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

[Emotion] Convert EuiDescriptionList #5971

Merged
merged 66 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
79da367
inital commit in EuiDescriptionList Emotion conversion
breehall Jun 8, 2022
b8ed043
Merge branch 'main' of https://github.com/breehall/eui into emotion/d…
breehall Jun 8, 2022
8578777
Update description_list.styles.ts with the row and responsive column …
breehall Jun 8, 2022
f117767
Converted the remaining styles for DescriptionList to Emotion. Conver…
breehall Jun 14, 2022
b0d7ced
Merge branch 'main' of https://github.com/breehall/eui into emotion/d…
breehall Jun 15, 2022
374be59
Updated DescriptionList tests and added Changlelog entry
breehall Jun 16, 2022
aabedbe
Removed original Sass file for DescriptionList and removed console s…
breehall Jun 20, 2022
9e5d1e6
CHANGELOG
breehall Jun 20, 2022
94cca23
Resolved bug in descriptionlist column styling that caused list eleme…
breehall Jun 20, 2022
6bceb4c
Merge branch 'main' of https://github.com/breehall/eui into emotion/d…
breehall Jun 20, 2022
2508142
Changelog update
breehall Jun 20, 2022
58d6928
Update snapshots for DescriptionList
breehall Jun 20, 2022
d1a55ca
Fixed duplicate class keys
Jun 27, 2022
2bb8bba
WIP: Moving styles to EuiDescriptionListTitle
Jun 27, 2022
ea4b179
Cleaner logic and styles with shared functions
Jun 27, 2022
d528633
Restructure styles in DescriptionList-Description
breehall Jun 27, 2022
02cac83
Even better logic and shared styles
Jun 27, 2022
16b08da
Merge branch 'emotion/description-list' of github.com:breehall/eui in…
Jun 27, 2022
2a7361f
Restructured DescriptionList Description Emotion styling
breehall Jun 28, 2022
1469945
Clean up description_list.styles.ts and update the Emotion styling to…
breehall Jun 28, 2022
b9bb25a
Added playground and fixed `align` requirement
Jun 28, 2022
2429fba
Fixed all the style combinations
Jun 28, 2022
84d13a2
Split up the column example into two sections
Jun 28, 2022
94e9ee3
Moved DescriptionList types from DescriptionList.tsx to a separate ty…
breehall Jul 5, 2022
a1cec5d
Added more test cases for DescriptionListTitle and DescriptionListDes…
breehall Jul 5, 2022
2db59ac
Broke up the DesciprtionList base example into two parts to highlight…
breehall Jul 6, 2022
cc565ea
Udpated the euiBreakpoint function to use the EuiTheme to capture bre…
breehall Jul 6, 2022
2768a8b
Changelog
breehall Jul 6, 2022
601cb1c
Documentation example updates from PR comments
breehall Jul 11, 2022
d1fc049
Documentation example updates from PR comments
breehall Jul 11, 2022
1f5e916
Clean up toClassNameMap arrays by removing the functions for type, al…
breehall Jul 11, 2022
7ace762
Update src/components/description_list/description_list.styles.ts
breehall Jul 11, 2022
42fdbd0
Update src/components/description_list/description_list_description.s…
breehall Jul 11, 2022
5efdcde
Update src/components/description_list/description_list_context.tsx
breehall Jul 11, 2022
0ca2038
Update src/components/description_list/description_list_description.s…
breehall Jul 11, 2022
7eba22f
Updated text-align CSS styles to use the logicalTextAlignCSS function
breehall Jul 11, 2022
3617866
Removed EuiDescriptionListContextProvider component in lieu of using …
breehall Jul 11, 2022
54da198
Update src/components/description_list/description_list.tsx
breehall Jul 11, 2022
8b68082
Merge branch 'emotion/description-list' of https://github.com/breehal…
breehall Jul 11, 2022
f54dea1
Update src/components/description_list/description_list.styles.ts
breehall Jul 11, 2022
a70824d
Merge branch 'emotion/description-list' of https://github.com/breehal…
breehall Jul 11, 2022
7ec0f83
Simplified the style files for DescriptionList, Title, and Descriptio…
breehall Jul 12, 2022
94e047e
Updated euiBreakPoint mixin by resolving a bug that caused media quer…
breehall Jul 12, 2022
a9c6ea4
Added tests for _responsive.ts
breehall Jul 12, 2022
9cbdf3c
Code clean up. Changelog update. Snapshot updates
breehall Jul 13, 2022
53bb4c5
Merge branch 'main' of https://github.com/breehall/eui into emotion/d…
breehall Jul 21, 2022
5d2229f
Resolve merge conflict in _responsive.ts files
breehall Jul 21, 2022
a68229d
Clean up
breehall Jul 21, 2022
d8ce0bc
CHANGELOG update
breehall Jul 21, 2022
050c71a
Remove data-type attribute from child EuiDescriptionListTitle and Eui…
breehall Jul 26, 2022
ec80197
Update src/components/description_list/description_list_description.s…
breehall Jul 26, 2022
628c0f5
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
6a46bb2
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
c88604c
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
4de25a2
Update src/components/description_list/description_list_description.s…
breehall Jul 26, 2022
e4e0b58
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
773fe6a
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
5e88e0d
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
c296617
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 26, 2022
dd57a4b
Removed classNames for the type, align, textStyle, and compressed pro…
breehall Jul 26, 2022
dfe232e
Merge branch 'main' of https://github.com/breehall/eui into emotion/d…
breehall Jul 26, 2022
d82ebf2
Merge branch 'emotion/description-list' of https://github.com/breehal…
breehall Jul 26, 2022
f1f73d6
Updated parameters of euiBreakpoint to match the latest iteration of …
breehall Jul 26, 2022
1b792ea
Update src/components/description_list/description_list_title.styles.ts
breehall Jul 27, 2022
d4ee78b
Update required EuiDescriptionList child test cases
breehall Jul 27, 2022
d7858c4
[PR feedback] DRY out context defaults in text
cee-chen Jul 27, 2022
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
30 changes: 3 additions & 27 deletions src-docs/src/views/description_list/description_list.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import React from 'react';

