Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Timeline] Introduce new component #21331

Merged
merged 61 commits into from Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
260a663
scaffolding
mnajdova Jun 2, 2020
729e570
added TimelineItem
mnajdova Jun 2, 2020
83a0d75
fixed tests
mnajdova Jun 2, 2020
ebe85a4
added tail and content
mnajdova Jun 2, 2020
8ef1c4a
fixed tests
mnajdova Jun 2, 2020
10e6622
Added TimelineItemDot
mnajdova Jun 3, 2020
8f4096b
TimelineItemDot
mnajdova Jun 3, 2020
cea6112
generated proptypes and api
mnajdova Jun 3, 2020
fbd4b30
added align
mnajdova Jun 3, 2020
8036f90
updated proptypes and api
mnajdova Jun 3, 2020
9a0c504
added align right
mnajdova Jun 3, 2020
bfb9bff
updated proptypes
mnajdova Jun 3, 2020
84d8ac4
docs api changes
mnajdova Jun 3, 2020
32cdb77
styles changes
mnajdova Jun 3, 2020
fa8f4ed
updated dots to support icons inside
mnajdova Jun 5, 2020
4af7b5a
style improvements
mnajdova Jun 5, 2020
662a126
prettier + lint
mnajdova Jun 5, 2020
d8e152b
added opposite content, added color and variant to dot
mnajdova Jun 6, 2020
5ca72c5
fixes
mnajdova Jun 6, 2020
75f7c7e
removed some subselectors, expended customizatione example
mnajdova Jun 6, 2020
8739aac
misc
mnajdova Jun 6, 2020
e63d2ed
more customizations
mnajdova Jun 6, 2020
3ead3f1
fixes
mnajdova Jun 6, 2020
f45b89b
misc
mnajdova Jun 6, 2020
3682129
opposite example
mnajdova Jun 6, 2020
ad4e464
docs api
mnajdova Jun 6, 2020
2f95a65
lint+prettier
mnajdova Jun 6, 2020
83bb2ad
docs api
mnajdova Jun 6, 2020
0dd8ae0
added separator
mnajdova Jun 7, 2020
5d25eb0
proptypes + docs + cleanups
mnajdova Jun 7, 2020
288eb3e
components renaming
mnajdova Jun 7, 2020
516bbf9
cleanups
mnajdova Jun 7, 2020
8df9005
styles + colors fixes
mnajdova Jun 7, 2020
2ad1cb0
addressing comments
mnajdova Jun 7, 2020
856847d
styles improvements
mnajdova Jun 7, 2020
af5c765
added colors and outlined examples
mnajdova Jun 7, 2020
a0c7293
docs:api
mnajdova Jun 7, 2020
3dfaf2c
removed connector from last element
mnajdova Jun 7, 2020
693c3fe
added opposite content
mnajdova Jun 7, 2020
3f538b5
docs:api
mnajdova Jun 7, 2020
e2b7518
Update docs/src/pages/components/timeline/CustomizedTimeline.tsx
mnajdova Jun 7, 2020
c568cfc
Update docs/src/pages/components/timeline/OppositeContentTimeline.tsx
mnajdova Jun 7, 2020
f28018c
examples fixes
mnajdova Jun 7, 2020
b8d6fdd
Update docs/src/pages/components/timeline/timeline.md
mnajdova Jun 8, 2020
3f75cbb
Update docs/src/pages/components/timeline/timeline.md
mnajdova Jun 8, 2020
70abe4f
Update docs/src/pages/components/timeline/OutlinedTimeline.js
mnajdova Jun 8, 2020
c4183a0
Update docs/src/pages/components/timeline/CustomizedTimeline.js
mnajdova Jun 8, 2020
df98fe1
renamed demos
mnajdova Jun 8, 2020
d98948e
added context for the timeline item classes
mnajdova Jun 8, 2020
2a6171b
improved customized example
mnajdova Jun 8, 2020
80970ca
docs:api changes
mnajdova Jun 8, 2020
ab07eed
names fixed
mnajdova Jun 9, 2020
31e2d2b
fixes
mnajdova Jun 9, 2020
71738e4
Update docs/src/pages/components/timeline/timeline.md
oliviertassinari Jun 9, 2020
9d486ae
removed component props
mnajdova Jun 9, 2020
966142c
removed alternating timeline from the opposite content example
mnajdova Jun 10, 2020
feb434c
updatd opposite content example
mnajdova Jun 10, 2020
ce228f2
prettier
mnajdova Jun 10, 2020
4b9f95d
simple -> basic
oliviertassinari Jun 10, 2020
b5cf91b
Update docs/src/pages/components/timeline/timeline.md
oliviertassinari Jun 10, 2020
a7c8b3f
josh's review
oliviertassinari Jun 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-connector.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-connector';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-connector\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
55 changes: 55 additions & 0 deletions docs/pages/api-docs/timeline-connector.md
@@ -0,0 +1,55 @@
---
filename: /packages/material-ui-lab/src/TimelineConnector/TimelineConnector.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TimelineConnector API

