@bonlineza/luxity-lib 2.39.6 → 2.39.7
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/Accordion.js +352 -342
- package/AddInterest.js +3141 -3135
- package/AddProductInterest.js +7584 -1011
- package/BrandSelector.js +861 -854
- package/Checkbox.js +250 -240
- package/CheckboxButton.js +236 -229
- package/CommunicationPreferenceOptionsRenderer.js +568 -560
- package/CommunicationPreferenceSection.js +659 -651
- package/CommunicationPreferences.js +2402 -2394
- package/ConditionSelector.js +859 -852
- package/CountryCodeSelect.js +6650 -79
- package/CurrencyInputFormatter.js +96 -86
- package/CurrencySelect.js +227 -219
- package/DropdownSelector.js +6820 -211
- package/GALink.js +51 -43
- package/GenderSelector.js +362 -355
- package/GraphQLDropdownSelector.js +11878 -5308
- package/GraphQLMultiSelector.js +601 -593
- package/IconHeader.js +126 -118
- package/IconWrapper.js +25 -17
- package/InterestCatSelector.js +432 -424
- package/InterestItem.js +470 -462
- package/Interests.js +11286 -4716
- package/InterestsSubheading.js +41 -33
- package/InvertedTextButton.js +175 -167
- package/LuxityAppSideNav.js +189 -181
- package/LuxityDesktopHeader.js +1363 -1355
- package/LuxityFooter.js +2236 -2228
- package/LuxityGraphQLDropdownSelector.js +11963 -5393
- package/LuxityGraphQLMultiselector.js +785 -778
- package/LuxityMobileHeader.js +1794 -1786
- package/LuxityPageReady.js +209 -199
- package/LuxityProductInterestItem.js +367 -359
- package/LuxitySideNav.js +673 -665
- package/MaterialSelector.js +11993 -5423
- package/ModelSelector.js +11993 -5423
- package/NotificationDropDown.js +7029 -459
- package/Notify.js +32 -20
- package/OutlinePrimaryButton.js +142 -134
- package/PriceRangeSelector.js +1270 -1264
- package/PrimaryButton.js +137 -129
- package/RadioButtons.js +318 -308
- package/RangeSlider.js +1039 -1033
- package/RareStepFooter.js +264 -257
- package/RareStepHeader.js +808 -801
- package/ReactSelectWrapper.js +6604 -33
- package/SecondaryButton.js +152 -144
- package/ShoeSizeRangeSelector.js +1153 -1147
- package/ShoeSizeSelector.js +1154 -1146
- package/SimpleErrorBoundary.js +138 -130
- package/StyleSelector.js +861 -854
- package/TextButton.js +143 -135
- package/Tooltip.js +184 -176
- package/Tracking.js +25 -15
- package/WrapperButton.js +58 -50
- package/build/bundle.css +1 -1
- package/build/bundle.js +17236 -10632
- package/build/constants.js +45 -32
- package/package.json +2 -2
- package/svg/Accessories.js +42 -34
- package/svg/Account.js +38 -30
- package/svg/Add.js +39 -31
- package/svg/ArrowRight.js +36 -28
- package/svg/Bags.js +48 -40
- package/svg/BurgerMenu.js +32 -24
- package/svg/Calendar.js +106 -98
- package/svg/CalendarCircled.js +108 -100
- package/svg/CheckCircled.js +40 -32
- package/svg/Close.js +37 -29
- package/svg/Clothing.js +44 -36
- package/svg/Dot.js +40 -32
- package/svg/Edit.js +35 -27
- package/svg/Eye.js +36 -28
- package/svg/FileAttach.js +36 -28
- package/svg/FileAttachCircled.js +38 -30
- package/svg/Jewellery.js +57 -49
- package/svg/LightBulb.js +66 -58
- package/svg/Logo.js +140 -132
- package/svg/LuxityMenu.js +36 -28
- package/svg/Minus.js +37 -29
- package/svg/MobileAvatar.js +36 -28
- package/svg/MyOrder.js +44 -36
- package/svg/MyPayment.js +44 -36
- package/svg/MyProfile.js +52 -44
- package/svg/MySale.js +39 -31
- package/svg/Notification.js +38 -30
- package/svg/PointerDown.js +36 -28
- package/svg/Search.js +35 -27
- package/svg/Shoes.js +45 -37
- package/svg/SvgWrapper.js +21 -13
- package/svg/Trash.js +40 -32
- package/svg/Watches.js +55 -47
package/CheckboxButton.js
CHANGED
|
@@ -1,263 +1,270 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('@bonlineza/b-lib/functions'), require('styled-components')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['react', '@bonlineza/b-lib/functions', 'styled-components'], factory) :
|
|
4
|
+
(global = global || self, global.CheckboxButton = factory(global.React, global.function, global.styled));
|
|
5
|
+
}(this, (function (React, functions, styled) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var React__default = 'default' in React ? React['default'] : React;
|
|
8
|
+
var styled__default = 'default' in styled ? styled['default'] : styled;
|
|
9
|
+
|
|
10
|
+
function _extends() {
|
|
11
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
12
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
+
var source = arguments[i];
|
|
14
|
+
|
|
15
|
+
for (var key in source) {
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
+
target[key] = source[key];
|
|
18
|
+
}
|
|
13
19
|
}
|
|
14
20
|
}
|
|
21
|
+
|
|
22
|
+
return target;
|
|
23
|
+
};
|
|
24
|
+
return _extends.apply(this, arguments);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
|
+
if (source == null) return {};
|
|
29
|
+
var target = {};
|
|
30
|
+
var sourceKeys = Object.keys(source);
|
|
31
|
+
var key, i;
|
|
32
|
+
|
|
33
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
34
|
+
key = sourceKeys[i];
|
|
35
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
36
|
+
target[key] = source[key];
|
|
15
37
|
}
|
|
16
38
|
|
|
17
39
|
return target;
|
|
18
|
-
};
|
|
19
|
-
return _extends.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
23
|
-
if (source == null) return {};
|
|
24
|
-
var target = {};
|
|
25
|
-
var sourceKeys = Object.keys(source);
|
|
26
|
-
var key, i;
|
|
27
|
-
|
|
28
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
29
|
-
key = sourceKeys[i];
|
|
30
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
31
|
-
target[key] = source[key];
|
|
32
40
|
}
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _objectWithoutProperties(source, excluded) {
|
|
38
|
-
if (source == null) return {};
|
|
42
|
+
function _objectWithoutProperties(source, excluded) {
|
|
43
|
+
if (source == null) return {};
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
var key, i;
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
if (Object.getOwnPropertySymbols) {
|
|
50
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
53
|
+
key = sourceSymbolKeys[i];
|
|
54
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
55
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
56
|
+
target[key] = source[key];
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return target;
|
|
56
|
-
}
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
if (!raw) {
|
|
60
|
-
raw = strings.slice(0);
|
|
60
|
+
return target;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
raw
|
|
65
|
-
|
|
63
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
64
|
+
if (!raw) {
|
|
65
|
+
raw = strings.slice(0);
|
|
66
66
|
}
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
69
|
+
raw: {
|
|
70
|
+
value: Object.freeze(raw)
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
}
|
|
75
|
+
function _slicedToArray(arr, i) {
|
|
76
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
77
|
+
}
|
|
77
78
|
|
|
78
|
-
function
|
|
79
|
-
|
|
79
|
+
function _arrayWithHoles(arr) {
|
|
80
|
+
if (Array.isArray(arr)) return arr;
|
|
81
|
+
}
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var _n = true;
|
|
84
|
-
var _d = false;
|
|
83
|
+
function _iterableToArrayLimit(arr, i) {
|
|
84
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
if (_i == null) return;
|
|
87
|
+
var _arr = [];
|
|
88
|
+
var _n = true;
|
|
89
|
+
var _d = false;
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
90
|
-
_arr.push(_s.value);
|
|
91
|
+
var _s, _e;
|
|
91
92
|
|
|
92
|
-
if (i && _arr.length === i) break;
|
|
93
|
-
}
|
|
94
|
-
} catch (err) {
|
|
95
|
-
_d = true;
|
|
96
|
-
_e = err;
|
|
97
|
-
} finally {
|
|
98
93
|
try {
|
|
99
|
-
|
|
94
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
95
|
+
_arr.push(_s.value);
|
|
96
|
+
|
|
97
|
+
if (i && _arr.length === i) break;
|
|
98
|
+
}
|
|
99
|
+
} catch (err) {
|
|
100
|
+
_d = true;
|
|
101
|
+
_e = err;
|
|
100
102
|
} finally {
|
|
101
|
-
|
|
103
|
+
try {
|
|
104
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
105
|
+
} finally {
|
|
106
|
+
if (_d) throw _e;
|
|
107
|
+
}
|
|
102
108
|
}
|
|
109
|
+
|
|
110
|
+
return _arr;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
113
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
114
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _arrayLikeToArray(arr, len) {
|
|
118
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
119
|
-
|
|
120
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
121
|
-
|
|
122
|
-
return arr2;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function _nonIterableRest() {
|
|
126
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
var theme = {
|
|
130
|
-
breakpoints: ['40em', '52em', '64em'],
|
|
131
|
-
space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
|
|
132
|
-
fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
|
|
133
|
-
marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
|
|
134
|
-
letterSpacings: ['-0.5px', '0px', '+0.5px'],
|
|
135
|
-
radii: ['0px', '2px', '4px', '8px'],
|
|
136
|
-
borderRadius: '6px',
|
|
137
|
-
colors: {
|
|
138
|
-
primary: '#000',
|
|
139
|
-
base: '#4e4949',
|
|
140
|
-
baseLt: '#817c7c',
|
|
141
|
-
borderColor: '#d8d8d8',
|
|
142
|
-
ntrlMin: '#fff',
|
|
143
|
-
ntrlMinTen: '#e6e6e6',
|
|
144
|
-
gray: '#efefef',
|
|
145
|
-
darkerGray: '#454141'
|
|
146
|
-
},
|
|
147
|
-
rareStepColors: {
|
|
148
|
-
primary: '#202b58',
|
|
149
|
-
secondary: '#ef5c2d',
|
|
150
|
-
ntrlMin: '#ffffff',
|
|
151
|
-
ntrl40: '#f4f4f4',
|
|
152
|
-
ntrl50: '#808080',
|
|
153
|
-
ntrl60: '#e8e8e8',
|
|
154
|
-
ntrl70: '#252525',
|
|
155
|
-
ntrlMax: '#000000'
|
|
156
|
-
},
|
|
157
|
-
rareStepFontWeights: {
|
|
158
|
-
normal: 400,
|
|
159
|
-
medium: 500,
|
|
160
|
-
semiBold: 600,
|
|
161
|
-
bold: 700
|
|
162
|
-
},
|
|
163
|
-
rareStepFontSize: {
|
|
164
|
-
h1: '36px',
|
|
165
|
-
h2: '30px',
|
|
166
|
-
h3: '24px',
|
|
167
|
-
h4: '20px',
|
|
168
|
-
h5: '16px',
|
|
169
|
-
h6: '14px',
|
|
170
|
-
footerTitle: '16px'
|
|
171
|
-
},
|
|
172
|
-
rareStepPageSizes: {
|
|
173
|
-
mobile: '500px',
|
|
174
|
-
tablet: '768px',
|
|
175
|
-
desktop: '992px',
|
|
176
|
-
screenl: '1280px',
|
|
177
|
-
screenxl: '1680px',
|
|
178
|
-
screenxxl: '1920px',
|
|
179
|
-
container: '1600px'
|
|
113
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
114
|
+
if (!o) return;
|
|
115
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
116
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
117
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
118
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
119
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
180
120
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
121
|
+
|
|
122
|
+
function _arrayLikeToArray(arr, len) {
|
|
123
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
124
|
+
|
|
125
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
126
|
+
|
|
127
|
+
return arr2;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function _nonIterableRest() {
|
|
131
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var theme = {
|
|
135
|
+
breakpoints: ['40em', '52em', '64em'],
|
|
136
|
+
space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
|
|
137
|
+
fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
|
|
138
|
+
marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
|
|
139
|
+
letterSpacings: ['-0.5px', '0px', '+0.5px'],
|
|
140
|
+
radii: ['0px', '2px', '4px', '8px'],
|
|
141
|
+
borderRadius: '6px',
|
|
142
|
+
colors: {
|
|
143
|
+
primary: '#000',
|
|
144
|
+
base: '#4e4949',
|
|
145
|
+
baseLt: '#817c7c',
|
|
146
|
+
borderColor: '#d8d8d8',
|
|
147
|
+
ntrlMin: '#fff',
|
|
148
|
+
ntrlMinTen: '#e6e6e6',
|
|
149
|
+
gray: '#efefef',
|
|
150
|
+
darkerGray: '#454141'
|
|
151
|
+
},
|
|
152
|
+
rareStepColors: {
|
|
153
|
+
primary: '#202b58',
|
|
154
|
+
secondary: '#ef5c2d',
|
|
155
|
+
ntrlMin: '#ffffff',
|
|
156
|
+
ntrl40: '#f4f4f4',
|
|
157
|
+
ntrl50: '#808080',
|
|
158
|
+
ntrl60: '#e8e8e8',
|
|
159
|
+
ntrl70: '#252525',
|
|
160
|
+
ntrlMax: '#000000'
|
|
161
|
+
},
|
|
162
|
+
rareStepFontWeights: {
|
|
163
|
+
normal: 400,
|
|
164
|
+
medium: 500,
|
|
165
|
+
semiBold: 600,
|
|
166
|
+
bold: 700
|
|
167
|
+
},
|
|
168
|
+
rareStepFontSize: {
|
|
169
|
+
h1: '36px',
|
|
170
|
+
h2: '30px',
|
|
171
|
+
h3: '24px',
|
|
172
|
+
h4: '20px',
|
|
173
|
+
h5: '16px',
|
|
174
|
+
h6: '14px',
|
|
175
|
+
footerTitle: '16px'
|
|
176
|
+
},
|
|
177
|
+
rareStepPageSizes: {
|
|
178
|
+
mobile: '500px',
|
|
179
|
+
tablet: '768px',
|
|
180
|
+
desktop: '992px',
|
|
181
|
+
screenl: '1280px',
|
|
182
|
+
screenxl: '1680px',
|
|
183
|
+
screenxxl: '1920px',
|
|
184
|
+
container: '1600px'
|
|
235
185
|
}
|
|
236
|
-
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
var themed = (function (Component) {
|
|
189
|
+
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
190
|
+
return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
|
|
191
|
+
theme: theme
|
|
192
|
+
}, /*#__PURE__*/React__default.createElement(Component, _extends({}, props, {
|
|
193
|
+
ref: ref
|
|
194
|
+
})));
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
var _excluded = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
199
|
+
|
|
200
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
201
|
+
var Content = styled__default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n transition: 200ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
202
|
+
return props.theme.colors.primary;
|
|
203
|
+
}, function (props) {
|
|
204
|
+
return props.theme.marginPaddings[0];
|
|
205
|
+
});
|
|
206
|
+
var InputText = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition: 200ms ease-in;\n margin-left: auto;\n margin-right: auto;\n"])));
|
|
207
|
+
var StyledLabel = styled__default.label(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n line-height: initial;\n display: block;\n box-sizing: border-box;\n transition: 200ms ease-in-out;\n text-align: center;\n\n &:hover ", " {\n color: ", ";\n }\n\n input {\n display: none;\n &:checked ~ ", " {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n &:checked ~ ", " ", " {\n color: ", ";\n }\n\n &:disabled ~ ", " {\n opacity: 0.5;\n cursor: not-allowed;\n }\n }\n"])), InputText, function (props) {
|
|
208
|
+
return props.theme.colors.primary;
|
|
209
|
+
}, Content, function (props) {
|
|
210
|
+
return props.theme.colors.primary;
|
|
211
|
+
}, function (props) {
|
|
212
|
+
return props.theme.colors.primary;
|
|
213
|
+
}, function (props) {
|
|
214
|
+
return props.theme.colors.ntrlMin;
|
|
215
|
+
}, Content, InputText, function (props) {
|
|
216
|
+
return props.theme.colors.ntrlMin;
|
|
217
|
+
}, Content);
|
|
218
|
+
/**
|
|
219
|
+
* CheckButton: Styled checkbox that resembles a button
|
|
220
|
+
* */
|
|
221
|
+
|
|
222
|
+
var CheckButton = function CheckButton(props) {
|
|
223
|
+
var title = props.title,
|
|
224
|
+
checked = props.checked,
|
|
225
|
+
renderIcon = props.renderIcon,
|
|
226
|
+
onChange = props.onChange,
|
|
227
|
+
checkedValue = props.checkedValue,
|
|
228
|
+
unCheckedValue = props.unCheckedValue,
|
|
229
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
230
|
+
|
|
231
|
+
var _React$useState = React__default.useState(checked),
|
|
232
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
233
|
+
checkedState = _React$useState2[0],
|
|
234
|
+
setCheck = _React$useState2[1];
|
|
235
|
+
|
|
236
|
+
var prevCheckState = functions.usePrevious(checkedState);
|
|
237
|
+
React__default.useEffect(function () {
|
|
238
|
+
if (prevCheckState !== checkedState) {
|
|
239
|
+
onChange(checkedState);
|
|
240
|
+
}
|
|
241
|
+
}, [checkedState, onChange, prevCheckState]);
|
|
242
|
+
|
|
243
|
+
var handleInputChange = function handleInputChange(e) {
|
|
244
|
+
var targetChecked = e.target.checked;
|
|
245
|
+
setCheck(targetChecked);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
249
|
+
defaultChecked: checked
|
|
250
|
+
}, restProps, {
|
|
251
|
+
type: "checkbox",
|
|
252
|
+
onChange: handleInputChange
|
|
253
|
+
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
254
|
+
};
|
|
237
255
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
256
|
+
CheckButton.defaultProps = {
|
|
257
|
+
title: '',
|
|
258
|
+
checked: false,
|
|
259
|
+
renderIcon: function renderIcon() {
|
|
260
|
+
return false;
|
|
261
|
+
},
|
|
262
|
+
onChange: function onChange() {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
241
265
|
};
|
|
266
|
+
var index = themed(CheckButton);
|
|
242
267
|
|
|
243
|
-
return
|
|
244
|
-
defaultChecked: checked
|
|
245
|
-
}, restProps, {
|
|
246
|
-
type: "checkbox",
|
|
247
|
-
onChange: handleInputChange
|
|
248
|
-
})), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
CheckButton.defaultProps = {
|
|
252
|
-
title: '',
|
|
253
|
-
checked: false,
|
|
254
|
-
renderIcon: function renderIcon() {
|
|
255
|
-
return false;
|
|
256
|
-
},
|
|
257
|
-
onChange: function onChange() {
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
var index = themed(CheckButton);
|
|
268
|
+
return index;
|
|
262
269
|
|
|
263
|
-
|
|
270
|
+
})));
|