@zohodesk/components 1.0.0-temp-245.1 → 1.0.0-temp-248
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 +10 -0
- package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +0 -5
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +0 -5
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +0 -5
- package/es/Provider/LibraryContext.js +3 -11
- package/es/Select/Select.js +5 -3
- package/es/Select/__tests__/Select.spec.js +5 -0
- package/es/Select/props/propTypes.js +2 -1
- package/es/TextBoxIcon/TextBoxIcon.js +0 -1
- package/es/shared/InputFieldLine/InputFieldLine.js +2 -1
- package/es/shared/InputFieldLine/InputFieldLine.module.css +13 -7
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/v1/Label/Label.js +30 -81
- package/es/v1/Label/props/defaultProps.js +10 -10
- package/es/v1/Label/props/propTypes.js +14 -22
- package/lib/Provider/LibraryContext.js +3 -11
- package/lib/Select/Select.js +8 -5
- package/lib/Select/__tests__/Select.spec.js +5 -0
- package/lib/Select/props/propTypes.js +2 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +0 -1
- package/lib/shared/InputFieldLine/InputFieldLine.js +2 -1
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +13 -7
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +5 -5
- package/lib/v1/Label/Label.js +33 -91
- package/lib/v1/Label/props/defaultProps.js +12 -12
- package/lib/v1/Label/props/propTypes.js +16 -24
- package/package.json +4 -4
- package/es/v1/Label/css/Label_v1.module.css +0 -58
- package/es/v1/Label/css/cssJSLogic.js +0 -35
- package/lib/v1/Label/css/Label_v1.module.css +0 -58
- package/lib/v1/Label/css/cssJSLogic.js +0 -40
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
4
|
|
|
5
|
+
# 1.5.7
|
|
6
|
+
- **InputFieldline**
|
|
7
|
+
- changed the handling of conditional logic for padding and size properties.
|
|
8
|
+
|
|
9
|
+
- **TextBoxIcon**
|
|
10
|
+
- added support for `InputFieldLineProps` via the customProps object.
|
|
11
|
+
|
|
12
|
+
- **Select**
|
|
13
|
+
- Removed the size prop from InputFieldLine usage, as it is unused.
|
|
14
|
+
|
|
5
15
|
# 1.5.6
|
|
6
16
|
|
|
7
17
|
- **ListItemWithRadio, ListItemWithCheckBox**
|
|
@@ -8,9 +8,4 @@
|
|
|
8
8
|
--zdt_v1_switch_onLabel: hsla(217, 23.08%, calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
9
9
|
--zdt_v1_switch_offLabel: hsla(217, 13.73%, calc(70.00% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
10
10
|
--zdt_v1_switch_offLabel_hover: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
11
|
-
|
|
12
|
-
/* label */
|
|
13
|
-
--zdt_v1_label_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
14
|
-
--zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
-
--zdt_v1_label_disabled_text: var(--dot_inputDisable);
|
|
16
11
|
}
|
|
@@ -8,9 +8,4 @@
|
|
|
8
8
|
--zdt_v1_switch_onLabel: hsla(0, 0.00%, calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
9
9
|
--zdt_v1_switch_offLabel: hsla(220, 10.45%, calc(39.41% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
10
10
|
--zdt_v1_switch_offLabel_hover: hsla(0, 0.00%, calc(0.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
11
|
-
|
|
12
|
-
/* label */
|
|
13
|
-
--zdt_v1_label_text: hsla(0, 0.00%, calc(0.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
14
|
-
--zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
-
--zdt_v1_label_disabled_text: var(--dot_inputDisable);
|
|
16
11
|
}
|
|
@@ -8,9 +8,4 @@
|
|
|
8
8
|
--zdt_v1_switch_onLabel: hsla(0, 0.00%, calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
9
9
|
--zdt_v1_switch_offLabel: hsla(0, 0.00%, calc(60.00% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
10
10
|
--zdt_v1_switch_offLabel_hover: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
11
|
-
|
|
12
|
-
/* label */
|
|
13
|
-
--zdt_v1_label_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
14
|
-
--zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
-
--zdt_v1_label_disabled_text: var(--dot_inputDisable);
|
|
16
11
|
}
|
|
@@ -11,8 +11,6 @@ const LibraryContextProvider = _ref => {
|
|
|
11
11
|
hasTagColorInheritedToText,
|
|
12
12
|
shouldIndicateSwitchState,
|
|
13
13
|
shouldStrikeThroughDisabledButton,
|
|
14
|
-
labelRequiredType,
|
|
15
|
-
shouldHighlightRequiredLabel,
|
|
16
14
|
children
|
|
17
15
|
} = _ref;
|
|
18
16
|
const [value, setValue] = useState({
|
|
@@ -21,9 +19,7 @@ const LibraryContextProvider = _ref => {
|
|
|
21
19
|
coloredTagVariant,
|
|
22
20
|
hasTagColorInheritedToText,
|
|
23
21
|
shouldIndicateSwitchState,
|
|
24
|
-
shouldStrikeThroughDisabledButton
|
|
25
|
-
labelRequiredType,
|
|
26
|
-
shouldHighlightRequiredLabel
|
|
22
|
+
shouldStrikeThroughDisabledButton
|
|
27
23
|
});
|
|
28
24
|
|
|
29
25
|
function setGlobalContext(key, data) {
|
|
@@ -48,9 +44,7 @@ LibraryContextProvider.propTypes = {
|
|
|
48
44
|
hasTagColorInheritedToText: PropTypes.bool,
|
|
49
45
|
direction: PropTypes.string,
|
|
50
46
|
shouldIndicateSwitchState: PropTypes.bool,
|
|
51
|
-
shouldStrikeThroughDisabledButton: PropTypes.bool
|
|
52
|
-
labelRequiredType: PropTypes.oneOf(['asterisk', 'text']),
|
|
53
|
-
shouldHighlightRequiredLabel: PropTypes.bool
|
|
47
|
+
shouldStrikeThroughDisabledButton: PropTypes.bool
|
|
54
48
|
};
|
|
55
49
|
LibraryContextProvider.defaultProps = {
|
|
56
50
|
isReducedMotion: getLibraryConfig('isReducedMotion'),
|
|
@@ -58,8 +52,6 @@ LibraryContextProvider.defaultProps = {
|
|
|
58
52
|
coloredTagVariant: 'bold',
|
|
59
53
|
hasTagColorInheritedToText: true,
|
|
60
54
|
shouldIndicateSwitchState: false,
|
|
61
|
-
shouldStrikeThroughDisabledButton: false
|
|
62
|
-
labelRequiredType: 'asterisk',
|
|
63
|
-
shouldHighlightRequiredLabel: true
|
|
55
|
+
shouldStrikeThroughDisabledButton: false
|
|
64
56
|
};
|
|
65
57
|
export default LibraryContextProvider;
|
package/es/Select/Select.js
CHANGED
|
@@ -835,7 +835,8 @@ export class SelectComponent extends Component {
|
|
|
835
835
|
TextBoxProps = {},
|
|
836
836
|
DropdownSearchTextBoxProps = {},
|
|
837
837
|
SuggestionsProps = {},
|
|
838
|
-
TextBoxIconProps = {}
|
|
838
|
+
TextBoxIconProps = {},
|
|
839
|
+
InputFieldLineProps = {}
|
|
839
840
|
} = customProps;
|
|
840
841
|
const inputFieldLineA11yAttributes = this.getInputFieldLineA11y({
|
|
841
842
|
setAriaId,
|
|
@@ -855,14 +856,15 @@ export class SelectComponent extends Component {
|
|
|
855
856
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
856
857
|
"data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`
|
|
857
858
|
}, isRenderable(renderCustomSelectedValue) ? /*#__PURE__*/React.createElement(InputFieldLine, {
|
|
858
|
-
isActive: isPopupReady,
|
|
859
859
|
border: needBorder ? 'bottom' : 'none',
|
|
860
|
+
hasPadding: true,
|
|
861
|
+
...InputFieldLineProps,
|
|
862
|
+
isActive: isPopupReady,
|
|
860
863
|
size: size,
|
|
861
864
|
borderColor: borderColor,
|
|
862
865
|
isDisabled: isDisabled,
|
|
863
866
|
isReadOnly: isReadOnly,
|
|
864
867
|
onKeyDown: this.handleKeyDown,
|
|
865
|
-
hasPadding: true,
|
|
866
868
|
a11yAttributes: inputFieldLineA11yAttributes
|
|
867
869
|
}, renderNode(renderCustomSelectedValue, {
|
|
868
870
|
isDisabled,
|
|
@@ -87,7 +87,8 @@ export const Select_propTypes = {
|
|
|
87
87
|
TextBoxIconProps: PropTypes.object,
|
|
88
88
|
DropdownSearchTextBoxProps: PropTypes.object,
|
|
89
89
|
listItemProps: PropTypes.object,
|
|
90
|
-
SuggestionsProps: PropTypes.object
|
|
90
|
+
SuggestionsProps: PropTypes.object,
|
|
91
|
+
InputFieldLineProps: PropTypes.object
|
|
91
92
|
}),
|
|
92
93
|
isLoading: PropTypes.bool,
|
|
93
94
|
dataSelectorId: PropTypes.string,
|
|
@@ -130,7 +130,6 @@ export default class TextBoxIcon extends React.Component {
|
|
|
130
130
|
return /*#__PURE__*/React.createElement(InputFieldLine, {
|
|
131
131
|
isActive: isActive || isFocus,
|
|
132
132
|
border: needBorder ? 'bottom' : 'none',
|
|
133
|
-
size: size,
|
|
134
133
|
borderColor: borderColor,
|
|
135
134
|
hasEffect: needEffect,
|
|
136
135
|
isDisabled: isDisabled,
|
|
@@ -36,7 +36,8 @@ function InputFieldLine(props) {
|
|
|
36
36
|
dataId: dataId,
|
|
37
37
|
onClick: onClick,
|
|
38
38
|
onKeyDown: onKeyDown,
|
|
39
|
-
|
|
39
|
+
scroll: !!size ? 'vertical' : undefined,
|
|
40
|
+
className: `${style.varClass} ${style.customContainer} ${!!size ? style[size] : ''} ${hasPadding ? style[`padding_${size}`] : ''} ${borderClass} ${isDisabled ? style.disabled : isReadOnly ? hasEffect ? style.effect : style.readonly : style.effect} ${border !== 'none' ? `${borderColorClass} ${style.hasBorder}` : ''} ${isActive && !(isDisabled || isReadOnly) ? style.active : ''} ${customClass}`
|
|
40
41
|
}, children);
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.customContainer {
|
|
9
|
-
composes: oflowy from '../../common/common.module.css';
|
|
10
9
|
cursor: var(--local_cursor);
|
|
11
10
|
border-color: var(--local_inputFieldLine_border_color);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
.disabled
|
|
13
|
+
.disabled,
|
|
14
|
+
.readonly {
|
|
15
15
|
--local_cursor: not-allowed;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -57,28 +57,34 @@
|
|
|
57
57
|
border-style: solid;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.padding_small,
|
|
61
|
+
.padding_xmedium {
|
|
62
|
+
--local_padding: var(--zd_size3);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.padding_medium,
|
|
66
|
+
.padding_large {
|
|
67
|
+
--local_padding: var(--zd_size8);
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
.xmedium {
|
|
61
71
|
min-height: var(--zd_size30) ;
|
|
62
|
-
--local_padding: var(--zd_size3);
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
.small {
|
|
66
75
|
max-height: var(--zd_size200) ;
|
|
67
|
-
--local_padding: var(--zd_size3);
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
.medium {
|
|
71
79
|
max-height: var(--zd_size350) ;
|
|
72
|
-
--local_padding: var(--zd_size8);
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
.large {
|
|
76
83
|
max-height: var(--zd_size400) ;
|
|
77
|
-
--local_padding: var(--zd_size8);
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
.border_bottom {
|
|
81
|
-
border-width:
|
|
87
|
+
border-width: 0 0 var(--local_inputFieldLine_border_width) 0;
|
|
82
88
|
padding-bottom: var(--local_padding);
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import useDropboxPosCalc from "../../../DropBox/DropBoxElement/useDropboxPosCalc";
|
|
3
3
|
import cssJSLogic from "../../../DropBox/DropBoxElement/css/cssJSLogic";
|
|
4
|
-
import { positionMapping } from
|
|
4
|
+
import { positionMapping } from '@zohodesk/dotkit/es/react/components/Popup/utils/positioning';
|
|
5
5
|
import { DropBoxElementDefaultProps } from "./props/defaultProps";
|
|
6
6
|
import { DropBoxElementPropTypes } from "./props/propTypes";
|
|
7
7
|
import { mergeStyle } from '@zohodesk/utils';
|
package/es/v1/Label/Label.js
CHANGED
|
@@ -1,91 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import defaultProps from "./props/defaultProps";
|
|
2
|
+
import { defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { propTypes } from "./props/propTypes";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
8
|
-
import Typography from "../../Typography/Typography";
|
|
9
|
-
import defaultStyle from "./css/Label_v1.module.css";
|
|
10
|
-
|
|
11
|
-
const Label = props => {
|
|
4
|
+
import style from "../../Label/Label.module.css";
|
|
5
|
+
import colors from "../../Label/LabelColors.module.css";
|
|
6
|
+
export default function Label(props) {
|
|
12
7
|
const {
|
|
8
|
+
text,
|
|
9
|
+
type,
|
|
10
|
+
palette,
|
|
11
|
+
size,
|
|
12
|
+
clipped,
|
|
13
13
|
htmlFor,
|
|
14
|
+
title,
|
|
14
15
|
onClick,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
tagAttributes,
|
|
19
|
-
a11yAttributes,
|
|
20
|
-
customProps,
|
|
21
|
-
isRequired,
|
|
22
|
-
requiredType,
|
|
23
|
-
isClipped,
|
|
24
|
-
renderRightPlaceholderNode,
|
|
25
|
-
renderLeftPlaceholderNode,
|
|
16
|
+
dataId,
|
|
17
|
+
dataSelectorId,
|
|
18
|
+
variant,
|
|
26
19
|
customClass,
|
|
27
|
-
|
|
20
|
+
id,
|
|
21
|
+
a11y = {}
|
|
28
22
|
} = props;
|
|
29
23
|
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const {
|
|
46
|
-
labelClass,
|
|
47
|
-
requiredClass,
|
|
48
|
-
asteriskClass
|
|
49
|
-
} = cssJSLogic({ ...props,
|
|
50
|
-
style
|
|
51
|
-
});
|
|
52
|
-
const a11yAttributes_requiredText = {
|
|
53
|
-
'aria-hidden': 'true'
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const renderRequired = () => /*#__PURE__*/React.createElement(Typography, {
|
|
57
|
-
$ui_tagName: "span",
|
|
58
|
-
$ui_className: requiredClass,
|
|
59
|
-
$a11yAttributes_text: a11yAttributes_requiredText
|
|
60
|
-
}, requiredType === 'text' ? '(Required)' : requiredType === 'asterisk' ? '*' : null);
|
|
61
|
-
|
|
62
|
-
return /*#__PURE__*/React.createElement(Flex, { ...customProps_container,
|
|
63
|
-
$tagAttributes_container: {
|
|
64
|
-
'data-selector-id': customId,
|
|
65
|
-
...tagAttributes_container
|
|
66
|
-
},
|
|
67
|
-
$ui_displayMode: "inline",
|
|
68
|
-
$ui_alignItems: "center",
|
|
69
|
-
$a11yAttributes_container: a11yAttributes_container,
|
|
70
|
-
testId: testId,
|
|
71
|
-
customId: customId,
|
|
72
|
-
$ui_className: customClass_container
|
|
73
|
-
}, isRenderable(renderRightPlaceholderNode) ? renderNode(renderRightPlaceholderNode) : null, /*#__PURE__*/React.createElement(Typography, { ...customProps_label,
|
|
74
|
-
$tagAttributes_text: {
|
|
75
|
-
htmlFor,
|
|
76
|
-
onClick,
|
|
77
|
-
...tagAttributes_label
|
|
78
|
-
},
|
|
79
|
-
$ui_tagName: "label",
|
|
80
|
-
$ui_className: labelClass,
|
|
81
|
-
$i18n_dataTitle: text,
|
|
82
|
-
$a11yAttributes_text: a11yAttributes_label,
|
|
83
|
-
$ui_size: style[size]
|
|
84
|
-
}, text, isRequired ? !isClipped && renderRequired() : null), isRequired ? isClipped && renderRequired() : null, isRenderable(renderLeftPlaceholderNode) ? renderNode(renderLeftPlaceholderNode) : null);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export default withComponentRegistrar(Label, {
|
|
88
|
-
name: 'ZDC_v1_Label'
|
|
89
|
-
});
|
|
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
|
+
}
|
|
90
39
|
Label.defaultProps = defaultProps;
|
|
91
40
|
Label.propTypes = propTypes;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export const defaultProps = {
|
|
2
|
+
clipped: false,
|
|
3
|
+
dataId: 'label',
|
|
4
|
+
palette: 'default',
|
|
5
|
+
size: 'medium',
|
|
6
|
+
text: 'Label',
|
|
7
|
+
type: 'title',
|
|
8
|
+
variant: 'default',
|
|
9
|
+
customClass: '',
|
|
10
|
+
dataSelectorId: 'label'
|
|
11
11
|
};
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
export
|
|
2
|
+
export const propTypes = {
|
|
3
|
+
clipped: PropTypes.bool,
|
|
4
|
+
dataId: PropTypes.string,
|
|
5
|
+
dataSelectorId: PropTypes.string,
|
|
3
6
|
htmlFor: PropTypes.string,
|
|
4
|
-
text: PropTypes.string,
|
|
5
7
|
onClick: PropTypes.func,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
container: PropTypes.object,
|
|
16
|
-
label: PropTypes.object
|
|
8
|
+
palette: PropTypes.oneOf(['default', 'primary', 'secondary', 'danger', 'mandatory', 'disable', 'dark']),
|
|
9
|
+
size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large']),
|
|
10
|
+
text: PropTypes.string,
|
|
11
|
+
title: PropTypes.string,
|
|
12
|
+
type: PropTypes.oneOf(['title', 'subtitle']),
|
|
13
|
+
variant: PropTypes.oneOf(['primary', 'default']),
|
|
14
|
+
customClass: PropTypes.string,
|
|
15
|
+
a11y: PropTypes.shape({
|
|
16
|
+
tabIndex: PropTypes.string
|
|
17
17
|
}),
|
|
18
|
-
|
|
19
|
-
testId: PropTypes.string,
|
|
20
|
-
customClass: PropTypes.object,
|
|
21
|
-
requiredType: PropTypes.oneOf(['asterisk', 'text']),
|
|
22
|
-
shouldHighlightRequired: PropTypes.bool,
|
|
23
|
-
isClipped: PropTypes.bool,
|
|
24
|
-
isRequired: PropTypes.bool,
|
|
25
|
-
isDisabled: PropTypes.bool,
|
|
26
|
-
size: PropTypes.oneOf(['small', 'medium'])
|
|
18
|
+
id: PropTypes.string
|
|
27
19
|
};
|
|
@@ -46,8 +46,6 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
46
46
|
hasTagColorInheritedToText = _ref.hasTagColorInheritedToText,
|
|
47
47
|
shouldIndicateSwitchState = _ref.shouldIndicateSwitchState,
|
|
48
48
|
shouldStrikeThroughDisabledButton = _ref.shouldStrikeThroughDisabledButton,
|
|
49
|
-
labelRequiredType = _ref.labelRequiredType,
|
|
50
|
-
shouldHighlightRequiredLabel = _ref.shouldHighlightRequiredLabel,
|
|
51
49
|
children = _ref.children;
|
|
52
50
|
|
|
53
51
|
var _useState = (0, _react.useState)({
|
|
@@ -56,9 +54,7 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
56
54
|
coloredTagVariant: coloredTagVariant,
|
|
57
55
|
hasTagColorInheritedToText: hasTagColorInheritedToText,
|
|
58
56
|
shouldIndicateSwitchState: shouldIndicateSwitchState,
|
|
59
|
-
shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton
|
|
60
|
-
labelRequiredType: labelRequiredType,
|
|
61
|
-
shouldHighlightRequiredLabel: shouldHighlightRequiredLabel
|
|
57
|
+
shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton
|
|
62
58
|
}),
|
|
63
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64
60
|
value = _useState2[0],
|
|
@@ -84,9 +80,7 @@ LibraryContextProvider.propTypes = {
|
|
|
84
80
|
hasTagColorInheritedToText: _propTypes["default"].bool,
|
|
85
81
|
direction: _propTypes["default"].string,
|
|
86
82
|
shouldIndicateSwitchState: _propTypes["default"].bool,
|
|
87
|
-
shouldStrikeThroughDisabledButton: _propTypes["default"].bool
|
|
88
|
-
labelRequiredType: _propTypes["default"].oneOf(['asterisk', 'text']),
|
|
89
|
-
shouldHighlightRequiredLabel: _propTypes["default"].bool
|
|
83
|
+
shouldStrikeThroughDisabledButton: _propTypes["default"].bool
|
|
90
84
|
};
|
|
91
85
|
LibraryContextProvider.defaultProps = {
|
|
92
86
|
isReducedMotion: (0, _Config.getLibraryConfig)('isReducedMotion'),
|
|
@@ -94,9 +88,7 @@ LibraryContextProvider.defaultProps = {
|
|
|
94
88
|
coloredTagVariant: 'bold',
|
|
95
89
|
hasTagColorInheritedToText: true,
|
|
96
90
|
shouldIndicateSwitchState: false,
|
|
97
|
-
shouldStrikeThroughDisabledButton: false
|
|
98
|
-
labelRequiredType: 'asterisk',
|
|
99
|
-
shouldHighlightRequiredLabel: true
|
|
91
|
+
shouldStrikeThroughDisabledButton: false
|
|
100
92
|
};
|
|
101
93
|
var _default = LibraryContextProvider;
|
|
102
94
|
exports["default"] = _default;
|
package/lib/Select/Select.js
CHANGED
|
@@ -885,7 +885,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
885
885
|
_customProps$Suggesti = customProps.SuggestionsProps,
|
|
886
886
|
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
887
887
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
888
|
-
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI
|
|
888
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
|
|
889
|
+
_customProps$InputFie = customProps.InputFieldLineProps,
|
|
890
|
+
InputFieldLineProps = _customProps$InputFie === void 0 ? {} : _customProps$InputFie;
|
|
889
891
|
var inputFieldLineA11yAttributes = this.getInputFieldLineA11y({
|
|
890
892
|
setAriaId: setAriaId,
|
|
891
893
|
isReadOnly: isReadOnly,
|
|
@@ -903,17 +905,18 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
903
905
|
ref: getTargetRef,
|
|
904
906
|
"data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
|
|
905
907
|
"data-test-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId)
|
|
906
|
-
}, (0, _utils.isRenderable)(renderCustomSelectedValue) ? /*#__PURE__*/_react["default"].createElement(_InputFieldLine["default"], {
|
|
907
|
-
isActive: isPopupReady,
|
|
908
|
+
}, (0, _utils.isRenderable)(renderCustomSelectedValue) ? /*#__PURE__*/_react["default"].createElement(_InputFieldLine["default"], _extends({
|
|
908
909
|
border: needBorder ? 'bottom' : 'none',
|
|
910
|
+
hasPadding: true
|
|
911
|
+
}, InputFieldLineProps, {
|
|
912
|
+
isActive: isPopupReady,
|
|
909
913
|
size: size,
|
|
910
914
|
borderColor: borderColor,
|
|
911
915
|
isDisabled: isDisabled,
|
|
912
916
|
isReadOnly: isReadOnly,
|
|
913
917
|
onKeyDown: this.handleKeyDown,
|
|
914
|
-
hasPadding: true,
|
|
915
918
|
a11yAttributes: inputFieldLineA11yAttributes
|
|
916
|
-
}, (0, _utils.renderNode)(renderCustomSelectedValue, {
|
|
919
|
+
}), (0, _utils.renderNode)(renderCustomSelectedValue, {
|
|
917
920
|
isDisabled: isDisabled,
|
|
918
921
|
isPopupOpen: isPopupOpen,
|
|
919
922
|
isReadOnly: isReadOnly,
|
|
@@ -103,7 +103,8 @@ var Select_propTypes = {
|
|
|
103
103
|
TextBoxIconProps: _propTypes["default"].object,
|
|
104
104
|
DropdownSearchTextBoxProps: _propTypes["default"].object,
|
|
105
105
|
listItemProps: _propTypes["default"].object,
|
|
106
|
-
SuggestionsProps: _propTypes["default"].object
|
|
106
|
+
SuggestionsProps: _propTypes["default"].object,
|
|
107
|
+
InputFieldLineProps: _propTypes["default"].object
|
|
107
108
|
}),
|
|
108
109
|
isLoading: _propTypes["default"].bool,
|
|
109
110
|
dataSelectorId: _propTypes["default"].string,
|
|
@@ -176,7 +176,6 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
176
176
|
return /*#__PURE__*/_react["default"].createElement(_InputFieldLine["default"], {
|
|
177
177
|
isActive: isActive || isFocus,
|
|
178
178
|
border: needBorder ? 'bottom' : 'none',
|
|
179
|
-
size: size,
|
|
180
179
|
borderColor: borderColor,
|
|
181
180
|
hasEffect: needEffect,
|
|
182
181
|
isDisabled: isDisabled,
|
|
@@ -47,7 +47,8 @@ function InputFieldLine(props) {
|
|
|
47
47
|
dataId: dataId,
|
|
48
48
|
onClick: onClick,
|
|
49
49
|
onKeyDown: onKeyDown,
|
|
50
|
-
|
|
50
|
+
scroll: !!size ? 'vertical' : undefined,
|
|
51
|
+
className: "".concat(_InputFieldLineModule["default"].varClass, " ").concat(_InputFieldLineModule["default"].customContainer, " ").concat(!!size ? _InputFieldLineModule["default"][size] : '', " ").concat(hasPadding ? _InputFieldLineModule["default"]["padding_".concat(size)] : '', " ").concat(borderClass, " ").concat(isDisabled ? _InputFieldLineModule["default"].disabled : isReadOnly ? hasEffect ? _InputFieldLineModule["default"].effect : _InputFieldLineModule["default"].readonly : _InputFieldLineModule["default"].effect, " ").concat(border !== 'none' ? "".concat(borderColorClass, " ").concat(_InputFieldLineModule["default"].hasBorder) : '', " ").concat(isActive && !(isDisabled || isReadOnly) ? _InputFieldLineModule["default"].active : '', " ").concat(customClass)
|
|
51
52
|
}), children);
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.customContainer {
|
|
9
|
-
composes: oflowy from '../../common/common.module.css';
|
|
10
9
|
cursor: var(--local_cursor);
|
|
11
10
|
border-color: var(--local_inputFieldLine_border_color);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
.disabled
|
|
13
|
+
.disabled,
|
|
14
|
+
.readonly {
|
|
15
15
|
--local_cursor: not-allowed;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -57,28 +57,34 @@
|
|
|
57
57
|
border-style: solid;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.padding_small,
|
|
61
|
+
.padding_xmedium {
|
|
62
|
+
--local_padding: var(--zd_size3);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.padding_medium,
|
|
66
|
+
.padding_large {
|
|
67
|
+
--local_padding: var(--zd_size8);
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
.xmedium {
|
|
61
71
|
min-height: var(--zd_size30) ;
|
|
62
|
-
--local_padding: var(--zd_size3);
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
.small {
|
|
66
75
|
max-height: var(--zd_size200) ;
|
|
67
|
-
--local_padding: var(--zd_size3);
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
.medium {
|
|
71
79
|
max-height: var(--zd_size350) ;
|
|
72
|
-
--local_padding: var(--zd_size8);
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
.large {
|
|
76
83
|
max-height: var(--zd_size400) ;
|
|
77
|
-
--local_padding: var(--zd_size8);
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
.border_bottom {
|
|
81
|
-
border-width:
|
|
87
|
+
border-width: 0 0 var(--local_inputFieldLine_border_width) 0;
|
|
82
88
|
padding-bottom: var(--local_padding);
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -11,7 +11,7 @@ var _useDropboxPosCalc2 = _interopRequireDefault(require("../../../DropBox/DropB
|
|
|
11
11
|
|
|
12
12
|
var _cssJSLogic2 = _interopRequireDefault(require("../../../DropBox/DropBoxElement/css/cssJSLogic"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _positioning = require("@zohodesk/dotkit/es/react/components/Popup/utils/positioning");
|
|
15
15
|
|
|
16
16
|
var _defaultProps = require("./props/defaultProps");
|
|
17
17
|
|
|
@@ -74,13 +74,13 @@ function DropBoxElement(props) {
|
|
|
74
74
|
ariaMultiselectable = a11y.ariaMultiselectable,
|
|
75
75
|
ariaLabelledby = a11y.ariaLabelledby;
|
|
76
76
|
boxPosition = boxPosition && boxPosition != 'undefined' ? boxPosition : 'bottomCenter';
|
|
77
|
-
var boxDirection =
|
|
77
|
+
var boxDirection = _positioning.positionMapping[boxPosition].direction;
|
|
78
78
|
|
|
79
79
|
if (isAbsolute) {
|
|
80
|
-
arrowPosition = arrowPosition ? arrowPosition :
|
|
81
|
-
boxPosition =
|
|
80
|
+
arrowPosition = arrowPosition ? arrowPosition : _positioning.positionMapping[boxPosition].arrowPosition;
|
|
81
|
+
boxPosition = _positioning.positionMapping[boxPosition].positionStyle;
|
|
82
82
|
} else {
|
|
83
|
-
arrowPosition =
|
|
83
|
+
arrowPosition = _positioning.positionMapping[boxPosition].arrowPosition;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
var _useDropboxPosCalc = (0, _useDropboxPosCalc2["default"])(props),
|
package/lib/v1/Label/Label.js
CHANGED
|
@@ -3,107 +3,49 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = Label;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _defaultProps =
|
|
10
|
+
var _defaultProps = require("./props/defaultProps");
|
|
11
11
|
|
|
12
12
|
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _LabelModule = _interopRequireDefault(require("../../Label/Label.module.css"));
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _ComponentRegistry = require("@zohodesk/dotkit/es/react/ComponentRegistry");
|
|
19
|
-
|
|
20
|
-
var _Flex = _interopRequireDefault(require("@zohodesk/layout/es/Flex/Flex"));
|
|
21
|
-
|
|
22
|
-
var _Typography = _interopRequireDefault(require("../../Typography/Typography"));
|
|
23
|
-
|
|
24
|
-
var _Label_v1Module = _interopRequireDefault(require("./css/Label_v1.module.css"));
|
|
16
|
+
var _LabelColorsModule = _interopRequireDefault(require("../../Label/LabelColors.module.css"));
|
|
25
17
|
|
|
26
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
19
|
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var Label = function Label(props) {
|
|
37
|
-
var htmlFor = props.htmlFor,
|
|
20
|
+
function Label(props) {
|
|
21
|
+
var text = props.text,
|
|
22
|
+
type = props.type,
|
|
23
|
+
palette = props.palette,
|
|
24
|
+
size = props.size,
|
|
25
|
+
clipped = props.clipped,
|
|
26
|
+
htmlFor = props.htmlFor,
|
|
27
|
+
title = props.title,
|
|
38
28
|
onClick = props.onClick,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
tagAttributes = props.tagAttributes,
|
|
43
|
-
a11yAttributes = props.a11yAttributes,
|
|
44
|
-
customProps = props.customProps,
|
|
45
|
-
isRequired = props.isRequired,
|
|
46
|
-
requiredType = props.requiredType,
|
|
47
|
-
isClipped = props.isClipped,
|
|
48
|
-
renderRightPlaceholderNode = props.renderRightPlaceholderNode,
|
|
49
|
-
renderLeftPlaceholderNode = props.renderLeftPlaceholderNode,
|
|
29
|
+
dataId = props.dataId,
|
|
30
|
+
dataSelectorId = props.dataSelectorId,
|
|
31
|
+
variant = props.variant,
|
|
50
32
|
customClass = props.customClass,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'aria-hidden': 'true'
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var renderRequired = function renderRequired() {
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
74
|
-
$ui_tagName: "span",
|
|
75
|
-
$ui_className: requiredClass,
|
|
76
|
-
$a11yAttributes_text: a11yAttributes_requiredText
|
|
77
|
-
}, requiredType === 'text' ? '(Required)' : requiredType === 'asterisk' ? '*' : null);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return /*#__PURE__*/_react["default"].createElement(_Flex["default"], _extends({}, customProps_container, {
|
|
81
|
-
$tagAttributes_container: _objectSpread({
|
|
82
|
-
'data-selector-id': customId
|
|
83
|
-
}, tagAttributes_container),
|
|
84
|
-
$ui_displayMode: "inline",
|
|
85
|
-
$ui_alignItems: "center",
|
|
86
|
-
$a11yAttributes_container: a11yAttributes_container,
|
|
87
|
-
testId: testId,
|
|
88
|
-
customId: customId,
|
|
89
|
-
$ui_className: customClass_container
|
|
90
|
-
}), (0, _utils.isRenderable)(renderRightPlaceholderNode) ? (0, _utils.renderNode)(renderRightPlaceholderNode) : null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], _extends({}, customProps_label, {
|
|
91
|
-
$tagAttributes_text: _objectSpread({
|
|
92
|
-
htmlFor: htmlFor,
|
|
93
|
-
onClick: onClick
|
|
94
|
-
}, tagAttributes_label),
|
|
95
|
-
$ui_tagName: "label",
|
|
96
|
-
$ui_className: labelClass,
|
|
97
|
-
$i18n_dataTitle: text,
|
|
98
|
-
$a11yAttributes_text: a11yAttributes_label,
|
|
99
|
-
$ui_size: style[size]
|
|
100
|
-
}), text, isRequired ? !isClipped && renderRequired() : null), isRequired ? isClipped && renderRequired() : null, (0, _utils.isRenderable)(renderLeftPlaceholderNode) ? (0, _utils.renderNode)(renderLeftPlaceholderNode) : null);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var _default = (0, _ComponentRegistry.withComponentRegistrar)(Label, {
|
|
104
|
-
name: 'ZDC_v1_Label'
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
exports["default"] = _default;
|
|
108
|
-
Label.defaultProps = _defaultProps["default"];
|
|
33
|
+
id = props.id,
|
|
34
|
+
_props$a11y = props.a11y,
|
|
35
|
+
a11y = _props$a11y === void 0 ? {} : _props$a11y;
|
|
36
|
+
var tabIndex = a11y.tabIndex;
|
|
37
|
+
return /*#__PURE__*/_react["default"].createElement("label", {
|
|
38
|
+
className: "".concat(_LabelModule["default"].label, " ").concat(_LabelModule["default"][type], " ").concat(_LabelModule["default"][size], " ").concat(_LabelColorsModule["default"][palette], " ").concat(_LabelModule["default"]["font_".concat(variant)], "\n ").concat(clipped ? _LabelModule["default"].dotted : '', " ").concat(onClick ? _LabelModule["default"].pointer : _LabelModule["default"].cursor, " ").concat(customClass, " "),
|
|
39
|
+
htmlFor: htmlFor,
|
|
40
|
+
"data-title": title,
|
|
41
|
+
"data-id": dataId,
|
|
42
|
+
"data-test-id": dataId,
|
|
43
|
+
"data-selector-id": dataSelectorId,
|
|
44
|
+
onClick: onClick,
|
|
45
|
+
id: id,
|
|
46
|
+
tabIndex: tabIndex
|
|
47
|
+
}, text);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Label.defaultProps = _defaultProps.defaultProps;
|
|
109
51
|
Label.propTypes = _propTypes.propTypes;
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
exports.defaultProps = void 0;
|
|
7
|
+
var defaultProps = {
|
|
8
|
+
clipped: false,
|
|
9
|
+
dataId: 'label',
|
|
10
|
+
palette: 'default',
|
|
11
|
+
size: 'medium',
|
|
12
|
+
text: 'Label',
|
|
13
|
+
type: 'title',
|
|
14
|
+
variant: 'default',
|
|
15
|
+
customClass: '',
|
|
16
|
+
dataSelectorId: 'label'
|
|
17
17
|
};
|
|
18
|
-
exports
|
|
18
|
+
exports.defaultProps = defaultProps;
|
|
@@ -3,36 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.propTypes = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var propTypes = {
|
|
13
|
+
clipped: _propTypes["default"].bool,
|
|
14
|
+
dataId: _propTypes["default"].string,
|
|
15
|
+
dataSelectorId: _propTypes["default"].string,
|
|
13
16
|
htmlFor: _propTypes["default"].string,
|
|
14
|
-
text: _propTypes["default"].string,
|
|
15
17
|
onClick: _propTypes["default"].func,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
container: _propTypes["default"].object,
|
|
26
|
-
label: _propTypes["default"].object
|
|
18
|
+
palette: _propTypes["default"].oneOf(['default', 'primary', 'secondary', 'danger', 'mandatory', 'disable', 'dark']),
|
|
19
|
+
size: _propTypes["default"].oneOf(['xsmall', 'small', 'medium', 'large']),
|
|
20
|
+
text: _propTypes["default"].string,
|
|
21
|
+
title: _propTypes["default"].string,
|
|
22
|
+
type: _propTypes["default"].oneOf(['title', 'subtitle']),
|
|
23
|
+
variant: _propTypes["default"].oneOf(['primary', 'default']),
|
|
24
|
+
customClass: _propTypes["default"].string,
|
|
25
|
+
a11y: _propTypes["default"].shape({
|
|
26
|
+
tabIndex: _propTypes["default"].string
|
|
27
27
|
}),
|
|
28
|
-
|
|
29
|
-
testId: _propTypes["default"].string,
|
|
30
|
-
customClass: _propTypes["default"].object,
|
|
31
|
-
requiredType: _propTypes["default"].oneOf(['asterisk', 'text']),
|
|
32
|
-
shouldHighlightRequired: _propTypes["default"].bool,
|
|
33
|
-
isClipped: _propTypes["default"].bool,
|
|
34
|
-
isRequired: _propTypes["default"].bool,
|
|
35
|
-
isDisabled: _propTypes["default"].bool,
|
|
36
|
-
size: _propTypes["default"].oneOf(['small', 'medium'])
|
|
28
|
+
id: _propTypes["default"].string
|
|
37
29
|
};
|
|
38
|
-
exports
|
|
30
|
+
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-248",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
|
|
40
40
|
"coverage": "react-cli coverage",
|
|
41
41
|
"prepare": "npm run init && npm run css:build ",
|
|
42
|
-
"prepublishOnly": "node prePublish.js && npm run download_only",
|
|
42
|
+
"prepublishOnly": "node prePublish.js && npm run download_only && npm run css:review && npm run review:props ",
|
|
43
43
|
"postpublish": "node postPublish.js",
|
|
44
44
|
"report": "react-cli publish:report",
|
|
45
45
|
"test": "react-cli test",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
81
81
|
"@zohodesk/a11y": "2.3.8",
|
|
82
82
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
83
|
-
"@zohodesk/dotkit": "1.0.
|
|
83
|
+
"@zohodesk/dotkit": "1.0.6",
|
|
84
84
|
"@zohodesk/hooks": "2.0.6",
|
|
85
85
|
"@zohodesk/icons": "1.1.6",
|
|
86
86
|
"@zohodesk/layout": "3.1.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@zohodesk/utils": "1.3.16",
|
|
111
111
|
"@zohodesk/a11y": "2.3.8",
|
|
112
112
|
"@zohodesk/layout": "3.1.0",
|
|
113
|
-
"@zohodesk/dotkit": "1.0.
|
|
113
|
+
"@zohodesk/dotkit": "1.0.6",
|
|
114
114
|
"color": "4.2.3"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--label_text_color: var(--zdt_v1_label_text);
|
|
3
|
-
--label_required_color: var(--zdt_v1_label_required_text);
|
|
4
|
-
--label_disabled_color: var(--zdt_v1_label_disabled_text);
|
|
5
|
-
}
|
|
6
|
-
.label {
|
|
7
|
-
font-size: var(--zd_font_size14) ;
|
|
8
|
-
color: var(--label_text_color);
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.dotted {
|
|
13
|
-
composes: dotted from '../../../common/common.module.css';
|
|
14
|
-
max-width: 100% ;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.required {
|
|
18
|
-
color: var(--label_required_color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* .asterisk{
|
|
22
|
-
height: 16px;
|
|
23
|
-
} */
|
|
24
|
-
.asterisk:after {
|
|
25
|
-
content: "*";
|
|
26
|
-
color: var(--label_required_color);
|
|
27
|
-
}
|
|
28
|
-
[dir=ltr] .asterisk:after {
|
|
29
|
-
margin-left: var(--zd_size2) ;
|
|
30
|
-
}
|
|
31
|
-
[dir=rtl] .asterisk:after {
|
|
32
|
-
margin-right: var(--zd_size2) ;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.requiredTxt {
|
|
36
|
-
color: var(--label_required_color);
|
|
37
|
-
font-size: var(--zd_font_size14) ;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[dir=ltr] .requiredTxt {
|
|
41
|
-
margin-left: var(--zd_size5) ;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[dir=rtl] .requiredTxt {
|
|
45
|
-
margin-right: var(--zd_size5) ;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.disabled {
|
|
49
|
-
color: var(--label_disabled_color);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.medium{
|
|
53
|
-
font-size: var(--zd_font_size14) ;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.small{
|
|
57
|
-
font-size: var(--zd_font_size13) ;
|
|
58
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import compileClassNames from '@zohodesk/utils/es/compileClassNames';
|
|
2
|
-
export default function cssJSLogic(_ref) {
|
|
3
|
-
let {
|
|
4
|
-
style,
|
|
5
|
-
...props
|
|
6
|
-
} = _ref;
|
|
7
|
-
const {
|
|
8
|
-
isClipped,
|
|
9
|
-
shouldHighlightRequired,
|
|
10
|
-
isRequired,
|
|
11
|
-
isDisabled,
|
|
12
|
-
customClass
|
|
13
|
-
} = props;
|
|
14
|
-
const {
|
|
15
|
-
label: customClass_label
|
|
16
|
-
} = customClass;
|
|
17
|
-
const labelClass = compileClassNames({
|
|
18
|
-
[style.label]: true,
|
|
19
|
-
[style.dotted]: isClipped,
|
|
20
|
-
[style.required]: isRequired && shouldHighlightRequired,
|
|
21
|
-
[style.disabled]: isDisabled && !isRequired,
|
|
22
|
-
[customClass_label]: !!customClass_label
|
|
23
|
-
});
|
|
24
|
-
const requiredClass = compileClassNames({
|
|
25
|
-
[style.requiredTxt]: true
|
|
26
|
-
});
|
|
27
|
-
const asteriskClass = compileClassNames({
|
|
28
|
-
[style.asterisk]: true
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
labelClass,
|
|
32
|
-
requiredClass,
|
|
33
|
-
asteriskClass
|
|
34
|
-
};
|
|
35
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--label_text_color: var(--zdt_v1_label_text);
|
|
3
|
-
--label_required_color: var(--zdt_v1_label_required_text);
|
|
4
|
-
--label_disabled_color: var(--zdt_v1_label_disabled_text);
|
|
5
|
-
}
|
|
6
|
-
.label {
|
|
7
|
-
font-size: var(--zd_font_size14) ;
|
|
8
|
-
color: var(--label_text_color);
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.dotted {
|
|
13
|
-
composes: dotted from '../../../common/common.module.css';
|
|
14
|
-
max-width: 100% ;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.required {
|
|
18
|
-
color: var(--label_required_color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* .asterisk{
|
|
22
|
-
height: 16px;
|
|
23
|
-
} */
|
|
24
|
-
.asterisk:after {
|
|
25
|
-
content: "*";
|
|
26
|
-
color: var(--label_required_color);
|
|
27
|
-
}
|
|
28
|
-
[dir=ltr] .asterisk:after {
|
|
29
|
-
margin-left: var(--zd_size2) ;
|
|
30
|
-
}
|
|
31
|
-
[dir=rtl] .asterisk:after {
|
|
32
|
-
margin-right: var(--zd_size2) ;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.requiredTxt {
|
|
36
|
-
color: var(--label_required_color);
|
|
37
|
-
font-size: var(--zd_font_size14) ;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[dir=ltr] .requiredTxt {
|
|
41
|
-
margin-left: var(--zd_size5) ;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[dir=rtl] .requiredTxt {
|
|
45
|
-
margin-right: var(--zd_size5) ;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.disabled {
|
|
49
|
-
color: var(--label_disabled_color);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.medium{
|
|
53
|
-
font-size: var(--zd_font_size14) ;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.small{
|
|
57
|
-
font-size: var(--zd_font_size13) ;
|
|
58
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = cssJSLogic;
|
|
7
|
-
|
|
8
|
-
var _compileClassNames4 = _interopRequireDefault(require("@zohodesk/utils/es/compileClassNames"));
|
|
9
|
-
|
|
10
|
-
var _excluded = ["style"];
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
|
|
16
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
-
|
|
18
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
-
|
|
20
|
-
function cssJSLogic(_ref) {
|
|
21
|
-
var _compileClassNames;
|
|
22
|
-
|
|
23
|
-
var style = _ref.style,
|
|
24
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
var isClipped = props.isClipped,
|
|
27
|
-
shouldHighlightRequired = props.shouldHighlightRequired,
|
|
28
|
-
isRequired = props.isRequired,
|
|
29
|
-
isDisabled = props.isDisabled,
|
|
30
|
-
customClass = props.customClass;
|
|
31
|
-
var customClass_label = customClass.label;
|
|
32
|
-
var labelClass = (0, _compileClassNames4["default"])((_compileClassNames = {}, _defineProperty(_compileClassNames, style.label, true), _defineProperty(_compileClassNames, style.dotted, isClipped), _defineProperty(_compileClassNames, style.required, isRequired && shouldHighlightRequired), _defineProperty(_compileClassNames, style.disabled, isDisabled && !isRequired), _defineProperty(_compileClassNames, customClass_label, !!customClass_label), _compileClassNames));
|
|
33
|
-
var requiredClass = (0, _compileClassNames4["default"])(_defineProperty({}, style.requiredTxt, true));
|
|
34
|
-
var asteriskClass = (0, _compileClassNames4["default"])(_defineProperty({}, style.asterisk, true));
|
|
35
|
-
return {
|
|
36
|
-
labelClass: labelClass,
|
|
37
|
-
requiredClass: requiredClass,
|
|
38
|
-
asteriskClass: asteriskClass
|
|
39
|
-
};
|
|
40
|
-
}
|