-
Notifications
You must be signed in to change notification settings - Fork 107
[v12] feat(ui-alerts): rework Alert #2330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v12
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,8 @@ | |
| * SOFTWARE. | ||
| */ | ||
|
|
||
| import type { AlertTheme } from '@instructure/shared-types' | ||
| import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes' | ||
| import { boxShadowObjectsToCSSString } from '@instructure/ui-themes' | ||
| import type { AlertProps, AlertStyle } from './props' | ||
|
|
||
| /** | ||
|
|
@@ -36,8 +37,9 @@ import type { AlertProps, AlertStyle } from './props' | |
| * @return {Object} The final style object, which will be used in the component | ||
| */ | ||
| const generateStyle = ( | ||
| componentTheme: AlertTheme, | ||
| props: AlertProps | ||
| componentTheme: NewComponentTypes['Alert'], | ||
| props: AlertProps, | ||
| sharedTokens: SharedTokens | ||
| ): AlertStyle => { | ||
| const { variant, hasShadow } = props | ||
|
|
||
|
|
@@ -84,7 +86,11 @@ const generateStyle = ( | |
| borderStyle: componentTheme.borderStyle, | ||
| borderRadius: componentTheme.borderRadius, | ||
| ...variantStyles[variant!].alert, | ||
| ...(hasShadow && { boxShadow: componentTheme.boxShadow }) | ||
| ...(hasShadow && { | ||
| boxShadow: boxShadowObjectsToCSSString( | ||
| sharedTokens.boxShadow.elevation4 | ||
| ) | ||
| }) | ||
| }, | ||
| icon: { | ||
| color: componentTheme.iconColor, | ||
|
|
@@ -116,7 +122,7 @@ const generateStyle = ( | |
| fontFamily: componentTheme.contentFontFamily, | ||
| fontWeight: componentTheme.contentFontWeight, | ||
| lineHeight: componentTheme.contentLineHeight, | ||
| padding: componentTheme.contentPadding | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put this change into the upgeade guide
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done it |
||
| padding: `${componentTheme.contentPaddingVertical} ${componentTheme.contentPaddingHorizontal}` | ||
| }, | ||
| variantScreenReaderLabel: { | ||
| position: 'absolute', | ||
|
|
||
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this change into the upgrade guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done it.