-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pie-toast-provider): DSW-2222 add priorty order
- Loading branch information
Showing
9 changed files
with
339 additions
and
37 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,9 @@ | ||
--- | ||
"@justeattakeaway/pie-toast-provider": minor | ||
"@justeattakeaway/pie-toast": minor | ||
"@justeattakeaway/pie-webc": minor | ||
"pie-storybook": minor | ||
"pie-monorepo": minor | ||
--- | ||
|
||
[Added] - priority order for the toast provider |
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,9 +1,9 @@ | ||
import { type TagVariantToStatusMap } from '../interfaces/tag-variant-to-status-map'; | ||
|
||
export const tagVariantToStatusMap: TagVariantToStatusMap = { | ||
alpha: 'yellow', | ||
beta: 'yellow', | ||
deprecated: 'red', | ||
removed: 'red', | ||
stable: 'green', | ||
alpha: 'brand-02', | ||
beta: 'brand-02', | ||
deprecated: 'error', | ||
removed: 'error', | ||
stable: 'information', | ||
}; |
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,3 +1,50 @@ | ||
// TODO - please remove the eslint disable comment below when you add props to this interface | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ToastProviderProps {} | ||
import { type ToastProps } from '@justeattakeaway/pie-toast'; | ||
|
||
export const PRIORITY_ORDER: { [x: string]: number } = { | ||
'error-actionable': 1, | ||
error: 2, | ||
'warning-actionable': 3, | ||
'positive-actionable': 4, | ||
'info-actionable': 5, | ||
'neutral-actionable': 6, | ||
warning: 7, | ||
positive: 8, | ||
info: 9, | ||
neutral: 10, | ||
}; | ||
|
||
export interface ExtendedToastProps extends ToastProps { | ||
/** | ||
* Callback for when the toast is closed. | ||
*/ | ||
onPieToastClose?: () => void; | ||
|
||
/** | ||
* Callback for when the toast is opened. | ||
*/ | ||
onPieToastOpen?: () => void; | ||
|
||
/** | ||
* Callback for when the leading action is clicked. | ||
*/ | ||
onPieToastLeadingActionClick?: (event: Event) => void; | ||
} | ||
|
||
export interface ToastProviderProps { | ||
/** | ||
* Default options for all toasts. | ||
*/ | ||
options?: Partial<ExtendedToastProps>; | ||
} | ||
|
||
export const defaultProps: ToastProviderProps = { | ||
options: {}, | ||
}; | ||
|
||
/** | ||
* Event name for when the chip is closed. | ||
* | ||
* @constant | ||
*/ | ||
|
||
export const ON_TOAST_PROVIDER_QUEUE_UPDATE_EVENT = 'pie-toast-provider-queue-update'; |
Oops, something went wrong.