@occmundial/occ-atomic 2.0.0-beta.1 → 2.0.0-beta.11
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierrc +6 -0
- package/.whitesource +12 -0
- package/CHANGELOG.md +1361 -584
- package/CONTRIBUTING.md +24 -0
- package/README.md +21 -21
- package/build/Autocomplete/Autocomplete.js +217 -117
- package/build/Autocomplete/Autocomplete.test.js +90 -74
- package/build/Autocomplete/__snapshots__/Autocomplete.test.js.snap +20 -0
- package/build/Autocomplete/index.js +6 -1
- package/build/Autocomplete/styles.js +2 -5
- package/build/Avatar/Avatar.js +66 -28
- package/build/Avatar/Avatar.test.js +36 -13
- package/build/Avatar/AvatarContent/AvatarContent.js +11 -14
- package/build/Avatar/AvatarContent/AvatarContent.test.js +55 -50
- package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +41 -0
- package/build/Avatar/AvatarContent/index.js +6 -1
- package/build/Avatar/AvatarContent/styles.js +12 -11
- package/build/Avatar/__snapshots__/Avatar.test.js.snap +17 -0
- package/build/Avatar/index.js +22 -1
- package/build/Avatar/styles.js +2 -6
- package/build/Banner/Banner.js +76 -0
- package/build/Banner/Banner.test.js +40 -0
- package/build/Banner/__snapshots__/Banner.test.js.snap +33 -0
- package/build/Banner/index.js +18 -0
- package/build/Banner/styles.js +41 -0
- package/build/Button/Button.js +134 -61
- package/build/Button/Button.test.js +69 -20
- package/build/Button/Loading.js +82 -0
- package/build/Button/__snapshots__/Button.test.js.snap +322 -0
- package/build/Button/index.js +22 -1
- package/build/Button/styles.js +187 -178
- package/build/ButtonAlign/ButtonAlign.js +20 -16
- package/build/ButtonAlign/ButtonAlign.test.js +3 -3
- package/build/ButtonAlign/__snapshots__/ButtonAlign.test.js.snap +19 -0
- package/build/Card/Card.js +4 -5
- package/build/Card/Card.test.js +40 -35
- package/build/Card/__snapshots__/Card.test.js.snap +46 -0
- package/build/Card/index.js +22 -1
- package/build/Card/styles.js +2 -4
- package/build/Check/Check.js +18 -14
- package/build/Check/Check.test.js +7 -7
- package/build/Check/__snapshots__/Check.test.js.snap +92 -0
- package/build/Check/styles.js +2 -2
- package/build/Checkbox/Checkbox.js +106 -60
- package/build/Checkbox/Checkbox.test.js +58 -42
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +92 -0
- package/build/Checkbox/index.js +4 -2
- package/build/Checkbox/styles.js +2 -5
- package/build/Column/Column.js +1 -1
- package/build/Column/Column.test.js +3 -3
- package/build/Column/__snapshots__/Column.test.js.snap +647 -0
- package/build/Container/Container.js +1 -1
- package/build/Container/Container.test.js +4 -4
- package/build/Container/__snapshots__/Container.test.js.snap +43 -0
- package/build/Droplist/Droplist.js +474 -227
- package/build/Droplist/Droplist.test.js +111 -87
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +65 -0
- package/build/Droplist/functions.js +9 -2
- package/build/Droplist/index.js +22 -1
- package/build/Droplist/styles.js +41 -15
- package/build/Flexbox/Flexbox.js +64 -29
- package/build/Flexbox/Flexbox.test.js +32 -14
- package/build/Flexbox/__snapshots__/Flexbox.test.js.snap +106 -0
- package/build/Flexbox/index.js +22 -1
- package/build/Flexbox/styles.js +2 -6
- package/build/Footer/Footer.js +42 -30
- package/build/Footer/Footer.test.js +2 -2
- package/build/Footer/List/List.js +32 -25
- package/build/Footer/__snapshots__/Footer.test.js.snap +90 -0
- package/build/Footer/styles.js +5 -0
- package/build/Grid/Col/Col.js +15 -22
- package/build/Grid/Col/Col.test.js +33 -13
- package/build/Grid/Col/__snapshots__/Col.test.js.snap +963 -0
- package/build/Grid/Col/index.js +22 -1
- package/build/Grid/Col/styles.js +97 -116
- package/build/Grid/Grid.js +18 -12
- package/build/Grid/Row/Row.js +1 -1
- package/build/Grid/Row/Row.test.js +2 -2
- package/build/Grid/Row/__snapshots__/Row.test.js.snap +22 -0
- package/build/Grid/Row/index.js +4 -2
- package/build/Grid/index.js +4 -2
- package/build/Header/Header.js +35 -31
- package/build/Header/Header.test.js +8 -8
- package/build/Header/Menu/Menu.js +23 -19
- package/build/Header/Menu/Menu.test.js +7 -7
- package/build/Header/Menu/__snapshots__/Menu.test.js.snap +113 -0
- package/build/Header/Nav/Nav.js +19 -15
- package/build/Header/Nav/Nav.test.js +5 -5
- package/build/Header/Nav/__snapshots__/Nav.test.js.snap +101 -0
- package/build/Header/__snapshots__/Header.test.js.snap +79 -0
- package/build/Hidden/Hidden.js +17 -13
- package/build/Hidden/Hidden.test.js +6 -6
- package/build/Hidden/__snapshots__/Hidden.test.js.snap +3 -0
- package/build/Hidden/index.js +4 -2
- package/build/Icon/Icon.js +90 -15
- package/build/Icon/Icon.test.js +49 -56
- package/build/Icon/__snapshots__/Icon.test.js.snap +32 -0
- package/build/Icon/index.js +22 -1
- package/build/Icon/styles.js +16 -9
- package/build/Input/Input.js +29 -25
- package/build/Input/Input.test.js +21 -21
- package/build/Input/__snapshots__/Input.test.js.snap +194 -0
- package/build/Input/index.js +17 -13
- package/build/Label/Label.js +17 -13
- package/build/Label/Label.test.js +6 -6
- package/build/Label/__snapshots__/Label.test.js.snap +82 -0
- package/build/LayerApp/LayerApp.js +22 -18
- package/build/LayerApp/LayerApp.test.js +4 -4
- package/build/LayerApp/__snapshots__/LayerApp.test.js.snap +37 -0
- package/build/Modal/Modal.js +55 -37
- package/build/Modal/Modal.test.js +15 -12
- package/build/Modal/__snapshots__/Modal.test.js.snap +208 -0
- package/build/Modal/index.js +19 -13
- package/build/Modal/styles.js +43 -31
- package/build/NavAside/NavAside.js +24 -19
- package/build/NavAside/NavAside.test.js +15 -13
- package/build/NavAside/__snapshots__/NavAside.test.js.snap +116 -0
- package/build/NavAside/index.js +16 -12
- package/build/NavIcon/NavIcon.js +41 -20
- package/build/NavIcon/styles.js +6 -16
- package/build/NavItem/NavItem.js +29 -16
- package/build/NavTab/NavTab.js +38 -29
- package/build/NavTop/NavTop.js +20 -16
- package/build/OrderBy/OrderBy.js +23 -19
- package/build/OrderBy/OrderBy.test.js +6 -6
- package/build/OrderBy/__snapshots__/OrderBy.test.js.snap +54 -0
- package/build/Pager/Break/Break.js +1 -1
- package/build/Pager/Break/Break.test.js +4 -4
- package/build/Pager/Break/__snapshots__/Break.test.js.snap +13 -0
- package/build/Pager/Page/Page.js +1 -1
- package/build/Pager/Page/Page.test.js +5 -5
- package/build/Pager/Page/__snapshots__/Page.test.js.snap +27 -0
- package/build/Pager/Pager.js +21 -17
- package/build/Pager/Pager.test.js +12 -12
- package/build/Pager/__snapshots__/Pager.test.js.snap +50 -0
- package/build/Pager/styles.js +1 -1
- package/build/Pill/Choice/Choice.js +23 -18
- package/build/Pill/Choice/styles.js +8 -3
- package/build/Pill/Group/Group.js +7 -4
- package/build/Pill/Group/styles.js +7 -4
- package/build/Pill/Pill.js +36 -23
- package/build/Pill/Pill.test.js +12 -12
- package/build/Pill/Stack/Stack.js +10 -7
- package/build/Pill/Stack/styles.js +4 -1
- package/build/Pill/__snapshots__/Pill.test.js.snap +62 -0
- package/build/Pill/styles.js +6 -2
- package/build/Placeholder/Placeholder.js +2 -2
- package/build/Placeholder/Placeholder.test.js +3 -3
- package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +130 -0
- package/build/Placeholder/styles.js +23 -16
- package/build/Provider/Provider.js +89 -0
- package/build/Provider/index.js +13 -0
- package/build/Provider/useAtomic.js +17 -0
- package/build/{hooks → Provider}/usePrevious.js +1 -1
- package/build/Radio/Radio.js +29 -15
- package/build/Radio/Radio.test.js +6 -6
- package/build/Radio/__snapshots__/Radio.test.js.snap +83 -0
- package/build/RangeCounter/RangeCounter.js +17 -13
- package/build/RangeCounter/RangeCounter.test.js +3 -3
- package/build/RangeCounter/__snapshots__/RangeCounter.test.js.snap +20 -0
- package/build/RangeCounter/styles.js +1 -1
- package/build/Row/Row.js +1 -1
- package/build/Row/Row.test.js +2 -2
- package/build/Row/__snapshots__/Row.test.js.snap +22 -0
- package/build/SightLogo/SightLogo.js +2 -2
- package/build/SightLogo/SightLogo.test.js +2 -2
- package/build/SightLogo/__snapshots__/SightLogo.test.js.snap +24 -0
- package/build/SlideDown/SlideDown.js +41 -27
- package/build/SlideDown/SlideDown.test.js +22 -16
- package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +42 -0
- package/build/SlideToggle/SlideToggle.js +31 -17
- package/build/SlideToggle/SlideToggle.test.js +7 -7
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +62 -0
- package/build/SubHeader/SubHeader.js +20 -16
- package/build/SubHeader/SubHeader.test.js +7 -7
- package/build/SubHeader/__snapshots__/SubHeader.test.js.snap +50 -0
- package/build/SwitchGroup/SwitchGroup.js +17 -13
- package/build/SwitchGroup/SwitchGroup.test.js +6 -6
- package/build/SwitchGroup/__snapshots__/SwitchGroup.test.js.snap +52 -0
- package/build/SwitchGroup/styles.js +1 -1
- package/build/Tag/Tag.js +27 -10
- package/build/Tag/Tag.test.js +8 -8
- package/build/Tag/__snapshots__/Tag.test.js.snap +137 -0
- package/build/Tag/styles.js +72 -27
- package/build/Text/Text.js +454 -122
- package/build/Text/Text.test.js +13 -13
- package/build/Text/__snapshots__/Text.test.js.snap +216 -0
- package/build/Text/styles.js +171 -78
- package/build/TextField/TextField.js +455 -302
- package/build/TextField/TextField.test.js +138 -146
- package/build/TextField/__snapshots__/TextField.test.js.snap +258 -0
- package/build/TextField/index.js +6 -1
- package/build/TextField/styles.js +99 -33
- package/build/Tip/Tip.js +91 -27
- package/build/Tip/Tip.test.js +8 -8
- package/build/Tip/__snapshots__/Tip.test.js.snap +49 -0
- package/build/Tip/styles.js +32 -12
- package/build/Title/Title.js +16 -12
- package/build/Title/Title.test.js +3 -3
- package/build/Title/__snapshots__/Title.test.js.snap +31 -0
- package/build/Toaster/Toast/Toast.js +13 -13
- package/build/Toaster/Toaster.js +27 -23
- package/build/Toaster/Toaster.test.js +6 -6
- package/build/Toaster/__snapshots__/Toaster.test.js.snap +5 -0
- package/build/Tooltip/Tooltip.js +210 -0
- package/build/Tooltip/Tooltip.test.js +35 -0
- package/build/Tooltip/__snapshots__/Tooltip.test.js.snap +33 -0
- package/build/Tooltip/hooks.js +132 -0
- package/build/Tooltip/index.js +18 -0
- package/build/Tooltip/styles.js +44 -0
- package/build/TourTip/TourTip.js +15 -11
- package/build/TourTip/TourTip.test.js +2 -2
- package/build/TourTip/__snapshots__/TourTip.test.js.snap +74 -0
- package/build/Visible/Visible.js +16 -12
- package/build/Visible/Visible.test.js +4 -4
- package/build/Visible/__snapshots__/Visible.test.js.snap +3 -0
- package/build/WindowSize/WindowSize.js +17 -11
- package/build/WindowSize/WindowSize.test.js +4 -4
- package/build/WindowSize/__snapshots__/WindowSize.test.js.snap +3 -0
- package/build/index.js +82 -8
- package/build/plugin/babel.js +61 -0
- package/build/subatomic/colors.js +8 -3
- package/build/subatomic/fonts.js +1 -1
- package/build/subatomic/icons/attachment.js +23 -0
- package/build/subatomic/icons/attachmentSolid.js +23 -0
- package/build/subatomic/icons/avatarSmile.js +23 -0
- package/build/subatomic/icons/book.js +23 -0
- package/build/subatomic/icons/cash.js +23 -0
- package/build/subatomic/icons/copy.js +23 -0
- package/build/subatomic/icons/copySolid.js +23 -0
- package/build/subatomic/icons/crossSolid.js +23 -0
- package/build/subatomic/icons/dislike.js +1 -1
- package/build/subatomic/icons/dislikeSolid.js +23 -0
- package/build/subatomic/icons/energy.js +23 -0
- package/build/subatomic/icons/energySolid.js +23 -0
- package/build/subatomic/icons/eye.js +1 -1
- package/build/subatomic/icons/eyeClosed.js +1 -1
- package/build/subatomic/icons/eyeClosedSolid.js +23 -0
- package/build/subatomic/icons/eyeSolid.js +23 -0
- package/build/subatomic/icons/hourGlass.js +23 -0
- package/build/subatomic/icons/like.js +1 -1
- package/build/subatomic/icons/likeSolid.js +23 -0
- package/build/subatomic/icons/location.js +23 -0
- package/build/subatomic/icons/locationSolid.js +23 -0
- package/build/subatomic/icons/matchJob.js +23 -0
- package/build/subatomic/icons/messages.js +1 -1
- package/build/subatomic/icons/messagesSolid.js +1 -1
- package/build/subatomic/icons/moreOptionsHorizontal.js +23 -0
- package/build/subatomic/icons/noMessages.js +23 -0
- package/build/subatomic/icons/noMessagesSolid.js +23 -0
- package/build/subatomic/icons/occDart.js +25 -8
- package/build/subatomic/icons/occHorizontal.js +25 -8
- package/build/subatomic/icons/occLogo.js +65 -0
- package/build/subatomic/icons/occVertical.js +25 -8
- package/build/subatomic/icons/profile.js +23 -0
- package/build/subatomic/icons/profileSolid.js +23 -0
- package/build/subatomic/icons/profileView.js +23 -0
- package/build/subatomic/icons/refresh.js +23 -0
- package/build/subatomic/icons/refreshSolid.js +23 -0
- package/build/subatomic/icons/sendMessage.js +23 -0
- package/build/subatomic/icons/sendMessageSolid.js +23 -0
- package/build/subatomic/icons/starsSolid.js +23 -0
- package/build/subatomic/icons/suitcase.js +23 -0
- package/build/subatomic/icons/suitcaseSolid.js +23 -0
- package/build/subatomic/icons/tag.js +1 -1
- package/build/subatomic/icons/tagSolid.js +23 -0
- package/build/subatomic/icons/trash.js +1 -1
- package/build/subatomic/icons/trashSolid.js +1 -1
- package/build/subatomic/icons/warning.js +23 -0
- package/build/subatomic/icons/warningSolid.js +23 -0
- package/build/subatomic/icons/webSite.js +23 -0
- package/build/subatomic/icons/webSiteSolid.js +23 -0
- package/build/subatomic/icons.js +230 -112
- package/build/subatomic/mappedIcons.js +171 -0
- package/build/tokens/borderRadius.json +8 -0
- package/build/tokens/colors.json +567 -0
- package/build/tokens/fonts.json +231 -0
- package/build/tokens/index.js +47 -0
- package/build/tokens/shadows.json +13 -0
- package/build/tokens/spacing.json +16 -0
- package/commitlint.config.js +6 -0
- package/package.json +124 -113
- package/playroom/FrameComponent.js +31 -0
- package/playroom/styles.js +14 -0
- package/playroom.config.js +7 -7
- package/build/Grid/Grid.test.js +0 -22
- package/build/Grid/Row/Rowdsd.js +0 -39
- package/build/hooks/useEventListener.js +0 -23
- package/yarn-error.log +0 -10737
package/build/Button/styles.js
CHANGED
@@ -5,48 +5,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var _reactJss = require("react-jss");
|
9
|
-
|
10
8
|
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
11
9
|
|
12
10
|
var _fonts = _interopRequireDefault(require("../subatomic/fonts"));
|
13
11
|
|
14
12
|
var _icons = _interopRequireDefault(require("../subatomic/icons"));
|
15
13
|
|
16
|
-
var
|
14
|
+
var _colors2 = _interopRequireDefault(require("../tokens/colors.json"));
|
15
|
+
|
16
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
17
|
+
|
18
|
+
var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
|
17
19
|
|
18
|
-
var
|
20
|
+
var _fonts2 = _interopRequireDefault(require("../tokens/fonts.json"));
|
21
|
+
|
22
|
+
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
23
|
+
|
24
|
+
var _mappedIcons = require("../subatomic/mappedIcons");
|
19
25
|
|
20
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
21
27
|
|
28
|
+
var sec = _colors["default"].sec,
|
29
|
+
secDark = _colors["default"].secDark,
|
30
|
+
grey500 = _colors["default"].grey500,
|
31
|
+
secLight = _colors["default"].secLight;
|
32
|
+
var sm = _fonts2["default"]['button-small'];
|
33
|
+
var md = _fonts2["default"]['button-medium'];
|
34
|
+
var lg = _fonts2["default"]['button-large'];
|
35
|
+
|
22
36
|
var renderIcon = function renderIcon(props, color) {
|
23
37
|
if (props.icon) {
|
24
|
-
return _icons["default"].base(_icons["default"][props.icon].icon(color));
|
38
|
+
return _mappedIcons.legacyIcons[props.icon] ? _icons["default"].base(_icons["default"][props.icon].icon(color)) : '';
|
25
39
|
} else if (props.iconRight) {
|
26
|
-
return _icons["default"].base(_icons["default"][props.iconRight].icon(color));
|
40
|
+
return _mappedIcons.legacyIcons[props.iconRight] ? _icons["default"].base(_icons["default"][props.iconRight].icon(color)) : '';
|
27
41
|
}
|
28
42
|
|
29
43
|
return '';
|
30
44
|
};
|
31
45
|
|
32
|
-
var _default =
|
46
|
+
var _default = {
|
33
47
|
btn: {
|
34
48
|
display: 'inline-block',
|
35
49
|
boxSizing: 'border-box',
|
36
50
|
position: 'relative',
|
37
51
|
maxWidth: '100%',
|
38
|
-
height: _spacing["default"].medium,
|
39
52
|
marginBottom: 0,
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
fontSize: 12,
|
45
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
46
|
-
letterSpacing: 1,
|
53
|
+
border: 0,
|
54
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-4']],
|
55
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
56
|
+
font: "".concat(sm.fontWeight, " ").concat(sm.fontSize, "/").concat(sm.lineHeight, " ").concat(_fonts["default"].body),
|
47
57
|
textAlign: 'center',
|
48
58
|
textDecoration: 'none',
|
49
|
-
textTransform: 'uppercase',
|
50
59
|
whiteSpace: 'nowrap',
|
51
60
|
transition: '0.3s all',
|
52
61
|
cursor: 'pointer',
|
@@ -80,188 +89,223 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
80
89
|
},
|
81
90
|
// Themes
|
82
91
|
primary: {
|
83
|
-
background:
|
84
|
-
color:
|
85
|
-
|
86
|
-
'
|
87
|
-
|
88
|
-
|
89
|
-
|
92
|
+
background: _colors2["default"].button.primary.bg["default"],
|
93
|
+
color: _colors2["default"].text.white.primary,
|
94
|
+
outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"]),
|
95
|
+
outlineOffset: '-2px',
|
96
|
+
'&:hover': {
|
97
|
+
background: _colors2["default"].button.primary.bg.hover
|
98
|
+
},
|
99
|
+
'&:active': {
|
100
|
+
background: _colors2["default"].button.primary.bg.active
|
101
|
+
},
|
102
|
+
'&:focus': {
|
103
|
+
outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"])
|
104
|
+
},
|
105
|
+
'&:not(:active):focus-visible': {
|
106
|
+
boxShadow: _shadows["default"]['focus-pink']
|
90
107
|
},
|
91
|
-
'
|
108
|
+
'&$disabled': {
|
109
|
+
background: _colors2["default"].button.primary.bg.disabled,
|
110
|
+
color: _colors2["default"].text.white.secondary,
|
111
|
+
cursor: 'not-allowed'
|
112
|
+
},
|
113
|
+
'& span span': {
|
114
|
+
background: function background(props) {
|
115
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
116
|
+
}
|
117
|
+
},
|
118
|
+
'&$disabled span span': {
|
92
119
|
background: function background(props) {
|
93
|
-
return renderIcon(props, [
|
120
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
94
121
|
}
|
95
122
|
}
|
96
123
|
},
|
97
124
|
secondary: {
|
98
|
-
background:
|
99
|
-
color:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
125
|
+
background: _colors2["default"].button.secondary.bg["default"],
|
126
|
+
color: _colors2["default"].text.indigo.primary,
|
127
|
+
'&:hover': {
|
128
|
+
background: _colors2["default"].button.secondary.bg.hover
|
129
|
+
},
|
130
|
+
'&:active': {
|
131
|
+
background: _colors2["default"].button.secondary.bg.active
|
132
|
+
},
|
133
|
+
'&:not(:active):focus-visible': {
|
134
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
108
135
|
},
|
109
|
-
'
|
136
|
+
'&$disabled': {
|
137
|
+
background: _colors2["default"].button.secondary.bg.disabled,
|
138
|
+
color: _colors2["default"].text.indigo.secondary
|
139
|
+
},
|
140
|
+
'& span span': {
|
110
141
|
background: function background(props) {
|
111
|
-
return renderIcon(props, [
|
142
|
+
return renderIcon(props, [_colors2["default"].icon.brand["default"]]);
|
112
143
|
}
|
113
144
|
},
|
114
|
-
'&$disabled': {
|
115
|
-
background:
|
116
|
-
|
117
|
-
|
145
|
+
'&$disabled span span': {
|
146
|
+
background: function background(props) {
|
147
|
+
return renderIcon(props, [_colors2["default"].icon.brand.disabled]);
|
148
|
+
}
|
118
149
|
},
|
119
150
|
'& $loadIcon': {
|
120
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
151
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon.brand["default"]]))
|
121
152
|
}
|
122
153
|
},
|
123
154
|
tertiary: {
|
124
|
-
background:
|
125
|
-
color:
|
126
|
-
|
127
|
-
'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}
|
155
|
+
background: 'transparent',
|
156
|
+
color: _colors2["default"].text.indigo.primary,
|
157
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"]),
|
158
|
+
outlineOffset: '-2px',
|
159
|
+
'&:hover': {
|
160
|
+
background: _colors2["default"].button.tertiary.bg.hover
|
161
|
+
},
|
162
|
+
'&:active': {
|
163
|
+
background: _colors2["default"].button.tertiary.bg.active
|
134
164
|
},
|
135
|
-
'
|
165
|
+
'&:focus': {
|
166
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"])
|
167
|
+
},
|
168
|
+
'&:not(:active):focus-visible': {
|
169
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
170
|
+
},
|
171
|
+
'& span span': {
|
136
172
|
background: function background(props) {
|
137
|
-
return renderIcon(props, [
|
173
|
+
return renderIcon(props, [_colors2["default"].icon.brand["default"]]);
|
138
174
|
}
|
139
175
|
},
|
140
176
|
'&$disabled': {
|
141
|
-
background:
|
142
|
-
color:
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
177
|
+
background: 'transparent',
|
178
|
+
color: _colors2["default"].text.indigo.secondary,
|
179
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.disabled)
|
180
|
+
},
|
181
|
+
'&$disabled span span': {
|
182
|
+
background: function background(props) {
|
183
|
+
return renderIcon(props, [_colors2["default"].icon.brand.disabled]);
|
148
184
|
}
|
149
185
|
},
|
150
186
|
'& $loadIcon': {
|
151
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
187
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon.brand["default"]]))
|
152
188
|
}
|
153
189
|
},
|
154
190
|
tertiaryWhite: {
|
155
191
|
background: 'transparent',
|
156
|
-
color:
|
157
|
-
|
158
|
-
'
|
159
|
-
|
192
|
+
color: _colors2["default"].text.white.primary,
|
193
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"]),
|
194
|
+
outlineOffset: '-2px',
|
195
|
+
'&:hover': {
|
196
|
+
background: _colors2["default"].button.tertiary.bg.inverse.hover
|
197
|
+
},
|
198
|
+
'&:active': {
|
199
|
+
background: _colors2["default"].button.tertiary.bg.inverse.active
|
200
|
+
},
|
201
|
+
'&:focus': {
|
202
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"])
|
160
203
|
},
|
161
|
-
'
|
204
|
+
'&:not(:active):focus-visible': {
|
205
|
+
boxShadow: _shadows["default"]['focus-white']
|
206
|
+
},
|
207
|
+
'& span span': {
|
162
208
|
background: function background(props) {
|
163
|
-
return renderIcon(props, [
|
209
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
164
210
|
}
|
165
211
|
},
|
166
212
|
'&$disabled': {
|
167
|
-
background:
|
168
|
-
color:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
}
|
213
|
+
background: 'transparent',
|
214
|
+
color: _colors2["default"].text.white.secondary
|
215
|
+
},
|
216
|
+
'&$disabled span span': {
|
217
|
+
background: function background(props) {
|
218
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
174
219
|
}
|
175
220
|
}
|
176
221
|
},
|
177
222
|
ghostPink: {
|
178
223
|
background: 'transparent',
|
179
|
-
color:
|
224
|
+
color: sec,
|
180
225
|
border: 'none',
|
181
|
-
paddingLeft: 0,
|
182
|
-
paddingRight: 0,
|
226
|
+
paddingLeft: [0, '!important'],
|
227
|
+
paddingRight: [0, '!important'],
|
183
228
|
'&:hover, &:active': {
|
184
|
-
color:
|
185
|
-
'&
|
229
|
+
color: secDark,
|
230
|
+
'& span span': {
|
186
231
|
background: function background(props) {
|
187
|
-
return renderIcon(props, [
|
232
|
+
return renderIcon(props, [secDark]);
|
188
233
|
}
|
189
234
|
}
|
190
235
|
},
|
191
|
-
'&
|
236
|
+
'& span span': {
|
192
237
|
background: function background(props) {
|
193
|
-
return renderIcon(props, [
|
238
|
+
return renderIcon(props, [sec]);
|
194
239
|
}
|
195
240
|
},
|
196
241
|
'&$disabled': {
|
197
242
|
background: "transparent !important",
|
198
|
-
color: "".concat(
|
243
|
+
color: "".concat(secLight, " !important"),
|
199
244
|
border: "none !important",
|
200
|
-
'&
|
245
|
+
'& span span': {
|
201
246
|
background: function background(props) {
|
202
|
-
return renderIcon(props, [
|
247
|
+
return renderIcon(props, [grey500]);
|
203
248
|
}
|
204
249
|
}
|
205
250
|
},
|
206
251
|
'& $loadIcon': {
|
207
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
252
|
+
background: _icons["default"].base(_icons["default"].loading.icon([sec]))
|
208
253
|
}
|
209
254
|
},
|
210
255
|
ghostGrey: {
|
211
256
|
background: 'transparent',
|
212
|
-
color:
|
213
|
-
|
214
|
-
|
215
|
-
paddingRight: 0,
|
216
|
-
'&:hover, &:active': {
|
217
|
-
color: _colors["default"].inkLight,
|
218
|
-
'& i': {
|
219
|
-
background: function background(props) {
|
220
|
-
return renderIcon(props, [_colors["default"].grey600]);
|
221
|
-
}
|
222
|
-
}
|
257
|
+
color: _colors2["default"].text.corp.secondary,
|
258
|
+
'&:hover': {
|
259
|
+
background: _colors2["default"].button.ghost.bg.hover
|
223
260
|
},
|
224
|
-
'
|
261
|
+
'&:active': {
|
262
|
+
background: _colors2["default"].button.ghost.bg.active
|
263
|
+
},
|
264
|
+
'&:not(:active):focus-visible': {
|
265
|
+
boxShadow: _shadows["default"]['focus-corp']
|
266
|
+
},
|
267
|
+
'& span span': {
|
225
268
|
background: function background(props) {
|
226
|
-
return renderIcon(props, [
|
269
|
+
return renderIcon(props, [_colors2["default"].icon["default"]["default"]]);
|
227
270
|
}
|
228
271
|
},
|
229
272
|
'&$disabled': {
|
230
|
-
background:
|
231
|
-
color:
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
}
|
273
|
+
background: 'transparent',
|
274
|
+
color: _colors2["default"].text.corp.disabled
|
275
|
+
},
|
276
|
+
'&$disabled span span': {
|
277
|
+
background: function background(props) {
|
278
|
+
return renderIcon(props, [_colors2["default"].icon["default"].disabled]);
|
237
279
|
}
|
238
280
|
},
|
239
281
|
'& $loadIcon': {
|
240
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
282
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon["default"]["default"]]))
|
241
283
|
}
|
242
284
|
},
|
243
285
|
ghostWhite: {
|
244
286
|
background: 'transparent',
|
245
|
-
color:
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
'&:
|
250
|
-
|
287
|
+
color: _colors2["default"].text.white.primary,
|
288
|
+
'&:hover': {
|
289
|
+
background: _colors2["default"].button.ghost.bg.inverse.hover
|
290
|
+
},
|
291
|
+
'&:active': {
|
292
|
+
background: _colors2["default"].button.ghost.bg.inverse.active
|
251
293
|
},
|
252
|
-
'
|
294
|
+
'&:not(:active):focus-visible': {
|
295
|
+
boxShadow: _shadows["default"]['focus-white']
|
296
|
+
},
|
297
|
+
'& span span': {
|
253
298
|
background: function background(props) {
|
254
|
-
return renderIcon(props, [
|
299
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
255
300
|
}
|
256
301
|
},
|
257
302
|
'&$disabled': {
|
258
|
-
background:
|
259
|
-
color:
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
}
|
303
|
+
background: 'transparent',
|
304
|
+
color: _colors2["default"].text.white.secondary
|
305
|
+
},
|
306
|
+
'&$disabled span span': {
|
307
|
+
background: function background(props) {
|
308
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
265
309
|
}
|
266
310
|
}
|
267
311
|
},
|
@@ -272,46 +316,22 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
272
316
|
}
|
273
317
|
},
|
274
318
|
disabled: {
|
275
|
-
background: _colors["default"].sec,
|
276
|
-
color: _colors["default"].white,
|
277
|
-
border: "1px solid ".concat(_colors["default"].sec),
|
278
319
|
cursor: 'default',
|
279
|
-
pointerEvents: 'none'
|
280
|
-
opacity: 0.4,
|
281
|
-
'& i': {
|
282
|
-
background: function background(props) {
|
283
|
-
return renderIcon(props, [_colors["default"].bgWhite]);
|
284
|
-
}
|
285
|
-
},
|
286
|
-
'&:hover, &:active, &:focus': {
|
287
|
-
background: _colors["default"].sec,
|
288
|
-
color: _colors["default"].white,
|
289
|
-
border: "1px solid ".concat(_colors["default"].sec)
|
290
|
-
}
|
320
|
+
pointerEvents: 'none'
|
291
321
|
},
|
292
322
|
// Sizes
|
293
323
|
md: {
|
294
|
-
|
295
|
-
|
296
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
297
|
-
'& i': {
|
298
|
-
width: _iconSizes["default"].small,
|
299
|
-
height: _iconSizes["default"].small
|
300
|
-
},
|
324
|
+
font: "".concat(md.fontWeight, " ").concat(md.fontSize, "/").concat(md.lineHeight, " ").concat(_fonts["default"].body),
|
325
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-5']],
|
301
326
|
'&$iconOnly': {
|
302
|
-
padding:
|
327
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-2']]
|
303
328
|
}
|
304
329
|
},
|
305
330
|
lg: {
|
306
|
-
|
307
|
-
|
308
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
309
|
-
'& i': {
|
310
|
-
width: _iconSizes["default"].small,
|
311
|
-
height: _iconSizes["default"].small
|
312
|
-
},
|
331
|
+
font: "".concat(lg.fontWeight, " ").concat(lg.fontSize, "/").concat(lg.lineHeight, " ").concat(_fonts["default"].body),
|
332
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-6']],
|
313
333
|
'&$iconOnly': {
|
314
|
-
padding:
|
334
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-3']]
|
315
335
|
}
|
316
336
|
},
|
317
337
|
// Block
|
@@ -321,41 +341,30 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
321
341
|
},
|
322
342
|
// Icon
|
323
343
|
icon: {
|
324
|
-
|
325
|
-
height: _iconSizes["default"].tiny,
|
326
|
-
marginRight: 4,
|
344
|
+
marginRight: _spacing["default"]['size-2'],
|
327
345
|
display: 'inline-block',
|
328
346
|
transition: '0.3s all'
|
329
347
|
},
|
330
348
|
iconRight: {
|
331
|
-
width:
|
332
|
-
height:
|
333
|
-
marginLeft:
|
349
|
+
width: 16,
|
350
|
+
height: 16,
|
351
|
+
marginLeft: _spacing["default"]['size-2'],
|
334
352
|
display: 'inline-block',
|
335
353
|
transition: '0.3s all'
|
336
354
|
},
|
337
|
-
'@keyframes iconRotate': {
|
338
|
-
from: {
|
339
|
-
transform: 'rotate(0deg)'
|
340
|
-
},
|
341
|
-
to: {
|
342
|
-
transform: 'rotate(360deg)'
|
343
|
-
}
|
344
|
-
},
|
345
355
|
iconOnly: {
|
346
|
-
padding:
|
347
|
-
'&
|
356
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-2']],
|
357
|
+
'& span span, & svg': {
|
348
358
|
marginRight: 0
|
349
359
|
}
|
350
360
|
},
|
351
361
|
loadIcon: {
|
352
|
-
width:
|
353
|
-
height:
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
362
|
+
width: 24,
|
363
|
+
height: 24,
|
364
|
+
fill: _colors2["default"].icon.inverse["default"]
|
365
|
+
},
|
366
|
+
round: {
|
367
|
+
borderRadius: '50%'
|
358
368
|
}
|
359
|
-
}
|
360
|
-
|
369
|
+
};
|
361
370
|
exports["default"] = _default;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
@@ -11,38 +13,40 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
15
|
|
14
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
15
|
-
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17
17
|
|
18
18
|
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); } }
|
19
19
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
21
21
|
|
22
|
-
function
|
22
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
23
23
|
|
24
|
-
function
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
25
25
|
|
26
|
-
function
|
26
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
27
27
|
|
28
|
-
function
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
29
29
|
|
30
|
-
function
|
30
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
31
|
+
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
*
|
34
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The Input component and the Button component have different sizes. That's why they wouldn't be aligned with each other when putting them side to side. Use this component to align the Button correctly with the Input.
|
38
|
+
* To align it correctly, use the same size value used on the Button.
|
39
|
+
* Right below there are two examples, one aligned and one that is not.
|
36
40
|
*/
|
37
|
-
var ButtonAlign =
|
38
|
-
/*#__PURE__*/
|
39
|
-
function (_React$Component) {
|
41
|
+
var ButtonAlign = /*#__PURE__*/function (_React$Component) {
|
40
42
|
_inherits(ButtonAlign, _React$Component);
|
41
43
|
|
44
|
+
var _super = _createSuper(ButtonAlign);
|
45
|
+
|
42
46
|
function ButtonAlign() {
|
43
47
|
_classCallCheck(this, ButtonAlign);
|
44
48
|
|
45
|
-
return
|
49
|
+
return _super.apply(this, arguments);
|
46
50
|
}
|
47
51
|
|
48
52
|
_createClass(ButtonAlign, [{
|
@@ -59,7 +63,7 @@ function (_React$Component) {
|
|
59
63
|
classes = _this$props.classes,
|
60
64
|
children = _this$props.children,
|
61
65
|
size = _this$props.size;
|
62
|
-
return _react["default"].createElement("div", {
|
66
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
63
67
|
className: size ? classes[size] : classes.sm
|
64
68
|
}, children);
|
65
69
|
}
|
@@ -21,13 +21,13 @@ var reduceClasses = function reduceClasses(prev, curr) {
|
|
21
21
|
var classes = Object.keys(_styles["default"]).reduce(reduceClasses, {});
|
22
22
|
describe("ButtonAlign", function () {
|
23
23
|
it('matches the snapshot', function () {
|
24
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_ButtonAlign["default"], {
|
24
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_ButtonAlign["default"], {
|
25
25
|
classes: classes
|
26
26
|
}));
|
27
27
|
expect(wrapper).toMatchSnapshot();
|
28
28
|
});
|
29
29
|
it('has the right size', function () {
|
30
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_ButtonAlign["default"], {
|
30
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_ButtonAlign["default"], {
|
31
31
|
classes: classes
|
32
32
|
}));
|
33
33
|
expect(wrapper.prop('className')).toEqual('sm');
|
@@ -39,7 +39,7 @@ describe("ButtonAlign", function () {
|
|
39
39
|
});
|
40
40
|
describe("ButtonAlignJSS", function () {
|
41
41
|
it('matches the snapshot', function () {
|
42
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_index["default"], null));
|
42
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], null));
|
43
43
|
expect(wrapper).toMatchSnapshot();
|
44
44
|
});
|
45
45
|
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ButtonAlign matches the snapshot 1`] = `ShallowWrapper {}`;
|
4
|
+
|
5
|
+
exports[`ButtonAlign styles matches the snapshot 1`] = `
|
6
|
+
Object {
|
7
|
+
"lg": Object {
|
8
|
+
"marginTop": "3px",
|
9
|
+
},
|
10
|
+
"md": Object {
|
11
|
+
"marginTop": "9px",
|
12
|
+
},
|
13
|
+
"sm": Object {
|
14
|
+
"marginTop": "19px",
|
15
|
+
},
|
16
|
+
}
|
17
|
+
`;
|
18
|
+
|
19
|
+
exports[`ButtonAlignJSS matches the snapshot 1`] = `ShallowWrapper {}`;
|