scb-wc-test 0.1.87 → 0.1.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,120 +0,0 @@
1
- import{a as d,n as r,i as f,x as p,t as h}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(n,c,o){try{customElements.get(n)||s(n,c,o)}catch(l){var a=String(l||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var u=Object.defineProperty,x=Object.getOwnPropertyDescriptor,e=(i,s,n,c)=>{for(var o=c>1?void 0:c?x(s,n):s,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(c?l(s,n,o):l(o))||o);return c&&o&&u(s,n,o),o};let t=class extends f{constructor(){super(...arguments),this.open=!1,this.label="",this.type="success",this.linkText="",this.linkhref="#",this.showIcon=!1,this.showCloseButton=!1,this._closeNotification=()=>{this.open=!1;const i=new CustomEvent("close",{detail:{open:this.open}});this.dispatchEvent(i)}}_iconForType(){switch(this.type){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";case"info":return"info";default:return"info"}}render(){return p`
2
- <div class="notification" type=${this.type} role="alert" aria-live="assertive" aria-atomic="true" style="display: ${this.open?"flex":"none"};">
3
- ${this.showIcon||this.showCloseButton?p`<div class="notification-header">
4
- ${this.showIcon?p`<md-icon>${this._iconForType()}</md-icon>`:""}
5
- ${this.showCloseButton?p`<scb-icon-button icon="close" @click=${this._closeNotification}></scb-icon-button>`:""}
6
- </div>`:""}
7
- <div class="notification-content">
8
- ${this.label?p`<div class="notification-label">${this.label}</div>`:""}
9
- <slot></slot>
10
- ${this.linkText?p`
11
- <div class="notification-footer">
12
- <a class="footer-link" href="${this.linkhref}">${this.linkText}</a>
13
- </div>
14
- `:""}
15
- <div>
16
- </div>
17
- `}};t.styles=[d`
18
- :host {
19
- display: block;
20
- position: relative;
21
- container-type: inline-size;
22
- container-name: notification-container;
23
- }
24
-
25
- .notification {
26
- border-radius: 12px;
27
- padding: 16px;
28
- display: flex;
29
- gap: 12px;
30
- flex-direction: column;
31
-
32
- }
33
- @container notification-container (min-width: 400px) {
34
- .notification {
35
- flex-direction: row;
36
- }
37
- .notification-label {
38
- margin-right: 40px;
39
- }
40
- }
41
- .notification-label {
42
- font-weight: 600;
43
- font-size: 20px;
44
- line-height: 28px; /* 140% */
45
- letter-spacing: -0.4px;
46
- }
47
- .notification[type="success"] {
48
- background: var(--md-sys-color-success-container);
49
- color: var(--md-sys-color-on-success-container);
50
-
51
- a{
52
- text-decoration: underline;
53
- text-decoration-thickness: 1px;
54
- text-underline-offset: .1578em;
55
- color: var(--md-sys-color-on-success-container);
56
- &:hover {text-decoration-thickness: 2px;}
57
- }
58
- }
59
- .notification[type="error"] {
60
- background: var(--md-sys-color-error-container);
61
- color: var(--md-sys-color-on-error-container);
62
- a{
63
- text-decoration: underline;
64
- text-decoration-thickness: 1px;
65
- text-underline-offset: .1578em;
66
- color: var(--md-sys-color-on-error-container);
67
- &:hover {text-decoration-thickness: 2px;}
68
- }
69
- }
70
- .notification[type="warning"] {
71
- background: var(--md-sys-color-warning-container);
72
- color: var(--md-sys-color-on-warning-container);
73
- a{
74
- text-decoration: underline;
75
- text-decoration-thickness: 1px;
76
- text-underline-offset: .1578em;
77
- color: var(--md-sys-color-on-warning-container);
78
- &:hover {text-decoration-thickness: 2px;}
79
- }
80
- }
81
- .notification[type="info"] {
82
- background: var(--md-sys-color-info-container);
83
- color: var(--md-sys-color-on-info-container);
84
- a{
85
- text-decoration: underline;
86
- text-decoration-thickness: 1px;
87
- text-underline-offset: .1578em;
88
- color: var(--md-sys-color-on-info-container);
89
- &:hover {text-decoration-thickness: 2px;}
90
- }
91
- }
92
- .notification-header scb-icon-button {
93
- position: absolute;
94
- right: 8px;
95
- top: 8px;
96
- }
97
- .notification-content{
98
- display: flex;
99
- flex-direction: column;
100
- gap: 4px;
101
- }
102
- slot{
103
- font-size: 18px;
104
- line-height: 26px;
105
- }
106
- .notification-footer {
107
- font-size: 18px;
108
- margin-top: 4px;
109
- line-height: 26px; /* 133% */
110
- }
111
-
112
- :host([open]) .notification {
113
- opacity: 1;
114
- }
115
-
116
- :host(:not([open])) .notification {
117
- opacity: 0;
118
- pointer-events: none;
119
- }
120
- `];e([r({type:Boolean,reflect:!0})],t.prototype,"open",2);e([r({type:String})],t.prototype,"label",2);e([r({type:String})],t.prototype,"type",2);e([r({type:String,attribute:"link-text"})],t.prototype,"linkText",2);e([r({type:String,attribute:"link-href"})],t.prototype,"linkhref",2);e([r({type:Boolean,attribute:"show-icon"})],t.prototype,"showIcon",2);e([r({type:Boolean,attribute:"show-close-button"})],t.prototype,"showCloseButton",2);t=e([h("scb-notification")],t);
@@ -1,15 +0,0 @@
1
- import { LitElement } from 'lit';
2
- export declare class ScbNotification extends LitElement {
3
- open: boolean;
4
- label: string;
5
- type: string;
6
- linkText: string;
7
- linkhref: string;
8
- showIcon: boolean;
9
- showCloseButton: boolean;
10
- static styles: import('lit').CSSResult[];
11
- /** Return icon name for notification type */
12
- private _iconForType;
13
- private _closeNotification;
14
- render(): import('lit-html').TemplateResult<1>;
15
- }
@@ -1,187 +0,0 @@
1
- import { css as h, LitElement as f, html as n } from "lit";
2
- import { property as i, customElement as d } from "lit/decorators.js";
3
- import "../scb-icon-button/scb-icon-button.js";
4
- import "@material/web/icon/icon.js";
5
- var x = Object.defineProperty, u = Object.getOwnPropertyDescriptor, o = (r, s, a, c) => {
6
- for (var e = c > 1 ? void 0 : c ? u(s, a) : s, l = r.length - 1, p; l >= 0; l--)
7
- (p = r[l]) && (e = (c ? p(s, a, e) : p(e)) || e);
8
- return c && e && x(s, a, e), e;
9
- };
10
- let t = class extends f {
11
- constructor() {
12
- super(...arguments), this.open = !1, this.label = "", this.type = "success", this.linkText = "", this.linkhref = "#", this.showIcon = !1, this.showCloseButton = !1, this._closeNotification = () => {
13
- this.open = !1;
14
- const r = new CustomEvent("close", {
15
- detail: { open: this.open }
16
- });
17
- this.dispatchEvent(r);
18
- };
19
- }
20
- /** Return icon name for notification type */
21
- _iconForType() {
22
- switch (this.type) {
23
- case "success":
24
- return "check_circle";
25
- case "error":
26
- return "error";
27
- case "warning":
28
- return "warning";
29
- case "info":
30
- return "info";
31
- default:
32
- return "info";
33
- }
34
- }
35
- render() {
36
- return n`
37
- <div class="notification" type=${this.type} role="alert" aria-live="assertive" aria-atomic="true" style="display: ${this.open ? "flex" : "none"};">
38
- ${this.showIcon || this.showCloseButton ? n`<div class="notification-header">
39
- ${this.showIcon ? n`<md-icon>${this._iconForType()}</md-icon>` : ""}
40
- ${this.showCloseButton ? n`<scb-icon-button icon="close" @click=${this._closeNotification}></scb-icon-button>` : ""}
41
- </div>` : ""}
42
- <div class="notification-content">
43
- ${this.label ? n`<div class="notification-label">${this.label}</div>` : ""}
44
- <slot></slot>
45
- ${this.linkText ? n`
46
- <div class="notification-footer">
47
- <a class="footer-link" href="${this.linkhref}">${this.linkText}</a>
48
- </div>
49
- ` : ""}
50
- <div>
51
- </div>
52
- `;
53
- }
54
- };
55
- t.styles = [
56
- h`
57
- :host {
58
- display: block;
59
- position: relative;
60
- container-type: inline-size;
61
- container-name: notification-container;
62
- }
63
-
64
- .notification {
65
- border-radius: 12px;
66
- padding: 16px;
67
- display: flex;
68
- gap: 12px;
69
- flex-direction: column;
70
-
71
- }
72
- @container notification-container (min-width: 400px) {
73
- .notification {
74
- flex-direction: row;
75
- }
76
- .notification-label {
77
- margin-right: 40px;
78
- }
79
- }
80
- .notification-label {
81
- font-weight: 600;
82
- font-size: 20px;
83
- line-height: 28px; /* 140% */
84
- letter-spacing: -0.4px;
85
- }
86
- .notification[type="success"] {
87
- background: var(--md-sys-color-success-container);
88
- color: var(--md-sys-color-on-success-container);
89
-
90
- a{
91
- text-decoration: underline;
92
- text-decoration-thickness: 1px;
93
- text-underline-offset: .1578em;
94
- color: var(--md-sys-color-on-success-container);
95
- &:hover {text-decoration-thickness: 2px;}
96
- }
97
- }
98
- .notification[type="error"] {
99
- background: var(--md-sys-color-error-container);
100
- color: var(--md-sys-color-on-error-container);
101
- a{
102
- text-decoration: underline;
103
- text-decoration-thickness: 1px;
104
- text-underline-offset: .1578em;
105
- color: var(--md-sys-color-on-error-container);
106
- &:hover {text-decoration-thickness: 2px;}
107
- }
108
- }
109
- .notification[type="warning"] {
110
- background: var(--md-sys-color-warning-container);
111
- color: var(--md-sys-color-on-warning-container);
112
- a{
113
- text-decoration: underline;
114
- text-decoration-thickness: 1px;
115
- text-underline-offset: .1578em;
116
- color: var(--md-sys-color-on-warning-container);
117
- &:hover {text-decoration-thickness: 2px;}
118
- }
119
- }
120
- .notification[type="info"] {
121
- background: var(--md-sys-color-info-container);
122
- color: var(--md-sys-color-on-info-container);
123
- a{
124
- text-decoration: underline;
125
- text-decoration-thickness: 1px;
126
- text-underline-offset: .1578em;
127
- color: var(--md-sys-color-on-info-container);
128
- &:hover {text-decoration-thickness: 2px;}
129
- }
130
- }
131
- .notification-header scb-icon-button {
132
- position: absolute;
133
- right: 8px;
134
- top: 8px;
135
- }
136
- .notification-content{
137
- display: flex;
138
- flex-direction: column;
139
- gap: 4px;
140
- }
141
- slot{
142
- font-size: 18px;
143
- line-height: 26px;
144
- }
145
- .notification-footer {
146
- font-size: 18px;
147
- margin-top: 4px;
148
- line-height: 26px; /* 133% */
149
- }
150
-
151
- :host([open]) .notification {
152
- opacity: 1;
153
- }
154
-
155
- :host(:not([open])) .notification {
156
- opacity: 0;
157
- pointer-events: none;
158
- }
159
- `
160
- ];
161
- o([
162
- i({ type: Boolean, reflect: !0 })
163
- ], t.prototype, "open", 2);
164
- o([
165
- i({ type: String })
166
- ], t.prototype, "label", 2);
167
- o([
168
- i({ type: String })
169
- ], t.prototype, "type", 2);
170
- o([
171
- i({ type: String, attribute: "link-text" })
172
- ], t.prototype, "linkText", 2);
173
- o([
174
- i({ type: String, attribute: "link-href" })
175
- ], t.prototype, "linkhref", 2);
176
- o([
177
- i({ type: Boolean, attribute: "show-icon" })
178
- ], t.prototype, "showIcon", 2);
179
- o([
180
- i({ type: Boolean, attribute: "show-close-button" })
181
- ], t.prototype, "showCloseButton", 2);
182
- t = o([
183
- d("scb-notification")
184
- ], t);
185
- export {
186
- t as ScbNotification
187
- };