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

🎉 Documentation Section Examples Redesign #4449

Merged
merged 87 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
94032a0
Moving docs tabs to bottom of example and always showing demo
Jan 23, 2021
e77335f
Quick addition of playground example and props table into exisitng gu…
Jan 23, 2021
ef5e8ba
Moving some logic to Knobs
Jan 24, 2021
9ca76f3
Added a couple renderers
Jan 24, 2021
f1363f9
Created a shared GuideSectionExample component for the example panel …
Jan 24, 2021
15dd396
Some cleanup of layout and button props
Jan 24, 2021
71c462c
More cleanup
Jan 24, 2021
aee6a11
Converting the CSS Utility page to the new design
Jan 25, 2021
52ce290
Moving a few more playgrounds and some fixes to the compiler display
Jan 25, 2021
ac510c3
Moved Facet playground
Jan 25, 2021
b7e1672
Moving default to badge
Jan 25, 2021
9fcf8c7
More button group sections
Jan 25, 2021
3e2b98a
Moving a title out of a button group example
Jan 25, 2021
021e001
Adding `EuiSplitPanel` (using render props… meh)
Feb 2, 2021
ce36dd3
Fix function reference
Feb 5, 2021
60d7db6
Merge remote-tracking branch 'upstream/master' into move-playground
Feb 5, 2021
cbcf2d1
Changing the split panel behavior
Feb 6, 2021
873decb
Updated guidelines examples to use split panel
Feb 6, 2021
563305d
Fixing up form guidelines page
Feb 6, 2021
6959e2f
Fix up panels for default theme
Feb 6, 2021
3372974
Cleaned up button guidelines
Feb 6, 2021
8ccfe80
Moving form control playgrounds
Feb 6, 2021
753715d
Nw docs layout
Feb 6, 2021
5ad7928
Cleanup
Feb 6, 2021
a159ae1
Updating homepage blockforms
Feb 7, 2021
31fa72b
Cleanup homepage
Feb 7, 2021
0c85290
Som more cleanup and fixing of mobile styles
Feb 7, 2021
b15d8d4
Fix page layout
Feb 8, 2021
b727561
Fix locale selector
Feb 8, 2021
4a8a4fe
Fixed theme selector
Feb 8, 2021
7091b99
Working on code tabs again
Feb 8, 2021
03202b8
Fix autoscrolls
Feb 8, 2021
7a210e3
Merge remote-tracking branch 'upstream/master' into move-playground
Feb 10, 2021
4c7b46b
Fixing overflows and in turn stickies
Feb 10, 2021
976ad01
Move babelfish and fix overflowing page content (again)
Feb 11, 2021
5e96c8f
Revert "Working on code tabs again"
Feb 11, 2021
8a605e6
Merge remote-tracking branch 'upstream/master' into move-playground
Feb 11, 2021
88ed33d
Some cleanup of spacing and fixing console errors
Feb 11, 2021
b9265e7
Adding animation with hover effect
elizabetdev Feb 25, 2021
1535a9e
Illustration dots color
elizabetdev Feb 25, 2021
3aba2b3
Merge remote-tracking branch upstream/master into move-playground
Feb 27, 2021
a1a78c0
Fixing conflicts
Feb 27, 2021
ac2cbe2
Increasing starting contrast on colors page
Feb 27, 2021
6b3a113
moved example text to own component
Feb 28, 2021
7251e73
moved example text to own component
Feb 28, 2021
b4f371e
moved example text to own component
Feb 28, 2021
72ae53e
Removing `extraContent` and fixing datagrid example page
Mar 1, 2021
28f14a6
WIP Breaking apart guide_section
Mar 1, 2021
f072734
Added `slugify` to string services
Mar 1, 2021
f06ccbf
Fixing some types and Codesandbox link
Mar 1, 2021
4a4c18e
Cleaning up more types
Mar 1, 2021
dadfdab
Converted guide_section to function component
Mar 2, 2021
6c9df03
Trying to fix HTML and cleaning up some visuals
Mar 2, 2021
8c5a516
Created GuideSectionPropsDescription
Mar 2, 2021
46deb81
Created GuideSectionPropsDescription
Mar 2, 2021
8f3fa62
Changed version badge to accent if local dev
Mar 2, 2021
eeecc0b
Merge remote-tracking branch 'upstream/master' into move-playground
Mar 6, 2021
6093300
Fixing keys in guide section and fixing page header content spacing i…
Mar 6, 2021
16a0ab5
Fixing GuideSectionTypes and GuideSection export errors. and unexpect…
elizabetdev Mar 7, 2021
9c60ea6
Fixing snapshot
elizabetdev Mar 7, 2021
6f1b147
Trying out adding more props to the demo panel
Mar 7, 2021
c5c1344
Adding getting started
elizabetdev Mar 9, 2021
74766c9
Merge branch 'move-playground' of https://github.com/cchaos/eui into …
elizabetdev Mar 9, 2021
9f29432
Adding more getting started MD files
elizabetdev Mar 9, 2021
2561836
Merge remote-tracking branch 'upstream/master' into move-playground
elizabetdev Mar 9, 2021
8e5b011
Updating README.me to point to getting started MD files
elizabetdev Mar 9, 2021
b1fac74
Fixing guidelines pages
elizabetdev Mar 9, 2021
3ac208e
Merge remote-tracking branch 'upstream/master' into move-playground
Mar 10, 2021
f987e63
Removing HTML tab and fixing some panel/card styles
Mar 10, 2021
d78b4b5
Injecting IDs into h2s and creating sections to allow having nav link…
elizabetdev Mar 10, 2021
65e9c88
Merge branch 'move-playground' of https://github.com/cchaos/eui into …
elizabetdev Mar 10, 2021
32168d4
Updating homepage getting started link
elizabetdev Mar 10, 2021
446950b
Added license link to bottom of home page
Mar 10, 2021
41e3a2c
Fix illustration color
Mar 10, 2021
aab3e32
Revert EuiCard portion of “Removing HTML tab and fixing some panel/ca…
Mar 10, 2021
332e4a4
Merge remote-tracking branch 'upstream/master' into move-playground
Mar 11, 2021
cdef674
Fixing a11y test on CSS utility classes and fixing focus indicators o…
Mar 11, 2021
b69e740
Better overflow fixes
Mar 11, 2021
36c5f0e
Fixing a bit more markdown
Mar 11, 2021
b47e5d3
Fixing some button examples
Mar 11, 2021
3cc6da3
Fix `br`s in types code
Mar 11, 2021
6710021
Cleaning up
Mar 11, 2021
9c23646
Commenting out getting started section
elizabetdev Mar 11, 2021
b041944
Reverting homepage getting started link
elizabetdev Mar 11, 2021
ade4397
Moved default to it’s own column again and merged with playground toggle
Mar 13, 2021
a9cdfb5
Fixes
Mar 15, 2021
c2cfa93
Update src-docs/src/components/guide_section/guide_section.tsx
cchaos Mar 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ directly in the code. And unit test coverage for the UI components allows us to
### Consumption

