@zohodesk/components 1.0.0-temp-217.2 → 1.0.0-temp-219

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 CHANGED
@@ -32,7 +32,12 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
- # 1.2.55 (yet to publish)
35
+ # 1.2.56
36
+
37
+ - **CheckBox**
38
+ - `data-selector-id` passing to Container component changed to `dataSelectorId`
39
+
40
+ # 1.2.55
36
41
 
37
42
  - **ListItemWithAvatar**
38
43
  - `AvatarTeamProps` and `AvatarProps` props has been added under the `customProps` group.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
+ import { ComponentCustomizer, PROP_CUSTOMIZE_TYPE } from '@zohodesk/dotkit/es/react/components/ComponentCustomizer';
4
5
  import cssJSLogic from "./css/cssJSLogic";
5
6
  import { mergeStyle } from '@zohodesk/utils';
6
7
  import style from "./css/Button.module.css";
@@ -12,7 +13,7 @@ toLowerCase check needed?
12
13
 
13
14
  /* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small','medium','large','xlarge','button_medium','button_small','primary','primaryfilled','danger','dangerfilled','plainprimary', 'plainsecondary', 'secondary', 'secondaryfilled', 'successFilled','tertiaryFilled'] }] */
14
15
 
15
- export default function Button(props) {
16
+ function Button(props) {
16
17
  let {
17
18
  text,
18
19
  disabled,
@@ -60,10 +61,17 @@ export default function Button(props) {
60
61
  className: loaderChildClass
61
62
  }))));
62
63
  }
64
+
63
65
  Button.defaultProps = defaultProps;
64
66
  Button.propTypes = propTypes; // if (__DOCS__) {
65
67
  // Button.docs = {
66
68
  // componentGroup: 'Form Elements',
67
69
  // folderName: 'Style Guide'
68
70
  // };
69
- // }
71
+ // }
72
+
73
+ export default ComponentCustomizer(Button, {
74
+ name: 'Button',
75
+ type: PROP_CUSTOMIZE_TYPE.excludedProps,
76
+ props: ['text', 'children']
77
+ });
@@ -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
- "data-selector-id": dataSelectorId || id,
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`]}` : ''}`
@@ -120,7 +120,7 @@ exports[`CheckBox component Should be render ID 1`] = `
120
120
  class="container pointer primary
121
121
  flex rowdir vCenter"
122
122
  data-id="checkBox"
123
- data-selector-id="container"
123
+ data-selector-id="checkBoxId"
124
124
  data-test-id="checkBox"
125
125
  role="checkbox"
126
126
  tabindex="0"
