@nectary/components 0.21.0 → 0.22.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/icon/filter-list/index.d.ts +11 -0
- package/icon/filter-list/index.js +4 -0
- package/icon-button/index.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/input/index.js +1 -1
- package/package.json +1 -1
- package/search/index.js +1 -1
- package/table-body/index.js +1 -1
- package/table-head-cell/index.js +1 -1
- package/table-row/index.d.ts +2 -0
- package/table-row/index.js +8 -0
- package/textarea/index.js +1 -1
- package/theme.css +2 -0
- package/table-head-sort/index.d.ts +0 -26
- package/table-head-sort/index.js +0 -94
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSinchIconElement, TSinchIconReact } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
'sinch-icon-filter-list': TSinchIconReact;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'sinch-icon-filter-list': 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" aria-hidden="true"><path d="M11 18h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1ZM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1Zm4 6h10c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1Z"/></svg>';
|
|
4
|
+
defineCustomElement('sinch-icon-filter-list', createIconClass(templateHTML));
|
package/icon-button/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
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, getBooleanAttribute, isAttrTrue, updateBooleanAttribute } from '../utils';
|
|
11
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:48px;border-radius:4px;background-color:transparent;box-shadow:0 0 0 1px transparent inset;cursor:pointer;--sinch-size-icon:24px;--sinch-color-icon:var(--sinch-color-stormy-500)}button:focus{box-shadow:0 0 0 1px var(--sinch-color-stormy-500) inset}button:hover{background-color:var(--sinch-color-snow-500)}button:active{background-color:var(--sinch-color-snow-600)}button:disabled{background-color:transparent;cursor:initial;--sinch-color-spinner-bg:var(--sinch-color-snow-200);--sinch-color-spinner-fg:var(--sinch-color-stormy-200);--sinch-color-icon:var(--sinch-color-stormy-100)}:host([small]:not([small=false]))>button{width:32px;height:32px}button>*{pointer-events:none}</style><button><slot name="icon"></slot></button>';
|
|
11
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:48px;border-radius:4px;background-color:transparent;box-shadow:0 0 0 1px transparent inset;cursor:pointer;--sinch-size-icon:24px;--sinch-color-icon:var(--sinch-icon-button-color, var(--sinch-color-stormy-500))}button:focus{box-shadow:0 0 0 1px var(--sinch-color-stormy-500) inset}button:hover{background-color:var(--sinch-color-snow-500)}button:active{background-color:var(--sinch-color-snow-600)}button:disabled{background-color:transparent;cursor:initial;--sinch-color-spinner-bg:var(--sinch-color-snow-200);--sinch-color-spinner-fg:var(--sinch-color-stormy-200);--sinch-color-icon:var(--sinch-color-stormy-100)}:host([small]:not([small=false]))>button{width:32px;height:32px}button>*{pointer-events:none}</style><button><slot name="icon"></slot></button>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
14
|
defineCustomElement('sinch-icon-button', (_$button = new WeakMap(), class extends HTMLElement {
|
package/index.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ import './icon/arrow-right';
|
|
|
90
90
|
import './icon/campaign';
|
|
91
91
|
import './icon/check';
|
|
92
92
|
import './icon/double-arrow';
|
|
93
|
+
import './icon/filter-list';
|
|
93
94
|
import './icon/first-page';
|
|
94
95
|
import './icon/fullscreen';
|
|
95
96
|
import './icon/fullscreen-exit';
|
|
@@ -114,7 +115,6 @@ import './table';
|
|
|
114
115
|
import './table-cell';
|
|
115
116
|
import './table-head';
|
|
116
117
|
import './table-head-cell';
|
|
117
|
-
import './table-head-sort';
|
|
118
118
|
import './table-body';
|
|
119
119
|
import './table-row';
|
|
120
120
|
import './spinner';
|
package/index.js
CHANGED
|
@@ -90,6 +90,7 @@ import './icon/arrow-right';
|
|
|
90
90
|
import './icon/campaign';
|
|
91
91
|
import './icon/check';
|
|
92
92
|
import './icon/double-arrow';
|
|
93
|
+
import './icon/filter-list';
|
|
93
94
|
import './icon/first-page';
|
|
94
95
|
import './icon/fullscreen';
|
|
95
96
|
import './icon/fullscreen-exit';
|
|
@@ -114,7 +115,6 @@ import './table';
|
|
|
114
115
|
import './table-cell';
|
|
115
116
|
import './table-head';
|
|
116
117
|
import './table-head-cell';
|
|
117
|
-
import './table-head-sort';
|
|
118
118
|
import './table-body';
|
|
119
119
|
import './table-row';
|
|
120
120
|
import './spinner';
|
package/input/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
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, getLiteralAttribute, isAttrTrue, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
|
|
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:4px;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-600)}#input[type=password]{font-size:1.5em;letter-spacing:.1em}: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-s);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:4px;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);background-color:var(--sinch-color-snow-100)}#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-600)}#input[type=password]{font-size:1.5em;letter-spacing:.1em}: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-s);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 inputTypes = ['text', 'password'];
|
|
13
13
|
const template = document.createElement('template');
|
|
14
14
|
template.innerHTML = templateHTML;
|
package/package.json
CHANGED
package/search/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(
|
|
|
13
13
|
|
|
14
14
|
import { isSearchOptionElement } from '../search-option';
|
|
15
15
|
import { attrValueToPixels, defineCustomElement, getAttribute, getIntegerAttribute, getRect, updateAttribute, updateIntegerAttribute } from '../utils';
|
|
16
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:4px;width:100%;height:48px;padding:0 44px;padding-right: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:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 4px rgba(0,0,0,.15);overflow-y:auto;contain:content}:host([aria-expanded=true]) #listbox{display:block}:host([label]:not([label=""])) #label{display:block}</style><label id="label" for="input"></label><div id="wrapper"><input id="input" type="text"/><sinch-icon-search id="icon-search"></sinch-icon-search><sinch-icon-button id="clear" small><sinch-icon-close id="icon-close" slot="icon"></sinch-icon-close></sinch-icon-button><div id="listbox"><slot name="option"></slot></div></div>';
|
|
16
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:4px;width:100%;height:48px;padding:0 44px;padding-right:12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 4px rgba(0,0,0,.15);overflow-y:auto;contain:content}:host([aria-expanded=true]) #listbox{display:block}:host([label]:not([label=""])) #label{display:block}</style><label id="label" for="input"></label><div id="wrapper"><input id="input" type="text"/><sinch-icon-search id="icon-search"></sinch-icon-search><sinch-icon-button id="clear" small><sinch-icon-close id="icon-close" slot="icon"></sinch-icon-close></sinch-icon-button><div id="listbox"><slot name="option"></slot></div></div>';
|
|
17
17
|
import '../icon/search';
|
|
18
18
|
import '../icon/close';
|
|
19
19
|
import '../icon-button';
|
package/table-body/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement } from '../utils';
|
|
2
|
-
const templateHTML = '<style>:host{display:table-row-group}</style><slot></slot>';
|
|
2
|
+
const templateHTML = '<style>:host{display:table-row-group}::slotted(sinch-table-row:hover){background-color:var(--sinch-color-tropical-50)}::slotted(sinch-table-row[selected]:not([selected=false])){background-color:var(--sinch-color-tropical-100)}</style><slot></slot>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
5
|
defineCustomElement('sinch-table-body', class extends HTMLElement {
|
package/table-head-cell/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
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, getLiteralAttribute, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
|
|
11
|
-
const templateHTML = '<style>:host{display:table-cell;border-bottom:1px solid var(--sinch-color-stormy-200);height:48px;vertical-align:middle;padding:0 6px;--sinch-color-icon:var(--sinch-color-stormy-200)}:host(:first-child){padding-left:8px}:host(:last-child){padding-right:8px}#wrapper{position:relative;width:100%;height:100%;box-sizing:border-box;font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-300)
|
|
11
|
+
const templateHTML = '<style>:host{display:table-cell;border-bottom:1px solid var(--sinch-color-stormy-200);height:48px;vertical-align:middle;padding:0 6px;--sinch-color-icon:var(--sinch-color-stormy-200)}:host(:first-child){padding-left:8px}:host(:last-child){padding-right:8px}#wrapper{position:relative;display:flex;align-items:center;gap:8px;width:100%;height:100%;box-sizing:border-box;font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-300);--sinch-icon-button-color:var(--sinch-color-stormy-100)}#text{flex-shrink:1;min-width:0;font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-200);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([align=center])>#wrapper{justify-content:center}:host([align=end])>#wrapper{justify-content:flex-end}:host(:is([text=""],:not([text])))>#wrapper{display:none}:host([fit]:not([fit=false])){width:1px}</style><slot name="checkbox"></slot><div id="wrapper"><slot name="left"></slot><span id="text"></span><slot name="tooltip"></slot><slot name="right"></slot></div>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
14
|
const alignValues = ['start', 'center', 'end'];
|
package/table-row/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
2
|
export declare type TSinchTableRowElement = HTMLElement & {
|
|
3
3
|
sticky: boolean;
|
|
4
|
+
selected: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare type TSinchTableRowReact = TSinchElementReact<TSinchTableRowElement> & {
|
|
6
7
|
sticky?: boolean;
|
|
8
|
+
selected?: boolean;
|
|
7
9
|
};
|
|
8
10
|
declare global {
|
|
9
11
|
namespace JSX {
|
package/table-row/index.js
CHANGED
|
@@ -23,4 +23,12 @@ defineCustomElement('sinch-table-row', class extends HTMLElement {
|
|
|
23
23
|
return getBooleanAttribute(this, 'sticky');
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
set selected(isSelected) {
|
|
27
|
+
updateBooleanAttribute(this, 'selected', isSelected);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get selected() {
|
|
31
|
+
return getBooleanAttribute(this, 'selected');
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
});
|
package/textarea/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
|
|
|
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, getIntegerAttribute, isAttrTrue, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
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:4px;width:100%;margin:2px 0;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);resize:none}#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-600)}:host([resizable]:not([resizable=false])) #input{resize:vertical}: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-s);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><textarea id="input"></textarea><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:4px;width:100%;margin:2px 0;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100);resize:none}#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-600)}:host([resizable]:not([resizable=false])) #input{resize:vertical}: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-s);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><textarea id="input"></textarea><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
14
|
defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _selectionStart = new WeakMap(), _selectionEnd = new WeakMap(), _isPendingDk = new WeakMap(), _onCompositionStart = new WeakMap(), _onInput = new WeakMap(), class extends HTMLElement {
|
package/theme.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
--sinch-color-tropical-300: #66AAAA;
|
|
16
16
|
--sinch-color-tropical-200: #99C6C6;
|
|
17
17
|
--sinch-color-tropical-100: #CCE3E3;
|
|
18
|
+
--sinch-color-tropical-50: #E5F1F1;
|
|
18
19
|
--sinch-color-stormy-600: #061927;
|
|
19
20
|
--sinch-color-stormy-500: #0A273D;
|
|
20
21
|
--sinch-color-stormy-400: #3B5264;
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
--sinch-color-raspberry-300: #EE778B;
|
|
34
35
|
--sinch-color-raspberry-200: #F4A4B1;
|
|
35
36
|
--sinch-color-raspberry-100: #F9D2D8;
|
|
37
|
+
--sinch-color-raspberry-50: #FCE8EB;
|
|
36
38
|
--sinch-color-text-default: #0A273D;
|
|
37
39
|
--sinch-color-text-inverted: #FFFFFF;
|
|
38
40
|
--sinch-color-text-muted: #677784;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import '../icon/north';
|
|
2
|
-
import '../icon/south';
|
|
3
|
-
import type { TSinchElementReact } from '../types';
|
|
4
|
-
import type { FocusEvent, SyntheticEvent } from 'react';
|
|
5
|
-
export declare type TSinchTableHeaderSortElement = HTMLElement & {
|
|
6
|
-
value: boolean;
|
|
7
|
-
focus(): void;
|
|
8
|
-
blur(): void;
|
|
9
|
-
};
|
|
10
|
-
export declare type TSinchTableHeaderSortReact = TSinchElementReact<TSinchTableHeaderSortElement> & {
|
|
11
|
-
value: boolean;
|
|
12
|
-
'aria-label': string;
|
|
13
|
-
onChange: (e: SyntheticEvent<TSinchTableHeaderSortElement, CustomEvent<boolean>>) => void;
|
|
14
|
-
onFocus?: (e: FocusEvent<TSinchTableHeaderSortElement>) => void;
|
|
15
|
-
onBlur?: (e: FocusEvent<TSinchTableHeaderSortElement>) => void;
|
|
16
|
-
};
|
|
17
|
-
declare global {
|
|
18
|
-
namespace JSX {
|
|
19
|
-
interface IntrinsicElements {
|
|
20
|
-
'sinch-table-head-sort': TSinchTableHeaderSortReact;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
interface HTMLElementTagNameMap {
|
|
24
|
-
'sinch-table-head-sort': TSinchTableHeaderSortElement;
|
|
25
|
-
}
|
|
26
|
-
}
|
package/table-head-sort/index.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
3
|
-
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
4
|
-
|
|
5
|
-
var _$input;
|
|
6
|
-
|
|
7
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
8
|
-
|
|
9
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10
|
-
|
|
11
|
-
import '../icon/north';
|
|
12
|
-
import '../icon/south';
|
|
13
|
-
import { defineCustomElement, getBooleanAttribute, isAttrTrue, updateBooleanAttribute } from '../utils';
|
|
14
|
-
const templateHTML = '<style>:host{display:contents;--sinch-size-icon:16px}input{all:initial;position:absolute;width:100%;height:100%;box-sizing:border-box;cursor:pointer}#up{display:none}#down{display:block}:host([value]:not([value=false])) #up{display:block}:host([value]:not([value=false])) #down{display:none}</style><sinch-icon-north id="up"></sinch-icon-north><sinch-icon-south id="down"></sinch-icon-south><input type="checkbox"/>';
|
|
15
|
-
const template = document.createElement('template');
|
|
16
|
-
template.innerHTML = templateHTML;
|
|
17
|
-
defineCustomElement('sinch-table-head-sort', (_$input = new WeakMap(), class extends HTMLElement {
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
|
|
21
|
-
_classPrivateFieldInitSpec(this, _$input, {
|
|
22
|
-
writable: true,
|
|
23
|
-
value: void 0
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
_defineProperty(this, 'onCheckboxInput', e => {
|
|
27
|
-
e.stopPropagation();
|
|
28
|
-
|
|
29
|
-
const isChecked = _classPrivateFieldGet(this, _$input).checked;
|
|
30
|
-
|
|
31
|
-
_classPrivateFieldGet(this, _$input).checked = this.value;
|
|
32
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
33
|
-
detail: isChecked,
|
|
34
|
-
bubbles: true
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const shadowRoot = this.attachShadow({
|
|
39
|
-
mode: 'closed'
|
|
40
|
-
});
|
|
41
|
-
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
42
|
-
|
|
43
|
-
_classPrivateFieldSet(this, _$input, shadowRoot.querySelector('input'));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
connectedCallback() {
|
|
47
|
-
this.setAttribute('role', 'checkbox');
|
|
48
|
-
|
|
49
|
-
_classPrivateFieldGet(this, _$input).addEventListener('input', this.onCheckboxInput);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
disconnectedCallback() {
|
|
53
|
-
_classPrivateFieldGet(this, _$input).removeEventListener('input', this.onCheckboxInput);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get type() {
|
|
57
|
-
return 'text';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get nodeName() {
|
|
61
|
-
return 'input';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static get observedAttributes() {
|
|
65
|
-
return ['value'];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
attributeChangedCallback(name, _, newVal) {
|
|
69
|
-
switch (name) {
|
|
70
|
-
case 'value':
|
|
71
|
-
{
|
|
72
|
-
_classPrivateFieldGet(this, _$input).checked = isAttrTrue(newVal);
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set value(isChecked) {
|
|
79
|
-
updateBooleanAttribute(this, 'value', isChecked);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
get value() {
|
|
83
|
-
return getBooleanAttribute(this, 'value');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
focus() {
|
|
87
|
-
_classPrivateFieldGet(this, _$input).focus();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
blur() {
|
|
91
|
-
_classPrivateFieldGet(this, _$input).blur();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
}));
|