@zohodesk/components 1.6.27 → 1.6.29
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/CHANGELOG.md +12 -0
- package/es/Avatar/Avatar.module.css +5 -11
- package/es/AvatarTeam/AvatarTeam.module.css +1 -3
- package/es/Button/css/Button.module.css +7 -9
- package/es/Card/Card.module.css +2 -2
- package/es/CheckBox/CheckBox.module.css +2 -4
- package/es/DateTime/DateTime.module.css +13 -20
- package/es/DateTime/DateWidget.module.css +7 -5
- package/es/DateTime/YearView.module.css +6 -9
- package/es/DividerLine/DividerLine.js +40 -0
- package/es/DividerLine/__tests__/DividerLine.spec.js +81 -0
- package/es/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/es/DividerLine/constants/index.js +29 -0
- package/es/DividerLine/css/DividerLine.module.css +52 -0
- package/es/DividerLine/css/cssJSLogic.js +1 -0
- package/es/DividerLine/css/dividerLine.cva.js +42 -0
- package/es/DividerLine/props/defaultProps.js +11 -0
- package/es/DividerLine/props/propTypes.js +19 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -7
- package/es/DropBox/css/DropBox.module.css +3 -3
- package/es/DropDown/DropDownHeading.module.css +1 -1
- package/es/DropDown/DropDownItem.module.css +3 -7
- package/es/DropDown/DropDownSeparator.js +9 -4
- package/es/DropDown/DropDownSeparator.module.css +0 -4
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/es/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/es/Label/Label.module.css +3 -3
- package/es/ListItem/ListItem.module.css +9 -12
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +1 -1
- package/es/MultiSelect/MultiSelect.module.css +13 -20
- package/es/MultiSelect/SelectedOptions.js +3 -3
- package/es/MultiSelect/SelectedOptions.module.css +1 -1
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/es/PopOver/PopOver.module.css +2 -2
- package/es/Radio/Radio.module.css +7 -7
- package/es/Ribbon/Ribbon.module.css +12 -19
- package/es/RippleEffect/RippleEffect.module.css +2 -2
- package/es/Select/Select.module.css +4 -4
- package/es/Select/SelectWithAvatar.js +14 -3
- package/es/Select/SelectWithIcon.js +23 -1
- package/es/Select/__tests__/SelectWithAvatar.spec.js +17 -0
- package/es/Select/__tests__/SelectWithIcon.spec.js +18 -0
- package/es/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/es/Select/props/propTypes.js +1 -0
- package/es/Switch/Switch.module.css +4 -7
- package/es/Tab/Tab.module.css +5 -7
- package/es/Tab/TabContent.module.css +1 -1
- package/es/Tab/Tabs.module.css +8 -9
- package/es/Tag/Tag.module.css +4 -7
- package/es/TextBoxIcon/TextBoxIcon.module.css +1 -1
- package/es/Textarea/Textarea.module.css +3 -4
- package/es/Tooltip/Tooltip.js +4 -1
- package/es/Tooltip/Tooltip.module.css +2 -5
- package/es/Typography/css/Typography.module.css +24 -32
- package/es/common/animation.module.css +8 -8
- package/es/common/common.module.css +79 -147
- package/es/semantic/Button/semanticButton.module.css +1 -4
- package/es/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/es/v1/Button/css/Button_v1.module.css +2 -2
- package/es/v1/Label/css/Label_v1.module.css +1 -1
- package/es/v1/Switch/css/Switch_v1.module.css +4 -7
- package/es/v1/shared/Spinner/Spinner_v1.module.css +3 -5
- package/es/v1/shared/SuccessTick/SuccessTick_v1.module.css +1 -2
- package/lib/Avatar/Avatar.module.css +5 -11
- package/lib/AvatarTeam/AvatarTeam.module.css +1 -3
- package/lib/Button/css/Button.module.css +7 -9
- package/lib/Card/Card.module.css +2 -2
- package/lib/CheckBox/CheckBox.module.css +2 -4
- package/lib/DateTime/DateTime.module.css +13 -20
- package/lib/DateTime/DateWidget.module.css +7 -5
- package/lib/DateTime/YearView.module.css +6 -9
- package/lib/DividerLine/DividerLine.js +50 -0
- package/lib/DividerLine/__tests__/DividerLine.spec.js +88 -0
- package/lib/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/lib/DividerLine/constants/index.js +39 -0
- package/lib/DividerLine/css/DividerLine.module.css +52 -0
- package/lib/DividerLine/css/cssJSLogic.js +13 -0
- package/lib/DividerLine/css/dividerLine.cva.js +57 -0
- package/lib/DividerLine/props/defaultProps.js +21 -0
- package/lib/DividerLine/props/propTypes.js +31 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -7
- package/lib/DropBox/css/DropBox.module.css +3 -3
- package/lib/DropDown/DropDownHeading.module.css +1 -1
- package/lib/DropDown/DropDownItem.module.css +3 -7
- package/lib/DropDown/DropDownSeparator.js +9 -4
- package/lib/DropDown/DropDownSeparator.module.css +0 -4
- package/lib/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/lib/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/lib/Label/Label.module.css +3 -3
- package/lib/ListItem/ListItem.module.css +9 -12
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/lib/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +1 -1
- package/lib/MultiSelect/MultiSelect.module.css +13 -20
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/SelectedOptions.module.css +1 -1
- package/lib/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/lib/PopOver/PopOver.module.css +2 -2
- package/lib/Radio/Radio.module.css +7 -7
- package/lib/Ribbon/Ribbon.module.css +12 -19
- package/lib/RippleEffect/RippleEffect.module.css +2 -2
- package/lib/Select/Select.module.css +4 -4
- package/lib/Select/SelectWithAvatar.js +15 -3
- package/lib/Select/SelectWithIcon.js +26 -1
- package/lib/Select/__tests__/SelectWithAvatar.spec.js +20 -0
- package/lib/Select/__tests__/SelectWithIcon.spec.js +21 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/lib/Select/props/propTypes.js +1 -0
- package/lib/Switch/Switch.module.css +4 -7
- package/lib/Tab/Tab.module.css +5 -7
- package/lib/Tab/TabContent.module.css +1 -1
- package/lib/Tab/Tabs.module.css +8 -9
- package/lib/Tag/Tag.module.css +4 -7
- package/lib/TextBoxIcon/TextBoxIcon.module.css +1 -1
- package/lib/Textarea/Textarea.module.css +3 -4
- package/lib/Tooltip/Tooltip.js +6 -1
- package/lib/Tooltip/Tooltip.module.css +2 -5
- package/lib/Typography/css/Typography.module.css +24 -32
- package/lib/common/animation.module.css +8 -8
- package/lib/common/common.module.css +79 -147
- package/lib/semantic/Button/semanticButton.module.css +1 -4
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/lib/v1/Button/css/Button_v1.module.css +2 -2
- package/lib/v1/Label/css/Label_v1.module.css +1 -1
- package/lib/v1/Switch/css/Switch_v1.module.css +4 -7
- package/lib/v1/shared/Spinner/Spinner_v1.module.css +3 -5
- package/lib/v1/shared/SuccessTick/SuccessTick_v1.module.css +1 -2
- package/package.json +10 -10
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.container {
|
|
47
47
|
composes: native;
|
|
48
48
|
composes: dotted from '../../common/common.module.css';
|
|
49
|
-
|
|
49
|
+
composes: d-relative from global;
|
|
50
50
|
font-size: var(--button_font_size);
|
|
51
51
|
color: var(--button_text_color);
|
|
52
52
|
font-weight: var(--button_font_weight);
|
|
@@ -94,17 +94,17 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.mediumBtn {
|
|
97
|
+
composes: d-text-center from global;
|
|
97
98
|
--button_height: var(--zd_size42);
|
|
98
99
|
--button_min_width: var(--zd_size42);
|
|
99
100
|
--button_font_size: var(--zd_font_size10);
|
|
100
|
-
text-align: center;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.smallBtn {
|
|
104
|
+
composes: d-text-center from global;
|
|
104
105
|
--button_height: var(--zd_size22);
|
|
105
106
|
--button_min_width: var(--zd_size22);
|
|
106
107
|
--button_font_size: var(--zd_font_size13);
|
|
107
|
-
text-align: center;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.smallBtnprimary,
|
|
@@ -272,10 +272,10 @@
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
.overlay {
|
|
275
|
-
|
|
275
|
+
composes: d-absolute from global;
|
|
276
276
|
top: 0 ;
|
|
277
277
|
bottom: 0 ;
|
|
278
|
-
background: inherit;
|
|
278
|
+
background-color: inherit;
|
|
279
279
|
border-radius: inherit;
|
|
280
280
|
}
|
|
281
281
|
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
.loading {
|
|
293
|
-
|
|
293
|
+
composes: d-absolute from global;
|
|
294
294
|
top: 50% ;
|
|
295
295
|
width: var(--zd_size20) ;
|
|
296
296
|
height: var(--zd_size20) ;
|
|
@@ -311,12 +311,10 @@
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
.loadingelement {
|
|
314
|
+
composes: d-inline-block d-relative d-origin-center from global;
|
|
314
315
|
height: inherit ;
|
|
315
316
|
width: inherit ;
|
|
316
|
-
position: relative;
|
|
317
|
-
display: inline-block;
|
|
318
317
|
border-radius: 50%;
|
|
319
|
-
transform-origin: 50%;
|
|
320
318
|
}
|
|
321
319
|
|
|
322
320
|
[dir=ltr] .loadingelement {
|
package/lib/Card/Card.module.css
CHANGED
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
--checkbox_cursor: default;
|
|
24
24
|
}
|
|
25
25
|
.cbBox {
|
|
26
|
-
|
|
26
|
+
composes: d-fill-none d-stroke-inherit from global;
|
|
27
27
|
stroke-width: var(--checkbox_stroke_width);
|
|
28
28
|
stroke-linecap: round;
|
|
29
|
-
stroke: inherit;
|
|
30
29
|
}
|
|
31
30
|
.tickPath {
|
|
32
31
|
composes: cbBox;
|
|
@@ -50,9 +49,8 @@
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.checkbox {
|
|
53
|
-
|
|
52
|
+
composes: d-block d-relative from global;
|
|
54
53
|
font-size: 0 ;
|
|
55
|
-
display: block;
|
|
56
54
|
}
|
|
57
55
|
.tick {
|
|
58
56
|
position: absolute;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.header {
|
|
17
17
|
min-height: var(--zd_size36) ;
|
|
18
18
|
composes: boxPadding;
|
|
19
|
-
text-
|
|
19
|
+
composes: d-text-center from global;
|
|
20
20
|
background-color: var(--zdt_datetime_header_bg);
|
|
21
21
|
border-radius: 0 0 2px 2px;
|
|
22
22
|
border-bottom: 1px solid var(--zdt_datetime_header_border);
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.grid {
|
|
30
|
+
composes: d-text-center from global;
|
|
30
31
|
width: var(--zd_size28) ;
|
|
31
32
|
height: var(--zd_size28) ;
|
|
32
33
|
line-height: 1.3846;
|
|
33
|
-
text-align: center;
|
|
34
34
|
padding: var(--zd_size4) 0 ;
|
|
35
35
|
border-radius: 50%;
|
|
36
36
|
border: 1px solid transparent;
|
|
@@ -38,21 +38,18 @@
|
|
|
38
38
|
|
|
39
39
|
.thArrow,
|
|
40
40
|
.datesStr {
|
|
41
|
+
composes: d-cursor-pointer from global;
|
|
41
42
|
font-size: var(--zd_font_size13) ;
|
|
42
43
|
color: var(--zdt_datetime_datestr_text);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
.thArrow, .datesStr {
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
46
|
.thArrow:hover,
|
|
50
47
|
.datesStr:hover {
|
|
51
48
|
color: var(--zdt_datetime_datestr_text);
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
.thArrow:hover, .datesStr:hover {
|
|
55
|
-
background: var(--zdt_datetime_datestr_hover_bg);
|
|
52
|
+
background-color: var(--zdt_datetime_datestr_hover_bg);
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.navigation {
|
|
@@ -89,8 +86,8 @@
|
|
|
89
86
|
composes: dotted from '../common/common.module.css';
|
|
90
87
|
font-size: var(--zd_font_size10) ;
|
|
91
88
|
color: var(--zdt_datetime_daystr_text);
|
|
92
|
-
text-transform: uppercase;
|
|
93
89
|
composes: semibold;
|
|
90
|
+
composes: d-uppercase from global;
|
|
94
91
|
width: var(--zd_size31) ;
|
|
95
92
|
}
|
|
96
93
|
|
|
@@ -143,8 +140,8 @@
|
|
|
143
140
|
}
|
|
144
141
|
|
|
145
142
|
.inActiveDate {
|
|
143
|
+
composes: d-cursor-no-drop from global;
|
|
146
144
|
color: var(--zdt_datetime_invalid_text);
|
|
147
|
-
cursor: no-drop;
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
.inActiveDate:hover {
|
|
@@ -167,11 +164,10 @@
|
|
|
167
164
|
}
|
|
168
165
|
|
|
169
166
|
.dropDown {
|
|
167
|
+
composes: d-inline-block d-relative from global;
|
|
170
168
|
width: var(--zd_size60) ;
|
|
171
|
-
display: inline-block;
|
|
172
169
|
margin-inline: var(--zd_size4) ;
|
|
173
170
|
margin-block:0 ;
|
|
174
|
-
position: relative;
|
|
175
171
|
}
|
|
176
172
|
|
|
177
173
|
.footer {
|
|
@@ -185,7 +181,7 @@
|
|
|
185
181
|
}
|
|
186
182
|
|
|
187
183
|
.space {
|
|
188
|
-
|
|
184
|
+
composes: d-inline-block from global;
|
|
189
185
|
width: var(--zd_size15) ;
|
|
190
186
|
}
|
|
191
187
|
|
|
@@ -195,7 +191,7 @@
|
|
|
195
191
|
}
|
|
196
192
|
|
|
197
193
|
.dateText {
|
|
198
|
-
|
|
194
|
+
composes: d-cursor-pointer from global;
|
|
199
195
|
}
|
|
200
196
|
|
|
201
197
|
.dateText:hover .downArrow {
|
|
@@ -205,18 +201,15 @@
|
|
|
205
201
|
.text {
|
|
206
202
|
composes: boxPadding;
|
|
207
203
|
font-size: var(--zd_font_size11) ;
|
|
208
|
-
text-transform: uppercase;
|
|
209
204
|
color: var(--zdt_datetime_text);
|
|
210
205
|
margin-block-start: var(--zd_size14) ;
|
|
211
206
|
composes: semibold;
|
|
212
|
-
|
|
207
|
+
composes: d-block d-uppercase from global;
|
|
213
208
|
}
|
|
214
209
|
|
|
215
210
|
.yearContainer {
|
|
216
|
-
|
|
211
|
+
composes: d-absolute d-size-full from global;
|
|
217
212
|
top: 0 ;
|
|
218
|
-
width: 100% ;
|
|
219
|
-
height: 100% ;
|
|
220
213
|
}
|
|
221
214
|
|
|
222
215
|
[dir=ltr] .yearContainer {
|
|
@@ -228,11 +221,11 @@
|
|
|
228
221
|
}
|
|
229
222
|
|
|
230
223
|
.subContainer {
|
|
231
|
-
|
|
224
|
+
composes: d-relative from global;
|
|
232
225
|
}
|
|
233
226
|
|
|
234
227
|
.dropBox {
|
|
235
|
-
|
|
228
|
+
composes: d-w-full from global;
|
|
236
229
|
border-radius: 3px;
|
|
237
230
|
box-shadow: var(--zd_bs_dropbox_bottom);
|
|
238
231
|
background-color: var(--zdt_dropbox_default_bg);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/* $Id */
|
|
2
2
|
.container {
|
|
3
|
-
position: relative;
|
|
4
3
|
composes: offSelection from '../common/common.module.css';
|
|
4
|
+
composes: d-relative from global;
|
|
5
|
+
}
|
|
6
|
+
.datePickIcon {
|
|
7
|
+
composes: d-h-full from global;
|
|
5
8
|
}
|
|
6
|
-
.datePickIcon{height:100% }
|
|
7
9
|
.readOnly, .readOnly > input, .disabled {
|
|
8
10
|
cursor: not-allowed;
|
|
9
11
|
}
|
|
10
12
|
.enabled {
|
|
11
|
-
|
|
13
|
+
composes: d-cursor-pointer from global;
|
|
12
14
|
}
|
|
13
15
|
.textBox {
|
|
14
|
-
|
|
16
|
+
composes: d-relative from global;
|
|
15
17
|
}
|
|
16
18
|
.inputLine {
|
|
17
|
-
|
|
19
|
+
composes: d-absolute from global;
|
|
18
20
|
bottom: 0 ;
|
|
19
21
|
transition: border var(--zd_transition2) linear 0s;
|
|
20
22
|
border-bottom: 1px solid var(--zdt_datewidget_input_border);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.month {
|
|
6
|
+
composes: d-text-center d-cursor-pointer from global;
|
|
6
7
|
width: 30.333%;
|
|
7
8
|
margin-block:0 var(--zd_size1) ;
|
|
8
9
|
margin-inline:0 ;
|
|
@@ -10,8 +11,6 @@
|
|
|
10
11
|
line-height: 2.1667;
|
|
11
12
|
height: var(--zd_size26) ;
|
|
12
13
|
color: var(--zdt_yearview_month_text);
|
|
13
|
-
text-align: center;
|
|
14
|
-
cursor: pointer;
|
|
15
14
|
background-color: var(--zdt_yearview_month_bg);
|
|
16
15
|
border-radius: 20px;
|
|
17
16
|
}
|
|
@@ -34,9 +33,9 @@
|
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
.year {
|
|
36
|
+
composes: d-cursor-pointer from global;
|
|
37
37
|
padding-block: var(--zd_size7) ;
|
|
38
38
|
padding-inline:0 ;
|
|
39
|
-
cursor: pointer;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.year:hover .yearText,
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
.isActive {
|
|
58
|
-
|
|
57
|
+
composes: d-cursor-default from global;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
.isActive .yearText {
|
|
@@ -77,21 +76,19 @@
|
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
.container {
|
|
80
|
-
height: 100% ;
|
|
81
|
-
overflow-y: auto;
|
|
82
|
-
overflow-x: hidden;
|
|
83
79
|
composes: boxPadding;
|
|
80
|
+
composes: d-overflow-x-hidden d-overflow-y-auto d-h-full from global;
|
|
84
81
|
background-color: var(--zdt_yearview_default_bg);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
.yearContainer {
|
|
85
|
+
composes: d-overflow-hidden from global;
|
|
88
86
|
height: var(--zd_size135) ;
|
|
89
|
-
overflow: hidden;
|
|
90
87
|
transition: height var(--zd_transition1);
|
|
91
88
|
padding-block-end: var(--zd_size5) ;
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
.toggleYear {
|
|
92
|
+
composes: d-p-0 from global;
|
|
95
93
|
height: 0 ;
|
|
96
|
-
padding: 0 ;
|
|
97
94
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _cssUtility = require("@dot-system/css-utility");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
|
|
13
|
+
|
|
14
|
+
var _defaultProps = _interopRequireDefault(require("./props/defaultProps"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("./props/propTypes"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
var DividerLine = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
23
|
+
var customId = props.customId,
|
|
24
|
+
testId = props.testId,
|
|
25
|
+
orientation = props.orientation,
|
|
26
|
+
customAttributes = props.customAttributes,
|
|
27
|
+
a11yAttributes = props.a11yAttributes;
|
|
28
|
+
|
|
29
|
+
var _cssJSLogic = (0, _cssJSLogic2["default"])({
|
|
30
|
+
props: props
|
|
31
|
+
}),
|
|
32
|
+
wrapperClass = _cssJSLogic.wrapperClass;
|
|
33
|
+
|
|
34
|
+
var wrapperTagAttrs = customAttributes.wrapper;
|
|
35
|
+
var wrapperA11yAttrs = a11yAttributes.wrapper;
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement("hr", _extends({}, wrapperTagAttrs, {
|
|
37
|
+
"aria-orientation": orientation
|
|
38
|
+
}, wrapperA11yAttrs, {
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: (0, _cssUtility.cn)(wrapperClass),
|
|
41
|
+
"data-id": customId,
|
|
42
|
+
"data-test-id": testId
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
DividerLine.displayName = 'DividerLine';
|
|
47
|
+
DividerLine.defaultProps = _defaultProps["default"];
|
|
48
|
+
DividerLine.propTypes = _propTypes["default"];
|
|
49
|
+
var _default = DividerLine;
|
|
50
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _DividerLine = _interopRequireDefault(require("../DividerLine"));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
|
|
11
|
+
describe('DividerLine - Snapshot', function () {
|
|
12
|
+
afterEach(function () {
|
|
13
|
+
(0, _react2.cleanup)();
|
|
14
|
+
});
|
|
15
|
+
test('Render with default props', function () {
|
|
16
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], null)),
|
|
17
|
+
asFragment = _render.asFragment;
|
|
18
|
+
|
|
19
|
+
expect(asFragment()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
test.each(['horizontal', 'vertical'])('Render with orientation as %s', function (orientation) {
|
|
22
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
23
|
+
orientation: orientation
|
|
24
|
+
})),
|
|
25
|
+
asFragment = _render2.asFragment;
|
|
26
|
+
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
test.each(['solid', 'dashed', 'dotted'])('Render with lineStyle as %s', function (lineStyle) {
|
|
30
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
31
|
+
lineStyle: lineStyle
|
|
32
|
+
})),
|
|
33
|
+
asFragment = _render3.asFragment;
|
|
34
|
+
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test.each(['default', 'secondary', 'tertiary', 'brand'])('Render with color as %s', function (color) {
|
|
38
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
39
|
+
color: color
|
|
40
|
+
})),
|
|
41
|
+
asFragment = _render4.asFragment;
|
|
42
|
+
|
|
43
|
+
expect(asFragment()).toMatchSnapshot();
|
|
44
|
+
});
|
|
45
|
+
test('Render with customId and testId', function () {
|
|
46
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
47
|
+
customId: "divider-line-customId",
|
|
48
|
+
testId: "divider-line-testId"
|
|
49
|
+
})),
|
|
50
|
+
asFragment = _render5.asFragment;
|
|
51
|
+
|
|
52
|
+
expect(asFragment()).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
test('Render with customAttributes', function () {
|
|
55
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
56
|
+
customAttributes: {
|
|
57
|
+
wrapper: {
|
|
58
|
+
'data-custom-attr': 'true'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})),
|
|
62
|
+
asFragment = _render6.asFragment;
|
|
63
|
+
|
|
64
|
+
expect(asFragment()).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
test('Render with a11yAttributes', function () {
|
|
67
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
68
|
+
a11yAttributes: {
|
|
69
|
+
wrapper: {
|
|
70
|
+
'aria-label': 'Section divider'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
})),
|
|
74
|
+
asFragment = _render7.asFragment;
|
|
75
|
+
|
|
76
|
+
expect(asFragment()).toMatchSnapshot();
|
|
77
|
+
});
|
|
78
|
+
test('Render with customClass', function () {
|
|
79
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
80
|
+
customClass: {
|
|
81
|
+
wrapper: 'my-divider-line'
|
|
82
|
+
}
|
|
83
|
+
})),
|
|
84
|
+
asFragment = _render8.asFragment;
|
|
85
|
+
|
|
86
|
+
expect(asFragment()).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
+
|
|
3
|
+
exports[`DividerLine - Snapshot Render with a11yAttributes 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<hr
|
|
6
|
+
aria-label="Section divider"
|
|
7
|
+
aria-orientation="horizontal"
|
|
8
|
+
class="wrapper horizontal solid colorDefault"
|
|
9
|
+
/>
|
|
10
|
+
</DocumentFragment>
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
exports[`DividerLine - Snapshot Render with color as brand 1`] = `
|
|
14
|
+
<DocumentFragment>
|
|
15
|
+
<hr
|
|
16
|
+
aria-orientation="horizontal"
|
|
17
|
+
class="wrapper horizontal solid colorBrand"
|
|
18
|
+
/>
|
|
19
|
+
</DocumentFragment>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`DividerLine - Snapshot Render with color as default 1`] = `
|
|
23
|
+
<DocumentFragment>
|
|
24
|
+
<hr
|
|
25
|
+
aria-orientation="horizontal"
|
|
26
|
+
class="wrapper horizontal solid colorDefault"
|
|
27
|
+
/>
|
|
28
|
+
</DocumentFragment>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`DividerLine - Snapshot Render with color as secondary 1`] = `
|
|
32
|
+
<DocumentFragment>
|
|
33
|
+
<hr
|
|
34
|
+
aria-orientation="horizontal"
|
|
35
|
+
class="wrapper horizontal solid colorSecondary"
|
|
36
|
+
/>
|
|
37
|
+
</DocumentFragment>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
exports[`DividerLine - Snapshot Render with color as tertiary 1`] = `
|
|
41
|
+
<DocumentFragment>
|
|
42
|
+
<hr
|
|
43
|
+
aria-orientation="horizontal"
|
|
44
|
+
class="wrapper horizontal solid colorTertiary"
|
|
45
|
+
/>
|
|
46
|
+
</DocumentFragment>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`DividerLine - Snapshot Render with customAttributes 1`] = `
|
|
50
|
+
<DocumentFragment>
|
|
51
|
+
<hr
|
|
52
|
+
aria-orientation="horizontal"
|
|
53
|
+
class="wrapper horizontal solid colorDefault"
|
|
54
|
+
data-custom-attr="true"
|
|
55
|
+
/>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`DividerLine - Snapshot Render with customClass 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<hr
|
|
62
|
+
aria-orientation="horizontal"
|
|
63
|
+
class="wrapper horizontal solid colorDefault my-divider-line"
|
|
64
|
+
/>
|
|
65
|
+
</DocumentFragment>
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`DividerLine - Snapshot Render with customId and testId 1`] = `
|
|
69
|
+
<DocumentFragment>
|
|
70
|
+
<hr
|
|
71
|
+
aria-orientation="horizontal"
|
|
72
|
+
class="wrapper horizontal solid colorDefault"
|
|
73
|
+
data-id="divider-line-customId"
|
|
74
|
+
data-test-id="divider-line-testId"
|
|
75
|
+
/>
|
|
76
|
+
</DocumentFragment>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`DividerLine - Snapshot Render with default props 1`] = `
|
|
80
|
+
<DocumentFragment>
|
|
81
|
+
<hr
|
|
82
|
+
aria-orientation="horizontal"
|
|
83
|
+
class="wrapper horizontal solid colorDefault"
|
|
84
|
+
/>
|
|
85
|
+
</DocumentFragment>
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
exports[`DividerLine - Snapshot Render with lineStyle as dashed 1`] = `
|
|
89
|
+
<DocumentFragment>
|
|
90
|
+
<hr
|
|
91
|
+
aria-orientation="horizontal"
|
|
92
|
+
class="wrapper horizontal dashed colorDefault"
|
|
93
|
+
/>
|
|
94
|
+
</DocumentFragment>
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
exports[`DividerLine - Snapshot Render with lineStyle as dotted 1`] = `
|
|
98
|
+
<DocumentFragment>
|
|
99
|
+
<hr
|
|
100
|
+
aria-orientation="horizontal"
|
|
101
|
+
class="wrapper horizontal dotted colorDefault"
|
|
102
|
+
/>
|
|
103
|
+
</DocumentFragment>
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
exports[`DividerLine - Snapshot Render with lineStyle as solid 1`] = `
|
|
107
|
+
<DocumentFragment>
|
|
108
|
+
<hr
|
|
109
|
+
aria-orientation="horizontal"
|
|
110
|
+
class="wrapper horizontal solid colorDefault"
|
|
111
|
+
/>
|
|
112
|
+
</DocumentFragment>
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
exports[`DividerLine - Snapshot Render with orientation as horizontal 1`] = `
|
|
116
|
+
<DocumentFragment>
|
|
117
|
+
<hr
|
|
118
|
+
aria-orientation="horizontal"
|
|
119
|
+
class="wrapper horizontal solid colorDefault"
|
|
120
|
+
/>
|
|
121
|
+
</DocumentFragment>
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
exports[`DividerLine - Snapshot Render with orientation as vertical 1`] = `
|
|
125
|
+
<DocumentFragment>
|
|
126
|
+
<hr
|
|
127
|
+
aria-orientation="vertical"
|
|
128
|
+
class="wrapper vertical solid colorDefault"
|
|
129
|
+
/>
|
|
130
|
+
</DocumentFragment>
|
|
131
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ORIENTATION = exports.LINE_STYLE_CLASS_MAP = exports.LINE_STYLE = exports.DEFAULT_ORIENTATION = exports.DEFAULT_LINE_STYLE = exports.DEFAULT_COLOR = exports.COLOR_CLASS_MAP = exports.COLOR = void 0;
|
|
7
|
+
|
|
8
|
+
var _LINE_STYLE_CLASS_MAP, _COLOR_CLASS_MAP;
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
var ORIENTATION = {
|
|
13
|
+
HORIZONTAL: 'horizontal',
|
|
14
|
+
VERTICAL: 'vertical'
|
|
15
|
+
};
|
|
16
|
+
exports.ORIENTATION = ORIENTATION;
|
|
17
|
+
var LINE_STYLE = {
|
|
18
|
+
SOLID: 'solid',
|
|
19
|
+
DASHED: 'dashed',
|
|
20
|
+
DOTTED: 'dotted'
|
|
21
|
+
};
|
|
22
|
+
exports.LINE_STYLE = LINE_STYLE;
|
|
23
|
+
var LINE_STYLE_CLASS_MAP = (_LINE_STYLE_CLASS_MAP = {}, _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.SOLID, 'solid'), _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.DASHED, 'dashed'), _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.DOTTED, 'dotted'), _LINE_STYLE_CLASS_MAP);
|
|
24
|
+
exports.LINE_STYLE_CLASS_MAP = LINE_STYLE_CLASS_MAP;
|
|
25
|
+
var COLOR = {
|
|
26
|
+
DEFAULT: 'default',
|
|
27
|
+
SECONDARY: 'secondary',
|
|
28
|
+
TERTIARY: 'tertiary',
|
|
29
|
+
BRAND: 'brand'
|
|
30
|
+
};
|
|
31
|
+
exports.COLOR = COLOR;
|
|
32
|
+
var COLOR_CLASS_MAP = (_COLOR_CLASS_MAP = {}, _defineProperty(_COLOR_CLASS_MAP, COLOR.DEFAULT, 'colorDefault'), _defineProperty(_COLOR_CLASS_MAP, COLOR.SECONDARY, 'colorSecondary'), _defineProperty(_COLOR_CLASS_MAP, COLOR.TERTIARY, 'colorTertiary'), _defineProperty(_COLOR_CLASS_MAP, COLOR.BRAND, 'colorBrand'), _COLOR_CLASS_MAP);
|
|
33
|
+
exports.COLOR_CLASS_MAP = COLOR_CLASS_MAP;
|
|
34
|
+
var DEFAULT_ORIENTATION = ORIENTATION.HORIZONTAL;
|
|
35
|
+
exports.DEFAULT_ORIENTATION = DEFAULT_ORIENTATION;
|
|
36
|
+
var DEFAULT_LINE_STYLE = LINE_STYLE.SOLID;
|
|
37
|
+
exports.DEFAULT_LINE_STYLE = DEFAULT_LINE_STYLE;
|
|
38
|
+
var DEFAULT_COLOR = COLOR.DEFAULT;
|
|
39
|
+
exports.DEFAULT_COLOR = DEFAULT_COLOR;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
border: none;
|
|
4
|
+
margin: 0 ;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.horizontal {
|
|
8
|
+
inline-size: 100% ;
|
|
9
|
+
block-size: 0 ;
|
|
10
|
+
border-block-start-width: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vertical {
|
|
14
|
+
inline-size: 0 ;
|
|
15
|
+
block-size: 100% ;
|
|
16
|
+
border-inline-start-width: 1px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.solid {
|
|
20
|
+
border-block-start-style: solid;
|
|
21
|
+
border-inline-start-style: solid;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dashed {
|
|
25
|
+
border-block-start-style: dashed;
|
|
26
|
+
border-inline-start-style: dashed;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dotted {
|
|
30
|
+
border-block-start-style: dotted;
|
|
31
|
+
border-inline-start-style: dotted;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.colorDefault {
|
|
35
|
+
border-block-start-color: var(--zd-border-primary);
|
|
36
|
+
border-inline-start-color: var(--zd-border-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.colorSecondary {
|
|
40
|
+
border-block-start-color: var(--zd-border-secondary);
|
|
41
|
+
border-inline-start-color: var(--zd-border-secondary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.colorTertiary {
|
|
45
|
+
border-block-start-color: var(--zd-border-tertiary);
|
|
46
|
+
border-inline-start-color: var(--zd-border-tertiary);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.colorBrand {
|
|
50
|
+
border-block-start-color: var(--zd-border-brand);
|
|
51
|
+
border-inline-start-color: var(--zd-border-brand);
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _dividerLine.dividerLine_cva;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _dividerLine = require("./dividerLine.cva");
|