@occmundial/occ-atomic 2.0.0-beta.0 → 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 -581
- package/CONTRIBUTING.md +24 -0
- package/README.md +21 -21
- package/build/Autocomplete/Autocomplete.js +35 -23
- package/build/Autocomplete/Autocomplete.test.js +14 -14
- package/build/Autocomplete/__snapshots__/Autocomplete.test.js.snap +20 -0
- package/build/Avatar/Avatar.js +21 -17
- package/build/Avatar/Avatar.test.js +2 -2
- package/build/Avatar/AvatarContent/AvatarContent.js +5 -5
- package/build/Avatar/AvatarContent/AvatarContent.test.js +6 -6
- package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +41 -0
- package/build/Avatar/AvatarContent/styles.js +10 -6
- package/build/Avatar/__snapshots__/Avatar.test.js.snap +17 -0
- package/build/Avatar/index.js +4 -2
- 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 +51 -30
- package/build/Button/Button.test.js +20 -25
- package/build/Button/Loading.js +89 -0
- package/build/Button/__snapshots__/Button.test.js.snap +334 -0
- package/build/Button/index.js +4 -2
- package/build/Button/styles.js +174 -155
- package/build/ButtonAlign/ButtonAlign.js +86 -0
- package/build/ButtonAlign/ButtonAlign.test.js +50 -0
- package/build/ButtonAlign/__snapshots__/ButtonAlign.test.js.snap +19 -0
- package/build/ButtonAlign/index.js +18 -0
- package/build/ButtonAlign/styles.js +18 -0
- package/build/Card/Card.js +1 -1
- package/build/Card/Card.test.js +4 -4
- package/build/Card/__snapshots__/Card.test.js.snap +46 -0
- package/build/Card/index.js +4 -2
- package/build/Check/Check.js +151 -0
- package/build/Check/Check.test.js +85 -0
- package/build/Check/__snapshots__/Check.test.js.snap +92 -0
- package/build/Check/index.js +18 -0
- package/build/Check/styles.js +100 -0
- package/build/Checkbox/Checkbox.js +29 -16
- package/build/Checkbox/Checkbox.test.js +8 -8
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +92 -0
- package/build/Checkbox/index.js +4 -2
- package/build/Column/Column.js +67 -0
- package/build/Column/Column.test.js +59 -0
- package/build/Column/__snapshots__/Column.test.js.snap +647 -0
- package/build/Column/index.js +18 -0
- package/build/Column/styles.js +93 -0
- package/build/Container/Container.js +50 -0
- package/build/Container/Container.test.js +53 -0
- package/build/Container/__snapshots__/Container.test.js.snap +43 -0
- package/build/Container/index.js +18 -0
- package/build/Container/styles.js +49 -0
- package/build/Droplist/Droplist.js +82 -33
- package/build/Droplist/Droplist.test.js +50 -11
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +65 -0
- package/build/Droplist/functions.js +9 -2
- package/build/Droplist/index.js +4 -2
- package/build/Droplist/styles.js +39 -10
- package/build/Flexbox/Flexbox.js +16 -12
- package/build/Flexbox/Flexbox.test.js +3 -3
- package/build/Flexbox/__snapshots__/Flexbox.test.js.snap +106 -0
- package/build/Flexbox/index.js +4 -2
- 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 +1 -1
- package/build/Grid/Col/Col.test.js +3 -3
- package/build/Grid/Col/__snapshots__/Col.test.js.snap +963 -0
- package/build/Grid/Col/index.js +4 -2
- 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 +163 -0
- package/build/Header/Header.test.js +118 -0
- package/build/Header/Menu/Menu.js +135 -0
- package/build/Header/Menu/Menu.test.js +107 -0
- package/build/Header/Menu/__snapshots__/Menu.test.js.snap +113 -0
- package/build/Header/Menu/index.js +18 -0
- package/build/Header/Menu/styles.js +123 -0
- package/build/Header/Nav/Nav.js +95 -0
- package/build/Header/Nav/Nav.test.js +81 -0
- package/build/Header/Nav/__snapshots__/Nav.test.js.snap +101 -0
- package/build/Header/Nav/index.js +18 -0
- package/build/Header/Nav/styles.js +110 -0
- package/build/Header/__snapshots__/Header.test.js.snap +79 -0
- package/build/Header/index.js +18 -0
- package/build/Header/styles.js +94 -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 +27 -15
- package/build/Icon/Icon.test.js +3 -3
- package/build/Icon/__snapshots__/Icon.test.js.snap +26 -0
- package/build/Icon/index.js +4 -2
- package/build/Input/Input.js +442 -0
- package/build/Input/Input.test.js +258 -0
- package/build/Input/__snapshots__/Input.test.js.snap +194 -0
- package/build/Input/index.js +78 -0
- package/build/Input/styles.js +202 -0
- package/build/Input/stylesFlat.js +74 -0
- package/build/Label/Label.js +98 -0
- package/build/Label/Label.test.js +73 -0
- package/build/Label/__snapshots__/Label.test.js.snap +82 -0
- package/build/Label/index.js +18 -0
- package/build/Label/styles.js +90 -0
- package/build/LayerApp/LayerApp.js +113 -0
- package/build/LayerApp/LayerApp.test.js +56 -0
- package/build/LayerApp/__snapshots__/LayerApp.test.js.snap +37 -0
- package/build/LayerApp/index.js +18 -0
- package/build/LayerApp/styles.js +43 -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 +10 -10
- 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 +110 -0
- package/build/RangeCounter/RangeCounter.test.js +57 -0
- package/build/RangeCounter/__snapshots__/RangeCounter.test.js.snap +20 -0
- package/build/RangeCounter/index.js +18 -0
- package/build/RangeCounter/styles.js +26 -0
- package/build/Row/Row.js +41 -0
- package/build/Row/Row.test.js +40 -0
- package/build/Row/__snapshots__/Row.test.js.snap +22 -0
- package/build/Row/index.js +18 -0
- package/build/Row/styles.js +21 -0
- package/build/SightLogo/SightLogo.js +41 -0
- package/build/SightLogo/SightLogo.test.js +40 -0
- package/build/SightLogo/__snapshots__/SightLogo.test.js.snap +24 -0
- package/build/SightLogo/index.js +18 -0
- package/build/SightLogo/styles.js +28 -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 +113 -0
- package/build/SubHeader/SubHeader.test.js +81 -0
- package/build/SubHeader/__snapshots__/SubHeader.test.js.snap +50 -0
- package/build/SubHeader/index.js +18 -0
- package/build/SubHeader/styles.js +59 -0
- package/build/SwitchGroup/SwitchGroup.js +114 -0
- package/build/SwitchGroup/SwitchGroup.test.js +91 -0
- package/build/SwitchGroup/__snapshots__/SwitchGroup.test.js.snap +52 -0
- package/build/SwitchGroup/index.js +18 -0
- package/build/SwitchGroup/styles.js +58 -0
- 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 +151 -92
- package/build/TextField/TextField.test.js +27 -19
- package/build/TextField/__snapshots__/TextField.test.js.snap +258 -0
- package/build/TextField/styles.js +74 -17
- 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 +89 -0
- package/build/Title/Title.test.js +50 -0
- package/build/Title/__snapshots__/Title.test.js.snap +31 -0
- package/build/Title/index.js +18 -0
- package/build/Title/styles.js +37 -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 +152 -0
- package/build/TourTip/TourTip.test.js +45 -0
- package/build/TourTip/__snapshots__/TourTip.test.js.snap +74 -0
- package/build/TourTip/index.js +18 -0
- package/build/TourTip/styles.js +82 -0
- package/build/Visible/Visible.js +119 -0
- package/build/Visible/Visible.test.js +31 -0
- package/build/Visible/__snapshots__/Visible.test.js.snap +3 -0
- package/build/Visible/index.js +13 -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 -111
- package/playroom/FrameComponent.js +31 -22
- package/playroom/styles.js +14 -14
- package/playroom.config.js +7 -7
- package/yarn-error.log +0 -10737
package/build/Tag/styles.js
CHANGED
@@ -13,77 +13,109 @@ var _icons = _interopRequireDefault(require("../subatomic/icons"));
|
|
13
13
|
|
14
14
|
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
15
15
|
|
16
|
+
var _iconSizes = _interopRequireDefault(require("../subatomic/iconSizes"));
|
17
|
+
|
16
18
|
var _hexRgba = _interopRequireDefault(require("hex-rgba"));
|
17
19
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
21
|
|
20
|
-
var
|
22
|
+
var infoLight = _colors["default"].infoLight,
|
21
23
|
infoText = _colors["default"].infoText,
|
22
|
-
|
24
|
+
successLight = _colors["default"].successLight,
|
23
25
|
successText = _colors["default"].successText,
|
24
|
-
|
26
|
+
warningLight = _colors["default"].warningLight,
|
25
27
|
warningText = _colors["default"].warningText,
|
26
|
-
|
28
|
+
errorLight = _colors["default"].errorLight,
|
27
29
|
errorText = _colors["default"].errorText,
|
28
30
|
grey900 = _colors["default"].grey900,
|
29
31
|
grey100 = _colors["default"].grey100,
|
30
|
-
textLink = _colors["default"].textLink
|
32
|
+
textLink = _colors["default"].textLink,
|
33
|
+
bgWhite = _colors["default"].bgWhite;
|
31
34
|
var xTiny = _spacing["default"].xTiny,
|
32
35
|
tiny = _spacing["default"].tiny,
|
33
36
|
small = _spacing["default"].small,
|
34
|
-
gutter = _spacing["default"].gutter
|
35
|
-
|
37
|
+
gutter = _spacing["default"].gutter,
|
38
|
+
medium = _spacing["default"].medium;
|
39
|
+
var smallIcon = _iconSizes["default"].small;
|
40
|
+
var paddingStandardTag = [1, tiny, 3, tiny],
|
41
|
+
paddingMediumTag = [5, gutter, 7, gutter],
|
42
|
+
paddingBigTag = [tiny, small],
|
43
|
+
tagTextLineHeight = 1.5,
|
44
|
+
tagTextStandardSize = 10,
|
45
|
+
tagTextMediumSize = 16,
|
46
|
+
tagTextBigSize = 16,
|
47
|
+
bigTagHeight = 40;
|
36
48
|
var _default = {
|
37
49
|
tag: {
|
38
50
|
boxSizing: 'border-box',
|
39
51
|
lineHeight: '12px',
|
40
52
|
textAlign: 'center',
|
41
53
|
borderRadius: small,
|
42
|
-
paddingRight: tiny,
|
43
|
-
paddingLeft: tiny,
|
44
|
-
height: small,
|
45
54
|
position: 'relative',
|
46
55
|
overflow: 'hidden',
|
47
|
-
display: 'inline-block'
|
48
|
-
|
49
|
-
|
56
|
+
display: 'inline-block'
|
57
|
+
},
|
58
|
+
standard: {
|
59
|
+
padding: paddingStandardTag,
|
60
|
+
height: small
|
61
|
+
},
|
62
|
+
medium: {
|
63
|
+
padding: paddingMediumTag,
|
64
|
+
height: medium
|
65
|
+
},
|
66
|
+
big: {
|
67
|
+
padding: paddingBigTag,
|
68
|
+
height: bigTagHeight,
|
69
|
+
borderRadius: medium
|
50
70
|
},
|
51
71
|
tagText: {
|
52
72
|
boxSizing: 'border-box',
|
53
73
|
fontFamily: _fonts["default"].body,
|
54
|
-
fontWeight: '
|
74
|
+
fontWeight: '400',
|
55
75
|
fontStyle: 'normal',
|
56
76
|
fontStretch: 'normal',
|
57
|
-
lineHeight: "".concat(iconHeight, "px"),
|
58
77
|
letterSpacing: 'normal',
|
59
78
|
textAlign: 'center',
|
60
79
|
position: 'relative',
|
61
80
|
overflow: 'hidden',
|
62
81
|
display: 'inline-block',
|
63
|
-
|
82
|
+
lineHeight: tagTextLineHeight,
|
64
83
|
paddingRight: function paddingRight(props) {
|
65
84
|
return props.iconName ? xTiny : 0;
|
66
85
|
}
|
67
86
|
},
|
87
|
+
standardTagText: {
|
88
|
+
fontSize: tagTextStandardSize
|
89
|
+
},
|
90
|
+
mediumTagText: {
|
91
|
+
fontSize: tagTextMediumSize
|
92
|
+
},
|
93
|
+
bigTagText: {
|
94
|
+
fontSize: tagTextBigSize
|
95
|
+
},
|
68
96
|
"default": {
|
69
97
|
color: grey900,
|
70
98
|
background: grey100
|
71
99
|
},
|
100
|
+
basic: {
|
101
|
+
color: grey900,
|
102
|
+
background: bgWhite
|
103
|
+
},
|
72
104
|
info: {
|
73
105
|
color: infoText,
|
74
|
-
backgroundColor:
|
106
|
+
backgroundColor: infoLight
|
75
107
|
},
|
76
108
|
success: {
|
77
109
|
color: successText,
|
78
|
-
background:
|
110
|
+
background: successLight
|
79
111
|
},
|
80
112
|
warning: {
|
81
113
|
color: warningText,
|
82
|
-
background:
|
114
|
+
background: warningLight
|
83
115
|
},
|
84
116
|
error: {
|
85
117
|
color: errorText,
|
86
|
-
background:
|
118
|
+
background: errorLight
|
87
119
|
},
|
88
120
|
link: {
|
89
121
|
color: textLink,
|
@@ -95,27 +127,40 @@ var _default = {
|
|
95
127
|
display: 'inline-block',
|
96
128
|
marginRight: xTiny,
|
97
129
|
content: '""',
|
98
|
-
width: gutter,
|
99
|
-
height: iconHeight,
|
100
130
|
paddingBottom: 0,
|
101
|
-
position: 'relative',
|
102
|
-
top: 0,
|
103
131
|
left: 0,
|
104
132
|
backgroundRepeat: 'no-repeat'
|
105
133
|
},
|
134
|
+
standardIcon: {
|
135
|
+
width: gutter,
|
136
|
+
height: gutter
|
137
|
+
},
|
138
|
+
mediumIcon: {
|
139
|
+
width: smallIcon,
|
140
|
+
height: smallIcon
|
141
|
+
},
|
142
|
+
bigIcon: {
|
143
|
+
width: smallIcon,
|
144
|
+
height: smallIcon
|
145
|
+
},
|
106
146
|
defaultIcon: {
|
107
147
|
background: function background(props) {
|
108
148
|
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([grey900])) : '';
|
109
149
|
}
|
110
150
|
},
|
151
|
+
basicIcon: {
|
152
|
+
background: function background(props) {
|
153
|
+
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([grey900])) : '';
|
154
|
+
}
|
155
|
+
},
|
111
156
|
infoIcon: {
|
112
157
|
background: function background(props) {
|
113
|
-
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([
|
158
|
+
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([infoText])) : '';
|
114
159
|
}
|
115
160
|
},
|
116
161
|
successIcon: {
|
117
162
|
background: function background(props) {
|
118
|
-
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([
|
163
|
+
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([successText])) : '';
|
119
164
|
}
|
120
165
|
},
|
121
166
|
warningIcon: {
|
@@ -125,7 +170,7 @@ var _default = {
|
|
125
170
|
},
|
126
171
|
errorIcon: {
|
127
172
|
background: function background(props) {
|
128
|
-
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([
|
173
|
+
return props.iconName ? _icons["default"].base(_icons["default"][props.iconName].icon([errorText])) : '';
|
129
174
|
}
|
130
175
|
},
|
131
176
|
linkIcon: {
|
package/build/Text/Text.js
CHANGED
@@ -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,9 +13,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
15
|
|
14
|
-
function
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
17
|
|
16
|
-
function
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
19
|
|
18
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19
21
|
|
@@ -21,25 +23,29 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
21
23
|
|
22
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
23
25
|
|
24
|
-
function
|
26
|
+
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); }
|
25
27
|
|
26
|
-
function
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
27
29
|
|
28
|
-
function
|
30
|
+
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); }; }
|
29
31
|
|
30
|
-
function
|
32
|
+
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); }
|
31
33
|
|
32
|
-
function
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
35
|
+
|
36
|
+
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; } }
|
37
|
+
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
33
39
|
|
34
|
-
var Text =
|
35
|
-
/*#__PURE__*/
|
36
|
-
function (_Component) {
|
40
|
+
var Text = /*#__PURE__*/function (_Component) {
|
37
41
|
_inherits(Text, _Component);
|
38
42
|
|
43
|
+
var _super = _createSuper(Text);
|
44
|
+
|
39
45
|
function Text() {
|
40
46
|
_classCallCheck(this, Text);
|
41
47
|
|
42
|
-
return
|
48
|
+
return _super.apply(this, arguments);
|
43
49
|
}
|
44
50
|
|
45
51
|
_createClass(Text, [{
|
@@ -59,6 +65,7 @@ function (_Component) {
|
|
59
65
|
headline = _this$props.headline,
|
60
66
|
heading = _this$props.heading,
|
61
67
|
subheading = _this$props.subheading,
|
68
|
+
extraLarge = _this$props.extraLarge,
|
62
69
|
large = _this$props.large,
|
63
70
|
standard = _this$props.standard,
|
64
71
|
small = _this$props.small,
|
@@ -71,6 +78,8 @@ function (_Component) {
|
|
71
78
|
heading: heading
|
72
79
|
}, {
|
73
80
|
subheading: subheading
|
81
|
+
}, {
|
82
|
+
extraLarge: extraLarge
|
74
83
|
}, {
|
75
84
|
large: large
|
76
85
|
}, {
|
@@ -266,7 +275,8 @@ function (_Component) {
|
|
266
275
|
tag = _this$props8.tag,
|
267
276
|
className = _this$props8.className,
|
268
277
|
style = _this$props8.style,
|
269
|
-
id = _this$props8.id
|
278
|
+
id = _this$props8.id,
|
279
|
+
testId = _this$props8.testId;
|
270
280
|
var TextType = tag;
|
271
281
|
var size = this.getSize();
|
272
282
|
var color = this.getColor();
|
@@ -275,10 +285,11 @@ function (_Component) {
|
|
275
285
|
var topSpacing = this.getTopSpacing();
|
276
286
|
var bottomSpacing = this.getBottomSpacing();
|
277
287
|
var strong = this.getWeight();
|
278
|
-
return _react["default"].createElement(TextType, {
|
288
|
+
return /*#__PURE__*/_react["default"].createElement(TextType, {
|
279
289
|
className: "".concat(classes.text, " ").concat(size, " ").concat(color ? color : emphasis).concat(topSpacing).concat(bottomSpacing).concat(align ? " ".concat(align) : '').concat(strong ? " ".concat(strong) : '').concat(className ? " ".concat(className) : ''),
|
280
290
|
style: style,
|
281
|
-
id: id
|
291
|
+
id: id,
|
292
|
+
"data-testid": testId
|
282
293
|
}, children);
|
283
294
|
}
|
284
295
|
}]);
|
@@ -302,6 +313,9 @@ Text.propTypes = {
|
|
302
313
|
/** Subheading size style. */
|
303
314
|
subheading: _propTypes["default"].bool,
|
304
315
|
|
316
|
+
/** Extra-large size style. */
|
317
|
+
extraLarge: _propTypes["default"].bool,
|
318
|
+
|
305
319
|
/** Large size style. */
|
306
320
|
large: _propTypes["default"].bool,
|
307
321
|
|
@@ -405,7 +419,8 @@ Text.propTypes = {
|
|
405
419
|
tag: _propTypes["default"].string.isRequired,
|
406
420
|
className: _propTypes["default"].string,
|
407
421
|
style: _propTypes["default"].object,
|
408
|
-
id: _propTypes["default"].string
|
422
|
+
id: _propTypes["default"].string,
|
423
|
+
testId: _propTypes["default"].string
|
409
424
|
};
|
410
425
|
Text.defaultProps = {
|
411
426
|
tag: 'p'
|
package/build/Text/Text.test.js
CHANGED
@@ -21,40 +21,40 @@ var reduceClasses = function reduceClasses(prev, curr) {
|
|
21
21
|
var classes = Object.keys(_styles["default"]).reduce(reduceClasses, {});
|
22
22
|
describe("Text", function () {
|
23
23
|
it('matches the snapshot', function () {
|
24
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
24
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
25
25
|
classes: classes
|
26
26
|
}, "Text"));
|
27
27
|
expect(wrapper).toMatchSnapshot();
|
28
28
|
});
|
29
29
|
it('has the correct size style', function () {
|
30
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
30
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
31
31
|
hero: true,
|
32
32
|
classes: classes
|
33
33
|
}, "Text"));
|
34
34
|
expect(wrapper.find('.hero').length).toBe(1);
|
35
35
|
});
|
36
36
|
it('has a default color style', function () {
|
37
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
37
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
38
38
|
classes: classes
|
39
39
|
}, "Text"));
|
40
40
|
expect(wrapper.find('.highEmphasis').length).toBe(1);
|
41
41
|
});
|
42
42
|
it('has the correct color style', function () {
|
43
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
43
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
44
44
|
primary: true,
|
45
45
|
classes: classes
|
46
46
|
}, "Text"));
|
47
47
|
expect(wrapper.find('.primary').length).toBe(1);
|
48
48
|
});
|
49
49
|
it('has the correct align style', function () {
|
50
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
50
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
51
51
|
center: true,
|
52
52
|
classes: classes
|
53
53
|
}, "Text"));
|
54
54
|
expect(wrapper.find('.center').length).toBe(1);
|
55
55
|
});
|
56
56
|
it('has the correct spacing style', function () {
|
57
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
57
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
58
58
|
topTiny: true,
|
59
59
|
bottomLarge: true,
|
60
60
|
classes: classes
|
@@ -63,7 +63,7 @@ describe("Text", function () {
|
|
63
63
|
expect(wrapper.find('.bottomLarge').length).toBe(1);
|
64
64
|
});
|
65
65
|
it('has the correct html tag', function () {
|
66
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Text["default"], {
|
66
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
67
67
|
tag: "h3",
|
68
68
|
classes: classes
|
69
69
|
}, "Text"));
|
@@ -72,7 +72,7 @@ describe("Text", function () {
|
|
72
72
|
});
|
73
73
|
describe("TextJSS", function () {
|
74
74
|
it('matches the snapshot', function () {
|
75
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_index["default"], null, "Text"));
|
75
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], null, "Text"));
|
76
76
|
expect(wrapper).toMatchSnapshot();
|
77
77
|
});
|
78
78
|
});
|
@@ -0,0 +1,158 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Text matches the snapshot 1`] = `ShallowWrapper {}`;
|
4
|
+
|
5
|
+
exports[`Text styles matches the snapshot 1`] = `
|
6
|
+
Object {
|
7
|
+
"bottomBase": Object {
|
8
|
+
"marginBottom": 24,
|
9
|
+
},
|
10
|
+
"bottomLarge": Object {
|
11
|
+
"marginBottom": 48,
|
12
|
+
},
|
13
|
+
"bottomMedium": Object {
|
14
|
+
"marginBottom": 32,
|
15
|
+
},
|
16
|
+
"bottomSmall": Object {
|
17
|
+
"marginBottom": 16,
|
18
|
+
},
|
19
|
+
"bottomTiny": Object {
|
20
|
+
"marginBottom": 8,
|
21
|
+
},
|
22
|
+
"bottomXLarge": Object {
|
23
|
+
"marginBottom": 64,
|
24
|
+
},
|
25
|
+
"bottomXTiny": Object {
|
26
|
+
"marginBottom": 4,
|
27
|
+
},
|
28
|
+
"center": Object {
|
29
|
+
"textAlign": "center",
|
30
|
+
},
|
31
|
+
"disabled": Object {
|
32
|
+
"color": "#dddddd",
|
33
|
+
},
|
34
|
+
"error": Object {
|
35
|
+
"color": "#db3737",
|
36
|
+
},
|
37
|
+
"extraLarge": Object {
|
38
|
+
"fontSize": 20,
|
39
|
+
"lineHeight": 1.5,
|
40
|
+
},
|
41
|
+
"heading": Object {
|
42
|
+
"fontSize": 24,
|
43
|
+
"fontWeight": 400,
|
44
|
+
"lineHeight": 1.1,
|
45
|
+
},
|
46
|
+
"headline": Object {
|
47
|
+
"@media screen and (min-width:768px)": Object {
|
48
|
+
"fontSize": 40,
|
49
|
+
},
|
50
|
+
"fontSize": 28,
|
51
|
+
"fontWeight": 400,
|
52
|
+
"lineHeight": 1.1,
|
53
|
+
},
|
54
|
+
"hero": Object {
|
55
|
+
"@media screen and (min-width:768px)": Object {
|
56
|
+
"fontSize": 48,
|
57
|
+
"letterSpacing": -0.96,
|
58
|
+
},
|
59
|
+
"fontSize": 32,
|
60
|
+
"fontWeight": 400,
|
61
|
+
"letterSpacing": -0.64,
|
62
|
+
"lineHeight": 1.1,
|
63
|
+
},
|
64
|
+
"highEmphasis": Object {
|
65
|
+
"color": "#222222",
|
66
|
+
},
|
67
|
+
"info": Object {
|
68
|
+
"color": "#5736ab",
|
69
|
+
},
|
70
|
+
"large": Object {
|
71
|
+
"fontSize": 18,
|
72
|
+
"lineHeight": 1.5,
|
73
|
+
},
|
74
|
+
"left": Object {
|
75
|
+
"textAlign": "left",
|
76
|
+
},
|
77
|
+
"link": Object {
|
78
|
+
"color": "#0946CB",
|
79
|
+
},
|
80
|
+
"lowEmphasis": Object {
|
81
|
+
"color": "#aaaaaa",
|
82
|
+
},
|
83
|
+
"micro": Object {
|
84
|
+
"fontSize": 12,
|
85
|
+
"lineHeight": 1.5,
|
86
|
+
},
|
87
|
+
"midEmphasis": Object {
|
88
|
+
"color": "#777777",
|
89
|
+
},
|
90
|
+
"primary": Object {
|
91
|
+
"color": "#083cae",
|
92
|
+
},
|
93
|
+
"right": Object {
|
94
|
+
"textAlign": "right",
|
95
|
+
},
|
96
|
+
"secondary": Object {
|
97
|
+
"color": "#f13465",
|
98
|
+
},
|
99
|
+
"small": Object {
|
100
|
+
"fontSize": 14,
|
101
|
+
"lineHeight": 1.5,
|
102
|
+
},
|
103
|
+
"standard": Object {
|
104
|
+
"fontSize": 16,
|
105
|
+
"lineHeight": 1.5,
|
106
|
+
},
|
107
|
+
"strong": Object {
|
108
|
+
"fontWeight": 400,
|
109
|
+
},
|
110
|
+
"subheading": Object {
|
111
|
+
"fontSize": 18,
|
112
|
+
"fontWeight": 400,
|
113
|
+
"lineHeight": 1.1,
|
114
|
+
},
|
115
|
+
"success": Object {
|
116
|
+
"color": "#009537",
|
117
|
+
},
|
118
|
+
"text": Object {
|
119
|
+
"fontFamily": "'OccText', sans-serif",
|
120
|
+
"fontStyle": "normal",
|
121
|
+
"fontWeight": 300,
|
122
|
+
"letterSpacing": 0,
|
123
|
+
"margin": 0,
|
124
|
+
},
|
125
|
+
"titleCase": Object {
|
126
|
+
"textTransform": "capitalize",
|
127
|
+
},
|
128
|
+
"topBase": Object {
|
129
|
+
"marginTop": 24,
|
130
|
+
},
|
131
|
+
"topLarge": Object {
|
132
|
+
"marginTop": 48,
|
133
|
+
},
|
134
|
+
"topMedium": Object {
|
135
|
+
"marginTop": 32,
|
136
|
+
},
|
137
|
+
"topSmall": Object {
|
138
|
+
"marginTop": 16,
|
139
|
+
},
|
140
|
+
"topTiny": Object {
|
141
|
+
"marginTop": 8,
|
142
|
+
},
|
143
|
+
"topXLarge": Object {
|
144
|
+
"marginTop": 64,
|
145
|
+
},
|
146
|
+
"topXTiny": Object {
|
147
|
+
"marginTop": 4,
|
148
|
+
},
|
149
|
+
"warning": Object {
|
150
|
+
"color": "#e69000",
|
151
|
+
},
|
152
|
+
"white": Object {
|
153
|
+
"color": "#ffffff",
|
154
|
+
},
|
155
|
+
}
|
156
|
+
`;
|
157
|
+
|
158
|
+
exports[`TextJSS matches the snapshot 1`] = `ShallowWrapper {}`;
|
package/build/Text/styles.js
CHANGED
@@ -21,54 +21,60 @@ var _default = {
|
|
21
21
|
text: {
|
22
22
|
letterSpacing: 0,
|
23
23
|
fontFamily: _fonts["default"].body,
|
24
|
-
fontWeight:
|
24
|
+
fontWeight: 300,
|
25
25
|
fontStyle: 'normal',
|
26
26
|
margin: 0
|
27
27
|
},
|
28
28
|
// Sizes
|
29
29
|
hero: _defineProperty({
|
30
|
-
fontSize:
|
31
|
-
lineHeight:
|
30
|
+
fontSize: 32,
|
31
|
+
lineHeight: 1.1,
|
32
|
+
fontWeight: 400,
|
33
|
+
letterSpacing: -0.64
|
32
34
|
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
33
|
-
fontSize:
|
34
|
-
|
35
|
+
fontSize: 48,
|
36
|
+
letterSpacing: -0.96
|
35
37
|
}),
|
36
38
|
headline: _defineProperty({
|
37
39
|
fontSize: 28,
|
38
|
-
lineHeight:
|
40
|
+
lineHeight: 1.1,
|
41
|
+
fontWeight: 400
|
39
42
|
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
40
|
-
fontSize:
|
41
|
-
lineHeight: '48px'
|
43
|
+
fontSize: 40
|
42
44
|
}),
|
43
45
|
heading: {
|
44
|
-
fontSize:
|
45
|
-
lineHeight:
|
46
|
-
fontWeight:
|
46
|
+
fontSize: 24,
|
47
|
+
lineHeight: 1.1,
|
48
|
+
fontWeight: 400
|
47
49
|
},
|
48
50
|
subheading: {
|
49
|
-
fontSize:
|
50
|
-
lineHeight:
|
51
|
-
fontWeight:
|
51
|
+
fontSize: 18,
|
52
|
+
lineHeight: 1.1,
|
53
|
+
fontWeight: 400
|
54
|
+
},
|
55
|
+
extraLarge: {
|
56
|
+
fontSize: 20,
|
57
|
+
lineHeight: 1.5
|
52
58
|
},
|
53
59
|
large: {
|
54
|
-
fontSize:
|
55
|
-
lineHeight:
|
60
|
+
fontSize: 18,
|
61
|
+
lineHeight: 1.5
|
56
62
|
},
|
57
63
|
standard: {
|
58
|
-
fontSize:
|
59
|
-
lineHeight:
|
64
|
+
fontSize: 16,
|
65
|
+
lineHeight: 1.5
|
60
66
|
},
|
61
67
|
small: {
|
62
|
-
fontSize:
|
63
|
-
lineHeight:
|
68
|
+
fontSize: 14,
|
69
|
+
lineHeight: 1.5
|
64
70
|
},
|
65
71
|
micro: {
|
66
|
-
fontSize:
|
67
|
-
lineHeight:
|
72
|
+
fontSize: 12,
|
73
|
+
lineHeight: 1.5
|
68
74
|
},
|
69
75
|
// Weight
|
70
76
|
strong: {
|
71
|
-
fontWeight:
|
77
|
+
fontWeight: 400
|
72
78
|
},
|
73
79
|
// Colors
|
74
80
|
primary: {
|
@@ -160,6 +166,9 @@ var _default = {
|
|
160
166
|
},
|
161
167
|
bottomXLarge: {
|
162
168
|
marginBottom: _spacing["default"].xLarge
|
169
|
+
},
|
170
|
+
titleCase: {
|
171
|
+
textTransform: 'capitalize'
|
163
172
|
}
|
164
173
|
};
|
165
174
|
exports["default"] = _default;
|