@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.
Files changed (225) hide show
  1. package/accordion-item/index.js +1 -1
  2. package/alert/index.js +1 -1
  3. package/badge/index.js +6 -2
  4. package/chat-bubble/index.js +1 -1
  5. package/colors.json +12 -12
  6. package/date-picker/index.js +18 -6
  7. package/file-drop/index.js +1 -1
  8. package/file-status/index.js +1 -1
  9. package/horizontal-stepper-item/index.js +1 -1
  10. package/icons-branded/5g-readiness/index.d.ts +11 -0
  11. package/icons-branded/5g-readiness/index.js +4 -0
  12. package/icons-branded/abcd/index.d.ts +11 -0
  13. package/icons-branded/abcd/index.js +4 -0
  14. package/icons-branded/airplane/index.d.ts +11 -0
  15. package/icons-branded/airplane/index.js +4 -0
  16. package/icons-branded/announcement/index.d.ts +11 -0
  17. package/icons-branded/announcement/index.js +4 -0
  18. package/icons-branded/bell-notification/index.d.ts +11 -0
  19. package/icons-branded/bell-notification/index.js +4 -0
  20. package/icons-branded/bell-off/index.d.ts +11 -0
  21. package/icons-branded/bell-off/index.js +4 -0
  22. package/icons-branded/billing/index.d.ts +11 -0
  23. package/icons-branded/billing/index.js +4 -0
  24. package/icons-branded/boat/index.d.ts +11 -0
  25. package/icons-branded/boat/index.js +4 -0
  26. package/icons-branded/book/index.d.ts +11 -0
  27. package/icons-branded/book/index.js +4 -0
  28. package/icons-branded/calendar/index.d.ts +11 -0
  29. package/icons-branded/calendar/index.js +4 -0
  30. package/icons-branded/call/index.d.ts +11 -0
  31. package/icons-branded/call/index.js +4 -0
  32. package/icons-branded/call-and-verified/index.d.ts +11 -0
  33. package/icons-branded/call-and-verified/index.js +4 -0
  34. package/icons-branded/calling-api/index.d.ts +11 -0
  35. package/icons-branded/calling-api/index.js +4 -0
  36. package/icons-branded/car/index.d.ts +11 -0
  37. package/icons-branded/car/index.js +4 -0
  38. package/icons-branded/channels/index.d.ts +11 -0
  39. package/icons-branded/channels/index.js +4 -0
  40. package/icons-branded/chat-message/index.d.ts +11 -0
  41. package/icons-branded/chat-message/index.js +4 -0
  42. package/icons-branded/chatlayert/index.d.ts +11 -0
  43. package/icons-branded/chatlayert/index.js +4 -0
  44. package/icons-branded/cloud/index.d.ts +11 -0
  45. package/icons-branded/cloud/index.js +4 -0
  46. package/icons-branded/connection/index.d.ts +11 -0
  47. package/icons-branded/connection/index.js +4 -0
  48. package/icons-branded/contact-center/index.d.ts +11 -0
  49. package/icons-branded/contact-center/index.js +4 -0
  50. package/icons-branded/contact-pro/index.d.ts +11 -0
  51. package/icons-branded/contact-pro/index.js +4 -0
  52. package/icons-branded/cookies/index.d.ts +11 -0
  53. package/icons-branded/cookies/index.js +4 -0
  54. package/icons-branded/custom/index.d.ts +11 -0
  55. package/icons-branded/custom/index.js +4 -0
  56. package/icons-branded/customer-satisfaction-smiley/index.d.ts +11 -0
  57. package/icons-branded/customer-satisfaction-smiley/index.js +4 -0
  58. package/icons-branded/database/index.d.ts +11 -0
  59. package/icons-branded/database/index.js +4 -0
  60. package/icons-branded/decision/index.d.ts +11 -0
  61. package/icons-branded/decision/index.js +4 -0
  62. package/icons-branded/developer/index.d.ts +11 -0
  63. package/icons-branded/developer/index.js +4 -0
  64. package/icons-branded/direction/index.d.ts +11 -0
  65. package/icons-branded/direction/index.js +4 -0
  66. package/icons-branded/easytouse/index.js +1 -1
  67. package/icons-branded/edit/index.d.ts +11 -0
  68. package/icons-branded/edit/index.js +4 -0
  69. package/icons-branded/finance/index.js +1 -1
  70. package/icons-branded/flow/index.d.ts +11 -0
  71. package/icons-branded/flow/index.js +4 -0
  72. package/icons-branded/flow-chart/index.d.ts +11 -0
  73. package/icons-branded/flow-chart/index.js +4 -0
  74. package/icons-branded/global/index.d.ts +11 -0
  75. package/icons-branded/global/index.js +4 -0
  76. package/icons-branded/gym/index.d.ts +11 -0
  77. package/icons-branded/gym/index.js +4 -0
  78. package/icons-branded/handshaking/index.d.ts +11 -0
  79. package/icons-branded/handshaking/index.js +4 -0
  80. package/icons-branded/health-insurance/index.d.ts +11 -0
  81. package/icons-branded/health-insurance/index.js +4 -0
  82. package/icons-branded/healthcare/index.d.ts +11 -0
  83. package/icons-branded/healthcare/index.js +4 -0
  84. package/icons-branded/idea/index.d.ts +11 -0
  85. package/icons-branded/idea/index.js +4 -0
  86. package/icons-branded/intelligent-revenue-maximisation/index.d.ts +11 -0
  87. package/icons-branded/intelligent-revenue-maximisation/index.js +4 -0
  88. package/icons-branded/laptop/index.d.ts +11 -0
  89. package/icons-branded/laptop/index.js +4 -0
  90. package/icons-branded/layout/index.d.ts +11 -0
  91. package/icons-branded/layout/index.js +4 -0
  92. package/icons-branded/lock/index.d.ts +11 -0
  93. package/icons-branded/lock/index.js +4 -0
  94. package/icons-branded/logistic/index.d.ts +11 -0
  95. package/icons-branded/logistic/index.js +4 -0
  96. package/icons-branded/long-message/index.d.ts +11 -0
  97. package/icons-branded/long-message/index.js +4 -0
  98. package/icons-branded/loop/index.d.ts +11 -0
  99. package/icons-branded/loop/index.js +4 -0
  100. package/icons-branded/low-cost/index.d.ts +11 -0
  101. package/icons-branded/low-cost/index.js +4 -0
  102. package/icons-branded/make-it-happen/index.d.ts +11 -0
  103. package/icons-branded/make-it-happen/index.js +4 -0
  104. package/icons-branded/make-money/index.d.ts +11 -0
  105. package/icons-branded/make-money/index.js +4 -0
  106. package/icons-branded/massage/index.d.ts +11 -0
  107. package/icons-branded/massage/index.js +4 -0
  108. package/icons-branded/media/index.d.ts +11 -0
  109. package/icons-branded/media/index.js +4 -0
  110. package/icons-branded/message/index.d.ts +11 -0
  111. package/icons-branded/message/index.js +4 -0
  112. package/icons-branded/message-questions/index.d.ts +11 -0
  113. package/icons-branded/message-questions/index.js +4 -0
  114. package/icons-branded/messaging/index.d.ts +11 -0
  115. package/icons-branded/messaging/index.js +4 -0
  116. package/icons-branded/mic/index.d.ts +11 -0
  117. package/icons-branded/mic/index.js +4 -0
  118. package/icons-branded/mobile/index.d.ts +11 -0
  119. package/icons-branded/mobile/index.js +4 -0
  120. package/icons-branded/mobile-intergration/index.d.ts +11 -0
  121. package/icons-branded/mobile-intergration/index.js +4 -0
  122. package/icons-branded/mobile-numbers/index.d.ts +11 -0
  123. package/icons-branded/mobile-numbers/index.js +4 -0
  124. package/icons-branded/money/index.d.ts +11 -0
  125. package/icons-branded/money/index.js +4 -0
  126. package/icons-branded/multiple-channels/index.js +1 -1
  127. package/icons-branded/music/index.d.ts +11 -0
  128. package/icons-branded/music/index.js +4 -0
  129. package/icons-branded/mute/index.d.ts +11 -0
  130. package/icons-branded/mute/index.js +4 -0
  131. package/icons-branded/news/index.d.ts +11 -0
  132. package/icons-branded/news/index.js +4 -0
  133. package/icons-branded/numbers/index.d.ts +11 -0
  134. package/icons-branded/numbers/index.js +4 -0
  135. package/icons-branded/office/index.d.ts +11 -0
  136. package/icons-branded/office/index.js +4 -0
  137. package/icons-branded/office-activities/index.d.ts +11 -0
  138. package/icons-branded/office-activities/index.js +4 -0
  139. package/icons-branded/opened-message/index.d.ts +11 -0
  140. package/icons-branded/opened-message/index.js +4 -0
  141. package/icons-branded/operators/index.d.ts +11 -0
  142. package/icons-branded/operators/index.js +4 -0
  143. package/icons-branded/package/index.d.ts +11 -0
  144. package/icons-branded/package/index.js +4 -0
  145. package/icons-branded/path/index.d.ts +11 -0
  146. package/icons-branded/path/index.js +4 -0
  147. package/icons-branded/perso-message/index.d.ts +11 -0
  148. package/icons-branded/perso-message/index.js +4 -0
  149. package/icons-branded/pie-chart/index.d.ts +11 -0
  150. package/icons-branded/pie-chart/index.js +4 -0
  151. package/icons-branded/piggybank/index.d.ts +11 -0
  152. package/icons-branded/piggybank/index.js +4 -0
  153. package/icons-branded/pin/index.d.ts +11 -0
  154. package/icons-branded/pin/index.js +4 -0
  155. package/icons-branded/price-tag/index.d.ts +11 -0
  156. package/icons-branded/price-tag/index.js +4 -0
  157. package/icons-branded/protection/index.d.ts +11 -0
  158. package/icons-branded/protection/index.js +4 -0
  159. package/icons-branded/purpose/index.d.ts +11 -0
  160. package/icons-branded/purpose/index.js +4 -0
  161. package/icons-branded/puzzle/index.d.ts +11 -0
  162. package/icons-branded/puzzle/index.js +4 -0
  163. package/icons-branded/queue/index.d.ts +11 -0
  164. package/icons-branded/queue/index.js +4 -0
  165. package/icons-branded/retail/index.d.ts +11 -0
  166. package/icons-branded/retail/index.js +4 -0
  167. package/icons-branded/rich-content/index.d.ts +11 -0
  168. package/icons-branded/rich-content/index.js +4 -0
  169. package/icons-branded/rocket/index.js +1 -1
  170. package/icons-branded/roi/index.d.ts +11 -0
  171. package/icons-branded/roi/index.js +4 -0
  172. package/icons-branded/search/index.d.ts +11 -0
  173. package/icons-branded/search/index.js +4 -0
  174. package/icons-branded/send/index.d.ts +11 -0
  175. package/icons-branded/send/index.js +4 -0
  176. package/icons-branded/settings/index.js +1 -1
  177. package/icons-branded/shopping-cart/index.d.ts +11 -0
  178. package/icons-branded/shopping-cart/index.js +4 -0
  179. package/icons-branded/support/index.d.ts +11 -0
  180. package/icons-branded/support/index.js +4 -0
  181. package/icons-branded/system-settings/index.d.ts +11 -0
  182. package/icons-branded/system-settings/index.js +4 -0
  183. package/icons-branded/telemast/index.d.ts +11 -0
  184. package/icons-branded/telemast/index.js +4 -0
  185. package/icons-branded/thumbs-down/index.d.ts +11 -0
  186. package/icons-branded/thumbs-down/index.js +4 -0
  187. package/icons-branded/thumbs-up/index.d.ts +11 -0
  188. package/icons-branded/thumbs-up/index.js +4 -0
  189. package/icons-branded/tutorial/index.d.ts +11 -0
  190. package/icons-branded/tutorial/index.js +4 -0
  191. package/icons-branded/verification-api/index.d.ts +11 -0
  192. package/icons-branded/verification-api/index.js +4 -0
  193. package/icons-branded/video-calling/index.d.ts +11 -0
  194. package/icons-branded/video-calling/index.js +4 -0
  195. package/icons-branded/video-off/index.d.ts +11 -0
  196. package/icons-branded/video-off/index.js +4 -0
  197. package/icons-branded/video-on/index.d.ts +11 -0
  198. package/icons-branded/video-on/index.js +4 -0
  199. package/icons-branded/voice-calling/index.d.ts +11 -0
  200. package/icons-branded/voice-calling/index.js +4 -0
  201. package/icons-branded/voice-video-and-data/index.d.ts +11 -0
  202. package/icons-branded/voice-video-and-data/index.js +4 -0
  203. package/icons-branded/webhook/index.d.ts +11 -0
  204. package/icons-branded/webhook/index.js +4 -0
  205. package/icons-branded/wheels/index.d.ts +11 -0
  206. package/icons-branded/wheels/index.js +4 -0
  207. package/icons-branded/wi-fi/index.d.ts +11 -0
  208. package/icons-branded/wi-fi/index.js +4 -0
  209. package/illustrations/create-illustration-class.js +1 -1
  210. package/inline-alert/index.js +1 -1
  211. package/logo/engage-icon/index.d.ts +11 -0
  212. package/logo/engage-icon/index.js +4 -0
  213. package/logo/engage-icon-wordmark/index.d.ts +11 -0
  214. package/logo/engage-icon-wordmark/index.js +4 -0
  215. package/package.json +1 -1
  216. package/tag/index.js +4 -2
  217. package/textarea/index.js +41 -20
  218. package/theme/button.css +2 -2
  219. package/theme/chip.css +8 -0
  220. package/theme/contextual.css +23 -11
  221. package/theme/palette.css +12 -12
  222. package/theme/tag.css +8 -0
  223. package/toast/index.js +1 -1
  224. package/utils/dom.js +3 -1
  225. package/vertical-stepper-item/index.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "0.45.2",
