@comicrelief/component-library 5.8.7 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PULL_REQUEST_TEMPLATE.md +27 -5
- package/dist/components/Atoms/Logo/Logo.js +0 -5
- package/dist/components/Atoms/Select/Select.js +7 -3
- package/dist/components/Atoms/Select/__snapshots__/Select.test.js.snap +1 -0
- package/dist/components/Molecules/Logos/Logos.js +1 -21
- package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Atoms/Logo/Logo.js +0 -3
- package/src/components/Atoms/Select/Select.js +13 -3
- package/src/components/Atoms/Select/__snapshots__/Select.test.js.snap +1 -0
- package/src/components/Molecules/Logos/Logos.js +1 -19
- package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +1 -0
- package/src/index.js +1 -1
- package/dist/components/Atoms/Logo/assets/big-night-logo.png +0 -0
- package/src/components/Atoms/Logo/assets/big-night-logo.png +0 -0
package/PULL_REQUEST_TEMPLATE.md
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
### PR Titles
|
|
2
|
+
#### To pass testing pipeline, these need to follow Conventional Commits spec:
|
|
3
|
+
https://www.conventionalcommits.org/en/v1.0.0/
|
|
4
|
+
e.g.
|
|
5
|
+
`feat: create NewForm component`
|
|
6
|
+
or
|
|
7
|
+
`fix: update broken link in NewForm component`
|
|
2
8
|
|
|
3
|
-
Fixes #
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
### PR description
|
|
11
|
+
#### What is it doing?
|
|
12
|
+
Tell us what it is doing from a technical perspective.
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
#### Why is this required?
|
|
15
|
+
Tell us why this is required from a business/product perspective.
|
|
16
|
+
|
|
17
|
+
#### link to Jira ticket:
|
|
18
|
+
Add a link to the Jira ticket.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Quick Checklist:
|
|
22
|
+
- [ ] My PR title follows the Conventional Commit spec.
|
|
23
|
+
|
|
24
|
+
- [ ] I have filled out the PR description as per the template above.
|
|
25
|
+
|
|
26
|
+
- [ ] I have added tests to cover new or changed behaviour.
|
|
27
|
+
|
|
28
|
+
- [ ] I have updated any relevant documentation.
|
|
29
|
+
|
|
30
|
+
### Important! - lastly, make sure to squash merge...
|
|
@@ -21,8 +21,6 @@ var _srLogo = _interopRequireDefault(require("./assets/sr-logo.svg"));
|
|
|
21
21
|
|
|
22
22
|
var _srGameonLogo = _interopRequireDefault(require("./assets/sr-gameon-logo.svg"));
|
|
23
23
|
|
|
24
|
-
var _bigNightLogo = _interopRequireDefault(require("./assets/big-night-logo.png"));
|
|
25
|
-
|
|
26
24
|
var Image = _styledComponents.default.img.withConfig({
|
|
27
25
|
displayName: "Logo__Image",
|
|
28
26
|
componentId: "sc-18yiye8-0"
|
|
@@ -54,9 +52,6 @@ var themeSwitcher = function themeSwitcher(theme) {
|
|
|
54
52
|
case 'Sport Relief Gameon':
|
|
55
53
|
return _srGameonLogo.default;
|
|
56
54
|
|
|
57
|
-
case 'Big Night In':
|
|
58
|
-
return _bigNightLogo.default;
|
|
59
|
-
|
|
60
55
|
default:
|
|
61
56
|
return _crLogo.default;
|
|
62
57
|
}
|
|
@@ -23,7 +23,7 @@ var _dropDownDarkPurple = _interopRequireDefault(require("./assets/drop-down-dar
|
|
|
23
23
|
|
|
24
24
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
25
25
|
|
|
26
|
-
var _excluded = ["errorMsg", "description", "label", "options", "hideLabel", "defaultValue", "onChange", "greyDescription", "className"];
|
|
26
|
+
var _excluded = ["errorMsg", "description", "label", "options", "hideLabel", "defaultValue", "onChange", "greyDescription", "className", "optional"];
|
|
27
27
|
|
|
28
28
|
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); }
|
|
29
29
|
|
|
@@ -68,6 +68,7 @@ var Select = /*#__PURE__*/_react.default.forwardRef(function (_ref8, ref) {
|
|
|
68
68
|
_onChange = _ref8.onChange,
|
|
69
69
|
greyDescription = _ref8.greyDescription,
|
|
70
70
|
className = _ref8.className,
|
|
71
|
+
optional = _ref8.optional,
|
|
71
72
|
rest = (0, _objectWithoutProperties2.default)(_ref8, _excluded);
|
|
72
73
|
|
|
73
74
|
var _useState = (0, _react.useState)(''),
|
|
@@ -79,7 +80,8 @@ var Select = /*#__PURE__*/_react.default.forwardRef(function (_ref8, ref) {
|
|
|
79
80
|
label: label,
|
|
80
81
|
hideLabel: hideLabel,
|
|
81
82
|
errorMsg: errorMsg,
|
|
82
|
-
className: className
|
|
83
|
+
className: className,
|
|
84
|
+
optional: optional
|
|
83
85
|
}, /*#__PURE__*/_react.default.createElement(StyledSelect, Object.assign({
|
|
84
86
|
onChange: function onChange(e) {
|
|
85
87
|
setValue(e.currentTarget.value);
|
|
@@ -91,6 +93,7 @@ var Select = /*#__PURE__*/_react.default.forwardRef(function (_ref8, ref) {
|
|
|
91
93
|
}, rest, {
|
|
92
94
|
error: errorMsg,
|
|
93
95
|
defaultValue: defaultValue,
|
|
96
|
+
required: optional === false,
|
|
94
97
|
hasValue: !!value,
|
|
95
98
|
greyDescription: greyDescription,
|
|
96
99
|
ref: ref
|
|
@@ -117,7 +120,8 @@ Select.defaultProps = {
|
|
|
117
120
|
/** If true, the 'description' option, which is initially selected but disabled, will be grey
|
|
118
121
|
* - like a text input's placeholder */
|
|
119
122
|
greyDescription: false,
|
|
120
|
-
className: ''
|
|
123
|
+
className: '',
|
|
124
|
+
optional: false
|
|
121
125
|
};
|
|
122
126
|
var _default = Select;
|
|
123
127
|
exports.default = _default;
|
|
@@ -33,26 +33,6 @@ var Logos = function Logos(_ref) {
|
|
|
33
33
|
})));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
if (campaign === 'Big Night In') {
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("a", {
|
|
38
|
-
href: "/",
|
|
39
|
-
title: "Go to Comic Relief homepage"
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement(_Logo.default, {
|
|
41
|
-
rotate: true,
|
|
42
|
-
sizeSm: "50px",
|
|
43
|
-
sizeMd: "60px",
|
|
44
|
-
campaign: "Comic Relief"
|
|
45
|
-
})), /*#__PURE__*/_react.default.createElement("a", {
|
|
46
|
-
href: "/big-night-in",
|
|
47
|
-
title: "Big night in homepage"
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_Logo.default, {
|
|
49
|
-
rotate: false,
|
|
50
|
-
sizeSm: "100px",
|
|
51
|
-
sizeMd: "200px",
|
|
52
|
-
campaign: "Big Night In"
|
|
53
|
-
})));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
36
|
if (campaign === 'Sport Relief') {
|
|
57
37
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
58
38
|
href: "/sportrelief",
|
|
@@ -67,7 +47,7 @@ var Logos = function Logos(_ref) {
|
|
|
67
47
|
href: "/",
|
|
68
48
|
title: "Go to Comic Relief homepage"
|
|
69
49
|
}, /*#__PURE__*/_react.default.createElement(_Logo.default, {
|
|
70
|
-
rotate:
|
|
50
|
+
rotate: false,
|
|
71
51
|
campaign: "Comic Relief"
|
|
72
52
|
}));
|
|
73
53
|
};
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ Object.defineProperty(exports, "Button", {
|
|
|
101
101
|
return _Button.default;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
Object.defineProperty(exports, "
|
|
104
|
+
Object.defineProperty(exports, "RadioButton", {
|
|
105
105
|
enumerable: true,
|
|
106
106
|
get: function get() {
|
|
107
107
|
return _RadioButton.default;
|
package/package.json
CHANGED
|
@@ -7,7 +7,6 @@ import spacing from '../../../theme/shared/spacing';
|
|
|
7
7
|
import crLogo from './assets/cr-logo.svg';
|
|
8
8
|
import srLogo from './assets/sr-logo.svg';
|
|
9
9
|
import srLogoGameOn from './assets/sr-gameon-logo.svg';
|
|
10
|
-
import bigNiht from './assets/big-night-logo.png';
|
|
11
10
|
|
|
12
11
|
const Image = styled.img`
|
|
13
12
|
object-fit: cover;
|
|
@@ -37,8 +36,6 @@ const themeSwitcher = theme => {
|
|
|
37
36
|
return srLogo;
|
|
38
37
|
case 'Sport Relief Gameon':
|
|
39
38
|
return srLogoGameOn;
|
|
40
|
-
case 'Big Night In':
|
|
41
|
-
return bigNiht;
|
|
42
39
|
default:
|
|
43
40
|
return crLogo;
|
|
44
41
|
}
|
|
@@ -49,6 +49,7 @@ const Select = React.forwardRef(
|
|
|
49
49
|
onChange,
|
|
50
50
|
greyDescription,
|
|
51
51
|
className,
|
|
52
|
+
optional,
|
|
52
53
|
...rest
|
|
53
54
|
},
|
|
54
55
|
ref
|
|
@@ -56,7 +57,13 @@ const Select = React.forwardRef(
|
|
|
56
57
|
const [value, setValue] = useState('');
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
|
-
<Label
|
|
60
|
+
<Label
|
|
61
|
+
label={label}
|
|
62
|
+
hideLabel={hideLabel}
|
|
63
|
+
errorMsg={errorMsg}
|
|
64
|
+
className={className}
|
|
65
|
+
optional={optional}
|
|
66
|
+
>
|
|
60
67
|
<StyledSelect
|
|
61
68
|
onChange={e => {
|
|
62
69
|
setValue(e.currentTarget.value);
|
|
@@ -67,6 +74,7 @@ const Select = React.forwardRef(
|
|
|
67
74
|
{...rest}
|
|
68
75
|
error={errorMsg}
|
|
69
76
|
defaultValue={defaultValue}
|
|
77
|
+
required={optional === false}
|
|
70
78
|
hasValue={!!value}
|
|
71
79
|
greyDescription={greyDescription}
|
|
72
80
|
ref={ref}
|
|
@@ -102,7 +110,8 @@ Select.propTypes = {
|
|
|
102
110
|
greyDescription: PropTypes.bool,
|
|
103
111
|
// className is needed so that styled(`Select`) will work
|
|
104
112
|
// (as `rest` is not spread on the outermost component)
|
|
105
|
-
className: PropTypes.string
|
|
113
|
+
className: PropTypes.string,
|
|
114
|
+
optional: PropTypes.bool
|
|
106
115
|
};
|
|
107
116
|
|
|
108
117
|
Select.defaultProps = {
|
|
@@ -112,7 +121,8 @@ Select.defaultProps = {
|
|
|
112
121
|
/** If true, the 'description' option, which is initially selected but disabled, will be grey
|
|
113
122
|
* - like a text input's placeholder */
|
|
114
123
|
greyDescription: false,
|
|
115
|
-
className: ''
|
|
124
|
+
className: '',
|
|
125
|
+
optional: false
|
|
116
126
|
};
|
|
117
127
|
|
|
118
128
|
export default Select;
|
|
@@ -17,24 +17,6 @@ const Logos = ({ campaign }) => {
|
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
if (campaign === 'Big Night In') {
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
<a href="/" title="Go to Comic Relief homepage">
|
|
24
|
-
<Logo rotate sizeSm="50px" sizeMd="60px" campaign="Comic Relief" />
|
|
25
|
-
</a>
|
|
26
|
-
<a href="/big-night-in" title="Big night in homepage">
|
|
27
|
-
<Logo
|
|
28
|
-
rotate={false}
|
|
29
|
-
sizeSm="100px"
|
|
30
|
-
sizeMd="200px"
|
|
31
|
-
campaign="Big Night In"
|
|
32
|
-
/>
|
|
33
|
-
</a>
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
20
|
if (campaign === 'Sport Relief') {
|
|
39
21
|
return (
|
|
40
22
|
<a href="/sportrelief" title="Sport Relief in homepage">
|
|
@@ -45,7 +27,7 @@ const Logos = ({ campaign }) => {
|
|
|
45
27
|
|
|
46
28
|
return (
|
|
47
29
|
<a href="/" title="Go to Comic Relief homepage">
|
|
48
|
-
<Logo rotate campaign="Comic Relief" />
|
|
30
|
+
<Logo rotate={false} campaign="Comic Relief" />
|
|
49
31
|
</a>
|
|
50
32
|
);
|
|
51
33
|
};
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { default as Logo } from './components/Atoms/Logo/Logo';
|
|
|
18
18
|
export { default as Picture } from './components/Atoms/Picture/Picture';
|
|
19
19
|
export { default as Link } from './components/Atoms/Link/Link';
|
|
20
20
|
export { default as Button } from './components/Atoms/Button/Button';
|
|
21
|
-
export { default as
|
|
21
|
+
export { default as RadioButton } from './components/Atoms/RadioButton/RadioButton';
|
|
22
22
|
export { default as Checkbox } from './components/Atoms/Checkbox/Checkbox';
|
|
23
23
|
export { default as Input } from './components/Atoms/Input/Input';
|
|
24
24
|
export { default as Select } from './components/Atoms/Select/Select';
|
|
Binary file
|
|
Binary file
|