* [Consuming EUI][consuming]
* [Using EUI with react-router](wiki/react-router.md)
* [Using EUI with react-router](react-router)

### Maintenance / Contributing

Expand All @@ -88,5 +88,6 @@ directly in the code. And unit test coverage for the UI components allows us to

[license]: LICENSE
[faq]: FAQ.md
[consuming]: wiki/consuming.md
[consuming]: src-docs/src/views/getting_started/consuming.md
[react-router]: wiki/react-router.md
[docs]: https://elastic.github.io/eui/
132 changes: 122 additions & 10 deletions src-docs/src/components/guide_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,7 @@ $guideZLevelHighest: $euiZLevel9 + 1000;

.guideDemo__ghostBackground {
@if (lightness($euiTextColor) < 50) {
background: $euiColorDarkestShade;
}
}

.guideDemo__icon {
text-align: center;

svg,
img {
margin-bottom: $euiSizeS;
background: $euiColorDarkestShade !important; // Override EuiPanel specificity
}
}

Expand Down Expand Up @@ -285,3 +276,124 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
flex-basis: 22% !important; // sass-lint:disable-line no-important
}
}

.guideHomePage__illustrationLightShade {
fill: $euiColorLightShade;
}

.guideHomePage__illustrationEmptyShade {
fill: $euiColorEmptyShade;
}

.guideHomePage__illustrationDots,
.guideHomePage__illustrationComponents {
position: absolute;
top: 0;
right: 0;
}

