@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.
- package/accordion/index.d.ts +8 -4
- package/accordion/types.d.ts +11 -16
- package/accordion-item/index.d.ts +8 -4
- package/accordion-item/types.d.ts +30 -47
- package/action-menu/index.d.ts +8 -4
- package/action-menu/types.d.ts +7 -8
- package/action-menu-option/index.d.ts +8 -4
- package/action-menu-option/types.d.ts +28 -32
- package/action-menu-option/utils.d.ts +1 -2
- package/alert/index.d.ts +8 -4
- package/alert/types.d.ts +22 -27
- package/avatar/index.d.ts +8 -4
- package/avatar/types.d.ts +25 -42
- package/badge/index.d.ts +8 -4
- package/badge/types.d.ts +18 -32
- package/button/index.d.ts +8 -4
- package/button/types.d.ts +140 -160
- package/button-group/index.d.ts +8 -4
- package/button-group/types.d.ts +10 -9
- package/button-group-item/index.d.ts +8 -4
- package/button-group-item/types.d.ts +42 -42
- package/card/index.d.ts +8 -4
- package/card/types.d.ts +8 -19
- package/card-container/index.d.ts +7 -4
- package/card-container/types.d.ts +2 -2
- package/card-v2/index.d.ts +8 -4
- package/card-v2/types.d.ts +41 -53
- package/card-v2-title/index.d.ts +8 -4
- package/card-v2-title/types.d.ts +21 -33
- package/checkbox/index.d.ts +8 -4
- package/checkbox/types.d.ts +45 -65
- package/chip/index.d.ts +8 -4
- package/chip/types.d.ts +30 -44
- package/code-tag/index.d.ts +8 -4
- package/code-tag/types.d.ts +15 -16
- package/color-menu/index.d.ts +8 -4
- package/color-menu/types.d.ts +15 -22
- package/color-menu-option/index.d.ts +8 -4
- package/color-menu-option/types.d.ts +14 -15
- package/color-swatch/index.d.ts +8 -4
- package/color-swatch/types.d.ts +15 -16
- package/date-picker/index.d.ts +8 -4
- package/date-picker/types.d.ts +50 -79
- package/dialog/index.d.ts +8 -4
- package/dialog/types.d.ts +30 -34
- package/emoji/index.d.ts +8 -4
- package/emoji/types.d.ts +11 -12
- package/emoji-picker/index.d.ts +8 -4
- package/emoji-picker/types.d.ts +25 -18
- package/field/index.d.ts +8 -4
- package/field/types.d.ts +21 -38
- package/file-drop/index.d.ts +8 -4
- package/file-drop/types.d.ts +33 -55
- package/file-picker/index.d.ts +8 -4
- package/file-picker/types.d.ts +12 -22
- package/file-status/index.d.ts +8 -4
- package/file-status/types.d.ts +27 -32
- package/flag/index.d.ts +8 -4
- package/flag/types.d.ts +10 -11
- package/grid/index.d.ts +8 -4
- package/grid/types.d.ts +19 -17
- package/grid-item/index.d.ts +8 -4
- package/grid-item/types.d.ts +7 -12
- package/help-tooltip/index.d.ts +8 -4
- package/help-tooltip/types.d.ts +11 -6
- package/horizontal-stepper/index.d.ts +8 -4
- package/horizontal-stepper/types.d.ts +37 -38
- package/horizontal-stepper-item/index.d.ts +8 -4
- package/horizontal-stepper-item/types.d.ts +30 -39
- package/icon/index.d.ts +8 -4
- package/icon/types.d.ts +18 -28
- package/inline-alert/index.d.ts +8 -4
- package/inline-alert/types.d.ts +30 -33
- package/input/index.d.ts +8 -4
- package/input/types.d.ts +54 -89
- package/link/index.d.ts +8 -4
- package/link/types.d.ts +31 -57
- package/list/index.d.ts +7 -4
- package/list/types.d.ts +2 -2
- package/list-item/index.d.ts +8 -4
- package/list-item/types.d.ts +10 -8
- package/package.json +2 -2
- package/pagination/index.d.ts +8 -4
- package/pagination/types.d.ts +31 -27
- package/persistent-overlay/index.d.ts +8 -4
- package/persistent-overlay/types.d.ts +19 -21
- package/pop/index.d.ts +8 -4
- package/pop/types.d.ts +13 -23
- package/popover/index.d.ts +8 -4
- package/popover/types.d.ts +20 -32
- package/progress/index.d.ts +8 -4
- package/progress/types.d.ts +13 -14
- package/progress-stepper/index.d.ts +8 -4
- package/progress-stepper/types.d.ts +10 -15
- package/progress-stepper-item/index.d.ts +8 -4
- package/progress-stepper-item/types.d.ts +35 -44
- package/radio/index.d.ts +8 -4
- package/radio/types.d.ts +16 -15
- package/radio-option/index.d.ts +8 -4
- package/radio-option/types.d.ts +35 -40
- package/rich-text/index.d.ts +8 -4
- package/rich-text/types.d.ts +31 -31
- package/rich-text/utils.js +1 -1
- package/rich-textarea/index.d.ts +8 -4
- package/rich-textarea/types.d.ts +37 -43
- package/segment/index.d.ts +8 -4
- package/segment/types.d.ts +18 -21
- package/segment-collapse/index.d.ts +8 -4
- package/segment-collapse/types.d.ts +15 -12
- package/segmented-control/index.d.ts +8 -4
- package/segmented-control/types.d.ts +11 -8
- package/segmented-control-option/index.d.ts +8 -4
- package/segmented-control-option/types.d.ts +32 -34
- package/segmented-icon-control/index.d.ts +8 -4
- package/segmented-icon-control/types.d.ts +11 -10
- package/segmented-icon-control-option/index.d.ts +8 -4
- package/segmented-icon-control-option/types.d.ts +28 -28
- package/select-button/index.d.ts +12 -4
- package/select-button/types.d.ts +38 -58
- package/select-menu/index.d.ts +8 -4
- package/select-menu/types.d.ts +18 -38
- package/select-menu-option/index.d.ts +8 -4
- package/select-menu-option/types.d.ts +27 -33
- package/select-menu-option/utils.d.ts +2 -2
- package/skeleton/index.d.ts +8 -4
- package/skeleton/types.d.ts +14 -13
- package/skeleton-item/index.d.ts +8 -4
- package/skeleton-item/types.d.ts +20 -19
- package/spinner/index.d.ts +8 -4
- package/spinner/types.d.ts +12 -13
- package/table/index.d.ts +7 -4
- package/table/types.d.ts +2 -2
- package/table-body/index.d.ts +7 -4
- package/table-body/types.d.ts +2 -2
- package/table-cell/index.d.ts +8 -4
- package/table-cell/types.d.ts +11 -10
- package/table-head/index.d.ts +7 -4
- package/table-head/types.d.ts +2 -2
- package/table-head-cell/index.d.ts +8 -4
- package/table-head-cell/types.d.ts +15 -18
- package/table-row/index.d.ts +8 -4
- package/table-row/types.d.ts +14 -15
- package/tabs/index.d.ts +8 -4
- package/tabs/types.d.ts +19 -16
- package/tabs-icon-option/index.d.ts +8 -4
- package/tabs-icon-option/types.d.ts +21 -26
- package/tabs-option/index.d.ts +8 -4
- package/tabs-option/types.d.ts +26 -35
- package/tag/index.d.ts +9 -4
- package/tag/index.js +18 -1
- package/tag/types.d.ts +24 -31
- package/text/index.d.ts +8 -4
- package/text/types.d.ts +21 -34
- package/textarea/index.d.ts +8 -4
- package/textarea/types.d.ts +30 -56
- package/tile-control/index.d.ts +8 -4
- package/tile-control/types.d.ts +15 -27
- package/tile-control-option/index.d.ts +8 -4
- package/tile-control-option/types.d.ts +41 -55
- package/time-picker/index.d.ts +8 -4
- package/time-picker/types.d.ts +42 -47
- package/title/index.d.ts +8 -4
- package/title/types.d.ts +18 -31
- package/toast/index.d.ts +8 -4
- package/toast/types.d.ts +31 -39
- package/toast-manager/index.d.ts +8 -4
- package/toast-manager/types.d.ts +13 -10
- package/toggle/index.d.ts +8 -4
- package/toggle/types.d.ts +29 -34
- package/tooltip/index.d.ts +8 -4
- package/tooltip/types.d.ts +25 -39
- package/types.d.ts +20 -6
- package/utils/adapters.d.ts +30 -0
- package/utils/adapters.js +1 -0
- package/vertical-stepper/index.d.ts +8 -4
- package/vertical-stepper/types.d.ts +29 -30
- package/vertical-stepper-item/index.d.ts +8 -4
- package/vertical-stepper-item/types.d.ts +34 -43
package/tabs-option/types.d.ts
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
/** Value */
|
|
4
|
-
value: string;
|
|
5
|
-
/** Text */
|
|
6
|
-
text: string;
|
|
7
|
-
/** Disabled */
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
/** Value */
|
|
10
|
-
setAttribute(name: 'value', value: string): void;
|
|
11
|
-
/** Text */
|
|
12
|
-
setAttribute(name: 'text', value: string): void;
|
|
13
|
-
/** Disabled */
|
|
14
|
-
setAttribute(name: 'disabled', value: ''): void;
|
|
15
|
-
};
|
|
16
|
-
export type TSinchTabsOptionReact = TSinchElementReact<TSinchTabsOptionElement> & {
|
|
1
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
2
|
+
export type TSinchTabsOptionProps = {
|
|
17
3
|
/** Value */
|
|
18
4
|
value: string;
|
|
19
5
|
/** Text */
|
|
@@ -22,23 +8,28 @@ export type TSinchTabsOptionReact = TSinchElementReact<TSinchTabsOptionElement>
|
|
|
22
8
|
'aria-label': string;
|
|
23
9
|
/** Disabled */
|
|
24
10
|
disabled?: boolean;
|
|
25
|
-
} & {
|
|
26
|
-
style?: {
|
|
27
|
-
'--sinch-comp-tab-font-label'?: string;
|
|
28
|
-
'--sinch-comp-tab-size-icon'?: string;
|
|
29
|
-
'--sinch-comp-tab-shape-radius'?: string;
|
|
30
|
-
'--sinch-comp-tab-color-default-background-initial'?: string;
|
|
31
|
-
'--sinch-comp-tab-color-default-background-hover'?: string;
|
|
32
|
-
'--sinch-comp-tab-color-default-text-initial'?: string;
|
|
33
|
-
'--sinch-comp-tab-color-default-icon-initial'?: string;
|
|
34
|
-
'--sinch-comp-tab-color-default-outline-focus'?: string;
|
|
35
|
-
'--sinch-comp-tab-color-checked-text-initial'?: string;
|
|
36
|
-
'--sinch-comp-tab-color-checked-icon-initial'?: string;
|
|
37
|
-
'--sinch-comp-tab-color-checked-border-initial'?: string;
|
|
38
|
-
'--sinch-comp-tab-color-disabled-text-initial'?: string;
|
|
39
|
-
'--sinch-comp-tab-color-disabled-icon-initial'?: string;
|
|
40
|
-
'--sinch-global-color-text'?: string;
|
|
41
|
-
'--sinch-global-color-icon'?: string;
|
|
42
|
-
'--sinch-global-size-icon'?: string;
|
|
43
|
-
};
|
|
44
11
|
};
|
|
12
|
+
export type TSinchTabsOptionStyle = {
|
|
13
|
+
'--sinch-comp-tab-font-label'?: string;
|
|
14
|
+
'--sinch-comp-tab-size-icon'?: string;
|
|
15
|
+
'--sinch-comp-tab-shape-radius'?: string;
|
|
16
|
+
'--sinch-comp-tab-color-default-background-initial'?: string;
|
|
17
|
+
'--sinch-comp-tab-color-default-background-hover'?: string;
|
|
18
|
+
'--sinch-comp-tab-color-default-text-initial'?: string;
|
|
19
|
+
'--sinch-comp-tab-color-default-icon-initial'?: string;
|
|
20
|
+
'--sinch-comp-tab-color-default-outline-focus'?: string;
|
|
21
|
+
'--sinch-comp-tab-color-checked-text-initial'?: string;
|
|
22
|
+
'--sinch-comp-tab-color-checked-icon-initial'?: string;
|
|
23
|
+
'--sinch-comp-tab-color-checked-border-initial'?: string;
|
|
24
|
+
'--sinch-comp-tab-color-disabled-text-initial'?: string;
|
|
25
|
+
'--sinch-comp-tab-color-disabled-icon-initial'?: string;
|
|
26
|
+
'--sinch-global-color-text'?: string;
|
|
27
|
+
'--sinch-global-color-icon'?: string;
|
|
28
|
+
'--sinch-global-size-icon'?: string;
|
|
29
|
+
};
|
|
30
|
+
export type TSinchTabsOption = {
|
|
31
|
+
props: TSinchTabsOptionProps;
|
|
32
|
+
style: TSinchTabsOptionStyle;
|
|
33
|
+
};
|
|
34
|
+
export type TSinchTabsOptionElement = NectaryComponentVanillaByType<TSinchTabsOption>;
|
|
35
|
+
export type TSinchTabsOptionReact = NectaryComponentReactByType<TSinchTabsOption>;
|
package/tag/index.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import '../text';
|
|
2
|
-
import
|
|
2
|
+
import '../tooltip';
|
|
3
|
+
import type { TSinchTag } from './types';
|
|
4
|
+
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
3
5
|
declare global {
|
|
6
|
+
interface NectaryComponentMap {
|
|
7
|
+
'sinch-tag': TSinchTag;
|
|
8
|
+
}
|
|
4
9
|
interface HTMLElementTagNameMap {
|
|
5
|
-
'sinch-tag':
|
|
10
|
+
'sinch-tag': NectaryComponentVanilla<'sinch-tag'>;
|
|
6
11
|
}
|
|
7
12
|
namespace JSX {
|
|
8
13
|
interface IntrinsicElements {
|
|
9
|
-
'sinch-tag':
|
|
14
|
+
'sinch-tag': NectaryComponentReact<'sinch-tag'>;
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
declare module 'react' {
|
|
14
19
|
namespace JSX {
|
|
15
20
|
interface IntrinsicElements {
|
|
16
|
-
'sinch-tag':
|
|
21
|
+
'sinch-tag': NectaryComponentReact<'sinch-tag'>;
|
|
17
22
|
}
|
|
18
23
|
}
|
|
19
24
|
}
|
package/tag/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import '../text';
|
|
2
|
+
import '../tooltip';
|
|
2
3
|
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement, isAttrTrue, isAttrEqual } from '../utils';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:var(--sinch-comp-tag-size-container-m);padding:0 9px;border-radius:var(--sinch-comp-tag-shape-radius);background-color:var(--sinch-comp-tag-color-default-background);box-sizing:border-box;user-select:none;--sinch-global-color-text:var(--sinch-comp-tag-color-default-foreground);--sinch-global-color-icon:var(--sinch-comp-tag-color-default-foreground);--sinch-global-size-icon:var(--sinch-comp-tag-size-icon-m)}:host([small]) #wrapper{height:var(--sinch-comp-tag-size-container-s);padding:0 8px;--sinch-global-size-icon:var(--sinch-comp-tag-size-icon-s)}#text{flex:1;--sinch-comp-text-font:var(--sinch-comp-tag-font-size-m-label)}:host([small]) #text{--sinch-comp-text-font:var(--sinch-comp-tag-font-size-s-label)}::slotted(*){margin-left:-4px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="text" type="s" ellipsis></sinch-text></div>';
|
|
4
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}:host([ellipsis]){display:inline}#wrapper{display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:var(--sinch-comp-tag-size-container-m);padding:0 9px;border-radius:var(--sinch-comp-tag-shape-radius);background-color:var(--sinch-comp-tag-color-default-background);box-sizing:border-box;user-select:none;--sinch-global-color-text:var(--sinch-comp-tag-color-default-foreground);--sinch-global-color-icon:var(--sinch-comp-tag-color-default-foreground);--sinch-global-size-icon:var(--sinch-comp-tag-size-icon-m)}:host([small]) #wrapper{height:var(--sinch-comp-tag-size-container-s);padding:0 8px;--sinch-global-size-icon:var(--sinch-comp-tag-size-icon-s)}#text{flex:1;--sinch-comp-text-font:var(--sinch-comp-tag-font-size-m-label)}:host([small]) #text{--sinch-comp-text-font:var(--sinch-comp-tag-font-size-s-label)}::slotted(*){margin-left:-4px}</style><sinch-tooltip id="tooltip" type="fast"><div id="wrapper"><slot name="icon"></slot><sinch-text id="text" type="s" ellipsis></sinch-text></div></sinch-tooltip>';
|
|
4
5
|
import { getTagColorBg, getTagColorFg } from './utils';
|
|
5
6
|
const template = document.createElement('template');
|
|
6
7
|
template.innerHTML = templateHTML;
|
|
7
8
|
defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
8
9
|
#$text;
|
|
10
|
+
#$tooltip;
|
|
9
11
|
#$wrapper;
|
|
10
12
|
constructor() {
|
|
11
13
|
super();
|
|
@@ -13,10 +15,12 @@ defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
|
13
15
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
14
16
|
this.#$wrapper = shadowRoot.querySelector('#wrapper');
|
|
15
17
|
this.#$text = shadowRoot.querySelector('#text');
|
|
18
|
+
this.#$tooltip = shadowRoot.querySelector('#tooltip');
|
|
16
19
|
}
|
|
17
20
|
connectedCallback() {
|
|
18
21
|
super.connectedCallback();
|
|
19
22
|
this.#updateColor();
|
|
23
|
+
this.#updateEllipsisTooltip();
|
|
20
24
|
}
|
|
21
25
|
disconnectedCallback() {
|
|
22
26
|
super.disconnectedCallback();
|
|
@@ -32,6 +36,7 @@ defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
|
32
36
|
}
|
|
33
37
|
set text(value) {
|
|
34
38
|
updateAttribute(this, 'text', value);
|
|
39
|
+
updateAttribute(this.#$tooltip, 'text', value);
|
|
35
40
|
}
|
|
36
41
|
get small() {
|
|
37
42
|
return getBooleanAttribute(this, 'small');
|
|
@@ -55,6 +60,7 @@ defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
|
55
60
|
case 'text':
|
|
56
61
|
{
|
|
57
62
|
this.#$text.textContent = newVal;
|
|
63
|
+
this.#updateEllipsisTooltip();
|
|
58
64
|
break;
|
|
59
65
|
}
|
|
60
66
|
case 'small':
|
|
@@ -81,4 +87,15 @@ defineCustomElement('sinch-tag', class extends NectaryElement {
|
|
|
81
87
|
this.#$wrapper.style.removeProperty('--sinch-global-color-icon');
|
|
82
88
|
}
|
|
83
89
|
}
|
|
90
|
+
#updateEllipsisTooltip() {
|
|
91
|
+
const ellipsis = getBooleanAttribute(this, 'ellipsis');
|
|
92
|
+
requestAnimationFrame(() => {
|
|
93
|
+
const hasOverflow = this.#$text.offsetWidth < this.#$text.scrollWidth;
|
|
94
|
+
if (ellipsis && hasOverflow) {
|
|
95
|
+
updateAttribute(this.#$tooltip, 'text', this.text);
|
|
96
|
+
} else {
|
|
97
|
+
updateAttribute(this.#$tooltip, 'text', '');
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
84
101
|
});
|
package/tag/types.d.ts
CHANGED
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
import type { TSinchTagColor } from './colors';
|
|
2
|
-
import type {
|
|
2
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
3
3
|
export type { TSinchTagColor };
|
|
4
|
-
export type
|
|
5
|
-
/** Text */
|
|
6
|
-
text: string;
|
|
7
|
-
/** Color, gray by default */
|
|
8
|
-
color: TSinchTagColor | null;
|
|
9
|
-
/** Small */
|
|
10
|
-
small: boolean;
|
|
11
|
-
/** Text */
|
|
12
|
-
setAttribute(name: 'text', value: string): void;
|
|
13
|
-
/** Color, gray by default */
|
|
14
|
-
setAttribute(name: 'color', value: string): void;
|
|
15
|
-
/** Small */
|
|
16
|
-
setAttribute(name: 'small', value: ''): void;
|
|
17
|
-
};
|
|
18
|
-
export type TSinchTagReact = TSinchElementReact<TSinchTagElement> & {
|
|
4
|
+
export type TSinchTagProps = {
|
|
19
5
|
/** Text */
|
|
20
6
|
text: string;
|
|
21
7
|
/** Color, gray by default */
|
|
22
8
|
color?: TSinchTagColor;
|
|
23
9
|
/** Small */
|
|
24
10
|
small?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
11
|
+
/** Ellipsis */
|
|
12
|
+
ellipsis?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type TSinchTagStyle = {
|
|
15
|
+
'--sinch-comp-tag-size-container-m'?: string;
|
|
16
|
+
'--sinch-comp-tag-size-container-s'?: string;
|
|
17
|
+
'--sinch-comp-tag-size-icon-m'?: string;
|
|
18
|
+
'--sinch-comp-tag-size-icon-s'?: string;
|
|
19
|
+
'--sinch-comp-tag-shape-radius'?: string;
|
|
20
|
+
'--sinch-comp-tag-font-size-m-label'?: string;
|
|
21
|
+
'--sinch-comp-tag-font-size-s-label'?: string;
|
|
22
|
+
'--sinch-comp-tag-color-default-background'?: string;
|
|
23
|
+
'--sinch-comp-tag-color-default-foreground'?: string;
|
|
24
|
+
'--sinch-global-color-text'?: string;
|
|
25
|
+
'--sinch-global-color-icon'?: string;
|
|
26
|
+
'--sinch-global-size-icon'?: string;
|
|
27
|
+
};
|
|
28
|
+
export type TSinchTag = {
|
|
29
|
+
props: TSinchTagProps;
|
|
30
|
+
style: TSinchTagStyle;
|
|
40
31
|
};
|
|
32
|
+
export type TSinchTagElement = NectaryComponentVanillaByType<TSinchTag>;
|
|
33
|
+
export type TSinchTagReact = NectaryComponentReactByType<TSinchTag>;
|
package/text/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TSinchText } from './types';
|
|
2
|
+
import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
|
|
2
3
|
declare global {
|
|
4
|
+
interface NectaryComponentMap {
|
|
5
|
+
'sinch-text': TSinchText;
|
|
6
|
+
}
|
|
3
7
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'sinch-text':
|
|
8
|
+
'sinch-text': NectaryComponentVanilla<'sinch-text'>;
|
|
5
9
|
}
|
|
6
10
|
namespace JSX {
|
|
7
11
|
interface IntrinsicElements {
|
|
8
|
-
'sinch-text':
|
|
12
|
+
'sinch-text': NectaryComponentReact<'sinch-text'>;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
declare module 'react' {
|
|
13
17
|
namespace JSX {
|
|
14
18
|
interface IntrinsicElements {
|
|
15
|
-
'sinch-text':
|
|
19
|
+
'sinch-text': NectaryComponentReact<'sinch-text'>;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
package/text/types.d.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
2
2
|
export type TSinchTextType = 'm' | 's' | 'xs' | 'xxs';
|
|
3
|
-
export type
|
|
4
|
-
/** Type */
|
|
5
|
-
type: TSinchTextType;
|
|
6
|
-
/** Block (“paragraph”, default) or inline (“span”) */
|
|
7
|
-
inline: boolean;
|
|
8
|
-
/** Emphasized */
|
|
9
|
-
emphasized: boolean;
|
|
10
|
-
/** Cuts the long text with “…” ellipsis */
|
|
11
|
-
ellipsis: boolean;
|
|
12
|
-
/** Type */
|
|
13
|
-
setAttribute(name: 'type', value: TSinchTextType): void;
|
|
14
|
-
/** Block (“paragraph”, default) or inline (“span”) */
|
|
15
|
-
setAttribute(name: 'inline', value: ''): void;
|
|
16
|
-
/** Emphasized */
|
|
17
|
-
setAttribute(name: 'emphasized', value: ''): void;
|
|
18
|
-
/** Cuts the long text with “…” ellipsis */
|
|
19
|
-
setAttribute(name: 'ellipsis', value: ''): void;
|
|
20
|
-
};
|
|
21
|
-
export type TSinchTextReact = TSinchElementReact<TSinchTextElement> & {
|
|
3
|
+
export type TSinchTextProps = {
|
|
22
4
|
/** Type */
|
|
23
5
|
type: TSinchTextType;
|
|
24
6
|
/** Block (“paragraph”, default) or inline (“span”) */
|
|
@@ -27,18 +9,23 @@ export type TSinchTextReact = TSinchElementReact<TSinchTextElement> & {
|
|
|
27
9
|
emphasized?: boolean;
|
|
28
10
|
/** Cuts the long text with “…” ellipsis */
|
|
29
11
|
ellipsis?: boolean;
|
|
30
|
-
} & {
|
|
31
|
-
style?: {
|
|
32
|
-
'--sinch-comp-text-align'?: string;
|
|
33
|
-
'--sinch-comp-text-font'?: string;
|
|
34
|
-
'--sinch-sys-font-body-m'?: string;
|
|
35
|
-
'--sinch-sys-font-body-s'?: string;
|
|
36
|
-
'--sinch-sys-font-body-xs'?: string;
|
|
37
|
-
'--sinch-sys-font-body-xxs'?: string;
|
|
38
|
-
'--sinch-sys-font-body-emphasize'?: string;
|
|
39
|
-
'--sinch-sys-font-body-emphasize-s'?: string;
|
|
40
|
-
'--sinch-global-color-text'?: string;
|
|
41
|
-
'--sinch-sys-color-text-default'?: string;
|
|
42
|
-
'--sinch-global-text-white-space'?: string;
|
|
43
|
-
};
|
|
44
12
|
};
|
|
13
|
+
export type TSinchTextStyle = {
|
|
14
|
+
'--sinch-comp-text-align'?: string;
|
|
15
|
+
'--sinch-comp-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-sys-font-body-emphasize'?: string;
|
|
21
|
+
'--sinch-sys-font-body-emphasize-s'?: string;
|
|
22
|
+
'--sinch-global-color-text'?: string;
|
|
23
|
+
'--sinch-sys-color-text-default'?: string;
|
|
24
|
+
'--sinch-global-text-white-space'?: string;
|
|
25
|
+
};
|
|
26
|
+
export type TSinchText = {
|
|
27
|
+
props: TSinchTextProps;
|
|
28
|
+
style: TSinchTextStyle;
|
|
29
|
+
};
|
|
30
|
+
export type TSinchTextElement = NectaryComponentVanillaByType<TSinchText>;
|
|
31
|
+
export type TSinchTextReact = NectaryComponentReactByType<TSinchText>;
|
package/textarea/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TSinchTextarea } from './types';
|
|
2
|
+
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
2
3
|
declare global {
|
|
4
|
+
interface NectaryComponentMap {
|
|
5
|
+
'sinch-textarea': TSinchTextarea;
|
|
6
|
+
}
|
|
3
7
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'sinch-textarea':
|
|
8
|
+
'sinch-textarea': NectaryComponentVanilla<'sinch-textarea'>;
|
|
5
9
|
}
|
|
6
10
|
namespace JSX {
|
|
7
11
|
interface IntrinsicElements {
|
|
8
|
-
'sinch-textarea':
|
|
12
|
+
'sinch-textarea': NectaryComponentReact<'sinch-textarea'>;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
declare module 'react' {
|
|
13
17
|
namespace JSX {
|
|
14
18
|
interface IntrinsicElements {
|
|
15
|
-
'sinch-textarea':
|
|
19
|
+
'sinch-textarea': NectaryComponentReact<'sinch-textarea'>;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
package/textarea/types.d.ts
CHANGED
|
@@ -1,42 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
/** Value */
|
|
4
|
-
value: string;
|
|
5
|
-
/** Text that appears in the text field when it has no value set */
|
|
6
|
-
placeholder: string | null;
|
|
7
|
-
/** Disabled */
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
/** Invalid state */
|
|
10
|
-
invalid: boolean;
|
|
11
|
-
selectionStart: HTMLTextAreaElement['selectionStart'];
|
|
12
|
-
selectionEnd: HTMLTextAreaElement['selectionEnd'];
|
|
13
|
-
selectionDirection: HTMLTextAreaElement['selectionDirection'];
|
|
14
|
-
/** Number of rows */
|
|
15
|
-
rows: HTMLTextAreaElement['rows'];
|
|
16
|
-
minRows: HTMLTextAreaElement['rows'];
|
|
17
|
-
/** Whether the text field is resizable */
|
|
18
|
-
resizable: boolean;
|
|
19
|
-
/** Change value event */
|
|
20
|
-
addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
|
|
21
|
-
/** Focus event */
|
|
22
|
-
addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
|
|
23
|
-
/** Blur event */
|
|
24
|
-
addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
|
|
25
|
-
/** Value */
|
|
26
|
-
setAttribute(name: 'value', value: string): void;
|
|
27
|
-
/** Text that appears in the text field when it has no value set */
|
|
28
|
-
setAttribute(name: 'placeholder', value: string): void;
|
|
29
|
-
/** Invalid state */
|
|
30
|
-
setAttribute(name: 'invalid', value: ''): void;
|
|
31
|
-
/** Disabled */
|
|
32
|
-
setAttribute(name: 'disabled', value: ''): void;
|
|
33
|
-
/** Number of rows */
|
|
34
|
-
setAttribute(name: 'rows', value: string): void;
|
|
35
|
-
setAttribute(name: 'minrows', value: string): void;
|
|
36
|
-
/** Whether the text field is resizable */
|
|
37
|
-
setAttribute(name: 'resizable', value: ''): void;
|
|
38
|
-
};
|
|
39
|
-
export type TSinchTextareaReact = TSinchElementReact<TSinchTextareaElement> & {
|
|
1
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
2
|
+
export type TSinchTextareaProps = {
|
|
40
3
|
/** Value */
|
|
41
4
|
value: string;
|
|
42
5
|
/** Text that appears in the text field when it has no value set */
|
|
@@ -51,24 +14,35 @@ export type TSinchTextareaReact = TSinchElementReact<TSinchTextareaElement> & {
|
|
|
51
14
|
minRows?: number;
|
|
52
15
|
/** Whether the text field is resizable */
|
|
53
16
|
resizable?: boolean;
|
|
17
|
+
selectionStart?: number;
|
|
18
|
+
selectionEnd?: number;
|
|
19
|
+
selectionDirection?: 'forward' | 'backward' | 'none';
|
|
20
|
+
};
|
|
21
|
+
export type TSinchTextareaEvents = {
|
|
54
22
|
/** Change value handler */
|
|
55
|
-
'
|
|
23
|
+
'-change'?: (e: CustomEvent<string>) => void;
|
|
56
24
|
/** Focus handler */
|
|
57
|
-
'
|
|
25
|
+
'-focus'?: (e: CustomEvent<void>) => void;
|
|
58
26
|
/** Blur handler */
|
|
59
|
-
'
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
27
|
+
'-blur'?: (e: CustomEvent<void>) => void;
|
|
28
|
+
};
|
|
29
|
+
export type TSinchTextareaStyle = {
|
|
30
|
+
'--sinch-comp-textarea-shape-radius'?: string;
|
|
31
|
+
'--sinch-comp-textarea-font-input'?: string;
|
|
32
|
+
'--sinch-comp-textarea-size-resize-handle'?: string;
|
|
33
|
+
'--sinch-comp-textarea-color-default-background-initial'?: string;
|
|
34
|
+
'--sinch-comp-textarea-color-default-text-initial'?: string;
|
|
35
|
+
'--sinch-comp-textarea-color-default-text-placeholder'?: string;
|
|
36
|
+
'--sinch-comp-textarea-color-default-border-initial'?: string;
|
|
37
|
+
'--sinch-comp-textarea-color-default-border-focus'?: string;
|
|
38
|
+
'--sinch-comp-textarea-color-invalid-border-initial'?: string;
|
|
39
|
+
'--sinch-comp-textarea-color-disabled-text-initial'?: string;
|
|
40
|
+
'--sinch-comp-textarea-color-disabled-border-initial'?: string;
|
|
41
|
+
};
|
|
42
|
+
export type TSinchTextarea = {
|
|
43
|
+
props: TSinchTextareaProps;
|
|
44
|
+
events: TSinchTextareaEvents;
|
|
45
|
+
style: TSinchTextareaStyle;
|
|
74
46
|
};
|
|
47
|
+
export type TSinchTextareaElement = NectaryComponentVanillaByType<TSinchTextarea>;
|
|
48
|
+
export type TSinchTextareaReact = NectaryComponentReactByType<TSinchTextarea>;
|
package/tile-control/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TSinchTileControl } from './types';
|
|
2
|
+
import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
|
|
2
3
|
declare global {
|
|
4
|
+
interface NectaryComponentMap {
|
|
5
|
+
'sinch-tile-control': TSinchTileControl;
|
|
6
|
+
}
|
|
3
7
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'sinch-tile-control':
|
|
8
|
+
'sinch-tile-control': NectaryComponentVanilla<'sinch-tile-control'>;
|
|
5
9
|
}
|
|
6
10
|
namespace JSX {
|
|
7
11
|
interface IntrinsicElements {
|
|
8
|
-
'sinch-tile-control':
|
|
12
|
+
'sinch-tile-control': NectaryComponentReact<'sinch-tile-control'>;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
declare module 'react' {
|
|
13
17
|
namespace JSX {
|
|
14
18
|
interface IntrinsicElements {
|
|
15
|
-
'sinch-tile-control':
|
|
19
|
+
'sinch-tile-control': NectaryComponentReact<'sinch-tile-control'>;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
package/tile-control/types.d.ts
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
2
2
|
/** Number of coumns from 1 to 10 */
|
|
3
3
|
export type TSinchTileControlColumns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | number;
|
|
4
|
-
export type
|
|
5
|
-
/** Value */
|
|
6
|
-
value: string;
|
|
7
|
-
/** Small */
|
|
8
|
-
small: boolean;
|
|
9
|
-
/** Multiple */
|
|
10
|
-
multiple: boolean;
|
|
11
|
-
/** Number of columns from 1 to 10 */
|
|
12
|
-
cols: TSinchTileControlColumns;
|
|
13
|
-
/** Change value event */
|
|
14
|
-
addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
|
|
15
|
-
/** Value */
|
|
16
|
-
setAttribute(name: 'value', value: string): void;
|
|
17
|
-
/** Small */
|
|
18
|
-
setAttribute(name: 'small', value: ''): void;
|
|
19
|
-
/** Multiple */
|
|
20
|
-
setAttribute(name: 'multiple', value: ''): void;
|
|
21
|
-
/** Number of columns from 1 to 10 */
|
|
22
|
-
setAttribute(name: 'cols', value: string): void;
|
|
23
|
-
};
|
|
24
|
-
export type TSinchTileControlReact = TSinchElementReact<TSinchTileControlElement> & {
|
|
4
|
+
export type TSinchTileControlProps = {
|
|
25
5
|
/** Value */
|
|
26
6
|
value: string;
|
|
27
7
|
/** Multiple */
|
|
@@ -32,10 +12,18 @@ export type TSinchTileControlReact = TSinchElementReact<TSinchTileControlElement
|
|
|
32
12
|
cols: TSinchTileControlColumns;
|
|
33
13
|
/** Label that is used for a11y */
|
|
34
14
|
'aria-label': string;
|
|
15
|
+
};
|
|
16
|
+
export type TSinchTileControlEvents = {
|
|
35
17
|
/** Change value handler */
|
|
36
|
-
'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
'-change'?: (e: CustomEvent<string>) => void;
|
|
19
|
+
};
|
|
20
|
+
export type TSinchTileControlStyle = {
|
|
21
|
+
'--sinch-grid-num-columns'?: string;
|
|
22
|
+
};
|
|
23
|
+
export type TSinchTileControl = {
|
|
24
|
+
props: TSinchTileControlProps;
|
|
25
|
+
events: TSinchTileControlEvents;
|
|
26
|
+
style: TSinchTileControlStyle;
|
|
41
27
|
};
|
|
28
|
+
export type TSinchTileControlElement = NectaryComponentVanillaByType<TSinchTileControl>;
|
|
29
|
+
export type TSinchTileControlReact = NectaryComponentReactByType<TSinchTileControl>;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TSinchTileControlOption } from './types';
|
|
2
|
+
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
2
3
|
declare global {
|
|
4
|
+
interface NectaryComponentMap {
|
|
5
|
+
'sinch-tile-control-option': TSinchTileControlOption;
|
|
6
|
+
}
|
|
3
7
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'sinch-tile-control-option':
|
|
8
|
+
'sinch-tile-control-option': NectaryComponentVanilla<'sinch-tile-control-option'>;
|
|
5
9
|
}
|
|
6
10
|
namespace JSX {
|
|
7
11
|
interface IntrinsicElements {
|
|
8
|
-
'sinch-tile-control-option':
|
|
12
|
+
'sinch-tile-control-option': NectaryComponentReact<'sinch-tile-control-option'>;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
declare module 'react' {
|
|
13
17
|
namespace JSX {
|
|
14
18
|
interface IntrinsicElements {
|
|
15
|
-
'sinch-tile-control-option':
|
|
19
|
+
'sinch-tile-control-option': NectaryComponentReact<'sinch-tile-control-option'>;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|