@zohodesk/components 1.0.0-temp-244 → 1.0.0-temp-245
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/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +5 -0
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +5 -0
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +5 -0
- package/es/AvatarTeam/AvatarTeam.module.css +189 -189
- package/es/Buttongroup/Buttongroup.module.css +104 -104
- package/es/DropBox/css/DropBox.module.css +58 -58
- package/es/DropDown/DropDownHeading.module.css +53 -53
- package/es/DropDown/DropDownItem.module.css +94 -94
- package/es/Label/Label.module.css +57 -57
- package/es/PopOver/PopOver.module.css +8 -8
- package/es/Provider/LibraryContext.js +11 -3
- package/es/Ribbon/Ribbon.module.css +499 -499
- package/es/Switch/Switch.module.css +127 -127
- package/es/Tag/Tag.module.css +253 -253
- package/es/TextBox/TextBox.module.css +196 -196
- package/es/TextBoxIcon/TextBoxIcon.module.css +79 -79
- package/es/Tooltip/Tooltip.js +2 -2
- package/es/common/customscroll.module.css +141 -141
- package/es/v1/Label/Label.js +82 -33
- package/es/v1/Label/css/Label_v1.module.css +43 -0
- package/es/v1/Label/css/cssJSLogic.js +29 -0
- package/es/v1/Label/props/defaultProps.js +8 -10
- package/es/v1/Label/props/propTypes.js +21 -14
- package/lib/AvatarTeam/AvatarTeam.module.css +189 -189
- package/lib/Buttongroup/Buttongroup.module.css +104 -104
- package/lib/DropBox/css/DropBox.module.css +58 -58
- package/lib/DropDown/DropDownHeading.module.css +53 -53
- package/lib/DropDown/DropDownItem.module.css +94 -94
- package/lib/Label/Label.module.css +57 -57
- package/lib/PopOver/PopOver.module.css +8 -8
- package/lib/Provider/LibraryContext.js +11 -3
- package/lib/Ribbon/Ribbon.module.css +499 -499
- package/lib/Switch/Switch.module.css +127 -127
- package/lib/Tag/Tag.module.css +253 -253
- package/lib/TextBox/TextBox.module.css +196 -196
- package/lib/TextBoxIcon/TextBoxIcon.module.css +79 -79
- package/lib/Tooltip/Tooltip.js +2 -2
- package/lib/common/customscroll.module.css +141 -141
- package/lib/v1/Label/Label.js +90 -35
- package/lib/v1/Label/css/Label_v1.module.css +43 -0
- package/lib/v1/Label/css/cssJSLogic.js +31 -0
- package/lib/v1/Label/props/defaultProps.js +10 -12
- package/lib/v1/Label/props/propTypes.js +23 -16
- package/package.json +1 -1
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
.scroll {
|
|
2
|
-
/* Variable:Ignore */
|
|
3
|
-
--zd-scroll-width: 12px;
|
|
4
|
-
/* Variable:Ignore */
|
|
5
|
-
--zd-scroll-height: 12px;
|
|
6
|
-
--zd-scroll-bg: var(--zdt_customscroll_default_bg);
|
|
7
|
-
--zd-scroll-corner-bg: transparent;
|
|
8
|
-
--zd-scroll-thump: var(--zdt_customscroll_thump_bg);
|
|
9
|
-
--zd-scroll-thump-hoverbg: var(--zdt_customscroll_thump_hover_bg);
|
|
10
|
-
--zd-scroll-border: var(--zdt_customscroll_border);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.scroll[data-scroll-palette='dark'],
|
|
14
|
-
.scroll [data-scroll-palette='dark'] {
|
|
15
|
-
--zd-scroll-bg: var(--zdt_customscroll_dark_bg);
|
|
16
|
-
--zd-scroll-thump: var(--zdt_customscroll_thump_dark_bg);
|
|
17
|
-
--zd-scroll-thump-hoverbg: var(--zdt_customscroll_thump_dark_hover_bg);
|
|
18
|
-
--zd-scroll-border: var(--zdt_customscroll_dark_border);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.scroll,
|
|
22
|
-
.scroll * {
|
|
23
|
-
/* css:theme-validation:ignore */
|
|
24
|
-
scrollbar-color: var(--zd-scroll-thump) var(--zd-scroll-bg);
|
|
25
|
-
scrollbar-width: thin;
|
|
26
|
-
/* css:theme-validation:ignore */
|
|
27
|
-
-ms-scrollbar-highlight-color: var(--zd-scroll-bg);
|
|
28
|
-
/* css:theme-validation:ignore */
|
|
29
|
-
-ms-scrollbar-face-color: var(--zd-scroll-thump);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.scroll::-webkit-scrollbar,
|
|
33
|
-
.scroll ::-webkit-scrollbar {
|
|
34
|
-
/* css:theme-validation:ignore */
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.scroll::-webkit-scrollbar, .scroll ::-webkit-scrollbar {
|
|
38
|
-
background: var(--zd-scroll-corner-bg);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.scroll::-webkit-scrollbar:hover,
|
|
42
|
-
.scroll ::-webkit-scrollbar:hover {
|
|
43
|
-
/* css:theme-validation:ignore */
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.scroll::-webkit-scrollbar:hover, .scroll ::-webkit-scrollbar:hover {
|
|
47
|
-
background: var(--zd-scroll-bg);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.scroll::-webkit-scrollbar:horizontal,
|
|
51
|
-
.scroll ::-webkit-scrollbar:horizontal {
|
|
52
|
-
height: var(--zd-scroll-height);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.scroll::-webkit-scrollbar:vertical,
|
|
56
|
-
.scroll ::-webkit-scrollbar:vertical {
|
|
57
|
-
width: var(--zd-scroll-width);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.scroll::-webkit-scrollbar-button,
|
|
61
|
-
.scroll ::-webkit-scrollbar-button {
|
|
62
|
-
display: none;
|
|
63
|
-
width: 0 ;
|
|
64
|
-
height: 0 ;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[dir=ltr] .scroll::-webkit-scrollbar-track:vertical, [dir=ltr] .scroll ::-webkit-scrollbar-track:vertical {
|
|
68
|
-
border-left: 1px solid transparent;
|
|
69
|
-
border-right: 1px solid transparent;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[dir=rtl] .scroll::-webkit-scrollbar-track:vertical, [dir=rtl] .scroll ::-webkit-scrollbar-track:vertical {
|
|
73
|
-
border-right: 1px solid transparent;
|
|
74
|
-
border-left: 1px solid transparent;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.scroll::-webkit-scrollbar-track:vertical:hover,
|
|
78
|
-
.scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
79
|
-
/* css:theme-validation:ignore */
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.scroll::-webkit-scrollbar-track:vertical:hover, .scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
83
|
-
border-color: var(--zd-scroll-border);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.scroll::-webkit-scrollbar-track:horizontal, .scroll ::-webkit-scrollbar-track:horizontal {
|
|
87
|
-
border-top: 1px solid transparent;
|
|
88
|
-
border-bottom: 1px solid transparent;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.scroll::-webkit-scrollbar-track:horizontal:hover,
|
|
92
|
-
.scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
93
|
-
/* css:theme-validation:ignore */
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.scroll::-webkit-scrollbar-track:horizontal:hover, .scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
97
|
-
border-color: var(--zd-scroll-border);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.scroll::-webkit-scrollbar-track-piece, .scroll ::-webkit-scrollbar-track-piece {
|
|
101
|
-
background: inherit;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.scroll::-webkit-scrollbar-thumb,
|
|
105
|
-
.scroll ::-webkit-scrollbar-thumb {
|
|
106
|
-
/* css:theme-validation:ignore */
|
|
107
|
-
/* display: none; */
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.scroll::-webkit-scrollbar-thumb, .scroll ::-webkit-scrollbar-thumb {
|
|
111
|
-
border-radius: 10px;
|
|
112
|
-
background: var(--zd-scroll-thump);
|
|
113
|
-
background-clip: padding-box;
|
|
114
|
-
border: 3px solid transparent;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.scroll::-webkit-scrollbar-thumb:hover,
|
|
118
|
-
.scroll ::-webkit-scrollbar-thumb:hover {
|
|
119
|
-
/* css:theme-validation:ignore */
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.scroll::-webkit-scrollbar-thumb:hover, .scroll ::-webkit-scrollbar-thumb:hover {
|
|
123
|
-
background: var(--zd-scroll-thump-hoverbg);
|
|
124
|
-
background-clip: padding-box;
|
|
125
|
-
border: 3px solid transparent;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* .scroll:hover > ::-webkit-scrollbar-thumb,
|
|
129
|
-
.scroll *:hover > ::-webkit-scrollbar-thumb {
|
|
130
|
-
display: block;
|
|
131
|
-
} */
|
|
132
|
-
.scroll::-webkit-scrollbar-corner,
|
|
133
|
-
.scroll ::-webkit-scrollbar-corner {
|
|
134
|
-
/* css:theme-validation:ignore */
|
|
135
|
-
}
|
|
136
|
-
.scroll::-webkit-scrollbar-corner, .scroll ::-webkit-scrollbar-corner {
|
|
137
|
-
background: var(--zd-scroll-corner-bg);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.scroll::-webkit-resizer, .scroll ::-webkit-resizer {
|
|
141
|
-
background: inherit;
|
|
1
|
+
.scroll {
|
|
2
|
+
/* Variable:Ignore */
|
|
3
|
+
--zd-scroll-width: 12px;
|
|
4
|
+
/* Variable:Ignore */
|
|
5
|
+
--zd-scroll-height: 12px;
|
|
6
|
+
--zd-scroll-bg: var(--zdt_customscroll_default_bg);
|
|
7
|
+
--zd-scroll-corner-bg: transparent;
|
|
8
|
+
--zd-scroll-thump: var(--zdt_customscroll_thump_bg);
|
|
9
|
+
--zd-scroll-thump-hoverbg: var(--zdt_customscroll_thump_hover_bg);
|
|
10
|
+
--zd-scroll-border: var(--zdt_customscroll_border);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.scroll[data-scroll-palette='dark'],
|
|
14
|
+
.scroll [data-scroll-palette='dark'] {
|
|
15
|
+
--zd-scroll-bg: var(--zdt_customscroll_dark_bg);
|
|
16
|
+
--zd-scroll-thump: var(--zdt_customscroll_thump_dark_bg);
|
|
17
|
+
--zd-scroll-thump-hoverbg: var(--zdt_customscroll_thump_dark_hover_bg);
|
|
18
|
+
--zd-scroll-border: var(--zdt_customscroll_dark_border);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.scroll,
|
|
22
|
+
.scroll * {
|
|
23
|
+
/* css:theme-validation:ignore */
|
|
24
|
+
scrollbar-color: var(--zd-scroll-thump) var(--zd-scroll-bg);
|
|
25
|
+
scrollbar-width: thin;
|
|
26
|
+
/* css:theme-validation:ignore */
|
|
27
|
+
-ms-scrollbar-highlight-color: var(--zd-scroll-bg);
|
|
28
|
+
/* css:theme-validation:ignore */
|
|
29
|
+
-ms-scrollbar-face-color: var(--zd-scroll-thump);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.scroll::-webkit-scrollbar,
|
|
33
|
+
.scroll ::-webkit-scrollbar {
|
|
34
|
+
/* css:theme-validation:ignore */
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.scroll::-webkit-scrollbar, .scroll ::-webkit-scrollbar {
|
|
38
|
+
background: var(--zd-scroll-corner-bg);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.scroll::-webkit-scrollbar:hover,
|
|
42
|
+
.scroll ::-webkit-scrollbar:hover {
|
|
43
|
+
/* css:theme-validation:ignore */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.scroll::-webkit-scrollbar:hover, .scroll ::-webkit-scrollbar:hover {
|
|
47
|
+
background: var(--zd-scroll-bg);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.scroll::-webkit-scrollbar:horizontal,
|
|
51
|
+
.scroll ::-webkit-scrollbar:horizontal {
|
|
52
|
+
height: var(--zd-scroll-height);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.scroll::-webkit-scrollbar:vertical,
|
|
56
|
+
.scroll ::-webkit-scrollbar:vertical {
|
|
57
|
+
width: var(--zd-scroll-width);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.scroll::-webkit-scrollbar-button,
|
|
61
|
+
.scroll ::-webkit-scrollbar-button {
|
|
62
|
+
display: none;
|
|
63
|
+
width: 0 ;
|
|
64
|
+
height: 0 ;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[dir=ltr] .scroll::-webkit-scrollbar-track:vertical, [dir=ltr] .scroll ::-webkit-scrollbar-track:vertical {
|
|
68
|
+
border-left: 1px solid transparent;
|
|
69
|
+
border-right: 1px solid transparent;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[dir=rtl] .scroll::-webkit-scrollbar-track:vertical, [dir=rtl] .scroll ::-webkit-scrollbar-track:vertical {
|
|
73
|
+
border-right: 1px solid transparent;
|
|
74
|
+
border-left: 1px solid transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.scroll::-webkit-scrollbar-track:vertical:hover,
|
|
78
|
+
.scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
79
|
+
/* css:theme-validation:ignore */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.scroll::-webkit-scrollbar-track:vertical:hover, .scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
83
|
+
border-color: var(--zd-scroll-border);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.scroll::-webkit-scrollbar-track:horizontal, .scroll ::-webkit-scrollbar-track:horizontal {
|
|
87
|
+
border-top: 1px solid transparent;
|
|
88
|
+
border-bottom: 1px solid transparent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.scroll::-webkit-scrollbar-track:horizontal:hover,
|
|
92
|
+
.scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
93
|
+
/* css:theme-validation:ignore */
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.scroll::-webkit-scrollbar-track:horizontal:hover, .scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
97
|
+
border-color: var(--zd-scroll-border);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.scroll::-webkit-scrollbar-track-piece, .scroll ::-webkit-scrollbar-track-piece {
|
|
101
|
+
background: inherit;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.scroll::-webkit-scrollbar-thumb,
|
|
105
|
+
.scroll ::-webkit-scrollbar-thumb {
|
|
106
|
+
/* css:theme-validation:ignore */
|
|
107
|
+
/* display: none; */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.scroll::-webkit-scrollbar-thumb, .scroll ::-webkit-scrollbar-thumb {
|
|
111
|
+
border-radius: 10px;
|
|
112
|
+
background: var(--zd-scroll-thump);
|
|
113
|
+
background-clip: padding-box;
|
|
114
|
+
border: 3px solid transparent;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.scroll::-webkit-scrollbar-thumb:hover,
|
|
118
|
+
.scroll ::-webkit-scrollbar-thumb:hover {
|
|
119
|
+
/* css:theme-validation:ignore */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.scroll::-webkit-scrollbar-thumb:hover, .scroll ::-webkit-scrollbar-thumb:hover {
|
|
123
|
+
background: var(--zd-scroll-thump-hoverbg);
|
|
124
|
+
background-clip: padding-box;
|
|
125
|
+
border: 3px solid transparent;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* .scroll:hover > ::-webkit-scrollbar-thumb,
|
|
129
|
+
.scroll *:hover > ::-webkit-scrollbar-thumb {
|
|
130
|
+
display: block;
|
|
131
|
+
} */
|
|
132
|
+
.scroll::-webkit-scrollbar-corner,
|
|
133
|
+
.scroll ::-webkit-scrollbar-corner {
|
|
134
|
+
/* css:theme-validation:ignore */
|
|
135
|
+
}
|
|
136
|
+
.scroll::-webkit-scrollbar-corner, .scroll ::-webkit-scrollbar-corner {
|
|
137
|
+
background: var(--zd-scroll-corner-bg);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.scroll::-webkit-resizer, .scroll ::-webkit-resizer {
|
|
141
|
+
background: inherit;
|
|
142
142
|
}
|
package/es/v1/Label/Label.js
CHANGED
|
@@ -1,40 +1,89 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React, { useContext, useEffect, useState } from 'react'; // props
|
|
2
|
+
|
|
3
|
+
import defaultProps from "./props/defaultProps";
|
|
4
|
+
import { propTypes } from "./props/propTypes"; // methods
|
|
5
|
+
|
|
6
|
+
import cssJSLogic from "./css/cssJSLogic";
|
|
7
|
+
import { mergeStyle } from '@zohodesk/utils'; // component registry
|
|
8
|
+
|
|
9
|
+
import { withComponentRegistrar } from '@zohodesk/dotkit/es/react/ComponentRegistry'; // components
|
|
10
|
+
|
|
11
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
12
|
+
import Typography from "../../Typography/Typography"; // css
|
|
13
|
+
|
|
14
|
+
import defaultStyle from "./css/Label_v1.module.css";
|
|
15
|
+
|
|
16
|
+
const Label = props => {
|
|
7
17
|
const {
|
|
8
|
-
text,
|
|
9
|
-
type,
|
|
10
|
-
palette,
|
|
11
|
-
size,
|
|
12
|
-
clipped,
|
|
13
18
|
htmlFor,
|
|
14
|
-
title,
|
|
15
19
|
onClick,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
text,
|
|
21
|
+
customId,
|
|
22
|
+
testId,
|
|
23
|
+
customStyle,
|
|
24
|
+
tagAttributes,
|
|
25
|
+
a11yAttributes,
|
|
26
|
+
customProps,
|
|
27
|
+
isRequired,
|
|
28
|
+
isDisabled,
|
|
29
|
+
requiredType,
|
|
30
|
+
shouldHighlightRequired
|
|
22
31
|
} = props;
|
|
23
32
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
container: tagAttributes_container,
|
|
34
|
+
label: tagAttributes_label
|
|
35
|
+
} = tagAttributes;
|
|
36
|
+
const {
|
|
37
|
+
container: a11yAttributes_container,
|
|
38
|
+
label: a11yAttributes_label
|
|
39
|
+
} = a11yAttributes;
|
|
40
|
+
const {
|
|
41
|
+
container: customProps_container,
|
|
42
|
+
label: customProps_label
|
|
43
|
+
} = customProps;
|
|
44
|
+
const style = mergeStyle(defaultStyle, customStyle);
|
|
45
|
+
const {
|
|
46
|
+
labelClass,
|
|
47
|
+
requiredClass
|
|
48
|
+
} = cssJSLogic({
|
|
49
|
+
props: { ...props,
|
|
50
|
+
requiredType,
|
|
51
|
+
shouldHighlightRequired,
|
|
52
|
+
isRequired,
|
|
53
|
+
isDisabled
|
|
54
|
+
},
|
|
55
|
+
style
|
|
56
|
+
});
|
|
57
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
58
|
+
$ui_displayMode: "inline",
|
|
59
|
+
$ui_alignItems: "center",
|
|
60
|
+
$tagAttributes_container: {
|
|
61
|
+
'data-selector-id': customId,
|
|
62
|
+
...tagAttributes_container
|
|
63
|
+
},
|
|
64
|
+
$a11yAttributes_container: a11yAttributes_container,
|
|
65
|
+
testId: testId,
|
|
66
|
+
customId: customId,
|
|
67
|
+
...customProps_container
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
69
|
+
$ui_tagName: "label",
|
|
70
|
+
$ui_className: labelClass,
|
|
71
|
+
$i18n_dataTitle: text,
|
|
72
|
+
$tagAttributes_text: {
|
|
73
|
+
htmlFor: htmlFor,
|
|
74
|
+
onClick: onClick,
|
|
75
|
+
...tagAttributes_label
|
|
76
|
+
},
|
|
77
|
+
$a11yAttributes_text: a11yAttributes_label,
|
|
78
|
+
...customProps_label
|
|
79
|
+
}, text), isRequired && requiredType === 'text' ? /*#__PURE__*/React.createElement(Typography, {
|
|
80
|
+
$ui_tagName: "span",
|
|
81
|
+
$ui_className: requiredClass
|
|
82
|
+
}, "(Required)") : '');
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default withComponentRegistrar(Label, {
|
|
86
|
+
name: 'ZDC_v1_Label'
|
|
87
|
+
});
|
|
39
88
|
Label.defaultProps = defaultProps;
|
|
40
89
|
Label.propTypes = propTypes;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.label {
|
|
2
|
+
font-size: var(--zd_font_size14) ;
|
|
3
|
+
color: var(--zdt_v1_label_text);
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dotted {
|
|
8
|
+
composes: dotted from '../../../common/common.module.css';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.required {
|
|
12
|
+
color: var(--zdt_v1_label_mandatory_text);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.asterisk:after {
|
|
16
|
+
content: "*";
|
|
17
|
+
color: var(--zdt_v1_label_mandatory_text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[dir=ltr] .asterisk:after {
|
|
21
|
+
padding-left: var(--zd_size2) ;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[dir=rtl] .asterisk:after {
|
|
25
|
+
padding-right: var(--zd_size2) ;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.requiredTxt {
|
|
29
|
+
color: var(--zdt_v1_label_mandatory_text);
|
|
30
|
+
font-size: var(--zd_font_size14) ;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[dir=ltr] .requiredTxt {
|
|
34
|
+
margin-left: var(--zd_size5) ;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[dir=rtl] .requiredTxt {
|
|
38
|
+
margin-right: var(--zd_size5) ;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.disabled {
|
|
42
|
+
color: var(--zdt_v1_label_disabled_text);
|
|
43
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import compileClassNames from '@zohodesk/utils/es/compileClassNames';
|
|
2
|
+
export default function cssJSLogic(_ref) {
|
|
3
|
+
let {
|
|
4
|
+
props,
|
|
5
|
+
style
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
isClipped,
|
|
9
|
+
requiredType,
|
|
10
|
+
shouldHighlightRequired,
|
|
11
|
+
isRequired,
|
|
12
|
+
isDisabled
|
|
13
|
+
} = props; // const shouldHighlightMandatory = localStorage?.getItem('mandatoryAppearance') === 'true';
|
|
14
|
+
|
|
15
|
+
let labelClass = compileClassNames({
|
|
16
|
+
[style.label]: true,
|
|
17
|
+
[style.dotted]: isClipped,
|
|
18
|
+
[style.asterisk]: isRequired && requiredType === 'asterisk',
|
|
19
|
+
[style.required]: isRequired && shouldHighlightRequired,
|
|
20
|
+
[style.disabled]: isDisabled
|
|
21
|
+
});
|
|
22
|
+
let requiredClass = compileClassNames({
|
|
23
|
+
[style.requiredTxt]: true
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
labelClass,
|
|
27
|
+
requiredClass
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
customClass: '',
|
|
10
|
-
dataSelectorId: 'label'
|
|
1
|
+
export default {
|
|
2
|
+
customProps: {},
|
|
3
|
+
tagAttributes: {},
|
|
4
|
+
a11yAttributes: {},
|
|
5
|
+
customStyle: {},
|
|
6
|
+
shouldHighlightRequired: false,
|
|
7
|
+
isDisabled: false,
|
|
8
|
+
isClipped: true
|
|
11
9
|
};
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
export
|
|
3
|
-
clipped: PropTypes.bool,
|
|
4
|
-
dataId: PropTypes.string,
|
|
5
|
-
dataSelectorId: PropTypes.string,
|
|
2
|
+
export default {
|
|
6
3
|
htmlFor: PropTypes.string,
|
|
7
|
-
onClick: PropTypes.func,
|
|
8
|
-
palette: PropTypes.oneOf(['default', 'primary', 'secondary', 'danger', 'mandatory', 'disable', 'dark']),
|
|
9
|
-
size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large']),
|
|
10
4
|
text: PropTypes.string,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
onClick: PropTypes.func,
|
|
6
|
+
a11yAttributes: PropTypes.shape({
|
|
7
|
+
container: PropTypes.object,
|
|
8
|
+
label: PropTypes.object
|
|
9
|
+
}),
|
|
10
|
+
tagAttributes: PropTypes.shape({
|
|
11
|
+
container: PropTypes.object,
|
|
12
|
+
label: PropTypes.object
|
|
13
|
+
}),
|
|
14
|
+
customProps: PropTypes.shape({
|
|
15
|
+
container: PropTypes.object,
|
|
16
|
+
label: PropTypes.object
|
|
17
17
|
}),
|
|
18
|
-
|
|
18
|
+
customId: PropTypes.string,
|
|
19
|
+
testId: PropTypes.string,
|
|
20
|
+
customStyle: PropTypes.object,
|
|
21
|
+
requiredType: PropTypes.oneOf(['asterisk', 'text']),
|
|
22
|
+
shouldHighlightRequired: PropTypes.bool,
|
|
23
|
+
isClipped: PropTypes.bool,
|
|
24
|
+
isRequired: PropTypes.bool,
|
|
25
|
+
isDisabled: PropTypes.bool
|
|
19
26
|
};
|