@planningcenter/tapestry-react 2.9.1 → 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/TimeField/TimeField.js +7 -2
- 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/button-themes.js +21 -21
- package/dist/cjs/system/colors/utils.js +3 -1
- 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/TimeField/TimeField.js +7 -2
- 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/button-themes.js +21 -21
- package/dist/esm/system/colors/utils.js +2 -1
- 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.mdx +1 -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/TimeField/TimeField.tsx +7 -2
- 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/button-themes.js +21 -21
- package/src/system/colors/utils.js +2 -1
- 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;
|
|
@@ -188,8 +188,13 @@ var TimeField = function TimeField(_ref) {
|
|
|
188
188
|
setHours(updatedHoursValue);
|
|
189
189
|
setHoursDisplay(updatedHoursValue);
|
|
190
190
|
} else {
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
if (updatedHoursValue === 12) {
|
|
192
|
+
setHours(12);
|
|
193
|
+
setHoursDisplay(12);
|
|
194
|
+
} else {
|
|
195
|
+
setHours(updatedHoursValue + 12);
|
|
196
|
+
setHoursDisplay(updatedHoursValue);
|
|
197
|
+
}
|
|
193
198
|
}
|
|
194
199
|
} else {
|
|
195
200
|
setHours(updatedHoursValue);
|
|
@@ -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;
|
|
@@ -191,63 +191,63 @@ var buttonThemes = {
|
|
|
191
191
|
},
|
|
192
192
|
error: {
|
|
193
193
|
fill: {
|
|
194
|
-
color: '
|
|
195
|
-
backgroundColor: '
|
|
194
|
+
color: 'white',
|
|
195
|
+
backgroundColor: 'error',
|
|
196
196
|
hover: {
|
|
197
|
-
backgroundColor: '
|
|
197
|
+
backgroundColor: 'error-dark'
|
|
198
198
|
},
|
|
199
199
|
active: {
|
|
200
|
-
backgroundColor: '
|
|
200
|
+
backgroundColor: 'error-darker'
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
outline: {
|
|
204
|
-
stroke: '
|
|
205
|
-
color: '
|
|
204
|
+
stroke: 'error',
|
|
205
|
+
color: 'error',
|
|
206
206
|
hover: {
|
|
207
|
-
backgroundColor: '
|
|
207
|
+
backgroundColor: 'error-lightest'
|
|
208
208
|
},
|
|
209
209
|
active: {
|
|
210
|
-
backgroundColor: '
|
|
210
|
+
backgroundColor: 'error-lighter'
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
naked: {
|
|
214
214
|
color: 'error',
|
|
215
215
|
hover: {
|
|
216
|
-
backgroundColor: '
|
|
216
|
+
backgroundColor: 'error-lightest'
|
|
217
217
|
},
|
|
218
218
|
active: {
|
|
219
|
-
backgroundColor: '
|
|
219
|
+
backgroundColor: 'error-lighter'
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
223
|
success: {
|
|
224
224
|
fill: {
|
|
225
|
-
color: '
|
|
226
|
-
backgroundColor: '
|
|
225
|
+
color: 'white',
|
|
226
|
+
backgroundColor: 'success',
|
|
227
227
|
hover: {
|
|
228
|
-
backgroundColor: '
|
|
228
|
+
backgroundColor: 'success-dark'
|
|
229
229
|
},
|
|
230
230
|
active: {
|
|
231
|
-
backgroundColor: '
|
|
231
|
+
backgroundColor: 'success-darker'
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
234
|
outline: {
|
|
235
|
-
stroke: '
|
|
236
|
-
color: '
|
|
235
|
+
stroke: 'success',
|
|
236
|
+
color: 'success',
|
|
237
237
|
hover: {
|
|
238
|
-
backgroundColor: '
|
|
238
|
+
backgroundColor: 'success-lightest'
|
|
239
239
|
},
|
|
240
240
|
active: {
|
|
241
|
-
backgroundColor: '
|
|
241
|
+
backgroundColor: 'success-lighter'
|
|
242
242
|
}
|
|
243
243
|
},
|
|
244
244
|
naked: {
|
|
245
|
-
color: '
|
|
245
|
+
color: 'success',
|
|
246
246
|
hover: {
|
|
247
|
-
backgroundColor: '
|
|
247
|
+
backgroundColor: 'success-lightest'
|
|
248
248
|
},
|
|
249
249
|
active: {
|
|
250
|
-
backgroundColor: '
|
|
250
|
+
backgroundColor: 'success-lighter'
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
},
|
|
@@ -19,6 +19,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
19
19
|
|
|
20
20
|
var _polished = require("polished");
|
|
21
21
|
|
|
22
|
+
var _utils = require("../../utils");
|
|
23
|
+
|
|
22
24
|
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; }
|
|
23
25
|
|
|
24
26
|
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; }
|
|
@@ -101,7 +103,7 @@ function flattenPalette(palette) {
|
|
|
101
103
|
|
|
102
104
|
var value = parsedPalette[key];
|
|
103
105
|
var aliasValue = parsedPalette[value];
|
|
104
|
-
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ?
|
|
106
|
+
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ? (0, _utils.getCSSProperty)('colors', value) : value, _objectSpread5));
|
|
105
107
|
}, {});
|
|
106
108
|
} // ported from ChromaJS
|
|
107
109
|
// https://github.com/gka/chroma.js/blob/d2c6d917df4ba2b87d8a740de116a0656bcbdfd5/src/io/lightness.coffee
|
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
|
|