@instructure/ui-buttons 8.8.1-snapshot.3 → 8.8.1-snapshot.63

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.
Files changed (93) hide show
  1. package/es/BaseButton/index.js +14 -135
  2. package/es/BaseButton/props.js +138 -0
  3. package/es/Button/index.js +4 -87
  4. package/es/Button/props.js +107 -0
  5. package/es/CloseButton/index.js +5 -93
  6. package/es/CloseButton/props.js +103 -0
  7. package/es/CondensedButton/index.js +4 -65
  8. package/es/CondensedButton/props.js +86 -0
  9. package/es/IconButton/index.js +4 -91
  10. package/es/IconButton/props.js +111 -0
  11. package/es/ToggleButton/index.js +2 -77
  12. package/es/ToggleButton/props.js +100 -0
  13. package/lib/BaseButton/index.js +14 -135
  14. package/lib/BaseButton/props.js +150 -0
  15. package/lib/Button/index.js +4 -87
  16. package/lib/Button/props.js +119 -0
  17. package/lib/CloseButton/index.js +5 -93
  18. package/lib/CloseButton/props.js +115 -0
  19. package/lib/CondensedButton/index.js +4 -65
  20. package/lib/CondensedButton/props.js +98 -0
  21. package/lib/IconButton/index.js +4 -91
  22. package/lib/IconButton/props.js +123 -0
  23. package/lib/ToggleButton/index.js +3 -79
  24. package/lib/ToggleButton/props.js +112 -0
  25. package/package.json +21 -21
  26. package/src/BaseButton/index.tsx +18 -123
  27. package/src/BaseButton/props.ts +192 -0
  28. package/src/BaseButton/styles.ts +1 -1
  29. package/src/Button/index.tsx +7 -81
  30. package/src/Button/props.ts +149 -0
  31. package/src/CloseButton/index.tsx +8 -82
  32. package/src/CloseButton/props.ts +137 -0
  33. package/src/CloseButton/styles.ts +1 -1
  34. package/src/CondensedButton/index.tsx +7 -57
  35. package/src/CondensedButton/props.ts +118 -0
  36. package/src/IconButton/index.tsx +7 -84
  37. package/src/IconButton/props.ts +154 -0
  38. package/src/ToggleButton/index.tsx +5 -68
  39. package/src/ToggleButton/props.ts +140 -0
  40. package/src/index.ts +6 -6
  41. package/types/BaseButton/index.d.ts +63 -117
  42. package/types/BaseButton/index.d.ts.map +1 -1
  43. package/types/BaseButton/{types.d.ts → props.d.ts} +14 -8
  44. package/types/BaseButton/props.d.ts.map +1 -0
  45. package/types/BaseButton/styles.d.ts +1 -1
  46. package/types/Button/index.d.ts +36 -73
  47. package/types/Button/index.d.ts.map +1 -1
  48. package/types/Button/{types.d.ts → props.d.ts} +12 -4
  49. package/types/Button/props.d.ts.map +1 -0
  50. package/types/CloseButton/index.d.ts +41 -75
  51. package/types/CloseButton/index.d.ts.map +1 -1
  52. package/types/CloseButton/props.d.ts +27 -0
  53. package/types/CloseButton/props.d.ts.map +1 -0
  54. package/types/CloseButton/styles.d.ts +1 -1
  55. package/types/CondensedButton/index.d.ts +28 -55
  56. package/types/CondensedButton/index.d.ts.map +1 -1
  57. package/types/CondensedButton/props.d.ts +24 -0
  58. package/types/CondensedButton/props.d.ts.map +1 -0
  59. package/types/IconButton/index.d.ts +38 -76
  60. package/types/IconButton/index.d.ts.map +1 -1
  61. package/types/IconButton/{types.d.ts → props.d.ts} +11 -3
  62. package/types/IconButton/props.d.ts.map +1 -0
  63. package/types/ToggleButton/index.d.ts +34 -65
  64. package/types/ToggleButton/index.d.ts.map +1 -1
  65. package/types/ToggleButton/{types.d.ts → props.d.ts} +10 -3
  66. package/types/ToggleButton/props.d.ts.map +1 -0
  67. package/types/index.d.ts +6 -6
  68. package/es/BaseButton/types.js +0 -1
  69. package/es/Button/types.js +0 -1
  70. package/es/CloseButton/types.js +0 -1
  71. package/es/CondensedButton/types.js +0 -1
  72. package/es/IconButton/types.js +0 -1
  73. package/es/ToggleButton/types.js +0 -1
  74. package/lib/BaseButton/types.js +0 -1
  75. package/lib/Button/types.js +0 -1
  76. package/lib/CloseButton/types.js +0 -1
  77. package/lib/CondensedButton/types.js +0 -1
  78. package/lib/IconButton/types.js +0 -1
  79. package/lib/ToggleButton/types.js +0 -1
  80. package/src/BaseButton/types.ts +0 -57
  81. package/src/Button/types.ts +0 -44
  82. package/src/CloseButton/types.ts +0 -45
  83. package/src/CondensedButton/types.ts +0 -40
  84. package/src/IconButton/types.ts +0 -45
  85. package/src/ToggleButton/types.ts +0 -48
  86. package/types/BaseButton/types.d.ts.map +0 -1
  87. package/types/Button/types.d.ts.map +0 -1
  88. package/types/CloseButton/types.d.ts +0 -22
  89. package/types/CloseButton/types.d.ts.map +0 -1
  90. package/types/CondensedButton/types.d.ts +0 -16
  91. package/types/CondensedButton/types.d.ts.map +0 -1
  92. package/types/IconButton/types.d.ts.map +0 -1
  93. package/types/ToggleButton/types.d.ts.map +0 -1
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _emotion = require("@instructure/emotion");
13
+
14
+ /*
15
+ * The MIT License (MIT)
16
+ *
17
+ * Copyright (c) 2015 - present Instructure, Inc.
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ * of this software and associated documentation files (the "Software"), to deal
21
+ * in the Software without restriction, including without limitation the rights
22
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ * copies of the Software, and to permit persons to whom the Software is
24
+ * furnished to do so, subject to the following conditions:
25
+ *
26
+ * The above copyright notice and this permission notice shall be included in all
27
+ * copies or substantial portions of the Software.
28
+ *
29
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ * SOFTWARE.
36
+ */
37
+ const propTypes = {
38
+ /**
39
+ * An accessible label for the `CloseButton` (required)
40
+ */
41
+ screenReaderLabel: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
42
+
43
+ /**
44
+ * Specifies the color for the `CloseButton`.
45
+ */
46
+ color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
47
+
48
+ /**
49
+ * Specifies if interaction with the `CloseButton` is enabled, disabled, or readonly.
50
+ */
51
+ interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
52
+
53
+ /**
54
+ * Provides a reference to the `CloseButton`'s underlying html element.
55
+ */
56
+ elementRef: _propTypes.default.func,
57
+
58
+ /**
59
+ * The size of the `CloseButton`
60
+ */
61
+ size: _propTypes.default.oneOf(['small', 'medium', 'large']),
62
+
63
+ /**
64
+ * Callback fired when the `CloseButton` is clicked.
65
+ */
66
+ onClick: _propTypes.default.func,
67
+
68
+ /**
69
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
70
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
71
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
72
+ */
73
+ margin: _emotion.ThemeablePropTypes.spacing,
74
+
75
+ /**
76
+ * Specifies the placement of the `CloseButton`
77
+ */
78
+ placement: _propTypes.default.oneOf(['start', 'end', 'static']),
79
+
80
+ /**
81
+ * Specifies the offset distance for the `CloseButton` with respect to both the top and start/end of the container.
82
+ * Note that for this property to have an effect, the `placement` prop must be set to either `start` or `end`. The
83
+ * offset will also be created with respect to a positioned parent. If it does not appear to be working, try setting
84
+ * the `position` of the parent container to `relative`.
85
+ */
86
+ offset: _propTypes.default.oneOf(['none', 'x-small', 'small', 'medium']),
87
+
88
+ /**
89
+ * Specifies the type of the `Button`'s underlying html element.
90
+ */
91
+ type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
92
+
93
+ /**
94
+ * The element to render as the component root, `CloseButton` by default.
95
+ */
96
+ as: _propTypes.default.elementType,
97
+
98
+ /**
99
+ * Specifies an href attribute for the `CloseButton`'s underlying html element.
100
+ */
101
+ href: _propTypes.default.string,
102
+
103
+ /**
104
+ * Specify a mouse cursor to use when hovering over the `CloseButton`.
105
+ */
106
+ cursor: _propTypes.default.string,
107
+
108
+ /**
109
+ * Specifies the tabindex of the `CloseButton`.
110
+ */
111
+ tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
112
+ };
113
+ exports.propTypes = propTypes;
114
+ const allowedProps = ['as', 'color', 'cursor', 'elementRef', 'href', 'interaction', 'margin', 'offset', 'onClick', 'placement', 'screenReaderLabel', 'size', 'tabIndex', 'type'];
115
+ exports.allowedProps = allowedProps;
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
16
  var _testable = require("@instructure/ui-testable/lib/testable.js");
