@zohodesk/components 1.2.4 → 1.2.6
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/README.md +8 -0
- package/coverage/Button/Button.js.html +1 -1
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +1 -1
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/AppContainer/AppContainer.js +3 -0
- package/es/v1/Accordion/Accordion.js +65 -0
- package/es/v1/Accordion/AccordionItem.js +57 -0
- package/es/v1/Accordion/index.js +2 -0
- package/es/v1/Animation/Animation.js +127 -0
- package/es/v1/AppContainer/AppContainer.js +137 -0
- package/es/v1/Avatar/Avatar.js +189 -0
- package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
- package/es/v1/Button/Button.js +68 -0
- package/es/v1/Buttongroup/Buttongroup.js +31 -0
- package/es/v1/Card/Card.js +271 -0
- package/es/v1/CheckBox/CheckBox.js +155 -0
- package/es/v1/DateTime/CalendarView.js +218 -0
- package/es/v1/DateTime/DateTime.js +783 -0
- package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
- package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
- package/es/v1/DateTime/DateWidget.js +1098 -0
- package/es/v1/DateTime/DaysRow.js +31 -0
- package/es/v1/DateTime/Time.js +166 -0
- package/es/v1/DateTime/YearView.js +264 -0
- package/es/v1/DateTime/index.js +1 -0
- package/es/v1/DropBox/DropBox.js +91 -0
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/v1/DropDown/DropDown.js +73 -0
- package/es/v1/DropDown/DropDownHeading.js +44 -0
- package/es/v1/DropDown/DropDownItem.js +76 -0
- package/es/v1/DropDown/DropDownSearch.js +63 -0
- package/es/v1/DropDown/DropDownSeparator.js +15 -0
- package/es/v1/Heading/Heading.js +32 -0
- package/es/v1/Label/Label.js +40 -0
- package/es/v1/Layout/Box.js +115 -0
- package/es/v1/Layout/Container.js +132 -0
- package/es/v1/Layout/index.js +2 -0
- package/es/v1/ListItem/ListContainer.js +102 -0
- package/es/v1/ListItem/ListItem.js +124 -0
- package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
- package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
- package/es/v1/ListItem/ListItemWithIcon.js +127 -0
- package/es/v1/ListItem/ListItemWithRadio.js +105 -0
- package/es/v1/ListItem/index.js +6 -0
- package/es/v1/Modal/Modal.js +154 -0
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
- package/es/v1/MultiSelect/EmptyState.js +64 -0
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/v1/MultiSelect/MultiSelect.js +1120 -0
- package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
- package/es/v1/MultiSelect/SelectedOptions.js +82 -0
- package/es/v1/MultiSelect/Suggestions.js +142 -0
- package/es/v1/MultiSelect/index.js +4 -0
- package/es/v1/PopOver/PopOver.js +211 -0
- package/es/v1/Popup/Popup.js +645 -0
- package/es/v1/Radio/Radio.js +115 -0
- package/es/v1/Responsive/CustomResponsive.js +195 -0
- package/es/v1/Responsive/RefWrapper.js +39 -0
- package/es/v1/Responsive/ResizeComponent.js +197 -0
- package/es/v1/Responsive/ResizeObserver.js +140 -0
- package/es/v1/Responsive/Responsive.js +194 -0
- package/es/v1/Responsive/index.js +9 -0
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
- package/es/v1/Ribbon/Ribbon.js +33 -0
- package/es/v1/RippleEffect/RippleEffect.js +24 -0
- package/es/v1/Select/GroupSelect.js +803 -0
- package/es/v1/Select/Select.js +969 -0
- package/es/v1/Select/SelectWithAvatar.js +344 -0
- package/es/v1/Select/SelectWithIcon.js +535 -0
- package/es/v1/Select/index.js +4 -0
- package/es/v1/Stencils/Stencils.js +26 -0
- package/es/v1/Switch/Switch.js +94 -0
- package/es/v1/Tab/Tab.js +108 -0
- package/es/v1/Tab/TabContent.js +30 -0
- package/es/v1/Tab/TabContentWrapper.js +29 -0
- package/es/v1/Tab/TabWrapper.js +57 -0
- package/es/v1/Tab/Tabs.js +612 -0
- package/es/v1/Tab/index.js +5 -0
- package/es/v1/Tag/Tag.js +134 -0
- package/es/v1/TextBox/TextBox.js +154 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
- package/es/v1/Textarea/Textarea.js +102 -0
- package/es/v1/Tooltip/Tooltip.js +518 -0
- package/es/v1/Typography/Typography.js +38 -0
- package/es/v1/Typography/css/Typography.module.css +376 -0
- package/es/v1/Typography/css/cssJSLogic.js +46 -0
- package/es/v1/Typography/css/letterSpacingMap.js +12 -0
- package/es/v1/Typography/props/defaultProps.js +8 -0
- package/es/v1/Typography/props/propTypes.js +24 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
- package/es/v1/semantic/Button/Button.js +53 -0
- package/es/v1/semantic/index.js +1 -0
- package/lib/AppContainer/AppContainer.js +5 -0
- package/lib/v1/Accordion/Accordion.js +96 -0
- package/lib/v1/Accordion/AccordionItem.js +68 -0
- package/lib/v1/Accordion/index.js +23 -0
- package/lib/v1/Animation/Animation.js +143 -0
- package/lib/v1/AppContainer/AppContainer.js +209 -0
- package/lib/v1/Avatar/Avatar.js +246 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
- package/lib/v1/Button/Button.js +82 -0
- package/lib/v1/Buttongroup/Buttongroup.js +44 -0
- package/lib/v1/Card/Card.js +365 -0
- package/lib/v1/CheckBox/CheckBox.js +166 -0
- package/lib/v1/DateTime/CalendarView.js +285 -0
- package/lib/v1/DateTime/DateTime.js +872 -0
- package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
- package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
- package/lib/v1/DateTime/DateWidget.js +1125 -0
- package/lib/v1/DateTime/DaysRow.js +80 -0
- package/lib/v1/DateTime/Time.js +254 -0
- package/lib/v1/DateTime/YearView.js +325 -0
- package/lib/v1/DateTime/index.js +15 -0
- package/lib/v1/DropBox/DropBox.js +119 -0
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/v1/DropDown/DropDown.js +170 -0
- package/lib/v1/DropDown/DropDownHeading.js +93 -0
- package/lib/v1/DropDown/DropDownItem.js +127 -0
- package/lib/v1/DropDown/DropDownSearch.js +113 -0
- package/lib/v1/DropDown/DropDownSeparator.js +64 -0
- package/lib/v1/Heading/Heading.js +49 -0
- package/lib/v1/Label/Label.js +51 -0
- package/lib/v1/Layout/Box.js +128 -0
- package/lib/v1/Layout/Container.js +145 -0
- package/lib/v1/Layout/index.js +23 -0
- package/lib/v1/ListItem/ListContainer.js +120 -0
- package/lib/v1/ListItem/ListItem.js +138 -0
- package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
- package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
- package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
- package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
- package/lib/v1/ListItem/index.js +55 -0
- package/lib/v1/Modal/Modal.js +212 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
- package/lib/v1/MultiSelect/EmptyState.js +112 -0
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
- package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
- package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
- package/lib/v1/MultiSelect/Suggestions.js +195 -0
- package/lib/v1/MultiSelect/index.js +39 -0
- package/lib/v1/PopOver/PopOver.js +293 -0
- package/lib/v1/Popup/Popup.js +715 -0
- package/lib/v1/Radio/Radio.js +126 -0
- package/lib/v1/Responsive/CustomResponsive.js +242 -0
- package/lib/v1/Responsive/RefWrapper.js +57 -0
- package/lib/v1/Responsive/ResizeComponent.js +268 -0
- package/lib/v1/Responsive/ResizeObserver.js +168 -0
- package/lib/v1/Responsive/Responsive.js +274 -0
- package/lib/v1/Responsive/index.js +55 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
- package/lib/v1/Ribbon/Ribbon.js +44 -0
- package/lib/v1/RippleEffect/RippleEffect.js +39 -0
- package/lib/v1/Select/GroupSelect.js +877 -0
- package/lib/v1/Select/Select.js +1013 -0
- package/lib/v1/Select/SelectWithAvatar.js +394 -0
- package/lib/v1/Select/SelectWithIcon.js +597 -0
- package/lib/v1/Select/index.js +39 -0
- package/lib/v1/Stencils/Stencils.js +43 -0
- package/lib/v1/Switch/Switch.js +108 -0
- package/lib/v1/Tab/Tab.js +132 -0
- package/lib/v1/Tab/TabContent.js +42 -0
- package/lib/v1/Tab/TabContentWrapper.js +42 -0
- package/lib/v1/Tab/TabWrapper.js +89 -0
- package/lib/v1/Tab/Tabs.js +680 -0
- package/lib/v1/Tab/index.js +47 -0
- package/lib/v1/Tag/Tag.js +154 -0
- package/lib/v1/TextBox/TextBox.js +168 -0
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
- package/lib/v1/Textarea/Textarea.js +118 -0
- package/lib/v1/Tooltip/Tooltip.js +586 -0
- package/lib/v1/Typography/Typography.js +56 -0
- package/lib/v1/Typography/css/Typography.module.css +376 -0
- package/lib/v1/Typography/css/cssJSLogic.js +41 -0
- package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
- package/lib/v1/Typography/props/defaultProps.js +15 -0
- package/lib/v1/Typography/props/propTypes.js +35 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
- package/lib/v1/semantic/Button/Button.js +63 -0
- package/lib/v1/semantic/index.js +15 -0
- package/package.json +1 -1
- package/result.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropDown_propTypes, DropDownTarget_propTypes, DropDownContainer_propTypes, DropDownItemContainer_propTypes } from '../../DropDown/props/propTypes';
|
|
3
|
+
import { DropDownItemContainer_defaultProps } from '../../DropDown/props/defaultProps';
|
|
4
|
+
import style from '../../DropDown/DropDown.module.css';
|
|
5
|
+
import PopOver, { PopOverTarget, PopOverContainer } from '../PopOver/PopOver';
|
|
6
|
+
export default class DropDown extends React.Component {
|
|
7
|
+
render() {
|
|
8
|
+
let {
|
|
9
|
+
children
|
|
10
|
+
} = this.props;
|
|
11
|
+
return /*#__PURE__*/React.createElement(PopOver, this.props, /*#__PURE__*/React.createElement(PopOverTarget, null, children[0]), /*#__PURE__*/React.createElement(PopOverContainer, null, children[1]));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
DropDown.propTypes = DropDown_propTypes;
|
|
16
|
+
export class DropDownTarget extends React.Component {
|
|
17
|
+
render() {
|
|
18
|
+
let {
|
|
19
|
+
children
|
|
20
|
+
} = this.props;
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", null, children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
DropDownTarget.propTypes = DropDownTarget_propTypes;
|
|
26
|
+
export class DropDownContainer extends React.Component {
|
|
27
|
+
render() {
|
|
28
|
+
let {
|
|
29
|
+
children
|
|
30
|
+
} = this.props;
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", null, " ", children, " ");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
DropDownContainer.propTypes = DropDownContainer_propTypes;
|
|
36
|
+
export class DropDownItemContainer extends React.Component {
|
|
37
|
+
constructor(props) {
|
|
38
|
+
super(props);
|
|
39
|
+
this.getRef = this.getRef.bind(this);
|
|
40
|
+
this.onScroll = this.onScroll.bind(this);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onScroll(e) {
|
|
44
|
+
let {
|
|
45
|
+
onScroll
|
|
46
|
+
} = this.props;
|
|
47
|
+
onScroll && onScroll(e);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
getRef(ele) {
|
|
51
|
+
let {
|
|
52
|
+
getRef
|
|
53
|
+
} = this.props;
|
|
54
|
+
getRef && getRef(ele);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
let {
|
|
59
|
+
children,
|
|
60
|
+
dataId
|
|
61
|
+
} = this.props;
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: style.listGroup,
|
|
64
|
+
onScroll: this.onScroll,
|
|
65
|
+
ref: this.getRef,
|
|
66
|
+
"data-id": dataId,
|
|
67
|
+
"data-test-id": dataId
|
|
68
|
+
}, children);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
DropDownItemContainer.propTypes = DropDownItemContainer_propTypes;
|
|
73
|
+
DropDownItemContainer.defaultProps = DropDownItemContainer_defaultProps;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropDownHeading_propTypes } from '../../DropDown/props/propTypes';
|
|
3
|
+
import { DropDownHeading_defaultProps } from '../../DropDown/props/defaultProps';
|
|
4
|
+
import style from '../../DropDown/DropDownHeading.module.css';
|
|
5
|
+
export default class DropDownHeading extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
let {
|
|
8
|
+
text,
|
|
9
|
+
title = text,
|
|
10
|
+
children,
|
|
11
|
+
customClass,
|
|
12
|
+
palette,
|
|
13
|
+
htmlId,
|
|
14
|
+
a11y,
|
|
15
|
+
dataId,
|
|
16
|
+
dataSelectorId
|
|
17
|
+
} = this.props;
|
|
18
|
+
let {
|
|
19
|
+
role,
|
|
20
|
+
ariaLabelledby,
|
|
21
|
+
ariaLabel
|
|
22
|
+
} = a11y;
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: `${style[palette]} ${customClass}`,
|
|
25
|
+
"data-title": title,
|
|
26
|
+
role: role,
|
|
27
|
+
"aria-labelledby": ariaLabelledby,
|
|
28
|
+
"aria-label": ariaLabel,
|
|
29
|
+
id: htmlId,
|
|
30
|
+
"data-id": dataId,
|
|
31
|
+
"data-test-id": dataId,
|
|
32
|
+
"data-selector-id": dataSelectorId // tabindex='0'
|
|
33
|
+
|
|
34
|
+
}, text, children);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
DropDownHeading.propTypes = DropDownHeading_propTypes;
|
|
39
|
+
DropDownHeading.defaultProps = DropDownHeading_defaultProps; // if (__DOCS__) {
|
|
40
|
+
// DropDownHeading.docs = {
|
|
41
|
+
// componentGroup: 'Form Elements',
|
|
42
|
+
// folderName: 'Style Guide'
|
|
43
|
+
// };
|
|
44
|
+
// }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropDownItem_propTypes } from '../../DropDown/props/propTypes';
|
|
3
|
+
import { DropDownItem_defaultProps } from '../../DropDown/props/defaultProps';
|
|
4
|
+
import style from '../../DropDown/DropDownItem.module.css';
|
|
5
|
+
export default class DropDownItem extends React.Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.onClick = this.onClick.bind(this);
|
|
9
|
+
this.getRef = this.getRef.bind(this);
|
|
10
|
+
this.getSelectedElement = this.getSelectedElement.bind(this);
|
|
11
|
+
this.onHover = this.onHover.bind(this);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getRef(ele) {
|
|
15
|
+
this.ele = ele;
|
|
16
|
+
let {
|
|
17
|
+
index,
|
|
18
|
+
getRef
|
|
19
|
+
} = this.props;
|
|
20
|
+
getRef && getRef(ele, index);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getSelectedElement() {
|
|
24
|
+
return this.ele ? this.ele : null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
onClick(e) {
|
|
28
|
+
let {
|
|
29
|
+
onClick,
|
|
30
|
+
id,
|
|
31
|
+
value,
|
|
32
|
+
index
|
|
33
|
+
} = this.props;
|
|
34
|
+
onClick && onClick(id, value, index, e);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
onHover(e) {
|
|
38
|
+
let {
|
|
39
|
+
onHover,
|
|
40
|
+
id,
|
|
41
|
+
value,
|
|
42
|
+
index
|
|
43
|
+
} = this.props;
|
|
44
|
+
onHover && onHover(id, value, index, e);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
render() {
|
|
48
|
+
let {
|
|
49
|
+
value,
|
|
50
|
+
active,
|
|
51
|
+
children,
|
|
52
|
+
hightlight,
|
|
53
|
+
dataId,
|
|
54
|
+
customClass = ''
|
|
55
|
+
} = this.props;
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: `${style.list} ${customClass} ${active ? style.listActive : hightlight ? style.listHover : ''} ${children && children[1] ? style.padding : ''}`,
|
|
58
|
+
onClick: this.onClick,
|
|
59
|
+
onMouseOver: this.onHover,
|
|
60
|
+
ref: this.getRef,
|
|
61
|
+
"data-id": dataId,
|
|
62
|
+
"data-test-id": dataId
|
|
63
|
+
}, children && children[0] ? /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
className: style.children
|
|
65
|
+
}, " ", children[0], " ") : children !== undefined ? /*#__PURE__*/React.createElement("span", {
|
|
66
|
+
className: style.children
|
|
67
|
+
}, " ", children, " ") : null, value ? /*#__PURE__*/React.createElement("span", {
|
|
68
|
+
className: style.value
|
|
69
|
+
}, value) : '', children && children[1] ? /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
className: style.user
|
|
71
|
+
}, " ", children[1], " ") : '');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
DropDownItem.propTypes = DropDownItem_propTypes;
|
|
76
|
+
DropDownItem.defaultProps = DropDownItem_defaultProps;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropDownSearch_propTypes } from '../../DropDown/props/propTypes';
|
|
3
|
+
import { DropDownSearch_defaultProps } from '../../DropDown/props/defaultProps';
|
|
4
|
+
import TextBox from '../TextBox/TextBox';
|
|
5
|
+
import style from '../../DropDown/DropDownSearch.module.css';
|
|
6
|
+
export default class DropDownSearch extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.getRef = this.getRef.bind(this);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
componentDidMount() {
|
|
13
|
+
this.input && this.input.focus({
|
|
14
|
+
preventScroll: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
getRef(ele) {
|
|
19
|
+
let {
|
|
20
|
+
getRef
|
|
21
|
+
} = this.props;
|
|
22
|
+
this.input = ele;
|
|
23
|
+
getRef && getRef(ele);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
let {
|
|
28
|
+
name,
|
|
29
|
+
id,
|
|
30
|
+
maxLength,
|
|
31
|
+
onKeyDown,
|
|
32
|
+
onChange,
|
|
33
|
+
value,
|
|
34
|
+
onBlur,
|
|
35
|
+
size,
|
|
36
|
+
textBoxSize,
|
|
37
|
+
placeHolder,
|
|
38
|
+
customClass
|
|
39
|
+
} = this.props;
|
|
40
|
+
let {
|
|
41
|
+
searchClass = '',
|
|
42
|
+
customTextBox = ''
|
|
43
|
+
} = customClass;
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: `${style.search} ${style[`${size}Search`]} ${searchClass}`
|
|
46
|
+
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
47
|
+
id: id,
|
|
48
|
+
inputRef: this.getRef,
|
|
49
|
+
maxLength: maxLength,
|
|
50
|
+
name: name,
|
|
51
|
+
onBlur: onBlur,
|
|
52
|
+
onChange: onChange,
|
|
53
|
+
onKeyDown: onKeyDown,
|
|
54
|
+
size: textBoxSize,
|
|
55
|
+
value: value,
|
|
56
|
+
placeHolder: placeHolder,
|
|
57
|
+
customClass: customTextBox
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
DropDownSearch.defaultProps = DropDownSearch_defaultProps;
|
|
63
|
+
DropDownSearch.propTypes = DropDownSearch_propTypes;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropDownSeparator_propTypes } from '../../DropDown/props/propTypes';
|
|
3
|
+
import style from '../../DropDown/DropDownSeparator.module.css';
|
|
4
|
+
export default class DropDownSeparator extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
let {
|
|
7
|
+
customClass = ''
|
|
8
|
+
} = this.props;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: `${style.separator} ${customClass}`
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
DropDownSeparator.propTypes = DropDownSeparator_propTypes;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../Heading/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../Heading/props/propTypes';
|
|
4
|
+
import style from '../../Heading/Heading.module.css';
|
|
5
|
+
export default function Heading(props) {
|
|
6
|
+
let {
|
|
7
|
+
tagName,
|
|
8
|
+
className,
|
|
9
|
+
onClick,
|
|
10
|
+
onDoubleClick,
|
|
11
|
+
title,
|
|
12
|
+
dataTitle,
|
|
13
|
+
dataId,
|
|
14
|
+
a11y
|
|
15
|
+
} = props;
|
|
16
|
+
return /*#__PURE__*/React.createElement(tagName, {
|
|
17
|
+
className: `${style.reset} ${className}`,
|
|
18
|
+
onClick,
|
|
19
|
+
onDoubleClick,
|
|
20
|
+
'data-title': dataTitle || title,
|
|
21
|
+
'data-id': dataId,
|
|
22
|
+
'data-test-id': dataId,
|
|
23
|
+
...a11y
|
|
24
|
+
}, title);
|
|
25
|
+
}
|
|
26
|
+
Heading.propTypes = propTypes;
|
|
27
|
+
Heading.defaultProps = defaultProps; // if (__DOCS__) {
|
|
28
|
+
// Heading.docs = {
|
|
29
|
+
// folderName: 'Style Guide',
|
|
30
|
+
// componentGroup: 'Accessibility'
|
|
31
|
+
// };
|
|
32
|
+
// }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../Label/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../Label/props/propTypes';
|
|
4
|
+
import style from '../../Label/Label.module.css';
|
|
5
|
+
import colors from '../../Label/LabelColors.module.css';
|
|
6
|
+
export default function Label(props) {
|
|
7
|
+
const {
|
|
8
|
+
text,
|
|
9
|
+
type,
|
|
10
|
+
palette,
|
|
11
|
+
size,
|
|
12
|
+
clipped,
|
|
13
|
+
htmlFor,
|
|
14
|
+
title,
|
|
15
|
+
onClick,
|
|
16
|
+
dataId,
|
|
17
|
+
dataSelectorId,
|
|
18
|
+
variant,
|
|
19
|
+
customClass,
|
|
20
|
+
id,
|
|
21
|
+
a11y = {}
|
|
22
|
+
} = props;
|
|
23
|
+
const {
|
|
24
|
+
tabIndex
|
|
25
|
+
} = a11y;
|
|
26
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
27
|
+
className: `${style.label} ${style[type]} ${style[size]} ${colors[palette]} ${style[`font_${variant}`]}
|
|
28
|
+
${clipped ? style.dotted : ''} ${onClick ? style.pointer : style.cursor} ${customClass} `,
|
|
29
|
+
htmlFor: htmlFor,
|
|
30
|
+
"data-title": title,
|
|
31
|
+
"data-id": dataId,
|
|
32
|
+
"data-test-id": dataId,
|
|
33
|
+
"data-selector-id": dataSelectorId,
|
|
34
|
+
onClick: onClick,
|
|
35
|
+
id: id,
|
|
36
|
+
tabIndex: tabIndex
|
|
37
|
+
}, text);
|
|
38
|
+
}
|
|
39
|
+
Label.defaultProps = defaultProps;
|
|
40
|
+
Label.propTypes = propTypes;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps as propTypes } from '../../Layout/props/propTypes';
|
|
3
|
+
import { BoxDefaultProps as defaultProps } from '../../Layout/props/defaultProps';
|
|
4
|
+
/* eslint css-modules/no-unused-class: 0 */
|
|
5
|
+
|
|
6
|
+
import { createProps, getClass, setProps } from '../../Layout/utils';
|
|
7
|
+
import style from '../../Layout/Layout.module.css';
|
|
8
|
+
/* eslint-disable react/no-unused-prop-types*/
|
|
9
|
+
|
|
10
|
+
function getBoxClassNames(props) {
|
|
11
|
+
const {
|
|
12
|
+
hidden,
|
|
13
|
+
className,
|
|
14
|
+
flexible,
|
|
15
|
+
adjust,
|
|
16
|
+
isFirst,
|
|
17
|
+
isLast,
|
|
18
|
+
shrink,
|
|
19
|
+
column,
|
|
20
|
+
align,
|
|
21
|
+
scroll,
|
|
22
|
+
preventParentScroll
|
|
23
|
+
} = props;
|
|
24
|
+
const modificators = [className];
|
|
25
|
+
|
|
26
|
+
if (flexible && !adjust) {
|
|
27
|
+
modificators.push(getClass(style, 'grow'));
|
|
28
|
+
modificators.push(getClass(style, 'basis'));
|
|
29
|
+
} else if (flexible && adjust) {
|
|
30
|
+
modificators.push(getClass(style, 'grow'));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (isFirst) {
|
|
34
|
+
modificators.push(getClass(style, 'first'));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (isLast) {
|
|
38
|
+
modificators.push(getClass(style, 'last'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (adjust) {
|
|
42
|
+
modificators.push(getClass(style, 'basisAuto'));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (shrink) {
|
|
46
|
+
modificators.push(getClass(style, 'shrinkOn'));
|
|
47
|
+
} else {
|
|
48
|
+
modificators.push(getClass(style, 'shrinkOff'));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (hidden) {
|
|
52
|
+
hidden.forEach(key => {
|
|
53
|
+
modificators.push(getClass(style, `hidden-screen-${key}`));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (column) {
|
|
58
|
+
modificators.push(getClass(style, `col-${column}`));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (align) {
|
|
62
|
+
let alignClassMapping = {
|
|
63
|
+
start: 'selfStart',
|
|
64
|
+
end: 'selfEnd',
|
|
65
|
+
center: 'selfCenter'
|
|
66
|
+
};
|
|
67
|
+
let alignClass = alignClassMapping[align];
|
|
68
|
+
modificators.push(getClass(style, alignClass));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (scroll) {
|
|
72
|
+
let scrollClassMapping = {
|
|
73
|
+
horizontal: 'scrollx',
|
|
74
|
+
vertical: 'scrolly',
|
|
75
|
+
both: 'scrollboth',
|
|
76
|
+
none: 'scrollnone'
|
|
77
|
+
};
|
|
78
|
+
let scrollClass = scrollClassMapping[scroll];
|
|
79
|
+
modificators.push(getClass(style, scrollClass));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (preventParentScroll) {
|
|
83
|
+
let ParentScrollClassMapping = {
|
|
84
|
+
horizontal: 'preventScrollBubbleX',
|
|
85
|
+
vertical: 'preventScrollBubbleY',
|
|
86
|
+
both: 'preventScrollBubbleBoth'
|
|
87
|
+
};
|
|
88
|
+
let parentScrollClass = ParentScrollClassMapping[preventParentScroll];
|
|
89
|
+
modificators.push(getClass(style, parentScrollClass));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return modificators;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function getBoxProps(props) {
|
|
96
|
+
return createProps(propTypes, props, getBoxClassNames(props));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default function Box(props) {
|
|
100
|
+
let {
|
|
101
|
+
tagName
|
|
102
|
+
} = props;
|
|
103
|
+
let componentProps = setProps({ ...getBoxProps(props)
|
|
104
|
+
}, props, {
|
|
105
|
+
isScrollAttribute: 'data-scroll',
|
|
106
|
+
eleRef: 'ref',
|
|
107
|
+
dataId: 'data-id',
|
|
108
|
+
testId: 'data-test-id',
|
|
109
|
+
tourId: 'data-tour',
|
|
110
|
+
dataSelectorId: 'data-selector-id'
|
|
111
|
+
});
|
|
112
|
+
return /*#__PURE__*/React.createElement(tagName, componentProps);
|
|
113
|
+
}
|
|
114
|
+
Box.propTypes = propTypes;
|
|
115
|
+
Box.defaultProps = defaultProps;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContainerProps as propTypes } from '../../Layout/props/propTypes';
|
|
3
|
+
import { ContainerDefaultProps as defaultProps } from '../../Layout/props/defaultProps';
|
|
4
|
+
/* eslint css-modules/no-unused-class: 0 */
|
|
5
|
+
|
|
6
|
+
import { createProps, getClass, setProps } from '../../Layout/utils';
|
|
7
|
+
import style from '../../Layout/Layout.module.css';
|
|
8
|
+
/* eslint-disable react/no-unused-prop-types*/
|
|
9
|
+
|
|
10
|
+
function getContainerClassNames(props) {
|
|
11
|
+
const {
|
|
12
|
+
hidden,
|
|
13
|
+
className,
|
|
14
|
+
isInline,
|
|
15
|
+
isCover,
|
|
16
|
+
alignBox,
|
|
17
|
+
alignContent,
|
|
18
|
+
wrap,
|
|
19
|
+
align,
|
|
20
|
+
scroll,
|
|
21
|
+
preventParentScroll
|
|
22
|
+
} = props;
|
|
23
|
+
const modificators = [className];
|
|
24
|
+
|
|
25
|
+
if (hidden) {
|
|
26
|
+
hidden.forEach(key => {
|
|
27
|
+
modificators.push(getClass(style, `hidden-screen-${key}`));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (isInline) {
|
|
32
|
+
modificators.push(getClass(style, 'inflex'));
|
|
33
|
+
} else {
|
|
34
|
+
modificators.push(getClass(style, 'flex'));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (isCover) {
|
|
38
|
+
modificators.push(getClass(style, 'cover'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let alignBoxClassMapping = {
|
|
42
|
+
row: 'rowdir',
|
|
43
|
+
column: 'coldir',
|
|
44
|
+
'row-reverse': 'rowReverse',
|
|
45
|
+
'column-reverse': 'colReverse'
|
|
46
|
+
};
|
|
47
|
+
let alignClass = alignBoxClassMapping[alignBox];
|
|
48
|
+
modificators.push(getClass(style, alignClass));
|
|
49
|
+
|
|
50
|
+
if (alignContent) {
|
|
51
|
+
let alignContentClassMapping = {
|
|
52
|
+
start: 'alignStart',
|
|
53
|
+
end: 'alignEnd',
|
|
54
|
+
center: 'alignCenter',
|
|
55
|
+
around: 'alignAround',
|
|
56
|
+
between: 'alignBetween'
|
|
57
|
+
};
|
|
58
|
+
let alignContentClass = alignContentClassMapping[alignContent];
|
|
59
|
+
modificators.push(getClass(style, alignContentClass));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (wrap) {
|
|
63
|
+
let wrapClassMapping = {
|
|
64
|
+
wrap: 'wrap',
|
|
65
|
+
'wrap-reverse': 'wrapReverse'
|
|
66
|
+
};
|
|
67
|
+
let wrapClass = wrapClassMapping[wrap];
|
|
68
|
+
modificators.push(getClass(style, wrapClass));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (align) {
|
|
72
|
+
let alignClassMapping = {
|
|
73
|
+
horizontal: 'hCenter',
|
|
74
|
+
vertical: 'vCenter',
|
|
75
|
+
both: 'both',
|
|
76
|
+
between: 'between',
|
|
77
|
+
around: 'around',
|
|
78
|
+
right: 'right',
|
|
79
|
+
left: 'left',
|
|
80
|
+
top: 'top',
|
|
81
|
+
bottom: 'bottom',
|
|
82
|
+
baseline: 'baseline'
|
|
83
|
+
};
|
|
84
|
+
let alignClass = alignClassMapping[align];
|
|
85
|
+
modificators.push(getClass(style, alignClass));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (scroll) {
|
|
89
|
+
let scrollClassMapping = {
|
|
90
|
+
horizontal: 'scrollx',
|
|
91
|
+
vertical: 'scrolly',
|
|
92
|
+
both: 'scrollboth',
|
|
93
|
+
none: 'scrollnone'
|
|
94
|
+
};
|
|
95
|
+
let scrollClass = scrollClassMapping[scroll];
|
|
96
|
+
modificators.push(getClass(style, scrollClass));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (preventParentScroll) {
|
|
100
|
+
let ParentScrollClassMapping = {
|
|
101
|
+
horizontal: 'preventScrollBubbleX',
|
|
102
|
+
vertical: 'preventScrollBubbleY',
|
|
103
|
+
both: 'preventScrollBubbleBoth'
|
|
104
|
+
};
|
|
105
|
+
let parentScrollClass = ParentScrollClassMapping[preventParentScroll];
|
|
106
|
+
modificators.push(getClass(style, parentScrollClass));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return modificators;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getContainerProps(props) {
|
|
113
|
+
return createProps(propTypes, props, getContainerClassNames(props));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default function Container(props) {
|
|
117
|
+
let {
|
|
118
|
+
tagName
|
|
119
|
+
} = props;
|
|
120
|
+
let componentProps = setProps({ ...getContainerProps(props)
|
|
121
|
+
}, props, {
|
|
122
|
+
isScrollAttribute: 'data-scroll',
|
|
123
|
+
eleRef: 'ref',
|
|
124
|
+
dataId: 'data-id',
|
|
125
|
+
testId: 'data-test-id',
|
|
126
|
+
tourId: 'data-tour',
|
|
127
|
+
dataSelectorId: 'data-selector-id'
|
|
128
|
+
});
|
|
129
|
+
return /*#__PURE__*/React.createElement(tagName, componentProps);
|
|
130
|
+
}
|
|
131
|
+
Container.propTypes = propTypes;
|
|
132
|
+
Container.defaultProps = defaultProps;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
/**** Libraries ****/
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
import { Container } from '../Layout';
|
|
6
|
+
import CssProvider from '../../Provider/CssProvider';
|
|
7
|
+
import style from '../../ListItem/ListItem.module.css';
|
|
8
|
+
import { ListContainerDefaultProps } from '../../ListItem/props/defaultProps';
|
|
9
|
+
import { ListContainer_Props } from '../../ListItem/props/propTypes';
|
|
10
|
+
import { useResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
11
|
+
|
|
12
|
+
const ListContainer = props => {
|
|
13
|
+
const {
|
|
14
|
+
size,
|
|
15
|
+
active,
|
|
16
|
+
highlight,
|
|
17
|
+
autoHover,
|
|
18
|
+
palette,
|
|
19
|
+
title,
|
|
20
|
+
disableTitle,
|
|
21
|
+
needTick,
|
|
22
|
+
isLink,
|
|
23
|
+
href,
|
|
24
|
+
target,
|
|
25
|
+
needBorder,
|
|
26
|
+
isDisabled,
|
|
27
|
+
children,
|
|
28
|
+
dataId,
|
|
29
|
+
dataSelectorId,
|
|
30
|
+
a11y,
|
|
31
|
+
customClass,
|
|
32
|
+
customProps,
|
|
33
|
+
onClick,
|
|
34
|
+
onMouseEnter,
|
|
35
|
+
onMouseOver,
|
|
36
|
+
eleRef
|
|
37
|
+
} = props;
|
|
38
|
+
const responsiveFunc = useCallback(_ref => {
|
|
39
|
+
let {
|
|
40
|
+
mediaQueryOR,
|
|
41
|
+
isTouchDevice
|
|
42
|
+
} = _ref;
|
|
43
|
+
return {
|
|
44
|
+
mobileToTab: mediaQueryOR([{
|
|
45
|
+
maxWidth: 700
|
|
46
|
+
}]),
|
|
47
|
+
isTouchDevice: isTouchDevice
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
const {
|
|
51
|
+
mobileToTab,
|
|
52
|
+
isTouchDevice
|
|
53
|
+
} = useResponsiveReceiver('Helmet', responsiveFunc);
|
|
54
|
+
const {
|
|
55
|
+
role,
|
|
56
|
+
ariaSelected,
|
|
57
|
+
ariaLabel,
|
|
58
|
+
insetFocus = true
|
|
59
|
+
} = a11y;
|
|
60
|
+
const options = {};
|
|
61
|
+
|
|
62
|
+
if (isLink) {
|
|
63
|
+
options.href = href;
|
|
64
|
+
options.target = `_${target}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (active) {
|
|
68
|
+
options['data-selected'] = active;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!isDisabled && !isLink) {
|
|
72
|
+
options.tabindex = '0';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
76
|
+
role: role,
|
|
77
|
+
"data-a11y-inset-focus": insetFocus,
|
|
78
|
+
"aria-selected": ariaSelected,
|
|
79
|
+
"aria-label": ariaLabel,
|
|
80
|
+
isCover: false,
|
|
81
|
+
align: "vertical",
|
|
82
|
+
alignBox: "row",
|
|
83
|
+
className: `${style.list} ${style[size]} ${mobileToTab && isTouchDevice ? style.responsiveHeight : ''} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customClass}`,
|
|
84
|
+
dataId: dataId,
|
|
85
|
+
dataSelectorId: dataSelectorId,
|
|
86
|
+
onClick: !isDisabled && onClick,
|
|
87
|
+
onMouseEnter: onMouseEnter,
|
|
88
|
+
onMouseOver: onMouseOver,
|
|
89
|
+
eleRef: eleRef,
|
|
90
|
+
tagName: isLink ? 'a' : 'li',
|
|
91
|
+
"data-title": isDisabled ? disableTitle : title
|
|
92
|
+
}, options, customProps), children);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
ListContainer.defaultProps = ListContainerDefaultProps;
|
|
96
|
+
ListContainer.propTypes = ListContainer_Props;
|
|
97
|
+
export default ListContainer; // if (__DOCS__) {
|
|
98
|
+
// ListContainer.docs = {
|
|
99
|
+
// componentGroup: 'Molecule',
|
|
100
|
+
// folderName: 'Style Guide'
|
|
101
|
+
// };
|
|
102
|
+
// }
|