@zohodesk/components 1.0.0-temp-217.1 → 1.0.0-temp-218
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/.cli/propValidation_report.html +1 -1
- package/es/CheckBox/CheckBox.js +1 -1
- package/es/Provider/LibraryContext.js +1 -3
- package/es/Switch/Switch.js +3 -27
- package/es/Switch/Switch.module.css +15 -126
- package/es/index.js +0 -1
- package/lib/CheckBox/CheckBox.js +1 -1
- package/lib/Provider/LibraryContext.js +1 -3
- package/lib/Switch/Switch.js +4 -34
- package/lib/Switch/Switch.module.css +15 -126
- package/lib/index.js +0 -9
- package/package.json +2 -2
- package/result.json +1 -1
- package/es/SwitchNew/SwitchNew.js +0 -118
- package/es/SwitchNew/SwitchNew.module.css +0 -155
- package/es/SwitchNew/props/defaultProps.js +0 -9
- package/es/SwitchNew/props/propTypes.js +0 -32
- package/lib/SwitchNew/SwitchNew.js +0 -148
- package/lib/SwitchNew/SwitchNew.module.css +0 -155
- package/lib/SwitchNew/props/defaultProps.js +0 -16
- package/lib/SwitchNew/props/propTypes.js +0 -43
package/es/CheckBox/CheckBox.js
CHANGED
|
@@ -92,7 +92,7 @@ export default class CheckBox extends React.Component {
|
|
|
92
92
|
"aria-label": ariaLabel,
|
|
93
93
|
"aria-labelledby": ariaLabelledby,
|
|
94
94
|
"aria-hidden": ariaHidden,
|
|
95
|
-
|
|
95
|
+
dataSelectorId: dataSelectorId || id,
|
|
96
96
|
...CheckBoxProps
|
|
97
97
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
98
98
|
className: `${style.boxContainer} ${style[size]} ${customCBoxSize} ${isFilled ? style.filled : ''} ${!isEditable ? `${style[`disabled`]}` : ''}`
|
|
@@ -9,15 +9,13 @@ const LibraryContextProvider = _ref => {
|
|
|
9
9
|
direction,
|
|
10
10
|
coloredTagVariant,
|
|
11
11
|
hasTagColorInheritedToText,
|
|
12
|
-
a11y_onOffLabel,
|
|
13
12
|
children
|
|
14
13
|
} = _ref;
|
|
15
14
|
const [value, setValue] = useState({
|
|
16
15
|
isReducedMotion,
|
|
17
16
|
direction,
|
|
18
17
|
coloredTagVariant,
|
|
19
|
-
hasTagColorInheritedToText
|
|
20
|
-
a11y_onOffLabel
|
|
18
|
+
hasTagColorInheritedToText
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
function setGlobalContext(key, data) {
|
package/es/Switch/Switch.js
CHANGED
|
@@ -3,7 +3,6 @@ import { defaultProps } from './props/defaultProps';
|
|
|
3
3
|
import { propTypes } from './props/propTypes';
|
|
4
4
|
import { Container, Box } from '../Layout';
|
|
5
5
|
import Label from '../Label/Label';
|
|
6
|
-
import LibraryContext from '../Provider/LibraryContextInit';
|
|
7
6
|
import style from './Switch.module.css';
|
|
8
7
|
export default class Switch extends React.Component {
|
|
9
8
|
constructor(props) {
|
|
@@ -19,7 +18,7 @@ export default class Switch extends React.Component {
|
|
|
19
18
|
onChange && onChange(!checked, e);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
render() {
|
|
23
22
|
let {
|
|
24
23
|
id,
|
|
25
24
|
name,
|
|
@@ -49,8 +48,6 @@ export default class Switch extends React.Component {
|
|
|
49
48
|
customLabel = ''
|
|
50
49
|
} = customClass;
|
|
51
50
|
size !== 'small' ? size = 'switch_medium' : size = 'switch_small';
|
|
52
|
-
const isOnOffLabelEnabled = context.a11y_onOffLabel;
|
|
53
|
-
const onOffLabelType = '';
|
|
54
51
|
return /*#__PURE__*/React.createElement(Container, {
|
|
55
52
|
align: "vertical",
|
|
56
53
|
isCover: false,
|
|
@@ -78,26 +75,9 @@ export default class Switch extends React.Component {
|
|
|
78
75
|
htmlFor: id,
|
|
79
76
|
"data-id": dataId,
|
|
80
77
|
"data-test-id": dataId,
|
|
81
|
-
className: `${style.label} ${style[`${size}Label`]} ${customSwitch}
|
|
78
|
+
className: `${style.label} ${style[`${size}Label`]} ${customSwitch}`,
|
|
82
79
|
tabIndex: isReadOnly || disabled ? '-1' : '0'
|
|
83
|
-
}, /*#__PURE__*/React.createElement(
|
|
84
|
-
className: style.thumb
|
|
85
|
-
}, isOnOffLabelEnabled && onOffLabelType === 'thumb' && /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className: style.onOffIndicationHolder
|
|
87
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: `${style.onOffIndication} ${checked ? style.onIndication : style.offIndication}`
|
|
89
|
-
}))), isOnOffLabelEnabled && /*#__PURE__*/React.createElement(Container, {
|
|
90
|
-
align: "vertical",
|
|
91
|
-
alignBox: checked ? 'row' : 'row-reverse',
|
|
92
|
-
className: style.onOffLabel,
|
|
93
|
-
isCover: false
|
|
94
|
-
}, onOffLabelType === 'labelOnTrack' && /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: style.onOffIndicationText
|
|
96
|
-
}, checked ? 'ON' : 'OFF'), isOnOffLabelEnabled && onOffLabelType === 'track' && /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: `${style.onOffIndication} ${checked ? style.onIndication : style.offIndication} ${style.thumbIndication}`
|
|
98
|
-
})))), isOnOffLabelEnabled && onOffLabelType === 'labelSide' && /*#__PURE__*/React.createElement(Box, {
|
|
99
|
-
className: `${style.labelText} ${size === "switch_medium" ? style.mediumLabelText : style.smallLabelText}`
|
|
100
|
-
}, checked ? 'On' : 'Off'), text && /*#__PURE__*/React.createElement(Label, {
|
|
80
|
+
})), text && /*#__PURE__*/React.createElement(Label, {
|
|
101
81
|
text: text,
|
|
102
82
|
palette: labelPalette,
|
|
103
83
|
id: id,
|
|
@@ -109,10 +89,6 @@ export default class Switch extends React.Component {
|
|
|
109
89
|
}));
|
|
110
90
|
}
|
|
111
91
|
|
|
112
|
-
render() {
|
|
113
|
-
return /*#__PURE__*/React.createElement(LibraryContext.Consumer, null, context => this.renderSwitch(context));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
92
|
}
|
|
117
93
|
Switch.defaultProps = defaultProps;
|
|
118
94
|
Switch.propTypes = propTypes; // if (__DOCS__) {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
{
|
|
38
38
|
--switch_off_bg_color: var(--zdt_switch_effect_off_bg);
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.label:after {
|
|
41
41
|
content: '';
|
|
42
42
|
display: block;
|
|
43
43
|
position: absolute;
|
|
@@ -46,21 +46,14 @@
|
|
|
46
46
|
box-shadow: var(--switch_cricle_box_shadow);
|
|
47
47
|
background-color: var(--switch_circle_bg_color);
|
|
48
48
|
border-radius: var(--switch_circle_border_radius);
|
|
49
|
-
left: var(--zd_size1) ;
|
|
50
|
-
}
|
|
51
|
-
.onOffIndicationHolder{
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
align-items: center;
|
|
55
|
-
height: 100% ;
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
.checked+.label {
|
|
59
52
|
box-shadow: inset 0 0 0 var(--zd_size10) var(--switch_on_bg_color);
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
|
|
55
|
+
.checked+.label:after {
|
|
56
|
+
right: calc( var(--zd_size1) * -1 ) ;
|
|
64
57
|
}
|
|
65
58
|
|
|
66
59
|
.input {
|
|
@@ -72,15 +65,15 @@
|
|
|
72
65
|
width: var(--zd_size28) ;
|
|
73
66
|
}
|
|
74
67
|
.switch_smallLabel {
|
|
75
|
-
height: var(--
|
|
68
|
+
height: var(--zd_size9) ;
|
|
76
69
|
width: var(--zd_size22) ;
|
|
77
|
-
|
|
70
|
+
top: calc( var(--zd_size2) * -1 ) ;
|
|
78
71
|
left: var(--zd_size2) ;
|
|
79
72
|
}
|
|
80
|
-
.switch_smallLabel
|
|
81
|
-
width: var(--
|
|
82
|
-
height: var(--
|
|
83
|
-
top: var(--
|
|
73
|
+
.switch_smallLabel:after {
|
|
74
|
+
width: var(--zd_size12) ;
|
|
75
|
+
height: var(--zd_size12) ;
|
|
76
|
+
top: calc( var(--zd_size2) * -1 ) ;
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
.medium {
|
|
@@ -88,21 +81,15 @@
|
|
|
88
81
|
width: var(--zd_size34) ;
|
|
89
82
|
}
|
|
90
83
|
.switch_mediumLabel {
|
|
91
|
-
height: var(--
|
|
84
|
+
height: var(--zd_size13) ;
|
|
92
85
|
width: var(--zd_size31) ;
|
|
93
86
|
top: var(--zd_size2) ;
|
|
94
87
|
left: var(--zd_size2) ;
|
|
95
88
|
}
|
|
96
|
-
.
|
|
97
|
-
width: var(--
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
width: var(--zd_size42) ;
|
|
101
|
-
}
|
|
102
|
-
.switch_mediumLabel .thumb{
|
|
103
|
-
width: var(--zd_size12) ;
|
|
104
|
-
height: var(--zd_size12) ;
|
|
105
|
-
top: var(--zd_size2) ;
|
|
89
|
+
.switch_mediumLabel:after {
|
|
90
|
+
width: var(--zd_size18) ;
|
|
91
|
+
height: var(--zd_size18) ;
|
|
92
|
+
top: calc( var(--zd_size3) * -1 ) ;
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
.input:disabled+.label {
|
|
@@ -138,102 +125,4 @@
|
|
|
138
125
|
|
|
139
126
|
[dir=rtl] .switch+label {
|
|
140
127
|
margin-right: var(--zd_size12) ;
|
|
141
|
-
}
|
|
142
|
-
.onOffLabel{
|
|
143
|
-
position: absolute;
|
|
144
|
-
inset: 0;
|
|
145
|
-
z-index: 2;
|
|
146
|
-
}
|
|
147
|
-
.onOffIndication{
|
|
148
|
-
/* css:theme-validation:ignore */
|
|
149
|
-
border: 0.5px solid;
|
|
150
|
-
}
|
|
151
|
-
.offIndication{
|
|
152
|
-
/* css:theme-validation:ignore */
|
|
153
|
-
border-color: #868585;
|
|
154
|
-
border-radius: 50%;
|
|
155
|
-
}
|
|
156
|
-
.onIndication{
|
|
157
|
-
/* css:theme-validation:ignore */
|
|
158
|
-
border-color: var(--switch_on_bg_color);
|
|
159
|
-
border-radius: 5px;
|
|
160
|
-
}
|
|
161
|
-
.thumbIndication.onIndication{
|
|
162
|
-
/* css:theme-validation:ignore */
|
|
163
|
-
border-color: #fff;
|
|
164
|
-
}
|
|
165
|
-
.switch_small .thumbIndication.onOffLabel{
|
|
166
|
-
top: calc( var(--zd_size10) * -1 ) ;
|
|
167
|
-
}
|
|
168
|
-
[dir=ltr] .switch_small .thumbIndication.onOffLabel{
|
|
169
|
-
right: var(--zd_size3) ;
|
|
170
|
-
}
|
|
171
|
-
[dir=rtl] .switch_small .thumbIndication.onOffLabel{
|
|
172
|
-
left: var(--zd_size3) ;
|
|
173
|
-
}
|
|
174
|
-
.switch_small .offIndication{
|
|
175
|
-
width: var(--zd_size5) ;
|
|
176
|
-
height: var(--zd_size5) ;
|
|
177
|
-
}
|
|
178
|
-
.switch_small .thumbIndication.offIndication{
|
|
179
|
-
margin: 0 var(--zd_size3) ;
|
|
180
|
-
}
|
|
181
|
-
.switch_small .onIndication{
|
|
182
|
-
width: var(--zd_size1) ;
|
|
183
|
-
height: var(--zd_size5) ;
|
|
184
|
-
}
|
|
185
|
-
.switch_small .thumbIndication.onIndication{
|
|
186
|
-
margin: 0 var(--zd_size5) ;
|
|
187
|
-
}
|
|
188
|
-
.switch_medium .thumbIndication.onOffLabel{
|
|
189
|
-
top: calc( var(--zd_size10) * -1 ) ;
|
|
190
|
-
}
|
|
191
|
-
[dir=ltr] .switch_medium .thumbIndication.onOffLabel{
|
|
192
|
-
right: var(--zd_size3) ;
|
|
193
|
-
}
|
|
194
|
-
[dir=rtl] .switch_medium .thumbIndication.onOffLabel{
|
|
195
|
-
left: var(--zd_size3) ;
|
|
196
|
-
}
|
|
197
|
-
.switch_medium .offIndication{
|
|
198
|
-
width: var(--zd_size7) ;
|
|
199
|
-
height: var(--zd_size7) ;
|
|
200
|
-
}
|
|
201
|
-
.switch_medium .thumbIndication.offIndication{
|
|
202
|
-
margin: 0 var(--zd_size5) ;
|
|
203
|
-
}
|
|
204
|
-
.switch_medium .onIndication{
|
|
205
|
-
width: var(--zd_size1) ;
|
|
206
|
-
height: var(--zd_size7) ;
|
|
207
|
-
}
|
|
208
|
-
.switch_medium .thumbIndication.onIndication{
|
|
209
|
-
margin: 0 var(--zd_size7) ;
|
|
210
|
-
}
|
|
211
|
-
.onOffIndicationText{
|
|
212
|
-
/* css:theme-validation:ignore */
|
|
213
|
-
color: #fff;
|
|
214
|
-
}
|
|
215
|
-
.switch_small .onOffIndicationText{
|
|
216
|
-
font-size: var(--zd_font_size7) ;
|
|
217
|
-
margin: 0 var(--zd_size4) ;
|
|
218
|
-
}
|
|
219
|
-
.switch_medium .onOffIndicationText{
|
|
220
|
-
font-size: var(--zd_font_size10) ;
|
|
221
|
-
margin: 0 var(--zd_size6) ;
|
|
222
|
-
}
|
|
223
|
-
.labelText{
|
|
224
|
-
/* css:theme-validation:ignore */
|
|
225
|
-
color: #000;
|
|
226
|
-
}
|
|
227
|
-
.smallLabelText{
|
|
228
|
-
font-size: var(--zd_font_size11) ;
|
|
229
|
-
margin: var(--zd_size1) 0 0 ;
|
|
230
|
-
}
|
|
231
|
-
.mediumLabelText{
|
|
232
|
-
font-size: var(--zd_font_size12) ;
|
|
233
|
-
}
|
|
234
|
-
[dir=ltr] .mediumLabelText{
|
|
235
|
-
margin : var(--zd_size1) 0 0 var(--zd_size2) ;
|
|
236
|
-
}
|
|
237
|
-
[dir=rtl] .mediumLabelText{
|
|
238
|
-
margin : var(--zd_size1) var(--zd_size2) 0 0 ;
|
|
239
128
|
}
|
package/es/index.js
CHANGED
|
@@ -29,7 +29,6 @@ export { default as RippleEffect } from './RippleEffect/RippleEffect';
|
|
|
29
29
|
export * from './Select';
|
|
30
30
|
export { default as Stencils } from './Stencils/Stencils';
|
|
31
31
|
export { default as Switch } from './Switch/Switch';
|
|
32
|
-
export { default as SwitchNew } from './SwitchNew/SwitchNew';
|
|
33
32
|
export * from './Tab';
|
|
34
33
|
export { default as Tag } from './Tag/Tag';
|
|
35
34
|
export { default as Textarea } from './Textarea/Textarea';
|
package/lib/CheckBox/CheckBox.js
CHANGED
|
@@ -143,7 +143,7 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
143
143
|
"aria-label": ariaLabel,
|
|
144
144
|
"aria-labelledby": ariaLabelledby,
|
|
145
145
|
"aria-hidden": ariaHidden,
|
|
146
|
-
|
|
146
|
+
dataSelectorId: dataSelectorId || id
|
|
147
147
|
}, CheckBoxProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
148
148
|
className: "".concat(_CheckBoxModule["default"].boxContainer, " ").concat(_CheckBoxModule["default"][size], " ").concat(customCBoxSize, " ").concat(isFilled ? _CheckBoxModule["default"].filled : '', " ").concat(!isEditable ? "".concat(_CheckBoxModule["default"]["disabled"]) : '')
|
|
149
149
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
@@ -44,15 +44,13 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
44
44
|
direction = _ref.direction,
|
|
45
45
|
coloredTagVariant = _ref.coloredTagVariant,
|
|
46
46
|
hasTagColorInheritedToText = _ref.hasTagColorInheritedToText,
|
|
47
|
-
a11y_onOffLabel = _ref.a11y_onOffLabel,
|
|
48
47
|
children = _ref.children;
|
|
49
48
|
|
|
50
49
|
var _useState = (0, _react.useState)({
|
|
51
50
|
isReducedMotion: isReducedMotion,
|
|
52
51
|
direction: direction,
|
|
53
52
|
coloredTagVariant: coloredTagVariant,
|
|
54
|
-
hasTagColorInheritedToText: hasTagColorInheritedToText
|
|
55
|
-
a11y_onOffLabel: a11y_onOffLabel
|
|
53
|
+
hasTagColorInheritedToText: hasTagColorInheritedToText
|
|
56
54
|
}),
|
|
57
55
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58
56
|
value = _useState2[0],
|
package/lib/Switch/Switch.js
CHANGED
|
@@ -17,8 +17,6 @@ var _Layout = require("../Layout");
|
|
|
17
17
|
|
|
18
18
|
var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
19
19
|
|
|
20
|
-
var _LibraryContextInit = _interopRequireDefault(require("../Provider/LibraryContextInit"));
|
|
21
|
-
|
|
22
20
|
var _SwitchModule = _interopRequireDefault(require("./Switch.module.css"));
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -69,8 +67,8 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
|
69
67
|
onChange && onChange(!checked, e);
|
|
70
68
|
}
|
|
71
69
|
}, {
|
|
72
|
-
key: "
|
|
73
|
-
value: function
|
|
70
|
+
key: "render",
|
|
71
|
+
value: function render() {
|
|
74
72
|
var _this$props2 = this.props,
|
|
75
73
|
id = _this$props2.id,
|
|
76
74
|
name = _this$props2.name,
|
|
@@ -101,8 +99,6 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
|
101
99
|
_customClass$customLa = customClass.customLabel,
|
|
102
100
|
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
|
|
103
101
|
size !== 'small' ? size = 'switch_medium' : size = 'switch_small';
|
|
104
|
-
var isOnOffLabelEnabled = context.a11y_onOffLabel;
|
|
105
|
-
var onOffLabelType = '';
|
|
106
102
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
107
103
|
align: "vertical",
|
|
108
104
|
isCover: false,
|
|
@@ -129,26 +125,9 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
|
129
125
|
htmlFor: id,
|
|
130
126
|
"data-id": dataId,
|
|
131
127
|
"data-test-id": dataId,
|
|
132
|
-
className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch
|
|
128
|
+
className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch),
|
|
133
129
|
tabIndex: isReadOnly || disabled ? '-1' : '0'
|
|
134
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
|
135
|
-
className: _SwitchModule["default"].thumb
|
|
136
|
-
}, isOnOffLabelEnabled && onOffLabelType === 'thumb' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
137
|
-
className: _SwitchModule["default"].onOffIndicationHolder
|
|
138
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
-
className: "".concat(_SwitchModule["default"].onOffIndication, " ").concat(checked ? _SwitchModule["default"].onIndication : _SwitchModule["default"].offIndication)
|
|
140
|
-
}))), isOnOffLabelEnabled && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
141
|
-
align: "vertical",
|
|
142
|
-
alignBox: checked ? 'row' : 'row-reverse',
|
|
143
|
-
className: _SwitchModule["default"].onOffLabel,
|
|
144
|
-
isCover: false
|
|
145
|
-
}, onOffLabelType === 'labelOnTrack' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
|
-
className: _SwitchModule["default"].onOffIndicationText
|
|
147
|
-
}, checked ? 'ON' : 'OFF'), isOnOffLabelEnabled && onOffLabelType === 'track' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
148
|
-
className: "".concat(_SwitchModule["default"].onOffIndication, " ").concat(checked ? _SwitchModule["default"].onIndication : _SwitchModule["default"].offIndication, " ").concat(_SwitchModule["default"].thumbIndication)
|
|
149
|
-
})))), isOnOffLabelEnabled && onOffLabelType === 'labelSide' && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
150
|
-
className: "".concat(_SwitchModule["default"].labelText, " ").concat(size === "switch_medium" ? _SwitchModule["default"].mediumLabelText : _SwitchModule["default"].smallLabelText)
|
|
151
|
-
}, checked ? 'On' : 'Off'), text && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
130
|
+
})), text && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
152
131
|
text: text,
|
|
153
132
|
palette: labelPalette,
|
|
154
133
|
id: id,
|
|
@@ -158,15 +137,6 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
|
158
137
|
customClass: customLabel
|
|
159
138
|
}, LabelProps)));
|
|
160
139
|
}
|
|
161
|
-
}, {
|
|
162
|
-
key: "render",
|
|
163
|
-
value: function render() {
|
|
164
|
-
var _this2 = this;
|
|
165
|
-
|
|
166
|
-
return /*#__PURE__*/_react["default"].createElement(_LibraryContextInit["default"].Consumer, null, function (context) {
|
|
167
|
-
return _this2.renderSwitch(context);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
140
|
}]);
|
|
171
141
|
|
|
172
142
|
return Switch;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
{
|
|
38
38
|
--switch_off_bg_color: var(--zdt_switch_effect_off_bg);
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.label:after {
|
|
41
41
|
content: '';
|
|
42
42
|
display: block;
|
|
43
43
|
position: absolute;
|
|
@@ -46,21 +46,14 @@
|
|
|
46
46
|
box-shadow: var(--switch_cricle_box_shadow);
|
|
47
47
|
background-color: var(--switch_circle_bg_color);
|
|
48
48
|
border-radius: var(--switch_circle_border_radius);
|
|
49
|
-
left: var(--zd_size1) ;
|
|
50
|
-
}
|
|
51
|
-
.onOffIndicationHolder{
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
align-items: center;
|
|
55
|
-
height: 100% ;
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
.checked+.label {
|
|
59
52
|
box-shadow: inset 0 0 0 var(--zd_size10) var(--switch_on_bg_color);
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
|
|
55
|
+
.checked+.label:after {
|
|
56
|
+
right: calc( var(--zd_size1) * -1 ) ;
|
|
64
57
|
}
|
|
65
58
|
|
|
66
59
|
.input {
|
|
@@ -72,15 +65,15 @@
|
|
|
72
65
|
width: var(--zd_size28) ;
|
|
73
66
|
}
|
|
74
67
|
.switch_smallLabel {
|
|
75
|
-
height: var(--
|
|
68
|
+
height: var(--zd_size9) ;
|
|
76
69
|
width: var(--zd_size22) ;
|
|
77
|
-
|
|
70
|
+
top: calc( var(--zd_size2) * -1 ) ;
|
|
78
71
|
left: var(--zd_size2) ;
|
|
79
72
|
}
|
|
80
|
-
.switch_smallLabel
|
|
81
|
-
width: var(--
|
|
82
|
-
height: var(--
|
|
83
|
-
top: var(--
|
|
73
|
+
.switch_smallLabel:after {
|
|
74
|
+
width: var(--zd_size12) ;
|
|
75
|
+
height: var(--zd_size12) ;
|
|
76
|
+
top: calc( var(--zd_size2) * -1 ) ;
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
.medium {
|
|
@@ -88,21 +81,15 @@
|
|
|
88
81
|
width: var(--zd_size34) ;
|
|
89
82
|
}
|
|
90
83
|
.switch_mediumLabel {
|
|
91
|
-
height: var(--
|
|
84
|
+
height: var(--zd_size13) ;
|
|
92
85
|
width: var(--zd_size31) ;
|
|
93
86
|
top: var(--zd_size2) ;
|
|
94
87
|
left: var(--zd_size2) ;
|
|
95
88
|
}
|
|
96
|
-
.
|
|
97
|
-
width: var(--
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
width: var(--zd_size42) ;
|
|
101
|
-
}
|
|
102
|
-
.switch_mediumLabel .thumb{
|
|
103
|
-
width: var(--zd_size12) ;
|
|
104
|
-
height: var(--zd_size12) ;
|
|
105
|
-
top: var(--zd_size2) ;
|
|
89
|
+
.switch_mediumLabel:after {
|
|
90
|
+
width: var(--zd_size18) ;
|
|
91
|
+
height: var(--zd_size18) ;
|
|
92
|
+
top: calc( var(--zd_size3) * -1 ) ;
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
.input:disabled+.label {
|
|
@@ -138,102 +125,4 @@
|
|
|
138
125
|
|
|
139
126
|
[dir=rtl] .switch+label {
|
|
140
127
|
margin-right: var(--zd_size12) ;
|
|
141
|
-
}
|
|
142
|
-
.onOffLabel{
|
|
143
|
-
position: absolute;
|
|
144
|
-
inset: 0;
|
|
145
|
-
z-index: 2;
|
|
146
|
-
}
|
|
147
|
-
.onOffIndication{
|
|
148
|
-
/* css:theme-validation:ignore */
|
|
149
|
-
border: 0.5px solid;
|
|
150
|
-
}
|
|
151
|
-
.offIndication{
|
|
152
|
-
/* css:theme-validation:ignore */
|
|
153
|
-
border-color: #868585;
|
|
154
|
-
border-radius: 50%;
|
|
155
|
-
}
|
|
156
|
-
.onIndication{
|
|
157
|
-
/* css:theme-validation:ignore */
|
|
158
|
-
border-color: var(--switch_on_bg_color);
|
|
159
|
-
border-radius: 5px;
|
|
160
|
-
}
|
|
161
|
-
.thumbIndication.onIndication{
|
|
162
|
-
/* css:theme-validation:ignore */
|
|
163
|
-
border-color: #fff;
|
|
164
|
-
}
|
|
165
|
-
.switch_small .thumbIndication.onOffLabel{
|
|
166
|
-
top: calc( var(--zd_size10) * -1 ) ;
|
|
167
|
-
}
|
|
168
|
-
[dir=ltr] .switch_small .thumbIndication.onOffLabel{
|
|
169
|
-
right: var(--zd_size3) ;
|
|
170
|
-
}
|
|
171
|
-
[dir=rtl] .switch_small .thumbIndication.onOffLabel{
|
|
172
|
-
left: var(--zd_size3) ;
|
|
173
|
-
}
|
|
174
|
-
.switch_small .offIndication{
|
|
175
|
-
width: var(--zd_size5) ;
|
|
176
|
-
height: var(--zd_size5) ;
|
|
177
|
-
}
|
|
178
|
-
.switch_small .thumbIndication.offIndication{
|
|
179
|
-
margin: 0 var(--zd_size3) ;
|
|
180
|
-
}
|
|
181
|
-
.switch_small .onIndication{
|
|
182
|
-
width: var(--zd_size1) ;
|
|
183
|
-
height: var(--zd_size5) ;
|
|
184
|
-
}
|
|
185
|
-
.switch_small .thumbIndication.onIndication{
|
|
186
|
-
margin: 0 var(--zd_size5) ;
|
|
187
|
-
}
|
|
188
|
-
.switch_medium .thumbIndication.onOffLabel{
|
|
189
|
-
top: calc( var(--zd_size10) * -1 ) ;
|
|
190
|
-
}
|
|
191
|
-
[dir=ltr] .switch_medium .thumbIndication.onOffLabel{
|
|
192
|
-
right: var(--zd_size3) ;
|
|
193
|
-
}
|
|
194
|
-
[dir=rtl] .switch_medium .thumbIndication.onOffLabel{
|
|
195
|
-
left: var(--zd_size3) ;
|
|
196
|
-
}
|
|
197
|
-
.switch_medium .offIndication{
|
|
198
|
-
width: var(--zd_size7) ;
|
|
199
|
-
height: var(--zd_size7) ;
|
|
200
|
-
}
|
|
201
|
-
.switch_medium .thumbIndication.offIndication{
|
|
202
|
-
margin: 0 var(--zd_size5) ;
|
|
203
|
-
}
|
|
204
|
-
.switch_medium .onIndication{
|
|
205
|
-
width: var(--zd_size1) ;
|
|
206
|
-
height: var(--zd_size7) ;
|
|
207
|
-
}
|
|
208
|
-
.switch_medium .thumbIndication.onIndication{
|
|
209
|
-
margin: 0 var(--zd_size7) ;
|
|
210
|
-
}
|
|
211
|
-
.onOffIndicationText{
|
|
212
|
-
/* css:theme-validation:ignore */
|
|
213
|
-
color: #fff;
|
|
214
|
-
}
|
|
215
|
-
.switch_small .onOffIndicationText{
|
|
216
|
-
font-size: var(--zd_font_size7) ;
|
|
217
|
-
margin: 0 var(--zd_size4) ;
|
|
218
|
-
}
|
|
219
|
-
.switch_medium .onOffIndicationText{
|
|
220
|
-
font-size: var(--zd_font_size10) ;
|
|
221
|
-
margin: 0 var(--zd_size6) ;
|
|
222
|
-
}
|
|
223
|
-
.labelText{
|
|
224
|
-
/* css:theme-validation:ignore */
|
|
225
|
-
color: #000;
|
|
226
|
-
}
|
|
227
|
-
.smallLabelText{
|
|
228
|
-
font-size: var(--zd_font_size11) ;
|
|
229
|
-
margin: var(--zd_size1) 0 0 ;
|
|
230
|
-
}
|
|
231
|
-
.mediumLabelText{
|
|
232
|
-
font-size: var(--zd_font_size12) ;
|
|
233
|
-
}
|
|
234
|
-
[dir=ltr] .mediumLabelText{
|
|
235
|
-
margin : var(--zd_size1) 0 0 var(--zd_size2) ;
|
|
236
|
-
}
|
|
237
|
-
[dir=rtl] .mediumLabelText{
|
|
238
|
-
margin : var(--zd_size1) var(--zd_size2) 0 0 ;
|
|
239
128
|
}
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,6 @@ var _exportNames = {
|
|
|
26
26
|
RippleEffect: true,
|
|
27
27
|
Stencils: true,
|
|
28
28
|
Switch: true,
|
|
29
|
-
SwitchNew: true,
|
|
30
29
|
Tag: true,
|
|
31
30
|
Textarea: true,
|
|
32
31
|
TextBox: true,
|
|
@@ -145,12 +144,6 @@ Object.defineProperty(exports, "Switch", {
|
|
|
145
144
|
return _Switch["default"];
|
|
146
145
|
}
|
|
147
146
|
});
|
|
148
|
-
Object.defineProperty(exports, "SwitchNew", {
|
|
149
|
-
enumerable: true,
|
|
150
|
-
get: function get() {
|
|
151
|
-
return _SwitchNew["default"];
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
147
|
Object.defineProperty(exports, "Tag", {
|
|
155
148
|
enumerable: true,
|
|
156
149
|
get: function get() {
|
|
@@ -359,8 +352,6 @@ var _Stencils = _interopRequireDefault(require("./Stencils/Stencils"));
|
|
|
359
352
|
|
|
360
353
|
var _Switch = _interopRequireDefault(require("./Switch/Switch"));
|
|
361
354
|
|
|
362
|
-
var _SwitchNew = _interopRequireDefault(require("./SwitchNew/SwitchNew"));
|
|
363
|
-
|
|
364
355
|
var _Tab = require("./Tab");
|
|
365
356
|
|
|
366
357
|
Object.keys(_Tab).forEach(function (key) {
|
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-218",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
|
|
39
39
|
"coverage": "react-cli coverage",
|
|
40
40
|
"prepare": "npm run init && npm run build && npm run rtl && npm run cssVariableConvert ",
|
|
41
|
-
"prepublishOnly": "node prePublish.js && npm run download",
|
|
41
|
+
"prepublishOnly": "node prePublish.js && npm run download && npm run css:review && npm run review:props ",
|
|
42
42
|
"postpublish": "node postPublish.js",
|
|
43
43
|
"report": "react-cli publish:report",
|
|
44
44
|
"test": "react-cli test",
|