19
17
 
20
18
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
@@ -25,6 +23,8 @@ var _theme = _interopRequireDefault(require("./theme"));
25
23
 
26
24
  var _BaseButton = require("../BaseButton");
27
25
 
26
+ var _props = require("./props");
27
+
28
28
  const _excluded = ["children", "type", "size", "elementRef", "as", "interaction", "color", "margin", "cursor", "href", "renderIcon"];
29
29
 
30
30
  var _dec, _dec2, _class, _class2, _temp;
@@ -86,77 +86,16 @@ let CondensedButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _de
86
86
  }), children);
87
87
  }
88
88
 
89
- }, _class2.displayName = "CondensedButton", _class2.componentId = 'CondensedButton', _class2.propTypes = {
90
- /**
91
- * Specifies the `CondensedButton` children.
92
- */
93
- children: _propTypes.default.node,
94
-
95
- /**
96
- * Specifies the type of the `CondensedButton`'s underlying html element.
97
- */
98
- type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
99
-
100
- /**
101
- * The size of the `CondensedButton`
102
- */
103
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
104
-
105
- /**
106
- * Provides a reference to the `CondensedButton`'s underlying html element.
107
- */
108
- elementRef: _propTypes.default.func,
109
-
110
- /**
111
- * The element to render as the component root, `button` by default.
112
- */
113
- as: _propTypes.default.elementType,
114
-
115
- /**
116
- * Specifies if interaction with the `CondensedButton` is enabled, disabled, or readonly.
117
- */
118
- interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
119
-
120
- /**
121
- * Specifies the color for the `CondensedButton`.
122
- */
123
- color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
124
-
125
- /**
126
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
127
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
128
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
129
- */
130
- margin: _emotion.ThemeablePropTypes.spacing,
131
-
132
- /**
133
- * Specify a mouse cursor to use when hovering over the button.
134
- * The `pointer` cursor is used by default.
135
- */
136
- cursor: _propTypes.default.string,
137
-
138
- /**
139
- * Specifies an href attribute for the `CondensedButton`'s underlying html element.
140
- */
141
- href: _propTypes.default.string,
142
-
143
- /**
144
- * An icon, or function that returns an icon.
145
- */
146
- renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
147
- }, _class2.defaultProps = {
89
+ }, _class2.displayName = "CondensedButton", _class2.componentId = 'CondensedButton', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
148
90
  children: null,
