@instructure/ui-buttons 8.25.1-snapshot-10 → 8.25.1-snapshot-15
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/CHANGELOG.md +1 -1
- package/es/BaseButton/index.js +87 -87
- package/es/Button/index.js +33 -34
- package/es/CloseButton/index.js +24 -25
- package/es/CondensedButton/index.js +25 -26
- package/es/IconButton/index.js +28 -29
- package/es/ToggleButton/index.js +22 -27
- package/lib/BaseButton/index.js +87 -87
- package/lib/Button/index.js +33 -34
- package/lib/CloseButton/index.js +25 -26
- package/lib/CondensedButton/index.js +26 -27
- package/lib/IconButton/index.js +29 -30
- package/lib/ToggleButton/index.js +22 -27
- package/package.json +20 -20
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [8.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-15](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-15) (2022-06-23)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-buttons
|
|
9
9
|
|
package/es/BaseButton/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -47,39 +47,76 @@ category: components/utilities
|
|
|
47
47
|
---
|
|
48
48
|
@tsProps
|
|
49
49
|
**/
|
|
50
|
-
let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class BaseButton extends Component {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class BaseButton extends Component {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.ref = null;
|
|
54
|
+
|
|
55
|
+
this.handleElementRef = el => {
|
|
56
|
+
const elementRef = this.props.elementRef;
|
|
57
|
+
this.ref = el;
|
|
58
|
+
|
|
59
|
+
if (typeof elementRef === 'function') {
|
|
60
|
+
elementRef(el);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
this.handleClick = event => {
|
|
65
|
+
const onClick = this.props.onClick;
|
|
66
|
+
const interaction = this.interaction;
|
|
67
|
+
|
|
68
|
+
if (interaction !== 'enabled') {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
event.stopPropagation();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (typeof onClick === 'function') {
|
|
75
|
+
onClick(event);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
this.handleKeyDown = event => {
|
|
80
|
+
const _this$props = this.props,
|
|
81
|
+
onClick = _this$props.onClick,
|
|
82
|
+
onKeyDown = _this$props.onKeyDown,
|
|
83
|
+
href = _this$props.href;
|
|
84
|
+
const interaction = this.interaction;
|
|
85
|
+
|
|
86
|
+
if (typeof onKeyDown === 'function') {
|
|
87
|
+
onKeyDown(event);
|
|
88
|
+
} // behave like a button when space key is pressed
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
const _keycode$codes = keycode.codes,
|
|
92
|
+
space = _keycode$codes.space,
|
|
93
|
+
enter = _keycode$codes.enter;
|
|
94
|
+
|
|
95
|
+
if (this.elementType !== 'button' && [space, enter].includes(event.keyCode)) {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
event.stopPropagation();
|
|
98
|
+
|
|
99
|
+
if (typeof onClick === 'function' && interaction === 'enabled') {
|
|
100
|
+
onClick(event);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (href) {
|
|
104
|
+
this.ref && this.ref.click();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
72
109
|
|
|
73
110
|
componentDidMount() {
|
|
74
|
-
var _this$props$makeStyle, _this$
|
|
111
|
+
var _this$props$makeStyle, _this$props2;
|
|
75
112
|
|
|
76
|
-
(_this$props$makeStyle = (_this$
|
|
113
|
+
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2, this.makeStylesVariables);
|
|
77
114
|
}
|
|
78
115
|
|
|
79
116
|
componentDidUpdate() {
|
|
80
|
-
var _this$props$makeStyle2, _this$
|
|
117
|
+
var _this$props$makeStyle2, _this$props3;
|
|
81
118
|
|
|
82
|
-
(_this$props$makeStyle2 = (_this$
|
|
119
|
+
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3, this.makeStylesVariables);
|
|
83
120
|
}
|
|
84
121
|
|
|
85
122
|
get _rootElement() {
|
|
@@ -94,9 +131,9 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
94
131
|
}
|
|
95
132
|
|
|
96
133
|
get hasOnlyIconVisible() {
|
|
97
|
-
const _this$
|
|
98
|
-
children = _this$
|
|
99
|
-
renderIcon = _this$
|
|
134
|
+
const _this$props4 = this.props,
|
|
135
|
+
children = _this$props4.children,
|
|
136
|
+
renderIcon = _this$props4.renderIcon;
|
|
100
137
|
return !!(renderIcon && !hasVisibleChildren(children));
|
|
101
138
|
}
|
|
102
139
|
|
|
@@ -135,10 +172,10 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
135
172
|
}
|
|
136
173
|
|
|
137
174
|
get focusColor() {
|
|
138
|
-
const _this$
|
|
139
|
-
color = _this$
|
|
140
|
-
focusColor = _this$
|
|
141
|
-
withBackground = _this$
|
|
175
|
+
const _this$props5 = this.props,
|
|
176
|
+
color = _this$props5.color,
|
|
177
|
+
focusColor = _this$props5.focusColor,
|
|
178
|
+
withBackground = _this$props5.withBackground; // Give user specified focusColor preference
|
|
142
179
|
|
|
143
180
|
if (focusColor) {
|
|
144
181
|
return focusColor;
|
|
@@ -163,58 +200,6 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
163
200
|
this.ref && this.ref.focus();
|
|
164
201
|
}
|
|
165
202
|
|
|
166
|
-
handleElementRef = el => {
|
|
167
|
-
const elementRef = this.props.elementRef;
|
|
168
|
-
this.ref = el;
|
|
169
|
-
|
|
170
|
-
if (typeof elementRef === 'function') {
|
|
171
|
-
elementRef(el);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
handleClick = event => {
|
|
175
|
-
const onClick = this.props.onClick;
|
|
176
|
-
const interaction = this.interaction;
|
|
177
|
-
|
|
178
|
-
if (interaction !== 'enabled') {
|
|
179
|
-
event.preventDefault();
|
|
180
|
-
event.stopPropagation();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (typeof onClick === 'function') {
|
|
185
|
-
onClick(event);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
handleKeyDown = event => {
|
|
189
|
-
const _this$props5 = this.props,
|
|
190
|
-
onClick = _this$props5.onClick,
|
|
191
|
-
onKeyDown = _this$props5.onKeyDown,
|
|
192
|
-
href = _this$props5.href;
|
|
193
|
-
const interaction = this.interaction;
|
|
194
|
-
|
|
195
|
-
if (typeof onKeyDown === 'function') {
|
|
196
|
-
onKeyDown(event);
|
|
197
|
-
} // behave like a button when space key is pressed
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const _keycode$codes = keycode.codes,
|
|
201
|
-
space = _keycode$codes.space,
|
|
202
|
-
enter = _keycode$codes.enter;
|
|
203
|
-
|
|
204
|
-
if (this.elementType !== 'button' && [space, enter].includes(event.keyCode)) {
|
|
205
|
-
event.preventDefault();
|
|
206
|
-
event.stopPropagation();
|
|
207
|
-
|
|
208
|
-
if (typeof onClick === 'function' && interaction === 'enabled') {
|
|
209
|
-
onClick(event);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (href) {
|
|
213
|
-
this.ref && this.ref.click();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
|
|
218
203
|
renderChildren() {
|
|
219
204
|
const _this$props6 = this.props,
|
|
220
205
|
renderIcon = _this$props6.renderIcon,
|
|
@@ -300,6 +285,21 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
300
285
|
}, this.renderChildren()));
|
|
301
286
|
}
|
|
302
287
|
|
|
303
|
-
}
|
|
288
|
+
}, _class2.displayName = "BaseButton", _class2.componentId = 'BaseButton', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
289
|
+
type: 'button',
|
|
290
|
+
size: 'medium',
|
|
291
|
+
as: 'button',
|
|
292
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
293
|
+
interaction: void 0,
|
|
294
|
+
color: 'secondary',
|
|
295
|
+
shape: 'rectangle',
|
|
296
|
+
display: 'inline-block',
|
|
297
|
+
textAlign: 'start',
|
|
298
|
+
withBackground: true,
|
|
299
|
+
withBorder: true,
|
|
300
|
+
isCondensed: false,
|
|
301
|
+
margin: '0',
|
|
302
|
+
cursor: 'pointer'
|
|
303
|
+
}, _class2)) || _class) || _class);
|
|
304
304
|
export { BaseButton };
|
|
305
305
|
export default BaseButton;
|
package/es/Button/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children", "type", "size", "as", "color", "focusColor", "display", "textAlign", "withBackground", "margin", "cursor", "href", "renderIcon"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -41,26 +41,25 @@ category: components
|
|
|
41
41
|
@tsProps
|
|
42
42
|
**/
|
|
43
43
|
// needed for listing the available theme variables on docs page
|
|
44
|
-
let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class Button extends Component {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ref = null;
|
|
44
|
+
let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class Button extends Component {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
this._buttonComponent = null;
|
|
48
|
+
this.ref = null;
|
|
49
|
+
|
|
50
|
+
this.handleElementRef = el => {
|
|
51
|
+
const elementRef = this.props.elementRef;
|
|
52
|
+
this.ref = el;
|
|
53
|
+
|
|
54
|
+
if (typeof elementRef === 'function') {
|
|
55
|
+
elementRef(el);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
this.handleButtonRef = component => {
|
|
60
|
+
this._buttonComponent = component;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
64
63
|
|
|
65
64
|
get focused() {
|
|
66
65
|
return this._buttonComponent && this._buttonComponent.focused;
|
|
@@ -70,18 +69,6 @@ let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable()
|
|
|
70
69
|
this._buttonComponent && this._buttonComponent.focus();
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
handleElementRef = el => {
|
|
74
|
-
const elementRef = this.props.elementRef;
|
|
75
|
-
this.ref = el;
|
|
76
|
-
|
|
77
|
-
if (typeof elementRef === 'function') {
|
|
78
|
-
elementRef(el);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
handleButtonRef = component => {
|
|
82
|
-
this._buttonComponent = component;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
72
|
render() {
|
|
86
73
|
const _this$props = this.props,
|
|
87
74
|
children = _this$props.children,
|
|
@@ -124,6 +111,18 @@ let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable()
|
|
|
124
111
|
return /*#__PURE__*/React.createElement(BaseButton, buttonProps, children);
|
|
125
112
|
}
|
|
126
113
|
|
|
127
|
-
}
|
|
114
|
+
}, _class2.displayName = "Button", _class2.componentId = 'Button', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
115
|
+
type: 'button',
|
|
116
|
+
size: 'medium',
|
|
117
|
+
as: 'button',
|
|
118
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
119
|
+
interaction: void 0,
|
|
120
|
+
color: 'secondary',
|
|
121
|
+
display: 'inline-block',
|
|
122
|
+
textAlign: 'center',
|
|
123
|
+
withBackground: true,
|
|
124
|
+
margin: '0',
|
|
125
|
+
cursor: 'pointer'
|
|
126
|
+
}, _class2)) || _class) || _class);
|
|
128
127
|
export default Button;
|
|
129
128
|
export { Button };
|
package/es/CloseButton/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["screenReaderLabel", "elementRef", "size", "onClick", "margin", "placement", "offset", "type", "as", "href", "cursor", "tabIndex", "styles"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -45,30 +45,19 @@ category: components
|
|
|
45
45
|
---
|
|
46
46
|
@tsProps
|
|
47
47
|
**/
|
|
48
|
-
let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class CloseButton extends Component {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
static allowedProps = allowedProps;
|
|
53
|
-
static defaultProps = {
|
|
54
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
55
|
-
interaction: void 0,
|
|
56
|
-
type: 'button',
|
|
57
|
-
placement: 'static',
|
|
58
|
-
offset: 'x-small',
|
|
59
|
-
size: 'small',
|
|
60
|
-
margin: '0',
|
|
61
|
-
as: 'button',
|
|
62
|
-
cursor: 'pointer'
|
|
63
|
-
};
|
|
64
|
-
ref = null;
|
|
65
|
-
handleRef = el => {
|
|
66
|
-
const elementRef = this.props.elementRef;
|
|
48
|
+
let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class CloseButton extends Component {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
this.ref = null;
|
|
67
52
|
|
|
68
|
-
|
|
69
|
-
elementRef
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
this.handleRef = el => {
|
|
54
|
+
const elementRef = this.props.elementRef;
|
|
55
|
+
|
|
56
|
+
if (typeof elementRef === 'function') {
|
|
57
|
+
elementRef(el);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
72
61
|
|
|
73
62
|
componentDidMount() {
|
|
74
63
|
var _this$props$makeStyle, _this$props;
|
|
@@ -131,6 +120,16 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
131
120
|
}, jsx(ScreenReaderContent, null, screenReaderLabel)));
|
|
132
121
|
}
|
|
133
122
|
|
|
134
|
-
}
|
|
123
|
+
}, _class2.displayName = "CloseButton", _class2.componentId = 'CloseButton', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
124
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
125
|
+
interaction: void 0,
|
|
126
|
+
type: 'button',
|
|
127
|
+
placement: 'static',
|
|
128
|
+
offset: 'x-small',
|
|
129
|
+
size: 'small',
|
|
130
|
+
margin: '0',
|
|
131
|
+
as: 'button',
|
|
132
|
+
cursor: 'pointer'
|
|
133
|
+
}, _class2)) || _class) || _class);
|
|
135
134
|
export default CloseButton;
|
|
136
135
|
export { CloseButton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children", "type", "size", "elementRef", "as", "interaction", "color", "margin", "cursor", "href", "renderIcon"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -41,31 +41,21 @@ category: components
|
|
|
41
41
|
@tsProps
|
|
42
42
|
**/
|
|
43
43
|
// needed for listing the available theme variables on docs page
|
|
44
|
-
let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class CondensedButton extends Component {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
static defaultProps = {
|
|
50
|
-
type: 'button',
|
|
51
|
-
size: 'medium',
|
|
52
|
-
as: 'button',
|
|
53
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
54
|
-
interaction: void 0,
|
|
55
|
-
color: 'primary',
|
|
56
|
-
margin: '0',
|
|
57
|
-
cursor: 'pointer'
|
|
58
|
-
};
|
|
59
|
-
_baseButton = null;
|
|
60
|
-
ref = null;
|
|
61
|
-
handleRef = el => {
|
|
62
|
-
const elementRef = this.props.elementRef;
|
|
63
|
-
this.ref = el;
|
|
44
|
+
let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class CondensedButton extends Component {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
this._baseButton = null;
|
|
48
|
+
this.ref = null;
|
|
64
49
|
|
|
65
|
-
|
|
66
|
-
elementRef
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
this.handleRef = el => {
|
|
51
|
+
const elementRef = this.props.elementRef;
|
|
52
|
+
this.ref = el;
|
|
53
|
+
|
|
54
|
+
if (typeof elementRef === 'function') {
|
|
55
|
+
elementRef(el);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
69
59
|
|
|
70
60
|
get focused() {
|
|
71
61
|
return this._baseButton && this._baseButton.focused;
|
|
@@ -112,6 +102,15 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
|
|
|
112
102
|
}), children);
|
|
113
103
|
}
|
|
114
104
|
|
|
115
|
-
}
|
|
105
|
+
}, _class2.displayName = "CondensedButton", _class2.componentId = 'CondensedButton', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
106
|
+
type: 'button',
|
|
107
|
+
size: 'medium',
|
|
108
|
+
as: 'button',
|
|
109
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
110
|
+
interaction: void 0,
|
|
111
|
+
color: 'primary',
|
|
112
|
+
margin: '0',
|
|
113
|
+
cursor: 'pointer'
|
|
114
|
+
}, _class2)) || _class) || _class);
|
|
116
115
|
export default CondensedButton;
|
|
117
116
|
export { CondensedButton };
|
package/es/IconButton/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children", "renderIcon", "screenReaderLabel", "type", "size", "elementRef", "as", "interaction", "color", "focusColor", "shape", "withBackground", "withBorder", "margin", "cursor", "href"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -42,34 +42,21 @@ category: components
|
|
|
42
42
|
@tsProps
|
|
43
43
|
**/
|
|
44
44
|
// needed for listing the available theme variables on docs page
|
|
45
|
-
let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class IconButton extends Component {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
static defaultProps = {
|
|
51
|
-
type: 'button',
|
|
52
|
-
size: 'medium',
|
|
53
|
-
as: 'button',
|
|
54
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
55
|
-
interaction: void 0,
|
|
56
|
-
color: 'secondary',
|
|
57
|
-
shape: 'rectangle',
|
|
58
|
-
withBackground: true,
|
|
59
|
-
withBorder: true,
|
|
60
|
-
margin: '0',
|
|
61
|
-
cursor: 'pointer'
|
|
62
|
-
};
|
|
63
|
-
_baseButton = null;
|
|
64
|
-
ref = null;
|
|
65
|
-
handleRef = el => {
|
|
66
|
-
const elementRef = this.props.elementRef;
|
|
67
|
-
this.ref = el;
|
|
45
|
+
let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class IconButton extends Component {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
this._baseButton = null;
|
|
49
|
+
this.ref = null;
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
elementRef
|
|
71
|
-
|
|
72
|
-
|
|
51
|
+
this.handleRef = el => {
|
|
52
|
+
const elementRef = this.props.elementRef;
|
|
53
|
+
this.ref = el;
|
|
54
|
+
|
|
55
|
+
if (typeof elementRef === 'function') {
|
|
56
|
+
elementRef(el);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
73
60
|
|
|
74
61
|
get focused() {
|
|
75
62
|
return this._baseButton && this._baseButton.focused;
|
|
@@ -122,6 +109,18 @@ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testab
|
|
|
122
109
|
}), /*#__PURE__*/React.createElement(ScreenReaderContent, null, screenReaderLabel));
|
|
123
110
|
}
|
|
124
111
|
|
|
125
|
-
}
|
|
112
|
+
}, _class2.displayName = "IconButton", _class2.componentId = 'IconButton', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
113
|
+
type: 'button',
|
|
114
|
+
size: 'medium',
|
|
115
|
+
as: 'button',
|
|
116
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
117
|
+
interaction: void 0,
|
|
118
|
+
color: 'secondary',
|
|
119
|
+
shape: 'rectangle',
|
|
120
|
+
withBackground: true,
|
|
121
|
+
withBorder: true,
|
|
122
|
+
margin: '0',
|
|
123
|
+
cursor: 'pointer'
|
|
124
|
+
}, _class2)) || _class) || _class);
|
|
126
125
|
export default IconButton;
|
|
127
126
|
export { IconButton };
|
package/es/ToggleButton/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["as", "color", "elementRef", "size", "interaction", "mountNode", "renderIcon", "renderTooltipContent", "screenReaderLabel", "status", "placement", "onClick"];
|
|
3
3
|
|
|
4
|
-
var _dec, _class;
|
|
4
|
+
var _dec, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -39,38 +39,24 @@ category: components
|
|
|
39
39
|
---
|
|
40
40
|
@tsProps
|
|
41
41
|
**/
|
|
42
|
-
let ToggleButton = (_dec = testable(), _dec(_class = class ToggleButton extends Component {
|
|
43
|
-
static displayName = "ToggleButton";
|
|
44
|
-
static componentId = 'ToggleButton';
|
|
45
|
-
static propTypes = propTypes;
|
|
46
|
-
static allowedProps = allowedProps;
|
|
47
|
-
static defaultProps = {
|
|
48
|
-
size: 'medium',
|
|
49
|
-
as: 'button',
|
|
50
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
51
|
-
interaction: void 0,
|
|
52
|
-
mountNode: null,
|
|
53
|
-
color: 'secondary',
|
|
54
|
-
placement: 'top center',
|
|
55
|
-
constrain: 'window'
|
|
56
|
-
};
|
|
57
|
-
|
|
42
|
+
let ToggleButton = (_dec = testable(), _dec(_class = (_class2 = class ToggleButton extends Component {
|
|
58
43
|
constructor(props) {
|
|
59
44
|
super(props);
|
|
45
|
+
this.ref = null;
|
|
46
|
+
|
|
47
|
+
this.handleRef = el => {
|
|
48
|
+
const elementRef = this.props.elementRef;
|
|
49
|
+
|
|
50
|
+
if (typeof elementRef === 'function') {
|
|
51
|
+
elementRef(el);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
60
55
|
this.state = {
|
|
61
56
|
isShowingTooltip: props.isShowingTooltip || false
|
|
62
57
|
};
|
|
63
58
|
}
|
|
64
59
|
|
|
65
|
-
ref = null;
|
|
66
|
-
handleRef = el => {
|
|
67
|
-
const elementRef = this.props.elementRef;
|
|
68
|
-
|
|
69
|
-
if (typeof elementRef === 'function') {
|
|
70
|
-
elementRef(el);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
60
|
get isShowingTooltip() {
|
|
75
61
|
return typeof this.props.isShowingTooltip === 'undefined' ? this.state.isShowingTooltip : this.props.isShowingTooltip;
|
|
76
62
|
}
|
|
@@ -123,6 +109,15 @@ let ToggleButton = (_dec = testable(), _dec(_class = class ToggleButton extends
|
|
|
123
109
|
}), callRenderProp(renderIcon)));
|
|
124
110
|
}
|
|
125
111
|
|
|
126
|
-
}
|
|
112
|
+
}, _class2.displayName = "ToggleButton", _class2.componentId = 'ToggleButton', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
113
|
+
size: 'medium',
|
|
114
|
+
as: 'button',
|
|
115
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
116
|
+
interaction: void 0,
|
|
117
|
+
mountNode: null,
|
|
118
|
+
color: 'secondary',
|
|
119
|
+
placement: 'top center',
|
|
120
|
+
constrain: 'window'
|
|
121
|
+
}, _class2)) || _class);
|
|
127
122
|
export { ToggleButton };
|
|
128
123
|
export default ToggleButton;
|