@zendeskgarden/react-buttons 8.62.1 → 8.63.0
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/index.cjs.js +61 -69
- package/dist/index.esm.js +10 -15
- package/dist/typings/elements/Anchor.d.ts +4 -0
- package/dist/typings/types/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var styled = require('styled-components');
|
|
@@ -16,7 +14,7 @@ var reactTheming = require('@zendeskgarden/react-theming');
|
|
|
16
14
|
var polished = require('polished');
|
|
17
15
|
var containerButtongroup = require('@zendeskgarden/container-buttongroup');
|
|
18
16
|
|
|
19
|
-
function
|
|
17
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
18
|
|
|
21
19
|
function _interopNamespace(e) {
|
|
22
20
|
if (e && e.__esModule) return e;
|
|
@@ -32,14 +30,13 @@ function _interopNamespace(e) {
|
|
|
32
30
|
}
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
n
|
|
33
|
+
n.default = e;
|
|
36
34
|
return Object.freeze(n);
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
40
37
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
|
-
var PropTypes__default = /*#__PURE__*/
|
|
42
|
-
var styled__default = /*#__PURE__*/
|
|
38
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
39
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
43
40
|
|
|
44
41
|
function _extends$2() {
|
|
45
42
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -59,9 +56,9 @@ function _extends$2() {
|
|
|
59
56
|
const SIZE = ['small', 'medium', 'large'];
|
|
60
57
|
|
|
61
58
|
const COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
62
|
-
const StyledButtonGroup = styled__default
|
|
59
|
+
const StyledButtonGroup = styled__default.default.div.attrs({
|
|
63
60
|
'data-garden-id': COMPONENT_ID$5,
|
|
64
|
-
'data-garden-version': '8.
|
|
61
|
+
'data-garden-version': '8.63.0'
|
|
65
62
|
}).withConfig({
|
|
66
63
|
displayName: "StyledButtonGroup",
|
|
67
64
|
componentId: "sc-1fbpzef-0"
|
|
@@ -80,17 +77,17 @@ const sizeStyles$1 = props => {
|
|
|
80
77
|
}
|
|
81
78
|
return marginProperty && styled.css(["", ":", "px;"], marginProperty, props.theme.space.base * 2);
|
|
82
79
|
};
|
|
83
|
-
const StyledIcon = styled__default
|
|
80
|
+
const StyledIcon = styled__default.default(_ref => {
|
|
84
81
|
let {
|
|
85
82
|
children,
|
|
86
83
|
isRotated,
|
|
87
84
|
theme,
|
|
88
85
|
...props
|
|
89
86
|
} = _ref;
|
|
90
|
-
return
|
|
87
|
+
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
91
88
|
}).attrs({
|
|
92
89
|
'data-garden-id': COMPONENT_ID$4,
|
|
93
|
-
'data-garden-version': '8.
|
|
90
|
+
'data-garden-version': '8.63.0'
|
|
94
91
|
}).withConfig({
|
|
95
92
|
displayName: "StyledIcon",
|
|
96
93
|
componentId: "sc-19meqgg-0"
|
|
@@ -187,9 +184,9 @@ const sizeStyles = props => {
|
|
|
187
184
|
}
|
|
188
185
|
return retVal;
|
|
189
186
|
};
|
|
190
|
-
const StyledButton = styled__default
|
|
187
|
+
const StyledButton = styled__default.default.button.attrs(props => ({
|
|
191
188
|
'data-garden-id': COMPONENT_ID$3,
|
|
192
|
-
'data-garden-version': '8.
|
|
189
|
+
'data-garden-version': '8.63.0',
|
|
193
190
|
type: props.type || 'button'
|
|
194
191
|
})).withConfig({
|
|
195
192
|
displayName: "StyledButton",
|
|
@@ -200,9 +197,9 @@ StyledButton.defaultProps = {
|
|
|
200
197
|
};
|
|
201
198
|
|
|
202
199
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
203
|
-
const StyledAnchor = styled__default
|
|
200
|
+
const StyledAnchor = styled__default.default(StyledButton).attrs(props => ({
|
|
204
201
|
'data-garden-id': COMPONENT_ID$2,
|
|
205
|
-
'data-garden-version': '8.
|
|
202
|
+
'data-garden-version': '8.63.0',
|
|
206
203
|
as: 'a',
|
|
207
204
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
208
205
|
isLink: true,
|
|
@@ -216,9 +213,7 @@ StyledAnchor.defaultProps = {
|
|
|
216
213
|
};
|
|
217
214
|
|
|
218
215
|
var _path$1;
|
|
219
|
-
|
|
220
216
|
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
221
|
-
|
|
222
217
|
var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
223
218
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
224
219
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -226,8 +221,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
226
221
|
height: 12,
|
|
227
222
|
focusable: "false",
|
|
228
223
|
viewBox: "0 0 12 12",
|
|
229
|
-
"aria-hidden": "true"
|
|
230
|
-
role: "img"
|
|
224
|
+
"aria-hidden": "true"
|
|
231
225
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
232
226
|
fill: "none",
|
|
233
227
|
stroke: "currentColor",
|
|
@@ -237,9 +231,9 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
237
231
|
};
|
|
238
232
|
|
|
239
233
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
240
|
-
const StyledExternalIcon = styled__default
|
|
234
|
+
const StyledExternalIcon = styled__default.default(SvgNewWindowStroke).attrs({
|
|
241
235
|
'data-garden-id': COMPONENT_ID$1,
|
|
242
|
-
'data-garden-version': '8.
|
|
236
|
+
'data-garden-version': '8.63.0'
|
|
243
237
|
}).withConfig({
|
|
244
238
|
displayName: "StyledExternalIcon",
|
|
245
239
|
componentId: "sc-16oz07e-0"
|
|
@@ -264,9 +258,9 @@ const iconStyles = props => {
|
|
|
264
258
|
const size = props.theme.iconSizes.md;
|
|
265
259
|
return styled.css(["width:", ";height:", ";& > svg{transition:opacity 0.15s ease-in-out;}"], size, size);
|
|
266
260
|
};
|
|
267
|
-
const StyledIconButton = styled__default
|
|
261
|
+
const StyledIconButton = styled__default.default(StyledButton).attrs({
|
|
268
262
|
'data-garden-id': COMPONENT_ID,
|
|
269
|
-
'data-garden-version': '8.
|
|
263
|
+
'data-garden-version': '8.63.0'
|
|
270
264
|
}).withConfig({
|
|
271
265
|
displayName: "StyledIconButton",
|
|
272
266
|
componentId: "sc-1t0ughp-0"
|
|
@@ -285,13 +279,13 @@ const useSplitButtonContext = () => {
|
|
|
285
279
|
return React.useContext(SplitButtonContext);
|
|
286
280
|
};
|
|
287
281
|
|
|
288
|
-
const StartIconComponent = props =>
|
|
282
|
+
const StartIconComponent = props => React__namespace.default.createElement(StyledIcon, _extends$2({
|
|
289
283
|
position: "start"
|
|
290
284
|
}, props));
|
|
291
285
|
StartIconComponent.displayName = 'Button.StartIcon';
|
|
292
286
|
const StartIcon = StartIconComponent;
|
|
293
287
|
|
|
294
|
-
const EndIconComponent = props =>
|
|
288
|
+
const EndIconComponent = props => React__namespace.default.createElement(StyledIcon, _extends$2({
|
|
295
289
|
position: "end"
|
|
296
290
|
}, props));
|
|
297
291
|
EndIconComponent.displayName = 'Button.EndIcon';
|
|
@@ -310,27 +304,27 @@ const ButtonComponent = React.forwardRef((props, ref) => {
|
|
|
310
304
|
}
|
|
311
305
|
computedProps = buttonGroupContext.getButtonProps({
|
|
312
306
|
item: props.value,
|
|
313
|
-
focusRef:
|
|
307
|
+
focusRef: React__namespace.default.createRef(),
|
|
314
308
|
isSelected: props.value === buttonGroupContext.selectedItem,
|
|
315
309
|
...computedProps
|
|
316
310
|
});
|
|
317
311
|
}
|
|
318
|
-
return
|
|
312
|
+
return React__namespace.default.createElement(StyledButton, _extends$2({
|
|
319
313
|
ref: ref
|
|
320
314
|
}, computedProps));
|
|
321
315
|
});
|
|
322
316
|
ButtonComponent.displayName = 'Button';
|
|
323
317
|
ButtonComponent.propTypes = {
|
|
324
|
-
isNeutral: PropTypes__default
|
|
325
|
-
isPrimary: PropTypes__default
|
|
326
|
-
isDanger: PropTypes__default
|
|
327
|
-
isPill: PropTypes__default
|
|
328
|
-
isBasic: PropTypes__default
|
|
329
|
-
focusInset: PropTypes__default
|
|
330
|
-
isLink: PropTypes__default
|
|
331
|
-
isStretched: PropTypes__default
|
|
332
|
-
isSelected: PropTypes__default
|
|
333
|
-
size: PropTypes__default
|
|
318
|
+
isNeutral: PropTypes__default.default.bool,
|
|
319
|
+
isPrimary: PropTypes__default.default.bool,
|
|
320
|
+
isDanger: PropTypes__default.default.bool,
|
|
321
|
+
isPill: PropTypes__default.default.bool,
|
|
322
|
+
isBasic: PropTypes__default.default.bool,
|
|
323
|
+
focusInset: PropTypes__default.default.bool,
|
|
324
|
+
isLink: PropTypes__default.default.bool,
|
|
325
|
+
isStretched: PropTypes__default.default.bool,
|
|
326
|
+
isSelected: PropTypes__default.default.bool,
|
|
327
|
+
size: PropTypes__default.default.oneOf(SIZE)
|
|
334
328
|
};
|
|
335
329
|
ButtonComponent.defaultProps = {
|
|
336
330
|
size: 'medium'
|
|
@@ -360,9 +354,10 @@ const Anchor = React.forwardRef((_ref, ref) => {
|
|
|
360
354
|
noIconLabel: 'true'
|
|
361
355
|
};
|
|
362
356
|
const iconAriaLabel = reactTheming.useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
|
|
363
|
-
return
|
|
357
|
+
return React__namespace.default.createElement(StyledAnchor, _extends$2({
|
|
364
358
|
ref: ref
|
|
365
|
-
}, anchorProps), children, isExternal &&
|
|
359
|
+
}, anchorProps), children, isExternal &&
|
|
360
|
+
React__namespace.default.createElement(StyledExternalIcon, {
|
|
366
361
|
role: "img",
|
|
367
362
|
"aria-label": iconAriaLabel,
|
|
368
363
|
"aria-hidden": undefined
|
|
@@ -370,9 +365,9 @@ const Anchor = React.forwardRef((_ref, ref) => {
|
|
|
370
365
|
});
|
|
371
366
|
Anchor.displayName = 'Anchor';
|
|
372
367
|
Anchor.propTypes = {
|
|
373
|
-
isExternal: PropTypes__default
|
|
374
|
-
isDanger: PropTypes__default
|
|
375
|
-
externalIconLabel: PropTypes__default
|
|
368
|
+
isExternal: PropTypes__default.default.bool,
|
|
369
|
+
isDanger: PropTypes__default.default.bool,
|
|
370
|
+
externalIconLabel: PropTypes__default.default.string
|
|
376
371
|
};
|
|
377
372
|
|
|
378
373
|
const ButtonGroup = React.forwardRef((_ref, ref) => {
|
|
@@ -395,16 +390,16 @@ const ButtonGroup = React.forwardRef((_ref, ref) => {
|
|
|
395
390
|
selectedItem,
|
|
396
391
|
getButtonProps
|
|
397
392
|
}), [selectedItem, getButtonProps]);
|
|
398
|
-
return
|
|
393
|
+
return React__namespace.default.createElement(ButtonGroupContext.Provider, {
|
|
399
394
|
value: contextValue
|
|
400
|
-
},
|
|
395
|
+
}, React__namespace.default.createElement(StyledButtonGroup, _extends$2({
|
|
401
396
|
ref: ref
|
|
402
397
|
}, getGroupProps(otherProps)), children));
|
|
403
398
|
});
|
|
404
399
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
405
400
|
ButtonGroup.propTypes = {
|
|
406
|
-
selectedItem: PropTypes__default
|
|
407
|
-
onSelect: PropTypes__default
|
|
401
|
+
selectedItem: PropTypes__default.default.any,
|
|
402
|
+
onSelect: PropTypes__default.default.func
|
|
408
403
|
};
|
|
409
404
|
|
|
410
405
|
const IconButton = React.forwardRef((_ref, ref) => {
|
|
@@ -414,24 +409,24 @@ const IconButton = React.forwardRef((_ref, ref) => {
|
|
|
414
409
|
...otherProps
|
|
415
410
|
} = _ref;
|
|
416
411
|
const focusInset = useSplitButtonContext();
|
|
417
|
-
return
|
|
412
|
+
return React__namespace.default.createElement(StyledIconButton, _extends$2({
|
|
418
413
|
ref: ref
|
|
419
414
|
}, otherProps, {
|
|
420
415
|
focusInset: otherProps.focusInset || focusInset
|
|
421
|
-
}),
|
|
416
|
+
}), React__namespace.default.createElement(StyledIcon, {
|
|
422
417
|
isRotated: isRotated
|
|
423
418
|
}, children));
|
|
424
419
|
});
|
|
425
420
|
IconButton.displayName = 'IconButton';
|
|
426
421
|
IconButton.propTypes = {
|
|
427
|
-
isDanger: PropTypes__default
|
|
428
|
-
size: PropTypes__default
|
|
429
|
-
isNeutral: PropTypes__default
|
|
430
|
-
isPrimary: PropTypes__default
|
|
431
|
-
isBasic: PropTypes__default
|
|
432
|
-
isPill: PropTypes__default
|
|
433
|
-
focusInset: PropTypes__default
|
|
434
|
-
isRotated: PropTypes__default
|
|
422
|
+
isDanger: PropTypes__default.default.bool,
|
|
423
|
+
size: PropTypes__default.default.oneOf(SIZE),
|
|
424
|
+
isNeutral: PropTypes__default.default.bool,
|
|
425
|
+
isPrimary: PropTypes__default.default.bool,
|
|
426
|
+
isBasic: PropTypes__default.default.bool,
|
|
427
|
+
isPill: PropTypes__default.default.bool,
|
|
428
|
+
focusInset: PropTypes__default.default.bool,
|
|
429
|
+
isRotated: PropTypes__default.default.bool
|
|
435
430
|
};
|
|
436
431
|
IconButton.defaultProps = {
|
|
437
432
|
isPill: true,
|
|
@@ -440,9 +435,7 @@ IconButton.defaultProps = {
|
|
|
440
435
|
};
|
|
441
436
|
|
|
442
437
|
var _path;
|
|
443
|
-
|
|
444
438
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
445
|
-
|
|
446
439
|
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
447
440
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
448
441
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -450,8 +443,7 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
450
443
|
height: 16,
|
|
451
444
|
focusable: "false",
|
|
452
445
|
viewBox: "0 0 16 16",
|
|
453
|
-
"aria-hidden": "true"
|
|
454
|
-
role: "img"
|
|
446
|
+
"aria-hidden": "true"
|
|
455
447
|
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
456
448
|
fill: "currentColor",
|
|
457
449
|
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
@@ -462,9 +454,9 @@ const ChevronButton = React.forwardRef((_ref, ref) => {
|
|
|
462
454
|
let {
|
|
463
455
|
...buttonProps
|
|
464
456
|
} = _ref;
|
|
465
|
-
return
|
|
457
|
+
return React__namespace.default.createElement(IconButton, _extends$2({
|
|
466
458
|
ref: ref
|
|
467
|
-
}, buttonProps),
|
|
459
|
+
}, buttonProps), React__namespace.default.createElement(SvgChevronDownStroke, null));
|
|
468
460
|
});
|
|
469
461
|
ChevronButton.displayName = 'ChevronButton';
|
|
470
462
|
ChevronButton.propTypes = IconButton.propTypes;
|
|
@@ -479,9 +471,9 @@ const SplitButton = React.forwardRef((_ref, ref) => {
|
|
|
479
471
|
children,
|
|
480
472
|
...other
|
|
481
473
|
} = _ref;
|
|
482
|
-
return
|
|
474
|
+
return React__namespace.default.createElement(SplitButtonContext.Provider, {
|
|
483
475
|
value: true
|
|
484
|
-
},
|
|
476
|
+
}, React__namespace.default.createElement(StyledButtonGroup, _extends$2({
|
|
485
477
|
ref: ref
|
|
486
478
|
}, other), children));
|
|
487
479
|
});
|
|
@@ -492,7 +484,7 @@ const ToggleButton = React.forwardRef((_ref, ref) => {
|
|
|
492
484
|
isPressed,
|
|
493
485
|
...otherProps
|
|
494
486
|
} = _ref;
|
|
495
|
-
return
|
|
487
|
+
return React__namespace.default.createElement(Button, _extends$2({
|
|
496
488
|
"aria-pressed": isPressed,
|
|
497
489
|
ref: ref
|
|
498
490
|
}, otherProps));
|
|
@@ -500,7 +492,7 @@ const ToggleButton = React.forwardRef((_ref, ref) => {
|
|
|
500
492
|
ToggleButton.displayName = 'ToggleButton';
|
|
501
493
|
ToggleButton.propTypes = {
|
|
502
494
|
...Button.propTypes,
|
|
503
|
-
isPressed: PropTypes__default
|
|
495
|
+
isPressed: PropTypes__default.default.oneOf([true, false, 'mixed'])
|
|
504
496
|
};
|
|
505
497
|
ToggleButton.defaultProps = {
|
|
506
498
|
size: 'medium'
|
|
@@ -511,7 +503,7 @@ const ToggleIconButton = React.forwardRef((_ref, ref) => {
|
|
|
511
503
|
isPressed,
|
|
512
504
|
...otherProps
|
|
513
505
|
} = _ref;
|
|
514
|
-
return
|
|
506
|
+
return React__namespace.default.createElement(IconButton, _extends$2({
|
|
515
507
|
"aria-pressed": isPressed,
|
|
516
508
|
ref: ref
|
|
517
509
|
}, otherProps));
|
|
@@ -519,7 +511,7 @@ const ToggleIconButton = React.forwardRef((_ref, ref) => {
|
|
|
519
511
|
ToggleIconButton.displayName = 'ToggleIconButton';
|
|
520
512
|
ToggleIconButton.propTypes = {
|
|
521
513
|
...IconButton.propTypes,
|
|
522
|
-
isPressed: PropTypes__default
|
|
514
|
+
isPressed: PropTypes__default.default.oneOf([true, false, 'mixed'])
|
|
523
515
|
};
|
|
524
516
|
ToggleIconButton.defaultProps = {
|
|
525
517
|
isPill: true,
|
package/dist/index.esm.js
CHANGED
|
@@ -33,7 +33,7 @@ const SIZE = ['small', 'medium', 'large'];
|
|
|
33
33
|
const COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
34
34
|
const StyledButtonGroup = styled.div.attrs({
|
|
35
35
|
'data-garden-id': COMPONENT_ID$5,
|
|
36
|
-
'data-garden-version': '8.
|
|
36
|
+
'data-garden-version': '8.63.0'
|
|
37
37
|
}).withConfig({
|
|
38
38
|
displayName: "StyledButtonGroup",
|
|
39
39
|
componentId: "sc-1fbpzef-0"
|
|
@@ -62,7 +62,7 @@ const StyledIcon = styled(_ref => {
|
|
|
62
62
|
return React__default.cloneElement(Children.only(children), props);
|
|
63
63
|
}).attrs({
|
|
64
64
|
'data-garden-id': COMPONENT_ID$4,
|
|
65
|
-
'data-garden-version': '8.
|
|
65
|
+
'data-garden-version': '8.63.0'
|
|
66
66
|
}).withConfig({
|
|
67
67
|
displayName: "StyledIcon",
|
|
68
68
|
componentId: "sc-19meqgg-0"
|
|
@@ -161,7 +161,7 @@ const sizeStyles = props => {
|
|
|
161
161
|
};
|
|
162
162
|
const StyledButton = styled.button.attrs(props => ({
|
|
163
163
|
'data-garden-id': COMPONENT_ID$3,
|
|
164
|
-
'data-garden-version': '8.
|
|
164
|
+
'data-garden-version': '8.63.0',
|
|
165
165
|
type: props.type || 'button'
|
|
166
166
|
})).withConfig({
|
|
167
167
|
displayName: "StyledButton",
|
|
@@ -174,7 +174,7 @@ StyledButton.defaultProps = {
|
|
|
174
174
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
175
175
|
const StyledAnchor = styled(StyledButton).attrs(props => ({
|
|
176
176
|
'data-garden-id': COMPONENT_ID$2,
|
|
177
|
-
'data-garden-version': '8.
|
|
177
|
+
'data-garden-version': '8.63.0',
|
|
178
178
|
as: 'a',
|
|
179
179
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
180
180
|
isLink: true,
|
|
@@ -188,9 +188,7 @@ StyledAnchor.defaultProps = {
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
var _path$1;
|
|
191
|
-
|
|
192
191
|
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
193
|
-
|
|
194
192
|
var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
195
193
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
196
194
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -198,8 +196,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
198
196
|
height: 12,
|
|
199
197
|
focusable: "false",
|
|
200
198
|
viewBox: "0 0 12 12",
|
|
201
|
-
"aria-hidden": "true"
|
|
202
|
-
role: "img"
|
|
199
|
+
"aria-hidden": "true"
|
|
203
200
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
204
201
|
fill: "none",
|
|
205
202
|
stroke: "currentColor",
|
|
@@ -211,7 +208,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
211
208
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
212
209
|
const StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
|
|
213
210
|
'data-garden-id': COMPONENT_ID$1,
|
|
214
|
-
'data-garden-version': '8.
|
|
211
|
+
'data-garden-version': '8.63.0'
|
|
215
212
|
}).withConfig({
|
|
216
213
|
displayName: "StyledExternalIcon",
|
|
217
214
|
componentId: "sc-16oz07e-0"
|
|
@@ -238,7 +235,7 @@ const iconStyles = props => {
|
|
|
238
235
|
};
|
|
239
236
|
const StyledIconButton = styled(StyledButton).attrs({
|
|
240
237
|
'data-garden-id': COMPONENT_ID,
|
|
241
|
-
'data-garden-version': '8.
|
|
238
|
+
'data-garden-version': '8.63.0'
|
|
242
239
|
}).withConfig({
|
|
243
240
|
displayName: "StyledIconButton",
|
|
244
241
|
componentId: "sc-1t0ughp-0"
|
|
@@ -334,7 +331,8 @@ const Anchor = forwardRef((_ref, ref) => {
|
|
|
334
331
|
const iconAriaLabel = useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
|
|
335
332
|
return React__default.createElement(StyledAnchor, _extends$2({
|
|
336
333
|
ref: ref
|
|
337
|
-
}, anchorProps), children, isExternal &&
|
|
334
|
+
}, anchorProps), children, isExternal &&
|
|
335
|
+
React__default.createElement(StyledExternalIcon, {
|
|
338
336
|
role: "img",
|
|
339
337
|
"aria-label": iconAriaLabel,
|
|
340
338
|
"aria-hidden": undefined
|
|
@@ -412,9 +410,7 @@ IconButton.defaultProps = {
|
|
|
412
410
|
};
|
|
413
411
|
|
|
414
412
|
var _path;
|
|
415
|
-
|
|
416
413
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
417
|
-
|
|
418
414
|
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
419
415
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
420
416
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -422,8 +418,7 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
422
418
|
height: 16,
|
|
423
419
|
focusable: "false",
|
|
424
420
|
viewBox: "0 0 16 16",
|
|
425
|
-
"aria-hidden": "true"
|
|
426
|
-
role: "img"
|
|
421
|
+
"aria-hidden": "true"
|
|
427
422
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
428
423
|
fill: "currentColor",
|
|
429
424
|
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IAnchorProps } from '../types';
|
|
9
|
+
/**
|
|
10
|
+
* 1. role='img' on `svg` is valid WAI-ARIA usage in this context.
|
|
11
|
+
* https://dequeuniversity.com/rules/axe/4.2/svg-img-alt
|
|
12
|
+
*/
|
|
9
13
|
/**
|
|
10
14
|
* @extends AnchorHTMLAttributes<HTMLAnchorElement>
|
|
11
15
|
*/
|
|
@@ -10,7 +10,7 @@ export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
10
10
|
/** Applies danger styling */
|
|
11
11
|
isDanger?: boolean;
|
|
12
12
|
/** Specifies the button size */
|
|
13
|
-
size?: typeof SIZE[number];
|
|
13
|
+
size?: (typeof SIZE)[number];
|
|
14
14
|
/** Stretches the button fill to its container width */
|
|
15
15
|
isStretched?: boolean;
|
|
16
16
|
/** Applies neutral button styling */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-buttons",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.63.0",
|
|
4
4
|
"description": "Components relating to buttons in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^8.
|
|
36
|
+
"@zendeskgarden/react-theming": "^8.63.0",
|
|
37
37
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "4b8715305a769881b143c7195c5b31e687422926"
|
|
50
50
|
}
|