@nectary/components 0.45.2 → 0.47.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-item/index.js +1 -1
- package/alert/index.js +1 -1
- package/badge/index.js +6 -2
- package/chat-bubble/index.js +1 -1
- package/colors.json +12 -12
- package/date-picker/index.js +18 -6
- package/file-drop/index.js +1 -1
- package/file-status/index.js +1 -1
- package/horizontal-stepper-item/index.js +1 -1
- package/icons-branded/5g-readiness/index.d.ts +11 -0
- package/icons-branded/5g-readiness/index.js +4 -0
- package/icons-branded/abcd/index.d.ts +11 -0
- package/icons-branded/abcd/index.js +4 -0
- package/icons-branded/airplane/index.d.ts +11 -0
- package/icons-branded/airplane/index.js +4 -0
- package/icons-branded/announcement/index.d.ts +11 -0
- package/icons-branded/announcement/index.js +4 -0
- package/icons-branded/bell-notification/index.d.ts +11 -0
- package/icons-branded/bell-notification/index.js +4 -0
- package/icons-branded/bell-off/index.d.ts +11 -0
- package/icons-branded/bell-off/index.js +4 -0
- package/icons-branded/billing/index.d.ts +11 -0
- package/icons-branded/billing/index.js +4 -0
- package/icons-branded/boat/index.d.ts +11 -0
- package/icons-branded/boat/index.js +4 -0
- package/icons-branded/book/index.d.ts +11 -0
- package/icons-branded/book/index.js +4 -0
- package/icons-branded/calendar/index.d.ts +11 -0
- package/icons-branded/calendar/index.js +4 -0
- package/icons-branded/call/index.d.ts +11 -0
- package/icons-branded/call/index.js +4 -0
- package/icons-branded/call-and-verified/index.d.ts +11 -0
- package/icons-branded/call-and-verified/index.js +4 -0
- package/icons-branded/calling-api/index.d.ts +11 -0
- package/icons-branded/calling-api/index.js +4 -0
- package/icons-branded/car/index.d.ts +11 -0
- package/icons-branded/car/index.js +4 -0
- package/icons-branded/channels/index.d.ts +11 -0
- package/icons-branded/channels/index.js +4 -0
- package/icons-branded/chat-message/index.d.ts +11 -0
- package/icons-branded/chat-message/index.js +4 -0
- package/icons-branded/chatlayert/index.d.ts +11 -0
- package/icons-branded/chatlayert/index.js +4 -0
- package/icons-branded/cloud/index.d.ts +11 -0
- package/icons-branded/cloud/index.js +4 -0
- package/icons-branded/connection/index.d.ts +11 -0
- package/icons-branded/connection/index.js +4 -0
- package/icons-branded/contact-center/index.d.ts +11 -0
- package/icons-branded/contact-center/index.js +4 -0
- package/icons-branded/contact-pro/index.d.ts +11 -0
- package/icons-branded/contact-pro/index.js +4 -0
- package/icons-branded/cookies/index.d.ts +11 -0
- package/icons-branded/cookies/index.js +4 -0
- package/icons-branded/custom/index.d.ts +11 -0
- package/icons-branded/custom/index.js +4 -0
- package/icons-branded/customer-satisfaction-smiley/index.d.ts +11 -0
- package/icons-branded/customer-satisfaction-smiley/index.js +4 -0
- package/icons-branded/database/index.d.ts +11 -0
- package/icons-branded/database/index.js +4 -0
- package/icons-branded/decision/index.d.ts +11 -0
- package/icons-branded/decision/index.js +4 -0
- package/icons-branded/developer/index.d.ts +11 -0
- package/icons-branded/developer/index.js +4 -0
- package/icons-branded/direction/index.d.ts +11 -0
- package/icons-branded/direction/index.js +4 -0
- package/icons-branded/easytouse/index.js +1 -1
- package/icons-branded/edit/index.d.ts +11 -0
- package/icons-branded/edit/index.js +4 -0
- package/icons-branded/finance/index.js +1 -1
- package/icons-branded/flow/index.d.ts +11 -0
- package/icons-branded/flow/index.js +4 -0
- package/icons-branded/flow-chart/index.d.ts +11 -0
- package/icons-branded/flow-chart/index.js +4 -0
- package/icons-branded/global/index.d.ts +11 -0
- package/icons-branded/global/index.js +4 -0
- package/icons-branded/gym/index.d.ts +11 -0
- package/icons-branded/gym/index.js +4 -0
- package/icons-branded/handshaking/index.d.ts +11 -0
- package/icons-branded/handshaking/index.js +4 -0
- package/icons-branded/health-insurance/index.d.ts +11 -0
- package/icons-branded/health-insurance/index.js +4 -0
- package/icons-branded/healthcare/index.d.ts +11 -0
- package/icons-branded/healthcare/index.js +4 -0
- package/icons-branded/idea/index.d.ts +11 -0
- package/icons-branded/idea/index.js +4 -0
- package/icons-branded/intelligent-revenue-maximisation/index.d.ts +11 -0
- package/icons-branded/intelligent-revenue-maximisation/index.js +4 -0
- package/icons-branded/laptop/index.d.ts +11 -0
- package/icons-branded/laptop/index.js +4 -0
- package/icons-branded/layout/index.d.ts +11 -0
- package/icons-branded/layout/index.js +4 -0
- package/icons-branded/lock/index.d.ts +11 -0
- package/icons-branded/lock/index.js +4 -0
- package/icons-branded/logistic/index.d.ts +11 -0
- package/icons-branded/logistic/index.js +4 -0
- package/icons-branded/long-message/index.d.ts +11 -0
- package/icons-branded/long-message/index.js +4 -0
- package/icons-branded/loop/index.d.ts +11 -0
- package/icons-branded/loop/index.js +4 -0
- package/icons-branded/low-cost/index.d.ts +11 -0
- package/icons-branded/low-cost/index.js +4 -0
- package/icons-branded/make-it-happen/index.d.ts +11 -0
- package/icons-branded/make-it-happen/index.js +4 -0
- package/icons-branded/make-money/index.d.ts +11 -0
- package/icons-branded/make-money/index.js +4 -0
- package/icons-branded/massage/index.d.ts +11 -0
- package/icons-branded/massage/index.js +4 -0
- package/icons-branded/media/index.d.ts +11 -0
- package/icons-branded/media/index.js +4 -0
- package/icons-branded/message/index.d.ts +11 -0
- package/icons-branded/message/index.js +4 -0
- package/icons-branded/message-questions/index.d.ts +11 -0
- package/icons-branded/message-questions/index.js +4 -0
- package/icons-branded/messaging/index.d.ts +11 -0
- package/icons-branded/messaging/index.js +4 -0
- package/icons-branded/mic/index.d.ts +11 -0
- package/icons-branded/mic/index.js +4 -0
- package/icons-branded/mobile/index.d.ts +11 -0
- package/icons-branded/mobile/index.js +4 -0
- package/icons-branded/mobile-intergration/index.d.ts +11 -0
- package/icons-branded/mobile-intergration/index.js +4 -0
- package/icons-branded/mobile-numbers/index.d.ts +11 -0
- package/icons-branded/mobile-numbers/index.js +4 -0
- package/icons-branded/money/index.d.ts +11 -0
- package/icons-branded/money/index.js +4 -0
- package/icons-branded/multiple-channels/index.js +1 -1
- package/icons-branded/music/index.d.ts +11 -0
- package/icons-branded/music/index.js +4 -0
- package/icons-branded/mute/index.d.ts +11 -0
- package/icons-branded/mute/index.js +4 -0
- package/icons-branded/news/index.d.ts +11 -0
- package/icons-branded/news/index.js +4 -0
- package/icons-branded/numbers/index.d.ts +11 -0
- package/icons-branded/numbers/index.js +4 -0
- package/icons-branded/office/index.d.ts +11 -0
- package/icons-branded/office/index.js +4 -0
- package/icons-branded/office-activities/index.d.ts +11 -0
- package/icons-branded/office-activities/index.js +4 -0
- package/icons-branded/opened-message/index.d.ts +11 -0
- package/icons-branded/opened-message/index.js +4 -0
- package/icons-branded/operators/index.d.ts +11 -0
- package/icons-branded/operators/index.js +4 -0
- package/icons-branded/package/index.d.ts +11 -0
- package/icons-branded/package/index.js +4 -0
- package/icons-branded/path/index.d.ts +11 -0
- package/icons-branded/path/index.js +4 -0
- package/icons-branded/perso-message/index.d.ts +11 -0
- package/icons-branded/perso-message/index.js +4 -0
- package/icons-branded/pie-chart/index.d.ts +11 -0
- package/icons-branded/pie-chart/index.js +4 -0
- package/icons-branded/piggybank/index.d.ts +11 -0
- package/icons-branded/piggybank/index.js +4 -0
- package/icons-branded/pin/index.d.ts +11 -0
- package/icons-branded/pin/index.js +4 -0
- package/icons-branded/price-tag/index.d.ts +11 -0
- package/icons-branded/price-tag/index.js +4 -0
- package/icons-branded/protection/index.d.ts +11 -0
- package/icons-branded/protection/index.js +4 -0
- package/icons-branded/purpose/index.d.ts +11 -0
- package/icons-branded/purpose/index.js +4 -0
- package/icons-branded/puzzle/index.d.ts +11 -0
- package/icons-branded/puzzle/index.js +4 -0
- package/icons-branded/queue/index.d.ts +11 -0
- package/icons-branded/queue/index.js +4 -0
- package/icons-branded/retail/index.d.ts +11 -0
- package/icons-branded/retail/index.js +4 -0
- package/icons-branded/rich-content/index.d.ts +11 -0
- package/icons-branded/rich-content/index.js +4 -0
- package/icons-branded/rocket/index.js +1 -1
- package/icons-branded/roi/index.d.ts +11 -0
- package/icons-branded/roi/index.js +4 -0
- package/icons-branded/search/index.d.ts +11 -0
- package/icons-branded/search/index.js +4 -0
- package/icons-branded/send/index.d.ts +11 -0
- package/icons-branded/send/index.js +4 -0
- package/icons-branded/settings/index.js +1 -1
- package/icons-branded/shopping-cart/index.d.ts +11 -0
- package/icons-branded/shopping-cart/index.js +4 -0
- package/icons-branded/support/index.d.ts +11 -0
- package/icons-branded/support/index.js +4 -0
- package/icons-branded/system-settings/index.d.ts +11 -0
- package/icons-branded/system-settings/index.js +4 -0
- package/icons-branded/telemast/index.d.ts +11 -0
- package/icons-branded/telemast/index.js +4 -0
- package/icons-branded/thumbs-down/index.d.ts +11 -0
- package/icons-branded/thumbs-down/index.js +4 -0
- package/icons-branded/thumbs-up/index.d.ts +11 -0
- package/icons-branded/thumbs-up/index.js +4 -0
- package/icons-branded/tutorial/index.d.ts +11 -0
- package/icons-branded/tutorial/index.js +4 -0
- package/icons-branded/verification-api/index.d.ts +11 -0
- package/icons-branded/verification-api/index.js +4 -0
- package/icons-branded/video-calling/index.d.ts +11 -0
- package/icons-branded/video-calling/index.js +4 -0
- package/icons-branded/video-off/index.d.ts +11 -0
- package/icons-branded/video-off/index.js +4 -0
- package/icons-branded/video-on/index.d.ts +11 -0
- package/icons-branded/video-on/index.js +4 -0
- package/icons-branded/voice-calling/index.d.ts +11 -0
- package/icons-branded/voice-calling/index.js +4 -0
- package/icons-branded/voice-video-and-data/index.d.ts +11 -0
- package/icons-branded/voice-video-and-data/index.js +4 -0
- package/icons-branded/webhook/index.d.ts +11 -0
- package/icons-branded/webhook/index.js +4 -0
- package/icons-branded/wheels/index.d.ts +11 -0
- package/icons-branded/wheels/index.js +4 -0
- package/icons-branded/wi-fi/index.d.ts +11 -0
- package/icons-branded/wi-fi/index.js +4 -0
- package/illustrations/create-illustration-class.js +1 -1
- package/inline-alert/index.js +1 -1
- package/logo/engage-icon/index.d.ts +11 -0
- package/logo/engage-icon/index.js +4 -0
- package/logo/engage-icon-wordmark/index.d.ts +11 -0
- package/logo/engage-icon-wordmark/index.js +4 -0
- package/package.json +1 -1
- package/tag/index.js +4 -2
- package/textarea/index.js +41 -20
- package/theme/button.css +2 -2
- package/theme/chip.css +8 -0
- package/theme/contextual.css +23 -11
- package/theme/palette.css +12 -12
- package/theme/tag.css +8 -0
- package/toast/index.js +1 -1
- package/utils/dom.js +3 -1
- package/vertical-stepper-item/index.js +1 -1
package/package.json
CHANGED
package/tag/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../text';
|
|
2
2
|
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement } from '../utils';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:24px;padding:0 9px;border-radius:12px;background-color:var(--sinch-tag-color-default-bg);color:var(--sinch-tag-color-default-fg);box-sizing:border-box;--sinch-color-icon:var(--sinch-tag-color-default-fg);--sinch-size-icon:16px}#text{flex:1}:host([small]:not([small=false])) #wrapper{height:20px;border-radius:10px;padding:0 8px}::slotted(*){margin-left:-4px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="text" type="xs" ellipsis></sinch-text></div>';
|
|
3
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:24px;padding:0 9px;border-radius:12px;background-color:var(--sinch-tag-color-default-bg);color:var(--sinch-tag-color-default-fg);box-sizing:border-box;user-select:none;--sinch-color-icon:var(--sinch-tag-color-default-fg);--sinch-size-icon:16px}#text{flex:1}:host([small]:not([small=false])) #wrapper{height:20px;border-radius:10px;padding:0 8px}::slotted(*){margin-left:-4px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="text" type="xs" ellipsis></sinch-text></div>';
|
|
4
4
|
import { assertTagColor, getTagColorBg, getTagColorFg } from './utils';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
@@ -59,7 +59,9 @@ defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
|
59
59
|
}
|
|
60
60
|
const colorName = this.color;
|
|
61
61
|
if (colorName !== null && colorName.length > 0) {
|
|
62
|
-
|
|
62
|
+
if ('production' !== 'production') {
|
|
63
|
+
assertTagColor(this, colorName);
|
|
64
|
+
}
|
|
63
65
|
const bg = getTagColorBg(colorName);
|
|
64
66
|
const fg = getTagColorFg(colorName);
|
|
65
67
|
this.#$wrapper.style.setProperty('background-color', bg);
|
package/textarea/index.js
CHANGED
|
@@ -1,40 +1,50 @@
|
|
|
1
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
2
|
-
|
|
1
|
+
import { Context, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
2
|
+
import { DEFAULT_SIZE } from '../utils/size';
|
|
3
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;--sinch-size:var(--sinch-size-m);--sinch-size-icon:var(--sinch-input-icon-size-m);--sinch-shape-radius:var(--sinch-shape-radius-m)}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;background-color:var(--sinch-color-snow-100);border-radius:var(--sinch-shape-radius);padding-right:2px;padding-bottom:2px;overflow:hidden}#input{all:initial;display:block;font:var(--sinch-font-text-m);color:var(--sinch-color-text-default);resize:none;white-space:pre-wrap;padding:8px 10px 8px 12px}#input::placeholder{font:var(--sinch-font-text-m);color:var(--sinch-color-text-muted);opacity:1}#input:disabled{color:var(--sinch-color-stormy-100)}#input:disabled::placeholder{color:var(--sinch-color-snow-500)}#input:focus{border-color:var(--sinch-color-stormy-600)}:host([resizable]:not([resizable=false])) #input{resize:vertical}#border{position:absolute;border:1px solid var(--sinch-color-border-dark);border-radius:var(--sinch-shape-radius);inset:0;pointer-events:none}:host([invalid]:not([invalid=false])) #border{border-color:var(--sinch-color-text-invalid)}#input:focus+#border{border-color:var(--sinch-color-border-focus);border-width:2px}#input:disabled+#border{border-color:var(--sinch-color-snow-500)}#bottom{display:flex;flex-direction:row;align-items:center;gap:8px;padding:8px 10px 10px 12px}#bottom.empty{display:none}</style><div id="wrapper"><textarea id="input"></textarea><div id="border"></div><div id="bottom"><slot name="bottom"></slot></div></div>';
|
|
3
4
|
const template = document.createElement('template');
|
|
4
5
|
template.innerHTML = templateHTML;
|
|
5
6
|
defineCustomElement('sinch-textarea', class extends NectaryElement {
|
|
6
7
|
#$input;
|
|
8
|
+
#$bottomSlot;
|
|
9
|
+
#$bottomWrapper;
|
|
7
10
|
#cursorPos = null;
|
|
8
11
|
#isPendingDk = false;
|
|
12
|
+
#controller = null;
|
|
13
|
+
#sizeContext;
|
|
9
14
|
constructor() {
|
|
10
15
|
super();
|
|
11
16
|
const shadowRoot = this.attachShadow();
|
|
12
17
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
13
18
|
this.#$input = shadowRoot.querySelector('#input');
|
|
19
|
+
this.#$bottomSlot = shadowRoot.querySelector('slot[name="bottom"]');
|
|
20
|
+
this.#$bottomWrapper = shadowRoot.querySelector('#bottom');
|
|
21
|
+
this.#sizeContext = new Context(this.#$bottomWrapper, 'size');
|
|
14
22
|
}
|
|
15
23
|
connectedCallback() {
|
|
24
|
+
super.connectedCallback();
|
|
25
|
+
this.#controller = new AbortController();
|
|
26
|
+
const options = {
|
|
27
|
+
signal: this.#controller.signal
|
|
28
|
+
};
|
|
16
29
|
this.setAttribute('role', 'textbox');
|
|
17
30
|
this.setAttribute('aria-multiline', 'true');
|
|
18
|
-
this.#$input.addEventListener('input', this.#onInput);
|
|
19
|
-
this.#$input.addEventListener('compositionstart', this.#onCompositionStart);
|
|
20
|
-
this.#$input.addEventListener('mousedown', this.#onSelectionChange);
|
|
21
|
-
this.#$input.addEventListener('keydown', this.#onSelectionChange);
|
|
22
|
-
this.#$input.addEventListener('focus', this.#onInputFocus);
|
|
23
|
-
this.#$input.addEventListener('blur', this.#onInputBlur);
|
|
24
|
-
this.addEventListener('
|
|
25
|
-
this.addEventListener('-
|
|
26
|
-
this.addEventListener('-
|
|
31
|
+
this.#$input.addEventListener('input', this.#onInput, options);
|
|
32
|
+
this.#$input.addEventListener('compositionstart', this.#onCompositionStart, options);
|
|
33
|
+
this.#$input.addEventListener('mousedown', this.#onSelectionChange, options);
|
|
34
|
+
this.#$input.addEventListener('keydown', this.#onSelectionChange, options);
|
|
35
|
+
this.#$input.addEventListener('focus', this.#onInputFocus, options);
|
|
36
|
+
this.#$input.addEventListener('blur', this.#onInputBlur, options);
|
|
37
|
+
this.#$bottomSlot.addEventListener('slotchange', this.#onBottomSlotChange, options);
|
|
38
|
+
this.addEventListener('-change', this.#onChangeReactHandler, options);
|
|
39
|
+
this.addEventListener('-focus', this.#onFocusReactHandler, options);
|
|
40
|
+
this.addEventListener('-blur', this.#onBlurReactHandler, options);
|
|
41
|
+
this.#sizeContext.listen(this.#controller.signal);
|
|
42
|
+
this.#onBottomSlotChange();
|
|
43
|
+
this.#onSizeUpdate();
|
|
27
44
|
}
|
|
28
45
|
disconnectedCallback() {
|
|
29
|
-
|
|
30
|
-
this
|
|
31
|
-
this.#$input.removeEventListener('mousedown', this.#onSelectionChange);
|
|
32
|
-
this.#$input.removeEventListener('keydown', this.#onSelectionChange);
|
|
33
|
-
this.#$input.removeEventListener('focus', this.#onInputFocus);
|
|
34
|
-
this.#$input.removeEventListener('blur', this.#onInputBlur);
|
|
35
|
-
this.removeEventListener('-change', this.#onChangeReactHandler);
|
|
36
|
-
this.removeEventListener('-focus', this.#onFocusReactHandler);
|
|
37
|
-
this.removeEventListener('-blur', this.#onBlurReactHandler);
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
this.#controller.abort();
|
|
38
48
|
}
|
|
39
49
|
static get observedAttributes() {
|
|
40
50
|
return ['value', 'placeholder', 'invalid', 'disabled', 'rows'];
|
|
@@ -186,6 +196,17 @@ defineCustomElement('sinch-textarea', class extends NectaryElement {
|
|
|
186
196
|
#onInputBlur = () => {
|
|
187
197
|
this.dispatchEvent(new CustomEvent('-blur'));
|
|
188
198
|
};
|
|
199
|
+
#onBottomSlotChange = () => {
|
|
200
|
+
const isEmpty = this.#$bottomSlot.assignedElements().length === 0;
|
|
201
|
+
setClass(this.#$bottomWrapper, 'empty', isEmpty);
|
|
202
|
+
};
|
|
203
|
+
#onSizeUpdate() {
|
|
204
|
+
if (!this.isConnected) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const size = this.getAttribute('data-size') ?? DEFAULT_SIZE;
|
|
208
|
+
this.#sizeContext.dispatch(size);
|
|
209
|
+
}
|
|
189
210
|
#onChangeReactHandler = e => {
|
|
190
211
|
getReactEventHandler(this, 'on-change')?.(e);
|
|
191
212
|
};
|
package/theme/button.css
CHANGED
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
--sinch-button-cta-secondary-mix-blend-mode: initial;
|
|
97
97
|
|
|
98
98
|
/* Destructive */
|
|
99
|
-
--sinch-button-destructive-color-background:
|
|
99
|
+
--sinch-button-destructive-color-background: var(--sinch-color-snow-100);
|
|
100
100
|
--sinch-button-destructive-color-background-hover: var(--sinch-color-raspberry-100);
|
|
101
101
|
--sinch-button-destructive-color-background-active: var(--sinch-color-raspberry-100);
|
|
102
|
-
--sinch-button-destructive-color-background-disabled:
|
|
102
|
+
--sinch-button-destructive-color-background-disabled: var(--sinch-color-snow-100);
|
|
103
103
|
--sinch-button-destructive-color-border: var(--sinch-color-raspberry-500);
|
|
104
104
|
--sinch-button-destructive-color-border-hover: var(--sinch-color-raspberry-500);
|
|
105
105
|
--sinch-button-destructive-color-border-active: var(--sinch-color-raspberry-500);
|
package/theme/chip.css
CHANGED
|
@@ -50,4 +50,12 @@
|
|
|
50
50
|
--sinch-chip-color-violet-fg: var(--sinch-color-stormy-500);
|
|
51
51
|
--sinch-chip-color-yellow-bg: var(--sinch-color-bolt-400);
|
|
52
52
|
--sinch-chip-color-yellow-fg: var(--sinch-color-stormy-500);
|
|
53
|
+
--sinch-chip-color-celtic-bg: var(--sinch-color-feedback-info-bg);
|
|
54
|
+
--sinch-chip-color-celtic-fg: var(--sinch-color-feedback-info-contrast);
|
|
55
|
+
--sinch-chip-color-olive-bg: var(--sinch-color-feedback-success-bg);
|
|
56
|
+
--sinch-chip-color-olive-fg: var(--sinch-color-feedback-success-contrast);
|
|
57
|
+
--sinch-chip-color-pumpkin-bg: var(--sinch-color-feedback-warning-bg);
|
|
58
|
+
--sinch-chip-color-pumpkin-fg: var(--sinch-color-feedback-warning-contrast);
|
|
59
|
+
--sinch-chip-color-jasper-bg: var(--sinch-color-feedback-invalid-bg);
|
|
60
|
+
--sinch-chip-color-jasper-fg: var(--sinch-color-feedback-invalid-contrast);
|
|
53
61
|
}
|
package/theme/contextual.css
CHANGED
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
/* Contextual */
|
|
4
4
|
--sinch-color-bg-primary-light: var(--sinch-color-snow-100);
|
|
5
5
|
--sinch-color-bg-primary-contrast: var(--sinch-color-snow-200);
|
|
6
|
-
--sinch-color-bg-
|
|
7
|
-
--sinch-color-bg-
|
|
8
|
-
--sinch-color-bg-
|
|
9
|
-
--sinch-color-bg-
|
|
6
|
+
--sinch-color-bg-secondary-green: var(--sinch-color-tropical-100);
|
|
7
|
+
--sinch-color-bg-secondary-blue: var(--sinch-color-ocean-100);
|
|
8
|
+
--sinch-color-bg-secondary-yellow: var(--sinch-color-honey-200);
|
|
9
|
+
--sinch-color-bg-secondary-red: var(--sinch-color-raspberry-100);
|
|
10
10
|
--sinch-color-bg-hover: var(--sinch-color-snow-200);
|
|
11
11
|
--sinch-color-bg-active: var(--sinch-color-snow-400);
|
|
12
|
+
--sinch-color-border-default: var(--sinch-color-snow-700);
|
|
13
|
+
--sinch-color-border-light: var(--sinch-color-snow-500);
|
|
14
|
+
--sinch-color-border-dark: var(--sinch-color-stormy-100);
|
|
15
|
+
--sinch-color-border-active: var(--sinch-color-stormy-500);
|
|
16
|
+
--sinch-color-border-disabled: var(--sinch-color-snow-400);
|
|
17
|
+
--sinch-color-border-focus: var(--sinch-color-ocean-500);
|
|
18
|
+
--sinch-color-border-invalid: var(--sinch-color-raspberry-600);
|
|
12
19
|
--sinch-color-text-default: var(--sinch-color-stormy-700);
|
|
13
20
|
--sinch-color-text-inverted: var(--sinch-color-snow-100);
|
|
14
21
|
--sinch-color-text-muted: var(--sinch-color-stormy-300);
|
|
@@ -17,12 +24,17 @@
|
|
|
17
24
|
--sinch-color-text-link-disabled: var(--sinch-color-tropical-100);
|
|
18
25
|
--sinch-color-text-invalid: var(--sinch-color-raspberry-600);
|
|
19
26
|
--sinch-color-text-invalid-disabled: var(--sinch-color-raspberry-100);
|
|
20
|
-
--sinch-color-
|
|
21
|
-
--sinch-color-
|
|
22
|
-
--sinch-color-
|
|
23
|
-
--sinch-color-
|
|
24
|
-
--sinch-color-
|
|
25
|
-
--sinch-color-
|
|
26
|
-
--sinch-color-
|
|
27
|
+
--sinch-color-feedback-info-contrast: var(--sinch-color-celtic-700);
|
|
28
|
+
--sinch-color-feedback-info-icon: var(--sinch-color-celtic-400);
|
|
29
|
+
--sinch-color-feedback-info-bg: var(--sinch-color-celtic-200);
|
|
30
|
+
--sinch-color-feedback-success-contrast: var(--sinch-color-olive-700);
|
|
31
|
+
--sinch-color-feedback-success-icon: var(--sinch-color-olive-400);
|
|
32
|
+
--sinch-color-feedback-success-bg: var(--sinch-color-olive-200);
|
|
33
|
+
--sinch-color-feedback-warning-contrast: var(--sinch-color-pumpkin-700);
|
|
34
|
+
--sinch-color-feedback-warning-icon: var(--sinch-color-pumpkin-400);
|
|
35
|
+
--sinch-color-feedback-warning-bg: var(--sinch-color-pumpkin-200);
|
|
36
|
+
--sinch-color-feedback-invalid-contrast: var(--sinch-color-jasper-700);
|
|
37
|
+
--sinch-color-feedback-invalid-icon: var(--sinch-color-jasper-400);
|
|
38
|
+
--sinch-color-feedback-invalid-bg: var(--sinch-color-jasper-200);
|
|
27
39
|
--sinch-color-icon: var(--sinch-color-stormy-500);
|
|
28
40
|
}
|
package/theme/palette.css
CHANGED
|
@@ -68,18 +68,18 @@
|
|
|
68
68
|
--sinch-color-violet-700: #4F1B98;
|
|
69
69
|
--sinch-color-violet-400: #9E67E4;
|
|
70
70
|
--sinch-color-violet-200: #DECBF6;
|
|
71
|
-
--sinch-color-
|
|
72
|
-
--sinch-color-
|
|
73
|
-
--sinch-color-
|
|
74
|
-
--sinch-color-
|
|
75
|
-
--sinch-color-
|
|
76
|
-
--sinch-color-
|
|
77
|
-
--sinch-color-
|
|
78
|
-
--sinch-color-
|
|
79
|
-
--sinch-color-
|
|
80
|
-
--sinch-color-
|
|
81
|
-
--sinch-color-
|
|
82
|
-
--sinch-color-
|
|
71
|
+
--sinch-color-olive-700: #275D33;
|
|
72
|
+
--sinch-color-olive-400: #46A65A;
|
|
73
|
+
--sinch-color-olive-200: #D7F1D8;
|
|
74
|
+
--sinch-color-celtic-700: #003B7E;
|
|
75
|
+
--sinch-color-celtic-400: #2071CE;
|
|
76
|
+
--sinch-color-celtic-200: #D5E5F8;
|
|
77
|
+
--sinch-color-jasper-700: #882024;
|
|
78
|
+
--sinch-color-jasper-400: #D13D42;
|
|
79
|
+
--sinch-color-jasper-200: #FBD5D5;
|
|
80
|
+
--sinch-color-pumpkin-700: #9C2E00;
|
|
81
|
+
--sinch-color-pumpkin-400: #F35B1C;
|
|
82
|
+
--sinch-color-pumpkin-200: #FFE8D6;
|
|
83
83
|
--sinch-color-skin-tone-0: #FFCC4D;
|
|
84
84
|
--sinch-color-skin-tone-10: #F7DECE;
|
|
85
85
|
--sinch-color-skin-tone-20: #F3D2A2;
|
package/theme/tag.css
CHANGED
|
@@ -50,4 +50,12 @@
|
|
|
50
50
|
--sinch-tag-color-violet-fg: var(--sinch-color-stormy-500);
|
|
51
51
|
--sinch-tag-color-yellow-bg: var(--sinch-color-bolt-400);
|
|
52
52
|
--sinch-tag-color-yellow-fg: var(--sinch-color-stormy-500);
|
|
53
|
+
--sinch-tag-color-celtic-bg: var(--sinch-color-feedback-info-bg);
|
|
54
|
+
--sinch-tag-color-celtic-fg: var(--sinch-color-feedback-info-contrast);
|
|
55
|
+
--sinch-tag-color-olive-bg: var(--sinch-color-feedback-success-bg);
|
|
56
|
+
--sinch-tag-color-olive-fg: var(--sinch-color-feedback-success-contrast);
|
|
57
|
+
--sinch-tag-color-pumpkin-bg: var(--sinch-color-feedback-warning-bg);
|
|
58
|
+
--sinch-tag-color-pumpkin-fg: var(--sinch-color-feedback-warning-contrast);
|
|
59
|
+
--sinch-tag-color-jasper-bg: var(--sinch-color-feedback-invalid-bg);
|
|
60
|
+
--sinch-tag-color-jasper-fg: var(--sinch-color-feedback-invalid-contrast);
|
|
53
61
|
}
|
package/toast/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import '../icons/info';
|
|
|
5
5
|
import '../title';
|
|
6
6
|
import '../text';
|
|
7
7
|
import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute, updateLiteralAttribute, NectaryElement, getReactEventHandler, getBooleanAttribute, updateBooleanAttribute } from '../utils';
|
|
8
|
-
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;align-items:center;gap:8px;width:328px;padding:8px 16px;box-sizing:border-box;border-radius:var(--sinch-shape-radius-l);box-shadow:var(--sinch-elevation-level-3)}#text{color:var(--sinch-color-stormy-500);padding:4px 0 4px 4px;flex:1;min-width:0}#icon-error,#icon-info,#icon-success,#icon-warn{display:none;align-self:flex-start;margin:4px 0}:host([type=success]) #wrapper{background-color:var(--sinch-color-success-
|
|
8
|
+
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;align-items:center;gap:8px;width:328px;padding:8px 16px;box-sizing:border-box;border-radius:var(--sinch-shape-radius-l);box-shadow:var(--sinch-elevation-level-3)}#text{color:var(--sinch-color-stormy-500);padding:4px 0 4px 4px;flex:1;min-width:0}#icon-error,#icon-info,#icon-success,#icon-warn{display:none;align-self:flex-start;margin:4px 0}:host([type=success]) #wrapper{background-color:var(--sinch-color-feedback-success-bg)}:host([type=warn]) #wrapper{background-color:var(--sinch-color-feedback-warning-bg)}:host([type=error]) #wrapper{background-color:var(--sinch-color-feedback-invalid-bg)}:host([type=info]) #wrapper{background-color:var(--sinch-color-feedback-info-bg)}:host([type=success]) #icon-success{display:block;--sinch-color-icon:var(--sinch-color-feedback-success-icon)}:host([type=warn]) #icon-warn{display:block;--sinch-color-icon:var(--sinch-color-feedback-warning-icon)}:host([type=error]) #icon-error{display:block;--sinch-color-icon:var(--sinch-color-feedback-invalid-icon)}:host([type=info]) #icon-info{display:block;--sinch-color-icon:var(--sinch-color-feedback-info-icon)}</style><div id="wrapper"><sinch-icon-info id="icon-info"></sinch-icon-info><sinch-icon-check-circle id="icon-success"></sinch-icon-check-circle><sinch-icon-report-problem id="icon-warn"></sinch-icon-report-problem><sinch-icon-report id="icon-error"></sinch-icon-report><sinch-text id="text" type="m"></sinch-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
9
9
|
import { assertType, typeValues } from './utils';
|
|
10
10
|
const TIMEOUT = 5000;
|
|
11
11
|
const template = document.createElement('template');
|
package/utils/dom.js
CHANGED
|
@@ -44,7 +44,9 @@ export function getLiteralAttribute($element, literals, attrName, defaultValue)
|
|
|
44
44
|
return attrValue;
|
|
45
45
|
}
|
|
46
46
|
if (typeof defaultValue === 'undefined') {
|
|
47
|
-
|
|
47
|
+
if ('production' !== 'production') {
|
|
48
|
+
throw new Error(`Invalid attribute value: ${attrName} = ${attrValue}`);
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
return defaultValue;
|
|
50
52
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../icons/check';
|
|
2
2
|
import '../icons/exclamation';
|
|
3
3
|
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
4
|
-
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;min-height:68px}#circle-wrapper{display:flex;flex-direction:row;align-items:flex-start;gap:8px;min-width:0}#circle{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background-color:var(--sinch-color-snow-700);font:var(--sinch-font-title-s);line-height:32px;text-align:center;color:var(--sinch-color-stormy-500);border:1px solid transparent;border-radius:50%;box-sizing:border-box;--sinch-size-icon:20px}#label-wrapper{margin-top:4px;min-width:0;flex:1}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-500);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#description{font:var(--sinch-font-text-xs);color:var(--sinch-color-stormy-300);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#icon-error,#icon-success{display:none}#content{display:none;padding:16px 0 16px 40px}#progress{position:absolute;width:1px;left:16px;top:32px;bottom:0;background-color:var(--sinch-color-snow-700);transform:translateX(-50%)}#bar{position:absolute;width:1px;height:0;background-color:var(--sinch-color-stormy-400);left:0;top:0}:host(:last-of-type) #progress{display:none}:host([data-progress=active]) #content{display:block}:host([data-progress=active]) #circle{color:var(--sinch-color-snow-100);background-color:var(--sinch-color-stormy-400)}:host([data-progress=done]) #circle{border-color:var(--sinch-color-stormy-400)}:host([data-progress=done]:not([status])) #icon-success{display:block}:host([data-progress=done][status=error]) #circle{background-color:var(--sinch-color-
|
|
4
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;min-height:68px}#circle-wrapper{display:flex;flex-direction:row;align-items:flex-start;gap:8px;min-width:0}#circle{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background-color:var(--sinch-color-snow-700);font:var(--sinch-font-title-s);line-height:32px;text-align:center;color:var(--sinch-color-stormy-500);border:1px solid transparent;border-radius:50%;box-sizing:border-box;--sinch-size-icon:20px}#label-wrapper{margin-top:4px;min-width:0;flex:1}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-500);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#description{font:var(--sinch-font-text-xs);color:var(--sinch-color-stormy-300);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#icon-error,#icon-success{display:none}#content{display:none;padding:16px 0 16px 40px}#progress{position:absolute;width:1px;left:16px;top:32px;bottom:0;background-color:var(--sinch-color-snow-700);transform:translateX(-50%)}#bar{position:absolute;width:1px;height:0;background-color:var(--sinch-color-stormy-400);left:0;top:0}:host(:last-of-type) #progress{display:none}:host([data-progress=active]) #content{display:block}:host([data-progress=active]) #circle{color:var(--sinch-color-snow-100);background-color:var(--sinch-color-stormy-400)}:host([data-progress=done]) #circle{border-color:var(--sinch-color-stormy-400)}:host([data-progress=done]:not([status])) #icon-success{display:block}:host([data-progress=done][status=error]) #circle{background-color:var(--sinch-color-feedback-invalid-bg);border-color:var(--sinch-color-stormy-400)}:host([data-progress=done][status=error]) #icon-error{display:block}:host([data-progress=done]:not([status=skip])) #circle-text{display:none}:host([data-progress=done]) #bar{height:100%}</style><div id="wrapper"><div id="progress"><div id="bar"></div></div><div id="circle-wrapper"><div id="circle" aria-hidden="true"><sinch-icon-check id="icon-success"></sinch-icon-check><sinch-icon-exclamation id="icon-error"></sinch-icon-exclamation><span id="circle-text"></span></div><div id="label-wrapper"><div id="label"></div><div id="description"></div></div></div><div id="content"><slot></slot></div></div>';
|
|
5
5
|
import { statusValues } from './utils';
|
|
6
6
|
const template = document.createElement('template');
|
|
7
7
|
template.innerHTML = templateHTML;
|