@zendeskgarden/react-dropdowns.legacy 9.0.0-next.9 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/elements/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/elements/Menu/Items/AddItem.js +3 -3
- package/dist/esm/elements/Menu/Items/HeaderItem.js +8 -3
- package/dist/esm/elements/Menu/Items/Item.js +16 -15
- package/dist/esm/elements/Menu/Items/ItemMeta.js +2 -2
- package/dist/esm/elements/Menu/Items/MediaBody.js +1 -1
- package/dist/esm/elements/Menu/Items/MediaFigure.js +1 -1
- package/dist/esm/elements/Menu/Items/NextItem.js +4 -4
- package/dist/esm/elements/Menu/Items/PreviousItem.js +4 -4
- package/dist/esm/elements/Menu/Menu.js +54 -55
- package/dist/esm/elements/Multiselect/Multiselect.js +7 -7
- package/dist/esm/elements/Select/Select.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-lg-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/plus-stroke.svg.js +1 -1
- package/dist/esm/styled/items/StyledAddItem.js +6 -6
- package/dist/esm/styled/items/StyledItem.js +21 -14
- package/dist/esm/styled/items/StyledItemIcon.js +6 -6
- package/dist/esm/styled/items/StyledItemMeta.js +6 -6
- package/dist/esm/styled/items/StyledNextIcon.js +6 -6
- package/dist/esm/styled/items/StyledNextItem.js +2 -5
- package/dist/esm/styled/items/StyledPreviousIcon.js +6 -6
- package/dist/esm/styled/items/StyledPreviousItem.js +2 -5
- package/dist/esm/styled/items/header/StyledHeaderIcon.js +6 -6
- package/dist/esm/styled/items/header/StyledHeaderItem.js +3 -6
- package/dist/esm/styled/items/media/StyledMediaBody.js +2 -5
- package/dist/esm/styled/items/media/StyledMediaFigure.js +4 -9
- package/dist/esm/styled/items/media/StyledMediaItem.js +2 -5
- package/dist/esm/styled/menu/StyledMenu.js +7 -10
- package/dist/esm/styled/menu/StyledMenuWrapper.js +8 -11
- package/dist/esm/styled/menu/StyledSeparator.js +6 -6
- package/dist/esm/styled/multiselect/StyledMultiselectInput.js +2 -5
- package/dist/esm/styled/multiselect/StyledMultiselectItemWrapper.js +2 -5
- package/dist/esm/styled/multiselect/StyledMultiselectItemsContainer.js +5 -8
- package/dist/esm/styled/multiselect/StyledMultiselectMoreAnchor.js +6 -6
- package/dist/esm/styled/select/StyledFauxInput.js +2 -5
- package/dist/esm/styled/select/StyledInput.js +2 -5
- package/dist/esm/styled/select/StyledSelect.js +2 -5
- package/dist/index.cjs.js +198 -229
- package/dist/typings/styled/items/StyledItem.d.ts +3 -3
- package/dist/typings/styled/items/StyledItemIcon.d.ts +3 -3
- package/dist/typings/styled/items/StyledItemMeta.d.ts +2 -2
- package/dist/typings/styled/items/StyledNextIcon.d.ts +1 -1
- package/dist/typings/styled/items/StyledPreviousIcon.d.ts +1 -1
- package/dist/typings/styled/items/header/StyledHeaderItem.d.ts +2 -2
- package/dist/typings/styled/items/media/StyledMediaBody.d.ts +1 -1
- package/dist/typings/styled/items/media/StyledMediaFigure.d.ts +13 -13
- package/dist/typings/styled/menu/StyledMenu.d.ts +5 -5
- package/dist/typings/styled/menu/StyledMenuWrapper.d.ts +5 -5
- package/dist/typings/styled/multiselect/StyledMultiselectInput.d.ts +0 -1
- package/dist/typings/styled/multiselect/StyledMultiselectItemsContainer.d.ts +2 -2
- package/dist/typings/styled/multiselect/StyledMultiselectMoreAnchor.d.ts +2 -2
- package/dist/typings/styled/select/StyledFauxInput.d.ts +4 -11
- package/dist/typings/styled/select/StyledInput.d.ts +0 -1
- package/dist/typings/utils/garden-placements.d.ts +2 -1
- package/package.json +8 -8
|
@@ -104,7 +104,7 @@ const Autocomplete = forwardRef((_ref, ref) => {
|
|
|
104
104
|
mergeRefs([triggerRef, ref])(selectRef);
|
|
105
105
|
popperReferenceElementRef.current = selectRef;
|
|
106
106
|
}
|
|
107
|
-
}), start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
107
|
+
}), !!start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
108
108
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
109
109
|
isFocused: isContainerFocused,
|
|
110
110
|
isDisabled: props.disabled
|
|
@@ -46,9 +46,9 @@ const AddItemComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
46
46
|
ref: ref,
|
|
47
47
|
disabled: disabled
|
|
48
48
|
}, props), React__default.createElement(StyledItemIcon, {
|
|
49
|
-
isCompact: isCompact,
|
|
50
|
-
isVisible: true,
|
|
51
|
-
isDisabled: disabled
|
|
49
|
+
$isCompact: isCompact,
|
|
50
|
+
$isVisible: true,
|
|
51
|
+
$isDisabled: disabled
|
|
52
52
|
}, React__default.createElement(SvgPlusStroke, null)), children);
|
|
53
53
|
});
|
|
54
54
|
const AddItem = React__default.forwardRef((props, ref) => React__default.createElement(Item, Object.assign({
|
|
@@ -30,14 +30,19 @@ import '../../../styled/multiselect/StyledMultiselectItemWrapper.js';
|
|
|
30
30
|
import '../../../styled/multiselect/StyledMultiselectMoreAnchor.js';
|
|
31
31
|
import useMenuContext from '../../../utils/useMenuContext.js';
|
|
32
32
|
|
|
33
|
-
const HeaderItem = React__default.forwardRef((
|
|
33
|
+
const HeaderItem = React__default.forwardRef((_ref, ref) => {
|
|
34
|
+
let {
|
|
35
|
+
hasIcon,
|
|
36
|
+
...other
|
|
37
|
+
} = _ref;
|
|
34
38
|
const {
|
|
35
39
|
isCompact
|
|
36
40
|
} = useMenuContext();
|
|
37
41
|
return React__default.createElement(StyledHeaderItem, Object.assign({
|
|
38
42
|
ref: ref,
|
|
39
|
-
isCompact: isCompact
|
|
40
|
-
|
|
43
|
+
$isCompact: isCompact,
|
|
44
|
+
$hasIcon: hasIcon
|
|
45
|
+
}, other));
|
|
41
46
|
});
|
|
42
47
|
HeaderItem.displayName = 'HeaderItem';
|
|
43
48
|
|
|
@@ -43,7 +43,7 @@ const Item = React__default.forwardRef((_ref, forwardRef) => {
|
|
|
43
43
|
component = StyledItem,
|
|
44
44
|
hasIcon,
|
|
45
45
|
children,
|
|
46
|
-
...
|
|
46
|
+
...other
|
|
47
47
|
} = _ref;
|
|
48
48
|
const {
|
|
49
49
|
selectedItems,
|
|
@@ -104,31 +104,32 @@ const Item = React__default.forwardRef((_ref, forwardRef) => {
|
|
|
104
104
|
}, React__default.createElement(Component, Object.assign({
|
|
105
105
|
ref: ref,
|
|
106
106
|
disabled: disabled,
|
|
107
|
-
isDanger: isDanger,
|
|
108
|
-
isCompact: isCompact
|
|
109
|
-
},
|
|
110
|
-
isCompact: isCompact,
|
|
111
|
-
isVisible: isSelected,
|
|
112
|
-
isDisabled: disabled
|
|
107
|
+
$isDanger: isDanger,
|
|
108
|
+
$isCompact: isCompact
|
|
109
|
+
}, other), !!isSelected && !hasIcon && React__default.createElement(StyledItemIcon, {
|
|
110
|
+
$isCompact: isCompact,
|
|
111
|
+
$isVisible: isSelected,
|
|
112
|
+
$isDisabled: disabled
|
|
113
113
|
}, React__default.createElement(SvgCheckLgStroke, null)), children));
|
|
114
114
|
}
|
|
115
115
|
itemIndexRef.current++;
|
|
116
116
|
return React__default.createElement(ItemContext.Provider, {
|
|
117
117
|
value: contextValue
|
|
118
|
-
}, React__default.createElement(Component,
|
|
118
|
+
}, React__default.createElement(Component, Object.assign({
|
|
119
|
+
$isCompact: isCompact,
|
|
120
|
+
$isDanger: isDanger,
|
|
121
|
+
$isFocused: isFocused
|
|
122
|
+
}, getItemProps({
|
|
119
123
|
item: value,
|
|
120
|
-
isFocused,
|
|
121
124
|
ref,
|
|
122
|
-
isCompact,
|
|
123
|
-
isDanger,
|
|
124
125
|
...(hasMenuRef.current && {
|
|
125
126
|
role: 'menuitem',
|
|
126
127
|
'aria-selected': null
|
|
127
128
|
}),
|
|
128
|
-
...
|
|
129
|
-
}), isSelected && !hasIcon && React__default.createElement(StyledItemIcon, {
|
|
130
|
-
isCompact: isCompact,
|
|
131
|
-
isVisible: isSelected
|
|
129
|
+
...other
|
|
130
|
+
})), !!isSelected && !hasIcon && React__default.createElement(StyledItemIcon, {
|
|
131
|
+
$isCompact: isCompact,
|
|
132
|
+
$isVisible: isSelected
|
|
132
133
|
}, React__default.createElement(SvgCheckLgStroke, null)), children));
|
|
133
134
|
});
|
|
134
135
|
Item.displayName = 'Item';
|
|
@@ -40,8 +40,8 @@ const ItemMeta = React__default.forwardRef((props, ref) => {
|
|
|
40
40
|
} = useItemContext();
|
|
41
41
|
return React__default.createElement(StyledItemMeta, Object.assign({
|
|
42
42
|
ref: ref,
|
|
43
|
-
isCompact: isCompact,
|
|
44
|
-
isDisabled: isDisabled
|
|
43
|
+
$isCompact: isCompact,
|
|
44
|
+
$isDisabled: isDisabled
|
|
45
45
|
}, props));
|
|
46
46
|
});
|
|
47
47
|
ItemMeta.displayName = 'ItemMeta';
|
|
@@ -36,7 +36,7 @@ const MediaBody = React__default.forwardRef((props, ref) => {
|
|
|
36
36
|
} = useMenuContext();
|
|
37
37
|
return React__default.createElement(StyledMediaBody, Object.assign({
|
|
38
38
|
ref: ref,
|
|
39
|
-
isCompact: isCompact
|
|
39
|
+
$isCompact: isCompact
|
|
40
40
|
}, props));
|
|
41
41
|
});
|
|
42
42
|
MediaBody.displayName = 'MediaBody';
|
|
@@ -46,11 +46,11 @@ const NextItemComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
46
46
|
ref: ref,
|
|
47
47
|
disabled: disabled
|
|
48
48
|
}, props), React__default.createElement(StyledItemIcon, {
|
|
49
|
-
isCompact: isCompact,
|
|
50
|
-
isDisabled: disabled,
|
|
51
|
-
isVisible: true
|
|
49
|
+
$isCompact: isCompact,
|
|
50
|
+
$isDisabled: disabled,
|
|
51
|
+
$isVisible: true
|
|
52
52
|
}, React__default.createElement(StyledNextIcon, {
|
|
53
|
-
isDisabled: disabled
|
|
53
|
+
$isDisabled: disabled
|
|
54
54
|
})), children);
|
|
55
55
|
});
|
|
56
56
|
const NextItem = React__default.forwardRef((_ref2, ref) => {
|
|
@@ -46,11 +46,11 @@ const PreviousItemComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
46
46
|
ref: ref,
|
|
47
47
|
disabled: disabled
|
|
48
48
|
}, props), React__default.createElement(StyledItemIcon, {
|
|
49
|
-
isCompact: isCompact,
|
|
50
|
-
isDisabled: disabled,
|
|
51
|
-
isVisible: true
|
|
49
|
+
$isCompact: isCompact,
|
|
50
|
+
$isDisabled: disabled,
|
|
51
|
+
$isVisible: true
|
|
52
52
|
}, React__default.createElement(StyledPreviousIcon, {
|
|
53
|
-
isDisabled: disabled
|
|
53
|
+
$isDisabled: disabled
|
|
54
54
|
})), children);
|
|
55
55
|
});
|
|
56
56
|
const PreviousItem = React__default.forwardRef((_ref2, ref) => {
|
|
@@ -39,17 +39,18 @@ import { MenuContext } from '../../utils/useMenuContext.js';
|
|
|
39
39
|
|
|
40
40
|
const Menu = forwardRef((props, menuRef) => {
|
|
41
41
|
const {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
appendToNode,
|
|
43
|
+
children,
|
|
44
44
|
eventsEnabled,
|
|
45
|
+
hasArrow,
|
|
45
46
|
isAnimated,
|
|
47
|
+
isCompact,
|
|
46
48
|
maxHeight,
|
|
49
|
+
placement,
|
|
50
|
+
popperModifiers,
|
|
47
51
|
style: menuStyle,
|
|
48
52
|
zIndex,
|
|
49
|
-
|
|
50
|
-
children,
|
|
51
|
-
appendToNode,
|
|
52
|
-
...otherProps
|
|
53
|
+
...other
|
|
53
54
|
} = props;
|
|
54
55
|
const {
|
|
55
56
|
hasMenuRef,
|
|
@@ -87,55 +88,53 @@ const Menu = forwardRef((props, menuRef) => {
|
|
|
87
88
|
previousIndexRef.current = undefined;
|
|
88
89
|
itemSearchRegistry.current = [];
|
|
89
90
|
const popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}))
|
|
138
|
-
);
|
|
91
|
+
return React__default.createElement(MenuContext.Provider, {
|
|
92
|
+
value: {
|
|
93
|
+
itemIndexRef,
|
|
94
|
+
isCompact
|
|
95
|
+
}
|
|
96
|
+
}, React__default.createElement(Popper, {
|
|
97
|
+
placement: popperPlacement,
|
|
98
|
+
modifiers: popperModifiers
|
|
99
|
+
,
|
|
100
|
+
eventsEnabled: !!(isOpen && eventsEnabled)
|
|
101
|
+
}, _ref => {
|
|
102
|
+
let {
|
|
103
|
+
ref,
|
|
104
|
+
style,
|
|
105
|
+
scheduleUpdate,
|
|
106
|
+
placement: currentPlacement
|
|
107
|
+
} = _ref;
|
|
108
|
+
let computedStyle = menuStyle;
|
|
109
|
+
scheduleUpdateRef.current = scheduleUpdate;
|
|
110
|
+
if ((isOpen || isVisible) && popperReferenceElementRef.current && popperReferenceElementRef.current.getBoundingClientRect) {
|
|
111
|
+
computedStyle = {
|
|
112
|
+
width: popperReferenceElementRef.current.getBoundingClientRect().width,
|
|
113
|
+
...menuStyle
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const menuProps = getMenuProps({
|
|
117
|
+
role: hasMenuRef.current ? 'menu' : 'listbox',
|
|
118
|
+
...other
|
|
119
|
+
});
|
|
120
|
+
const sharedProps = {
|
|
121
|
+
$hasArrow: hasArrow,
|
|
122
|
+
$isAnimated: isAnimated ? isOpen || isVisible : false,
|
|
123
|
+
$isCompact: isCompact,
|
|
124
|
+
$maxHeight: maxHeight,
|
|
125
|
+
$placement: currentPlacement
|
|
126
|
+
};
|
|
127
|
+
const menu = React__default.createElement(StyledMenuWrapper, Object.assign({
|
|
128
|
+
ref: isOpen ? ref : undefined,
|
|
129
|
+
$isHidden: !isOpen,
|
|
130
|
+
$zIndex: zIndex,
|
|
131
|
+
style: style
|
|
132
|
+
}, sharedProps), React__default.createElement(StyledMenu, Object.assign({
|
|
133
|
+
ref: menuRef,
|
|
134
|
+
style: computedStyle
|
|
135
|
+
}, sharedProps, menuProps), !!(isOpen || isVisible) && children));
|
|
136
|
+
return appendToNode ? createPortal(menu, appendToNode) : menu;
|
|
137
|
+
}));
|
|
139
138
|
});
|
|
140
139
|
Menu.displayName = 'Menu';
|
|
141
140
|
Menu.propTypes = {
|
|
@@ -215,18 +215,18 @@ const Multiselect = React__default.forwardRef((_ref, ref) => {
|
|
|
215
215
|
}), {
|
|
216
216
|
size: props.isCompact ? 'medium' : 'large'
|
|
217
217
|
});
|
|
218
|
-
output.push(
|
|
218
|
+
output.push(React__default.createElement(StyledMultiselectItemWrapper, {
|
|
219
219
|
key: x
|
|
220
220
|
}, renderedItem));
|
|
221
221
|
} else {
|
|
222
222
|
output.push(renderSelectableItem(item, x));
|
|
223
223
|
}
|
|
224
224
|
} else if (!isFocused && !inputValue || props.disabled) {
|
|
225
|
-
output.push(
|
|
225
|
+
output.push(React__default.createElement(StyledMultiselectItemWrapper, {
|
|
226
226
|
key: "more-anchor"
|
|
227
227
|
}, React__default.createElement(StyledMultiselectMoreAnchor, {
|
|
228
|
-
isCompact: props.isCompact,
|
|
229
|
-
isDisabled: props.disabled
|
|
228
|
+
$isCompact: props.isCompact,
|
|
229
|
+
$isDisabled: props.disabled
|
|
230
230
|
}, renderShowMore ? renderShowMore(itemValues.length - x) : `+ ${itemValues.length - x} more`)));
|
|
231
231
|
break;
|
|
232
232
|
} else {
|
|
@@ -252,13 +252,13 @@ const Multiselect = React__default.forwardRef((_ref, ref) => {
|
|
|
252
252
|
popperReference(selectRef);
|
|
253
253
|
mergeRefs([triggerRef, popperReferenceElementRef, ref])(selectRef);
|
|
254
254
|
}
|
|
255
|
-
}), start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
255
|
+
}), !!start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
256
256
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
257
257
|
isFocused: isContainerFocused,
|
|
258
258
|
isDisabled: props.disabled
|
|
259
259
|
}, start), React__default.createElement(StyledMultiselectItemsContainer, {
|
|
260
|
-
isBare: props.isBare,
|
|
261
|
-
isCompact: props.isCompact
|
|
260
|
+
$isBare: props.isBare,
|
|
261
|
+
$isCompact: props.isCompact
|
|
262
262
|
}, items, React__default.createElement(StyledMultiselectInput, getInputProps({
|
|
263
263
|
disabled: props.disabled,
|
|
264
264
|
onFocus: () => {
|
|
@@ -158,7 +158,7 @@ const Select = React__default.forwardRef((_ref, ref) => {
|
|
|
158
158
|
popperReference(selectRef);
|
|
159
159
|
mergeRefs([triggerRef, ref, popperReferenceElementRef])(selectRef);
|
|
160
160
|
}
|
|
161
|
-
}), start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
161
|
+
}), !!start && React__default.createElement(StyledFauxInput.StartIcon, {
|
|
162
162
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
163
163
|
isFocused: isContainerFocused,
|
|
164
164
|
isDisabled: props.disabled
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgPlusStroke = function SvgPlusStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledItem } from './StyledItem.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.add_item';
|
|
12
12
|
const StyledAddItem = styled(StyledItem).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.
|
|
14
|
+
'data-garden-version': '9.1.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledAddItem",
|
|
17
17
|
componentId: "sc-mlto71-0"
|
|
18
|
-
})(["color:", ";", ";"], props => !props.disabled &&
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
18
|
+
})(["color:", ";", ";"], props => !props.disabled && getColor({
|
|
19
|
+
theme: props.theme,
|
|
20
|
+
variable: 'foreground.primary'
|
|
21
|
+
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
22
|
|
|
23
23
|
export { StyledAddItem };
|
|
@@ -5,40 +5,47 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
9
|
-
import { rgba } from 'polished';
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
9
|
|
|
11
10
|
const COMPONENT_ID = 'dropdowns.item';
|
|
12
11
|
const getItemPaddingVertical = props => {
|
|
13
|
-
if (props
|
|
12
|
+
if (props.$isCompact) {
|
|
14
13
|
return `${props.theme.space.base}px`;
|
|
15
14
|
}
|
|
16
15
|
return `${props.theme.space.base * 2}px`;
|
|
17
16
|
};
|
|
18
17
|
const getColorStyles = props => {
|
|
18
|
+
const backgroundColor = props.$isFocused ? getColor({
|
|
19
|
+
theme: props.theme,
|
|
20
|
+
variable: 'background.primaryEmphasis',
|
|
21
|
+
transparency: props.theme.opacity[100]
|
|
22
|
+
}) : 'inherit';
|
|
19
23
|
let foregroundColor;
|
|
20
|
-
let backgroundColor;
|
|
21
24
|
if (props.disabled) {
|
|
22
|
-
foregroundColor =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
foregroundColor = getColor({
|
|
26
|
+
theme: props.theme,
|
|
27
|
+
variable: 'foreground.disabled'
|
|
28
|
+
});
|
|
29
|
+
} else if (props.$isDanger) {
|
|
30
|
+
foregroundColor = getColor({
|
|
31
|
+
theme: props.theme,
|
|
32
|
+
variable: 'foreground.danger'
|
|
33
|
+
});
|
|
26
34
|
} else {
|
|
27
|
-
foregroundColor =
|
|
28
|
-
|
|
35
|
+
foregroundColor = getColor({
|
|
36
|
+
theme: props.theme,
|
|
37
|
+
variable: 'foreground.default'
|
|
38
|
+
});
|
|
29
39
|
}
|
|
30
40
|
return css(["background-color:", ";color:", ";& a,& a:hover,& a:focus,& a:active{color:inherit;}"], backgroundColor, foregroundColor);
|
|
31
41
|
};
|
|
32
42
|
const StyledItem = styled.li.attrs(props => ({
|
|
33
43
|
'data-garden-id': COMPONENT_ID,
|
|
34
|
-
'data-garden-version': '9.
|
|
44
|
+
'data-garden-version': '9.1.0',
|
|
35
45
|
'aria-disabled': props.disabled
|
|
36
46
|
})).withConfig({
|
|
37
47
|
displayName: "StyledItem",
|
|
38
48
|
componentId: "sc-x4h8aw-0"
|
|
39
49
|
})(["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;}", ";", ";"], props => props.disabled ? 'default' : 'pointer', props => getItemPaddingVertical(props), props => props.theme.space.base * 9, props => props.theme.space.base * 5, props => props.theme.space.base, props => props.theme.space.base, props => getColorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
40
|
-
StyledItem.defaultProps = {
|
|
41
|
-
theme: DEFAULT_THEME
|
|
42
|
-
};
|
|
43
50
|
|
|
44
51
|
export { StyledItem, getItemPaddingVertical };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import {
|
|
9
|
+
import { getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { getItemPaddingVertical } from './StyledItem.js';
|
|
11
11
|
|
|
12
12
|
const COMPONENT_ID = 'dropdowns.item_icon';
|
|
@@ -15,13 +15,13 @@ const getSizeStyles = props => {
|
|
|
15
15
|
};
|
|
16
16
|
const StyledItemIcon = styled.div.attrs({
|
|
17
17
|
'data-garden-id': COMPONENT_ID,
|
|
18
|
-
'data-garden-version': '9.
|
|
18
|
+
'data-garden-version': '9.1.0'
|
|
19
19
|
}).withConfig({
|
|
20
20
|
displayName: "StyledItemIcon",
|
|
21
21
|
componentId: "sc-pspm80-0"
|
|
22
|
-
})(["display:flex;position:absolute;top:0;", ":", "px;align-items:center;justify-content:center;transition:opacity 0.1s ease-in-out;opacity:", ";color:", ";", ";& > *{width:", ";height:", ";}"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 3, props => props
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
22
|
+
})(["display:flex;position:absolute;top:0;", ":", "px;align-items:center;justify-content:center;transition:opacity 0.1s ease-in-out;opacity:", ";color:", ";", ";& > *{width:", ";height:", ";}"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 3, props => props.$isVisible ? '1' : '0', props => props.$isDisabled ? 'inherit' : getColor({
|
|
23
|
+
theme: props.theme,
|
|
24
|
+
variable: 'foreground.primary'
|
|
25
|
+
}), props => getSizeStyles(props), props => props.theme.iconSizes.md, props => props.theme.iconSizes.md);
|
|
26
26
|
|
|
27
27
|
export { StyledItemIcon };
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.item_meta';
|
|
11
11
|
const StyledItemMeta = styled.span.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledItemMeta",
|
|
16
16
|
componentId: "sc-1m3x8m1-0"
|
|
17
|
-
})(["display:block;line-height:", "px;color:", ";font-size:", ";", ";"], props => props.theme.space.base * (props
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
})(["display:block;line-height:", "px;color:", ";font-size:", ";", ";"], props => props.theme.space.base * (props.$isCompact ? 3 : 4), props => getColor({
|
|
18
|
+
theme: props.theme,
|
|
19
|
+
variable: props.$isDisabled ? 'foreground.disabled' : 'foreground.subtle'
|
|
20
|
+
}), props => props.theme.fontSizes.sm, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
21
|
|
|
22
22
|
export { StyledItemMeta };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import SvgChevronRightStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js';
|
|
10
|
-
import {
|
|
10
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
11
11
|
|
|
12
12
|
const COMPONENT_ID = 'dropdowns.next_item_icon';
|
|
13
13
|
const NextIconComponent = _ref => {
|
|
@@ -16,16 +16,16 @@ const NextIconComponent = _ref => {
|
|
|
16
16
|
} = _ref;
|
|
17
17
|
return React__default.createElement(SvgChevronRightStroke, {
|
|
18
18
|
"data-garden-id": COMPONENT_ID,
|
|
19
|
-
"data-garden-version": '9.
|
|
19
|
+
"data-garden-version": '9.1.0',
|
|
20
20
|
className: className
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
const StyledNextIcon = styled(NextIconComponent).withConfig({
|
|
24
24
|
displayName: "StyledNextIcon",
|
|
25
25
|
componentId: "sc-1nzkdnq-0"
|
|
26
|
-
})(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
26
|
+
})(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props.$isDisabled ? 'inherit' : getColor({
|
|
27
|
+
theme: props.theme,
|
|
28
|
+
variable: 'foreground.disabled'
|
|
29
|
+
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
30
|
|
|
31
31
|
export { StyledNextIcon };
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledItem } from './StyledItem.js';
|
|
10
10
|
import { StyledItemIcon } from './StyledItemIcon.js';
|
|
11
11
|
|
|
12
12
|
const COMPONENT_ID = 'dropdowns.next_item';
|
|
13
13
|
const StyledNextItem = styled(StyledItem).attrs({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.
|
|
15
|
+
'data-garden-version': '9.1.0'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledNextItem",
|
|
18
18
|
componentId: "sc-1wrjlge-0"
|
|
19
19
|
})(["", "{right:", ";left:", ";}", ";"], StyledItemIcon, props => props.theme.rtl ? 'auto' : `${props.theme.space.base * 3}px`, props => props.theme.rtl ? `${props.theme.space.base * 3}px` : 'auto', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
-
StyledNextItem.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
23
20
|
|
|
24
21
|
export { StyledNextItem };
|