@nectary/components 4.10.5 → 4.11.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 (171) hide show
  1. package/accordion/index.d.ts +13 -0
  2. package/accordion/index.js +3 -2
  3. package/accordion-item/index.d.ts +23 -1
  4. package/accordion-item/index.js +3 -2
  5. package/action-menu/index.d.ts +12 -0
  6. package/action-menu/index.js +3 -2
  7. package/action-menu-option/index.d.ts +14 -0
  8. package/action-menu-option/index.js +3 -2
  9. package/alert/index.d.ts +14 -1
  10. package/alert/index.js +3 -2
  11. package/avatar/index.d.ts +21 -1
  12. package/avatar/index.js +3 -2
  13. package/badge/index.d.ts +21 -2
  14. package/badge/index.js +3 -2
  15. package/button/index.d.ts +25 -1
  16. package/button/index.js +3 -2
  17. package/button-group/index.d.ts +14 -0
  18. package/button-group/index.js +3 -2
  19. package/button-group-item/index.d.ts +15 -0
  20. package/button-group-item/index.js +3 -2
  21. package/card/index.d.ts +17 -1
  22. package/card/index.js +3 -2
  23. package/card-container/index.d.ts +4 -0
  24. package/card-container/index.js +3 -2
  25. package/card-v2/index.d.ts +15 -0
  26. package/card-v2/index.js +3 -2
  27. package/card-v2-title/index.d.ts +15 -1
  28. package/card-v2-title/index.js +3 -2
  29. package/checkbox/index.d.ts +28 -0
  30. package/checkbox/index.js +3 -2
  31. package/chip/index.d.ts +16 -0
  32. package/chip/index.js +3 -2
  33. package/code-tag/index.d.ts +9 -0
  34. package/code-tag/index.js +3 -2
  35. package/color-menu/index.d.ts +20 -1
  36. package/color-menu/index.js +3 -2
  37. package/color-menu-option/index.d.ts +11 -0
  38. package/color-menu-option/index.js +3 -2
  39. package/color-swatch/index.d.ts +11 -0
  40. package/color-swatch/index.js +3 -2
  41. package/date-picker/index.d.ts +35 -1
  42. package/date-picker/index.js +3 -2
  43. package/dialog/index.d.ts +15 -0
  44. package/dialog/index.js +3 -2
  45. package/emoji/index.d.ts +11 -0
  46. package/emoji/index.js +3 -2
  47. package/emoji-picker/index.d.ts +15 -1
  48. package/emoji-picker/index.js +3 -2
  49. package/field/index.d.ts +21 -0
  50. package/field/index.js +3 -2
  51. package/file-drop/index.d.ts +23 -0
  52. package/file-drop/index.js +3 -2
  53. package/file-picker/index.d.ts +15 -0
  54. package/file-picker/index.js +3 -2
  55. package/file-status/index.d.ts +14 -1
  56. package/file-status/index.js +3 -2
  57. package/flag/index.d.ts +11 -0
  58. package/flag/index.js +3 -2
  59. package/grid/index.d.ts +4 -0
  60. package/grid/index.js +3 -2
  61. package/grid-item/index.d.ts +12 -0
  62. package/grid-item/index.js +3 -2
  63. package/help-tooltip/index.d.ts +17 -0
  64. package/help-tooltip/index.js +3 -2
  65. package/horizontal-stepper/index.d.ts +11 -0
  66. package/horizontal-stepper/index.js +3 -2
  67. package/horizontal-stepper-item/index.d.ts +14 -1
  68. package/horizontal-stepper-item/index.js +3 -2
  69. package/icon/index.d.ts +12 -0
  70. package/icon/index.js +3 -2
  71. package/inline-alert/index.d.ts +16 -1
  72. package/inline-alert/index.js +3 -2
  73. package/input/index.d.ts +45 -1
  74. package/input/index.js +3 -2
  75. package/link/index.d.ts +26 -0
  76. package/link/index.js +3 -2
  77. package/list/index.d.ts +5 -0
  78. package/list/index.js +3 -2
  79. package/list-item/index.d.ts +5 -0
  80. package/list-item/index.js +3 -2
  81. package/package.json +2 -2
  82. package/pagination/index.d.ts +20 -1
  83. package/pagination/index.js +3 -2
  84. package/persistent-overlay/index.d.ts +13 -0
  85. package/persistent-overlay/index.js +3 -2
  86. package/pop/index.d.ts +21 -2
  87. package/pop/index.js +3 -2
  88. package/popover/index.d.ts +20 -1
  89. package/popover/index.js +3 -2
  90. package/progress/index.d.ts +12 -0
  91. package/progress/index.js +3 -2
  92. package/progress-stepper/index.d.ts +15 -1
  93. package/progress-stepper/index.js +3 -2
  94. package/progress-stepper-item/index.d.ts +16 -0
  95. package/progress-stepper-item/index.js +3 -2
  96. package/radio/index.d.ts +19 -0
  97. package/radio/index.js +3 -2
  98. package/radio-option/index.d.ts +18 -0
  99. package/radio-option/index.js +3 -2
  100. package/rich-text/index.d.ts +14 -0
  101. package/rich-text/index.js +3 -2
  102. package/rich-textarea/index.d.ts +28 -0
  103. package/rich-textarea/index.js +3 -2
  104. package/segment/index.d.ts +18 -1
  105. package/segment/index.js +3 -2
  106. package/segment-collapse/index.d.ts +14 -0
  107. package/segment-collapse/index.js +3 -2
  108. package/segmented-control/index.d.ts +11 -0
  109. package/segmented-control/index.js +3 -2
  110. package/segmented-control-option/index.d.ts +16 -0
  111. package/segmented-control-option/index.js +3 -2
  112. package/segmented-icon-control/index.d.ts +13 -0
  113. package/segmented-icon-control/index.js +3 -2
  114. package/segmented-icon-control-option/index.d.ts +14 -0
  115. package/segmented-icon-control-option/index.js +3 -2
  116. package/select-button/index.d.ts +21 -0
  117. package/select-button/index.js +3 -2
  118. package/select-menu/index.d.ts +30 -0
  119. package/select-menu/index.js +3 -2
  120. package/skeleton/index.d.ts +9 -0
  121. package/skeleton/index.js +3 -2
  122. package/skeleton-item/index.d.ts +4 -0
  123. package/skeleton-item/index.js +3 -2
  124. package/spinner/index.d.ts +12 -0
  125. package/spinner/index.js +3 -2
  126. package/stop-events/index.d.ts +6 -1
  127. package/stop-events/index.js +3 -2
  128. package/table/index.d.ts +5 -0
  129. package/table/index.js +3 -2
  130. package/table-body/index.d.ts +5 -0
  131. package/table-body/index.js +3 -2
  132. package/table-cell/index.d.ts +8 -1
  133. package/table-cell/index.js +3 -2
  134. package/table-head/index.d.ts +5 -0
  135. package/table-head/index.js +3 -2
  136. package/table-head-cell/index.d.ts +15 -0
  137. package/table-head-cell/index.js +3 -2
  138. package/table-row/index.d.ts +11 -0
  139. package/table-row/index.js +3 -2
  140. package/tabs/index.d.ts +13 -1
  141. package/tabs/index.js +3 -2
  142. package/tabs-icon-option/index.d.ts +16 -0
  143. package/tabs-icon-option/index.js +3 -2
  144. package/tabs-option/index.d.ts +18 -0
  145. package/tabs-option/index.js +3 -2
  146. package/tag/index.d.ts +15 -0
  147. package/tag/index.js +3 -2
  148. package/text/index.d.ts +17 -1
  149. package/text/index.js +3 -2
  150. package/textarea/index.d.ts +38 -0
  151. package/textarea/index.js +3 -2
  152. package/tile-control/index.d.ts +17 -0
  153. package/tile-control/index.js +3 -2
  154. package/tile-control-option/index.d.ts +18 -0
  155. package/tile-control-option/index.js +3 -2
  156. package/time-picker/index.d.ts +21 -1
  157. package/time-picker/index.js +3 -2
  158. package/title/index.d.ts +15 -1
  159. package/title/index.js +3 -2
  160. package/toast/index.d.ts +16 -1
  161. package/toast/index.js +3 -2
  162. package/toast-manager/index.d.ts +14 -2
  163. package/toast-manager/index.js +3 -2
  164. package/toggle/index.d.ts +20 -0
  165. package/toggle/index.js +3 -2
  166. package/tooltip/index.d.ts +21 -2
  167. package/tooltip/index.js +3 -2
  168. package/vertical-stepper/index.d.ts +11 -0
  169. package/vertical-stepper/index.js +3 -2
  170. package/vertical-stepper-item/index.d.ts +14 -1
  171. package/vertical-stepper-item/index.js +3 -2
