-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiSteps] Add support for unordered steps (#7813)
- Loading branch information
Showing
26 changed files
with
414 additions
and
144 deletions.
There are no files selected for viewing
Binary file added
BIN
+10 KB
...rence/chrome_desktop_Navigation_EuiSteps_EuiStepsHorizontal_Unordered_Steps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.7 KB
...ference/chrome_desktop_Navigation_EuiSteps_EuiSteps_EuiStep_Multiline_Title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.35 KB
...nce/chrome_desktop_Navigation_EuiSteps_EuiSteps_EuiStep_Multiline_Title_XXS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.9 KB
....loki/reference/chrome_desktop_Navigation_EuiSteps_EuiSteps_Unordered_Steps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.31 KB
...erence/chrome_mobile_Navigation_EuiSteps_EuiStepsHorizontal_Unordered_Steps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.3 KB
...eference/chrome_mobile_Navigation_EuiSteps_EuiSteps_EuiStep_Multiline_Title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.6 KB
...ence/chrome_mobile_Navigation_EuiSteps_EuiSteps_EuiStep_Multiline_Title_XXS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67.6 KB
.../.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiSteps_Unordered_Steps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Updated `EuiSteps` to support a new `titleSize="xxs"` style, which outputs the same title font size but smaller unnumbered step indicators | ||
- Updated `EuiStepsHorizontal` to support a new `size="xs"` style, which outputs smaller unnumbered step indicators | ||
- Updated `EuiStepNumber` to support new `titleSize="none"` which omits rendering step numbers, and will only render icons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 59 additions & 8 deletions
67
packages/eui/src-docs/src/views/steps/steps_title_sizes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,77 @@ | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
|
||
import { EuiCode, EuiSteps } from '../../../../src/components'; | ||
import { | ||
EuiButtonGroup, | ||
EuiCode, | ||
EuiSpacer, | ||
EuiSteps, | ||
EuiTitle, | ||
} from '../../../../src/components'; | ||
import { EuiStepInterface } from '../../../../src/components/steps/step'; | ||
|
||
const firstSetOfSteps = [ | ||
const firstSetOfSteps: EuiStepInterface[] = [ | ||
{ | ||
title: 'Step 1', | ||
children: ( | ||
<p> | ||
Steps with <EuiCode>titleSize</EuiCode> set to <EuiCode>xs</EuiCode>{' '} | ||
like this one, get a smaller step circle | ||
Both step title and circle indicators will adjust in size based on the{' '} | ||
<EuiCode>titleSize</EuiCode> prop | ||
</p> | ||
), | ||
}, | ||
{ | ||
title: 'Step 2', | ||
children: ( | ||
<p> | ||
Steps with <EuiCode>titleSize</EuiCode> set to <EuiCode>xs</EuiCode>{' '} | ||
like this one, get a smaller step circle | ||
Both step title and circle indicators will adjust in size based on the{' '} | ||
<EuiCode>titleSize</EuiCode> prop | ||
</p> | ||
), | ||
}, | ||
]; | ||
|
||
export default () => <EuiSteps titleSize="xs" steps={firstSetOfSteps} />; | ||
const sizeButtons = [ | ||
{ | ||
id: 'xxs', | ||
label: 'XXSmall', | ||
}, | ||
{ | ||
id: 'xs', | ||
label: 'XSmall', | ||
}, | ||
{ | ||
id: 's', | ||
label: 'Small', | ||
}, | ||
{ | ||
id: 'm', | ||
label: 'Medium', | ||
}, | ||
]; | ||
|
||
type StepSizes = NonNullable<EuiStepInterface['titleSize']>; | ||
|
||
export default () => { | ||
const [titleSize, setTitleSize] = useState<StepSizes>('m'); | ||
|
||
const sizeOnChange = (optionId: StepSizes) => { | ||
setTitleSize(optionId); | ||
}; | ||
|
||
return ( | ||
<> | ||
<EuiTitle size="xxs"> | ||
<h3>Step Size</h3> | ||
</EuiTitle> | ||
<EuiSpacer size="s" /> | ||
<EuiButtonGroup | ||
legend="Horizontal step size toggle" | ||
options={sizeButtons} | ||
idSelected={titleSize} | ||
onChange={(id) => sizeOnChange(id as StepSizes)} | ||
/> | ||
<EuiSpacer size="m" /> | ||
<EuiSteps titleSize={titleSize} steps={firstSetOfSteps} /> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.