3
+ "version": "0.47.0",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",
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
- assertTagColor(this, colorName);
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
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:var(--sinch-shape-radius-s);width:100%;padding:8px 12px;font:var(--sinch-font-text-m);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);resize:none;white-space:pre-wrap}#input::placeholder{font:var(--sinch-font-text-m);color:var(--sinch-color-text-muted);opacity:1}#input:disabled{border-color:var(--sinch-color-snow-500);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}:host([invalid]:not([invalid=false])) #input:enabled{border-color:var(--sinch-color-text-invalid)}</style><textarea id="input"></textarea>';
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('-change', this.#onChangeReactHandler);
25
- this.addEventListener('-focus', this.#onFocusReactHandler);
26
- this.addEventListener('-blur', this.#onBlurReactHandler);
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
- this.#$input.removeEventListener('input', this.#onInput);
30
- this.#$input.removeEventListener('compositionstart', this.#onCompositionStart);
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: transparent;
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: transparent;
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
  }
@@ -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-comp-green: var(--sinch-color-tropical-100);
7
- --sinch-color-bg-comp-blue: var(--sinch-color-ocean-100);
8
- --sinch-color-bg-comp-yellow: var(--sinch-color-honey-200);
9
- --sinch-color-bg-comp-red: var(--sinch-color-raspberry-100);
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-border-default: var(--sinch-color-snow-700);
21
- --sinch-color-border-light: var(--sinch-color-snow-500);
22
- --sinch-color-border-dark: var(--sinch-color-stormy-100);
23
- --sinch-color-border-active: var(--sinch-color-stormy-500);
24
- --sinch-color-border-disabled: var(--sinch-color-snow-400);
25
- --sinch-color-border-focus: var(--sinch-color-ocean-500);
26
- --sinch-color-border-invalid: var(--sinch-color-raspberry-600);
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-error-700: #882024;
72
- --sinch-color-error-500: #D13D42;
73
- --sinch-color-error-200: #FBD5D5;
74
- --sinch-color-success-700: #275D33;
75
- --sinch-color-success-500: #46A65A;
76
- --sinch-color-success-200: #D7F1D8;
77
- --sinch-color-informative-700: #003B7E;
78
- --sinch-color-informative-500: #2071CE;
79
- --sinch-color-informative-200: #D5E5F8;
80
- --sinch-color-warning-700: #9C2E00;
81
- --sinch-color-warning-500: #F35B1C;
82
- --sinch-color-warning-200: #FFE8D6;
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-200)}:host([type=warn]) #wrapper{background-color:var(--sinch-color-warning-200)}:host([type=error]) #wrapper{background-color:var(--sinch-color-error-200)}:host([type=info]) #wrapper{background-color:var(--sinch-color-informative-200)}:host([type=success]) #icon-success{display:block;--sinch-color-icon:var(--sinch-color-success-500)}:host([type=warn]) #icon-warn{display:block;--sinch-color-icon:var(--sinch-color-warning-500)}:host([type=error]) #icon-error{display:block;--sinch-color-icon:var(--sinch-color-error-500)}:host([type=info]) #icon-info{display:block;--sinch-color-icon:var(--sinch-color-informative-500)}</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>';
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
- throw new Error(`Invalid attribute value: ${attrName} = ${attrValue}`);
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-error-200);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>';
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;