import {
EuiDescriptionList,
EuiFlexItem,
EuiFlexGroup,
EuiDescriptionListTitle,
EuiDescriptionListDescription,
} from '../../../../src/components';
import { EuiDescriptionList } from '../../../../src/components';

const favoriteVideoGames = [
{
Expand All @@ -16,29 +10,11 @@ const favoriteVideoGames = [
{
title: 'TIE Fighter',
description:
'The sequel to XWING, join the dark side and fly for the Emporer.',
'The sequel to XWING, join the dark side and fly for the Emperor.',
},
{
title: 'Quake 2',
description: 'The game that made me drop out of college.',
},
];
export default () => (
<EuiFlexGroup>
<EuiFlexItem>
<EuiDescriptionList listItems={favoriteVideoGames} />
</EuiFlexItem>
<EuiFlexItem>
<EuiDescriptionList>
<EuiDescriptionListTitle>Dota 2</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
A videogame that I have spent way too much time on over the years.
</EuiDescriptionListDescription>
<EuiDescriptionListTitle>Kings Quest VI</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The game that forced me to learn DOS.
</EuiDescriptionListDescription>
</EuiDescriptionList>
</EuiFlexItem>
</EuiFlexGroup>
);
export default () => <EuiDescriptionList listItems={favoriteVideoGames} />;
36 changes: 7 additions & 29 deletions src-docs/src/views/description_list/description_list_column.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React, { Fragment } from 'react';
import React from 'react';

import {
EuiDescriptionList,
EuiSpacer,
EuiTitle,
} from '../../../../src/components';
import { EuiDescriptionList } from '../../../../src/components';

const favoriteVideoGames = [
{
Expand All @@ -22,27 +18,9 @@ const favoriteVideoGames = [
},
];
export default () => (
<Fragment>
<EuiDescriptionList
type="column"
listItems={favoriteVideoGames}
style={{ maxWidth: '400px' }}
/>

<EuiSpacer size="xl" />

<EuiTitle size="s">
<h3>
The following list will become the typical row format on small screens
</h3>
</EuiTitle>

<EuiSpacer />

<EuiDescriptionList
type="responsiveColumn"
listItems={favoriteVideoGames}
style={{ maxWidth: '400px' }}
/>
</Fragment>
<EuiDescriptionList
type="column"
listItems={favoriteVideoGames}
style={{ maxWidth: '400px' }}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';

import { EuiDescriptionList } from '../../../../src/components';

const favoriteVideoGames = [
{
title: 'The Elder Scrolls: Morrowind',
description: 'The opening music alone evokes such strong memories.',
},
{
title: 'TIE Fighter',
description:
'The sequel to XWING, join the dark side and fly for the Emporer.',
},
{
title: 'Quake 2',
description: 'The game that made me drop out of college.',
},
];
export default () => (
<EuiDescriptionList
type="responsiveColumn"
listItems={favoriteVideoGames}
style={{ maxWidth: '400px' }}
/>
);
84 changes: 69 additions & 15 deletions src-docs/src/views/description_list/description_list_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
EuiDescriptionListDescription,
} from '../../../../src/components';

import { descriptionListConfig } from './playground';

import DescriptionList from './description_list';
const descriptionListSource = require('!!raw-loader!./description_list');
const descriptionListSnippet = [
Expand All @@ -20,26 +22,42 @@ const descriptionListSnippet = [
},
]}
/>`,
];

import DescriptionListSeparate from './description_list_separate';
const descriptionListSeparateSource = require('!!raw-loader!./description_list_separate');
const descriptionListSeparateSnippet = [
`<EuiDescriptionList>
<EuiDescriptionListTitle>Dota 2</EuiDescriptionListTitle>
<EuiDescriptionListTitle>
The Elder Scrolls: Morrowind
</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
A videogame that I have spent way too much time on over the years.
The opening music alone evokes such strong memories.
</EuiDescriptionListDescription>
<EuiDescriptionListTitle>TIE Fighter</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The sequel to XWING, join the dark side and fly for the Emperor.
</EuiDescriptionListDescription>
<EuiDescriptionListTitle>Quake 2</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The game that made me drop out of college.
</EuiDescriptionListDescription>
</EuiDescriptionList>`,
];

import DescriptionListColumn from './description_list_column';
const descriptionListColumnSource = require('!!raw-loader!./description_list_column');
const descriptionListColumnSnippet = [
`<EuiDescriptionList
const descriptionListColumnSnippet = `<EuiDescriptionList
type="column"
listItems={favoriteVideoGames}
/>`,
`<EuiDescriptionList
/>`;

import DescriptionListResponsiveColumn from './description_list_column_responsive';
const descriptionListResponsiveColumnSource = require('!!raw-loader!./description_list_column_responsive');
const descriptionListResponsiveColumnSnippet = `<EuiDescriptionList
type="responsiveColumn"
listItems={favoriteVideoGames}
/>`,
];
/>`;

import DescriptionListStyling from './description_list_styling';
const descriptionListStylingSource = require('!!raw-loader!./description_list_styling');
Expand Down Expand Up @@ -93,10 +111,7 @@ export const DescriptionListExample = {
<p>
<strong>EuiDescriptionList</strong> is a component for listing pairs
of information together. You can use the component on its own, passing
in an object for the list, or use the{' '}
<strong>EuiDescriptionListTitle</strong> and{' '}
<strong>EuiDescriptionListDescription</strong> components separately
to build a list manually.
in an object for the list.
</p>
),
props: {
Expand All @@ -106,6 +121,30 @@ export const DescriptionListExample = {
},
snippet: descriptionListSnippet,
demo: <DescriptionList />,
playground: descriptionListConfig,
},
{
source: [
{
type: GuideSectionTypes.JS,
code: descriptionListSeparateSource,
},
],
text: (
<p>
You can also use the <strong>EuiDescriptionListTitle</strong> and{' '}
<strong>EuiDescriptionListDescription</strong> components separately
to build a list manually.
</p>
),
props: {
EuiDescriptionList,
EuiDescriptionListTitle,
EuiDescriptionListDescription,
},
snippet: descriptionListSeparateSnippet,
demo: <DescriptionListSeparate />,
playground: descriptionListConfig,
},
{
title: 'Reverse style',
Expand Down Expand Up @@ -148,14 +187,29 @@ export const DescriptionListExample = {
<EuiCode>column</EuiCode> description lists can be presented in an
inline, column format.
</p>
</Fragment>
),
snippet: descriptionListColumnSnippet,
demo: <DescriptionListColumn />,
},
{
source: [
{
type: GuideSectionTypes.JS,
code: descriptionListResponsiveColumnSource,
},
],
text: (
<Fragment>
<p>
To return to the typical row format on smaller screens set{' '}
<EuiCode>type</EuiCode> to <EuiCode>responsiveColumn</EuiCode>.
<EuiCode>type</EuiCode> to <EuiCode>responsiveColumn</EuiCode>. The
following list will only show the column format on larger screens.
</p>
</Fragment>
),
snippet: descriptionListColumnSnippet,
demo: <DescriptionListColumn />,
snippet: descriptionListResponsiveColumnSnippet,
demo: <DescriptionListResponsiveColumn />,
},
{
title: 'Inline',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';

import {
EuiDescriptionList,
EuiDescriptionListTitle,
EuiDescriptionListDescription,
} from '../../../../src/components';

export default () => (
<EuiDescriptionList>
<EuiDescriptionListTitle>
The Elder Scrolls: Morrowind
</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The opening music alone evokes such strong memories.
</EuiDescriptionListDescription>
<EuiDescriptionListTitle>TIE Fighter</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The sequel to XWING, join the dark side and fly for the Emperor.
</EuiDescriptionListDescription>
<EuiDescriptionListTitle>Quake 2</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
The game that made me drop out of college.
</EuiDescriptionListDescription>
</EuiDescriptionList>
);
46 changes: 46 additions & 0 deletions src-docs/src/views/description_list/playground.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { EuiDescriptionList } from '../../../../src/components';
import {
propUtilityForPlayground,
generateCustomProps,
} from '../../services/playground';

export const descriptionListConfig = () => {
const docgenInfo = Array.isArray(EuiDescriptionList.__docgenInfo)
? EuiDescriptionList.__docgenInfo[0]
: EuiDescriptionList.__docgenInfo;
const propsToUse = propUtilityForPlayground(docgenInfo.props);

const listItems = `[
{
title: 'The Elder Scrolls: Morrowind',
description: 'The opening music alone evokes such strong memories.',
},
{
title: 'TIE Fighter',
description:
'The sequel to XWING, join the dark side and fly for the Emporer.',
},
]`;
propsToUse.listItems = {
...propsToUse.listItems,
value: listItems,
};

return {
config: {
componentName: 'EuiSuggest',
props: propsToUse,
scope: {
EuiSuggest: EuiDescriptionList,
},
imports: {
'@elastic/eui': {
named: ['EuiDescriptionList'],
},
},
customProps: {
...generateCustomProps(['listItems']),
},
},
};
};
Loading