@planningcenter/tapestry-react 2.1.1 → 2.2.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/Avatar/Avatar.js +11 -9
- package/dist/cjs/Badge/Badge.js +5 -1
- package/dist/cjs/Card/Card.js +5 -2
- package/dist/cjs/Combobox/Combobox.js +16 -43
- package/dist/cjs/Combobox/ComboboxInput.js +112 -146
- package/dist/cjs/Combobox/ComboboxItem.js +38 -53
- package/dist/cjs/Combobox/ComboboxItems.js +41 -58
- package/dist/cjs/Combobox/index.js +12 -0
- package/dist/cjs/DateField/DateField.js +109 -128
- package/dist/cjs/Field/Field.js +80 -106
- package/dist/cjs/Menu/Item.js +1 -0
- package/dist/cjs/Pagination/Pagination.js +17 -11
- package/dist/cjs/Popover/utils.js +1 -0
- package/dist/cjs/SegmentedControl/SegmentedControl.js +89 -111
- package/dist/cjs/SegmentedTabs/SegmentedTabs.js +54 -84
- package/dist/cjs/Tabs/Tab.js +9 -6
- package/dist/cjs/Tabs/TabList.js +49 -64
- package/dist/cjs/Tabs/TabPanel.js +6 -2
- package/dist/cjs/Tabs/TabPanels.js +14 -27
- package/dist/cjs/Tabs/Tabs.js +72 -106
- package/dist/cjs/Tabs/index.js +12 -0
- package/dist/cjs/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/cjs/Tooltip/Tooltip.js +158 -182
- package/dist/cjs/Wizard/Wizard.js +143 -193
- package/dist/cjs/Wizard/index.js +3 -0
- package/dist/cjs/system/box-sizes.js +3 -3
- package/dist/esm/Avatar/Avatar.js +11 -7
- package/dist/esm/Badge/Badge.js +5 -1
- package/dist/esm/Card/Card.js +5 -2
- package/dist/esm/Combobox/Combobox.js +18 -43
- package/dist/esm/Combobox/ComboboxInput.js +111 -149
- package/dist/esm/Combobox/ComboboxItem.js +38 -52
- package/dist/esm/Combobox/ComboboxItems.js +38 -56
- package/dist/esm/Combobox/index.js +8 -0
- package/dist/esm/DateField/DateField.js +106 -133
- package/dist/esm/Field/Field.js +76 -103
- package/dist/esm/Menu/Item.js +1 -0
- package/dist/esm/Pagination/Pagination.js +16 -11
- package/dist/esm/Popover/utils.js +1 -0
- package/dist/esm/SegmentedControl/SegmentedControl.js +90 -114
- package/dist/esm/SegmentedTabs/SegmentedTabs.js +51 -83
- package/dist/esm/Tabs/Tab.js +8 -6
- package/dist/esm/Tabs/TabList.js +49 -66
- package/dist/esm/Tabs/TabPanel.js +4 -2
- package/dist/esm/Tabs/TabPanels.js +14 -28
- package/dist/esm/Tabs/Tabs.js +76 -120
- package/dist/esm/Tabs/index.js +8 -0
- package/dist/esm/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/esm/Tooltip/Tooltip.js +154 -195
- package/dist/esm/Wizard/Wizard.js +144 -201
- package/dist/esm/Wizard/index.js +2 -0
- package/dist/esm/system/box-sizes.js +3 -3
- package/dist/types/Button/Button.d.ts +4 -0
- package/dist/types/Popover/utils.d.ts +3 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/Avatar/Avatar.tsx +15 -8
- package/src/Badge/Badge.js +5 -0
- package/src/Button/Button.tsx +5 -0
- package/src/Card/Card.tsx +22 -1
- package/src/Combobox/Combobox.js +18 -32
- package/src/Combobox/Combobox.mdx +1 -0
- package/src/Combobox/Combobox.test.js +1 -1
- package/src/Combobox/ComboboxInput.js +111 -105
- package/src/Combobox/ComboboxItem.js +27 -27
- package/src/Combobox/ComboboxItems.js +38 -60
- package/src/Combobox/index.js +8 -0
- package/src/DateField/DateField.js +109 -105
- package/src/DateField/DateField.mdx +1 -0
- package/src/Field/Field.js +85 -93
- package/src/Field/Field.mdx +1 -0
- package/src/Menu/Heading.js +5 -1
- package/src/Menu/Heading.mdx +20 -0
- package/src/Menu/Item.js +13 -1
- package/src/Menu/Item.mdx +18 -0
- package/src/Menu/Menu.mdx +1 -0
- package/src/Pagination/Pagination.tsx +22 -12
- package/src/Popover/utils.ts +1 -0
- package/src/SegmentedControl/SegmentedControl.js +88 -92
- package/src/SegmentedControl/SegmentedControl.mdx +1 -0
- package/src/SegmentedTabs/SegmentedTabs.js +51 -71
- package/src/SegmentedTabs/SegmentedTabs.mdx +1 -0
- package/src/Tabs/Tab.js +3 -1
- package/src/Tabs/TabList.js +56 -62
- package/src/Tabs/TabPanel.js +2 -1
- package/src/Tabs/TabPanels.js +14 -15
- package/src/Tabs/Tabs.js +63 -84
- package/src/Tabs/Tabs.mdx +16 -17
- package/src/Tabs/index.js +8 -0
- package/src/ThemeProvider/ThemeProvider.tsx +1 -1
- package/src/Tooltip/Tooltip.js +142 -160
- package/src/Tooltip/Tooltip.mdx +1 -0
- package/src/Wizard/Wizard.js +141 -170
- package/src/Wizard/Wizard.mdx +3 -2
- package/src/Wizard/index.js +2 -0
- package/src/system/box-sizes.js +3 -3
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
5
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
6
4
|
|
|
7
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
8
6
|
|
|
9
7
|
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) { _defineProperty(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; }
|
|
10
8
|
|
|
11
|
-
import React, { Children,
|
|
9
|
+
import React, { Children, useCallback, useReducer, useState } from 'react';
|
|
12
10
|
import Button from '../Button';
|
|
13
11
|
import Card from '../Card';
|
|
14
12
|
import Divider from '../Divider';
|
|
@@ -16,212 +14,157 @@ import StackView from '../StackView';
|
|
|
16
14
|
import PagerView from '../PagerView';
|
|
17
15
|
import StepperProgress from '../StepperProgress';
|
|
18
16
|
import Text from '../Text';
|
|
19
|
-
import
|
|
17
|
+
import { useThemeProps } from '../system';
|
|
20
18
|
import WizardContext from './WizardContext';
|
|
21
19
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
20
|
+
var _ref2 = /*#__PURE__*/React.createElement(Divider, null);
|
|
21
|
+
|
|
22
|
+
function Wizard(props) {
|
|
23
|
+
var _useThemeProps = useThemeProps('wizard', props),
|
|
24
|
+
_useThemeProps$autoFo = _useThemeProps.autoFocus,
|
|
25
|
+
autoFocus = _useThemeProps$autoFo === void 0 ? true : _useThemeProps$autoFo,
|
|
26
|
+
backButtonProps = _useThemeProps.backButtonProps,
|
|
27
|
+
buttonProps = _useThemeProps.buttonProps,
|
|
28
|
+
cancelButtonProps = _useThemeProps.cancelButtonProps,
|
|
29
|
+
children = _useThemeProps.children,
|
|
30
|
+
footerProps = _useThemeProps.footerProps,
|
|
31
|
+
_useThemeProps$initia = _useThemeProps.initialPayload,
|
|
32
|
+
initialPayload = _useThemeProps$initia === void 0 ? {} : _useThemeProps$initia,
|
|
33
|
+
nextButtonProps = _useThemeProps.nextButtonProps,
|
|
34
|
+
_useThemeProps$nextBu = _useThemeProps.nextButtonTitle,
|
|
35
|
+
nextButtonTitle = _useThemeProps$nextBu === void 0 ? function (_ref) {
|
|
36
|
+
var activeStepIndex = _ref.activeStepIndex,
|
|
37
|
+
steps = _ref.steps,
|
|
38
|
+
totalSteps = _ref.totalSteps;
|
|
39
|
+
return activeStepIndex >= totalSteps - 1 ? 'Finish' : 'Next';
|
|
40
|
+
} : _useThemeProps$nextBu,
|
|
41
|
+
onCancel = _useThemeProps.onCancel,
|
|
42
|
+
onSubmit = _useThemeProps.onSubmit,
|
|
43
|
+
renderProgress = _useThemeProps.renderProgress,
|
|
44
|
+
restProps = _objectWithoutPropertiesLoose(_useThemeProps, ["autoFocus", "backButtonProps", "buttonProps", "cancelButtonProps", "children", "footerProps", "initialPayload", "nextButtonProps", "nextButtonTitle", "onCancel", "onSubmit", "renderProgress"]);
|
|
45
|
+
|
|
46
|
+
var _useState = useState(0),
|
|
47
|
+
activeStepIndex = _useState[0],
|
|
48
|
+
setActiveStepIndex = _useState[1];
|
|
49
|
+
|
|
50
|
+
var _useState2 = useState([]),
|
|
51
|
+
steps = _useState2[0],
|
|
52
|
+
setSteps = _useState2[1];
|
|
53
|
+
|
|
54
|
+
var _useState3 = useState(false),
|
|
55
|
+
sendingPayload = _useState3[0],
|
|
56
|
+
setSendingPayload = _useState3[1];
|
|
57
|
+
|
|
58
|
+
var totalSteps = steps.length;
|
|
59
|
+
|
|
60
|
+
var _useReducer = useReducer(function (prevState, updatedProperty) {
|
|
61
|
+
return _objectSpread(_objectSpread({}, prevState), updatedProperty);
|
|
62
|
+
}, initialPayload),
|
|
63
|
+
payload = _useReducer[0],
|
|
64
|
+
setPayload = _useReducer[1];
|
|
65
|
+
|
|
66
|
+
var addStep = useCallback(function (step) {
|
|
67
|
+
setSteps(function (steps) {
|
|
68
|
+
return [].concat(steps, [step]);
|
|
74
69
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return _this.setState({
|
|
80
|
-
sendingPayload: false
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
_this.setState({
|
|
85
|
-
sendingPayload: true
|
|
70
|
+
return function () {
|
|
71
|
+
setSteps(function (steps) {
|
|
72
|
+
return steps.filter(function (previousStep) {
|
|
73
|
+
return previousStep.name !== step.name;
|
|
86
74
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return _this;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var _proto = Wizard.prototype;
|
|
96
|
-
|
|
97
|
-
_proto.isCurrentStepValid = function isCurrentStepValid() {
|
|
98
|
-
var _this$state = this.state,
|
|
99
|
-
activeStepIndex = _this$state.activeStepIndex,
|
|
100
|
-
payload = _this$state.payload,
|
|
101
|
-
steps = _this$state.steps;
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}, [steps]);
|
|
78
|
+
var isCurrentStepValid = useCallback(function () {
|
|
102
79
|
var currentStep = steps[activeStepIndex];
|
|
103
80
|
return currentStep && currentStep.valid ? currentStep.valid(payload) : true;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
autoFocus = _this$props.autoFocus,
|
|
111
|
-
backButtonProps = _this$props.backButtonProps,
|
|
112
|
-
buttonProps = _this$props.buttonProps,
|
|
113
|
-
cancelButtonProps = _this$props.cancelButtonProps,
|
|
114
|
-
children = _this$props.children,
|
|
115
|
-
footerProps = _this$props.footerProps,
|
|
116
|
-
initialPayload = _this$props.initialPayload,
|
|
117
|
-
nextButtonProps = _this$props.nextButtonProps,
|
|
118
|
-
nextButtonTitle = _this$props.nextButtonTitle,
|
|
119
|
-
onCancel = _this$props.onCancel,
|
|
120
|
-
onSubmit = _this$props.onSubmit,
|
|
121
|
-
renderProgress = _this$props.renderProgress,
|
|
122
|
-
restProps = _objectWithoutPropertiesLoose(_this$props, ["autoFocus", "backButtonProps", "buttonProps", "cancelButtonProps", "children", "footerProps", "initialPayload", "nextButtonProps", "nextButtonTitle", "onCancel", "onSubmit", "renderProgress"]);
|
|
81
|
+
}, [activeStepIndex, steps, payload]);
|
|
82
|
+
var handleSubmit = useCallback(function () {
|
|
83
|
+
if (onSubmit) {
|
|
84
|
+
var _complete = function _complete() {
|
|
85
|
+
return setSendingPayload(false);
|
|
86
|
+
};
|
|
123
87
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
88
|
+
setSendingPayload(true);
|
|
89
|
+
onSubmit(payload, _complete);
|
|
90
|
+
}
|
|
91
|
+
}, [payload]);
|
|
92
|
+
return /*#__PURE__*/React.createElement(WizardContext.Provider, {
|
|
93
|
+
value: {
|
|
94
|
+
activeStepIndex: activeStepIndex,
|
|
95
|
+
addStep: addStep,
|
|
96
|
+
setPayload: setPayload,
|
|
97
|
+
payload: payload,
|
|
98
|
+
totalSteps: totalSteps
|
|
99
|
+
}
|
|
100
|
+
}, /*#__PURE__*/React.createElement(StackView, _extends({
|
|
101
|
+
alignment: "center",
|
|
102
|
+
minWidth: 48,
|
|
103
|
+
maxWidth: 96
|
|
104
|
+
}, restProps), renderProgress ? renderProgress({
|
|
105
|
+
activeStepIndex: activeStepIndex,
|
|
106
|
+
steps: steps,
|
|
107
|
+
totalSteps: totalSteps
|
|
108
|
+
}) : /*#__PURE__*/React.createElement(StepperProgress, {
|
|
109
|
+
width: "80%",
|
|
110
|
+
paddingTop: 6,
|
|
111
|
+
paddingBottom: 4,
|
|
112
|
+
activeStepIndex: activeStepIndex
|
|
113
|
+
}, steps.map(function (step, index) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(StepperProgress.Step, {
|
|
115
|
+
key: index,
|
|
116
|
+
renderEnd: /*#__PURE__*/React.createElement(Text, {
|
|
117
|
+
align: "center",
|
|
118
|
+
marginTop: 2
|
|
119
|
+
}, step.name)
|
|
120
|
+
});
|
|
121
|
+
})), /*#__PURE__*/React.createElement(Card, {
|
|
122
|
+
spacing: _ref2,
|
|
123
|
+
elevation: 1
|
|
124
|
+
}, /*#__PURE__*/React.createElement(PagerView, {
|
|
125
|
+
activeViewIndex: activeStepIndex,
|
|
126
|
+
autoFocus: autoFocus
|
|
127
|
+
}, Children.map(children, function (child, index) {
|
|
128
|
+
return /*#__PURE__*/React.createElement(PagerView.View, {
|
|
129
|
+
key: index
|
|
130
|
+
}, child);
|
|
131
|
+
})), /*#__PURE__*/React.createElement(StackView, _extends({
|
|
132
|
+
axis: "horizontal",
|
|
133
|
+
distribution: activeStepIndex > 0 ? 'space-between' : 'end',
|
|
134
|
+
padding: 1,
|
|
135
|
+
spacing: 1
|
|
136
|
+
}, footerProps), activeStepIndex === 0 && onCancel && /*#__PURE__*/React.createElement(Button, _extends({
|
|
137
|
+
disabled: sendingPayload,
|
|
138
|
+
onClick: onCancel,
|
|
139
|
+
size: "lg",
|
|
140
|
+
title: "Cancel",
|
|
141
|
+
variant: "naked"
|
|
142
|
+
}, buttonProps, cancelButtonProps)), activeStepIndex > 0 && /*#__PURE__*/React.createElement(Button, _extends({
|
|
143
|
+
disabled: sendingPayload,
|
|
144
|
+
iconLeft: {
|
|
145
|
+
name: 'general.leftChevron',
|
|
146
|
+
size: 'sm'
|
|
147
|
+
},
|
|
148
|
+
onClick: function onClick() {
|
|
149
|
+
return setActiveStepIndex(activeStepIndex - 1);
|
|
150
|
+
},
|
|
151
|
+
size: "lg",
|
|
152
|
+
title: "Back",
|
|
153
|
+
variant: "naked"
|
|
154
|
+
}, buttonProps, backButtonProps)), /*#__PURE__*/React.createElement(Button, _extends({
|
|
155
|
+
disabled: !isCurrentStepValid(),
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
return activeStepIndex >= totalSteps - 1 ? handleSubmit() : setActiveStepIndex(activeStepIndex + 1);
|
|
158
|
+
},
|
|
159
|
+
size: "lg",
|
|
160
|
+
spinner: sendingPayload,
|
|
161
|
+
theme: "primary",
|
|
162
|
+
title: nextButtonTitle({
|
|
142
163
|
activeStepIndex: activeStepIndex,
|
|
143
164
|
steps: steps,
|
|
144
165
|
totalSteps: totalSteps
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
paddingBottom: 4,
|
|
149
|
-
activeStepIndex: activeStepIndex
|
|
150
|
-
}, steps.map(function (step, index) {
|
|
151
|
-
return /*#__PURE__*/React.createElement(StepperProgress.Step, {
|
|
152
|
-
key: index,
|
|
153
|
-
renderEnd: /*#__PURE__*/React.createElement(Text, {
|
|
154
|
-
align: "center",
|
|
155
|
-
marginTop: 2
|
|
156
|
-
}, step.name)
|
|
157
|
-
});
|
|
158
|
-
})), /*#__PURE__*/React.createElement(Card, {
|
|
159
|
-
spacing: _ref,
|
|
160
|
-
elevation: 1
|
|
161
|
-
}, /*#__PURE__*/React.createElement(PagerView, {
|
|
162
|
-
activeViewIndex: activeStepIndex,
|
|
163
|
-
autoFocus: autoFocus
|
|
164
|
-
}, Children.map(children, function (child, index) {
|
|
165
|
-
return /*#__PURE__*/React.createElement(PagerView.View, {
|
|
166
|
-
key: index
|
|
167
|
-
}, child);
|
|
168
|
-
})), /*#__PURE__*/React.createElement(StackView, _extends({
|
|
169
|
-
axis: "horizontal",
|
|
170
|
-
distribution: activeStepIndex > 0 ? 'space-between' : 'end',
|
|
171
|
-
padding: 1,
|
|
172
|
-
spacing: 1
|
|
173
|
-
}, footerProps), activeStepIndex === 0 && onCancel && /*#__PURE__*/React.createElement(Button, _extends({
|
|
174
|
-
disabled: sendingPayload,
|
|
175
|
-
onClick: onCancel,
|
|
176
|
-
size: "lg",
|
|
177
|
-
title: "Cancel",
|
|
178
|
-
variant: "naked"
|
|
179
|
-
}, buttonProps, cancelButtonProps)), activeStepIndex > 0 && /*#__PURE__*/React.createElement(Button, _extends({
|
|
180
|
-
disabled: sendingPayload,
|
|
181
|
-
iconLeft: {
|
|
182
|
-
name: 'general.leftChevron',
|
|
183
|
-
size: 'sm'
|
|
184
|
-
},
|
|
185
|
-
onClick: function onClick() {
|
|
186
|
-
return _this2.setState({
|
|
187
|
-
activeStepIndex: activeStepIndex - 1
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
size: "lg",
|
|
191
|
-
title: "Back",
|
|
192
|
-
variant: "naked"
|
|
193
|
-
}, buttonProps, backButtonProps)), /*#__PURE__*/React.createElement(Button, _extends({
|
|
194
|
-
disabled: !this.isCurrentStepValid(),
|
|
195
|
-
onClick: function onClick() {
|
|
196
|
-
return activeStepIndex >= totalSteps - 1 ? _this2.handleSubmit() : _this2.setState({
|
|
197
|
-
activeStepIndex: activeStepIndex + 1
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
size: "lg",
|
|
201
|
-
spinner: sendingPayload,
|
|
202
|
-
theme: "primary",
|
|
203
|
-
title: nextButtonTitle({
|
|
204
|
-
activeStepIndex: activeStepIndex,
|
|
205
|
-
steps: steps,
|
|
206
|
-
totalSteps: totalSteps
|
|
207
|
-
})
|
|
208
|
-
}, buttonProps, nextButtonProps))))));
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
return Wizard;
|
|
212
|
-
}(Component);
|
|
213
|
-
|
|
214
|
-
_defineProperty(Wizard, "Step", Step);
|
|
215
|
-
|
|
216
|
-
_defineProperty(Wizard, "defaultProps", {
|
|
217
|
-
autoFocus: true,
|
|
218
|
-
initialPayload: {},
|
|
219
|
-
nextButtonTitle: function nextButtonTitle(_ref2) {
|
|
220
|
-
var activeStepIndex = _ref2.activeStepIndex,
|
|
221
|
-
steps = _ref2.steps,
|
|
222
|
-
totalSteps = _ref2.totalSteps;
|
|
223
|
-
return activeStepIndex >= totalSteps - 1 ? 'Finish' : 'Next';
|
|
224
|
-
}
|
|
225
|
-
});
|
|
166
|
+
})
|
|
167
|
+
}, buttonProps, nextButtonProps))))));
|
|
168
|
+
}
|
|
226
169
|
|
|
227
170
|
export default Wizard;
|
package/dist/esm/Wizard/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export var boxSizes = {
|
|
|
18
18
|
radius: 3
|
|
19
19
|
},
|
|
20
20
|
md: {
|
|
21
|
-
boxSize: 4
|
|
21
|
+
boxSize: 4,
|
|
22
22
|
fontSize: 4,
|
|
23
23
|
lineHeight: 3,
|
|
24
24
|
paddingHorizontalDense: 1,
|
|
@@ -27,7 +27,7 @@ export var boxSizes = {
|
|
|
27
27
|
radius: 4
|
|
28
28
|
},
|
|
29
29
|
lg: {
|
|
30
|
-
boxSize:
|
|
30
|
+
boxSize: 5,
|
|
31
31
|
fontSize: 3,
|
|
32
32
|
lineHeight: 4,
|
|
33
33
|
paddingHorizontalDense: 1,
|
|
@@ -36,7 +36,7 @@ export var boxSizes = {
|
|
|
36
36
|
radius: 5
|
|
37
37
|
},
|
|
38
38
|
xl: {
|
|
39
|
-
boxSize:
|
|
39
|
+
boxSize: 8,
|
|
40
40
|
fontSize: 1,
|
|
41
41
|
lineHeight: 5,
|
|
42
42
|
paddingHorizontalDense: 2,
|
|
@@ -11,6 +11,10 @@ declare type ButtonProps = {
|
|
|
11
11
|
* Opens the linked destination in a new window or tab.
|
|
12
12
|
*/
|
|
13
13
|
external?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Pass styles for when the button is active.
|
|
16
|
+
*/
|
|
17
|
+
active?: object;
|
|
14
18
|
/**
|
|
15
19
|
* Pass styles for when the button is focused.
|
|
16
20
|
*/
|
|
@@ -25,6 +25,7 @@ export declare function getModifiers({ matchWidths, offset, keepInView, shouldFl
|
|
|
25
25
|
enabled: boolean;
|
|
26
26
|
phase: string;
|
|
27
27
|
requires: string[];
|
|
28
|
+
fn: () => void;
|
|
28
29
|
effect: ({ state }: {
|
|
29
30
|
state: any;
|
|
30
31
|
}) => void;
|
|
@@ -37,12 +38,14 @@ export declare function getModifiers({ matchWidths, offset, keepInView, shouldFl
|
|
|
37
38
|
enabled?: undefined;
|
|
38
39
|
phase?: undefined;
|
|
39
40
|
requires?: undefined;
|
|
41
|
+
fn?: undefined;
|
|
40
42
|
effect?: undefined;
|
|
41
43
|
} | {
|
|
42
44
|
name: string;
|
|
43
45
|
enabled: any;
|
|
44
46
|
phase?: undefined;
|
|
45
47
|
requires?: undefined;
|
|
48
|
+
fn?: undefined;
|
|
46
49
|
effect?: undefined;
|
|
47
50
|
options?: undefined;
|
|
48
51
|
})[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.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",
|
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/Avatar/Avatar.tsx
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Box from '../Box'
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const avatarSizes = {
|
|
6
|
+
xs: 2.5,
|
|
7
|
+
sm: 3,
|
|
8
|
+
md: 4.5,
|
|
9
|
+
lg: 6,
|
|
10
|
+
xl: 9,
|
|
11
|
+
xxl: 14,
|
|
12
|
+
}
|
|
5
13
|
|
|
6
14
|
const borderSizes = {
|
|
7
15
|
xs: 2,
|
|
@@ -16,15 +24,15 @@ type AvatarProps = {
|
|
|
16
24
|
/**
|
|
17
25
|
* Controls the size of the avatar.
|
|
18
26
|
*/
|
|
19
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
|
|
27
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
|
|
20
28
|
/**
|
|
21
29
|
* The source of the image to display.
|
|
22
30
|
*/
|
|
23
|
-
source?: string
|
|
31
|
+
source?: string
|
|
24
32
|
/**
|
|
25
33
|
* Adds a colored ring with padding around the avatar. Accepts a valid color string.
|
|
26
34
|
*/
|
|
27
|
-
status?: string
|
|
35
|
+
status?: string
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
/**
|
|
@@ -36,14 +44,13 @@ export function Avatar({
|
|
|
36
44
|
status,
|
|
37
45
|
...restProps
|
|
38
46
|
}: AvatarProps) {
|
|
39
|
-
const { boxSize } = useBoxSize(size)
|
|
40
47
|
return (
|
|
41
48
|
<Box
|
|
42
49
|
as="img"
|
|
43
50
|
src={source}
|
|
44
|
-
width={
|
|
45
|
-
height={
|
|
46
|
-
flexBasis={
|
|
51
|
+
width={avatarSizes[size]}
|
|
52
|
+
height={avatarSizes[size]}
|
|
53
|
+
flexBasis={avatarSizes[size]}
|
|
47
54
|
flexShrink={0}
|
|
48
55
|
flexGrow={0}
|
|
49
56
|
objectFit="cover"
|
package/src/Badge/Badge.js
CHANGED
|
@@ -123,6 +123,11 @@ function Badge({
|
|
|
123
123
|
? paddingHorizontal
|
|
124
124
|
: paddingHorizontalDense
|
|
125
125
|
|
|
126
|
+
// The `square` prop is no longer needed and should not get
|
|
127
|
+
// passed to `<StackView>` since it's not one of its props
|
|
128
|
+
// or a standard HTML attribute.
|
|
129
|
+
delete badgeProps.square
|
|
130
|
+
|
|
126
131
|
return (
|
|
127
132
|
<StackView
|
|
128
133
|
inline
|
package/src/Button/Button.tsx
CHANGED
package/src/Card/Card.tsx
CHANGED
|
@@ -22,6 +22,27 @@ export function Card({
|
|
|
22
22
|
...restProps
|
|
23
23
|
}: CardProps) {
|
|
24
24
|
const cardTheme = useThemeValue('card')
|
|
25
|
+
|
|
26
|
+
// List of component types to ignore when setting the radius
|
|
27
|
+
// for first & last child elements
|
|
28
|
+
const ignoreRadiusTypes = [
|
|
29
|
+
'Avatar',
|
|
30
|
+
'Badge',
|
|
31
|
+
'Button',
|
|
32
|
+
'Calendar',
|
|
33
|
+
'ChurchCenterStatus',
|
|
34
|
+
'Group',
|
|
35
|
+
'Inline',
|
|
36
|
+
'Input',
|
|
37
|
+
'InputBox',
|
|
38
|
+
'Modal',
|
|
39
|
+
'Progress',
|
|
40
|
+
'Spinner',
|
|
41
|
+
'Status',
|
|
42
|
+
'Tab',
|
|
43
|
+
'Tooltip'
|
|
44
|
+
]
|
|
45
|
+
|
|
25
46
|
return (
|
|
26
47
|
<StackView
|
|
27
48
|
width="100%"
|
|
@@ -37,7 +58,7 @@ export function Card({
|
|
|
37
58
|
>
|
|
38
59
|
{radius > 0
|
|
39
60
|
? cloneChildren(children, (child, { firstChild, lastChild }) =>
|
|
40
|
-
child.props.radius === undefined
|
|
61
|
+
child.props.radius === undefined && !ignoreRadiusTypes.includes(child.type.name)
|
|
41
62
|
? firstChild
|
|
42
63
|
? {
|
|
43
64
|
[`radius${
|
package/src/Combobox/Combobox.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import Box from '../Box'
|
|
5
5
|
import { ItemList } from '../ItemList'
|
|
6
|
-
|
|
7
|
-
import ComboboxInput from './ComboboxInput'
|
|
8
|
-
import ComboboxItem from './ComboboxItem'
|
|
9
|
-
import ComboboxItems from './ComboboxItems'
|
|
10
|
-
import ComboboxPopover from './ComboboxPopover'
|
|
6
|
+
import { useThemeProps } from '../system'
|
|
11
7
|
|
|
12
8
|
type ComboboxProps = {
|
|
13
9
|
/**
|
|
@@ -18,32 +14,22 @@ type ComboboxProps = {
|
|
|
18
14
|
selectedValue: any,
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = this.props
|
|
38
|
-
return (
|
|
39
|
-
<ItemList
|
|
40
|
-
selected={(item) => item.value === selectedValue}
|
|
41
|
-
onSelect={onSelect}
|
|
42
|
-
>
|
|
43
|
-
<Box {...restProps}>{children}</Box>
|
|
44
|
-
</ItemList>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
17
|
+
function Combobox(props: ComboboxProps) {
|
|
18
|
+
const {
|
|
19
|
+
children,
|
|
20
|
+
multiple,
|
|
21
|
+
onSelect,
|
|
22
|
+
selectedValue,
|
|
23
|
+
...restProps
|
|
24
|
+
} = useThemeProps('combobox', props)
|
|
25
|
+
return (
|
|
26
|
+
<ItemList
|
|
27
|
+
selected={(item) => item.value === selectedValue}
|
|
28
|
+
onSelect={onSelect}
|
|
29
|
+
>
|
|
30
|
+
<Box {...restProps}>{children}</Box>
|
|
31
|
+
</ItemList>
|
|
32
|
+
)
|
|
47
33
|
}
|
|
48
34
|
|
|
49
35
|
export default Combobox
|
|
@@ -3,6 +3,7 @@ title: Combobox
|
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Used for easily selecting a list of items that are paired with a text input. Composes [Combobox.Input](https://github.com/planningcenter/tapestry-react/blob/master/packages/tapestry-react/src/Combobox/ComboboxInput.js) and [Popover](/popover).
|
|
5
5
|
propsSummary: Accepts [Box](/box) props.
|
|
6
|
+
themeKey: combobox
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
### Combobox
|