@spectrum-web-components/toast
Advanced tools
Comparing version 0.7.3 to 0.8.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [0.8.0](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/toast@0.7.3...@spectrum-web-components/toast@0.8.0) (2021-03-04) | ||
### Features | ||
- use latest exports specification ([a7ecf4b](https://github.com/adobe/spectrum-web-components/commit/a7ecf4b6da7996f36a8a89f62cc2384709497008)) | ||
## [0.7.3](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/toast@0.7.2...@spectrum-web-components/toast@0.7.3) (2021-02-11) | ||
@@ -8,0 +14,0 @@ |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.7.3", | ||
"version": "0.8.0", | ||
"description": "", | ||
@@ -30,3 +30,3 @@ "main": "./src/index.js", | ||
".": "./src/index.js", | ||
"./src/": "./src/", | ||
"./src/*": "./src/*", | ||
"./custom-elements.json": "./custom-elements.json", | ||
@@ -57,9 +57,9 @@ "./package.json": "./package.json", | ||
"dependencies": { | ||
"@spectrum-web-components/base": "^0.3.3", | ||
"@spectrum-web-components/button": "^0.12.0", | ||
"@spectrum-web-components/icon": "^0.8.3", | ||
"@spectrum-web-components/icons-workflow": "^0.5.3", | ||
"@spectrum-web-components/base": "^0.4.0", | ||
"@spectrum-web-components/button": "^0.13.0", | ||
"@spectrum-web-components/icon": "^0.9.0", | ||
"@spectrum-web-components/icons-workflow": "^0.6.0", | ||
"tslib": "^2.0.0" | ||
}, | ||
"gitHead": "975a9d6bf075d367fbc77c9b5cec4eabce66f6c0" | ||
"gitHead": "aec24bb12d82dea387faa1e6d36dfc7620d230f7" | ||
} |
import { CSSResultArray, TemplateResult, SpectrumElement, PropertyValues } from '@spectrum-web-components/base'; | ||
import '@spectrum-web-components/button/sp-clear-button.js'; | ||
import '@spectrum-web-components/icon/sp-icon.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js'; | ||
export declare const toastVariants: ToastVariants[]; | ||
@@ -5,0 +7,0 @@ export declare type ToastVariants = 'negative' | 'positive' | 'info' | 'error' | 'warning' | ''; |
@@ -15,4 +15,5 @@ /* | ||
import '@spectrum-web-components/button/sp-clear-button.js'; | ||
import '@spectrum-web-components/icon/sp-icon.js'; | ||
import { AlertIcon, InfoIcon, CheckmarkCircleIcon, } from '@spectrum-web-components/icons-workflow'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js'; | ||
import toastStyles from './toast.css.js'; | ||
@@ -105,28 +106,27 @@ export const toastVariants = [ | ||
renderIcon(variant) { | ||
let label = ''; | ||
let icon; | ||
switch (variant) { | ||
case 'info': | ||
label = 'Information'; | ||
icon = InfoIcon; | ||
break; | ||
return html ` | ||
<sp-icon-info | ||
label="Information" | ||
class="type" | ||
></sp-icon-info> | ||
`; | ||
case 'negative': | ||
case 'error': // deprecated | ||
case 'warning': // deprecated | ||
label = 'Error'; | ||
icon = AlertIcon; | ||
break; | ||
return html ` | ||
<sp-icon-alert label="Error" class="type"></sp-icon-alert> | ||
`; | ||
case 'positive': | ||
case 'success': // deprecated | ||
label = 'Success'; | ||
icon = CheckmarkCircleIcon; | ||
break; | ||
return html ` | ||
<sp-icon-checkmark-circle | ||
label="Success" | ||
class="type" | ||
></sp-icon-checkmark-circle> | ||
`; | ||
default: | ||
return html ``; | ||
} | ||
return html ` | ||
<sp-icon class="type" label=${label}> | ||
${icon({ hidden: true })} | ||
</sp-icon> | ||
`; | ||
} | ||
@@ -133,0 +133,0 @@ startCountdown() { |
@@ -22,8 +22,5 @@ /* | ||
import '@spectrum-web-components/button/sp-clear-button.js'; | ||
import '@spectrum-web-components/icon/sp-icon.js'; | ||
import { | ||
AlertIcon, | ||
InfoIcon, | ||
CheckmarkCircleIcon, | ||
} from '@spectrum-web-components/icons-workflow'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js'; | ||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js'; | ||
@@ -109,28 +106,27 @@ import toastStyles from './toast.css.js'; | ||
private renderIcon(variant: string): TemplateResult { | ||
let label = ''; | ||
let icon; | ||
switch (variant) { | ||
case 'info': | ||
label = 'Information'; | ||
icon = InfoIcon; | ||
break; | ||
return html` | ||
<sp-icon-info | ||
label="Information" | ||
class="type" | ||
></sp-icon-info> | ||
`; | ||
case 'negative': | ||
case 'error': // deprecated | ||
case 'warning': // deprecated | ||
label = 'Error'; | ||
icon = AlertIcon; | ||
break; | ||
return html` | ||
<sp-icon-alert label="Error" class="type"></sp-icon-alert> | ||
`; | ||
case 'positive': | ||
case 'success': // deprecated | ||
label = 'Success'; | ||
icon = CheckmarkCircleIcon; | ||
break; | ||
return html` | ||
<sp-icon-checkmark-circle | ||
label="Success" | ||
class="type" | ||
></sp-icon-checkmark-circle> | ||
`; | ||
default: | ||
return html``; | ||
} | ||
return html` | ||
<sp-icon class="type" label=${label}> | ||
${icon({ hidden: true })} | ||
</sp-icon> | ||
`; | ||
} | ||
@@ -137,0 +133,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127941
1179
+ Added@spectrum-web-components/base@0.4.6(transitive)
+ Added@spectrum-web-components/button@0.13.7(transitive)
+ Added@spectrum-web-components/icon@0.9.11(transitive)
+ Added@spectrum-web-components/icons-ui@0.6.11(transitive)
+ Added@spectrum-web-components/icons-workflow@0.6.11(transitive)
+ Added@spectrum-web-components/iconset@0.5.8(transitive)
+ Added@spectrum-web-components/shared@0.12.11(transitive)
- Removed@spectrum-web-components/base@0.3.3(transitive)
- Removed@spectrum-web-components/button@0.12.0(transitive)
- Removed@spectrum-web-components/icon@0.8.3(transitive)
- Removed@spectrum-web-components/icons-ui@0.5.3(transitive)
- Removed@spectrum-web-components/icons-workflow@0.5.3(transitive)
- Removed@spectrum-web-components/iconset@0.4.3(transitive)
- Removed@spectrum-web-components/shared@0.10.0(transitive)