@zohodesk/components 1.0.0-temp-246 → 1.0.0-temp-242.1
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 +23 -7
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +0 -2
- package/assets/Appearance/light/mode/Component_LightMode.module.css +0 -2
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +0 -2
- package/es/AppContainer/AppContainer.js +1 -0
- package/es/AppContainer/AppContainer.module.css +3 -2
- package/es/Button/css/Button.module.css +13 -4
- package/es/CheckBox/CheckBox.js +10 -21
- package/es/CheckBox/CheckBox.module.css +6 -21
- package/es/CheckBox/__tests__/CheckBox.spec.js +0 -9
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +93 -162
- package/es/CheckBox/props/propTypes.js +1 -4
- package/es/DateTime/DateTime.module.css +12 -9
- package/es/DateTime/YearView.module.css +1 -1
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +3 -14
- package/es/Heading/Heading.module.css +1 -1
- package/es/Label/Label.js +1 -19
- package/es/Label/Label.module.css +8 -8
- package/es/Label/__tests__/Label.spec.js +0 -58
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -66
- package/es/Label/props/defaultProps.js +0 -1
- package/es/Label/props/propTypes.js +1 -7
- package/es/MultiSelect/MultiSelect.module.css +1 -1
- package/es/Popup/Popup.js +21 -1045
- package/es/Radio/Radio.js +9 -20
- package/es/Radio/Radio.module.css +5 -38
- package/es/Radio/__tests__/Radio.spec.js +0 -10
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +81 -238
- package/es/Radio/props/propTypes.js +1 -4
- package/es/Tab/Tabs.module.css +1 -1
- package/es/TextBox/TextBox.module.css +4 -4
- package/es/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Tooltip/Tooltip.module.css +1 -1
- package/es/Typography/css/Typography.module.css +4 -4
- package/es/common/basic.module.css +39 -6
- package/es/common/basicReset.module.css +2 -2
- package/es/common/common.module.css +5 -5
- package/es/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/es/utils/Common.js +1 -1
- package/es/v1/Popup/Popup.js +1 -1
- package/es/v1/Tab/v1Tabs.module.css +1 -1
- package/es/v1/Typography/css/v1_Typography.module.css +4 -4
- package/lib/AppContainer/AppContainer.js +2 -0
- package/lib/AppContainer/AppContainer.module.css +3 -2
- package/lib/Button/css/Button.module.css +13 -4
- package/lib/CheckBox/CheckBox.js +9 -23
- package/lib/CheckBox/CheckBox.module.css +6 -21
- package/lib/CheckBox/__tests__/CheckBox.spec.js +12 -21
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +93 -162
- package/lib/CheckBox/props/propTypes.js +1 -5
- package/lib/DateTime/DateTime.module.css +12 -9
- package/lib/DateTime/YearView.module.css +1 -1
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -5
- package/lib/DropBox/utils/isMobilePopover.js +4 -14
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Label/Label.js +1 -21
- package/lib/Label/Label.module.css +8 -8
- package/lib/Label/__tests__/Label.spec.js +0 -58
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -66
- package/lib/Label/props/defaultProps.js +0 -1
- package/lib/Label/props/propTypes.js +1 -8
- package/lib/MultiSelect/MultiSelect.module.css +1 -1
- package/lib/Popup/Popup.js +25 -1152
- package/lib/Radio/Radio.js +8 -22
- package/lib/Radio/Radio.module.css +5 -38
- package/lib/Radio/__tests__/Radio.spec.js +0 -10
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +81 -238
- package/lib/Radio/props/propTypes.js +1 -5
- package/lib/Tab/Tabs.module.css +1 -1
- package/lib/TextBox/TextBox.module.css +4 -4
- package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Tooltip/Tooltip.module.css +1 -1
- package/lib/Typography/css/Typography.module.css +4 -4
- package/lib/common/basic.module.css +39 -6
- package/lib/common/basicReset.module.css +2 -2
- package/lib/common/common.module.css +5 -5
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/lib/utils/Common.js +1 -1
- package/lib/v1/Popup/Popup.js +1 -1
- package/lib/v1/Tab/v1Tabs.module.css +1 -1
- package/lib/v1/Typography/css/v1_Typography.module.css +4 -4
- package/package.json +5 -5
- package/es/DropBox/DropBoxPositionMapping.js +0 -142
- package/es/Popup/PositionMapping.js +0 -72
- package/es/Popup/Registry.js +0 -36
- package/es/Popup/intersectionObserver.js +0 -49
- package/es/Popup/viewPort.js +0 -373
- package/lib/DropBox/DropBoxPositionMapping.js +0 -149
- package/lib/Popup/PositionMapping.js +0 -81
- package/lib/Popup/Registry.js +0 -46
- package/lib/Popup/intersectionObserver.js +0 -72
- package/lib/Popup/viewPort.js +0 -367
package/lib/Radio/Radio.js
CHANGED
|
@@ -15,8 +15,6 @@ var _propTypes = require("./props/propTypes");
|
|
|
15
15
|
|
|
16
16
|
var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
17
17
|
|
|
18
|
-
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
19
|
-
|
|
20
18
|
var _Layout = require("../Layout");
|
|
21
19
|
|
|
22
20
|
var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
|
|
@@ -103,16 +101,13 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
103
101
|
customProps = _this$props3.customProps,
|
|
104
102
|
children = _this$props3.children,
|
|
105
103
|
a11y = _this$props3.a11y,
|
|
106
|
-
secondaryText = _this$props3.secondaryText,
|
|
107
104
|
renderRightPlaceholderNode = _this$props3.renderRightPlaceholderNode;
|
|
108
105
|
var _customClass$customRa = customClass.customRadioWrap,
|
|
109
106
|
customRadioWrap = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
110
107
|
_customClass$customRa2 = customClass.customRadio,
|
|
111
108
|
customRadio = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2,
|
|
112
109
|
_customClass$customLa = customClass.customLabel,
|
|
113
|
-
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa
|
|
114
|
-
_customClass$customSe = customClass.customSecondaryText,
|
|
115
|
-
customSecondaryText = _customClass$customSe === void 0 ? '' : _customClass$customSe;
|
|
110
|
+
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
|
|
116
111
|
var accessMode = isReadOnly ? _RadioModule["default"].readonly : disabled ? (0, _CssProvider["default"])('isDisabled') : _RadioModule["default"].pointer;
|
|
117
112
|
var toolTip = disabled ? disabledTitle : title ? title : null;
|
|
118
113
|
var isEditable = !(isReadOnly || disabled);
|
|
@@ -129,9 +124,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
129
124
|
var _customProps$Containe = customProps.ContainerProps,
|
|
130
125
|
ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
|
|
131
126
|
_customProps$LabelPro = customProps.LabelProps,
|
|
132
|
-
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro
|
|
133
|
-
_customProps$secondar = customProps.secondaryTextProps,
|
|
134
|
-
secondaryTextProps = _customProps$secondar === void 0 ? {} : _customProps$secondar;
|
|
127
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro;
|
|
135
128
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
136
129
|
dataId: value ? value.toLowerCase() : 'RadioComp',
|
|
137
130
|
isCover: false,
|
|
@@ -150,8 +143,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
150
143
|
"aria-labelledby": ariaLabelledby,
|
|
151
144
|
"aria-readonly": ariaReadonly
|
|
152
145
|
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
153
|
-
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(!isEditable ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio, " ").concat(!isEditable ? "".concat(_RadioModule["default"].disabled) : ''
|
|
154
|
-
align: secondaryText ? "start" : undefined
|
|
146
|
+
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(!isEditable ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio, " ").concat(!isEditable ? "".concat(_RadioModule["default"].disabled) : '')
|
|
155
147
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
156
148
|
type: "hidden",
|
|
157
149
|
id: id,
|
|
@@ -172,10 +164,10 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
172
164
|
cy: "20",
|
|
173
165
|
r: "11.03",
|
|
174
166
|
className: "".concat(_RadioModule["default"].centerPath)
|
|
175
|
-
}) : null))),
|
|
167
|
+
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
176
168
|
flexible: true,
|
|
177
|
-
className: _RadioModule["default"].
|
|
178
|
-
},
|
|
169
|
+
className: "".concat(_RadioModule["default"].text, " ").concat(disabled ? "".concat(_RadioModule["default"].disabled) : '')
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
179
171
|
text: text,
|
|
180
172
|
palette: labelPalette,
|
|
181
173
|
size: labelSize,
|
|
@@ -184,14 +176,8 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
184
176
|
dataId: "".concat(text, "_label"),
|
|
185
177
|
variant: variant,
|
|
186
178
|
title: toolTip ? toolTip : text,
|
|
187
|
-
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', "
|
|
188
|
-
}, LabelProps)),
|
|
189
|
-
$ui_size: "12",
|
|
190
|
-
$ui_lineHeight: "1.2"
|
|
191
|
-
}, secondaryTextProps, {
|
|
192
|
-
$i18n_dataTitle: toolTip ? null : secondaryText,
|
|
193
|
-
$ui_className: "".concat(_RadioModule["default"].secondaryText, " ").concat(customSecondaryText)
|
|
194
|
-
}), secondaryText) : null), children, renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
|
|
179
|
+
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(isEditable ? _RadioModule["default"].pointer : '', " ").concat(isReadOnly ? _RadioModule["default"].readonly : '', " ").concat(customLabel)
|
|
180
|
+
}, LabelProps))), children, renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
|
|
195
181
|
}
|
|
196
182
|
}]);
|
|
197
183
|
|
|
@@ -10,25 +10,20 @@
|
|
|
10
10
|
}[dir=ltr] .varClass {
|
|
11
11
|
--radio_label_margin: 0 0 0 var(--zd_size6);
|
|
12
12
|
}[dir=rtl] .varClass {
|
|
13
|
-
--radio_label_margin: 0
|
|
13
|
+
--radio_label_margin: 0 var(--zd_size6) 0 0;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
.container {
|
|
17
16
|
composes: varClass;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
.pointer {
|
|
21
19
|
cursor: pointer;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
.readonly, .disabled {
|
|
25
22
|
cursor: default;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
.disabled {
|
|
29
25
|
opacity: 0.7
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
.radio {
|
|
33
28
|
composes: offSelection from '../common/common.module.css';
|
|
34
29
|
width: var(--radio_width);
|
|
@@ -37,12 +32,10 @@
|
|
|
37
32
|
background: var(--radio_bg_color);
|
|
38
33
|
border-radius: 50%;
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
.radio,
|
|
42
36
|
.centerPath {
|
|
43
37
|
fill: var(--radio_fill);
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
.filled {
|
|
47
40
|
--radio_bg_color: var(--zdt_radio_default_bg);
|
|
48
41
|
}
|
|
@@ -51,66 +44,48 @@
|
|
|
51
44
|
--radio_width: var(--zd_size16);
|
|
52
45
|
--radio_height: var(--zd_size16);
|
|
53
46
|
}
|
|
54
|
-
|
|
55
47
|
.small {
|
|
56
48
|
--radio_width: var(--zd_size13);
|
|
57
49
|
--radio_height: var(--zd_size13);
|
|
58
50
|
}
|
|
59
|
-
|
|
60
|
-
.medium.withSecondaryText {
|
|
61
|
-
margin-top: var(--zd_size1) ;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.small.withSecondaryText {
|
|
65
|
-
margin-top: var(--zd_size3) ;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
51
|
.radioLabel {
|
|
69
52
|
font-size: 0 ;
|
|
70
53
|
display: block;
|
|
71
54
|
}
|
|
72
|
-
|
|
73
55
|
.rdBox {
|
|
74
56
|
fill: none;
|
|
75
57
|
stroke-width: var(--radio_stroke_width);
|
|
76
58
|
stroke-linecap: round;
|
|
77
59
|
stroke: inherit;
|
|
78
60
|
}
|
|
79
|
-
|
|
80
61
|
.centerPath {
|
|
81
62
|
--radio_fill: inherit;
|
|
82
63
|
stroke-width: var(--radio_inner_stroke_width);
|
|
83
64
|
transform-origin: center;
|
|
84
65
|
}
|
|
85
|
-
|
|
86
66
|
[dir=ltr] .checked .centerPath {
|
|
87
67
|
animation: circleAnimate var(--zd_transition3) ease forwards;
|
|
88
68
|
}
|
|
89
|
-
|
|
90
69
|
[dir=rtl] .checked .centerPath {
|
|
91
70
|
animation: circleAnimate var(--zd_transition3) ease forwards;
|
|
92
71
|
}
|
|
93
|
-
|
|
94
72
|
.rdBoxprimary,
|
|
95
73
|
.hoverEfffect:hover .hoverprimary
|
|
96
|
-
|
|
97
74
|
/* .hoverEfffect:focus .hoverprimary */
|
|
98
|
-
|
|
75
|
+
{
|
|
99
76
|
--radio_stroke_color: var(--zdt_radio_primary_stroke);
|
|
100
77
|
}
|
|
101
78
|
|
|
102
79
|
.rdBoxdanger,
|
|
103
80
|
.hoverEfffect:hover .hoverdanger
|
|
104
|
-
|
|
105
81
|
/* .hoverEfffect:focus .hoverdanger */
|
|
106
|
-
|
|
82
|
+
{
|
|
107
83
|
--radio_stroke_color: var(--zdt_radio_danger_stroke);
|
|
108
84
|
}
|
|
109
85
|
|
|
110
86
|
.centerPathprimary {
|
|
111
87
|
--radio_fill: var(--zdt_radio_primary_fill);
|
|
112
88
|
}
|
|
113
|
-
|
|
114
89
|
.centerPathdanger {
|
|
115
90
|
--radio_fill: var(--zdt_radio_danger_fill);
|
|
116
91
|
}
|
|
@@ -127,22 +102,14 @@
|
|
|
127
102
|
--label_text_color: var(--zdt_radio_label_danger_text);
|
|
128
103
|
}
|
|
129
104
|
|
|
130
|
-
.
|
|
131
|
-
color: var(--zdt_radio_secondary_text);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.labelContainer {
|
|
135
|
-
composes: dflex flexcolumn from '../common/common.module.css';
|
|
136
|
-
gap: var(--zd_size4) ;
|
|
105
|
+
.text {
|
|
137
106
|
margin: var(--radio_label_margin);
|
|
138
107
|
}
|
|
139
|
-
|
|
140
108
|
@keyframes circleAnimate {
|
|
141
109
|
0% {
|
|
142
110
|
transform: scale(0);
|
|
143
111
|
}
|
|
144
|
-
|
|
145
112
|
100% {
|
|
146
113
|
transform: scale(1);
|
|
147
114
|
}
|
|
148
|
-
}
|
|
115
|
+
}
|
|
@@ -243,14 +243,4 @@ describe('Radio', function () {
|
|
|
243
243
|
|
|
244
244
|
expect(asFragment()).toMatchSnapshot();
|
|
245
245
|
});
|
|
246
|
-
test('rendering secondaryText with checked state', function () {
|
|
247
|
-
var _render25 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
248
|
-
secondaryText: "Secondary text",
|
|
249
|
-
text: "Radio Text",
|
|
250
|
-
checked: true
|
|
251
|
-
})),
|
|
252
|
-
asFragment = _render25.asFragment;
|
|
253
|
-
|
|
254
|
-
expect(asFragment()).toMatchSnapshot();
|
|
255
|
-
});
|
|
256
246
|
});
|