@nectary/components 4.8.1 → 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 (178) 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 +9 -4
  150. package/tag/index.js +18 -1
  151. package/tag/types.d.ts +24 -31
  152. package/text/index.d.ts +8 -4
  153. package/text/types.d.ts +21 -34
  154. package/textarea/index.d.ts +8 -4
  155. package/textarea/types.d.ts +30 -56
  156. package/tile-control/index.d.ts +8 -4
  157. package/tile-control/types.d.ts +15 -27
  158. package/tile-control-option/index.d.ts +8 -4
  159. package/tile-control-option/types.d.ts +41 -55
  160. package/time-picker/index.d.ts +8 -4
  161. package/time-picker/types.d.ts +42 -47
  162. package/title/index.d.ts +8 -4
  163. package/title/types.d.ts +18 -31
  164. package/toast/index.d.ts +8 -4
  165. package/toast/types.d.ts +31 -39
  166. package/toast-manager/index.d.ts +8 -4
  167. package/toast-manager/types.d.ts +13 -10
  168. package/toggle/index.d.ts +8 -4
  169. package/toggle/types.d.ts +29 -34
  170. package/tooltip/index.d.ts +8 -4
  171. package/tooltip/types.d.ts +25 -39
  172. package/types.d.ts +20 -6
  173. package/utils/adapters.d.ts +30 -0
  174. package/utils/adapters.js +1 -0
  175. package/vertical-stepper/index.d.ts +8 -4
  176. package/vertical-stepper/types.d.ts +29 -30
  177. package/vertical-stepper-item/index.d.ts +8 -4
  178. package/vertical-stepper-item/types.d.ts +34 -43
