@nectary/components 0.48.1 → 0.49.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 (149) hide show
  1. package/accordion/types.d.ts +2 -2
  2. package/accordion-item/types.d.ts +3 -3
  3. package/action-menu/index.js +0 -1
  4. package/action-menu/types.d.ts +2 -2
  5. package/action-menu-option/index.js +1 -1
  6. package/action-menu-option/types.d.ts +2 -2
  7. package/alert/index.d.ts +2 -1
  8. package/alert/index.js +4 -3
  9. package/alert/types.d.ts +3 -3
  10. package/alert/utils.d.ts +1 -1
  11. package/avatar/types.d.ts +3 -3
  12. package/avatar/utils.d.ts +1 -1
  13. package/badge/types.d.ts +3 -3
  14. package/badge/utils.d.ts +1 -1
  15. package/button/types.d.ts +3 -3
  16. package/button/utils.d.ts +1 -1
  17. package/card/types.d.ts +2 -2
  18. package/card-container/types.d.ts +2 -2
  19. package/chat/types.d.ts +2 -2
  20. package/chat-block/types.d.ts +3 -3
  21. package/chat-bubble/types.d.ts +4 -4
  22. package/checkbox/types.d.ts +2 -2
  23. package/chip/types.d.ts +2 -2
  24. package/code-tag/index.d.ts +13 -0
  25. package/code-tag/index.js +36 -0
  26. package/code-tag/types.d.ts +11 -0
  27. package/code-tag/types.js +1 -0
  28. package/color-menu/index.js +0 -3
  29. package/color-menu/types.d.ts +2 -2
  30. package/color-swatch/types.d.ts +2 -2
  31. package/date-picker/index.js +0 -6
  32. package/date-picker/types.d.ts +2 -2
  33. package/date-picker/utils.d.ts +6 -6
  34. package/dialog/index.js +0 -1
  35. package/dialog/types.d.ts +2 -2
  36. package/emoji/types.d.ts +2 -2
  37. package/emoji/utils.js +0 -4
  38. package/emoji-picker/index.js +1 -3
  39. package/emoji-picker/types.d.ts +4 -4
  40. package/field/types.d.ts +2 -2
  41. package/file-drop/types.d.ts +3 -3
  42. package/file-picker/index.js +0 -1
  43. package/file-picker/types.d.ts +3 -3
  44. package/file-status/types.d.ts +3 -3
  45. package/file-status/utils.d.ts +1 -1
  46. package/flag/types.d.ts +2 -2
  47. package/flag/utils.js +0 -2
  48. package/grid/types.d.ts +2 -2
  49. package/grid-item/types.d.ts +2 -2
  50. package/help-tooltip/types.d.ts +2 -2
  51. package/horizontal-stepper/types.d.ts +2 -2
  52. package/horizontal-stepper-item/types.d.ts +3 -3
  53. package/icon/types.d.ts +2 -2
  54. package/icon-button/types.d.ts +3 -3
  55. package/icon-button/utils.d.ts +1 -1
  56. package/icons/types.d.ts +2 -2
  57. package/icons-branded/types.d.ts +2 -2
  58. package/icons-channel/types.d.ts +2 -2
  59. package/illustrations/types.d.ts +4 -4
  60. package/inline-alert/index.d.ts +4 -3
  61. package/inline-alert/index.js +6 -5
  62. package/inline-alert/types.d.ts +3 -3
  63. package/inline-alert/utils.d.ts +1 -1
  64. package/input/index.js +17 -3
  65. package/input/types.d.ts +9 -3
  66. package/input/utils.d.ts +3 -0
  67. package/input/utils.js +6 -1
  68. package/link/types.d.ts +2 -2
  69. package/list/types.d.ts +2 -2
  70. package/list-item/types.d.ts +2 -2
  71. package/logo/types.d.ts +2 -2
  72. package/package.json +10 -9
  73. package/pagination/index.js +0 -6
  74. package/pagination/types.d.ts +2 -2
  75. package/pop/index.js +0 -16
  76. package/pop/types.d.ts +3 -3
  77. package/pop/utils.d.ts +1 -1
  78. package/popover/types.d.ts +3 -3
  79. package/popover/utils.d.ts +2 -2
  80. package/progress/types.d.ts +2 -2
  81. package/radio/types.d.ts +2 -2
  82. package/radio-option/types.d.ts +2 -2
  83. package/rich-text/index.d.ts +12 -0
  84. package/rich-text/index.js +56 -0
  85. package/rich-text/types.d.ts +12 -0
  86. package/rich-text/types.js +1 -0
  87. package/rich-text/utils.d.ts +5 -0
  88. package/rich-text/utils.js +6 -0
  89. package/segment/types.d.ts +2 -2
  90. package/segment-collapse/types.d.ts +2 -2
  91. package/segmented-control/types.d.ts +2 -2
  92. package/segmented-control-option/types.d.ts +2 -2
  93. package/segmented-icon-control/types.d.ts +2 -2
  94. package/segmented-icon-control-option/types.d.ts +2 -2
  95. package/select-button/index.js +1 -1
  96. package/select-button/types.d.ts +2 -2
  97. package/select-menu/index.js +0 -1
  98. package/select-menu/types.d.ts +2 -2
  99. package/select-menu-option/index.js +1 -1
  100. package/select-menu-option/types.d.ts +2 -2
  101. package/spinner/types.d.ts +2 -2
  102. package/table/types.d.ts +2 -2
  103. package/table-body/types.d.ts +2 -2
  104. package/table-cell/types.d.ts +3 -3
  105. package/table-head/types.d.ts +2 -2
  106. package/table-head-cell/types.d.ts +2 -2
  107. package/table-row/types.d.ts +2 -2
  108. package/tabs/types.d.ts +2 -2
  109. package/tabs-icon-option/index.js +1 -1
  110. package/tabs-icon-option/types.d.ts +2 -2
  111. package/tabs-option/index.js +1 -1
  112. package/tabs-option/types.d.ts +2 -2
  113. package/tag/types.d.ts +2 -2
  114. package/text/index.js +1 -3
  115. package/text/types.d.ts +3 -3
  116. package/text/utils.d.ts +1 -1
  117. package/text/utils.js +1 -1
  118. package/textarea/index.js +1 -1
  119. package/textarea/types.d.ts +2 -2
  120. package/theme/fonts.css +33 -0
  121. package/theme/fonts.json +33 -0
  122. package/tile-control/types.d.ts +2 -2
  123. package/tile-control-option/types.d.ts +2 -2
  124. package/time-picker/index.js +0 -4
  125. package/time-picker/types.d.ts +2 -2
  126. package/title/index.js +0 -2
  127. package/title/types.d.ts +4 -4
  128. package/title/utils.d.ts +3 -2
  129. package/title/utils.js +17 -0
  130. package/toast/types.d.ts +3 -3
  131. package/toast/utils.d.ts +1 -1
  132. package/toast-manager/index.js +0 -1
  133. package/toast-manager/types.d.ts +2 -2
  134. package/toggle/types.d.ts +2 -2
  135. package/tooltip/tooltip-state.d.ts +1 -1
  136. package/tooltip/types.d.ts +3 -3
  137. package/tooltip/utils.d.ts +2 -2
  138. package/utils/context.d.ts +5 -5
  139. package/utils/context.js +0 -1
  140. package/utils/countries.d.ts +1 -1
  141. package/utils/dom.d.ts +1 -1
  142. package/utils/index.d.ts +1 -0
  143. package/utils/index.js +2 -1
  144. package/utils/markdown.d.ts +1 -0
  145. package/utils/markdown.js +128 -0
  146. package/utils/rect.js +0 -1
  147. package/utils/size.d.ts +4 -4
  148. package/vertical-stepper/types.d.ts +2 -2
  149. package/vertical-stepper-item/types.d.ts +3 -3
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchAccordionElement = HTMLElement & {
3
+ export type TSinchAccordionElement = HTMLElement & {
4
4
  /** Value */
5
5
  value: string;
6
6
  /** Allows to expand multiple items simultanously */
@@ -12,7 +12,7 @@ export declare type TSinchAccordionElement = HTMLElement & {
12
12
  /** Allows to expand multiple items simultanously */
13
13
  setAttribute(name: 'multiple', value: ''): void;
14
14
  };
15
- export declare type TSinchAccordionReact = TSinchElementReact<TSinchAccordionElement> & {
15
+ export type TSinchAccordionReact = TSinchElementReact<TSinchAccordionElement> & {
16
16
  /** Value */
17
17
  value: string;
18
18
  multiple?: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchAccordionStatusType = 'info' | 'success' | 'warn' | 'error';
3
- export declare type TSinchAccordionItemElement = HTMLElement & {
2
+ export type TSinchAccordionStatusType = 'info' | 'success' | 'warn' | 'error';
3
+ export type TSinchAccordionItemElement = HTMLElement & {
4
4
  /** Value */
5
5
  value: string;
6
6
  /** Label */
@@ -22,7 +22,7 @@ export declare type TSinchAccordionItemElement = HTMLElement & {
22
22
  /** Disabled */
23
23
  setAttribute(name: 'disabled', value: ''): void;
24
24
  };
25
- export declare type TSinchAccordionItemReact = TSinchElementReact<TSinchAccordionItemElement> & {
25
+ export type TSinchAccordionItemReact = TSinchElementReact<TSinchAccordionItemElement> & {
26
26
  /** Value */
27
27
  value: string;
28
28
  /** Label */
@@ -159,7 +159,6 @@ defineCustomElement('sinch-action-menu', class extends NectaryElement {
159
159
  const hasRows = this.hasAttribute('rows');
160
160
  for (const $op of this.#getOptionElements()) {
161
161
  const isSelected = $op === $option;
162
-
163
162
  updateBooleanAttribute($op, 'data-selected', isSelected);
164
163
  if (isSelected && hasRows) {
165
164
  $op.scrollIntoView?.({
@@ -1,11 +1,11 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchActionMenuElement = HTMLElement & {
2
+ export type TSinchActionMenuElement = HTMLElement & {
3
3
  /** How many rows to show and scroll the rest */
4
4
  rows: number | null;
5
5
  /** How many rows to show and scroll the rest */
6
6
  setAttribute(name: 'rows', value: string): void;
7
7
  };
8
- export declare type TSinchActionMenuReact = TSinchElementReact<TSinchActionMenuElement> & {
8
+ export type TSinchActionMenuReact = TSinchElementReact<TSinchActionMenuElement> & {
9
9
  /** How many rows to show and scroll the rest */
10
10
  rows?: number;
11
11
  /** Label that is used for a11y */
@@ -1,6 +1,6 @@
1
1
  import '../text';
2
2
  import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
3
- const templateHTML = '<style>:host{display:block}#wrapper{all:initial;display:flex;position:relative;box-sizing:border-box;height:40px;width:100%;padding:8px 16px;align-items:center;gap:10px;user-select:none;cursor:pointer;color:var(--sinch-color-text-default);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:24px}#content{flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host(:hover:not([disabled]))>#wrapper,:host([data-selected])>#wrapper{background-color:var(--sinch-color-snow-400)}:host([disabled])>#wrapper{cursor:initial;pointer-events:none;color:var(--sinch-color-text-disabled);--sinch-color-icon:var(--sinch-color-stormy-100)}::slotted(*){margin-left:-6px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="content" type="m" ellipsis></sinch-text></div>';
3
+ const templateHTML = '<style>:host{display:block}#wrapper{all:initial;display:flex;position:relative;box-sizing:border-box;height:40px;width:100%;padding:8px 16px;align-items:center;gap:10px;user-select:none;cursor:pointer;color:var(--sinch-color-text-default);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:24px}#content{flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled])>#wrapper{cursor:initial;pointer-events:none;color:var(--sinch-color-text-disabled);--sinch-color-icon:var(--sinch-color-stormy-100)}:host(:hover:not([disabled]))>#wrapper,:host([data-selected])>#wrapper{background-color:var(--sinch-color-snow-400)}::slotted(*){margin-left:-6px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="content" type="m" ellipsis></sinch-text></div>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
6
  defineCustomElement('sinch-action-menu-option', class ActionMenuOption extends NectaryElement {
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchActionMenuOptionElement = HTMLElement & {
2
+ export type TSinchActionMenuOptionElement = HTMLElement & {
3
3
  /** Display text */
4
4
  text: string;
5
5
  /** Disabled state */
@@ -11,7 +11,7 @@ export declare type TSinchActionMenuOptionElement = HTMLElement & {
11
11
  /** Disabled state */
12
12
  setAttribute(name: 'disabled', value: ''): void;
13
13
  };
14
- export declare type TSinchActionMenuOptionReact = TSinchElementReact<TSinchActionMenuOptionElement> & {
14
+ export type TSinchActionMenuOptionReact = TSinchElementReact<TSinchActionMenuOptionElement> & {
15
15
  /** Display text */
16
16
  text: string;
17
17
  /** Disabled state */
package/alert/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import '../icons/info';
1
2
  import '../icons/report-problem';
2
3
  import '../icons/report';
3
- import '../icons/info';
4
+ import '../rich-text';
4
5
  import '../text';
5
6
  import type { TSinchAlertElement, TSinchAlertReact } from './types';
6
7
  declare global {
package/alert/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import '../icons/info';
1
2
  import '../icons/report-problem';
2
3
  import '../icons/report';
3
- import '../icons/info';
4
+ import '../rich-text';
4
5
  import '../text';
5
6
  import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute, updateLiteralAttribute, NectaryElement } from '../utils';
6
- const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}#text{color:var(--sinch-color-stormy-500);flex:1;min-width:0}#icon-error,#icon-info,#icon-warn{display:none}: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=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-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>';
7
+ const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}#text{display:flex;flex-direction:column;gap:8px;color:var(--sinch-color-stormy-500);flex:1;min-width:0}#icon-error,#icon-info,#icon-warn{display:none}: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=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-report-problem id="icon-warn"></sinch-icon-report-problem><sinch-icon-report id="icon-error"></sinch-icon-report><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
7
8
  import { assertType, typeValues } from './utils';
8
9
  const template = document.createElement('template');
9
10
  template.innerHTML = templateHTML;
@@ -44,7 +45,7 @@ defineCustomElement('sinch-alert', class extends NectaryElement {
44
45
  }
45
46
  case 'text':
46
47
  {
47
- this.#$text.textContent = newVal;
48
+ updateAttribute(this.#$text, 'text', newVal);
48
49
  break;
49
50
  }
50
51
  }
package/alert/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchAlertType = 'info' | 'warn' | 'error';
3
- export declare type TSinchAlertElement = HTMLElement & {
2
+ export type TSinchAlertType = 'info' | 'warn' | 'error';
3
+ export type TSinchAlertElement = HTMLElement & {
4
4
  /** Type */
5
5
  type: TSinchAlertType;
6
6
  /** Text */
@@ -10,7 +10,7 @@ export declare type TSinchAlertElement = HTMLElement & {
10
10
  /** Text */
11
11
  setAttribute(name: 'text', value: string): void;
12
12
  };
13
- export declare type TSinchAlertReact = TSinchElementReact<TSinchAlertElement> & {
13
+ export type TSinchAlertReact = TSinchElementReact<TSinchAlertElement> & {
14
14
  /** Type */
15
15
  type: TSinchAlertType;
16
16
  /** Text */
package/alert/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchAlertType } from './types';
2
2
  export declare const typeValues: readonly TSinchAlertType[];
3
- declare type TAssertType = (value: string | null) => asserts value is TSinchAlertType;
3
+ type TAssertType = (value: string | null) => asserts value is TSinchAlertType;
4
4
  export declare const assertType: TAssertType;
5
5
  export {};
package/avatar/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { TSinchSize } from '../utils/size';
3
- export declare type TSinchAvatarStatus = 'online' | 'busy' | 'away' | 'offline';
4
- export declare type TSinchAvatarElement = HTMLElement & {
3
+ export type TSinchAvatarStatus = 'online' | 'busy' | 'away' | 'offline';
4
+ export type TSinchAvatarElement = HTMLElement & {
5
5
  /** Image source */
6
6
  src: string | null;
7
7
  /** Alt text */
@@ -23,7 +23,7 @@ export declare type TSinchAvatarElement = HTMLElement & {
23
23
  /** Status */
24
24
  setAttribute(name: 'status', value: TSinchAvatarStatus): void;
25
25
  };
26
- export declare type TSinchAvatarReact = TSinchElementReact<TSinchAvatarElement> & {
26
+ export type TSinchAvatarReact = TSinchElementReact<TSinchAvatarElement> & {
27
27
  /** Image source */
28
28
  src?: string;
29
29
  /** Alt text */
package/avatar/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchAvatarStatus } from './types';
2
2
  export declare const statusValues: readonly TSinchAvatarStatus[];
3
- declare type TAssertStatus = (value: string | null) => asserts value is TSinchAvatarStatus;
3
+ type TAssertStatus = (value: string | null) => asserts value is TSinchAvatarStatus;
4
4
  export declare const assertStatus: TAssertStatus;
5
5
  export declare const getAvatarColorBg: (id: string) => string;
6
6
  export declare const getAvatarColorFg: (id: string) => string;
package/badge/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
2
  import type { TSinchSize } from '../utils/size';
3
- export declare type TSinchBadgeMode = 'square' | 'circle';
4
- export declare type TSinchBadgeElement = HTMLElement & {
3
+ export type TSinchBadgeMode = 'square' | 'circle';
4
+ export type TSinchBadgeElement = HTMLElement & {
5
5
  /** Text */
6
6
  text: string;
7
7
  /** Size */
@@ -24,7 +24,7 @@ export declare type TSinchBadgeElement = HTMLElement & {
24
24
  /** Hidden */
25
25
  setAttribute(name: 'hidden', value: ''): void;
26
26
  };
27
- export declare type TSinchBadgeReact = TSinchElementReact<TSinchBadgeElement> & {
27
+ export type TSinchBadgeReact = TSinchElementReact<TSinchBadgeElement> & {
28
28
  /** Text */
29
29
  text: string;
30
30
  /** Size */
package/badge/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchBadgeMode } from './types';
2
2
  export declare const modeValues: readonly TSinchBadgeMode[];
3
- declare type TAssertMode = (value: string | null) => asserts value is TSinchBadgeMode;
3
+ type TAssertMode = (value: string | null) => asserts value is TSinchBadgeMode;
4
4
  export declare const assertMode: TAssertMode;
5
5
  export declare const getBadgeColorBg: (id: string) => string;
6
6
  export declare const getBadgeColorFg: (id: string) => string;
package/button/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { TSinchSize } from '../utils/size';
3
- export declare type TSinchButtonType = 'primary' | 'secondary' | 'tertiary' | 'cta-primary' | 'cta-secondary' | 'destructive';
4
- export declare type TSinchButtonElement = HTMLElement & {
3
+ export type TSinchButtonType = 'primary' | 'secondary' | 'tertiary' | 'cta-primary' | 'cta-secondary' | 'destructive';
4
+ export type TSinchButtonElement = HTMLElement & {
5
5
  /** Type, `primary` by default */
6
6
  type: TSinchButtonType;
7
7
  /** Size, `m` by default */
@@ -25,7 +25,7 @@ export declare type TSinchButtonElement = HTMLElement & {
25
25
  /** Disabled */
26
26
  setAttribute(attr: 'disabled', value: ''): void;
27
27
  };
28
- export declare type TSinchButtonReact = TSinchElementReact<TSinchButtonElement> & {
28
+ export type TSinchButtonReact = TSinchElementReact<TSinchButtonElement> & {
29
29
  /** Type, `primary` by default */
30
30
  type?: TSinchButtonType;
31
31
  /** Size, `m` by default */
package/button/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchButtonType } from './types';
2
2
  export declare const typeValues: readonly TSinchButtonType[];
3
- declare type TAssertType = (value: string | null) => asserts value is TSinchButtonType;
3
+ type TAssertType = (value: string | null) => asserts value is TSinchButtonType;
4
4
  export declare const assertType: TAssertType;
5
5
  export {};
package/card/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchCardElement = HTMLElement & {
2
+ export type TSinchCardElement = HTMLElement & {
3
3
  /** Text */
4
4
  text: string;
5
5
  /** Caption */
@@ -17,7 +17,7 @@ export declare type TSinchCardElement = HTMLElement & {
17
17
  /** Disabled */
18
18
  setAttribute(name: 'disabled', value: ''): void;
19
19
  };
20
- export declare type TSinchCardReact = TSinchElementReact<TSinchCardElement> & {
20
+ export type TSinchCardReact = TSinchElementReact<TSinchCardElement> & {
21
21
  /** Text */
22
22
  text: string;
23
23
  /** Caption */
@@ -1,3 +1,3 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchCardContainerElement = HTMLElement;
3
- export declare type TSinchCardContainerReact = TSinchElementReact<TSinchCardContainerElement>;
2
+ export type TSinchCardContainerElement = HTMLElement;
3
+ export type TSinchCardContainerReact = TSinchElementReact<TSinchCardContainerElement>;
package/chat/types.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchChatElement = HTMLElement;
3
- export declare type TSinchChatReact = TSinchElementReact<TSinchChatElement>;
2
+ export type TSinchChatElement = HTMLElement;
3
+ export type TSinchChatReact = TSinchElementReact<TSinchChatElement>;
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchChatBlockType = 'customer' | 'agent' | 'agent-prev';
3
- export declare type TSinchChatBlockElement = HTMLElement & {
2
+ export type TSinchChatBlockType = 'customer' | 'agent' | 'agent-prev';
3
+ export type TSinchChatBlockElement = HTMLElement & {
4
4
  /** Type */
5
5
  type: TSinchChatBlockType | null;
6
6
  /** First name */
@@ -18,7 +18,7 @@ export declare type TSinchChatBlockElement = HTMLElement & {
18
18
  /** Timestamp */
19
19
  setAttribute(name: 'timestamp', value: string): void;
20
20
  };
21
- export declare type TSinchChatBlockReact = TSinchElementReact<TSinchChatBlockElement> & {
21
+ export type TSinchChatBlockReact = TSinchElementReact<TSinchChatBlockElement> & {
22
22
  /** Type */
23
23
  type: TSinchChatBlockType;
24
24
  /** First name */
@@ -1,7 +1,7 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchChatBubbleType = 'customer' | 'agent' | 'agent-prev';
3
- export declare type TSinchChatBubbleStatus = 'sending' | 'sent' | 'received' | 'seen' | 'error';
4
- export declare type TSinchChatBubbleElement = HTMLElement & {
2
+ export type TSinchChatBubbleType = 'customer' | 'agent' | 'agent-prev';
3
+ export type TSinchChatBubbleStatus = 'sending' | 'sent' | 'received' | 'seen' | 'error';
4
+ export type TSinchChatBubbleElement = HTMLElement & {
5
5
  readonly type: TSinchChatBubbleType | null;
6
6
  /** Text */
7
7
  text: string;
@@ -12,7 +12,7 @@ export declare type TSinchChatBubbleElement = HTMLElement & {
12
12
  /** Status */
13
13
  setAttribute(name: 'status', value: TSinchChatBubbleStatus): void;
14
14
  };
15
- export declare type TSinchChatBubbleReact = TSinchElementReact<TSinchChatBubbleElement> & {
15
+ export type TSinchChatBubbleReact = TSinchElementReact<TSinchChatBubbleElement> & {
16
16
  /** Text */
17
17
  text: string;
18
18
  /** Status */
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchCheckboxElement = HTMLElement & {
3
+ export type TSinchCheckboxElement = HTMLElement & {
4
4
  checked: boolean;
5
5
  indeterminate: boolean;
6
6
  disabled: boolean;
@@ -15,7 +15,7 @@ export declare type TSinchCheckboxElement = HTMLElement & {
15
15
  setAttribute(name: 'invalid', value: ''): void;
16
16
  setAttribute(name: 'text', value: string): void;
17
17
  };
18
- export declare type TSinchCheckboxReact = TSinchElementReact<TSinchCheckboxElement> & {
18
+ export type TSinchCheckboxReact = TSinchElementReact<TSinchCheckboxElement> & {
19
19
  checked?: boolean;
20
20
  indeterminate?: boolean;
21
21
  disabled?: boolean;
package/chip/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchChipElement = HTMLElement & {
2
+ export type TSinchChipElement = HTMLElement & {
3
3
  /** Text */
4
4
  text: string;
5
5
  /** Color, gray by default */
@@ -19,7 +19,7 @@ export declare type TSinchChipElement = HTMLElement & {
19
19
  /** Small */
20
20
  setAttribute(name: 'small', value: ''): void;
21
21
  };
22
- export declare type TSinchChipReact = TSinchElementReact<TSinchChipElement> & {
22
+ export type TSinchChipReact = TSinchElementReact<TSinchChipElement> & {
23
23
  /** Text */
24
24
  text: string;
25
25
  /** Color, gray by default */
@@ -0,0 +1,13 @@
1
+ import '../icons/open-in-new';
2
+ import '../icons/arrow-forward';
3
+ import type { TSinchCodeTagElement, TSinchCodeTagReact } from './types';
4
+ declare global {
5
+ namespace JSX {
6
+ interface IntrinsicElements {
7
+ 'sinch-code-tag': TSinchCodeTagReact;
8
+ }
9
+ }
10
+ interface HTMLElementTagNameMap {
11
+ 'sinch-code-tag': TSinchCodeTagElement;
12
+ }
13
+ }
@@ -0,0 +1,36 @@
1
+ import '../icons/open-in-new';
2
+ import '../icons/arrow-forward';
3
+ import { defineCustomElement, getAttribute, updateAttribute, NectaryElement } from '../utils';
4
+ const templateHTML = '<style>:host{display:inline}#content{font:var(--sinch-font-mono-text-s);font-size:inherit;line-height:inherit;text-decoration:inherit;border:1px solid var(--sinch-color-border-light);background-color:var(--sinch-color-bg-primary-contrast);padding:0 .25em;border-radius:var(--sinch-shape-radius-xs)}</style><span id="content"></span>';
5
+ const template = document.createElement('template');
6
+ template.innerHTML = templateHTML;
7
+ defineCustomElement('sinch-code-tag', class extends NectaryElement {
8
+ #$text;
9
+ constructor() {
10
+ super();
11
+ const shadowRoot = this.attachShadow();
12
+ shadowRoot.appendChild(template.content.cloneNode(true));
13
+ this.#$text = shadowRoot.querySelector('#content');
14
+ }
15
+ get text() {
16
+ return getAttribute(this, 'text', '');
17
+ }
18
+ set text(value) {
19
+ updateAttribute(this, 'text', value);
20
+ }
21
+ static get observedAttributes() {
22
+ return ['text'];
23
+ }
24
+ attributeChangedCallback(name, oldVal, newVal) {
25
+ if (oldVal === newVal) {
26
+ return;
27
+ }
28
+ switch (name) {
29
+ case 'text':
30
+ {
31
+ this.#$text.textContent = newVal;
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ });
@@ -0,0 +1,11 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ export type TSinchCodeTagElement = HTMLElement & {
3
+ /** Text content of hyperlink */
4
+ text: string;
5
+ /** Text content of hyperlink */
6
+ setAttribute(name: 'text', value: string): void;
7
+ };
8
+ export type TSinchCodeTagReact = TSinchElementReact<TSinchCodeTagElement> & {
9
+ /** Text content of hyperlink */
10
+ text: string;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -146,9 +146,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
146
146
  fragment.appendChild(optFrag);
147
147
  }
148
148
  this.#$listbox.replaceChildren(fragment);
149
-
150
149
  this.#updateColumns();
151
-
152
150
  this.#onValueChange();
153
151
  }
154
152
  #updateRows() {
@@ -305,7 +303,6 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
305
303
  const hasRows = this.hasAttribute('rows');
306
304
  for (const $op of this.#getOptionElements()) {
307
305
  const isSelected = $op === $option;
308
-
309
306
  updateBooleanAttribute($op, 'data-selected', isSelected);
310
307
  if (isSelected && hasRows) {
311
308
  $op.scrollIntoView?.({
@@ -1,5 +1,5 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
- export declare type TSinchColorMenuElement = HTMLElement & {
2
+ export type TSinchColorMenuElement = HTMLElement & {
3
3
  /** Value */
4
4
  value: string;
5
5
  /** How many rows to show and scroll the rest */
@@ -20,7 +20,7 @@ export declare type TSinchColorMenuElement = HTMLElement & {
20
20
  /** How many cols to show and scroll the rest */
21
21
  setAttribute(name: 'cols', value: string): void;
22
22
  };
23
- export declare type TSinchColorMenuReact = TSinchElementReact<TSinchColorMenuElement> & {
23
+ export type TSinchColorMenuReact = TSinchElementReact<TSinchColorMenuElement> & {
24
24
  /** Value */
25
25
  value: string;
26
26
  /** How many rows to show and scroll the rest */
@@ -1,11 +1,11 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchColorSwatchElement = HTMLElement & {
2
+ export type TSinchColorSwatchElement = HTMLElement & {
3
3
  /** Color name */
4
4
  name: string | null;
5
5
  /** Color name */
6
6
  setAttribute(name: 'name', value: string): void;
7
7
  };
8
- export declare type TSinchColorSwatchReact = TSinchElementReact<TSinchColorSwatchElement> & {
8
+ export type TSinchColorSwatchReact = TSinchElementReact<TSinchColorSwatchElement> & {
9
9
  /** Color name */
10
10
  name?: string;
11
11
  };
@@ -92,7 +92,6 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
92
92
  if ('production' !== 'production') {
93
93
  assertDate(this.#minDate, name, newVal);
94
94
  }
95
-
96
95
  if (this.#uiDate !== null) {
97
96
  clampMinDate(this.#uiDate, this.#minDate);
98
97
  }
@@ -108,7 +107,6 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
108
107
  if ('production' !== 'production') {
109
108
  assertDate(this.#maxDate, name, newVal);
110
109
  }
111
-
112
110
  if (this.#uiDate !== null) {
113
111
  clampMaxDate(this.#uiDate, this.#maxDate);
114
112
  }
@@ -305,7 +303,6 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
305
303
  this.#render();
306
304
  return;
307
305
  }
308
-
309
306
  this.dispatchEvent(new CustomEvent('change', {
310
307
  detail: dateIso,
311
308
  bubbles: true
@@ -326,7 +323,6 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
326
323
  if (isValidDate(date1) && isValidDate(date2)) {
327
324
  this.#date1 = date1;
328
325
  this.#date2 = date2;
329
-
330
326
  if (this.#uiDate === null) {
331
327
  this.#uiDate = cloneDate(this.#date2);
332
328
  }
@@ -347,11 +343,9 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
347
343
  if (this.#uiDate === null) {
348
344
  this.#uiDate = today();
349
345
  }
350
-
351
346
  if (this.#minDate !== null) {
352
347
  clampMinDate(this.#uiDate, this.#minDate);
353
348
  }
354
-
355
349
  if (this.#maxDate !== null) {
356
350
  clampMaxDate(this.#uiDate, this.#maxDate);
357
351
  }
@@ -1,6 +1,6 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchDatePickerElement = HTMLElement & {
3
+ export type TSinchDatePickerElement = HTMLElement & {
4
4
  /** Date value in ISO 8601 format */
5
5
  value: string;
6
6
  /** Date min limit in ISO 8601 format */
@@ -45,7 +45,7 @@ export declare type TSinchDatePickerElement = HTMLElement & {
45
45
  /** Label that is used for a11y */
46
46
  setAttribute(name: 'next-month-aria-label', value: string): void;
47
47
  };
48
- export declare type TSinchDatePickerReact = TSinchElementReact<TSinchDatePickerElement> & {
48
+ export type TSinchDatePickerReact = TSinchElementReact<TSinchDatePickerElement> & {
49
49
  /** Date value in ISO 8601 format */
50
50
  value: string;
51
51
  /** Date min limit in ISO 8601 format */
@@ -1,20 +1,20 @@
1
- declare type TCalendarOptions = {
1
+ type TCalendarOptions = {
2
2
  firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
3
3
  };
4
- declare type TMaybeDate = Date | null;
4
+ type TMaybeDate = Date | null;
5
5
  export declare const getCalendarMonth: (date: Date, options?: TCalendarOptions) => TMaybeDate[][];
6
6
  export declare const dateToIso: (date: Date) => string;
7
7
  export declare const isoToDate: (value: string) => Date;
8
8
  export declare const today: () => Date;
9
9
  export declare const getDayNames: (locale: string) => string[];
10
10
  export declare const getMonthNames: (locale: string) => string[];
11
- declare type TAssertMinMax = (value: string | null, attrName: string) => asserts value is string;
11
+ type TAssertMinMax = (value: string | null, attrName: string) => asserts value is string;
12
12
  export declare const assertMinMax: TAssertMinMax;
13
- declare type TAssertValue = (value: string | null) => asserts value is string;
13
+ type TAssertValue = (value: string | null) => asserts value is string;
14
14
  export declare const assertValue: TAssertValue;
15
- declare type TAssertLocale = (value: string | null) => asserts value is string;
15
+ type TAssertLocale = (value: string | null) => asserts value is string;
16
16
  export declare const assertLocale: TAssertLocale;
17
- declare type TAssertDate = (value: any, attrName: string, attrValue: string) => asserts value is Date;
17
+ type TAssertDate = (value: any, attrName: string, attrValue: string) => asserts value is Date;
18
18
  export declare const isValidDate: (value: any) => value is Date;
19
19
  export declare const assertDate: TAssertDate;
20
20
  export declare const compareDates: (a: Date, b: Date) => number;
package/dialog/index.js CHANGED
@@ -26,7 +26,6 @@ defineCustomElement('sinch-dialog', class extends NectaryElement {
26
26
  this.#$dialog.addEventListener('mousedown', this.#onBackdropClick);
27
27
  this.#$dialog.addEventListener('cancel', this.#onCancel);
28
28
  this.addEventListener('-close', this.#onCloseReactHandler);
29
-
30
29
  this.#setOpen(getBooleanAttribute(this, 'open'));
31
30
  }
32
31
  disconnectedCallback() {
package/dialog/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
- export declare type TSinchDialogElement = HTMLElement & {
2
+ export type TSinchDialogElement = HTMLElement & {
3
3
  caption: string;
4
4
  readonly dialogRect: TRect;
5
5
  readonly closeButtonRect: TRect;
@@ -7,7 +7,7 @@ export declare type TSinchDialogElement = HTMLElement & {
7
7
  setAttribute(name: 'caption', value: string): void;
8
8
  setAttribute(name: 'close-aria-label', value: string): void;
9
9
  };
10
- export declare type TSinchDialogReact = TSinchElementReact<TSinchDialogElement> & {
10
+ export type TSinchDialogReact = TSinchElementReact<TSinchDialogElement> & {
11
11
  open: boolean;
12
12
  caption: string;
13
13
  'aria-label': string;
package/emoji/types.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchEmojiElement = HTMLElement & {
2
+ export type TSinchEmojiElement = HTMLElement & {
3
3
  /** Emoji character */
4
4
  char: string;
5
5
  /** Emoji character */
6
6
  setAttribute(name: 'char', value: string): void;
7
7
  };
8
- export declare type TSinchEmojiReact = TSinchElementReact<TSinchEmojiElement> & {
8
+ export type TSinchEmojiReact = TSinchElementReact<TSinchEmojiElement> & {
9
9
  /** Emoji character */
10
10
  char: string;
11
11
  };
package/emoji/utils.js CHANGED
@@ -20,13 +20,11 @@ function toCodePoints(unicodeSurrogates) {
20
20
  }
21
21
  return points;
22
22
  }
23
-
24
23
  let emojiUrl = null;
25
24
  export const getEmojiUrl = (root, char) => {
26
25
  if (char === null || char.length === 0) {
27
26
  return '';
28
27
  }
29
-
30
28
  if (emojiUrl === null) {
31
29
  emojiUrl = getCssVar(root, '--sinch-emoji-src-url');
32
30
  if (emojiUrl !== null) {
@@ -37,10 +35,8 @@ export const getEmojiUrl = (root, char) => {
37
35
  return '';
38
36
  }
39
37
  let codepoints = toCodePoints(removeVS16s(char)).join('-');
40
-
41
38
  if (codepoints === '1f441-fe0f-200d-1f5e8-fe0f') {
42
39
  codepoints = '1f441-200d-1f5e8';
43
40
  }
44
-
45
41
  return emojiUrl.replace('%s', codepoints);
46
42
  };
@@ -125,9 +125,7 @@ defineCustomElement('sinch-emoji-picker', class extends NectaryElement {
125
125
  this.#handleKeydown(e.detail);
126
126
  };
127
127
  #onContextVisibility = e => {
128
- if (e.detail) {
129
- } else {
130
- }
128
+ if (e.detail) {} else {}
131
129
  };
132
130
  #onListboxKeyDown = e => {
133
131
  this.#handleKeydown(e);