-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(styles): update notification to new token format (#9582)
* docs(carbon-react): update storybook to use background theme color * fix(eslint): update to exclude *.stories.js files * docs(notification): add playground for toast * refactor(styles): update notification tests to one file * feat(themes): add support for component tokens * feat(styles): add support for CSS Custom Property in component tokens * fix(styles): update notification to new token format Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4c31ac6
commit 4d424f0
Showing
12 changed files
with
328 additions
and
173 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
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
27 changes: 0 additions & 27 deletions
27
packages/styles/scss/components/__tests__/inline-notification-test.js
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
packages/styles/scss/components/__tests__/notification-test.js
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,44 @@ | ||
/** | ||
* Copyright IBM Corp. 2018, 2018 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @jest-environment node | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { SassRenderer } = require('@carbon/test-utils/scss'); | ||
|
||
const { render } = SassRenderer.create(__dirname); | ||
|
||
describe('scss/components/notification', () => { | ||
test('Public API', async () => { | ||
const { unwrap } = await render(` | ||
@use 'sass:map'; | ||
@use 'sass:meta'; | ||
@use '../notification'; | ||
$_: get('mixins', ( | ||
toast-notification: meta.mixin-exists('toast-notification', 'notification'), | ||
inline-notification: meta.mixin-exists('inline-notification', 'notification'), | ||
)); | ||
$_: get('tokens', map.keys(meta.module-variables('notification'))); | ||
`); | ||
|
||
expect(unwrap('mixins')).toEqual({ | ||
'toast-notification': true, | ||
'inline-notification': true, | ||
}); | ||
expect(unwrap('tokens')).toEqual([ | ||
'notification-background-error', | ||
'notification-background-success', | ||
'notification-background-info', | ||
'notification-background-warning', | ||
'notification-action-hover', | ||
'notification-tokens', | ||
]); | ||
}); | ||
}); |
27 changes: 0 additions & 27 deletions
27
packages/styles/scss/components/__tests__/toast-notification-test.js
This file was deleted.
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
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
Oops, something went wrong.