@@ -1,27 +1,5 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchTileControlOptionElement = HTMLElement & {
3
- /** Value */
4
- value: string;
5
- /** Text content */
6
- text: string;
7
- /** Disabled */
8
- disabled: boolean;
9
- /** Small */
10
- small: boolean;
11
- /** Focus event */
12
- addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
13
- /** Blur event */
14
- addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
15
- /** Value */
16
- setAttribute(name: 'value', value: string): void;
17
- /** Text content */
18
- setAttribute(attr: 'text', value: string): void;
19
- /** Disabled */
20
- setAttribute(name: 'disabled', value: ''): void;
21
- /** Small */
22
- setAttribute(name: 'small', value: ''): void;
23
- };
24
- export type TSinchTileControlOptionReact = TSinchElementReact<TSinchTileControlOptionElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchTileControlOptionProps = {
25
3
  /** Value */
26
4
  value: string;
27
5
  /** Text content */
@@ -30,37 +8,45 @@ export type TSinchTileControlOptionReact = TSinchElementReact<TSinchTileControlO
30
8
  'aria-label': string;
31
9
  /** Disabled */
32
10
  disabled?: boolean;
11
+ };
12
+ export type TSinchTileControlOptionEvents = {
33
13
  /** Focus handler */
34
- 'on-focus'?: (e: CustomEvent<void>) => void;
14
+ '-focus'?: (e: CustomEvent<void>) => void;
35
15
  /** Blur handler */
36
- 'on-blur'?: (e: CustomEvent<void>) => void;
37
- } & {
38
- style?: {
39
- '--sinch-comp-tile-control-shape-radius-l'?: string;
40
- '--sinch-comp-tile-control-shape-radius-s'?: string;
41
- '--sinch-comp-tile-control-font-label'?: string;
42
- '--sinch-comp-tile-control-size-m-icon'?: string;
43
- '--sinch-comp-tile-control-size-s-icon'?: string;
44
- '--sinch-comp-tile-control-color-default-background-initial'?: string;
45
- '--sinch-comp-tile-control-color-default-border-initial'?: string;
46
- '--sinch-comp-tile-control-color-default-text-initial'?: string;
47
- '--sinch-comp-tile-control-color-default-icon-initial'?: string;
48
- '--sinch-comp-tile-control-color-default-background-hover'?: string;
49
- '--sinch-comp-tile-control-color-default-border-hover'?: string;
50
- '--sinch-comp-tile-control-color-default-outline-focus'?: string;
51
- '--sinch-comp-tile-control-color-checked-background-initial'?: string;
52
- '--sinch-comp-tile-control-color-checked-border-initial'?: string;
53
- '--sinch-comp-tile-control-color-checked-text-initial'?: string;
54
- '--sinch-comp-tile-control-color-checked-icon-initial'?: string;
55
- '--sinch-comp-tile-control-color-disabled-background-initial'?: string;
56
- '--sinch-comp-tile-control-color-disabled-border-initial'?: string;
57
- '--sinch-comp-tile-control-color-disabled-text-initial'?: string;
58
- '--sinch-comp-tile-control-color-disabled-icon-initial'?: string;
59
- '--sinch-comp-tile-control-shadow-initial'?: string;
60
- '--sinch-comp-tile-control-shadow-hover'?: string;
61
- '--sinch-comp-tile-control-shadow-active'?: string;
62
- '--sinch-comp-tile-control-shadow-disabled'?: string;
63
- '--sinch-global-size-icon'?: string;
64
- '--sinch-global-color-icon'?: string;
65
- };
16
+ '-blur'?: (e: CustomEvent<void>) => void;
17
+ };
18
+ export type TSinchTileControlOptionStyle = {
19
+ '--sinch-comp-tile-control-shape-radius-l'?: string;
20
+ '--sinch-comp-tile-control-shape-radius-s'?: string;
21
+ '--sinch-comp-tile-control-font-label'?: string;
22
+ '--sinch-comp-tile-control-size-m-icon'?: string;
23
+ '--sinch-comp-tile-control-size-s-icon'?: string;
24
+ '--sinch-comp-tile-control-color-default-background-initial'?: string;
25
+ '--sinch-comp-tile-control-color-default-border-initial'?: string;
26
+ '--sinch-comp-tile-control-color-default-text-initial'?: string;
27
+ '--sinch-comp-tile-control-color-default-icon-initial'?: string;
28
+ '--sinch-comp-tile-control-color-default-background-hover'?: string;
29
+ '--sinch-comp-tile-control-color-default-border-hover'?: string;
30
+ '--sinch-comp-tile-control-color-default-outline-focus'?: string;
31
+ '--sinch-comp-tile-control-color-checked-background-initial'?: string;
32
+ '--sinch-comp-tile-control-color-checked-border-initial'?: string;
33
+ '--sinch-comp-tile-control-color-checked-text-initial'?: string;
34
+ '--sinch-comp-tile-control-color-checked-icon-initial'?: string;
35
+ '--sinch-comp-tile-control-color-disabled-background-initial'?: string;
36
+ '--sinch-comp-tile-control-color-disabled-border-initial'?: string;
37
+ '--sinch-comp-tile-control-color-disabled-text-initial'?: string;
38
+ '--sinch-comp-tile-control-color-disabled-icon-initial'?: string;
39
+ '--sinch-comp-tile-control-shadow-initial'?: string;
40
+ '--sinch-comp-tile-control-shadow-hover'?: string;
41
+ '--sinch-comp-tile-control-shadow-active'?: string;
42
+ '--sinch-comp-tile-control-shadow-disabled'?: string;
43
+ '--sinch-global-size-icon'?: string;
44
+ '--sinch-global-color-icon'?: string;
45
+ };
46
+ export type TSinchTileControlOption = {
47
+ props: TSinchTileControlOptionProps;
48
+ events: TSinchTileControlOptionEvents;
49
+ style: TSinchTileControlOptionStyle;
66
50
  };
51
+ export type TSinchTileControlOptionElement = NectaryComponentVanillaByType<TSinchTileControlOption>;
52
+ export type TSinchTileControlOptionReact = NectaryComponentReactByType<TSinchTileControlOption>;
@@ -1,21 +1,25 @@
1
1
  import '../icon';
2
2
  import '../segmented-control';
3
3
  import '../segmented-control-option';
4
- import type { TSinchTimePickerElement, TSinchTimePickerReact } from './types';
4
+ import type { TSinchTimePicker } from './types';
5
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
5
6
  declare global {
7
+ interface NectaryComponentMap {
8
+ 'sinch-time-picker': TSinchTimePicker;
9
+ }
6
10
  interface HTMLElementTagNameMap {
7
- 'sinch-time-picker': TSinchTimePickerElement;
11
+ 'sinch-time-picker': NectaryComponentVanilla<'sinch-time-picker'>;
8
12
  }
9
13
  namespace JSX {
10
14
  interface IntrinsicElements {
11
- 'sinch-time-picker': TSinchTimePickerReact;
15
+ 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
12
16
  }
13
17
  }
14
18
  }