@@ -229,7 +229,7 @@ exports[`CheckBox component Should be render dataSelectorId 1`] = `
229
229
  class="container pointer primary
230
230
  inflex rowdir vCenter"
231
231
  data-id="checkBox"
232
- data-selector-id="container"
232
+ data-selector-id="dataSelectorIdCheck"
233
233
  data-test-id="checkBox"
234
234
  role="checkbox"
235
235
  tabindex="0"
@@ -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) {
@@ -2,6 +2,7 @@
2
2
  import React, { Component } from 'react';
3
3
  import { Select_defaultProps } from "./props/defaultProps";
4
4
  import { Select_propTypes } from "./props/propTypes";
5
+ import { ComponentCustomizer } from '@zohodesk/dotkit/es/react/components/ComponentCustomizer';
5
6
  /**** Components ****/
6
7
 
7
8
  import Popup from "../Popup/Popup";
@@ -964,7 +965,9 @@ let Select = Popup(SelectComponent);
964
965
  Select.defaultProps = SelectComponent.defaultProps;
965
966
  Select.propTypes = Select_propTypes;
966
967
  Select.displayName = 'Select';
967
- export default Select; // if (__DOCS__) {
968
+ export default ComponentCustomizer(Select, {
969
+ name: 'Select'
970
+ }); // if (__DOCS__) {
968
971
  // Select.docs = {
969
972
  // componentGroup: 'Form Elements',
970
973
  // folderName: 'Style Guide',
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
+ import { ComponentCustomizer, PROP_CUSTOMIZE_TYPE } from '@zohodesk/dotkit/es/react/components/ComponentCustomizer';
4
5
  import { Container, Box } from "../Layout";
5
6
  import Label from "../Label/Label";
6
- import LibraryContext from "../Provider/LibraryContextInit";
7
7
  import style from "./Switch.module.css";
8
- export default class Switch extends React.Component {
8
+
9
+ class Switch extends React.Component {
9
10
  constructor(props) {
10
11
  super(props);
11
12
  this.onChange = this.onChange.bind(this);
@@ -19,7 +20,7 @@ export default class Switch extends React.Component {
19
20
  onChange && onChange(!checked, e);
20
21
  }
21
22
 
22
- renderSwitch(context) {
23
+ render() {
23
24
  let {
24
25
  id,
25
26
  name,
@@ -49,8 +50,6 @@ export default class Switch extends React.Component {
49
50
  customLabel = ''
50
51
  } = customClass;
51
52
  size !== 'small' ? size = 'switch_medium' : size = 'switch_small';
52
- const isOnOffLabelEnabled = context.a11y_onOffLabel;
53
- const onOffLabelType = '';
54
53
  return /*#__PURE__*/React.createElement(Container, {
55
54
  align: "vertical",
56
55
  isCover: false,
@@ -78,26 +77,9 @@ export default class Switch extends React.Component {
78
77
  htmlFor: id,
79
78
  "data-id": dataId,
80
79
  "data-test-id": dataId,
81
- className: `${style.label} ${style[`${size}Label`]} ${customSwitch} ${onOffLabelType === 'labelOnTrack' && isOnOffLabelEnabled ? style.labelOnTrack : ''}`,
80
+ className: `${style.label} ${style[`${size}Label`]} ${customSwitch}`,
82
81
  tabIndex: isReadOnly || disabled ? '-1' : '0'
83
- }, /*#__PURE__*/React.createElement("div", {
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, {
82
+ })), text && /*#__PURE__*/React.createElement(Label, {
101
83
  text: text,
102
84
  palette: labelPalette,
103
85
  id: id,
@@ -109,15 +91,18 @@ export default class Switch extends React.Component {
109
91
  }));
110
92
  }
111
93
 
112
- render() {
113
- return /*#__PURE__*/React.createElement(LibraryContext.Consumer, null, context => this.renderSwitch(context));
114
- }
115
-
116
94
  }
95
+
117
96
  Switch.defaultProps = defaultProps;
118
97
  Switch.propTypes = propTypes; // if (__DOCS__) {
119
98
  // Switch.docs = {
120
99
  // componentGroup: 'Form Elements',
121
100
  // folderName: 'Style Guide'
122
101
  // };
123
- // }
102
+ // }
103
+
104
+ export default ComponentCustomizer(Switch, {
105
+ name: 'Switch',
106
+ type: PROP_CUSTOMIZE_TYPE.selectedProps,
107
+ propNames: ['size']
108
+ });
@@ -37,7 +37,7 @@
37
37
  {
38
38
  --switch_off_bg_color: var(--zdt_switch_effect_off_bg);
39
39
  }
40
- .thumb {
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
- .checked+label .thumb {
62
- right: var(--zd_size1) ;
63
- left: auto ;
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(--zd_size12) ;
68
+ height: var(--zd_size9) ;
76
69
  width: var(--zd_size22) ;
77
- bottom: var(--zd_size1) ;
70
+ top: calc( var(--zd_size2) * -1 ) ;
78
71
  left: var(--zd_size2) ;
79
72
  }
80
- .switch_smallLabel .thumb{
81
- width: var(--zd_size10) ;
82
- height: var(--zd_size10) ;
83
- top: var(--zd_size1) ;
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(--zd_size16) ;
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
- .switch_smallLabel.labelOnTrack{
97
- width: var(--zd_size32) ;
98
- }
99
- .switch_mediumLabel.labelOnTrack{
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
  }
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
+ import { ComponentCustomizer } from '@zohodesk/dotkit/es/react/components/ComponentCustomizer';
4
5
  /* eslint css-modules/no-unused-class: [2, { markAsUsed: ['xmedium', 'medium', 'small', 'default', 'primary', 'secondary'] }] */
5
6
 
6
7
  import style from "./TextBox.module.css";
7
- export default class TextBox extends React.PureComponent {
8
+
9
+ class TextBox extends React.PureComponent {
8
10
  constructor(props) {
9
11
  super(props);
10
12
  this.onChange = this.onChange.bind(this);
@@ -178,6 +180,7 @@ export default class TextBox extends React.PureComponent {
178
180
  }
179
181
 
180
182
  }
183
+
181
184
  TextBox.defaultProps = defaultProps;
182
185
  TextBox.propTypes = propTypes; // if (__DOCS__) {
183
186
  // Textbox.docs = {
@@ -186,4 +189,8 @@ TextBox.propTypes = propTypes; // if (__DOCS__) {
186
189
  // external: true,
187
190
  // description: ' '
188
191
  // };
189
- // }
192
+ // }
193
+
194
+ export default ComponentCustomizer(TextBox, {
195
+ name: 'TextBox'
196
+ });
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";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = Button;
6
+ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -11,6 +11,8 @@ var _defaultProps = require("./props/defaultProps");
11
11
 
12
12
  var _propTypes = require("./props/propTypes");
13
13
 
14
+ var _ComponentCustomizer = require("@zohodesk/dotkit/es/react/components/ComponentCustomizer");
15
+
14
16
  var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
15
17
 
16
18
  var _utils = require("@zohodesk/utils");
@@ -81,4 +83,12 @@ Button.propTypes = _propTypes.propTypes; // if (__DOCS__) {
81
83
  // componentGroup: 'Form Elements',
82
84
  // folderName: 'Style Guide'
83
85
  // };
84
- // }
86
+ // }
87
+
88
+ var _default = (0, _ComponentCustomizer.ComponentCustomizer)(Button, {
89
+ name: 'Button',
90
+ type: _ComponentCustomizer.PROP_CUSTOMIZE_TYPE.excludedProps,
91
+ props: ['text', 'children']
92
+ });
93
+
94
+ exports["default"] = _default;
@@ -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
- "data-selector-id": dataSelectorId || id
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", {
@@ -120,7 +120,7 @@ exports[`CheckBox component Should be render ID 1`] = `
120
120
  class="container pointer primary
