@occmundial/occ-atomic 3.0.0-beta.2 → 3.0.0-beta.20
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +168 -0
- package/build/Banner/Banner.js +30 -40
- package/build/Banner/Banner.test.js +64 -17
- package/build/Banner/__snapshots__/Banner.test.js.snap +0 -28
- package/build/Banner/index.js +1 -6
- package/build/Button/__snapshots__/Button.test.js.snap +18 -20
- package/build/Button/styles.js +6 -8
- package/build/Checkbox/Checkbox.js +48 -3
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +81 -49
- package/build/Checkbox/styles.js +91 -48
- package/build/Pill/Choice/Choice.js +73 -81
- package/build/Pill/Choice/styles.js +64 -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 +43 -33
- package/build/Pill/__snapshots__/Pill.test.js.snap +14 -24
- package/build/Pill/styles.js +22 -27
- package/build/Radio/Radio.js +42 -6
- package/build/Radio/__snapshots__/Radio.test.js.snap +81 -80
- package/build/Radio/styles.js +93 -85
- package/build/SlideToggle/SlideToggle.js +38 -6
- package/build/SlideToggle/SlideToggle.test.js +2 -2
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +53 -37
- package/build/SlideToggle/styles.js +65 -45
- package/build/Text/Text.js +4 -2
- package/build/TextField/TextField.js +7 -6
- package/build/TextField/__snapshots__/TextField.test.js.snap +3 -0
- package/build/TextField/styles.js +3 -0
- package/build/Tip/Tip.js +51 -95
- package/build/Tip/Tip.test.js +29 -6
- package/build/Tip/TipText/index.js +32 -0
- package/build/Tip/__snapshots__/Tip.test.js.snap +90 -15
- package/build/Tip/styles.js +85 -31
- package/build/tokens/colors.json +3 -3
- package/package.json +4 -1
- package/build/Banner/styles.js +0 -41
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,171 @@
|
|
1
|
+
# [3.0.0-beta.20](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.19...v3.0.0-beta.20) (2024-06-25)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Add condition to set test id prop ([4e90cea](https://github.com/occmundial/occ-atomic/commit/4e90cea0a6f5c627c8b2a398a9aef449fa3e1b7c))
|
7
|
+
* Adjust tip styles and add banner prop ([04d17ff](https://github.com/occmundial/occ-atomic/commit/04d17ff0fe74186da32d15f91001406344867bb4))
|
8
|
+
* Merge beta changes ([218b68a](https://github.com/occmundial/occ-atomic/commit/218b68a7347b025dc2cdd8171f7d4c22bbd383f1))
|
9
|
+
* Resolve component data conflicts ([c390f1f](https://github.com/occmundial/occ-atomic/commit/c390f1f485415dc15251386527c0caaa70e9814f))
|
10
|
+
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* Add test id prop and add new tests ([aba7d32](https://github.com/occmundial/occ-atomic/commit/aba7d3215e0b19e635b53546f66accd327ebed42))
|
15
|
+
|
16
|
+
# [3.0.0-beta.19](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.18...v3.0.0-beta.19) (2024-06-21)
|
17
|
+
|
18
|
+
|
19
|
+
### Bug Fixes
|
20
|
+
|
21
|
+
* Prevent default to avoid scroll on key down ([9ee17d2](https://github.com/occmundial/occ-atomic/commit/9ee17d2a247a02a7be7e1c743669c8833d3f5748))
|
22
|
+
|
23
|
+
# [3.0.0-beta.18](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2024-06-21)
|
24
|
+
|
25
|
+
|
26
|
+
### Bug Fixes
|
27
|
+
|
28
|
+
* Replace onKeyDown for onKeyUp ([e574e9c](https://github.com/occmundial/occ-atomic/commit/e574e9c42f7a55723794269ede7a4f58dd899e58))
|
29
|
+
|
30
|
+
# [3.0.0-beta.17](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.16...v3.0.0-beta.17) (2024-06-19)
|
31
|
+
|
32
|
+
|
33
|
+
### Bug Fixes
|
34
|
+
|
35
|
+
* Change icon size and adjust margin ([0411455](https://github.com/occmundial/occ-atomic/commit/041145590cd765e5b81937f07ef676d2fc5e8826))
|
36
|
+
* Remove selector not active for focus visible ([dbec333](https://github.com/occmundial/occ-atomic/commit/dbec33316a94826d2007a044b634f944ffe01715))
|
37
|
+
|
38
|
+
# [3.0.0-beta.16](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2024-06-19)
|
39
|
+
|
40
|
+
|
41
|
+
### Bug Fixes
|
42
|
+
|
43
|
+
* Change focus behavior in form components ([a3b6c9b](https://github.com/occmundial/occ-atomic/commit/a3b6c9b5194b1d8302a6f73bb5522df9e6a756fc))
|
44
|
+
* Changes to structure and styles of Checkbox ([6ed54c0](https://github.com/occmundial/occ-atomic/commit/6ed54c0a5ebae0542431b8305d0da8a052c2d3fb))
|
45
|
+
* Changes to structure and styles of Radio ([694c995](https://github.com/occmundial/occ-atomic/commit/694c9950a4c6c43a5bd7987536a293835860421e))
|
46
|
+
* Changes to structure and styles of SlideToggle ([5ec340f](https://github.com/occmundial/occ-atomic/commit/5ec340f0cc09b04d032ebb888034a92cf71f2f8a))
|
47
|
+
* Fix focus styles in form components ([e69d45b](https://github.com/occmundial/occ-atomic/commit/e69d45b84c3e35a433f37feb7c9b0012137bc2bb))
|
48
|
+
* Fix spacing and sizing of radio, checkbox and toggle ([b3a71c2](https://github.com/occmundial/occ-atomic/commit/b3a71c2e30e2b810036104a4ee57b6b805d2780c))
|
49
|
+
* Fix styles and icon color on Checkbox ([1c4e360](https://github.com/occmundial/occ-atomic/commit/1c4e360ec0d3291048d14f4ccd3859d0bdbc2817))
|
50
|
+
* Fix transition value in SlideToggle ([8423fc6](https://github.com/occmundial/occ-atomic/commit/8423fc6b9eea3219ed052add95f27ef4d181f5b5))
|
51
|
+
* Update componentData ([ff7c0bd](https://github.com/occmundial/occ-atomic/commit/ff7c0bd47ed55d652b01ace7526867d751a6e1c7))
|
52
|
+
|
53
|
+
# [3.0.0-beta.15](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2024-06-18)
|
54
|
+
|
55
|
+
|
56
|
+
### Bug Fixes
|
57
|
+
|
58
|
+
* Centered select icon and set cursor pointer for select box ([05fa3f1](https://github.com/occmundial/occ-atomic/commit/05fa3f1ca0efdf7e2b75c468eb23279aafbc58ce))
|
59
|
+
* Remove class condition ([59ef135](https://github.com/occmundial/occ-atomic/commit/59ef1353213a9df3737d59c13385254767c41372))
|
60
|
+
|
61
|
+
# [3.0.0-beta.14](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2024-06-13)
|
62
|
+
|
63
|
+
|
64
|
+
### Bug Fixes
|
65
|
+
|
66
|
+
* Fix toggle background on focus when hovered ([8c35f96](https://github.com/occmundial/occ-atomic/commit/8c35f96b77fdb3d1692d864159561842a3213bba))
|
67
|
+
|
68
|
+
# [3.0.0-beta.13](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.12...v3.0.0-beta.13) (2024-06-13)
|
69
|
+
|
70
|
+
|
71
|
+
### Bug Fixes
|
72
|
+
|
73
|
+
* Add form nav behavior to SwitchToggle ([e1e74ed](https://github.com/occmundial/occ-atomic/commit/e1e74edf8306250d0ae7a723b758c9426593c295))
|
74
|
+
|
75
|
+
# [3.0.0-beta.12](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2024-06-07)
|
76
|
+
|
77
|
+
|
78
|
+
### Bug Fixes
|
79
|
+
|
80
|
+
* Add form nav behavior to checkbox ([6b2c664](https://github.com/occmundial/occ-atomic/commit/6b2c664e165bb4617dc53874be69bb9d8c8e6bc3))
|
81
|
+
|
82
|
+
# [3.0.0-beta.11](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2024-06-07)
|
83
|
+
|
84
|
+
|
85
|
+
### Bug Fixes
|
86
|
+
|
87
|
+
* Call hoc window size and improve tip text use memo ([840e108](https://github.com/occmundial/occ-atomic/commit/840e1089cb3e80c6b2d2686c56b577166f6bc66f))
|
88
|
+
* Resolve conflicts ([23e9ba8](https://github.com/occmundial/occ-atomic/commit/23e9ba8008ffe55e8af6910394580123032aee0e))
|
89
|
+
|
90
|
+
# [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)
|
91
|
+
|
92
|
+
|
93
|
+
### Features
|
94
|
+
|
95
|
+
* Checkbox redesigned and documentation created ([48fbc8d](https://github.com/occmundial/occ-atomic/commit/48fbc8d0a912c300324fe244e9692a49f3a152b5))
|
96
|
+
* Remove updates to component ([ab71716](https://github.com/occmundial/occ-atomic/commit/ab71716991a7700134dbafe0d8eda63e18ff8eab))
|
97
|
+
|
98
|
+
# [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)
|
99
|
+
|
100
|
+
|
101
|
+
### Bug Fixes
|
102
|
+
|
103
|
+
* Move use memo before early return ([3d290c9](https://github.com/occmundial/occ-atomic/commit/3d290c9675fb24e20d131fdbaeef023920f3e439))
|
104
|
+
|
105
|
+
# [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)
|
106
|
+
|
107
|
+
|
108
|
+
### Bug Fixes
|
109
|
+
|
110
|
+
* Add border for promote alert ([5050f18](https://github.com/occmundial/occ-atomic/commit/5050f187b60f98118654ecbbe3e2cba7b29790ab))
|
111
|
+
* Add min height to tip container ([579d263](https://github.com/occmundial/occ-atomic/commit/579d26306d59ce73b5084f9cd632dd12ed162fc5))
|
112
|
+
* Resolve conflicts ([0a15dfa](https://github.com/occmundial/occ-atomic/commit/0a15dfa8d8da38a724d71622809f0e02c5bed0e9))
|
113
|
+
|
114
|
+
|
115
|
+
### Features
|
116
|
+
|
117
|
+
* Render tip in banner component ([239e2c8](https://github.com/occmundial/occ-atomic/commit/239e2c82c23d79698bd912931b314ceddf252fb4))
|
118
|
+
* Update tip component with new design tokens ([b2367fc](https://github.com/occmundial/occ-atomic/commit/b2367fcaade288609df4c841c91fb308841ae4b0))
|
119
|
+
|
120
|
+
|
121
|
+
### Performance Improvements
|
122
|
+
|
123
|
+
* Memoize text replace in tip text component ([69180ce](https://github.com/occmundial/occ-atomic/commit/69180ce9cb1e812769e31a837257d8c8e6f24199))
|
124
|
+
|
125
|
+
# [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)
|
126
|
+
|
127
|
+
|
128
|
+
### Bug Fixes
|
129
|
+
|
130
|
+
* Fix radio styles and add a form nav behavior ([59f0320](https://github.com/occmundial/occ-atomic/commit/59f03207a45b1ec27e02970668cffe2cfd5931a9))
|
131
|
+
* Ignore tab index if radio element is disabled ([e479098](https://github.com/occmundial/occ-atomic/commit/e4790982a127408a474f688a4647612ef8fbb446))
|
132
|
+
|
133
|
+
# [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)
|
134
|
+
|
135
|
+
|
136
|
+
### Bug Fixes
|
137
|
+
|
138
|
+
* Text new emphasis props ([bc3e934](https://github.com/occmundial/occ-atomic/commit/bc3e934299230cb0b3a0fddeb4c8fcd2b72a052f))
|
139
|
+
|
140
|
+
# [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)
|
141
|
+
|
142
|
+
|
143
|
+
### Bug Fixes
|
144
|
+
|
145
|
+
* Remove fixed size for right-side icon in button ([1228467](https://github.com/occmundial/occ-atomic/commit/1228467ba0d107bba0e70603c28a3ccffaec306b))
|
146
|
+
|
147
|
+
# [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)
|
148
|
+
|
149
|
+
|
150
|
+
### Bug Fixes
|
151
|
+
|
152
|
+
* Make toggle unshrinkable inside a flex box ([6067fba](https://github.com/occmundial/occ-atomic/commit/6067fbad2276824bcec0c35748beea0006b73300))
|
153
|
+
|
154
|
+
# [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)
|
155
|
+
|
156
|
+
|
157
|
+
### Bug Fixes
|
158
|
+
|
159
|
+
* Remove bg from group pill on focus ([6cdb2f1](https://github.com/occmundial/occ-atomic/commit/6cdb2f1573b6a297810d4e075c462ccc2b9140b1))
|
160
|
+
* Remove repeated selectors and change usecallback dependencies ([4d23be0](https://github.com/occmundial/occ-atomic/commit/4d23be0f88672df2e3c39578e3a4638385c23594))
|
161
|
+
* Resolve conflicts with beta ([0e51771](https://github.com/occmundial/occ-atomic/commit/0e5177122818b55d51a28d013c10164f18abaf97))
|
162
|
+
|
163
|
+
|
164
|
+
### Features
|
165
|
+
|
166
|
+
* Disabled all group items when pill disabled prop is true ([922cb8a](https://github.com/occmundial/occ-atomic/commit/922cb8a0146f21a0ad3a49da87321a3ebc6c6feb))
|
167
|
+
* Update pill styles with design tokens ([a6caadc](https://github.com/occmundial/occ-atomic/commit/a6caadc0170b290865332278fa4b3850ee452faa))
|
168
|
+
|
1
169
|
# [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)
|
2
170
|
|
3
171
|
|
package/build/Banner/Banner.js
CHANGED
@@ -9,17 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var
|
13
|
-
|
14
|
-
var _WindowSize = _interopRequireDefault(require("../WindowSize"));
|
15
|
-
|
16
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
17
|
-
|
18
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
19
|
-
|
20
|
-
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
21
|
-
|
22
|
-
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
12
|
+
var _Tip = _interopRequireDefault(require("../Tip"));
|
23
13
|
|
24
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
15
|
|
@@ -27,38 +17,29 @@ var Banner = function Banner(_ref) {
|
|
27
17
|
var id = _ref.id,
|
28
18
|
style = _ref.style,
|
29
19
|
className = _ref.className,
|
30
|
-
classes = _ref.classes,
|
31
20
|
children = _ref.children,
|
32
21
|
onClose = _ref.onClose,
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
cta = _ref.cta,
|
23
|
+
_ref$theme = _ref.theme,
|
24
|
+
theme = _ref$theme === void 0 ? 'promote' : _ref$theme,
|
25
|
+
_ref$size = _ref.size,
|
26
|
+
size = _ref$size === void 0 ? 'large' : _ref$size,
|
27
|
+
testId = _ref.testId;
|
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
|
+
banner: true,
|
34
|
+
cta: cta,
|
35
|
+
theme: theme,
|
36
|
+
icon: true,
|
37
|
+
size: size,
|
38
|
+
testId: testId
|
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,18 @@ 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']),
|
60
|
+
size: _propTypes["default"].oneOf(['large', 'small']),
|
61
|
+
|
62
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
63
|
+
testId: _propTypes["default"].string
|
72
64
|
};
|
73
|
-
|
74
|
-
var _default = (0, _WindowSize["default"])(Banner);
|
75
|
-
|
65
|
+
var _default = Banner;
|
76
66
|
exports["default"] = _default;
|
@@ -6,35 +6,82 @@ var _enzyme = require("enzyme");
|
|
6
6
|
|
7
7
|
var _Banner = _interopRequireDefault(require("./Banner"));
|
8
8
|
|
9
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
10
|
-
|
11
9
|
var _index = _interopRequireDefault(require("./index"));
|
12
10
|
|
13
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
14
12
|
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
-
|
17
|
-
var reduceClasses = function reduceClasses(prev, curr) {
|
18
|
-
return Object.assign({}, prev, _defineProperty({}, curr, curr));
|
19
|
-
};
|
20
|
-
|
21
|
-
var classes = Object.keys(_styles["default"]).reduce(reduceClasses, {});
|
22
13
|
describe("Banner", function () {
|
23
14
|
it('matches the snapshot', function () {
|
24
15
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Banner["default"], {
|
25
|
-
|
26
|
-
|
16
|
+
onClose: function onClose() {},
|
17
|
+
cta: {
|
18
|
+
text: 'Lorem ipsum.',
|
19
|
+
onClick: function onClick() {
|
20
|
+
return alert('CTA clicked!');
|
21
|
+
}
|
22
|
+
},
|
23
|
+
theme: "info"
|
24
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"));
|
27
25
|
expect(wrapper).toMatchSnapshot();
|
28
26
|
});
|
27
|
+
it('Has content centered', function () {
|
28
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Banner["default"], {
|
29
|
+
onClose: function onClose() {},
|
30
|
+
cta: {
|
31
|
+
text: 'Lorem ipsum.',
|
32
|
+
onClick: function onClick() {
|
33
|
+
return alert('CTA clicked!');
|
34
|
+
}
|
35
|
+
},
|
36
|
+
theme: "info"
|
37
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"));
|
38
|
+
expect(wrapper.prop('banner')).toEqual(true);
|
39
|
+
});
|
40
|
+
it('has a close icon button', function () {
|
41
|
+
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Banner["default"], {
|
42
|
+
onClose: function onClose() {},
|
43
|
+
cta: {
|
44
|
+
text: 'Lorem ipsum.',
|
45
|
+
onClick: function onClick() {
|
46
|
+
return alert('CTA clicked!');
|
47
|
+
}
|
48
|
+
},
|
49
|
+
theme: "info",
|
50
|
+
testId: "banner-test"
|
51
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"));
|
52
|
+
expect(wrapper.find({
|
53
|
+
"data-testid": 'banner-test__close-icon'
|
54
|
+
}).length).toBe(1);
|
55
|
+
});
|
56
|
+
it('has a link', function () {
|
57
|
+
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Banner["default"], {
|
58
|
+
onClose: function onClose() {},
|
59
|
+
cta: {
|
60
|
+
text: 'Lorem ipsum.',
|
61
|
+
onClick: function onClick() {
|
62
|
+
return alert('CTA clicked!');
|
63
|
+
}
|
64
|
+
},
|
65
|
+
theme: "info",
|
66
|
+
testId: "banner-test"
|
67
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"));
|
68
|
+
expect(wrapper.find({
|
69
|
+
"data-testid": 'banner-test__link'
|
70
|
+
}).length).toBe(1);
|
71
|
+
});
|
29
72
|
});
|
30
73
|
describe("BannerJSS", function () {
|
31
74
|
it('matches the snapshot', function () {
|
32
|
-
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"],
|
75
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
76
|
+
onClose: function onClose() {},
|
77
|
+
cta: {
|
78
|
+
text: 'Lorem ipsum.',
|
79
|
+
onClick: function onClick() {
|
80
|
+
return alert('CTA clicked!');
|
81
|
+
}
|
82
|
+
},
|
83
|
+
theme: "info"
|
84
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"));
|
33
85
|
expect(wrapper).toMatchSnapshot();
|
34
86
|
});
|
35
|
-
});
|
36
|
-
describe("Banner styles", function () {
|
37
|
-
it('matches the snapshot', function () {
|
38
|
-
expect(_styles["default"]).toMatchSnapshot();
|
39
|
-
});
|
40
87
|
});
|
@@ -2,32 +2,4 @@
|
|
2
2
|
|
3
3
|
exports[`Banner matches the snapshot 1`] = `ShallowWrapper {}`;
|
4
4
|
|
5
|
-
exports[`Banner styles matches the snapshot 1`] = `
|
6
|
-
Object {
|
7
|
-
"container": Object {
|
8
|
-
"backgroundColor": "#222222",
|
9
|
-
"padding": 16,
|
10
|
-
},
|
11
|
-
"icon": Object {
|
12
|
-
"cursor": "pointer",
|
13
|
-
},
|
14
|
-
"iconFlex": Object {
|
15
|
-
"@media screen and (min-width:576px)": Object {
|
16
|
-
"padding": 0,
|
17
|
-
},
|
18
|
-
"paddingLeft": 16,
|
19
|
-
"paddingTop": 16,
|
20
|
-
},
|
21
|
-
"textBanner": Object {
|
22
|
-
"display": "inline-block",
|
23
|
-
},
|
24
|
-
"textFlex": Object {
|
25
|
-
"@media screen and (min-width:576px)": Object {
|
26
|
-
"textAlign": "center",
|
27
|
-
},
|
28
|
-
"textAlign": "start",
|
29
|
-
},
|
30
|
-
}
|
31
|
-
`;
|
32
|
-
|
33
5
|
exports[`BannerJSS matches the snapshot 1`] = `ShallowWrapper {}`;
|
package/build/Banner/index.js
CHANGED
@@ -5,14 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var _reactJss = _interopRequireDefault(require("react-jss"));
|
9
|
-
|
10
8
|
var _Banner = _interopRequireDefault(require("./Banner"));
|
11
9
|
|
12
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
13
|
-
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
11
|
|
16
|
-
var _default =
|
17
|
-
|
12
|
+
var _default = _Banner["default"];
|
18
13
|
exports["default"] = _default;
|
@@ -64,12 +64,12 @@ Object {
|
|
64
64
|
"&:active": Object {
|
65
65
|
"background": "hsl(234 75.4% 12.7% / 0.1)",
|
66
66
|
},
|
67
|
+
"&:focus-visible": Object {
|
68
|
+
"boxShadow": "0 0 0 8px hsl(234 75.4% 12.7% / 0.1)",
|
69
|
+
},
|
67
70
|
"&:hover": Object {
|
68
71
|
"background": "hsl(234 75.4% 12.7% / 0.05)",
|
69
72
|
},
|
70
|
-
"&:not(:active):focus-visible": Object {
|
71
|
-
"boxShadow": "0 0 0 8px hsl(234 75.4% 12.7% / 0.1)",
|
72
|
-
},
|
73
73
|
"background": "transparent",
|
74
74
|
"color": "#5A5D7B",
|
75
75
|
},
|
@@ -120,12 +120,12 @@ Object {
|
|
120
120
|
"&:active": Object {
|
121
121
|
"background": "rgba(255,255,255,0.1)",
|
122
122
|
},
|
123
|
+
"&:focus-visible": Object {
|
124
|
+
"boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
|
125
|
+
},
|
123
126
|
"&:hover": Object {
|
124
127
|
"background": "rgba(255,255,255,0.05)",
|
125
128
|
},
|
126
|
-
"&:not(:active):focus-visible": Object {
|
127
|
-
"boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
|
128
|
-
},
|
129
129
|
"background": "transparent",
|
130
130
|
"color": "#fff",
|
131
131
|
},
|
@@ -145,10 +145,8 @@ Object {
|
|
145
145
|
},
|
146
146
|
"iconRight": Object {
|
147
147
|
"display": "inline-block",
|
148
|
-
"height": 16,
|
149
148
|
"marginLeft": "8px",
|
150
149
|
"transition": "0.3s all",
|
151
|
-
"width": 16,
|
152
150
|
},
|
153
151
|
"lg": Object {
|
154
152
|
"&$iconOnly": Object {
|
@@ -216,12 +214,12 @@ Object {
|
|
216
214
|
"&:focus": Object {
|
217
215
|
"outline": "2px solid rgba(255,255,255,0.2)",
|
218
216
|
},
|
217
|
+
"&:focus-visible": Object {
|
218
|
+
"boxShadow": "0 0 0 8px hsl(344 87.1% 57.5% / 0.3)",
|
219
|
+
},
|
219
220
|
"&:hover": Object {
|
220
221
|
"background": "#A32444",
|
221
222
|
},
|
222
|
-
"&:not(:active):focus-visible": Object {
|
223
|
-
"boxShadow": "0 0 0 8px hsl(344 87.1% 57.5% / 0.3)",
|
224
|
-
},
|
225
223
|
"background": "#D32E58",
|
226
224
|
"color": "#fff",
|
227
225
|
"outline": "2px solid rgba(255,255,255,0.2)",
|
@@ -247,12 +245,12 @@ Object {
|
|
247
245
|
"&:active": Object {
|
248
246
|
"background": "hsl(221 91.2% 35.7% / 0.2)",
|
249
247
|
},
|
248
|
+
"&:focus-visible": Object {
|
249
|
+
"boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
|
250
|
+
},
|
250
251
|
"&:hover": Object {
|
251
252
|
"background": "hsl(221 91.2% 35.7% / 0.1)",
|
252
253
|
},
|
253
|
-
"&:not(:active):focus-visible": Object {
|
254
|
-
"boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
|
255
|
-
},
|
256
254
|
"background": "hsl(221 91.2% 35.7% / 0.05)",
|
257
255
|
"color": "#083CAE",
|
258
256
|
},
|
@@ -277,12 +275,12 @@ Object {
|
|
277
275
|
"&:focus": Object {
|
278
276
|
"outline": "2px solid #083CAE",
|
279
277
|
},
|
278
|
+
"&:focus-visible": Object {
|
279
|
+
"boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
|
280
|
+
},
|
280
281
|
"&:hover": Object {
|
281
282
|
"background": "hsl(221 91.2% 35.7% / 0.05)",
|
282
283
|
},
|
283
|
-
"&:not(:active):focus-visible": Object {
|
284
|
-
"boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
|
285
|
-
},
|
286
284
|
"background": "transparent",
|
287
285
|
"color": "#083CAE",
|
288
286
|
"outline": "2px solid #083CAE",
|
@@ -305,12 +303,12 @@ Object {
|
|
305
303
|
"&:focus": Object {
|
306
304
|
"outline": "2px solid #fff",
|
307
305
|
},
|
306
|
+
"&:focus-visible": Object {
|
307
|
+
"boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
|
308
|
+
},
|
308
309
|
"&:hover": Object {
|
309
310
|
"background": "rgba(255,255,255,0.05)",
|
310
311
|
},
|
311
|
-
"&:not(:active):focus-visible": Object {
|
312
|
-
"boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
|
313
|
-
},
|
314
312
|
"background": "transparent",
|
315
313
|
"color": "#fff",
|
316
314
|
"outline": "2px solid #fff",
|
package/build/Button/styles.js
CHANGED
@@ -102,7 +102,7 @@ var _default = {
|
|
102
102
|
'&:focus': {
|
103
103
|
outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"])
|
104
104
|
},
|
105
|
-
'&:
|
105
|
+
'&:focus-visible': {
|
106
106
|
boxShadow: _shadows["default"]['focus-pink']
|
107
107
|
},
|
108
108
|
'&$disabled': {
|
@@ -130,7 +130,7 @@ var _default = {
|
|
130
130
|
'&:active': {
|
131
131
|
background: _colors2["default"].button.secondary.bg.active
|
132
132
|
},
|
133
|
-
'&:
|
133
|
+
'&:focus-visible': {
|
134
134
|
boxShadow: _shadows["default"]['focus-indigo']
|
135
135
|
},
|
136
136
|
'&$disabled': {
|
@@ -165,7 +165,7 @@ var _default = {
|
|
165
165
|
'&:focus': {
|
166
166
|
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"])
|
167
167
|
},
|
168
|
-
'&:
|
168
|
+
'&:focus-visible': {
|
169
169
|
boxShadow: _shadows["default"]['focus-indigo']
|
170
170
|
},
|
171
171
|
'& span span': {
|
@@ -201,7 +201,7 @@ var _default = {
|
|
201
201
|
'&:focus': {
|
202
202
|
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"])
|
203
203
|
},
|
204
|
-
'&:
|
204
|
+
'&:focus-visible': {
|
205
205
|
boxShadow: _shadows["default"]['focus-white']
|
206
206
|
},
|
207
207
|
'& span span': {
|
@@ -261,7 +261,7 @@ var _default = {
|
|
261
261
|
'&:active': {
|
262
262
|
background: _colors2["default"].button.ghost.bg.active
|
263
263
|
},
|
264
|
-
'&:
|
264
|
+
'&:focus-visible': {
|
265
265
|
boxShadow: _shadows["default"]['focus-corp']
|
266
266
|
},
|
267
267
|
'& span span': {
|
@@ -291,7 +291,7 @@ var _default = {
|
|
291
291
|
'&:active': {
|
292
292
|
background: _colors2["default"].button.ghost.bg.inverse.active
|
293
293
|
},
|
294
|
-
'&:
|
294
|
+
'&:focus-visible': {
|
295
295
|
boxShadow: _shadows["default"]['focus-white']
|
296
296
|
},
|
297
297
|
'& span span': {
|
@@ -346,8 +346,6 @@ var _default = {
|
|
346
346
|
transition: '0.3s all'
|
347
347
|
},
|
348
348
|
iconRight: {
|
349
|
-
width: 16,
|
350
|
-
height: 16,
|
351
349
|
marginLeft: _spacing["default"]['size-2'],
|
352
350
|
display: 'inline-block',
|
353
351
|
transition: '0.3s all'
|