@occmundial/occ-atomic 2.0.0-beta.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +123 -0
- package/build/Button/__snapshots__/Button.test.js.snap +4 -4
- package/build/Button/styles.js +4 -4
- package/build/Fab/Fab.js +81 -0
- package/build/Fab/Fab.test.js +64 -0
- package/build/Fab/__snapshots__/Fab.test.js.snap +16 -0
- package/build/Fab/index.js +18 -0
- package/build/Fab/styles.js +45 -0
- package/build/Pager/Pager.js +15 -7
- package/build/Pager/Pager.test.js +11 -11
- package/build/Pager/__snapshots__/Pager.test.js.snap +12 -9
- package/build/Pager/styles.js +12 -9
- package/build/Radio/Radio.js +8 -1
- package/build/Radio/__snapshots__/Radio.test.js.snap +80 -25
- package/build/Radio/styles.js +84 -25
- package/build/Tip/Tip.js +4 -4
- package/build/Toaster/Toast/Toast.js +4 -4
- package/build/index.js +4 -1
- package/build/plugin/babel.js +2 -0
- package/build/subatomic/icons/occDart.js +2 -2
- package/build/subatomic/icons/occHorizontal.js +2 -2
- package/build/subatomic/icons/occLogo.js +2 -2
- package/build/subatomic/icons/occVertical.js +2 -2
- package/build/subatomic/mappedIcons.js +2 -3
- package/catalog-info.yaml +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,126 @@
|
|
1
|
+
# [2.0.0](https://github.com/occmundial/occ-atomic/compare/v1.39.1...v2.0.0) (2024-05-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Add exception for the provider in the babel plugin ([4383e87](https://github.com/occmundial/occ-atomic/commit/4383e876ef28bb773dca3ff9149dfe1ad7cc53a1))
|
7
|
+
* Add missed icons ([a5527c5](https://github.com/occmundial/occ-atomic/commit/a5527c5eff5afb23c142c0b412756ee8f6a11b02))
|
8
|
+
* Adjust icon in prev and next button ([8d78c19](https://github.com/occmundial/occ-atomic/commit/8d78c196ce2a27990084683fbeb95b0b9e49be02))
|
9
|
+
* Adjust styles for ghostPink theme and button icons ([942a2c9](https://github.com/occmundial/occ-atomic/commit/942a2c967cea88479154a65a98f2961bfbd406ce))
|
10
|
+
* Adjust styles for ghostPink theme and button icons ([9e2576e](https://github.com/occmundial/occ-atomic/commit/9e2576efb42856f1a91ab271ea4b823fbbfbf45d))
|
11
|
+
* Change font tokens in Button ([7b0b47a](https://github.com/occmundial/occ-atomic/commit/7b0b47ab608530cf4fa6ea31afb2592ad70958c9))
|
12
|
+
* Change logic to fallback legacy icons ([60f37f4](https://github.com/occmundial/occ-atomic/commit/60f37f48391713faba97f6d4f93e60519d79b348))
|
13
|
+
* Change name of the import for AtomicProvider in babel ([d0157de](https://github.com/occmundial/occ-atomic/commit/d0157de2321bce412dc0662a98f89a6196dbc917))
|
14
|
+
* Change tabs to spaces ([ba606c3](https://github.com/occmundial/occ-atomic/commit/ba606c3951a779fd05937fed49f785cc529cd611))
|
15
|
+
* Change the import declaration for the provider ([4fae96e](https://github.com/occmundial/occ-atomic/commit/4fae96e40028fc5d93438f7df3fd7342c0f6392a))
|
16
|
+
* Changed font variable to the old one ([75dc28b](https://github.com/occmundial/occ-atomic/commit/75dc28bc0bd174057449c45d4ebe79366ffc8433))
|
17
|
+
* Fix loading icon size ([2cf2248](https://github.com/occmundial/occ-atomic/commit/2cf22486a65eb78ce9e7fb18da00a7e237fbcb55))
|
18
|
+
* Force padding of 0 in ghostPink button ([778ef27](https://github.com/occmundial/occ-atomic/commit/778ef27301183f43ace721b625582c14c353009b))
|
19
|
+
* Include the tokens into the build ([d3d0e1e](https://github.com/occmundial/occ-atomic/commit/d3d0e1eea096847bfcaf99d6c8f56b17d45faa5f))
|
20
|
+
* Update design tokens ([6c96339](https://github.com/occmundial/occ-atomic/commit/6c963392e0b3af43978a5189bdbe0304e046f47c))
|
21
|
+
* Update tip and toast icons ([07f3474](https://github.com/occmundial/occ-atomic/commit/07f347420e2f3d278274018cd9039508cbd7e504))
|
22
|
+
|
23
|
+
|
24
|
+
### Features
|
25
|
+
|
26
|
+
* Add hover shadow ([207b7a2](https://github.com/occmundial/occ-atomic/commit/207b7a2819771ff7384c7c53448f37d5dfb7e146))
|
27
|
+
* Add logic to use atomic icons and static icons ([6fe277e](https://github.com/occmundial/occ-atomic/commit/6fe277ed83927d29af3cf06573cb6d08a0f399ab))
|
28
|
+
* Add logic to use atomic icons and static icons ([0b9a9e4](https://github.com/occmundial/occ-atomic/commit/0b9a9e41c37a4fcff6c14c8e79da4885662ccba1))
|
29
|
+
* Add new design tokens files ([6b8fbcf](https://github.com/occmundial/occ-atomic/commit/6b8fbcf03f272603020686e229cf3ad1bd3e3a3e))
|
30
|
+
* Add new fab component ([2164eea](https://github.com/occmundial/occ-atomic/commit/2164eea04ed268165609db2bcd80be4dd02df6a2))
|
31
|
+
* Add to mapped icons stars solid icon ([5c96982](https://github.com/occmundial/occ-atomic/commit/5c9698235dc690bb8e1c913cc140854fc64c530b))
|
32
|
+
* Adds testing icon to legacy icons ([a0bca6c](https://github.com/occmundial/occ-atomic/commit/a0bca6c33f54e731b645a953499dbc5b96d03d90))
|
33
|
+
* Change Button themes and styles ([114375d](https://github.com/occmundial/occ-atomic/commit/114375d8a7a3b56622c00416a007e52a333ed8d4))
|
34
|
+
* Change occ logo blue color to blue token ([4b7d63d](https://github.com/occmundial/occ-atomic/commit/4b7d63d0743a8caecc019f8326733c4cf2017b2f))
|
35
|
+
* Changed some examples with tables ([3efe252](https://github.com/occmundial/occ-atomic/commit/3efe252c3d8651976f28e951081c717861c0ad56))
|
36
|
+
* Map arrow down to chevron down ([9bd47fa](https://github.com/occmundial/occ-atomic/commit/9bd47fab659f3f7743d6f0b6a48dc9ecf599022d))
|
37
|
+
* Remove fab border transition ([485e64c](https://github.com/occmundial/occ-atomic/commit/485e64ca574f3300a159b8c4a5bedf11ee49b32d))
|
38
|
+
* Remove fab border transition ([9561c59](https://github.com/occmundial/occ-atomic/commit/9561c599981f8ccfc76ccdb00b35576d01f53578))
|
39
|
+
* Update atomic icons ([cdaa9bd](https://github.com/occmundial/occ-atomic/commit/cdaa9bda879f0d8aabe44a79cd16a0eedd3a7e8d))
|
40
|
+
* Update fab snapshot test ([d75b525](https://github.com/occmundial/occ-atomic/commit/d75b525dd32c4f4b38cebf4f5cd8e0dd1034752e))
|
41
|
+
* Update ghost pink loading icon ([9292276](https://github.com/occmundial/occ-atomic/commit/92922766abe7c0010b9f4f4b8265c2105c019f3c))
|
42
|
+
* Update snapshots ([438e896](https://github.com/occmundial/occ-atomic/commit/438e8968d5d228d1b9bad3883be676fa1bc8f2b1))
|
43
|
+
* Update snapshots ([0395996](https://github.com/occmundial/occ-atomic/commit/0395996ad4f21e6db5b917005c9ccf1c8a9dd0df))
|
44
|
+
* Update tokens path and add outline offset ([a7e6807](https://github.com/occmundial/occ-atomic/commit/a7e6807e1936d98c8f72e483b1b131dcfa714877))
|
45
|
+
* Update tokens path and add outline offset ([89eeb16](https://github.com/occmundial/occ-atomic/commit/89eeb16a797cb4996069f369bce34b9efb025a3d))
|
46
|
+
* Updated radio styles and documentation ([2c39496](https://github.com/occmundial/occ-atomic/commit/2c39496186092fe20434ce4a030c28e42cebff91))
|
47
|
+
* Updated Text component documentation ([73e4b21](https://github.com/occmundial/occ-atomic/commit/73e4b21d488ba012df82d2e4fb85c18689c5d586))
|
48
|
+
* Updated text component with new tokens ([b5f75ee](https://github.com/occmundial/occ-atomic/commit/b5f75eec430126b36c06dcd60bb320ccdf7eee0f))
|
49
|
+
* Upgrade font tokens ([069bf92](https://github.com/occmundial/occ-atomic/commit/069bf9237f5b52492961f96f0a6f4a79469f4448))
|
50
|
+
* Validate render icon in button logic ([c445f00](https://github.com/occmundial/occ-atomic/commit/c445f00b7f89b94c102b0e113b503d0e1a5193d4))
|
51
|
+
* Validate render icon in button logic ([91dbc46](https://github.com/occmundial/occ-atomic/commit/91dbc464acceec6b1c7c9d2dde28976d04a5bf30))
|
52
|
+
|
53
|
+
|
54
|
+
### BREAKING CHANGES
|
55
|
+
|
56
|
+
* 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
|
+
|
58
|
+
# [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
|
+
|
60
|
+
|
61
|
+
### Bug Fixes
|
62
|
+
|
63
|
+
* Adjust icon in prev and next button ([8d78c19](https://github.com/occmundial/occ-atomic/commit/8d78c196ce2a27990084683fbeb95b0b9e49be02))
|
64
|
+
* Change tabs to spaces ([ba606c3](https://github.com/occmundial/occ-atomic/commit/ba606c3951a779fd05937fed49f785cc529cd611))
|
65
|
+
|
66
|
+
# [2.0.0-beta.15](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2024-05-10)
|
67
|
+
|
68
|
+
|
69
|
+
### Features
|
70
|
+
|
71
|
+
* Updated radio styles and documentation ([2c39496](https://github.com/occmundial/occ-atomic/commit/2c39496186092fe20434ce4a030c28e42cebff91))
|
72
|
+
|
73
|
+
# [2.0.0-beta.14](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.13...v2.0.0-beta.14) (2024-05-07)
|
74
|
+
|
75
|
+
|
76
|
+
### Features
|
77
|
+
|
78
|
+
* Add hover shadow ([207b7a2](https://github.com/occmundial/occ-atomic/commit/207b7a2819771ff7384c7c53448f37d5dfb7e146))
|
79
|
+
* Add new fab component ([2164eea](https://github.com/occmundial/occ-atomic/commit/2164eea04ed268165609db2bcd80be4dd02df6a2))
|
80
|
+
* Remove fab border transition ([485e64c](https://github.com/occmundial/occ-atomic/commit/485e64ca574f3300a159b8c4a5bedf11ee49b32d))
|
81
|
+
* Remove fab border transition ([9561c59](https://github.com/occmundial/occ-atomic/commit/9561c599981f8ccfc76ccdb00b35576d01f53578))
|
82
|
+
* Update fab snapshot test ([d75b525](https://github.com/occmundial/occ-atomic/commit/d75b525dd32c4f4b38cebf4f5cd8e0dd1034752e))
|
83
|
+
* Update ghost pink loading icon ([9292276](https://github.com/occmundial/occ-atomic/commit/92922766abe7c0010b9f4f4b8265c2105c019f3c))
|
84
|
+
* Update snapshots ([438e896](https://github.com/occmundial/occ-atomic/commit/438e8968d5d228d1b9bad3883be676fa1bc8f2b1))
|
85
|
+
* Update snapshots ([0395996](https://github.com/occmundial/occ-atomic/commit/0395996ad4f21e6db5b917005c9ccf1c8a9dd0df))
|
86
|
+
* Update tokens path and add outline offset ([a7e6807](https://github.com/occmundial/occ-atomic/commit/a7e6807e1936d98c8f72e483b1b131dcfa714877))
|
87
|
+
* Update tokens path and add outline offset ([89eeb16](https://github.com/occmundial/occ-atomic/commit/89eeb16a797cb4996069f369bce34b9efb025a3d))
|
88
|
+
|
89
|
+
# [2.0.0-beta.13](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2024-04-29)
|
90
|
+
|
91
|
+
|
92
|
+
### Features
|
93
|
+
|
94
|
+
* Map arrow down to chevron down ([9bd47fa](https://github.com/occmundial/occ-atomic/commit/9bd47fab659f3f7743d6f0b6a48dc9ecf599022d))
|
95
|
+
|
96
|
+
# [2.0.0-beta.12](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2024-04-26)
|
97
|
+
|
98
|
+
|
99
|
+
### Bug Fixes
|
100
|
+
|
101
|
+
* Change name of the import for AtomicProvider in babel ([d0157de](https://github.com/occmundial/occ-atomic/commit/d0157de2321bce412dc0662a98f89a6196dbc917))
|
102
|
+
|
103
|
+
# [2.0.0-beta.11](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.10...v2.0.0-beta.11) (2024-04-25)
|
104
|
+
|
105
|
+
|
106
|
+
### Bug Fixes
|
107
|
+
|
108
|
+
* Update tip and toast icons ([07f3474](https://github.com/occmundial/occ-atomic/commit/07f347420e2f3d278274018cd9039508cbd7e504))
|
109
|
+
|
110
|
+
# [2.0.0-beta.10](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.9...v2.0.0-beta.10) (2024-04-25)
|
111
|
+
|
112
|
+
|
113
|
+
### Bug Fixes
|
114
|
+
|
115
|
+
* Change the import declaration for the provider ([4fae96e](https://github.com/occmundial/occ-atomic/commit/4fae96e40028fc5d93438f7df3fd7342c0f6392a))
|
116
|
+
|
117
|
+
# [2.0.0-beta.9](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.8...v2.0.0-beta.9) (2024-04-25)
|
118
|
+
|
119
|
+
|
120
|
+
### Bug Fixes
|
121
|
+
|
122
|
+
* Add exception for the provider in the babel plugin ([4383e87](https://github.com/occmundial/occ-atomic/commit/4383e876ef28bb773dca3ff9149dfe1ad7cc53a1))
|
123
|
+
|
1
124
|
# [2.0.0-beta.8](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.7...v2.0.0-beta.8) (2024-04-25)
|
2
125
|
|
3
126
|
|
@@ -49,7 +49,7 @@ Object {
|
|
49
49
|
},
|
50
50
|
"ghostGrey": Object {
|
51
51
|
"& $loadIcon": Object {
|
52
|
-
"
|
52
|
+
"fill": "#5A5D7B",
|
53
53
|
},
|
54
54
|
"& span span": Object {
|
55
55
|
"background": [Function],
|
@@ -75,7 +75,7 @@ Object {
|
|
75
75
|
},
|
76
76
|
"ghostPink": Object {
|
77
77
|
"& $loadIcon": Object {
|
78
|
-
"
|
78
|
+
"fill": "#f13465",
|
79
79
|
},
|
80
80
|
"& span span": Object {
|
81
81
|
"background": [Function],
|
@@ -232,7 +232,7 @@ Object {
|
|
232
232
|
},
|
233
233
|
"secondary": Object {
|
234
234
|
"& $loadIcon": Object {
|
235
|
-
"
|
235
|
+
"fill": "#083CAE",
|
236
236
|
},
|
237
237
|
"& span span": Object {
|
238
238
|
"background": [Function],
|
@@ -258,7 +258,7 @@ Object {
|
|
258
258
|
},
|
259
259
|
"tertiary": Object {
|
260
260
|
"& $loadIcon": Object {
|
261
|
-
"
|
261
|
+
"fill": "#083CAE",
|
262
262
|
},
|
263
263
|
"& span span": Object {
|
264
264
|
"background": [Function],
|
package/build/Button/styles.js
CHANGED
@@ -148,7 +148,7 @@ var _default = {
|
|
148
148
|
}
|
149
149
|
},
|
150
150
|
'& $loadIcon': {
|
151
|
-
|
151
|
+
fill: _colors2["default"].icon.brand["default"]
|
152
152
|
}
|
153
153
|
},
|
154
154
|
tertiary: {
|
@@ -184,7 +184,7 @@ var _default = {
|
|
184
184
|
}
|
185
185
|
},
|
186
186
|
'& $loadIcon': {
|
187
|
-
|
187
|
+
fill: _colors2["default"].icon.brand["default"]
|
188
188
|
}
|
189
189
|
},
|
190
190
|
tertiaryWhite: {
|
@@ -249,7 +249,7 @@ var _default = {
|
|
249
249
|
}
|
250
250
|
},
|
251
251
|
'& $loadIcon': {
|
252
|
-
|
252
|
+
fill: sec
|
253
253
|
}
|
254
254
|
},
|
255
255
|
ghostGrey: {
|
@@ -279,7 +279,7 @@ var _default = {
|
|
279
279
|
}
|
280
280
|
},
|
281
281
|
'& $loadIcon': {
|
282
|
-
|
282
|
+
fill: _colors2["default"].icon["default"]["default"]
|
283
283
|
}
|
284
284
|
},
|
285
285
|
ghostWhite: {
|
package/build/Fab/Fab.js
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
|
+
|
12
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
|
+
|
16
|
+
/**
|
17
|
+
*
|
18
|
+
* A floating action button appears in front of all screen content as a circular shape with an icon in its center.
|
19
|
+
*/
|
20
|
+
var Fab = function Fab(props) {
|
21
|
+
var size = props.size,
|
22
|
+
classes = props.classes,
|
23
|
+
className = props.className,
|
24
|
+
testId = props.testId,
|
25
|
+
icon = props.icon,
|
26
|
+
onClick = props.onClick,
|
27
|
+
href = props.href,
|
28
|
+
target = props.target,
|
29
|
+
rel = props.rel,
|
30
|
+
disabled = props.disabled,
|
31
|
+
id = props.id;
|
32
|
+
var classNames = classes.fab;
|
33
|
+
if (className) classNames += " ".concat(className);
|
34
|
+
if (disabled) classNames += " ".concat(classes.disabled);
|
35
|
+
return /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
36
|
+
size: size,
|
37
|
+
icon: icon,
|
38
|
+
onClick: onClick,
|
39
|
+
href: href,
|
40
|
+
target: target,
|
41
|
+
rel: rel,
|
42
|
+
disabled: disabled,
|
43
|
+
round: true,
|
44
|
+
testId: testId,
|
45
|
+
className: classNames,
|
46
|
+
id: id,
|
47
|
+
theme: "tertiary"
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
Fab.propTypes = {
|
52
|
+
classes: _propTypes["default"].object.isRequired,
|
53
|
+
|
54
|
+
/** Use the name of any of the icons available in the library. */
|
55
|
+
icon: _propTypes["default"].string.isRequired,
|
56
|
+
|
57
|
+
/** The fab has three different sizes: sm, md, lg. */
|
58
|
+
size: _propTypes["default"].oneOf(['sm', 'md', 'lg']),
|
59
|
+
|
60
|
+
/** It disables the button. */
|
61
|
+
disabled: _propTypes["default"].bool,
|
62
|
+
|
63
|
+
/** The function to call when the button is clicked. */
|
64
|
+
onClick: _propTypes["default"].func,
|
65
|
+
|
66
|
+
/** Optionally, you can set the href property and use it like a link. */
|
67
|
+
href: _propTypes["default"].string,
|
68
|
+
|
69
|
+
/** If you use the href property, you can also define the target. */
|
70
|
+
target: _propTypes["default"].string,
|
71
|
+
|
72
|
+
/** If you use the href property, you can also define the rel attribute. */
|
73
|
+
rel: _propTypes["default"].string,
|
74
|
+
id: _propTypes["default"].string,
|
75
|
+
className: _propTypes["default"].string,
|
76
|
+
|
77
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
78
|
+
testId: _propTypes["default"].string
|
79
|
+
};
|
80
|
+
var _default = Fab;
|
81
|
+
exports["default"] = _default;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
4
|
+
|
5
|
+
var _enzyme = require("enzyme");
|
6
|
+
|
7
|
+
var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
|
8
|
+
|
9
|
+
var _Fab = _interopRequireDefault(require("./Fab"));
|
10
|
+
|
11
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
14
|
+
|
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
|
+
describe('FAB', function () {
|
23
|
+
it('matches the snapshot', function () {
|
24
|
+
var wrapper = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Fab["default"], {
|
25
|
+
icon: "testing",
|
26
|
+
theme: "primary",
|
27
|
+
classes: classes
|
28
|
+
})).toJSON();
|
29
|
+
|
30
|
+
expect(wrapper).toMatchSnapshot();
|
31
|
+
});
|
32
|
+
it('returns a Button with an icon', function () {
|
33
|
+
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Fab["default"], {
|
34
|
+
classes: classes,
|
35
|
+
icon: "testing"
|
36
|
+
}));
|
37
|
+
expect(wrapper.find('button').length).toBe(1);
|
38
|
+
expect(wrapper.find('button span Jss(Icon)').length).toBe(1);
|
39
|
+
expect(wrapper.find('a').length).toBe(0);
|
40
|
+
});
|
41
|
+
it('returns an anchor', function () {
|
42
|
+
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Fab["default"], {
|
43
|
+
classes: classes,
|
44
|
+
href: "http://occ.com.mx",
|
45
|
+
icon: "testing"
|
46
|
+
}));
|
47
|
+
expect(wrapper.find('button').length).toBe(0);
|
48
|
+
expect(wrapper.find('a').length).toBe(1);
|
49
|
+
});
|
50
|
+
it('has the right size', function () {
|
51
|
+
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Fab["default"], {
|
52
|
+
classes: classes,
|
53
|
+
icon: "testing",
|
54
|
+
size: "md"
|
55
|
+
}));
|
56
|
+
expect(wrapper.find('button').prop('className').indexOf('md')).not.toBe(-1);
|
57
|
+
expect(wrapper.find('button').prop('className').indexOf('lg')).toBe(-1);
|
58
|
+
wrapper.setProps({
|
59
|
+
size: 'lg'
|
60
|
+
});
|
61
|
+
expect(wrapper.find('button').prop('className').indexOf('md')).toBe(-1);
|
62
|
+
expect(wrapper.find('button').prop('className').indexOf('lg')).not.toBe(-1);
|
63
|
+
});
|
64
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`FAB matches the snapshot 1`] = `
|
4
|
+
<button
|
5
|
+
className="Button-btn-0-1-28 Button-btn-0-1-1 Button-tertiary-0-1-23 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-38 Button-iconOnly-0-1-18 Button-round-0-1-40 Button-round-0-1-20"
|
6
|
+
>
|
7
|
+
<span
|
8
|
+
className="Button-cont-0-1-29 Button-cont-0-1-2"
|
9
|
+
>
|
10
|
+
<span
|
11
|
+
className="Icon-oldIcon-0-1-45 Icon-oldIcon-0-1-43 Button-icon-0-1-36 Button-icon-0-1-16"
|
12
|
+
/>
|
13
|
+
|
14
|
+
</span>
|
15
|
+
</button>
|
16
|
+
`;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _reactJss = _interopRequireDefault(require("react-jss"));
|
9
|
+
|
10
|
+
var _Fab = _interopRequireDefault(require("./Fab"));
|
11
|
+
|
12
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
|
+
|
16
|
+
var _default = (0, _reactJss["default"])(_styles["default"])(_Fab["default"]);
|
17
|
+
|
18
|
+
exports["default"] = _default;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
9
|
+
|
10
|
+
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
|
+
|
14
|
+
var _default = {
|
15
|
+
fab: {
|
16
|
+
background: "".concat(_colors["default"].bg.surface["default"], " !important"),
|
17
|
+
outline: "1px solid ".concat(_colors["default"].border["default"]["default"]),
|
18
|
+
outlineOffset: '-1px',
|
19
|
+
boxShadow: _shadows["default"]["elevation-elevation-4"],
|
20
|
+
transition: '0.3s all, 0s outline, 0s outline-offset',
|
21
|
+
'&:hover': {
|
22
|
+
outlineColor: _colors["default"].border["default"].bold,
|
23
|
+
background: "".concat(_colors["default"].bg["default"], " !important")
|
24
|
+
},
|
25
|
+
'&:active, &:focus': {
|
26
|
+
outline: "2px solid ".concat(_colors["default"].border["default"].bold),
|
27
|
+
outlineOffset: '-2px',
|
28
|
+
background: "".concat(_colors["default"].bg["default"], " !important")
|
29
|
+
},
|
30
|
+
'&$disabled': {
|
31
|
+
color: _colors["default"].text.indigo.secondary,
|
32
|
+
cursor: 'not-allowed',
|
33
|
+
outlineColor: _colors["default"].border["default"].subtle
|
34
|
+
},
|
35
|
+
'&:not(:active):focus-visible': {
|
36
|
+
boxShadow: _shadows["default"]['focus-corp'],
|
37
|
+
outlineColor: _colors["default"].border["default"]["default"]
|
38
|
+
}
|
39
|
+
},
|
40
|
+
disabled: {
|
41
|
+
cursor: 'default',
|
42
|
+
pointerEvents: 'none'
|
43
|
+
}
|
44
|
+
};
|
45
|
+
exports["default"] = _default;
|
package/build/Pager/Pager.js
CHANGED
@@ -218,20 +218,28 @@ var Pager = /*#__PURE__*/function (_React$Component) {
|
|
218
218
|
return /*#__PURE__*/_react["default"].createElement("ul", {
|
219
219
|
className: "".concat(classes.pager).concat(className ? " ".concat(className) : '')
|
220
220
|
}, /*#__PURE__*/_react["default"].createElement("li", {
|
221
|
-
className: "".concat(classes.btn, " ").concat(classes.
|
221
|
+
className: "".concat(classes.btn, " ").concat(classes.listItemPrevious).concat(selected == 1 ? " ".concat(classes.disabled) : ''),
|
222
222
|
tabIndex: "0",
|
223
223
|
onClick: this.handlePrevPage
|
224
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
225
|
+
className: classes.prev
|
224
226
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
225
|
-
iconName: "
|
227
|
+
iconName: "chevron-left",
|
228
|
+
width: 14,
|
229
|
+
height: 14,
|
226
230
|
colors: ['#adb4bb']
|
227
|
-
}),
|
228
|
-
className: "".concat(classes.btn, " ").concat(classes.
|
231
|
+
}), previousLabel)), !hideNumbers && this.pagination(), /*#__PURE__*/_react["default"].createElement("li", {
|
232
|
+
className: "".concat(classes.btn, " ").concat(classes.listItemNext).concat(selected == pageCount ? " ".concat(classes.disabled) : ''),
|
229
233
|
tabIndex: "0",
|
230
234
|
onClick: this.handleNextPage
|
231
|
-
},
|
232
|
-
|
235
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
236
|
+
className: classes.next
|
237
|
+
}, nextLabel, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
238
|
+
iconName: "chevron-right",
|
239
|
+
width: 14,
|
240
|
+
height: 14,
|
233
241
|
colors: ['#adb4bb']
|
234
|
-
})));
|
242
|
+
}))));
|
235
243
|
}
|
236
244
|
}]);
|
237
245
|
|
@@ -30,10 +30,10 @@ describe("Pager", function () {
|
|
30
30
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pager["default"], {
|
31
31
|
classes: classes
|
32
32
|
}));
|
33
|
-
expect(wrapper.find('.
|
34
|
-
expect(wrapper.find('.
|
35
|
-
expect(wrapper.find('.
|
36
|
-
expect(wrapper.find('.
|
33
|
+
expect(wrapper.find('.listItemPrevious').length).toBe(1);
|
34
|
+
expect(wrapper.find('.listItemPrevious').text()).toEqual('<Jss(Icon) />Previous');
|
35
|
+
expect(wrapper.find('.listItemNext').length).toBe(1);
|
36
|
+
expect(wrapper.find('.listItemNext').text()).toEqual('Next<Jss(Icon) />');
|
37
37
|
});
|
38
38
|
it('changes to previous page', function () {
|
39
39
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pager["default"], {
|
@@ -41,7 +41,7 @@ describe("Pager", function () {
|
|
41
41
|
classes: classes
|
42
42
|
}));
|
43
43
|
expect(wrapper.state('selected')).toEqual(3);
|
44
|
-
wrapper.find('.
|
44
|
+
wrapper.find('.listItemPrevious').simulate('click', {
|
45
45
|
target: {}
|
46
46
|
});
|
47
47
|
expect(wrapper.state('selected')).toEqual(2);
|
@@ -52,7 +52,7 @@ describe("Pager", function () {
|
|
52
52
|
classes: classes
|
53
53
|
}));
|
54
54
|
expect(wrapper.state('selected')).toEqual(3);
|
55
|
-
wrapper.find('.
|
55
|
+
wrapper.find('.listItemNext').simulate('click', {
|
56
56
|
target: {}
|
57
57
|
});
|
58
58
|
expect(wrapper.state('selected')).toEqual(4);
|
@@ -84,11 +84,11 @@ describe("Pager", function () {
|
|
84
84
|
initialPage: 1,
|
85
85
|
classes: classes
|
86
86
|
}));
|
87
|
-
expect(wrapper.find('.
|
87
|
+
expect(wrapper.find('.listItemPrevious').hasClass('disabled')).toEqual(true);
|
88
88
|
wrapper.setProps({
|
89
89
|
forcePage: 5
|
90
90
|
});
|
91
|
-
expect(wrapper.find('.
|
91
|
+
expect(wrapper.find('.listItemPrevious').hasClass('disabled')).toEqual(false);
|
92
92
|
});
|
93
93
|
it('disables the next page button', function () {
|
94
94
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pager["default"], {
|
@@ -96,11 +96,11 @@ describe("Pager", function () {
|
|
96
96
|
initialPage: 5,
|
97
97
|
classes: classes
|
98
98
|
}));
|
99
|
-
expect(wrapper.find('.
|
99
|
+
expect(wrapper.find('.listItemNext').hasClass('disabled')).toEqual(true);
|
100
100
|
wrapper.setProps({
|
101
101
|
forcePage: 1
|
102
102
|
});
|
103
|
-
expect(wrapper.find('.
|
103
|
+
expect(wrapper.find('.listItemNext').hasClass('disabled')).toEqual(false);
|
104
104
|
});
|
105
105
|
it('calls the onPageChange function', function () {
|
106
106
|
var onPageChange = jest.fn();
|
@@ -108,7 +108,7 @@ describe("Pager", function () {
|
|
108
108
|
onPageChange: onPageChange,
|
109
109
|
classes: classes
|
110
110
|
}));
|
111
|
-
wrapper.find('.
|
111
|
+
wrapper.find('.listItemNext').simulate('click', {
|
112
112
|
target: {}
|
113
113
|
});
|
114
114
|
expect(onPageChange.mock.calls.length).toBe(1);
|
@@ -15,7 +15,6 @@ Object {
|
|
15
15
|
"border": "1px solid #bfbfbf",
|
16
16
|
"borderRadius": "5px",
|
17
17
|
"cursor": "pointer",
|
18
|
-
"display": "inline-block",
|
19
18
|
"fontFamily": "'OccText', sans-serif",
|
20
19
|
"outline": "0",
|
21
20
|
"padding": "3px 13px",
|
@@ -25,24 +24,28 @@ Object {
|
|
25
24
|
"opacity": "0.4",
|
26
25
|
"pointerEvents": "none",
|
27
26
|
},
|
28
|
-
"
|
29
|
-
"& span": Object {
|
30
|
-
"transform": "rotate(-90deg)",
|
31
|
-
},
|
27
|
+
"listItemNext": Object {
|
32
28
|
"marginLeft": "15px",
|
33
29
|
},
|
30
|
+
"listItemPrevious": Object {
|
31
|
+
"marginRight": "15px",
|
32
|
+
},
|
33
|
+
"next": Object {
|
34
|
+
"alignItems": "center",
|
35
|
+
"display": "flex",
|
36
|
+
},
|
34
37
|
"pager": Object {
|
38
|
+
"alignItems": "center",
|
35
39
|
"color": "#727272",
|
40
|
+
"display": "flex",
|
36
41
|
"fontFamily": "'OccText', sans-serif",
|
37
42
|
"fontSize": "14px",
|
38
43
|
"listStyle": "none",
|
39
44
|
"paddingLeft": "0",
|
40
45
|
},
|
41
46
|
"prev": Object {
|
42
|
-
"
|
43
|
-
|
44
|
-
},
|
45
|
-
"marginRight": "15px",
|
47
|
+
"alignItems": "center",
|
48
|
+
"display": "flex",
|
46
49
|
},
|
47
50
|
}
|
48
51
|
`;
|
package/build/Pager/styles.js
CHANGED
@@ -15,12 +15,13 @@ var _default = {
|
|
15
15
|
pager: {
|
16
16
|
listStyle: 'none',
|
17
17
|
paddingLeft: '0',
|
18
|
+
display: 'flex',
|
19
|
+
alignItems: 'center',
|
18
20
|
fontFamily: _fonts["default"].body,
|
19
21
|
color: _colors["default"].grey7,
|
20
22
|
fontSize: '14px'
|
21
23
|
},
|
22
24
|
btn: {
|
23
|
-
display: 'inline-block',
|
24
25
|
fontFamily: _fonts["default"].body,
|
25
26
|
border: "1px solid ".concat(_colors["default"].grey1),
|
26
27
|
borderRadius: '5px',
|
@@ -37,16 +38,18 @@ var _default = {
|
|
37
38
|
}
|
38
39
|
},
|
39
40
|
prev: {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
display: 'flex',
|
42
|
+
alignItems: 'center'
|
43
|
+
},
|
44
|
+
listItemPrevious: {
|
45
|
+
marginRight: '15px'
|
44
46
|
},
|
45
47
|
next: {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
display: 'flex',
|
49
|
+
alignItems: 'center'
|
50
|
+
},
|
51
|
+
listItemNext: {
|
52
|
+
marginLeft: '15px'
|
50
53
|
},
|
51
54
|
disabled: {
|
52
55
|
pointerEvents: 'none',
|
package/build/Radio/Radio.js
CHANGED
@@ -94,6 +94,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
94
94
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
95
95
|
id: option.trk,
|
96
96
|
key: option.value,
|
97
|
+
tabIndex: -1,
|
97
98
|
"data-testid": option.testId
|
98
99
|
}, option.testId && {
|
99
100
|
'data-value': selected == option.value ? 1 : 0
|
@@ -111,7 +112,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
111
112
|
className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '')
|
112
113
|
}, option.label), option.right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
113
114
|
tag: "label",
|
114
|
-
|
115
|
+
corpSecondary: true,
|
115
116
|
className: classes.right
|
116
117
|
}, option.right));
|
117
118
|
}));
|
@@ -147,8 +148,14 @@ Radio.propTypes = {
|
|
147
148
|
|
148
149
|
/** Use this prop to overflow the text of the label, adding '...' and the end. */
|
149
150
|
textOverflow: _propTypes["default"].bool,
|
151
|
+
|
152
|
+
/** Id of the component */
|
150
153
|
id: _propTypes["default"].string,
|
154
|
+
|
155
|
+
/** Adds class(es) to each option container */
|
151
156
|
className: _propTypes["default"].string,
|
157
|
+
|
158
|
+
/** Adds style(s) to each option container */
|
152
159
|
style: _propTypes["default"].object
|
153
160
|
};
|
154
161
|
var _default = Radio;
|
@@ -5,39 +5,92 @@ exports[`Radio matches the snapshot 1`] = `ShallowWrapper {}`;
|
|
5
5
|
exports[`Radio styles matches the snapshot 1`] = `
|
6
6
|
Object {
|
7
7
|
"active": Object {
|
8
|
-
"& $radio
|
9
|
-
"
|
10
|
-
"#
|
11
|
-
|
12
|
-
|
8
|
+
"& $radio": Object {
|
9
|
+
"&:after": Object {
|
10
|
+
"background": "#0059CD",
|
11
|
+
},
|
12
|
+
"&:before": Object {
|
13
|
+
"borderColor": "#0059CD",
|
14
|
+
"borderWidth": 2,
|
15
|
+
},
|
13
16
|
},
|
14
17
|
},
|
15
18
|
"cont": Object {
|
16
|
-
"
|
17
|
-
"
|
18
|
-
|
19
|
-
|
19
|
+
"&$active": Object {
|
20
|
+
"&:active": Object {
|
21
|
+
"& $radio:after": Object {
|
22
|
+
"background": "#0047A5",
|
23
|
+
},
|
24
|
+
"& $radio:before": Object {
|
25
|
+
"borderColor": "#0047A5",
|
26
|
+
"borderWidth": "3px",
|
27
|
+
"boxShadow": "initial",
|
28
|
+
},
|
29
|
+
},
|
30
|
+
"&:focus $radio:before": Object {
|
31
|
+
"borderColor": "#0059CD",
|
32
|
+
"boxShadow": undefined,
|
33
|
+
},
|
34
|
+
"&:hover": Object {
|
35
|
+
"& $radio:after": Object {
|
36
|
+
"background": "#0047A5",
|
37
|
+
},
|
38
|
+
"& $radio:before": Object {
|
39
|
+
"borderColor": "#0047A5",
|
40
|
+
"boxShadow": "initial",
|
41
|
+
},
|
42
|
+
},
|
20
43
|
},
|
21
|
-
"&:
|
22
|
-
"
|
44
|
+
"&:not($active)": Object {
|
45
|
+
"&:active $radio:before": Object {
|
46
|
+
"borderColor": "#6C6F89",
|
47
|
+
"borderWidth": "2px",
|
48
|
+
"boxShadow": "initial",
|
49
|
+
},
|
50
|
+
"&:focus $radio:before": Object {
|
51
|
+
"borderColor": "#D3D4DC",
|
52
|
+
"boxShadow": undefined,
|
53
|
+
},
|
54
|
+
"&:hover $radio:before": Object {
|
55
|
+
"borderColor": "#6C6F89",
|
56
|
+
"boxShadow": "initial",
|
57
|
+
},
|
23
58
|
},
|
24
59
|
"alignItems": "start",
|
25
60
|
"boxSizing": "border-box",
|
26
61
|
"cursor": "pointer",
|
27
62
|
"display": "flex",
|
28
63
|
"outline": "0",
|
29
|
-
"paddingBottom":
|
30
|
-
"paddingTop":
|
64
|
+
"paddingBottom": "8px",
|
65
|
+
"paddingTop": "8px",
|
31
66
|
},
|
32
67
|
"disabled": Object {
|
33
|
-
"
|
68
|
+
"& :not($radio)": Object {
|
69
|
+
"opacity": 0.4,
|
70
|
+
},
|
71
|
+
"&$active": Object {
|
72
|
+
"& $radio:after": Object {
|
73
|
+
"background": "#8DA5DA",
|
74
|
+
},
|
75
|
+
"& $radio:before": Object {
|
76
|
+
"borderColor": "#8DA5DA",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
"&:not($active)": Object {
|
80
|
+
"& $radio:after": Object {
|
81
|
+
"background": "#EDEDF1",
|
82
|
+
},
|
83
|
+
"& $radio:before": Object {
|
84
|
+
"background": "#EDEDF1",
|
85
|
+
},
|
86
|
+
},
|
34
87
|
"pointerEvents": "none",
|
35
88
|
},
|
36
89
|
"label": Object {
|
37
90
|
"cursor": "pointer",
|
38
91
|
"flex": "1",
|
39
92
|
"float": "left",
|
40
|
-
"marginLeft":
|
93
|
+
"marginLeft": "8px",
|
41
94
|
},
|
42
95
|
"overflow": Object {
|
43
96
|
"overflow": "hidden",
|
@@ -46,36 +99,38 @@ Object {
|
|
46
99
|
},
|
47
100
|
"radio": Object {
|
48
101
|
"&:after": Object {
|
49
|
-
"background": "
|
102
|
+
"background": "#fff",
|
50
103
|
"borderRadius": "50%",
|
104
|
+
"boxSizing": "border-box",
|
51
105
|
"content": "\\"\\"",
|
52
|
-
"height":
|
106
|
+
"height": 10,
|
53
107
|
"left": "50%",
|
54
108
|
"position": "absolute",
|
55
109
|
"top": "50%",
|
56
110
|
"transform": "translate(-50%, -50%)",
|
57
111
|
"transition": "0.3s all",
|
58
|
-
"width":
|
112
|
+
"width": 10,
|
59
113
|
},
|
60
114
|
"&:before": Object {
|
61
|
-
"background": "#
|
62
|
-
"border": "1px solid #
|
115
|
+
"background": "#fff",
|
116
|
+
"border": "1px solid #D3D4DC",
|
63
117
|
"borderRadius": "50%",
|
118
|
+
"boxSizing": "border-box",
|
64
119
|
"content": "\\"\\"",
|
65
|
-
"height":
|
120
|
+
"height": 20,
|
66
121
|
"left": "50%",
|
67
122
|
"position": "absolute",
|
68
123
|
"top": "50%",
|
69
124
|
"transform": "translate(-50%, -50%)",
|
70
|
-
"width":
|
125
|
+
"width": 20,
|
71
126
|
},
|
72
|
-
"height":
|
127
|
+
"height": "24px",
|
73
128
|
"position": "relative",
|
74
|
-
"width":
|
129
|
+
"width": "24px",
|
75
130
|
},
|
76
131
|
"right": Object {
|
77
132
|
"float": "right",
|
78
|
-
"marginLeft":
|
133
|
+
"marginLeft": "8px",
|
79
134
|
},
|
80
135
|
}
|
81
136
|
`;
|
package/build/Radio/styles.js
CHANGED
@@ -5,76 +5,135 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
|
14
|
+
var radio = _colors["default"].radio;
|
14
15
|
var _default = {
|
15
16
|
cont: {
|
16
|
-
paddingTop: _spacing["default"]
|
17
|
-
paddingBottom: _spacing["default"]
|
17
|
+
paddingTop: _spacing["default"]['size-2'],
|
18
|
+
paddingBottom: _spacing["default"]['size-2'],
|
18
19
|
boxSizing: 'border-box',
|
19
20
|
display: 'flex',
|
20
21
|
alignItems: 'start',
|
21
22
|
cursor: 'pointer',
|
22
23
|
outline: '0',
|
23
|
-
'
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
'&$active': {
|
25
|
+
'&:focus $radio:before': {
|
26
|
+
borderColor: radio['selected']['border']['default'],
|
27
|
+
boxShadow: _colors["default"]['focus-bright-blue']
|
28
|
+
},
|
29
|
+
'&:hover': {
|
30
|
+
'& $radio:before': {
|
31
|
+
borderColor: radio['selected']['border']['hover'],
|
32
|
+
boxShadow: 'initial'
|
33
|
+
},
|
34
|
+
'& $radio:after': {
|
35
|
+
background: radio['selected']['bg']['hover']
|
36
|
+
}
|
37
|
+
},
|
38
|
+
'&:active': {
|
39
|
+
'& $radio:before': {
|
40
|
+
borderColor: radio['selected']['border']['hover'],
|
41
|
+
borderWidth: '3px',
|
42
|
+
boxShadow: 'initial'
|
43
|
+
},
|
44
|
+
'& $radio:after': {
|
45
|
+
background: radio['selected']['bg']['hover']
|
46
|
+
}
|
47
|
+
}
|
27
48
|
},
|
28
|
-
'&:
|
29
|
-
|
49
|
+
'&:not($active)': {
|
50
|
+
'&:focus $radio:before': {
|
51
|
+
borderColor: radio['unselected']['border']['default'],
|
52
|
+
boxShadow: _colors["default"]['focus-bright-blue']
|
53
|
+
},
|
54
|
+
'&:hover $radio:before': {
|
55
|
+
borderColor: radio['unselected']['border']['hover'],
|
56
|
+
boxShadow: 'initial'
|
57
|
+
},
|
58
|
+
'&:active $radio:before': {
|
59
|
+
borderColor: radio['unselected']['border']['hover'],
|
60
|
+
borderWidth: '2px',
|
61
|
+
boxShadow: 'initial'
|
62
|
+
}
|
30
63
|
}
|
31
64
|
},
|
32
65
|
radio: {
|
33
|
-
width: _spacing["default"]
|
34
|
-
height: _spacing["default"]
|
66
|
+
width: _spacing["default"]['size-5'],
|
67
|
+
height: _spacing["default"]['size-5'],
|
35
68
|
position: 'relative',
|
36
69
|
'&:before': {
|
37
70
|
content: '""',
|
38
|
-
|
39
|
-
|
71
|
+
boxSizing: 'border-box',
|
72
|
+
width: 20,
|
73
|
+
height: 20,
|
40
74
|
borderRadius: '50%',
|
41
75
|
position: 'absolute',
|
42
76
|
top: '50%',
|
43
77
|
left: '50%',
|
44
78
|
transform: 'translate(-50%, -50%)',
|
45
|
-
border: "1px solid ".concat(
|
46
|
-
background:
|
79
|
+
border: "1px solid ".concat(radio['unselected']['border']['default']),
|
80
|
+
background: radio['bg']['default']
|
47
81
|
},
|
48
82
|
'&:after': {
|
49
83
|
content: '""',
|
50
|
-
|
51
|
-
|
84
|
+
boxSizing: 'border-box',
|
85
|
+
width: 10,
|
86
|
+
height: 10,
|
52
87
|
borderRadius: '50%',
|
53
88
|
position: 'absolute',
|
54
89
|
top: '50%',
|
55
90
|
left: '50%',
|
56
91
|
transform: 'translate(-50%, -50%)',
|
57
92
|
transition: '0.3s all',
|
58
|
-
background: '
|
93
|
+
background: radio['bg']['default']
|
59
94
|
}
|
60
95
|
},
|
61
96
|
active: {
|
62
|
-
'& $radio
|
63
|
-
|
97
|
+
'& $radio': {
|
98
|
+
'&:before': {
|
99
|
+
borderWidth: 2,
|
100
|
+
borderColor: radio['selected']['border']['default']
|
101
|
+
},
|
102
|
+
'&:after': {
|
103
|
+
background: radio['selected']['bg']['default']
|
104
|
+
}
|
64
105
|
}
|
65
106
|
},
|
66
107
|
disabled: {
|
67
|
-
|
68
|
-
|
108
|
+
pointerEvents: 'none',
|
109
|
+
'& :not($radio)': {
|
110
|
+
opacity: 0.4
|
111
|
+
},
|
112
|
+
'&$active': {
|
113
|
+
'& $radio:before': {
|
114
|
+
borderColor: radio['selected']['border']['disabled']
|
115
|
+
},
|
116
|
+
'& $radio:after': {
|
117
|
+
background: radio['selected']['bg']['disabled']
|
118
|
+
}
|
119
|
+
},
|
120
|
+
'&:not($active)': {
|
121
|
+
'& $radio:before': {
|
122
|
+
background: radio['bg']['disabled']
|
123
|
+
},
|
124
|
+
'& $radio:after': {
|
125
|
+
background: radio['bg']['disabled']
|
126
|
+
}
|
127
|
+
}
|
69
128
|
},
|
70
129
|
label: {
|
71
|
-
marginLeft: _spacing["default"]
|
130
|
+
marginLeft: _spacing["default"]['size-2'],
|
72
131
|
cursor: 'pointer',
|
73
132
|
"float": 'left',
|
74
133
|
flex: '1'
|
75
134
|
},
|
76
135
|
right: {
|
77
|
-
marginLeft: _spacing["default"]
|
136
|
+
marginLeft: _spacing["default"]['size-2'],
|
78
137
|
"float": 'right'
|
79
138
|
},
|
80
139
|
overflow: {
|
package/build/Tip/Tip.js
CHANGED
@@ -35,10 +35,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
35
35
|
|
36
36
|
var boldRegex = /\*(.*?)\*/g;
|
37
37
|
var icons = {
|
38
|
-
info: '
|
39
|
-
warning: '
|
40
|
-
success: '
|
41
|
-
error: '
|
38
|
+
info: 'info-circle',
|
39
|
+
warning: 'alert',
|
40
|
+
success: 'check-circle',
|
41
|
+
error: 'x-circle',
|
42
42
|
promote: null
|
43
43
|
};
|
44
44
|
var PROMOTE = 'promote';
|
@@ -37,25 +37,25 @@ var Toast = function Toast(_ref) {
|
|
37
37
|
switch (theme) {
|
38
38
|
case 'success':
|
39
39
|
return {
|
40
|
-
icon: '
|
40
|
+
icon: 'check-circle',
|
41
41
|
color: _colors["default"].bgWhite
|
42
42
|
};
|
43
43
|
|
44
44
|
case 'error':
|
45
45
|
return {
|
46
|
-
icon: '
|
46
|
+
icon: 'x-circle',
|
47
47
|
color: _colors["default"].bgWhite
|
48
48
|
};
|
49
49
|
|
50
50
|
case 'info':
|
51
51
|
return {
|
52
|
-
icon: '
|
52
|
+
icon: 'info-circle',
|
53
53
|
color: _colors["default"].bgWhite
|
54
54
|
};
|
55
55
|
|
56
56
|
case 'warning':
|
57
57
|
return {
|
58
|
-
icon: '
|
58
|
+
icon: 'alert',
|
59
59
|
color: _colors["default"].grey900
|
60
60
|
};
|
61
61
|
}
|
package/build/index.js
CHANGED
@@ -82,6 +82,8 @@ var _Toaster = _interopRequireDefault(require("./Toaster"));
|
|
82
82
|
|
83
83
|
var _functions = require("./Toaster/functions");
|
84
84
|
|
85
|
+
var _Fab = _interopRequireDefault(require("./Fab"));
|
86
|
+
|
85
87
|
var _NavTab = _interopRequireDefault(require("./NavTab"));
|
86
88
|
|
87
89
|
var _NavItem = _interopRequireDefault(require("./NavItem"));
|
@@ -192,5 +194,6 @@ module.exports = {
|
|
192
194
|
spacing: _spacing["default"],
|
193
195
|
WindowSize: _WindowSize["default"],
|
194
196
|
tokens: tokens,
|
195
|
-
AtomicProvider: _Provider["default"]
|
197
|
+
AtomicProvider: _Provider["default"],
|
198
|
+
Fab: _Fab["default"]
|
196
199
|
};
|
package/build/plugin/babel.js
CHANGED
@@ -37,6 +37,8 @@ function importModule(path) {
|
|
37
37
|
return importDeclaration(specifier, '@occmundial/occ-atomic/build/Toaster/functions');
|
38
38
|
} else if (importName === 'Nav' || importName === 'Menu') {
|
39
39
|
return importDeclaration(specifier, "@occmundial/occ-atomic/build/Header/".concat(importName));
|
40
|
+
} else if (importName === 'AtomicProvider') {
|
41
|
+
return importDeclaration(types.importDefaultSpecifier(types.identifier('AtomicProvider')), '@occmundial/occ-atomic/build/Provider');
|
40
42
|
} else if (subatomic.includes(importName)) {
|
41
43
|
return importDeclaration(types.importDefaultSpecifier(types.identifier(importName)), "@occmundial/occ-atomic/build/subatomic/".concat(importName));
|
42
44
|
}
|
@@ -7,7 +7,7 @@ exports.occDartBlue = exports.occDartWhite = exports.occDartGrey = exports.occDa
|
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../colors"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors2 = _interopRequireDefault(require("../../tokens/colors.json"));
|
11
11
|
|
12
12
|
var _iconSizes = _interopRequireDefault(require("../iconSizes"));
|
13
13
|
|
@@ -19,7 +19,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
19
19
|
|
20
20
|
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; }
|
21
21
|
|
22
|
-
var brand =
|
22
|
+
var brand = _colors2["default"].icon.brand;
|
23
23
|
var ink = _colors["default"].ink,
|
24
24
|
inkLight = _colors["default"].inkLight,
|
25
25
|
white = _colors["default"].white;
|
@@ -7,7 +7,7 @@ exports.occHorizontalBlue = exports.occHorizontalWhite = exports.occHorizontalGr
|
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../colors"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors2 = _interopRequireDefault(require("../../tokens/colors.json"));
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
|
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
|
18
18
|
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; }
|
19
19
|
|
20
|
-
var brand =
|
20
|
+
var brand = _colors2["default"].icon.brand;
|
21
21
|
var ink = _colors["default"].ink,
|
22
22
|
inkLight = _colors["default"].inkLight,
|
23
23
|
white = _colors["default"].white;
|
@@ -7,7 +7,7 @@ exports.occLogoBlue = exports.occLogoWhite = exports.occLogoGrey = exports.occLo
|
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../colors"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors2 = _interopRequireDefault(require("../../tokens/colors.json"));
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
|
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
|
18
18
|
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; }
|
19
19
|
|
20
|
-
var brand =
|
20
|
+
var brand = _colors2["default"].icon.brand;
|
21
21
|
var ink = _colors["default"].ink,
|
22
22
|
inkLight = _colors["default"].inkLight,
|
23
23
|
white = _colors["default"].white;
|
@@ -7,7 +7,7 @@ exports.occVerticalBlue = exports.occVerticalWhite = exports.occVerticalGrey = e
|
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../colors"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors2 = _interopRequireDefault(require("../../tokens/colors.json"));
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
|
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
|
18
18
|
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; }
|
19
19
|
|
20
|
-
var brand =
|
20
|
+
var brand = _colors2["default"].icon.brand;
|
21
21
|
var ink = _colors["default"].ink,
|
22
22
|
inkLight = _colors["default"].inkLight,
|
23
23
|
white = _colors["default"].white;
|
@@ -22,7 +22,6 @@ var oldToNewIcon = {
|
|
22
22
|
cart: 'cart',
|
23
23
|
cartSolid: 'cart',
|
24
24
|
cash: 'cash-coin',
|
25
|
-
check: 'check-circle',
|
26
25
|
checkSolid: 'check-circle',
|
27
26
|
company: 'building',
|
28
27
|
companySolid: 'building',
|
@@ -115,8 +114,8 @@ var oldToNewIcon = {
|
|
115
114
|
moreOptions: 'three-dots-vertical',
|
116
115
|
money: 'coin',
|
117
116
|
go: 'arrow-right-circle',
|
118
|
-
arrowDown: '
|
119
|
-
arrowDownFilled: '
|
117
|
+
arrowDown: 'chevron-down',
|
118
|
+
arrowDownFilled: 'chevron-down',
|
120
119
|
label: 'tag',
|
121
120
|
unlock: 'unlock',
|
122
121
|
bill: 'cash',
|
@@ -0,0 +1,13 @@
|
|
1
|
+
apiVersion: backstage.io/v1alpha1
|
2
|
+
kind: Component
|
3
|
+
metadata:
|
4
|
+
name: occ-atomic
|
5
|
+
annotations:
|
6
|
+
github.com/project-slug: occmundial/occ-atomic
|
7
|
+
design-tokens.occdeep.io/platform: tailwind
|
8
|
+
design-tokens.occdeep.io/path: lib/tokens
|
9
|
+
design-tokens.occdeep.io/branch: beta
|
10
|
+
spec:
|
11
|
+
type: service
|
12
|
+
lifecycle: production
|
13
|
+
owner: ui-team
|
package/package.json
CHANGED