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

feat(ProgressIndicator): add animation #9340

Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
619218d
add animation to progress line on each individual progress step
kristastarr Jun 30, 2021
d5f1236
add animation to progress indicator
kristastarr Jul 27, 2021
6f11616
remove top border on ProgressStep component in vertical variant
kristastarr Jul 27, 2021
9ab421b
feat(react): Progress Tracker: add transitions to current, complete, …
kristastarr Aug 11, 2021
3ccbc33
feat(react): Progress Tracker: add transitions to current, complete, …
kristastarr Aug 11, 2021
2f2661e
feat(progress-indicator): add media query for prefers-reduced-motion
kristastarr Sep 3, 2021
b879a0d
experiment with animations for form inputs
kristastarr Sep 15, 2021
4c5cea0
Merge branch 'carbon-design-system:main' into input-validation
kristastarr Sep 15, 2021
c26f694
add files for cf foundry deploy
kristastarr Sep 15, 2021
1d5a790
try to deploy
kristastarr Sep 15, 2021
a38a4b3
update maniest.yml
kristastarr Sep 16, 2021
7a4af74
feat(progress-indicator): fix conflicts; use motion duration tokens
kristastarr Sep 28, 2021
c22623b
Merge branch 'main' of github.com:carbon-design-system/carbon into pr…
kristastarr Sep 28, 2021
4ef814c
add 5 variations of text input animations
kristastarr Sep 30, 2021
f9272aa
Merge branch 'input-validation'
kristastarr Sep 30, 2021
6feccaf
merge upstream
kristastarr Oct 11, 2021
46f4875
Merge branch 'main' into progress-tracker-motion
kristastarr Oct 11, 2021
87034a3
merge stuff
kristastarr Oct 11, 2021
45ac268
merge more stuff
kristastarr Oct 11, 2021
11d83f9
Merge branch 'main' of github.com:carbon-design-system/carbon
kristastarr Oct 11, 2021
e1e58ba
Merge branch 'main' of github.com:carbon-design-system/carbon
kristastarr Oct 11, 2021
e65ce9a
Merge branch 'main' of github.com:carbon-design-system/carbon
kristastarr Oct 15, 2021
add6fbe
Merge branch 'main' into progress-tracker-motion
kristastarr Oct 15, 2021
949a429
remove unintended content from unrelated explorations
kristastarr Oct 19, 2021
8962239
feat(ProgressIndicator): fix lint and format errors
kristastarr Oct 19, 2021
6d349f4
Merge branch 'main' of github.com:carbon-design-system/carbon
kristastarr Oct 19, 2021
d606734
Merge branch 'main' into progress-tracker-motion
kristastarr Oct 19, 2021
8232648
revert(TextInput): remove unintended changes
kristastarr Oct 19, 2021
604b088
Merge branch 'main' into progress-tracker-motion
kristastarr Oct 19, 2021
a272d2b
Merge branch 'main' of github.com:carbon-design-system/carbon
kristastarr Oct 19, 2021
07d8302
Merge branch 'main' into progress-tracker-motion
kristastarr Oct 19, 2021
483982a
Merge branch 'progress-tracker-motion' of https://github.com/kristast…
kristastarr Oct 19, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/// Progress indicator styles
/// @access private
/// @group progress-indicator

@mixin progress-indicator {
.#{$prefix}--progress {
@include reset;
Expand All @@ -31,6 +32,7 @@
width: rem(128px);
min-width: 7rem;
flex-direction: row;
border-top: 2px solid $ui-03;

.#{$prefix}--tooltip__label {
display: block;
Expand All @@ -45,14 +47,14 @@
.#{$prefix}--progress-line {
position: absolute;
left: 0;
width: rem(128px);
height: 1px;
border: $progress-indicator-bar-width;
width: 0;
height: 2px;
transform: translateY(-2px);
transition: width 0.15s cubic-bezier(0.2, 0, 0.38, 0.9) 0.15s;
}

.#{$prefix}--progress--space-equal .#{$prefix}--progress-line {
width: 100%;
min-width: rem(128px);
width: 0;
}

.#{$prefix}--progress-step svg {
Expand Down Expand Up @@ -129,7 +131,6 @@

display: block;
width: rem(125px);

min-width: rem(115px);
min-height: $carbon--spacing-06;
padding: $carbon--spacing-03 $carbon--spacing-05;
Expand Down Expand Up @@ -158,13 +159,23 @@
margin-left: $carbon--spacing-06;
color: $text-secondary;
text-align: start;
opacity: 0;
transform: translateY(-10px);
animation: 0.15s optional-text-entrance 0.15s motion(standard, productive)
forwards;
}

//CURRENT STYLING
.#{$prefix}--progress-step--current {
.#{$prefix}--progress-line {
background-color: $interactive;
}

svg circle {
opacity: 0;
animation: 0.15s progress-indicator-icon-fade 0.15s
motion(standard, productive) forwards;
}
}

//INCOMPLETE STYLING
Expand All @@ -181,8 +192,15 @@
//COMPLETED STYLING
.#{$prefix}--progress-step--complete {
.#{$prefix}--progress-line {
width: 100%;
background-color: $interactive;
}

svg {
opacity: 0;
animation: 0.15s progress-indicator-icon-fade motion(standard, productive)
forwards;
}
}

//interactive button
Expand Down Expand Up @@ -223,6 +241,12 @@
fill: $disabled;
}

svg circle {
opacity: 0;
animation: 0.15s progress-indicator-icon-fade 0.15s
motion(standard, productive) forwards;
}

