@occmundial/occ-atomic 2.0.0-beta.1 → 2.0.0-beta.2
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 +1276 -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 +123 -62
- package/build/Button/Button.test.js +67 -18
- package/build/Button/Loading.js +89 -0
- package/build/Button/__snapshots__/Button.test.js.snap +334 -0
- package/build/Button/index.js +22 -1
- package/build/Button/styles.js +176 -160
- 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 +65 -21
- package/build/Icon/Icon.test.js +47 -56
- package/build/Icon/__snapshots__/Icon.test.js.snap +26 -0
- package/build/Icon/index.js +22 -1
- package/build/Icon/styles.js +2 -5
- 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 +10 -10
- 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 +22 -18
- package/build/NavAside/NavAside.test.js +12 -12
- package/build/NavAside/__snapshots__/NavAside.test.js.snap +116 -0
- package/build/NavAside/index.js +16 -12
- package/build/NavIcon/NavIcon.js +31 -19
- package/build/NavItem/NavItem.js +29 -16
- package/build/NavTab/NavTab.js +36 -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/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 +37 -26
- package/build/SlideDown/SlideDown.test.js +9 -9
- 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 +30 -15
- package/build/Text/Text.test.js +8 -8
- package/build/Text/__snapshots__/Text.test.js.snap +158 -0
- package/build/Text/styles.js +32 -23
- 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 +5 -5
- 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 +11 -11
- 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 +79 -8
- package/build/plugin/babel.js +59 -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 +23 -8
- package/build/subatomic/icons/occHorizontal.js +23 -8
- package/build/subatomic/icons/occLogo.js +63 -0
- package/build/subatomic/icons/occVertical.js +23 -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/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/build/hooks/usePrevious.js +0 -19
- package/yarn-error.log +0 -10737
package/build/Button/styles.js
CHANGED
@@ -5,20 +5,31 @@ 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"));
|
19
|
+
|
20
|
+
var _fonts2 = _interopRequireDefault(require("../tokens/fonts.json"));
|
17
21
|
|
18
|
-
var
|
22
|
+
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
19
23
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
21
25
|
|
26
|
+
var sec = _colors["default"].sec,
|
27
|
+
secDark = _colors["default"].secDark,
|
28
|
+
grey900 = _colors["default"].grey900;
|
29
|
+
var sm = _fonts2["default"]['button-small'];
|
30
|
+
var md = _fonts2["default"]['button-medium'];
|
31
|
+
var lg = _fonts2["default"]['button-large'];
|
32
|
+
|
22
33
|
var renderIcon = function renderIcon(props, color) {
|
23
34
|
if (props.icon) {
|
24
35
|
return _icons["default"].base(_icons["default"][props.icon].icon(color));
|
@@ -29,24 +40,19 @@ var renderIcon = function renderIcon(props, color) {
|
|
29
40
|
return '';
|
30
41
|
};
|
31
42
|
|
32
|
-
var _default =
|
43
|
+
var _default = {
|
33
44
|
btn: {
|
34
45
|
display: 'inline-block',
|
35
46
|
boxSizing: 'border-box',
|
36
47
|
position: 'relative',
|
37
48
|
maxWidth: '100%',
|
38
|
-
height: _spacing["default"].medium,
|
39
49
|
marginBottom: 0,
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
fontSize: 12,
|
45
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
46
|
-
letterSpacing: 1,
|
50
|
+
border: 0,
|
51
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-4']],
|
52
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
53
|
+
font: "".concat(sm.fontWeight, " ").concat(sm.fontSize, "/").concat(sm.lineHeight, " ").concat(_fonts["default"].body),
|
47
54
|
textAlign: 'center',
|
48
55
|
textDecoration: 'none',
|
49
|
-
textTransform: 'uppercase',
|
50
56
|
whiteSpace: 'nowrap',
|
51
57
|
transition: '0.3s all',
|
52
58
|
cursor: 'pointer',
|
@@ -80,188 +86,223 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
80
86
|
},
|
81
87
|
// Themes
|
82
88
|
primary: {
|
83
|
-
background:
|
84
|
-
color:
|
85
|
-
|
86
|
-
'
|
87
|
-
|
88
|
-
|
89
|
-
|
89
|
+
background: _colors2["default"].button.primary.bg["default"],
|
90
|
+
color: _colors2["default"].text.white.primary,
|
91
|
+
outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"]),
|
92
|
+
outlineOffset: '-2px',
|
93
|
+
'&:hover': {
|
94
|
+
background: _colors2["default"].button.primary.bg.hover
|
95
|
+
},
|
96
|
+
'&:active': {
|
97
|
+
background: _colors2["default"].button.primary.bg.active
|
98
|
+
},
|
99
|
+
'&:focus': {
|
100
|
+
outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"])
|
101
|
+
},
|
102
|
+
'&:not(:active):focus-visible': {
|
103
|
+
boxShadow: _shadows["default"]['focus-pink']
|
104
|
+
},
|
105
|
+
'&$disabled': {
|
106
|
+
background: _colors2["default"].button.primary.bg.disabled,
|
107
|
+
color: _colors2["default"].text.white.secondary,
|
108
|
+
cursor: 'not-allowed'
|
90
109
|
},
|
91
110
|
'& i': {
|
92
111
|
background: function background(props) {
|
93
|
-
return renderIcon(props, [
|
112
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
113
|
+
}
|
114
|
+
},
|
115
|
+
'&$disabled i': {
|
116
|
+
background: function background(props) {
|
117
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
94
118
|
}
|
95
119
|
}
|
96
120
|
},
|
97
121
|
secondary: {
|
98
|
-
background:
|
99
|
-
color:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
122
|
+
background: _colors2["default"].button.secondary.bg["default"],
|
123
|
+
color: _colors2["default"].text.indigo.primary,
|
124
|
+
'&:hover': {
|
125
|
+
background: _colors2["default"].button.secondary.bg.hover
|
126
|
+
},
|
127
|
+
'&:active': {
|
128
|
+
background: _colors2["default"].button.secondary.bg.active
|
129
|
+
},
|
130
|
+
'&:not(:active):focus-visible': {
|
131
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
132
|
+
},
|
133
|
+
'&$disabled': {
|
134
|
+
background: _colors2["default"].button.secondary.bg.disabled,
|
135
|
+
color: _colors2["default"].text.indigo.secondary
|
108
136
|
},
|
109
137
|
'& i': {
|
110
138
|
background: function background(props) {
|
111
|
-
return renderIcon(props, [
|
139
|
+
return renderIcon(props, [_colors2["default"].icon.brand["default"]]);
|
112
140
|
}
|
113
141
|
},
|
114
|
-
'&$disabled': {
|
115
|
-
background:
|
116
|
-
|
117
|
-
|
142
|
+
'&$disabled i': {
|
143
|
+
background: function background(props) {
|
144
|
+
return renderIcon(props, [_colors2["default"].icon.brand.disabled]);
|
145
|
+
}
|
118
146
|
},
|
119
147
|
'& $loadIcon': {
|
120
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
148
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon.brand["default"]]))
|
121
149
|
}
|
122
150
|
},
|
123
151
|
tertiary: {
|
124
|
-
background:
|
125
|
-
color:
|
126
|
-
|
127
|
-
'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
152
|
+
background: 'transparent',
|
153
|
+
color: _colors2["default"].text.indigo.primary,
|
154
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"]),
|
155
|
+
outlineOffset: '-2px',
|
156
|
+
'&:hover': {
|
157
|
+
background: _colors2["default"].button.tertiary.bg.hover
|
158
|
+
},
|
159
|
+
'&:active': {
|
160
|
+
background: _colors2["default"].button.tertiary.bg.active
|
161
|
+
},
|
162
|
+
'&:focus': {
|
163
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"])
|
164
|
+
},
|
165
|
+
'&:not(:active):focus-visible': {
|
166
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
134
167
|
},
|
135
168
|
'& i': {
|
136
169
|
background: function background(props) {
|
137
|
-
return renderIcon(props, [
|
170
|
+
return renderIcon(props, [_colors2["default"].icon.brand["default"]]);
|
138
171
|
}
|
139
172
|
},
|
140
173
|
'&$disabled': {
|
141
|
-
background:
|
142
|
-
color:
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
174
|
+
background: 'transparent',
|
175
|
+
color: _colors2["default"].text.indigo.secondary,
|
176
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.disabled)
|
177
|
+
},
|
178
|
+
'&$disabled i': {
|
179
|
+
background: function background(props) {
|
180
|
+
return renderIcon(props, [_colors2["default"].icon.brand.disabled]);
|
148
181
|
}
|
149
182
|
},
|
150
183
|
'& $loadIcon': {
|
151
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
184
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon.brand["default"]]))
|
152
185
|
}
|
153
186
|
},
|
154
187
|
tertiaryWhite: {
|
155
188
|
background: 'transparent',
|
156
|
-
color:
|
157
|
-
|
158
|
-
'
|
159
|
-
|
189
|
+
color: _colors2["default"].text.white.primary,
|
190
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"]),
|
191
|
+
outlineOffset: '-2px',
|
192
|
+
'&:hover': {
|
193
|
+
background: _colors2["default"].button.tertiary.bg.inverse.hover
|
194
|
+
},
|
195
|
+
'&:active': {
|
196
|
+
background: _colors2["default"].button.tertiary.bg.inverse.active
|
197
|
+
},
|
198
|
+
'&:focus': {
|
199
|
+
outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"])
|
200
|
+
},
|
201
|
+
'&:not(:active):focus-visible': {
|
202
|
+
boxShadow: _shadows["default"]['focus-white']
|
160
203
|
},
|
161
204
|
'& i': {
|
162
205
|
background: function background(props) {
|
163
|
-
return renderIcon(props, [
|
206
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
164
207
|
}
|
165
208
|
},
|
166
209
|
'&$disabled': {
|
167
|
-
background:
|
168
|
-
color:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
}
|
210
|
+
background: 'transparent',
|
211
|
+
color: _colors2["default"].text.white.secondary
|
212
|
+
},
|
213
|
+
'&$disabled i': {
|
214
|
+
background: function background(props) {
|
215
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
174
216
|
}
|
175
217
|
}
|
176
218
|
},
|
177
219
|
ghostPink: {
|
178
220
|
background: 'transparent',
|
179
|
-
color:
|
221
|
+
color: sec,
|
180
222
|
border: 'none',
|
181
223
|
paddingLeft: 0,
|
182
224
|
paddingRight: 0,
|
183
225
|
'&:hover, &:active': {
|
184
|
-
color:
|
226
|
+
color: secDark,
|
185
227
|
'& i': {
|
186
228
|
background: function background(props) {
|
187
|
-
return renderIcon(props, [
|
229
|
+
return renderIcon(props, [secDark]);
|
188
230
|
}
|
189
231
|
}
|
190
232
|
},
|
191
233
|
'& i': {
|
192
234
|
background: function background(props) {
|
193
|
-
return renderIcon(props, [
|
235
|
+
return renderIcon(props, [sec]);
|
194
236
|
}
|
195
237
|
},
|
196
238
|
'&$disabled': {
|
197
239
|
background: "transparent !important",
|
198
|
-
color: "".concat(
|
240
|
+
color: "".concat(sec, " !important"),
|
199
241
|
border: "none !important",
|
200
242
|
'& i': {
|
201
243
|
background: function background(props) {
|
202
|
-
return renderIcon(props, [
|
244
|
+
return renderIcon(props, [grey900]);
|
203
245
|
}
|
204
246
|
}
|
205
247
|
},
|
206
248
|
'& $loadIcon': {
|
207
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
249
|
+
background: _icons["default"].base(_icons["default"].loading.icon([sec]))
|
208
250
|
}
|
209
251
|
},
|
210
252
|
ghostGrey: {
|
211
253
|
background: 'transparent',
|
212
|
-
color:
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
'&:
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
}
|
222
|
-
}
|
254
|
+
color: _colors2["default"].text.corp.secondary,
|
255
|
+
'&:hover': {
|
256
|
+
background: _colors2["default"].button.ghost.bg.hover
|
257
|
+
},
|
258
|
+
'&:active': {
|
259
|
+
background: _colors2["default"].button.ghost.bg.active
|
260
|
+
},
|
261
|
+
'&:not(:active):focus-visible': {
|
262
|
+
boxShadow: _shadows["default"]['focus-corp']
|
223
263
|
},
|
224
264
|
'& i': {
|
225
265
|
background: function background(props) {
|
226
|
-
return renderIcon(props, [
|
266
|
+
return renderIcon(props, [_colors2["default"].icon["default"]["default"]]);
|
227
267
|
}
|
228
268
|
},
|
229
269
|
'&$disabled': {
|
230
|
-
background:
|
231
|
-
color:
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
}
|
270
|
+
background: 'transparent',
|
271
|
+
color: _colors2["default"].text.corp.disabled
|
272
|
+
},
|
273
|
+
'&$disabled i': {
|
274
|
+
background: function background(props) {
|
275
|
+
return renderIcon(props, [_colors2["default"].icon["default"].disabled]);
|
237
276
|
}
|
238
277
|
},
|
239
278
|
'& $loadIcon': {
|
240
|
-
background: _icons["default"].base(_icons["default"].loading.icon([
|
279
|
+
background: _icons["default"].base(_icons["default"].loading.icon([_colors2["default"].icon["default"]["default"]]))
|
241
280
|
}
|
242
281
|
},
|
243
282
|
ghostWhite: {
|
244
283
|
background: 'transparent',
|
245
|
-
color:
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
'&:
|
250
|
-
|
284
|
+
color: _colors2["default"].text.white.primary,
|
285
|
+
'&:hover': {
|
286
|
+
background: _colors2["default"].button.ghost.bg.inverse.hover
|
287
|
+
},
|
288
|
+
'&:active': {
|
289
|
+
background: _colors2["default"].button.ghost.bg.inverse.active
|
290
|
+
},
|
291
|
+
'&:not(:active):focus-visible': {
|
292
|
+
boxShadow: _shadows["default"]['focus-white']
|
251
293
|
},
|
252
294
|
'& i': {
|
253
295
|
background: function background(props) {
|
254
|
-
return renderIcon(props, [
|
296
|
+
return renderIcon(props, [_colors2["default"].icon.inverse["default"]]);
|
255
297
|
}
|
256
298
|
},
|
257
299
|
'&$disabled': {
|
258
|
-
background:
|
259
|
-
color:
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
}
|
300
|
+
background: 'transparent',
|
301
|
+
color: _colors2["default"].text.white.secondary
|
302
|
+
},
|
303
|
+
'&$disabled i': {
|
304
|
+
background: function background(props) {
|
305
|
+
return renderIcon(props, [_colors2["default"].icon.inverse.disabled]);
|
265
306
|
}
|
266
307
|
}
|
267
308
|
},
|
@@ -272,46 +313,30 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
272
313
|
}
|
273
314
|
},
|
274
315
|
disabled: {
|
275
|
-
background: _colors["default"].sec,
|
276
|
-
color: _colors["default"].white,
|
277
|
-
border: "1px solid ".concat(_colors["default"].sec),
|
278
316
|
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
|
-
}
|
317
|
+
pointerEvents: 'none'
|
291
318
|
},
|
292
319
|
// Sizes
|
293
320
|
md: {
|
294
|
-
|
295
|
-
|
296
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
321
|
+
font: "".concat(md.fontWeight, " ").concat(md.fontSize, "/").concat(md.lineHeight, " ").concat(_fonts["default"].body),
|
322
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-5']],
|
297
323
|
'& i': {
|
298
|
-
width:
|
299
|
-
height:
|
324
|
+
width: 24,
|
325
|
+
height: 24
|
300
326
|
},
|
301
327
|
'&$iconOnly': {
|
302
|
-
padding:
|
328
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-2']]
|
303
329
|
}
|
304
330
|
},
|
305
331
|
lg: {
|
306
|
-
|
307
|
-
|
308
|
-
lineHeight: "".concat(_spacing["default"].base, "px"),
|
332
|
+
font: "".concat(lg.fontWeight, " ").concat(lg.fontSize, "/").concat(lg.lineHeight, " ").concat(_fonts["default"].body),
|
333
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-6']],
|
309
334
|
'& i': {
|
310
|
-
width:
|
311
|
-
height:
|
335
|
+
width: 24,
|
336
|
+
height: 24
|
312
337
|
},
|
313
338
|
'&$iconOnly': {
|
314
|
-
padding:
|
339
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-3']]
|
315
340
|
}
|
316
341
|
},
|
317
342
|
// Block
|
@@ -321,41 +346,32 @@ var _default = (0, _reactJss.createUseStyles)({
|
|
321
346
|
},
|
322
347
|
// Icon
|
323
348
|
icon: {
|
324
|
-
width:
|
325
|
-
height:
|
326
|
-
marginRight:
|
349
|
+
width: 16,
|
350
|
+
height: 16,
|
351
|
+
marginRight: _spacing["default"]['size-2'],
|
327
352
|
display: 'inline-block',
|
328
353
|
transition: '0.3s all'
|
329
354
|
},
|
330
355
|
iconRight: {
|
331
|
-
width:
|
332
|
-
height:
|
333
|
-
marginLeft:
|
356
|
+
width: 16,
|
357
|
+
height: 16,
|
358
|
+
marginLeft: _spacing["default"]['size-2'],
|
334
359
|
display: 'inline-block',
|
335
360
|
transition: '0.3s all'
|
336
361
|
},
|
337
|
-
'@keyframes iconRotate': {
|
338
|
-
from: {
|
339
|
-
transform: 'rotate(0deg)'
|
340
|
-
},
|
341
|
-
to: {
|
342
|
-
transform: 'rotate(360deg)'
|
343
|
-
}
|
344
|
-
},
|
345
362
|
iconOnly: {
|
346
|
-
padding:
|
363
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-2']],
|
347
364
|
'& i': {
|
348
365
|
marginRight: 0
|
349
366
|
}
|
350
367
|
},
|
351
368
|
loadIcon: {
|
352
|
-
width:
|
353
|
-
height:
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
369
|
+
width: 24,
|
370
|
+
height: 24,
|
371
|
+
fill: _colors2["default"].icon.inverse["default"]
|
372
|
+
},
|
373
|
+
round: {
|
374
|
+
borderRadius: '50%'
|
358
375
|
}
|
359
|
-
}
|
360
|
-
|
376
|
+
};
|
361
377
|
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 {}`;
|