@zendeskgarden/react-dropdowns 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 +306 -307
- package/dist/index.esm.js +119 -116
- package/dist/typings/elements/Dropdown/Dropdown.d.ts +2 -3
- package/dist/typings/elements/Menu/Items/AddItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/Item.d.ts +3 -1
- package/dist/typings/elements/Menu/Items/NextItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/PreviousItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Menu.d.ts +1 -2
- package/dist/typings/elements/Multiselect/Multiselect.d.ts +1 -2
- package/dist/typings/index.d.ts +3 -3
- package/dist/typings/styled/items/StyledItem.d.ts +1 -0
- package/dist/typings/styled/items/media/StyledMediaFigure.d.ts +179 -179
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import React__default, { useContext, useRef, useState, Children, useEffect, useCallback, useMemo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import styled, { ThemeContext, css } from 'styled-components';
|
|
11
12
|
import Downshift from 'downshift';
|
|
12
13
|
export { resetIdCounter } from 'downshift';
|
|
13
14
|
import { Manager, Reference, Popper } from 'react-popper';
|
|
14
|
-
import { withTheme, isRtl, arrowStyles, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
15
15
|
import { composeEventHandlers, KEY_CODES } from '@zendeskgarden/container-utilities';
|
|
16
|
-
import
|
|
17
|
-
import { math } from 'polished';
|
|
16
|
+
import { arrowStyles, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
17
|
+
import { rgba, math } from 'polished';
|
|
18
18
|
import { FauxInput, Input, MediaInput, Field as Field$1, Hint as Hint$1, Label as Label$1, Message as Message$1 } from '@zendeskgarden/react-forms';
|
|
19
19
|
import mergeRefs from 'react-merge-refs';
|
|
20
20
|
import { useSelection } from '@zendeskgarden/container-selection';
|
|
@@ -24,14 +24,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
24
24
|
|
|
25
25
|
if (Object.getOwnPropertySymbols) {
|
|
26
26
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
keys.push.apply(keys, symbols);
|
|
27
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
28
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
29
|
+
})), keys.push.apply(keys, symbols);
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
return keys;
|
|
@@ -39,19 +34,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
39
34
|
|
|
40
35
|
function _objectSpread2(target) {
|
|
41
36
|
for (var i = 1; i < arguments.length; i++) {
|
|
42
|
-
var source = arguments[i]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
49
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
50
|
-
} else {
|
|
51
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
52
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
53
|
-
});
|
|
54
|
-
}
|
|
37
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
38
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
39
|
+
_defineProperty(target, key, source[key]);
|
|
40
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
55
43
|
}
|
|
56
44
|
|
|
57
45
|
return target;
|
|
@@ -218,6 +206,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
218
206
|
_useState2 = _slicedToArray(_useState, 2),
|
|
219
207
|
dropdownType = _useState2[0],
|
|
220
208
|
setDropdownType = _useState2[1];
|
|
209
|
+
var themeContext = useContext(ThemeContext);
|
|
221
210
|
var hasMenuRef = useRef(false);
|
|
222
211
|
var popperReferenceElementRef = useRef(null);
|
|
223
212
|
var customGetInputProps = function customGetInputProps(_ref, downshift, rtl) {
|
|
@@ -255,7 +244,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
255
244
|
downshift = _objectWithoutProperties(_ref2, _excluded2$6);
|
|
256
245
|
return _objectSpread2({
|
|
257
246
|
getInputProps: function getInputProps(p) {
|
|
258
|
-
return _getInputProps(customGetInputProps(p, downshift,
|
|
247
|
+
return _getInputProps(customGetInputProps(p, downshift, themeContext.rtl));
|
|
259
248
|
},
|
|
260
249
|
getToggleButtonProps: function getToggleButtonProps(p) {
|
|
261
250
|
return _getToggleButtonProps(_objectSpread2({
|
|
@@ -352,7 +341,6 @@ Dropdown.propTypes = {
|
|
|
352
341
|
onStateChange: PropTypes.func,
|
|
353
342
|
downshiftProps: PropTypes.object
|
|
354
343
|
};
|
|
355
|
-
var Dropdown$1 = withTheme(Dropdown);
|
|
356
344
|
|
|
357
345
|
function getPopperPlacement(gardenPlacement) {
|
|
358
346
|
switch (gardenPlacement) {
|
|
@@ -428,7 +416,7 @@ var COMPONENT_ID$m = 'dropdowns.menu';
|
|
|
428
416
|
var StyledMenu = styled.ul.attrs(function (props) {
|
|
429
417
|
return {
|
|
430
418
|
'data-garden-id': COMPONENT_ID$m,
|
|
431
|
-
'data-garden-version': '8.
|
|
419
|
+
'data-garden-version': '8.47.2',
|
|
432
420
|
className: props.isAnimated && 'is-animated'
|
|
433
421
|
};
|
|
434
422
|
}).withConfig({
|
|
@@ -453,7 +441,7 @@ var COMPONENT_ID$l = 'dropdowns.menu_wrapper';
|
|
|
453
441
|
var StyledMenuWrapper = styled.div.attrs(function (props) {
|
|
454
442
|
return {
|
|
455
443
|
'data-garden-id': COMPONENT_ID$l,
|
|
456
|
-
'data-garden-version': '8.
|
|
444
|
+
'data-garden-version': '8.47.2',
|
|
457
445
|
className: props.isAnimated && 'is-animated'
|
|
458
446
|
};
|
|
459
447
|
}).withConfig({
|
|
@@ -477,7 +465,7 @@ StyledMenuWrapper.defaultProps = {
|
|
|
477
465
|
var COMPONENT_ID$k = 'dropdowns.separator';
|
|
478
466
|
var StyledSeparator = styled.li.attrs({
|
|
479
467
|
'data-garden-id': COMPONENT_ID$k,
|
|
480
|
-
'data-garden-version': '8.
|
|
468
|
+
'data-garden-version': '8.47.2',
|
|
481
469
|
role: 'separator'
|
|
482
470
|
}).withConfig({
|
|
483
471
|
displayName: "StyledSeparator",
|
|
@@ -501,18 +489,29 @@ var getItemPaddingVertical = function getItemPaddingVertical(props) {
|
|
|
501
489
|
return "".concat(props.theme.space.base * 2, "px");
|
|
502
490
|
};
|
|
503
491
|
var getColorStyles = function getColorStyles(props) {
|
|
504
|
-
|
|
492
|
+
var foregroundColor;
|
|
493
|
+
var backgroundColor;
|
|
494
|
+
if (props.disabled) {
|
|
495
|
+
foregroundColor = getColor('neutralHue', 400, props.theme);
|
|
496
|
+
} else if (props.isDanger) {
|
|
497
|
+
foregroundColor = getColor('dangerHue', 600, props.theme);
|
|
498
|
+
backgroundColor = props.isFocused ? rgba(foregroundColor, 0.08) : 'inherit';
|
|
499
|
+
} else {
|
|
500
|
+
foregroundColor = props.theme.colors.foreground;
|
|
501
|
+
backgroundColor = props.isFocused ? getColor('primaryHue', 600, props.theme, 0.08) : 'inherit';
|
|
502
|
+
}
|
|
503
|
+
return css(["background-color:", ";color:", ";& a,& a:hover,& a:focus,& a:active{color:inherit;}"], backgroundColor, foregroundColor);
|
|
505
504
|
};
|
|
506
505
|
var StyledItem = styled.li.attrs(function (props) {
|
|
507
506
|
return {
|
|
508
507
|
'data-garden-id': COMPONENT_ID$j,
|
|
509
|
-
'data-garden-version': '8.
|
|
508
|
+
'data-garden-version': '8.47.2',
|
|
510
509
|
'aria-disabled': props.disabled
|
|
511
510
|
};
|
|
512
511
|
}).withConfig({
|
|
513
512
|
displayName: "StyledItem",
|
|
514
513
|
componentId: "sc-1xeog7q-0"
|
|
515
|
-
})(["display:block;position:relative;z-index:0;cursor:", ";padding:", " ", "px;text-decoration:none;line-height:", "px;word-wrap:break-word;user-select:none;&:first-child{margin-top:", "px;}&:last-child{margin-bottom:", "px;}&:focus{outline:none;}& a,& a:hover,& a:focus,& a:active{text-decoration:none;}", "
|
|
514
|
+
})(["display:block;position:relative;z-index:0;cursor:", ";padding:", " ", "px;text-decoration:none;line-height:", "px;word-wrap:break-word;user-select:none;&:first-child{margin-top:", "px;}&:last-child{margin-bottom:", "px;}&:focus{outline:none;}& a,& a:hover,& a:focus,& a:active{text-decoration:none;}", ";", ";"], function (props) {
|
|
516
515
|
return props.disabled ? 'default' : 'pointer';
|
|
517
516
|
}, function (props) {
|
|
518
517
|
return getItemPaddingVertical(props);
|
|
@@ -536,7 +535,7 @@ StyledItem.defaultProps = {
|
|
|
536
535
|
var COMPONENT_ID$i = 'dropdowns.add_item';
|
|
537
536
|
var StyledAddItem = styled(StyledItem).attrs({
|
|
538
537
|
'data-garden-id': COMPONENT_ID$i,
|
|
539
|
-
'data-garden-version': '8.
|
|
538
|
+
'data-garden-version': '8.47.2'
|
|
540
539
|
}).withConfig({
|
|
541
540
|
displayName: "StyledAddItem",
|
|
542
541
|
componentId: "sc-ekqk50-0"
|
|
@@ -552,7 +551,7 @@ StyledAddItem.defaultProps = {
|
|
|
552
551
|
var COMPONENT_ID$h = 'dropdowns.item_meta';
|
|
553
552
|
var StyledItemMeta = styled.span.attrs({
|
|
554
553
|
'data-garden-id': COMPONENT_ID$h,
|
|
555
|
-
'data-garden-version': '8.
|
|
554
|
+
'data-garden-version': '8.47.2'
|
|
556
555
|
}).withConfig({
|
|
557
556
|
displayName: "StyledItemMeta",
|
|
558
557
|
componentId: "sc-k6xy28-0"
|
|
@@ -575,7 +574,7 @@ var getSizeStyles = function getSizeStyles(props) {
|
|
|
575
574
|
};
|
|
576
575
|
var StyledItemIcon = styled.div.attrs({
|
|
577
576
|
'data-garden-id': COMPONENT_ID$g,
|
|
578
|
-
'data-garden-version': '8.
|
|
577
|
+
'data-garden-version': '8.47.2'
|
|
579
578
|
}).withConfig({
|
|
580
579
|
displayName: "StyledItemIcon",
|
|
581
580
|
componentId: "sc-1v0ty11-0"
|
|
@@ -601,7 +600,7 @@ StyledItemIcon.defaultProps = {
|
|
|
601
600
|
var COMPONENT_ID$f = 'dropdowns.next_item';
|
|
602
601
|
var StyledNextItem = styled(StyledItem).attrs({
|
|
603
602
|
'data-garden-id': COMPONENT_ID$f,
|
|
604
|
-
'data-garden-version': '8.
|
|
603
|
+
'data-garden-version': '8.47.2'
|
|
605
604
|
}).withConfig({
|
|
606
605
|
displayName: "StyledNextItem",
|
|
607
606
|
componentId: "sc-1bcygn5-0"
|
|
@@ -616,30 +615,30 @@ StyledNextItem.defaultProps = {
|
|
|
616
615
|
theme: DEFAULT_THEME
|
|
617
616
|
};
|
|
618
617
|
|
|
619
|
-
|
|
618
|
+
var _path$4;
|
|
620
619
|
|
|
621
|
-
|
|
622
|
-
fill: "currentColor",
|
|
623
|
-
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
624
|
-
});
|
|
620
|
+
function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
|
|
625
621
|
|
|
626
|
-
function SvgChevronRightStroke(props) {
|
|
622
|
+
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
627
623
|
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
628
624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
629
625
|
width: 16,
|
|
630
626
|
height: 16,
|
|
631
|
-
viewBox: "0 0 16 16",
|
|
632
627
|
focusable: "false",
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
628
|
+
viewBox: "0 0 16 16",
|
|
629
|
+
"aria-hidden": "true"
|
|
630
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
631
|
+
fill: "currentColor",
|
|
632
|
+
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
633
|
+
})));
|
|
634
|
+
};
|
|
636
635
|
|
|
637
636
|
var COMPONENT_ID$e = 'dropdowns.next_item_icon';
|
|
638
637
|
var NextIconComponent = function NextIconComponent(_ref) {
|
|
639
638
|
var className = _ref.className;
|
|
640
639
|
return React__default.createElement(SvgChevronRightStroke, {
|
|
641
640
|
"data-garden-id": COMPONENT_ID$e,
|
|
642
|
-
"data-garden-version": '8.
|
|
641
|
+
"data-garden-version": '8.47.2',
|
|
643
642
|
className: className
|
|
644
643
|
});
|
|
645
644
|
};
|
|
@@ -660,7 +659,7 @@ StyledNextIcon.defaultProps = {
|
|
|
660
659
|
var COMPONENT_ID$d = 'dropdowns.previous_item';
|
|
661
660
|
var StyledPreviousItem = styled(StyledItem).attrs({
|
|
662
661
|
'data-garden-id': COMPONENT_ID$d,
|
|
663
|
-
'data-garden-version': '8.
|
|
662
|
+
'data-garden-version': '8.47.2'
|
|
664
663
|
}).withConfig({
|
|
665
664
|
displayName: "StyledPreviousItem",
|
|
666
665
|
componentId: "sc-1nmdds9-0"
|
|
@@ -673,30 +672,30 @@ StyledPreviousItem.defaultProps = {
|
|
|
673
672
|
theme: DEFAULT_THEME
|
|
674
673
|
};
|
|
675
674
|
|
|
676
|
-
|
|
675
|
+
var _path$3;
|
|
677
676
|
|
|
678
|
-
|
|
679
|
-
fill: "currentColor",
|
|
680
|
-
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
681
|
-
});
|
|
677
|
+
function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
|
|
682
678
|
|
|
683
|
-
function SvgChevronLeftStroke(props) {
|
|
679
|
+
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
684
680
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
685
681
|
xmlns: "http://www.w3.org/2000/svg",
|
|
686
682
|
width: 16,
|
|
687
683
|
height: 16,
|
|
688
|
-
viewBox: "0 0 16 16",
|
|
689
684
|
focusable: "false",
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
685
|
+
viewBox: "0 0 16 16",
|
|
686
|
+
"aria-hidden": "true"
|
|
687
|
+
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
688
|
+
fill: "currentColor",
|
|
689
|
+
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
690
|
+
})));
|
|
691
|
+
};
|
|
693
692
|
|
|
694
693
|
var COMPONENT_ID$c = 'dropdowns.previous_item_icon';
|
|
695
694
|
var PreviousIconComponent = function PreviousIconComponent(_ref) {
|
|
696
695
|
var className = _ref.className;
|
|
697
696
|
return React__default.createElement(SvgChevronLeftStroke, {
|
|
698
697
|
"data-garden-id": COMPONENT_ID$c,
|
|
699
|
-
"data-garden-version": '8.
|
|
698
|
+
"data-garden-version": '8.47.2',
|
|
700
699
|
className: className
|
|
701
700
|
});
|
|
702
701
|
};
|
|
@@ -717,7 +716,7 @@ StyledPreviousIcon.defaultProps = {
|
|
|
717
716
|
var COMPONENT_ID$b = 'dropdowns.header_icon';
|
|
718
717
|
var StyledHeaderIcon = styled.div.attrs({
|
|
719
718
|
'data-garden-id': COMPONENT_ID$b,
|
|
720
|
-
'data-garden-version': '8.
|
|
719
|
+
'data-garden-version': '8.47.2'
|
|
721
720
|
}).withConfig({
|
|
722
721
|
displayName: "StyledHeaderIcon",
|
|
723
722
|
componentId: "sc-1fl6nsz-0"
|
|
@@ -747,7 +746,7 @@ var getHorizontalPadding = function getHorizontalPadding(props) {
|
|
|
747
746
|
};
|
|
748
747
|
var StyledHeaderItem = styled(StyledItem).attrs({
|
|
749
748
|
'data-garden-id': COMPONENT_ID$a,
|
|
750
|
-
'data-garden-version': '8.
|
|
749
|
+
'data-garden-version': '8.47.2'
|
|
751
750
|
}).withConfig({
|
|
752
751
|
displayName: "StyledHeaderItem",
|
|
753
752
|
componentId: "sc-137filx-0"
|
|
@@ -767,7 +766,7 @@ StyledHeaderItem.defaultProps = {
|
|
|
767
766
|
var COMPONENT_ID$9 = 'dropdowns.media_body';
|
|
768
767
|
var StyledMediaBody = styled.div.attrs({
|
|
769
768
|
'data-garden-id': COMPONENT_ID$9,
|
|
770
|
-
'data-garden-version': '8.
|
|
769
|
+
'data-garden-version': '8.47.2'
|
|
771
770
|
}).withConfig({
|
|
772
771
|
displayName: "StyledMediaBody",
|
|
773
772
|
componentId: "sc-36j7ef-0"
|
|
@@ -795,7 +794,7 @@ function (_ref) {
|
|
|
795
794
|
);
|
|
796
795
|
}).attrs({
|
|
797
796
|
'data-garden-id': COMPONENT_ID$8,
|
|
798
|
-
'data-garden-version': '8.
|
|
797
|
+
'data-garden-version': '8.47.2'
|
|
799
798
|
}).withConfig({
|
|
800
799
|
displayName: "StyledMediaFigure",
|
|
801
800
|
componentId: "sc-2f2x8x-0"
|
|
@@ -817,7 +816,7 @@ StyledMediaFigure.defaultProps = {
|
|
|
817
816
|
var COMPONENT_ID$7 = 'dropdowns.media_item';
|
|
818
817
|
var StyledMediaItem = styled(StyledItem).attrs({
|
|
819
818
|
'data-garden-id': COMPONENT_ID$7,
|
|
820
|
-
'data-garden-version': '8.
|
|
819
|
+
'data-garden-version': '8.47.2'
|
|
821
820
|
}).withConfig({
|
|
822
821
|
displayName: "StyledMediaItem",
|
|
823
822
|
componentId: "sc-ikwshz-0"
|
|
@@ -832,7 +831,7 @@ var COMPONENT_ID$6 = 'dropdowns.faux_input';
|
|
|
832
831
|
var StyledFauxInput = styled(FauxInput).attrs(function (props) {
|
|
833
832
|
return {
|
|
834
833
|
'data-garden-id': COMPONENT_ID$6,
|
|
835
|
-
'data-garden-version': '8.
|
|
834
|
+
'data-garden-version': '8.47.2',
|
|
836
835
|
mediaLayout: true,
|
|
837
836
|
theme: props.theme
|
|
838
837
|
};
|
|
@@ -854,7 +853,7 @@ var COMPONENT_ID$5 = 'dropdowns.input';
|
|
|
854
853
|
var hiddenStyling = css(["position:fixed;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
855
854
|
var StyledInput = styled(Input).attrs({
|
|
856
855
|
'data-garden-id': COMPONENT_ID$5,
|
|
857
|
-
'data-garden-version': '8.
|
|
856
|
+
'data-garden-version': '8.47.2',
|
|
858
857
|
isBare: true
|
|
859
858
|
}).withConfig({
|
|
860
859
|
displayName: "StyledInput",
|
|
@@ -871,7 +870,7 @@ StyledInput.defaultProps = {
|
|
|
871
870
|
var COMPONENT_ID$4 = 'dropdowns.select';
|
|
872
871
|
var StyledSelect = styled.div.attrs({
|
|
873
872
|
'data-garden-id': COMPONENT_ID$4,
|
|
874
|
-
'data-garden-version': '8.
|
|
873
|
+
'data-garden-version': '8.47.2'
|
|
875
874
|
}).withConfig({
|
|
876
875
|
displayName: "StyledSelect",
|
|
877
876
|
componentId: "sc-xifmwj-0"
|
|
@@ -894,7 +893,7 @@ var visibleStyling = function visibleStyling(props) {
|
|
|
894
893
|
};
|
|
895
894
|
var StyledMultiselectInput = styled(StyledInput).attrs({
|
|
896
895
|
'data-garden-id': COMPONENT_ID$3,
|
|
897
|
-
'data-garden-version': '8.
|
|
896
|
+
'data-garden-version': '8.47.2'
|
|
898
897
|
}).withConfig({
|
|
899
898
|
displayName: "StyledMultiselectInput",
|
|
900
899
|
componentId: "sc-1avnf6f-0"
|
|
@@ -924,7 +923,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
924
923
|
};
|
|
925
924
|
var StyledMultiselectItemsContainer = styled.div.attrs({
|
|
926
925
|
'data-garden-id': COMPONENT_ID$2,
|
|
927
|
-
'data-garden-version': '8.
|
|
926
|
+
'data-garden-version': '8.47.2'
|
|
928
927
|
}).withConfig({
|
|
929
928
|
displayName: "StyledMultiselectItemsContainer",
|
|
930
929
|
componentId: "sc-1jzhet8-0"
|
|
@@ -940,7 +939,7 @@ StyledMultiselectItemsContainer.defaultProps = {
|
|
|
940
939
|
var COMPONENT_ID$1 = 'dropdowns.multiselect_item_wrapper';
|
|
941
940
|
var StyledMultiselectItemWrapper = styled.div.attrs({
|
|
942
941
|
'data-garden-id': COMPONENT_ID$1,
|
|
943
|
-
'data-garden-version': '8.
|
|
942
|
+
'data-garden-version': '8.47.2'
|
|
944
943
|
}).withConfig({
|
|
945
944
|
displayName: "StyledMultiselectItemWrapper",
|
|
946
945
|
componentId: "sc-1rb2bye-0"
|
|
@@ -956,7 +955,7 @@ StyledMultiselectItemWrapper.defaultProps = {
|
|
|
956
955
|
var COMPONENT_ID = 'dropdowns.multiselect_more_anchor';
|
|
957
956
|
var StyledMultiselectMoreAnchor = styled.div.attrs({
|
|
958
957
|
'data-garden-id': COMPONENT_ID,
|
|
959
|
-
'data-garden-version': '8.
|
|
958
|
+
'data-garden-version': '8.47.2'
|
|
960
959
|
}).withConfig({
|
|
961
960
|
displayName: "StyledMultiselectMoreAnchor",
|
|
962
961
|
componentId: "sc-1m9v46e-0"
|
|
@@ -1117,23 +1116,23 @@ Trigger.defaultProps = {
|
|
|
1117
1116
|
refKey: 'ref'
|
|
1118
1117
|
};
|
|
1119
1118
|
|
|
1120
|
-
|
|
1119
|
+
var _path$2;
|
|
1121
1120
|
|
|
1122
|
-
|
|
1123
|
-
fill: "currentColor",
|
|
1124
|
-
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"
|
|
1125
|
-
});
|
|
1121
|
+
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
|
|
1126
1122
|
|
|
1127
|
-
function SvgChevronDownStroke(props) {
|
|
1123
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
1128
1124
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
1129
1125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1130
1126
|
width: 16,
|
|
1131
1127
|
height: 16,
|
|
1132
|
-
viewBox: "0 0 16 16",
|
|
1133
1128
|
focusable: "false",
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1129
|
+
viewBox: "0 0 16 16",
|
|
1130
|
+
"aria-hidden": "true"
|
|
1131
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
1132
|
+
fill: "currentColor",
|
|
1133
|
+
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"
|
|
1134
|
+
})));
|
|
1135
|
+
};
|
|
1137
1136
|
|
|
1138
1137
|
var FieldContext = React__default.createContext(undefined);
|
|
1139
1138
|
var useFieldContext = function useFieldContext() {
|
|
@@ -1377,8 +1376,9 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1377
1376
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1378
1377
|
focusedItem = _useState6[0],
|
|
1379
1378
|
setFocusedItem = _useState6[1];
|
|
1379
|
+
var themeContext = useContext(ThemeContext);
|
|
1380
1380
|
var _useSelection = useSelection({
|
|
1381
|
-
rtl:
|
|
1381
|
+
rtl: themeContext.rtl,
|
|
1382
1382
|
focusedItem: focusedItem,
|
|
1383
1383
|
selectedItem: undefined,
|
|
1384
1384
|
onFocus: function onFocus(item) {
|
|
@@ -1466,7 +1466,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1466
1466
|
inputRef.current && inputRef.current.focus();
|
|
1467
1467
|
e.preventDefault();
|
|
1468
1468
|
}
|
|
1469
|
-
if (
|
|
1469
|
+
if (themeContext.rtl) {
|
|
1470
1470
|
if (e.keyCode === KEY_CODES.RIGHT && index === 0) {
|
|
1471
1471
|
e.preventDefault();
|
|
1472
1472
|
}
|
|
@@ -1495,7 +1495,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1495
1495
|
return React__default.createElement(StyledMultiselectItemWrapper, {
|
|
1496
1496
|
key: key
|
|
1497
1497
|
}, clonedChild);
|
|
1498
|
-
}, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef]);
|
|
1498
|
+
}, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef, themeContext.rtl]);
|
|
1499
1499
|
var items = useMemo(function () {
|
|
1500
1500
|
var itemValues = selectedItems || [];
|
|
1501
1501
|
var output = [];
|
|
@@ -1564,9 +1564,9 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1564
1564
|
},
|
|
1565
1565
|
onKeyDown: function onKeyDown(e) {
|
|
1566
1566
|
if (!inputValue) {
|
|
1567
|
-
if (
|
|
1567
|
+
if (themeContext.rtl && e.keyCode === KEY_CODES.RIGHT && selectedItems.length > 0 && previousIndexRef.current === undefined) {
|
|
1568
1568
|
setFocusedItem(selectedItems[selectedItems.length - 1]);
|
|
1569
|
-
} else if (!
|
|
1569
|
+
} else if (!themeContext.rtl && e.keyCode === KEY_CODES.LEFT && selectedItems.length > 0 && previousIndexRef.current === undefined) {
|
|
1570
1570
|
setFocusedItem(selectedItems[selectedItems.length - 1]);
|
|
1571
1571
|
} else if (e.keyCode === KEY_CODES.BACKSPACE && selectedItems.length > 0) {
|
|
1572
1572
|
setDownshiftState({
|
|
@@ -1604,7 +1604,7 @@ Multiselect.propTypes = {
|
|
|
1604
1604
|
Multiselect.defaultProps = {
|
|
1605
1605
|
maxItems: 4
|
|
1606
1606
|
};
|
|
1607
|
-
|
|
1607
|
+
Multiselect.displayName = 'Multiselect';
|
|
1608
1608
|
|
|
1609
1609
|
var _excluded$6 = ["children", "start"],
|
|
1610
1610
|
_excluded2$2 = ["type"];
|
|
@@ -1890,11 +1890,12 @@ var Menu = function Menu(props) {
|
|
|
1890
1890
|
return clearTimeout(timeout);
|
|
1891
1891
|
};
|
|
1892
1892
|
}, [isOpen, isAnimated]);
|
|
1893
|
+
var themeContext = useContext(ThemeContext);
|
|
1893
1894
|
itemIndexRef.current = 0;
|
|
1894
1895
|
nextItemsHashRef.current = {};
|
|
1895
1896
|
previousIndexRef.current = undefined;
|
|
1896
1897
|
itemSearchRegistry.current = [];
|
|
1897
|
-
var popperPlacement =
|
|
1898
|
+
var popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
|
|
1898
1899
|
return (
|
|
1899
1900
|
React__default.createElement(MenuContext.Provider, {
|
|
1900
1901
|
value: {
|
|
@@ -1957,7 +1958,6 @@ Menu.defaultProps = {
|
|
|
1957
1958
|
maxHeight: '400px',
|
|
1958
1959
|
zIndex: 1000
|
|
1959
1960
|
};
|
|
1960
|
-
var Menu$1 = withTheme(Menu);
|
|
1961
1961
|
|
|
1962
1962
|
var Separator = React__default.forwardRef(function (props, ref) {
|
|
1963
1963
|
return React__default.createElement(StyledSeparator, _extends$5({
|
|
@@ -1966,45 +1966,45 @@ var Separator = React__default.forwardRef(function (props, ref) {
|
|
|
1966
1966
|
});
|
|
1967
1967
|
Separator.displayName = 'Separator';
|
|
1968
1968
|
|
|
1969
|
-
|
|
1969
|
+
var _path$1;
|
|
1970
1970
|
|
|
1971
|
-
|
|
1972
|
-
stroke: "currentColor",
|
|
1973
|
-
strokeLinecap: "round",
|
|
1974
|
-
d: "M7.5 2.5v12m6-6h-12"
|
|
1975
|
-
});
|
|
1971
|
+
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); }
|
|
1976
1972
|
|
|
1977
|
-
function SvgPlusStroke(props) {
|
|
1973
|
+
var SvgPlusStroke = function SvgPlusStroke(props) {
|
|
1978
1974
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
1979
1975
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1980
1976
|
width: 16,
|
|
1981
1977
|
height: 16,
|
|
1982
|
-
viewBox: "0 0 16 16",
|
|
1983
1978
|
focusable: "false",
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
}
|
|
1979
|
+
viewBox: "0 0 16 16",
|
|
1980
|
+
"aria-hidden": "true"
|
|
1981
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
1982
|
+
stroke: "currentColor",
|
|
1983
|
+
strokeLinecap: "round",
|
|
1984
|
+
d: "M7.5 2.5v12m6-6h-12"
|
|
1985
|
+
})));
|
|
1986
|
+
};
|
|
1987
1987
|
|
|
1988
|
-
|
|
1988
|
+
var _path;
|
|
1989
1989
|
|
|
1990
|
-
var
|
|
1991
|
-
fill: "none",
|
|
1992
|
-
stroke: "currentColor",
|
|
1993
|
-
strokeLinecap: "round",
|
|
1994
|
-
strokeLinejoin: "round",
|
|
1995
|
-
d: "M1 9l4 4L15 3"
|
|
1996
|
-
});
|
|
1990
|
+
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); }
|
|
1997
1991
|
|
|
1998
|
-
function SvgCheckLgStroke(props) {
|
|
1992
|
+
var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
|
|
1999
1993
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
2000
1994
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2001
1995
|
width: 16,
|
|
2002
1996
|
height: 16,
|
|
2003
|
-
viewBox: "0 0 16 16",
|
|
2004
1997
|
focusable: "false",
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
}
|
|
1998
|
+
viewBox: "0 0 16 16",
|
|
1999
|
+
"aria-hidden": "true"
|
|
2000
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
2001
|
+
fill: "none",
|
|
2002
|
+
stroke: "currentColor",
|
|
2003
|
+
strokeLinecap: "round",
|
|
2004
|
+
strokeLinejoin: "round",
|
|
2005
|
+
d: "M1 9l4 4L15 3"
|
|
2006
|
+
})));
|
|
2007
|
+
};
|
|
2008
2008
|
|
|
2009
2009
|
var ItemContext = React__default.createContext(undefined);
|
|
2010
2010
|
var useItemContext = function useItemContext() {
|
|
@@ -2015,10 +2015,11 @@ var useItemContext = function useItemContext() {
|
|
|
2015
2015
|
return context;
|
|
2016
2016
|
};
|
|
2017
2017
|
|
|
2018
|
-
var _excluded$3 = ["value", "disabled", "component", "children"];
|
|
2018
|
+
var _excluded$3 = ["value", "disabled", "isDanger", "component", "children"];
|
|
2019
2019
|
var Item = React__default.forwardRef(function (_ref, forwardRef) {
|
|
2020
2020
|
var value = _ref.value,
|
|
2021
2021
|
disabled = _ref.disabled,
|
|
2022
|
+
isDanger = _ref.isDanger,
|
|
2022
2023
|
_ref$component = _ref.component,
|
|
2023
2024
|
component = _ref$component === void 0 ? StyledItem : _ref$component,
|
|
2024
2025
|
children = _ref.children,
|
|
@@ -2081,6 +2082,7 @@ var Item = React__default.forwardRef(function (_ref, forwardRef) {
|
|
|
2081
2082
|
}, React__default.createElement(Component, _extends$5({
|
|
2082
2083
|
ref: ref,
|
|
2083
2084
|
disabled: disabled,
|
|
2085
|
+
isDanger: isDanger,
|
|
2084
2086
|
isCompact: isCompact
|
|
2085
2087
|
}, props), isSelected && React__default.createElement(StyledItemIcon, {
|
|
2086
2088
|
isCompact: isCompact,
|
|
@@ -2095,7 +2097,8 @@ var Item = React__default.forwardRef(function (_ref, forwardRef) {
|
|
|
2095
2097
|
item: value,
|
|
2096
2098
|
isFocused: isFocused,
|
|
2097
2099
|
ref: ref,
|
|
2098
|
-
isCompact: isCompact
|
|
2100
|
+
isCompact: isCompact,
|
|
2101
|
+
isDanger: isDanger
|
|
2099
2102
|
}, hasMenuRef.current && {
|
|
2100
2103
|
role: 'menuitem',
|
|
2101
2104
|
'aria-selected': null
|
|
@@ -2291,4 +2294,4 @@ PreviousItem.propTypes = {
|
|
|
2291
2294
|
disabled: PropTypes.bool
|
|
2292
2295
|
};
|
|
2293
2296
|
|
|
2294
|
-
export { AddItem, Autocomplete, Combobox, Dropdown
|
|
2297
|
+
export { AddItem, Autocomplete, Combobox, Dropdown, Field, HeaderIcon, HeaderItem, Hint, Item, ItemMeta, Label, MediaBody, MediaFigure, MediaItem, Menu, Message, Multiselect, NextItem, PreviousItem, Select, Separator, Trigger };
|
|
@@ -40,7 +40,6 @@ export interface IDropdownProps {
|
|
|
40
40
|
* */
|
|
41
41
|
onInputValueChange?: (inputValue: string, stateAndHelpers: ControllerStateAndHelpers<any>) => void;
|
|
42
42
|
/** Passes customization props to the [Downshift](https://www.downshift-js.com/) component */
|
|
43
|
-
downshiftProps?:
|
|
43
|
+
downshiftProps?: Record<string, any>;
|
|
44
44
|
}
|
|
45
|
-
declare const
|
|
46
|
-
export default _default;
|
|
45
|
+
export declare const Dropdown: React.FunctionComponent<IDropdownProps>;
|
|
@@ -9,4 +9,4 @@ import { IItemProps } from './Item';
|
|
|
9
9
|
/**
|
|
10
10
|
* @extends LiHTMLAttributes<HTMLLIElement>
|
|
11
11
|
*/
|
|
12
|
-
export declare const AddItem: React.ForwardRefExoticComponent<
|
|
12
|
+
export declare const AddItem: React.ForwardRefExoticComponent<Omit<IItemProps, "component"> & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -9,11 +9,13 @@ export interface IItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
|
9
9
|
/** Sets the value that is returned upon selection */
|
|
10
10
|
value?: any;
|
|
11
11
|
/**
|
|
12
|
-
* @ignore
|
|
12
|
+
* @ignore Sets the wrapping component for the item
|
|
13
13
|
*/
|
|
14
14
|
component?: any;
|
|
15
15
|
/** Indicates that the element is not interactive */
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
/** Applies danger styling */
|
|
18
|
+
isDanger?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* @extends LiHTMLAttributes<HTMLLIElement>
|
|
@@ -9,4 +9,4 @@ import { IItemProps } from './Item';
|
|
|
9
9
|
/**
|
|
10
10
|
* @extends LiHTMLAttributes<HTMLLIElement>
|
|
11
11
|
*/
|
|
12
|
-
export declare const NextItem: React.ForwardRefExoticComponent<
|
|
12
|
+
export declare const NextItem: React.ForwardRefExoticComponent<Omit<IItemProps, "component"> & React.RefAttributes<HTMLLIElement>>;
|