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

Add titleSize prop to EuiStep #3340

Merged
merged 15 commits into from
Apr 23, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added `showCloseButton` and `dockedBreakpoint` flexibility to `EuiCollapsibleNav` ([#3330](https://github.com/elastic/eui/pull/3330))
- Added `panelStyle` prop to `EuiPopover` to distinguish style object configuration ([#3329](https://github.com/elastic/eui/pull/3329))
- Added `titleSize` prop to `EuiStep` ([#3340](https://github.com/elastic/eui/pull/3340))

**Bug Fixes**

Expand Down
1 change: 1 addition & 0 deletions src/components/steps/_steps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

.euiStep__titleWrapper {
display: flex;
align-items: center;
}

.euiStep__circle {
Expand Down
9 changes: 7 additions & 2 deletions src/components/steps/step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { CommonProps } from '../common';

import classNames from 'classnames';

import { EuiTitle } from '../title';
import { EuiTitle, EuiTitleSize } from '../title';

import { EuiStepStatus, EuiStepNumber } from './step_number';

Expand All @@ -43,6 +43,10 @@ export interface EuiStepProps {
* May replace the number provided in props.step with alternate styling.
*/
status?: EuiStepStatus;
/**
* Size of the title. See EuiTitle for options ('s', 'm', 'l'... etc)
*/
titleSize?: EuiTitleSize;
cchaos marked this conversation as resolved.
Show resolved Hide resolved
}

export type StandaloneEuiStepProps = CommonProps &
Expand All @@ -55,6 +59,7 @@ export const EuiStep: FunctionComponent<StandaloneEuiStepProps> = ({
headingElement = 'p',
step = 1,
title,
titleSize = 's',
status,
...rest
}) => {
Expand All @@ -81,7 +86,7 @@ export const EuiStep: FunctionComponent<StandaloneEuiStepProps> = ({
)}
</EuiI18n>

<EuiTitle size="s" className="euiStep__title">
<EuiTitle size={titleSize} className="euiStep__title">
{React.createElement(headingElement, null, title)}
</EuiTitle>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/steps/steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function renderSteps(
headingElement: string
) {
return steps.map((step, index) => {
const { className, children, title, status, ...rest } = step;
const { className, children, title, titleSize, status, ...rest } = step;

return (
<EuiStep
Expand All @@ -55,6 +55,7 @@ function renderSteps(
headingElement={headingElement}
step={firstStepNumber + index}
title={title}
titleSize={titleSize}
status={status}
{...rest}>
{children}
Expand Down