@nectary/components 1.3.3 → 2.0.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.js +0 -3
- package/accordion/types.d.ts +0 -3
- package/accordion-item/index.d.ts +2 -0
- package/accordion-item/index.js +33 -34
- package/action-menu-option/index.js +2 -2
- package/alert/index.js +2 -12
- package/avatar/index.js +1 -1
- package/avatar/utils.js +3 -3
- package/badge/index.js +41 -67
- package/badge/types.d.ts +0 -4
- package/badge/utils.d.ts +0 -3
- package/badge/utils.js +0 -11
- package/button/index.js +1 -1
- package/button/types.d.ts +2 -2
- package/card/index.js +5 -16
- package/card/types.d.ts +0 -6
- package/card-container/index.js +1 -1
- package/chat-block/index.js +1 -1
- package/chat-bubble/index.js +3 -24
- package/checkbox/index.js +31 -30
- package/checkbox/types.d.ts +0 -3
- package/chip/index.js +34 -27
- package/chip/utils.js +3 -3
- package/code-tag/index.js +1 -1
- package/color-menu/index.d.ts +0 -3
- package/color-menu/index.js +50 -99
- package/color-menu/types.d.ts +0 -4
- package/color-menu-option/index.d.ts +14 -0
- package/color-menu-option/index.js +52 -0
- package/color-menu-option/types.d.ts +9 -0
- package/color-menu-option/utils.d.ts +1 -0
- package/color-menu-option/utils.js +11 -0
- package/color-swatch/index.js +1 -1
- package/color-swatch/utils.js +3 -3
- package/date-picker/index.js +2 -24
- package/date-picker/types.d.ts +0 -3
- package/dialog/index.js +2 -5
- package/dialog/types.d.ts +0 -2
- package/emoji/index.js +1 -1
- package/emoji-picker/index.d.ts +1 -0
- package/emoji-picker/index.js +32 -23
- package/field/index.js +39 -32
- package/file-drop/index.js +1 -1
- package/file-status/index.js +2 -16
- package/flag/index.js +1 -1
- package/grid/index.js +1 -1
- package/help-tooltip/index.js +3 -12
- package/horizontal-stepper/index.js +1 -1
- package/horizontal-stepper-item/index.d.ts +2 -0
- package/horizontal-stepper-item/index.js +8 -12
- package/icon/index.js +1 -1
- package/icon-button/index.js +1 -1
- package/inline-alert/index.js +19 -29
- package/input/index.d.ts +0 -3
- package/input/index.js +12 -46
- package/input/types.d.ts +1 -5
- package/link/index.js +35 -37
- package/list-item/index.js +1 -1
- package/package.json +10 -10
- package/pagination/index.js +8 -21
- package/pagination/types.d.ts +0 -3
- package/pop/index.js +16 -13
- package/popover/index.js +44 -50
- package/progress/index.js +20 -15
- package/radio/index.js +19 -6
- package/radio/types.d.ts +3 -3
- package/radio-option/index.js +35 -27
- package/rich-text/index.js +1 -1
- package/segment/index.js +2 -3
- package/segment-collapse/index.js +2 -11
- package/segment-collapse/types.d.ts +0 -3
- package/segmented-control/index.js +0 -3
- package/segmented-control/types.d.ts +0 -3
- package/segmented-control-option/index.js +20 -19
- package/segmented-icon-control/index.js +1 -4
- package/segmented-icon-control/types.d.ts +0 -3
- package/segmented-icon-control-option/index.js +18 -14
- package/select-button/index.js +7 -12
- package/select-menu/index.js +12 -5
- package/select-menu-option/index.js +2 -5
- package/skeleton/index.js +1 -1
- package/skeleton-item/index.js +1 -1
- package/spinner/index.js +1 -1
- package/table/index.js +1 -1
- package/table-body/index.js +1 -1
- package/table-cell/index.js +1 -1
- package/table-head-cell/index.d.ts +1 -0
- package/table-head-cell/index.js +12 -3
- package/table-row/index.js +18 -2
- package/tabs/index.js +1 -4
- package/tabs/types.d.ts +0 -3
- package/tabs-icon-option/index.js +4 -2
- package/tabs-option/index.js +25 -20
- package/tag/index.js +16 -8
- package/tag/utils.js +3 -3
- package/text/index.js +30 -20
- package/textarea/index.js +10 -6
- package/textarea/types.d.ts +0 -3
- package/tile-control/index.js +23 -25
- package/tile-control/types.d.ts +0 -3
- package/tile-control-option/index.js +1 -1
- package/time-picker/index.js +2 -8
- package/time-picker/types.d.ts +0 -3
- package/title/index.js +30 -22
- package/toast/index.js +20 -30
- package/toggle/index.js +33 -30
- package/toggle/types.d.ts +0 -3
- package/tooltip/index.js +41 -30
- package/tooltip/tooltip-state.d.ts +1 -0
- package/tooltip/tooltip-state.js +6 -0
- package/tooltip/types.d.ts +7 -12
- package/tooltip/utils.d.ts +4 -1
- package/tooltip/utils.js +7 -1
- package/vertical-stepper/index.js +1 -1
- package/vertical-stepper-item/index.d.ts +2 -0
- package/vertical-stepper-item/index.js +8 -12
- package/logo/create-logo-class.d.ts +0 -1
- package/logo/create-logo-class.js +0 -52
- package/logo/engage-icon/index.d.ts +0 -11
- package/logo/engage-icon/index.js +0 -4
- package/logo/engage-icon-wordmark/index.d.ts +0 -11
- package/logo/engage-icon-wordmark/index.js +0 -4
- package/logo/sinch-icon/index.d.ts +0 -11
- package/logo/sinch-icon/index.js +0 -4
- package/logo/sinch-icon-wordmark/index.d.ts +0 -11
- package/logo/sinch-icon-wordmark/index.js +0 -4
- package/logo/types.d.ts +0 -11
- package/theme/accordion-item.css +0 -4
- package/theme/alert.css +0 -6
- package/theme/avatar.css +0 -25
- package/theme/badge.css +0 -15
- package/theme/button.css +0 -146
- package/theme/chat.css +0 -9
- package/theme/chip.css +0 -68
- package/theme/color-menu.css +0 -4
- package/theme/color-swatch.css +0 -71
- package/theme/colors.d.ts +0 -4
- package/theme/colors.js +0 -4
- package/theme/contextual.css +0 -40
- package/theme/date-picker.css +0 -7
- package/theme/dialog.css +0 -4
- package/theme/elevation.css +0 -7
- package/theme/emoji-picker.css +0 -13
- package/theme/emoji.css +0 -5
- package/theme/file-status.css +0 -7
- package/theme/flag.css +0 -4
- package/theme/fonts.css +0 -86
- package/theme/fonts.json +0 -89
- package/theme/help-tooltip.css +0 -5
- package/theme/horizontal-stepper.css +0 -5
- package/theme/icon-button.css +0 -68
- package/theme/icon.css +0 -7
- package/theme/index.css +0 -4
- package/theme/index.d.ts +0 -39
- package/theme/index.js +0 -39
- package/theme/inline-alert.css +0 -7
- package/theme/input.css +0 -10
- package/theme/link.css +0 -5
- package/theme/pagination.css +0 -5
- package/theme/palette.css +0 -90
- package/theme/segment.css +0 -4
- package/theme/select-button.css +0 -10
- package/theme/select-menu.css +0 -6
- package/theme/shapes.css +0 -8
- package/theme/size.css +0 -9
- package/theme/spinner.css +0 -7
- package/theme/tag.css +0 -67
- package/theme/time-picker.css +0 -4
- package/theme/toast.css +0 -7
- package/theme/typography.css +0 -16
- package/theme/vertical-stepper.css +0 -5
- /package/{logo → color-menu-option}/types.js +0 -0
package/chat-bubble/index.js
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
import '../icon';
|
|
2
|
-
import { defineCustomElement, getAttribute,
|
|
3
|
-
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;padding:12px 16px;border-radius:16px;max-width:595px;box-sizing:border-box}:host([data-type=customer])>#wrapper{background-color:var(--sinch-color-
|
|
2
|
+
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
3
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;padding:12px 16px;border-radius:16px;max-width:595px;box-sizing:border-box}:host([data-type=customer])>#wrapper{background-color:var(--sinch-sys-color-container-contrast-primary-default);border-top-left-radius:0}:host([data-type=agent-prev])>#wrapper{background-color:var(--sinch-sys-color-container-contrast-primary-active);border-top-right-radius:0}:host([data-type=agent])>#wrapper{background-color:var(--sinch-sys-color-container-complement-primary-hover);border-top-right-radius:0}#text{--sinch-global-color-text:var(--sinch-sys-color-text-default)}#icon-error,#icon-received,#icon-seen,#icon-sending,#icon-sent{display:none;position:absolute;right:16px;bottom:12px;--sinch-global-size-icon:16px;--sinch-comp-icon-font-variation-settings:"FILL" 0}#icon-sending{--sinch-global-color-icon:var(--sinch-sys-color-text-default)}#icon-sent{--sinch-global-color-icon:var(--sinch-sys-color-text-default)}#icon-received{--sinch-global-color-icon:var(--sinch-sys-color-text-default)}#icon-seen{--sinch-global-color-icon:var(--sinch-sys-color-feedback-success-contrast)}#icon-error{--sinch-global-color-icon:var(--sinch-sys-color-feedback-invalid-contrast)}:host([status=error]) #icon-error,:host([status=received]) #icon-received,:host([status=seen]) #icon-seen,:host([status=sending]) #icon-sending,:host([status=sent]) #icon-sent{display:block}:host([status]:not([status=""])) #wrapper{padding-right:42px}</style><div id="wrapper"><sinch-text id="text" type="m"></sinch-text><sinch-icon id="icon-sending" name="query_builder"></sinch-icon><sinch-icon id="icon-sent" name="check"></sinch-icon><sinch-icon id="icon-received" name="done_all"></sinch-icon><sinch-icon id="icon-seen" name="done_all"></sinch-icon><sinch-icon id="icon-error" name="error_outline"></sinch-icon></div>';
|
|
4
4
|
import { statusValues, typeValues } from './utils';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
7
|
defineCustomElement('sinch-chat-bubble', class extends NectaryElement {
|
|
8
8
|
#$text;
|
|
9
|
-
#$icon;
|
|
10
9
|
constructor() {
|
|
11
10
|
super();
|
|
12
11
|
const shadowRoot = this.attachShadow();
|
|
13
12
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
14
13
|
this.#$text = shadowRoot.querySelector('#text');
|
|
15
|
-
this.#$icon = shadowRoot.querySelector('#icon');
|
|
16
|
-
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback();
|
|
19
|
-
this.#updateIcon();
|
|
20
|
-
}
|
|
21
|
-
disconnectedCallback() {
|
|
22
|
-
super.disconnectedCallback();
|
|
23
14
|
}
|
|
24
15
|
static get observedAttributes() {
|
|
25
|
-
return ['text'
|
|
16
|
+
return ['text'];
|
|
26
17
|
}
|
|
27
18
|
attributeChangedCallback(name, _, newVal) {
|
|
28
19
|
switch (name) {
|
|
@@ -31,11 +22,6 @@ defineCustomElement('sinch-chat-bubble', class extends NectaryElement {
|
|
|
31
22
|
this.#$text.textContent = newVal;
|
|
32
23
|
break;
|
|
33
24
|
}
|
|
34
|
-
case 'status':
|
|
35
|
-
{
|
|
36
|
-
this.#updateIcon();
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
25
|
}
|
|
40
26
|
}
|
|
41
27
|
set text(value) {
|
|
@@ -53,11 +39,4 @@ defineCustomElement('sinch-chat-bubble', class extends NectaryElement {
|
|
|
53
39
|
get status() {
|
|
54
40
|
return getLiteralAttribute(this, statusValues, 'status', null);
|
|
55
41
|
}
|
|
56
|
-
#updateIcon() {
|
|
57
|
-
if (!this.isConnected) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const status = this.status;
|
|
61
|
-
updateAttribute(this.#$icon, 'name', status !== null ? getCssVar(this, `--sinch-chat-icon-${status}`) : null);
|
|
62
|
-
}
|
|
63
42
|
});
|
package/checkbox/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
2
|
-
const templateHTML = '<style>:host{
|
|
2
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;flex-direction:row;box-sizing:border-box;width:100%;--sinch-local-size:24px;--sinch-local-color-background:var(--sinch-comp-checkbox-color-default-background-initial);--sinch-local-color-background-hover:var(--sinch-comp-checkbox-color-default-background-hover);--sinch-local-color-background-active:var(--sinch-comp-checkbox-color-default-background-active);--sinch-local-color-border:var(--sinch-comp-checkbox-color-default-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-checkbox-color-default-border-hover);--sinch-local-color-border-active:var(--sinch-comp-checkbox-color-default-border-active);--sinch-local-color-text:var(--sinch-comp-checkbox-color-default-text-initial)}:host([invalid])>#wrapper{--sinch-local-color-background:var(--sinch-comp-checkbox-color-invalid-background-initial);--sinch-local-color-background-hover:var(--sinch-comp-checkbox-color-invalid-background-hover);--sinch-local-color-background-active:var(--sinch-comp-checkbox-color-invalid-background-active);--sinch-local-color-border:var(--sinch-comp-checkbox-color-invalid-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-checkbox-color-invalid-border-hover);--sinch-local-color-border-active:var(--sinch-comp-checkbox-color-invalid-border-active);--sinch-local-color-text:var(--sinch-comp-checkbox-color-invalid-text-initial)}:host([checked])>#wrapper{--sinch-local-color-background:var(--sinch-comp-checkbox-color-checked-background-initial);--sinch-local-color-background-hover:var(--sinch-comp-checkbox-color-checked-background-hover);--sinch-local-color-background-active:var(--sinch-comp-checkbox-color-checked-background-active);--sinch-local-color-border:var(--sinch-comp-checkbox-color-checked-border-initial);--sinch-local-color-border-hover:var(--sinch-comp-checkbox-color-checked-border-hover);--sinch-local-color-border-active:var(--sinch-comp-checkbox-color-checked-border-active)}:host([disabled])>#wrapper{--sinch-local-color-background:var(--sinch-comp-checkbox-color-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-checkbox-color-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-checkbox-color-disabled-text-initial)}:host([disabled][checked])>#wrapper{--sinch-local-color-background:var(--sinch-comp-checkbox-color-checked-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-checkbox-color-checked-disabled-border-initial)}#checkbox{all:initial;display:block;width:var(--sinch-local-size);height:var(--sinch-local-size);cursor:pointer}#checkbox:disabled{cursor:initial}#icon-container{position:relative;width:var(--sinch-local-size);height:var(--sinch-local-size);align-self:flex-start}#checkbox::before{content:"";position:absolute;top:0;left:0;width:var(--sinch-local-size);height:var(--sinch-local-size);border:2px solid var(--sinch-comp-checkbox-color-default-outline-focus);border-radius:calc(var(--sinch-comp-checkbox-shape-radius) + 3px);transition:opacity .1s linear;opacity:0;box-sizing:border-box;pointer-events:none}#checkbox:focus-visible::before{opacity:1}#checkbox::after{content:"";position:absolute;width:18px;height:18px;inset:0;margin:auto;background-color:var(--sinch-local-color-background);border:2px solid var(--sinch-local-color-border);border-radius:var(--sinch-comp-checkbox-shape-radius);transition:background-color .1s linear;box-sizing:border-box;pointer-events:none}#checkbox:enabled:hover::after{background-color:var(--sinch-local-color-background-hover);border-color:var(--sinch-local-color-border-hover)}#checkbox:enabled:active::after{background-color:var(--sinch-local-color-background-active);border-color:var(--sinch-local-color-border-active)}#icon-checkmark,#icon-indeterminate{position:absolute;left:4px;top:4px;width:16px;height:16px;transition:opacity .1s linear;opacity:0;pointer-events:none;fill:var(--sinch-sys-color-container-main-default)}@media (prefers-reduced-motion){#checkbox::after,#checkbox::before,#icon-checkmark,#icon-indeterminate{transition:none}}#label{display:none;flex:1;align-self:center;padding-left:7px;font:var(--sinch-comp-checkbox-font-label);color:var(--sinch-local-color-text);cursor:pointer}:host([disabled]) #label{cursor:initial}:host([text]:not([text=""])) #label{display:block}:host(:not([indeterminate])) #checkbox:checked~#icon-checkmark{opacity:1}:host([indeterminate]) #checkbox:checked~#icon-indeterminate{opacity:1}</style><div id="wrapper"><div id="icon-container"><input id="checkbox" type="checkbox"/><svg id="icon-checkmark" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 16.17 5.53 12.7a.996.996 0 1 0-1.41 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71a.996.996 0 1 0-1.41-1.41L9 16.17Z"/></svg><svg id="icon-indeterminate" viewBox="0 0 24 24" aria-hidden="true"><path d="M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1Z"/></svg></div><label for="checkbox" id="label"></label></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
5
|
defineCustomElement('sinch-checkbox', class extends NectaryElement {
|
|
@@ -32,13 +32,37 @@ defineCustomElement('sinch-checkbox', class extends NectaryElement {
|
|
|
32
32
|
this.removeEventListener('-blur', this.#onBlurReactHandler);
|
|
33
33
|
}
|
|
34
34
|
static get observedAttributes() {
|
|
35
|
-
return ['checked', 'disabled', 'text'];
|
|
35
|
+
return ['checked', 'disabled', 'text', 'invalid', 'indeterminate'];
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
attributeChangedCallback(name, _, newVal) {
|
|
38
|
+
switch (name) {
|
|
39
|
+
case 'text':
|
|
40
|
+
{
|
|
41
|
+
this.#$label.textContent = newVal;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case 'checked':
|
|
45
|
+
{
|
|
46
|
+
const isChecked = isAttrTrue(newVal);
|
|
47
|
+
this.#$input.checked = isChecked;
|
|
48
|
+
updateExplicitBooleanAttribute(this, 'aria-checked', isChecked);
|
|
49
|
+
updateBooleanAttribute(this, 'checked', isChecked);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 'disabled':
|
|
53
|
+
{
|
|
54
|
+
const isDisabled = isAttrTrue(newVal);
|
|
55
|
+
this.#$input.disabled = isDisabled;
|
|
56
|
+
updateBooleanAttribute(this, 'disabled', isDisabled);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case 'invalid':
|
|
60
|
+
case 'indeterminate':
|
|
61
|
+
{
|
|
62
|
+
updateBooleanAttribute(this, name, isAttrTrue(newVal));
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
42
66
|
}
|
|
43
67
|
set checked(isChecked) {
|
|
44
68
|
updateBooleanAttribute(this, 'checked', isChecked);
|
|
@@ -70,29 +94,6 @@ defineCustomElement('sinch-checkbox', class extends NectaryElement {
|
|
|
70
94
|
get text() {
|
|
71
95
|
return getAttribute(this, 'text');
|
|
72
96
|
}
|
|
73
|
-
attributeChangedCallback(name, _, newVal) {
|
|
74
|
-
switch (name) {
|
|
75
|
-
case 'text':
|
|
76
|
-
{
|
|
77
|
-
this.#$label.textContent = newVal;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case 'checked':
|
|
81
|
-
{
|
|
82
|
-
const isChecked = isAttrTrue(newVal);
|
|
83
|
-
this.#$input.checked = isChecked;
|
|
84
|
-
updateExplicitBooleanAttribute(this, 'aria-checked', isChecked);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
case 'disabled':
|
|
88
|
-
{
|
|
89
|
-
const isDisabled = isAttrTrue(newVal);
|
|
90
|
-
this.#$input.disabled = isDisabled;
|
|
91
|
-
updateBooleanAttribute(this, 'disabled', isDisabled);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
97
|
get focusable() {
|
|
97
98
|
return true;
|
|
98
99
|
}
|
package/checkbox/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
import type { SyntheticEvent } from 'react';
|
|
3
2
|
export type TSinchCheckboxElement = HTMLElement & {
|
|
4
3
|
/** Value */
|
|
5
4
|
checked: boolean;
|
|
@@ -41,8 +40,6 @@ export type TSinchCheckboxReact = TSinchElementReact<TSinchCheckboxElement> & {
|
|
|
41
40
|
text?: string;
|
|
42
41
|
/** Label that is used for a11y – might be different from `label` */
|
|
43
42
|
'aria-label': string;
|
|
44
|
-
/** @deprecated */
|
|
45
|
-
onChange?: (event: SyntheticEvent<TSinchCheckboxElement, CustomEvent<boolean>>) => void;
|
|
46
43
|
/** Change value handler */
|
|
47
44
|
'on-change'?: (e: CustomEvent<boolean>) => void;
|
|
48
45
|
/** Focus handler */
|
package/chip/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import '../text';
|
|
2
2
|
import '../icon';
|
|
3
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement, getReactEventHandler,
|
|
4
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:
|
|
3
|
+
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement, getReactEventHandler, isAttrTrue } from '../utils';
|
|
4
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;height:var(--sinch-comp-chip-size-container-m);padding:0 5px 0 9px;border-radius:var(--sinch-comp-chip-shape-radius);background-color:var(--sinch-comp-chip-color-neutral-default-background-initial);box-sizing:border-box;cursor:pointer;--sinch-global-color-text:var(--sinch-comp-chip-color-neutral-default-foreground-initial);--sinch-global-color-icon:var(--sinch-comp-chip-color-neutral-default-foreground-initial);--sinch-global-size-icon:var(--sinch-comp-chip-size-icon-m)}#button:focus-visible::after{content:"";position:absolute;inset:-4px;border-radius:calc(var(--sinch-comp-chip-shape-radius) + 4px);border:2px solid var(--sinch-comp-chip-color-outiline-focus);pointer-events:none}#text{flex:1;--sinch-comp-text-font:var(--sinch-comp-chip-font-size-m-label)}:host([small]) #button{height:var(--sinch-comp-chip-size-container-s);padding:0 3px 0 7px;--sinch-global-size-icon:var(--sinch-comp-chip-size-icon-s)}:host([small]) #text{--sinch-comp-text-font:var(--sinch-comp-chip-font-size-s-label)}::slotted(*){margin-left:-4px}</style><button id="button"><slot name="icon"></slot><sinch-text id="text" type="xs" ellipsis></sinch-text><sinch-icon id="icon-close" name="cancel"></sinch-icon></button>';
|
|
5
5
|
import { assertChipColor, getChipColorBg, getChipColorFg } from './utils';
|
|
6
6
|
const template = document.createElement('template');
|
|
7
7
|
template.innerHTML = templateHTML;
|
|
8
8
|
defineCustomElement('sinch-chip', class extends NectaryElement {
|
|
9
9
|
#$text;
|
|
10
10
|
#$button;
|
|
11
|
-
#$iconClose;
|
|
12
11
|
#controller = null;
|
|
13
12
|
constructor() {
|
|
14
13
|
super();
|
|
15
|
-
const shadowRoot = this.attachShadow(
|
|
14
|
+
const shadowRoot = this.attachShadow({
|
|
15
|
+
delegatesFocus: true
|
|
16
|
+
});
|
|
16
17
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
17
18
|
this.#$button = shadowRoot.querySelector('#button');
|
|
18
19
|
this.#$text = shadowRoot.querySelector('#text');
|
|
19
|
-
this.#$iconClose = shadowRoot.querySelector('#icon-close');
|
|
20
20
|
}
|
|
21
21
|
connectedCallback() {
|
|
22
22
|
super.connectedCallback();
|
|
@@ -43,13 +43,37 @@ defineCustomElement('sinch-chip', class extends NectaryElement {
|
|
|
43
43
|
this.addEventListener('-blur', this.#onBlurReactHandler, {
|
|
44
44
|
signal
|
|
45
45
|
});
|
|
46
|
-
updateAttribute(this.#$iconClose, 'name', getCssVar(this, '--sinch-chip-icon-close'));
|
|
47
46
|
this.#updateColor();
|
|
48
47
|
}
|
|
49
48
|
disconnectedCallback() {
|
|
50
49
|
super.disconnectedCallback();
|
|
51
50
|
this.#controller.abort();
|
|
52
51
|
}
|
|
52
|
+
static get observedAttributes() {
|
|
53
|
+
return ['text', 'color', 'small'];
|
|
54
|
+
}
|
|
55
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
56
|
+
if (oldVal === newVal) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
switch (name) {
|
|
60
|
+
case 'color':
|
|
61
|
+
{
|
|
62
|
+
this.#updateColor();
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case 'text':
|
|
66
|
+
{
|
|
67
|
+
this.#$text.textContent = newVal;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case 'small':
|
|
71
|
+
{
|
|
72
|
+
updateBooleanAttribute(this, name, isAttrTrue(newVal));
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
53
77
|
get color() {
|
|
54
78
|
return getAttribute(this, 'color');
|
|
55
79
|
}
|
|
@@ -68,23 +92,6 @@ defineCustomElement('sinch-chip', class extends NectaryElement {
|
|
|
68
92
|
set small(isSmall) {
|
|
69
93
|
updateBooleanAttribute(this, 'small', isSmall);
|
|
70
94
|
}
|
|
71
|
-
static get observedAttributes() {
|
|
72
|
-
return ['text', 'color'];
|
|
73
|
-
}
|
|
74
|
-
attributeChangedCallback(name, _, newVal) {
|
|
75
|
-
switch (name) {
|
|
76
|
-
case 'color':
|
|
77
|
-
{
|
|
78
|
-
this.#updateColor();
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
case 'text':
|
|
82
|
-
{
|
|
83
|
-
this.#$text.textContent = newVal;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
95
|
#updateColor() {
|
|
89
96
|
if (!this.isConnected) {
|
|
90
97
|
return;
|
|
@@ -97,12 +104,12 @@ defineCustomElement('sinch-chip', class extends NectaryElement {
|
|
|
97
104
|
const bg = getChipColorBg(colorName);
|
|
98
105
|
const fg = getChipColorFg(colorName);
|
|
99
106
|
this.#$button.style.setProperty('background-color', bg);
|
|
100
|
-
this.#$button.style.setProperty('color', fg);
|
|
101
|
-
this.#$button.style.setProperty('--sinch-color-icon', fg);
|
|
107
|
+
this.#$button.style.setProperty('--sinch-global-color-text', fg);
|
|
108
|
+
this.#$button.style.setProperty('--sinch-global-color-icon', fg);
|
|
102
109
|
} else {
|
|
103
110
|
this.#$button.style.removeProperty('background-color');
|
|
104
|
-
this.#$button.style.removeProperty('color');
|
|
105
|
-
this.#$button.style.removeProperty('--sinch-color-icon');
|
|
111
|
+
this.#$button.style.removeProperty('--sinch-global-color-text');
|
|
112
|
+
this.#$button.style.removeProperty('--sinch-global-color-icon');
|
|
106
113
|
}
|
|
107
114
|
}
|
|
108
115
|
get focusable() {
|
package/chip/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const getChipColorBg = id => {
|
|
2
|
-
return `var(--sinch-chip-color-${id}-
|
|
2
|
+
return `var(--sinch-comp-chip-color-${id}-default-background-initial)`;
|
|
3
3
|
};
|
|
4
4
|
export const getChipColorFg = id => {
|
|
5
|
-
return `var(--sinch-chip-color-${id}-
|
|
5
|
+
return `var(--sinch-comp-chip-color-${id}-default-foreground-initial)`;
|
|
6
6
|
};
|
|
7
7
|
export const assertChipColor = (root, id) => {
|
|
8
|
-
if (id === null || window.getComputedStyle(root).getPropertyValue(`--sinch-chip-color-${id}-
|
|
8
|
+
if (id === null || window.getComputedStyle(root).getPropertyValue(`--sinch-comp-chip-color-${id}-default-background-initial`).length === 0) {
|
|
9
9
|
throw new Error(`Invalid sinch-chip color name: ${id}`);
|
|
10
10
|
}
|
|
11
11
|
};
|
package/code-tag/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement, getAttribute, updateAttribute, NectaryElement } from '../utils';
|
|
2
|
-
const templateHTML = '<style>:host{display:inline}#content{font:var(--sinch-font-
|
|
2
|
+
const templateHTML = '<style>:host{display:inline}#content{font:var(--sinch-comp-code-tag-font-text);font-size:inherit;line-height:inherit;color:var(--sinch-comp-code-tag-color-default-text-initial);border:1px solid var(--sinch-comp-code-tag-color-default-border-initial);background-color:var(--sinch-comp-code-tag-color-default-background-initial);padding:0 .25em;border-radius:var(--sinch-comp-code-tag-shape-radius);white-space:var(--sinch-global-text-white-space,normal)}</style><span id="content"></span>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
5
|
defineCustomElement('sinch-code-tag', class extends NectaryElement {
|
package/color-menu/index.d.ts
CHANGED
package/color-menu/index.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import '../
|
|
2
|
-
|
|
3
|
-
import '../icon';
|
|
4
|
-
import { getSwatchColorFg } from '../color-swatch/utils';
|
|
5
|
-
import { lightColorNames, darkColorNames, vibrantColorNames } from '../theme/colors';
|
|
6
|
-
import { attrValueToPixels, defineCustomElement, getAttribute, getBooleanAttribute, unpackCsv, getIntegerAttribute, getReactEventHandler, getRect, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute, updateIntegerAttribute, subscribeContext, getCssVar } from '../utils';
|
|
7
|
-
const optionTemplateHTML = '<div class="option" role="option"><sinch-tooltip inverted class="tooltip"><div class="swatch-wrapper"><sinch-color-swatch class="swatch"></sinch-color-swatch><sinch-icon class="check"></sinch-icon></div></sinch-tooltip></div>';
|
|
8
|
-
const templateHTML = '<style>:host{display:block;outline:0}#listbox{display:flex;flex-direction:row;flex-wrap:wrap;padding:4px 10px;overflow-y:auto}#listbox:empty{display:none}.option{padding:12px 6px;--sinch-color-icon:var(--sinch-color-stormy-500)}.swatch-wrapper{position:relative;cursor:pointer;width:32px;height:32px}.swatch-wrapper::after{content:"";position:absolute;width:34px;height:34px;inset:-3px;border:2px solid transparent;border-radius:50%;pointer-events:none}.option[data-selected]:not([data-checked]) .swatch-wrapper::after{border-color:var(--sinch-color-border-focus)}.check{display:none;position:absolute;left:4px;top:4px;pointer-events:none;--sinch-size-icon:24px}.option[data-checked] .check{display:block}</style><div id="listbox" role="presentation"></div>';
|
|
9
|
-
import { getParentOption } from './utils';
|
|
1
|
+
import { attrValueToPixels, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, getRect, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute, updateIntegerAttribute, subscribeContext } from '../utils';
|
|
2
|
+
const templateHTML = '<style>:host{display:block;outline:0}#listbox{display:flex;flex-direction:row;flex-wrap:wrap;padding:4px 10px;overflow-y:auto}#listbox.empty{display:none}</style><div id="listbox" role="presentation"><slot id="options"></slot></div>';
|
|
10
3
|
const NUM_COLS_DEFAULT = 5;
|
|
11
4
|
const ITEM_WIDTH = 44;
|
|
12
5
|
const ITEM_HEIGHT = 56;
|
|
13
6
|
const template = document.createElement('template');
|
|
14
|
-
const optionTemplate = document.createElement('template');
|
|
15
7
|
template.innerHTML = templateHTML;
|
|
16
|
-
optionTemplate.innerHTML = optionTemplateHTML;
|
|
17
8
|
defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
18
9
|
#$listbox;
|
|
10
|
+
#$optionsSlot;
|
|
19
11
|
#controller = null;
|
|
20
|
-
#prevColorsValue = '';
|
|
21
|
-
#checkIconName = null;
|
|
22
12
|
constructor() {
|
|
23
13
|
super();
|
|
24
14
|
const shadowRoot = this.attachShadow();
|
|
25
15
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
26
16
|
this.#$listbox = shadowRoot.querySelector('#listbox');
|
|
17
|
+
this.#$optionsSlot = shadowRoot.querySelector('#options');
|
|
27
18
|
}
|
|
28
19
|
connectedCallback() {
|
|
29
20
|
super.connectedCallback();
|
|
@@ -31,32 +22,53 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
31
22
|
const {
|
|
32
23
|
signal
|
|
33
24
|
} = this.#controller;
|
|
25
|
+
const options = {
|
|
26
|
+
signal
|
|
27
|
+
};
|
|
34
28
|
this.setAttribute('role', 'listbox');
|
|
35
29
|
this.setAttribute('tabindex', '0');
|
|
36
|
-
this.addEventListener('keydown', this.#onListboxKeyDown,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.addEventListener('
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
this.#$listbox.addEventListener('click', this.#onListboxClick, {
|
|
43
|
-
signal
|
|
44
|
-
});
|
|
45
|
-
this.addEventListener('-change', this.#onChangeReactHandler, {
|
|
46
|
-
signal
|
|
47
|
-
});
|
|
30
|
+
this.addEventListener('keydown', this.#onListboxKeyDown, options);
|
|
31
|
+
this.addEventListener('blur', this.#onListboxBlur, options);
|
|
32
|
+
this.#$listbox.addEventListener('click', this.#onListboxClick, options);
|
|
33
|
+
this.#$optionsSlot.addEventListener('slotchange', this.#onSlotChange, options);
|
|
34
|
+
this.addEventListener('-change', this.#onChangeReactHandler, options);
|
|
48
35
|
subscribeContext(this, 'keydown', this.#onContextKeyDown, signal);
|
|
49
36
|
subscribeContext(this, 'visibility', this.#onContextVisibility, signal);
|
|
50
|
-
this.#
|
|
51
|
-
requestAnimationFrame(this.#onMount);
|
|
37
|
+
this.#updateColumns();
|
|
52
38
|
}
|
|
53
39
|
disconnectedCallback() {
|
|
54
40
|
super.disconnectedCallback();
|
|
55
|
-
this.#prevColorsValue = null;
|
|
56
41
|
this.#controller.abort();
|
|
42
|
+
this.#controller = null;
|
|
57
43
|
}
|
|
58
44
|
static get observedAttributes() {
|
|
59
|
-
return ['value', 'rows', 'cols'
|
|
45
|
+
return ['value', 'rows', 'cols'];
|
|
46
|
+
}
|
|
47
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
48
|
+
if (oldVal === newVal) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
switch (name) {
|
|
52
|
+
case 'value':
|
|
53
|
+
{
|
|
54
|
+
if (this.isConnected) {
|
|
55
|
+
this.#onValueChange();
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case 'rows':
|
|
60
|
+
{
|
|
61
|
+
this.#updateRows();
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case 'cols':
|
|
65
|
+
{
|
|
66
|
+
if (this.isConnected) {
|
|
67
|
+
this.#updateColumns();
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
60
72
|
}
|
|
61
73
|
set value(value) {
|
|
62
74
|
updateAttribute(this, 'value', value);
|
|
@@ -86,73 +98,16 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
86
98
|
return true;
|
|
87
99
|
}
|
|
88
100
|
nthItemRect(index) {
|
|
89
|
-
const $item = this
|
|
101
|
+
const $item = this.#getOptionElements()[index];
|
|
90
102
|
if ($item != null) {
|
|
91
103
|
return getRect($item);
|
|
92
104
|
}
|
|
93
105
|
return null;
|
|
94
106
|
}
|
|
95
|
-
|
|
96
|
-
if (oldVal === newVal) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
switch (name) {
|
|
100
|
-
case 'value':
|
|
101
|
-
{
|
|
102
|
-
if (this.isConnected) {
|
|
103
|
-
this.#onValueChange();
|
|
104
|
-
}
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
case 'colors':
|
|
108
|
-
{
|
|
109
|
-
if (this.isConnected) {
|
|
110
|
-
this.#updateColors();
|
|
111
|
-
}
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
case 'rows':
|
|
115
|
-
{
|
|
116
|
-
this.#updateRows();
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
case 'cols':
|
|
120
|
-
{
|
|
121
|
-
if (this.isConnected) {
|
|
122
|
-
this.#updateColumns();
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
#updateColors() {
|
|
129
|
-
const colorsValue = this.colors;
|
|
130
|
-
if (colorsValue === this.#prevColorsValue) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this.#prevColorsValue = colorsValue;
|
|
134
|
-
const colorNames = unpackCsv(colorsValue ?? `${lightColorNames},${vibrantColorNames},${darkColorNames}`);
|
|
135
|
-
const fragment = document.createDocumentFragment();
|
|
136
|
-
for (const color of colorNames) {
|
|
137
|
-
if (color.length === 0) {
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
const optFrag = optionTemplate.content.cloneNode(true);
|
|
141
|
-
const $option = optFrag.querySelector('.option');
|
|
142
|
-
const $swatch = optFrag.querySelector('.swatch');
|
|
143
|
-
const $tooltip = optFrag.querySelector('.tooltip');
|
|
144
|
-
const $checkIcon = optFrag.querySelector('.check');
|
|
145
|
-
updateAttribute($option, 'data-value', color);
|
|
146
|
-
updateAttribute($tooltip, 'text', color);
|
|
147
|
-
updateAttribute($swatch, 'name', color);
|
|
148
|
-
updateAttribute($checkIcon, 'name', this.#checkIconName);
|
|
149
|
-
$option.style.setProperty('--sinch-color-icon', getSwatchColorFg(color));
|
|
150
|
-
fragment.appendChild(optFrag);
|
|
151
|
-
}
|
|
152
|
-
this.#$listbox.replaceChildren(fragment);
|
|
107
|
+
#onSlotChange = () => {
|
|
153
108
|
this.#updateColumns();
|
|
154
109
|
this.#onValueChange();
|
|
155
|
-
}
|
|
110
|
+
};
|
|
156
111
|
#updateRows() {
|
|
157
112
|
const rowsValue = getAttribute(this, 'rows');
|
|
158
113
|
this.#$listbox.style.maxHeight = attrValueToPixels(rowsValue, {
|
|
@@ -162,7 +117,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
162
117
|
}
|
|
163
118
|
#updateColumns() {
|
|
164
119
|
const colsValue = getAttribute(this, 'cols');
|
|
165
|
-
const numItems = this
|
|
120
|
+
const numItems = this.#getOptionElements().length;
|
|
166
121
|
this.#$listbox.style.width = attrValueToPixels(colsValue, {
|
|
167
122
|
min: 1,
|
|
168
123
|
max: numItems,
|
|
@@ -170,9 +125,6 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
170
125
|
itemSizeMultiplier: ITEM_WIDTH
|
|
171
126
|
});
|
|
172
127
|
}
|
|
173
|
-
#onMount = () => {
|
|
174
|
-
this.#updateColors();
|
|
175
|
-
};
|
|
176
128
|
#onListboxBlur = () => {
|
|
177
129
|
this.#selectOption(null);
|
|
178
130
|
};
|
|
@@ -181,8 +133,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
181
133
|
if ($elem === this.#$listbox) {
|
|
182
134
|
return;
|
|
183
135
|
}
|
|
184
|
-
|
|
185
|
-
this.#dispatchChangeEvent($option);
|
|
136
|
+
this.#dispatchChangeEvent($elem);
|
|
186
137
|
};
|
|
187
138
|
#onContextVisibility = e => {
|
|
188
139
|
if (e.detail) {
|
|
@@ -238,7 +189,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
238
189
|
#onValueChange() {
|
|
239
190
|
const value = this.value;
|
|
240
191
|
for (const $option of this.#getOptionElements()) {
|
|
241
|
-
const isChecked = value === getAttribute($option, '
|
|
192
|
+
const isChecked = value === getAttribute($option, 'value', '');
|
|
242
193
|
updateBooleanAttribute($option, 'data-checked', isChecked);
|
|
243
194
|
updateBooleanAttribute($option, 'data-selected', isChecked);
|
|
244
195
|
updateExplicitBooleanAttribute($option, 'aria-selected', isChecked);
|
|
@@ -316,7 +267,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
316
267
|
}
|
|
317
268
|
}
|
|
318
269
|
#getOptionElements() {
|
|
319
|
-
return
|
|
270
|
+
return this.#$optionsSlot.assignedElements();
|
|
320
271
|
}
|
|
321
272
|
#getSelectedOptionIndex() {
|
|
322
273
|
const elements = this.#getOptionElements();
|
|
@@ -341,7 +292,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
341
292
|
const elements = this.#getOptionElements();
|
|
342
293
|
const value = this.value;
|
|
343
294
|
for (const $el of elements) {
|
|
344
|
-
if (getAttribute($el, '
|
|
295
|
+
if (getAttribute($el, 'value') === value) {
|
|
345
296
|
return $el;
|
|
346
297
|
}
|
|
347
298
|
}
|
|
@@ -353,7 +304,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
|
|
|
353
304
|
}
|
|
354
305
|
if ($opt !== null) {
|
|
355
306
|
this.dispatchEvent(new CustomEvent('-change', {
|
|
356
|
-
detail: getAttribute($opt, '
|
|
307
|
+
detail: getAttribute($opt, 'value')
|
|
357
308
|
}));
|
|
358
309
|
}
|
|
359
310
|
}
|
package/color-menu/types.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export type TSinchColorMenuElement = HTMLElement & {
|
|
|
6
6
|
rows: number | null;
|
|
7
7
|
/** How many cols to show and scroll the rest */
|
|
8
8
|
cols: number | null;
|
|
9
|
-
/** Comma-separated color names, all colors by default */
|
|
10
|
-
colors: string | null;
|
|
11
9
|
nthItemRect(index: number): TRect | null;
|
|
12
10
|
/** Change event */
|
|
13
11
|
addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
|
|
@@ -27,8 +25,6 @@ export type TSinchColorMenuReact = TSinchElementReact<TSinchColorMenuElement> &
|
|
|
27
25
|
rows?: number;
|
|
28
26
|
/** How many cols to show and scroll the rest */
|
|
29
27
|
cols?: number;
|
|
30
|
-
/** Comma-separated color names, all colors by default */
|
|
31
|
-
colors?: string;
|
|
32
28
|
/** Label that is used for a11y */
|
|
33
29
|
'aria-label': string;
|
|
34
30
|
/** Change event handler */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '../color-swatch';
|
|
2
|
+
import '../tooltip';
|
|
3
|
+
import '../icon';
|
|
4
|
+
import type { TSinchColorMenuOptionElement, TSinchColorMenuOptionReact } from './types';
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'sinch-color-menu-option': TSinchColorMenuOptionReact;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'sinch-color-menu-option': TSinchColorMenuOptionElement;
|
|
13
|
+
}
|
|
14
|
+
}
|