package/chip/index.d.ts CHANGED
@@ -1,7 +1,23 @@
1
1
  import '../text';
2
2
  import '../icon';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchChip } from './types';
4
5
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
6
+ export declare class Chip extends NectaryElement {
7
+ #private;
8
+ constructor();
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ static get observedAttributes(): string[];
12
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
13
+ get color(): string | null;
14
+ set color(value: string | null);
15
+ get text(): string;
16
+ set text(value: string);
17
+ get small(): boolean;
18
+ set small(isSmall: boolean);
19
+ get focusable(): boolean;
20
+ }
5
21
  declare global {
6
22
  interface NectaryComponentMap {
7
23
  'sinch-chip': TSinchChip;
package/chip/index.js CHANGED
@@ -5,7 +5,7 @@ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;ou
5
5
  import { getChipColorBg, getChipColorFg } from './utils';
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-chip', class extends NectaryElement {
8
+ export class Chip extends NectaryElement {
9
9
  #$text;
10
10
  #$button;
11
11
  #controller = null;
@@ -141,4 +141,5 @@ defineCustomElement('sinch-chip', class extends NectaryElement {
141
141
  #onClickReactHandler = e => {
142
142
  getReactEventHandler(this, 'on-click')?.(e);
143
143
  };
144
- });
144
+ }
145
+ defineCustomElement('sinch-chip', Chip);
@@ -1,5 +1,14 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchCodeTag } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class CodeTag extends NectaryElement {
5
+ #private;
6
+ constructor();
7
+ static get observedAttributes(): string[];
8
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
9
+ get text(): string;
10
+ set text(value: string);
11
+ }
3
12
  declare global {
4
13
  interface NectaryComponentMap {
5
14
  'sinch-code-tag': TSinchCodeTag;
package/code-tag/index.js CHANGED
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, updateAttribute, NectaryElement } fr
2
2
  const templateHTML = '<style>:host{display:inline}#content{font:var(--sinch-comp-code-tag-font-text);font-size:inherit;line-height:inherit;color:var(--sinch-comp-code-tag-color-default-text-initial);border:1px solid var(--sinch-comp-code-tag-color-default-border-initial);background-color:var(--sinch-comp-code-tag-color-default-background-initial);padding:0 .25em;border-radius:var(--sinch-comp-code-tag-shape-radius);white-space:var(--sinch-global-text-white-space,normal)}</style><span id="content"></span>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-code-tag', class extends NectaryElement {
5
+ export class CodeTag extends NectaryElement {
6
6
  #$text;
7
7
  constructor() {
8
8
  super();
@@ -28,4 +28,5 @@ defineCustomElement('sinch-code-tag', class extends NectaryElement {
28
28
  set text(value) {
29
29
  updateAttribute(this, 'text', value);
30
30
  }
31
- });
31
+ }
32
+ defineCustomElement('sinch-code-tag', CodeTag);
@@ -1,5 +1,24 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchColorMenu } from './types';
2
- import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
3
+ import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
4
+ export declare class ColorMenu extends NectaryElement {
5
+ #private;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ static get observedAttributes(): string[];
10
+ attributeChangedCallback(name: string): void;
11
+ set value(value: string);
12
+ get value(): string;
13
+ set colors(value: string | null);
14
+ get colors(): string | null;
15
+ set rows(value: number | null);
16
+ get rows(): number | null;
17
+ set cols(value: number | null);
18
+ get cols(): number | null;
19
+ get focusable(): boolean;
20
+ nthItemRect(index: number): TRect | null;
21
+ }
3
22
  declare global {
4
23
  interface NectaryComponentMap {
5
24
  'sinch-color-menu': TSinchColorMenu;
@@ -5,7 +5,7 @@ const ITEM_WIDTH = 44;
5
5
  const ITEM_HEIGHT = 56;
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-color-menu', class extends NectaryElement {
8
+ export class ColorMenu extends NectaryElement {
9
9
  #$listbox;
10
10
  #$optionsSlot;
11
11
  #controller = null;
@@ -305,4 +305,5 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
305
305
  #onChangeReactHandler = e => {
306
306
  getReactEventHandler(this, 'on-change')?.(e);
307
307
  };
308
- });
308
+ }
309
+ defineCustomElement('sinch-color-menu', ColorMenu);
@@ -1,7 +1,18 @@
1
1
  import '../color-swatch';
2
2
  import '../tooltip';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchColorMenuOption } from './types';
