-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
42 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris': major | ||
--- | ||
|
||
Removed `polarisSummerEditions2023` feature flag from AppProvider context |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export interface FeaturesConfig { | ||
polarisSummerEditions2023?: boolean; | ||
[key: string]: boolean | undefined; | ||
} | ||
|
||
|
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
49 changes: 18 additions & 31 deletions
49
polaris.shopify.com/src/components/StatusBadge/StatusBadge.module.scss
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,37 +1,24 @@ | ||
.StatusBadge { | ||
font-size: var(--p-font-size-75); | ||
font-size: var(--font-size-100); | ||
letter-spacing: 0; | ||
font-weight: var(--p-font-weight-medium); | ||
padding: var(--p-space-05) var(--p-space-2); | ||
color: var(--p-color-text-subdued); | ||
border-radius: var(--p-border-radius-2); | ||
} | ||
font-weight: var(--font-weight-400); | ||
border-radius: var(--border-radius-round); | ||
padding: 0.05rem 0.25rem; | ||
color: var(--text); | ||
|
||
.toneSuccess { | ||
background-color: var(--p-color-bg-success); | ||
color: var(--p-color-text-success); | ||
} | ||
&[data-value='alpha'] { | ||
background: var(--surface-attention); | ||
} | ||
|
||
.toneInfo { | ||
background-color: var(--p-color-bg-info); | ||
color: var(--p-color-text-info); | ||
} | ||
|
||
.toneAttention { | ||
background-color: var(--p-color-bg-caution); | ||
color: var(--p-color-text-caution); | ||
} | ||
|
||
.toneWarning { | ||
background-color: var(--p-color-bg-warning); | ||
color: var(--p-color-text-warning-experimental); | ||
} | ||
|
||
.toneCritical { | ||
background-color: var(--p-color-bg-critical); | ||
color: var(--p-color-text-critical); | ||
} | ||
&[data-value='warning'], | ||
&[data-value='deprecated'], | ||
&[data-value='legacy'] { | ||
background: var(--surface-warning); | ||
} | ||
|
||
.toneNew { | ||
background-color: var(--p-color-bg-transparent-subdued-experimental); | ||
&[data-value='beta'], | ||
&[data-value='information'], | ||
&[data-value='new'] { | ||
background: var(--surface-information); | ||
} | ||
} |
23 changes: 4 additions & 19 deletions
23
polaris.shopify.com/src/components/StatusBadge/StatusBadge.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,30 +1,15 @@ | ||
import {Status} from '../../types'; | ||
import {className as classNames, variationName} from '../../utils/various'; | ||
import styles from './StatusBadge.module.scss'; | ||
|
||
interface Props { | ||
status: Status; | ||
} | ||
|
||
type Tone = 'info' | 'success' | 'warning' | 'critical' | 'attention' | 'new'; | ||
|
||
const StatusToneMapping: {[S in Status]: Tone} = { | ||
Alpha: 'info', | ||
Beta: 'success', | ||
Deprecated: 'critical', | ||
Information: 'info', | ||
Legacy: 'warning', | ||
New: 'new', | ||
Warning: 'warning', | ||
}; | ||
|
||
function StatusBadge({status}: Props) { | ||
const className = classNames( | ||
styles.StatusBadge, | ||
styles[variationName('tone', StatusToneMapping[status])], | ||
return ( | ||
<div className={styles.StatusBadge} data-value={status.toLowerCase()}> | ||
{status} | ||
</div> | ||
); | ||
|
||
return <div className={className}>{status}</div>; | ||
} | ||
|
||
export default StatusBadge; |
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