149
91
  type: 'button',
150
92
  size: 'medium',
151
93
  elementRef: el => {},
152
94
  as: 'button',
153
95
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
154
- interaction: void 0,
155
96
  color: 'primary',
156
97
  margin: '0',
157
- cursor: 'pointer',
158
- href: void 0,
159
- renderIcon: void 0
98
+ cursor: 'pointer'
160
99
  }, _temp)) || _class) || _class);
161
100
  exports.CondensedButton = CondensedButton;
162
101
  var _default = CondensedButton;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _emotion = require("@instructure/emotion");
13
+
14
+ /*
15
+ * The MIT License (MIT)
16
+ *
17
+ * Copyright (c) 2015 - present Instructure, Inc.
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ * of this software and associated documentation files (the "Software"), to deal
21
+ * in the Software without restriction, including without limitation the rights
22
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ * copies of the Software, and to permit persons to whom the Software is
24
+ * furnished to do so, subject to the following conditions:
25
+ *
26
+ * The above copyright notice and this permission notice shall be included in all
27
+ * copies or substantial portions of the Software.
28
+ *
29
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ * SOFTWARE.
36
+ */
37
+ const propTypes = {
38
+ /**
39
+ * Specifies the `CondensedButton` children.
40
+ */
41
+ children: _propTypes.default.node,
42
+
43
+ /**
44
+ * Specifies the type of the `CondensedButton`'s underlying html element.
45
+ */
46
+ type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
47
+
48
+ /**
49
+ * The size of the `CondensedButton`
50
+ */
51
+ size: _propTypes.default.oneOf(['small', 'medium', 'large']),
52
+
53
+ /**
54
+ * Provides a reference to the `CondensedButton`'s underlying html element.
55
+ */
56
+ elementRef: _propTypes.default.func,
57
+
58
+ /**
59
+ * The element to render as the component root, `button` by default.
60
+ */
61
+ as: _propTypes.default.elementType,
62
+
63
+ /**
64
+ * Specifies if interaction with the `CondensedButton` is enabled, disabled, or readonly.
65
+ */
66
+ interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
67
+
68
+ /**
69
+ * Specifies the color for the `CondensedButton`.
70
+ */
71
+ color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
72
+
73
+ /**
74
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
75
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
76
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
77
+ */
78
+ margin: _emotion.ThemeablePropTypes.spacing,
79
+
80
+ /**
81
+ * Specify a mouse cursor to use when hovering over the button.
82
+ * The `pointer` cursor is used by default.
83
+ */
84
+ cursor: _propTypes.default.string,
85
+
86
+ /**
87
+ * Specifies an href attribute for the `CondensedButton`'s underlying html element.
88
+ */
89
+ href: _propTypes.default.string,
90
+
91
+ /**
92
+ * An icon, or function that returns an icon.
93
+ */
94
+ renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
95
+ };
96
+ exports.propTypes = propTypes;
97
+ const allowedProps = ['as', 'children', 'color', 'cursor', 'elementRef', 'href', 'interaction', 'margin', 'renderIcon', 'size', 'type'];
98
+ exports.allowedProps = allowedProps;
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
16
  var _testable = require("@instructure/ui-testable/lib/testable.js");
19
17
 
20
18
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
@@ -27,6 +25,8 @@ var _theme = _interopRequireDefault(require("./theme"));
27
25
 
28
26
  var _BaseButton = require("../BaseButton");
29
27
 
28
+ var _props = require("./props");
29
+
30
30
  const _excluded = ["children", "renderIcon", "screenReaderLabel", "type", "size", "elementRef", "as", "interaction", "color", "focusColor", "shape", "withBackground", "withBorder", "margin", "cursor", "href"];
31
31
 
32
32
  var _dec, _dec2, _class, _class2, _temp;
@@ -94,106 +94,19 @@ let IconButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _dec2 =
94
94
  }), /*#__PURE__*/_react.default.createElement(_ScreenReaderContent.ScreenReaderContent, null, screenReaderLabel));
95
95
  }
96
96
 
97
- }, _class2.displayName = "IconButton", _class2.componentId = 'IconButton', _class2.propTypes = {
98
- /**
99
- * An icon, or function returning an icon (identical to the `renderIcon` prop).
100
- */
101
- children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
102
-
103
- /**
104
- * An icon, or function that returns an icon (identical to the `children` prop).
105
- */
106
- renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
107
-
108
- /**
109
- * An accessible label for the `IconButton`.
110
- */
111
- screenReaderLabel: _propTypes.default.string.isRequired,
112
-
113
- /**
114
- * Specifies the type of the `IconButton`'s underlying html element.
115
- */
116
- type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
117
-
118
- /**
119
- * The size of the `IconButton`
120
- */
121
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
122
-
123
- /**
124
- * Provides a reference to the `IconButton`'s underlying html element.
125
- */
126
- elementRef: _propTypes.default.func,
127
-
128
- /**
129
- * The element to render as the component root, `button` by default.
130
- */
131
- as: _propTypes.default.elementType,
132
-
133
- /**
134
- * Specifies if interaction with the `IconButton` is enabled, disabled, or readonly.
135
- */
136
- interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
137
-
138
- /**
139
- * Specifies the color for the `IconButton`.
140
- */
141
- color: _propTypes.default.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger']),
142
-
143
- /**
144
- * Override the `Button`'s default focus outline color.
145
- */
146
- focusColor: _propTypes.default.oneOf(['info', 'inverse']),
147
-
148
- /**
149
- * Specifies if the `IconButton` shape should be a circle or rectangle.
150
- */
151
- shape: _propTypes.default.oneOf(['rectangle', 'circle']),
152
-
153
- /**
154
- * Specifies if the `IconButton` should render with a solid background. When false, the background is transparent.
155
- */
156
- withBackground: _propTypes.default.bool,
157
-
158
- /**
159
- * Specifies if the `IconButton` should render with a border.
160
- */
161
- withBorder: _propTypes.default.bool,
162
-
163
- /**
164
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
165
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
166
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
167
- */
168
- margin: _emotion.ThemeablePropTypes.spacing,
169
-
170
- /**
171
- * Specify a mouse cursor to use when hovering over the button.
172
- * The `pointer` cursor is used by default.
173
- */
174
- cursor: _propTypes.default.string,
175
-
176
- /**
177
- * Specifies an href attribute for the `IconButton`'s underlying html element.
178
- */
179
- href: _propTypes.default.string
180
- }, _class2.defaultProps = {
97
+ }, _class2.displayName = "IconButton", _class2.componentId = 'IconButton', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
181
98
  children: null,
