@zendeskgarden/react-buttons 8.47.1 → 8.48.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 +122 -124
- package/dist/index.esm.js +77 -77
- package/dist/typings/elements/Anchor.d.ts +1 -2
- package/dist/typings/elements/Button.d.ts +12 -11
- package/dist/typings/elements/ButtonGroup.d.ts +1 -2
- package/dist/typings/elements/ChevronButton.d.ts +2 -3
- package/dist/typings/elements/IconButton.d.ts +1 -2
- package/dist/typings/elements/SplitButton.d.ts +2 -3
- package/dist/typings/elements/ToggleButton.d.ts +1 -2
- package/dist/typings/elements/ToggleIconButton.d.ts +1 -2
- package/dist/typings/elements/components/EndIcon.d.ts +18 -0
- package/dist/typings/elements/components/StartIcon.d.ts +18 -0
- package/dist/typings/index.d.ts +11 -8
- package/dist/typings/styled/StyledAnchor.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.48.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.48.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.48.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.48.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.48.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.48.2'
|
|
423
409
|
}).withConfig({
|
|
424
410
|
displayName: "StyledIconButton",
|
|
425
411
|
componentId: "sc-1t0ughp-0"
|
|
@@ -444,7 +430,23 @@ var useSplitButtonContext = function useSplitButtonContext() {
|
|
|
444
430
|
return React.useContext(SplitButtonContext);
|
|
445
431
|
};
|
|
446
432
|
|
|
447
|
-
var
|
|
433
|
+
var StartIconComponent = function StartIconComponent(props) {
|
|
434
|
+
return React__default["default"].createElement(StyledIcon, _extends$2({
|
|
435
|
+
position: "start"
|
|
436
|
+
}, props));
|
|
437
|
+
};
|
|
438
|
+
StartIconComponent.displayName = 'Button.StartIcon';
|
|
439
|
+
var StartIcon = StartIconComponent;
|
|
440
|
+
|
|
441
|
+
var EndIconComponent = function EndIconComponent(props) {
|
|
442
|
+
return React__default["default"].createElement(StyledIcon, _extends$2({
|
|
443
|
+
position: "end"
|
|
444
|
+
}, props));
|
|
445
|
+
};
|
|
446
|
+
EndIconComponent.displayName = 'Button.EndIcon';
|
|
447
|
+
var EndIcon = EndIconComponent;
|
|
448
|
+
|
|
449
|
+
var ButtonComponent = React.forwardRef(function (props, ref) {
|
|
448
450
|
var buttonGroupContext = useButtonGroupContext();
|
|
449
451
|
var splitButtonContext = useSplitButtonContext();
|
|
450
452
|
var computedProps = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -456,44 +458,36 @@ var Button = React__default['default'].forwardRef(function (props, ref) {
|
|
|
456
458
|
}
|
|
457
459
|
computedProps = buttonGroupContext.getButtonProps(_objectSpread2({
|
|
458
460
|
item: props.value,
|
|
459
|
-
focusRef: React__default[
|
|
461
|
+
focusRef: React__default["default"].createRef(),
|
|
460
462
|
isSelected: props.value === buttonGroupContext.selectedItem
|
|
461
463
|
}, computedProps));
|
|
462
464
|
}
|
|
463
|
-
return React__default[
|
|
465
|
+
return React__default["default"].createElement(StyledButton, _extends$2({
|
|
464
466
|
ref: ref
|
|
465
467
|
}, computedProps));
|
|
466
468
|
});
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
469
|
+
ButtonComponent.displayName = 'Button';
|
|
470
|
+
ButtonComponent.propTypes = {
|
|
471
|
+
isNeutral: PropTypes__default["default"].bool,
|
|
472
|
+
isPrimary: PropTypes__default["default"].bool,
|
|
473
|
+
isDanger: PropTypes__default["default"].bool,
|
|
474
|
+
isPill: PropTypes__default["default"].bool,
|
|
475
|
+
isBasic: PropTypes__default["default"].bool,
|
|
476
|
+
focusInset: PropTypes__default["default"].bool,
|
|
477
|
+
isLink: PropTypes__default["default"].bool,
|
|
478
|
+
isStretched: PropTypes__default["default"].bool,
|
|
479
|
+
isSelected: PropTypes__default["default"].bool,
|
|
480
|
+
size: PropTypes__default["default"].oneOf(['small', 'medium', 'large'])
|
|
481
|
+
};
|
|
482
|
+
ButtonComponent.defaultProps = {
|
|
480
483
|
size: 'medium'
|
|
481
484
|
};
|
|
482
|
-
var
|
|
483
|
-
return React__default['default'].createElement(StyledIcon, _extends$2({
|
|
484
|
-
position: "start"
|
|
485
|
-
}, props));
|
|
486
|
-
};
|
|
487
|
-
var EndIcon = function EndIcon(props) {
|
|
488
|
-
return React__default['default'].createElement(StyledIcon, _extends$2({
|
|
489
|
-
position: "end"
|
|
490
|
-
}, props));
|
|
491
|
-
};
|
|
492
|
-
Button.StartIcon = StartIcon;
|
|
485
|
+
var Button = ButtonComponent;
|
|
493
486
|
Button.EndIcon = EndIcon;
|
|
487
|
+
Button.StartIcon = StartIcon;
|
|
494
488
|
|
|
495
489
|
var _excluded$5 = ["children", "isExternal"];
|
|
496
|
-
var Anchor =
|
|
490
|
+
var Anchor = React.forwardRef(function (_ref, ref) {
|
|
497
491
|
var children = _ref.children,
|
|
498
492
|
isExternal = _ref.isExternal,
|
|
499
493
|
otherProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
@@ -504,18 +498,18 @@ var Anchor = React__default['default'].forwardRef(function (_ref, ref) {
|
|
|
504
498
|
rel: 'noopener noreferrer'
|
|
505
499
|
}, anchorProps);
|
|
506
500
|
}
|
|
507
|
-
return React__default[
|
|
501
|
+
return React__default["default"].createElement(StyledAnchor, _extends$2({
|
|
508
502
|
ref: ref
|
|
509
|
-
}, anchorProps), children, isExternal && React__default[
|
|
503
|
+
}, anchorProps), children, isExternal && React__default["default"].createElement(StyledExternalIcon, null));
|
|
510
504
|
});
|
|
511
505
|
Anchor.displayName = 'Anchor';
|
|
512
506
|
Anchor.propTypes = {
|
|
513
|
-
isExternal: PropTypes__default[
|
|
514
|
-
isDanger: PropTypes__default[
|
|
507
|
+
isExternal: PropTypes__default["default"].bool,
|
|
508
|
+
isDanger: PropTypes__default["default"].bool
|
|
515
509
|
};
|
|
516
510
|
|
|
517
511
|
var _excluded$4 = ["children", "onSelect", "selectedItem"];
|
|
518
|
-
var ButtonGroup = function
|
|
512
|
+
var ButtonGroup = React.forwardRef(function (_ref, ref) {
|
|
519
513
|
var children = _ref.children,
|
|
520
514
|
onSelect = _ref.onSelect,
|
|
521
515
|
controlledSelectedItem = _ref.selectedItem,
|
|
@@ -534,39 +528,42 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
534
528
|
getButtonProps: getButtonProps
|
|
535
529
|
};
|
|
536
530
|
}, [selectedItem, getButtonProps]);
|
|
537
|
-
return React__default[
|
|
531
|
+
return React__default["default"].createElement(ButtonGroupContext.Provider, {
|
|
538
532
|
value: contextValue
|
|
539
|
-
}, React__default[
|
|
540
|
-
|
|
533
|
+
}, React__default["default"].createElement(StyledButtonGroup, _extends$2({
|
|
534
|
+
ref: ref
|
|
535
|
+
}, getGroupProps(otherProps)), children));
|
|
536
|
+
});
|
|
537
|
+
ButtonGroup.displayName = 'ButtonGroup';
|
|
541
538
|
ButtonGroup.propTypes = {
|
|
542
|
-
selectedItem: PropTypes__default[
|
|
543
|
-
onSelect: PropTypes__default[
|
|
539
|
+
selectedItem: PropTypes__default["default"].any,
|
|
540
|
+
onSelect: PropTypes__default["default"].func
|
|
544
541
|
};
|
|
545
542
|
|
|
546
543
|
var _excluded$3 = ["children", "isRotated"];
|
|
547
|
-
var IconButton =
|
|
544
|
+
var IconButton = React.forwardRef(function (_ref, ref) {
|
|
548
545
|
var children = _ref.children,
|
|
549
546
|
isRotated = _ref.isRotated,
|
|
550
547
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
551
548
|
var focusInset = useSplitButtonContext();
|
|
552
|
-
return React__default[
|
|
549
|
+
return React__default["default"].createElement(StyledIconButton, _extends$2({
|
|
553
550
|
ref: ref
|
|
554
551
|
}, otherProps, {
|
|
555
552
|
focusInset: otherProps.focusInset || focusInset
|
|
556
|
-
}), React__default[
|
|
553
|
+
}), React__default["default"].createElement(StyledIcon, {
|
|
557
554
|
isRotated: isRotated
|
|
558
555
|
}, children));
|
|
559
556
|
});
|
|
560
557
|
IconButton.displayName = 'IconButton';
|
|
561
558
|
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[
|
|
559
|
+
isDanger: PropTypes__default["default"].bool,
|
|
560
|
+
size: PropTypes__default["default"].oneOf(['small', 'medium', 'large']),
|
|
561
|
+
isNeutral: PropTypes__default["default"].bool,
|
|
562
|
+
isPrimary: PropTypes__default["default"].bool,
|
|
563
|
+
isBasic: PropTypes__default["default"].bool,
|
|
564
|
+
isPill: PropTypes__default["default"].bool,
|
|
565
|
+
focusInset: PropTypes__default["default"].bool,
|
|
566
|
+
isRotated: PropTypes__default["default"].bool
|
|
570
567
|
};
|
|
571
568
|
IconButton.defaultProps = {
|
|
572
569
|
isPill: true,
|
|
@@ -574,29 +571,29 @@ IconButton.defaultProps = {
|
|
|
574
571
|
size: 'medium'
|
|
575
572
|
};
|
|
576
573
|
|
|
577
|
-
|
|
574
|
+
var _path;
|
|
578
575
|
|
|
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
|
-
});
|
|
576
|
+
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
577
|
|
|
584
|
-
function SvgChevronDownStroke(props) {
|
|
578
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
585
579
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
586
580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
587
581
|
width: 16,
|
|
588
582
|
height: 16,
|
|
589
|
-
viewBox: "0 0 16 16",
|
|
590
583
|
focusable: "false",
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
584
|
+
viewBox: "0 0 16 16",
|
|
585
|
+
"aria-hidden": "true"
|
|
586
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
587
|
+
fill: "currentColor",
|
|
588
|
+
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"
|
|
589
|
+
})));
|
|
590
|
+
};
|
|
594
591
|
|
|
595
|
-
var ChevronButton =
|
|
592
|
+
var ChevronButton = React.forwardRef(function (_ref, ref) {
|
|
596
593
|
var buttonProps = _extends$2({}, _ref);
|
|
597
|
-
return React__default[
|
|
594
|
+
return React__default["default"].createElement(IconButton, _extends$2({
|
|
598
595
|
ref: ref
|
|
599
|
-
}, buttonProps), React__default[
|
|
596
|
+
}, buttonProps), React__default["default"].createElement(SvgChevronDownStroke, null));
|
|
600
597
|
});
|
|
601
598
|
ChevronButton.displayName = 'ChevronButton';
|
|
602
599
|
ChevronButton.propTypes = IconButton.propTypes;
|
|
@@ -607,49 +604,50 @@ ChevronButton.defaultProps = {
|
|
|
607
604
|
};
|
|
608
605
|
|
|
609
606
|
var _excluded$2 = ["children"];
|
|
610
|
-
var SplitButton = function
|
|
607
|
+
var SplitButton = React.forwardRef(function (_ref, ref) {
|
|
611
608
|
var children = _ref.children,
|
|
612
609
|
other = _objectWithoutProperties(_ref, _excluded$2);
|
|
613
|
-
return React__default[
|
|
610
|
+
return React__default["default"].createElement(SplitButtonContext.Provider, {
|
|
614
611
|
value: true
|
|
615
|
-
}, React__default[
|
|
616
|
-
|
|
612
|
+
}, React__default["default"].createElement(StyledButtonGroup, _extends$2({
|
|
613
|
+
ref: ref
|
|
614
|
+
}, other), children));
|
|
615
|
+
});
|
|
616
|
+
SplitButton.displayName = 'SplitButton';
|
|
617
617
|
|
|
618
618
|
var _excluded$1 = ["isPressed"];
|
|
619
|
-
var ToggleButton =
|
|
619
|
+
var ToggleButton = React.forwardRef(function (_ref, ref) {
|
|
620
620
|
var isPressed = _ref.isPressed,
|
|
621
621
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
622
|
-
return React__default[
|
|
622
|
+
return React__default["default"].createElement(Button, _extends$2({
|
|
623
623
|
"aria-pressed": isPressed,
|
|
624
624
|
ref: ref
|
|
625
625
|
}, otherProps));
|
|
626
626
|
});
|
|
627
627
|
ToggleButton.displayName = 'ToggleButton';
|
|
628
628
|
ToggleButton.propTypes = _objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
|
|
629
|
-
isPressed: PropTypes__default[
|
|
629
|
+
isPressed: PropTypes__default["default"].oneOf([true, false, 'mixed'])
|
|
630
630
|
});
|
|
631
631
|
ToggleButton.defaultProps = {
|
|
632
|
-
isPressed: false,
|
|
633
632
|
size: 'medium'
|
|
634
633
|
};
|
|
635
634
|
|
|
636
635
|
var _excluded = ["isPressed"];
|
|
637
|
-
var ToggleIconButton =
|
|
636
|
+
var ToggleIconButton = React.forwardRef(function (_ref, ref) {
|
|
638
637
|
var isPressed = _ref.isPressed,
|
|
639
638
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
640
|
-
return React__default[
|
|
639
|
+
return React__default["default"].createElement(IconButton, _extends$2({
|
|
641
640
|
"aria-pressed": isPressed,
|
|
642
641
|
ref: ref
|
|
643
642
|
}, otherProps));
|
|
644
643
|
});
|
|
645
644
|
ToggleIconButton.displayName = 'ToggleIconButton';
|
|
646
645
|
ToggleIconButton.propTypes = _objectSpread2(_objectSpread2({}, IconButton.propTypes), {}, {
|
|
647
|
-
isPressed: PropTypes__default[
|
|
646
|
+
isPressed: PropTypes__default["default"].oneOf([true, false, 'mixed'])
|
|
648
647
|
});
|
|
649
648
|
ToggleIconButton.defaultProps = {
|
|
650
649
|
isPill: true,
|
|
651
650
|
isBasic: true,
|
|
652
|
-
isPressed: false,
|
|
653
651
|
size: 'medium'
|
|
654
652
|
};
|
|
655
653
|
|
package/dist/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { Children, createContext, useContext, useMemo } from 'react';
|
|
9
|
+
import React__default, { Children, createContext, useContext, forwardRef, useMemo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import styled, { css } from 'styled-components';
|
|
12
12
|
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
@@ -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.48.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.48.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.48.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.48.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.48.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.48.2'
|
|
393
381
|
}).withConfig({
|
|
394
382
|
displayName: "StyledIconButton",
|
|
395
383
|
componentId: "sc-1t0ughp-0"
|
|
@@ -414,7 +402,23 @@ var useSplitButtonContext = function useSplitButtonContext() {
|
|
|
414
402
|
return useContext(SplitButtonContext);
|
|
415
403
|
};
|
|
416
404
|
|
|
417
|
-
var
|
|
405
|
+
var StartIconComponent = function StartIconComponent(props) {
|
|
406
|
+
return React__default.createElement(StyledIcon, _extends$2({
|
|
407
|
+
position: "start"
|
|
408
|
+
}, props));
|
|
409
|
+
};
|
|
410
|
+
StartIconComponent.displayName = 'Button.StartIcon';
|
|
411
|
+
var StartIcon = StartIconComponent;
|
|
412
|
+
|
|
413
|
+
var EndIconComponent = function EndIconComponent(props) {
|
|
414
|
+
return React__default.createElement(StyledIcon, _extends$2({
|
|
415
|
+
position: "end"
|
|
416
|
+
}, props));
|
|
417
|
+
};
|
|
418
|
+
EndIconComponent.displayName = 'Button.EndIcon';
|
|
419
|
+
var EndIcon = EndIconComponent;
|
|
420
|
+
|
|
421
|
+
var ButtonComponent = forwardRef(function (props, ref) {
|
|
418
422
|
var buttonGroupContext = useButtonGroupContext();
|
|
419
423
|
var splitButtonContext = useSplitButtonContext();
|
|
420
424
|
var computedProps = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -434,7 +438,8 @@ var Button = React__default.forwardRef(function (props, ref) {
|
|
|
434
438
|
ref: ref
|
|
435
439
|
}, computedProps));
|
|
436
440
|
});
|
|
437
|
-
|
|
441
|
+
ButtonComponent.displayName = 'Button';
|
|
442
|
+
ButtonComponent.propTypes = {
|
|
438
443
|
isNeutral: PropTypes.bool,
|
|
439
444
|
isPrimary: PropTypes.bool,
|
|
440
445
|
isDanger: PropTypes.bool,
|
|
@@ -446,24 +451,15 @@ Button.propTypes = {
|
|
|
446
451
|
isSelected: PropTypes.bool,
|
|
447
452
|
size: PropTypes.oneOf(['small', 'medium', 'large'])
|
|
448
453
|
};
|
|
449
|
-
|
|
454
|
+
ButtonComponent.defaultProps = {
|
|
450
455
|
size: 'medium'
|
|
451
456
|
};
|
|
452
|
-
var
|
|
453
|
-
return React__default.createElement(StyledIcon, _extends$2({
|
|
454
|
-
position: "start"
|
|
455
|
-
}, props));
|
|
456
|
-
};
|
|
457
|
-
var EndIcon = function EndIcon(props) {
|
|
458
|
-
return React__default.createElement(StyledIcon, _extends$2({
|
|
459
|
-
position: "end"
|
|
460
|
-
}, props));
|
|
461
|
-
};
|
|
462
|
-
Button.StartIcon = StartIcon;
|
|
457
|
+
var Button = ButtonComponent;
|
|
463
458
|
Button.EndIcon = EndIcon;
|
|
459
|
+
Button.StartIcon = StartIcon;
|
|
464
460
|
|
|
465
461
|
var _excluded$5 = ["children", "isExternal"];
|
|
466
|
-
var Anchor =
|
|
462
|
+
var Anchor = forwardRef(function (_ref, ref) {
|
|
467
463
|
var children = _ref.children,
|
|
468
464
|
isExternal = _ref.isExternal,
|
|
469
465
|
otherProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
@@ -485,7 +481,7 @@ Anchor.propTypes = {
|
|
|
485
481
|
};
|
|
486
482
|
|
|
487
483
|
var _excluded$4 = ["children", "onSelect", "selectedItem"];
|
|
488
|
-
var ButtonGroup = function
|
|
484
|
+
var ButtonGroup = forwardRef(function (_ref, ref) {
|
|
489
485
|
var children = _ref.children,
|
|
490
486
|
onSelect = _ref.onSelect,
|
|
491
487
|
controlledSelectedItem = _ref.selectedItem,
|
|
@@ -506,15 +502,18 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
506
502
|
}, [selectedItem, getButtonProps]);
|
|
507
503
|
return React__default.createElement(ButtonGroupContext.Provider, {
|
|
508
504
|
value: contextValue
|
|
509
|
-
}, React__default.createElement(StyledButtonGroup,
|
|
510
|
-
|
|
505
|
+
}, React__default.createElement(StyledButtonGroup, _extends$2({
|
|
506
|
+
ref: ref
|
|
507
|
+
}, getGroupProps(otherProps)), children));
|
|
508
|
+
});
|
|
509
|
+
ButtonGroup.displayName = 'ButtonGroup';
|
|
511
510
|
ButtonGroup.propTypes = {
|
|
512
511
|
selectedItem: PropTypes.any,
|
|
513
512
|
onSelect: PropTypes.func
|
|
514
513
|
};
|
|
515
514
|
|
|
516
515
|
var _excluded$3 = ["children", "isRotated"];
|
|
517
|
-
var IconButton =
|
|
516
|
+
var IconButton = forwardRef(function (_ref, ref) {
|
|
518
517
|
var children = _ref.children,
|
|
519
518
|
isRotated = _ref.isRotated,
|
|
520
519
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
@@ -544,25 +543,25 @@ IconButton.defaultProps = {
|
|
|
544
543
|
size: 'medium'
|
|
545
544
|
};
|
|
546
545
|
|
|
547
|
-
|
|
546
|
+
var _path;
|
|
548
547
|
|
|
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
|
-
});
|
|
548
|
+
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
549
|
|
|
554
|
-
function SvgChevronDownStroke(props) {
|
|
550
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
555
551
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
556
552
|
xmlns: "http://www.w3.org/2000/svg",
|
|
557
553
|
width: 16,
|
|
558
554
|
height: 16,
|
|
559
|
-
viewBox: "0 0 16 16",
|
|
560
555
|
focusable: "false",
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
556
|
+
viewBox: "0 0 16 16",
|
|
557
|
+
"aria-hidden": "true"
|
|
558
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
559
|
+
fill: "currentColor",
|
|
560
|
+
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"
|
|
561
|
+
})));
|
|
562
|
+
};
|
|
564
563
|
|
|
565
|
-
var ChevronButton =
|
|
564
|
+
var ChevronButton = forwardRef(function (_ref, ref) {
|
|
566
565
|
var buttonProps = _extends$2({}, _ref);
|
|
567
566
|
return React__default.createElement(IconButton, _extends$2({
|
|
568
567
|
ref: ref
|
|
@@ -577,16 +576,19 @@ ChevronButton.defaultProps = {
|
|
|
577
576
|
};
|
|
578
577
|
|
|
579
578
|
var _excluded$2 = ["children"];
|
|
580
|
-
var SplitButton = function
|
|
579
|
+
var SplitButton = forwardRef(function (_ref, ref) {
|
|
581
580
|
var children = _ref.children,
|
|
582
581
|
other = _objectWithoutProperties(_ref, _excluded$2);
|
|
583
582
|
return React__default.createElement(SplitButtonContext.Provider, {
|
|
584
583
|
value: true
|
|
585
|
-
}, React__default.createElement(StyledButtonGroup,
|
|
586
|
-
|
|
584
|
+
}, React__default.createElement(StyledButtonGroup, _extends$2({
|
|
585
|
+
ref: ref
|
|
586
|
+
}, other), children));
|
|
587
|
+
});
|
|
588
|
+
SplitButton.displayName = 'SplitButton';
|
|
587
589
|
|
|
588
590
|
var _excluded$1 = ["isPressed"];
|
|
589
|
-
var ToggleButton =
|
|
591
|
+
var ToggleButton = forwardRef(function (_ref, ref) {
|
|
590
592
|
var isPressed = _ref.isPressed,
|
|
591
593
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
592
594
|
return React__default.createElement(Button, _extends$2({
|
|
@@ -599,12 +601,11 @@ ToggleButton.propTypes = _objectSpread2(_objectSpread2({}, Button.propTypes), {}
|
|
|
599
601
|
isPressed: PropTypes.oneOf([true, false, 'mixed'])
|
|
600
602
|
});
|
|
601
603
|
ToggleButton.defaultProps = {
|
|
602
|
-
isPressed: false,
|
|
603
604
|
size: 'medium'
|
|
604
605
|
};
|
|
605
606
|
|
|
606
607
|
var _excluded = ["isPressed"];
|
|
607
|
-
var ToggleIconButton =
|
|
608
|
+
var ToggleIconButton = forwardRef(function (_ref, ref) {
|
|
608
609
|
var isPressed = _ref.isPressed,
|
|
609
610
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
610
611
|
return React__default.createElement(IconButton, _extends$2({
|
|
@@ -619,7 +620,6 @@ ToggleIconButton.propTypes = _objectSpread2(_objectSpread2({}, IconButton.propTy
|
|
|
619
620
|
ToggleIconButton.defaultProps = {
|
|
620
621
|
isPill: true,
|
|
621
622
|
isBasic: true,
|
|
622
|
-
isPressed: false,
|
|
623
623
|
size: 'medium'
|
|
624
624
|
};
|
|
625
625
|
|
|
@@ -18,5 +18,4 @@ export interface IAnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
18
18
|
/**
|
|
19
19
|
* @extends AnchorHTMLAttributes<HTMLAnchorElement>
|
|
20
20
|
*/
|
|
21
|
-
declare const Anchor: React.
|
|
22
|
-
export default Anchor;
|
|
21
|
+
export declare const Anchor: React.ForwardRefExoticComponent<IAnchorProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import React, { ButtonHTMLAttributes, SVGAttributes } from 'react';
|
|
8
|
+
import { StartIcon } from './components/StartIcon';
|
|
9
|
+
import { EndIcon } from './components/EndIcon';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use IButtonStartIconProps or IButtonEndIconProps instead
|
|
12
|
+
*/
|
|
13
|
+
export interface IIconProps extends SVGAttributes<SVGSVGElement> {
|
|
14
|
+
isRotated?: boolean;
|
|
15
|
+
}
|
|
8
16
|
export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
17
|
/** Applies danger styling */
|
|
10
18
|
isDanger?: boolean;
|
|
@@ -27,17 +35,10 @@ export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
27
35
|
/** @ignore prop used by `ButtonGroup` */
|
|
28
36
|
isSelected?: boolean;
|
|
29
37
|
}
|
|
30
|
-
export interface IIconProps extends SVGAttributes<SVGSVGElement> {
|
|
31
|
-
isRotated?: boolean;
|
|
32
|
-
children: any;
|
|
33
|
-
}
|
|
34
|
-
declare const StartIcon: (props: IIconProps) => JSX.Element;
|
|
35
|
-
declare const EndIcon: (props: IIconProps) => JSX.Element;
|
|
36
|
-
declare const _default: React.FunctionComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>> & {
|
|
37
|
-
StartIcon: typeof StartIcon;
|
|
38
|
-
EndIcon: typeof EndIcon;
|
|
39
|
-
};
|
|
40
38
|
/**
|
|
41
39
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
42
40
|
*/
|
|
43
|
-
export
|
|
41
|
+
export declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>> & {
|
|
42
|
+
EndIcon: typeof EndIcon;
|
|
43
|
+
StartIcon: typeof StartIcon;
|
|
44
|
+
};
|
|
@@ -18,5 +18,4 @@ export interface IButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
18
18
|
/**
|
|
19
19
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
20
20
|
*/
|
|
21
|
-
declare const ButtonGroup: React.
|
|
22
|
-
export default ButtonGroup;
|
|
21
|
+
export declare const ButtonGroup: React.ForwardRefExoticComponent<IButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { IIconButtonProps } from './IconButton';
|
|
8
|
+
import { IIconButtonProps as IChevronButtonProps } from './IconButton';
|
|
9
9
|
/**
|
|
10
10
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
11
11
|
*/
|
|
12
|
-
declare const ChevronButton: React.
|
|
13
|
-
export default ChevronButton;
|
|
12
|
+
export declare const ChevronButton: React.ForwardRefExoticComponent<IChevronButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -26,5 +26,4 @@ export interface IIconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement
|
|
|
26
26
|
/**
|
|
27
27
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
28
28
|
*/
|
|
29
|
-
declare const IconButton: React.
|
|
30
|
-
export default IconButton;
|
|
29
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
7
|
+
import React from 'react';
|
|
8
8
|
/**
|
|
9
9
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
10
10
|
*/
|
|
11
|
-
declare const SplitButton: React.
|
|
12
|
-
export default SplitButton;
|
|
11
|
+
export declare const SplitButton: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -16,5 +16,4 @@ export interface IToggleButtonProps extends IButtonProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
18
18
|
*/
|
|
19
|
-
declare const ToggleButton: React.
|
|
20
|
-
export default ToggleButton;
|
|
19
|
+
export declare const ToggleButton: React.ForwardRefExoticComponent<IToggleButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -16,5 +16,4 @@ export interface IToggleIconButtonProps extends IIconButtonProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
18
18
|
*/
|
|
19
|
-
declare const ToggleIconButton: React.
|
|
20
|
-
export default ToggleIconButton;
|
|
19
|
+
export declare const ToggleIconButton: React.ForwardRefExoticComponent<IToggleIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { SVGAttributes } from 'react';
|
|
8
|
+
export interface IButtonEndIconProps extends SVGAttributes<SVGElement> {
|
|
9
|
+
/** Rotates icon 180 degrees */
|
|
10
|
+
isRotated?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @extends SVGAttributes<SVGElement>
|
|
14
|
+
*/
|
|
15
|
+
export declare const EndIcon: {
|
|
16
|
+
(props: IButtonEndIconProps): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { SVGAttributes } from 'react';
|
|
8
|
+
export interface IButtonStartIconProps extends SVGAttributes<SVGElement> {
|
|
9
|
+
/** Rotates icon 180 degrees */
|
|
10
|
+
isRotated?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @extends SVGAttributes<SVGElement>
|
|
14
|
+
*/
|
|
15
|
+
export declare const StartIcon: {
|
|
16
|
+
(props: IButtonStartIconProps): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -4,16 +4,19 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { Button } from './elements/Button';
|
|
8
8
|
export type { IButtonProps, IIconProps } from './elements/Button';
|
|
9
|
-
export {
|
|
9
|
+
export type { IButtonEndIconProps } from './elements/components/EndIcon';
|
|
10
|
+
export type { IButtonStartIconProps } from './elements/components/StartIcon';
|
|
11
|
+
export { Anchor } from './elements/Anchor';
|
|
10
12
|
export type { IAnchorProps } from './elements/Anchor';
|
|
11
|
-
export {
|
|
13
|
+
export { ButtonGroup } from './elements/ButtonGroup';
|
|
12
14
|
export type { IButtonGroupProps } from './elements/ButtonGroup';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
15
|
+
export { ChevronButton } from './elements/ChevronButton';
|
|
16
|
+
export { IconButton } from './elements/IconButton';
|
|
17
|
+
export type { IIconButtonProps, IIconButtonProps as IChevronButtonProps } from './elements/IconButton';
|
|
18
|
+
export { SplitButton } from './elements/SplitButton';
|
|
19
|
+
export { ToggleButton } from './elements/ToggleButton';
|
|
17
20
|
export type { IToggleButtonProps } from './elements/ToggleButton';
|
|
18
|
-
export {
|
|
21
|
+
export { ToggleIconButton } from './elements/ToggleIconButton';
|
|
19
22
|
export type { IToggleIconButtonProps } from './elements/ToggleIconButton';
|
|
@@ -14,4 +14,4 @@ export declare const StyledAnchor: import("styled-components").StyledComponent<"
|
|
|
14
14
|
dir: "rtl" | undefined;
|
|
15
15
|
isLink: boolean;
|
|
16
16
|
type: undefined;
|
|
17
|
-
}, "type" | "dir" | "
|
|
17
|
+
}, "type" | "dir" | "data-garden-id" | "data-garden-version" | "as" | "isLink">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-buttons",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.48.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.48.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": "c514c351b0973fe1f9853853c536d4fac10f4ce4"
|
|
50
50
|
}
|