@nectary/components 4.10.5 → 4.11.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 +13 -0
- package/accordion/index.js +3 -2
- package/accordion-item/index.d.ts +23 -1
- package/accordion-item/index.js +3 -2
- package/action-menu/index.d.ts +12 -0
- package/action-menu/index.js +3 -2
- package/action-menu-option/index.d.ts +14 -0
- package/action-menu-option/index.js +3 -2
- package/alert/index.d.ts +14 -1
- package/alert/index.js +3 -2
- package/avatar/index.d.ts +21 -1
- package/avatar/index.js +3 -2
- package/badge/index.d.ts +21 -2
- package/badge/index.js +3 -2
- package/button/index.d.ts +25 -1
- package/button/index.js +3 -2
- package/button-group/index.d.ts +14 -0
- package/button-group/index.js +3 -2
- package/button-group-item/index.d.ts +15 -0
- package/button-group-item/index.js +3 -2
- package/card/index.d.ts +17 -1
- package/card/index.js +3 -2
- package/card-container/index.d.ts +4 -0
- package/card-container/index.js +3 -2
- package/card-v2/index.d.ts +15 -0
- package/card-v2/index.js +3 -2
- package/card-v2-title/index.d.ts +15 -1
- package/card-v2-title/index.js +3 -2
- package/checkbox/index.d.ts +28 -0
- package/checkbox/index.js +3 -2
- package/chip/index.d.ts +16 -0
- package/chip/index.js +3 -2
- package/code-tag/index.d.ts +9 -0
- package/code-tag/index.js +3 -2
- package/color-menu/index.d.ts +20 -1
- package/color-menu/index.js +3 -2
- package/color-menu-option/index.d.ts +11 -0
- package/color-menu-option/index.js +3 -2
- package/color-swatch/index.d.ts +11 -0
- package/color-swatch/index.js +3 -2
- package/date-picker/index.d.ts +35 -1
- package/date-picker/index.js +3 -2
- package/dialog/index.d.ts +15 -0
- package/dialog/index.js +3 -2
- package/emoji/index.d.ts +11 -0
- package/emoji/index.js +3 -2
- package/emoji-picker/index.d.ts +15 -1
- package/emoji-picker/index.js +3 -2
- package/field/index.d.ts +21 -0
- package/field/index.js +3 -2
- package/file-drop/index.d.ts +23 -0
- package/file-drop/index.js +3 -2
- package/file-picker/index.d.ts +15 -0
- package/file-picker/index.js +3 -2
- package/file-status/index.d.ts +14 -1
- package/file-status/index.js +3 -2
- package/flag/index.d.ts +11 -0
- package/flag/index.js +3 -2
- package/grid/index.d.ts +4 -0
- package/grid/index.js +3 -2
- package/grid-item/index.d.ts +12 -0
- package/grid-item/index.js +3 -2
- package/help-tooltip/index.d.ts +17 -0
- package/help-tooltip/index.js +3 -2
- package/horizontal-stepper/index.d.ts +11 -0
- package/horizontal-stepper/index.js +3 -2
- package/horizontal-stepper-item/index.d.ts +14 -1
- package/horizontal-stepper-item/index.js +3 -2
- package/icon/index.d.ts +12 -0
- package/icon/index.js +3 -2
- package/inline-alert/index.d.ts +16 -1
- package/inline-alert/index.js +3 -2
- package/input/index.d.ts +45 -1
- package/input/index.js +3 -2
- package/link/index.d.ts +26 -0
- package/link/index.js +3 -2
- package/list/index.d.ts +5 -0
- package/list/index.js +3 -2
- package/list-item/index.d.ts +5 -0
- package/list-item/index.js +3 -2
- package/package.json +2 -2
- package/pagination/index.d.ts +20 -1
- package/pagination/index.js +3 -2
- package/persistent-overlay/index.d.ts +13 -0
- package/persistent-overlay/index.js +3 -2
- package/pop/index.d.ts +21 -2
- package/pop/index.js +3 -2
- package/popover/index.d.ts +20 -1
- package/popover/index.js +3 -2
- package/progress/index.d.ts +12 -0
- package/progress/index.js +3 -2
- package/progress-stepper/index.d.ts +15 -1
- package/progress-stepper/index.js +3 -2
- package/progress-stepper-item/index.d.ts +16 -0
- package/progress-stepper-item/index.js +3 -2
- package/radio/index.d.ts +19 -0
- package/radio/index.js +3 -2
- package/radio-option/index.d.ts +18 -0
- package/radio-option/index.js +3 -2
- package/rich-text/index.d.ts +14 -0
- package/rich-text/index.js +3 -2
- package/rich-textarea/index.d.ts +28 -0
- package/rich-textarea/index.js +3 -2
- package/segment/index.d.ts +18 -1
- package/segment/index.js +3 -2
- package/segment-collapse/index.d.ts +14 -0
- package/segment-collapse/index.js +3 -2
- package/segmented-control/index.d.ts +11 -0
- package/segmented-control/index.js +3 -2
- package/segmented-control-option/index.d.ts +16 -0
- package/segmented-control-option/index.js +3 -2
- package/segmented-icon-control/index.d.ts +13 -0
- package/segmented-icon-control/index.js +3 -2
- package/segmented-icon-control-option/index.d.ts +14 -0
- package/segmented-icon-control-option/index.js +3 -2
- package/select-button/index.d.ts +21 -0
- package/select-button/index.js +3 -2
- package/select-menu/index.d.ts +30 -0
- package/select-menu/index.js +3 -2
- package/skeleton/index.d.ts +9 -0
- package/skeleton/index.js +3 -2
- package/skeleton-item/index.d.ts +4 -0
- package/skeleton-item/index.js +3 -2
- package/spinner/index.d.ts +12 -0
- package/spinner/index.js +3 -2
- package/stop-events/index.d.ts +6 -1
- package/stop-events/index.js +3 -2
- package/table/index.d.ts +5 -0
- package/table/index.js +3 -2
- package/table-body/index.d.ts +5 -0
- package/table-body/index.js +3 -2
- package/table-cell/index.d.ts +8 -1
- package/table-cell/index.js +3 -2
- package/table-head/index.d.ts +5 -0
- package/table-head/index.js +3 -2
- package/table-head-cell/index.d.ts +15 -0
- package/table-head-cell/index.js +3 -2
- package/table-row/index.d.ts +11 -0
- package/table-row/index.js +3 -2
- package/tabs/index.d.ts +13 -1
- package/tabs/index.js +3 -2
- package/tabs-icon-option/index.d.ts +16 -0
- package/tabs-icon-option/index.js +3 -2
- package/tabs-option/index.d.ts +18 -0
- package/tabs-option/index.js +3 -2
- package/tag/index.d.ts +15 -0
- package/tag/index.js +3 -2
- package/text/index.d.ts +17 -1
- package/text/index.js +3 -2
- package/textarea/index.d.ts +38 -0
- package/textarea/index.js +3 -2
- package/tile-control/index.d.ts +17 -0
- package/tile-control/index.js +3 -2
- package/tile-control-option/index.d.ts +18 -0
- package/tile-control-option/index.js +3 -2
- package/time-picker/index.d.ts +21 -1
- package/time-picker/index.js +3 -2
- package/title/index.d.ts +15 -1
- package/title/index.js +3 -2
- package/toast/index.d.ts +16 -1
- package/toast/index.js +3 -2
- package/toast-manager/index.d.ts +14 -2
- package/toast-manager/index.js +3 -2
- package/toggle/index.d.ts +20 -0
- package/toggle/index.js +3 -2
- package/tooltip/index.d.ts +21 -2
- package/tooltip/index.js +3 -2
- package/vertical-stepper/index.d.ts +11 -0
- package/vertical-stepper/index.js +3 -2
- package/vertical-stepper-item/index.d.ts +14 -1
- package/vertical-stepper-item/index.js +3 -2
package/accordion/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { TSinchAccordion } from './types';
|
|
2
3
|
import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
|
|
4
|
+
export declare class Accordion extends NectaryElement {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
static get observedAttributes(): string[];
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
set value(value: string);
|
|
11
|
+
get value(): string;
|
|
12
|
+
set multiple(isMultiple: boolean);
|
|
13
|
+
get multiple(): boolean;
|
|
14
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
15
|
+
}
|
|
3
16
|
declare global {
|
|
4
17
|
interface NectaryComponentMap {
|
|
5
18
|
'sinch-accordion': TSinchAccordion;
|
package/accordion/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { NectaryElement, defineCustomElement, getAttribute, getBooleanAttribute,
|
|
|
2
2
|
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%}::slotted(sinch-accordion-item){flex-shrink:1}</style><div id="wrapper"><slot></slot></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
|
|
5
|
+
export class Accordion extends NectaryElement {
|
|
6
6
|
#$slot;
|
|
7
7
|
#controller = null;
|
|
8
8
|
constructor() {
|
|
@@ -87,4 +87,5 @@ defineCustomElement('sinch-accordion', class extends NectaryElement {
|
|
|
87
87
|
#onChangeReactHandler = e => {
|
|
88
88
|
getReactEventHandler(this, 'on-change')?.(e);
|
|
89
89
|
};
|
|
90
|
-
}
|
|
90
|
+
}
|
|
91
|
+
defineCustomElement('sinch-accordion', Accordion);
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import '../icon';
|
|
2
2
|
import '../text';
|
|
3
3
|
import '../title';
|
|
4
|
-
import
|
|
4
|
+
import { NectaryElement } from '../utils';
|
|
5
|
+
import type { TSinchAccordionStatusType, TSinchAccordionItem } from './types';
|
|
5
6
|
import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
|
|
7
|
+
export declare class AccordionItem extends NectaryElement {
|
|
8
|
+
#private;
|
|
9
|
+
constructor();
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
static get observedAttributes(): string[];
|
|
13
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
14
|
+
set value(value: string);
|
|
15
|
+
get value(): string;
|
|
16
|
+
set label(value: string);
|
|
17
|
+
get label(): string;
|
|
18
|
+
set disabled(isDisabled: boolean);
|
|
19
|
+
get disabled(): boolean;
|
|
20
|
+
get status(): TSinchAccordionStatusType | null;
|
|
21
|
+
set status(value: TSinchAccordionStatusType | null);
|
|
22
|
+
set optionalText(value: string | null);
|
|
23
|
+
get optionalText(): string | null;
|
|
24
|
+
get focusable(): boolean;
|
|
25
|
+
focus(): void;
|
|
26
|
+
blur(): void;
|
|
27
|
+
}
|
|
6
28
|
declare global {
|
|
7
29
|
interface NectaryComponentMap {
|
|
8
30
|
'sinch-accordion-item': TSinchAccordionItem;
|
package/accordion-item/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:block;outline:0;min-height:48px}#wrap
|
|
|
6
6
|
import { statusValues } from './utils';
|
|
7
7
|
const template = document.createElement('template');
|
|
8
8
|
template.innerHTML = templateHTML;
|
|
9
|
-
|
|
9
|
+
export class AccordionItem extends NectaryElement {
|
|
10
10
|
#$button;
|
|
11
11
|
#$title;
|
|
12
12
|
#$optionalText;
|
|
@@ -92,4 +92,5 @@ defineCustomElement('sinch-accordion-item', class extends NectaryElement {
|
|
|
92
92
|
blur() {
|
|
93
93
|
this.#$button.blur();
|
|
94
94
|
}
|
|
95
|
-
}
|
|
95
|
+
}
|
|
96
|
+
defineCustomElement('sinch-accordion-item', AccordionItem);
|
package/action-menu/index.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { TSinchActionMenu } from './types';
|
|
2
3
|
import type { NectaryComponentVanilla, NectaryComponentReact } from '../types';
|
|
4
|
+
export declare class ActionMenu extends NectaryElement {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
static get observedAttributes(): string[];
|
|
10
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
11
|
+
set rows(value: number | null);
|
|
12
|
+
get rows(): number | null;
|
|
13
|
+
get focusable(): boolean;
|
|
14
|
+
}
|
|
3
15
|
declare global {
|
|
4
16
|
interface NectaryComponentMap {
|
|
5
17
|
'sinch-action-menu': TSinchActionMenu;
|
package/action-menu/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const templateHTML = '<style>:host{display:block;outline:0}#listbox{overflow-y:a
|
|
|
4
4
|
const ITEM_HEIGHT = 40;
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class ActionMenu extends NectaryElement {
|
|
8
8
|
#$optionSlot;
|
|
9
9
|
#$listbox;
|
|
10
10
|
#controller = null;
|
|
@@ -192,4 +192,5 @@ defineCustomElement('sinch-action-menu', class extends NectaryElement {
|
|
|
192
192
|
get focusable() {
|
|
193
193
|
return true;
|
|
194
194
|
}
|
|
195
|
-
}
|
|
195
|
+
}
|
|
196
|
+
defineCustomElement('sinch-action-menu', ActionMenu);
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import '../text';
|
|
2
|
+
import { NectaryElement } from '../utils';
|
|
2
3
|
import type { TSinchActionMenuOption } from './types';
|
|
3
4
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
5
|
+
export declare class ActionMenuOption extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
static get observedAttributes(): string[];
|
|
11
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
12
|
+
set text(value: string);
|
|
13
|
+
get text(): string;
|
|
14
|
+
set disabled(isDisabled: boolean);
|
|
15
|
+
get disabled(): boolean;
|
|
16
|
+
click(): void;
|
|
17
|
+
}
|
|
4
18
|
declare global {
|
|
5
19
|
interface NectaryComponentMap {
|
|
6
20
|
'sinch-action-menu-option': TSinchActionMenuOption;
|
|
@@ -3,7 +3,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHa
|
|
|
3
3
|
const templateHTML = '<style>:host{display:block;cursor:pointer}:host([disabled]){cursor:initial}#wrapper{all:initial;display:flex;position:relative;box-sizing:border-box;height:40px;width:100%;padding:8px 16px;align-items:center;gap:10px;user-select:none;background-color:var(--sinch-comp-action-menu-color-default-background-initial);--sinch-global-color-text:var(--sinch-comp-action-menu-color-default-text-initial);--sinch-global-color-icon:var(--sinch-comp-action-menu-color-default-icon-initial);--sinch-global-size-icon:var(--sinch-comp-action-menu-size-icon)}:host([data-selected])>#wrapper{background-color:var(--sinch-comp-action-menu-color-default-background-selected)}:host(:hover)>#wrapper{background-color:var(--sinch-comp-action-menu-color-default-background-hover)}:host([disabled])>#wrapper{pointer-events:none;background-color:var(--sinch-comp-action-menu-color-disabled-background-initial);--sinch-global-color-text:var(--sinch-comp-action-menu-color-disabled-text-initial);--sinch-global-color-icon:var(--sinch-comp-action-menu-color-disabled-icon-initial)}#content{flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-action-menu-font-option)}::slotted(*){margin-left:-6px}</style><div id="wrapper" inert><slot name="icon"></slot><sinch-text id="content" type="m" ellipsis></sinch-text></div>';
|
|
4
4
|
const template = document.createElement('template');
|
|
5
5
|
template.innerHTML = templateHTML;
|
|
6
|
-
|
|
6
|
+
export class ActionMenuOption extends NectaryElement {
|
|
7
7
|
#$content;
|
|
8
8
|
#controller = null;
|
|
9
9
|
constructor() {
|
|
@@ -79,4 +79,5 @@ defineCustomElement('sinch-action-menu-option', class ActionMenuOption extends N
|
|
|
79
79
|
#onClickReactHandler = e => {
|
|
80
80
|
getReactEventHandler(this, 'on-click')?.(e);
|
|
81
81
|
};
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
|
+
defineCustomElement('sinch-action-menu-option', ActionMenuOption);
|
package/alert/index.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import '../icon';
|
|
2
2
|
import '../rich-text';
|
|
3
3
|
import '../text';
|
|
4
|
-
import
|
|
4
|
+
import { NectaryElement } from '../utils';
|
|
5
|
+
import type { TSinchAlertType, TSinchAlert } from './types';
|
|
5
6
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
7
|
+
export declare class Alert extends NectaryElement {
|
|
8
|
+
#private;
|
|
9
|
+
constructor();
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
static get observedAttributes(): string[];
|
|
13
|
+
attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
|
|
14
|
+
get type(): TSinchAlertType;
|
|
15
|
+
set type(value: TSinchAlertType);
|
|
16
|
+
get text(): string;
|
|
17
|
+
set text(value: string);
|
|
18
|
+
}
|
|
6
19
|
declare global {
|
|
7
20
|
interface NectaryComponentMap {
|
|
8
21
|
'sinch-alert': TSinchAlert;
|
package/alert/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-dire
|
|
|
6
6
|
import { typeValues } from './utils';
|
|
7
7
|
const template = document.createElement('template');
|
|
8
8
|
template.innerHTML = templateHTML;
|
|
9
|
-
|
|
9
|
+
export class Alert extends NectaryElement {
|
|
10
10
|
#$text;
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
@@ -45,4 +45,5 @@ defineCustomElement('sinch-alert', class extends NectaryElement {
|
|
|
45
45
|
set text(value) {
|
|
46
46
|
updateAttribute(this, 'text', value);
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
|
+
defineCustomElement('sinch-alert', Alert);
|
package/avatar/index.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
2
|
+
import type { TSinchAvatarStatus, TSinchAvatar } from './types';
|
|
2
3
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
import type { TSinchSize } from '../utils/size';
|
|
5
|
+
export declare class Avatar extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
static get observedAttributes(): string[];
|
|
11
|
+
attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
|
|
12
|
+
get src(): string | null;
|
|
13
|
+
set src(value: string | null);
|
|
14
|
+
get alt(): string;
|
|
15
|
+
set alt(value: string);
|
|
16
|
+
get color(): string | null;
|
|
17
|
+
set color(value: string | null);
|
|
18
|
+
get size(): TSinchSize;
|
|
19
|
+
set size(value: TSinchSize);
|
|
20
|
+
get status(): TSinchAvatarStatus | null;
|
|
21
|
+
set status(value: TSinchAvatarStatus | null);
|
|
22
|
+
}
|
|
3
23
|
declare global {
|
|
4
24
|
interface NectaryComponentMap {
|
|
5
25
|
'sinch-avatar': TSinchAvatar;
|
package/avatar/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;ou
|
|
|
4
4
|
import { getAvatarColorBg, getAvatarColorFg, statusValues } from './utils';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class Avatar extends NectaryElement {
|
|
8
8
|
#$circle;
|
|
9
9
|
#$text;
|
|
10
10
|
#$image;
|
|
@@ -91,4 +91,5 @@ defineCustomElement('sinch-avatar', class extends NectaryElement {
|
|
|
91
91
|
this.#$circle.style.removeProperty('color');
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
|
+
defineCustomElement('sinch-avatar', Avatar);
|
package/badge/index.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
2
|
+
import type { TSinchBadgeMode, TSinchBadge } from './types';
|
|
3
|
+
import type { TRect, NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
import type { TSinchSize } from '../utils/size';
|
|
5
|
+
export declare class Badge extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
static get observedAttributes(): string[];
|
|
11
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
12
|
+
get text(): string;
|
|
13
|
+
set text(value: string);
|
|
14
|
+
get size(): TSinchSize;
|
|
15
|
+
set size(value: TSinchSize);
|
|
16
|
+
get mode(): TSinchBadgeMode;
|
|
17
|
+
set mode(value: TSinchBadgeMode);
|
|
18
|
+
get hidden(): boolean;
|
|
19
|
+
set hidden(isHidden: boolean);
|
|
20
|
+
get badgeRect(): TRect;
|
|
21
|
+
}
|
|
3
22
|
declare global {
|
|
4
23
|
interface NectaryComponentMap {
|
|
5
24
|
'sinch-badge': TSinchBadge;
|
package/badge/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const templateHTML = '<style>:host{display:inline-flex;flex-direction:column;pos
|
|
|
4
4
|
import { modeValues } from './utils';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class Badge extends NectaryElement {
|
|
8
8
|
#$badgeWrapper;
|
|
9
9
|
#$badge;
|
|
10
10
|
#$text;
|
|
@@ -111,4 +111,5 @@ defineCustomElement('sinch-badge', class extends NectaryElement {
|
|
|
111
111
|
#onResize = () => {
|
|
112
112
|
this.#updatePosition();
|
|
113
113
|
};
|
|
114
|
-
}
|
|
114
|
+
}
|
|
115
|
+
defineCustomElement('sinch-badge', Badge);
|
package/button/index.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
2
|
+
import type { TSinchButtonType, TSinchButton, TSinchButtonFormType } from './types';
|
|
2
3
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
import type { TSinchSizeEx } from '../utils/size';
|
|
5
|
+
export declare class Button extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
static formAssociated: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
static get observedAttributes(): string[];
|
|
12
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
13
|
+
set type(value: TSinchButtonType);
|
|
14
|
+
get type(): TSinchButtonType;
|
|
15
|
+
set text(value: string);
|
|
16
|
+
get text(): string;
|
|
17
|
+
set disabled(isDisabled: boolean);
|
|
18
|
+
get disabled(): boolean;
|
|
19
|
+
set toggled(isToggled: boolean);
|
|
20
|
+
get toggled(): boolean;
|
|
21
|
+
set size(size: TSinchSizeEx);
|
|
22
|
+
get size(): TSinchSizeEx;
|
|
23
|
+
get focusable(): boolean;
|
|
24
|
+
set formType(value: TSinchButtonFormType);
|
|
25
|
+
get formType(): TSinchButtonFormType;
|
|
26
|
+
}
|
|
3
27
|
declare global {
|
|
4
28
|
interface NectaryComponentMap {
|
|
5
29
|
'sinch-button': TSinchButton;
|
package/button/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;ou
|
|
|
5
5
|
import { typeValues, formTypeValues } from './utils';
|
|
6
6
|
const template = document.createElement('template');
|
|
7
7
|
template.innerHTML = templateHTML;
|
|
8
|
-
|
|
8
|
+
export class Button extends NectaryElement {
|
|
9
9
|
#$button;
|
|
10
10
|
#$text;
|
|
11
11
|
#controller = null;
|
|
@@ -204,4 +204,5 @@ defineCustomElement('sinch-button', class extends NectaryElement {
|
|
|
204
204
|
#onClickReactHandler = e => {
|
|
205
205
|
getReactEventHandler(this, 'on-click')?.(e);
|
|
206
206
|
};
|
|
207
|
-
}
|
|
207
|
+
}
|
|
208
|
+
defineCustomElement('sinch-button', Button);
|
package/button-group/index.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { TSinchButtonGroup } from './types';
|
|
3
|
+
import type { TSinchButtonType } from '../button/types';
|
|
2
4
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
5
|
+
import type { TSinchSizeEx } from '../utils/size';
|
|
6
|
+
export declare class ButtonGroup extends NectaryElement {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
static get observedAttributes(): string[];
|
|
10
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
11
|
+
set type(value: TSinchButtonType);
|
|
12
|
+
get type(): TSinchButtonType;
|
|
13
|
+
set size(size: TSinchSizeEx);
|
|
14
|
+
get size(): TSinchSizeEx;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
}
|
|
3
17
|
declare global {
|
|
4
18
|
interface NectaryComponentMap {
|
|
5
19
|
'sinch-button-group': TSinchButtonGroup;
|
package/button-group/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { DEFAULT_SIZE, sizeExValues } from '../utils/size';
|
|
|
4
4
|
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;box-sizing:border-box;width:100%;height:100%}</style><div id="wrapper"><slot></slot></div>';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class ButtonGroup extends NectaryElement {
|
|
8
8
|
#$slot;
|
|
9
9
|
constructor() {
|
|
10
10
|
super();
|
|
@@ -46,4 +46,5 @@ defineCustomElement('sinch-button-group', class extends NectaryElement {
|
|
|
46
46
|
connectedCallback() {
|
|
47
47
|
this.setAttribute('role', 'group');
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
|
+
defineCustomElement('sinch-button-group', ButtonGroup);
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { TSinchButtonGroupItem } from './types';
|
|
2
3
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
export declare class ButtonGroupItem extends NectaryElement {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
static get observedAttributes(): string[];
|
|
8
|
+
attributeChangedCallback(name: (keyof NectaryComponentVanilla<'sinch-button'>), oldVal: string | null, newVal: string | null): void;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
set text(value: string);
|
|
11
|
+
get text(): string;
|
|
12
|
+
set disabled(isDisabled: boolean);
|
|
13
|
+
get disabled(): boolean;
|
|
14
|
+
set toggled(isToggled: boolean);
|
|
15
|
+
get toggled(): boolean;
|
|
16
|
+
get focusable(): boolean;
|
|
17
|
+
}
|
|
3
18
|
declare global {
|
|
4
19
|
interface NectaryComponentMap {
|
|
5
20
|
'sinch-button-group-item': TSinchButtonGroupItem;
|
|
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHa
|
|
|
2
2
|
const templateHTML = '<style>:host{display:block;--sinch-local-divider-color:var(--sinch-comp-button-color-secondary-default-text-initial)}#wrapper{display:flex;box-sizing:border-box;width:100%;height:100%;position:relative}:host(:is(:not(:first-of-type))) #wrapper::before{content:"";position:absolute;inset:0;background-color:var(--sinch-local-divider-color);opacity:.3;pointer-events:none;z-index:2;top:10%;bottom:10%;left:-.5px;width:1px}:host([type=primary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-primary-default-text-initial)}:host([type=secondary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-secondary-default-text-initial)}:host([type=subtle-primary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-subtle-primary-default-text-initial)}:host([type=subtle-secondary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-subtle-secondary-default-text-initial)}:host([type=cta-primary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-cta-primary-default-text-initial)}:host([type=cta-secondary]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-cta-secondary-default-text-initial)}:host([type=destructive]) #wrapper::before{--sinch-local-divider-color:var(--sinch-comp-button-color-danger-default-text-initial)}#sinch-button-element{display:flex;box-sizing:border-box;width:100%;height:100%;--sinch-button-shape-radius-base:0;--sinch-button-shape-radius-top-right:0;--sinch-button-shape-radius-top-left:0;--sinch-button-shape-radius-bottom-right:0;--sinch-button-shape-radius-bottom-left:0}:host(:is(:first-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-left:var(--sinch-comp-button-shape-radius-size-m);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-button-shape-radius-size-m)}:host(:is(:last-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-right:var(--sinch-comp-button-shape-radius-size-m);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-button-shape-radius-size-m)}:host([size="l"]:is(:first-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-left:var(--sinch-comp-button-shape-radius-size-l);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-button-shape-radius-size-l)}:host([size="l"]:is(:last-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-right:var(--sinch-comp-button-shape-radius-size-l);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-button-shape-radius-size-l)}:host([size="m"]:is(:first-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-left:var(--sinch-comp-button-shape-radius-size-m);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-button-shape-radius-size-m)}:host([size="m"]:is(:last-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-right:var(--sinch-comp-button-shape-radius-size-m);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-button-shape-radius-size-m)}:host([size="s"]:is(:first-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-left:var(--sinch-comp-button-shape-radius-size-s);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-button-shape-radius-size-s)}:host([size="s"]:is(:last-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-right:var(--sinch-comp-button-shape-radius-size-s);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-button-shape-radius-size-s)}:host([size=xs]:is(:first-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-left:var(--sinch-comp-button-shape-radius-size-xs);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-button-shape-radius-size-xs)}:host([size=xs]:is(:last-of-type)) #sinch-button-element{--sinch-button-shape-radius-top-right:var(--sinch-comp-button-shape-radius-size-xs);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-button-shape-radius-size-xs)}:host(:is(:not(:first-of-type,:last-of-type))) #sinch-button-element:not(:active){--sinch-button-border-left:none;--sinch-button-border-right:none}:host(:is(:first-of-type)) #sinch-button-element:not(:active){--sinch-button-border-right:none}:host(:is(:last-of-type)) #sinch-button-element:not(:active){--sinch-button-border-left:none}:host(:is([text=""],:not([text]))) :is(#left-icon,#right-icon,#text){display:none}::slotted(*){display:block}</style><div id="wrapper"><sinch-button id="sinch-button-element"><slot id="left-icon" name="left-icon" slot="left-icon"></slot><slot id="icon" name="icon" slot="icon"></slot><slot id="right-icon" name="right-icon" slot="right-icon"></slot></sinch-button></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
|
|
5
|
+
export class ButtonGroupItem extends NectaryElement {
|
|
6
6
|
#$sinchButton;
|
|
7
7
|
#controller = null;
|
|
8
8
|
constructor() {
|
|
@@ -76,4 +76,5 @@ defineCustomElement('sinch-button-group-item', class extends NectaryElement {
|
|
|
76
76
|
#onBlurReactHandler = () => {
|
|
77
77
|
getReactEventHandler(this, 'on-blur')?.();
|
|
78
78
|
};
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
|
+
defineCustomElement('sinch-button-group-item', ButtonGroupItem);
|
package/card/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import '../title';
|
|
2
2
|
import '../text';
|
|
3
|
+
import { NectaryElement } from '../utils';
|
|
3
4
|
import type { TSinchCard } from './types';
|
|
4
|
-
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
5
|
+
import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
|
|
6
|
+
export declare class Card extends NectaryElement {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
static get observedAttributes(): string[];
|
|
12
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
13
|
+
set text(value: string);
|
|
14
|
+
get text(): string;
|
|
15
|
+
set caption(value: string);
|
|
16
|
+
get caption(): string;
|
|
17
|
+
set label(value: string);
|
|
18
|
+
get label(): string;
|
|
19
|
+
get dragRect(): TRect | null;
|
|
20
|
+
}
|
|
5
21
|
declare global {
|
|
6
22
|
interface NectaryComponentMap {
|
|
7
23
|
'sinch-card': TSinchCard;
|
package/card/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { defineCustomElement, getBooleanAttribute, getAttribute, updateAttribute
|
|
|
4
4
|
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{border-radius:var(--sinch-comp-card-shape-radius);border:1px solid var(--sinch-comp-card-color-default-border-initial);background-color:var(--sinch-comp-card-color-default-background-initial);box-shadow:var(--sinch-comp-card-shadow-initial);overflow:hidden}:host(:hover) #wrapper{box-shadow:var(--sinch-comp-card-shadow-hover)}#card-body{padding:24px;box-sizing:border-box;display:flex;flex-direction:column;gap:16px}#illustration-wrapper{display:none;overflow:hidden;height:240px}#illustration-wrapper.active{display:block}#label{--sinch-comp-text-font:var(--sinch-comp-card-font-label);--sinch-global-color-text:var(--sinch-comp-card-color-default-title-initial)}#label:empty{display:none}#header{display:flex;flex-direction:row;align-items:center;gap:8px;--sinch-global-size-icon:var(--sinch-comp-card-size-icon)}#caption{flex:1;min-width:0;--sinch-comp-title-font:var(--sinch-comp-card-font-title);--sinch-global-color-text:var(--sinch-comp-card-color-default-title-initial)}#description{flex:1;min-height:0;max-height:120px;overflow-y:auto;--sinch-comp-text-font:var(--sinch-comp-card-font-description);--sinch-global-color-text:var(--sinch-comp-card-color-default-description-initial)}#description:empty{display:none}slot[name=action]::slotted(*){margin-top:20px;align-self:flex-start;max-width:100%}:host([draggable=true]) #header{cursor:grab}</style><div id="wrapper"><div id="illustration-wrapper"><slot name="illustration"></slot></div><div id="card-body"><sinch-text id="label" type="s" emphasized ellipsis></sinch-text><div id="header"><slot name="icon"></slot><sinch-title id="caption" type="m" level="3" ellipsis></sinch-title></div><sinch-text id="description" type="m"></sinch-text><slot name="action"></slot></div></div>';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class Card extends NectaryElement {
|
|
8
8
|
#$text;
|
|
9
9
|
#$label;
|
|
10
10
|
#$caption;
|
|
@@ -130,4 +130,5 @@ defineCustomElement('sinch-card', class extends NectaryElement {
|
|
|
130
130
|
e.stopPropagation();
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
|
-
}
|
|
133
|
+
}
|
|
134
|
+
defineCustomElement('sinch-card', Card);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
3
|
+
export declare class CardContainer extends NectaryElement {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
2
6
|
declare global {
|
|
3
7
|
interface NectaryComponentMap {
|
|
4
8
|
'sinch-card-container': {};
|
package/card-container/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import { defineCustomElement, NectaryElement } from '../utils';
|
|
|
2
2
|
const templateHTML = '<style>:host{display:block}#wrapper{height:100%;padding:20px 0;box-sizing:border-box;background-color:var(--sinch-comp-card-color-default-background-initial);border-radius:var(--sinch-comp-card-shape-radius);border:1px solid var(--sinch-comp-card-color-default-border-initial)}#scroll{overflow:auto;height:100%;box-sizing:border-box;padding:4px 24px}</style><div id="wrapper"><div id="scroll"><slot></slot></div></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
|
|
5
|
+
export class CardContainer extends NectaryElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
const shadowRoot = this.attachShadow();
|
|
9
9
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
10
10
|
}
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
defineCustomElement('sinch-card-container', CardContainer);
|
package/card-v2/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
1
2
|
import type { TSinchCardV2 } from './types';
|
|
2
3
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
export declare class CardV2 extends NectaryElement {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions, isInitial?: boolean): void;
|
|
10
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
11
|
+
static get observedAttributes(): string[];
|
|
12
|
+
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
13
|
+
get disabled(): boolean;
|
|
14
|
+
set disabled(value: boolean);
|
|
15
|
+
get selected(): boolean;
|
|
16
|
+
set selected(value: boolean);
|
|
17
|
+
}
|
|
3
18
|
declare global {
|
|
4
19
|
interface NectaryComponentMap {
|
|
5
20
|
'sinch-card-v2': TSinchCardV2;
|
package/card-v2/index.js
CHANGED
|
@@ -3,7 +3,7 @@ const templateHTML = '<style>:host{display:flex}.empty{display:none!important}#c
|
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
5
|
const CLICK_EVENTS = ['click', '-click'];
|
|
6
|
-
|
|
6
|
+
export class CardV2 extends NectaryElement {
|
|
7
7
|
#$slots;
|
|
8
8
|
#controller = null;
|
|
9
9
|
#clickEventListeners = (() => new Map())();
|
|
@@ -131,4 +131,5 @@ defineCustomElement('sinch-card-v2', class extends NectaryElement {
|
|
|
131
131
|
set selected(value) {
|
|
132
132
|
updateBooleanAttribute(this, 'selected', value);
|
|
133
133
|
}
|
|
134
|
-
}
|
|
134
|
+
}
|
|
135
|
+
defineCustomElement('sinch-card-v2', CardV2);
|
package/card-v2-title/index.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
2
|
+
import type { TSinchOrientation, TSinchCardTitle } from './types';
|
|
2
3
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
|
+
export declare class CardV2Title extends NectaryElement {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
10
|
+
get text(): string;
|
|
11
|
+
set text(value: string);
|
|
12
|
+
get orientation(): TSinchOrientation;
|
|
13
|
+
set orientation(value: TSinchOrientation);
|
|
14
|
+
set ellipsis(isEllipsis: boolean);
|
|
15
|
+
get ellipsis(): boolean;
|
|
16
|
+
}
|
|
3
17
|
declare global {
|
|
4
18
|
interface NectaryComponentMap {
|
|
5
19
|
'sinch-card-v2-title': TSinchCardTitle;
|
package/card-v2-title/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defineCustomElement, getAttribute, updateAttribute, NectaryElement, upd
|
|
|
2
2
|
const templateHTML = '<style>:host{display:block}#title{display:flex;align-items:center;flex-direction:row}#title-text{font:var(--sinch-comp-card-v2-font-title);color:var(--sinch-comp-card-v2-color-default-title-initial)}#title-icon{display:flex}:host([orientation=vertical]) #title{align-items:start;flex-direction:column}:host([disabled]:not([disabled=false])) #title-text{color:var(--sinch-comp-card-v2-color-default-title-disabled)}:host([selected]:not([selected=false])[disabled]:not([disabled=false])) #title-text{color:var(--sinch-comp-card-v2-color-selected-title-disabled)}::slotted([slot=icon]){--sinch-global-color-icon:var(--sinch-comp-card-v2-color-default-icon-initial);--sinch-global-size-icon:var(--sinch-comp-card-v2-size-icon);margin-right:8px;margin-bottom:0}:host([orientation=vertical]) ::slotted([slot=icon]){margin-right:0;margin-bottom:8px}:host([selected]:not([selected=false])) ::slotted([slot=icon]){--sinch-global-color-icon:var(--sinch-comp-card-v2-color-selected-icon-initial)}:host([disabled]:not([disabled=false])) ::slotted([slot=icon]){--sinch-global-color-icon:var(--sinch-comp-card-v2-color-default-icon-disabled)}:host([selected]:not([selected=false])[disabled]:not([disabled=false])) ::slotted([slot=icon]){--sinch-global-color-icon:var(--sinch-comp-card-v2-color-selected-icon-disabled)}</style><div id="title"><div id="title-icon"><slot name="icon"></slot></div><sinch-text id="title-text" type="m"></sinch-text></div>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
|
|
5
|
+
export class CardV2Title extends NectaryElement {
|
|
6
6
|
#$text;
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
@@ -52,4 +52,5 @@ defineCustomElement('sinch-card-v2-title', class extends NectaryElement {
|
|
|
52
52
|
get ellipsis() {
|
|
53
53
|
return getBooleanAttribute(this, 'ellipsis');
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
|
+
defineCustomElement('sinch-card-v2-title', CardV2Title);
|
package/checkbox/index.d.ts
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import '../rich-text';
|
|
2
|
+
import { NectaryElement } from '../utils';
|
|
2
3
|
import type { TSinchCheckbox } from './types';
|
|
3
4
|
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
5
|
+
export declare class Checkbox extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
static formAssociated: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
formAssociatedCallback(): void;
|
|
12
|
+
formResetCallback(): void;
|
|
13
|
+
formStateRestoreCallback(state: string | FormData | null): void;
|
|
14
|
+
static get observedAttributes(): string[];
|
|
15
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
16
|
+
set name(value: string);
|
|
17
|
+
get name(): string;
|
|
18
|
+
set value(value: string);
|
|
19
|
+
get value(): string;
|
|
20
|
+
set checked(isChecked: boolean);
|
|
21
|
+
get checked(): boolean;
|
|
22
|
+
set indeterminate(isIndeterminate: boolean);
|
|
23
|
+
get indeterminate(): boolean;
|
|
24
|
+
set disabled(isDisabled: boolean);
|
|
25
|
+
get disabled(): boolean;
|
|
26
|
+
set invalid(isInvalid: boolean);
|
|
27
|
+
get invalid(): boolean;
|
|
28
|
+
set text(value: string | null);
|
|
29
|
+
get text(): string | null;
|
|
30
|
+
get focusable(): boolean;
|
|
31
|
+
}
|
|
4
32
|
declare global {
|
|
5
33
|
interface NectaryComponentMap {
|
|
6
34
|
'sinch-checkbox': TSinchCheckbox;
|
package/checkbox/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { setFormValue } from '../utils/form';
|
|
|
4
4
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;flex-direction:row;box-sizing:border-box;width:100%;min-height: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{width:18px;height:18px;cursor:pointer}:host([disabled]) #checkbox{cursor:initial}#icon-container{position:relative;width:18px;height:18px;align-self:flex-start;margin-top:3px}#checkbox::before{content:"";position:absolute;inset:-3px;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}:host(:focus-visible) #checkbox::before{opacity:1}#checkbox::after{content:"";position:absolute;width:18px;height:18px;inset:0;margin:auto;background-color:var(--sinch-local-color-background);border:1px solid var(--sinch-local-color-border);border-radius:var(--sinch-comp-checkbox-shape-radius);transition:background-color .1s linear;box-sizing:border-box;pointer-events:none}:host(:hover:not([disabled])) #checkbox::after{background-color:var(--sinch-local-color-background-hover);border-color:var(--sinch-local-color-border-hover)}:host(:active:not([disabled])) #checkbox::after{background-color:var(--sinch-local-color-background-active);border-color:var(--sinch-local-color-border-active)}#icon-checkmark,#icon-indeterminate{position:absolute;left:1px;top:1px;width:16px;height:16px;transition:opacity .1s linear;opacity:0;pointer-events:none;fill:var(--sinch-sys-color-surface-primary-default)}:host(:not([indeterminate])[checked]) #icon-checkmark{opacity:1}:host([indeterminate][checked]) #icon-indeterminate{opacity:1}@media (prefers-reduced-motion){#checkbox::after,#checkbox::before,#icon-checkmark,#icon-indeterminate{transition:none}}#label{flex:1;align-self:center;padding-left:8px;font:var(--sinch-comp-checkbox-font-label);cursor:pointer;--sinch-global-color-text:var(--sinch-local-color-text)}:host(:not([text])) #label,:host([text=""]) #label{display:none}:host([disabled]) #label{cursor:initial}</style><div id="wrapper"><div id="icon-container"><div id="checkbox"></div><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><sinch-rich-text id="label"></sinch-rich-text></div>';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
|
-
|
|
7
|
+
export class Checkbox extends NectaryElement {
|
|
8
8
|
#$label;
|
|
9
9
|
#controller = null;
|
|
10
10
|
#internals;
|
|
@@ -164,4 +164,5 @@ defineCustomElement('sinch-checkbox', class extends NectaryElement {
|
|
|
164
164
|
#onBlurReactHandler = e => {
|
|
165
165
|
getReactEventHandler(this, 'on-blur')?.(e);
|
|
166
166
|
};
|
|
167
|
-
}
|
|
167
|
+
}
|
|
168
|
+
defineCustomElement('sinch-checkbox', Checkbox);
|