@zohodesk/components 1.0.0-alpha-265 → 1.0.0-alpha-267
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 +11 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +181 -180
- package/assets/Appearance/dark/themes/blue/blueDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +31 -31
- package/assets/Appearance/dark/themes/green/greenDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/orange/orangeDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/red/redDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/red/redDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +30 -30
- package/assets/Appearance/default/mode/defaultMode.module.css +177 -176
- package/assets/Appearance/default/themes/blue/blueDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +31 -31
- package/assets/Appearance/default/themes/green/greenDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/orange/orangeDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/red/redDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/red/redDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +182 -181
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +31 -31
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +30 -30
- package/assets/Contrast/darkContrastLightness.module.css +39 -0
- package/assets/Contrast/defaultContrastLightness.module.css +39 -0
- package/assets/Contrast/pureDarkContrastLightness.module.css +39 -0
- package/es/AppContainer/AppContainer.js +1 -0
- package/es/Avatar/Avatar.module.css +48 -13
- package/es/Button/Button.js +44 -47
- package/es/Button/{Button.module.css → css/Button.module.css} +6 -6
- package/es/Button/css/cssJSLogic.js +53 -0
- package/es/Button/index.js +2 -0
- package/es/Button/props/propTypes.js +3 -1
- package/es/Buttongroup/Buttongroup.module.css +36 -18
- package/es/DateTime/DateTime.module.css +1 -1
- package/es/DropBox/DropBox.js +2 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +5 -3
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -10
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +8 -8
- package/es/DropBox/css/DropBox.module.css +1 -1
- package/es/Ribbon/Ribbon.module.css +102 -24
- package/es/Select/Select.js +12 -2
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +2 -1
- package/es/Switch/Switch.module.css +26 -9
- package/es/Tab/Tabs.module.css +6 -2
- package/es/Tooltip/Tooltip.module.css +28 -3
- package/es/common/a11y.module.css +3 -3
- package/es/common/boxShadow.module.css +34 -0
- package/lib/AppContainer/AppContainer.js +1 -0
- package/lib/Avatar/Avatar.module.css +48 -13
- package/lib/Button/Button.js +43 -72
- package/lib/Button/{Button.module.css → css/Button.module.css} +6 -6
- package/lib/Button/css/cssJSLogic.js +40 -0
- package/lib/Button/index.js +20 -0
- package/lib/Button/props/propTypes.js +5 -2
- package/lib/Buttongroup/Buttongroup.module.css +36 -18
- package/lib/DateTime/DateTime.module.css +1 -1
- package/lib/DropBox/DropBox.js +2 -2
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -3
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -10
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +5 -5
- package/lib/DropBox/css/DropBox.module.css +1 -1
- package/lib/Ribbon/Ribbon.module.css +102 -24
- package/lib/Select/Select.js +12 -2
- package/lib/Select/props/defaultProps.js +2 -1
- package/lib/Select/props/propTypes.js +2 -1
- package/lib/Switch/Switch.module.css +26 -9
- package/lib/Tab/Tabs.module.css +6 -2
- package/lib/Tooltip/Tooltip.module.css +28 -3
- package/lib/common/a11y.module.css +3 -3
- package/lib/common/boxShadow.module.css +34 -0
- package/package.json +26 -13
- package/es/Button/__tests__/Button.spec.js +0 -190
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/lib/Button/__tests__/Button.spec.js +0 -193
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
|
@@ -43,7 +43,8 @@ var Select_defaultProps = {
|
|
|
43
43
|
i18nKeys: {},
|
|
44
44
|
iconOnHover: false,
|
|
45
45
|
customProps: {},
|
|
46
|
-
isLoading: false
|
|
46
|
+
isLoading: false,
|
|
47
|
+
isAbsolutePositioningNeeded: true
|
|
47
48
|
};
|
|
48
49
|
exports.Select_defaultProps = Select_defaultProps;
|
|
49
50
|
var GroupSelect_defaultProps = {
|
|
@@ -92,7 +92,8 @@ var Select_propTypes = {
|
|
|
92
92
|
SuggestionsProps: _propTypes["default"].object
|
|
93
93
|
}),
|
|
94
94
|
isLoading: _propTypes["default"].bool,
|
|
95
|
-
dataSelectorId: _propTypes["default"].string
|
|
95
|
+
dataSelectorId: _propTypes["default"].string,
|
|
96
|
+
isAbsolutePositioningNeeded: _propTypes["default"].bool
|
|
96
97
|
};
|
|
97
98
|
exports.Select_propTypes = Select_propTypes;
|
|
98
99
|
var GroupSelect_propTypes = {
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
/* switch default variables */
|
|
3
3
|
--switch_off_bg_color: var(--zdt_switch_default_off_bg);
|
|
4
4
|
--switch_on_bg_color: var(--zdt_switch_default_on_bg);
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
/* switch circle default variables */
|
|
7
7
|
--switch_circle_bg_color: var(--zdt_switch_circle_bg);
|
|
8
8
|
--switch_circle_border_radius: 50px;
|
|
9
|
-
--switch_cricle_box_shadow:
|
|
9
|
+
--switch_cricle_box_shadow: var(--zd_bs_switch_default);
|
|
10
10
|
}
|
|
11
|
+
|
|
11
12
|
.container {
|
|
12
13
|
composes: varClass;
|
|
13
14
|
vertical-align: middle;
|
|
14
15
|
}
|
|
16
|
+
|
|
15
17
|
.disabled {
|
|
16
18
|
composes: disabled from '../common/common.module.css';
|
|
17
19
|
}
|
|
20
|
+
|
|
18
21
|
.readonly {
|
|
19
22
|
composes: readonly from '../common/common.module.css';
|
|
20
23
|
}
|
|
24
|
+
|
|
21
25
|
.label {
|
|
22
26
|
display: inline-block;
|
|
23
27
|
position: relative;
|
|
@@ -26,9 +30,11 @@
|
|
|
26
30
|
border-radius: 20px;
|
|
27
31
|
cursor: pointer;
|
|
28
32
|
}
|
|
33
|
+
|
|
29
34
|
.effect:hover .label
|
|
35
|
+
|
|
30
36
|
/* .effect:focus .label */
|
|
31
|
-
|
|
37
|
+
{
|
|
32
38
|
--switch_off_bg_color: var(--zdt_switch_effect_off_bg);
|
|
33
39
|
}
|
|
34
40
|
.label:after {
|
|
@@ -41,16 +47,19 @@
|
|
|
41
47
|
background-color: var(--switch_circle_bg_color);
|
|
42
48
|
border-radius: var(--switch_circle_border_radius);
|
|
43
49
|
}
|
|
44
|
-
|
|
50
|
+
|
|
51
|
+
.checked+.label {
|
|
45
52
|
box-shadow: inset 0 0 0 var(--zd_size10) var(--switch_on_bg_color);
|
|
46
53
|
}
|
|
47
|
-
|
|
54
|
+
|
|
55
|
+
.checked+.label:after {
|
|
48
56
|
right: calc(var(--zd_size1) * -1);
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
.input {
|
|
52
60
|
display: none;
|
|
53
61
|
}
|
|
62
|
+
|
|
54
63
|
.small {
|
|
55
64
|
height: var(--zd_size14);
|
|
56
65
|
width: var(--zd_size28);
|
|
@@ -66,6 +75,7 @@
|
|
|
66
75
|
height: var(--zd_size12);
|
|
67
76
|
top: calc(var(--zd_size2) * -1);
|
|
68
77
|
}
|
|
78
|
+
|
|
69
79
|
.medium {
|
|
70
80
|
height: var(--zd_size18);
|
|
71
81
|
width: var(--zd_size34);
|
|
@@ -81,31 +91,38 @@
|
|
|
81
91
|
height: var(--zd_size18);
|
|
82
92
|
top: calc(var(--zd_size3) * -1);
|
|
83
93
|
}
|
|
84
|
-
|
|
94
|
+
|
|
95
|
+
.input:disabled+.label {
|
|
85
96
|
opacity: 0.4;
|
|
86
97
|
border-color: var(--zdt_switch_default_off_bg);
|
|
87
98
|
cursor: not-allowed;
|
|
88
99
|
}
|
|
100
|
+
|
|
89
101
|
.switch {
|
|
90
102
|
display: inline-block;
|
|
91
103
|
composes: offSelection from '../common/common.module.css';
|
|
92
104
|
vertical-align: middle;
|
|
93
105
|
}
|
|
106
|
+
|
|
94
107
|
.switch_small {
|
|
95
108
|
composes: small;
|
|
96
109
|
composes: switch;
|
|
97
110
|
}
|
|
111
|
+
|
|
98
112
|
.switch_medium {
|
|
99
113
|
composes: medium;
|
|
100
114
|
composes: switch;
|
|
101
115
|
}
|
|
102
|
-
|
|
116
|
+
|
|
117
|
+
.switch+label {
|
|
103
118
|
position: relative;
|
|
104
119
|
top: calc(var(--zd_size1) * -1);
|
|
105
120
|
}
|
|
106
|
-
|
|
121
|
+
|
|
122
|
+
[dir=ltr] .switch+label {
|
|
107
123
|
margin-left: var(--zd_size12);
|
|
108
124
|
}
|
|
109
|
-
|
|
125
|
+
|
|
126
|
+
[dir=rtl] .switch+label {
|
|
110
127
|
margin-right: var(--zd_size12);
|
|
111
128
|
}
|
package/lib/Tab/Tabs.module.css
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
z-index: 1;
|
|
4
4
|
--tab_position_gap: var(--zd_size22);
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
.alpha {
|
|
7
8
|
height: var(--zd_size35);
|
|
8
9
|
background-color: var(--zdt_tabs_alpha_bg);
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
bottom: 0;
|
|
31
32
|
height: var(--zd_size10);
|
|
32
33
|
border-radius: 100px / 5px;
|
|
33
|
-
box-shadow:
|
|
34
|
+
box-shadow: var(--zd_bs_tabs_shadow);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
[dir=ltr] .alpha::after {
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
position: relative;
|
|
116
117
|
cursor: pointer;
|
|
117
118
|
}
|
|
119
|
+
|
|
118
120
|
.menuBox {
|
|
119
121
|
max-height: var(--zd_size220);
|
|
120
122
|
}
|
|
@@ -128,13 +130,15 @@
|
|
|
128
130
|
[dir=rtl] .bottomRightToLeft, [dir=rtl] .topRightToLeft, [dir=rtl] .bottomCenterToLeft {
|
|
129
131
|
left: calc(var(--tab_position_gap) * -1);
|
|
130
132
|
}
|
|
133
|
+
|
|
131
134
|
[dir=ltr] .bottomLeftToRight, [dir=ltr] .topLeftToRight, [dir=ltr] .bottomCenterToRight {
|
|
132
135
|
left: calc(var(--tab_position_gap) * -1);
|
|
133
136
|
}
|
|
137
|
+
|
|
134
138
|
[dir=rtl] .bottomLeftToRight, [dir=rtl] .topLeftToRight, [dir=rtl] .bottomCenterToRight {
|
|
135
139
|
right: calc(var(--tab_position_gap) * -1);
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
.hidden{
|
|
142
|
+
.hidden {
|
|
139
143
|
visibility: hidden;
|
|
140
144
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.tooltiptext {
|
|
2
2
|
position: fixed;
|
|
3
|
-
z-index: 9999999;
|
|
3
|
+
z-index: 9999999;
|
|
4
|
+
/*Hook for editor alert*/
|
|
4
5
|
pointer-events: none;
|
|
5
6
|
box-shadow: 0 4px 12px 0 var(--zdt_tooltip_default_box_shadow);
|
|
6
7
|
border-radius: var(--zd_size4);
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
}[dir=rtl] .tooltiptext {
|
|
10
11
|
animation: tooltip-grow var(--zd_transition7) cubic-bezier(0.175, 0.885, 0.32, 1.15);
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
.tooltipcont {
|
|
13
15
|
color: var(--zdt_tooltip_default_text);
|
|
14
16
|
font-size: var(--zd_font_size13);
|
|
@@ -24,9 +26,11 @@
|
|
|
24
26
|
border-color: transparent;
|
|
25
27
|
border-radius: var(--zd_size4);
|
|
26
28
|
}
|
|
29
|
+
|
|
27
30
|
.tooltipWrapCont {
|
|
28
31
|
white-space: pre-wrap;
|
|
29
32
|
}
|
|
33
|
+
|
|
30
34
|
.tooltipNormalCont {
|
|
31
35
|
white-space: normal;
|
|
32
36
|
}
|
|
@@ -36,6 +40,7 @@
|
|
|
36
40
|
top: 0;
|
|
37
41
|
border-top-left-radius: 3px;
|
|
38
42
|
}
|
|
43
|
+
|
|
39
44
|
.arrowUp,
|
|
40
45
|
.arrowDown {
|
|
41
46
|
width: 11px;
|
|
@@ -44,10 +49,15 @@
|
|
|
44
49
|
border-left: solid 6px var(--zdt_tooltip_default_bg);
|
|
45
50
|
border-right: solid 6px transparent;
|
|
46
51
|
border-bottom: solid 6px transparent;
|
|
52
|
+
box-shadow: 0 4px 12px 0 var(--zdt_tooltip_default_box_shadow);
|
|
53
|
+
z-index: -1;
|
|
47
54
|
}
|
|
55
|
+
|
|
48
56
|
.arrowDown {
|
|
49
|
-
margin-top: -4px !important;
|
|
57
|
+
margin-top: -4px !important;
|
|
58
|
+
/* put important because of '.wms-mainui *' have margin: 0; */
|
|
50
59
|
}
|
|
60
|
+
|
|
51
61
|
.arrowLeft,
|
|
52
62
|
.arrowRight {
|
|
53
63
|
width: 11px;
|
|
@@ -56,22 +66,30 @@
|
|
|
56
66
|
border-left: solid 6px var(--zdt_tooltip_default_bg);
|
|
57
67
|
border-right: solid 6px transparent;
|
|
58
68
|
border-bottom: solid 6px transparent;
|
|
69
|
+
box-shadow: 0 4px 12px 0 var(--zdt_tooltip_default_box_shadow);
|
|
70
|
+
z-index: -1;
|
|
59
71
|
}
|
|
72
|
+
|
|
60
73
|
.arrowRight {
|
|
61
74
|
margin-left: -2px;
|
|
62
75
|
}
|
|
76
|
+
|
|
63
77
|
.arrowLeft {
|
|
64
78
|
margin-left: 1px;
|
|
65
79
|
}
|
|
80
|
+
|
|
66
81
|
.arrowUp {
|
|
67
82
|
transform: rotate(45deg);
|
|
68
83
|
}
|
|
84
|
+
|
|
69
85
|
.arrowDown {
|
|
70
86
|
transform: rotate(225deg);
|
|
71
87
|
}
|
|
88
|
+
|
|
72
89
|
.arrowLeft {
|
|
73
90
|
transform: rotate(315deg) translateY(-50%);
|
|
74
91
|
}
|
|
92
|
+
|
|
75
93
|
.arrowRight {
|
|
76
94
|
transform: rotate(135deg) translateY(50%);
|
|
77
95
|
}
|
|
@@ -79,31 +97,38 @@
|
|
|
79
97
|
from {
|
|
80
98
|
opacity: 0;
|
|
81
99
|
}
|
|
100
|
+
|
|
82
101
|
to {
|
|
83
102
|
opacity: 1;
|
|
84
103
|
}
|
|
85
104
|
}
|
|
105
|
+
|
|
86
106
|
@-webkit-keyframes tooltip-grow {
|
|
87
107
|
from {
|
|
88
108
|
opacity: 0;
|
|
89
109
|
}
|
|
110
|
+
|
|
90
111
|
to {
|
|
91
112
|
opacity: 1;
|
|
92
113
|
}
|
|
93
114
|
}
|
|
115
|
+
|
|
94
116
|
@-moz-keyframes tooltip-grow {
|
|
95
117
|
from {
|
|
96
118
|
opacity: 0;
|
|
97
119
|
}
|
|
120
|
+
|
|
98
121
|
to {
|
|
99
122
|
opacity: 1;
|
|
100
123
|
}
|
|
101
124
|
}
|
|
125
|
+
|
|
102
126
|
@-ms-keyframes tooltip-grow {
|
|
103
127
|
from {
|
|
104
128
|
opacity: 0;
|
|
105
129
|
}
|
|
130
|
+
|
|
106
131
|
to {
|
|
107
132
|
opacity: 1;
|
|
108
133
|
}
|
|
109
|
-
}
|
|
134
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--lib_a11y_focusScope_focus_border:var(--zdt_a11y_focusScope_focus_border);
|
|
3
|
-
--lib_a11y_focusScope_focus_bg:var(--zdt_listitem_highlight_bg);
|
|
1
|
+
:root {
|
|
2
|
+
--lib_a11y_focusScope_focus_border: var(--zdt_a11y_focusScope_focus_border);
|
|
3
|
+
--lib_a11y_focusScope_focus_bg: var(--zdt_listitem_highlight_bg);
|
|
4
4
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* avatar */
|
|
3
|
+
--zd_bs_avatar_black: var(--zd_bs_contrast_outline, inset 0px 0px 5px var(--avatar_boxshadow));
|
|
4
|
+
--zd_bs_avatar_white: var(--zd_bs_contrast_outline, inset 0px 0px 11px var(--avatar_boxshadow));
|
|
5
|
+
|
|
6
|
+
/* button */
|
|
7
|
+
--zd_bs_button_primary: var(--zd_bs_contrast_outline, 0 3px 10px var(--zdt_button_primary_box_shadow));
|
|
8
|
+
--zd_bs_button_danger: var(--zd_bs_contrast_outline, 0 3px 10px var(--zdt_button_danger_box_shadow));
|
|
9
|
+
|
|
10
|
+
/* button group */
|
|
11
|
+
--zd_bs_buttongroup_footer: var(--zd_bs_contrast_outline, 0 -4px 5px -3px var(--zdt_buttongroup_footer_box_shadow));
|
|
12
|
+
|
|
13
|
+
/* dropbox */
|
|
14
|
+
--zd_bs_dropbox_default: var(--zd_bs_contrast_outline, 4px 3px 30px var(--zdt_dropbox_default_box_shadow));
|
|
15
|
+
--zd_bs_dropbox_top: var(--zd_bs_contrast_outline, 0 -3px 30px var(--zdt_dropbox_default_box_shadow));
|
|
16
|
+
--zd_bs_dropbox_left: var(--zd_bs_contrast_outline, -4px 0 30px var(--zdt_dropbox_default_box_shadow));
|
|
17
|
+
--zd_bs_dropbox_right: var(--zd_bs_contrast_outline, 4px 0 30px var(--zdt_dropbox_default_box_shadow));
|
|
18
|
+
--zd_bs_dropbox_bottom: var(--zd_bs_contrast_outline, 0 3px 30px var(--zdt_dropbox_default_box_shadow));
|
|
19
|
+
--zd_bs_dropbox_arrow: var(--zd_bs_contrast_outline, 1px -1px 2px 0 var(--dropbox_arrow_box_shadow_color));
|
|
20
|
+
|
|
21
|
+
/* ribbon */
|
|
22
|
+
--zd_bs_ribbon_default: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_default_shadow));
|
|
23
|
+
--zd_bs_ribbon_danger: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_danger_shadow));
|
|
24
|
+
--zd_bs_ribbon_primary: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_primary_shadow));
|
|
25
|
+
--zd_bs_ribbon_secondary: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_secondary_shadow));
|
|
26
|
+
--zd_bs_ribbon_info: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_info_shadow));
|
|
27
|
+
--zd_bs_ribbon_dark: var(--zd_bs_contrast_outline, 0 5px 10px var(--zdt_ribbon_dark_shadow));
|
|
28
|
+
|
|
29
|
+
/* switch */
|
|
30
|
+
--zd_bs_switch_default: var(--zd_bs_contrast_outline, 0 1px 4px 0 var(--zdt_switch_circle_shadow));
|
|
31
|
+
|
|
32
|
+
/* tabs */
|
|
33
|
+
--zd_bs_tabs_shadow: var(--zd_bs_contrast_outline, 0 -2px 9px var(--zdt_tabs_alpha_box_shadow));
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-267",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"lintAll": "react-cli lint ./src",
|
|
23
23
|
"lintAllFix": "npm run lintAll --eslint:fix=true",
|
|
24
24
|
"clean": "react-cli clean build unittest coverage es lib assets && mkdir assets",
|
|
25
|
-
"dubCheck": "node
|
|
25
|
+
"dubCheck": "node ./node_modules/@zohodesk-private/node-plugins/es/dublication_css_file_finder node_modules/@zohodesk/icons/lib node_modules/@zohodesk/variables/lib",
|
|
26
26
|
"init": "npm run clean && cd ../assets && npm run componentsassets && cd ../components && npm run build:variables",
|
|
27
27
|
"build:variables": "node ./preprocess/index",
|
|
28
28
|
"rtl": "react-cli rtl ./src ./lib && react-cli rtl ./src ./es",
|
|
@@ -43,17 +43,22 @@
|
|
|
43
43
|
"sstest": "npm run init && react-cli sstest",
|
|
44
44
|
"build:external": "npm run clean && npm run init && npm run docsjs:build && npm run build:externalDocCopy && react-cli build:component:umd && npm run externalDocHTMLChange",
|
|
45
45
|
"download": "rm package-lock.json && rm -rf node_modules/ && npm install",
|
|
46
|
-
"expublish": "npm publish --tag experimental-version"
|
|
46
|
+
"expublish": "npm publish --tag experimental-version",
|
|
47
|
+
"variable:addignore": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableIgnore.js ./src",
|
|
48
|
+
"variable:convert": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/pxParserPostcss.js ./src",
|
|
49
|
+
"variable:check": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableErrorCheck.js ./src ./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
52
|
+
"@zohodesk-private/css-variable-migrator": "1.0.1",
|
|
53
|
+
"@zohodesk-private/node-plugins": "^1.0.0",
|
|
54
|
+
"@zohodesk/a11y": "1.3.7",
|
|
49
55
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
50
|
-
"@zohodesk/
|
|
51
|
-
"@zohodesk/
|
|
56
|
+
"@zohodesk/icons": "1.0.0-beta.125",
|
|
57
|
+
"@zohodesk/svg": "1.0.0-beta.56",
|
|
58
|
+
"@zohodesk/variables": "1.0.0-beta.31",
|
|
52
59
|
"@zohodesk/virtualizer": "1.0.3",
|
|
53
|
-
"velocity-react": "1.4.3",
|
|
54
60
|
"react-sortable-hoc": "^0.8.3",
|
|
55
|
-
"
|
|
56
|
-
"@zohodesk/a11y": "1.3.7"
|
|
61
|
+
"velocity-react": "1.4.3"
|
|
57
62
|
},
|
|
58
63
|
"dependencies": {
|
|
59
64
|
"hoist-non-react-statics": "3.0.1",
|
|
@@ -62,9 +67,9 @@
|
|
|
62
67
|
"selectn": "1.1.2"
|
|
63
68
|
},
|
|
64
69
|
"peerDependencies": {
|
|
65
|
-
"@zohodesk/icons": "1.0.0-beta.
|
|
66
|
-
"@zohodesk/variables": "1.0.0-beta.
|
|
67
|
-
"@zohodesk/svg": "1.0.0-beta.
|
|
70
|
+
"@zohodesk/icons": "1.0.0-beta.125",
|
|
71
|
+
"@zohodesk/variables": "1.0.0-beta.31",
|
|
72
|
+
"@zohodesk/svg": "1.0.0-beta.56",
|
|
68
73
|
"@zohodesk/virtualizer": "1.0.3",
|
|
69
74
|
"velocity-react": "1.4.3",
|
|
70
75
|
"react-sortable-hoc": "^0.8.3",
|
|
@@ -74,16 +79,24 @@
|
|
|
74
79
|
"preprocess": {
|
|
75
80
|
"runner": "./preprocess/index.js"
|
|
76
81
|
},
|
|
82
|
+
"app": {
|
|
83
|
+
"plugins": {
|
|
84
|
+
"cssVariableReplacement": true
|
|
85
|
+
},
|
|
86
|
+
"cssVariableReplacementConfig": "./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
|
|
87
|
+
},
|
|
77
88
|
"css": {
|
|
78
89
|
"plugins": {
|
|
79
|
-
"hasRTL": true
|
|
90
|
+
"hasRTL": true,
|
|
91
|
+
"cssVariableReplacement": true
|
|
80
92
|
},
|
|
81
93
|
"exclude": {
|
|
82
94
|
"rtl": [
|
|
83
95
|
"@zohodesk/icons",
|
|
84
96
|
"@zohodesk/variables"
|
|
85
97
|
]
|
|
86
|
-
}
|
|
98
|
+
},
|
|
99
|
+
"cssVariableReplacementConfig": "./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
|
|
87
100
|
},
|
|
88
101
|
"docs": {
|
|
89
102
|
"plugins": {
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Button from '../Button';
|
|
3
|
-
import TestUtils from 'react-dom/test-utils';
|
|
4
|
-
import renderer from 'react-test-renderer';
|
|
5
|
-
describe('Button component', () => {
|
|
6
|
-
it('should display text', () => {
|
|
7
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
8
|
-
text: "primary",
|
|
9
|
-
palette: "primary"
|
|
10
|
-
}));
|
|
11
|
-
expect(TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp').textContent.contains('primary')).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
it('should be able to click', () => {
|
|
14
|
-
let mockfn = jest.fn();
|
|
15
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
16
|
-
text: "primary",
|
|
17
|
-
palette: "primary",
|
|
18
|
-
onClick: mockfn
|
|
19
|
-
}));
|
|
20
|
-
let buttonEle = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
21
|
-
TestUtils.Simulate.click(buttonEle);
|
|
22
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
23
|
-
});
|
|
24
|
-
it('should not able to click', () => {
|
|
25
|
-
let mockfn = jest.fn();
|
|
26
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
27
|
-
text: "primary",
|
|
28
|
-
palette: "primary",
|
|
29
|
-
onClick: mockfn,
|
|
30
|
-
disabled: true
|
|
31
|
-
}));
|
|
32
|
-
let buttonEle = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp_disabled');
|
|
33
|
-
TestUtils.Simulate.click(buttonEle);
|
|
34
|
-
expect(mockfn.mock.calls.length).toBe(0);
|
|
35
|
-
});
|
|
36
|
-
it('should not able to click on loading status', () => {
|
|
37
|
-
let mockfn = jest.fn();
|
|
38
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
39
|
-
text: "primary",
|
|
40
|
-
palette: "primary",
|
|
41
|
-
onClick: mockfn,
|
|
42
|
-
status: "loading"
|
|
43
|
-
}));
|
|
44
|
-
let buttonEle = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
45
|
-
TestUtils.Simulate.click(buttonEle);
|
|
46
|
-
expect(mockfn.mock.calls.length).toBe(0);
|
|
47
|
-
});
|
|
48
|
-
it('should able to click other than loading status', () => {
|
|
49
|
-
let mockfn = jest.fn();
|
|
50
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
51
|
-
text: "primary",
|
|
52
|
-
palette: "primary",
|
|
53
|
-
onClick: mockfn,
|
|
54
|
-
status: "success"
|
|
55
|
-
}));
|
|
56
|
-
let buttonEle = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
57
|
-
TestUtils.Simulate.click(buttonEle);
|
|
58
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
59
|
-
});
|
|
60
|
-
it('should able to click and click arguments should be event object', () => {
|
|
61
|
-
let mockfn = jest.fn();
|
|
62
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Button, {
|
|
63
|
-
text: "primary",
|
|
64
|
-
palette: "primary",
|
|
65
|
-
onClick: mockfn,
|
|
66
|
-
status: "success"
|
|
67
|
-
}));
|
|
68
|
-
let buttonEle = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
69
|
-
TestUtils.Simulate.click(buttonEle);
|
|
70
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
71
|
-
expect(mockfn.mock.calls[0].length).toBe(1);
|
|
72
|
-
});
|
|
73
|
-
it('should the palette is plainPrimary', () => {
|
|
74
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
75
|
-
text: "primary",
|
|
76
|
-
palette: "plainPrimary"
|
|
77
|
-
}));
|
|
78
|
-
let tree = ele.toJSON();
|
|
79
|
-
expect(tree).toMatchSnapshot();
|
|
80
|
-
});
|
|
81
|
-
it('should the palette is plainSecondary', () => {
|
|
82
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
83
|
-
text: "plainSecondary",
|
|
84
|
-
palette: "plainSecondary"
|
|
85
|
-
}));
|
|
86
|
-
let tree = ele.toJSON();
|
|
87
|
-
expect(tree).toMatchSnapshot();
|
|
88
|
-
});
|
|
89
|
-
it('should the palette is primaryFilled', () => {
|
|
90
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
91
|
-
text: "primaryFilled",
|
|
92
|
-
palette: "primaryFilled"
|
|
93
|
-
}));
|
|
94
|
-
let tree = ele.toJSON();
|
|
95
|
-
expect(tree).toMatchSnapshot();
|
|
96
|
-
});
|
|
97
|
-
it('should the palette is danger', () => {
|
|
98
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
99
|
-
text: "danger",
|
|
100
|
-
palette: "danger"
|
|
101
|
-
}));
|
|
102
|
-
let tree = ele.toJSON();
|
|
103
|
-
expect(tree).toMatchSnapshot();
|
|
104
|
-
});
|
|
105
|
-
it('should the palette is dangerFilled', () => {
|
|
106
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
107
|
-
text: "dangerFilled",
|
|
108
|
-
palette: "dangerFilled"
|
|
109
|
-
}));
|
|
110
|
-
let tree = ele.toJSON();
|
|
111
|
-
expect(tree).toMatchSnapshot();
|
|
112
|
-
});
|
|
113
|
-
it('should the palette is secondary', () => {
|
|
114
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
115
|
-
text: "secondary",
|
|
116
|
-
palette: "secondary"
|
|
117
|
-
}));
|
|
118
|
-
let tree = ele.toJSON();
|
|
119
|
-
expect(tree).toMatchSnapshot();
|
|
120
|
-
});
|
|
121
|
-
it('should the palette is secondaryFilled', () => {
|
|
122
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
123
|
-
text: "secondaryFilled",
|
|
124
|
-
palette: "secondaryFilled"
|
|
125
|
-
}));
|
|
126
|
-
let tree = ele.toJSON();
|
|
127
|
-
expect(tree).toMatchSnapshot();
|
|
128
|
-
});
|
|
129
|
-
it('should is not bold', () => {
|
|
130
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
131
|
-
text: "secondaryFilled",
|
|
132
|
-
isBold: false
|
|
133
|
-
}));
|
|
134
|
-
let tree = ele.toJSON();
|
|
135
|
-
expect(tree).toMatchSnapshot();
|
|
136
|
-
});
|
|
137
|
-
it('should is rounded', () => {
|
|
138
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
139
|
-
text: "secondaryFilled",
|
|
140
|
-
rounded: true
|
|
141
|
-
}));
|
|
142
|
-
let tree = ele.toJSON();
|
|
143
|
-
expect(tree).toMatchSnapshot();
|
|
144
|
-
});
|
|
145
|
-
it('should the size is small', () => {
|
|
146
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
147
|
-
text: "small",
|
|
148
|
-
rounded: true,
|
|
149
|
-
size: "small"
|
|
150
|
-
}));
|
|
151
|
-
let tree = ele.toJSON();
|
|
152
|
-
expect(tree).toMatchSnapshot();
|
|
153
|
-
});
|
|
154
|
-
it('should the size is large', () => {
|
|
155
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
156
|
-
text: "large",
|
|
157
|
-
rounded: true,
|
|
158
|
-
size: "large"
|
|
159
|
-
}));
|
|
160
|
-
let tree = ele.toJSON();
|
|
161
|
-
expect(tree).toMatchSnapshot();
|
|
162
|
-
});
|
|
163
|
-
it('should the size is xlarge', () => {
|
|
164
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
165
|
-
text: "xlarge",
|
|
166
|
-
rounded: true,
|
|
167
|
-
size: "xlarge"
|
|
168
|
-
}));
|
|
169
|
-
let tree = ele.toJSON();
|
|
170
|
-
expect(tree).toMatchSnapshot();
|
|
171
|
-
});
|
|
172
|
-
it('should the status is loading', () => {
|
|
173
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
174
|
-
text: "secondaryFilled",
|
|
175
|
-
rounded: true,
|
|
176
|
-
status: "loading"
|
|
177
|
-
}));
|
|
178
|
-
let tree = ele.toJSON();
|
|
179
|
-
expect(tree).toMatchSnapshot();
|
|
180
|
-
});
|
|
181
|
-
it('should the status is success', () => {
|
|
182
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Button, {
|
|
183
|
-
text: "secondaryFilled",
|
|
184
|
-
rounded: true,
|
|
185
|
-
status: "success"
|
|
186
|
-
}));
|
|
187
|
-
let tree = ele.toJSON();
|
|
188
|
-
expect(tree).toMatchSnapshot();
|
|
189
|
-
});
|
|
190
|
-
});
|