-
Notifications
You must be signed in to change notification settings - Fork 1
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
12 changed files
with
89 additions
and
13 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,10 @@ | ||
# Deprecations List | ||
|
||
Following deprecations will be removed in version 2 of the _spirit-web-react_ package. | ||
|
||
> Please follow these steps to safely upgrade your design system to Spirit Design System v2 components. | ||
## Add the `danger` icon to your project's assets | ||
|
||
The `warning` icon as a fallback for the `danger` color in the Alert component will be removed in favor of the `danger` icon. | ||
Please, add the `danger` icon to your project's assets. |
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,8 +1,33 @@ | ||
import { useContext } from 'react'; | ||
import warning from '../common/utilities/warning'; | ||
import IconsContext from '../context/IconsContext'; | ||
|
||
export const useIcon = (name: string) => { | ||
const icons = useContext(IconsContext); | ||
|
||
return icons != null ? icons[name] : ''; | ||
/** | ||
* @todo Remove this block when DS-1177 is resolved and return the previous code | ||
* | ||
* @see { @link https://jira.almacareer.tech/browse/DS-1177 } | ||
* | ||
* Previous code: return icons != null ? icons[name] : ''; | ||
*/ | ||
const iconFallbacks: { [key: string]: string } = { | ||
danger: 'warning', | ||
}; | ||
|
||
if (icons != null && icons[name] != null) { | ||
return icons[name]; | ||
} | ||
|
||
if (icons != null && icons[name] == null) { | ||
warning( | ||
name !== 'danger' || iconFallbacks[name] !== 'warning', | ||
'The "danger" icon is missing from your assets. It will be required in the next major version. Using "warning" as a fallback.', | ||
); | ||
|
||
return icons[iconFallbacks[name]]; | ||
} | ||
|
||
return ''; | ||
}; |
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,10 @@ | ||
# Deprecations List | ||
|
||
Following deprecations will be removed in version 3 of the _spirit-web-twig_ package. | ||
|
||
> Please follow these steps to safely upgrade your design system to Spirit Design System v3 components. | ||
## Add the `danger` icon to your project's assets | ||
|
||
The `warning` icon as a fallback for the `danger` color in the Alert component will be removed in favor of the `danger` icon. | ||
Please, add the `danger` icon to your project's assets. |
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
Binary file modified
BIN
+3.53 KB
(100%)
tests/e2e/demo-components-compare.spec.ts-snapshots/alert-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.