@nectary/components 4.8.2 → 4.9.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 (177) hide show
  1. package/accordion/index.d.ts +8 -4
  2. package/accordion/types.d.ts +11 -16
  3. package/accordion-item/index.d.ts +8 -4
  4. package/accordion-item/types.d.ts +30 -47
  5. package/action-menu/index.d.ts +8 -4
  6. package/action-menu/types.d.ts +7 -8
  7. package/action-menu-option/index.d.ts +8 -4
  8. package/action-menu-option/types.d.ts +28 -32
  9. package/action-menu-option/utils.d.ts +1 -2
  10. package/alert/index.d.ts +8 -4
  11. package/alert/types.d.ts +22 -27
  12. package/avatar/index.d.ts +8 -4
  13. package/avatar/types.d.ts +25 -42
  14. package/badge/index.d.ts +8 -4
  15. package/badge/types.d.ts +18 -32
  16. package/button/index.d.ts +8 -4
  17. package/button/types.d.ts +140 -160
  18. package/button-group/index.d.ts +8 -4
  19. package/button-group/types.d.ts +10 -9
  20. package/button-group-item/index.d.ts +8 -4
  21. package/button-group-item/types.d.ts +42 -42
  22. package/card/index.d.ts +8 -4
  23. package/card/types.d.ts +8 -19
  24. package/card-container/index.d.ts +7 -4
  25. package/card-container/types.d.ts +2 -2
  26. package/card-v2/index.d.ts +8 -4
  27. package/card-v2/types.d.ts +41 -53
  28. package/card-v2-title/index.d.ts +8 -4
  29. package/card-v2-title/types.d.ts +21 -33
  30. package/checkbox/index.d.ts +8 -4
  31. package/checkbox/types.d.ts +45 -65
  32. package/chip/index.d.ts +8 -4
  33. package/chip/types.d.ts +30 -44
  34. package/code-tag/index.d.ts +8 -4
  35. package/code-tag/types.d.ts +15 -16
  36. package/color-menu/index.d.ts +8 -4
  37. package/color-menu/types.d.ts +15 -22
  38. package/color-menu-option/index.d.ts +8 -4
  39. package/color-menu-option/types.d.ts +14 -15
  40. package/color-swatch/index.d.ts +8 -4
  41. package/color-swatch/types.d.ts +15 -16
  42. package/date-picker/index.d.ts +8 -4
  43. package/date-picker/types.d.ts +50 -79
  44. package/dialog/index.d.ts +8 -4
  45. package/dialog/types.d.ts +30 -34
  46. package/emoji/index.d.ts +8 -4
  47. package/emoji/types.d.ts +11 -12
  48. package/emoji-picker/index.d.ts +8 -4
  49. package/emoji-picker/types.d.ts +25 -18
  50. package/field/index.d.ts +8 -4
  51. package/field/types.d.ts +21 -38
  52. package/file-drop/index.d.ts +8 -4
  53. package/file-drop/types.d.ts +33 -55
  54. package/file-picker/index.d.ts +8 -4
  55. package/file-picker/types.d.ts +12 -22
  56. package/file-status/index.d.ts +8 -4
  57. package/file-status/types.d.ts +27 -32
  58. package/flag/index.d.ts +8 -4
  59. package/flag/types.d.ts +10 -11
  60. package/grid/index.d.ts +8 -4
  61. package/grid/types.d.ts +19 -17
  62. package/grid-item/index.d.ts +8 -4
  63. package/grid-item/types.d.ts +7 -12
  64. package/help-tooltip/index.d.ts +8 -4
  65. package/help-tooltip/types.d.ts +11 -6
  66. package/horizontal-stepper/index.d.ts +8 -4
  67. package/horizontal-stepper/types.d.ts +37 -38
  68. package/horizontal-stepper-item/index.d.ts +8 -4
  69. package/horizontal-stepper-item/types.d.ts +30 -39
  70. package/icon/index.d.ts +8 -4
  71. package/icon/types.d.ts +18 -28
  72. package/inline-alert/index.d.ts +8 -4
  73. package/inline-alert/types.d.ts +30 -33
  74. package/input/index.d.ts +8 -4
  75. package/input/types.d.ts +54 -89
  76. package/link/index.d.ts +8 -4
  77. package/link/types.d.ts +31 -57
  78. package/list/index.d.ts +7 -4
  79. package/list/types.d.ts +2 -2
  80. package/list-item/index.d.ts +8 -4
  81. package/list-item/types.d.ts +10 -8
  82. package/package.json +2 -2
  83. package/pagination/index.d.ts +8 -4
  84. package/pagination/types.d.ts +31 -27
  85. package/persistent-overlay/index.d.ts +8 -4
  86. package/persistent-overlay/types.d.ts +19 -21
  87. package/pop/index.d.ts +8 -4
  88. package/pop/types.d.ts +13 -23
  89. package/popover/index.d.ts +8 -4
  90. package/popover/types.d.ts +20 -32
  91. package/progress/index.d.ts +8 -4
  92. package/progress/types.d.ts +13 -14
  93. package/progress-stepper/index.d.ts +8 -4
  94. package/progress-stepper/types.d.ts +10 -15
  95. package/progress-stepper-item/index.d.ts +8 -4
  96. package/progress-stepper-item/types.d.ts +35 -44
  97. package/radio/index.d.ts +8 -4
  98. package/radio/types.d.ts +16 -15
  99. package/radio-option/index.d.ts +8 -4
  100. package/radio-option/types.d.ts +35 -40
  101. package/rich-text/index.d.ts +8 -4
  102. package/rich-text/types.d.ts +31 -31
  103. package/rich-text/utils.js +1 -1
  104. package/rich-textarea/index.d.ts +8 -4
  105. package/rich-textarea/types.d.ts +37 -43
  106. package/segment/index.d.ts +8 -4
  107. package/segment/types.d.ts +18 -21
  108. package/segment-collapse/index.d.ts +8 -4
  109. package/segment-collapse/types.d.ts +15 -12
  110. package/segmented-control/index.d.ts +8 -4
  111. package/segmented-control/types.d.ts +11 -8
  112. package/segmented-control-option/index.d.ts +8 -4
  113. package/segmented-control-option/types.d.ts +32 -34
  114. package/segmented-icon-control/index.d.ts +8 -4
  115. package/segmented-icon-control/types.d.ts +11 -10
  116. package/segmented-icon-control-option/index.d.ts +8 -4
  117. package/segmented-icon-control-option/types.d.ts +28 -28
  118. package/select-button/index.d.ts +12 -4
  119. package/select-button/types.d.ts +38 -58
  120. package/select-menu/index.d.ts +8 -4
  121. package/select-menu/types.d.ts +18 -38
  122. package/select-menu-option/index.d.ts +8 -4
  123. package/select-menu-option/types.d.ts +27 -33
  124. package/select-menu-option/utils.d.ts +2 -2
  125. package/skeleton/index.d.ts +8 -4
  126. package/skeleton/types.d.ts +14 -13
  127. package/skeleton-item/index.d.ts +8 -4
  128. package/skeleton-item/types.d.ts +20 -19
  129. package/spinner/index.d.ts +8 -4
  130. package/spinner/types.d.ts +12 -13
  131. package/table/index.d.ts +7 -4
  132. package/table/types.d.ts +2 -2
  133. package/table-body/index.d.ts +7 -4
  134. package/table-body/types.d.ts +2 -2
  135. package/table-cell/index.d.ts +8 -4
  136. package/table-cell/types.d.ts +11 -10
  137. package/table-head/index.d.ts +7 -4
  138. package/table-head/types.d.ts +2 -2
  139. package/table-head-cell/index.d.ts +8 -4
  140. package/table-head-cell/types.d.ts +15 -18
  141. package/table-row/index.d.ts +8 -4
  142. package/table-row/types.d.ts +14 -15
  143. package/tabs/index.d.ts +8 -4
  144. package/tabs/types.d.ts +19 -16
  145. package/tabs-icon-option/index.d.ts +8 -4
  146. package/tabs-icon-option/types.d.ts +21 -26
  147. package/tabs-option/index.d.ts +8 -4
  148. package/tabs-option/types.d.ts +26 -35
  149. package/tag/index.d.ts +8 -4
  150. package/tag/types.d.ts +22 -35
  151. package/text/index.d.ts +8 -4
  152. package/text/types.d.ts +21 -34
  153. package/textarea/index.d.ts +8 -4
  154. package/textarea/types.d.ts +30 -56
  155. package/tile-control/index.d.ts +8 -4
  156. package/tile-control/types.d.ts +15 -27
  157. package/tile-control-option/index.d.ts +8 -4
  158. package/tile-control-option/types.d.ts +41 -55
  159. package/time-picker/index.d.ts +8 -4
  160. package/time-picker/types.d.ts +42 -47
  161. package/title/index.d.ts +8 -4
  162. package/title/types.d.ts +18 -31
  163. package/toast/index.d.ts +8 -4
  164. package/toast/types.d.ts +31 -39
  165. package/toast-manager/index.d.ts +8 -4
  166. package/toast-manager/types.d.ts +13 -10
  167. package/toggle/index.d.ts +8 -4
  168. package/toggle/types.d.ts +29 -34
  169. package/tooltip/index.d.ts +8 -4
  170. package/tooltip/types.d.ts +25 -39
  171. package/types.d.ts +20 -6
  172. package/utils/adapters.d.ts +30 -0
  173. package/utils/adapters.js +1 -0
  174. package/vertical-stepper/index.d.ts +8 -4
  175. package/vertical-stepper/types.d.ts +29 -30
  176. package/vertical-stepper-item/index.d.ts +8 -4
  177. package/vertical-stepper-item/types.d.ts +34 -43
