@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
package/tabs/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchTabsElement = HTMLElement & {
3
+ export type TSinchTabsElement = HTMLElement & {
4
4
  /** Value */
5
5
  value: string;
6
6
  nthOptionRect(index: number): TRect | null;
@@ -9,7 +9,7 @@ export declare type TSinchTabsElement = HTMLElement & {
9
9
  /** Value */
10
10
  setAttribute(name: 'value', value: string): void;
11
11
  };
12
- export declare type TSinchTabsReact = TSinchElementReact<TSinchTabsElement> & {
12
+ export type TSinchTabsReact = TSinchElementReact<TSinchTabsElement> & {
13
13
  /** Value */
14
14
  value: string;
15
15
  /** Label that is used for a11y */
@@ -1,5 +1,5 @@
1
1
  import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
2
- const templateHTML = '<style>:host{display:block;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:column;padding:12px 16px 0;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}:host([data-checked]) #button{--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}#button:disabled{cursor:unset;pointer-events:none;--sinch-color-icon:var(--sinch-color-border-default)}::slotted(*){display:block}</style><sinch-tooltip id="tooltip" inverted><button id="button"><slot name="icon"></slot></button></sinch-tooltip>';
2
+ const templateHTML = '<style>:host{display:block;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:column;padding:12px 16px 0;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}#button:disabled{cursor:unset;pointer-events:none;--sinch-color-icon:var(--sinch-color-border-default)}:host([data-checked]) #button{--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}::slotted(*){display:block}</style><sinch-tooltip id="tooltip" inverted><button id="button"><slot name="icon"></slot></button></sinch-tooltip>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
5
  defineCustomElement('sinch-tabs-icon-option', class extends NectaryElement {
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTabsIconOptionElement = HTMLElement & {
2
+ export type TSinchTabsIconOptionElement = HTMLElement & {
3
3
  /** Value */
4
4
  value: string;
5
5
  /** Disabled */
@@ -9,7 +9,7 @@ export declare type TSinchTabsIconOptionElement = HTMLElement & {
9
9
  /** Disabled */
10
10
  setAttribute(name: 'disabled', value: ''): void;
11
11
  };
12
- export declare type TSinchTabsIconOptionReact = TSinchElementReact<TSinchTabsIconOptionElement> & {
12
+ export type TSinchTabsIconOptionReact = TSinchElementReact<TSinchTabsIconOptionElement> & {
13
13
  /** Value */
14
14
  value: string;
15
15
  /** Label that is used for a11y */
@@ -1,6 +1,6 @@
1
1
  import '../text';
2
2
  import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
3
- const templateHTML = '<style>:host{display:block}#button{all:initial;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 16px;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;color:var(--sinch-color-stormy-300);--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}:host([data-checked]) #button{color:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}#button:disabled{cursor:unset;pointer-events:none;color:var(--sinch-color-border-default);--sinch-color-icon:var(--sinch-color-border-default)}#text{flex-shrink:1;flex-basis:auto;min-width:0}::slotted(*){display:block}</style><button id="button"><slot name="icon"></slot><sinch-text id="text" type="m" ellipsis></sinch-text></button>';
3
+ const templateHTML = '<style>:host{display:block}#button{all:initial;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 16px;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;color:var(--sinch-color-stormy-300);--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}#button:disabled{cursor:unset;pointer-events:none;color:var(--sinch-color-border-default);--sinch-color-icon:var(--sinch-color-border-default)}:host([data-checked]) #button{color:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}#text{flex-shrink:1;flex-basis:auto;min-width:0}::slotted(*){display:block}</style><button id="button"><slot name="icon"></slot><sinch-text id="text" type="m" ellipsis></sinch-text></button>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
6
  defineCustomElement('sinch-tabs-option', class extends NectaryElement {
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTabsOptionElement = HTMLElement & {
2
+ export type TSinchTabsOptionElement = HTMLElement & {
3
3
  /** Value */
4
4
  value: string;
5
5
  /** Text */
@@ -13,7 +13,7 @@ export declare type TSinchTabsOptionElement = HTMLElement & {
13
13
  /** Disabled */
14
14
  setAttribute(name: 'disabled', value: ''): void;
15
15
  };
16
- export declare type TSinchTabsOptionReact = TSinchElementReact<TSinchTabsOptionElement> & {
16
+ export type TSinchTabsOptionReact = TSinchElementReact<TSinchTabsOptionElement> & {
17
17
  /** Value */
18
18
  value: string;
19
19
  /** Text */
package/tag/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTagElement = HTMLElement & {
2
+ export type TSinchTagElement = HTMLElement & {
3
3
  /** Text */
4
4
  text: string;
5
5
  /** Color, gray by default */
@@ -13,7 +13,7 @@ export declare type TSinchTagElement = HTMLElement & {
13
13
  /** Small */
14
14
  setAttribute(name: 'small', value: ''): void;
15
15
  };
16
- export declare type TSinchTagReact = TSinchElementReact<TSinchTagElement> & {
16
+ export type TSinchTagReact = TSinchElementReact<TSinchTagElement> & {
17
17
  /** Text */
18
18
  text: string;
19
19
  /** Color, gray by default */
package/text/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import '../icons/cancel';
2
2
  import { defineCustomElement, getBooleanAttribute, updateBooleanAttribute, NectaryElement, getLiteralAttribute, updateLiteralAttribute, isAttrTrue } from '../utils';
3
- const templateHTML = '<style>:host{display:block;font:var(--sinch-font-text-m)}:host([inline]:not([inline=false])){display:inline}:host([type="s"]){font:var(--sinch-font-text-s)}:host([type=xs]){font:var(--sinch-font-text-xs)}:host([type=xxs]){font:var(--sinch-font-text-xxs)}:host([emphasized]:not([emphasized=false])){font-weight:var(--sinch-font-weight-emphasized)}:host([ellipsis]:not([ellipsis=false])){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--sinch-text-white-space:nowrap}</style><slot></slot>';
3
+ const templateHTML = '<style>:host{display:block;font:var(--sinch-font-text-m);font-style:inherit;font-weight:inherit;text-decoration:inherit}:host([inline]:not([inline=false])){display:inline}:host([type="s"]){font:var(--sinch-font-text-s)}:host([type=xs]){font:var(--sinch-font-text-xs)}:host([type=xxs]){font:var(--sinch-font-text-xxs)}:host([emphasized]:not([emphasized=false])){font-weight:var(--sinch-font-weight-emphasized)}:host([ellipsis]:not([ellipsis=false])){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--sinch-text-white-space:nowrap}</style><slot></slot>';
4
4
  import { assertType, typeValues } from './utils';
5
5
  const template = document.createElement('template');
6
6
  template.innerHTML = templateHTML;
@@ -12,9 +12,7 @@ defineCustomElement('sinch-text', class extends NectaryElement {
12
12
  }
13
13
  connectedCallback() {
14
14
  this.setAttribute('role', getBooleanAttribute(this, 'inline') ? 'text' : 'paragraph');
15
-
16
15
  }
17
-
18
16
  get type() {
19
17
  return getLiteralAttribute(this, typeValues, 'type');
20
18
  }
package/text/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTextType = 'm' | 's' | 'xs' | 'xxs';
3
- export declare type TSinchTextElement = HTMLElement & {
2
+ export type TSinchTextType = 'm' | 's' | 'xs' | 'xxs';
3
+ export type TSinchTextElement = HTMLElement & {
4
4
  type: TSinchTextType;
5
5
  inline: boolean;
6
6
  emphasized: boolean;
@@ -10,7 +10,7 @@ export declare type TSinchTextElement = HTMLElement & {
10
10
  setAttribute(name: 'emphasized', value: ''): void;
11
11
  setAttribute(name: 'ellipsis', value: ''): void;
12
12
  };
13
- export declare type TSinchTextReact = TSinchElementReact<TSinchTextElement> & {
13
+ export type TSinchTextReact = TSinchElementReact<TSinchTextElement> & {
14
14
  type: TSinchTextType;
15
15
  inline?: boolean;
16
16
  emphasized?: boolean;
package/text/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchTextType } from './types';
2
2
  export declare const typeValues: readonly TSinchTextType[];
3
- declare type TAssertType = (value: string | null) => asserts value is TSinchTextType;
3
+ type TAssertType = (value: string | null) => asserts value is TSinchTextType;
4
4
  export declare const assertType: TAssertType;
5
5
  export {};
package/text/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const typeValues = ['m', 's', 'xs', 'xxs'];
2
2
  export const assertType = value => {
3
3
  if (value === null || !typeValues.includes(value)) {
4
- throw new Error(`sinch-title: invalid type attribute: ${value}`);
4
+ throw new Error(`sinch-text: invalid "type" attribute: "${value}"`);
5
5
  }
6
6
  };
package/textarea/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
2
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
+ 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-text-disabled);-webkit-text-fill-color:var(--sinch-color-text-disabled)}#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>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
6
  defineCustomElement('sinch-textarea', class extends NectaryElement {
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchTextareaElement = HTMLElement & {
3
+ export type TSinchTextareaElement = HTMLElement & {
4
4
  /** Value */
5
5
  value: string;
6
6
  /** Text that appears in the text field when it has no value set */
@@ -35,7 +35,7 @@ export declare type TSinchTextareaElement = HTMLElement & {
35
35
  /** Whether the text field is resizable */
36
36
  setAttribute(name: 'resizable', value: ''): void;
37
37
  };
38
- export declare type TSinchTextareaReact = TSinchElementReact<TSinchTextareaElement> & {
38
+ export type TSinchTextareaReact = TSinchElementReact<TSinchTextareaElement> & {
39
39
  /** Value */
40
40
  value: string;
41
41
  /** Text that appears in the text field when it has no value set */
package/theme/fonts.css CHANGED
@@ -31,6 +31,39 @@
31
31
  url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700.woff") format("woff");
32
32
  }
33
33
 
34
+ @font-face {
35
+ font-family: "DM Sans";
36
+ font-weight: 400;
37
+ font-style: italic;
38
+ font-display: swap;
39
+ src:
40
+ local("DMSans-Italic"),
41
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff2") format("woff2"),
42
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff") format("woff");
43
+ }
44
+
45
+ @font-face {
46
+ font-family: "DM Sans";
47
+ font-weight: 500;
48
+ font-style: italic;
49
+ font-display: swap;
50
+ src:
51
+ local("DMSans-MediumItalic"),
52
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff2") format("woff2"),
53
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff") format("woff");
54
+ }
55
+
56
+ @font-face {
57
+ font-family: "DM Sans";
58
+ font-weight: 700;
59
+ font-style: italic;
60
+ font-display: swap;
61
+ src:
62
+ local("DMSans-BoldItalic"),
63
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff2") format("woff2"),
64
+ url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff") format("woff");
65
+ }
66
+
34
67
  @font-face {
35
68
  font-family: "DM Mono";
36
69
  font-weight: 400;
package/theme/fonts.json CHANGED
@@ -32,6 +32,39 @@
32
32
  "woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700.woff"
33
33
  }
34
34
  },
35
+ {
36
+ "family": "DM Sans",
37
+ "weight": 400,
38
+ "style": "italic",
39
+ "display": "swap",
40
+ "src": {
41
+ "local": "DMSans-Italic",
42
+ "woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff2",
43
+ "woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff"
44
+ }
45
+ },
46
+ {
47
+ "family": "DM Sans",
48
+ "weight": 500,
49
+ "style": "italic",
50
+ "display": "swap",
51
+ "src": {
52
+ "local": "DMSans-MediumItalic",
53
+ "woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff2",
54
+ "woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff"
55
+ }
56
+ },
57
+ {
58
+ "family": "DM Sans",
59
+ "weight": 700,
60
+ "style": "italic",
61
+ "display": "swap",
62
+ "src": {
63
+ "local": "DMSans-BoldItalic",
64
+ "woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff2",
65
+ "woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff"
66
+ }
67
+ },
35
68
  {
36
69
  "family": "DM Mono",
37
70
  "weight": 400,
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchTileControlElement = HTMLElement & {
3
+ export type TSinchTileControlElement = HTMLElement & {
4
4
  /** Value */
5
5
  value: string;
6
6
  /** Small */
@@ -20,7 +20,7 @@ export declare type TSinchTileControlElement = HTMLElement & {
20
20
  /** Number of columns from 1 to 8 */
21
21
  setAttribute(name: 'cols', value: string): void;
22
22
  };
23
- export declare type TSinchTileControlReact = TSinchElementReact<TSinchTileControlElement> & {
23
+ export type TSinchTileControlReact = TSinchElementReact<TSinchTileControlElement> & {
24
24
  /** Value */
25
25
  value: string;
26
26
  /** Multiple */
@@ -1,5 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTileControlOptionElement = HTMLElement & {
2
+ export type TSinchTileControlOptionElement = HTMLElement & {
3
3
  /** Value */
4
4
  value: string;
5
5
  /** Text content */
@@ -21,7 +21,7 @@ export declare type TSinchTileControlOptionElement = HTMLElement & {
21
21
  /** Small */
22
22
  setAttribute(name: 'small', value: ''): void;
23
23
  };
24
- export declare type TSinchTileControlOptionReact = TSinchElementReact<TSinchTileControlOptionElement> & {
24
+ export type TSinchTileControlOptionReact = TSinchElementReact<TSinchTileControlOptionElement> & {
25
25
  /** Value */
26
26
  value: string;
27
27
  /** Text content */
@@ -53,7 +53,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
53
53
  const HOUR_12_DIGIT_RADIUS = HOUR_12_RADIUS + HOUR_12_DIGIT_SIZE / 2;
54
54
  const HOUR_24_DIGIT_RADIUS = HOUR_24_RADIUS + HOUR_24_DIGIT_SIZE / 2;
55
55
  const hours12Frag = document.createDocumentFragment();
56
-
57
56
  for (let i = 0; i < 12; i++) {
58
57
  const rad = Math.PI / 6 * (i - 3);
59
58
  const el = document.createElement('div');
@@ -66,7 +65,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
66
65
  hours12Frag.appendChild(el);
67
66
  }
68
67
  this.#$pickerHours.appendChild(hours12Frag);
69
-
70
68
  const hours24Frag = document.createDocumentFragment();
71
69
  for (let i = 12; i < 24; i++) {
72
70
  const rad = Math.PI / 6 * (i - 3);
@@ -80,7 +78,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
80
78
  hours24Frag.appendChild(el);
81
79
  }
82
80
  this.#$pickerHours.appendChild(hours24Frag);
83
-
84
81
  const minutesFrag = document.createDocumentFragment();
85
82
  for (let i = 0; i < 60; i += 5) {
86
83
  const rad = Math.PI / 30 * (i - 15);
@@ -207,7 +204,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
207
204
  if (dy < 0) {
208
205
  cssDeg += 180;
209
206
  }
210
-
211
207
  const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
212
208
  return [cssDeg, rowIndex];
213
209
  }
@@ -1,6 +1,6 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchTimePickerElement = HTMLElement & {
3
+ export type TSinchTimePickerElement = HTMLElement & {
4
4
  /** Time value in ISO 8601 format */
5
5
  value: string;
6
6
  /** AM/PM 12-hour clock system, `false` by default */
@@ -21,7 +21,7 @@ export declare type TSinchTimePickerElement = HTMLElement & {
21
21
  /** Submit button label that is used for a11y */
22
22
  setAttribute(name: 'submit-aria-label', value: string): void;
23
23
  };
24
- export declare type TSinchTimePickerReact = TSinchElementReact<TSinchTimePickerElement> & {
24
+ export type TSinchTimePickerReact = TSinchElementReact<TSinchTimePickerElement> & {
25
25
  /** Time value in ISO 8601 format */
26
26
  value: string;
27
27
  /** AM/PM 12-hour clock system, `false` by default */
package/title/index.js CHANGED
@@ -14,9 +14,7 @@ defineCustomElement('sinch-title', class extends NectaryElement {
14
14
  }
15
15
  connectedCallback() {
16
16
  this.setAttribute('role', 'heading');
17
-
18
17
  }
19
-
20
18
  get text() {
21
19
  return getAttribute(this, 'text', '');
22
20
  }
package/title/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchTitleType = 'xl' | 'l' | 'm' | 's' | 'xs';
3
- export declare type TSinchTitleLevel = '1' | '2' | '3' | '4' | '5' | '6';
4
- export declare type TSinchTitleElement = HTMLElement & {
2
+ export type TSinchTitleType = 'xl' | 'l' | 'm' | 's' | 'xs';
3
+ export type TSinchTitleLevel = '1' | '2' | '3' | '4' | '5' | '6';
4
+ export type TSinchTitleElement = HTMLElement & {
5
5
  text: string;
6
6
  type: TSinchTitleType;
7
7
  level: TSinchTitleLevel;
@@ -11,7 +11,7 @@ export declare type TSinchTitleElement = HTMLElement & {
11
11
  setAttribute(name: 'level', value: TSinchTitleLevel): void;
12
12
  setAttribute(name: 'ellipsis', value: ''): void;
13
13
  };
14
- export declare type TSinchTitleReact = TSinchElementReact<TSinchTitleElement> & {
14
+ export type TSinchTitleReact = TSinchElementReact<TSinchTitleElement> & {
15
15
  text: string;
16
16
  type: TSinchTitleType;
17
17
  level: TSinchTitleLevel;
package/title/utils.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import type { TSinchTitleLevel, TSinchTitleType } from './types';
2
2
  export declare const typeValues: readonly TSinchTitleType[];
3
3
  export declare const levelValues: readonly TSinchTitleLevel[];
4
- declare type TAssertLevel = (value: string | null) => asserts value is TSinchTitleLevel;
4
+ type TAssertLevel = (value: string | null) => asserts value is TSinchTitleLevel;
5
5
  export declare const assertLevel: TAssertLevel;
6
- declare type TAssertType = (value: string | null) => asserts value is TSinchTitleType;
6
+ type TAssertType = (value: string | null) => asserts value is TSinchTitleType;
7
7
  export declare const assertType: TAssertType;
8
8
  export declare const getTitleLevelFromType: (type: TSinchTitleType) => TSinchTitleLevel;
9
+ export declare const getTitleTypeFromLevel: (level: TSinchTitleLevel) => TSinchTitleType;
9
10
  export {};
package/title/utils.js CHANGED
@@ -25,4 +25,21 @@ export const getTitleLevelFromType = type => {
25
25
  default:
26
26
  throw new Error(`sinch-title: invalid type value: ${type}`);
27
27
  }
28
+ };
29
+ export const getTitleTypeFromLevel = level => {
30
+ switch (level) {
31
+ case '1':
32
+ return 'xl';
33
+ case '2':
34
+ return 'l';
35
+ case '3':
36
+ return 'm';
37
+ case '4':
38
+ return 's';
39
+ case '5':
40
+ case '6':
41
+ return 'xs';
42
+ default:
43
+ throw new Error(`sinch-title: invalid level value: ${level}`);
44
+ }
28
45
  };
package/toast/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
- export declare type TSinchToastType = 'info' | 'warn' | 'error' | 'success';
3
- export declare type TSinchToastElement = HTMLElement & {
2
+ export type TSinchToastType = 'info' | 'warn' | 'error' | 'success';
3
+ export type TSinchToastElement = HTMLElement & {
4
4
  /** Type */
5
5
  type: TSinchToastType;
6
6
  /** Text */
@@ -16,7 +16,7 @@ export declare type TSinchToastElement = HTMLElement & {
16
16
  /** Persistent, i.e. doesn't automatically dissapear after 5s */
17
17
  setAttribute(name: 'persistent', value: ''): void;
18
18
  };
19
- export declare type TSinchToastReact = TSinchElementReact<TSinchToastElement> & {
19
+ export type TSinchToastReact = TSinchElementReact<TSinchToastElement> & {
20
20
  /** Type */
21
21
  type: TSinchToastType;
22
22
  /** Text */
package/toast/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TSinchToastType } from './types';
2
2
  export declare const typeValues: readonly TSinchToastType[];
3
- declare type TAssertType = (value: string | null) => asserts value is TSinchToastType;
3
+ type TAssertType = (value: string | null) => asserts value is TSinchToastType;
4
4
  export declare const assertType: TAssertType;
5
5
  export {};
@@ -101,7 +101,6 @@ defineCustomElement('sinch-toast-manager', class extends NectaryElement {
101
101
  this.#onAnimateRemove(item, removeIndex);
102
102
  ++removeIndex;
103
103
  }
104
-
105
104
  let addIndex = 0;
106
105
  for (const item of slotItems) {
107
106
  if (this.#map.has(item)) {
@@ -1,7 +1,7 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
- export declare type TSinchToastManagerElement = HTMLElement & {
2
+ export type TSinchToastManagerElement = HTMLElement & {
3
3
  readonly containerRect: TRect;
4
4
  nthActionRect: (nth: number) => TRect | null;
5
5
  nthCloseRect: (nth: number) => TRect | null;
6
6
  };
7
- export declare type TSinchToastManagerReact = TSinchElementReact<TSinchToastManagerElement> & {};
7
+ export type TSinchToastManagerReact = TSinchElementReact<TSinchToastManagerElement> & {};
package/toggle/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
- export declare type TSinchToggleElement = HTMLElement & {
3
+ export type TSinchToggleElement = HTMLElement & {
4
4
  checked: boolean;
5
5
  small: boolean;
6
6
  labeled: boolean;
@@ -14,7 +14,7 @@ export declare type TSinchToggleElement = HTMLElement & {
14
14
  setAttribute(name: 'disabled', value: ''): void;
15
15
  setAttribute(name: 'text', value: string): void;
16
16
  };
17
- export declare type TSinchToggleReact = TSinchElementReact<TSinchToggleElement> & {
17
+ export type TSinchToggleReact = TSinchElementReact<TSinchToggleElement> & {
18
18
  checked?: boolean;
19
19
  small?: boolean;
20
20
  labeled?: boolean;
@@ -1,4 +1,4 @@
1
- declare type TTooltipStateOptions = {
1
+ type TTooltipStateOptions = {
2
2
  showDelay: number;
3
3
  hideDelay: number;
4
4
  hideAnimationDuration: number;
@@ -1,6 +1,6 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
- export declare type TSinchTooltipOrientation = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
3
- export declare type TSinchTooltipElement = HTMLElement & {
2
+ export type TSinchTooltipOrientation = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
3
+ export type TSinchTooltipElement = HTMLElement & {
4
4
  /** Text */
5
5
  text: string;
6
6
  /** @deprecated */
@@ -24,7 +24,7 @@ export declare type TSinchTooltipElement = HTMLElement & {
24
24
  /** Orientation, where it *points to* from origin */
25
25
  setAttribute(name: 'orientation', value: TSinchTooltipOrientation): void;
26
26
  };
27
- export declare type TSinchTooltipReact = TSinchElementReact<TSinchTooltipElement> & {
27
+ export type TSinchTooltipReact = TSinchElementReact<TSinchTooltipElement> & {
28
28
  /** Text */
29
29
  text: string;
30
30
  /** @deprecated */
@@ -1,7 +1,7 @@
1
- import type { TSinchPopOrientation } from '../pop/types';
2
1
  import type { TSinchTooltipOrientation } from './types';
2
+ import type { TSinchPopOrientation } from '../pop/types';
3
3
  export declare const orientationValues: readonly TSinchTooltipOrientation[];
4
4
  export declare const getPopOrientation: (orientation: TSinchTooltipOrientation) => TSinchPopOrientation;
5
- declare type TAssertOrientation = (value: string | null) => asserts value is TSinchTooltipOrientation;
5
+ type TAssertOrientation = (value: string | null) => asserts value is TSinchTooltipOrientation;
6
6
  export declare const assertOrientation: TAssertOrientation;
7
7
  export {};
@@ -1,11 +1,11 @@
1
- export declare type TContextName = 'visibility' | 'keydown' | 'size';
2
- export declare type TContextKeydown = {
1
+ export type TContextName = 'visibility' | 'keydown' | 'size';
2
+ export type TContextKeydown = {
3
3
  code: string;
4
4
  preventDefault: () => void;
5
5
  };
6
- export declare type TContextVisibility = boolean;
7
- export declare type TContextSize = string;
8
- declare type TContextDataType = {
6
+ export type TContextVisibility = boolean;
7
+ export type TContextSize = string;
8
+ type TContextDataType = {
9
9
  visibility: TContextVisibility;
10
10
  keydown: TContextKeydown;
11
11
  size: TContextSize;
package/utils/context.js CHANGED
@@ -69,7 +69,6 @@ export const subscribeContext = ($el, name, cb, signal) => {
69
69
  detail: $el
70
70
  }));
71
71
  });
72
-
73
72
  $el.addEventListener(contextNameToEventMap[name], cb, {
74
73
  signal
75
74
  });
@@ -1,4 +1,4 @@
1
- export declare type TSinchCountry = {
1
+ export type TSinchCountry = {
2
2
  name: string;
3
3
  phoneCode: string;
4
4
  };
package/utils/dom.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare function getLiteralAttribute<T extends readonly string[]>($elemen
11
11
  export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: null): T[number] | null;
12
12
  export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: T[number]): T[number];
13
13
  export declare const clampNumber: (value: number, min: number, max: number) => number;
14
- declare type IntegerOptions = {
14
+ type IntegerOptions = {
15
15
  min?: number;
16
16
  max?: number;
17
17
  defaultValue?: number | null;
package/utils/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './slot';
7
7
  export * from './throttle';
8
8
  export * from './debounce';
9
9
  export * from './get-react-event-handler';
10
+ export * from './markdown';
package/utils/index.js CHANGED
@@ -6,4 +6,5 @@ export * from './rect';
6
6
  export * from './slot';
7
7
  export * from './throttle';
8
8
  export * from './debounce';
9
- export * from './get-react-event-handler';
9
+ export * from './get-react-event-handler';
10
+ export * from './markdown';
@@ -0,0 +1 @@
1
+ export declare const parseMarkdown: (md: string) => string;