@zendeskgarden/react-dropdowns 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/combobox/Combobox.js +47 -48
- package/dist/esm/elements/combobox/Field.js +0 -1
- package/dist/esm/elements/combobox/Hint.js +1 -2
- package/dist/esm/elements/combobox/Label.js +1 -2
- package/dist/esm/elements/combobox/Listbox.js +7 -8
- package/dist/esm/elements/combobox/Message.js +1 -2
- package/dist/esm/elements/combobox/OptGroup.js +5 -6
- package/dist/esm/elements/combobox/Option.js +9 -6
- package/dist/esm/elements/combobox/OptionMeta.js +1 -2
- package/dist/esm/elements/combobox/Tag.js +0 -1
- package/dist/esm/elements/combobox/utils.js +1 -1
- package/dist/esm/elements/menu/Item.js +11 -10
- package/dist/esm/elements/menu/ItemGroup.js +6 -6
- package/dist/esm/elements/menu/ItemMeta.js +1 -2
- package/dist/esm/elements/menu/Menu.js +9 -36
- package/dist/esm/elements/menu/MenuList.js +8 -9
- package/dist/esm/elements/menu/Separator.js +0 -1
- package/dist/esm/elements/menu/utils.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/views/combobox/StyledCombobox.js +4 -7
- package/dist/esm/views/combobox/StyledContainer.js +2 -5
- package/dist/esm/views/combobox/StyledField.js +2 -5
- package/dist/esm/views/combobox/StyledFloatingListbox.js +5 -8
- package/dist/esm/views/combobox/StyledHint.js +2 -5
- package/dist/esm/views/combobox/StyledInput.js +13 -10
- package/dist/esm/views/combobox/StyledInputGroup.js +2 -5
- package/dist/esm/views/combobox/StyledInputIcon.js +26 -10
- package/dist/esm/views/combobox/StyledLabel.js +2 -5
- package/dist/esm/views/combobox/StyledListbox.js +3 -7
- package/dist/esm/views/combobox/StyledListboxSeparator.js +10 -7
- package/dist/esm/views/combobox/StyledMessage.js +2 -5
- package/dist/esm/views/combobox/StyledOptGroup.js +2 -5
- package/dist/esm/views/combobox/StyledOption.js +35 -17
- package/dist/esm/views/combobox/StyledOptionContent.js +2 -5
- package/dist/esm/views/combobox/StyledOptionIcon.js +25 -6
- package/dist/esm/views/combobox/StyledOptionMeta.js +12 -7
- package/dist/esm/views/combobox/StyledOptionTypeIcon.js +18 -11
- package/dist/esm/views/combobox/StyledTag.js +6 -6
- package/dist/esm/views/combobox/StyledTagsButton.js +10 -7
- package/dist/esm/views/combobox/StyledTrigger.js +71 -43
- package/dist/esm/views/combobox/StyledValue.js +13 -9
- package/dist/esm/views/menu/StyledFloatingMenu.js +2 -5
- package/dist/esm/views/menu/StyledItem.js +2 -5
- package/dist/esm/views/menu/StyledItemContent.js +2 -5
- package/dist/esm/views/menu/StyledItemGroup.js +2 -5
- package/dist/esm/views/menu/StyledItemIcon.js +2 -5
- package/dist/esm/views/menu/StyledItemMeta.js +2 -5
- package/dist/esm/views/menu/StyledItemTypeIcon.js +2 -5
- package/dist/esm/views/menu/StyledMenu.js +5 -8
- package/dist/esm/views/menu/StyledSeparator.js +2 -5
- package/dist/index.cjs.js +457 -412
- package/dist/typings/context/useComboboxContext.d.ts +12 -13
- package/dist/typings/context/useFieldContext.d.ts +6 -6
- package/dist/typings/context/useItemContext.d.ts +2 -3
- package/dist/typings/context/useItemGroupContext.d.ts +2 -3
- package/dist/typings/context/useMenuContext.d.ts +10 -11
- package/dist/typings/context/useOptionContext.d.ts +2 -3
- package/dist/typings/elements/combobox/Field.d.ts +3 -1
- package/dist/typings/elements/combobox/Option.d.ts +3 -1
- package/dist/typings/elements/combobox/Tag.d.ts +3 -1
- package/dist/typings/elements/combobox/TagAvatar.d.ts +1 -2
- package/dist/typings/elements/combobox/utils.d.ts +2 -2
- package/dist/typings/elements/menu/Item.d.ts +3 -1
- package/dist/typings/elements/menu/utils.d.ts +2 -2
- package/dist/typings/types/index.d.ts +2 -0
- package/dist/typings/views/combobox/StyledCombobox.d.ts +1 -1
- package/dist/typings/views/combobox/StyledFloatingListbox.d.ts +3 -3
- package/dist/typings/views/combobox/StyledHint.d.ts +0 -1
- package/dist/typings/views/combobox/StyledInput.d.ts +4 -4
- package/dist/typings/views/combobox/StyledInputIcon.d.ts +1 -2
- package/dist/typings/views/combobox/StyledLabel.d.ts +0 -1
- package/dist/typings/views/combobox/StyledListbox.d.ts +3 -3
- package/dist/typings/views/combobox/StyledMessage.d.ts +0 -1
- package/dist/typings/views/combobox/StyledOptGroup.d.ts +1 -1
- package/dist/typings/views/combobox/StyledOption.d.ts +2 -2
- package/dist/typings/views/combobox/StyledOptionIcon.d.ts +8 -4
- package/dist/typings/views/combobox/StyledOptionMeta.d.ts +1 -1
- package/dist/typings/views/combobox/StyledOptionTypeIcon.d.ts +1 -2
- package/dist/typings/views/combobox/StyledTag.d.ts +2 -6
- package/dist/typings/views/combobox/StyledTagsButton.d.ts +1 -1
- package/dist/typings/views/combobox/StyledTrigger.d.ts +9 -9
- package/dist/typings/views/combobox/StyledValue.d.ts +7 -7
- package/dist/typings/views/index.d.ts +0 -1
- package/dist/typings/views/menu/StyledItemIcon.d.ts +2 -3
- package/dist/typings/views/menu/StyledItemTypeIcon.d.ts +1 -2
- package/dist/typings/views/menu/StyledMenu.d.ts +1 -1
- package/package.json +12 -12
- package/dist/esm/views/menu/StyledButton.js +0 -23
- package/dist/typings/views/menu/StyledButton.d.ts +0 -20
|
@@ -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,26 +5,23 @@
|
|
|
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
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledLabel } from './StyledLabel.js';
|
|
10
10
|
import { StyledHint } from './StyledHint.js';
|
|
11
11
|
import { StyledMessage } from './StyledMessage.js';
|
|
12
12
|
|
|
13
13
|
const COMPONENT_ID = 'dropdowns.combobox';
|
|
14
14
|
const sizeStyles = props => {
|
|
15
|
-
const minWidth = `${props
|
|
16
|
-
const marginTop = `${props.theme.space.base * (props
|
|
15
|
+
const minWidth = `${props.$isCompact ? 100 : 144}px`;
|
|
16
|
+
const marginTop = `${props.theme.space.base * (props.$isCompact ? 1 : 2)}px`;
|
|
17
17
|
return css(["min-width:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], minWidth, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
|
|
18
18
|
};
|
|
19
19
|
const StyledCombobox = styled.div.attrs({
|
|
20
20
|
'data-garden-id': COMPONENT_ID,
|
|
21
|
-
'data-garden-version': '9.
|
|
21
|
+
'data-garden-version': '9.1.0'
|
|
22
22
|
}).withConfig({
|
|
23
23
|
displayName: "StyledCombobox",
|
|
24
24
|
componentId: "sc-13eybg8-0"
|
|
25
25
|
})(["", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
26
|
-
StyledCombobox.defaultProps = {
|
|
27
|
-
theme: DEFAULT_THEME
|
|
28
|
-
};
|
|
29
26
|
|
|
30
27
|
export { StyledCombobox };
|
|
@@ -5,18 +5,15 @@
|
|
|
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
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.container';
|
|
11
11
|
const StyledContainer = styled.div.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: "StyledContainer",
|
|
16
16
|
componentId: "sc-14i9jid-0"
|
|
17
17
|
})(["display:flex;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledContainer.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledContainer };
|
|
@@ -5,18 +5,15 @@
|
|
|
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
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.field';
|
|
11
11
|
const StyledField = styled.div.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: "StyledField",
|
|
16
16
|
componentId: "sc-zc57xl-0"
|
|
17
17
|
})(["direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledField.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledField };
|
|
@@ -5,23 +5,20 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { menuStyles, retrieveComponentStyles
|
|
8
|
+
import { menuStyles, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.floating';
|
|
11
11
|
const StyledFloatingListbox = styled.div.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: "StyledFloatingListbox",
|
|
16
16
|
componentId: "sc-1cp6spf-0"
|
|
17
|
-
})(["top:0;left:0;", ";", ";"], props => menuStyles(props
|
|
17
|
+
})(["top:0;left:0;", ";", ";"], props => menuStyles(props.$position, {
|
|
18
18
|
theme: props.theme,
|
|
19
|
-
hidden: props
|
|
19
|
+
hidden: props.$isHidden,
|
|
20
20
|
animationModifier: '[data-garden-animate="true"]',
|
|
21
|
-
zIndex: props
|
|
21
|
+
zIndex: props.$zIndex
|
|
22
22
|
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
|
-
StyledFloatingListbox.defaultProps = {
|
|
24
|
-
theme: DEFAULT_THEME
|
|
25
|
-
};
|
|
26
23
|
|
|
27
24
|
export { StyledFloatingListbox };
|
|
@@ -5,19 +5,16 @@
|
|
|
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 { Field } from '@zendeskgarden/react-forms';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.hint';
|
|
12
12
|
const StyledHint = styled(Field.Hint).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: "StyledHint",
|
|
17
17
|
componentId: "sc-106qvqx-0"
|
|
18
18
|
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledHint.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledHint };
|
|
@@ -6,18 +6,24 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { hideVisually, math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles,
|
|
9
|
+
import { retrieveComponentStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.input';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const placeholderColor = getColor({
|
|
17
|
+
theme,
|
|
18
|
+
variable: 'foreground.disabled'
|
|
19
|
+
});
|
|
14
20
|
return css(["background-color:inherit;color:inherit;&::placeholder{opacity:1;color:", ";}"], placeholderColor);
|
|
15
21
|
};
|
|
16
22
|
const getHeight = props => {
|
|
17
|
-
if (props
|
|
23
|
+
if (props.$isBare && !props.$isMultiselectable) {
|
|
18
24
|
return props.theme.space.base * 5;
|
|
19
25
|
}
|
|
20
|
-
return props.theme.space.base * (props
|
|
26
|
+
return props.theme.space.base * (props.$isCompact ? 5 : 8);
|
|
21
27
|
};
|
|
22
28
|
const sizeStyles = props => {
|
|
23
29
|
const height = props.theme.space.base * 5;
|
|
@@ -29,13 +35,10 @@ const sizeStyles = props => {
|
|
|
29
35
|
};
|
|
30
36
|
const StyledInput = styled.input.attrs({
|
|
31
37
|
'data-garden-id': COMPONENT_ID,
|
|
32
|
-
'data-garden-version': '9.
|
|
38
|
+
'data-garden-version': '9.1.0'
|
|
33
39
|
}).withConfig({
|
|
34
40
|
displayName: "StyledInput",
|
|
35
41
|
componentId: "sc-1lkqdg-0"
|
|
36
|
-
})(["flex-basis:0;flex-grow:1;border:none;padding:0;font-family:inherit;&:focus{outline:none;}", ";", ";&[hidden]{display:revert;", "}&[aria-hidden='true']{display:none;}", ";"], sizeStyles, colorStyles, props => props
|
|
37
|
-
StyledInput.defaultProps = {
|
|
38
|
-
theme: DEFAULT_THEME
|
|
39
|
-
};
|
|
42
|
+
})(["flex-basis:0;flex-grow:1;border:none;padding:0;font-family:inherit;&:focus{outline:none;}", ";", ";&[hidden]{display:revert;", "}&[aria-hidden='true']{display:none;}", ";"], sizeStyles, colorStyles, props => props.$isEditable && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
40
43
|
|
|
41
44
|
export { StyledInput, getHeight, sizeStyles };
|
|
@@ -5,7 +5,7 @@
|
|
|
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
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.input_group';
|
|
11
11
|
const sizeStyles = props => {
|
|
@@ -14,13 +14,10 @@ const sizeStyles = props => {
|
|
|
14
14
|
};
|
|
15
15
|
const StyledInputGroup = styled.div.attrs({
|
|
16
16
|
'data-garden-id': COMPONENT_ID,
|
|
17
|
-
'data-garden-version': '9.
|
|
17
|
+
'data-garden-version': '9.1.0'
|
|
18
18
|
}).withConfig({
|
|
19
19
|
displayName: "StyledInputGroup",
|
|
20
20
|
componentId: "sc-yx3q7u-0"
|
|
21
21
|
})(["display:flex;flex-grow:1;flex-wrap:wrap;", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
|
-
StyledInputGroup.defaultProps = {
|
|
23
|
-
theme: DEFAULT_THEME
|
|
24
|
-
};
|
|
25
22
|
|
|
26
23
|
export { StyledInputGroup };
|
|
@@ -6,16 +6,35 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { StyledBaseIcon, retrieveComponentStyles,
|
|
9
|
+
import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { getHeight } from './StyledInput.js';
|
|
11
11
|
import { StyledTrigger } from './StyledTrigger.js';
|
|
12
12
|
|
|
13
13
|
const COMPONENT_ID = 'dropdowns.combobox.input_icon';
|
|
14
|
-
const colorStyles =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const colorStyles = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
theme,
|
|
17
|
+
$isLabelHovered
|
|
18
|
+
} = _ref;
|
|
19
|
+
const options = {
|
|
20
|
+
theme,
|
|
21
|
+
variable: 'foreground.subtle'
|
|
22
|
+
};
|
|
23
|
+
const color = getColor(options);
|
|
24
|
+
const focusColor = getColor({
|
|
25
|
+
...options,
|
|
26
|
+
dark: {
|
|
27
|
+
offset: -100
|
|
28
|
+
},
|
|
29
|
+
light: {
|
|
30
|
+
offset: 100
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const disabledColor = getColor({
|
|
34
|
+
theme,
|
|
35
|
+
variable: 'foreground.disabled'
|
|
36
|
+
});
|
|
37
|
+
return css(["color:", ";", ":hover &&,", ":focus-within &&,", ":focus &&{color:", ";}", "[aria-disabled='true'] &&{color:", ";}"], $isLabelHovered ? focusColor : color, StyledTrigger, StyledTrigger, StyledTrigger, focusColor, StyledTrigger, disabledColor);
|
|
19
38
|
};
|
|
20
39
|
const sizeStyles = props => {
|
|
21
40
|
const size = props.theme.iconSizes.md;
|
|
@@ -31,13 +50,10 @@ const sizeStyles = props => {
|
|
|
31
50
|
};
|
|
32
51
|
const StyledInputIcon = styled(StyledBaseIcon).attrs({
|
|
33
52
|
'data-garden-id': COMPONENT_ID,
|
|
34
|
-
'data-garden-version': '9.
|
|
53
|
+
'data-garden-version': '9.1.0'
|
|
35
54
|
}).withConfig({
|
|
36
55
|
displayName: "StyledInputIcon",
|
|
37
56
|
componentId: "sc-gqbs1s-0"
|
|
38
57
|
})(["position:sticky;flex-shrink:0;transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
39
|
-
StyledInputIcon.defaultProps = {
|
|
40
|
-
theme: DEFAULT_THEME
|
|
41
|
-
};
|
|
42
58
|
|
|
43
59
|
export { StyledInputIcon };
|
|
@@ -5,19 +5,16 @@
|
|
|
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 { Field } from '@zendeskgarden/react-forms';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.label';
|
|
12
12
|
const StyledLabel = styled(Field.Label).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: "StyledLabel",
|
|
17
17
|
componentId: "sc-az6now-0"
|
|
18
18
|
})(["vertical-align:revert;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledLabel.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledLabel };
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
8
|
import { StyledOption, getMinHeight } from './StyledOption.js';
|
|
10
9
|
import { StyledOptionContent } from './StyledOptionContent.js';
|
|
11
10
|
import { StyledOptGroup } from './StyledOptGroup.js';
|
|
@@ -14,18 +13,15 @@ import { StyledListboxSeparator } from './StyledListboxSeparator.js';
|
|
|
14
13
|
const COMPONENT_ID = 'dropdowns.combobox.listbox';
|
|
15
14
|
const sizeStyles = props => {
|
|
16
15
|
const padding = props.theme.space.base;
|
|
17
|
-
const minHeight = props
|
|
18
|
-
return css(["min-height:", ";max-height:", ";&&&{padding-top:", "px;padding-bottom:", "px;}"], minHeight, props
|
|
16
|
+
const $minHeight = props.$minHeight === undefined ? `${getMinHeight(props) + padding * 2}px` : props.$minHeight;
|
|
17
|
+
return css(["min-height:", ";max-height:", ";&&&{padding-top:", "px;padding-bottom:", "px;}"], $minHeight, props.$maxHeight, padding, padding);
|
|
19
18
|
};
|
|
20
19
|
const StyledListbox = styled.ul.attrs({
|
|
21
20
|
'data-garden-id': COMPONENT_ID,
|
|
22
|
-
'data-garden-version': '9.
|
|
21
|
+
'data-garden-version': '9.1.0'
|
|
23
22
|
}).withConfig({
|
|
24
23
|
displayName: "StyledListbox",
|
|
25
24
|
componentId: "sc-1k13ba7-0"
|
|
26
25
|
})(["overflow-y:auto;list-style-type:none;", ";&&&{display:block;}", ":first-child ", " ", ":first-child ", "[role='none']:first-child{display:none;}"], sizeStyles, StyledOption, StyledOptionContent, StyledOptGroup, StyledListboxSeparator);
|
|
27
|
-
StyledListbox.defaultProps = {
|
|
28
|
-
theme: DEFAULT_THEME
|
|
29
|
-
};
|
|
30
26
|
|
|
31
27
|
export { StyledListbox };
|
|
@@ -5,11 +5,17 @@
|
|
|
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,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.separator';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
15
|
+
const backgroundColor = getColor({
|
|
16
|
+
theme,
|
|
17
|
+
variable: 'border.subtle'
|
|
18
|
+
});
|
|
13
19
|
return css(["background-color:", ";"], backgroundColor);
|
|
14
20
|
};
|
|
15
21
|
const sizeStyles = props => {
|
|
@@ -19,13 +25,10 @@ const sizeStyles = props => {
|
|
|
19
25
|
};
|
|
20
26
|
const StyledListboxSeparator = styled.li.attrs({
|
|
21
27
|
'data-garden-id': COMPONENT_ID,
|
|
22
|
-
'data-garden-version': '9.
|
|
28
|
+
'data-garden-version': '9.1.0'
|
|
23
29
|
}).withConfig({
|
|
24
30
|
displayName: "StyledListboxSeparator",
|
|
25
31
|
componentId: "sc-1p6toh2-0"
|
|
26
32
|
})(["cursor:default;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
27
|
-
StyledListboxSeparator.defaultProps = {
|
|
28
|
-
theme: DEFAULT_THEME
|
|
29
|
-
};
|
|
30
33
|
|
|
31
34
|
export { StyledListboxSeparator };
|
|
@@ -5,19 +5,16 @@
|
|
|
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 { Field } from '@zendeskgarden/react-forms';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.message';
|
|
12
12
|
const StyledMessage = styled(Field.Message).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: "StyledMessage",
|
|
17
17
|
componentId: "sc-jux8m5-0"
|
|
18
18
|
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledMessage.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledMessage };
|
|
@@ -5,18 +5,15 @@
|
|
|
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
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.optgroup';
|
|
11
11
|
const StyledOptGroup = styled.ul.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: "StyledOptGroup",
|
|
16
16
|
componentId: "sc-1kavqsx-0"
|
|
17
17
|
})(["margin:0;padding:0;list-style-type:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledOptGroup.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledOptGroup };
|
|
@@ -6,27 +6,48 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { hideVisually, math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles,
|
|
9
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.option';
|
|
12
|
-
const colorStyles =
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$isActive,
|
|
16
|
+
$type
|
|
17
|
+
} = _ref;
|
|
13
18
|
let backgroundColor;
|
|
14
19
|
let boxShadow;
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
backgroundColor =
|
|
18
|
-
|
|
20
|
+
if ($isActive && $type !== 'group' && $type !== 'header') {
|
|
21
|
+
const variable = 'background.primaryEmphasis';
|
|
22
|
+
backgroundColor = getColor({
|
|
23
|
+
theme,
|
|
24
|
+
variable,
|
|
25
|
+
transparency: theme.opacity[100]
|
|
26
|
+
});
|
|
27
|
+
boxShadow = `inset ${theme.rtl ? `-${theme.shadowWidths.md}` : theme.shadowWidths.md} 0 ${getColor({
|
|
28
|
+
theme,
|
|
29
|
+
variable
|
|
30
|
+
})}`;
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
let foregroundVariable;
|
|
33
|
+
if ($type === 'add') {
|
|
34
|
+
foregroundVariable = 'foreground.primary';
|
|
35
|
+
} else if ($type === 'danger') {
|
|
36
|
+
foregroundVariable = 'foreground.danger';
|
|
37
|
+
} else {
|
|
38
|
+
foregroundVariable = 'foreground.default';
|
|
26
39
|
}
|
|
40
|
+
const foregroundColor = getColor({
|
|
41
|
+
theme,
|
|
42
|
+
variable: foregroundVariable
|
|
43
|
+
});
|
|
44
|
+
const disabledForegroundColor = getColor({
|
|
45
|
+
theme,
|
|
46
|
+
variable: 'foreground.disabled'
|
|
47
|
+
});
|
|
27
48
|
return css(["box-shadow:", ";background-color:", ";color:", ";&[aria-disabled='true']{background-color:transparent;color:", ";}"], boxShadow, backgroundColor, foregroundColor, disabledForegroundColor);
|
|
28
49
|
};
|
|
29
|
-
const getMinHeight = props => props.theme.space.base * (props
|
|
50
|
+
const getMinHeight = props => props.theme.space.base * (props.$isCompact ? 7 : 9);
|
|
30
51
|
const sizeStyles = props => {
|
|
31
52
|
const lineHeight = props.theme.lineHeights.md;
|
|
32
53
|
const minHeight = getMinHeight(props);
|
|
@@ -36,13 +57,10 @@ const sizeStyles = props => {
|
|
|
36
57
|
};
|
|
37
58
|
const StyledOption = styled.li.attrs({
|
|
38
59
|
'data-garden-id': COMPONENT_ID,
|
|
39
|
-
'data-garden-version': '9.
|
|
60
|
+
'data-garden-version': '9.1.0'
|
|
40
61
|
}).withConfig({
|
|
41
62
|
displayName: "StyledOption",
|
|
42
63
|
componentId: "sc-jl4wn6-0"
|
|
43
64
|
})(["display:flex;position:relative;transition:color 0.25s ease-in-out;cursor:", ";overflow-wrap:anywhere;font-weight:", ";user-select:none;&:focus{outline:none;}", ";", ";&[aria-disabled='true']{cursor:default;}&[aria-hidden='true']{", ";}", ";"], props => props.$type === 'group' || props.$type === 'header' ? 'default' : 'pointer', props => props.$type === 'header' || props.$type === 'previous' ? props.theme.fontWeights.semibold : props.theme.fontWeights.regular, sizeStyles, colorStyles, hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
44
|
-
StyledOption.defaultProps = {
|
|
45
|
-
theme: DEFAULT_THEME
|
|
46
|
-
};
|
|
47
65
|
|
|
48
66
|
export { StyledOption, getMinHeight };
|
|
@@ -5,18 +5,15 @@
|
|
|
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
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.option.content';
|
|
11
11
|
const StyledOptionContent = styled.div.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: "StyledOptionContent",
|
|
16
16
|
componentId: "sc-121ujpu-0"
|
|
17
17
|
})(["display:flex;flex-direction:column;flex-grow:1;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledOptionContent.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledOptionContent };
|
|
@@ -6,9 +6,31 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { StyledBaseIcon, retrieveComponentStyles,
|
|
9
|
+
import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'dropdowns.combobox.option.icon';
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$isDisabled,
|
|
16
|
+
$type
|
|
17
|
+
} = _ref;
|
|
18
|
+
let variable;
|
|
19
|
+
if ($isDisabled) {
|
|
20
|
+
variable = 'foreground.disabled';
|
|
21
|
+
} else if ($type === 'danger') {
|
|
22
|
+
variable = 'foreground.danger';
|
|
23
|
+
} else if ($type === 'add') {
|
|
24
|
+
variable = 'foreground.primary';
|
|
25
|
+
} else {
|
|
26
|
+
variable = 'foreground.subtle';
|
|
27
|
+
}
|
|
28
|
+
const color = getColor({
|
|
29
|
+
theme,
|
|
30
|
+
variable
|
|
31
|
+
});
|
|
32
|
+
return css(["color:", ";"], color);
|
|
33
|
+
};
|
|
12
34
|
const sizeStyles = props => {
|
|
13
35
|
const size = props.theme.iconSizes.md;
|
|
14
36
|
const marginTop = math(`(${props.theme.lineHeights.md} - ${size}) / 2`);
|
|
@@ -17,13 +39,10 @@ const sizeStyles = props => {
|
|
|
17
39
|
};
|
|
18
40
|
const StyledOptionIcon = styled(StyledBaseIcon).attrs({
|
|
19
41
|
'data-garden-id': COMPONENT_ID,
|
|
20
|
-
'data-garden-version': '9.
|
|
42
|
+
'data-garden-version': '9.1.0'
|
|
21
43
|
}).withConfig({
|
|
22
44
|
displayName: "StyledOptionIcon",
|
|
23
45
|
componentId: "sc-qsab3y-0"
|
|
24
|
-
})(["flex-shrink:0;", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
25
|
-
StyledOptionIcon.defaultProps = {
|
|
26
|
-
theme: DEFAULT_THEME
|
|
27
|
-
};
|
|
46
|
+
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
28
47
|
|
|
29
48
|
export { StyledOptionIcon };
|
|
@@ -5,11 +5,19 @@
|
|
|
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,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'dropdowns.combobox.option.meta';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme,
|
|
14
|
+
$isDisabled
|
|
15
|
+
} = _ref;
|
|
16
|
+
const variable = $isDisabled ? 'foreground.disabled' : 'foreground.subtle';
|
|
17
|
+
const color = getColor({
|
|
18
|
+
theme,
|
|
19
|
+
variable
|
|
20
|
+
});
|
|
13
21
|
return css(["color:", ";"], color);
|
|
14
22
|
};
|
|
15
23
|
const sizeStyles = props => {
|
|
@@ -19,13 +27,10 @@ const sizeStyles = props => {
|
|
|
19
27
|
};
|
|
20
28
|
const StyledOptionMeta = styled.div.attrs({
|
|
21
29
|
'data-garden-id': COMPONENT_ID,
|
|
22
|
-
'data-garden-version': '9.
|
|
30
|
+
'data-garden-version': '9.1.0'
|
|
23
31
|
}).withConfig({
|
|
24
32
|
displayName: "StyledOptionMeta",
|
|
25
33
|
componentId: "sc-j6pu10-0"
|
|
26
34
|
})(["transition:color 0.25s ease-in-out;font-weight:", ";", ";", ";", ";"], props => props.theme.fontWeights.regular, sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
27
|
-
StyledOptionMeta.defaultProps = {
|
|
28
|
-
theme: DEFAULT_THEME
|
|
29
|
-
};
|
|
30
35
|
|
|
31
36
|
export { StyledOptionMeta };
|