package/radio/types.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchRadioElement = HTMLElement & {
3
- value: string;
4
- invalid: boolean;
5
- addEventListener(type: '-change', listener: (e: CustomEvent<boolean>) => void): void;
6
- setAttribute(name: 'value', value: string): void;
7
- setAttribute(name: 'invalid', value: ''): void;
8
- };
9
- export type TSinchRadioReact = TSinchElementReact<TSinchRadioElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchRadioProps = {
10
3
  value: string;
11
4
  invalid?: boolean;
12
5
  'aria-label': string;
13
- 'on-change'?: (e: CustomEvent<string>) => void;
14
- } & {
15
- style?: {
16
- '--sinch-comp-radio-direction'?: 'row' | 'column';
17
- '--sinch-comp-radio-gap'?: number | string;
18
- };
19
6
  };
7
+ export type TSinchRadioEvents = {
8
+ '-change'?: (e: CustomEvent<string>) => void;
9
+ };
10
+ export type TSinchRadioStyle = {
11
+ '--sinch-comp-radio-direction'?: 'row' | 'column';
12
+ '--sinch-comp-radio-gap'?: number | string;
13
+ };
14
+ export type TSinchRadio = {
15
+ props: TSinchRadioProps;
16
+ events: TSinchRadioEvents;
17
+ style: TSinchRadioStyle;
18
+ };
19
+ export type TSinchRadioElement = NectaryComponentVanillaByType<TSinchRadio>;
20
+ export type TSinchRadioReact = NectaryComponentReactByType<TSinchRadio>;
@@ -1,18 +1,22 @@
1
- import type { TSinchRadioOptionElement, TSinchRadioOptionReact } from './types';
1
+ import type { TSinchRadioOption } from './types';
2
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-radio-option': TSinchRadioOption;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-radio-option': TSinchRadioOptionElement;
8
+ 'sinch-radio-option': NectaryComponentVanilla<'sinch-radio-option'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-radio-option': TSinchRadioOptionReact;
12
+ 'sinch-radio-option': NectaryComponentReact<'sinch-radio-option'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-radio-option': TSinchRadioOptionReact;
19
+ 'sinch-radio-option': NectaryComponentReact<'sinch-radio-option'>;
16
20
  }
17
21
  }
18
22
  }
@@ -1,46 +1,41 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchRadioOptionElement = HTMLElement & {
3
- value: string;
4
- checked: boolean;
5
- disabled: boolean;
6
- text: string;
7
- setAttribute(name: 'value', value: string): void;
8
- setAttribute(name: 'checked', value: ''): void;
9
- setAttribute(name: 'disabled', value: ''): void;
10
- setAttribute(name: 'text', value: string): void;
11
- };
12
- export type TSinchRadioOptionReact = TSinchElementReact<TSinchRadioOptionElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchRadioOptionProps = {
13
3
  value: string;
14
4
  checked?: boolean;
15
5
  disabled?: boolean;
16
6
  text: string;
17
7
  'aria-label': string;
18
- } & {
19
- style?: {
20
- '--sinch-comp-radio-color-default-background-initial'?: string;
21
- '--sinch-comp-radio-color-default-background-hover'?: string;
22
- '--sinch-comp-radio-color-default-background-active'?: string;
23
- '--sinch-comp-radio-color-default-border-initial'?: string;
24
- '--sinch-comp-radio-color-default-border-hover'?: string;
25
- '--sinch-comp-radio-color-default-border-active'?: string;
26
- '--sinch-comp-radio-color-default-label-initial'?: string;
27
- '--sinch-comp-radio-color-default-outline-focus'?: string;
28
- '--sinch-comp-radio-color-checked-border-initial'?: string;
29
- '--sinch-comp-radio-color-checked-border-hover'?: string;
30
- '--sinch-comp-radio-color-checked-border-active'?: string;
31
- '--sinch-comp-radio-color-checked-knob-initial'?: string;
32
- '--sinch-comp-radio-color-checked-knob-hover'?: string;
33
- '--sinch-comp-radio-color-checked-knob-active'?: string;
34
- '--sinch-comp-radio-color-invalid-border-initial'?: string;
35
- '--sinch-comp-radio-color-invalid-border-hover'?: string;
36
- '--sinch-comp-radio-color-invalid-border-active'?: string;
37
- '--sinch-comp-radio-color-invalid-label-initial'?: string;
38
- '--sinch-comp-radio-color-disabled-background-initial'?: string;
39
- '--sinch-comp-radio-color-disabled-border-initial'?: string;
40
- '--sinch-comp-radio-color-disabled-label-initial'?: string;
41
- '--sinch-comp-radio-color-checked-disabled-border-initial'?: string;
42
- '--sinch-comp-radio-color-checked-disabled-knob-initial'?: string;
43
- '--sinch-comp-radio-color-checked-disabled-label-initial'?: string;
44
- '--sinch-comp-radio-font-label'?: string;
45
- };
46
8
  };
9
+ export type TSinchRadioOptionStyle = {
10
+ '--sinch-comp-radio-color-default-background-initial'?: string;
11
+ '--sinch-comp-radio-color-default-background-hover'?: string;
12
+ '--sinch-comp-radio-color-default-background-active'?: string;
13
+ '--sinch-comp-radio-color-default-border-initial'?: string;
14
+ '--sinch-comp-radio-color-default-border-hover'?: string;
15
+ '--sinch-comp-radio-color-default-border-active'?: string;
16
+ '--sinch-comp-radio-color-default-label-initial'?: string;
17
+ '--sinch-comp-radio-color-default-outline-focus'?: string;
18
+ '--sinch-comp-radio-color-checked-border-initial'?: string;
19
+ '--sinch-comp-radio-color-checked-border-hover'?: string;
20
+ '--sinch-comp-radio-color-checked-border-active'?: string;
21
+ '--sinch-comp-radio-color-checked-knob-initial'?: string;
22
+ '--sinch-comp-radio-color-checked-knob-hover'?: string;
23
+ '--sinch-comp-radio-color-checked-knob-active'?: string;
24
+ '--sinch-comp-radio-color-invalid-border-initial'?: string;
25
+ '--sinch-comp-radio-color-invalid-border-hover'?: string;
26
+ '--sinch-comp-radio-color-invalid-border-active'?: string;
27
+ '--sinch-comp-radio-color-invalid-label-initial'?: string;
28
+ '--sinch-comp-radio-color-disabled-background-initial'?: string;
29
+ '--sinch-comp-radio-color-disabled-border-initial'?: string;
30
+ '--sinch-comp-radio-color-disabled-label-initial'?: string;
31
+ '--sinch-comp-radio-color-checked-disabled-border-initial'?: string;
32
+ '--sinch-comp-radio-color-checked-disabled-knob-initial'?: string;
33
+ '--sinch-comp-radio-color-checked-disabled-label-initial'?: string;
34
+ '--sinch-comp-radio-font-label'?: string;
35
+ };
36
+ export type TSinchRadioOption = {
37
+ props: TSinchRadioOptionProps;
38
+ style: TSinchRadioOptionStyle;
39
+ };
40
+ export type TSinchRadioOptionElement = NectaryComponentVanillaByType<TSinchRadioOption>;
41
+ export type TSinchRadioOptionReact = NectaryComponentReactByType<TSinchRadioOption>;
@@ -1,21 +1,25 @@
1
1
  import '../emoji';
2
2
  import '../code-tag';
3
3
  import '../link';
4
- import type { TSinchRichTextElement, TSinchRichTextReact } from './types';
4
+ import type { TSinchRichText } from './types';
5
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
5
6
  declare global {
7
+ interface NectaryComponentMap {
8
+ 'sinch-rich-text': TSinchRichText;
9
+ }
6
10
  interface HTMLElementTagNameMap {
7
- 'sinch-rich-text': TSinchRichTextElement;
11
+ 'sinch-rich-text': NectaryComponentVanilla<'sinch-rich-text'>;
8
12
  }
9
13
  namespace JSX {
10
14
  interface IntrinsicElements {
11
- 'sinch-rich-text': TSinchRichTextReact;
15
+ 'sinch-rich-text': NectaryComponentReact<'sinch-rich-text'>;
12
16
  }
13
17
  }
14
18
  }
15
19
  declare module 'react' {
16
20
  namespace JSX {
17
21
  interface IntrinsicElements {
18
- 'sinch-rich-text': TSinchRichTextReact;
22
+ 'sinch-rich-text': NectaryComponentReact<'sinch-rich-text'>;
19
23
  }
20
24
  }
21
25
  }
@@ -1,39 +1,39 @@
1
1
  import type { TSinchTextType } from '../text/types';
2
- import type { TSinchElementReact } from '../types';
2
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
3
3
  export type ElementClickedEvent = CustomEvent & {
4
4
  currentTarget: HTMLElement;
5
5
  };
