Skip to content

[EuiProgress] Include more names in EuiProgress's colorToClassNameMap #4117

@j-m

Description

@j-m

For context, I have two columns, one with EuiIcons and one with an EuiProgress like so (far right):
image

I see EuiProgress's colour map contains

const colorToClassNameMap: {
    primary: string;
    secondary: string;
    danger: string;
    subdued: string;
    accent: string;
};

vs EuiIcon's:

const colorToClassMap: {
    default: null;
    primary: string;
    secondary: string;
    success: string;
    accent: string;
    warning: string;
    danger: string;
    text: string;
    subdued: string;
    ghost: string;
};

I would like EuiProgress to contain success and warning from EuiIcon's map, please.

I could then reuse the same colour selection code for both columns.

I tried adding a className to the EuiProgress like

className={`euiIcon--${stateColour(this.state.rows[rowIndex]['state'])}`}

but it wasn't very happy, I imagine there's a bit more to a progress bar than an icon...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions