Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Commit 3df196b

Browse files
committed
Merge branch 'release/16.3'
2 parents 95ce09d + af0d27d commit 3df196b

File tree

92 files changed

+1981
-28465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1981
-28465
lines changed

apps/components/ComponentsExample.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { __ } from "@wordpress/i18n";
22

3-
import { Alert, CourseDetails, FullHeightCard, Warning } from "@yoast/components";
3+
import { Alert, CourseDetails, FullHeightCard, StarRating, Warning } from "@yoast/components";
44
import { getCourseFeed, getDirectionalStyle, makeOutboundLink } from "@yoast/helpers";
55
import React from "react";
66
import styled from "styled-components";
@@ -138,6 +138,12 @@ export default class ComponentsExample extends React.Component {
138138
</Alert>;
139139
}
140140

141+
updateStars( event ) {
142+
this.setState({
143+
input: event.target.value
144+
} );
145+
}
146+
141147
/**
142148
* Renders all the Component examples.
143149
*
@@ -171,6 +177,9 @@ export default class ComponentsExample extends React.Component {
171177
<p key="2">This spans to multiple lines.</p>,
172178
] }
173179
/>
180+
<h2>Star rating</h2>
181+
<i>Accepts a rating from 0-5 and colors the stars yellow accordingly</i>
182+
<StarRating rating={ 3.5 } />
174183
<h2>Outbound links</h2>
175184
<p>
176185
<NonYoastLink href="http://www.example.org">example.org</NonYoastLink>

apps/components/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yoast/example-component-app",
3-
"version": "1.8.0",
3+
"version": "1.9.0-rc.1",
44
"description": "This app demonstrates the possibilites of our components",
55
"main": "index.js",
66
"author": "Yoast",
@@ -12,11 +12,11 @@
1212
},
1313
"dependencies": {
1414
"@wordpress/i18n": "1.2.3",
15-
"@yoast/analysis-report": "^1.20.0",
16-
"@yoast/components": "^2.18.0",
17-
"@yoast/configuration-wizard": "^2.21.0",
15+
"@yoast/analysis-report": "^1.21.0-rc.0",
16+
"@yoast/components": "^2.19.0-rc.0",
17+
"@yoast/configuration-wizard": "^2.22.0-rc.0",
1818
"@yoast/helpers": "^0.16.0",
19-
"@yoast/search-metadata-previews": "^2.23.0",
19+
"@yoast/search-metadata-previews": "^2.24.0-rc.1",
2020
"@yoast/style-guide": "^0.13.0",
2121
"babel-polyfill": "^6.23.0",
2222
"lodash": "4.17.11",
@@ -48,7 +48,7 @@
4848
"webpack": "4.19.1",
4949
"webpack-cli": "^2.1.3",
5050
"webpack-dev-server": "3.1.14",
51-
"yoast-components": "^5.23.0"
51+
"yoast-components": "^5.24.0-rc.1"
5252
},
5353
"peerDependencies": {
5454
"material-ui": "^0.18.6",

apps/content-analysis/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@yoast/content-analysis-app",
3-
"version": "0.9.0",
3+
"version": "0.10.0-rc.0",
44
"private": true,
55
"dependencies": {
66
"@babel/core": "7.7.4",
77
"@svgr/webpack": "4.3.3",
88
"@wordpress/i18n": "^3.1.1",
9-
"@yoast/analysis-report": "^1.20.0",
10-
"@yoast/components": "^2.18.0",
9+
"@yoast/analysis-report": "^1.21.0-rc.0",
10+
"@yoast/components": "^2.19.0-rc.0",
1111
"@yoast/style-guide": "^0.13.0",
1212
"babel-core": "7.0.0-bridge.0",
1313
"babel-eslint": "10.0.3",

packages/analysis-report/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yoast/analysis-report",
3-
"version": "1.20.0",
3+
"version": "1.21.0-rc.0",
44
"main": "src/index.js",
55
"repository": {
66
"type": "git",
@@ -17,7 +17,7 @@
1717
"private": false,
1818
"dependencies": {
1919
"@wordpress/i18n": "^1.1.0",
20-
"@yoast/components": "^2.18.0",
20+
"@yoast/components": "^2.19.0-rc.0",
2121
"@yoast/helpers": "^0.16.0",
2222
"@yoast/style-guide": "^0.13.0",
2323
"lodash": "^4.17.11",

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yoast/components",
3-
"version": "2.18.0",
3+
"version": "2.19.0-rc.0",
44
"description": "Yoast Components",
55
"main": "src/index.js",
66
"private": false,

packages/components/src/field-group/FieldGroup.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,32 @@ import PropTypes from "prop-types";
44
// Import the required CSS.
55
import "./field-group.css";
66
import HelpIcon, { helpIconDefaultProps, helpIconProps } from "../help-icon/HelpIcon";
7+
import NewBadge from "../new-badge/NewBadge";
78

89
/**
910
* FieldGroup component that can be used to wrap our form elements in.
1011
*
11-
* @param {string} htmlFor ID to which HTML element the label belongs.
12-
* @param {string} label Text displayed as label.
13-
* @param {string} linkTo Location to which the icon links.
14-
* @param {string} linkText Screen-reader text that is added to the link.
15-
* @param {string} description Optional: a description where the input element is used for.
16-
* @param {array} children Children that are rendered in the FieldGroup.
12+
* @param {string} htmlFor ID to which HTML element the label belongs.
13+
* @param {string} label Text displayed as label.
14+
* @param {string} linkTo Location to which the icon links.
15+
* @param {string} linkText Screen-reader text that is added to the link.
16+
* @param {string} description Optional: A description where the input element is used for.
17+
* @param {array} children Children that are rendered in the FieldGroup.
1718
* @param {string} wrapperClassName Optional: A classname for the FieldGroup's outer div. Default is "yoast-field-group".
18-
* @param {string} titleClassName Optional: A classname for the FieldGroup's title div. Default is "yoast-field-group__title".
19+
* @param {string} titleClassName Optional: A classname for the FieldGroup's title div. Default is "yoast-field-group__title".
20+
* @param {bool} hasNewBadge Optional: Whether the FieldGroup has a 'New' Badge.
1921
*
2022
* @returns {React.Component} A div with a label, icon and optional description that renders all children.
2123
*/
22-
const FieldGroup = ( { htmlFor, label, linkTo, linkText, description, children, wrapperClassName, titleClassName } ) => {
24+
const FieldGroup = ( { htmlFor, label, linkTo, linkText, description, children, wrapperClassName, titleClassName, hasNewBadge } ) => {
2325
const titleComponent = htmlFor
2426
? <label htmlFor={ htmlFor }>{ label }</label>
2527
: <b>{ label }</b>;
2628
return (
2729
<div className={ wrapperClassName }>
2830
{ label !== "" && <div className={ titleClassName }>
2931
{ titleComponent }
32+
{ hasNewBadge && <NewBadge inLabel={ true } /> }
3033
{ linkTo !== "" && <HelpIcon
3134
linkTo={ linkTo }
3235
linkText={ linkText }

packages/components/src/image-select/ImageSelect.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function ImageSelect( props ) {
3737
>
3838
<FieldGroup
3939
label={ props.label }
40+
hasNewBadge={ props.hasNewBadge }
4041
>
4142
{ props.hasPreview &&
4243
<button className={ imageClassName } onClick={ props.onClick } type="button">
@@ -73,6 +74,7 @@ ImageSelect.propTypes = {
7374
replaceImageButtonId: PropTypes.string,
7475
removeImageButtonId: PropTypes.string,
7576
warnings: PropTypes.arrayOf( PropTypes.string ),
77+
hasNewBadge: PropTypes.bool,
7678
};
7779

7880
ImageSelect.defaultProps = {
@@ -87,4 +89,5 @@ ImageSelect.defaultProps = {
8789
replaceImageButtonId: "",
8890
removeImageButtonId: "",
8991
warnings: [],
92+
hasNewBadge: false,
9093
};

packages/components/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ export * from "./inputs";
1313
export * from "./insights-card";
1414
export * from "./radiobutton";
1515
export * from "./select";
16+
export * from "./star-rating";
1617
export * from "./help-icon";
1718
export * from "./tables";
19+
export * from "./new-badge";
1820

1921
// Referenced index.js explicitly due to case-sensitive path conflicts.
2022
export * from "./toggle/index.js";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import { __ } from "@wordpress/i18n";
4+
5+
/**
6+
* Function for the NewBadge component.
7+
*
8+
* @param {bool} inLabel Whether the NewBadge is within a Label.
9+
*
10+
* @returns {React.Component} The NewBadge.
11+
*/
12+
const NewBadge = ( { inLabel } ) => (
13+
<span className={ inLabel ? "yoast-badge yoast-badge__in-label yoast-new-badge" : "yoast-badge yoast-new-badge" }>
14+
{ __( "New", "wordpress-seo" ) }
15+
</span>
16+
);
17+
18+
NewBadge.propTypes = {
19+
inLabel: PropTypes.bool,
20+
};
21+
22+
NewBadge.defaultProps = {
23+
inLabel: false,
24+
};
25+
26+
export default NewBadge;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import "./new-badge.css";
2+
export { default as NewBadge } from "./NewBadge";

0 commit comments

Comments
 (0)