<p class="description">The API documentation of the TimelineConnector React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import TimelineConnector from '@material-ui/lab/TimelineConnector';
// or
import { TimelineConnector } from '@material-ui/lab';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiTimelineConnector` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiTimelineConnector-root</span> | Styles applied to the root element.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/TimelineConnector/TimelineConnector.js) for more detail.

## Demos

- [Timeline](/components/timeline/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-content.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-content';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-content\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
56 changes: 56 additions & 0 deletions docs/pages/api-docs/timeline-content.md
@@ -0,0 +1,56 @@
---
filename: /packages/material-ui-lab/src/TimelineContent/TimelineContent.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TimelineContent API

<p class="description">The API documentation of the TimelineContent React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import TimelineContent from '@material-ui/lab/TimelineContent';
// or
import { TimelineContent } from '@material-ui/lab';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiTimelineContent` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiTimelineContent-root</span> | Styles applied to the root element.
| <span class="prop-name">alignRight</span> | <span class="prop-name">.MuiTimelineContent-alignRight</span> | Styles applied to the root element if `align="right"`.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/TimelineContent/TimelineContent.js) for more detail.

## Demos

- [Timeline](/components/timeline/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-dot.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-dot';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-dot\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
63 changes: 63 additions & 0 deletions docs/pages/api-docs/timeline-dot.md
@@ -0,0 +1,63 @@
---
filename: /packages/material-ui-lab/src/TimelineDot/TimelineDot.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TimelineDot API

<p class="description">The API documentation of the TimelineDot React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import TimelineDot from '@material-ui/lab/TimelineDot';
// or
import { TimelineDot } from '@material-ui/lab';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiTimelineDot` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">color</span> | <span class="prop-type">'grey'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'</span> | <span class="prop-default">'grey'</span> | The dot can have a different colors. |
| <span class="prop-name">variant</span> | <span class="prop-type">'default'<br>&#124;&nbsp;'outlined'</span> | <span class="prop-default">'default'</span> | The dot can appear filled or outlined. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiTimelineDot-root</span> | Styles applied to the root element.
| <span class="prop-name">defaultGrey</span> | <span class="prop-name">.MuiTimelineDot-defaultGrey</span> | Styles applied to the root element if `color="grey"` and `variant="default"`.
| <span class="prop-name">outlinedGrey</span> | <span class="prop-name">.MuiTimelineDot-outlinedGrey</span> | Styles applied to the root element if `color="grey"` and `variant="outlined"`.
| <span class="prop-name">defaultPrimary</span> | <span class="prop-name">.MuiTimelineDot-defaultPrimary</span> | Styles applied to the root element if `color="primary"` and `variant="default"`.
| <span class="prop-name">outlinedPrimary</span> | <span class="prop-name">.MuiTimelineDot-outlinedPrimary</span> | Styles applied to the root element if `color="primary"` and `variant="outlined"`.
| <span class="prop-name">defaultSecondary</span> | <span class="prop-name">.MuiTimelineDot-defaultSecondary</span> | Styles applied to the root element if `color="secondary"` and `variant="default"`.
| <span class="prop-name">outlinedSecondary</span> | <span class="prop-name">.MuiTimelineDot-outlinedSecondary</span> | Styles applied to the root element if `color="secondary"` and `variant="outlined"`.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/TimelineDot/TimelineDot.js) for more detail.

## Demos

- [Timeline](/components/timeline/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-item.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-item';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-item\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
61 changes: 61 additions & 0 deletions docs/pages/api-docs/timeline-item.md
@@ -0,0 +1,61 @@
---
filename: /packages/material-ui-lab/src/TimelineItem/TimelineItem.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TimelineItem API

<p class="description">The API documentation of the TimelineItem React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import TimelineItem from '@material-ui/lab/TimelineItem';
// or
import { TimelineItem } from '@material-ui/lab';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiTimelineItem` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiTimelineItem-root</span> | Styles applied to the root element.
| <span class="prop-name">alignLeft</span> | <span class="prop-name">.MuiTimelineItem-alignLeft</span> | Styles applied to the root element if `align="left"`.
| <span class="prop-name">alignRight</span> | <span class="prop-name">.MuiTimelineItem-alignRight</span> | Styles applied to the root element if `align="right"`.
| <span class="prop-name">alignAlternate</span> | <span class="prop-name">.MuiTimelineItem-alignAlternate</span> | Styles applied to the root element if `align="alternate"`.
| <span class="prop-name">missingOppositeContent</span> | <span class="prop-name">.MuiTimelineItem-missingOppositeContent</span> | Styles applied to the root element if no there isn't TimelineOppositeContent provided.
| <span class="prop-name">content</span> | <span class="prop-name">.MuiTimelineItem-content</span> | Styles applied to the timeline content node.
| <span class="prop-name">oppositeContent</span> | <span class="prop-name">.MuiTimelineItem-oppositeContent</span> | Styles applied to the timeline opposite content node.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/TimelineItem/TimelineItem.js) for more detail.

## Demos

- [Timeline](/components/timeline/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-opposite-content.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-opposite-content';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-opposite-content\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
56 changes: 56 additions & 0 deletions docs/pages/api-docs/timeline-opposite-content.md
@@ -0,0 +1,56 @@
---
filename: /packages/material-ui-lab/src/TimelineOppositeContent/TimelineOppositeContent.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TimelineOppositeContent API

<p class="description">The API documentation of the TimelineOppositeContent React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import TimelineOppositeContent from '@material-ui/lab/TimelineOppositeContent';
// or
import { TimelineOppositeContent } from '@material-ui/lab';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiTimelineOppositeContent` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiTimelineOppositeContent-root</span> | Styles applied to the root element.
| <span class="prop-name">alignRight</span> | <span class="prop-name">.MuiTimelineOppositeContent-alignRight</span> | Styles applied to the root element if `align="right"`.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/TimelineOppositeContent/TimelineOppositeContent.js) for more detail.

## Demos

- [Timeline](/components/timeline/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/timeline-separator.js
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/timeline-separator';
const requireRaw = require.context('!raw-loader!./', false, /\/timeline-separator\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};