0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,42 @@
import * as React from 'react';
import { StandardProps } from '..';
import { Orientation } from '../Stepper';
import { TransitionProps } from '../transitions/transition';
export interface StepContentProps
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, StepContentClasskey> {
/**
* Step content.
*/
children?: React.ReactNode;
/**
* The component used for the transition.
* [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
*/
TransitionComponent?: React.ComponentType<TransitionProps>;
/**
* Adjust the duration of the content expand transition.
* Passed as a prop to the transition component.
*
* Set to 'auto' to automatically calculate transition time based on height.
*/
transitionDuration?: TransitionProps['timeout'] | 'auto';
/**
* Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element.
*/
TransitionProps?: TransitionProps;
}
export type StepContentClasskey = 'root' | 'last' | 'transition';
/**
*
* Demos:
*
* - [Steppers](https://material-ui.com/components/steppers/)
*
* API:
*
* - [StepContent API](https://material-ui.com/api/step-content/)
*/
export default function StepContent(props: StepContentProps): JSX.Element;

View file

@ -0,0 +1,140 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.styles = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _Collapse = _interopRequireDefault(require("../Collapse"));
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
marginTop: 8,
marginLeft: 12,
// half icon
paddingLeft: 8 + 12,
// margin + half icon
paddingRight: 8,
borderLeft: "1px solid ".concat(theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600])
},
/* Styles applied to the root element if `last={true}` (controlled by `Step`). */
last: {
borderLeft: 'none'
},
/* Styles applied to the Transition component. */
transition: {}
};
};
exports.styles = styles;
var StepContent = /*#__PURE__*/React.forwardRef(function StepContent(props, ref) {
var active = props.active,
alternativeLabel = props.alternativeLabel,
children = props.children,
classes = props.classes,
className = props.className,
completed = props.completed,
expanded = props.expanded,
last = props.last,
optional = props.optional,
orientation = props.orientation,
_props$TransitionComp = props.TransitionComponent,
TransitionComponent = _props$TransitionComp === void 0 ? _Collapse.default : _props$TransitionComp,
_props$transitionDura = props.transitionDuration,
transitionDurationProp = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,
TransitionProps = props.TransitionProps,
other = (0, _objectWithoutProperties2.default)(props, ["active", "alternativeLabel", "children", "classes", "className", "completed", "expanded", "last", "optional", "orientation", "TransitionComponent", "transitionDuration", "TransitionProps"]);
if (process.env.NODE_ENV !== 'production') {
if (orientation !== 'vertical') {
console.error('Material-UI: <StepContent /> is only designed for use with the vertical stepper.');
}
}
var transitionDuration = transitionDurationProp;
if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
transitionDuration = undefined;
}
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className, last && classes.last),
ref: ref
}, other), /*#__PURE__*/React.createElement(TransitionComponent, (0, _extends2.default)({
in: active || expanded,
className: classes.transition,
timeout: transitionDuration,
unmountOnExit: true
}, TransitionProps), children));
});
process.env.NODE_ENV !== "production" ? StepContent.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* Step content.
*/
children: _propTypes.default.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: _propTypes.default.object,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* The component used for the transition.
* [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
*/
TransitionComponent: _propTypes.default.elementType,
/**
* Adjust the duration of the content expand transition.
* Passed as a prop to the transition component.
*
* Set to 'auto' to automatically calculate transition time based on height.
*/
transitionDuration: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.shape({
appear: _propTypes.default.number,
enter: _propTypes.default.number,
exit: _propTypes.default.number
})]),
/**
* Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element.
*/
TransitionProps: _propTypes.default.object
} : void 0;
var _default = (0, _withStyles.default)(styles, {
name: 'MuiStepContent'
})(StepContent);
exports.default = _default;

View file

@ -0,0 +1,2 @@
export { default } from './StepContent';
export * from './StepContent';

View file

@ -0,0 +1,15 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _StepContent.default;
}
});
var _StepContent = _interopRequireDefault(require("./StepContent"));

View file

@ -0,0 +1,5 @@
{
"sideEffects": false,
"module": "../esm/StepContent/index.js",
"typings": "./index.d.ts"
}