Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/toast

Package Overview
Dependencies
Maintainers
5
Versions
287
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/toast - npm Package Compare versions

Comparing version 0.7.3 to 0.8.0

6

CHANGELOG.md

@@ -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 @@

14

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc