@nectary/components 4.10.5 → 4.11.1

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 (173) 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/types.d.ts +10 -7
  169. package/utils/adapters.d.ts +4 -4
  170. package/vertical-stepper/index.d.ts +11 -0
  171. package/vertical-stepper/index.js +3 -2
  172. package/vertical-stepper-item/index.d.ts +14 -1
  173. package/vertical-stepper-item/index.js +3 -2
@@ -1,7 +1,23 @@
1
1
  import '../icon';
2
2
  import '../text';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchProgressStepperItem } from './types';
4
5
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
6
+ export declare class ProgressStepperItem 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 value(value: string);
14
+ get value(): string;
15
+ set text(value: string);
16
+ get text(): string;
17
+ set invalid(isInvalid: boolean);
18
+ get invalid(): boolean;
19
+ get focusable(): boolean;
20
+ }
5
21
  declare global {
6
22
  interface NectaryComponentMap {
7
23
  'sinch-progress-stepper-item': TSinchProgressStepperItem;
@@ -5,7 +5,7 @@ const templateHTML = '<style>:host{display:block;outline:0}#button{position:rela
5
5
  import { ATTR_PROGRESS_STEPPER_ITEM_ACTIVE_DESCENDANT, ATTR_PROGRESS_STEPPER_ITEM_CHECKED, ATTR_PROGRESS_STEPPER_ITEM_STATUS, isProgressStepperItemActive, isProgressStepperItemActiveDescendant } from './utils';
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-progress-stepper-item', class extends NectaryElement {
8
+ export class ProgressStepperItem extends NectaryElement {
9
9
  #$text;
10
10
  constructor() {
11
11
  super();
@@ -80,4 +80,5 @@ defineCustomElement('sinch-progress-stepper-item', class extends NectaryElement
80
80
  #updateTabIndex() {
81
81
  this.tabIndex = isProgressStepperItemActiveDescendant(this) && isProgressStepperItemActive(this) ? 0 : -1;
82
82
  }
83
- });
83
+ }
84
+ defineCustomElement('sinch-progress-stepper-item', ProgressStepperItem);
package/radio/index.d.ts CHANGED
@@ -1,5 +1,24 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchRadio } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class Radio extends NectaryElement {
5
+ #private;
6
+ static formAssociated: boolean;
7
+ constructor();
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ formAssociatedCallback(): void;
11
+ formResetCallback(): void;
12
+ formStateRestoreCallback(state: string | FormData | null): void;
13
+ static get observedAttributes(): string[];
14
+ set name(value: string);
15
+ get name(): string;
16
+ set value(value: string);
17
+ get value(): string;
18
+ set invalid(isInvalid: boolean);
19
+ get invalid(): boolean;
20
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
21
+ }
3
22
  declare global {
4
23
  interface NectaryComponentMap {
5
24
  'sinch-radio': TSinchRadio;
package/radio/index.js CHANGED
@@ -3,7 +3,7 @@ import { setFormValue } from '../utils/form';
3
3
  const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:var(--sinch-comp-radio-direction,column);gap:var(--sinch-comp-radio-gap,8px);box-sizing:border-box;width:100%}</style><div id="wrapper"><slot></slot></div>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
- defineCustomElement('sinch-radio', class extends NectaryElement {
6
+ export class Radio extends NectaryElement {
7
7
  #$slot;
8
8
  #controller = null;
9
9
  #internals;
@@ -196,4 +196,5 @@ defineCustomElement('sinch-radio', class extends NectaryElement {
196
196
  #onChangeReactHandler = e => {
197
197
  getReactEventHandler(this, 'on-change')?.(e);
198
198
  };
199
- });
199
+ }
200
+ defineCustomElement('sinch-radio', Radio);
@@ -1,5 +1,23 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchRadioOption } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class RadioOption 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 checked(isChecked: boolean);
12
+ get checked(): boolean;
13
+ set value(value: string);
14
+ get value(): string;
15
+ set disabled(isDisabled: boolean);
16
+ get disabled(): boolean;
17
+ set text(value: string);
18
+ get text(): string;
19
+ get focusable(): boolean;
20
+ }
3
21
  declare global {
4
22
  interface NectaryComponentMap {
5
23
  'sinch-radio-option': TSinchRadioOption;
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrEqual, is
2
2
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row;box-sizing:border-box;width:100%;min-height:24px;--sinch-local-color-background:var(--sinch-comp-radio-color-default-background-initial);--sinch-local-color-background-hover:var(--sinch-comp-radio-color-default-background-hover);--sinch-local-color-background-active:var(--sinch-comp-radio-color-default-background-active);--sinch-local-color-border:var(--sinch-comp-radio-color-default-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-radio-color-default-border-hover);--sinch-local-color-border-active:var(--sinch-comp-radio-color-default-border-active);--sinch-local-color-knob:var(--sinch-comp-radio-color-checked-knob-initial);--sinch-local-color-knob-hover:var(--sinch-comp-radio-color-checked-knob-hover);--sinch-local-color-knob-active:var(--sinch-comp-radio-color-checked-knob-active);--sinch-local-color-text:var(--sinch-comp-radio-color-default-label-initial)}:host([data-invalid])>#wrapper{--sinch-local-color-border:var(--sinch-comp-radio-color-invalid-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-radio-color-invalid-border-hover);--sinch-local-color-border-active:var(--sinch-comp-radio-color-invalid-border-active);--sinch-local-color-text:var(--sinch-comp-radio-color-invalid-label-initial)}:host([checked])>#wrapper{--sinch-local-color-border:var(--sinch-comp-radio-color-checked-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-radio-color-checked-border-hover);--sinch-local-color-border-active:var(--sinch-comp-radio-color-checked-border-active)}:host([disabled])>#wrapper{--sinch-local-color-background:var(--sinch-comp-radio-color-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-radio-color-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-radio-color-disabled-label-initial)}:host([disabled][checked])>#wrapper{--sinch-local-color-border:var(--sinch-comp-radio-color-checked-disabled-border-initial);--sinch-local-color-knob:var(--sinch-comp-radio-color-checked-disabled-knob-initial);--sinch-local-color-text:var(--sinch-comp-radio-color-checked-disabled-label-initial)}#input{all:initial;display:block;width:18px;height:18px;cursor:pointer}:host([disabled]) #input{cursor:initial}#input-wrapper{position:relative;width:18px;height:18px;align-self:flex-start;margin-top:3px}#input::before{content:"";position:absolute;inset:-3px;border:2px solid var(--sinch-comp-radio-color-default-outline-focus);border-radius:50%;transition:opacity .1s linear;opacity:0;box-sizing:border-box;pointer-events:none}:host(:focus-visible) #input::before{opacity:1}#input::after{content:"";position:absolute;width:18px;height:18px;inset:0;margin:auto;background-color:var(--sinch-local-color-background);border:1px solid var(--sinch-local-color-border);border-radius:50%;box-sizing:border-box;pointer-events:none}:host(:hover:not([disabled])) #input::after{background-color:var(--sinch-local-color-background-hover);border-color:var(--sinch-local-color-border-hover)}:host(:active:not([disabled])) #input::after{background-color:var(--sinch-local-color-background-active);border-color:var(--sinch-local-color-border-active)}#knob{position:absolute;width:10px;height:10px;inset:0;margin:auto;border-radius:50%;transition:opacity .1s linear;opacity:0;background-color:var(--sinch-local-color-knob);pointer-events:none}:host([checked]) #knob{opacity:1}:host(:hover:not([disabled])) #knob{background-color:var(--sinch-local-color-knob-hover)}:host(:active:not([disabled])) #knob{background-color:var(--sinch-local-color-knob-active)}@media (prefers-reduced-motion){#input::after,#input::before,#knob{transition:none}}#label{flex:1;align-self:center;padding-left:8px;font:var(--sinch-comp-radio-font-label);color:var(--sinch-local-color-text);cursor:pointer}#label:empty{display:none}:host([disabled]) #label{cursor:initial}</style><div id="wrapper"><div id="input-wrapper"><div id="input"></div><div id="knob"></div></div><span id="label"></span></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-radio-option', class extends NectaryElement {
5
+ export class RadioOption extends NectaryElement {
6
6
  #$label;
7
7
  constructor() {
8
8
  super();
@@ -76,4 +76,5 @@ defineCustomElement('sinch-radio-option', class extends NectaryElement {
76
76
  get focusable() {
77
77
  return true;
78
78
  }
79
- });
79
+ }
80
+ defineCustomElement('sinch-radio-option', RadioOption);
@@ -1,8 +1,22 @@
1
1
  import '../emoji';
2
2
  import '../code-tag';
3
3
  import '../link';
4
+ import { NectaryElement } from '../utils';
4
5
  import type { TSinchRichText } from './types';
6
+ import type { TSinchTextType } from '../text/types';
5
7
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
8
+ export declare class RichText extends NectaryElement {
9
+ #private;
10
+ constructor();
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ static get observedAttributes(): string[];
14
+ attributeChangedCallback(name: string, _oldVal: string | null, _newVal: string | null): void;
15
+ get size(): TSinchTextType;
16
+ set size(value: TSinchTextType);
17
+ get text(): string;
18
+ set text(value: string);
19
+ }
6
20
  declare global {
7
21
  interface NectaryComponentMap {
8
22
  'sinch-rich-text': TSinchRichText;
@@ -7,7 +7,7 @@ const templateHTML = '<style>:host{display:block;--sinch-comp-rich-text-font:var
7
7
  import { createParseVisitor, sizeValues } from './utils';
8
8
  const template = document.createElement('template');
9
9
  template.innerHTML = templateHTML;
10
- defineCustomElement('sinch-rich-text', class extends NectaryElement {
10
+ export class RichText extends NectaryElement {
11
11
  #wrapper;
12
12
  #parseVisitor;
13
13
  #controller = null;
@@ -98,4 +98,5 @@ defineCustomElement('sinch-rich-text', class extends NectaryElement {
98
98
  #onClickReactHandler = e => {
99
99
  getReactEventHandler(this, 'on-element-click')?.(e);
100
100
  };
101
- });
101
+ }
102
+ defineCustomElement('sinch-rich-text', RichText);
@@ -1,5 +1,33 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchRichTextarea } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class RichTextarea 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 value(value: string);
12
+ get value(): string;
13
+ set placeholder(value: string | null);
14
+ get placeholder(): string | null;
15
+ set disabled(isDisabled: boolean);
16
+ get disabled(): boolean;
17
+ set rows(value: HTMLTextAreaElement['rows']);
18
+ get rows(): HTMLTextAreaElement['rows'];
19
+ get focusable(): boolean;
20
+ focus(): void;
21
+ blur(): void;
22
+ insertText(value: string): void;
23
+ insertLink(text: string, href: string): void;
24
+ formatItalic(): void;
25
+ formatBold(): void;
26
+ formatStrikethrough(): void;
27
+ formatCodeTag(): void;
28
+ formatOrderedList(): void;
29
+ formatUnorderedList(): void;
30
+ }
3
31
  declare global {
4
32
  interface NectaryComponentMap {
5
33
  'sinch-rich-textarea': TSinchRichTextarea;
@@ -5,7 +5,7 @@ import { createParseVisitor, deleteContentBackward, formatIndent, formatInline,
5
5
  const template = document.createElement('template');
6
6
  template.innerHTML = templateHTML;
7
7
  const SUPPORTS_SHADOW_SELECTION = typeof window.ShadowRoot.prototype.getSelection === 'function';
8
- defineCustomElement('sinch-rich-textarea', class extends NectaryElement {
8
+ export class RichTextarea extends NectaryElement {
9
9
  #$input;
10
10
  #$placeholder;
11
11
  #controller = null;
@@ -461,4 +461,5 @@ defineCustomElement('sinch-rich-textarea', class extends NectaryElement {
461
461
  #onSelectionReactHandler = e => {
462
462
  getReactEventHandler(this, 'on-selection')?.(e);
463
463
  };
464
- });
464
+ }
465
+ defineCustomElement('sinch-rich-textarea', RichTextarea);
@@ -1,6 +1,23 @@
1
1
  import '../title';
2
+ import { NectaryElement } from '../utils';
2
3
  import type { TSinchSegment } from './types';
3
- import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
5
+ import type { TSinchSize } from '../utils/size';
6
+ export declare class Segment 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 caption(caption: string);
14
+ get caption(): string;
15
+ set collapsed(isChecked: boolean);
16
+ get collapsed(): boolean;
17
+ get size(): TSinchSize;
18
+ set size(value: TSinchSize);
19
+ get collapseButtonRect(): TRect | null;
20
+ }
4
21
  declare global {
5
22
  interface NectaryComponentMap {
6
23
  'sinch-segment': TSinchSegment;
package/segment/index.js CHANGED
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-dire
6
6
  import { getTitleTypeFromSize } from './utils';
7
7
  const template = document.createElement('template');
8
8
  template.innerHTML = templateHTML;
9
- defineCustomElement('sinch-segment', class extends NectaryElement {
9
+ export class Segment extends NectaryElement {
10
10
  #$caption;
11
11
  #$previewSlot;
12
12
  #$previewWrapper;
@@ -106,4 +106,5 @@ defineCustomElement('sinch-segment', class extends NectaryElement {
106
106
  #onActionSlotChange = () => {
107
107
  setClass(this.#$actionWrapper, 'empty', this.#$actionSlot.assignedElements().length === 0);
108
108
  };
109
- });
109
+ }
110
+ defineCustomElement('sinch-segment', Segment);
@@ -1,6 +1,20 @@
1
1
  import '../icon';
2
+ import { NectaryElement } from '../utils';
2
3
  import type { TSinchSegmentExpand } from './types';
3
4
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
5
+ export declare class SegmentCollapse extends NectaryElement {
6
+ #private;
7
+ constructor();
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ static get observedAttributes(): string[];
11
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
12
+ set value(isChecked: boolean);
13
+ get value(): boolean;
14
+ get focusable(): boolean;
15
+ focus(): void;
16
+ blur(): void;
17
+ }
4
18
  declare global {
5
19
  interface NectaryComponentMap {
6
20
  'sinch-segment-collapse': TSinchSegmentExpand;
@@ -3,7 +3,7 @@ import { defineCustomElement, getBooleanAttribute, getReactEventHandler, isAttrT
3
3
  const templateHTML = '<style>:host{display:block;--sinch-global-size-icon:32px}#icon-dropdown{display:block;will-change:transform;transform:rotate(180deg)}:host([value]:not([value=false])) #icon-dropdown{transform:rotate(0)}</style><sinch-button id="button" size="s"><sinch-icon icons-version="2" name="fa-chevron-down" id="icon-dropdown" slot="icon"></sinch-icon></sinch-button>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
- defineCustomElement('sinch-segment-collapse', class extends NectaryElement {
6
+ export class SegmentCollapse extends NectaryElement {
7
7
  #$button;
8
8
  constructor() {
9
9
  super();
@@ -56,4 +56,5 @@ defineCustomElement('sinch-segment-collapse', class extends NectaryElement {
56
56
  #onChangeReactHandler = e => {
57
57
  getReactEventHandler(this, 'on-change')?.(e);
58
58
  };
59
- });
59
+ }
60
+ defineCustomElement('sinch-segment-collapse', SegmentCollapse);
@@ -1,5 +1,16 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSegmentedControl } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class SegmentedControl 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 value(value: string);
12
+ get value(): string;
13
+ }
3
14
  declare global {
4
15
  interface NectaryComponentMap {
5
16
  'sinch-segmented-control': TSinchSegmentedControl;
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHa
2
2
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row;width:100%;box-sizing:border-box;position:relative;z-index:0}</style><div id="wrapper"><slot></slot></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-segmented-control', class extends NectaryElement {
5
+ export class SegmentedControl extends NectaryElement {
6
6
  #$slot;
7
7
  #controller = null;
8
8
  constructor() {
@@ -82,4 +82,5 @@ defineCustomElement('sinch-segmented-control', class extends NectaryElement {
82
82
  #onChangeReactHandler = e => {
83
83
  getReactEventHandler(this, 'on-change')?.(e);
84
84
  };
85
- });
85
+ }
86
+ defineCustomElement('sinch-segmented-control', SegmentedControl);
@@ -1,5 +1,21 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSegmentedControlOption } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class SegmentedControlOption 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 value(value: string);
12
+ get value(): string;
13
+ set disabled(isDisabled: boolean);
14
+ get disabled(): boolean;
15
+ set text(value: string);
16
+ get text(): string;
17
+ get focusable(): boolean;
18
+ }
3
19
  declare global {
4
20
  interface NectaryComponentMap {
5
21
  'sinch-segmented-control-option': TSinchSegmentedControlOption;
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHa
2
2
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;height:32px;padding:0 16px;box-sizing:border-box;color:var(--sinch-local-color-text);background-color:var(--sinch-local-color-background);cursor:pointer;--sinch-local-color-text:var(--sinch-comp-segmented-control-color-default-text-initial);--sinch-local-shape-radius:var(--sinch-comp-segmented-control-shape-radius);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-default-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-default-background-initial);--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-default-icon-initial);--sinch-global-size-icon:var(--sinch-comp-segmented-control-size-icon)}:host(:hover){--sinch-local-color-background:var(--sinch-comp-segmented-control-color-default-background-hover)}:host(:first-child) #wrapper{border-top-left-radius:var(--sinch-local-shape-radius);border-bottom-left-radius:var(--sinch-local-shape-radius)}:host(:last-child) #wrapper{border-top-right-radius:var(--sinch-local-shape-radius);border-bottom-right-radius:var(--sinch-local-shape-radius)}:host([data-checked]) #wrapper{--sinch-local-color-text:var(--sinch-comp-segmented-control-color-checked-text-initial);--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-checked-icon-initial);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-checked-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-checked-background-initial)}:host([disabled]) #wrapper{--sinch-local-color-text:var(--sinch-comp-segmented-control-color-disabled-text-initial);--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-disabled-icon-initial);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-disabled-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-disabled-background-initial)}#border{position:absolute;inset:0;border:1px solid var(--sinch-local-color-border);pointer-events:none;box-sizing:border-box}:host(:first-child) #border{border-top-left-radius:var(--sinch-local-shape-radius);border-bottom-left-radius:var(--sinch-local-shape-radius)}:host(:last-child) #border{border-top-right-radius:var(--sinch-local-shape-radius);border-bottom-right-radius:var(--sinch-local-shape-radius)}:host(:not(:first-child)) #border{border-left-width:0}:host([data-checked]) #border{border-width:2px}:host([data-checked]:not(:first-child)) #border{left:-1px}#outline{display:none;position:absolute;inset:-3px;border:2px solid var(--sinch-comp-segmented-control-color-default-outline-focus);pointer-events:none;box-sizing:border-box;z-index:1}:host(:focus-visible) #outline{display:block}:host(:first-child) #outline{border-top-left-radius:calc(var(--sinch-local-shape-radius) + 3px);border-bottom-left-radius:calc(var(--sinch-local-shape-radius) + 3px)}:host(:last-child) #outline{border-top-right-radius:calc(var(--sinch-local-shape-radius) + 3px);border-bottom-right-radius:calc(var(--sinch-local-shape-radius) + 3px)}:host(:not(:first-child)) #outline{left:-4px}#content{font:var(--sinch-comp-segmented-control-font-label);flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none}::slotted(*){display:block;pointer-events:none}</style><div id="wrapper"><slot name="icon"></slot><span id="content"></span><div id="border"></div><div id="outline"></div></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-segmented-control-option', class extends NectaryElement {
5
+ export class SegmentedControlOption extends NectaryElement {
6
6
  #$label;
7
7
  #controller = null;
8
8
  constructor() {
@@ -92,4 +92,5 @@ defineCustomElement('sinch-segmented-control-option', class extends NectaryEleme
92
92
  #onBlurReactHandler = () => {
93
93
  getReactEventHandler(this, 'on-blur')?.();
94
94
  };
95
- });
95
+ }
96
+ defineCustomElement('sinch-segmented-control-option', SegmentedControlOption);
@@ -1,5 +1,18 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSegmentedIconControl } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class SegmentedIconControl 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 value(value: string);
12
+ get value(): string;
13
+ set multiple(isMultiple: boolean);
14
+ get multiple(): boolean;
15
+ }
3
16
  declare global {
4
17
  interface NectaryComponentMap {
5
18
  'sinch-segmented-icon-control': TSinchSegmentedIconControl;
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, unpackCsv, getF
2
2
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row;width:100%;box-sizing:border-box;position:relative;z-index:0}</style><div id="wrapper"><slot></slot></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-segmented-icon-control', class extends NectaryElement {
5
+ export class SegmentedIconControl extends NectaryElement {
6
6
  #$slot;
7
7
  #controller = null;
8
8
  constructor() {
@@ -98,4 +98,5 @@ defineCustomElement('sinch-segmented-icon-control', class extends NectaryElement
98
98
  #onChangeReactHandler = e => {
99
99
  getReactEventHandler(this, 'on-change')?.(e);
100
100
  };
101
- });
101
+ }
102
+ defineCustomElement('sinch-segmented-icon-control', SegmentedIconControl);
@@ -1,5 +1,19 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSegmentedIconControlOption } from './types';
2
3
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
4
+ export declare class SegmentedIconControlOption 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 value(value: string);
12
+ get value(): string;
13
+ set disabled(isDisabled: boolean);
14
+ get disabled(): boolean;
15
+ get focusable(): boolean;
16
+ }
3
17
  declare global {
4
18
  interface NectaryComponentMap {
5
19
  'sinch-segmented-icon-control-option': TSinchSegmentedIconControlOption;
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHa
2
2
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;width:56px;height:32px;padding:3px 16px;box-sizing:border-box;background-color:var(--sinch-local-color-background);cursor:pointer;--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-default-icon-initial);--sinch-global-size-icon:var(--sinch-comp-segmented-control-size-icon);--sinch-local-shape-radius:var(--sinch-comp-segmented-control-shape-radius);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-default-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-default-background-initial)}:host(:hover){--sinch-local-color-background:var(--sinch-comp-segmented-control-color-default-background-hover)}:host(:first-child) #wrapper{border-top-left-radius:var(--sinch-local-shape-radius);border-bottom-left-radius:var(--sinch-local-shape-radius)}:host(:last-child) #wrapper{border-top-right-radius:var(--sinch-local-shape-radius);border-bottom-right-radius:var(--sinch-local-shape-radius)}:host([data-checked]) #wrapper{--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-checked-icon-initial);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-checked-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-checked-background-initial)}:host([disabled]) #wrapper{--sinch-global-color-icon:var(--sinch-comp-segmented-control-color-disabled-icon-initial);--sinch-local-color-border:var(--sinch-comp-segmented-control-color-disabled-border-initial);--sinch-local-color-background:var(--sinch-comp-segmented-control-color-disabled-background-initial);cursor:initial}#border{position:absolute;inset:0;border:1px solid var(--sinch-local-color-border);pointer-events:none;box-sizing:border-box}:host(:first-child) #border{border-top-left-radius:var(--sinch-local-shape-radius);border-bottom-left-radius:var(--sinch-local-shape-radius)}:host(:last-child) #border{border-top-right-radius:var(--sinch-local-shape-radius);border-bottom-right-radius:var(--sinch-local-shape-radius)}:host(:not(:first-child)) #border{border-left-width:0}:host([data-checked]) #border{border-width:2px}:host([data-checked]:not(:first-child)) #border{left:-1px}#outline{display:none;position:absolute;inset:-3px;border:2px solid var(--sinch-comp-segmented-control-color-default-outline-focus);pointer-events:none;box-sizing:border-box;z-index:1}:host(:focus-visible) #outline{display:block}:host(:first-child) #outline{border-top-left-radius:calc(var(--sinch-local-shape-radius) + 3px);border-bottom-left-radius:calc(var(--sinch-local-shape-radius) + 3px)}:host(:last-child) #outline{border-top-right-radius:calc(var(--sinch-local-shape-radius) + 3px);border-bottom-right-radius:calc(var(--sinch-local-shape-radius) + 3px)}:host(:not(:first-child)) #outline{left:-4px}::slotted(*){display:block;pointer-events:none}</style><div id="wrapper"><slot name="icon"></slot><div id="border"></div><div id="outline"></div></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-segmented-icon-control-option', class extends NectaryElement {
5
+ export class SegmentedIconControlOption extends NectaryElement {
6
6
  #controller = null;
7
7
  constructor() {
8
8
  super();
@@ -79,4 +79,5 @@ defineCustomElement('sinch-segmented-icon-control-option', class extends Nectary
79
79
  #onBlurReactHandler = () => {
80
80
  getReactEventHandler(this, 'on-blur')?.();
81
81
  };
82
- });
82
+ }
83
+ defineCustomElement('sinch-segmented-icon-control-option', SegmentedIconControlOption);
@@ -1,7 +1,28 @@
1
1
  import '../text';
2
2
  import '../icon';
3
+ import { NectaryElement } from '../utils';
3
4
  import type { TSinchSelectButtonProps, TSinchSelectButtonStyle, TSinchSelectButtonEvents } from './types';
4
5
  import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
6
+ import type { TSinchSize } from '../utils/size';
7
+ export declare class SelectButton 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 text(value: string);
15
+ get text(): string;
16
+ set placeholder(value: string | null);
17
+ get placeholder(): string | null;
18
+ set invalid(isInvalid: boolean);
19
+ get invalid(): boolean;
20
+ set disabled(isDisabled: boolean);
21
+ get disabled(): boolean;
22
+ set size(size: TSinchSize);
23
+ get size(): TSinchSize;
24
+ get focusable(): boolean;
25
+ }
5
26
  declare global {
6
27
  interface NectaryComponentMap {
7
28
  'sinch-select-button': {
@@ -5,7 +5,7 @@ import { DEFAULT_SIZE, sizeValues } from '../utils/size';
5
5
  const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;cursor:pointer}:host([disabled]){cursor:initial}#wrapper{position:relative;display:flex;flex-direction:row;align-items:center;gap:8px;box-sizing:border-box;width:100%;height:var(--sinch-local-size);padding:0 8px 0 12px;background-color:var(--sinch-comp-select-button-color-default-background-initial);border-radius:var(--sinch-local-shape-radius);--sinch-local-size:var(--sinch-comp-select-button-size-container-m);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-m);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-m);--sinch-global-color-icon:var(--sinch-comp-select-button-color-default-icon-initial)}:host([data-size="l"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-l);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-l);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-l)}:host([data-size="m"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-m);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-m);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-m)}:host([data-size="s"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-s);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-s);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-s)}:host([data-size="l"]) #wrapper{padding:0 12px}:host([data-size="m"]) #wrapper{padding:0 8px 0 12px}:host([data-size="s"]) #wrapper{padding:0 4px 0 12px}:host([disabled]) #wrapper{--sinch-global-color-icon:var(--sinch-comp-select-button-color-disabled-icon-initial)}#text{flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-select-button-font-input);--sinch-global-color-text:var(--sinch-comp-select-button-color-default-text-initial)}#text:empty{display:none}#placeholder{display:none;flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-select-button-font-placeholder);--sinch-global-color-text:var(--sinch-comp-select-button-color-default-placeholder-initial)}#text:empty+#placeholder{display:block}#border{position:absolute;border:1px solid var(--sinch-comp-select-button-color-default-border-initial);border-radius:var(--sinch-local-shape-radius);inset:0;pointer-events:none}:host(:focus-visible) #border{border-color:var(--sinch-comp-select-button-color-default-border-focus);border-width:2px}:host([invalid]) #border{border-color:var(--sinch-comp-select-button-color-invalid-border-initial)}:host([disabled]) #border{border-color:var(--sinch-comp-select-button-color-disabled-border-initial)}:host([disabled]) #text{--sinch-global-color-text:var(--sinch-comp-select-button-color-disabled-text-initial)}:host([disabled]) #placeholder{--sinch-global-color-text:var(--sinch-comp-select-button-color-disabled-placeholder-initial)}#left{display:flex;flex-direction:row;align-self:stretch;align-items:center;gap:4px;margin-left:-4px}#left.empty{display:none}#dropdown-icon{margin-left:-4px}</style><div id="wrapper" inert><div id="border"></div><div id="left"><slot name="left"></slot></div><slot name="icon"></slot><sinch-text id="text" type="m" ellipsis></sinch-text><sinch-text id="placeholder" type="m" ellipsis></sinch-text><sinch-icon icons-version="2" name="fa-chevron-down" id="dropdown-icon"></sinch-icon></div>';
6
6
  const template = document.createElement('template');
7
7
  template.innerHTML = templateHTML;
8
- defineCustomElement('sinch-select-button', class extends NectaryElement {
8
+ export class SelectButton extends NectaryElement {
9
9
  #$text;
10
10
  #$placeholder;
11
11
  #$leftSlot;
@@ -199,4 +199,5 @@ defineCustomElement('sinch-select-button', class extends NectaryElement {
199
199
  #onBlurReactHandler = () => {
200
200
  getReactEventHandler(this, 'on-blur')?.();
201
201
  };
202
- });
202
+ }
203
+ defineCustomElement('sinch-select-button', SelectButton);
@@ -1,8 +1,38 @@
1
1
  import '../input';
2
2
  import '../icon';
3
3
  import '../text';
4
+ import { NectaryElement } from '../utils';
4
5
  import type { TSinchSelectMenu } from './types';
5
6
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
7
+ export declare class SelectMenu extends NectaryElement {
8
+ #private;
9
+ static formAssociated: boolean;
10
+ constructor();
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ formAssociatedCallback(): void;
14
+ formResetCallback(): void;
15
+ formStateRestoreCallback(state: string | FormData | null): void;
16
+ static get observedAttributes(): string[];
17
+ attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
18
+ set name(value: string);
19
+ get name(): string;
20
+ set value(value: string);
21
+ get value(): string;
22
+ set rows(value: number | null);
23
+ get rows(): number | null;
24
+ set multiple(isMultiple: boolean);
25
+ get multiple(): boolean;
26
+ set searchable(isSearchable: boolean | null);
27
+ get searchable(): boolean | null;
28
+ set 'search-autocomplete'(autocomplete: string);
29
+ get 'search-autocomplete'(): string;
30
+ set 'search-placeholder'(placeholder: string);
31
+ get 'search-placeholder'(): string;
32
+ set 'search-value'(value: string);
33
+ get 'search-value'(): string;
34
+ get focusable(): boolean;
35
+ }
6
36
  declare global {
7
37
  interface NectaryComponentMap {
8
38
  'sinch-select-menu': TSinchSelectMenu;
@@ -9,7 +9,7 @@ const ITEM_HEIGHT = 40;
9
9
  const NUM_ITEMS_SEARCH = 7;
10
10
  const template = document.createElement('template');
11
11
  template.innerHTML = templateHTML;
12
- defineCustomElement('sinch-select-menu', class extends NectaryElement {
12
+ export class SelectMenu extends NectaryElement {
13
13
  #$optionSlot;
14
14
  #$listbox;
15
15
  #$search;
@@ -415,4 +415,5 @@ defineCustomElement('sinch-select-menu', class extends NectaryElement {
415
415
  #onSearchChangeReactHandler = e => {
416
416
  getReactEventHandler(this, 'on-search-change')?.(e);
417
417
  };
418
- });
418
+ }
419
+ defineCustomElement('sinch-select-menu', SelectMenu);
@@ -1,5 +1,14 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSkeleton } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class Skeleton 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
+ }
3
12
  declare global {
4
13
  interface NectaryComponentMap {
5
14
  'sinch-skeleton': TSinchSkeleton;
package/skeleton/index.js CHANGED
@@ -4,7 +4,7 @@ const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
5
  const ANIMATION_DURATION = 2000;
6
6
  const BORDER_WIDTH = 1;
7
- defineCustomElement('sinch-skeleton', class extends NectaryElement {
7
+ export class Skeleton extends NectaryElement {
8
8
  #animation = null;
9
9
  #shimmer;
10
10
  #wrapper;
@@ -105,4 +105,5 @@ defineCustomElement('sinch-skeleton', class extends NectaryElement {
105
105
  rect.setAttribute('rx', radius.toString());
106
106
  this.#clip.appendChild(rect);
107
107
  }
108
- });
108
+ }
109
+ defineCustomElement('sinch-skeleton', Skeleton);
@@ -1,5 +1,9 @@
1
+ import { NectaryElement } from '../utils';
1
2
  import type { TSinchSkeletonItem } from './types';
2
3
  import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
+ export declare class SkeletonItem extends NectaryElement {
5
+ constructor();
6
+ }
3
7
  declare global {
4
8
  interface NectaryComponentMap {
5
9
  'sinch-skeleton-item': TSinchSkeletonItem;
@@ -2,10 +2,11 @@ import { defineCustomElement, NectaryElement } from '../utils';
2
2
  const templateHTML = '<style>:host{display:block;height:var(--sinch-sys-size-m);--sinch-local-shape-radius:var(--sinch-sys-shape-radius-m)}:host([size=xs]){height:var(--sinch-sys-size-xs);--sinch-local-shape-radius:var(--sinch-sys-shape-radius-xs)}:host([size="s"]){height:var(--sinch-sys-size-s);--sinch-local-shape-radius:var(--sinch-sys-shape-radius-s)}:host([size="m"]){height:var(--sinch-sys-size-m);--sinch-local-shape-radius:var(--sinch-sys-shape-radius-m)}:host([size="l"]){height:var(--sinch-sys-size-l);--sinch-local-shape-radius:var(--sinch-sys-shape-radius-l)}#content{height:100%;background-color:var(--sinch-sys-color-border-subtle);border-radius:var(--sinch-local-shape-radius)}</style><div id="content"></div>';
3
3
  const template = document.createElement('template');
4
4
  template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-skeleton-item', class extends NectaryElement {
5
+ export class SkeletonItem 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-skeleton-item', SkeletonItem);