-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Updates severity notification palette (#3016)
- Loading branch information
1 parent
d8a1a65
commit efec7c4
Showing
13 changed files
with
1,292 additions
and
114 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1,050 changes: 1,050 additions & 0 deletions
1,050
src/__tests__/snapshot-tests/__snapshots__/design-tokens.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import merge from 'lodash/merge'; | ||
|
||
import { expandColorDictionary } from '../utils'; | ||
import { StyleDictionary } from '../utils/interfaces'; | ||
import { tokens as parentTokens } from '../visual-refresh/color-severity'; | ||
|
||
const tokens: StyleDictionary.ColorSeverityDictionary = { | ||
colorTextNotificationSeverityMedium: { light: '{colorBlack}', dark: '{colorGrey900}' }, | ||
}; | ||
|
||
const expandedTokens: StyleDictionary.ExpandedColorScopeDictionary = merge( | ||
{}, | ||
parentTokens, | ||
expandColorDictionary(tokens) | ||
); | ||
export { expandedTokens as tokens }; | ||
export const mode: StyleDictionary.ModeIdentifier = 'color'; |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { expandColorDictionary } from '../utils'; | ||
import { StyleDictionary } from '../utils/interfaces'; | ||
|
||
const tokens: StyleDictionary.ColorSeverityDictionary = { | ||
// note: these should not be used directly. Instead, use the semantic tokens defined below. | ||
colorSeverityDarkRed: { light: '#870303', dark: '#d63f38' }, | ||
colorSeverityRed: { light: '#ce3311', dark: '#fe6e73' }, | ||
colorSeverityOrange: { light: '#f89256', dark: '#f89256' }, | ||
colorSeverityYellow: { light: '#f2cd54', dark: '#f2cd54' }, | ||
colorSeverityGrey: '{colorGrey550}', | ||
|
||
colorBackgroundNotificationSeverityCritical: '{colorSeverityDarkRed}', | ||
colorBackgroundNotificationSeverityHigh: '{colorSeverityRed}', | ||
colorBackgroundNotificationSeverityMedium: '{colorSeverityOrange}', | ||
colorBackgroundNotificationSeverityLow: '{colorSeverityYellow}', | ||
colorBackgroundNotificationSeverityNeutral: '{colorSeverityGrey}', | ||
|
||
colorTextNotificationSeverityCritical: { light: '{colorGrey100}', dark: '{colorBlack}' }, | ||
colorTextNotificationSeverityHigh: { light: '{colorGrey100}', dark: '{colorGrey900}' }, | ||
colorTextNotificationSeverityMedium: '{colorGrey900}', | ||
colorTextNotificationSeverityLow: '{colorGrey900}', | ||
colorTextNotificationSeverityNeutral: '{colorGrey100}', | ||
}; | ||
|
||
const expandedTokens: StyleDictionary.ExpandedColorScopeDictionary = expandColorDictionary(tokens); | ||
|
||
export { expandedTokens as tokens }; | ||
export const mode: StyleDictionary.ModeIdentifier = 'color'; |
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
66 changes: 66 additions & 0 deletions
66
style-dictionary/visual-refresh/metadata/color-severity.ts
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,66 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { StyleDictionary } from '../../utils/interfaces'; | ||
|
||
const metadata: StyleDictionary.MetadataIndex = { | ||
colorBackgroundNotificationSeverityCritical: { | ||
description: | ||
'Background color in a notification to represent a critical error or a critically high-level of severity. For example: "Sev-1"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorBackgroundNotificationSeverityHigh: { | ||
description: | ||
'Background color in a notification to represent an error status or a high-level of severity. For example: "Failed" or "Sev-2"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorBackgroundNotificationSeverityMedium: { | ||
description: 'Background color in a notification to represent a medium-level of severity. For example: "Sev-3"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorBackgroundNotificationSeverityLow: { | ||
description: | ||
'Background color in a notification to represent a warning or a low-level of severity. For example: "Warning" or "Sev-4"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorBackgroundNotificationSeverityNeutral: { | ||
description: | ||
'Background color in a notification to represent a neutral status, a severity level of no impact, or the lowest-level of severity. For example: "Pending" or "Sev-5"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorTextNotificationSeverityCritical: { | ||
description: | ||
'Text color in a notification to represent a critical error or a critically high-level of severity. For example: "Sev-1"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorTextNotificationSeverityHigh: { | ||
description: | ||
'Text color in a notification to represent an error status or a high-level of severity. For example: "Failed" or "Sev-2"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorTextNotificationSeverityMedium: { | ||
description: 'Text color in a notification to represent a medium-level of severity. For example: "Sev-3"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorTextNotificationSeverityLow: { | ||
description: | ||
'Text color in a notification to represent a warning or a low-level of severity. For example: "Warning" or "Sev-4"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
colorTextNotificationSeverityNeutral: { | ||
description: | ||
'Text color in a notification to represent a neutral status, a severity level of no impact, or the lowest-level of severity. For example: "Pending" or "Sev-5"', | ||
public: true, | ||
themeable: true, | ||
}, | ||
}; | ||
|
||
export default metadata; |
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