@zendeskgarden/react-dropdowns 9.0.0-next.7 → 9.0.0-next.8
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/context/useComboboxContext.js +18 -0
- package/dist/esm/context/useFieldContext.js +18 -0
- package/dist/esm/context/useItemContext.js +18 -0
- package/dist/esm/context/useItemGroupContext.js +14 -0
- package/dist/esm/context/useMenuContext.js +18 -0
- package/dist/esm/context/useOptionContext.js +18 -0
- package/dist/esm/elements/combobox/Combobox.js +330 -0
- package/dist/esm/elements/combobox/Field.js +75 -0
- package/dist/esm/elements/combobox/Hint.js +57 -0
- package/dist/esm/elements/combobox/Label.js +68 -0
- package/dist/esm/elements/combobox/Listbox.js +155 -0
- package/dist/esm/elements/combobox/Message.js +63 -0
- package/dist/esm/elements/combobox/OptGroup.js +93 -0
- package/dist/esm/elements/combobox/Option.js +133 -0
- package/dist/esm/elements/combobox/OptionMeta.js +55 -0
- package/dist/esm/elements/combobox/Tag.js +98 -0
- package/dist/esm/elements/combobox/TagAvatar.js +13 -0
- package/dist/esm/elements/combobox/TagGroup.js +35 -0
- package/dist/esm/elements/combobox/utils.js +36 -0
- package/dist/esm/elements/menu/Item.js +140 -0
- package/dist/esm/elements/menu/ItemGroup.js +96 -0
- package/dist/esm/elements/menu/ItemMeta.js +55 -0
- package/dist/esm/elements/menu/Menu.js +157 -0
- package/dist/esm/elements/menu/MenuList.js +170 -0
- package/dist/esm/elements/menu/Separator.js +58 -0
- package/dist/esm/elements/menu/utils.js +55 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-lg-stroke.svg.js +28 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/plus-stroke.svg.js +26 -0
- package/dist/esm/types/index.js +12 -0
- package/dist/esm/views/combobox/StyledCombobox.js +30 -0
- package/dist/esm/views/combobox/StyledContainer.js +22 -0
- package/dist/esm/views/combobox/StyledField.js +22 -0
- package/dist/esm/views/combobox/StyledFloatingListbox.js +27 -0
- package/dist/esm/views/combobox/StyledHint.js +23 -0
- package/dist/esm/views/combobox/StyledInput.js +41 -0
- package/dist/esm/views/combobox/StyledInputGroup.js +26 -0
- package/dist/esm/views/combobox/StyledInputIcon.js +56 -0
- package/dist/esm/views/combobox/StyledLabel.js +23 -0
- package/dist/esm/views/combobox/StyledListbox.js +31 -0
- package/dist/esm/views/combobox/StyledListboxSeparator.js +31 -0
- package/dist/esm/views/combobox/StyledMessage.js +23 -0
- package/dist/esm/views/combobox/StyledOptGroup.js +22 -0
- package/dist/esm/views/combobox/StyledOption.js +48 -0
- package/dist/esm/views/combobox/StyledOptionContent.js +22 -0
- package/dist/esm/views/combobox/StyledOptionIcon.js +37 -0
- package/dist/esm/views/combobox/StyledOptionMeta.js +31 -0
- package/dist/esm/views/combobox/StyledOptionTypeIcon.js +58 -0
- package/dist/esm/views/combobox/StyledTag.js +24 -0
- package/dist/esm/views/combobox/StyledTagsButton.js +28 -0
- package/dist/esm/views/combobox/StyledTrigger.js +94 -0
- package/dist/esm/views/combobox/StyledValue.js +32 -0
- package/dist/esm/views/menu/StyledButton.js +23 -0
- package/dist/esm/views/menu/StyledFloatingMenu.js +23 -0
- package/dist/esm/views/menu/StyledItem.js +23 -0
- package/dist/esm/views/menu/StyledItemContent.js +23 -0
- package/dist/esm/views/menu/StyledItemGroup.js +23 -0
- package/dist/esm/views/menu/StyledItemIcon.js +23 -0
- package/dist/esm/views/menu/StyledItemMeta.js +23 -0
- package/dist/esm/views/menu/StyledItemTypeIcon.js +24 -0
- package/dist/esm/views/menu/StyledMenu.js +27 -0
- package/dist/esm/views/menu/StyledSeparator.js +23 -0
- package/dist/index.cjs.js +61 -75
- package/package.json +9 -9
- package/dist/index.esm.js +0 -1969
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React__default, { forwardRef } from 'react';
|
|
8
|
+
import '../../views/combobox/StyledCombobox.js';
|
|
9
|
+
import '../../views/combobox/StyledContainer.js';
|
|
10
|
+
import '../../views/combobox/StyledField.js';
|
|
11
|
+
import '../../views/combobox/StyledFloatingListbox.js';
|
|
12
|
+
import '../../views/combobox/StyledHint.js';
|
|
13
|
+
import '../../views/combobox/StyledInput.js';
|
|
14
|
+
import '../../views/combobox/StyledInputGroup.js';
|
|
15
|
+
import '../../views/combobox/StyledInputIcon.js';
|
|
16
|
+
import '../../views/combobox/StyledLabel.js';
|
|
17
|
+
import '../../views/combobox/StyledListbox.js';
|
|
18
|
+
import '../../views/combobox/StyledListboxSeparator.js';
|
|
19
|
+
import '../../views/combobox/StyledMessage.js';
|
|
20
|
+
import '../../views/combobox/StyledOptGroup.js';
|
|
21
|
+
import '../../views/combobox/StyledOption.js';
|
|
22
|
+
import '../../views/combobox/StyledOptionContent.js';
|
|
23
|
+
import '../../views/combobox/StyledOptionIcon.js';
|
|
24
|
+
import '../../views/combobox/StyledOptionMeta.js';
|
|
25
|
+
import '../../views/combobox/StyledOptionTypeIcon.js';
|
|
26
|
+
import '../../views/combobox/StyledTag.js';
|
|
27
|
+
import '../../views/combobox/StyledTagsButton.js';
|
|
28
|
+
import '../../views/combobox/StyledTrigger.js';
|
|
29
|
+
import '../../views/combobox/StyledValue.js';
|
|
30
|
+
import '../../views/menu/StyledMenu.js';
|
|
31
|
+
import '../../views/menu/StyledFloatingMenu.js';
|
|
32
|
+
import '../../views/menu/StyledItem.js';
|
|
33
|
+
import '../../views/menu/StyledItemContent.js';
|
|
34
|
+
import '../../views/menu/StyledItemGroup.js';
|
|
35
|
+
import '../../views/menu/StyledItemIcon.js';
|
|
36
|
+
import '../../views/menu/StyledItemMeta.js';
|
|
37
|
+
import '../../views/menu/StyledItemTypeIcon.js';
|
|
38
|
+
import '../../views/menu/StyledButton.js';
|
|
39
|
+
import { StyledSeparator } from '../../views/menu/StyledSeparator.js';
|
|
40
|
+
import useMenuContext from '../../context/useMenuContext.js';
|
|
41
|
+
|
|
42
|
+
const Separator = forwardRef(
|
|
43
|
+
(_ref, ref) => {
|
|
44
|
+
let {
|
|
45
|
+
children,
|
|
46
|
+
...props
|
|
47
|
+
} = _ref;
|
|
48
|
+
const {
|
|
49
|
+
getSeparatorProps
|
|
50
|
+
} = useMenuContext();
|
|
51
|
+
const separatorProps = getSeparatorProps();
|
|
52
|
+
return React__default.createElement(StyledSeparator, Object.assign({}, props, separatorProps, {
|
|
53
|
+
ref: ref
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
Separator.displayName = 'Separator';
|
|
57
|
+
|
|
58
|
+
export { Separator };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { Children, isValidElement } from 'react';
|
|
8
|
+
|
|
9
|
+
const toItem = props => ({
|
|
10
|
+
value: props.value,
|
|
11
|
+
label: props.label,
|
|
12
|
+
...(props.name && {
|
|
13
|
+
name: props.name
|
|
14
|
+
}),
|
|
15
|
+
...(props.isDisabled && {
|
|
16
|
+
disabled: props.isDisabled
|
|
17
|
+
}),
|
|
18
|
+
...(props.isSelected && {
|
|
19
|
+
selected: props.isSelected
|
|
20
|
+
}),
|
|
21
|
+
...(props.selectionType && {
|
|
22
|
+
type: props.selectionType
|
|
23
|
+
}),
|
|
24
|
+
...(props.type === 'next' && {
|
|
25
|
+
isNext: true
|
|
26
|
+
}),
|
|
27
|
+
...(props.type === 'previous' && {
|
|
28
|
+
isPrevious: true
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
const toItems = (children, type) => Children.toArray(children).reduce((items, item) => {
|
|
32
|
+
const retVal = items;
|
|
33
|
+
if ( isValidElement(item)) {
|
|
34
|
+
if ('value' in item.props) {
|
|
35
|
+
retVal.push(toItem({
|
|
36
|
+
...item.props,
|
|
37
|
+
selectionType: type
|
|
38
|
+
}));
|
|
39
|
+
} else {
|
|
40
|
+
const props = item.props;
|
|
41
|
+
const groupLabel = props.legend || props['aria-label'];
|
|
42
|
+
const isSelectableGroup = props.type && ['checkbox', 'radio'].includes(props.type);
|
|
43
|
+
if (groupLabel || isSelectableGroup) {
|
|
44
|
+
const groupItems = toItems(props.children, props.type);
|
|
45
|
+
retVal.push({
|
|
46
|
+
label: props.legend || props['aria-label'],
|
|
47
|
+
items: groupItems
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return retVal;
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
export { toItem, toItems };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export { Combobox } from './elements/combobox/Combobox.js';
|
|
8
|
+
export { Field } from './elements/combobox/Field.js';
|
|
9
|
+
export { Hint } from './elements/combobox/Hint.js';
|
|
10
|
+
export { Label } from './elements/combobox/Label.js';
|
|
11
|
+
export { Message } from './elements/combobox/Message.js';
|
|
12
|
+
export { Option } from './elements/combobox/Option.js';
|
|
13
|
+
export { OptGroup } from './elements/combobox/OptGroup.js';
|
|
14
|
+
export { Tag } from './elements/combobox/Tag.js';
|
|
15
|
+
export { Menu } from './elements/menu/Menu.js';
|
|
16
|
+
export { ItemGroup } from './elements/menu/ItemGroup.js';
|
|
17
|
+
export { Item } from './elements/menu/Item.js';
|
|
18
|
+
export { Separator } from './elements/menu/Separator.js';
|
|
19
|
+
export { VALIDATION } from '@zendeskgarden/react-forms';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
var _path;
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
11
|
+
var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
focusable: "false",
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fill: "none",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
d: "M1 9l4 4L15 3"
|
|
25
|
+
})));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { SvgCheckLgStroke as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
var _path;
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
11
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
focusable: "false",
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
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"
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SvgChevronDownStroke as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
var _path;
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
11
|
+
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
focusable: "false",
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
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"
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SvgChevronLeftStroke as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
var _path;
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
11
|
+
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
focusable: "false",
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
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"
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SvgChevronRightStroke as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
var _path;
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
11
|
+
var SvgPlusStroke = function SvgPlusStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
focusable: "false",
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
d: "M7.5 2.5v12m6-6h-12"
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { SvgPlusStroke as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { PLACEMENT as PLACEMENT$1 } from '@zendeskgarden/react-theming';
|
|
8
|
+
|
|
9
|
+
const OPTION_TYPE = ['add', 'danger', 'next', 'previous'];
|
|
10
|
+
const PLACEMENT = ['auto', ...PLACEMENT$1];
|
|
11
|
+
|
|
12
|
+
export { OPTION_TYPE, PLACEMENT };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledLabel } from './StyledLabel.js';
|
|
10
|
+
import { StyledHint } from './StyledHint.js';
|
|
11
|
+
import { StyledMessage } from './StyledMessage.js';
|
|
12
|
+
|
|
13
|
+
const COMPONENT_ID = 'dropdowns.combobox';
|
|
14
|
+
const sizeStyles = props => {
|
|
15
|
+
const minWidth = `${props.isCompact ? 100 : 144}px`;
|
|
16
|
+
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
17
|
+
return css(["min-width:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], minWidth, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
|
|
18
|
+
};
|
|
19
|
+
const StyledCombobox = styled.div.attrs({
|
|
20
|
+
'data-garden-id': COMPONENT_ID,
|
|
21
|
+
'data-garden-version': '9.0.0-next.8'
|
|
22
|
+
}).withConfig({
|
|
23
|
+
displayName: "StyledCombobox",
|
|
24
|
+
componentId: "sc-13eybg8-0"
|
|
25
|
+
})(["", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
26
|
+
StyledCombobox.defaultProps = {
|
|
27
|
+
theme: DEFAULT_THEME
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { StyledCombobox };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'dropdowns.combobox.container';
|
|
11
|
+
const StyledContainer = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledContainer",
|
|
16
|
+
componentId: "sc-14i9jid-0"
|
|
17
|
+
})(["display:flex;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledContainer.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledContainer };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'dropdowns.combobox.field';
|
|
11
|
+
const StyledField = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledField",
|
|
16
|
+
componentId: "sc-zc57xl-0"
|
|
17
|
+
})(["direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledField.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledField };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { menuStyles, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'dropdowns.combobox.floating';
|
|
11
|
+
const StyledFloatingListbox = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledFloatingListbox",
|
|
16
|
+
componentId: "sc-1cp6spf-0"
|
|
17
|
+
})(["top:0;left:0;", ";", ";"], props => menuStyles(props.position, {
|
|
18
|
+
theme: props.theme,
|
|
19
|
+
hidden: props.isHidden,
|
|
20
|
+
animationModifier: '[data-garden-animate="true"]',
|
|
21
|
+
zIndex: props.zIndex
|
|
22
|
+
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
|
+
StyledFloatingListbox.defaultProps = {
|
|
24
|
+
theme: DEFAULT_THEME
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { StyledFloatingListbox };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { Field } from '@zendeskgarden/react-forms';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'dropdowns.combobox.hint';
|
|
12
|
+
const StyledHint = styled(Field.Hint).attrs({
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.8'
|
|
15
|
+
}).withConfig({
|
|
16
|
+
displayName: "StyledHint",
|
|
17
|
+
componentId: "sc-106qvqx-0"
|
|
18
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
+
StyledHint.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledHint };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { hideVisually, math } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, getLineHeight } from '@zendeskgarden/react-theming';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'dropdowns.combobox.input';
|
|
12
|
+
const colorStyles = props => {
|
|
13
|
+
const placeholderColor = getColorV8('neutralHue', 400, props.theme);
|
|
14
|
+
return css(["background-color:inherit;color:inherit;&::placeholder{opacity:1;color:", ";}"], placeholderColor);
|
|
15
|
+
};
|
|
16
|
+
const getHeight = props => {
|
|
17
|
+
if (props.isBare && !props.isMultiselectable) {
|
|
18
|
+
return props.theme.space.base * 5;
|
|
19
|
+
}
|
|
20
|
+
return props.theme.space.base * (props.isCompact ? 5 : 8);
|
|
21
|
+
};
|
|
22
|
+
const sizeStyles = props => {
|
|
23
|
+
const height = props.theme.space.base * 5;
|
|
24
|
+
const fontSize = props.theme.fontSizes.md;
|
|
25
|
+
const lineHeight = getLineHeight(height, fontSize);
|
|
26
|
+
const margin = math(`${props.theme.shadowWidths.sm} + ${(getHeight(props) - height) / 2}`);
|
|
27
|
+
const minWidth = `${props.theme.space.base * 8}px`;
|
|
28
|
+
return css(["min-width:", ";height:", "px;line-height:", ";font-size:", ";&&{margin-top:", ";margin-bottom:", ";}"], minWidth, height, lineHeight, fontSize, margin, margin);
|
|
29
|
+
};
|
|
30
|
+
const StyledInput = styled.input.attrs({
|
|
31
|
+
'data-garden-id': COMPONENT_ID,
|
|
32
|
+
'data-garden-version': '9.0.0-next.8'
|
|
33
|
+
}).withConfig({
|
|
34
|
+
displayName: "StyledInput",
|
|
35
|
+
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.isEditable && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
37
|
+
StyledInput.defaultProps = {
|
|
38
|
+
theme: DEFAULT_THEME
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { StyledInput, getHeight, sizeStyles };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'dropdowns.combobox.input_group';
|
|
11
|
+
const sizeStyles = props => {
|
|
12
|
+
const margin = props.theme.shadowWidths.sm;
|
|
13
|
+
return css(["margin:-", ";min-width:0;& > *{margin:", ";}"], margin, margin);
|
|
14
|
+
};
|
|
15
|
+
const StyledInputGroup = styled.div.attrs({
|
|
16
|
+
'data-garden-id': COMPONENT_ID,
|
|
17
|
+
'data-garden-version': '9.0.0-next.8'
|
|
18
|
+
}).withConfig({
|
|
19
|
+
displayName: "StyledInputGroup",
|
|
20
|
+
componentId: "sc-yx3q7u-0"
|
|
21
|
+
})(["display:flex;flex-grow:1;flex-wrap:wrap;", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
|
+
StyledInputGroup.defaultProps = {
|
|
23
|
+
theme: DEFAULT_THEME
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { StyledInputGroup };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { cloneElement, Children } from 'react';
|
|
8
|
+
import styled, { css } from 'styled-components';
|
|
9
|
+
import { math } from 'polished';
|
|
10
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
|
|
11
|
+
import { getHeight } from './StyledInput.js';
|
|
12
|
+
import { StyledTrigger } from './StyledTrigger.js';
|
|
13
|
+
|
|
14
|
+
const COMPONENT_ID = 'dropdowns.combobox.input_icon';
|
|
15
|
+
const colorStyles = props => {
|
|
16
|
+
const color = getColorV8('neutralHue', 600, props.theme);
|
|
17
|
+
const focusColor = getColorV8('neutralHue', 700, props.theme);
|
|
18
|
+
const disabledColor = getColorV8('neutralHue', 400, props.theme);
|
|
19
|
+
return css(["color:", ";", ":hover &,", ":focus-within &,", ":focus &{color:", ";}", "[aria-disabled='true'] &{color:", ";}"], props.isLabelHovered ? focusColor : color, StyledTrigger, StyledTrigger, StyledTrigger, focusColor, StyledTrigger, disabledColor);
|
|
20
|
+
};
|
|
21
|
+
const sizeStyles = props => {
|
|
22
|
+
const size = props.theme.iconSizes.md;
|
|
23
|
+
const position = math(`(${getHeight(props)} - ${size}) / 2`);
|
|
24
|
+
const margin = `${props.theme.space.base * 2}px`;
|
|
25
|
+
let side;
|
|
26
|
+
if (props.isEnd) {
|
|
27
|
+
side = props.theme.rtl ? 'right' : 'left';
|
|
28
|
+
} else {
|
|
29
|
+
side = props.theme.rtl ? 'left' : 'right';
|
|
30
|
+
}
|
|
31
|
+
return css(["top:", ";margin-", ":", ";width:", ";height:", ";"], position, side, margin, size, size);
|
|
32
|
+
};
|
|
33
|
+
const StyledInputIcon = styled(_ref => {
|
|
34
|
+
let {
|
|
35
|
+
children,
|
|
36
|
+
isCompact,
|
|
37
|
+
isDisabled,
|
|
38
|
+
isEnd,
|
|
39
|
+
isLabelHovered,
|
|
40
|
+
isRotated,
|
|
41
|
+
theme,
|
|
42
|
+
...props
|
|
43
|
+
} = _ref;
|
|
44
|
+
return cloneElement(Children.only(children), props);
|
|
45
|
+
}).attrs({
|
|
46
|
+
'data-garden-id': COMPONENT_ID,
|
|
47
|
+
'data-garden-version': '9.0.0-next.8'
|
|
48
|
+
}).withConfig({
|
|
49
|
+
displayName: "StyledInputIcon",
|
|
50
|
+
componentId: "sc-gqbs1s-0"
|
|
51
|
+
})(["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));
|
|
52
|
+
StyledInputIcon.defaultProps = {
|
|
53
|
+
theme: DEFAULT_THEME
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { StyledInputIcon };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { Field } from '@zendeskgarden/react-forms';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'dropdowns.combobox.label';
|
|
12
|
+
const StyledLabel = styled(Field.Label).attrs({
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.8'
|
|
15
|
+
}).withConfig({
|
|
16
|
+
displayName: "StyledLabel",
|
|
17
|
+
componentId: "sc-az6now-0"
|
|
18
|
+
})(["vertical-align:revert;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
+
StyledLabel.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledLabel };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledOption, getMinHeight } from './StyledOption.js';
|
|
10
|
+
import { StyledOptionContent } from './StyledOptionContent.js';
|
|
11
|
+
import { StyledOptGroup } from './StyledOptGroup.js';
|
|
12
|
+
import { StyledListboxSeparator } from './StyledListboxSeparator.js';
|
|
13
|
+
|
|
14
|
+
const COMPONENT_ID = 'dropdowns.combobox.listbox';
|
|
15
|
+
const sizeStyles = props => {
|
|
16
|
+
const padding = props.theme.space.base;
|
|
17
|
+
const minHeight = props.minHeight === undefined ? `${getMinHeight(props) + padding * 2}px` : props.minHeight;
|
|
18
|
+
return css(["min-height:", ";max-height:", ";&&&{padding-top:", "px;padding-bottom:", "px;}"], minHeight, props.maxHeight, padding, padding);
|
|
19
|
+
};
|
|
20
|
+
const StyledListbox = styled.ul.attrs({
|
|
21
|
+
'data-garden-id': COMPONENT_ID,
|
|
22
|
+
'data-garden-version': '9.0.0-next.8'
|
|
23
|
+
}).withConfig({
|
|
24
|
+
displayName: "StyledListbox",
|
|
25
|
+
componentId: "sc-1k13ba7-0"
|
|
26
|
+
})(["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
|
+
|
|
31
|
+
export { StyledListbox };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'dropdowns.combobox.separator';
|
|
11
|
+
const colorStyles = props => {
|
|
12
|
+
const backgroundColor = getColorV8('neutralHue', 200, props.theme);
|
|
13
|
+
return css(["background-color:", ";"], backgroundColor);
|
|
14
|
+
};
|
|
15
|
+
const sizeStyles = props => {
|
|
16
|
+
const margin = `${props.theme.space.base}px`;
|
|
17
|
+
const height = props.theme.borderWidths.sm;
|
|
18
|
+
return css(["margin:", " 0;height:", ";"], margin, height);
|
|
19
|
+
};
|
|
20
|
+
const StyledListboxSeparator = styled.li.attrs({
|
|
21
|
+
'data-garden-id': COMPONENT_ID,
|
|
22
|
+
'data-garden-version': '9.0.0-next.8'
|
|
23
|
+
}).withConfig({
|
|
24
|
+
displayName: "StyledListboxSeparator",
|
|
25
|
+
componentId: "sc-1p6toh2-0"
|
|
26
|
+
})(["cursor:default;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
27
|
+
StyledListboxSeparator.defaultProps = {
|
|
28
|
+
theme: DEFAULT_THEME
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { StyledListboxSeparator };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { Field } from '@zendeskgarden/react-forms';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'dropdowns.combobox.message';
|
|
12
|
+
const StyledMessage = styled(Field.Message).attrs({
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.8'
|
|
15
|
+
}).withConfig({
|
|
16
|
+
displayName: "StyledMessage",
|
|
17
|
+
componentId: "sc-jux8m5-0"
|
|
18
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
+
StyledMessage.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledMessage };
|