15
19
  declare module 'react' {
16
20
  namespace JSX {
17
21
  interface IntrinsicElements {
18
- 'sinch-time-picker': TSinchTimePickerReact;
22
+ 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
19
23
  }
20
24
  }
21
25
  }
@@ -1,26 +1,5 @@
1
- import type { TRect, TSinchElementReact } from '../types';
2
- export type TSinchTimePickerElement = HTMLElement & {
3
- /** Time value in ISO 8601 format */
4
- value: string;
5
- /** AM/PM 12-hour clock system, `false` by default */
6
- ampm: boolean;
7
- /** Submit button label that is used for a11y */
8
- submitAriaLabel: string;
9
- readonly submitButtonRect: TRect;
10
- readonly amButtonRect: TRect | null;
11
- readonly pmButtonRect: TRect | null;
12
- hourDigitRect(hour: number): TRect | null;
13
- minuteDigitRect(minute: number): TRect | null;
14
- /** Change value handler, return time in ISO 8601 format */
15
- addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
16
- /** Time value in ISO 8601 format */
17
- setAttribute(name: 'value', value: string): void;
18
- /** AM/PM 12-hour clock system, `false` by default */
19
- setAttribute(name: 'ampm', value: boolean): void;
20
- /** Submit button label that is used for a11y */
21
- setAttribute(name: 'submit-aria-label', value: string): void;
22
- };
23
- export type TSinchTimePickerReact = TSinchElementReact<TSinchTimePickerElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect } from '../types';
2
+ export type TSinchTimePickerProps = {
24
3
  /** Time value in ISO 8601 format */
25
4
  value: string;
26
5
  /** AM/PM 12-hour clock system, `false` by default */
@@ -29,29 +8,45 @@ export type TSinchTimePickerReact = TSinchElementReact<TSinchTimePickerElement>
29
8
  'aria-label': string;
30
9
  /** Submit button label that is used for a11y */
31
10
  'submit-aria-label': string;
11
+ readonly submitButtonRect?: TRect;
12
+ readonly amButtonRect?: TRect | null;
13
+ readonly pmButtonRect?: TRect | null;
14
+ };
15
+ export type TSinchTimePickerMethods = {
16
+ hourDigitRect(hour: number): TRect | null;
17
+ minuteDigitRect(minute: number): TRect | null;
18
+ };
19
+ export type TSinchTimePickerEvents = {
32
20
  /** Change value handler, return time in ISO 8601 format */
33
- 'on-change'?: (e: CustomEvent<string>) => void;
34
- } & {
35
- style?: {
36
- '--sinch-comp-time-picker-header-font'?: string;
37
- '--sinch-comp-time-picker-digit-font-default-h12'?: string;
38
- '--sinch-comp-time-picker-digit-font-checked-h12'?: string;
39
- '--sinch-comp-time-picker-digit-font-default-h24'?: string;
40
- '--sinch-comp-time-picker-digit-font-checked-h24'?: string;
41
- '--sinch-comp-time-picker-digit-font-default-minutes'?: string;
42
- '--sinch-comp-time-picker-digit-font-checked-minutes'?: string;
43
- '--sinch-comp-time-picker-header-color-default-text-initial'?: string;
44
- '--sinch-comp-time-picker-header-color-default-icon-initial'?: string;
45
- '--sinch-comp-time-picker-watch-face-color-default-border-initial'?: string;
46
- '--sinch-comp-time-picker-watch-face-color-default-background-initial'?: string;
47
- '--sinch-comp-time-picker-digit-color-default-h12-initial'?: string;
48
- '--sinch-comp-time-picker-digit-color-checked-h12-default'?: string;
49
- '--sinch-comp-time-picker-digit-color-default-h24-initial'?: string;
50
- '--sinch-comp-time-picker-digit-color-checked-h24-initial'?: string;
51
- '--sinch-comp-time-picker-digit-color-default-minute-initial'?: string;
52
- '--sinch-comp-time-picker-digit-color-checked-minute-initial'?: string;
53
- '--sinch-comp-time-picker-needle-color-default-background-initial'?: string;
54
- '--sinch-comp-time-picker-needle-color-default-background-focus'?: string;
55
- '--sinch-global-color-icon'?: string;
56
- };
21
+ '-change'?: (e: CustomEvent<string>) => void;
22
+ };
23
+ export type TSinchTimePickerStyle = {
24
+ '--sinch-comp-time-picker-header-font'?: string;
25
+ '--sinch-comp-time-picker-digit-font-default-h12'?: string;
26
+ '--sinch-comp-time-picker-digit-font-checked-h12'?: string;
27
+ '--sinch-comp-time-picker-digit-font-default-h24'?: string;
28
+ '--sinch-comp-time-picker-digit-font-checked-h24'?: string;
29
+ '--sinch-comp-time-picker-digit-font-default-minutes'?: string;
30
+ '--sinch-comp-time-picker-digit-font-checked-minutes'?: string;
31
+ '--sinch-comp-time-picker-header-color-default-text-initial'?: string;
32
+ '--sinch-comp-time-picker-header-color-default-icon-initial'?: string;
33
+ '--sinch-comp-time-picker-watch-face-color-default-border-initial'?: string;
34
+ '--sinch-comp-time-picker-watch-face-color-default-background-initial'?: string;
35
+ '--sinch-comp-time-picker-digit-color-default-h12-initial'?: string;
36
+ '--sinch-comp-time-picker-digit-color-checked-h12-default'?: string;
37
+ '--sinch-comp-time-picker-digit-color-default-h24-initial'?: string;
38
+ '--sinch-comp-time-picker-digit-color-checked-h24-initial'?: string;
39
+ '--sinch-comp-time-picker-digit-color-default-minute-initial'?: string;
40
+ '--sinch-comp-time-picker-digit-color-checked-minute-initial'?: string;
41
+ '--sinch-comp-time-picker-needle-color-default-background-initial'?: string;
42
+ '--sinch-comp-time-picker-needle-color-default-background-focus'?: string;
43
+ '--sinch-global-color-icon'?: string;
44
+ };
45
+ export type TSinchTimePicker = {
46
+ props: TSinchTimePickerProps;
47
+ methods: TSinchTimePickerMethods;
48
+ events: TSinchTimePickerEvents;
49
+ style: TSinchTimePickerStyle;
57
50
  };
