File tree Expand file tree Collapse file tree 5 files changed +23
-18
lines changed
polaris-react/src/components/ProgressBar
polaris.shopify.com/pages/examples Expand file tree Collapse file tree 5 files changed +23
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/polaris ' : major
3+ ---
4+
5+ Renamed ` color ` prop to ` tone ` for ` ProgressBar ` component
Original file line number Diff line number Diff line change 3535 height : progress-bar-height (large );
3636}
3737
38- .colorHighlight {
38+ .toneHighlight {
3939 // stylelint-disable -- Polaris component custom properties
4040 --pc-progress-bar-background : var (--p-color-bg-strong );
4141 --pc-progress-bar-indicator : var (--p-color-border-info );
4747 }
4848}
4949
50- .colorPrimary {
50+ .tonePrimary {
5151 // stylelint-disable -- Polaris component custom properties
5252 --pc-progress-bar-background : var (--p-color-bg-strong );
5353 --pc-progress-bar-indicator : var (--p-color-bg-primary );
5454 // stylelint-enable
5555}
5656
57- .colorSuccess {
57+ .toneSuccess {
5858 // stylelint-disable -- Polaris component custom properties
5959 --pc-progress-bar-background : var (--p-color-bg-strong );
6060 --pc-progress-bar-indicator : var (--p-color-border-success );
6666 }
6767}
6868
69- .colorCritical {
69+ .toneCritical {
7070 // stylelint-disable -- Polaris component custom properties
7171 --pc-progress-bar-background : var (--p-color-bg-strong );
7272 --pc-progress-bar-indicator : var (--p-color-bg-critical );
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ export function Small() {
1717export function WithColors ( ) {
1818 return (
1919 < div >
20- < ProgressBar progress = { 70 } color = "primary" />
20+ < ProgressBar progress = { 70 } tone = "primary" />
2121 < br />
22- < ProgressBar progress = { 30 } color = "success" />
22+ < ProgressBar progress = { 30 } tone = "success" />
2323 < br />
24- < ProgressBar progress = { 30 } color = "critical" />
24+ < ProgressBar progress = { 30 } tone = "critical" />
2525 < br />
26- < ProgressBar progress = { 30 } color = "highlight" />
26+ < ProgressBar progress = { 30 } tone = "highlight" />
2727 </ div >
2828 ) ;
2929}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import {useI18n} from '../../utilities/i18n';
88import styles from './ProgressBar.scss' ;
99
1010type Size = 'small' | 'medium' | 'large' ;
11- type Color = 'highlight' | 'primary' | 'success' | 'critical' ;
11+ type Tone = 'highlight' | 'primary' | 'success' | 'critical' ;
1212
1313export interface ProgressBarProps {
1414 /**
@@ -21,11 +21,6 @@ export interface ProgressBarProps {
2121 * @default 'medium'
2222 */
2323 size ?: Size ;
24- /**
25- * Color of progressbar
26- * @default 'highlight'
27- */
28- color ?: Color ;
2924 /**
3025 * Whether the fill animation is triggered
3126 * @default 'true'
@@ -35,12 +30,17 @@ export interface ProgressBarProps {
3530 * Id (ids) of element (elements) that describes progressbar
3631 */
3732 ariaLabelledBy ?: string ;
33+ /**
34+ * Color of progressbar
35+ * @default 'highlight'
36+ */
37+ tone ?: Tone ;
3838}
3939
4040export function ProgressBar ( {
4141 progress = 0 ,
4242 size = 'medium' ,
43- color = 'highlight' ,
43+ tone = 'highlight' ,
4444 animated : hasAppearAnimation = true ,
4545 ariaLabelledBy,
4646} : ProgressBarProps ) {
@@ -50,7 +50,7 @@ export function ProgressBar({
5050 const className = classNames (
5151 styles . ProgressBar ,
5252 size && styles [ variationName ( 'size' , size ) ] ,
53- color && styles [ variationName ( 'color ' , color ) ] ,
53+ tone && styles [ variationName ( 'tone ' , tone ) ] ,
5454 ) ;
5555
5656 const warningMessage = i18n . translate (
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
55function ProgressBarExample ( ) {
66 return (
77 < div style = { { width : 225 } } >
8- < ProgressBar progress = { 70 } color = "primary" />
8+ < ProgressBar progress = { 70 } tone = "primary" />
99 < br />
10- < ProgressBar progress = { 30 } color = "success" />
10+ < ProgressBar progress = { 30 } tone = "success" />
1111 </ div >
1212 ) ;
1313}
You can’t perform that action at this time.
0 commit comments