-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add backgroundColor var on LoadingDots (#2991)
Fixes: #2990 https://canvas.workdaydesign.com/components/indicators/loading-dots/ shows a circle variant for use on gray/dark/image-based backgrounds. Our LoadingDots component styling needed some TLC to allow consumers to set the background color to match this pattern, and our Storybook entries can be updated to show how to achieve this variant. I also noticed some links to docs were broken in the codebase so I updated that too. [category:Components Documentation] Release Note: Adds capability to LoadingDots to accept a `loadingDotColor` prop to change loading dots color, with the capability to override that var with a stencil - intended for use with the circle variant for dark backgrounds/images, which is now shown in Storybook with Custom Shape story. Also adds a `animationDurationMs` prop in the same pattern, with a Custom Color and Animation story in storybook demonstrating the use of both these new props. Co-authored-by: @mannycarrera4 <[email protected]> Co-authored-by: manuel.carrera <[email protected]> Co-authored-by: @NicholasBoll <[email protected]> Co-authored-by: @alanbsmith <[email protected]> Co-authored-by: @alanbsmith <[email protected]> Co-authored-by: @mannycarrera4 <[email protected]>
- Loading branch information
1 parent
d5be4cb
commit 2ad2b08
Showing
8 changed files
with
131 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Contributing to Canvas | ||
|
||
You may read our contribution guidelines | ||
[here](https://workday.github.io/canvas-kit/?path=/docs/guides-contributing--page). | ||
[here](https://workday.github.io/canvas-kit/?path=/docs/guides-contributing--docs). |
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
19 changes: 19 additions & 0 deletions
19
modules/react/loading-dots/stories/examples/CustomColorAndAnimation.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import {LoadingDots} from '@workday/canvas-kit-react/loading-dots'; | ||
import {system} from '@workday/canvas-tokens-web'; | ||
import {createStyles} from '@workday/canvas-kit-styling'; | ||
|
||
const styleOverrides = { | ||
parentContainer: createStyles({ | ||
display: 'flex', | ||
gap: system.space.x4, | ||
}), | ||
}; | ||
|
||
export const CustomColorAndAnimation = () => { | ||
return ( | ||
<div className={styleOverrides.parentContainer}> | ||
<LoadingDots loadingDotColor={system.color.fg.primary.default} animationDurationMs="60ms" /> | ||
</div> | ||
); | ||
}; |
32 changes: 32 additions & 0 deletions
32
modules/react/loading-dots/stories/examples/CustomShape.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import {LoadingDots, loadingDotsStencil} from '@workday/canvas-kit-react/loading-dots'; | ||
import {system} from '@workday/canvas-tokens-web'; | ||
import {createStyles, createStencil} from '@workday/canvas-kit-styling'; | ||
|
||
const styleOverrides = { | ||
parentContainer: createStyles({ | ||
display: 'flex', | ||
gap: system.space.x4, | ||
}), | ||
}; | ||
|
||
const loadingStencil = createStencil({ | ||
base: { | ||
borderRadius: system.shape.round, | ||
backgroundColor: system.color.bg.overlay, | ||
height: 80, | ||
width: 80, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
display: 'flex', | ||
[loadingDotsStencil.vars.loadingDotColor]: system.color.icon.inverse, | ||
}, | ||
}); | ||
|
||
export const CustomShape = () => { | ||
return ( | ||
<div className={styleOverrides.parentContainer}> | ||
<LoadingDots cs={loadingStencil()} /> | ||
</div> | ||
); | ||
}; |