.#{$prefix}--progress-label,
.#{$prefix}--progress-label:hover {
box-shadow: none;
Expand Down Expand Up @@ -262,10 +286,14 @@
}

// Vertical Variant
.#{$prefix}--progress--vertical .#{$prefix}--progress-step {
border-top: none;
}

.#{$prefix}--progress--vertical {
display: flex;
flex-direction: column;
border-left: 2px solid $ui-03;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step,
Expand Down Expand Up @@ -308,8 +336,33 @@
position: absolute;
top: 0;
left: 0;
width: 1px;
height: 100%;
width: 2px;
height: 0;
background-color: $interactive;
transform: translateX(-2px);
transition: height 0.15s cubic-bezier(0.2, 0, 0.38, 0.9) 0.15s;
}

.#{$prefix}--progress--vertical {
.#{$prefix}--progress-step--complete {
.#{$prefix}--progress-line {
height: 100%;
}
}
}
}

// Animations
@keyframes optional-text-entrance {
to {
opacity: 1;
transform: none;
}
}

@keyframes progress-indicator-icon-fade {
to {
opacity: 1;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,61 +32,72 @@ export default {
},
};

const tooltipTwo = () => {
return (
<Tooltip
direction="bottom"
showIcon={false}
triggerClassName={`${prefix}--progress-label`}
triggerText={'Second step with tooltip'}
tooltipId="tooltipId-0">
<p>Overflow tooltip content.</p>
</Tooltip>
);
};

const tooltipThree = () => {
return (
<Tooltip
direction="bottom"
showIcon={false}
triggerClassName={`${prefix}--progress-label`}
triggerText={'Third step with tooltip'}
tooltipId="tooltipId-1">
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Animi
consequuntur hic ratione aliquid cupiditate, nesciunt saepe iste
blanditiis cumque maxime tenetur veniam est illo deserunt sint quae
pariatur. Laboriosam, consequatur.
</p>
</Tooltip>
);
};

const stepData = [
{
label: 'First step',
description: 'Step 1: Getting started with Carbon Design System',
secondaryLabel: 'Optional label',
},
{
label: 'Second step with tooltip',
description: 'Step 2: Getting started with Carbon Design System',
renderLabel: tooltipTwo,
},
{
label: 'Third step with tooltip',
description: 'Step 3: Getting started with Carbon Design System',
renderLabel: tooltipThree,
},
{
label: 'Fourth step',
description: 'Step 4: Getting started with Carbon Design System',
invalid: 'invalid',
secondaryLabel: 'Example invalid step',
},
{
label: 'Fifth step',
description: 'Step 5: Getting started with Carbon Design System',
disabled: 'disabled',
},
];

export const Default = () => (
<ProgressIndicator
vertical={boolean('Vertical (vertical)', false)}
currentIndex={number('Current progress (currentIndex)', 1)}
spaceEqually={boolean('Space Equally (spaceEqually)', false)}>
<ProgressStep
label={text('Label (label)', 'First step')}
description="Step 1: Getting started with Carbon Design System"
secondaryLabel="Optional label"
/>
<ProgressStep
label="Second step with tooltip"
description="Step 2: Getting started with Carbon Design System"
renderLabel={() => (
<Tooltip
direction="bottom"
showIcon={false}
triggerClassName={`${prefix}--progress-label`}
triggerText={'Second step with tooltip'}
tooltipId="tooltipId-0">
<p>Overflow tooltip content.</p>
</Tooltip>
)}
/>
<ProgressStep
label="Third step with tooltip"
description="Step 3: Getting started with Carbon Design System"
renderLabel={() => (
<Tooltip
direction="bottom"
showIcon={false}
triggerClassName={`${prefix}--progress-label`}
triggerText={'Third step with tooltip'}
tooltipId="tooltipId-1">
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Animi
consequuntur hic ratione aliquid cupiditate, nesciunt saepe iste
blanditiis cumque maxime tenetur veniam est illo deserunt sint quae
pariatur. Laboriosam, consequatur.
</p>
</Tooltip>
)}
/>
<ProgressStep
label="Fourth step"
description="Step 4: Getting started with Carbon Design System"
invalid
secondaryLabel="Example invalid step"
/>
<ProgressStep
label="Fifth step"
description="Step 5: Getting started with Carbon Design System"
disabled
/>
</ProgressIndicator>
spaceEqually={boolean('Space Equally (spaceEqually)', false)}
stepData={stepData}></ProgressIndicator>
);

Default.parameters = {
Expand All @@ -102,35 +113,8 @@ Default.parameters = {
export const Interactive = () => (
<ProgressIndicator
currentIndex={number('Current progress (currentIndex)', 1)}
onChange={action('onChange')}>
<ProgressStep
label="Click me"
description="Step 1: Register a onChange event"
/>
<ProgressStep
label="Really long label"
description="The progress indicator will listen for clicks on the steps"
/>
<ProgressStep
label="Tooltip and really long label"
description="The progress indicator will listen for clicks on the steps"
renderLabel={() => (
<Tooltip
direction="bottom"
showIcon={false}
triggerClassName={`${prefix}--progress-label`}
triggerText="Tooltip and really long label"
tooltipId="tooltipId-1">
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Animi
consequuntur hic ratione aliquid cupiditate, nesciunt saepe iste
blanditiis cumque maxime tenetur veniam est illo deserunt sint quae
pariatur. Laboriosam, consequatur.
</p>
</Tooltip>
)}
/>
</ProgressIndicator>
onChange={action('onChange')}
stepData={stepData}></ProgressIndicator>
);

Interactive.storyName = 'interactive';
Expand Down
Loading