@nectary/components 0.23.0 → 0.25.0
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.
- package/accordion/index.js +3 -6
- package/accordion-item/index.js +3 -6
- package/alert/index.js +3 -5
- package/alert-button/index.js +3 -6
- package/alert-close/index.js +3 -6
- package/avatar/index.js +3 -5
- package/avatar-badge/index.js +3 -5
- package/avatar-status/index.js +3 -5
- package/button/index.js +3 -6
- package/card/index.js +3 -6
- package/card-button/index.js +3 -6
- package/card-container/index.js +3 -6
- package/card-link/index.js +3 -6
- package/chat/index.js +3 -6
- package/chat-avatar/index.js +3 -6
- package/chat-block/index.js +3 -6
- package/chat-bubble/index.js +3 -6
- package/checkbox/index.js +3 -6
- package/colors.json +2 -0
- package/dialog/index.d.ts +2 -3
- package/dialog/index.js +3 -6
- package/dropdown/index.js +4 -7
- package/dropdown-option/index.d.ts +2 -1
- package/dropdown-option/index.js +4 -6
- package/grid/index.js +3 -5
- package/grid-item/index.js +3 -5
- package/help-tooltip/index.js +3 -5
- package/icon-button/index.js +3 -6
- package/icons/create-icon-class.d.ts +1 -1
- package/icons/create-icon-class.js +3 -5
- package/icons-branded/create-icon-class.d.ts +1 -1
- package/icons-branded/create-icon-class.js +3 -5
- package/icons-channel/create-icon-class.d.ts +1 -1
- package/icons-channel/create-icon-class.js +3 -5
- package/illustration/create-illustration-class.d.ts +1 -1
- package/illustration/create-illustration-class.js +3 -5
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/input/index.js +3 -6
- package/link/index.js +5 -26
- package/logo/create-logo-class.d.ts +1 -1
- package/logo/create-logo-class.js +3 -5
- package/package.json +3 -5
- package/pagination/index.d.ts +4 -1
- package/pagination/index.js +17 -6
- package/popover/index.js +3 -6
- package/radio/index.js +3 -6
- package/radio-option/index.js +3 -6
- package/search/index.js +38 -26
- package/search-option/index.js +3 -5
- package/segment/index.js +3 -6
- package/segment-collapse/index.js +13 -33
- package/segmented-control/index.d.ts +20 -0
- package/segmented-control/index.js +208 -0
- package/segmented-control-option/index.d.ts +29 -0
- package/segmented-control-option/index.js +112 -0
- package/select/index.js +22 -8
- package/spinner/index.js +3 -5
- package/table/index.js +3 -5
- package/table-body/index.js +3 -5
- package/table-cell/index.js +3 -5
- package/table-head/index.js +3 -5
- package/table-head-cell/index.js +3 -5
- package/table-row/index.js +3 -5
- package/tabs/index.js +4 -7
- package/tabs-option/index.js +12 -31
- package/tag/index.js +3 -5
- package/tag-close/index.js +3 -6
- package/textarea/index.js +3 -6
- package/title/index.js +3 -6
- package/toggle/index.js +3 -6
- package/tooltip/index.js +3 -5
- package/utils.d.ts +10 -3
- package/utils.js +22 -14
package/accordion/index.js
CHANGED
|
@@ -8,11 +8,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import { isAccordionItemElement } from '../accordion-item';
|
|
11
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, getCSVSet, getFirstCSValue, updateAttribute, updateBooleanAttribute, updateCSV } from '../utils';
|
|
11
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, getCSVSet, getFirstCSValue, NectaryElement, updateAttribute, updateBooleanAttribute, updateCSV } from '../utils';
|
|
12
12
|
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%}::slotted(sinch-accordion-item){flex-shrink:1}</style><div id="wrapper"><slot></slot></div>';
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-accordion', (_$slot = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-accordion', (_$slot = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -49,10 +49,7 @@ defineCustomElement('sinch-accordion', (_$slot = new WeakMap(), _onSlotChange =
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
const shadowRoot = this.attachShadow(
|
|
53
|
-
mode: 'closed',
|
|
54
|
-
delegatesFocus: true
|
|
55
|
-
});
|
|
52
|
+
const shadowRoot = this.attachShadow();
|
|
56
53
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
57
54
|
shadowRoot.addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
|
|
58
55
|
|
package/accordion-item/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../icons/keyboard-arrow-down';
|
|
11
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, getLiteralAttribute, isAttrTrue, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
|
|
11
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, getLiteralAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
|
|
12
12
|
const templateHTML = '<style>:host{display:block;outline:0;min-height:48px}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border-bottom:1px solid var(--sinch-color-stormy-200);--sinch-size-icon:16px}#button{all:initial;cursor:pointer;display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;height:48px;padding:12px 8px;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);fill:var(--sinch-color-stormy-500)}#button>*{pointer-events:none}#button:disabled{cursor:initial;color:var(--sinch-color-stormy-100);fill:var(--sinch-color-stormy-100)}#button::before{width:8px;height:8px;border-radius:50%;margin-left:2px;margin-right:8px}:host([status=success]) #button::before{content:"";background-color:var(--sinch-color-success-500)}:host([status=warn]) #button::before{content:"";background-color:var(--sinch-color-warning-500)}:host([status=error]) #button::before{content:"";background-color:var(--sinch-color-error-500)}:host([status=info]) #button::before{content:"";background-color:var(--sinch-color-informative-500)}#title{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#content{display:none;overflow-y:auto;flex-shrink:1;min-height:0;padding:0 8px 18px;font:var(--sinch-font-body);color:var(--sinch-color-text-default)}#dropdown-icon{--sinch-size-icon:24px}#button[aria-expanded=true]>#dropdown-icon{transform:rotate(180deg)}#button[aria-expanded=true]+#content{display:block}#optional{font:var(--sinch-font-small-text);color:var(--sinch-color-stormy-300)}</style><div id="wrapper"><button id="button" aria-controls="content" aria-expanded="false"><slot name="icon"></slot><span id="title"></span> <span id="optional"></span><sinch-icon-keyboard-arrow-down id="dropdown-icon"></sinch-icon-keyboard-arrow-down></button><div id="content" role="region" aria-labelledby="button"><slot name="content"></slot></div></div>';
|
|
13
13
|
export const isAccordionItemElement = element => {
|
|
14
14
|
return element instanceof Element && element.tagName === 'SINCH-ACCORDION-ITEM';
|
|
@@ -16,7 +16,7 @@ export const isAccordionItemElement = element => {
|
|
|
16
16
|
const statusValues = ['info', 'success', 'warn', 'error'];
|
|
17
17
|
const template = document.createElement('template');
|
|
18
18
|
template.innerHTML = templateHTML;
|
|
19
|
-
defineCustomElement('sinch-accordion-item', (_$button = new WeakMap(), _$buttonContent = new WeakMap(), _$optionalText = new WeakMap(), _onButtonClick = new WeakMap(), class extends
|
|
19
|
+
defineCustomElement('sinch-accordion-item', (_$button = new WeakMap(), _$buttonContent = new WeakMap(), _$optionalText = new WeakMap(), _onButtonClick = new WeakMap(), class extends NectaryElement {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
|
|
@@ -49,10 +49,7 @@ defineCustomElement('sinch-accordion-item', (_$button = new WeakMap(), _$buttonC
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
const shadowRoot = this.attachShadow(
|
|
53
|
-
mode: 'closed',
|
|
54
|
-
delegatesFocus: true
|
|
55
|
-
});
|
|
52
|
+
const shadowRoot = this.attachShadow();
|
|
56
53
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
57
54
|
|
|
58
55
|
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('#button'));
|
package/alert/index.js
CHANGED
|
@@ -7,12 +7,12 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, getLiteralAttribute, updateBooleanAttribute, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, getLiteralAttribute, updateBooleanAttribute, updateAttribute, updateLiteralAttribute, NectaryElement } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{--sinch-color-alert-info-background:#D5E5F8;--sinch-color-alert-success-background:#D7F1D8;--sinch-color-alert-warn-background:#FFE8D6;--sinch-color-alert-error-background:#FCD7D4;display:block}#wrapper{display:flex;flex-direction:row;column-gap:12px;align-items:center;position:relative;padding:12px 18px;border-radius:4px;font:var(--sinch-font-body);color:var(--sinch-color-stormy-600);background-color:var(--sinch-color-alert-info-background);box-sizing:border-box;width:100%;min-height:56px}#body-wrapper{display:flex;flex-direction:row;align-items:center;column-gap:12px;flex:1;min-width:0}#title{display:none;font:var(--sinch-font-title-s);margin:0;margin-bottom:4px}#text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;flex:1;min-width:0}:is(#icon-info,#icon-success,#icon-warn,#icon-error){display:none}:host([type=success]) #wrapper{background-color:var(--sinch-color-alert-success-background)}:host([type=warn]) #wrapper{background-color:var(--sinch-color-alert-warn-background)}:host([type=error]) #wrapper{background-color:var(--sinch-color-alert-error-background)}:host([type=info]) #wrapper{background-color:var(--sinch-color-alert-info-background)}:host([type=success]) #icon-success{display:block}:host([type=warn]) #icon-warn{display:block}:host([type=error]) #icon-error{display:block}:host(:is([type=info],:not([type]))) #icon-info{display:block}:host([multiline]:not([multiline=false])) #wrapper{align-items:flex-start;padding:16px 18px}:host([multiline]:not([multiline=false])) #body-wrapper{flex-direction:column;align-items:flex-start}:host([multiline]:not([multiline=false])) #title{display:block}:host([multiline]:not([multiline=false])) :is(#icon-info,#icon-success,#icon-warn,#icon-error){margin-top:2px}:host([multiline]:not([multiline=false])) #text{overflow:unset;text-overflow:unset;white-space:unset}:host([multiline]:not([multiline=false])) ::slotted(sinch-alert-button){margin-top:10px}</style><div id="wrapper"><svg id="icon-info" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0Zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1Zm1-8H9V5h2v2Z" fill="#2071CE"/></svg> <svg id="icon-success" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0ZM7.29 14.29 3.7 10.7a.996.996 0 1 1 1.41-1.41L8 12.17l6.88-6.88a.996.996 0 1 1 1.41 1.41L8.7 14.29a.996.996 0 0 1-1.41 0Z" fill="#2E8540"/></svg> <svg id="icon-warn" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path d="M2.47 18h15.06c1.54 0 2.5-1.67 1.73-3L11.73 1.99c-.77-1.33-2.69-1.33-3.46 0L.74 15c-.77 1.33.19 3 1.73 3ZM10 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1Zm1 4H9v-2h2v2Z" fill="#FF8C34"/></svg> <svg id="icon-error" width="20" height="20" viewBox="0 0 18 18" aria-hidden="true"><path d="M12.32 0H5.68c-.26 0-.52.11-.7.29L.29 4.98c-.18.18-.29.44-.29.7v6.63c0 .27.11.52.29.71l4.68 4.68c.19.19.45.3.71.3h6.63c.27 0 .52-.11.71-.29l4.68-4.68a.99.99 0 0 0 .29-.71V5.68c0-.27-.11-.52-.29-.71L13.02.29c-.18-.18-.44-.29-.7-.29ZM9 14.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3ZM9 10c-.55 0-1-.45-1-1V5c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1Z" fill="#E31C3D"/></svg><div id="body-wrapper"><p id="title"></p><p id="text"></p><slot name="button"></slot></div><slot name="close"></slot></div>';
|
|
12
12
|
const typeValues = ['info', 'success', 'warn', 'error'];
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-alert', (_$text = new WeakMap(), _$title = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-alert', (_$text = new WeakMap(), _$title = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -26,9 +26,7 @@ defineCustomElement('sinch-alert', (_$text = new WeakMap(), _$title = new WeakMa
|
|
|
26
26
|
value: void 0
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const shadowRoot = this.attachShadow(
|
|
30
|
-
mode: 'closed'
|
|
31
|
-
});
|
|
29
|
+
const shadowRoot = this.attachShadow();
|
|
32
30
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
33
31
|
|
|
34
32
|
_classPrivateFieldSet(this, _$text, shadowRoot.querySelector('#text'));
|
package/alert-button/index.js
CHANGED
|
@@ -7,11 +7,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getAttribute, updateAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;padding:9px 16px;border:1px solid var(--sinch-color-stormy-500);border-radius:4px;font:var(--sinch-font-body);font-size:14px;line-height:14px;color:var(--sinch-color-stormy-500);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;height:32px;box-sizing:border-box}</style><button></button>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-alert-button', (_$button = new WeakMap(), class extends
|
|
14
|
+
defineCustomElement('sinch-alert-button', (_$button = new WeakMap(), class extends NectaryElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
|
|
@@ -20,10 +20,7 @@ defineCustomElement('sinch-alert-button', (_$button = new WeakMap(), class exten
|
|
|
20
20
|
value: void 0
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const shadowRoot = this.attachShadow(
|
|
24
|
-
mode: 'closed',
|
|
25
|
-
delegatesFocus: true
|
|
26
|
-
});
|
|
23
|
+
const shadowRoot = this.attachShadow();
|
|
27
24
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
28
25
|
|
|
29
26
|
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('button'));
|
package/alert-close/index.js
CHANGED
|
@@ -8,11 +8,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../icons/close';
|
|
11
|
-
import { defineCustomElement } from '../utils';
|
|
11
|
+
import { defineCustomElement, NectaryElement } from '../utils';
|
|
12
12
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;display:block;width:24px;height:24px;box-sizing:border-box;cursor:pointer;--sinch-size-icon:24px}sinch-icon-close{display:block;pointer-events:none}</style><button aria-label="close"><sinch-icon-close></sinch-icon-close></button>';
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-alert-close', (_$button = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-alert-close', (_$button = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -21,10 +21,7 @@ defineCustomElement('sinch-alert-close', (_$button = new WeakMap(), class extend
|
|
|
21
21
|
value: void 0
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const shadowRoot = this.attachShadow(
|
|
25
|
-
mode: 'closed',
|
|
26
|
-
delegatesFocus: true
|
|
27
|
-
});
|
|
24
|
+
const shadowRoot = this.attachShadow();
|
|
28
25
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
29
26
|
|
|
30
27
|
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('button'));
|
package/avatar/index.js
CHANGED
|
@@ -8,13 +8,13 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../icons/cancel';
|
|
11
|
-
import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
11
|
+
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
12
12
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:40px;height:40px;font:var(--sinch-font-title-s);line-height:38px;color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-700);text-align:center;border-radius:50%;border:1px solid var(--sinch-color-snow-100);box-sizing:border-box;text-transform:uppercase;--sinch-avatar-badge-size:16px;--sinch-avatar-badge-font:700 12px/14px "Gilroy","Arial","sans-serif"}:host([background=blue]) #wrapper{background-color:var(--sinch-color-stormy-500);color:var(--sinch-color-snow-100)}:host([background=yellow]) #wrapper{background-color:var(--sinch-color-honey-500)}:host([size="l"]) #wrapper{width:56px;height:56px;font:var(--sinch-font-title-m);line-height:54px;--sinch-avatar-badge-size:20px;--sinch-avatar-badge-font:700 12px/18px "Gilroy","Arial","sans-serif"}:host([size="s"]) #wrapper{width:24px;height:24px;font:var(--sinch-font-extra-small-text);line-height:22px;--sinch-avatar-badge-size:11px;--sinch-avatar-badge-font:500 8px/9px "Gilroy","Arial","sans-serif"}#text{display:block;width:100%;height:100%;box-sizing:border-box}#image{display:none;width:100%;height:100%;object-fit:contain;position:absolute;left:0;top:0;border-radius:50%}:host([src]:not([src=""])) #image{display:block}::slotted(sinch-avatar-badge){position:absolute;top:-2px;left:calc(100% - 15px)}:host([size="l"]) ::slotted(sinch-avatar-badge){left:calc(100% - 19px)}:host([size="s"]) ::slotted(sinch-avatar-badge){left:calc(100% - 9px)}::slotted(sinch-avatar-status){position:absolute;bottom:-2px;right:-2px}:host([size="l"]) ::slotted(sinch-avatar-status){bottom:2px;right:2px}</style><div id="wrapper"><span id="text"></span> <img id="image" alt=""/><slot name="badge"></slot><slot name="status"></slot></div>';
|
|
13
13
|
const backgroundValues = ['grey', 'yellow', 'blue'];
|
|
14
14
|
const sizeValues = ['l', 'm', 's'];
|
|
15
15
|
const template = document.createElement('template');
|
|
16
16
|
template.innerHTML = templateHTML;
|
|
17
|
-
defineCustomElement('sinch-avatar', (_$text = new WeakMap(), _$image = new WeakMap(), class extends
|
|
17
|
+
defineCustomElement('sinch-avatar', (_$text = new WeakMap(), _$image = new WeakMap(), class extends NectaryElement {
|
|
18
18
|
constructor() {
|
|
19
19
|
super();
|
|
20
20
|
|
|
@@ -28,9 +28,7 @@ defineCustomElement('sinch-avatar', (_$text = new WeakMap(), _$image = new WeakM
|
|
|
28
28
|
value: void 0
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const shadowRoot = this.attachShadow(
|
|
32
|
-
mode: 'closed'
|
|
33
|
-
});
|
|
31
|
+
const shadowRoot = this.attachShadow();
|
|
34
32
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
35
33
|
|
|
36
34
|
_classPrivateFieldSet(this, _$text, shadowRoot.querySelector('#text'));
|
package/avatar-badge/index.js
CHANGED
|
@@ -8,11 +8,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../icons/cancel';
|
|
11
|
-
import { defineCustomElement, getAttribute, setClass, updateAttribute } from '../utils';
|
|
11
|
+
import { defineCustomElement, getAttribute, NectaryElement, setClass, updateAttribute } from '../utils';
|
|
12
12
|
const templateHTML = '<style>#text{width:var(--sinch-avatar-badge-size);height:var(--sinch-avatar-badge-size);border:1px solid var(--sinch-color-snow-100);border-radius:calc(var(--sinch-avatar-badge-size)/ 2);text-align:center;box-sizing:border-box;color:var(--sinch-color-snow-100);font:var(--sinch-avatar-badge-font);background-color:var(--sinch-color-raspberry-500)}#text.long{width:fit-content;padding:0 calc(var(--sinch-avatar-badge-size)/ 4)}</style><div id="text"></div>';
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-avatar-badge', (_$text = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-avatar-badge', (_$text = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -21,9 +21,7 @@ defineCustomElement('sinch-avatar-badge', (_$text = new WeakMap(), class extends
|
|
|
21
21
|
value: void 0
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const shadowRoot = this.attachShadow(
|
|
25
|
-
mode: 'closed'
|
|
26
|
-
});
|
|
24
|
+
const shadowRoot = this.attachShadow();
|
|
27
25
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
28
26
|
|
|
29
27
|
_classPrivateFieldSet(this, _$text, shadowRoot.querySelector('#text'));
|
package/avatar-status/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../icons/cancel';
|
|
2
|
-
import { defineCustomElement, getLiteralAttribute, updateLiteralAttribute } from '../utils';
|
|
2
|
+
import { defineCustomElement, getLiteralAttribute, NectaryElement, updateLiteralAttribute } from '../utils';
|
|
3
3
|
const templateHTML = '<style>#circle{width:10px;height:10px;border:1px solid var(--sinch-color-snow-100);border-radius:50%;box-sizing:border-box}:host([color=grey]) #circle{background-color:var(--sinch-color-snow-600)}:host([color=yellow]) #circle{background-color:var(--sinch-color-honey-500)}:host([color=red]) #circle{background-color:var(--sinch-color-raspberry-500)}:host([color=green]) #circle{background-color:var(--sinch-color-grass-400)}</style><div id="circle"></div>';
|
|
4
4
|
const colorValues = ['red', 'yellow', 'green', 'grey'];
|
|
5
5
|
|
|
@@ -11,12 +11,10 @@ const assertColor = value => {
|
|
|
11
11
|
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-avatar-status', class extends
|
|
14
|
+
defineCustomElement('sinch-avatar-status', class extends NectaryElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
|
-
const shadowRoot = this.attachShadow(
|
|
18
|
-
mode: 'closed'
|
|
19
|
-
});
|
|
17
|
+
const shadowRoot = this.attachShadow();
|
|
20
18
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
21
19
|
}
|
|
22
20
|
|
package/button/index.js
CHANGED
|
@@ -7,12 +7,12 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, getLiteralAttribute, isAttrTrue, updateBooleanAttribute, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, getLiteralAttribute, isAttrTrue, updateBooleanAttribute, updateAttribute, updateLiteralAttribute, NectaryElement } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{--sinch-color-button-background:var(--sinch-color-tropical-500);--sinch-color-button-background-hover:var(--sinch-color-tropical-400);--sinch-color-button-background-focus:var(--sinch-color-tropical-500);--sinch-color-button-background-active:var(--sinch-color-tropical-600);--sinch-color-button-background-disabled:var(--sinch-color-tropical-100);--sinch-color-button-text:var(--sinch-color-text-inverted);--sinch-color-button-text-disabled:var(--sinch-color-text-inverted);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-text-inverted);display:inline-block;vertical-align:middle;outline:0}:host([type=secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-tropical-100);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-tropical-100);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-tropical-500);--sinch-color-button-text-disabled:var(--sinch-color-tropical-100);--sinch-color-button-border:var(--sinch-color-tropical-500);--sinch-color-button-border-hover:var(--sinch-color-tropical-500);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-tropical-500);--sinch-color-button-border-disabled:var(--sinch-color-tropical-100);--sinch-color-spinner-bg:var(--sinch-color-tropical-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([type=secondary]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100)}:host([type=secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-tropical-200);--sinch-color-spinner-fg:var(--sinch-color-tropical-400)}:host([type=cta-primary]){--sinch-color-button-background:var(--sinch-color-honey-500);--sinch-color-button-background-hover:var(--sinch-color-honey-400);--sinch-color-button-background-focus:var(--sinch-color-honey-500);--sinch-color-button-background-active:var(--sinch-color-honey-600);--sinch-color-button-background-disabled:var(--sinch-color-honey-100);--sinch-color-button-text:var(--sinch-color-text-default);--sinch-color-button-text-disabled:var(--sinch-color-stormy-300);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-text-default);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-honey-700);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-text-default)}:host([type=cta-primary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-stormy-300)}:host([type=cta-secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-snow-500);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-snow-500);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-stormy-500);--sinch-color-button-text-disabled:var(--sinch-color-stormy-200);--sinch-color-button-border:var(--sinch-color-stormy-500);--sinch-color-button-border-hover:var(--sinch-color-stormy-500);--sinch-color-button-border-focus:var(--sinch-color-stormy-500);--sinch-color-button-border-active:var(--sinch-color-stormy-500);--sinch-color-button-border-disabled:var(--sinch-color-stormy-200);--sinch-color-spinner-bg:var(--sinch-color-snow-800);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-stormy-500)}:host([type=cta-secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-600);--sinch-color-spinner-fg:var(--sinch-color-stormy-200);--sinch-color-icon:var(--sinch-color-stormy-200)}:host([type=destructive]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-error-200);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-error-200);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-text-invalid);--sinch-color-button-text-disabled:var(--sinch-color-error-200);--sinch-color-button-border:var(--sinch-color-error-500);--sinch-color-button-border-hover:var(--sinch-color-error-500);--sinch-color-button-border-focus:var(--sinch-color-error-800);--sinch-color-button-border-active:var(--sinch-color-error-500);--sinch-color-button-border-disabled:var(--sinch-color-error-200);--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500);--sinch-color-icon:var(--sinch-color-text-invalid)}:host([type=destructive]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-raspberry-200);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}:host([type=destructive]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}button{all:initial;display:flex;align-items:center;justify-content:center;gap:15px;box-sizing:border-box;width:100%;height:48px;padding:12px;border-radius:4px;font:var(--sinch-font-title-s);color:var(--sinch-color-button-text);background-color:var(--sinch-color-button-background);box-shadow:0 0 0 1px var(--sinch-color-button-border) inset;cursor:pointer;--sinch-size-icon:24px}button:focus{background-color:var(--sinch-color-button-background-focus);box-shadow:0 0 0 2px var(--sinch-color-button-border-focus) inset}button:hover{background-color:var(--sinch-color-button-background-hover);box-shadow:0 0 0 1px var(--sinch-color-button-border-hover) inset}button:active{background-color:var(--sinch-color-button-background-active);box-shadow:0 0 0 2px var(--sinch-color-button-border-active) inset}button:disabled{color:var(--sinch-color-button-text-disabled);background-color:var(--sinch-color-button-background-disabled);box-shadow:0 0 0 1px var(--sinch-color-button-border-disabled) inset;cursor:initial;--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-200);--sinch-color-icon:var(--sinch-color-button-text-disabled)}button>*{pointer-events:none}#text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:none}:host([text]:not([text=""])) #text{display:initial}:host([text]:not([text=""])) button{padding:12px 24px}:host([small]:not([small=false]))>button{height:32px;padding:8px;line-height:16px;font-size:14px;gap:8px;--sinch-size-icon:16px}:host([text]:not([text=""])[small]:not([small=false])) button{padding:8px 16px}</style><button><slot name="icon"></slot><span id="text"></span></button>';
|
|
12
12
|
const buttonTypes = ['primary', 'secondary', 'cta-primary', 'cta-secondary', 'destructive'];
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-button', (_$button = new WeakMap(), _$text = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-button', (_$button = new WeakMap(), _$text = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -26,10 +26,7 @@ defineCustomElement('sinch-button', (_$button = new WeakMap(), _$text = new Weak
|
|
|
26
26
|
value: void 0
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const shadowRoot = this.attachShadow(
|
|
30
|
-
mode: 'closed',
|
|
31
|
-
delegatesFocus: true
|
|
32
|
-
});
|
|
29
|
+
const shadowRoot = this.attachShadow();
|
|
33
30
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
34
31
|
|
|
35
32
|
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('button'));
|
package/card/index.js
CHANGED
|
@@ -9,11 +9,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
9
9
|
|
|
10
10
|
import { isSinchCardButtonElement } from '../card-button';
|
|
11
11
|
import { isSinchCardLinkElement } from '../card-link';
|
|
12
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, setClass } from '../utils';
|
|
12
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, setClass, NectaryElement } from '../utils';
|
|
13
13
|
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative}#card-body{padding:24px;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;background-color:var(--sinch-color-snow-100);border-radius:8px;border:1px solid var(--sinch-color-snow-700)}#illustration-wrapper{display:none;flex-direction:column;align-items:center;border-top-left-radius:8px;border-top-right-radius:8px;overflow:hidden;background-color:var(--sinch-color-stormy-500);height:240px}#illustration-wrapper.active{display:flex}#illustration-wrapper.active+#card-body{border-top-left-radius:0;border-top-right-radius:0;border-top:none}#label{margin:0;font:var(--sinch-font-title-xs);color:var(--sinch-color-stormy-300);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#label:empty{display:none}#header{display:flex;flex-direction:row;align-items:center;gap:8px;--sinch-size-icon:48px}#title{font:var(--sinch-font-title-m);color:var(--sinch-color-stormy-500);flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#description{margin:0;font:var(--sinch-font-body);color:var(--sinch-color-stormy-500);flex:1;min-height:0;max-height:120px;overflow-y:auto}#description:empty{display:none}:host([disabled]:not([disabled=false])) :is(#illustration-wrapper,#description,#header,#label){opacity:.6}::slotted(sinch-card-button),::slotted(sinch-card-link){margin-top:20px;align-self:flex-start;max-width:100%}</style><div id="wrapper"><div id="illustration-wrapper"><slot name="illustration"></slot></div><div id="card-body"><p id="label"></p><div id="header"><slot name="icon"></slot><span id="title"></span></div><p id="description"></p><slot name="action"></slot></div></div>';
|
|
14
14
|
const template = document.createElement('template');
|
|
15
15
|
template.innerHTML = templateHTML;
|
|
16
|
-
defineCustomElement('sinch-card', (_$text = new WeakMap(), _$label = new WeakMap(), _$title = new WeakMap(), _$illustrationSlot = new WeakMap(), _$actionSlot = new WeakMap(), _$illustrationSlotWrapper = new WeakMap(), _onIllustrationSlotChange = new WeakMap(), _updateDisabledAttributeInChildren = new WeakMap(), class extends
|
|
16
|
+
defineCustomElement('sinch-card', (_$text = new WeakMap(), _$label = new WeakMap(), _$title = new WeakMap(), _$illustrationSlot = new WeakMap(), _$actionSlot = new WeakMap(), _$illustrationSlotWrapper = new WeakMap(), _onIllustrationSlotChange = new WeakMap(), _updateDisabledAttributeInChildren = new WeakMap(), class extends NectaryElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
19
|
|
|
@@ -65,10 +65,7 @@ defineCustomElement('sinch-card', (_$text = new WeakMap(), _$label = new WeakMap
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
const shadowRoot = this.attachShadow(
|
|
69
|
-
mode: 'closed',
|
|
70
|
-
delegatesFocus: true
|
|
71
|
-
});
|
|
68
|
+
const shadowRoot = this.attachShadow();
|
|
72
69
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
73
70
|
|
|
74
71
|
_classPrivateFieldSet(this, _$text, shadowRoot.querySelector('#description'));
|
package/card-button/index.js
CHANGED
|
@@ -7,14 +7,14 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, updateAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, updateAttribute, NectaryElement } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{display:inline-block;outline:0}sinch-button{display:block}</style><sinch-button type="primary" small></sinch-button>';
|
|
12
12
|
export const isSinchCardButtonElement = el => {
|
|
13
13
|
return el.tagName === 'SINCH-CARD-BUTTON';
|
|
14
14
|
};
|
|
15
15
|
const template = document.createElement('template');
|
|
16
16
|
template.innerHTML = templateHTML;
|
|
17
|
-
defineCustomElement('sinch-card-button', (_$button = new WeakMap(), class extends
|
|
17
|
+
defineCustomElement('sinch-card-button', (_$button = new WeakMap(), class extends NectaryElement {
|
|
18
18
|
constructor() {
|
|
19
19
|
super();
|
|
20
20
|
|
|
@@ -23,10 +23,7 @@ defineCustomElement('sinch-card-button', (_$button = new WeakMap(), class extend
|
|
|
23
23
|
value: void 0
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const shadowRoot = this.attachShadow(
|
|
27
|
-
mode: 'closed',
|
|
28
|
-
delegatesFocus: true
|
|
29
|
-
});
|
|
26
|
+
const shadowRoot = this.attachShadow();
|
|
30
27
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
31
28
|
|
|
32
29
|
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('sinch-button'));
|
package/card-container/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { defineCustomElement } from '../utils';
|
|
1
|
+
import { defineCustomElement, NectaryElement } from '../utils';
|
|
2
2
|
const templateHTML = '<style>:host{display:block}#wrapper{position:relative;padding:24px;box-sizing:border-box;background-color:var(--sinch-color-snow-100);border-radius:8px;border:1px solid var(--sinch-color-snow-700)}</style><div id="wrapper"><slot></slot></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
defineCustomElement('sinch-card-container', class extends
|
|
5
|
+
defineCustomElement('sinch-card-container', class extends NectaryElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
|
-
const shadowRoot = this.attachShadow(
|
|
9
|
-
mode: 'closed',
|
|
10
|
-
delegatesFocus: true
|
|
11
|
-
});
|
|
8
|
+
const shadowRoot = this.attachShadow();
|
|
12
9
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
13
10
|
}
|
|
14
11
|
|
package/card-link/index.js
CHANGED
|
@@ -8,14 +8,14 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../icons/arrow-forward';
|
|
11
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute } from '../utils';
|
|
11
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement } from '../utils';
|
|
12
12
|
const templateHTML = '<style>:host{display:inline;outline:0}a{display:flex;flex-direction:row;gap:8px;font:var(--sinch-font-emphasized-body);color:var(--sinch-color-tropical-500);text-decoration:none;outline:0;--sinch-color-icon:var(--sinch-color-tropical-500);--sinch-size-icon:24px}a:hover{color:var(--sinch-color-tropical-600);fill:var(--sinch-color-tropical-600)}:host([disabled]:not([disabled=false])) a{color:var(--sinch-color-tropical-300);pointer-events:none;cursor:initial;--sinch-color-icon:var(--sinch-color-tropical-300)}span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex-shrink:1}</style><a><span></span><sinch-icon-arrow-forward></sinch-icon-arrow-forward></a>';
|
|
13
13
|
export const isSinchCardLinkElement = el => {
|
|
14
14
|
return el.tagName === 'SINCH-CARD-LINK';
|
|
15
15
|
};
|
|
16
16
|
const template = document.createElement('template');
|
|
17
17
|
template.innerHTML = templateHTML;
|
|
18
|
-
defineCustomElement('sinch-card-link', (_$anchor = new WeakMap(), _$text = new WeakMap(), _onClick = new WeakMap(), class extends
|
|
18
|
+
defineCustomElement('sinch-card-link', (_$anchor = new WeakMap(), _$text = new WeakMap(), _onClick = new WeakMap(), class extends NectaryElement {
|
|
19
19
|
constructor() {
|
|
20
20
|
super();
|
|
21
21
|
|
|
@@ -39,10 +39,7 @@ defineCustomElement('sinch-card-link', (_$anchor = new WeakMap(), _$text = new W
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
const shadowRoot = this.attachShadow(
|
|
43
|
-
mode: 'closed',
|
|
44
|
-
delegatesFocus: true
|
|
45
|
-
});
|
|
42
|
+
const shadowRoot = this.attachShadow();
|
|
46
43
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
47
44
|
|
|
48
45
|
_classPrivateFieldSet(this, _$anchor, shadowRoot.querySelector('a'));
|
package/chat/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { defineCustomElement } from '../utils';
|
|
1
|
+
import { defineCustomElement, NectaryElement } from '../utils';
|
|
2
2
|
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;gap:32px;box-sizing:border-box;width:100%}</style><div id="wrapper"><slot></slot></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
defineCustomElement('sinch-chat', class extends
|
|
5
|
+
defineCustomElement('sinch-chat', class extends NectaryElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
|
-
const shadowRoot = this.attachShadow(
|
|
9
|
-
mode: 'closed',
|
|
10
|
-
delegatesFocus: true
|
|
11
|
-
});
|
|
8
|
+
const shadowRoot = this.attachShadow();
|
|
12
9
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
13
10
|
}
|
|
14
11
|
|
package/chat-avatar/index.js
CHANGED
|
@@ -8,11 +8,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import '../avatar';
|
|
11
|
-
import { defineCustomElement, getAttribute, updateAttribute } from '../utils';
|
|
11
|
+
import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } from '../utils';
|
|
12
12
|
const templateHTML = '<style>sinch-avatar{display:block}</style><sinch-avatar background="blue" size="l"></sinch-avatar>';
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-chat-avatar', (_$avatar = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-chat-avatar', (_$avatar = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -21,10 +21,7 @@ defineCustomElement('sinch-chat-avatar', (_$avatar = new WeakMap(), class extend
|
|
|
21
21
|
value: void 0
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const shadowRoot = this.attachShadow(
|
|
25
|
-
mode: 'closed',
|
|
26
|
-
delegatesFocus: true
|
|
27
|
-
});
|
|
24
|
+
const shadowRoot = this.attachShadow();
|
|
28
25
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
29
26
|
|
|
30
27
|
_classPrivateFieldSet(this, _$avatar, shadowRoot.querySelector('sinch-avatar'));
|
package/chat-block/index.js
CHANGED
|
@@ -12,11 +12,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
12
12
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
13
13
|
|
|
14
14
|
import { typeValues } from '../chat-bubble';
|
|
15
|
-
import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
15
|
+
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
16
16
|
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;display:flex;flex-direction:column;gap:4px;align-items:flex-end;padding-left:72px}#stamp{display:flex;gap:4px;margin:0;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-stormy-400)}#avatar{display:none;position:absolute;left:0;top:24px}:host([type=customer])>#wrapper{align-items:flex-start}:host([type=customer]) #avatar{display:block}</style><div id="wrapper"><div id="avatar"><slot name="avatar"></slot></div><p id="stamp"><span id="firstname"></span><span id="lastname"></span>•<span id="time"></span></p><slot name="bubble"></slot></div>';
|
|
17
17
|
const template = document.createElement('template');
|
|
18
18
|
template.innerHTML = templateHTML;
|
|
19
|
-
defineCustomElement('sinch-chat-block', (_$firstName = new WeakMap(), _$lastName = new WeakMap(), _$timeStamp = new WeakMap(), _$bubbleSlot = new WeakMap(), _onBubbleSlotChange = new WeakMap(), _updateBubbleTypes = new WeakSet(), class extends
|
|
19
|
+
defineCustomElement('sinch-chat-block', (_$firstName = new WeakMap(), _$lastName = new WeakMap(), _$timeStamp = new WeakMap(), _$bubbleSlot = new WeakMap(), _onBubbleSlotChange = new WeakMap(), _updateBubbleTypes = new WeakSet(), class extends NectaryElement {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
|
|
@@ -49,10 +49,7 @@ defineCustomElement('sinch-chat-block', (_$firstName = new WeakMap(), _$lastName
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
const shadowRoot = this.attachShadow(
|
|
53
|
-
mode: 'closed',
|
|
54
|
-
delegatesFocus: true
|
|
55
|
-
});
|
|
52
|
+
const shadowRoot = this.attachShadow();
|
|
56
53
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
57
54
|
|
|
58
55
|
_classPrivateFieldSet(this, _$firstName, shadowRoot.querySelector('#firstname'));
|
package/chat-bubble/index.js
CHANGED
|
@@ -7,12 +7,12 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{display:block;outline:0}#text{padding:12px 16px;border-radius:16px;font:var(--sinch-font-body);color:var(--sinch-color-stormy-500);margin:0;max-width:595px;box-sizing:border-box}:host([data-type=customer])>#text{background-color:var(--sinch-color-snow-500);border-top-left-radius:0}:host([data-type=agent-prev])>#text{background-color:var(--sinch-color-snow-700);border-top-right-radius:0}:host([data-type=agent])>#text{background-color:var(--sinch-color-honey-200);border-top-right-radius:0}</style><p id="text"></p>';
|
|
12
12
|
export const typeValues = ['customer', 'agent', 'agent-prev'];
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
|
-
defineCustomElement('sinch-chat-bubble', (_$text = new WeakMap(), class extends
|
|
15
|
+
defineCustomElement('sinch-chat-bubble', (_$text = new WeakMap(), class extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -21,10 +21,7 @@ defineCustomElement('sinch-chat-bubble', (_$text = new WeakMap(), class extends
|
|
|
21
21
|
value: void 0
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const shadowRoot = this.attachShadow(
|
|
25
|
-
mode: 'closed',
|
|
26
|
-
delegatesFocus: true
|
|
27
|
-
});
|
|
24
|
+
const shadowRoot = this.attachShadow();
|
|
28
25
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
29
26
|
|
|
30
27
|
_classPrivateFieldSet(this, _$text, shadowRoot.querySelector('#text'));
|
package/checkbox/index.js
CHANGED
|
@@ -7,11 +7,11 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{--sinch-color-checkbox-circle:var(--sinch-color-transparent);--sinch-color-checkbox-background:var(--sinch-color-snow-100);--sinch-color-checkbox-border:var(--sinch-color-stormy-300);--sinch-color-checkbox-circle-checked:var(--sinch-color-transparent);--sinch-color-checkbox-background-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-border-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-circle-hover:var(--sinch-color-snow-500);--sinch-color-checkbox-background-hover:var(--sinch-color-snow-100);--sinch-color-checkbox-border-hover:var(--sinch-color-stormy-300);--sinch-color-checkbox-circle-hover-checked:var(--sinch-color-tropical-100);--sinch-color-checkbox-background-hover-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-border-hover-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-circle-focus:var(--sinch-color-snow-800);--sinch-color-checkbox-background-focus:var(--sinch-color-snow-100);--sinch-color-checkbox-border-focus:var(--sinch-color-stormy-300);--sinch-color-checkbox-circle-focus-checked:var(--sinch-color-tropical-200);--sinch-color-checkbox-background-focus-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-border-focus-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-circle-active:var(--sinch-color-stormy-100);--sinch-color-checkbox-background-active:var(--sinch-color-snow-100);--sinch-color-checkbox-border-active:var(--sinch-color-stormy-300);--sinch-color-checkbox-circle-active-checked:var(--sinch-color-tropical-300);--sinch-color-checkbox-background-active-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-border-active-checked:var(--sinch-color-tropical-500);--sinch-color-checkbox-circle-disabled:var(--sinch-color-transparent);--sinch-color-checkbox-background-disabled:var(--sinch-color-snow-100);--sinch-color-checkbox-border-disabled:var(--sinch-color-stormy-100);--sinch-color-checkbox-circle-disabled-checked:var(--sinch-color-transparent);--sinch-color-checkbox-background-disabled-checked:var(--sinch-color-stormy-100);--sinch-color-checkbox-border-disabled-checked:var(--sinch-color-stormy-100);--sinch-color-checkbox-text:var(--sinch-color-text-default);--sinch-color-checkbox-text-disabled:var(--sinch-color-stormy-200);display:inline-block;vertical-align:middle;outline:0}:host([invalid]:not([invalid=false])){--sinch-color-checkbox-border:var(--sinch-color-raspberry-500);--sinch-color-checkbox-background-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-hover:var(--sinch-color-raspberry-500);--sinch-color-checkbox-circle-hover-checked:var(--sinch-color-raspberry-100);--sinch-color-checkbox-background-hover-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-hover-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-focus:var(--sinch-color-raspberry-500);--sinch-color-checkbox-circle-focus-checked:var(--sinch-color-raspberry-200);--sinch-color-checkbox-background-focus-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-focus-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-active:var(--sinch-color-raspberry-500);--sinch-color-checkbox-circle-active-checked:var(--sinch-color-raspberry-300);--sinch-color-checkbox-background-active-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-active-checked:var(--sinch-color-raspberry-500);--sinch-color-checkbox-border-disabled:var(--sinch-color-raspberry-200);--sinch-color-checkbox-background-disabled-checked:var(--sinch-color-raspberry-200);--sinch-color-checkbox-border-disabled-checked:var(--sinch-color-raspberry-200);--sinch-color-checkbox-text:var(--sinch-color-text-invalid);--sinch-color-checkbox-text-disabled:var(--sinch-color-raspberry-200)}#wrapper{display:flex;flex-direction:row;box-sizing:border-box;width:100%;height:32px}#checkbox{all:initial;display:block;width:32px;height:32px;cursor:pointer}#checkbox:disabled{cursor:initial}#icon-container{position:relative;width:32px;height:32px}#checkbox::before{content:"";position:absolute;top:0;left:0;width:32px;height:32px;border-radius:16px;pointer-events:none;background-color:var(--sinch-color-checkbox-circle);transition:background-color .1s linear}#checkbox::after{content:"";position:absolute;top:7px;left:7px;width:18px;height:18px;border-radius:2px;pointer-events:none;background-color:var(--sinch-color-checkbox-background);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border) inset;transition:background-color .1s linear}#icon-checkmark{position:absolute;left:9px;top:10px;transition:opacity .1s linear;opacity:0;pointer-events:none}#icon-indeterminate{position:absolute;left:10px;top:15px;transition:opacity .1s linear;opacity:0;pointer-events:none}@media (prefers-reduced-motion){#checkbox::after,#checkbox::before,#icon-checkmark,#icon-indeterminate{transition:none}}#label{display:none;flex:1;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:6px;font:var(--sinch-font-body);color:var(--sinch-color-checkbox-text)}:host([text]:not([text=""])) #label{display:block}:host([disabled]:not([disabled=false])) #label{color:var(--sinch-color-checkbox-text-disabled)}:host(:is(:not([indeterminate]),[indeterminate=false])) #checkbox:checked~#icon-checkmark{opacity:1}:host([indeterminate]:not([indeterminate=false])) #checkbox:checked~#icon-indeterminate{opacity:1}#checkbox:checked::before{background-color:var(--sinch-color-checkbox-circle-checked)}#checkbox:checked::after{background-color:var(--sinch-color-checkbox-background-checked);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-checked) inset}#checkbox:focus::before{background-color:var(--sinch-color-checkbox-circle-focus)}#checkbox:focus::after{background-color:var(--sinch-color-checkbox-background-focus);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-focus) inset}#checkbox:hover::before{background-color:var(--sinch-color-checkbox-circle-hover)}#checkbox:hover::after{background-color:var(--sinch-color-checkbox-background-hover);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-hover) inset}#checkbox:active::before{background-color:var(--sinch-color-checkbox-circle-active)}#checkbox:active::after{background-color:var(--sinch-color-checkbox-background-active);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-active) inset}#checkbox:disabled::before{background-color:var(--sinch-color-checkbox-circle-disabled)}#checkbox:disabled::after{background-color:var(--sinch-color-checkbox-background-disabled);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-disabled) inset}#checkbox:focus:checked::before{background-color:var(--sinch-color-checkbox-circle-focus-checked)}#checkbox:focus:checked::after{background-color:var(--sinch-color-checkbox-background-focus-checked);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-focus-checked) inset}#checkbox:hover:checked::before{background-color:var(--sinch-color-checkbox-circle-hover-checked)}#checkbox:hover:checked::after{background-color:var(--sinch-color-checkbox-background-hover-checked);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-hover-checked) inset}#checkbox:active:checked::before{background-color:var(--sinch-color-checkbox-circle-active-checked)}#checkbox:active:checked::after{background-color:var(--sinch-color-checkbox-background-active-checked);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-active-checked) inset}#checkbox:disabled:checked::before{background-color:var(--sinch-color-checkbox-circle-disabled-checked)}#checkbox:disabled:checked::after{background-color:var(--sinch-color-checkbox-background-disabled-checked);box-shadow:0 0 0 2px var(--sinch-color-checkbox-border-disabled-checked) inset}</style><div id="wrapper"><div id="icon-container"><input id="checkbox" type="checkbox"/> <svg id="icon-checkmark" width="14" height="11" aria-hidden="true"><path d="M14 1.99999L12.59 0.579987L4.98995 8.17L1.49997 4.5L0.0799694 5.91L4.98995 11L14 1.99999Z" fill="white"/></svg> <svg id="icon-indeterminate" width="12" height="2" aria-hidden="true"><line y1="1" x2="12" y2="1" stroke="white" stroke-width="2"/></svg></div><label for="checkbox" id="label"></label></div>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-checkbox', (_$input = new WeakMap(), _$label = new WeakMap(), _onCheckboxInput = new WeakMap(), class extends
|
|
14
|
+
defineCustomElement('sinch-checkbox', (_$input = new WeakMap(), _$label = new WeakMap(), _onCheckboxInput = new WeakMap(), class extends NectaryElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
|
|
@@ -40,10 +40,7 @@ defineCustomElement('sinch-checkbox', (_$input = new WeakMap(), _$label = new We
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
const shadowRoot = this.attachShadow(
|
|
44
|
-
mode: 'closed',
|
|
45
|
-
delegatesFocus: true
|
|
46
|
-
});
|
|
43
|
+
const shadowRoot = this.attachShadow();
|
|
47
44
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
48
45
|
|
|
49
46
|
_classPrivateFieldSet(this, _$input, shadowRoot.querySelector('input'));
|
package/colors.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"colorTropical300": "#66AAAA",
|
|
14
14
|
"colorTropical200": "#99C6C6",
|
|
15
15
|
"colorTropical100": "#CCE3E3",
|
|
16
|
+
"colorTropical50": "#E5F1F1",
|
|
16
17
|
"colorStormy600": "#061927",
|
|
17
18
|
"colorStormy500": "#0A273D",
|
|
18
19
|
"colorStormy400": "#3B5264",
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
"colorRaspberry300": "#EE778B",
|
|
32
33
|
"colorRaspberry200": "#F4A4B1",
|
|
33
34
|
"colorRaspberry100": "#F9D2D8",
|
|
35
|
+
"colorRaspberry50": "#FCE8EB",
|
|
34
36
|
"colorTextDefault": "#0A273D",
|
|
35
37
|
"colorTextInverted": "#FFFFFF",
|
|
36
38
|
"colorTextMuted": "#677784",
|
package/dialog/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import '../icon-button';
|
|
|
2
2
|
import '../icons/close';
|
|
3
3
|
import type { TRect, TSinchElementReact } from '../types';
|
|
4
4
|
import type { SyntheticEvent } from 'react';
|
|
5
|
-
declare type TSinchDialogElement = HTMLElement & {
|
|
5
|
+
export declare type TSinchDialogElement = HTMLElement & {
|
|
6
6
|
caption: string;
|
|
7
7
|
readonly dialogRect: TRect;
|
|
8
8
|
readonly closeButtonRect: TRect;
|
|
9
9
|
};
|
|
10
|
-
declare type TSinchDialogReact = TSinchElementReact<TSinchDialogElement> & {
|
|
10
|
+
export declare type TSinchDialogReact = TSinchElementReact<TSinchDialogElement> & {
|
|
11
11
|
open: boolean;
|
|
12
12
|
caption: string;
|
|
13
13
|
'aria-label': string;
|
|
@@ -23,4 +23,3 @@ declare global {
|
|
|
23
23
|
'sinch-dialog': TSinchDialogElement;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export {};
|
package/dialog/index.js
CHANGED
|
@@ -12,13 +12,13 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
12
12
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
13
13
|
|
|
14
14
|
import dialogPolyfill from 'dialog-polyfill';
|
|
15
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, getRect, isAttrTrue, updateAttribute, getReactEventHandler } from '../utils';
|
|
15
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, getRect, isAttrTrue, updateAttribute, getReactEventHandler, NectaryElement } from '../utils';
|
|
16
16
|
import '../icon-button';
|
|
17
17
|
import '../icons/close';
|
|
18
18
|
const templateHTML = '<style>dialog{position:absolute;left:0;right:0;margin:auto;display:flex;flex-direction:column;padding:24px;width:100%;max-width:512px;border-radius:4px;box-sizing:border-box;background-color:var(--sinch-color-snow-100);color:var(--sinch-color-text-default);font:var(--sinch-font-body);border:none;box-shadow:1px 2px 8px rgba(0,0,0,.1)}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.55}dialog::backdrop{background-color:#000;opacity:.55}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translate(0,-50%)}#header{display:flex;flex-direction:row;justify-content:space-between;align-content:center;margin-bottom:16px}#caption{font:var(--sinch-font-title-m);color:var(--sinch-color-text-default)}#content-wrapper{min-height:0;overflow:auto;max-height:var(--sinch-dialog-max-height,50vh)}#close{all:initial;cursor:pointer;--sinch-size-icon:24px}#buttons{display:flex;flex-direction:row;justify-content:flex-end;gap:16px;margin-top:24px}</style><dialog><div id="header"><span id="caption"></span> <button id="close"><sinch-icon-close></sinch-icon-close></button></div><div id="content-wrapper"><slot name="content"></slot></div><div id="buttons"><slot name="buttons"></slot></div></dialog>';
|
|
19
19
|
const template = document.createElement('template');
|
|
20
20
|
template.innerHTML = templateHTML;
|
|
21
|
-
defineCustomElement('sinch-dialog', (_$dialog = new WeakMap(), _$closeButton = new WeakMap(), _$caption = new WeakMap(), _isConnected = new WeakMap(), _onCancel = new WeakMap(), _onCloseClick = new WeakMap(), _onBackdropClick = new WeakMap(), _onCloseReactHandler = new WeakMap(), _dispatchCloseEvent = new WeakSet(), _setOpen = new WeakSet(), class extends
|
|
21
|
+
defineCustomElement('sinch-dialog', (_$dialog = new WeakMap(), _$closeButton = new WeakMap(), _$caption = new WeakMap(), _isConnected = new WeakMap(), _onCancel = new WeakMap(), _onCloseClick = new WeakMap(), _onBackdropClick = new WeakMap(), _onCloseReactHandler = new WeakMap(), _dispatchCloseEvent = new WeakSet(), _setOpen = new WeakSet(), class extends NectaryElement {
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
|
|
@@ -83,10 +83,7 @@ defineCustomElement('sinch-dialog', (_$dialog = new WeakMap(), _$closeButton = n
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
const shadowRoot = this.attachShadow(
|
|
87
|
-
mode: 'closed',
|
|
88
|
-
delegatesFocus: true
|
|
89
|
-
});
|
|
86
|
+
const shadowRoot = this.attachShadow();
|
|
90
87
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
91
88
|
|
|
92
89
|
_classPrivateFieldSet(this, _$dialog, shadowRoot.querySelector('dialog'));
|