@nectary/components 0.8.1 → 0.10.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 +5 -1
- package/accordion-item/index.js +7 -7
- package/alert/index.js +2 -2
- package/alert-button/index.js +1 -1
- package/alert-close/index.js +2 -2
- package/button/index.d.ts +2 -1
- package/button/index.js +7 -3
- package/checkbox/index.d.ts +3 -0
- package/checkbox/index.js +27 -18
- package/dropdown/index.d.ts +34 -0
- package/dropdown/index.js +451 -0
- package/dropdown-option/index.d.ts +44 -0
- package/dropdown-option/index.js +116 -0
- package/help-tooltip/index.js +5 -1
- package/icon/arrow-back-ios/index.d.ts +11 -0
- package/icon/arrow-back-ios/index.js +4 -0
- package/icon/arrow-forward-ios/index.d.ts +11 -0
- package/icon/arrow-forward-ios/index.js +4 -0
- package/icon/cancel/index.js +1 -1
- package/icon/chevron-left/index.d.ts +11 -0
- package/icon/chevron-left/index.js +4 -0
- package/icon/chevron-right/index.d.ts +11 -0
- package/icon/chevron-right/index.js +4 -0
- package/icon/close/index.js +1 -1
- package/icon/create-icon-class.js +1 -1
- package/icon/east/index.js +1 -1
- package/icon/expand-less/index.d.ts +11 -0
- package/icon/expand-less/index.js +4 -0
- package/icon/expand-more/index.d.ts +11 -0
- package/icon/expand-more/index.js +4 -0
- package/icon/help-outline/index.js +1 -1
- package/icon/keyboard-arrow-down/index.d.ts +11 -0
- package/icon/keyboard-arrow-down/index.js +4 -0
- package/icon/keyboard-arrow-left/index.d.ts +11 -0
- package/icon/keyboard-arrow-left/index.js +4 -0
- package/icon/keyboard-arrow-right/index.d.ts +11 -0
- package/icon/keyboard-arrow-right/index.js +4 -0
- package/icon/keyboard-arrow-up/index.d.ts +11 -0
- package/icon/keyboard-arrow-up/index.js +4 -0
- package/icon/more-horiz/index.js +1 -1
- package/icon/more-vert/index.js +1 -1
- package/icon/north/index.js +1 -1
- package/icon/north-east/index.js +1 -1
- package/icon/north-west/index.js +1 -1
- package/icon/open-in-new/index.js +1 -1
- package/icon/south/index.js +1 -1
- package/icon/south-east/index.js +1 -1
- package/icon/south-west/index.js +1 -1
- package/icon/west/index.js +1 -1
- package/icon-branded/barchart-down/index.js +1 -1
- package/icon-branded/barchart-up/index.js +1 -1
- package/icon-branded/campaigns/index.js +1 -1
- package/icon-branded/chatbot/index.js +1 -1
- package/icon-branded/contact/index.js +1 -1
- package/icon-branded/create-icon-class.js +1 -1
- package/icon-branded/home/index.js +1 -1
- package/icon-branded/multiple-channels/index.js +1 -1
- package/icon-branded/rocket/index.js +1 -1
- package/icon-branded/settings/index.js +1 -1
- package/icon-branded/user/index.js +1 -1
- package/icon-branded/users/index.js +1 -1
- package/index.d.ts +13 -0
- package/index.js +13 -0
- package/input/index.d.ts +3 -1
- package/input/index.js +59 -11
- package/link/index.js +2 -2
- package/logo/create-logo-class.js +1 -1
- package/logo/sinch-icon/index.js +1 -1
- package/logo/sinch-icon-wordmark/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.d.ts +27 -0
- package/pagination/index.js +219 -0
- package/radio/index.d.ts +1 -0
- package/radio/index.js +97 -71
- package/radio-option/index.d.ts +1 -0
- package/radio-option/index.js +4 -1
- package/select/index.d.ts +4 -1
- package/select/index.js +72 -265
- package/select-option/index.d.ts +3 -17
- package/select-option/index.js +4 -103
- 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/index.js +1 -1
- package/table-head-cell/index.js +3 -2
- package/table-head-sort/index.d.ts +1 -0
- package/table-head-sort/index.js +3 -1
- package/table-row/index.js +1 -1
- package/tabs/index.d.ts +1 -0
- package/tabs/index.js +96 -66
- package/tabs-option/index.d.ts +1 -0
- package/tabs-option/index.js +4 -2
- package/tag/index.js +1 -1
- package/tag-close/index.js +2 -2
- package/textarea/index.d.ts +3 -1
- package/textarea/index.js +58 -11
- package/theme.css +3 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +4 -5
- package/tooltip/index.d.ts +2 -1
- package/tooltip/index.js +7 -3
- package/types.d.ts +7 -0
- package/utils.d.ts +3 -0
- package/utils.js +17 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-chevron-left', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-chevron-right': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-chevron-right': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-chevron-right', createIconClass(templateHTML));
|
package/icon/close/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7A.996.996 0 1 0 5.7 7.11L10.59 12 5.7 16.89a.996.996 0 1 0 1.41 1.41L12 13.41l4.89 4.89a.996.996 0 1 0 1.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-close', createIconClass(templateHTML));
|
|
@@ -10,7 +10,7 @@ export const createIconClass = templateHTML => {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
const shadowRoot = this.attachShadow({
|
|
13
|
-
mode: '
|
|
13
|
+
mode: 'closed'
|
|
14
14
|
});
|
|
15
15
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
16
|
this.$svg = shadowRoot.querySelector('svg');
|
package/icon/east/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M14.29 5.71a.996.996 0 0 0 0 1.41L18.17 11H3c-.55 0-1 .45-1 1s.45 1 1 1h15.18l-3.88 3.88a.996.996 0 1 0 1.41 1.41l5.59-5.59a.996.996 0 0 0 0-1.41l-5.6-5.58a.996.996 0 0 0-1.41 0Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-east', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-expand-less': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-expand-less': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M11.29 8.71 6.7 13.3a.996.996 0 1 0 1.41 1.41L12 10.83l3.88 3.88a.996.996 0 1 0 1.41-1.41L12.7 8.71a.996.996 0 0 0-1.41 0Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-expand-less', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-expand-more': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-expand-more': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M15.88 9.29 12 13.17 8.12 9.29a.996.996 0 1 0-1.41 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59a.996.996 0 0 0 0-1.41c-.39-.38-1.03-.39-1.42 0Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-expand-more', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8Zm-1-4h2v2h-2v-2Zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-help-outline', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-keyboard-arrow-down': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-keyboard-arrow-down': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M8.12 9.29 12 13.17l3.88-3.88a.996.996 0 1 1 1.41 1.41l-4.59 4.59a.996.996 0 0 1-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-keyboard-arrow-down', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-keyboard-arrow-left': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-keyboard-arrow-left': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M14.71 15.88 10.83 12l3.88-3.88a.996.996 0 1 0-1.41-1.41L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-keyboard-arrow-left', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-keyboard-arrow-right': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-keyboard-arrow-right': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M9.29 15.88 13.17 12 9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-keyboard-arrow-right', createIconClass(templateHTML));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-keyboard-arrow-up': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-keyboard-arrow-up': TSinchIconElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineCustomElement } from '../../utils';
|
|
2
|
+
import { createIconClass } from '../create-icon-class';
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24"><path d="M8.12 14.71 12 10.83l3.88 3.88a.996.996 0 1 0 1.41-1.41L12.7 8.71a.996.996 0 0 0-1.41 0L6.7 13.3a.996.996 0 0 0 0 1.41c.39.38 1.03.39 1.42 0Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-keyboard-arrow-up', createIconClass(templateHTML));
|
package/icon/more-horiz/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-more-horiz', createIconClass(templateHTML));
|
package/icon/more-vert/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-more-vert', createIconClass(templateHTML));
|
package/icon/north/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.71 9.7c.39.39 1.02.39 1.41 0L11 5.83V21c0 .55.45 1 1 1s1-.45 1-1V5.83l3.88 3.88a.996.996 0 1 0 1.41-1.41L12.7 2.7a.996.996 0 0 0-1.41 0L5.71 8.29a.996.996 0 0 0 0 1.41Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-north', createIconClass(templateHTML));
|
package/icon/north-east/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6c0 .56.45 1 1 1h5.59L4.7 17.89a.996.996 0 1 0 1.41 1.41L17 8.41V14c0 .55.45 1 1 1s1-.45 1-1V6c0-.55-.45-1-1-1h-8c-.55 0-1 .45-1 1Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-north-east', createIconClass(templateHTML));
|
package/icon/north-west/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 15c.56 0 1-.45 1-1V8.41L17.89 19.3a.996.996 0 1 0 1.41-1.41L8.41 7H14c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-north-west', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1ZM14 4c0 .55.45 1 1 1h2.59l-9.13 9.13a.996.996 0 1 0 1.41 1.41L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-open-in-new', createIconClass(templateHTML));
|
package/icon/south/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18.3 14.29a.996.996 0 0 0-1.41 0L13 18.17V3c0-.55-.45-1-1-1s-1 .45-1 1v15.18L7.12 14.3a.996.996 0 1 0-1.41 1.41l5.59 5.59c.39.39 1.02.39 1.41 0l5.59-5.59c.38-.39.38-1.03 0-1.42Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-south', createIconClass(templateHTML));
|
package/icon/south-east/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 9c-.56 0-1 .45-1 1v5.59L6.12 4.7a.996.996 0 1 0-1.41 1.41L15.59 17H10c-.55 0-1 .45-1 1s.45 1 1 1h8c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-south-east', createIconClass(templateHTML));
|
package/icon/south-west/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18c0-.56-.45-1-1-1H8.41L19.3 6.11a.996.996 0 1 0-1.41-1.41L7 15.59V10c0-.55-.45-1-1-1s-1 .45-1 1v8c0 .55.45 1 1 1h8c.55 0 1-.45 1-1Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-south-west', createIconClass(templateHTML));
|
package/icon/west/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 24 24"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9.7 18.3a.996.996 0 0 0 0-1.41L5.83 13H21c.55 0 1-.45 1-1s-.45-1-1-1H5.83l3.88-3.88A.996.996 0 1 0 8.3 5.71L2.7 11.3a.996.996 0 0 0 0 1.41l5.59 5.59c.39.38 1.03.38 1.41 0Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-west', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.2 37h25.6c.59 0 1.2-.448 1.2-1V12c0-.552-.61-1-1.2-1H11.2c-.59 0-1.2.448-1.2 1v24c0 .552.61 1 1.2 1Zm25.6 2c1.767 0 3.2-1.343 3.2-3V12c0-1.657-1.433-3-3.2-3H11.2C9.433 9 8 10.343 8 12v24c0 1.657 1.433 3 3.2 3h25.6Z"/><path id="accent" d="M35 33a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6Zm-8 0a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V22a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11Zm-9 1a1 1 0 0 0 1-1V15a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h4Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-barchart-down', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M36.8 11H11.2c-.59 0-1.2.448-1.2 1v24c0 .552.61 1 1.2 1h25.6c.59 0 1.2-.448 1.2-1V12c0-.552-.61-1-1.2-1ZM11.2 9C9.433 9 8 10.343 8 12v24c0 1.657 1.433 3 3.2 3h25.6c1.767 0 3.2-1.343 3.2-3V12c0-1.657-1.433-3-3.2-3H11.2Z"/><path id="accent" d="M30 14a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V15a1 1 0 0 0-1-1h-4Zm-9 8a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V22Zm-8 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-6Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-barchart-up', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path d="M40.761 11.657 7.085 20.52a.114.114 0 0 0-.017.216l9.857 4.413-1.855 1.36-8.82-3.948a2.115 2.115 0 0 1 .326-3.975l34.355-9.04a1.506 1.506 0 0 1 1.884 1.587l-1.785 20.52c-.02.23-.083.453-.186.658a5.471 5.471 0 0 1-7.129 2.547l-12.391-5.549 1.855-1.36 11.354 5.083a3.47 3.47 0 0 0 4.508-1.586l1.72-19.789Z"/><path id="accent" d="M24.854 30.89 19 37.394v-8.863L37.06 16.33a1 1 0 1 0-1.12-1.658L17 27.47v9.925c0 1.833 2.26 2.7 3.487 1.338l6.285-6.983-1.918-.86Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-campaigns', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M25 10.874A4.002 4.002 0 0 0 24 3a4 4 0 0 0-1 7.874V13H12a3 3 0 0 0-3 3v16a3 3 0 0 0 3 3h2v5.69L23.95 35H36a3 3 0 0 0 3-3V16a3 3 0 0 0-3-3H25v-2.126ZM26 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm10 8.01a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H23.43L16 37.25V33h-4a1 1 0 0 1-1-1V16a1 1 0 0 1 1-1l24 .01Z"/><path id="accent" d="M18 18a4 4 0 0 0-3.465 6s1.152-2 3.465-2c2.313 0 3.465 2 3.465 2A4 4 0 0 0 18 18Zm12 0a4 4 0 0 0-3.465 6s1.152-2 3.465-2c2.313 0 3.465 2 3.465 2A4 4 0 0 0 30 18ZM19 28a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-4Zm8 1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-chatbot', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M25 11h-8c-5.523 0-10 4.477-10 10v10h18c5.523 0 10-4.477 10-10s-4.477-10-10-10Zm-8-2C10.373 9 5 14.373 5 21v12h20c6.627 0 12-5.373 12-12S31.627 9 25 9h-8Z"/><path d="M16 21a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm7 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm7 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/><path id="accent" d="M23 39a11.97 11.97 0 0 1-8.944-4h2.943A9.956 9.956 0 0 0 23 37h18V26.922a9.91 9.91 0 0 0-4.198-8.106 11.906 11.906 0 0 0-.878-2.79A11.923 11.923 0 0 1 43 26.922V39H23Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-contact', createIconClass(templateHTML));
|
|
@@ -10,7 +10,7 @@ export const createIconClass = templateHTML => {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
const shadowRoot = this.attachShadow({
|
|
13
|
-
mode: '
|
|
13
|
+
mode: 'closed'
|
|
14
14
|
});
|
|
15
15
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
16
|
this.$svg = shadowRoot.querySelector('svg');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M25.076 10.128a1 1 0 0 0-1.152 0l-11.5 8.092a1 1 0 0 0-.424.818V35.5c0 .552.448 1.5 1 1.5h6V24.5a3 3 0 0 1 3-3h5a3 3 0 0 1 3 3V37h6c.552 0 1-.948 1-1.5V19.038a1 1 0 0 0-.425-.818l-11.5-8.092ZM28 37V24.5a1 1 0 0 0-1-1h-5a1 1 0 0 0-1 1V37h7ZM22.773 8.492a3 3 0 0 1 3.454 0l11.5 8.093A3 3 0 0 1 39 19.038V35.5c0 1.657-1.343 3.5-3 3.5H13c-1.657 0-3-1.843-3-3.5V19.038a3 3 0 0 1 1.274-2.453l11.5-8.093Z"/><path id="accent" fill-rule="evenodd" clip-rule="evenodd" d="M23.923 3.183a1 1 0 0 1 1.17.011l17 12.5a1 1 0 0 1-1.185 1.612L24.488 5.232 11.587 14.34l-3.99 2.964a1 1 0 1 1-1.193-1.606L10 13.026V7a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1v2.128l8.423-5.945ZM13.501 10.54V8H12v3.599l1.5-1.06Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-home', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h2v5.266L20.777 24H28a2 2 0 0 0 2-2V12h7.5a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-.5.5H34v4.131L27.803 26h-6.56l-2.513 1.545c.346.284.788.455 1.27.455h7.197L36 33.868V32h1.5a.5.5 0 0 1 .5.5v4c0 .5 0 1.5-.5 1.5h-27c-.5 0-.5-.5-.5-1.5v-4a.5.5 0 0 1 .5-.5h16.78L25 30H10a2 2 0 0 0-2 2v5c0 2 0 3 2 3h28c2 0 2-1 2-3v-5a2 2 0 0 0-2-2h-2v-2h2a2 2 0 0 0 2-2V12a2 2 0 0 0-2-2h-8V8a2 2 0 0 0-2-2H10Zm0 2.5a.5.5 0 0 1 .5-.5h17a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-.5.5h-7.277L14 25.734V22h-3.5a.5.5 0 0 1-.5-.5v-13Z"/><path id="accent" fill-rule="evenodd" clip-rule="evenodd" d="M13 12a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H13Zm0 4a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H13Zm-1 19a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H13a1 1 0 0 1-1-1Zm16 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-multiple-channels', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M37.643 6.083c.953.142 2.045.523 2.743 1.222.298.298.46.688.557 1.02.103.353.166.754.2 1.175.07.844.034 1.867-.097 2.945-.26 2.142-1.085 4.626-2.173 6.53-1.086 1.902-2.941 3.741-4.46 5.07a39.759 39.759 0 0 1-2.408 1.944v8.464a2 2 0 0 1-.867 1.648l-6.38 4.386a2 2 0 0 1-3.073-1.163l-1.583-6.333-6.108-6.109L7.66 25.3a2 2 0 0 1-1.163-3.073l4.386-6.38a2 2 0 0 1 1.648-.866h7.95a30.882 30.882 0 0 1 2.054-2.578c1.405-1.58 3.408-3.479 5.6-4.351 1.991-.793 4.324-1.575 6.444-1.897 1.06-.16 2.112-.214 3.064-.071ZM19.163 16.98H12.53l-4.386 6.379 5.91 1.477 5.107-7.856Zm-3.378 8.865 5.334 5.334 9.312-6.518.002-.002.01-.006.038-.027.154-.111a37.704 37.704 0 0 0 2.462-1.975c1.481-1.296 3.126-2.957 4.04-4.556.912-1.597 1.684-3.797 1.924-5.78.12-.985.145-1.867.09-2.54a4.046 4.046 0 0 0-.127-.776.96.96 0 0 0-.072-.188c-.302-.292-.936-.54-1.604-.64-.684-.102-1.52-.072-2.469.071-1.897.288-4.065 1.006-6.004 1.778-1.739.692-3.485 2.292-4.847 3.822a28.839 28.839 0 0 0-2.04 2.582l-.113.164-.027.041-.006.01h-.001l-6.056 9.317Zm14.22 1.555-7.863 5.505 1.484 5.934 6.379-4.386V27.4Z"/><path id="accent" d="M30 18.984a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12.583 38.532a3.5 3.5 0 1 0-4.193-5.605c-1.548 1.158-2.205 4.904-2.205 6.904 0 .5 4.85-.14 6.398-1.299Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-rocket', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="m32.204 13.831-.313.195c-2.46 1.537-5.662.153-6.317-2.713-.388-1.701-2.76-1.701-3.148 0-.655 2.866-3.856 4.25-6.317 2.713l-.313-.195c-1.348-.842-2.935.775-2.04 2.177 1.595 2.497.26 5.865-2.595 6.502-1.562.35-1.562 2.63 0 2.98 2.854.637 4.19 4.006 2.596 6.502-.896 1.402.69 3.019 2.04 2.177l.311-.195c2.462-1.537 5.663-.153 6.318 2.713.388 1.701 2.76 1.701 3.148 0 .655-2.866 3.856-4.25 6.317-2.713l.313.195c1.348.842 2.935-.775 2.04-2.177-1.595-2.497-.26-5.865 2.595-6.502 1.562-.35 1.562-2.63 0-2.98-2.854-.637-4.19-4.006-2.596-6.502.896-1.402-.69-3.019-2.04-2.177ZM27.51 10.85c-.867-3.799-6.155-3.799-7.022 0-.348 1.52-2.044 2.25-3.345 1.438l-.312-.195c-3.184-1.988-6.781 1.836-4.74 5.031.833 1.306.133 3.064-1.355 3.397-3.65.815-3.65 6.145 0 6.96 1.488.333 2.188 2.091 1.355 3.397-2.041 3.195 1.556 7.019 4.74 5.031l.312-.195c1.301-.812 2.998-.081 3.345 1.438.867 3.799 6.155 3.799 7.022 0 .348-1.52 2.044-2.25 3.345-1.438l.312.195c3.184 1.988 6.781-1.836 4.74-5.031-.833-1.306-.133-3.064 1.355-3.397 3.65-.815 3.65-6.145 0-6.96-1.488-.333-2.188-2.091-1.355-3.397 2.041-3.195-1.556-7.019-4.74-5.031l-.312.195c-1.301.812-2.998.081-3.345-1.438Z"/><path id="accent" fill-rule="evenodd" clip-rule="evenodd" d="M24 21a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm-5 3a5 5 0 1 1 10 0 5 5 0 0 1-10 0Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-settings', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path id="accent" fill-rule="evenodd" clip-rule="evenodd" d="M24 13a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-6 4a6 6 0 1 1 12 0 6 6 0 0 1-12 0Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M17.724 31.24C16.111 32.705 15 34.929 15 38a1 1 0 1 1-2 0c0-3.596 1.322-6.371 3.378-8.24 2.04-1.854 4.74-2.76 7.425-2.76 5.385 0 10.909 3.675 11.196 10.96a1 1 0 1 1-1.998.08c-.239-6.05-4.715-9.04-9.198-9.04-2.25 0-4.451.76-6.08 2.24Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-user', createIconClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createIconClass } from '../create-icon-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 48 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 48 48" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M19 11a6 6 0 1 0 0 12 6 6 0 0 0 0-12Zm-4 6a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z"/><path d="M10 38c0-3.071 1.112-5.295 2.723-6.76 1.628-1.48 3.83-2.24 6.08-2.24 4.483 0 8.959 2.991 9.198 9.04a1 1 0 1 0 1.998-.08C29.712 30.676 24.188 27 18.803 27c-2.685 0-5.385.906-7.425 2.76C9.322 31.629 8 34.404 8 38a1 1 0 1 0 2 0Z"/><path id="accent" d="M30.296 11.457A6 6 0 0 0 28 11v2a4 4 0 0 1 0 8v2a6 6 0 0 0 2.296-11.543ZM32 29.804v-2.158c3.731 1.352 6.793 4.82 7 10.316a1 1 0 1 1-2 .075c-.16-4.26-2.296-6.982-5-8.233Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-icon-users', createIconClass(templateHTML));
|
package/index.d.ts
CHANGED
|
@@ -19,6 +19,18 @@ import './tag-close';
|
|
|
19
19
|
import './textarea';
|
|
20
20
|
import './toggle';
|
|
21
21
|
import './tooltip';
|
|
22
|
+
import './dropdown';
|
|
23
|
+
import './dropdown-option';
|
|
24
|
+
import './icon/keyboard-arrow-down';
|
|
25
|
+
import './icon/keyboard-arrow-left';
|
|
26
|
+
import './icon/keyboard-arrow-right';
|
|
27
|
+
import './icon/keyboard-arrow-up';
|
|
28
|
+
import './icon/chevron-left';
|
|
29
|
+
import './icon/chevron-right';
|
|
30
|
+
import './icon/expand-less';
|
|
31
|
+
import './icon/expand-more';
|
|
32
|
+
import './icon/arrow-back-ios';
|
|
33
|
+
import './icon/arrow-forward-ios';
|
|
22
34
|
import './icon/cancel';
|
|
23
35
|
import './icon/close';
|
|
24
36
|
import './icon/east';
|
|
@@ -33,6 +45,7 @@ import './icon/south';
|
|
|
33
45
|
import './icon/south-east';
|
|
34
46
|
import './icon/south-west';
|
|
35
47
|
import './icon/west';
|
|
48
|
+
import './pagination';
|
|
36
49
|
import './table';
|
|
37
50
|
import './table-cell';
|
|
38
51
|
import './table-head';
|
package/index.js
CHANGED
|
@@ -19,6 +19,18 @@ import './tag-close';
|
|
|
19
19
|
import './textarea';
|
|
20
20
|
import './toggle';
|
|
21
21
|
import './tooltip';
|
|
22
|
+
import './dropdown';
|
|
23
|
+
import './dropdown-option';
|
|
24
|
+
import './icon/keyboard-arrow-down';
|
|
25
|
+
import './icon/keyboard-arrow-left';
|
|
26
|
+
import './icon/keyboard-arrow-right';
|
|
27
|
+
import './icon/keyboard-arrow-up';
|
|
28
|
+
import './icon/chevron-left';
|
|
29
|
+
import './icon/chevron-right';
|
|
30
|
+
import './icon/expand-less';
|
|
31
|
+
import './icon/expand-more';
|
|
32
|
+
import './icon/arrow-back-ios';
|
|
33
|
+
import './icon/arrow-forward-ios';
|
|
22
34
|
import './icon/cancel';
|
|
23
35
|
import './icon/close';
|
|
24
36
|
import './icon/east';
|
|
@@ -33,6 +45,7 @@ import './icon/south';
|
|
|
33
45
|
import './icon/south-east';
|
|
34
46
|
import './icon/south-west';
|
|
35
47
|
import './icon/west';
|
|
48
|
+
import './pagination';
|
|
36
49
|
import './table';
|
|
37
50
|
import './table-cell';
|
|
38
51
|
import './table-head';
|
package/input/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
import type { FocusEvent, SyntheticEvent } from 'react';
|
|
2
|
+
import type { DOMAttributes, FocusEvent, SyntheticEvent } from 'react';
|
|
3
3
|
export declare type TSinchInputElement = HTMLElement & {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
@@ -19,7 +19,9 @@ export declare type TSinchInputReact = TSinchElementReact<TSinchInputElement> &
|
|
|
19
19
|
invalidText?: string;
|
|
20
20
|
additionalText?: string;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
+
'aria-label': string;
|
|
22
23
|
onChange: (e: SyntheticEvent<TSinchInputElement, CustomEvent<string>>) => void;
|
|
24
|
+
onKeyPress?: DOMAttributes<TSinchInputElement>['onKeyPress'];
|
|
23
25
|
onFocus?: (e: FocusEvent<TSinchInputElement>) => void;
|
|
24
26
|
onBlur?: (e: FocusEvent<TSinchInputElement>) => void;
|
|
25
27
|
};
|
package/input/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
2
2
|
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
3
3
|
|
|
4
|
-
var _$input, _$label, _$optionalText, _$additionalText, _$invalidText, _onInput;
|
|
4
|
+
var _$input, _$label, _$optionalText, _$additionalText, _$invalidText, _selectionStart, _selectionEnd, _onInput;
|
|
5
5
|
|
|
6
6
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
10
|
import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
11
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{width:100%;box-sizing:border-box}#input{all:initial;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:2px;width:100%;height:48px;margin:2px 0;padding:0 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100)}#input:disabled::placeholder{color:var(--sinch-color-snow-500)}#input:focus{border-color:var(--sinch-color-stormy-300)}:host([invalidtext]:not([invalidtext=""])) #input:not(:disabled){border-color:var(--sinch-color-text-invalid)}#bottom,#top{display:flex;align-items:baseline}#top{height:24px}#bottom{height:20px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-4);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted)}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid)}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="input"></label><slot name="tooltip"></slot><span id="optional"></span></div><input id="input" type="text"/><div id="bottom"><span id="invalid"></span> <span id="additional"></span></div></div>';
|
|
11
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;--sinch-color-icon:var(--sinch-color-stormy-500)}#wrapper{width:100%;box-sizing:border-box}#input{all:initial;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:2px;width:100%;height:48px;margin:2px 0;padding:0 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100)}#input:disabled::placeholder{color:var(--sinch-color-snow-500)}#input:focus{border-color:var(--sinch-color-stormy-300)}:host([invalidtext]:not([invalidtext=""])) #input:not(:disabled){border-color:var(--sinch-color-text-invalid)}#bottom,#top{display:flex;align-items:baseline}#top{height:24px}#bottom{height:20px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-4);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted)}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid)}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="input"></label><slot name="tooltip"></slot><span id="optional"></span></div><input id="input" type="text"/><div id="bottom"><span id="invalid"></span> <span id="additional"></span></div></div>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _onInput = new WeakMap(), class extends HTMLElement {
|
|
14
|
+
defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _selectionStart = new WeakMap(), _selectionEnd = new WeakMap(), _onInput = new WeakMap(), class extends HTMLElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
|
|
@@ -40,21 +40,55 @@ defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakM
|
|
|
40
40
|
value: void 0
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
_classPrivateFieldInitSpec(this, _selectionStart, {
|
|
44
|
+
writable: true,
|
|
45
|
+
value: null
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
_classPrivateFieldInitSpec(this, _selectionEnd, {
|
|
49
|
+
writable: true,
|
|
50
|
+
value: null
|
|
51
|
+
});
|
|
52
|
+
|
|
43
53
|
_classPrivateFieldInitSpec(this, _onInput, {
|
|
44
54
|
writable: true,
|
|
45
55
|
value: e => {
|
|
46
56
|
e.stopPropagation();
|
|
47
|
-
|
|
48
|
-
_classPrivateFieldGet(this, _$input).value
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
|
|
58
|
+
const nextValue = _classPrivateFieldGet(this, _$input).value;
|
|
59
|
+
|
|
60
|
+
const prevValue = this.value;
|
|
61
|
+
|
|
62
|
+
if (prevValue !== nextValue) {
|
|
63
|
+
const nextSelectionStart = _classPrivateFieldGet(this, _$input).selectionStart;
|
|
64
|
+
|
|
65
|
+
const nextSelectionEnd = _classPrivateFieldGet(this, _$input).selectionEnd;
|
|
66
|
+
|
|
67
|
+
const prevSelectionStart = _classPrivateFieldGet(this, _selectionStart);
|
|
68
|
+
|
|
69
|
+
const prevSelectionEnd = _classPrivateFieldGet(this, _selectionEnd);
|
|
70
|
+
|
|
71
|
+
const isPrevCursorEnd = prevSelectionStart === prevSelectionEnd && prevSelectionStart === prevValue.length;
|
|
72
|
+
_classPrivateFieldGet(this, _$input).value = prevValue;
|
|
73
|
+
|
|
74
|
+
if (!isPrevCursorEnd) {
|
|
75
|
+
_classPrivateFieldGet(this, _$input).setSelectionRange(prevSelectionStart, prevSelectionEnd);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_classPrivateFieldSet(this, _selectionStart, nextSelectionStart);
|
|
79
|
+
|
|
80
|
+
_classPrivateFieldSet(this, _selectionEnd, nextSelectionEnd);
|
|
81
|
+
|
|
82
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
83
|
+
detail: nextValue,
|
|
84
|
+
bubbles: true
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
53
87
|
}
|
|
54
88
|
});
|
|
55
89
|
|
|
56
90
|
const shadowRoot = this.attachShadow({
|
|
57
|
-
mode: '
|
|
91
|
+
mode: 'closed',
|
|
58
92
|
delegatesFocus: true
|
|
59
93
|
});
|
|
60
94
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
@@ -71,6 +105,8 @@ defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakM
|
|
|
71
105
|
}
|
|
72
106
|
|
|
73
107
|
connectedCallback() {
|
|
108
|
+
this.setAttribute('role', 'textbox');
|
|
109
|
+
|
|
74
110
|
_classPrivateFieldGet(this, _$input).addEventListener('input', _classPrivateFieldGet(this, _onInput));
|
|
75
111
|
}
|
|
76
112
|
|
|
@@ -150,7 +186,17 @@ defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakM
|
|
|
150
186
|
switch (name) {
|
|
151
187
|
case 'value':
|
|
152
188
|
{
|
|
153
|
-
|
|
189
|
+
const nextVal = newVal ?? '';
|
|
190
|
+
|
|
191
|
+
if (nextVal !== _classPrivateFieldGet(this, _$input).value) {
|
|
192
|
+
_classPrivateFieldGet(this, _$input).value = nextVal;
|
|
193
|
+
const isNextCursorEnd = _classPrivateFieldGet(this, _selectionStart) === _classPrivateFieldGet(this, _selectionEnd) && (_classPrivateFieldGet(this, _selectionStart) === null || _classPrivateFieldGet(this, _selectionStart) === nextVal.length);
|
|
194
|
+
|
|
195
|
+
if (!isNextCursorEnd) {
|
|
196
|
+
_classPrivateFieldGet(this, _$input).setSelectionRange(_classPrivateFieldGet(this, _selectionStart), _classPrivateFieldGet(this, _selectionEnd));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
154
200
|
break;
|
|
155
201
|
}
|
|
156
202
|
|
|
@@ -163,6 +209,7 @@ defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakM
|
|
|
163
209
|
case 'placeholder':
|
|
164
210
|
{
|
|
165
211
|
_classPrivateFieldGet(this, _$input).placeholder = newVal ?? '';
|
|
212
|
+
updateAttribute(this, 'aria-placeholder', newVal);
|
|
166
213
|
break;
|
|
167
214
|
}
|
|
168
215
|
|
|
@@ -181,6 +228,7 @@ defineCustomElement('sinch-input', (_$input = new WeakMap(), _$label = new WeakM
|
|
|
181
228
|
case 'invalidtext':
|
|
182
229
|
{
|
|
183
230
|
_classPrivateFieldGet(this, _$invalidText).textContent = newVal;
|
|
231
|
+
updateAttribute(this, 'aria-invalid', String(newVal !== null && newVal !== ''));
|
|
184
232
|
break;
|
|
185
233
|
}
|
|
186
234
|
|