4
5
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
6
+ export declare class ColorMenuOption extends NectaryElement {
7
+ #private;
8
+ constructor();
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ static get observedAttributes(): string[];
12
+ attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
13
+ set value(value: string);
14
+ get value(): string;
15
+ }
5
16
  declare global {
6
17
  interface NectaryComponentMap {
7
18
  'sinch-color-menu-option': TSinchColorMenuOption;
@@ -5,7 +5,7 @@ import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } fr
5
5
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{width:44px;height:56px;padding:12px 6px;box-sizing:border-box}#swatch-wrapper{position:relative;cursor:pointer;width:32px;height:32px}#swatch-wrapper::after{content:"";position:absolute;width:34px;height:34px;inset:-3px;border:2px solid var(--sinch-comp-color-menu-option-color-default-border-initial);border-radius:50%;pointer-events:none}:host([data-checked]) #swatch-wrapper::after{border-color:var(--sinch-comp-color-menu-option-color-default-border-selected)}:host([data-selected]) #swatch-wrapper::after{border-color:var(--sinch-comp-color-menu-option-color-default-border-focus)}:host(:hover) #swatch-wrapper::after{border-color:var(--sinch-comp-color-menu-option-color-default-border-hover)}:host(:active) #swatch-wrapper::after{border-color:var(--sinch-comp-color-menu-option-color-default-border-active)}</style><div id="wrapper"><sinch-tooltip id="tooltip"><div id="swatch-wrapper"><sinch-color-swatch id="swatch"></sinch-color-swatch></div></sinch-tooltip></div>';
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-color-menu-option', class extends NectaryElement {
8
+ export class ColorMenuOption extends NectaryElement {
9
9
  #$wrapper;
10
10
  #$tooltip;
11
11
  #$swatch;
@@ -45,4 +45,5 @@ defineCustomElement('sinch-color-menu-option', class extends NectaryElement {
45
45
  get value() {
46
46
  return getAttribute(this, 'value', '');
47
47
  }
48
- });
48
+ }
49
+ defineCustomElement('sinch-color-menu-option', ColorMenuOption);
@@ -1,6 +1,17 @@
1
1
  import '../text';
2
+ import { NectaryElement } from '../utils';
2
3
  import type { TSinchColorSwatch } from './types';
3
4
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
5
+ export declare class ColorSwatch extends NectaryElement {
6
+ #private;
7
+ constructor();
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ static get observedAttributes(): string[];
11
+ attributeChangedCallback(name: string): void;
12
+ get name(): string | null;
13
+ set name(value: string | null);
14
+ }
4
15
  declare global {
5
16
  interface NectaryComponentMap {
6
17
  'sinch-color-swatch': TSinchColorSwatch;
@@ -4,7 +4,7 @@ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle}#w
4
4
  import { getSwatchColorBg } from './utils';
5
5
  const template = document.createElement('template');
6
6
  template.innerHTML = templateHTML;
7
- defineCustomElement('sinch-color-swatch', class extends NectaryElement {
7
+ export class ColorSwatch extends NectaryElement {
8
8
  #$wrapper;
9
9
  constructor() {
10
10
  super();
@@ -51,4 +51,5 @@ defineCustomElement('sinch-color-swatch', class extends NectaryElement {
51
51
  setClass(this.#$wrapper, 'no-color', true);
52
52
  }
53
53
  }
54
- });
54
+ }
55
+ defineCustomElement('sinch-color-swatch', ColorSwatch);
@@ -1,7 +1,41 @@
1
1
  import '../icon';
2
2
  import '../text';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchDatePicker } from './types';
4
- import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
5
+ import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
6
+ export declare class DatePicker extends NectaryElement {
7
+ #private;
8
+ static formAssociated: boolean;
9
+ constructor();
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ formAssociatedCallback(): void;
13
+ formResetCallback(): void;
14
+ formStateRestoreCallback(state: string | FormData | null): void;
15
+ static get observedAttributes(): string[];
16
+ attributeChangedCallback(name: string, prevValue: string | null, newVal: string | null): void;
17
+ set name(value: string);
18
+ get name(): string;
19
+ set locale(value: string);
20
+ get locale(): string;
21
+ set value(value: string);
22
+ get value(): string;
23
+ set min(value: string);
24
+ get min(): string;
25
+ set max(value: string);
26
+ get max(): string;
27
+ set range(isRanged: boolean);
28
+ get range(): boolean;
29
+ set prevMonthAriaLabel(value: string);
30
+ get prevMonthAriaLabel(): string;
31
+ set nextMonthAriaLabel(value: string);
32
+ get nextMonthAriaLabel(): string;
33
+ get prevYearButtonRect(): TRect;
34
+ get nextYearButtonRect(): TRect;
35
+ get prevMonthButtonRect(): TRect;
36
+ get nextMonthButtonRect(): TRect;
37
+ nthButtonRect(index: number): TRect | null;
38
+ }
5
39
  declare global {
6
40
  interface NectaryComponentMap {
7
41
  'sinch-date-picker': TSinchDatePicker;
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:block;outline:0}#content{width:fit-co
6
6
  import { areDatesEqual, canGoNextMonth, canGoNextYear, canGoPrevMonth, canGoPrevYear, clampMaxDate, clampMinDate, cloneDate, dateToIso, decMonth, decYear, getCalendarMonth, getDayNames, getMonthNames, incMonth, incYear, isDateBetween, isDateOnScreen, isoToDate, isValidDate, sortDates, today } from './utils';
7
7
  const template = document.createElement('template');
8
8
  template.innerHTML = templateHTML;
9
- defineCustomElement('sinch-date-picker', class extends NectaryElement {
9
+ export class DatePicker extends NectaryElement {
10
10
  #$month;
11
11
  #$weeks;
12
12
  #$days;
@@ -407,4 +407,5 @@ defineCustomElement('sinch-date-picker', class extends NectaryElement {
407
407
  #onChangeReactHandler = e => {
408
408
  getReactEventHandler(this, 'on-change')?.(e);
409
409
  };
410
- });
410
+ }
411
+ defineCustomElement('sinch-date-picker', DatePicker);
package/dialog/index.d.ts CHANGED
@@ -1,8 +1,23 @@
1
1
  import '../icon';
2
2
  import '../stop-events';
3
3
  import '../title';
4
+ import { NectaryElement } from '../utils';
4
5
  import type { TSinchDialog } from './types';
5
6
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
7
+ export declare class Dialog extends NectaryElement {
8
+ #private;
9
+ constructor();
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ static get observedAttributes(): string[];
13
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
14
+ set caption(caption: string);
15
+ get caption(): string;
16
+ set open(isOpen: boolean);
17
+ get open(): boolean;
18
+ get dialogRect(): import("../types").TRect;
19
+ get closeButtonRect(): import("../types").TRect;
20
+ }
6
21
  declare global {
7
22
  interface NectaryComponentMap {
8
23
  'sinch-dialog': TSinchDialog;
package/dialog/index.js CHANGED
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:contents;--sinch-comp-dialog-max-widt
6
6
  import { disableScroll, enableScroll } from './utils';
7
7
  const template = document.createElement('template');
8
8
  template.innerHTML = templateHTML;
9
- defineCustomElement('sinch-dialog', class extends NectaryElement {
9
+ export class Dialog extends NectaryElement {
10
10
  #$dialog;
11
11
  #$closeButton;
12
12
  #$caption;
@@ -145,4 +145,5 @@ defineCustomElement('sinch-dialog', class extends NectaryElement {
145
145
  #onActionSlotChange = () => {
146
146
  setClass(this.#$actionWrapper, 'empty', this.#$actionSlot.assignedElements().length === 0);
147
147
  };
148
- });
148
+ }
149
+ defineCustomElement('sinch-dialog', Dialog);
package/emoji/index.d.ts CHANGED
@@ -1,5 +1,16 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchEmoji } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class Emoji extends NectaryElement {
5
+ #private;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ static get observedAttributes(): string[];
10
+ attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
11
+ set char(value: string);
12
+ get char(): string;
13
+ }
3
14
  declare global {
4
15
  interface NectaryComponentMap {
5
16
  'sinch-emoji': TSinchEmoji;
package/emoji/index.js CHANGED
@@ -3,7 +3,7 @@ const templateHTML = '<style>:host{display:contents;--sinch-comp-emoji-vertical-
3
3
  import { getEmojiBaseUrl, getEmojiUrl } from './utils';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
- defineCustomElement('sinch-emoji', class extends NectaryElement {
6
+ export class Emoji extends NectaryElement {
7
7
  #$img;
8
8
  constructor() {
9
9
  super();
@@ -43,4 +43,5 @@ defineCustomElement('sinch-emoji', class extends NectaryElement {
43
43
  }
44
44
  this.#$img.src = getEmojiUrl(getEmojiBaseUrl(this), this.char);
45
45
  }
46
- });
46
+ }
47
+ defineCustomElement('sinch-emoji', Emoji);
@@ -8,8 +8,22 @@ import '../tabs-icon-option';
8
8
  import '../emoji';
9
9
  import '../text';
10
10
  import '../icon';
11
+ import { NectaryElement } from '../utils';
11
12
  import type { TSinchEmojiPicker } from './types';
12
- import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
13
+ import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
14
+ export declare class EmojiPicker extends NectaryElement {
15
+ #private;
16
+ constructor();
17
+ connectedCallback(): void;
18
+ disconnectedCallback(): void;
19
+ get skinToneButtonRect(): TRect;
20
+ get searchInputRect(): TRect;
21
+ get searchClearButtonRect(): TRect;
22
+ nthSkinToneRect(index: number): TRect | null;
23
+ nthTabRect(index: number): TRect | null;
24
+ nthEmojiRect(index: number): TRect | null;
25
+ get focusable(): boolean;
26
+ }
13
27
  declare global {
14
28
  interface NectaryComponentMap {
15
29
  'sinch-emoji-picker': TSinchEmojiPicker;
@@ -18,7 +18,7 @@ const template = document.createElement('template');
18
18
  const MIN_SEARCH_LENGTH = 2;
19
19
  const SEARCH_DEBOUNCE_TIMEOUT = 300;
20
20
  template.innerHTML = templateHTML;
21
- defineCustomElement('sinch-emoji-picker', class extends NectaryElement {
21
+ export class EmojiPicker extends NectaryElement {
22
22
  #$tabs;
23
23
  #$searchInput;
24
24
  #$searchClearButton;
@@ -304,4 +304,5 @@ defineCustomElement('sinch-emoji-picker', class extends NectaryElement {
304
304
  btn.appendChild(el);
305
305
  return btn;
306
306
  }
307
- });
307
+ }
308
+ defineCustomElement('sinch-emoji-picker', EmojiPicker);
package/field/index.d.ts CHANGED
@@ -1,5 +1,26 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchField } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class Field extends NectaryElement {
5
+ #private;
6
+ topSection: HTMLDivElement;
7
+ constructor();
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ static get observedAttributes(): string[];
11
+ shouldShowTopSection(): void;
12
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
13
+ set label(value: string | null);
14
+ get label(): string | null;
15
+ set optionalText(value: string | null);
16
+ get optionalText(): string | null;
17
+ set additionalText(value: string | null);
18
+ get additionalText(): string | null;
19
+ set invalidText(value: string | null);
20
+ get invalidText(): string | null;
21
+ set disabled(isDisabled: boolean);
22
+ get disabled(): boolean;
23
+ }
3
24
  declare global {
4
25
  interface NectaryComponentMap {
5
26
  'sinch-field': TSinchField;
package/field/index.js CHANGED
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getFirstSlotEle
2
2
  const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;width:100%}#bottom,#top{display:flex;align-items:baseline}#top{height:24px;margin-bottom:2px}#top.empty{display:none}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-comp-field-font-label);color:var(--sinch-comp-field-color-default-label-initial)}#optional{flex:1;font:var(--sinch-comp-field-font-optional);color:var(--sinch-comp-field-color-default-optional-initial);text-align:right}#additional{flex:1;text-align:right;font:var(--sinch-comp-field-font-additional);color:var(--sinch-comp-field-color-default-additional-initial);line-height:20px;margin-top:2px}#additional:empty{display:none}#invalid{font:var(--sinch-comp-field-font-invalid);color:var(--sinch-comp-field-color-invalid-text-initial);line-height:20px;margin-top:2px}#invalid:empty{display:none}#tooltip{align-self:center;margin:0 8px;display:flex}#tooltip.empty{display:none}:host([disabled]) #label{color:var(--sinch-comp-field-color-disabled-label-initial)}:host([disabled]) #additional{color:var(--sinch-comp-field-color-disabled-additional-initial)}:host([disabled]) #optional{color:var(--sinch-comp-field-color-disabled-optional-initial)}</style><div id="wrapper"><div id="top"><label id="label" for="input"></label><div id="tooltip"><slot name="tooltip"></slot></div><span id="optional"></span></div><slot name="input"></slot><div id="bottom"><div id="invalid"></div><div id="additional"></div></div></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-field', class extends NectaryElement {
5
+ export class Field extends NectaryElement {
6
6
  #$label;
7
7
  #$optionalText;
8
8
  #$additionalText;
@@ -117,4 +117,5 @@ defineCustomElement('sinch-field', class extends NectaryElement {
117
117
  #onTooltipSlotChange = () => {
118
118
  setClass(this.#$tooltipWrapper, 'empty', this.#$tooltipSlot.assignedElements().length === 0);
119
119
  };
120
- });
120
+ }
121
+ defineCustomElement('sinch-field', Field);
@@ -1,7 +1,30 @@
1
1
  import '../text';
2
2
  import '../file-picker';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchFileDrop } from './types';
4
5
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
6
+ export declare class FileDrop extends NectaryElement {
7
+ #private;
8
+ constructor();
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ static get observedAttributes(): string[];
12
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
13
+ set multiple(isMultiple: boolean);
14
+ get multiple(): boolean;
15
+ set accept(value: string | null);
16
+ get accept(): string | null;
17
+ get size(): number | null;
18
+ set size(value: number | null);
19
+ set text(value: string);
20
+ get text(): string;
21
+ set placeholder(value: string);
22
+ get placeholder(): string;
23
+ set disabled(isDisabled: boolean);
24
+ get disabled(): boolean;
25
+ set invalid(isInvalid: boolean);
26
+ get invalid(): boolean;
27
+ }
5
28
  declare global {
6
29
  interface NectaryComponentMap {
7
30
  'sinch-file-drop': TSinchFileDrop;
@@ -5,7 +5,7 @@ const templateHTML = '<style>:host{display:block}#wrapper{position:relative;disp
5
5
  import { areFilesAccepted, areItemsAccepted, doFilesSatisfySize } from './utils';
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-file-drop', class extends NectaryElement {
8
+ export class FileDrop extends NectaryElement {
9
9
  #$filePicker;
10
10
  #$dropArea;
11
11
  #$placeholder;
@@ -208,4 +208,5 @@ defineCustomElement('sinch-file-drop', class extends NectaryElement {
208
208
  detail: type
209
209
  }));
210
210
  }
211
- });
211
+ }
212
+ defineCustomElement('sinch-file-drop', FileDrop);
@@ -1,5 +1,20 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchFilePicker } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class FilePicker extends NectaryElement {
5
+ #private;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ static get observedAttributes(): string[];
10
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
11
+ set multiple(isMultiple: boolean);
12
+ get multiple(): boolean;
13
+ set accept(value: string | null);
14
+ get accept(): string | null;
15
+ get size(): number | null;
16
+ set size(value: number | null);
17
+ }
3
18
  declare global {
4
19
  interface NectaryComponentMap {
5
20
  'sinch-file-picker': TSinchFilePicker;
@@ -3,7 +3,7 @@ const templateHTML = '<style>:host{display:inline-block}::slotted(*){display:blo
3
3
  import { doFilesSatisfySize } from './utils';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
- defineCustomElement('sinch-file-picker', class extends NectaryElement {
6
+ export class FilePicker extends NectaryElement {
7
7
  #$input;
8
8
  #$targetSlot;
9
9
  #controller = null;
@@ -97,4 +97,5 @@ defineCustomElement('sinch-file-picker', class extends NectaryElement {
97
97
  #onInvalidReactHandler = e => {
98
98
  getReactEventHandler(this, 'on-invalid')?.(e);
99
99
  };
100
- });
100
+ }
101
+ defineCustomElement('sinch-file-picker', FilePicker);
@@ -1,8 +1,21 @@
1
1
  import '../spinner';
2
2
  import '../icon';
3
3
  import '../text';
4
- import type { TSinchFileStatus } from './types';
4
+ import { NectaryElement } from '../utils';
5
+ import type { TSinchFileStatusType, TSinchFileStatus } from './types';
5
6
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
7
+ export declare class FileStatus extends NectaryElement {
8
+ #private;
9
+ constructor();
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ get type(): TSinchFileStatusType;
13
+ set type(value: TSinchFileStatusType);
14
+ get filename(): string;
15
+ set filename(value: string);
16
+ static get observedAttributes(): string[];
17
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
18
+ }
6
19
  declare global {
7
20
  interface NectaryComponentMap {
8
21
  'sinch-file-status': TSinchFileStatus;
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-dire
6
6
  import { typeValues } from './utils';
7
7
  const template = document.createElement('template');
8
8
  template.innerHTML = templateHTML;
9
- defineCustomElement('sinch-file-status', class extends NectaryElement {
9
+ export class FileStatus extends NectaryElement {
10
10
  #$filename;
11
11
  #$contentSlot;
12
12
  #controller = null;
@@ -58,4 +58,5 @@ defineCustomElement('sinch-file-status', class extends NectaryElement {
58
58
  #onContentSlotChange = () => {
59
59
  updateBooleanAttribute(this.#$filename, 'emphasized', this.#$contentSlot.assignedElements().length > 0);
60
60
  };
61
- });
61
+ }
62
+ defineCustomElement('sinch-file-status', FileStatus);
package/flag/index.d.ts CHANGED
@@ -1,5 +1,16 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchFlag } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class Flag extends NectaryElement {
5
+ #private;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ static get observedAttributes(): string[];
10
+ attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
11
+ set code(value: string);
12
+ get code(): string;
13
+ }
3
14
  declare global {
4
15
  interface NectaryComponentMap {
5
16
  'sinch-flag': TSinchFlag;
package/flag/index.js CHANGED
@@ -3,7 +3,7 @@ const templateHTML = '<style>:host{display:contents}#image{pointer-events:none;w
3
3
  import { getFlagUrl } from './utils';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
- defineCustomElement('sinch-flag', class extends NectaryElement {
6
+ export class Flag extends NectaryElement {
7
7
  #$img;
8
8
  constructor() {
9
9
  super();
@@ -43,4 +43,5 @@ defineCustomElement('sinch-flag', class extends NectaryElement {
43
43
  }
44
44
  this.#$img.src = getFlagUrl(this, this.code);
45
45
  }
46
- });
46
+ }
47
+ defineCustomElement('sinch-flag', Flag);
package/grid/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchGrid } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class Grid extends NectaryElement {
5
+ constructor();
6
+ }
3
7
  declare global {
4
8
  interface NectaryComponentMap {
5
9
  'sinch-grid': TSinchGrid;
package/grid/index.js CHANGED
@@ -2,10 +2,11 @@ import { defineCustomElement, NectaryElement } from '../utils';
2
2
  const templateHTML = '<style>:host{display:grid;grid-template-columns:repeat(var(--sinch-comp-grid-columns-xl),minmax(0,1fr));grid-column-gap:var(--sinch-comp-grid-gutter-xl);grid-row-gap:var(--sinch-comp-grid-gutter-xl);padding:var(--sinch-comp-grid-margin-xl)}@media only screen and (max-width:1439px){:host{grid-template-columns:repeat(var(--sinch-comp-grid-columns-l),minmax(0,1fr));grid-column-gap:var(--sinch-comp-grid-gutter-l);grid-row-gap:var(--sinch-comp-grid-gutter-l);padding:var(--sinch-comp-grid-margin-l)}}@media only screen and (max-width:1023px){:host{grid-template-columns:repeat(var(--sinch-comp-grid-columns-m),minmax(0,1fr));grid-column-gap:var(--sinch-comp-grid-gutter-m);grid-row-gap:var(--sinch-comp-grid-gutter-m);padding:var(--sinch-comp-grid-margin-m)}}@media only screen and (max-width:767px){:host{grid-template-columns:repeat(var(--sinch-comp-grid-columns-s),minmax(0,1fr));grid-column-gap:var(--sinch-comp-grid-gutter-s);grid-row-gap:var(--sinch-comp-grid-gutter-s);padding:var(--sinch-comp-grid-margin-s)}}</style><slot name="item"></slot>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-grid', class extends NectaryElement {
5
+ export class Grid extends NectaryElement {
6
6
  constructor() {
7
7
  super();
8
8
  const shadowRoot = this.attachShadow();
9
9
  shadowRoot.appendChild(template.content.cloneNode(true));
10
10
  }
11
- });
11
+ }
12
+ defineCustomElement('sinch-grid', Grid);
@@ -1,5 +1,17 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchGridItem } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class GridItem extends NectaryElement {
5
+ constructor();
6
+ get s(): number | null;
7
+ set s(value: number | null);
8
+ get m(): number | null;
9
+ set m(value: number | null);
10
+ get l(): number | null;
11
+ set l(value: number | null);
12
+ get xl(): number | null;
13
+ set xl(value: number | null);
14
+ }
3
15
  declare global {
4
16
  interface NectaryComponentMap {
5
17
  'sinch-grid-item': TSinchGridItem;
@@ -2,7 +2,7 @@ import { defineCustomElement, getIntegerAttribute, NectaryElement, updateInteger
2
2
  const templateHTML = '<style>:host{display:block;grid-column:span 12}:host([xl="2"]){grid-column:span 2}:host([xl="3"]){grid-column:span 3}:host([xl="4"]){grid-column:span 4}:host([xl="5"]){grid-column:span 5}:host([xl="6"]){grid-column:span 6}:host([xl="7"]){grid-column:span 7}:host([xl="8"]){grid-column:span 8}:host([xl="9"]){grid-column:span 9}:host([xl="10"]){grid-column:span 10}:host([xl="11"]){grid-column:span 11}:host([xl="12"]){grid-column:span 12}@media only screen and (max-width:1439px){:host{grid-column:span 12}:host([l="2"]){grid-column:span 2}:host([l="3"]){grid-column:span 3}:host([l="4"]){grid-column:span 4}:host([l="5"]){grid-column:span 5}:host([l="6"]){grid-column:span 6}:host([l="7"]){grid-column:span 7}:host([l="8"]){grid-column:span 8}:host([l="9"]){grid-column:span 9}:host([l="10"]){grid-column:span 10}:host([l="11"]){grid-column:span 11}:host([l="12"]){grid-column:span 12}}@media only screen and (max-width:1023px){:host{grid-column:span 8}:host([m="2"]){grid-column:span 2}:host([m="3"]){grid-column:span 3}:host([m="4"]){grid-column:span 4}:host([m="5"]){grid-column:span 5}:host([m="6"]){grid-column:span 6}:host([m="7"]){grid-column:span 7}:host([m="8"]){grid-column:span 8}}@media only screen and (max-width:767px){:host{grid-column:span 4}:host([s="2"]){grid-column:span 2}:host([s="3"]){grid-column:span 3}:host([s="4"]){grid-column:span 4}}</style><slot name="content"></slot>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-grid-item', class extends NectaryElement {
5
+ export class GridItem extends NectaryElement {
6
6
  constructor() {
7
7
  super();
8
8
  const shadowRoot = this.attachShadow();
@@ -32,4 +32,5 @@ defineCustomElement('sinch-grid-item', class extends NectaryElement {
32
32
  set xl(value) {
33
33
  updateIntegerAttribute(this, 'xl', value);
34
34
  }
35
- });
35
+ }
36
+ defineCustomElement('sinch-grid-item', GridItem);