@occmundial/occ-atomic 2.0.0 → 3.0.0-beta.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +148 -0
- package/build/Autocomplete/Autocomplete.js +2 -5
- package/build/Autocomplete/Autocomplete.test.js +17 -9
- package/build/Autocomplete/styles.js +5 -5
- package/build/Banner/Banner.js +24 -38
- package/build/Button/Button.js +28 -7
- package/build/Button/__snapshots__/Button.test.js.snap +0 -2
- package/build/Button/styles.js +0 -2
- package/build/Checkbox/Checkbox.js +1 -0
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +59 -24
- package/build/Checkbox/styles.js +68 -23
- package/build/Droplist/Droplist.js +37 -49
- package/build/Droplist/Droplist.test.js +2 -2
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +57 -25
- package/build/Droplist/styles.js +62 -32
- package/build/Fab/__snapshots__/Fab.test.js.snap +1 -0
- package/build/Pill/Choice/Choice.js +71 -81
- package/build/Pill/Choice/styles.js +61 -20
- package/build/Pill/Group/Group.js +5 -2
- package/build/Pill/Group/styles.js +31 -31
- package/build/Pill/Pill.js +4 -3
- package/build/Pill/Stack/Stack.js +7 -12
- package/build/Pill/Stack/styles.js +46 -33
- package/build/Pill/__snapshots__/Pill.test.js.snap +14 -24
- package/build/Pill/styles.js +22 -27
- package/build/Radio/Radio.js +24 -3
- package/build/Radio/__snapshots__/Radio.test.js.snap +16 -7
- package/build/Radio/styles.js +23 -12
- package/build/SlideToggle/SlideToggle.js +1 -0
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +30 -10
- package/build/SlideToggle/styles.js +38 -14
- package/build/Text/Text.js +4 -2
- package/build/Text/styles.js +2 -1
- package/build/TextField/TextField.js +77 -104
- package/build/TextField/TextField.test.js +7 -15
- package/build/TextField/__snapshots__/TextField.test.js.snap +59 -145
- package/build/TextField/styles.js +81 -149
- package/build/Tip/Tip.js +42 -88
- package/build/Tip/Tip.test.js +0 -6
- package/build/Tip/TipText/index.js +41 -0
- package/build/Tip/__snapshots__/Tip.test.js.snap +79 -12
- package/build/Tip/styles.js +79 -26
- package/build/tokens/colors.json +41 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,112 @@
|
|
1
|
+
# [3.0.0-beta.10](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2024-06-06)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Checkbox redesigned and documentation created ([48fbc8d](https://github.com/occmundial/occ-atomic/commit/48fbc8d0a912c300324fe244e9692a49f3a152b5))
|
7
|
+
* Remove updates to component ([ab71716](https://github.com/occmundial/occ-atomic/commit/ab71716991a7700134dbafe0d8eda63e18ff8eab))
|
8
|
+
|
9
|
+
# [3.0.0-beta.9](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2024-06-06)
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* Move use memo before early return ([3d290c9](https://github.com/occmundial/occ-atomic/commit/3d290c9675fb24e20d131fdbaeef023920f3e439))
|
15
|
+
|
16
|
+
# [3.0.0-beta.8](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2024-06-06)
|
17
|
+
|
18
|
+
|
19
|
+
### Bug Fixes
|
20
|
+
|
21
|
+
* Add border for promote alert ([5050f18](https://github.com/occmundial/occ-atomic/commit/5050f187b60f98118654ecbbe3e2cba7b29790ab))
|
22
|
+
* Add min height to tip container ([579d263](https://github.com/occmundial/occ-atomic/commit/579d26306d59ce73b5084f9cd632dd12ed162fc5))
|
23
|
+
* Resolve conflicts ([0a15dfa](https://github.com/occmundial/occ-atomic/commit/0a15dfa8d8da38a724d71622809f0e02c5bed0e9))
|
24
|
+
|
25
|
+
|
26
|
+
### Features
|
27
|
+
|
28
|
+
* Render tip in banner component ([239e2c8](https://github.com/occmundial/occ-atomic/commit/239e2c82c23d79698bd912931b314ceddf252fb4))
|
29
|
+
* Update tip component with new design tokens ([b2367fc](https://github.com/occmundial/occ-atomic/commit/b2367fcaade288609df4c841c91fb308841ae4b0))
|
30
|
+
|
31
|
+
|
32
|
+
### Performance Improvements
|
33
|
+
|
34
|
+
* Memoize text replace in tip text component ([69180ce](https://github.com/occmundial/occ-atomic/commit/69180ce9cb1e812769e31a837257d8c8e6f24199))
|
35
|
+
|
36
|
+
# [3.0.0-beta.7](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2024-06-06)
|
37
|
+
|
38
|
+
|
39
|
+
### Bug Fixes
|
40
|
+
|
41
|
+
* Fix radio styles and add a form nav behavior ([59f0320](https://github.com/occmundial/occ-atomic/commit/59f03207a45b1ec27e02970668cffe2cfd5931a9))
|
42
|
+
* Ignore tab index if radio element is disabled ([e479098](https://github.com/occmundial/occ-atomic/commit/e4790982a127408a474f688a4647612ef8fbb446))
|
43
|
+
|
44
|
+
# [3.0.0-beta.6](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2024-06-05)
|
45
|
+
|
46
|
+
|
47
|
+
### Bug Fixes
|
48
|
+
|
49
|
+
* Text new emphasis props ([bc3e934](https://github.com/occmundial/occ-atomic/commit/bc3e934299230cb0b3a0fddeb4c8fcd2b72a052f))
|
50
|
+
|
51
|
+
# [3.0.0-beta.5](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2024-06-04)
|
52
|
+
|
53
|
+
|
54
|
+
### Bug Fixes
|
55
|
+
|
56
|
+
* Remove fixed size for right-side icon in button ([1228467](https://github.com/occmundial/occ-atomic/commit/1228467ba0d107bba0e70603c28a3ccffaec306b))
|
57
|
+
|
58
|
+
# [3.0.0-beta.4](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2024-06-04)
|
59
|
+
|
60
|
+
|
61
|
+
### Bug Fixes
|
62
|
+
|
63
|
+
* Make toggle unshrinkable inside a flex box ([6067fba](https://github.com/occmundial/occ-atomic/commit/6067fbad2276824bcec0c35748beea0006b73300))
|
64
|
+
|
65
|
+
# [3.0.0-beta.3](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2024-05-30)
|
66
|
+
|
67
|
+
|
68
|
+
### Bug Fixes
|
69
|
+
|
70
|
+
* Remove bg from group pill on focus ([6cdb2f1](https://github.com/occmundial/occ-atomic/commit/6cdb2f1573b6a297810d4e075c462ccc2b9140b1))
|
71
|
+
* Remove repeated selectors and change usecallback dependencies ([4d23be0](https://github.com/occmundial/occ-atomic/commit/4d23be0f88672df2e3c39578e3a4638385c23594))
|
72
|
+
* Resolve conflicts with beta ([0e51771](https://github.com/occmundial/occ-atomic/commit/0e5177122818b55d51a28d013c10164f18abaf97))
|
73
|
+
|
74
|
+
|
75
|
+
### Features
|
76
|
+
|
77
|
+
* Disabled all group items when pill disabled prop is true ([922cb8a](https://github.com/occmundial/occ-atomic/commit/922cb8a0146f21a0ad3a49da87321a3ebc6c6feb))
|
78
|
+
* Update pill styles with design tokens ([a6caadc](https://github.com/occmundial/occ-atomic/commit/a6caadc0170b290865332278fa4b3850ee452faa))
|
79
|
+
|
80
|
+
# [3.0.0-beta.2](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2024-05-28)
|
81
|
+
|
82
|
+
|
83
|
+
### Features
|
84
|
+
|
85
|
+
* Updated toogle component and documentation ([fad2eca](https://github.com/occmundial/occ-atomic/commit/fad2eca12daa8802b85b5f35bab564b90ce9bd10))
|
86
|
+
|
87
|
+
# [3.0.0-beta.1](https://github.com/occmundial/occ-atomic/compare/v2.0.0...v3.0.0-beta.1) (2024-05-27)
|
88
|
+
|
89
|
+
|
90
|
+
### Bug Fixes
|
91
|
+
|
92
|
+
* Add events to Button ([cbac2b8](https://github.com/occmundial/occ-atomic/commit/cbac2b8a19cc93c76529a2aa4f91a685a5b7f9c7))
|
93
|
+
* Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
|
94
|
+
* Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
|
95
|
+
* Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
|
96
|
+
* Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
|
97
|
+
|
98
|
+
|
99
|
+
### Features
|
100
|
+
|
101
|
+
* Update Autocomplete styles ([fa449be](https://github.com/occmundial/occ-atomic/commit/fa449be2322c75857e6350ee9dee596cd441b033))
|
102
|
+
* Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
|
103
|
+
* Update TextField styles ([0d0218e](https://github.com/occmundial/occ-atomic/commit/0d0218ea0df146da1b07482676eb99ad57d186b7))
|
104
|
+
|
105
|
+
|
106
|
+
### BREAKING CHANGES
|
107
|
+
|
108
|
+
* Remove the lockHeight and searchField properties
|
109
|
+
|
1
110
|
# [2.0.0](https://github.com/occmundial/occ-atomic/compare/v1.39.1...v2.0.0) (2024-05-27)
|
2
111
|
|
3
112
|
|
@@ -55,6 +164,45 @@
|
|
55
164
|
|
56
165
|
* The themes of the Button component have changed to match the styles of the button in the new design system. The current themes have slightly different names to the new ones but they all have a corresponding new theme that matches, except for the ghostPink theme.
|
57
166
|
|
167
|
+
# [2.0.0-beta.19](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.18...v2.0.0-beta.19) (2024-05-27)
|
168
|
+
|
169
|
+
|
170
|
+
### Features
|
171
|
+
|
172
|
+
* Update Autocomplete styles ([fa449be](https://github.com/occmundial/occ-atomic/commit/fa449be2322c75857e6350ee9dee596cd441b033))
|
173
|
+
|
174
|
+
# [2.0.0-beta.18](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.17...v2.0.0-beta.18) (2024-05-21)
|
175
|
+
|
176
|
+
|
177
|
+
### Bug Fixes
|
178
|
+
|
179
|
+
* Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
|
180
|
+
* Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
|
181
|
+
* Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
|
182
|
+
* Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
|
183
|
+
|
184
|
+
|
185
|
+
### Features
|
186
|
+
|
187
|
+
* Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
|
188
|
+
|
189
|
+
# [2.0.0-beta.17](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2024-05-21)
|
190
|
+
|
191
|
+
|
192
|
+
### Bug Fixes
|
193
|
+
|
194
|
+
* Add events to Button ([cbac2b8](https://github.com/occmundial/occ-atomic/commit/cbac2b8a19cc93c76529a2aa4f91a685a5b7f9c7))
|
195
|
+
|
196
|
+
|
197
|
+
### Features
|
198
|
+
|
199
|
+
* Update TextField styles ([0d0218e](https://github.com/occmundial/occ-atomic/commit/0d0218ea0df146da1b07482676eb99ad57d186b7))
|
200
|
+
|
201
|
+
|
202
|
+
### BREAKING CHANGES
|
203
|
+
|
204
|
+
* Remove the lockHeight and searchField properties
|
205
|
+
|
58
206
|
# [2.0.0-beta.16](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.15...v2.0.0-beta.16) (2024-05-14)
|
59
207
|
|
60
208
|
|
@@ -243,7 +243,8 @@ Autocomplete.propTypes = {
|
|
243
243
|
className: _propTypes["default"].string,
|
244
244
|
inputClassName: _propTypes["default"].string,
|
245
245
|
disabled: _propTypes["default"].bool,
|
246
|
-
testId: _propTypes["default"].string
|
246
|
+
testId: _propTypes["default"].string,
|
247
|
+
disableAutoComplete: _propTypes["default"].bool
|
247
248
|
}).isRequired,
|
248
249
|
|
249
250
|
/** Object with the props for the Droplist component. Check their descriptions in the Droplist docs. */
|
@@ -279,9 +280,6 @@ Autocomplete.propTypes = {
|
|
279
280
|
/** Function to call on mouse down (Droplist item). */
|
280
281
|
onMouseDown: _propTypes["default"].func,
|
281
282
|
onRef: _propTypes["default"].func,
|
282
|
-
|
283
|
-
/** Disables native autoComplete on browsers. */
|
284
|
-
disableAutoComplete: _propTypes["default"].bool,
|
285
283
|
id: _propTypes["default"].string,
|
286
284
|
className: _propTypes["default"].string,
|
287
285
|
style: _propTypes["default"].object,
|
@@ -292,7 +290,6 @@ Autocomplete.propTypes = {
|
|
292
290
|
Autocomplete.defaultProps = {
|
293
291
|
textfieldProps: {},
|
294
292
|
droplistProps: {},
|
295
|
-
disableAutoComplete: false,
|
296
293
|
showInitialData: false
|
297
294
|
};
|
298
295
|
var _default = Autocomplete;
|
@@ -36,7 +36,7 @@ var items = [{
|
|
36
36
|
textRight: '(6)',
|
37
37
|
id: 4
|
38
38
|
}];
|
39
|
-
describe(
|
39
|
+
describe('Autocomplete', function () {
|
40
40
|
it('matches the snapshot', function () {
|
41
41
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Autocomplete["default"], {
|
42
42
|
droplistProps: {
|
@@ -64,7 +64,7 @@ describe("Autocomplete", function () {
|
|
64
64
|
expect(wrapper.find('.input').at(0).length).toBe(1);
|
65
65
|
expect(wrapper.find('.droplist').at(0).length).toBe(1);
|
66
66
|
});
|
67
|
-
it(
|
67
|
+
it("hides the droplist when there's no value or the input has no focus", function () {
|
68
68
|
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Autocomplete["default"], {
|
69
69
|
textfieldProps: {
|
70
70
|
valueProp: 'a',
|
@@ -147,14 +147,17 @@ describe("Autocomplete", function () {
|
|
147
147
|
},
|
148
148
|
droplistProps: {
|
149
149
|
items: items,
|
150
|
-
className: 'droplist'
|
150
|
+
className: 'droplist',
|
151
|
+
testId: 'test-component'
|
151
152
|
},
|
152
153
|
classes: classes
|
153
154
|
}));
|
154
155
|
wrapper.setState({
|
155
156
|
focus: true
|
156
157
|
});
|
157
|
-
wrapper.find(
|
158
|
+
wrapper.find({
|
159
|
+
"data-testid": 'test-component__droplist-item-0'
|
160
|
+
}).simulate('mousedown');
|
158
161
|
expect(onMouseDown.mock.calls[0][0]).toEqual({
|
159
162
|
id: 1,
|
160
163
|
text: 'Administrador',
|
@@ -164,7 +167,9 @@ describe("Autocomplete", function () {
|
|
164
167
|
focus: true,
|
165
168
|
value: 'a'
|
166
169
|
});
|
167
|
-
wrapper.find(
|
170
|
+
wrapper.find({
|
171
|
+
"data-testid": 'test-component__droplist-item-1'
|
172
|
+
}).simulate('mousedown');
|
168
173
|
expect(onMouseDown.mock.calls[1][0]).toEqual({
|
169
174
|
id: 2,
|
170
175
|
text: 'Administrador Sr',
|
@@ -202,14 +207,17 @@ describe("Autocomplete", function () {
|
|
202
207
|
},
|
203
208
|
droplistProps: {
|
204
209
|
items: items,
|
205
|
-
className: 'droplist'
|
210
|
+
className: 'droplist',
|
211
|
+
testId: "test-component"
|
206
212
|
},
|
207
213
|
classes: classes
|
208
214
|
}));
|
209
215
|
wrapper.setState({
|
210
216
|
focus: true
|
211
217
|
});
|
212
|
-
wrapper.find(
|
218
|
+
wrapper.find({
|
219
|
+
"data-testid": 'test-component__droplist-item-0'
|
220
|
+
}).simulate('mousedown');
|
213
221
|
expect(onMouseDown.mock.calls.length).toBe(1);
|
214
222
|
});
|
215
223
|
it('calls the onFocus function', function () {
|
@@ -247,7 +255,7 @@ describe("Autocomplete", function () {
|
|
247
255
|
expect(onBlur.mock.calls.length).toBe(1);
|
248
256
|
});
|
249
257
|
});
|
250
|
-
describe(
|
258
|
+
describe('AutocompleteJSS', function () {
|
251
259
|
it('matches the snapshot', function () {
|
252
260
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
253
261
|
droplistProps: {
|
@@ -258,7 +266,7 @@ describe("AutocompleteJSS", function () {
|
|
258
266
|
expect(wrapper).toMatchSnapshot();
|
259
267
|
});
|
260
268
|
});
|
261
|
-
describe(
|
269
|
+
describe('Autocomplete styles', function () {
|
262
270
|
it('matches the snapshot', function () {
|
263
271
|
expect(_styles["default"]).toMatchSnapshot();
|
264
272
|
});
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _idx = _interopRequireDefault(require("idx"));
|
9
9
|
|
10
|
-
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
11
|
-
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
11
|
|
14
12
|
var _default = {
|
@@ -20,10 +18,12 @@ var _default = {
|
|
20
18
|
zIndex: 2,
|
21
19
|
top: function top(props) {
|
22
20
|
return (0, _idx["default"])(props, function (_) {
|
23
|
-
return _.textfieldProps.
|
21
|
+
return _.textfieldProps.assistiveText;
|
24
22
|
}) || (0, _idx["default"])(props, function (_) {
|
25
|
-
return _.textfieldProps.
|
26
|
-
})
|
23
|
+
return _.textfieldProps.counter;
|
24
|
+
}) && (0, _idx["default"])(props, function (_) {
|
25
|
+
return _.textfieldProps.maxLength;
|
26
|
+
}) ? 'calc(100% - 21px)' : 'calc(100% + 8px)';
|
27
27
|
},
|
28
28
|
left: 0,
|
29
29
|
width: '100%'
|
package/build/Banner/Banner.js
CHANGED
@@ -9,17 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
13
|
-
|
14
|
-
var _WindowSize = _interopRequireDefault(require("../WindowSize"));
|
15
|
-
|
16
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
17
|
-
|
18
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
19
|
-
|
20
12
|
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
21
13
|
|
22
|
-
var
|
14
|
+
var _Tip = _interopRequireDefault(require("../Tip"));
|
23
15
|
|
24
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
17
|
|
@@ -27,38 +19,27 @@ var Banner = function Banner(_ref) {
|
|
27
19
|
var id = _ref.id,
|
28
20
|
style = _ref.style,
|
29
21
|
className = _ref.className,
|
30
|
-
classes = _ref.classes,
|
31
22
|
children = _ref.children,
|
32
23
|
onClose = _ref.onClose,
|
33
|
-
winWidth = _ref.winWidth
|
34
|
-
|
35
|
-
|
24
|
+
winWidth = _ref.winWidth,
|
25
|
+
cta = _ref.cta,
|
26
|
+
_ref$theme = _ref.theme,
|
27
|
+
theme = _ref$theme === void 0 ? 'promote' : _ref$theme;
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(_Tip["default"], {
|
36
29
|
id: id,
|
30
|
+
style: style,
|
37
31
|
className: className,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
},
|
46
|
-
white: true,
|
47
|
-
small: isMobile,
|
48
|
-
tag: "div",
|
49
|
-
className: classes.textBanner
|
50
|
-
}, children)), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
51
|
-
className: classes.iconFlex
|
52
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
53
|
-
iconName: "close",
|
54
|
-
colors: [_colors["default"].bgWhite],
|
55
|
-
onClick: onClose,
|
56
|
-
className: classes.icon
|
57
|
-
}))));
|
32
|
+
onClose: onClose,
|
33
|
+
size: winWidth < _grid["default"].xs ? 'small' : 'large',
|
34
|
+
center: true,
|
35
|
+
type: "banner",
|
36
|
+
cta: cta,
|
37
|
+
theme: theme,
|
38
|
+
icon: true
|
39
|
+
}, children);
|
58
40
|
};
|
59
41
|
|
60
42
|
Banner.propTypes = {
|
61
|
-
classes: _propTypes["default"].object.isRequired,
|
62
43
|
winWidth: _propTypes["default"].number,
|
63
44
|
|
64
45
|
/** Text of the tip. If you put text between two * characters that text will be displayed as bold. */
|
@@ -68,9 +49,14 @@ Banner.propTypes = {
|
|
68
49
|
id: _propTypes["default"].string,
|
69
50
|
className: _propTypes["default"].string,
|
70
51
|
style: _propTypes["default"].object,
|
71
|
-
onClose: _propTypes["default"].func
|
52
|
+
onClose: _propTypes["default"].func,
|
53
|
+
cta: _propTypes["default"].shape({
|
54
|
+
text: _propTypes["default"].string,
|
55
|
+
href: _propTypes["default"].string,
|
56
|
+
target: _propTypes["default"].string,
|
57
|
+
onClick: _propTypes["default"].func
|
58
|
+
}),
|
59
|
+
theme: _propTypes["default"].oneOf(['info', 'warning', 'success', 'error', 'promote'])
|
72
60
|
};
|
73
|
-
|
74
|
-
var _default = (0, _WindowSize["default"])(Banner);
|
75
|
-
|
61
|
+
var _default = Banner;
|
76
62
|
exports["default"] = _default;
|
package/build/Button/Button.js
CHANGED
@@ -17,6 +17,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
19
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
21
|
+
|
20
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
21
23
|
|
22
24
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -66,6 +68,9 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
66
68
|
target = _this$props.target,
|
67
69
|
rel = _this$props.rel,
|
68
70
|
onClick = _this$props.onClick,
|
71
|
+
onMouseDown = _this$props.onMouseDown,
|
72
|
+
onMouseUp = _this$props.onMouseUp,
|
73
|
+
onMouseOut = _this$props.onMouseOut,
|
69
74
|
theme = _this$props.theme,
|
70
75
|
size = _this$props.size,
|
71
76
|
block = _this$props.block,
|
@@ -112,26 +117,33 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
112
117
|
width: iconSize,
|
113
118
|
height: iconSize
|
114
119
|
})) : null;
|
120
|
+
var eventProps = !disabled ? {
|
121
|
+
onClick: onClick,
|
122
|
+
onMouseDown: onMouseDown,
|
123
|
+
onMouseUp: onMouseUp,
|
124
|
+
onMouseOut: onMouseOut
|
125
|
+
} : {};
|
115
126
|
|
116
127
|
if (href) {
|
117
|
-
return /*#__PURE__*/_react["default"].createElement("a", {
|
128
|
+
return /*#__PURE__*/_react["default"].createElement("a", _extends({
|
118
129
|
className: classNames,
|
119
130
|
href: !disabled ? href : '',
|
120
131
|
target: target,
|
121
|
-
rel: rel
|
122
|
-
|
132
|
+
rel: rel
|
133
|
+
}, eventProps, {
|
123
134
|
id: id,
|
124
135
|
style: style,
|
125
136
|
"data-testid": testId
|
126
|
-
}, content, loadingLayer);
|
137
|
+
}), content, loadingLayer);
|
127
138
|
} else {
|
128
|
-
return /*#__PURE__*/_react["default"].createElement("button", {
|
139
|
+
return /*#__PURE__*/_react["default"].createElement("button", _extends({
|
129
140
|
className: classNames,
|
130
|
-
|
141
|
+
disabled: disabled
|
142
|
+
}, eventProps, {
|
131
143
|
id: id,
|
132
144
|
style: style,
|
133
145
|
"data-testid": testId
|
134
|
-
}, content, loadingLayer);
|
146
|
+
}), content, loadingLayer);
|
135
147
|
}
|
136
148
|
}
|
137
149
|
}]);
|
@@ -176,6 +188,15 @@ Button.propTypes = {
|
|
176
188
|
/** The function to call when the button is clicked. */
|
177
189
|
onClick: _propTypes["default"].func,
|
178
190
|
|
191
|
+
/** The function to call when the mouse is down on the button. */
|
192
|
+
onMouseDown: _propTypes["default"].func,
|
193
|
+
|
194
|
+
/** The function to call when the mouse is up on the button. */
|
195
|
+
onMouseUp: _propTypes["default"].func,
|
196
|
+
|
197
|
+
/** The function to call when the mouse moves out of the button. */
|
198
|
+
onMouseOut: _propTypes["default"].func,
|
199
|
+
|
179
200
|
/** Optionally, you can set the href property and use it like a link. */
|
180
201
|
href: _propTypes["default"].string,
|
181
202
|
|
package/build/Button/styles.js
CHANGED
@@ -101,6 +101,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
101
101
|
var iconClass = undetermined ? " ".concat(classes.undetermined) : value ? " ".concat(classes.active) : '';
|
102
102
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
103
103
|
id: id,
|
104
|
+
tabIndex: -1,
|
104
105
|
className: "".concat(classes.cont).concat(iconClass).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
|
105
106
|
onClick: this.toggle,
|
106
107
|
style: style,
|
@@ -6,67 +6,101 @@ exports[`Checkbox styles matches the snapshot 1`] = `
|
|
6
6
|
Object {
|
7
7
|
"active": Object {
|
8
8
|
"& $check:after": Object {
|
9
|
-
"background":
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
|
10
|
+
},
|
11
|
+
"& $check:before": Object {
|
12
|
+
"background": "#0059CD",
|
13
|
+
"borderColor": "rgba(255,255,255,0.2)",
|
13
14
|
},
|
14
15
|
},
|
15
16
|
"check": Object {
|
16
17
|
"&:after": Object {
|
17
18
|
"background": "transparent",
|
19
|
+
"boxSizing": "border-box",
|
18
20
|
"content": "\\"\\"",
|
19
|
-
"height":
|
21
|
+
"height": 20,
|
20
22
|
"left": "50%",
|
21
23
|
"marginTop": -1,
|
22
24
|
"position": "absolute",
|
23
25
|
"top": "50%",
|
24
26
|
"transform": "translate(-50%, -50%)",
|
25
27
|
"transition": "0.3s all",
|
26
|
-
"width":
|
28
|
+
"width": 20,
|
27
29
|
},
|
28
30
|
"&:before": Object {
|
29
|
-
"background": "#
|
30
|
-
"border": "1px solid #
|
31
|
-
"borderRadius":
|
31
|
+
"background": "#fff",
|
32
|
+
"border": "1px solid #D3D4DC",
|
33
|
+
"borderRadius": "4px",
|
34
|
+
"boxSizing": "border-box",
|
32
35
|
"content": "\\"\\"",
|
33
|
-
"height":
|
36
|
+
"height": 20,
|
34
37
|
"left": "50%",
|
35
38
|
"position": "absolute",
|
36
39
|
"top": "50%",
|
37
40
|
"transform": "translate(-50%, -50%)",
|
38
|
-
"width":
|
41
|
+
"width": 20,
|
39
42
|
},
|
40
|
-
"height":
|
43
|
+
"height": "24px",
|
41
44
|
"position": "relative",
|
42
|
-
"width":
|
45
|
+
"width": "24px",
|
43
46
|
},
|
44
47
|
"cont": Object {
|
48
|
+
"&$active, &$undetermined": Object {
|
49
|
+
"&:hover $check:before, &:active $check:before": Object {
|
50
|
+
"background": "#083CAE",
|
51
|
+
},
|
52
|
+
},
|
45
53
|
"&:after": Object {
|
46
54
|
"clear": "both",
|
47
55
|
"content": "\\"\\"",
|
48
56
|
"display": "table",
|
49
57
|
},
|
50
|
-
"&:
|
51
|
-
"
|
58
|
+
"&:focus $check:before": Object {
|
59
|
+
"borderWidth": 1,
|
60
|
+
"boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
|
61
|
+
},
|
62
|
+
"&:not($active), &:not($undetermined)": Object {
|
63
|
+
"&:active $check:before": Object {
|
64
|
+
"borderWidth": 2,
|
65
|
+
},
|
66
|
+
"&:hover $check:before, &:active $check:before": Object {
|
67
|
+
"borderColor": "#6C6F89",
|
68
|
+
},
|
52
69
|
},
|
53
70
|
"alignItems": "start",
|
54
71
|
"boxSizing": "border-box",
|
55
72
|
"cursor": "pointer",
|
56
73
|
"display": "flex",
|
57
74
|
"outline": "0",
|
58
|
-
"paddingBottom":
|
59
|
-
"paddingTop":
|
75
|
+
"paddingBottom": "8px",
|
76
|
+
"paddingTop": "8px",
|
60
77
|
},
|
61
78
|
"disabled": Object {
|
62
|
-
"
|
79
|
+
"&$active $check:after": Object {
|
80
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiM4REE1REEiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
|
81
|
+
},
|
82
|
+
"&$active, &$undetermined": Object {
|
83
|
+
"& $check:before": Object {
|
84
|
+
"background": "hsl(221 91.2% 35.7% / 0.1)",
|
85
|
+
"borderColor": "rgba(255,255,255,0.2)",
|
86
|
+
},
|
87
|
+
},
|
88
|
+
"&$undetermined $check:after": Object {
|
89
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI1LjMsMTMuMyA1LjMsMTAuNyAxOC43LDEwLjcgMTguNywxMy4zICIgZmlsbD0iIzhEQTVEQSIgLz4KICAgICAgICA8L3N2Zz4=)",
|
90
|
+
},
|
91
|
+
"&:not($active), &:not($undetermined)": Object {
|
92
|
+
"& $check:before": Object {
|
93
|
+
"background": "#EDEDF1",
|
94
|
+
"borderColor": "#D3D4DC",
|
95
|
+
},
|
96
|
+
},
|
63
97
|
"pointerEvents": "none",
|
64
98
|
},
|
65
99
|
"label": Object {
|
66
100
|
"cursor": "pointer",
|
67
101
|
"flex": "1",
|
68
102
|
"float": "left",
|
69
|
-
"marginLeft":
|
103
|
+
"marginLeft": "8px",
|
70
104
|
},
|
71
105
|
"overflow": Object {
|
72
106
|
"overflow": "hidden",
|
@@ -75,16 +109,17 @@ Object {
|
|
75
109
|
},
|
76
110
|
"right": Object {
|
77
111
|
"float": "right",
|
78
|
-
"marginLeft":
|
112
|
+
"marginLeft": "8px",
|
79
113
|
},
|
80
114
|
"undetermined": Object {
|
81
115
|
"& $check:after": Object {
|
82
|
-
"background":
|
83
|
-
"url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI1LjMsMTMuMyA1LjMsMTAuNyAxOC43LDEwLjcgMTguNywxMy4zICIgZmlsbD0iIzA4M2NhZSIgLz4KICAgICAgICA8L3N2Zz4=)",
|
84
|
-
"!important",
|
85
|
-
],
|
116
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI1LjMsMTMuMyA1LjMsMTAuNyAxOC43LDEwLjcgMTguNywxMy4zICIgZmlsbD0iI2ZmZiIgLz4KICAgICAgICA8L3N2Zz4=)",
|
86
117
|
"marginTop": 0,
|
87
118
|
},
|
119
|
+
"& $check:before": Object {
|
120
|
+
"background": "#0059CD",
|
121
|
+
"borderColor": "rgba(255,255,255,0.2)",
|
122
|
+
},
|
88
123
|
},
|
89
124
|
}
|
90
125
|
`;
|