@planningcenter/tapestry-react 2.9.2 → 2.10.0-rc.1
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/Badge/Badge.js +19 -7
- package/dist/cjs/Badge/Status.js +52 -77
- package/dist/cjs/Button/Button.js +1 -1
- package/dist/cjs/Calendar/Day.js +5 -2
- package/dist/cjs/Combobox/ComboboxPopover.js +20 -6
- package/dist/cjs/Input/Inline.js +1 -1
- package/dist/cjs/Input/InputBox.js +1 -1
- package/dist/cjs/Menu/Item.js +47 -25
- package/dist/cjs/Modal/Modal.js +4 -3
- package/dist/cjs/NumberField/NumberField.js +112 -31
- package/dist/cjs/NumberField/NumberField.test.js +8 -2
- package/dist/cjs/Portal/Portal.js +2 -1
- package/dist/cjs/Progress/Progress.js +2 -2
- package/dist/cjs/Radio/Radio.js +12 -8
- package/dist/cjs/Toolbar/Toolbar.js +1 -0
- package/dist/cjs/Tooltip/Tooltip.js +4 -2
- package/dist/cjs/Wizard/Wizard.js +4 -4
- package/dist/cjs/system/utils.js +2 -0
- package/dist/esm/Badge/Badge.js +19 -7
- package/dist/esm/Badge/Status.js +52 -77
- package/dist/esm/Button/Button.js +1 -1
- package/dist/esm/Calendar/Day.js +5 -2
- package/dist/esm/Combobox/ComboboxPopover.js +20 -6
- package/dist/esm/Input/Inline.js +1 -1
- package/dist/esm/Input/InputBox.js +1 -1
- package/dist/esm/Menu/Item.js +47 -25
- package/dist/esm/Modal/Modal.js +4 -3
- package/dist/esm/NumberField/NumberField.js +112 -32
- package/dist/esm/NumberField/NumberField.test.js +8 -2
- package/dist/esm/Portal/Portal.js +2 -1
- package/dist/esm/Progress/Progress.js +2 -2
- package/dist/esm/Radio/Radio.js +12 -8
- package/dist/esm/Toolbar/Toolbar.js +2 -1
- package/dist/esm/Tooltip/Tooltip.js +4 -2
- package/dist/esm/Wizard/Wizard.js +4 -4
- package/dist/esm/system/utils.js +2 -0
- package/dist/types/Badge/Status.d.ts +27 -0
- package/dist/types/Button/Button.d.ts +4 -2
- package/dist/types/Modal/Modal.d.ts +23 -0
- package/dist/types/NumberField/NumberField.d.ts +89 -0
- package/dist/types/Progress/Progress.d.ts +12 -0
- package/dist/types/Radio/Radio.d.ts +44 -0
- package/dist/types/Wizard/Wizard.d.ts +63 -0
- package/package.json +3 -1
- package/src/Badge/Badge.js +8 -0
- package/src/Badge/Status.tsx +90 -0
- package/src/Button/Button.tsx +2 -2
- package/src/Calendar/Day.js +11 -0
- package/src/Combobox/ComboboxPopover.js +30 -0
- package/src/Input/Inline.js +1 -1
- package/src/Input/InputBox.js +1 -1
- package/src/Menu/Item.js +15 -0
- package/src/Modal/{Modal.js → Modal.tsx} +8 -9
- package/src/NumberField/NumberField.mdx +13 -0
- package/src/NumberField/NumberField.test.tsx +38 -11
- package/src/NumberField/{NumberField.js → NumberField.tsx} +124 -48
- package/src/Portal/Portal.tsx +1 -0
- package/src/Progress/{Progress.js → Progress.tsx} +3 -4
- package/src/Radio/{Radio.js → Radio.tsx} +21 -15
- package/src/Toolbar/Toolbar.js +1 -0
- package/src/Tooltip/Tooltip.js +8 -1
- package/src/Wizard/{Wizard.js → Wizard.tsx} +42 -35
- package/src/system/utils.js +2 -0
- package/src/Badge/Status.js +0 -101
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
exports.__esModule = true;
|
|
@@ -13,10 +15,14 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
|
13
15
|
|
|
14
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
17
|
|
|
16
|
-
var _react = require("react");
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
19
|
|
|
18
20
|
var _InputField = _interopRequireDefault(require("../Input/InputField"));
|
|
19
21
|
|
|
22
|
+
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
23
|
+
|
|
24
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
25
|
+
|
|
20
26
|
var _utils = require("../utils");
|
|
21
27
|
|
|
22
28
|
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; }
|
|
@@ -56,7 +62,9 @@ var NumberField = /*#__PURE__*/function (_Component) {
|
|
|
56
62
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getParsedValues", function (value) {
|
|
57
63
|
return {
|
|
58
64
|
value: Number.parseFloat(value),
|
|
65
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
59
66
|
minValue: Number.parseFloat(_this.props.min),
|
|
67
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
60
68
|
maxValue: Number.parseFloat(_this.props.max)
|
|
61
69
|
};
|
|
62
70
|
});
|
|
@@ -87,19 +95,40 @@ var NumberField = /*#__PURE__*/function (_Component) {
|
|
|
87
95
|
maxValue = _this$getParsedValues3.maxValue;
|
|
88
96
|
|
|
89
97
|
if (value < minValue) {
|
|
98
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
90
99
|
_this.props.onChange(minValue);
|
|
91
100
|
} else if (value > maxValue) {
|
|
101
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
92
102
|
_this.props.onChange(maxValue);
|
|
93
103
|
} else if (isNaN(event.target.value)) {
|
|
104
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
94
105
|
_this.props.onChange(_this.clampValue(value));
|
|
95
106
|
}
|
|
96
107
|
|
|
97
108
|
if (_this.props.onBlur) {
|
|
109
|
+
// @ts-ignore
|
|
98
110
|
_this.props.onBlur(event);
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
_this.firstTouch = true;
|
|
102
114
|
});
|
|
115
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "stepValue", function (baseValue, step) {
|
|
116
|
+
var nextValue = _this.clampValue(baseValue + step);
|
|
117
|
+
|
|
118
|
+
var parsedValue = Number.parseFloat( // @ts-ignore Expected 1 arguments, but got 2.ts(2554)
|
|
119
|
+
baseValue.toString().indexOf('.') > -1 ? nextValue.toFixed(2) : nextValue);
|
|
120
|
+
|
|
121
|
+
if (_this.isValueValid(parsedValue)) {
|
|
122
|
+
// @ts-ignore Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
|
|
123
|
+
_this.props.onChange(parsedValue);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "incrementValue", function () {
|
|
127
|
+
return _this.stepValue(_this.props.value, _this.props.step);
|
|
128
|
+
});
|
|
129
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "decrementValue", function () {
|
|
130
|
+
return _this.stepValue(_this.props.value, -_this.props.step);
|
|
131
|
+
});
|
|
103
132
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleKeyDown", function (event) {
|
|
104
133
|
if (_this.props.ignoredKeys.includes(event.key)) {
|
|
105
134
|
return;
|
|
@@ -110,24 +139,16 @@ var NumberField = /*#__PURE__*/function (_Component) {
|
|
|
110
139
|
step = _this$props.step;
|
|
111
140
|
|
|
112
141
|
var _this$getParsedValues4 = _this.getParsedValues(event.target.value),
|
|
113
|
-
value = _this$getParsedValues4.value
|
|
114
|
-
minValue = _this$getParsedValues4.minValue,
|
|
115
|
-
maxValue = _this$getParsedValues4.maxValue;
|
|
142
|
+
value = _this$getParsedValues4.value;
|
|
116
143
|
|
|
117
144
|
if (isNotAcceptedNumberKey(event) || pad && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
|
118
145
|
event.preventDefault();
|
|
119
146
|
}
|
|
120
147
|
|
|
121
|
-
if (event.key === 'ArrowUp'
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var parsedValue = Number.parseFloat(event.target.value.indexOf('.') > -1 ? nextValue.toFixed(2) : nextValue);
|
|
127
|
-
|
|
128
|
-
if (_this.isValueValid(parsedValue)) {
|
|
129
|
-
_this.props.onChange(parsedValue);
|
|
130
|
-
}
|
|
148
|
+
if (event.key === 'ArrowUp') {
|
|
149
|
+
_this.incrementValue();
|
|
150
|
+
} else if (event.key === 'ArrowDown') {
|
|
151
|
+
_this.decrementValue();
|
|
131
152
|
}
|
|
132
153
|
|
|
133
154
|
if (_this.props.onKeyDown) {
|
|
@@ -188,38 +209,30 @@ var NumberField = /*#__PURE__*/function (_Component) {
|
|
|
188
209
|
return autoWidth || (pad && isValueEmpty ? getPadStringSize(pad) : isValueEmpty && placeholder !== undefined ? placeholder : value);
|
|
189
210
|
};
|
|
190
211
|
|
|
191
|
-
_proto.
|
|
212
|
+
_proto.renderInput = function renderInput(restProps) {
|
|
192
213
|
var _this$props3 = this.props,
|
|
193
|
-
autoWidth = _this$props3.autoWidth,
|
|
194
214
|
as = _this$props3.as,
|
|
195
215
|
highlightOnInteraction = _this$props3.highlightOnInteraction,
|
|
196
|
-
ignoredKeys = _this$props3.ignoredKeys,
|
|
197
|
-
min = _this$props3.min,
|
|
198
|
-
max = _this$props3.max,
|
|
199
|
-
moveFocusOnMax = _this$props3.moveFocusOnMax,
|
|
200
|
-
onChange = _this$props3.onChange,
|
|
201
|
-
onBlur = _this$props3.onBlur,
|
|
202
|
-
onInput = _this$props3.onInput,
|
|
203
|
-
onKeyDown = _this$props3.onKeyDown,
|
|
204
216
|
pad = _this$props3.pad,
|
|
205
|
-
value = _this$props3.value
|
|
206
|
-
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props3, ["autoWidth", "as", "highlightOnInteraction", "ignoredKeys", "min", "max", "moveFocusOnMax", "onChange", "onBlur", "onInput", "onKeyDown", "pad", "value"]);
|
|
217
|
+
value = _this$props3.value;
|
|
207
218
|
var parsed = this.getParsedValues(value);
|
|
208
219
|
var numberValue = value === null ? '' : value;
|
|
209
220
|
|
|
210
221
|
if (pad && numberValue !== '') {
|
|
211
222
|
numberValue = (0, _utils.padNumber)(numberValue, pad);
|
|
212
|
-
}
|
|
223
|
+
} // @ts-ignore Property 'min' does not exist on type '{ value: number; minValue: number; maxValue: number; }'.ts(2339)
|
|
224
|
+
|
|
213
225
|
|
|
214
226
|
if (parsed.min !== MIN_VALUE) {
|
|
215
|
-
restProps.min = min;
|
|
216
|
-
}
|
|
227
|
+
restProps.min = this.props.min;
|
|
228
|
+
} // @ts-ignore Property 'max' does not exist on type '{ value: number; minValue: number; maxValue: number; }'.ts(2339)
|
|
229
|
+
|
|
217
230
|
|
|
218
231
|
if (parsed.max !== MAX_VALUE) {
|
|
219
|
-
restProps.max = max;
|
|
232
|
+
restProps.max = this.props.max;
|
|
220
233
|
}
|
|
221
234
|
|
|
222
|
-
if (autoWidth !== false) {
|
|
235
|
+
if (this.props.autoWidth !== false) {
|
|
223
236
|
restProps.autoWidth = this.getAutoWidthValue(numberValue);
|
|
224
237
|
|
|
225
238
|
if (restProps.autoWidth === undefined) {
|
|
@@ -238,11 +251,79 @@ var NumberField = /*#__PURE__*/function (_Component) {
|
|
|
238
251
|
}));
|
|
239
252
|
};
|
|
240
253
|
|
|
254
|
+
_proto.renderInputWithControls = function renderInputWithControls(restProps) {
|
|
255
|
+
var _this2 = this;
|
|
256
|
+
|
|
257
|
+
var inputElement = this.renderInput(restProps);
|
|
258
|
+
|
|
259
|
+
if (this.props.hasControls) {
|
|
260
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, inputElement, /*#__PURE__*/_react["default"].createElement(_StackView["default"], {
|
|
261
|
+
marginRight: -1,
|
|
262
|
+
marginLeft: 1
|
|
263
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
264
|
+
icon: {
|
|
265
|
+
name: 'general.upCaret'
|
|
266
|
+
},
|
|
267
|
+
hover: {
|
|
268
|
+
backgroundColor: 'grey-1'
|
|
269
|
+
},
|
|
270
|
+
minHeight: 1,
|
|
271
|
+
onClick: function onClick() {
|
|
272
|
+
return _this2.incrementValue();
|
|
273
|
+
},
|
|
274
|
+
paddingVertical: 0.25 // @ts-ignore Type 'string' is not assignable to type 'never'.ts(2322)
|
|
275
|
+
,
|
|
276
|
+
size: "xs",
|
|
277
|
+
title: "Increment by 1",
|
|
278
|
+
theme: "naked"
|
|
279
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
280
|
+
icon: {
|
|
281
|
+
name: 'general.downCaret'
|
|
282
|
+
},
|
|
283
|
+
hover: {
|
|
284
|
+
backgroundColor: 'grey-1'
|
|
285
|
+
},
|
|
286
|
+
minHeight: 1,
|
|
287
|
+
onClick: function onClick() {
|
|
288
|
+
return _this2.decrementValue();
|
|
289
|
+
},
|
|
290
|
+
paddingVertical: 0.25 // @ts-ignore Type 'string' is not assignable to type 'never'.ts(2322)
|
|
291
|
+
,
|
|
292
|
+
size: "xs",
|
|
293
|
+
title: "Decrement by 1",
|
|
294
|
+
theme: "naked"
|
|
295
|
+
})));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return inputElement;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
_proto.render = function render() {
|
|
302
|
+
var _this$props4 = this.props,
|
|
303
|
+
autoWidth = _this$props4.autoWidth,
|
|
304
|
+
as = _this$props4.as,
|
|
305
|
+
hasControls = _this$props4.hasControls,
|
|
306
|
+
highlightOnInteraction = _this$props4.highlightOnInteraction,
|
|
307
|
+
ignoredKeys = _this$props4.ignoredKeys,
|
|
308
|
+
min = _this$props4.min,
|
|
309
|
+
max = _this$props4.max,
|
|
310
|
+
moveFocusOnMax = _this$props4.moveFocusOnMax,
|
|
311
|
+
onChange = _this$props4.onChange,
|
|
312
|
+
onBlur = _this$props4.onBlur,
|
|
313
|
+
onInput = _this$props4.onInput,
|
|
314
|
+
onKeyDown = _this$props4.onKeyDown,
|
|
315
|
+
pad = _this$props4.pad,
|
|
316
|
+
value = _this$props4.value,
|
|
317
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props4, ["autoWidth", "as", "hasControls", "highlightOnInteraction", "ignoredKeys", "min", "max", "moveFocusOnMax", "onChange", "onBlur", "onInput", "onKeyDown", "pad", "value"]);
|
|
318
|
+
return this.props.hasControls ? this.renderInputWithControls(restProps) : this.renderInput(restProps);
|
|
319
|
+
};
|
|
320
|
+
|
|
241
321
|
return NumberField;
|
|
242
322
|
}(_react.Component);
|
|
243
323
|
|
|
244
324
|
(0, _defineProperty2["default"])(NumberField, "defaultProps", {
|
|
245
325
|
as: _InputField["default"],
|
|
326
|
+
hasControls: false,
|
|
246
327
|
ignoredKeys: [],
|
|
247
328
|
min: MIN_VALUE,
|
|
248
329
|
max: MAX_VALUE,
|
|
@@ -29,7 +29,13 @@ describe('value', function () {
|
|
|
29
29
|
|
|
30
30
|
return /*#__PURE__*/_react["default"].createElement(_NumberField["default"], (0, _extends2["default"])({}, props, {
|
|
31
31
|
"data-testid": "test",
|
|
32
|
-
value: value
|
|
32
|
+
value: value // @ts-ignore No overload matches this call.
|
|
33
|
+
// Overload 1 of 2, '(props: Props | Readonly<Props>): NumberField', gave the following error.
|
|
34
|
+
// Type 'Dispatch<any>' is not assignable to type '(value: string) => null'.
|
|
35
|
+
// Type 'void' is not assignable to type 'null'.
|
|
36
|
+
// Overload 2 of 2, '(props: Props, context: any): NumberField', gave the following error.
|
|
37
|
+
// Type 'Dispatch<any>' is not assignable to type '(value: string) => null'.ts(2769)
|
|
38
|
+
,
|
|
33
39
|
onChange: setValue
|
|
34
40
|
}));
|
|
35
41
|
};
|
|
@@ -110,7 +116,7 @@ describe('value', function () {
|
|
|
110
116
|
});
|
|
111
117
|
});
|
|
112
118
|
describe('pad', function () {
|
|
113
|
-
it(
|
|
119
|
+
it('add appropriate pad', function () {
|
|
114
120
|
var numberField = setup({
|
|
115
121
|
value: 0,
|
|
116
122
|
pad: 2
|
|
@@ -40,7 +40,8 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
40
40
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_needsUpdate", false);
|
|
41
41
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_updated", false);
|
|
42
42
|
return _this;
|
|
43
|
-
}
|
|
43
|
+
} // @ts-ignore error TS2612: Property 'context' will overwrite the base property in 'Component<PortalProps, {}, any>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
|
|
44
|
+
|
|
44
45
|
|
|
45
46
|
var _proto = Portal.prototype;
|
|
46
47
|
|
|
@@ -15,7 +15,7 @@ var _Box = _interopRequireDefault(require("../Box"));
|
|
|
15
15
|
|
|
16
16
|
var _system = require("../system");
|
|
17
17
|
|
|
18
|
-
function Progress(_ref) {
|
|
18
|
+
var Progress = function Progress(_ref) {
|
|
19
19
|
var value = _ref.value,
|
|
20
20
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["value"]);
|
|
21
21
|
|
|
@@ -45,7 +45,7 @@ function Progress(_ref) {
|
|
|
45
45
|
transform: "scaleX(" + value / 100 + ")"
|
|
46
46
|
}
|
|
47
47
|
}));
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
49
|
|
|
50
50
|
var _default = Progress;
|
|
51
51
|
exports["default"] = _default;
|
package/dist/cjs/Radio/Radio.js
CHANGED
|
@@ -33,9 +33,8 @@ var iconPaths = {
|
|
|
33
33
|
};
|
|
34
34
|
var radioEmitter = (0, _mitt["default"])();
|
|
35
35
|
|
|
36
|
-
function Radio(_ref) {
|
|
36
|
+
var Radio = function Radio(_ref) {
|
|
37
37
|
var checked = _ref.checked,
|
|
38
|
-
css = _ref.css,
|
|
39
38
|
disabled = _ref.disabled,
|
|
40
39
|
id = _ref.id,
|
|
41
40
|
label = _ref.label,
|
|
@@ -46,7 +45,7 @@ function Radio(_ref) {
|
|
|
46
45
|
_ref$size = _ref.size,
|
|
47
46
|
size = _ref$size === void 0 ? 'xs' : _ref$size,
|
|
48
47
|
value = _ref.value,
|
|
49
|
-
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["checked", "
|
|
48
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["checked", "disabled", "id", "label", "name", "onBlur", "onChange", "onFocus", "size", "value"]);
|
|
50
49
|
var radioTheme = (0, _system.useThemeValue)('radio');
|
|
51
50
|
var inputRef = (0, _react.useRef)();
|
|
52
51
|
|
|
@@ -85,22 +84,27 @@ function Radio(_ref) {
|
|
|
85
84
|
}, restProps), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
86
85
|
innerRef: inputRef,
|
|
87
86
|
as: "input",
|
|
88
|
-
type: "radio"
|
|
87
|
+
type: "radio" // @ts-ignore Type 'string | number' is not assignable to type 'string'.
|
|
88
|
+
// Type 'number' is not assignable to type 'string'.ts(2322)
|
|
89
|
+
,
|
|
89
90
|
id: id,
|
|
90
91
|
name: name,
|
|
91
92
|
checked: checked,
|
|
92
93
|
value: value,
|
|
93
94
|
disabled: disabled,
|
|
94
95
|
onChange: function onChange(event) {
|
|
95
|
-
radioEmitter.emit(name, event.target);
|
|
96
|
+
radioEmitter.emit(name, event.target); // @ts-ignore Expected 0 arguments, but got 1.ts(2554)
|
|
97
|
+
|
|
96
98
|
_onChange && _onChange(event);
|
|
97
99
|
},
|
|
98
100
|
onFocus: function onFocus(event) {
|
|
99
|
-
setFocus(true);
|
|
101
|
+
setFocus(true); // @ts-ignore Expected 0 arguments, but got 1.ts(2554)
|
|
102
|
+
|
|
100
103
|
_onFocus && _onFocus(event);
|
|
101
104
|
},
|
|
102
105
|
onBlur: function onBlur(event) {
|
|
103
|
-
setFocus(false);
|
|
106
|
+
setFocus(false); // @ts-ignore Expected 0 arguments, but got 1.ts(2554)
|
|
107
|
+
|
|
104
108
|
_onBlur && _onBlur(event);
|
|
105
109
|
},
|
|
106
110
|
position: "absolute",
|
|
@@ -152,7 +156,7 @@ function Radio(_ref) {
|
|
|
152
156
|
lineHeight: 2.5,
|
|
153
157
|
marginLeft: 0.5
|
|
154
158
|
}, label)));
|
|
155
|
-
}
|
|
159
|
+
};
|
|
156
160
|
|
|
157
161
|
var _default = Radio;
|
|
158
162
|
exports["default"] = _default;
|
|
@@ -27,6 +27,7 @@ var _utils = require("../utils");
|
|
|
27
27
|
|
|
28
28
|
var _Action = _interopRequireDefault(require("./Action"));
|
|
29
29
|
|
|
30
|
+
// @ts-ignore Should this be ReactNode anyway?
|
|
30
31
|
var Toolbar = /*#__PURE__*/function (_Component) {
|
|
31
32
|
(0, _inheritsLoose2["default"])(Toolbar, _Component);
|
|
32
33
|
|
|
@@ -55,7 +55,9 @@ function Tooltip(props, ref) {
|
|
|
55
55
|
triggerOnFocus = _useThemeProps$trigge === void 0 ? true : _useThemeProps$trigge,
|
|
56
56
|
_useThemeProps$trigge2 = _useThemeProps.triggerOnHover,
|
|
57
57
|
triggerOnHover = _useThemeProps$trigge2 === void 0 ? true : _useThemeProps$trigge2,
|
|
58
|
-
|
|
58
|
+
_useThemeProps$zIndex = _useThemeProps.zIndex,
|
|
59
|
+
zIndex = _useThemeProps$zIndex === void 0 ? 9999 : _useThemeProps$zIndex,
|
|
60
|
+
childProps = (0, _objectWithoutPropertiesLoose2["default"])(_useThemeProps, ["children", "openDelay", "closeDelay", "defaultOpen", "keepInView", "placement", "popoverProps", "renderTo", "title", "triggerOnFocus", "triggerOnHover", "zIndex"]);
|
|
59
61
|
|
|
60
62
|
var isPageInView = (0, _react.useRef)(true);
|
|
61
63
|
var isMouseDown = (0, _react.useRef)(false);
|
|
@@ -194,7 +196,7 @@ function Tooltip(props, ref) {
|
|
|
194
196
|
radius: 2,
|
|
195
197
|
backgroundColor: "grey-9",
|
|
196
198
|
color: "rgba(255,255,255,0.94)",
|
|
197
|
-
zIndex:
|
|
199
|
+
zIndex: zIndex
|
|
198
200
|
}, popoverProps, {
|
|
199
201
|
anchorElement: /*#__PURE__*/(0, _react.cloneElement)(child, childProps),
|
|
200
202
|
onMouseEnter: createOpenTimeout,
|
|
@@ -37,7 +37,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
37
37
|
|
|
38
38
|
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; }
|
|
39
39
|
|
|
40
|
-
function Wizard(props) {
|
|
40
|
+
var Wizard = function Wizard(props) {
|
|
41
41
|
var _useThemeProps = (0, _system.useThemeProps)('wizard', props),
|
|
42
42
|
_useThemeProps$autoFo = _useThemeProps.autoFocus,
|
|
43
43
|
autoFocus = _useThemeProps$autoFo === void 0 ? true : _useThemeProps$autoFo,
|
|
@@ -92,7 +92,7 @@ function Wizard(props) {
|
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
-
}, [
|
|
95
|
+
}, []);
|
|
96
96
|
var isCurrentStepValid = (0, _react.useCallback)(function () {
|
|
97
97
|
var currentStep = steps[activeStepIndex];
|
|
98
98
|
return currentStep && currentStep.valid ? currentStep.valid(payload) : true;
|
|
@@ -106,7 +106,7 @@ function Wizard(props) {
|
|
|
106
106
|
setSendingPayload(true);
|
|
107
107
|
onSubmit(payload, _complete);
|
|
108
108
|
}
|
|
109
|
-
}, [payload]);
|
|
109
|
+
}, [onSubmit, payload]);
|
|
110
110
|
return /*#__PURE__*/_react["default"].createElement(_WizardContext["default"].Provider, {
|
|
111
111
|
value: {
|
|
112
112
|
activeStepIndex: activeStepIndex,
|
|
@@ -183,7 +183,7 @@ function Wizard(props) {
|
|
|
183
183
|
totalSteps: totalSteps
|
|
184
184
|
})
|
|
185
185
|
}, buttonProps, nextButtonProps))))));
|
|
186
|
-
}
|
|
186
|
+
};
|
|
187
187
|
|
|
188
188
|
var _default = Wizard;
|
|
189
189
|
exports["default"] = _default;
|
package/dist/cjs/system/utils.js
CHANGED
|
@@ -165,6 +165,7 @@ function useThemeValue(path, defaultValue) {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
function useThemeProps(path, props) {
|
|
168
|
+
// @ts-ignore error TS2554: Expected 2 arguments, but got 1
|
|
168
169
|
return _objectSpread(_objectSpread({}, useThemeValue(path)), props);
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -173,6 +174,7 @@ function useBoxSize(size) {
|
|
|
173
174
|
size = 'md';
|
|
174
175
|
}
|
|
175
176
|
|
|
177
|
+
// @ts-ignore error TS2554: Expected 2 arguments, but got 1
|
|
176
178
|
var boxSizes = useThemeValue('boxSizes');
|
|
177
179
|
var navigateSize = (0, _react.useCallback)(function (amount) {
|
|
178
180
|
var index = Object.keys(boxSizes).indexOf(size);
|
package/dist/esm/Badge/Badge.js
CHANGED
|
@@ -66,9 +66,13 @@ function Badge(_ref) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (badgeProps.radius === 'circle') {
|
|
69
|
-
|
|
70
|
-
textStyle.
|
|
71
|
-
|
|
69
|
+
// @ts-ignore error TS2339: Property 'position' does not exist on type ...
|
|
70
|
+
textStyle.position = 'absolute'; // @ts-ignore error TS2339: Property 'top' does not exist on type ...
|
|
71
|
+
|
|
72
|
+
textStyle.top = '50%'; // @ts-ignore error TS2339: Property 'left' does not exist on type ...
|
|
73
|
+
|
|
74
|
+
textStyle.left = '50%'; // @ts-ignore error TS2339: Property 'transform' does not exist on type ...
|
|
75
|
+
|
|
72
76
|
textStyle.transform = 'translate(-50%, -50%)';
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -105,8 +109,12 @@ function Badge(_ref) {
|
|
|
105
109
|
position: "absolute",
|
|
106
110
|
top: 0,
|
|
107
111
|
left: 0
|
|
108
|
-
}, typeof renderLeft === 'string' ? renderLeft :
|
|
109
|
-
|
|
112
|
+
}, typeof renderLeft === 'string' ? renderLeft // @ts-ignore error TS2769: No overload matches this call.
|
|
113
|
+
:
|
|
114
|
+
/*#__PURE__*/
|
|
115
|
+
cloneElement(renderLeft, {
|
|
116
|
+
size: // @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
117
|
+
renderLeft.props && renderLeft.props.size || badgeProps.size
|
|
110
118
|
})), typeof title === 'undefined' ? children : /*#__PURE__*/React.createElement(Text, textStyle, title), renderRight && /*#__PURE__*/React.createElement(Box, {
|
|
111
119
|
display: "flex",
|
|
112
120
|
alignItems: "center",
|
|
@@ -116,8 +124,12 @@ function Badge(_ref) {
|
|
|
116
124
|
position: "absolute",
|
|
117
125
|
top: 0,
|
|
118
126
|
right: 0
|
|
119
|
-
}, typeof renderRight === 'string' ? renderRight :
|
|
120
|
-
|
|
127
|
+
}, typeof renderRight === 'string' ? renderRight // @ts-ignore error TS2769: No overload matches this call.
|
|
128
|
+
:
|
|
129
|
+
/*#__PURE__*/
|
|
130
|
+
cloneElement(renderRight, {
|
|
131
|
+
size: // @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
132
|
+
renderRight.props && renderRight.props.size || badgeProps.size
|
|
121
133
|
})));
|
|
122
134
|
}
|
|
123
135
|
|
package/dist/esm/Badge/Status.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import
|
|
4
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
import React, { Component } from 'react';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
7
4
|
import { getColor } from '../system';
|
|
8
5
|
import Icon from '../Icon';
|
|
9
6
|
import Badge from './Badge';
|
|
@@ -18,81 +15,59 @@ var statuses = {
|
|
|
18
15
|
}
|
|
19
16
|
};
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
var Status = function Status(_ref) {
|
|
19
|
+
var light = _ref.light,
|
|
20
|
+
onClearRequest = _ref.onClearRequest,
|
|
21
|
+
_ref$size = _ref.size,
|
|
22
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
23
|
+
status = _ref.status,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
restProps = _objectWithoutPropertiesLoose(_ref, ["light", "onClearRequest", "size", "status", "title"]);
|
|
26
|
+
|
|
27
|
+
var _useState = useState(null),
|
|
28
|
+
timeoutId = _useState[0],
|
|
29
|
+
setTimeoutId = _useState[1];
|
|
30
|
+
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
var requestClear = function requestClear() {
|
|
33
|
+
if (timeoutId) {
|
|
34
|
+
clearTimeout(timeoutId);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setTimeoutId(setTimeout(onClearRequest, 1800));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
requestClear();
|
|
41
|
+
return function () {
|
|
42
|
+
if (timeoutId) {
|
|
43
|
+
clearTimeout(timeoutId);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, [onClearRequest, status, timeoutId]);
|
|
47
|
+
|
|
48
|
+
if (!status) {
|
|
49
|
+
return null;
|
|
50
|
+
} else {
|
|
51
|
+
var _statuses$status = statuses[status],
|
|
52
|
+
color = _statuses$status.color,
|
|
53
|
+
icon = _statuses$status.icon;
|
|
54
|
+
return /*#__PURE__*/React.createElement(Badge, _extends({
|
|
55
|
+
color: light ? {
|
|
56
|
+
background: 'light',
|
|
57
|
+
foreground: getColor(color)
|
|
58
|
+
} : getColor(color),
|
|
59
|
+
fontWeight: 600,
|
|
60
|
+
paddingRight: 1,
|
|
61
|
+
radius: "pill",
|
|
62
|
+
renderLeft: /*#__PURE__*/React.createElement(Icon, {
|
|
63
|
+
name: icon
|
|
64
|
+
}),
|
|
65
|
+
size: size,
|
|
66
|
+
title: title
|
|
67
|
+
}, restProps));
|
|
39
68
|
}
|
|
69
|
+
}; // @ts-ignore error TS2339: Property 'displayName' does not exist on type 'typeof Status'.
|
|
40
70
|
|
|
41
|
-
var _proto = Status.prototype;
|
|
42
|
-
|
|
43
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
44
|
-
this.requestClear();
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
_proto.componentDidUpdate = function componentDidUpdate(lastProps) {
|
|
48
|
-
if (lastProps.status !== this.props.status) {
|
|
49
|
-
this.requestClear();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
_proto.requestClear = function requestClear() {
|
|
54
|
-
if (this.timeout) {
|
|
55
|
-
clearTimeout(this.timeout);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.timeout = setTimeout(this.props.onClearRequest, 1800);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
_proto.render = function render() {
|
|
62
|
-
var _this$props = this.props,
|
|
63
|
-
status = _this$props.status,
|
|
64
|
-
light = _this$props.light,
|
|
65
|
-
onClearRequest = _this$props.onClearRequest,
|
|
66
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["status", "light", "onClearRequest"]);
|
|
67
|
-
|
|
68
|
-
if (!status) {
|
|
69
|
-
return null;
|
|
70
|
-
} else {
|
|
71
|
-
var _statuses$status = statuses[status],
|
|
72
|
-
color = _statuses$status.color,
|
|
73
|
-
icon = _statuses$status.icon;
|
|
74
|
-
return /*#__PURE__*/React.createElement(Badge, _extends({
|
|
75
|
-
paddingRight: 1,
|
|
76
|
-
radius: "pill",
|
|
77
|
-
renderLeft: /*#__PURE__*/React.createElement(Icon, {
|
|
78
|
-
name: icon
|
|
79
|
-
}),
|
|
80
|
-
color: light ? {
|
|
81
|
-
background: 'light',
|
|
82
|
-
foreground: getColor(color)
|
|
83
|
-
} : getColor(color),
|
|
84
|
-
fontWeight: 600
|
|
85
|
-
}, props));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return Status;
|
|
90
|
-
}(Component);
|
|
91
|
-
|
|
92
|
-
_defineProperty(Status, "defaultProps", {
|
|
93
|
-
title: '',
|
|
94
|
-
size: 'sm'
|
|
95
|
-
});
|
|
96
71
|
|
|
97
72
|
Status.displayName = 'Badge.Status';
|
|
98
73
|
export default Status;
|
package/dist/esm/Calendar/Day.js
CHANGED
|
@@ -29,7 +29,9 @@ var Day = function Day(_ref) {
|
|
|
29
29
|
statusOffset = _ref$statusOffset === void 0 ? '15%' : _ref$statusOffset,
|
|
30
30
|
restProps = _objectWithoutPropertiesLoose(_ref, ["backgroundColor", "cellSize", "children", "color", "date", "disabled", "fontSize", "fontWeight", "inSameMonth", "isMinDate", "isMaxDate", "isSelected", "isToday", "selectDate", "selectedColor", "statusColor", "statuses", "statusOffset"]);
|
|
31
31
|
|
|
32
|
-
var affordance = !disabled && !isMinDate && !isMaxDate && (
|
|
32
|
+
var affordance = !disabled && !isMinDate && !isMaxDate && ( // @ts-ignore error TS2339: Property 'onClick' does not exist on type '{}'.
|
|
33
|
+
// @ts-ignore error TS2339: Property 'onMouseDown' does not exist on type '{}'.
|
|
34
|
+
selectDate || restProps.onClick || restProps.onMouseDown);
|
|
33
35
|
return /*#__PURE__*/React.createElement(StackView, {
|
|
34
36
|
width: cellSize,
|
|
35
37
|
height: cellSize,
|
|
@@ -45,7 +47,8 @@ var Day = function Day(_ref) {
|
|
|
45
47
|
width: "100%",
|
|
46
48
|
height: "100%",
|
|
47
49
|
alignment: "center",
|
|
48
|
-
distribution: "center"
|
|
50
|
+
distribution: "center" // @ts-ignore error TS2322: Type '"" | "none"' is not assignable to type 'PointerEvents'.
|
|
51
|
+
,
|
|
49
52
|
pointerEvents: (disabled || isMinDate || isMaxDate) && 'none',
|
|
50
53
|
hover: affordance && {
|
|
51
54
|
backgroundColor: 'highlight'
|