@nectary/components 0.9.0 → 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/cancel/index.js +1 -1
- package/icon/close/index.js +1 -1
- package/icon/create-icon-class.js +1 -1
- package/icon/east/index.js +1 -1
- package/icon/help-outline/index.js +1 -1
- 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 +2 -0
- package/index.js +2 -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.js +1 -6
- 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
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,8 @@ import './tag-close';
|
|
|
19
19
|
import './textarea';
|
|
20
20
|
import './toggle';
|
|
21
21
|
import './tooltip';
|
|
22
|
+
import './dropdown';
|
|
23
|
+
import './dropdown-option';
|
|
22
24
|
import './icon/keyboard-arrow-down';
|
|
23
25
|
import './icon/keyboard-arrow-left';
|
|
24
26
|
import './icon/keyboard-arrow-right';
|
package/index.js
CHANGED
|
@@ -19,6 +19,8 @@ import './tag-close';
|
|
|
19
19
|
import './textarea';
|
|
20
20
|
import './toggle';
|
|
21
21
|
import './tooltip';
|
|
22
|
+
import './dropdown';
|
|
23
|
+
import './dropdown-option';
|
|
22
24
|
import './icon/keyboard-arrow-down';
|
|
23
25
|
import './icon/keyboard-arrow-left';
|
|
24
26
|
import './icon/keyboard-arrow-right';
|
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
|
|
package/link/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
9
9
|
|
|
10
10
|
import '../icon/cancel';
|
|
11
11
|
import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute } from '../utils';
|
|
12
|
-
const templateHTML = '<style>:host{display:inline;outline:0}a{font:var(--sinch-font-body);font-size:inherit;line-height:inherit;color:var(--sinch-color-text-link);fill:var(--sinch-color-text-link)}svg{display:none;transform:translateY(.15em);margin-left:.4em;width:.8em;pointer-events:none}a:hover{color:var(--sinch-color-tropical-600);fill:var(--sinch-color-tropical-600)}:host([disabled]:not([disabled=false])) a{color:var(--sinch-color-tropical-200);pointer-events:none;cursor:initial;fill:var(--sinch-color-tropical-200)}:host([external]:not([external=false])) svg{display:inline-block}</style><a><span></span><svg viewBox="0 0 16 16"><path d="M14.222 14.222H1.778V1.778H8V0H1.778C.79 0 0 .8 0 1.778v12.444C0 15.2.791 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V8h-1.778v6.222ZM9.778 0v1.778h3.19l-8.737 8.738 1.253 1.253 8.738-8.738v3.191H16V0H9.778Z"/></svg></a>';
|
|
12
|
+
const templateHTML = '<style>:host{display:inline;outline:0}a{font:var(--sinch-font-body);font-size:inherit;line-height:inherit;color:var(--sinch-color-text-link);fill:var(--sinch-color-text-link)}svg{display:none;transform:translateY(.15em);margin-left:.4em;width:.8em;pointer-events:none}a:hover{color:var(--sinch-color-tropical-600);fill:var(--sinch-color-tropical-600)}:host([disabled]:not([disabled=false])) a{color:var(--sinch-color-tropical-200);pointer-events:none;cursor:initial;fill:var(--sinch-color-tropical-200)}:host([external]:not([external=false])) svg{display:inline-block}</style><a><span></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M14.222 14.222H1.778V1.778H8V0H1.778C.79 0 0 .8 0 1.778v12.444C0 15.2.791 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V8h-1.778v6.222ZM9.778 0v1.778h3.19l-8.737 8.738 1.253 1.253 8.738-8.738v3.191H16V0H9.778Z"/></svg></a>';
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
|
15
15
|
defineCustomElement('sinch-link', (_$anchor = new WeakMap(), _$text = new WeakMap(), _onClick = new WeakMap(), class extends HTMLElement {
|
|
@@ -37,7 +37,7 @@ defineCustomElement('sinch-link', (_$anchor = new WeakMap(), _$text = new WeakMa
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const shadowRoot = this.attachShadow({
|
|
40
|
-
mode: '
|
|
40
|
+
mode: 'closed',
|
|
41
41
|
delegatesFocus: true
|
|
42
42
|
});
|
|
43
43
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
@@ -10,7 +10,7 @@ export const createLogoClass = 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/logo/sinch-icon/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createLogoClass } from '../create-logo-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 93 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 93 48" aria-hidden="true"><path d="M92.298 25.271a17.167 17.167 0 0 1-.814 5.312c-1.51 4.734-5.27 8.678-10.06 10.549-5.64 2.202-12.252 1.416-18.624-2.21l-4.649-2.67a16.424 16.424 0 0 1-3.563 3.064l-14.817 8.679-.027.015v-7.501l.027-.014 22.29-13.057a16.017 16.017 0 0 1-.713 3.206l4.656 2.65c5.95 3.386 10.388 2.85 13.065 1.806 2.991-1.167 5.323-3.59 6.245-6.483.692-2.15.679-4.467-.04-6.609-.955-2.88-3.319-5.275-6.324-6.41-2.688-1.014-7.132-1.494-13.04 1.962L29.7 38.747l-.043.028c-4.017 2.35-8.14 3.556-12.065 3.58a18.162 18.162 0 0 1-6.53-1.145C6.247 39.396 2.44 35.498.874 30.783A17.116 17.116 0 0 1 .81 20.166c1.51-4.733 5.272-8.676 10.063-10.548 5.64-2.202 12.252-1.416 18.623 2.212l4.649 2.67a16.377 16.377 0 0 1 3.563-3.067l.281-.163 1.726-1.011-7.37-4.197A3.238 3.238 0 0 1 35.551.437l10.591 6.06L56.52.457a3.238 3.238 0 0 1 3.27 5.588l-29.528 17.05c.132-1.017.36-2.019.683-2.992l-4.656-2.65c-5.946-3.383-10.384-2.847-13.061-1.803-2.991 1.167-5.325 3.59-6.247 6.481a10.623 10.623 0 0 0 .039 6.608c.956 2.882 3.321 5.277 6.324 6.41 2.689 1.012 7.136 1.495 13.042-1.966l36.256-21.208c4.017-2.349 8.14-3.555 12.067-3.579a18.112 18.112 0 0 1 6.53 1.145c4.812 1.813 8.62 5.712 10.187 10.426a17.23 17.23 0 0 1 .872 5.304Z"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-logo-sinch-icon', createLogoClass(templateHTML));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineCustomElement } from '../../utils';
|
|
2
2
|
import { createLogoClass } from '../create-logo-class';
|
|
3
|
-
const templateHTML = '<svg viewBox="0 0 236 48"
|
|
3
|
+
const templateHTML = '<svg viewBox="0 0 236 48" aria-hidden="true"><path d="m100.82 36.72 6.606-3.801c1.299 2.603 3.5 3.903 6.602 3.9 2.914 0 4.704-1.299 4.704-3.201 0-1.902-2.498-2.498-6.806-3.401-5.903-1.303-9.703-3.7-9.703-8.704 0-5.412 5.503-9.108 11.605-9.108 5.204 0 8.804 1.403 12.006 5.411l-6.303 3.605c-1.199-2.081-3.001-3.101-5.603-3.101-2.701 0-4.2 1.199-4.2 2.802 0 1.998 3.001 2.397 7.002 3.4 5.503 1.4 9.707 3.301 9.707 8.805 0 5.702-5.603 9.603-12.609 9.603-5.802-.008-10.207-1.607-13.008-6.21Zm29.618 5.41V16.739l7.405-4.333v29.717l-7.405.009Zm12.608 0V26.517c0-8.004 5.903-14.111 14.108-14.111 8.325 0 14.107 6.506 14.107 14.111v15.606h-7.493V27.016c0-4.604-2.801-7.306-6.602-7.306-4.104 0-6.606 2.914-6.606 7.306v15.106l-7.514.009Zm32.203-14.515c0-8.904 6.402-15.21 15.402-15.21 5.603 0 10.602 2.914 13.004 7.405l-6.402 3.805a7.36 7.36 0 0 0-6.702-4.005c-4.404 0-7.705 3.302-7.705 8.005 0 4.604 3.101 8.105 7.705 8.105 3.001 0 5.603-1.503 6.802-4.004l6.402 3.704a14.887 14.887 0 0 1-13.104 7.493c-8.883.009-15.402-6.394-15.402-15.298Zm32.519 14.507V4.304L215.186 0v14.607a12.584 12.584 0 0 1 6.902-2.202c8.204 0 13.907 5.603 13.907 13.907v15.819h-7.493V27.016c0-4.604-2.801-7.306-6.602-7.306-4.104 0-6.606 2.914-6.606 7.306v15.106h-7.526ZM82.892 27.578a15.068 15.068 0 0 1-9.766 14.244C68.06 43.8 62.124 43.072 56.4 39.837l-4.162-2.398a14.752 14.752 0 0 1-3.197 2.752l-13.32 7.792h-.026v-6.722h.025l20.02-11.735a14.647 14.647 0 0 1-.641 2.876l4.162 2.381c5.345 3.04 9.333 2.56 11.735 1.624a9.484 9.484 0 0 0 5.607-5.828 9.67 9.67 0 0 0 .458-2.972 9.257 9.257 0 0 0-6.17-8.717c-2.418-.911-6.406-1.344-11.713 1.761L26.675 39.679l-.038.025c-3.605 2.11-7.31 3.197-10.823 3.217-2.001.02-3.99-.328-5.865-1.028a15.185 15.185 0 0 1-9.22-18.898 15.352 15.352 0 0 1 9.037-9.475c5.066-1.977 11.002-1.274 16.725 1.986l4.163 2.398a14.678 14.678 0 0 1 3.201-2.752l.28-.166 1.552-.908-6.619-3.746a2.915 2.915 0 0 1 2.86-5.058l9.512 5.44 9.32-5.41a2.914 2.914 0 0 1 2.939 5.007l-26.52 15.31a14.67 14.67 0 0 1 .616-2.68l-4.163-2.382c-5.341-3.038-9.325-2.56-11.73-1.619a9.317 9.317 0 0 0 .103 17.508c2.415.912 6.407 1.345 11.714-1.76l32.557-19.053c3.604-2.11 7.31-3.193 10.823-3.214 2-.02 3.987.329 5.86 1.029a15.077 15.077 0 0 1 9.937 14.128"/></svg>';
|
|
4
4
|
defineCustomElement('sinch-logo-sinch-icon-wordmark', createLogoClass(templateHTML));
|
package/package.json
CHANGED
package/pagination/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(
|
|
|
13
13
|
|
|
14
14
|
import '../icon/keyboard-arrow-left';
|
|
15
15
|
import '../icon/keyboard-arrow-right';
|
|
16
|
-
import { defineCustomElement, updateAttribute, getIntegerAttribute } from '../utils';
|
|
16
|
+
import { defineCustomElement, updateAttribute, getIntegerAttribute, setClass } from '../utils';
|
|
17
17
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;justify-content:center;gap:8px;width:100%;box-sizing:border-box}button{all:initial;width:28px;height:28px;box-sizing:border-box;cursor:pointer;text-align:center;contain:strict;--sinch-color-icon:var(--sinch-color-stormy-500)}button:disabled{--sinch-color-icon:var(--sinch-color-stormy-100);cursor:initial}button>*{pointer-events:none}.page{border-radius:50%;font:var(--sinch-font-body);color:var(--sinch-color-stormy-500)}.page.dots>span{display:none}.page.dots::after{content:"..."}.page.active{font:var(--sinch-font-emphasized-body);background-color:var(--sinch-color-snow-600);pointer-events:none;cursor:initial}.page.hidden{display:none}</style><div id="wrapper"><button id="left"><sinch-icon-keyboard-arrow-left></sinch-icon-keyboard-arrow-left></button> <button class="page"><span>1</span></button> <button class="page active"><span>2</span></button> <button class="page"><span>3</span></button> <button class="page"><span>4</span></button> <button class="page"><span>5</span></button> <button class="page dots"><span>6</span></button> <button class="page"><span>20</span></button> <button id="right"><sinch-icon-keyboard-arrow-right></sinch-icon-keyboard-arrow-right></button></div>';
|
|
18
18
|
const NUM_BUTTONS = 7;
|
|
19
19
|
const MIDDLE_BTN_INDEX = Math.floor(NUM_BUTTONS / 2);
|
|
@@ -21,11 +21,6 @@ const FIRST_BTN_INDEX = 0;
|
|
|
21
21
|
const LAST_BTN_INDEX = NUM_BUTTONS - 1;
|
|
22
22
|
const DOTS_LEFT_INDEX = 1;
|
|
23
23
|
const DOTS_RIGHT_INDEX = LAST_BTN_INDEX - 1;
|
|
24
|
-
|
|
25
|
-
const setClass = (elem, name, isSet) => {
|
|
26
|
-
isSet ? elem.classList.add(name) : elem.classList.remove(name);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
24
|
const template = document.createElement('template');
|
|
30
25
|
template.innerHTML = templateHTML;
|
|
31
26
|
defineCustomElement('sinch-pagination', (_$left = new WeakMap(), _$right = new WeakMap(), _$buttons = new WeakMap(), _$wrapper = new WeakMap(), _onValueChange = new WeakSet(), _onButtonClick = new WeakMap(), _clamp = new WeakSet(), _dispatchChangeEvent = new WeakSet(), class extends HTMLElement {
|
package/radio/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare type TSinchRadioElement = HTMLElement & {
|
|
|
5
5
|
};
|
|
6
6
|
export declare type TSinchRadioReact = TSinchElementReact<TSinchRadioElement> & {
|
|
7
7
|
value: string;
|
|
8
|
+
'aria-label': string;
|
|
8
9
|
onChange: (event: SyntheticEvent<TSinchRadioElement, CustomEvent<boolean>>) => void;
|
|
9
10
|
};
|
|
10
11
|
declare global {
|