-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
839 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React, { Fragment } from 'react'; | ||
|
||
import { | ||
EuiBreadcrumbs, | ||
EuiButton, | ||
EuiPageContentHeader, | ||
EuiPageContentHeaderSection, | ||
EuiTitle, | ||
EuiSpacer, | ||
} from '../../../../src/components'; | ||
|
||
export default () => { | ||
const breadcrumbs = [{ | ||
text: 'Animals', | ||
href: '#', | ||
onClick: (e) => { e.preventDefault(); console.log('You clicked Animals'); }, | ||
'data-test-subj': 'breadcrumbsAnimals', | ||
className: 'customClass', | ||
}, { | ||
text: 'Reptiles', | ||
href: '#', | ||
onClick: (e) => { e.preventDefault(); console.log('You clicked Reptiles'); }, | ||
}, { | ||
text: 'Boa constrictor', | ||
href: '#', | ||
onClick: (e) => { e.preventDefault(); console.log('You clicked Boa constrictor'); }, | ||
}, { | ||
text: 'Edit', | ||
}]; | ||
|
||
return ( | ||
<Fragment> | ||
<EuiBreadcrumbs breadcrumbs={breadcrumbs} responsive={false} truncate={false} /> | ||
<EuiSpacer size="xs" /> | ||
|
||
<EuiPageContentHeader> | ||
<EuiPageContentHeaderSection> | ||
<EuiTitle size="l"> | ||
<h1>Boa constrictor</h1> | ||
</EuiTitle> | ||
</EuiPageContentHeaderSection> | ||
|
||
<EuiPageContentHeaderSection> | ||
<EuiButton>Cancel</EuiButton> | ||
</EuiPageContentHeaderSection> | ||
</EuiPageContentHeader> | ||
</Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import React from 'react'; | ||
|
||
import { renderToHtml } from '../../services'; | ||
|
||
import { | ||
GuideSectionTypes, | ||
} from '../../components'; | ||
|
||
import { | ||
EuiCode, | ||
EuiBreadcrumbs, | ||
} from '../../../../src/components'; | ||
|
||
import Breadcrumbs from './breadcrumbs'; | ||
const breadcrumbsSource = require('!!raw-loader!./breadcrumbs'); | ||
const breadcrumbsHtml = renderToHtml(Breadcrumbs); | ||
|
||
import Responsive from './responsive'; | ||
const responsiveSource = require('!!raw-loader!./responsive'); | ||
const responsiveHtml = renderToHtml(Responsive); | ||
|
||
import Truncate from './truncate'; | ||
const truncateSource = require('!!raw-loader!./truncate'); | ||
const truncateHtml = renderToHtml(Truncate); | ||
|
||
import Max from './max'; | ||
const maxSource = require('!!raw-loader!./max'); | ||
const maxHtml = renderToHtml(Max); | ||
|
||
export const BreadcrumbsExample = { | ||
title: 'Breadcrumbs', | ||
sections: [{ | ||
source: [{ | ||
type: GuideSectionTypes.JS, | ||
code: breadcrumbsSource, | ||
}, { | ||
type: GuideSectionTypes.HTML, | ||
code: breadcrumbsHtml, | ||
}], | ||
text: ( | ||
<p> | ||
<EuiCode>EuiBreadcrumbs</EuiCode> let the user track their progress within and back out of | ||
a UX flow. They work well within <EuiCode>EuiPageContentHeader</EuiCode> but be careful | ||
not to be use them within an app that also uses <EuiCode>EuiHeaderBreadcrumbs</EuiCode>. | ||
</p> | ||
), | ||
props: { EuiBreadcrumbs }, | ||
demo: <Breadcrumbs />, | ||
}, { | ||
title: 'Responsive', | ||
source: [{ | ||
type: GuideSectionTypes.JS, | ||
code: responsiveSource, | ||
}, { | ||
type: GuideSectionTypes.HTML, | ||
code: responsiveHtml, | ||
}], | ||
text: ( | ||
<p> | ||
The <EuiCode>responsive</EuiCode> prop will hide breadcrumbs on narrower screens. | ||
</p> | ||
), | ||
props: { EuiBreadcrumbs }, | ||
demo: <Responsive />, | ||
}, { | ||
title: 'Truncate each breadcrumb', | ||
source: [{ | ||
type: GuideSectionTypes.JS, | ||
code: truncateSource, | ||
}, { | ||
type: GuideSectionTypes.HTML, | ||
code: truncateHtml, | ||
}], | ||
text: ( | ||
<p> | ||
The <EuiCode>truncate</EuiCode> prop will truncate breadcrumbs which are too long. | ||
</p> | ||
), | ||
props: { EuiBreadcrumbs }, | ||
demo: <Truncate />, | ||
}, { | ||
title: 'Limit the number of breadcrumbs', | ||
source: [{ | ||
type: GuideSectionTypes.JS, | ||
code: maxSource, | ||
}, { | ||
type: GuideSectionTypes.HTML, | ||
code: maxHtml, | ||
}], | ||
text: ( | ||
<p> | ||
Use the <EuiCode>max</EuiCode> prop to cull breadcrumbs beyond a certain number. By default, | ||
this number is 5. | ||
</p> | ||
), | ||
props: { EuiBreadcrumbs }, | ||
demo: <Max />, | ||
}], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiBreadcrumbs, | ||
} from '../../../../src/components'; | ||
|
||
export default () => { | ||
const breadcrumbs = [{ | ||
text: 'Animals', | ||
href: '#', | ||
}, { | ||
text: 'Metazoans', | ||
href: '#', | ||
}, { | ||
text: 'Chordates', | ||
href: '#', | ||
}, { | ||
text: 'Vertebrates', | ||
href: '#', | ||
}, { | ||
text: 'Tetrapods', | ||
href: '#', | ||
}, { | ||
text: 'Reptiles', | ||
href: '#', | ||
}, { | ||
text: 'Boa constrictor', | ||
href: '#', | ||
}, { | ||
text: 'Nebulosa subspecies', | ||
}]; | ||
|
||
return <EuiBreadcrumbs breadcrumbs={breadcrumbs} responsive={false} truncate={false} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiBreadcrumbs, | ||
} from '../../../../src/components'; | ||
|
||
export default () => { | ||
const breadcrumbs = [{ | ||
text: 'Animals', | ||
href: '#', | ||
}, { | ||
text: 'Metazoans', | ||
href: '#', | ||
}, { | ||
text: 'Chordates', | ||
href: '#', | ||
}, { | ||
text: 'Vertebrates', | ||
href: '#', | ||
}, { | ||
text: 'Tetrapods', | ||
href: '#', | ||
}, { | ||
text: 'Reptiles', | ||
href: '#', | ||
}, { | ||
text: 'Boa constrictor', | ||
href: '#', | ||
}, { | ||
text: 'Nebulosa subspecies', | ||
}]; | ||
|
||
return <EuiBreadcrumbs breadcrumbs={breadcrumbs} max={null} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiBreadcrumbs, | ||
} from '../../../../src/components'; | ||
|
||
export default () => { | ||
const breadcrumbs = [{ | ||
text: 'Animals', | ||
href: '#', | ||
}, { | ||
text: 'Metazoans is a real mouthful, especially for creatures without mouths', | ||
href: '#', | ||
}, { | ||
text: 'Nebulosa subspecies', | ||
}]; | ||
|
||
return <EuiBreadcrumbs breadcrumbs={breadcrumbs} />; | ||
}; |
Oops, something went wrong.