6
- export type TSinchRichTextElement = HTMLElement & {
7
- size: TSinchTextType;
8
- text: string;
9
- setAttribute(name: 'size', value: TSinchTextType): void;
10
- setAttribute(name: 'text', value: string): void;
11
- /** Click event */
12
- addEventListener(type: '-element-click', listener: (e: ElementClickedEvent) => void): void;
13
- };
14
- export type TSinchRichTextReact = TSinchElementReact<TSinchRichTextElement> & {
6
+ export type TSinchRichTextProps = {
15
7
  size?: TSinchTextType;
16
8
  text: string;
9
+ };
10
+ export type TSinchRichTextEvents = {
17
11
  /** Click event handler */
18
- 'on-element-click'?: (e: ElementClickedEvent) => void;
19
- } & {
20
- style?: {
21
- '--sinch-comp-rich-text-font'?: string;
22
- '--sinch-sys-font-body-m'?: string;
23
- '--sinch-sys-font-body-s'?: string;
24
- '--sinch-sys-font-body-xs'?: string;
25
- '--sinch-sys-font-body-xxs'?: string;
26
- '--sinch-ref-typography-font-weight-700'?: string;
27
- '--sinch-comp-link-default-font-initial'?: string;
28
- '--sinch-comp-code-tag-font-text'?: string;
29
- '--sinch-sys-color-text-default'?: string;
30
- '--sinch-comp-link-color-default-text-initial'?: string;
31
- '--sinch-comp-link-color-default-text-hover'?: string;
32
- '--sinch-comp-code-tag-color-default-border-initial'?: string;
33
- '--sinch-comp-code-tag-color-default-background-initial'?: string;
34
- '--sinch-comp-code-tag-shape-radius'?: string;
35
- '--sinch-comp-emoji-vertical-align'?: string;
36
- '--sinch-global-color-text'?: string;
37
- '--sinch-global-size-icon'?: string;
38
- };
12
+ '-element-click'?: (e: ElementClickedEvent) => void;
13
+ };
14
+ export type TSinchRichTextStyle = {
15
+ '--sinch-comp-rich-text-font'?: string;
16
+ '--sinch-sys-font-body-m'?: string;
17
+ '--sinch-sys-font-body-s'?: string;
18
+ '--sinch-sys-font-body-xs'?: string;
19
+ '--sinch-sys-font-body-xxs'?: string;
20
+ '--sinch-ref-typography-font-weight-700'?: string;
21
+ '--sinch-comp-link-default-font-initial'?: string;
22
+ '--sinch-comp-code-tag-font-text'?: string;
23
+ '--sinch-sys-color-text-default'?: string;
24
+ '--sinch-comp-link-color-default-text-initial'?: string;
25
+ '--sinch-comp-link-color-default-text-hover'?: string;
26
+ '--sinch-comp-code-tag-color-default-border-initial'?: string;
27
+ '--sinch-comp-code-tag-color-default-background-initial'?: string;
28
+ '--sinch-comp-code-tag-shape-radius'?: string;
29
+ '--sinch-comp-emoji-vertical-align'?: string;
30
+ '--sinch-global-color-text'?: string;
31
+ '--sinch-global-size-icon'?: string;
32
+ };
33
+ export type TSinchRichText = {
34
+ props: TSinchRichTextProps;
35
+ events: TSinchRichTextEvents;
36
+ style: TSinchRichTextStyle;
39
37
  };
38
+ export type TSinchRichTextElement = NectaryComponentVanillaByType<TSinchRichText>;
39
+ export type TSinchRichTextReact = NectaryComponentReactByType<TSinchRichText>;
@@ -70,7 +70,7 @@ export const createParseVisitor = doc => {
70
70
  $link.preventDefault = true;
71
71
  break;
72
72
  case 'use-history':
73
- $link['use-history'] = true;
73
+ $link.useHistory = true;
74
74
  break;
75
75
  case 'external':
76
76
  $link.external = true;
@@ -1,18 +1,22 @@
1
- import type { TSinchRichTextareaElement, TSinchRichTextareaReact } from './types';
1
+ import type { TSinchRichTextarea } from './types';
2
+ import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-rich-textarea': TSinchRichTextarea;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-rich-textarea': TSinchRichTextareaElement;
8
+ 'sinch-rich-textarea': NectaryComponentVanilla<'sinch-rich-textarea'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-rich-textarea': TSinchRichTextareaReact;
12
+ 'sinch-rich-textarea': NectaryComponentReact<'sinch-rich-textarea'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-rich-textarea': TSinchRichTextareaReact;
19
+ 'sinch-rich-textarea': NectaryComponentReact<'sinch-rich-textarea'>;
16
20
  }
17
21
  }
18
22
  }