121
121
  flex rowdir vCenter"
122
122
  data-id="checkBox"
123
- data-selector-id="container"
123
+ data-selector-id="checkBoxId"
124
124
  data-test-id="checkBox"
125
125
  role="checkbox"
126
126
  tabindex="0"
@@ -229,7 +229,7 @@ exports[`CheckBox component Should be render dataSelectorId 1`] = `
229
229
  class="container pointer primary
230
230
  inflex rowdir vCenter"
231
231
  data-id="checkBox"
232
- data-selector-id="container"
232
+ data-selector-id="dataSelectorIdCheck"
233
233
  data-test-id="checkBox"
234
234
  role="checkbox"
235
235
  tabindex="0"
@@ -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],
@@ -13,6 +13,8 @@ var _defaultProps = require("./props/defaultProps");
13
13
 
14
14
  var _propTypes = require("./props/propTypes");
15
15
 
16
+ var _ComponentCustomizer = require("@zohodesk/dotkit/es/react/components/ComponentCustomizer");
17
+
16
18
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
17
19
 
18
20
  var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
@@ -1011,7 +1013,10 @@ var Select = (0, _Popup["default"])(SelectComponent);
1011
1013
  Select.defaultProps = SelectComponent.defaultProps;
1012
1014
  Select.propTypes = _propTypes.Select_propTypes;
1013
1015
  Select.displayName = 'Select';
1014
- var _default = Select; // if (__DOCS__) {
1016
+
1017
+ var _default = (0, _ComponentCustomizer.ComponentCustomizer)(Select, {
1018
+ name: 'Select'
1019
+ }); // if (__DOCS__) {
1015
1020
  // Select.docs = {
1016
1021
  // componentGroup: 'Form Elements',
1017
1022
  // folderName: 'Style Guide',
@@ -1022,4 +1027,5 @@ var _default = Select; // if (__DOCS__) {
1022
1027
  // Select.propTypes = SelectComponent.propTypes;
1023
1028
  // }
1024
1029
 
1030
+
1025
1031
  exports["default"] = _default;
@@ -13,12 +13,12 @@ var _defaultProps = require("./props/defaultProps");
13
13
 
14
14
  var _propTypes = require("./props/propTypes");
15
15
 
16
+ var _ComponentCustomizer = require("@zohodesk/dotkit/es/react/components/ComponentCustomizer");
17
+
16
18
  var _Layout = require("../Layout");
17
19
 
18
20
  var _Label = _interopRequireDefault(require("../Label/Label"));
19
21
 
20
- var _LibraryContextInit = _interopRequireDefault(require("../Provider/LibraryContextInit"));
21
-
22
22
  var _SwitchModule = _interopRequireDefault(require("./Switch.module.css"));
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -69,8 +69,8 @@ var Switch = /*#__PURE__*/function (_React$Component) {
69
69
  onChange && onChange(!checked, e);
70
70
  }
71
71
  }, {
72
- key: "renderSwitch",
73
- value: function renderSwitch(context) {
72
+ key: "render",
73
+ value: function render() {
74
74
  var _this$props2 = this.props,
75
75
  id = _this$props2.id,
76
76
  name = _this$props2.name,
@@ -101,8 +101,6 @@ var Switch = /*#__PURE__*/function (_React$Component) {
101
101
  _customClass$customLa = customClass.customLabel,
102
102
  customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
103
103
  size !== 'small' ? size = 'switch_medium' : size = 'switch_small';
104
- var isOnOffLabelEnabled = context.a11y_onOffLabel;
105
- var onOffLabelType = '';
106
104
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
107
105
  align: "vertical",
108
106
  isCover: false,
@@ -129,26 +127,9 @@ var Switch = /*#__PURE__*/function (_React$Component) {
129
127
  htmlFor: id,
130
128
  "data-id": dataId,
131
129
  "data-test-id": dataId,
132
- className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch, " ").concat(onOffLabelType === 'labelOnTrack' && isOnOffLabelEnabled ? _SwitchModule["default"].labelOnTrack : ''),
130
+ className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch),
133
131
  tabIndex: isReadOnly || disabled ? '-1' : '0'
134
- }, /*#__PURE__*/_react["default"].createElement("div", {
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({
132
+ })), text && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
152
133
  text: text,
153
134
  palette: labelPalette,
154
135
  id: id,
@@ -158,25 +139,23 @@ var Switch = /*#__PURE__*/function (_React$Component) {
158
139
  customClass: customLabel
159
140
  }, LabelProps)));
160
141
  }
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
142
  }]);
171
143
 
172
144
  return Switch;
173
145
  }(_react["default"].Component);
174
146
 
175
- exports["default"] = Switch;
176
147
  Switch.defaultProps = _defaultProps.defaultProps;
177
148
  Switch.propTypes = _propTypes.propTypes; // if (__DOCS__) {
178
149
  // Switch.docs = {
179
150
  // componentGroup: 'Form Elements',
180
151
  // folderName: 'Style Guide'
181
152
  // };
182
- // }
153
+ // }
154
+
155
+ var _default = (0, _ComponentCustomizer.ComponentCustomizer)(Switch, {
156
+ name: 'Switch',
157
+ type: _ComponentCustomizer.PROP_CUSTOMIZE_TYPE.selectedProps,
158
+ propNames: ['size']
159
+ });
160
+
161
+ exports["default"] = _default;