@zendeskgarden/react-buttons 8.45.0 → 8.47.2
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 +93 -106
- package/dist/index.esm.js +38 -49
- package/dist/typings/elements/Anchor.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -27,14 +27,12 @@ function _interopNamespace(e) {
|
|
|
27
27
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
28
|
Object.defineProperty(n, k, d.get ? d : {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return e[k];
|
|
32
|
-
}
|
|
30
|
+
get: function () { return e[k]; }
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
|
-
n[
|
|
35
|
+
n["default"] = e;
|
|
38
36
|
return Object.freeze(n);
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -48,14 +46,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
48
46
|
|
|
49
47
|
if (Object.getOwnPropertySymbols) {
|
|
50
48
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
keys.push.apply(keys, symbols);
|
|
49
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
50
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
51
|
+
})), keys.push.apply(keys, symbols);
|
|
59
52
|
}
|
|
60
53
|
|
|
61
54
|
return keys;
|
|
@@ -63,19 +56,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
63
56
|
|
|
64
57
|
function _objectSpread2(target) {
|
|
65
58
|
for (var i = 1; i < arguments.length; i++) {
|
|
66
|
-
var source = arguments[i]
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
73
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
74
|
-
} else {
|
|
75
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
76
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
77
|
-
});
|
|
78
|
-
}
|
|
59
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
60
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
61
|
+
_defineProperty(target, key, source[key]);
|
|
62
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
63
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
64
|
+
});
|
|
79
65
|
}
|
|
80
66
|
|
|
81
67
|
return target;
|
|
@@ -151,9 +137,9 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
151
137
|
}
|
|
152
138
|
|
|
153
139
|
var COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
154
|
-
var StyledButtonGroup = styled__default[
|
|
140
|
+
var StyledButtonGroup = styled__default["default"].div.attrs({
|
|
155
141
|
'data-garden-id': COMPONENT_ID$5,
|
|
156
|
-
'data-garden-version': '8.
|
|
142
|
+
'data-garden-version': '8.47.2'
|
|
157
143
|
}).withConfig({
|
|
158
144
|
displayName: "StyledButtonGroup",
|
|
159
145
|
componentId: "sc-1fbpzef-0"
|
|
@@ -177,15 +163,15 @@ var sizeStyles$1 = function sizeStyles(props) {
|
|
|
177
163
|
}
|
|
178
164
|
return marginProperty && styled.css(["", ":", "px;"], marginProperty, props.theme.space.base * 2);
|
|
179
165
|
};
|
|
180
|
-
var StyledIcon = styled__default[
|
|
166
|
+
var StyledIcon = styled__default["default"](function (_ref) {
|
|
181
167
|
var children = _ref.children;
|
|
182
168
|
_ref.isRotated;
|
|
183
169
|
_ref.theme;
|
|
184
170
|
var props = _objectWithoutProperties(_ref, _excluded$6);
|
|
185
|
-
return React__default[
|
|
171
|
+
return React__default["default"].cloneElement(React.Children.only(children), props);
|
|
186
172
|
}).attrs({
|
|
187
173
|
'data-garden-id': COMPONENT_ID$4,
|
|
188
|
-
'data-garden-version': '8.
|
|
174
|
+
'data-garden-version': '8.47.2'
|
|
189
175
|
}).withConfig({
|
|
190
176
|
displayName: "StyledIcon",
|
|
191
177
|
componentId: "sc-19meqgg-0"
|
|
@@ -291,10 +277,10 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
291
277
|
}
|
|
292
278
|
return retVal;
|
|
293
279
|
};
|
|
294
|
-
var StyledButton = styled__default[
|
|
280
|
+
var StyledButton = styled__default["default"].button.attrs(function (props) {
|
|
295
281
|
return {
|
|
296
282
|
'data-garden-id': COMPONENT_ID$3,
|
|
297
|
-
'data-garden-version': '8.
|
|
283
|
+
'data-garden-version': '8.47.2',
|
|
298
284
|
type: props.type || 'button'
|
|
299
285
|
};
|
|
300
286
|
}).withConfig({
|
|
@@ -344,10 +330,10 @@ StyledButton.defaultProps = {
|
|
|
344
330
|
};
|
|
345
331
|
|
|
346
332
|
var COMPONENT_ID$2 = 'buttons.anchor';
|
|
347
|
-
var StyledAnchor = styled__default[
|
|
333
|
+
var StyledAnchor = styled__default["default"](StyledButton).attrs(function (props) {
|
|
348
334
|
return {
|
|
349
335
|
'data-garden-id': COMPONENT_ID$2,
|
|
350
|
-
'data-garden-version': '8.
|
|
336
|
+
'data-garden-version': '8.47.2',
|
|
351
337
|
as: 'a',
|
|
352
338
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
353
339
|
isLink: true,
|
|
@@ -365,30 +351,30 @@ StyledAnchor.defaultProps = {
|
|
|
365
351
|
theme: reactTheming.DEFAULT_THEME
|
|
366
352
|
};
|
|
367
353
|
|
|
368
|
-
|
|
354
|
+
var _path$1;
|
|
369
355
|
|
|
370
|
-
|
|
371
|
-
fill: "none",
|
|
372
|
-
stroke: "currentColor",
|
|
373
|
-
strokeLinecap: "round",
|
|
374
|
-
d: "M10.5 8.5V10c0 .3-.2.5-.5.5H2c-.3 0-.5-.2-.5-.5V2c0-.3.2-.5.5-.5h1.5M6 6l4-4m-3.5-.5H10c.3 0 .5.2.5.5v3.5"
|
|
375
|
-
});
|
|
356
|
+
function _extends$1() { _extends$1 = Object.assign || 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); }
|
|
376
357
|
|
|
377
|
-
function SvgNewWindowStroke(props) {
|
|
358
|
+
var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
378
359
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
379
360
|
xmlns: "http://www.w3.org/2000/svg",
|
|
380
361
|
width: 12,
|
|
381
362
|
height: 12,
|
|
382
|
-
viewBox: "0 0 12 12",
|
|
383
363
|
focusable: "false",
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
364
|
+
viewBox: "0 0 12 12",
|
|
365
|
+
"aria-hidden": "true"
|
|
366
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
367
|
+
fill: "none",
|
|
368
|
+
stroke: "currentColor",
|
|
369
|
+
strokeLinecap: "round",
|
|
370
|
+
d: "M10.5 8.5V10c0 .3-.2.5-.5.5H2c-.3 0-.5-.2-.5-.5V2c0-.3.2-.5.5-.5h1.5M6 6l4-4m-3.5-.5H10c.3 0 .5.2.5.5v3.5"
|
|
371
|
+
})));
|
|
372
|
+
};
|
|
387
373
|
|
|
388
374
|
var COMPONENT_ID$1 = 'buttons.external_icon';
|
|
389
|
-
var StyledExternalIcon = styled__default[
|
|
375
|
+
var StyledExternalIcon = styled__default["default"](SvgNewWindowStroke).attrs({
|
|
390
376
|
'data-garden-id': COMPONENT_ID$1,
|
|
391
|
-
'data-garden-version': '8.
|
|
377
|
+
'data-garden-version': '8.47.2'
|
|
392
378
|
}).withConfig({
|
|
393
379
|
displayName: "StyledExternalIcon",
|
|
394
380
|
componentId: "sc-16oz07e-0"
|
|
@@ -417,9 +403,9 @@ var iconStyles = function iconStyles(props) {
|
|
|
417
403
|
var size = props.theme.iconSizes.md;
|
|
418
404
|
return styled.css(["width:", ";height:", ";& > svg{transition:opacity 0.15s ease-in-out;}"], size, size);
|
|
419
405
|
};
|
|
420
|
-
var StyledIconButton = styled__default[
|
|
406
|
+
var StyledIconButton = styled__default["default"](StyledButton).attrs({
|
|
421
407
|
'data-garden-id': COMPONENT_ID,
|
|
422
|
-
'data-garden-version': '8.
|
|
408
|
+
'data-garden-version': '8.47.2'
|
|
423
409
|
}).withConfig({
|
|
424
410
|
displayName: "StyledIconButton",
|
|
425
411
|
componentId: "sc-1t0ughp-0"
|
|
@@ -444,7 +430,7 @@ var useSplitButtonContext = function useSplitButtonContext() {
|
|
|
444
430
|
return React.useContext(SplitButtonContext);
|
|
445
431
|
};
|
|
446
432
|
|
|
447
|
-
var Button = React__default[
|
|
433
|
+
var Button = React__default["default"].forwardRef(function (props, ref) {
|
|
448
434
|
var buttonGroupContext = useButtonGroupContext();
|
|
449
435
|
var splitButtonContext = useSplitButtonContext();
|
|
450
436
|
var computedProps = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -456,36 +442,37 @@ var Button = React__default['default'].forwardRef(function (props, ref) {
|
|
|
456
442
|
}
|
|
457
443
|
computedProps = buttonGroupContext.getButtonProps(_objectSpread2({
|
|
458
444
|
item: props.value,
|
|
459
|
-
focusRef: React__default[
|
|
445
|
+
focusRef: React__default["default"].createRef(),
|
|
460
446
|
isSelected: props.value === buttonGroupContext.selectedItem
|
|
461
447
|
}, computedProps));
|
|
462
448
|
}
|
|
463
|
-
return React__default[
|
|
449
|
+
return React__default["default"].createElement(StyledButton, _extends$2({
|
|
464
450
|
ref: ref
|
|
465
451
|
}, computedProps));
|
|
466
452
|
});
|
|
467
453
|
Button.propTypes = {
|
|
468
|
-
isNeutral: PropTypes__default[
|
|
469
|
-
isPrimary: PropTypes__default[
|
|
470
|
-
isDanger: PropTypes__default[
|
|
471
|
-
isPill: PropTypes__default[
|
|
472
|
-
isBasic: PropTypes__default[
|
|
473
|
-
focusInset: PropTypes__default[
|
|
474
|
-
isLink: PropTypes__default[
|
|
475
|
-
isStretched: PropTypes__default[
|
|
476
|
-
isSelected: PropTypes__default[
|
|
477
|
-
size: PropTypes__default[
|
|
454
|
+
isNeutral: PropTypes__default["default"].bool,
|
|
455
|
+
isPrimary: PropTypes__default["default"].bool,
|
|
456
|
+
isDanger: PropTypes__default["default"].bool,
|
|
457
|
+
isPill: PropTypes__default["default"].bool,
|
|
458
|
+
isBasic: PropTypes__default["default"].bool,
|
|
459
|
+
focusInset: PropTypes__default["default"].bool,
|
|
460
|
+
isLink: PropTypes__default["default"].bool,
|
|
461
|
+
isStretched: PropTypes__default["default"].bool,
|
|
462
|
+
isSelected: PropTypes__default["default"].bool,
|
|
463
|
+
size: PropTypes__default["default"].oneOf(['small', 'medium', 'large'])
|
|
478
464
|
};
|
|
479
465
|
Button.defaultProps = {
|
|
480
466
|
size: 'medium'
|
|
481
467
|
};
|
|
468
|
+
Button.displayName = 'Button';
|
|
482
469
|
var StartIcon = function StartIcon(props) {
|
|
483
|
-
return React__default[
|
|
470
|
+
return React__default["default"].createElement(StyledIcon, _extends$2({
|
|
484
471
|
position: "start"
|
|
485
472
|
}, props));
|
|
486
473
|
};
|
|
487
474
|
var EndIcon = function EndIcon(props) {
|
|
488
|
-
return React__default[
|
|
475
|
+
return React__default["default"].createElement(StyledIcon, _extends$2({
|
|
489
476
|
position: "end"
|
|
490
477
|
}, props));
|
|
491
478
|
};
|
|
@@ -493,7 +480,7 @@ Button.StartIcon = StartIcon;
|
|
|
493
480
|
Button.EndIcon = EndIcon;
|
|
494
481
|
|
|
495
482
|
var _excluded$5 = ["children", "isExternal"];
|
|
496
|
-
var Anchor = React__default[
|
|
483
|
+
var Anchor = React__default["default"].forwardRef(function (_ref, ref) {
|
|
497
484
|
var children = _ref.children,
|
|
498
485
|
isExternal = _ref.isExternal,
|
|
499
486
|
otherProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
@@ -504,14 +491,14 @@ var Anchor = React__default['default'].forwardRef(function (_ref, ref) {
|
|
|
504
491
|
rel: 'noopener noreferrer'
|
|
505
492
|
}, anchorProps);
|
|
506
493
|
}
|
|
507
|
-
return React__default[
|
|
494
|
+
return React__default["default"].createElement(StyledAnchor, _extends$2({
|
|
508
495
|
ref: ref
|
|
509
|
-
}, anchorProps), children, isExternal && React__default[
|
|
496
|
+
}, anchorProps), children, isExternal && React__default["default"].createElement(StyledExternalIcon, null));
|
|
510
497
|
});
|
|
511
498
|
Anchor.displayName = 'Anchor';
|
|
512
499
|
Anchor.propTypes = {
|
|
513
|
-
isExternal: PropTypes__default[
|
|
514
|
-
isDanger: PropTypes__default[
|
|
500
|
+
isExternal: PropTypes__default["default"].bool,
|
|
501
|
+
isDanger: PropTypes__default["default"].bool
|
|
515
502
|
};
|
|
516
503
|
|
|
517
504
|
var _excluded$4 = ["children", "onSelect", "selectedItem"];
|
|
@@ -534,39 +521,39 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
534
521
|
getButtonProps: getButtonProps
|
|
535
522
|
};
|
|
536
523
|
}, [selectedItem, getButtonProps]);
|
|
537
|
-
return React__default[
|
|
524
|
+
return React__default["default"].createElement(ButtonGroupContext.Provider, {
|
|
538
525
|
value: contextValue
|
|
539
|
-
}, React__default[
|
|
526
|
+
}, React__default["default"].createElement(StyledButtonGroup, getGroupProps(otherProps), children));
|
|
540
527
|
};
|
|
541
528
|
ButtonGroup.propTypes = {
|
|
542
|
-
selectedItem: PropTypes__default[
|
|
543
|
-
onSelect: PropTypes__default[
|
|
529
|
+
selectedItem: PropTypes__default["default"].any,
|
|
530
|
+
onSelect: PropTypes__default["default"].func
|
|
544
531
|
};
|
|
545
532
|
|
|
546
533
|
var _excluded$3 = ["children", "isRotated"];
|
|
547
|
-
var IconButton = React__default[
|
|
534
|
+
var IconButton = React__default["default"].forwardRef(function (_ref, ref) {
|
|
548
535
|
var children = _ref.children,
|
|
549
536
|
isRotated = _ref.isRotated,
|
|
550
537
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
551
538
|
var focusInset = useSplitButtonContext();
|
|
552
|
-
return React__default[
|
|
539
|
+
return React__default["default"].createElement(StyledIconButton, _extends$2({
|
|
553
540
|
ref: ref
|
|
554
541
|
}, otherProps, {
|
|
555
542
|
focusInset: otherProps.focusInset || focusInset
|
|
556
|
-
}), React__default[
|
|
543
|
+
}), React__default["default"].createElement(StyledIcon, {
|
|
557
544
|
isRotated: isRotated
|
|
558
545
|
}, children));
|
|
559
546
|
});
|
|
560
547
|
IconButton.displayName = 'IconButton';
|
|
561
548
|
IconButton.propTypes = {
|
|
562
|
-
isDanger: PropTypes__default[
|
|
563
|
-
size: PropTypes__default[
|
|
564
|
-
isNeutral: PropTypes__default[
|
|
565
|
-
isPrimary: PropTypes__default[
|
|
566
|
-
isBasic: PropTypes__default[
|
|
567
|
-
isPill: PropTypes__default[
|
|
568
|
-
focusInset: PropTypes__default[
|
|
569
|
-
isRotated: PropTypes__default[
|
|
549
|
+
isDanger: PropTypes__default["default"].bool,
|
|
550
|
+
size: PropTypes__default["default"].oneOf(['small', 'medium', 'large']),
|
|
551
|
+
isNeutral: PropTypes__default["default"].bool,
|
|
552
|
+
isPrimary: PropTypes__default["default"].bool,
|
|
553
|
+
isBasic: PropTypes__default["default"].bool,
|
|
554
|
+
isPill: PropTypes__default["default"].bool,
|
|
555
|
+
focusInset: PropTypes__default["default"].bool,
|
|
556
|
+
isRotated: PropTypes__default["default"].bool
|
|
570
557
|
};
|
|
571
558
|
IconButton.defaultProps = {
|
|
572
559
|
isPill: true,
|
|
@@ -574,29 +561,29 @@ IconButton.defaultProps = {
|
|
|
574
561
|
size: 'medium'
|
|
575
562
|
};
|
|
576
563
|
|
|
577
|
-
|
|
564
|
+
var _path;
|
|
578
565
|
|
|
579
|
-
var
|
|
580
|
-
fill: "currentColor",
|
|
581
|
-
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"
|
|
582
|
-
});
|
|
566
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
583
567
|
|
|
584
|
-
function SvgChevronDownStroke(props) {
|
|
568
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
585
569
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
586
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
587
571
|
width: 16,
|
|
588
572
|
height: 16,
|
|
589
|
-
viewBox: "0 0 16 16",
|
|
590
573
|
focusable: "false",
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
574
|
+
viewBox: "0 0 16 16",
|
|
575
|
+
"aria-hidden": "true"
|
|
576
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
577
|
+
fill: "currentColor",
|
|
578
|
+
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"
|
|
579
|
+
})));
|
|
580
|
+
};
|
|
594
581
|
|
|
595
|
-
var ChevronButton = React__default[
|
|
582
|
+
var ChevronButton = React__default["default"].forwardRef(function (_ref, ref) {
|
|
596
583
|
var buttonProps = _extends$2({}, _ref);
|
|
597
|
-
return React__default[
|
|
584
|
+
return React__default["default"].createElement(IconButton, _extends$2({
|
|
598
585
|
ref: ref
|
|
599
|
-
}, buttonProps), React__default[
|
|
586
|
+
}, buttonProps), React__default["default"].createElement(SvgChevronDownStroke, null));
|
|
600
587
|
});
|
|
601
588
|
ChevronButton.displayName = 'ChevronButton';
|
|
602
589
|
ChevronButton.propTypes = IconButton.propTypes;
|
|
@@ -610,23 +597,23 @@ var _excluded$2 = ["children"];
|
|
|
610
597
|
var SplitButton = function SplitButton(_ref) {
|
|
611
598
|
var children = _ref.children,
|
|
612
599
|
other = _objectWithoutProperties(_ref, _excluded$2);
|
|
613
|
-
return React__default[
|
|
600
|
+
return React__default["default"].createElement(SplitButtonContext.Provider, {
|
|
614
601
|
value: true
|
|
615
|
-
}, React__default[
|
|
602
|
+
}, React__default["default"].createElement(StyledButtonGroup, other, children));
|
|
616
603
|
};
|
|
617
604
|
|
|
618
605
|
var _excluded$1 = ["isPressed"];
|
|
619
|
-
var ToggleButton = React__default[
|
|
606
|
+
var ToggleButton = React__default["default"].forwardRef(function (_ref, ref) {
|
|
620
607
|
var isPressed = _ref.isPressed,
|
|
621
608
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
622
|
-
return React__default[
|
|
609
|
+
return React__default["default"].createElement(Button, _extends$2({
|
|
623
610
|
"aria-pressed": isPressed,
|
|
624
611
|
ref: ref
|
|
625
612
|
}, otherProps));
|
|
626
613
|
});
|
|
627
614
|
ToggleButton.displayName = 'ToggleButton';
|
|
628
615
|
ToggleButton.propTypes = _objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
|
|
629
|
-
isPressed: PropTypes__default[
|
|
616
|
+
isPressed: PropTypes__default["default"].oneOf([true, false, 'mixed'])
|
|
630
617
|
});
|
|
631
618
|
ToggleButton.defaultProps = {
|
|
632
619
|
isPressed: false,
|
|
@@ -634,17 +621,17 @@ ToggleButton.defaultProps = {
|
|
|
634
621
|
};
|
|
635
622
|
|
|
636
623
|
var _excluded = ["isPressed"];
|
|
637
|
-
var ToggleIconButton = React__default[
|
|
624
|
+
var ToggleIconButton = React__default["default"].forwardRef(function (_ref, ref) {
|
|
638
625
|
var isPressed = _ref.isPressed,
|
|
639
626
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
640
|
-
return React__default[
|
|
627
|
+
return React__default["default"].createElement(IconButton, _extends$2({
|
|
641
628
|
"aria-pressed": isPressed,
|
|
642
629
|
ref: ref
|
|
643
630
|
}, otherProps));
|
|
644
631
|
});
|
|
645
632
|
ToggleIconButton.displayName = 'ToggleIconButton';
|
|
646
633
|
ToggleIconButton.propTypes = _objectSpread2(_objectSpread2({}, IconButton.propTypes), {}, {
|
|
647
|
-
isPressed: PropTypes__default[
|
|
634
|
+
isPressed: PropTypes__default["default"].oneOf([true, false, 'mixed'])
|
|
648
635
|
});
|
|
649
636
|
ToggleIconButton.defaultProps = {
|
|
650
637
|
isPill: true,
|
package/dist/index.esm.js
CHANGED
|
@@ -18,14 +18,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
18
18
|
|
|
19
19
|
if (Object.getOwnPropertySymbols) {
|
|
20
20
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
keys.push.apply(keys, symbols);
|
|
21
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
23
|
+
})), keys.push.apply(keys, symbols);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
return keys;
|
|
@@ -33,19 +28,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
33
28
|
|
|
34
29
|
function _objectSpread2(target) {
|
|
35
30
|
for (var i = 1; i < arguments.length; i++) {
|
|
36
|
-
var source = arguments[i]
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
43
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
44
|
-
} else {
|
|
45
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
46
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
31
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
32
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
33
|
+
_defineProperty(target, key, source[key]);
|
|
34
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
35
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
36
|
+
});
|
|
49
37
|
}
|
|
50
38
|
|
|
51
39
|
return target;
|
|
@@ -123,7 +111,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
123
111
|
var COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
124
112
|
var StyledButtonGroup = styled.div.attrs({
|
|
125
113
|
'data-garden-id': COMPONENT_ID$5,
|
|
126
|
-
'data-garden-version': '8.
|
|
114
|
+
'data-garden-version': '8.47.2'
|
|
127
115
|
}).withConfig({
|
|
128
116
|
displayName: "StyledButtonGroup",
|
|
129
117
|
componentId: "sc-1fbpzef-0"
|
|
@@ -155,7 +143,7 @@ var StyledIcon = styled(function (_ref) {
|
|
|
155
143
|
return React__default.cloneElement(Children.only(children), props);
|
|
156
144
|
}).attrs({
|
|
157
145
|
'data-garden-id': COMPONENT_ID$4,
|
|
158
|
-
'data-garden-version': '8.
|
|
146
|
+
'data-garden-version': '8.47.2'
|
|
159
147
|
}).withConfig({
|
|
160
148
|
displayName: "StyledIcon",
|
|
161
149
|
componentId: "sc-19meqgg-0"
|
|
@@ -264,7 +252,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
264
252
|
var StyledButton = styled.button.attrs(function (props) {
|
|
265
253
|
return {
|
|
266
254
|
'data-garden-id': COMPONENT_ID$3,
|
|
267
|
-
'data-garden-version': '8.
|
|
255
|
+
'data-garden-version': '8.47.2',
|
|
268
256
|
type: props.type || 'button'
|
|
269
257
|
};
|
|
270
258
|
}).withConfig({
|
|
@@ -317,7 +305,7 @@ var COMPONENT_ID$2 = 'buttons.anchor';
|
|
|
317
305
|
var StyledAnchor = styled(StyledButton).attrs(function (props) {
|
|
318
306
|
return {
|
|
319
307
|
'data-garden-id': COMPONENT_ID$2,
|
|
320
|
-
'data-garden-version': '8.
|
|
308
|
+
'data-garden-version': '8.47.2',
|
|
321
309
|
as: 'a',
|
|
322
310
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
323
311
|
isLink: true,
|
|
@@ -335,30 +323,30 @@ StyledAnchor.defaultProps = {
|
|
|
335
323
|
theme: DEFAULT_THEME
|
|
336
324
|
};
|
|
337
325
|
|
|
338
|
-
|
|
326
|
+
var _path$1;
|
|
339
327
|
|
|
340
|
-
|
|
341
|
-
fill: "none",
|
|
342
|
-
stroke: "currentColor",
|
|
343
|
-
strokeLinecap: "round",
|
|
344
|
-
d: "M10.5 8.5V10c0 .3-.2.5-.5.5H2c-.3 0-.5-.2-.5-.5V2c0-.3.2-.5.5-.5h1.5M6 6l4-4m-3.5-.5H10c.3 0 .5.2.5.5v3.5"
|
|
345
|
-
});
|
|
328
|
+
function _extends$1() { _extends$1 = Object.assign || 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); }
|
|
346
329
|
|
|
347
|
-
function SvgNewWindowStroke(props) {
|
|
330
|
+
var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
348
331
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
349
332
|
xmlns: "http://www.w3.org/2000/svg",
|
|
350
333
|
width: 12,
|
|
351
334
|
height: 12,
|
|
352
|
-
viewBox: "0 0 12 12",
|
|
353
335
|
focusable: "false",
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
336
|
+
viewBox: "0 0 12 12",
|
|
337
|
+
"aria-hidden": "true"
|
|
338
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
339
|
+
fill: "none",
|
|
340
|
+
stroke: "currentColor",
|
|
341
|
+
strokeLinecap: "round",
|
|
342
|
+
d: "M10.5 8.5V10c0 .3-.2.5-.5.5H2c-.3 0-.5-.2-.5-.5V2c0-.3.2-.5.5-.5h1.5M6 6l4-4m-3.5-.5H10c.3 0 .5.2.5.5v3.5"
|
|
343
|
+
})));
|
|
344
|
+
};
|
|
357
345
|
|
|
358
346
|
var COMPONENT_ID$1 = 'buttons.external_icon';
|
|
359
347
|
var StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
|
|
360
348
|
'data-garden-id': COMPONENT_ID$1,
|
|
361
|
-
'data-garden-version': '8.
|
|
349
|
+
'data-garden-version': '8.47.2'
|
|
362
350
|
}).withConfig({
|
|
363
351
|
displayName: "StyledExternalIcon",
|
|
364
352
|
componentId: "sc-16oz07e-0"
|
|
@@ -389,7 +377,7 @@ var iconStyles = function iconStyles(props) {
|
|
|
389
377
|
};
|
|
390
378
|
var StyledIconButton = styled(StyledButton).attrs({
|
|
391
379
|
'data-garden-id': COMPONENT_ID,
|
|
392
|
-
'data-garden-version': '8.
|
|
380
|
+
'data-garden-version': '8.47.2'
|
|
393
381
|
}).withConfig({
|
|
394
382
|
displayName: "StyledIconButton",
|
|
395
383
|
componentId: "sc-1t0ughp-0"
|
|
@@ -449,6 +437,7 @@ Button.propTypes = {
|
|
|
449
437
|
Button.defaultProps = {
|
|
450
438
|
size: 'medium'
|
|
451
439
|
};
|
|
440
|
+
Button.displayName = 'Button';
|
|
452
441
|
var StartIcon = function StartIcon(props) {
|
|
453
442
|
return React__default.createElement(StyledIcon, _extends$2({
|
|
454
443
|
position: "start"
|
|
@@ -544,23 +533,23 @@ IconButton.defaultProps = {
|
|
|
544
533
|
size: 'medium'
|
|
545
534
|
};
|
|
546
535
|
|
|
547
|
-
|
|
536
|
+
var _path;
|
|
548
537
|
|
|
549
|
-
var
|
|
550
|
-
fill: "currentColor",
|
|
551
|
-
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"
|
|
552
|
-
});
|
|
538
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
553
539
|
|
|
554
|
-
function SvgChevronDownStroke(props) {
|
|
540
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
555
541
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
556
542
|
xmlns: "http://www.w3.org/2000/svg",
|
|
557
543
|
width: 16,
|
|
558
544
|
height: 16,
|
|
559
|
-
viewBox: "0 0 16 16",
|
|
560
545
|
focusable: "false",
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
546
|
+
viewBox: "0 0 16 16",
|
|
547
|
+
"aria-hidden": "true"
|
|
548
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
549
|
+
fill: "currentColor",
|
|
550
|
+
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"
|
|
551
|
+
})));
|
|
552
|
+
};
|
|
564
553
|
|
|
565
554
|
var ChevronButton = React__default.forwardRef(function (_ref, ref) {
|
|
566
555
|
var buttonProps = _extends$2({}, _ref);
|
|
@@ -10,7 +10,7 @@ export interface IAnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
10
10
|
isDanger?: boolean;
|
|
11
11
|
/**
|
|
12
12
|
* Attaches `target="_blank"` and `rel="noopener noreferrer"` to an anchor that
|
|
13
|
-
* navigates to an external resource. This ensures
|
|
13
|
+
* navigates to an external resource. This ensures that the anchor is a
|
|
14
14
|
* safe [cross-origin destination link](https://web.dev/external-anchors-use-rel-noopener/).
|
|
15
15
|
**/
|
|
16
16
|
isExternal?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-buttons",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.47.2",
|
|
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.47.2",
|
|
37
37
|
"@zendeskgarden/svg-icons": "6.30.2"
|
|
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": "41cb43f285760417ae2145e47eca0e4a600455ab"
|
|
50
50
|
}
|