New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bliss-design-system/alert

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bliss-design-system/alert - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

dist/BlissAlert.js

24

dist/index.js

@@ -1,15 +0,9 @@

import{ifDefined as e}from"lit/directives/if-defined.js";import{property as t,state as o}from"lit/decorators.js";import{css as r,LitElement as i,html as s}from"lit";function l(e,t,o,r){var i,s=arguments.length,l=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(l=(s<3?i(l):s>3?i(t,o,l):i(t,o))||l);return s>3&&l&&Object.defineProperty(t,o,l),l}const n=r`:host([hidden]){display:none}:host [part=alert]{background-color:#f5f8ff;border-color:#186bf2;display:flex;position:relative;padding:16px 12px;overflow:hidden;border-width:1px;border-style:solid;border-radius:2px;border-left-width:4px;font-family:inherit}:host [part=icon]{color:#186bf2}:host [part=heading]{color:#1f2328;font-size:1.25rem;line-height:1.25;margin:0 0 4px}:host [part=content]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;color:#444a55;font-size:1rem;line-height:1.5;margin:0 0 0 16px}:host [part=content] ::slotted(*){margin:0;font-size:inherit;line-height:inherit}:host [part=close]::slotted(button){color:#186bf2}:host [part=close]::slotted(button:hover){background-color:#d6e7ff;border-color:#d6e7ff}:host [part=close]::slotted(button:active){background-color:#a3c7ff;border-color:#a3c7ff;color:#003fa3}:host [part=close]::slotted(button){appearance:none;background-color:transparent;border-radius:2px;box-sizing:border-box;border:0;cursor:pointer;margin:0 0 0 auto;padding:0;user-select:none;align-self:flex-start}:host [part=close]::slotted(button:focus-visible){outline:2px solid #186bf2;outline-offset:1px}:host([dismissible]) [part=content]{margin-right:32px}:host([size=small]) [part=alert]{padding:8px 16px 8px 12px}:host([theme=neutral]) [part=alert]{background-color:#f4f4f6;border-color:#6c7789}:host([theme=neutral]) [part=icon]{color:#6c7789}:host([theme=neutral]) [part=close]::slotted(button){color:#6c7789}:host([theme=neutral]) [part=close]::slotted(button:hover){background-color:#e2e5e9;border-color:#e2e5e9}:host([theme=neutral]) [part=close]::slotted(button:active){background-color:#ccd0d7;border-color:#ccd0d7;color:#32363e}:host([theme=positive]) [part=alert]{background-color:#ebfaf5;border-color:#0b8e67}:host([theme=positive]) [part=icon]{color:#0b8e67}:host([theme=positive]) [part=close]::slotted(button){color:#0b8e67}:host([theme=positive]) [part=close]::slotted(button:hover){background-color:#caf2e6;border-color:#caf2e6}:host([theme=positive]) [part=close]::slotted(button:active){background-color:#8de2c9;border-color:#8de2c9;color:#056145}:host([theme=notice]) [part=alert]{background-color:#fffbeb;border-color:#8b6704}:host([theme=notice]) [part=icon]{color:#8b6704}:host([theme=notice]) [part=close]::slotted(button){color:#8b6704}:host([theme=notice]) [part=close]::slotted(button:hover){background-color:#fcf3cf;border-color:#fcf3cf}:host([theme=notice]) [part=close]::slotted(button:active){background-color:#fbecb1;border-color:#fbecb1;color:#8b6704}:host([theme=warning]) [part=alert]{background-color:#fff7f0;border-color:#c25405}:host([theme=warning]) [part=icon]{color:#c25405}:host([theme=warning]) [part=close]::slotted(button){color:#c25405}:host([theme=warning]) [part=close]::slotted(button:hover){background-color:#fde4ce;border-color:#fde4ce}:host([theme=warning]) [part=close]::slotted(button:active){background-color:#fbbe89;border-color:#fbbe89;color:#863603}:host([theme=critical]) [part=alert]{background-color:#fff0f1;border-color:#a81523}:host([theme=critical]) [part=icon]{color:#a81523}:host([theme=critical]) [part=close]::slotted(button){color:#a81523}:host([theme=critical]) [part=close]::slotted(button:hover){background-color:#fed2d6;border-color:#fed2d6}:host([theme=critical]) [part=close]::slotted(button:active){background-color:#fba7af;border-color:#fba7af;color:#780712}`;class c extends i{constructor(){super(...arguments),this.size="medium",this.icon="info",this.theme="default",this.dismissible=!1,this.closeText="Close",this.politenessLevel="polite",this.headingEl=null}static get styles(){return[n]}close(){var e;const t=this.parentNode;null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}connectedCallback(){super.connectedCallback(),this.setPolitenessLevel(),this.renderShadowHeading(),this.renderLightIcon(),this.renderLightCloseButton()}renderLightIcon(){const e=this.querySelector("bliss-icon");if(e)e.setAttribute("name",this.icon);else{const e=document.createElement("bliss-icon");e.slot="icon",e.setAttribute("name",this.icon),this.prepend(e)}}renderLightCloseButton(){const e=this.querySelector("button");if(!e&&this.dismissible){const e=document.createElement("button"),t={slot:"close","aria-label":this.closeText};Object.entries(t).forEach((([t,o])=>{e.setAttribute(t,o)})),e.innerHTML='<bliss-icon name="close-clean" aria-hidden="true"></bliss-icon>',e.onclick=this.close,this.append(e)}else e&&!this.dismissible&&this.removeChild(e)}renderShadowHeading(){this.heading&&("medium"!==this.size?(console.warn("%c[Bliss Warn]:","font-weight: 600;",`The '${this.size}' alert size does not support a heading. If you'd like to use one, please set the size to 'medium'.`),this.headingEl=null):this.headingEl=s`<h3 part="heading" id="bliss-alert-heading">
${this.heading}
</h3>`)}updated(e){e.has("icon")&&this.renderLightIcon(),e.has("theme")&&this.setPolitenessLevel(),(e.has("heading")||e.has("size"))&&this.renderShadowHeading(),e.has("dismissible")&&this.renderLightCloseButton()}setPolitenessLevel(){"critical"===this.theme&&(this.politenessLevel="assertive")}render(){const t=this.headingEl?"bliss-alert-heading":void 0;return s`<div part="alert">
<slot part="icon" name="icon" aria-hidden="true"></slot>
<div
part="content"
aria-labelledby="${e(t)}"
aria-describedby="bliss-alert-content"
aria-live="${this.politenessLevel}"
>
${this.headingEl}
<slot id="bliss-alert-content"></slot>
</div>
<slot part="close" name="close"></slot>
</div>`}}l([t({type:String})],c.prototype,"heading",void 0),l([t({type:String})],c.prototype,"size",void 0),l([t({type:String})],c.prototype,"icon",void 0),l([t({type:String})],c.prototype,"theme",void 0),l([t({type:Boolean})],c.prototype,"dismissible",void 0),l([t({type:String,attribute:"close-text"})],c.prototype,"closeText",void 0),l([o()],c.prototype,"politenessLevel",void 0),l([o()],c.prototype,"headingEl",void 0);const a=()=>{window.customElements.get("bliss-alert")?console.info("%c[Bliss Info]:","font-weight: 600;","<bliss-alert> has already been registered."):window.customElements.define("bliss-alert",c)};export{c as BlissAlert,a as blissRegisterAlert};
import { BlissAlert } from './BlissAlert.js';
const blissRegisterAlert = () => {
if (window.customElements.get('bliss-alert')) {
console.info('%c[Bliss Info]:', 'font-weight: 600;', '<bliss-alert> has already been registered.');
return;
}
window.customElements.define('bliss-alert', BlissAlert);
};
export { BlissAlert, blissRegisterAlert };
{
"name": "@bliss-design-system/alert",
"version": "1.1.1",
"version": "1.2.0",
"description": "",

@@ -41,3 +41,3 @@ "repository": {

"dependencies": {
"lit": "^2.0.0"
"lit": "2.0.0-rc.2"
},

@@ -48,4 +48,4 @@ "devDependencies": {

"peerDependencies": {
"@bliss/iconset": "^1.0.2",
"@bliss-design-system/icon": "^2.2.0"
"@bliss/iconset": "^1.0.5",
"@bliss-design-system/icon": "^2.1.1"
},

@@ -52,0 +52,0 @@ "contributes": {

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