@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
package/dist/cjs/Badge/Badge.js
CHANGED
|
@@ -82,9 +82,13 @@ function Badge(_ref) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (badgeProps.radius === 'circle') {
|
|
85
|
-
|
|
86
|
-
textStyle.
|
|
87
|
-
|
|
85
|
+
// @ts-ignore error TS2339: Property 'position' does not exist on type ...
|
|
86
|
+
textStyle.position = 'absolute'; // @ts-ignore error TS2339: Property 'top' does not exist on type ...
|
|
87
|
+
|
|
88
|
+
textStyle.top = '50%'; // @ts-ignore error TS2339: Property 'left' does not exist on type ...
|
|
89
|
+
|
|
90
|
+
textStyle.left = '50%'; // @ts-ignore error TS2339: Property 'transform' does not exist on type ...
|
|
91
|
+
|
|
88
92
|
textStyle.transform = 'translate(-50%, -50%)';
|
|
89
93
|
}
|
|
90
94
|
|
|
@@ -121,8 +125,12 @@ function Badge(_ref) {
|
|
|
121
125
|
position: "absolute",
|
|
122
126
|
top: 0,
|
|
123
127
|
left: 0
|
|
124
|
-
}, typeof renderLeft === 'string' ? renderLeft :
|
|
125
|
-
|
|
128
|
+
}, typeof renderLeft === 'string' ? renderLeft // @ts-ignore error TS2769: No overload matches this call.
|
|
129
|
+
:
|
|
130
|
+
/*#__PURE__*/
|
|
131
|
+
(0, _react.cloneElement)(renderLeft, {
|
|
132
|
+
size: // @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
133
|
+
renderLeft.props && renderLeft.props.size || badgeProps.size
|
|
126
134
|
})), typeof title === 'undefined' ? children : /*#__PURE__*/_react["default"].createElement(_Text["default"], textStyle, title), renderRight && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
127
135
|
display: "flex",
|
|
128
136
|
alignItems: "center",
|
|
@@ -132,8 +140,12 @@ function Badge(_ref) {
|
|
|
132
140
|
position: "absolute",
|
|
133
141
|
top: 0,
|
|
134
142
|
right: 0
|
|
135
|
-
}, typeof renderRight === 'string' ? renderRight :
|
|
136
|
-
|
|
143
|
+
}, typeof renderRight === 'string' ? renderRight // @ts-ignore error TS2769: No overload matches this call.
|
|
144
|
+
:
|
|
145
|
+
/*#__PURE__*/
|
|
146
|
+
(0, _react.cloneElement)(renderRight, {
|
|
147
|
+
size: // @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
148
|
+
renderRight.props && renderRight.props.size || badgeProps.size
|
|
137
149
|
})));
|
|
138
150
|
}
|
|
139
151
|
|
package/dist/cjs/Badge/Status.js
CHANGED
|
@@ -11,12 +11,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
13
|
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
17
|
-
|
|
18
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
|
|
20
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
15
|
|
|
22
16
|
var _system = require("../system");
|
|
@@ -36,79 +30,60 @@ var statuses = {
|
|
|
36
30
|
}
|
|
37
31
|
};
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
var Status = function Status(_ref) {
|
|
34
|
+
var light = _ref.light,
|
|
35
|
+
onClearRequest = _ref.onClearRequest,
|
|
36
|
+
_ref$size = _ref.size,
|
|
37
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
38
|
+
status = _ref.status,
|
|
39
|
+
title = _ref.title,
|
|
40
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["light", "onClearRequest", "size", "status", "title"]);
|
|
41
|
+
|
|
42
|
+
var _useState = (0, _react.useState)(null),
|
|
43
|
+
timeoutId = _useState[0],
|
|
44
|
+
setTimeoutId = _useState[1];
|
|
45
|
+
|
|
46
|
+
(0, _react.useEffect)(function () {
|
|
47
|
+
var requestClear = function requestClear() {
|
|
48
|
+
if (timeoutId) {
|
|
49
|
+
clearTimeout(timeoutId);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setTimeoutId(setTimeout(onClearRequest, 1800));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
requestClear();
|
|
56
|
+
return function () {
|
|
57
|
+
if (timeoutId) {
|
|
58
|
+
clearTimeout(timeoutId);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}, [onClearRequest, status, timeoutId]);
|
|
62
|
+
|
|
63
|
+
if (!status) {
|
|
64
|
+
return null;
|
|
65
|
+
} else {
|
|
66
|
+
var _statuses$status = statuses[status],
|
|
67
|
+
color = _statuses$status.color,
|
|
68
|
+
icon = _statuses$status.icon;
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_Badge["default"], (0, _extends2["default"])({
|
|
70
|
+
color: light ? {
|
|
71
|
+
background: 'light',
|
|
72
|
+
foreground: (0, _system.getColor)(color)
|
|
73
|
+
} : (0, _system.getColor)(color),
|
|
74
|
+
fontWeight: 600,
|
|
75
|
+
paddingRight: 1,
|
|
76
|
+
radius: "pill",
|
|
77
|
+
renderLeft: /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
78
|
+
name: icon
|
|
79
|
+
}),
|
|
80
|
+
size: size,
|
|
81
|
+
title: title
|
|
82
|
+
}, restProps));
|
|
55
83
|
}
|
|
84
|
+
}; // @ts-ignore error TS2339: Property 'displayName' does not exist on type 'typeof Status'.
|
|
85
|
+
|
|
56
86
|
|
|
57
|
-
var _proto = Status.prototype;
|
|
58
|
-
|
|
59
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
60
|
-
this.requestClear();
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
_proto.componentDidUpdate = function componentDidUpdate(lastProps) {
|
|
64
|
-
if (lastProps.status !== this.props.status) {
|
|
65
|
-
this.requestClear();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
_proto.requestClear = function requestClear() {
|
|
70
|
-
if (this.timeout) {
|
|
71
|
-
clearTimeout(this.timeout);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
this.timeout = setTimeout(this.props.onClearRequest, 1800);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
_proto.render = function render() {
|
|
78
|
-
var _this$props = this.props,
|
|
79
|
-
status = _this$props.status,
|
|
80
|
-
light = _this$props.light,
|
|
81
|
-
onClearRequest = _this$props.onClearRequest,
|
|
82
|
-
props = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, ["status", "light", "onClearRequest"]);
|
|
83
|
-
|
|
84
|
-
if (!status) {
|
|
85
|
-
return null;
|
|
86
|
-
} else {
|
|
87
|
-
var _statuses$status = statuses[status],
|
|
88
|
-
color = _statuses$status.color,
|
|
89
|
-
icon = _statuses$status.icon;
|
|
90
|
-
return /*#__PURE__*/_react["default"].createElement(_Badge["default"], (0, _extends2["default"])({
|
|
91
|
-
paddingRight: 1,
|
|
92
|
-
radius: "pill",
|
|
93
|
-
renderLeft: /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
94
|
-
name: icon
|
|
95
|
-
}),
|
|
96
|
-
color: light ? {
|
|
97
|
-
background: 'light',
|
|
98
|
-
foreground: (0, _system.getColor)(color)
|
|
99
|
-
} : (0, _system.getColor)(color),
|
|
100
|
-
fontWeight: 600
|
|
101
|
-
}, props));
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return Status;
|
|
106
|
-
}(_react.Component);
|
|
107
|
-
|
|
108
|
-
(0, _defineProperty2["default"])(Status, "defaultProps", {
|
|
109
|
-
title: '',
|
|
110
|
-
size: 'sm'
|
|
111
|
-
});
|
|
112
87
|
Status.displayName = 'Badge.Status';
|
|
113
88
|
var _default = Status;
|
|
114
89
|
exports["default"] = _default;
|
package/dist/cjs/Calendar/Day.js
CHANGED
|
@@ -40,7 +40,9 @@ var Day = function Day(_ref) {
|
|
|
40
40
|
_ref$statusOffset = _ref.statusOffset,
|
|
41
41
|
statusOffset = _ref$statusOffset === void 0 ? '15%' : _ref$statusOffset,
|
|
42
42
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["backgroundColor", "cellSize", "children", "color", "date", "disabled", "fontSize", "fontWeight", "inSameMonth", "isMinDate", "isMaxDate", "isSelected", "isToday", "selectDate", "selectedColor", "statusColor", "statuses", "statusOffset"]);
|
|
43
|
-
var affordance = !disabled && !isMinDate && !isMaxDate && (
|
|
43
|
+
var affordance = !disabled && !isMinDate && !isMaxDate && ( // @ts-ignore error TS2339: Property 'onClick' does not exist on type '{}'.
|
|
44
|
+
// @ts-ignore error TS2339: Property 'onMouseDown' does not exist on type '{}'.
|
|
45
|
+
selectDate || restProps.onClick || restProps.onMouseDown);
|
|
44
46
|
return /*#__PURE__*/_react["default"].createElement(_StackView["default"], {
|
|
45
47
|
width: cellSize,
|
|
46
48
|
height: cellSize,
|
|
@@ -56,7 +58,8 @@ var Day = function Day(_ref) {
|
|
|
56
58
|
width: "100%",
|
|
57
59
|
height: "100%",
|
|
58
60
|
alignment: "center",
|
|
59
|
-
distribution: "center"
|
|
61
|
+
distribution: "center" // @ts-ignore error TS2322: Type '"" | "none"' is not assignable to type 'PointerEvents'.
|
|
62
|
+
,
|
|
60
63
|
pointerEvents: (disabled || isMinDate || isMaxDate) && 'none',
|
|
61
64
|
hover: affordance && {
|
|
62
65
|
backgroundColor: 'highlight'
|
|
@@ -45,6 +45,7 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
45
45
|
|
|
46
46
|
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
47
47
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
48
|
+
// @ts-ignore error TS2339: Property 'defaultOpen' does not exist on type 'Readonly<Props>'.
|
|
48
49
|
isPopoverOpen: _this.props.defaultOpen || false
|
|
49
50
|
});
|
|
50
51
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "id", (0, _utils.generateId)('combobox'));
|
|
@@ -52,15 +53,18 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
52
53
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "inputTouched", false);
|
|
53
54
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeRequestId", null);
|
|
54
55
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setItemListRef", function (component) {
|
|
56
|
+
// @ts-ignore error TS2339: Property 'itemList' does not exist on type 'ComboboxPopover'.
|
|
55
57
|
_this.itemList = component;
|
|
56
58
|
});
|
|
57
59
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setInputRef", function (component) {
|
|
60
|
+
// @ts-ignore error TS2339: Property 'input' does not exist on type 'ComboboxPopover'.
|
|
58
61
|
_this.input = component;
|
|
59
62
|
});
|
|
60
63
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "openPopover", function () {
|
|
61
64
|
_this.setState({
|
|
62
65
|
isPopoverOpen: true
|
|
63
66
|
}, function () {
|
|
67
|
+
// @ts-ignore error TS2339: Property 'itemList' does not exist on type 'ComboboxPopover'.
|
|
64
68
|
_this.itemList.setHighlightedIndex(0, {
|
|
65
69
|
maybeScrollIntoView: false
|
|
66
70
|
});
|
|
@@ -72,6 +76,7 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
72
76
|
_this.setState({
|
|
73
77
|
isPopoverOpen: false
|
|
74
78
|
}, function () {
|
|
79
|
+
// @ts-ignore error TS2339: Property 'itemList' does not exist on type 'ComboboxPopover'.
|
|
75
80
|
_this.itemList.clearHighlightedIndex();
|
|
76
81
|
});
|
|
77
82
|
});
|
|
@@ -79,18 +84,21 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
79
84
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleBlur", function (event) {
|
|
80
85
|
_this.closePopover();
|
|
81
86
|
|
|
82
|
-
_this.inputTouched = false;
|
|
87
|
+
_this.inputTouched = false; // @ts-ignore error TS2339: Property 'onBlur' does not exist on type 'Readonly<Props>'.
|
|
83
88
|
|
|
84
89
|
if (_this.props.onBlur) {
|
|
90
|
+
// @ts-ignore error TS2339: Property 'onBlur' does not exist on type 'Readonly<Props>'.
|
|
85
91
|
_this.props.onBlur(event);
|
|
86
92
|
}
|
|
87
93
|
});
|
|
88
94
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSelect", function (event) {
|
|
89
95
|
if (_this.props.closeOnSelect) {
|
|
90
96
|
_this.closePopover();
|
|
91
|
-
}
|
|
97
|
+
} // @ts-ignore error TS2339: Property 'onSelect' does not exist on type 'Readonly<Props>'.
|
|
98
|
+
|
|
92
99
|
|
|
93
100
|
if (_this.props.onSelect) {
|
|
101
|
+
// @ts-ignore error TS2339: Property 'onSelect' does not exist on type 'Readonly<Props>'.
|
|
94
102
|
_this.props.onSelect(event);
|
|
95
103
|
}
|
|
96
104
|
});
|
|
@@ -100,13 +108,16 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
100
108
|
var _proto = ComboboxPopover.prototype;
|
|
101
109
|
|
|
102
110
|
_proto.componentDidUpdate = function componentDidUpdate(lastProps) {
|
|
103
|
-
if (lastProps.disabled !== lastProps.disabled &&
|
|
111
|
+
if (lastProps.disabled !== lastProps.disabled && // @ts-ignore error TS2339: Property 'disabled' does not exist on type 'Readonly<Props>'.
|
|
112
|
+
this.props.disabled === true) {
|
|
104
113
|
this.closePopover();
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
var isComboboxFocused = document.activeElement === this.inputNode;
|
|
108
117
|
|
|
109
|
-
if (isComboboxFocused &&
|
|
118
|
+
if (isComboboxFocused && // @ts-ignore error TS2339: Property 'value' does not exist on type 'Readonly<Props>'.
|
|
119
|
+
lastProps.value !== this.props.value && // @ts-ignore error TS2339: Property 'value' does not exist on type 'Readonly<Props>'.
|
|
120
|
+
this.props.value.length > 0 && !this.state.isPopoverOpen) {
|
|
110
121
|
this.openPopover();
|
|
111
122
|
}
|
|
112
123
|
};
|
|
@@ -159,6 +170,7 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
159
170
|
}, popoverProps, {
|
|
160
171
|
as: _Menu["default"],
|
|
161
172
|
ref: function ref(component) {
|
|
173
|
+
// @ts-ignore error TS2339: Property 'popover' does not exist on type 'ComboboxPopover'.
|
|
162
174
|
_this2.popover = component;
|
|
163
175
|
},
|
|
164
176
|
innerRef: function innerRef(node) {
|
|
@@ -172,7 +184,8 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
172
184
|
relativeTo: relativeTo,
|
|
173
185
|
renderTo: renderTo,
|
|
174
186
|
open: isPopoverOpen,
|
|
175
|
-
onBlur: requestBlur
|
|
187
|
+
onBlur: requestBlur // @ts-ignore error TS2322: Type '(anchorProps: any) => Element' is not assignable to type 'ReactElement<...
|
|
188
|
+
,
|
|
176
189
|
anchorElement: function anchorElement(anchorProps) {
|
|
177
190
|
return /*#__PURE__*/_react["default"].createElement(_ComboboxInput["default"], (0, _extends2["default"])({
|
|
178
191
|
ref: _this2.setInputRef,
|
|
@@ -225,7 +238,8 @@ var ComboboxPopover = /*#__PURE__*/function (_Component) {
|
|
|
225
238
|
_this2.closePopover();
|
|
226
239
|
} else {
|
|
227
240
|
_this2.openPopover();
|
|
228
|
-
}
|
|
241
|
+
} // @ts-ignore error TS2339: Property 'input' does not exist on type 'ComboboxPopover'.
|
|
242
|
+
|
|
229
243
|
|
|
230
244
|
_this2.input.focus();
|
|
231
245
|
}
|
package/dist/cjs/Input/Inline.js
CHANGED
package/dist/cjs/Menu/Item.js
CHANGED
|
@@ -43,10 +43,12 @@ function Item(_ref) {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
if (renderLeft) {
|
|
46
|
+
// @ts-ignore error TS2339: Property 'paddingLeft' does not exist on type
|
|
46
47
|
css.paddingLeft = 5;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
if (renderRight) {
|
|
51
|
+
// @ts-ignore error TS2339: Property 'paddingRight' does not exist on type
|
|
50
52
|
css.paddingRight = 5;
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -55,35 +57,55 @@ function Item(_ref) {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
if (disabled) {
|
|
58
|
-
|
|
60
|
+
// @ts-ignore error TS2339: Property 'cursor' does not exist on type ...
|
|
61
|
+
css.cursor = 'not-allowed'; // @ts-ignore error TS2339: Property 'opacity' does not exist on type ...
|
|
62
|
+
|
|
59
63
|
css.opacity = 0.65;
|
|
60
|
-
} else if (
|
|
64
|
+
} else if ( // @ts-ignore error TS2339: Property 'onClick' does not exist on type '{}'.
|
|
65
|
+
props.onClick || // @ts-ignore error TS2339: Property 'onDoubleClick' does not exist on type '{}'.
|
|
66
|
+
props.onDoubleClick || // @ts-ignore error TS2339: Property 'onMouseDown' does not exist on type '{}'.
|
|
67
|
+
props.onMouseDown || // @ts-ignore error TS2339: Property 'onMouseUp' does not exist on type '{}'.
|
|
68
|
+
props.onMouseUp) {
|
|
69
|
+
// @ts-ignore error TS2339: Property 'cursor' does not exist on type ...
|
|
61
70
|
css.cursor = 'pointer';
|
|
62
71
|
}
|
|
63
72
|
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
return (
|
|
74
|
+
/*#__PURE__*/
|
|
75
|
+
// @ts-ignore error TS2322: Type '{ ... }' is not assignable to type ...
|
|
76
|
+
_react["default"].createElement(_StackView["default"], (0, _extends2["default"])({}, css, props), renderLeft && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
width: 4,
|
|
81
|
+
height: "100%",
|
|
82
|
+
position: "absolute",
|
|
83
|
+
top: 0,
|
|
84
|
+
left: 0.5
|
|
85
|
+
}, typeof renderLeft === 'function' // @ts-ignore error TS2349: This expression is not callable.
|
|
86
|
+
? renderRight() // @ts-ignore error TS2769: No overload matches this call.
|
|
87
|
+
:
|
|
88
|
+
/*#__PURE__*/
|
|
89
|
+
(0, _react.cloneElement)(renderLeft, {
|
|
90
|
+
// @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
91
|
+
size: renderLeft.props && renderLeft.props.size || 'md'
|
|
92
|
+
})), children, renderRight && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
93
|
+
display: "flex",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "center",
|
|
96
|
+
width: 4,
|
|
97
|
+
height: "100%",
|
|
98
|
+
position: "absolute",
|
|
99
|
+
top: 0,
|
|
100
|
+
right: 0.5
|
|
101
|
+
}, typeof renderRight === 'function' ? renderRight() // @ts-ignore error TS2769: No overload matches this call.
|
|
102
|
+
:
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
(0, _react.cloneElement)(renderRight, {
|
|
105
|
+
// @ts-ignore error TS2339: Property 'props' does not exist on type ...
|
|
106
|
+
size: renderRight.props && renderRight.props.size || 'md'
|
|
107
|
+
})))
|
|
108
|
+
);
|
|
87
109
|
}
|
|
88
110
|
|
|
89
111
|
Item.displayName = 'Menu.Item';
|
package/dist/cjs/Modal/Modal.js
CHANGED
|
@@ -23,9 +23,10 @@ var _utils = require("../utils");
|
|
|
23
23
|
|
|
24
24
|
var _system = require("../system");
|
|
25
25
|
|
|
26
|
-
function Modal(_ref) {
|
|
26
|
+
var Modal = function Modal(_ref) {
|
|
27
27
|
var children = _ref.children,
|
|
28
|
-
|
|
28
|
+
_ref$closeOnOutsideCl = _ref.closeOnOutsideClick,
|
|
29
|
+
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? false : _ref$closeOnOutsideCl,
|
|
29
30
|
onRequestClose = _ref.onRequestClose,
|
|
30
31
|
open = _ref.open,
|
|
31
32
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["children", "closeOnOutsideClick", "onRequestClose", "open"]);
|
|
@@ -69,7 +70,7 @@ function Modal(_ref) {
|
|
|
69
70
|
radius: 8,
|
|
70
71
|
width: "100%"
|
|
71
72
|
}, themeProps), children));
|
|
72
|
-
}
|
|
73
|
+
};
|
|
73
74
|
|
|
74
75
|
var _default = Modal;
|
|
75
76
|
exports["default"] = _default;
|