Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,18 @@
import * as React from 'react';
import { StandardProps } from '..';
import { PaperProps, PaperClassKey } from '../Paper';
export interface CardProps extends StandardProps<
PaperProps,
CardClassKey
> {
raised?: boolean;
}
export type CardClassKey =
| PaperClassKey
;
declare const Card: React.ComponentType<CardProps>;
export default Card;

View File

@@ -0,0 +1,21 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
// @inheritedComponent Paper
import React from 'react';
import Paper from '../Paper';
function Card(props) {
const { raised } = props,
other = _objectWithoutProperties(props, ['raised']);
return React.createElement(Paper, _extends({ elevation: raised ? 8 : 2 }, other));
}
Card.defaultProps = {
raised: false
};
export default Card;

View File

@@ -0,0 +1,18 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface CardActionsProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
CardActionClassKey
> {
disableActionSpacing?: boolean;
}
export type CardActionClassKey =
| 'root'
| 'actionSpacing'
;
declare const CardActions: React.ComponentType<CardActionsProps>;
export default CardActions;

View File

@@ -0,0 +1,38 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import { cloneChildrenWithClassName } from '../utils/reactHelpers';
export const styles = {
root: {
height: 52,
display: 'flex',
alignItems: 'center',
padding: '2px 4px'
},
actionSpacing: {
margin: '0 4px'
}
};
function CardActions(props) {
const { disableActionSpacing, children, classes, className } = props,
other = _objectWithoutProperties(props, ['disableActionSpacing', 'children', 'classes', 'className']);
return React.createElement(
'div',
_extends({ className: classNames(classes.root, className) }, other),
disableActionSpacing ? children : cloneChildrenWithClassName(children, classes.actionSpacing)
);
}
CardActions.defaultProps = {
disableActionSpacing: false
};
export default withStyles(styles, { name: 'MuiCardActions' })(CardActions);

View File

@@ -0,0 +1,15 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface CardContentProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
CardContentClassKey
> {}
export type CardContentClassKey =
| 'root'
;
declare const CardContent: React.ComponentType<CardContentProps>;
export default CardContent;

View File

@@ -0,0 +1,25 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
padding: theme.spacing.unit * 2,
'&:last-child': {
paddingBottom: theme.spacing.unit * 3
}
}
});
function CardContent(props) {
const { classes, className } = props,
other = _objectWithoutProperties(props, ['classes', 'className']);
return React.createElement('div', _extends({ className: classNames(classes.root, className) }, other));
}
export default withStyles(styles, { name: 'MuiCardContent' })(CardContent);

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import { StandardProps } from '..';
import { CardContentProps, CardContentClassKey } from './CardContent';
export interface CardHeaderProps extends StandardProps<
CardContentProps,
CardHeaderClassKey,
'title'
> {
avatar?: React.ReactNode;
subheader?: React.ReactNode;
title?: React.ReactNode;
}
export type CardHeaderClassKey =
| CardContentClassKey
| 'avatar'
| 'content'
| 'title'
| 'subheader'
;
declare const CardHeader: React.ComponentType<CardHeaderProps>;
export default CardHeader;

View File

@@ -0,0 +1,70 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
// @inheritedComponent CardContent
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import Typography from '../Typography';
import CardContent from './CardContent';
export const styles = theme => ({
root: {
display: 'flex',
alignItems: 'center'
},
avatar: {
flex: '0 0 auto',
marginRight: theme.spacing.unit * 2
},
content: {
flex: '1 1 auto'
},
title: {},
subheader: {}
});
function CardHeader(props) {
const { avatar, classes, className: classNameProp, subheader, title } = props,
other = _objectWithoutProperties(props, ['avatar', 'classes', 'className', 'subheader', 'title']);
const className = classNames(classes.root, classNameProp);
// Adjustments that depend on the presence of an avatar
const titleType = avatar ? 'body2' : 'headline';
const subheaderType = avatar ? 'body2' : 'body1';
return React.createElement(
CardContent,
_extends({ className: className }, other),
avatar && React.createElement(
'div',
{ className: classes.avatar },
avatar
),
React.createElement(
'div',
{ className: classes.content },
React.createElement(
Typography,
{ type: titleType, component: 'span', className: classes.title },
title
),
React.createElement(
Typography,
{
type: subheaderType,
component: 'span',
color: 'secondary',
className: classes.subheader
},
subheader
)
)
);
}
export default withStyles(styles, { name: 'MuiCardHeader' })(CardHeader);

View File

@@ -0,0 +1,19 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface CardMediaProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
CardMediaClassKey
> {
image?: string;
src?: string;
component?: React.ReactType;
}
export type CardMediaClassKey =
| 'root'
;
declare const CardMedia: React.ComponentType<CardMediaProps>;
export default CardMedia;

View File

@@ -0,0 +1,48 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import warning from 'warning';
import withStyles from '../styles/withStyles';
export const styles = {
root: {
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center'
},
rootMedia: {
width: '100%'
}
};
const mediaComponents = ['video', 'audio', 'picture', 'iframe', 'img'];
function CardMedia(props) {
const { classes, className, image, style, src, component: ComponentProp } = props,
other = _objectWithoutProperties(props, ['classes', 'className', 'image', 'style', 'src', 'component']);
warning(Boolean(image || src), 'Material-UI: either `image` or `src` property must be specified.');
const isMediaComponent = mediaComponents.indexOf(ComponentProp) !== -1;
const composedStyle = !isMediaComponent && image ? _extends({ backgroundImage: `url(${image})` }, style) : style;
const composedClassName = classNames({
[classes.root]: !isMediaComponent,
[classes.rootMedia]: isMediaComponent
}, className);
return React.createElement(ComponentProp, _extends({
className: composedClassName,
style: composedStyle,
src: isMediaComponent ? image || src : undefined
}, other));
}
CardMedia.defaultProps = {
component: 'div'
};
export default withStyles(styles, { name: 'MuiCardMedia' })(CardMedia);

View File

@@ -0,0 +1,10 @@
export { default } from './Card';
export * from './Card';
export { default as CardActions } from './CardActions';
export * from './CardActions';
export { default as CardContent } from './CardContent';
export * from './CardContent';
export { default as CardHeader } from './CardHeader';
export * from './CardHeader';
export { default as CardMedia } from './CardMedia';
export * from './CardMedia';

View File

@@ -0,0 +1,5 @@
export { default } from './Card';
export { default as CardContent } from './CardContent';
export { default as CardActions } from './CardActions';
export { default as CardMedia } from './CardMedia';
export { default as CardHeader } from './CardHeader';