51
+ export type TSinchTimePickerElement = NectaryComponentVanillaByType<TSinchTimePicker>;
52
+ export type TSinchTimePickerReact = NectaryComponentReactByType<TSinchTimePicker>;
package/title/index.d.ts CHANGED
@@ -1,18 +1,22 @@
1
- import type { TSinchTitleElement, TSinchTitleReact } from './types';
1
+ import type { TSinchTitle } from './types';
2
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-title': TSinchTitle;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-title': TSinchTitleElement;
8
+ 'sinch-title': NectaryComponentVanilla<'sinch-title'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-title': TSinchTitleReact;
12
+ 'sinch-title': NectaryComponentReact<'sinch-title'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-title': TSinchTitleReact;
19
+ 'sinch-title': NectaryComponentReact<'sinch-title'>;
16
20
  }
17
21
  }
18
22
  }
package/title/types.d.ts CHANGED
@@ -1,25 +1,7 @@
1
- import type { TSinchElementReact } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
2
  export type TSinchTitleType = 'xl' | 'l' | 'm' | 's' | 'xs';
3
3
  export type TSinchTitleLevel = '1' | '2' | '3' | '4' | '5' | '6';
4
- export type TSinchTitleElement = HTMLElement & {
5
- /** Text */
6
- text: string;
7
- /** Type */
8
- type: TSinchTitleType;
9
- /** Semantical level */
10
- level: TSinchTitleLevel;
11
- /** Cuts the long title with “…” ellipsis */
12
- ellipsis: boolean;
13
- /** Text */
14
- setAttribute(name: 'text', value: string): void;
15
- /** Type */
16
- setAttribute(name: 'type', value: TSinchTitleType): void;
17
- /** Semantical level */
18
- setAttribute(name: 'level', value: TSinchTitleLevel): void;
19
- /** Cuts the long title with “…” ellipsis */
20
- setAttribute(name: 'ellipsis', value: ''): void;
21
- };
22
- export type TSinchTitleReact = TSinchElementReact<TSinchTitleElement> & {
4
+ export type TSinchTitleProps = {
23
5
  /** Text */
24
6
  text: string;
25
7
  /** Type */
@@ -28,15 +10,20 @@ export type TSinchTitleReact = TSinchElementReact<TSinchTitleElement> & {
28
10
  level: TSinchTitleLevel;
29
11
  /** Cuts the long title with “…” ellipsis */
30
12
  ellipsis?: boolean;
31
- } & {
32
- style?: {
33
- '--sinch-comp-title-font'?: string;
34
- '--sinch-sys-font-desktop-title-xl'?: string;
35
- '--sinch-sys-font-desktop-title-l'?: string;
36
- '--sinch-sys-font-desktop-title-m'?: string;
37
- '--sinch-sys-font-desktop-title-s'?: string;
38
- '--sinch-sys-font-desktop-title-xs'?: string;
39
- '--sinch-global-color-text'?: string;
40
- '--sinch-sys-color-text-default'?: string;
41
- };
42
13
  };
14
+ export type TSinchTitleStyle = {
15
+ '--sinch-comp-title-font'?: string;
16
+ '--sinch-sys-font-desktop-title-xl'?: string;
17
+ '--sinch-sys-font-desktop-title-l'?: string;
18
+ '--sinch-sys-font-desktop-title-m'?: string;
19
+ '--sinch-sys-font-desktop-title-s'?: string;
20
+ '--sinch-sys-font-desktop-title-xs'?: string;
21
+ '--sinch-global-color-text'?: string;
22
+ '--sinch-sys-color-text-default'?: string;
23
+ };
24
+ export type TSinchTitle = {
25
+ props: TSinchTitleProps;
26
+ style: TSinchTitleStyle;
27
+ };
28
+ export type TSinchTitleElement = NectaryComponentVanillaByType<TSinchTitle>;
29
+ export type TSinchTitleReact = NectaryComponentReactByType<TSinchTitle>;
package/toast/index.d.ts CHANGED
@@ -1,20 +1,24 @@
1
1
  import '../icon';
2
2
  import '../rich-text';
3
- import type { TSinchToastElement, TSinchToastReact } from './types';
3
+ import type { TSinchToast } from './types';
4
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
5
  declare global {
6
+ interface NectaryComponentMap {
7
+ 'sinch-toast': TSinchToast;
8
+ }
5
9
  interface HTMLElementTagNameMap {
6
- 'sinch-toast': TSinchToastElement;
10
+ 'sinch-toast': NectaryComponentVanilla<'sinch-toast'>;
7
11
  }
8
12
  namespace JSX {
9
13
  interface IntrinsicElements {
10
- 'sinch-toast': TSinchToastReact;
14
+ 'sinch-toast': NectaryComponentReact<'sinch-toast'>;
11
15
  }
12
16
  }
13
17
  }
14
18
  declare module 'react' {
15
19
  namespace JSX {
16
20
  interface IntrinsicElements {
17
- 'sinch-toast': TSinchToastReact;
21
+ 'sinch-toast': NectaryComponentReact<'sinch-toast'>;
18
22
  }
19
23
  }
20
24
  }
package/toast/types.d.ts CHANGED
@@ -1,48 +1,40 @@
1
- import type { TSinchElementReact } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
2
  export type TSinchToastType = 'info' | 'warn' | 'error' | 'success';
3
- export type TSinchToastElement = HTMLElement & {
4
- /** Type */
5
- type: TSinchToastType;
6
- /** Text */
7
- text: string;
8
- /** Persistent, i.e. doesn't automatically dissapear after 5s */
9
- persistent: boolean;
10
- /** Timeout event */
11
- addEventListener(type: '-timeout', listener: (e: CustomEvent<void>) => void): void;
12
- /** Type */
13
- setAttribute(name: 'type', value: TSinchToastType): void;
14
- /** Text */
15
- setAttribute(name: 'text', value: string): void;
16
- /** Persistent, i.e. doesn't automatically dissapear after 5s */
17
- setAttribute(name: 'persistent', value: ''): void;
18
- };
19
- export type TSinchToastReact = TSinchElementReact<TSinchToastElement> & {
3
+ export type TSinchToastProps = {
20
4
  /** Type */
21
5
  type: TSinchToastType;
22
6
  /** Text */
23
7
  text: string;
24
8
  /** Persistent, i.e. doesn't automatically dissapear after 5s */
25
9
  persistent?: boolean;
10
+ };
11
+ export type TSinchToastEvents = {
26
12
  /** Timeout handler */
27
- 'on-timeout'?: (e: CustomEvent<void>) => void;
28
- } & {
29
- style?: {
30
- '--sinch-comp-toast-shape-radius'?: string;
31
- '--sinch-comp-toast-font-body'?: string;
32
- '--sinch-comp-toast-shadow'?: string;
33
- '--sinch-comp-toast-color-success-default-background'?: string;
34
- '--sinch-comp-toast-color-success-default-text'?: string;
35
- '--sinch-comp-toast-color-success-default-icon'?: string;
36
- '--sinch-comp-toast-color-warning-default-background'?: string;
37
- '--sinch-comp-toast-color-warning-default-text'?: string;
38
- '--sinch-comp-toast-color-warning-default-icon'?: string;
39
- '--sinch-comp-toast-color-error-default-background'?: string;
40
- '--sinch-comp-toast-color-error-default-text'?: string;
41
- '--sinch-comp-toast-color-error-default-icon'?: string;
42
- '--sinch-comp-toast-color-info-default-background'?: string;
43
- '--sinch-comp-toast-color-info-default-text'?: string;
44
- '--sinch-comp-toast-color-info-default-icon'?: string;
45
- '--sinch-global-color-text'?: string;
46
- '--sinch-global-color-icon'?: string;
47
- };
13
+ '-timeout'?: (e: CustomEvent<void>) => void;
14
+ };
15
+ export type TSinchToastStyle = {
16
+ '--sinch-comp-toast-shape-radius'?: string;
17
+ '--sinch-comp-toast-font-body'?: string;
18
+ '--sinch-comp-toast-shadow'?: string;
19
+ '--sinch-comp-toast-color-success-default-background'?: string;
20
+ '--sinch-comp-toast-color-success-default-text'?: string;
21
+ '--sinch-comp-toast-color-success-default-icon'?: string;
22
+ '--sinch-comp-toast-color-warning-default-background'?: string;
23
+ '--sinch-comp-toast-color-warning-default-text'?: string;
24
+ '--sinch-comp-toast-color-warning-default-icon'?: string;
25
+ '--sinch-comp-toast-color-error-default-background'?: string;
26
+ '--sinch-comp-toast-color-error-default-text'?: string;
27
+ '--sinch-comp-toast-color-error-default-icon'?: string;
28
+ '--sinch-comp-toast-color-info-default-background'?: string;
29
+ '--sinch-comp-toast-color-info-default-text'?: string;
30
+ '--sinch-comp-toast-color-info-default-icon'?: string;
31
+ '--sinch-global-color-text'?: string;
32
+ '--sinch-global-color-icon'?: string;
33
+ };
34
+ export type TSinchToast = {
35
+ props: TSinchToastProps;
36
+ events: TSinchToastEvents;
37
+ style: TSinchToastStyle;
48
38
  };
39
+ export type TSinchToastElement = NectaryComponentVanillaByType<TSinchToast>;
40
+ export type TSinchToastReact = NectaryComponentReactByType<TSinchToast>;
@@ -1,20 +1,24 @@
1
1
  import '../title';
2
2
  import '../text';
3
- import type { TSinchToastManagerElement, TSinchToastManagerReact } from './types';
3
+ import type { TSinchToastManager } from './types';
4
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
5
  declare global {
6
+ interface NectaryComponentMap {
7
+ 'sinch-toast-manager': TSinchToastManager;
8
+ }
5
9
  interface HTMLElementTagNameMap {
6
- 'sinch-toast-manager': TSinchToastManagerElement;
10
+ 'sinch-toast-manager': NectaryComponentVanilla<'sinch-toast-manager'>;
7
11
  }
8
12
  namespace JSX {
9
13
  interface IntrinsicElements {
10
- 'sinch-toast-manager': TSinchToastManagerReact;
14
+ 'sinch-toast-manager': NectaryComponentReact<'sinch-toast-manager'>;
11
15
  }
12
16
  }
13
17
  }
14
18
  declare module 'react' {
15
19
  namespace JSX {
16
20
  interface IntrinsicElements {
17
- 'sinch-toast-manager': TSinchToastManagerReact;
21
+ 'sinch-toast-manager': NectaryComponentReact<'sinch-toast-manager'>;
18
22
  }
19
23
  }
20
24
  }
@@ -1,13 +1,16 @@
1
- import type { TRect, TSinchElementReact } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect } from '../types';
2
2
  export type TSinchToastManagerOrigin = 'top-right' | 'bottom-right';
3
- export type TSinchToastManagerElement = HTMLElement & {
4
- readonly containerRect: TRect;
5
- nthActionRect: (nth: number) => TRect | null;
6
- nthCloseRect: (nth: number) => TRect | null;
7
- origin: TSinchToastManagerOrigin;
8
- /** Origin */
9
- setAttribute(name: 'origin', value: TSinchToastManagerOrigin): void;
10
- };
11
- export type TSinchToastManagerReact = TSinchElementReact<TSinchToastManagerElement> & {
3
+ export type TSinchToastManagerProps = {
12
4
  origin?: TSinchToastManagerOrigin;
5
+ readonly containerRect?: TRect;
6
+ };
7
+ export type TSinchToastManagerMethods = {
8
+ nthActionRect(nth: number): TRect | null;
9
+ nthCloseRect(nth: number): TRect | null;
10
+ };
11
+ export type TSinchToastManager = {
12
+ props: TSinchToastManagerProps;
13
+ methods: TSinchToastManagerMethods;
13
14
  };
15
+ export type TSinchToastManagerElement = NectaryComponentVanillaByType<TSinchToastManager>;
16
+ export type TSinchToastManagerReact = NectaryComponentReactByType<TSinchToastManager>;
package/toggle/index.d.ts CHANGED
@@ -1,18 +1,22 @@
1
- import type { TSinchToggleElement, TSinchToggleReact } from './types';
1
+ import type { TSinchToggle } from './types';
2
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
2
3
  declare global {
4
+ interface NectaryComponentMap {
5
+ 'sinch-toggle': TSinchToggle;
6
+ }
3
7
  interface HTMLElementTagNameMap {
4
- 'sinch-toggle': TSinchToggleElement;
8
+ 'sinch-toggle': NectaryComponentVanilla<'sinch-toggle'>;
5
9
  }
6
10
  namespace JSX {
7
11
  interface IntrinsicElements {
8
- 'sinch-toggle': TSinchToggleReact;
12
+ 'sinch-toggle': NectaryComponentReact<'sinch-toggle'>;
9
13
  }
10
14
  }
11
15
  }
12
16
  declare module 'react' {
13
17
  namespace JSX {
14
18
  interface IntrinsicElements {
15
- 'sinch-toggle': TSinchToggleReact;
19
+ 'sinch-toggle': NectaryComponentReact<'sinch-toggle'>;
16
20
  }
17
21
  }
18
22
  }
package/toggle/types.d.ts CHANGED
@@ -1,41 +1,36 @@
1
- import type { TSinchElementReact } from '../types';
2
- export type TSinchToggleElement = HTMLElement & {
3
- checked: boolean;
4
- small: boolean;
5
- labeled: boolean;
6
- disabled: boolean;
7
- text: string | null;
8
- addEventListener(type: '-change', listener: (e: CustomEvent<boolean>) => void): void;
9
- setAttribute(name: 'checked', value: ''): void;
10
- setAttribute(name: 'small', value: ''): void;
11
- setAttribute(name: 'labeled', value: ''): void;
12
- setAttribute(name: 'disabled', value: ''): void;
13
- setAttribute(name: 'text', value: string): void;
14
- };
15
- export type TSinchToggleReact = TSinchElementReact<TSinchToggleElement> & {
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
2
+ export type TSinchToggleProps = {
16
3
  checked?: boolean;
17
4
  small?: boolean;
18
5
  labeled?: boolean;
19
6
  disabled?: boolean;
20
7
  text?: string;
21
8
  'aria-label': string;
22
- 'on-change'?: (e: CustomEvent<boolean>) => void;
23
- } & {
24
- style?: {
25
- '--sinch-local-size'?: string;
26
- '--sinch-comp-toggle-color-default-background-initial'?: string;
27
- '--sinch-comp-toggle-color-default-knob-background-initial'?: string;
28
- '--sinch-comp-toggle-color-default-text-inside-initial'?: string;
29
- '--sinch-comp-toggle-color-default-outline-focus'?: string;
30
- '--sinch-comp-toggle-color-default-label-initial'?: string;
31
- '--sinch-comp-toggle-color-checked-background-initial'?: string;
32
- '--sinch-comp-toggle-color-disabled-background-initial'?: string;
33
- '--sinch-comp-toggle-color-disabled-label-initial'?: string;
34
- '--sinch-comp-toggle-color-checked-disabled-background-initial'?: string;
35
- '--sinch-comp-toggle-shadow-knob-default'?: string;
36
- '--sinch-comp-toggle-shadow-knob-disabled'?: string;
37
- '--sinch-comp-toggle-font-size-m-inside-text'?: string;
38
- '--sinch-comp-toggle-font-size-m-label'?: string;
39
- '--sinch-comp-toggle-font-size-s-label'?: string;
40
- };
41
9
  };
10
+ export type TSinchToggleEvents = {
11
+ '-change'?: (e: CustomEvent<boolean>) => void;
12
+ };
13
+ export type TSinchToggleStyle = {
14
+ '--sinch-local-size'?: string;
15
+ '--sinch-comp-toggle-color-default-background-initial'?: string;
16
+ '--sinch-comp-toggle-color-default-knob-background-initial'?: string;
17
+ '--sinch-comp-toggle-color-default-text-inside-initial'?: string;
18
+ '--sinch-comp-toggle-color-default-outline-focus'?: string;
19
+ '--sinch-comp-toggle-color-default-label-initial'?: string;
20
+ '--sinch-comp-toggle-color-checked-background-initial'?: string;
21
+ '--sinch-comp-toggle-color-disabled-background-initial'?: string;
22
+ '--sinch-comp-toggle-color-disabled-label-initial'?: string;
23
+ '--sinch-comp-toggle-color-checked-disabled-background-initial'?: string;
24
+ '--sinch-comp-toggle-shadow-knob-default'?: string;
25
+ '--sinch-comp-toggle-shadow-knob-disabled'?: string;
26
+ '--sinch-comp-toggle-font-size-m-inside-text'?: string;
27
+ '--sinch-comp-toggle-font-size-m-label'?: string;
28
+ '--sinch-comp-toggle-font-size-s-label'?: string;
29
+ };
30
+ export type TSinchToggle = {
31
+ props: TSinchToggleProps;
32
+ events: TSinchToggleEvents;
33
+ style: TSinchToggleStyle;
34
+ };
35
+ export type TSinchToggleElement = NectaryComponentVanillaByType<TSinchToggle>;
36
+ export type TSinchToggleReact = NectaryComponentReactByType<TSinchToggle>;
@@ -1,20 +1,24 @@
1
1
  import '../text';
2
2
  import '../pop';
3
- import type { TSinchTooltipElement, TSinchTooltipReact } from './types';
3
+ import type { TSinchTooltip } from './types';
4
+ import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
4
5
  declare global {
6
+ interface NectaryComponentMap {
7
+ 'sinch-tooltip': TSinchTooltip;
8
+ }
5
9
  interface HTMLElementTagNameMap {
6
- 'sinch-tooltip': TSinchTooltipElement;
10
+ 'sinch-tooltip': NectaryComponentVanilla<'sinch-tooltip'>;
7
11
  }
8
12
  namespace JSX {
9
13
  interface IntrinsicElements {
10
- 'sinch-tooltip': TSinchTooltipReact;
14
+ 'sinch-tooltip': NectaryComponentReact<'sinch-tooltip'>;
11
15
  }
12
16
  }
13
17
  }
14
18
  declare module 'react' {
15
19
  namespace JSX {
16
20
  interface IntrinsicElements {
17
- 'sinch-tooltip': TSinchTooltipReact;
21
+ 'sinch-tooltip': NectaryComponentReact<'sinch-tooltip'>;
18
22
  }
19
23
  }
20
24
  }