@@ -1,4 +1,4 @@
1
- import type { TSinchElementReact } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
2
  export type TRichTextareaSelection = {
3
3
  italic: boolean;
4
4
  bold: boolean;
@@ -8,11 +8,14 @@ export type TRichTextareaSelection = {
8
8
  ulist: boolean;
9
9
  olist: boolean;
10
10
  };
11
- export type TSinchRichTextareaElement = HTMLElement & {
11
+ export type TSinchRichTextareaProps = {
12
12
  /** Value */
13
13
  value: string;
14
14
  /** Text that appears in the text field when it has no value set */
15
- placeholder: string | null;
15
+ placeholder?: string;
16
+ 'aria-label': string;
17
+ };
18
+ export type TSinchRichTextareaMethods = {
16
19
  insertText(value: string): void;
17
20
  insertLink(text: string, href: string): void;
18
21
  formatItalic(): void;
@@ -21,48 +24,39 @@ export type TSinchRichTextareaElement = HTMLElement & {
21
24
  formatCodeTag(): void;
22
25
  formatOrderedList(): void;
23
26
  formatUnorderedList(): void;
24
- /** Change value event */
25
- addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
26
- /** Focus event */
27
- addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
28
- /** Blur event */
29
- addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
30
- addEventListener(type: '-selection', listener: (e: CustomEvent<TRichTextareaSelection>) => void): void;
31
- /** Value */
32
- setAttribute(name: 'value', value: string): void;
33
- /** Text that appears in the text field when it has no value set */
34
- setAttribute(name: 'placeholder', value: string): void;
35
27
  };
36
- export type TSinchRichTextareaReact = TSinchElementReact<TSinchRichTextareaElement> & {
37
- /** Value */
38
- value: string;
39
- /** Text that appears in the text field when it has no value set */
40
- placeholder?: string;
41
- 'aria-label': string;
28
+ export type TSinchRichTextareaEvents = {
42
29
  /** Change value handler */
43
- 'on-change'?: (e: CustomEvent<string>) => void;
30
+ '-change'?: (e: CustomEvent<string>) => void;
44
31
  /** Focus handler */
45
- 'on-focus'?: (e: CustomEvent<void>) => void;
32
+ '-focus'?: (e: CustomEvent<void>) => void;
46
33
  /** Blur handler */
47
- 'on-blur'?: (e: CustomEvent<void>) => void;
48
- } & {
49
- style?: {
50
- '--sinch-comp-textarea-shape-radius'?: string;
51
- '--sinch-comp-code-tag-shape-radius'?: string;
52
- '--sinch-comp-textarea-color-default-background-initial'?: string;
53
- '--sinch-comp-textarea-color-default-text-initial'?: string;
54
- '--sinch-comp-textarea-color-default-text-placeholder'?: string;
55
- '--sinch-comp-textarea-color-default-border-initial'?: string;
56
- '--sinch-comp-textarea-color-default-border-focus'?: string;
57
- '--sinch-comp-textarea-color-invalid-border-initial'?: string;
58
- '--sinch-comp-textarea-color-disabled-text-initial'?: string;
59
- '--sinch-comp-textarea-color-disabled-border-initial'?: string;
60
- '--sinch-comp-code-tag-color-default-text-initial'?: string;
61
- '--sinch-comp-code-tag-color-default-border-initial'?: string;
62
- '--sinch-comp-code-tag-color-default-background-initial'?: string;
63
- '--sinch-comp-link-color-default-text-initial'?: string;
64
- '--sinch-comp-textarea-font-input'?: string;
65
- '--sinch-comp-code-tag-font-text'?: string;
66
- '--sinch-comp-link-default-font-initial'?: string;
67
- };
34
+ '-blur'?: (e: CustomEvent<void>) => void;
35
+ };
36
+ export type TSinchRichTextareaStyle = {
37
+ '--sinch-comp-textarea-shape-radius'?: string;
38
+ '--sinch-comp-code-tag-shape-radius'?: string;
39
+ '--sinch-comp-textarea-color-default-background-initial'?: string;
40
+ '--sinch-comp-textarea-color-default-text-initial'?: string;
41
+ '--sinch-comp-textarea-color-default-text-placeholder'?: string;
42
+ '--sinch-comp-textarea-color-default-border-initial'?: string;
43
+ '--sinch-comp-textarea-color-default-border-focus'?: string;
44
+ '--sinch-comp-textarea-color-invalid-border-initial'?: string;
45
+ '--sinch-comp-textarea-color-disabled-text-initial'?: string;
46
+ '--sinch-comp-textarea-color-disabled-border-initial'?: string;
47
+ '--sinch-comp-code-tag-color-default-text-initial'?: string;
48
+ '--sinch-comp-code-tag-color-default-border-initial'?: string;
49
+ '--sinch-comp-code-tag-color-default-background-initial'?: string;
50
+ '--sinch-comp-link-color-default-text-initial'?: string;
51
+ '--sinch-comp-textarea-font-input'?: string;
52
+ '--sinch-comp-code-tag-font-text'?: string;
53
+ '--sinch-comp-link-default-font-initial'?: string;
54
+ };
55
+ export type TSinchRichTextarea = {
56
+ props: TSinchRichTextareaProps;
57
+ methods: TSinchRichTextareaMethods;
58
+ events: TSinchRichTextareaEvents;
59
+ style: TSinchRichTextareaStyle;
68
60
  };
61
+ export type TSinchRichTextareaElement = NectaryComponentVanillaByType<TSinchRichTextarea>;
62
+ export type TSinchRichTextareaReact = NectaryComponentReactByType<TSinchRichTextarea>;
@@ -1,19 +1,23 @@
1
1
  import '../title';
2
- import type { TSinchSegmentElement, TSinchSegmentReact } from './types';
2
+ import type { TSinchSegment } from './types';
3
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
3
4
  declare global {
5
+ interface NectaryComponentMap {
6
+ 'sinch-segment': TSinchSegment;
7
+ }
4
8
  interface HTMLElementTagNameMap {
5
- 'sinch-segment': TSinchSegmentElement;
9
+ 'sinch-segment': NectaryComponentVanilla<'sinch-segment'>;
6
10
  }
7
11
  namespace JSX {
8
12
  interface IntrinsicElements {
9
- 'sinch-segment': TSinchSegmentReact;
13
+ 'sinch-segment': NectaryComponentReact<'sinch-segment'>;
10
14
  }
11
15
  }
12
16
  }
13
17
  declare module 'react' {
14
18
  namespace JSX {
15
19
  interface IntrinsicElements {
16
- 'sinch-segment': TSinchSegmentReact;
20
+ 'sinch-segment': NectaryComponentReact<'sinch-segment'>;
17
21
  }
18
22
  }
19
23
  }
@@ -1,26 +1,23 @@
1
- import type { TRect, TSinchElementReact } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect } from '../types';
2
2
  import type { TSinchSize } from '../utils/size';
3
- export type TSinchSegmentElement = HTMLElement & {
4
- caption: string;
5
- collapsed: boolean;
6
- size: TSinchSize;
7
- readonly collapseButtonRect: TRect | null;
8
- setAttribute(name: 'caption', value: string): void;
9
- setAttribute(name: 'collapsed', value: ''): void;
10
- setAttribute(name: 'size', value: TSinchSize): void;
11
- };
12
- export type TSinchSegmentReact = TSinchElementReact<TSinchSegmentElement> & {
3
+ export type TSinchSegmentProps = {
13
4
  caption: string;
14
5
  collapsed?: boolean;
15
6
  size?: TSinchSize;
16
- } & {
17
- style?: {
18
- '--sinch-comp-segment-shape-radius'?: string;
19
- '--sinch-comp-segment-color-default-border-initial'?: string;
20
- '--sinch-comp-segment-color-default-background-initial'?: string;
21
- '--sinch-comp-segment-font-size-m-title'?: string;
22
- '--sinch-comp-segment-font-size-l-title'?: string;
23
- '--sinch-comp-segment-font-size-s-title'?: string;
24
- '--sinch-global-size-icon'?: string;
25
- };
7
+ readonly collapseButtonRect?: TRect | null;
8
+ };
9
+ export type TSinchSegmentStyle = {
10
+ '--sinch-comp-segment-shape-radius'?: string;
11
+ '--sinch-comp-segment-color-default-border-initial'?: string;
12
+ '--sinch-comp-segment-color-default-background-initial'?: string;
13
+ '--sinch-comp-segment-font-size-m-title'?: string;
14
+ '--sinch-comp-segment-font-size-l-title'?: string;
15
+ '--sinch-comp-segment-font-size-s-title'?: string;
16
+ '--sinch-global-size-icon'?: string;
17
+ };
18
+ export type TSinchSegment = {
19
+ props: TSinchSegmentProps;
20
+ style: TSinchSegmentStyle;
26
21
  };
22
+ export type TSinchSegmentElement = NectaryComponentVanillaByType<TSinchSegment>;
23
+ export type TSinchSegmentReact = NectaryComponentReactByType<TSinchSegment>;
@@ -1,19 +1,23 @@
1
1
  import '../icon';
2
- import type { TSinchSegmentExpandElement, TSinchSegmentExpandReact } from './types';
2
+ import type { TSinchSegmentExpand } from './types';
3
+ import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
3
4
  declare global {
5
+ interface NectaryComponentMap {
6
+ 'sinch-segment-collapse': TSinchSegmentExpand;
7
+ }
4
8
  interface HTMLElementTagNameMap {
5
- 'sinch-segment-collapse': TSinchSegmentExpandElement;
9
+ 'sinch-segment-collapse': NectaryComponentVanilla<'sinch-segment-collapse'>;
6
10
  }
7
11
  namespace JSX {
8
12
  interface IntrinsicElements {
9
- 'sinch-segment-collapse': TSinchSegmentExpandReact;
13
+ 'sinch-segment-collapse': NectaryComponentReact<'sinch-segment-collapse'>;
10
14
  }
11
15
  }
12
16
  }
13
17
  declare module 'react' {
14
18
  namespace JSX {
15
19
  interface IntrinsicElements {
16
- 'sinch-segment-collapse': TSinchSegmentExpandReact;
20
+ 'sinch-segment-collapse': NectaryComponentReact<'sinch-segment-collapse'>;
17
21
  }
18
22
  }
19
23
  }
@@ -1,15 +1,18 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchSegmentExpandElement = HTMLElement & {
3
- value: boolean;
4
- addEventListener(type: '-change', listener: (e: CustomEvent<boolean>) => void): void;
5
- setAttribute(name: 'value', value: string): void;
6
- };
7
- export type TSinchSegmentExpandReact = TSinchElementReact<TSinchSegmentExpandElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchSegmentExpandProps = {
8
3
  value: boolean;
9
4
  'aria-label': string;
10
- 'on-change'?: (e: CustomEvent<boolean>) => void;
11
- } & {
12
- style?: {
13
- '--sinch-global-size-icon'?: string;
14
- };
15
5
  };
6
+ export type TSinchSegmentExpandEvents = {
7
+ '-change'?: (e: CustomEvent<boolean>) => void;
8
+ };
9
+ export type TSinchSegmentExpandStyle = {
10
+ '--sinch-global-size-icon'?: string;
11
+ };
12
+ export type TSinchSegmentExpand = {
13
+ props: TSinchSegmentExpandProps;
14
+ events: TSinchSegmentExpandEvents;
15
+ style: TSinchSegmentExpandStyle;
16
+ };
17
+ export type TSinchSegmentExpandElement = NectaryComponentVanillaByType<TSinchSegmentExpand>;
18
+ export type TSinchSegmentExpandReact = NectaryComponentReactByType<TSinchSegmentExpand>;
@@ -1,18 +1,22 @@
1
- import type { TSinchSegmentedControlElement, TSinchSegmentedControlReact } from './types';
1
+ import type { TSinchSegmentedControl } from './types';
2
+ import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-segmented-control': TSinchSegmentedControl;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-segmented-control': TSinchSegmentedControlElement;
8
+ 'sinch-segmented-control': NectaryComponentVanilla<'sinch-segmented-control'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-segmented-control': TSinchSegmentedControlReact;
12
+ 'sinch-segmented-control': NectaryComponentReact<'sinch-segmented-control'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-segmented-control': TSinchSegmentedControlReact;
19
+ 'sinch-segmented-control': NectaryComponentReact<'sinch-segmented-control'>;
16
20
  }
17
21
  }
18
22
  }
@@ -1,11 +1,14 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchSegmentedControlElement = HTMLElement & {
3
- value: string;
4
- addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
5
- setAttribute(name: 'value', value: string): void;
6
- };
7
- export type TSinchSegmentedControlReact = TSinchElementReact<TSinchSegmentedControlElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchSegmentedControlProps = {
8
3
  value: string;
9
4
  'aria-label': string;
10
- 'on-change'?: (e: CustomEvent<string>) => void;
11
5
  };
6
+ export type TSinchSegmentedControlEvents = {
7
+ '-change'?: (e: CustomEvent<string>) => void;
8
+ };
9
+ export type TSinchSegmentedControl = {
10
+ props: TSinchSegmentedControlProps;
11
+ events: TSinchSegmentedControlEvents;
12
+ };
13
+ export type TSinchSegmentedControlElement = NectaryComponentVanillaByType<TSinchSegmentedControl>;
14
+ export type TSinchSegmentedControlReact = NectaryComponentReactByType<TSinchSegmentedControl>;
@@ -1,18 +1,22 @@
1
- import type { TSinchSegmentedControlOptionElement, TSinchSegmentedControlOptionReact } from './types';
1
+ import type { TSinchSegmentedControlOption } from './types';
2
+ import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-segmented-control-option': TSinchSegmentedControlOption;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-segmented-control-option': TSinchSegmentedControlOptionElement;
8
+ 'sinch-segmented-control-option': NectaryComponentVanilla<'sinch-segmented-control-option'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-segmented-control-option': TSinchSegmentedControlOptionReact;
12
+ 'sinch-segmented-control-option': NectaryComponentReact<'sinch-segmented-control-option'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-segmented-control-option': TSinchSegmentedControlOptionReact;
19
+ 'sinch-segmented-control-option': NectaryComponentReact<'sinch-segmented-control-option'>;
16
20
  }
17
21
  }
18
22
  }