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 EuiIcon #5967

Merged
merged 30 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6d02f3e
Attempt to convert EuiIcon class comp to functional comp
miukimiu Jun 14, 2022
f9337d2
Merge remote-tracking branch 'upstream/main' into emotion-icon
miukimiu Jun 16, 2022
236007d
Reverting to class comp. Better styles. Deleting sass icon files.
miukimiu Jun 17, 2022
f32b33b
Merge remote-tracking branch 'upstream/main' into emotion-icon
miukimiu Jun 17, 2022
0801a19
Adding css class name in use
miukimiu Jun 17, 2022
0fa667b
Update test
miukimiu Jun 17, 2022
09cbbbe
Removing sass-lint important comments
miukimiu Jun 20, 2022
571039d
Adding shouldRenderCustomStyles
miukimiu Jun 20, 2022
d47ccba
Fix/imporve appendIconComponentCache tests
cee-chen Jun 20, 2022
412aed9
Showing props table
miukimiu Jun 20, 2022
8b18907
Renaming icon map and better `named_colors` types
miukimiu Jun 21, 2022
d54c4fc
Fix playground
miukimiu Jun 21, 2022
5482bb1
Removing `console.log({ docgenInfo });`
miukimiu Jun 21, 2022
21fdcb1
Passing custom color to Emotion
miukimiu Jun 21, 2022
8ab9593
Removing background color on `focus`
miukimiu Jun 21, 2022
bf9e5e9
Merge branch 'main' into emotion-icon
cee-chen Jun 27, 2022
94003fe
Remove need for IconProps docs workaround
cee-chen Jun 27, 2022
c398c4a
[PR feedback] Clean up ghost/text selectors as well as Elastic-logo s…
cee-chen Jun 27, 2022
59ccf7a
[PR feedback] comment cleanup
cee-chen Jun 27, 2022
dd53f03
[PR feedback] Export simplification
cee-chen Jun 27, 2022
c4861d0
Merge remote-tracking branch 'upstream/main' into emotion-icon
miukimiu Jun 28, 2022
3b57233
Re-adding custom colors as `style`
miukimiu Jun 28, 2022
509b890
Renamed `euiIconSizes` to `euiFormControlIconSizes` and moved to form…
miukimiu Jun 28, 2022
591acab
Removing underscore from functions and variables
miukimiu Jun 28, 2022
193d9e3
Removing unused `.euiIcon:focus` styles. Adding comments.
miukimiu Jun 28, 2022
ae58c9d
Adding `data-is-loaded` and `data-is-loading` attributes
miukimiu Jun 28, 2022
f07dd2c
Update upcoming_changelogs/5967.md
miukimiu Jun 28, 2022
8ed6ece
Update src/components/icon/icon.tsx
miukimiu Jun 28, 2022
2fcd282
Adding `customColor` to show in className
miukimiu Jun 28, 2022
2466cba
Fixing path in `creating-icons` wiki
miukimiu Jun 28, 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
4 changes: 3 additions & 1 deletion src-docs/src/views/icon/icon_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
EuiSpacer,
} from '../../../../src/components';

import { IconProps } from './props';

import iconConfig from './playground';

import Icons from './icons';
Expand Down Expand Up @@ -48,7 +50,7 @@ export const IconExample = {
</p>
),
demo: <EuiIcon type="grid" />,
props: { EuiIcon },
props: { EuiIcon: IconProps },
cee-chen marked this conversation as resolved.
Show resolved Hide resolved
playground: iconConfig,
},
{
Expand Down
11 changes: 7 additions & 4 deletions src-docs/src/views/icon/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import {
iconValidator,
} from '../../services/playground';
import { EuiIcon } from '../../../../src/components/';
import { IconProps } from './props';

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

console.log({ docgenInfo });
const propsToUse = propUtilityForPlayground(docgenInfo.props, true);

propsToUse.type = iconValidator({ ...propsToUse.type }, 'grid');

Expand Down
5 changes: 5 additions & 0 deletions src-docs/src/views/icon/props.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React, { FunctionComponent } from 'react';

import { EuiIconProps } from '../../../../src/components/icon';

export const IconProps: FunctionComponent<EuiIconProps> = () => <div />;
2 changes: 1 addition & 1 deletion src/components/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export type EuiBadgeProps = {
/**
* Props passed to the close button.
*/
closeButtonProps?: Partial<PropsOf<EuiIcon>>;
closeButtonProps?: Partial<PropsOf<typeof EuiIcon>>;
} & CommonProps &
ExclusiveUnion<WithIconOnClick, {}> &
ExclusiveUnion<
Expand Down
Loading