.guideHomePage__illustrationEffect {
display: block;
height: auto;
position: relative;
width: auto;

.guideHomePage__illustrationEffectParts {
height: auto;
transform: perspective(1600px);
transform-style: preserve-3d;
transition: all .3s ease-in-out;
width: 100%;

&:before {
content: '';
display: block;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}

.guideHomePage__illustrationEffectPartsDots,
.guideHomePage__illustrationEffectPartsComps {
position: absolute;
left: 0;
top: 0;
transform: translateZ(16px) scale(.9);
transition: all .4s ease;
width: 100%;
height: 100%;
z-index: 1;
}

.guideHomePage__illustrationTopLeftCorner {
height: 50%;
left: 0;
position: absolute;
top: 0;
width: 50%;
z-index: 300;

&:hover ~ .guideHomePage__illustrationEffectParts {
transform: perspective(1600px) rotateX(-5deg) rotateY(5deg);

.guideHomePage__illustrationEffectPartsDots {
transform: translate3d(-.1px, -.1px, 16px) scale(.9);
}
}
}

.guideHomePage__illustrationTopRightCorner {
height: 50%;
position: absolute;
right: 0;
top: 0;
width: 50%;
z-index: 300;

&:hover ~ .guideHomePage__illustrationEffectParts {
transform: perspective(1600px) rotateX(-5deg) rotateY(-5deg);

.guideHomePage__illustrationEffectPartsDots {
transform: translate3d(.1px, -.1px, 16px) scale(.9);
}
}
}

.guideHomePage__illustrationBottomLeftCorner {
bottom: 0;
height: 50%;
left: 0;
position: absolute;
width: 50%;
z-index: 300;

&:hover ~ .guideHomePage__illustrationEffectParts {
transform: perspective(1600px) rotateX(5deg) rotateY(5deg);

.guideHomePage__illustrationEffectPartsDots {
transform: translate3d(-.1px, .1px, 1px) scale(.9);
}
}
}

.guideHomePage__illustrationBottomRightCorner {
bottom: 0;
height: 50%;
position: absolute;
right: 0;
width: 50%;
z-index: 300;

&:hover ~ .guideHomePage__illustrationEffectParts {
transform: perspective(1600px) rotateX(5deg) rotateY(-5deg);


.guideHomePage__illustrationEffectPartsDots {
transform: translate3d(.1px, .1px, 1px) scale(.9);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { FunctionComponent } from 'react';
import {
EuiMarkdownFormat,
getDefaultEuiMarkdownProcessingPlugins,
} from '../../../../src/components/markdown_editor';
import { EuiText } from '../../../../src/components/text';
import { EuiTitle } from '../../../../src/components/title';
import { slugify } from '../../../../src/services';

export type GuideMarkdownFormatProps = {
children: any;
};

export const GuideMarkdownFormat: FunctionComponent<GuideMarkdownFormatProps> = ({
children,
}) => {
const processingPlugins = getDefaultEuiMarkdownProcessingPlugins();
const rehype2reactConfig = processingPlugins[1][1];

rehype2reactConfig.components.h2 = ({ children }) => {
const id = slugify(children[0]);

return (
<EuiTitle>
<h2 id={id}>{children}</h2>
</EuiTitle>
);
};

rehype2reactConfig.components.p = ({ children }) => (
<EuiText grow={false}>{children}</EuiText>
);

return (
<EuiMarkdownFormat processingPluginList={processingPlugins}>
{children}
</EuiMarkdownFormat>
);
};
1 change: 1 addition & 0 deletions src-docs/src/components/guide_markdown_format/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { GuideMarkdownFormat } from './guide_markdown_format';
23 changes: 14 additions & 9 deletions src-docs/src/components/guide_page/guide_page_header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
);
}

function renderVersion() {
const isLocalDev = window.location.host.includes('803');

return (
<EuiBadge
href="#/package/changelog"
aria-label={`Version ${pkg.version}, View changelog`}
color={isLocalDev ? 'accent' : 'default'}>
{isLocalDev ? 'Local' : `v.${pkg.version}`}
</EuiBadge>
);
}

function renderGithub() {
const href = 'https://github.com/elastic/eui';
const label = 'EUI GitHub repo';
Expand Down Expand Up @@ -131,15 +144,7 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
theme="dark"
sections={[
{
items: [
renderLogo(),
<EuiBadge
href="#/package/changelog"
aria-label={`Version ${pkg.version}, View changelog`}
color="default">
v.{pkg.version}
</EuiBadge>,
],
items: [renderLogo(), renderVersion()],
borders: 'none',
},
{
Expand Down
60 changes: 13 additions & 47 deletions src-docs/src/components/guide_rule/_guide_rule_example.scss
Original file line number Diff line number Diff line change
@@ -1,58 +1,24 @@
/**
* 1. Ensure that the borders of the captions line up across the whole example row
* 1b. even if the caption spans multiple lines
*/

.guideRule__example {
.guideRule__example__panel {
border-bottom: 2px solid;
margin-bottom: $euiSizeS;
flex-grow: 1; /* 1 */

&:not(.euiPanel) {
padding-bottom: $euiSize; // only change the bottom padding if it's not an euiPanel
}
}

pre {
margin-bottom: 0;
padding: 0;
}

.guideRule__caption {
@include euiFontSizeS;
max-height: $euiFontSizeS * $euiLineHeight; /* 1 */
overflow-y: visible; /* 1 */
}

// Coloring
&.guideRule__example--do {
.guideRule__example__panel {
border-bottom-color: $euiColorSuccess;
}

.guideRule__caption {
color: $euiColorSuccessText;
&--flex {
display: flex;
align-items: center;
justify-content: space-around;
}
}
}

&.guideRule__example--dont {
.guideRule__example__panel {
border-bottom-color: $euiColorDanger;
}

.guideRule__caption {
color: $euiColorDanger;
}
.guideRule__example--do {
.guideRule__example__panel {
border-bottom-color: $euiColorSuccess;
}
}

&.guideRule__example--frame {
.guideRule__example__panel {
padding: $euiSizeL;
background-color: $euiColorLightestShade;
display: flex;
align-items: center;
justify-content: space-around;
}
.guideRule__example--dont {
.guideRule__example__panel {
border-bottom-color: $euiColorDanger;
}
}

Loading