@planningcenter/tapestry-react 1.1.0 → 1.4.0
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/dist/cjs/Button/Button.js +6 -1
- package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +25 -12
- package/dist/cjs/Field/Field.js +1 -0
- package/dist/cjs/Menu/Heading.js +3 -2
- package/dist/cjs/Menu/Item.js +5 -5
- package/dist/cjs/Page/PageActions.js +5 -0
- package/dist/cjs/Page/PageHeader.js +17 -21
- package/dist/cjs/Page/PageTab.js +11 -2
- package/dist/cjs/Page/PageTabList.js +5 -10
- package/dist/cjs/Page/PageTitle.js +3 -2
- package/dist/cjs/Page/PageToolbar.js +30 -6
- package/dist/esm/Button/Button.js +6 -1
- package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +23 -11
- package/dist/esm/Field/Field.js +1 -0
- package/dist/esm/Menu/Heading.js +3 -2
- package/dist/esm/Menu/Item.js +5 -5
- package/dist/esm/Page/PageActions.js +5 -0
- package/dist/esm/Page/PageHeader.js +17 -18
- package/dist/esm/Page/PageTab.js +10 -2
- package/dist/esm/Page/PageTabList.js +5 -8
- package/dist/esm/Page/PageTitle.js +3 -2
- package/dist/esm/Page/PageToolbar.js +28 -6
- package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +15 -1
- package/package.json +2 -2
- package/src/Button/Button.tsx +6 -1
- package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +18 -0
- package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +48 -16
- package/src/Field/Field.js +1 -0
- package/src/Menu/Heading.js +6 -1
- package/src/Menu/Item.js +5 -5
- package/src/Page/Page.mdx +56 -1
- package/src/Page/PageActions.js +12 -1
- package/src/Page/PageHeader.js +19 -25
- package/src/Page/PageTab.js +15 -1
- package/src/Page/PageTabList.js +10 -8
- package/src/Page/PageTitle.js +9 -1
- package/src/Page/PageToolbar.js +29 -6
|
@@ -68,6 +68,7 @@ function Button(_ref) {
|
|
|
68
68
|
|
|
69
69
|
var buttonProps = {
|
|
70
70
|
alignment: 'center',
|
|
71
|
+
as: restProps.href || to ? 'a' : 'div',
|
|
71
72
|
axis: 'horizontal',
|
|
72
73
|
distribution: 'center',
|
|
73
74
|
fontSize: fontSize,
|
|
@@ -79,7 +80,6 @@ function Button(_ref) {
|
|
|
79
80
|
role: 'button',
|
|
80
81
|
strokeAlign: 'inside',
|
|
81
82
|
strokeWeight: 1,
|
|
82
|
-
as: restProps.href || to ? 'a' : 'div',
|
|
83
83
|
userSelect: 'none',
|
|
84
84
|
zIndex: 1
|
|
85
85
|
};
|
|
@@ -227,6 +227,11 @@ function Button(_ref) {
|
|
|
227
227
|
zIndex: 2
|
|
228
228
|
}, buttonProps.hover)
|
|
229
229
|
});
|
|
230
|
+
} // pass to if as is defined
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
if (restProps.as) {
|
|
234
|
+
buttonProps.to = to;
|
|
230
235
|
}
|
|
231
236
|
|
|
232
237
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -30,7 +30,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
30
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
31
|
|
|
32
32
|
function ChurchCenterStatus(_ref) {
|
|
33
|
-
var _ref$
|
|
33
|
+
var _ref$buttonProps = _ref.buttonProps,
|
|
34
|
+
passedButtonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
35
|
+
_ref$ccAppEnabled = _ref.ccAppEnabled,
|
|
34
36
|
ccAppEnabled = _ref$ccAppEnabled === void 0 ? false : _ref$ccAppEnabled,
|
|
35
37
|
_ref$ccPublishingEnab = _ref.ccPublishingEnabled,
|
|
36
38
|
ccPublishingEnabled = _ref$ccPublishingEnab === void 0 ? false : _ref$ccPublishingEnab,
|
|
@@ -44,16 +46,23 @@ function ChurchCenterStatus(_ref) {
|
|
|
44
46
|
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
45
47
|
icons = _ref.icons,
|
|
46
48
|
productUrl = _ref.productUrl,
|
|
49
|
+
_ref$renderPopoverFoo = _ref.renderPopoverFooter,
|
|
50
|
+
renderPopoverFooter = _ref$renderPopoverFoo === void 0 ? function () {} : _ref$renderPopoverFoo,
|
|
47
51
|
settingsUrl = _ref.settingsUrl,
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
_ref$showSettingsLink = _ref.showSettingsLink,
|
|
53
|
+
showSettingsLink = _ref$showSettingsLink === void 0 ? true : _ref$showSettingsLink,
|
|
54
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["buttonProps", "ccAppEnabled", "ccPublishingEnabled", "ccWebEnabled", "description", "destinationLabel", "disabledDescription", "dropdownProps", "icons", "productUrl", "renderPopoverFooter", "settingsUrl", "showSettingsLink"]);
|
|
55
|
+
|
|
56
|
+
var buttonProps = _objectSpread({
|
|
50
57
|
distribution: 'start',
|
|
51
58
|
fontWeight: 400,
|
|
52
59
|
paddingHorizontal: 2,
|
|
53
60
|
radius: 0,
|
|
54
61
|
variant: 'naked'
|
|
55
|
-
};
|
|
62
|
+
}, passedButtonProps);
|
|
63
|
+
|
|
56
64
|
var ccEnabled = ccAppEnabled || ccWebEnabled;
|
|
65
|
+
var hasLinks = showSettingsLink || ccEnabled && ccPublishingEnabled || !!renderPopoverFooter();
|
|
57
66
|
|
|
58
67
|
var icon = _objectSpread({
|
|
59
68
|
check: 'checkmark',
|
|
@@ -113,19 +122,23 @@ function ChurchCenterStatus(_ref) {
|
|
|
113
122
|
}), /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
|
114
123
|
size: "14px",
|
|
115
124
|
weight: 700
|
|
116
|
-
}, "Mobile app")))), /*#__PURE__*/_react["default"].createElement(_Divider["default"], {
|
|
125
|
+
}, "Mobile app")))), hasLinks && /*#__PURE__*/_react["default"].createElement(_Divider["default"], {
|
|
117
126
|
margin: 0.5
|
|
118
|
-
}), /*#__PURE__*/_react["default"].createElement(_StackView["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
127
|
+
}), /*#__PURE__*/_react["default"].createElement(_StackView["default"], null, showSettingsLink && /*#__PURE__*/_react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
119
128
|
external: true,
|
|
120
129
|
title: "Update settings",
|
|
121
130
|
to: settingsUrl
|
|
122
131
|
}, buttonProps)), ccEnabled && ccPublishingEnabled && /*#__PURE__*/_react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
123
132
|
external: true,
|
|
133
|
+
iconRight: {
|
|
134
|
+
color: 'primary',
|
|
135
|
+
name: icon.external,
|
|
136
|
+
marginLeft: 1,
|
|
137
|
+
size: 'xs'
|
|
138
|
+
},
|
|
139
|
+
title: "Visit " + destinationLabel,
|
|
124
140
|
to: productUrl
|
|
125
|
-
}, buttonProps
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
marginLeft: 1,
|
|
129
|
-
size: "sm"
|
|
130
|
-
})))));
|
|
141
|
+
}, buttonProps, {
|
|
142
|
+
as: "a"
|
|
143
|
+
})), renderPopoverFooter(buttonProps))));
|
|
131
144
|
}
|
package/dist/cjs/Field/Field.js
CHANGED
|
@@ -103,6 +103,7 @@ var Field = /*#__PURE__*/function (_Component) {
|
|
|
103
103
|
order: inline ? 0 : 1,
|
|
104
104
|
grow: 1,
|
|
105
105
|
marginTop: inline || !label ? undefined : 1,
|
|
106
|
+
maxWidth: "100%",
|
|
106
107
|
spacing: spacing
|
|
107
108
|
}, (0, _utils.cloneChildren)(children, function (child, _ref) {
|
|
108
109
|
var firstChild = _ref.firstChild;
|
package/dist/cjs/Menu/Heading.js
CHANGED
|
@@ -17,8 +17,9 @@ function Heading(_ref) {
|
|
|
17
17
|
var children = _ref.children,
|
|
18
18
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["children"]);
|
|
19
19
|
return /*#__PURE__*/_react["default"].createElement(_HeadingUppercase["default"], (0, _extends2["default"])({
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
paddingBottom: 0.5,
|
|
21
|
+
paddingHorizontal: 2,
|
|
22
|
+
paddingTop: 1
|
|
22
23
|
}, restProps), children);
|
|
23
24
|
}
|
|
24
25
|
|
package/dist/cjs/Menu/Item.js
CHANGED
|
@@ -35,7 +35,7 @@ function Item(_ref) {
|
|
|
35
35
|
minHeight: 4,
|
|
36
36
|
fontSize: '14px',
|
|
37
37
|
paddingVertical: 0.75,
|
|
38
|
-
paddingHorizontal:
|
|
38
|
+
paddingHorizontal: 2,
|
|
39
39
|
whiteSpace: 'nowrap',
|
|
40
40
|
position: 'relative',
|
|
41
41
|
userSelect: 'none',
|
|
@@ -43,11 +43,11 @@ function Item(_ref) {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
if (renderLeft) {
|
|
46
|
-
css.paddingLeft =
|
|
46
|
+
css.paddingLeft = 5;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (renderRight) {
|
|
50
|
-
css.paddingRight =
|
|
50
|
+
css.paddingRight = 5;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (isHighlighted) {
|
|
@@ -69,7 +69,7 @@ function Item(_ref) {
|
|
|
69
69
|
height: "100%",
|
|
70
70
|
position: "absolute",
|
|
71
71
|
top: 0,
|
|
72
|
-
left:
|
|
72
|
+
left: 0.5
|
|
73
73
|
}, typeof renderLeft === 'function' ? renderRight() : /*#__PURE__*/(0, _react.cloneElement)(renderLeft, {
|
|
74
74
|
size: renderLeft.props && renderLeft.props.size || 'md'
|
|
75
75
|
})), children, renderRight && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
@@ -80,7 +80,7 @@ function Item(_ref) {
|
|
|
80
80
|
height: "100%",
|
|
81
81
|
position: "absolute",
|
|
82
82
|
top: 0,
|
|
83
|
-
right:
|
|
83
|
+
right: 0.5
|
|
84
84
|
}, typeof renderRight === 'function' ? renderRight() : /*#__PURE__*/(0, _react.cloneElement)(renderRight, {
|
|
85
85
|
size: renderRight.props && renderRight.props.size || 'md'
|
|
86
86
|
})));
|
|
@@ -13,7 +13,12 @@ var _StackView = _interopRequireDefault(require("../StackView"));
|
|
|
13
13
|
|
|
14
14
|
function PageActions(props) {
|
|
15
15
|
return /*#__PURE__*/_react["default"].createElement(_StackView["default"], (0, _extends2["default"])({
|
|
16
|
+
alignment: "center",
|
|
17
|
+
alignSelf: "end",
|
|
16
18
|
axis: "horizontal",
|
|
19
|
+
distribution: "end",
|
|
20
|
+
flex: "1",
|
|
21
|
+
paddingBottom: 2,
|
|
17
22
|
spacing: 1
|
|
18
23
|
}, props));
|
|
19
24
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
exports.__esModule = true;
|
|
@@ -11,37 +9,35 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
9
|
|
|
12
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
11
|
|
|
14
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
13
|
|
|
16
14
|
var _system = require("../system");
|
|
17
15
|
|
|
18
16
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
19
17
|
|
|
20
|
-
var _PageTabList = require("./PageTabList");
|
|
21
|
-
|
|
22
18
|
function PageHeader(_ref) {
|
|
23
19
|
var children = _ref.children,
|
|
24
20
|
toolbar = _ref.toolbar,
|
|
25
21
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["children", "toolbar"]);
|
|
26
22
|
var themeProps = (0, _system.useThemeValue)('pageHeader');
|
|
27
|
-
var tabsPresent = toolbar ? _react.Children.toArray(toolbar.props.children).some(function (child) {
|
|
28
|
-
return child && child.type.displayName === _PageTabList.PAGE_TABLIST_DISPLAY_NAME;
|
|
29
|
-
}) : false;
|
|
30
|
-
var childrenToRender = toolbar ? children ? _react.Children.toArray([/*#__PURE__*/_react["default"].createElement(_StackView["default"], {
|
|
31
|
-
axis: "horizontal",
|
|
32
|
-
alignment: "center",
|
|
33
|
-
width: "100%"
|
|
34
|
-
}, children), toolbar]) : toolbar : children;
|
|
35
23
|
return /*#__PURE__*/_react["default"].createElement(_StackView["default"], (0, _extends2["default"])({
|
|
36
24
|
as: "header",
|
|
37
|
-
axis:
|
|
38
|
-
|
|
39
|
-
paddingHorizontal:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
axis: "vertical",
|
|
26
|
+
backgroundColor: "primary-light",
|
|
27
|
+
paddingHorizontal: 2,
|
|
28
|
+
minHeight: 8,
|
|
29
|
+
mediaQueries: {
|
|
30
|
+
sm: {
|
|
31
|
+
paddingHorizontal: 3
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
spacing: 0
|
|
35
|
+
}, themeProps, restProps), children && /*#__PURE__*/_react["default"].createElement(_StackView["default"], {
|
|
36
|
+
alignment: "center",
|
|
37
|
+
axis: "horizontal",
|
|
38
|
+
paddingTop: 2,
|
|
39
|
+
width: "100%"
|
|
40
|
+
}, children), toolbar);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
var _default = PageHeader;
|
package/dist/cjs/Page/PageTab.js
CHANGED
|
@@ -11,10 +11,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _Tab = _interopRequireDefault(require("../Tab"));
|
|
13
13
|
|
|
14
|
+
var _system = require("../system");
|
|
15
|
+
|
|
14
16
|
function PageTab(props) {
|
|
15
|
-
|
|
17
|
+
var themeProps = (0, _system.useThemeValue)('pageTab');
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement(_Tab["default"], (0, _extends2["default"])({
|
|
19
|
+
mediaQueries: {
|
|
20
|
+
sm: {
|
|
21
|
+
paddingHorizontal: 3
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
paddingHorizontal: 1.5,
|
|
16
25
|
size: "lg"
|
|
17
|
-
}));
|
|
26
|
+
}, themeProps, props));
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
var _default = PageTab;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = PageTabList;
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
@@ -11,16 +11,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
13
13
|
|
|
14
|
-
var PAGE_TABLIST_DISPLAY_NAME = 'PageTabList';
|
|
15
|
-
exports.PAGE_TABLIST_DISPLAY_NAME = PAGE_TABLIST_DISPLAY_NAME;
|
|
16
|
-
|
|
17
14
|
function PageTabList(props) {
|
|
18
15
|
return /*#__PURE__*/_react["default"].createElement(_StackView["default"], (0, _extends2["default"])({
|
|
19
16
|
axis: "horizontal",
|
|
20
|
-
|
|
17
|
+
paddingTop: 2,
|
|
18
|
+
spacing: 0.5,
|
|
19
|
+
alignSelf: "end"
|
|
21
20
|
}, props));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
PageTabList.displayName = PAGE_TABLIST_DISPLAY_NAME;
|
|
25
|
-
var _default = PageTabList;
|
|
26
|
-
exports["default"] = _default;
|
|
21
|
+
}
|
|
@@ -16,8 +16,9 @@ var _Heading = _interopRequireDefault(require("../Heading"));
|
|
|
16
16
|
function PageTitle(props) {
|
|
17
17
|
var themeProps = (0, _system.useThemeValue)('pageTitle');
|
|
18
18
|
return /*#__PURE__*/_react["default"].createElement(_Heading["default"], (0, _extends2["default"])({
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
color: "white",
|
|
20
|
+
fontSize: "25px",
|
|
21
|
+
level: 2
|
|
21
22
|
}, themeProps, props));
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -5,18 +5,42 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
|
|
8
12
|
var _react = _interopRequireDefault(require("react"));
|
|
9
13
|
|
|
10
14
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
11
15
|
|
|
16
|
+
var _system = require("../system");
|
|
17
|
+
|
|
12
18
|
function PageToolbar(_ref) {
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
var _mediaQueries;
|
|
20
|
+
|
|
21
|
+
var stackBelow = _ref.stackBelow,
|
|
22
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["stackBelow"]);
|
|
23
|
+
var themeBreakpoints = (0, _system.useThemeValue)('breakpoints');
|
|
24
|
+
var breakpoint = Object.keys(themeBreakpoints).includes(stackBelow) ? stackBelow : 'sm';
|
|
25
|
+
var stackProps = stackBelow ? {
|
|
26
|
+
axis: 'vertical',
|
|
27
|
+
alignment: 'stretch',
|
|
28
|
+
spacing: 2,
|
|
29
|
+
mediaQueries: (_mediaQueries = {}, _mediaQueries[breakpoint] = {
|
|
30
|
+
axis: 'horizontal',
|
|
31
|
+
alignment: 'center',
|
|
32
|
+
paddingBottom: 0,
|
|
33
|
+
spacing: 0
|
|
34
|
+
}, _mediaQueries)
|
|
35
|
+
} : null;
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(_StackView["default"], (0, _extends2["default"])({
|
|
37
|
+
alignment: "center",
|
|
16
38
|
axis: "horizontal",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
distribution: "space-between",
|
|
40
|
+
flex: 1,
|
|
41
|
+
spacing: 2,
|
|
42
|
+
width: "100%"
|
|
43
|
+
}, stackProps, restProps));
|
|
20
44
|
}
|
|
21
45
|
|
|
22
46
|
var _default = PageToolbar;
|
|
@@ -61,6 +61,7 @@ export function Button(_ref) {
|
|
|
61
61
|
|
|
62
62
|
var buttonProps = {
|
|
63
63
|
alignment: 'center',
|
|
64
|
+
as: restProps.href || to ? 'a' : 'div',
|
|
64
65
|
axis: 'horizontal',
|
|
65
66
|
distribution: 'center',
|
|
66
67
|
fontSize: fontSize,
|
|
@@ -72,7 +73,6 @@ export function Button(_ref) {
|
|
|
72
73
|
role: 'button',
|
|
73
74
|
strokeAlign: 'inside',
|
|
74
75
|
strokeWeight: 1,
|
|
75
|
-
as: restProps.href || to ? 'a' : 'div',
|
|
76
76
|
userSelect: 'none',
|
|
77
77
|
zIndex: 1
|
|
78
78
|
};
|
|
@@ -220,6 +220,11 @@ export function Button(_ref) {
|
|
|
220
220
|
zIndex: 2
|
|
221
221
|
}, buttonProps.hover)
|
|
222
222
|
});
|
|
223
|
+
} // pass to if as is defined
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
if (restProps.as) {
|
|
227
|
+
buttonProps.to = to;
|
|
223
228
|
}
|
|
224
229
|
|
|
225
230
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -33,7 +33,9 @@ var _ref6 = /*#__PURE__*/React.createElement(Divider, {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
export function ChurchCenterStatus(_ref) {
|
|
36
|
-
var _ref$
|
|
36
|
+
var _ref$buttonProps = _ref.buttonProps,
|
|
37
|
+
passedButtonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
38
|
+
_ref$ccAppEnabled = _ref.ccAppEnabled,
|
|
37
39
|
ccAppEnabled = _ref$ccAppEnabled === void 0 ? false : _ref$ccAppEnabled,
|
|
38
40
|
_ref$ccPublishingEnab = _ref.ccPublishingEnabled,
|
|
39
41
|
ccPublishingEnabled = _ref$ccPublishingEnab === void 0 ? false : _ref$ccPublishingEnab,
|
|
@@ -47,17 +49,23 @@ export function ChurchCenterStatus(_ref) {
|
|
|
47
49
|
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
48
50
|
icons = _ref.icons,
|
|
49
51
|
productUrl = _ref.productUrl,
|
|
52
|
+
_ref$renderPopoverFoo = _ref.renderPopoverFooter,
|
|
53
|
+
renderPopoverFooter = _ref$renderPopoverFoo === void 0 ? function () {} : _ref$renderPopoverFoo,
|
|
50
54
|
settingsUrl = _ref.settingsUrl,
|
|
51
|
-
|
|
55
|
+
_ref$showSettingsLink = _ref.showSettingsLink,
|
|
56
|
+
showSettingsLink = _ref$showSettingsLink === void 0 ? true : _ref$showSettingsLink,
|
|
57
|
+
props = _objectWithoutPropertiesLoose(_ref, ["buttonProps", "ccAppEnabled", "ccPublishingEnabled", "ccWebEnabled", "description", "destinationLabel", "disabledDescription", "dropdownProps", "icons", "productUrl", "renderPopoverFooter", "settingsUrl", "showSettingsLink"]);
|
|
52
58
|
|
|
53
|
-
var buttonProps = {
|
|
59
|
+
var buttonProps = _objectSpread({
|
|
54
60
|
distribution: 'start',
|
|
55
61
|
fontWeight: 400,
|
|
56
62
|
paddingHorizontal: 2,
|
|
57
63
|
radius: 0,
|
|
58
64
|
variant: 'naked'
|
|
59
|
-
};
|
|
65
|
+
}, passedButtonProps);
|
|
66
|
+
|
|
60
67
|
var ccEnabled = ccAppEnabled || ccWebEnabled;
|
|
68
|
+
var hasLinks = showSettingsLink || ccEnabled && ccPublishingEnabled || !!renderPopoverFooter();
|
|
61
69
|
|
|
62
70
|
var icon = _objectSpread({
|
|
63
71
|
check: 'checkmark',
|
|
@@ -111,17 +119,21 @@ export function ChurchCenterStatus(_ref) {
|
|
|
111
119
|
color: ccAppEnabled ? 'success' : 'error',
|
|
112
120
|
name: ccAppEnabled ? icon.check : icon.x,
|
|
113
121
|
size: "sm"
|
|
114
|
-
}), _ref5))), _ref6, /*#__PURE__*/React.createElement(StackView, null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
122
|
+
}), _ref5))), hasLinks && _ref6, /*#__PURE__*/React.createElement(StackView, null, showSettingsLink && /*#__PURE__*/React.createElement(Button, _extends({
|
|
115
123
|
external: true,
|
|
116
124
|
title: "Update settings",
|
|
117
125
|
to: settingsUrl
|
|
118
126
|
}, buttonProps)), ccEnabled && ccPublishingEnabled && /*#__PURE__*/React.createElement(Button, _extends({
|
|
119
127
|
external: true,
|
|
128
|
+
iconRight: {
|
|
129
|
+
color: 'primary',
|
|
130
|
+
name: icon.external,
|
|
131
|
+
marginLeft: 1,
|
|
132
|
+
size: 'xs'
|
|
133
|
+
},
|
|
134
|
+
title: "Visit " + destinationLabel,
|
|
120
135
|
to: productUrl
|
|
121
|
-
}, buttonProps
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
marginLeft: 1,
|
|
125
|
-
size: "sm"
|
|
126
|
-
})))));
|
|
136
|
+
}, buttonProps, {
|
|
137
|
+
as: "a"
|
|
138
|
+
})), renderPopoverFooter(buttonProps))));
|
|
127
139
|
}
|
package/dist/esm/Field/Field.js
CHANGED
|
@@ -87,6 +87,7 @@ var Field = /*#__PURE__*/function (_Component) {
|
|
|
87
87
|
order: inline ? 0 : 1,
|
|
88
88
|
grow: 1,
|
|
89
89
|
marginTop: inline || !label ? undefined : 1,
|
|
90
|
+
maxWidth: "100%",
|
|
90
91
|
spacing: spacing
|
|
91
92
|
}, cloneChildren(children, function (child, _ref) {
|
|
92
93
|
var firstChild = _ref.firstChild;
|
package/dist/esm/Menu/Heading.js
CHANGED
|
@@ -8,8 +8,9 @@ function Heading(_ref) {
|
|
|
8
8
|
restProps = _objectWithoutPropertiesLoose(_ref, ["children"]);
|
|
9
9
|
|
|
10
10
|
return /*#__PURE__*/React.createElement(HeadingUppercase, _extends({
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
paddingBottom: 0.5,
|
|
12
|
+
paddingHorizontal: 2,
|
|
13
|
+
paddingTop: 1
|
|
13
14
|
}, restProps), children);
|
|
14
15
|
}
|
|
15
16
|
|
package/dist/esm/Menu/Item.js
CHANGED
|
@@ -23,7 +23,7 @@ function Item(_ref) {
|
|
|
23
23
|
minHeight: 4,
|
|
24
24
|
fontSize: '14px',
|
|
25
25
|
paddingVertical: 0.75,
|
|
26
|
-
paddingHorizontal:
|
|
26
|
+
paddingHorizontal: 2,
|
|
27
27
|
whiteSpace: 'nowrap',
|
|
28
28
|
position: 'relative',
|
|
29
29
|
userSelect: 'none',
|
|
@@ -31,11 +31,11 @@ function Item(_ref) {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
if (renderLeft) {
|
|
34
|
-
css.paddingLeft =
|
|
34
|
+
css.paddingLeft = 5;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
if (renderRight) {
|
|
38
|
-
css.paddingRight =
|
|
38
|
+
css.paddingRight = 5;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (isHighlighted) {
|
|
@@ -57,7 +57,7 @@ function Item(_ref) {
|
|
|
57
57
|
height: "100%",
|
|
58
58
|
position: "absolute",
|
|
59
59
|
top: 0,
|
|
60
|
-
left:
|
|
60
|
+
left: 0.5
|
|
61
61
|
}, typeof renderLeft === 'function' ? renderRight() : /*#__PURE__*/cloneElement(renderLeft, {
|
|
62
62
|
size: renderLeft.props && renderLeft.props.size || 'md'
|
|
63
63
|
})), children, renderRight && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -68,7 +68,7 @@ function Item(_ref) {
|
|
|
68
68
|
height: "100%",
|
|
69
69
|
position: "absolute",
|
|
70
70
|
top: 0,
|
|
71
|
-
right:
|
|
71
|
+
right: 0.5
|
|
72
72
|
}, typeof renderRight === 'function' ? renderRight() : /*#__PURE__*/cloneElement(renderRight, {
|
|
73
73
|
size: renderRight.props && renderRight.props.size || 'md'
|
|
74
74
|
})));
|
|
@@ -4,7 +4,12 @@ import StackView from '../StackView';
|
|
|
4
4
|
|
|
5
5
|
function PageActions(props) {
|
|
6
6
|
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
7
|
+
alignment: "center",
|
|
8
|
+
alignSelf: "end",
|
|
7
9
|
axis: "horizontal",
|
|
10
|
+
distribution: "end",
|
|
11
|
+
flex: "1",
|
|
12
|
+
paddingBottom: 2,
|
|
8
13
|
spacing: 1
|
|
9
14
|
}, props));
|
|
10
15
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { useThemeValue } from '../system';
|
|
5
5
|
import StackView from '../StackView';
|
|
6
|
-
import { PAGE_TABLIST_DISPLAY_NAME } from './PageTabList';
|
|
7
6
|
|
|
8
7
|
function PageHeader(_ref) {
|
|
9
8
|
var children = _ref.children,
|
|
@@ -11,24 +10,24 @@ function PageHeader(_ref) {
|
|
|
11
10
|
restProps = _objectWithoutPropertiesLoose(_ref, ["children", "toolbar"]);
|
|
12
11
|
|
|
13
12
|
var themeProps = useThemeValue('pageHeader');
|
|
14
|
-
var tabsPresent = toolbar ? Children.toArray(toolbar.props.children).some(function (child) {
|
|
15
|
-
return child && child.type.displayName === PAGE_TABLIST_DISPLAY_NAME;
|
|
16
|
-
}) : false;
|
|
17
|
-
var childrenToRender = toolbar ? children ? Children.toArray([/*#__PURE__*/React.createElement(StackView, {
|
|
18
|
-
axis: "horizontal",
|
|
19
|
-
alignment: "center",
|
|
20
|
-
width: "100%"
|
|
21
|
-
}, children), toolbar]) : toolbar : children;
|
|
22
13
|
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
23
14
|
as: "header",
|
|
24
|
-
axis:
|
|
25
|
-
|
|
26
|
-
paddingHorizontal:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
axis: "vertical",
|
|
16
|
+
backgroundColor: "primary-light",
|
|
17
|
+
paddingHorizontal: 2,
|
|
18
|
+
minHeight: 8,
|
|
19
|
+
mediaQueries: {
|
|
20
|
+
sm: {
|
|
21
|
+
paddingHorizontal: 3
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
spacing: 0
|
|
25
|
+
}, themeProps, restProps), children && /*#__PURE__*/React.createElement(StackView, {
|
|
26
|
+
alignment: "center",
|
|
27
|
+
axis: "horizontal",
|
|
28
|
+
paddingTop: 2,
|
|
29
|
+
width: "100%"
|
|
30
|
+
}, children), toolbar);
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export default PageHeader;
|
package/dist/esm/Page/PageTab.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Tab from '../Tab';
|
|
4
|
+
import { useThemeValue } from '../system';
|
|
4
5
|
|
|
5
6
|
function PageTab(props) {
|
|
6
|
-
|
|
7
|
+
var themeProps = useThemeValue('pageTab');
|
|
8
|
+
return /*#__PURE__*/React.createElement(Tab, _extends({
|
|
9
|
+
mediaQueries: {
|
|
10
|
+
sm: {
|
|
11
|
+
paddingHorizontal: 3
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
paddingHorizontal: 1.5,
|
|
7
15
|
size: "lg"
|
|
8
|
-
}));
|
|
16
|
+
}, themeProps, props));
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
export default PageTab;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import StackView from '../StackView';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
function PageTabList(props) {
|
|
4
|
+
export default function PageTabList(props) {
|
|
7
5
|
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
8
6
|
axis: "horizontal",
|
|
9
|
-
|
|
7
|
+
paddingTop: 2,
|
|
8
|
+
spacing: 0.5,
|
|
9
|
+
alignSelf: "end"
|
|
10
10
|
}, props));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
PageTabList.displayName = PAGE_TABLIST_DISPLAY_NAME;
|
|
14
|
-
export default PageTabList;
|
|
11
|
+
}
|
|
@@ -6,8 +6,9 @@ import Heading from '../Heading';
|
|
|
6
6
|
function PageTitle(props) {
|
|
7
7
|
var themeProps = useThemeValue('pageTitle');
|
|
8
8
|
return /*#__PURE__*/React.createElement(Heading, _extends({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
color: "white",
|
|
10
|
+
fontSize: "25px",
|
|
11
|
+
level: 2
|
|
11
12
|
}, themeProps, props));
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -1,14 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import StackView from '../StackView';
|
|
5
|
+
import { useThemeValue } from '../system';
|
|
3
6
|
|
|
4
7
|
function PageToolbar(_ref) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var _mediaQueries;
|
|
9
|
+
|
|
10
|
+
var stackBelow = _ref.stackBelow,
|
|
11
|
+
restProps = _objectWithoutPropertiesLoose(_ref, ["stackBelow"]);
|
|
12
|
+
|
|
13
|
+
var themeBreakpoints = useThemeValue('breakpoints');
|
|
14
|
+
var breakpoint = Object.keys(themeBreakpoints).includes(stackBelow) ? stackBelow : 'sm';
|
|
15
|
+
var stackProps = stackBelow ? {
|
|
16
|
+
axis: 'vertical',
|
|
17
|
+
alignment: 'stretch',
|
|
18
|
+
spacing: 2,
|
|
19
|
+
mediaQueries: (_mediaQueries = {}, _mediaQueries[breakpoint] = {
|
|
20
|
+
axis: 'horizontal',
|
|
21
|
+
alignment: 'center',
|
|
22
|
+
paddingBottom: 0,
|
|
23
|
+
spacing: 0
|
|
24
|
+
}, _mediaQueries)
|
|
25
|
+
} : null;
|
|
26
|
+
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
27
|
+
alignment: "center",
|
|
8
28
|
axis: "horizontal",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
distribution: "space-between",
|
|
30
|
+
flex: 1,
|
|
31
|
+
spacing: 2,
|
|
32
|
+
width: "100%"
|
|
33
|
+
}, stackProps, restProps));
|
|
12
34
|
}
|
|
13
35
|
|
|
14
36
|
export default PageToolbar;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type ChurchCenterStatusProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Pass props to the Dropdown buttons.
|
|
5
|
+
*/
|
|
6
|
+
buttonProps?: object;
|
|
3
7
|
/**
|
|
4
8
|
* Determines status of Church Center App.
|
|
5
9
|
*/
|
|
@@ -36,10 +40,20 @@ declare type ChurchCenterStatusProps = {
|
|
|
36
40
|
* Where the browser should navigate when destination button is pressed.
|
|
37
41
|
*/
|
|
38
42
|
productUrl: string;
|
|
43
|
+
/**
|
|
44
|
+
* Render nodes at the end of the popover. `buttonProps` is passed as an argument
|
|
45
|
+
* and can be spread on any `<Button />` component to match the style of the other
|
|
46
|
+
* popover links.
|
|
47
|
+
*/
|
|
48
|
+
renderPopoverFooter: Function;
|
|
39
49
|
/**
|
|
40
50
|
* Where the browser should navigate when settings button is pressed.
|
|
41
51
|
*/
|
|
42
52
|
settingsUrl: string;
|
|
53
|
+
/**
|
|
54
|
+
* Toggle the settings link display.
|
|
55
|
+
*/
|
|
56
|
+
showSettingsLink?: boolean;
|
|
43
57
|
};
|
|
44
|
-
export declare function ChurchCenterStatus({ ccAppEnabled, ccPublishingEnabled, ccWebEnabled, description, destinationLabel, disabledDescription, dropdownProps, icons, productUrl, settingsUrl, ...props }: ChurchCenterStatusProps): JSX.Element;
|
|
58
|
+
export declare function ChurchCenterStatus({ buttonProps: passedButtonProps, ccAppEnabled, ccPublishingEnabled, ccWebEnabled, description, destinationLabel, disabledDescription, dropdownProps, icons, productUrl, renderPopoverFooter, settingsUrl, showSettingsLink, ...props }: ChurchCenterStatusProps): JSX.Element;
|
|
45
59
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
|
|
5
5
|
"author": "Front End Systems Engineering <frontend@pco.bz>",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@popmotion/popcorn": "^0.4.4",
|
|
93
|
-
"@popperjs/core": "
|
|
93
|
+
"@popperjs/core": "~2.9.0",
|
|
94
94
|
"@testing-library/jest-dom": "^5.11.9",
|
|
95
95
|
"@testing-library/user-event": "^13.1.9",
|
|
96
96
|
"camel-to-kebab": "^1.1.0",
|
package/src/Button/Button.tsx
CHANGED
|
@@ -116,6 +116,7 @@ export function Button({
|
|
|
116
116
|
|
|
117
117
|
let buttonProps: any = {
|
|
118
118
|
alignment: 'center',
|
|
119
|
+
as: (restProps as any).href || to ? 'a' : 'div',
|
|
119
120
|
axis: 'horizontal',
|
|
120
121
|
distribution: 'center',
|
|
121
122
|
fontSize,
|
|
@@ -127,7 +128,6 @@ export function Button({
|
|
|
127
128
|
role: 'button',
|
|
128
129
|
strokeAlign: 'inside',
|
|
129
130
|
strokeWeight: 1,
|
|
130
|
-
as: (restProps as any).href || to ? 'a' : 'div',
|
|
131
131
|
userSelect: 'none',
|
|
132
132
|
zIndex: 1,
|
|
133
133
|
}
|
|
@@ -271,6 +271,11 @@ export function Button({
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// pass to if as is defined
|
|
275
|
+
if ((restProps as any).as) {
|
|
276
|
+
buttonProps.to = to
|
|
277
|
+
}
|
|
278
|
+
|
|
274
279
|
if (process.env.NODE_ENV !== 'production') {
|
|
275
280
|
if (icon && !(title || (tooltip && (tooltip as any).title))) {
|
|
276
281
|
const { tooltipProps, wrapperProps } = useAccessibilityViolation(
|
|
@@ -59,6 +59,24 @@ render(
|
|
|
59
59
|
)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
```jsx live
|
|
63
|
+
render(
|
|
64
|
+
<ChurchCenterStatus
|
|
65
|
+
ccAppEnabled
|
|
66
|
+
ccPublishingEnabled={false}
|
|
67
|
+
ccWebEnabled
|
|
68
|
+
description="On Church Center, people can browse and register for events."
|
|
69
|
+
destinationLabel="event list"
|
|
70
|
+
productUrl="#product"
|
|
71
|
+
renderPopoverFooter={(buttonProps) => (
|
|
72
|
+
<Button title="Another link!" {...buttonProps} />
|
|
73
|
+
)}
|
|
74
|
+
settingsUrl="#settings"
|
|
75
|
+
showSettingsLink={false}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
```
|
|
79
|
+
|
|
62
80
|
## Custom icons
|
|
63
81
|
|
|
64
82
|
To use the Planning Center General set of icons, import the general set to your theme and define the overrides with the `icons` prop.
|
|
@@ -8,6 +8,11 @@ import StackView from '../StackView'
|
|
|
8
8
|
import Text from '../Text'
|
|
9
9
|
|
|
10
10
|
type ChurchCenterStatusProps = {
|
|
11
|
+
/**
|
|
12
|
+
* Pass props to the Dropdown buttons.
|
|
13
|
+
*/
|
|
14
|
+
buttonProps?: object
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* Determines status of Church Center App.
|
|
13
18
|
*/
|
|
@@ -53,13 +58,26 @@ type ChurchCenterStatusProps = {
|
|
|
53
58
|
*/
|
|
54
59
|
productUrl: string
|
|
55
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Render nodes at the end of the popover. `buttonProps` is passed as an argument
|
|
63
|
+
* and can be spread on any `<Button />` component to match the style of the other
|
|
64
|
+
* popover links.
|
|
65
|
+
*/
|
|
66
|
+
renderPopoverFooter: Function
|
|
67
|
+
|
|
56
68
|
/**
|
|
57
69
|
* Where the browser should navigate when settings button is pressed.
|
|
58
70
|
*/
|
|
59
71
|
settingsUrl: string
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Toggle the settings link display.
|
|
75
|
+
*/
|
|
76
|
+
showSettingsLink?: boolean
|
|
60
77
|
}
|
|
61
78
|
|
|
62
79
|
export function ChurchCenterStatus({
|
|
80
|
+
buttonProps: passedButtonProps = {},
|
|
63
81
|
ccAppEnabled = false,
|
|
64
82
|
ccPublishingEnabled = false,
|
|
65
83
|
ccWebEnabled = false,
|
|
@@ -69,7 +87,9 @@ export function ChurchCenterStatus({
|
|
|
69
87
|
dropdownProps = {},
|
|
70
88
|
icons,
|
|
71
89
|
productUrl,
|
|
90
|
+
renderPopoverFooter = () => {},
|
|
72
91
|
settingsUrl,
|
|
92
|
+
showSettingsLink = true,
|
|
73
93
|
...props
|
|
74
94
|
}: ChurchCenterStatusProps) {
|
|
75
95
|
const buttonProps: any = {
|
|
@@ -78,9 +98,14 @@ export function ChurchCenterStatus({
|
|
|
78
98
|
paddingHorizontal: 2,
|
|
79
99
|
radius: 0,
|
|
80
100
|
variant: 'naked',
|
|
101
|
+
...passedButtonProps,
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
const ccEnabled = ccAppEnabled || ccWebEnabled
|
|
105
|
+
const hasLinks =
|
|
106
|
+
showSettingsLink ||
|
|
107
|
+
(ccEnabled && ccPublishingEnabled) ||
|
|
108
|
+
!!renderPopoverFooter()
|
|
84
109
|
|
|
85
110
|
const icon = {
|
|
86
111
|
check: 'checkmark',
|
|
@@ -142,25 +167,32 @@ export function ChurchCenterStatus({
|
|
|
142
167
|
</StackView>
|
|
143
168
|
)}
|
|
144
169
|
</StackView>
|
|
145
|
-
<Divider margin={0.5} />
|
|
170
|
+
{hasLinks && <Divider margin={0.5} />}
|
|
146
171
|
<StackView>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
172
|
+
{showSettingsLink && (
|
|
173
|
+
<Button
|
|
174
|
+
external
|
|
175
|
+
title="Update settings"
|
|
176
|
+
to={settingsUrl}
|
|
177
|
+
{...buttonProps}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
153
180
|
{ccEnabled && ccPublishingEnabled && (
|
|
154
|
-
<Button
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
color
|
|
158
|
-
name
|
|
159
|
-
marginLeft
|
|
160
|
-
size
|
|
161
|
-
|
|
162
|
-
|
|
181
|
+
<Button
|
|
182
|
+
external
|
|
183
|
+
iconRight={{
|
|
184
|
+
color: 'primary',
|
|
185
|
+
name: icon.external,
|
|
186
|
+
marginLeft: 1,
|
|
187
|
+
size: 'xs',
|
|
188
|
+
}}
|
|
189
|
+
title={`Visit ${destinationLabel}`}
|
|
190
|
+
to={productUrl}
|
|
191
|
+
{...buttonProps}
|
|
192
|
+
as="a"
|
|
193
|
+
/>
|
|
163
194
|
)}
|
|
195
|
+
{renderPopoverFooter(buttonProps)}
|
|
164
196
|
</StackView>
|
|
165
197
|
</Dropdown>
|
|
166
198
|
</StackView>
|
package/src/Field/Field.js
CHANGED
package/src/Menu/Heading.js
CHANGED
|
@@ -4,7 +4,12 @@ import HeadingUppercase from '../HeadingUppercase'
|
|
|
4
4
|
|
|
5
5
|
function Heading({ children, ...restProps }) {
|
|
6
6
|
return (
|
|
7
|
-
<HeadingUppercase
|
|
7
|
+
<HeadingUppercase
|
|
8
|
+
paddingBottom={0.5}
|
|
9
|
+
paddingHorizontal={2}
|
|
10
|
+
paddingTop={1}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
8
13
|
{children}
|
|
9
14
|
</HeadingUppercase>
|
|
10
15
|
)
|
package/src/Menu/Item.js
CHANGED
|
@@ -20,7 +20,7 @@ function Item({
|
|
|
20
20
|
minHeight: 4,
|
|
21
21
|
fontSize: '14px',
|
|
22
22
|
paddingVertical: 0.75,
|
|
23
|
-
paddingHorizontal:
|
|
23
|
+
paddingHorizontal: 2,
|
|
24
24
|
whiteSpace: 'nowrap',
|
|
25
25
|
position: 'relative',
|
|
26
26
|
userSelect: 'none',
|
|
@@ -28,11 +28,11 @@ function Item({
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (renderLeft) {
|
|
31
|
-
css.paddingLeft =
|
|
31
|
+
css.paddingLeft = 5
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (renderRight) {
|
|
35
|
-
css.paddingRight =
|
|
35
|
+
css.paddingRight = 5
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (isHighlighted) {
|
|
@@ -62,7 +62,7 @@ function Item({
|
|
|
62
62
|
height="100%"
|
|
63
63
|
position="absolute"
|
|
64
64
|
top={0}
|
|
65
|
-
left=
|
|
65
|
+
left={0.5}
|
|
66
66
|
>
|
|
67
67
|
{typeof renderLeft === 'function'
|
|
68
68
|
? renderRight()
|
|
@@ -83,7 +83,7 @@ function Item({
|
|
|
83
83
|
height="100%"
|
|
84
84
|
position="absolute"
|
|
85
85
|
top={0}
|
|
86
|
-
right=
|
|
86
|
+
right={0.5}
|
|
87
87
|
>
|
|
88
88
|
{typeof renderRight === 'function'
|
|
89
89
|
? renderRight()
|
package/src/Page/Page.mdx
CHANGED
|
@@ -4,6 +4,27 @@ category: General
|
|
|
4
4
|
summary: Page specific components.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
```jsx live
|
|
8
|
+
render(
|
|
9
|
+
<Box width="100%">
|
|
10
|
+
<PageHeader>
|
|
11
|
+
<PageTitle>People</PageTitle>
|
|
12
|
+
</PageHeader>
|
|
13
|
+
<PageBody
|
|
14
|
+
sidebar={
|
|
15
|
+
<Sidebar grow={0}>
|
|
16
|
+
<Sidebar.Item active>Item 1</Sidebar.Item>
|
|
17
|
+
<Sidebar.Item>Item 2</Sidebar.Item>
|
|
18
|
+
<Sidebar.Item>Item 3</Sidebar.Item>
|
|
19
|
+
</Sidebar>
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
|
+
Regular body
|
|
23
|
+
</PageBody>
|
|
24
|
+
</Box>
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
7
28
|
```jsx live
|
|
8
29
|
render(
|
|
9
30
|
<Box width="100%">
|
|
@@ -33,6 +54,40 @@ render(
|
|
|
33
54
|
)
|
|
34
55
|
```
|
|
35
56
|
|
|
57
|
+
```jsx live
|
|
58
|
+
render(
|
|
59
|
+
<Box width="100%">
|
|
60
|
+
<PageHeader
|
|
61
|
+
toolbar={
|
|
62
|
+
<PageToolbar>
|
|
63
|
+
<PageTabList>
|
|
64
|
+
<PageTab active>My Schedule</PageTab>
|
|
65
|
+
<PageTab>All Plans</PageTab>
|
|
66
|
+
</PageTabList>
|
|
67
|
+
<PageActions>
|
|
68
|
+
<PageButton title="One" />
|
|
69
|
+
<PageButton title="Two" />
|
|
70
|
+
</PageActions>
|
|
71
|
+
</PageToolbar>
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<PageTitle>People</PageTitle>
|
|
75
|
+
</PageHeader>
|
|
76
|
+
<PageBody
|
|
77
|
+
sidebar={
|
|
78
|
+
<Sidebar grow={0}>
|
|
79
|
+
<Sidebar.Item active>Item 1</Sidebar.Item>
|
|
80
|
+
<Sidebar.Item>Item 2</Sidebar.Item>
|
|
81
|
+
<Sidebar.Item>Item 3</Sidebar.Item>
|
|
82
|
+
</Sidebar>
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
Regular body
|
|
86
|
+
</PageBody>
|
|
87
|
+
</Box>
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
36
91
|
```jsx live
|
|
37
92
|
render(
|
|
38
93
|
<Box width="100%">
|
|
@@ -74,7 +129,7 @@ render(
|
|
|
74
129
|
|
|
75
130
|
## Theming
|
|
76
131
|
|
|
77
|
-
Use theme keys `pageBody`, `pageButton`, `pageDropdown`, and `pageTitle` to override `Page` component props.
|
|
132
|
+
Use theme keys `pageBody`, `pageButton`, `pageDropdown`, `pageHeader`, and `pageTitle` to override `Page` component props.
|
|
78
133
|
|
|
79
134
|
```jsx live
|
|
80
135
|
render(
|
package/src/Page/PageActions.js
CHANGED
|
@@ -3,7 +3,18 @@ import React from 'react'
|
|
|
3
3
|
import StackView from '../StackView'
|
|
4
4
|
|
|
5
5
|
function PageActions(props) {
|
|
6
|
-
return
|
|
6
|
+
return (
|
|
7
|
+
<StackView
|
|
8
|
+
alignment="center"
|
|
9
|
+
alignSelf="end"
|
|
10
|
+
axis="horizontal"
|
|
11
|
+
distribution="end"
|
|
12
|
+
flex="1"
|
|
13
|
+
paddingBottom={2}
|
|
14
|
+
spacing={1}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
7
18
|
}
|
|
8
19
|
|
|
9
20
|
export default PageActions
|
package/src/Page/PageHeader.js
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { useThemeValue } from '../system'
|
|
4
4
|
import StackView from '../StackView'
|
|
5
5
|
|
|
6
|
-
import { PAGE_TABLIST_DISPLAY_NAME } from './PageTabList'
|
|
7
|
-
|
|
8
6
|
function PageHeader({ children, toolbar, ...restProps }) {
|
|
9
7
|
const themeProps = useThemeValue('pageHeader')
|
|
10
|
-
const tabsPresent = toolbar
|
|
11
|
-
? Children.toArray(toolbar.props.children).some(
|
|
12
|
-
(child) => child && child.type.displayName === PAGE_TABLIST_DISPLAY_NAME
|
|
13
|
-
)
|
|
14
|
-
: false
|
|
15
|
-
const childrenToRender = toolbar
|
|
16
|
-
? children
|
|
17
|
-
? Children.toArray([
|
|
18
|
-
<StackView axis="horizontal" alignment="center" width="100%">
|
|
19
|
-
{children}
|
|
20
|
-
</StackView>,
|
|
21
|
-
toolbar,
|
|
22
|
-
])
|
|
23
|
-
: toolbar
|
|
24
|
-
: children
|
|
25
8
|
return (
|
|
26
9
|
<StackView
|
|
27
10
|
as="header"
|
|
28
|
-
axis=
|
|
29
|
-
alignment={children && toolbar ? 'start' : 'center'}
|
|
30
|
-
paddingHorizontal={3}
|
|
31
|
-
paddingTop={1.5}
|
|
32
|
-
paddingBottom={tabsPresent ? null : 1.5}
|
|
33
|
-
spacing={1.5}
|
|
11
|
+
axis="vertical"
|
|
34
12
|
backgroundColor="primary-light"
|
|
13
|
+
paddingHorizontal={2}
|
|
14
|
+
minHeight={8}
|
|
15
|
+
mediaQueries={{
|
|
16
|
+
sm: { paddingHorizontal: 3 },
|
|
17
|
+
}}
|
|
18
|
+
spacing={0}
|
|
35
19
|
{...themeProps}
|
|
36
20
|
{...restProps}
|
|
37
21
|
>
|
|
38
|
-
{
|
|
22
|
+
{children && (
|
|
23
|
+
<StackView
|
|
24
|
+
alignment="center"
|
|
25
|
+
axis="horizontal"
|
|
26
|
+
paddingTop={2}
|
|
27
|
+
width="100%"
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</StackView>
|
|
31
|
+
)}
|
|
32
|
+
{toolbar}
|
|
39
33
|
</StackView>
|
|
40
34
|
)
|
|
41
35
|
}
|
package/src/Page/PageTab.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Tab from '../Tab'
|
|
4
|
+
import { useThemeValue } from '../system'
|
|
4
5
|
|
|
5
6
|
function PageTab(props) {
|
|
6
|
-
|
|
7
|
+
const themeProps = useThemeValue('pageTab')
|
|
8
|
+
return (
|
|
9
|
+
<Tab
|
|
10
|
+
mediaQueries={{
|
|
11
|
+
sm: {
|
|
12
|
+
paddingHorizontal: 3,
|
|
13
|
+
},
|
|
14
|
+
}}
|
|
15
|
+
paddingHorizontal={1.5}
|
|
16
|
+
size="lg"
|
|
17
|
+
{...themeProps}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
7
21
|
}
|
|
8
22
|
|
|
9
23
|
export default PageTab
|
package/src/Page/PageTabList.js
CHANGED
|
@@ -2,12 +2,14 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import StackView from '../StackView'
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export default function PageTabList(props) {
|
|
6
|
+
return (
|
|
7
|
+
<StackView
|
|
8
|
+
axis="horizontal"
|
|
9
|
+
paddingTop={2}
|
|
10
|
+
spacing={0.5}
|
|
11
|
+
alignSelf="end"
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
PageTabList.displayName = PAGE_TABLIST_DISPLAY_NAME
|
|
12
|
-
|
|
13
|
-
export default PageTabList
|
package/src/Page/PageTitle.js
CHANGED
|
@@ -5,7 +5,15 @@ import Heading from '../Heading'
|
|
|
5
5
|
|
|
6
6
|
function PageTitle(props) {
|
|
7
7
|
const themeProps = useThemeValue('pageTitle')
|
|
8
|
-
return
|
|
8
|
+
return (
|
|
9
|
+
<Heading
|
|
10
|
+
color="white"
|
|
11
|
+
fontSize="25px"
|
|
12
|
+
level={2}
|
|
13
|
+
{...themeProps}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
export default PageTitle
|
package/src/Page/PageToolbar.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import StackView from '../StackView'
|
|
4
|
+
import { useThemeValue } from '../system'
|
|
5
|
+
|
|
6
|
+
function PageToolbar({ stackBelow, ...restProps }) {
|
|
7
|
+
const themeBreakpoints = useThemeValue('breakpoints')
|
|
8
|
+
const breakpoint = Object.keys(themeBreakpoints).includes(stackBelow)
|
|
9
|
+
? stackBelow
|
|
10
|
+
: 'sm'
|
|
11
|
+
const stackProps = stackBelow
|
|
12
|
+
? {
|
|
13
|
+
axis: 'vertical',
|
|
14
|
+
alignment: 'stretch',
|
|
15
|
+
spacing: 2,
|
|
16
|
+
mediaQueries: {
|
|
17
|
+
[breakpoint]: {
|
|
18
|
+
axis: 'horizontal',
|
|
19
|
+
alignment: 'center',
|
|
20
|
+
paddingBottom: 0,
|
|
21
|
+
spacing: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
: null
|
|
4
26
|
|
|
5
|
-
function PageToolbar({ children }) {
|
|
6
27
|
return (
|
|
7
28
|
<StackView
|
|
8
|
-
|
|
29
|
+
alignment="center"
|
|
9
30
|
axis="horizontal"
|
|
10
|
-
alignment="start"
|
|
11
31
|
distribution="space-between"
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
32
|
+
flex={1}
|
|
33
|
+
spacing={2}
|
|
34
|
+
width="100%"
|
|
35
|
+
{...stackProps}
|
|
36
|
+
{...restProps}
|
|
37
|
+
/>
|
|
15
38
|
)
|
|
16
39
|
}
|
|
17
40
|
|