Skip to content

Commit

Permalink
Merge branch 'develop' into jimothy/update-tools-library-diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
dpatil-magento committed Oct 15, 2019
2 parents f7c2c22 + 152f4ab commit 2fb332e
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/run-docker
Expand Up @@ -26,7 +26,7 @@ main () {
env_setup
create_certificate
# If cert setup failed then don't start docker
if [ "$STATUS" == 0 ]; then
if [ "$STATUS" = "0" ]; then
start_docker
else
message "An error occurred during setup."
Expand Down Expand Up @@ -60,7 +60,7 @@ start_docker () {

clean_up_env & # clean up the environment in the background

if [ "$BUILD_STATUS" == 0 ]; then
if [ "$BUILD_STATUS" = "0" ]; then
message "Starting Docker network and containers"
docker-compose up
else
Expand Down
Expand Up @@ -74,6 +74,7 @@ https://github.com/nodejs/node-gyp#installation`
break;
case 'jpg':
query.format = 'jpeg';
break;
default:
break;
}
Expand Down
28 changes: 28 additions & 0 deletions packages/venia-ui/lib/components/Button/button.js
Expand Up @@ -6,6 +6,16 @@ import defaultClasses from './button.css';

const getRootClassName = priority => `root_${priority}Priority`;

/**
* A component for buttons.
*
* @typedef Button
* @kind functional component
*
* @param {props} props React component props
*
* @returns {React.Element} A React component that displays a single button.
*/
export const Button = props => {
const {
children,
Expand All @@ -24,6 +34,24 @@ export const Button = props => {
);
};

/**
* Props for {@link Button}
*
* @typedef props
*
* @property {Object} classes An object containing the class names for the
* Button component.
* @property {string} classes.content classes for the button content
* @property {string} classes.root classes for root container
* @property {string} classes.root_highPriority classes for Button if
* high priority.
* @property {string} classes.root_lowPriority classes for Button if
* low priority.
* @property {string} classes.root_normalPriority classes for Button if
* normal priority.
* @property {string} priority the priority/importance of the Button
* @property {string} type the type of the Button
*/
Button.propTypes = {
classes: shape({
content: string,
Expand Down
24 changes: 24 additions & 0 deletions packages/venia-ui/lib/components/ButtonGroup/buttonGroup.js
Expand Up @@ -5,6 +5,16 @@ import { mergeClasses } from '../../classify';
import Button from './button';
import defaultClasses from './buttonGroup.css';

/**
* A component that creates a group of buttons.
*
* @typedef ButtonGroup
* @kind functional component
*
* @param {props} props React component props
*
* @returns {React.Element} A React component that displays multiple buttons.
*/
const ButtonGroup = props => {
const { items } = props;
const classes = mergeClasses(defaultClasses, props.classes);
Expand All @@ -20,6 +30,20 @@ const ButtonGroup = props => {
return <div className={classes.root}>{children}</div>;
};

/**
* Props for {@link ButtonGroup}
*
* @typedef props
*
* @property {Object} classes An object containing the class names for the
* ButtonGroup component.
* @property {string} classes.root classes for root container
* @property {InferProps<children, key>[]} items the items to evaluate
* memoization recomputation.
* @property {ReactNodeLike} children any elements that will be child
* elements inside the root container.
* @property {string} key the unique for a `Button` element.
*/
ButtonGroup.propTypes = {
classes: shape({
root: string
Expand Down
20 changes: 20 additions & 0 deletions packages/venia-ui/lib/components/Logo/logo.js
Expand Up @@ -3,6 +3,16 @@ import PropTypes from 'prop-types';
import { mergeClasses } from '../../classify';
import logo from './logo.svg';

/**
* A component that renders a logo in the header.
*
* @typedef Logo
* @kind functional component
*
* @param {props} props React component props
*
* @returns {React.Element} A React component that displays a logo.
*/
const Logo = props => {
const { height } = props;
const classes = mergeClasses({}, props.classes);
Expand All @@ -18,6 +28,16 @@ const Logo = props => {
);
};

/**
* Props for {@link Logo}
*
* @typedef props
*
* @property {Object} classes An object containing the class names for the
* Logo component.
* @property {string} classes.logo classes for logo
* @property {number} height the height of the logo.
*/
Logo.propTypes = {
classes: PropTypes.shape({
logo: PropTypes.string
Expand Down
26 changes: 26 additions & 0 deletions packages/venia-ui/lib/components/Mask/mask.js
Expand Up @@ -4,7 +4,33 @@ import PropTypes from 'prop-types';
import classify from '../../classify';
import defaultClasses from './mask.css';

/**
* A component that masks content.
*
* @class Mask
* @extends {Component}
*
* @typedef Mask
* @kind class component
*
* @returns {React.Element} A React component that will mask content.
*/
class Mask extends Component {
/**
* Props for {@link Mask}
*
* @typedef props
*
* @property {Object} classes An object containing the class names for the
* Mask component.
* @property {string} classes.root classes for root container
* @property {string} classes.root_action classes for root container if
* the `isActive` property is `true`.
* @property {Function} dismiss the handler for on the `onClick` event
* handler.
* @property {boolean} isActive whether the mask is in an active state
* or not.
*/
static propTypes = {
classes: PropTypes.shape({
root: PropTypes.string,
Expand Down
21 changes: 21 additions & 0 deletions packages/venia-ui/lib/components/Modal/modal.js
Expand Up @@ -2,6 +2,17 @@ import { useMemo } from 'react';
import { createPortal } from 'react-dom';
import { node, object } from 'prop-types';

/**
* A component that gives a modal-like behavior with content inside.
*
* @typedef Modal
* @kind functional component
*
* @param {children} children React child elements
* @param {container} container modal container
*
* @returns {React.ReactPortal} A React portal that displays some content as a modal.
*/
const Modal = ({ children, container }) => {
const target = useMemo(
() =>
Expand All @@ -16,6 +27,16 @@ const Modal = ({ children, container }) => {

export default Modal;

/**
* Props for {@link Modal}
*
* @typedef props
*
* @property {ReactNodeLike} children any elements that will be child
* elements inside the modal.
* @property {Object} container the container element (a DOM element)
* where the children will be rendered.
*/
Modal.propTypes = {
children: node,
container: object
Expand Down
23 changes: 23 additions & 0 deletions packages/venia-ui/lib/components/Trigger/trigger.js
Expand Up @@ -4,6 +4,16 @@ import { func, node, shape, string } from 'prop-types';
import { mergeClasses } from '../../classify';
import defaultClasses from './trigger.css';

/**
* A component that will trigger a given action.
*
* @typedef Trigger
* @kind functional component
*
* @param {props} props React component props
*
* @returns {React.Element} A React component that when triggered invokes the action.
*/
const Trigger = props => {
const { action, children } = props;

Expand All @@ -16,6 +26,19 @@ const Trigger = props => {
);
};

/**
* Props for {@link Trigger}
*
* @typedef props
*
* @property {Function} action the handler for on the `onClick` event
* handler.
* @property {ReactNodeLike} children any elements that will be child
* elements inside the root container.
* @property {Object} classes An object containing the class names for the
* Trigger component.
* @property {string} classes.root classes for root container
*/
Trigger.propTypes = {
action: func.isRequired,
children: node,
Expand Down

0 comments on commit 2fb332e

Please sign in to comment.