182
- renderIcon: void 0,
183
99
  type: 'button',
184
100
  size: 'medium',
185
101
  elementRef: el => {},
186
102
  as: 'button',
187
103
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
188
- interaction: void 0,
189
104
  color: 'secondary',
190
- focusColor: void 0,
191
105
  shape: 'rectangle',
192
106
  withBackground: true,
193
107
  withBorder: true,
194
108
  margin: '0',
195
- cursor: 'pointer',
196
- href: void 0
109
+ cursor: 'pointer'
197
110
  }, _temp)) || _class) || _class);
198
111
  exports.IconButton = IconButton;
199
112
  var _default = IconButton;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _emotion = require("@instructure/emotion");
13
+
14
+ /*
15
+ * The MIT License (MIT)
16
+ *
17
+ * Copyright (c) 2015 - present Instructure, Inc.
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ * of this software and associated documentation files (the "Software"), to deal
21
+ * in the Software without restriction, including without limitation the rights
22
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ * copies of the Software, and to permit persons to whom the Software is
24
+ * furnished to do so, subject to the following conditions:
25
+ *
26
+ * The above copyright notice and this permission notice shall be included in all
27
+ * copies or substantial portions of the Software.
28
+ *
29
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ * SOFTWARE.
36
+ */
37
+ const propTypes = {
38
+ /**
39
+ * An icon, or function returning an icon (identical to the `renderIcon` prop).
40
+ */
41
+ children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
42
+
43
+ /**
44
+ * An icon, or function that returns an icon (identical to the `children` prop).
45
+ */
46
+ renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
47
+
48
+ /**
49
+ * An accessible label for the `IconButton`.
50
+ */
51
+ screenReaderLabel: _propTypes.default.string.isRequired,
52
+
53
+ /**
54
+ * Specifies the type of the `IconButton`'s underlying html element.
55
+ */
56
+ type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
57
+
58
+ /**
59
+ * The size of the `IconButton`
60
+ */
61
+ size: _propTypes.default.oneOf(['small', 'medium', 'large']),
62
+
63
+ /**
64
+ * Provides a reference to the `IconButton`'s underlying html element.
65
+ */
66
+ elementRef: _propTypes.default.func,
67
+
68
+ /**
69
+ * The element to render as the component root, `button` by default.
70
+ */
71
+ as: _propTypes.default.elementType,
72
+
73
+ /**
74
+ * Specifies if interaction with the `IconButton` is enabled, disabled, or readonly.
75
+ */
76
+ interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
77
+
78
+ /**
79
+ * Specifies the color for the `IconButton`.
80
+ */
81
+ color: _propTypes.default.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger']),
82
+
83
+ /**
84
+ * Override the `Button`'s default focus outline color.
85
+ */
86
+ focusColor: _propTypes.default.oneOf(['info', 'inverse']),
87
+
88
+ /**
89
+ * Specifies if the `IconButton` shape should be a circle or rectangle.
90
+ */
91
+ shape: _propTypes.default.oneOf(['rectangle', 'circle']),
92
+
93
+ /**
94
+ * Specifies if the `IconButton` should render with a solid background. When false, the background is transparent.
95
+ */
96
+ withBackground: _propTypes.default.bool,
97
+
98
+ /**
99
+ * Specifies if the `IconButton` should render with a border.
100
+ */
101
+ withBorder: _propTypes.default.bool,
102
+
103
+ /**
104
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
105
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
106
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
107
+ */
108
+ margin: _emotion.ThemeablePropTypes.spacing,
109
+
110
+ /**
111
+ * Specify a mouse cursor to use when hovering over the button.
112
+ * The `pointer` cursor is used by default.
113
+ */
114
+ cursor: _propTypes.default.string,
115
+
116
+ /**
117
+ * Specifies an href attribute for the `IconButton`'s underlying html element.
118
+ */
119
+ href: _propTypes.default.string
120
+ };
121
+ exports.propTypes = propTypes;
122
+ const allowedProps = ['as', 'children', 'color', 'cursor', 'elementRef', 'focusColor', 'href', 'interaction', 'margin', 'renderIcon', 'screenReaderLabel', 'shape', 'size', 'type', 'withBackground', 'withBorder'];
123
+ exports.allowedProps = allowedProps;