@nectary/components 0.39.0 → 0.41.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 +47 -84
- package/accordion-item/index.js +30 -53
- package/action-menu/index.d.ts +0 -1
- package/action-menu/index.js +177 -223
- package/action-menu/types.d.ts +8 -18
- package/action-menu-option/index.d.ts +1 -0
- package/action-menu-option/index.js +52 -62
- package/action-menu-option/types.d.ts +9 -0
- package/action-menu-option/utils.d.ts +2 -0
- package/action-menu-option/utils.js +3 -0
- package/alert/index.js +6 -20
- package/avatar/index.js +12 -31
- package/avatar-badge/index.js +8 -22
- package/avatar-status/index.js +1 -1
- package/button/index.js +46 -92
- package/button/types.d.ts +1 -1
- package/card/index.js +21 -59
- package/chat-avatar/index.js +8 -22
- package/chat-block/index.js +29 -69
- package/chat-bubble/index.js +6 -20
- package/checkbox/index.js +59 -107
- package/chip/index.d.ts +13 -0
- package/chip/index.js +140 -0
- package/chip/types.d.ts +37 -0
- package/color-menu/index.d.ts +14 -0
- package/color-menu/index.js +450 -0
- package/color-menu/types.d.ts +36 -0
- package/color-menu/utils.d.ts +1 -0
- package/color-menu/utils.js +15 -0
- package/color-swatch/index.d.ts +13 -0
- package/color-swatch/index.js +60 -0
- package/color-swatch/types.d.ts +11 -0
- package/colors.json +61 -49
- package/date-picker/index.js +162 -293
- package/dialog/index.js +70 -142
- package/field/index.js +44 -65
- package/file-drop/index.js +123 -200
- package/file-picker/index.d.ts +0 -1
- package/file-picker/index.js +55 -108
- package/file-status/index.js +15 -39
- package/help-tooltip/index.js +11 -28
- package/horizontal-stepper/index.js +33 -59
- package/horizontal-stepper-item/index.js +13 -37
- package/icon-button/index.d.ts +1 -0
- package/icon-button/index.js +51 -85
- package/icon-button/types.d.ts +16 -2
- package/icons-channel/notify/index.d.ts +11 -0
- package/icons-channel/notify/index.js +4 -0
- package/illustrations/create-illustration-class.js +1 -1
- package/inline-alert/index.js +29 -81
- package/input/index.js +117 -222
- package/link/index.js +51 -97
- package/list-item/index.js +1 -1
- package/package.json +12 -14
- package/pagination/index.js +113 -163
- package/pop/index.d.ts +11 -0
- package/pop/index.js +391 -0
- package/pop/types.d.ts +35 -0
- package/pop/utils.d.ts +7 -0
- package/pop/utils.js +18 -0
- package/popover/index.d.ts +1 -0
- package/popover/index.js +105 -314
- package/popover/types.d.ts +8 -1
- package/popover/utils.d.ts +5 -0
- package/popover/utils.js +17 -1
- package/progress/index.js +9 -28
- package/radio/index.js +103 -169
- package/radio-option/index.js +28 -48
- package/segment/index.js +49 -130
- package/segment-collapse/index.js +28 -49
- package/segmented-control/index.js +36 -73
- package/segmented-control-option/index.js +45 -87
- package/segmented-icon-control/index.js +47 -84
- package/segmented-icon-control-option/index.js +42 -79
- package/select-button/index.d.ts +13 -0
- package/select-button/index.js +158 -0
- package/select-button/types.d.ts +43 -0
- package/select-menu/index.d.ts +11 -0
- package/select-menu/index.js +345 -0
- package/select-menu/types.d.ts +29 -0
- package/{dropdown-text-option → select-menu-option}/index.d.ts +5 -7
- package/select-menu-option/index.js +76 -0
- package/{select-option → select-menu-option}/types.d.ts +8 -9
- package/stop-events/index.js +7 -20
- package/table-head-cell/index.js +7 -21
- package/tabs/index.js +103 -165
- package/tabs-option/index.js +24 -44
- package/tag/index.d.ts +0 -1
- package/tag/index.js +35 -38
- package/tag/types.d.ts +12 -7
- package/textarea/index.js +96 -167
- package/theme.css +146 -49
- package/tile-control/index.js +55 -96
- package/tile-control-option/index.js +45 -87
- package/time-picker/index.js +216 -368
- package/title/index.js +6 -20
- package/toast/index.js +32 -70
- package/toast-manager/index.js +141 -217
- package/toggle/index.js +59 -107
- package/tooltip/index.d.ts +2 -0
- package/tooltip/index.js +160 -17
- package/tooltip/types.d.ts +13 -0
- package/tooltip/utils.d.ts +5 -0
- package/tooltip/utils.js +25 -1
- package/utils/animation.d.ts +17 -0
- package/utils/animation.js +142 -0
- package/utils/colors.d.ts +5 -0
- package/utils/colors.js +5 -0
- package/utils/context.d.ts +15 -0
- package/utils/context.js +57 -0
- package/{utils.d.ts → utils/index.d.ts} +15 -11
- package/{utils.js → utils/index.js} +104 -48
- package/vertical-stepper/index.js +29 -50
- package/vertical-stepper-item/index.js +13 -37
- package/dropdown/index.d.ts +0 -12
- package/dropdown/index.js +0 -415
- package/dropdown/types.d.ts +0 -32
- package/dropdown-checkbox-option/index.d.ts +0 -11
- package/dropdown-checkbox-option/index.js +0 -88
- package/dropdown-checkbox-option/types.d.ts +0 -15
- package/dropdown-radio-option/index.d.ts +0 -11
- package/dropdown-radio-option/index.js +0 -88
- package/dropdown-radio-option/types.d.ts +0 -15
- package/dropdown-text-option/index.js +0 -104
- package/dropdown-text-option/types.d.ts +0 -16
- package/select/index.d.ts +0 -13
- package/select/index.js +0 -316
- package/select/types.d.ts +0 -53
- package/select-option/index.d.ts +0 -11
- package/select-option/index.js +0 -8
- package/tag/utils.d.ts +0 -5
- package/tag/utils.js +0 -6
- package/tag-close/index.d.ts +0 -12
- package/tag-close/index.js +0 -42
- package/tag-close/types.d.ts +0 -5
- /package/{dropdown-checkbox-option → chip}/types.js +0 -0
- /package/{dropdown-radio-option → color-menu}/types.js +0 -0
- /package/{dropdown-text-option → color-swatch}/types.js +0 -0
- /package/{dropdown → pop}/types.js +0 -0
- /package/{select-option → select-button}/types.js +0 -0
- /package/{tag-close → select-menu}/types.js +0 -0
- /package/{select → select-menu-option}/types.js +0 -0
package/textarea/index.js
CHANGED
|
@@ -1,166 +1,43 @@
|
|
|
1
|
-
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
2
|
-
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
3
|
-
|
|
4
|
-
var _$input, _cursorPos, _isPendingDk, _onCompositionStart, _onSelectionChange, _onInput, _onInputFocus, _onInputBlur, _onChangeReactHandler, _onFocusReactHandler, _onBlurReactHandler;
|
|
5
|
-
|
|
6
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
7
|
-
|
|
8
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
|
-
|
|
10
1
|
import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
11
2
|
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:var(--sinch-shape-radius-s);width:100%;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);resize:none}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted);opacity:1}#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([invalid]:not([invalid=false])) #input:enabled{border-color:var(--sinch-color-text-invalid)}</style><textarea id="input"></textarea>';
|
|
12
3
|
const template = document.createElement('template');
|
|
13
4
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-textarea',
|
|
5
|
+
defineCustomElement('sinch-textarea', class extends NectaryElement {
|
|
6
|
+
#$input;
|
|
7
|
+
#cursorPos = null;
|
|
8
|
+
#isPendingDk = false;
|
|
9
|
+
|
|
15
10
|
constructor() {
|
|
16
11
|
super();
|
|
17
|
-
|
|
18
|
-
_classPrivateFieldInitSpec(this, _$input, {
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
_classPrivateFieldInitSpec(this, _cursorPos, {
|
|
24
|
-
writable: true,
|
|
25
|
-
value: null
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
_classPrivateFieldInitSpec(this, _isPendingDk, {
|
|
29
|
-
writable: true,
|
|
30
|
-
value: false
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
_classPrivateFieldInitSpec(this, _onCompositionStart, {
|
|
34
|
-
writable: true,
|
|
35
|
-
value: () => {
|
|
36
|
-
_classPrivateFieldSet(this, _isPendingDk, true);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
_classPrivateFieldInitSpec(this, _onSelectionChange, {
|
|
41
|
-
writable: true,
|
|
42
|
-
value: () => {
|
|
43
|
-
_classPrivateFieldSet(this, _cursorPos, _classPrivateFieldGet(this, _$input).selectionEnd);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
_classPrivateFieldInitSpec(this, _onInput, {
|
|
48
|
-
writable: true,
|
|
49
|
-
value: e => {
|
|
50
|
-
e.stopPropagation();
|
|
51
|
-
|
|
52
|
-
const nextValue = _classPrivateFieldGet(this, _$input).value;
|
|
53
|
-
|
|
54
|
-
const prevValue = this.value;
|
|
55
|
-
|
|
56
|
-
if (prevValue !== nextValue) {
|
|
57
|
-
const nextCursorPos = _classPrivateFieldGet(this, _$input).selectionEnd;
|
|
58
|
-
|
|
59
|
-
if (!_classPrivateFieldGet(this, _isPendingDk)) {
|
|
60
|
-
_classPrivateFieldGet(this, _$input).value = prevValue;
|
|
61
|
-
|
|
62
|
-
const prevCursorPos = _classPrivateFieldGet(this, _cursorPos);
|
|
63
|
-
|
|
64
|
-
const isPrevCursorEnd = prevCursorPos === null || prevCursorPos === prevValue.length;
|
|
65
|
-
|
|
66
|
-
if (!isPrevCursorEnd) {
|
|
67
|
-
_classPrivateFieldGet(this, _$input).setSelectionRange(prevCursorPos, prevCursorPos);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
_classPrivateFieldSet(this, _isPendingDk, false);
|
|
72
|
-
|
|
73
|
-
_classPrivateFieldSet(this, _cursorPos, nextCursorPos);
|
|
74
|
-
|
|
75
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
76
|
-
detail: nextValue,
|
|
77
|
-
bubbles: true
|
|
78
|
-
}));
|
|
79
|
-
this.dispatchEvent(new CustomEvent('-change', {
|
|
80
|
-
detail: nextValue
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
_classPrivateFieldInitSpec(this, _onInputFocus, {
|
|
87
|
-
writable: true,
|
|
88
|
-
value: () => {
|
|
89
|
-
this.dispatchEvent(new CustomEvent('-focus'));
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_classPrivateFieldInitSpec(this, _onInputBlur, {
|
|
94
|
-
writable: true,
|
|
95
|
-
value: () => {
|
|
96
|
-
this.dispatchEvent(new CustomEvent('-blur'));
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
_classPrivateFieldInitSpec(this, _onChangeReactHandler, {
|
|
101
|
-
writable: true,
|
|
102
|
-
value: e => {
|
|
103
|
-
getReactEventHandler(this, 'on-change')?.(e);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
_classPrivateFieldInitSpec(this, _onFocusReactHandler, {
|
|
108
|
-
writable: true,
|
|
109
|
-
value: () => {
|
|
110
|
-
getReactEventHandler(this, 'on-focus')?.();
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
_classPrivateFieldInitSpec(this, _onBlurReactHandler, {
|
|
115
|
-
writable: true,
|
|
116
|
-
value: () => {
|
|
117
|
-
getReactEventHandler(this, 'on-blur')?.();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
12
|
const shadowRoot = this.attachShadow();
|
|
122
13
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
123
|
-
|
|
124
|
-
_classPrivateFieldSet(this, _$input, shadowRoot.querySelector('#input'));
|
|
14
|
+
this.#$input = shadowRoot.querySelector('#input');
|
|
125
15
|
}
|
|
126
16
|
|
|
127
17
|
connectedCallback() {
|
|
128
18
|
this.setAttribute('role', 'textbox');
|
|
129
19
|
this.setAttribute('aria-multiline', 'true');
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_classPrivateFieldGet(this, _$input).addEventListener('focus', _classPrivateFieldGet(this, _onInputFocus));
|
|
140
|
-
|
|
141
|
-
_classPrivateFieldGet(this, _$input).addEventListener('blur', _classPrivateFieldGet(this, _onInputBlur));
|
|
142
|
-
|
|
143
|
-
this.addEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
|
|
144
|
-
this.addEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
|
|
145
|
-
this.addEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
|
|
20
|
+
this.#$input.addEventListener('input', this.#onInput);
|
|
21
|
+
this.#$input.addEventListener('compositionstart', this.#onCompositionStart);
|
|
22
|
+
this.#$input.addEventListener('mousedown', this.#onSelectionChange);
|
|
23
|
+
this.#$input.addEventListener('keydown', this.#onSelectionChange);
|
|
24
|
+
this.#$input.addEventListener('focus', this.#onInputFocus);
|
|
25
|
+
this.#$input.addEventListener('blur', this.#onInputBlur);
|
|
26
|
+
this.addEventListener('-change', this.#onChangeReactHandler);
|
|
27
|
+
this.addEventListener('-focus', this.#onFocusReactHandler);
|
|
28
|
+
this.addEventListener('-blur', this.#onBlurReactHandler);
|
|
146
29
|
}
|
|
147
30
|
|
|
148
31
|
disconnectedCallback() {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
_classPrivateFieldGet(this, _$input).removeEventListener('blur', _classPrivateFieldGet(this, _onInputBlur));
|
|
160
|
-
|
|
161
|
-
this.removeEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
|
|
162
|
-
this.removeEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
|
|
163
|
-
this.removeEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
|
|
32
|
+
this.#$input.removeEventListener('input', this.#onInput);
|
|
33
|
+
this.#$input.removeEventListener('compositionstart', this.#onCompositionStart);
|
|
34
|
+
this.#$input.removeEventListener('mousedown', this.#onSelectionChange);
|
|
35
|
+
this.#$input.removeEventListener('keydown', this.#onSelectionChange);
|
|
36
|
+
this.#$input.removeEventListener('focus', this.#onInputFocus);
|
|
37
|
+
this.#$input.removeEventListener('blur', this.#onInputBlur);
|
|
38
|
+
this.removeEventListener('-change', this.#onChangeReactHandler);
|
|
39
|
+
this.removeEventListener('-focus', this.#onFocusReactHandler);
|
|
40
|
+
this.removeEventListener('-blur', this.#onBlurReactHandler);
|
|
164
41
|
}
|
|
165
42
|
|
|
166
43
|
static get observedAttributes() {
|
|
@@ -176,17 +53,15 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _cursorPos = new
|
|
|
176
53
|
case 'value':
|
|
177
54
|
{
|
|
178
55
|
const nextVal = newVal ?? '';
|
|
179
|
-
|
|
180
|
-
const prevVal = _classPrivateFieldGet(this, _$input).value;
|
|
56
|
+
const prevVal = this.#$input.value;
|
|
181
57
|
|
|
182
58
|
if (nextVal !== prevVal) {
|
|
183
|
-
const prevCursorPos =
|
|
184
|
-
|
|
59
|
+
const prevCursorPos = this.#$input.selectionEnd;
|
|
185
60
|
const isPrevCursorEnd = prevCursorPos === prevVal.length;
|
|
186
|
-
|
|
61
|
+
this.#$input.value = nextVal;
|
|
187
62
|
|
|
188
63
|
if (!isPrevCursorEnd) {
|
|
189
|
-
|
|
64
|
+
this.#$input.setSelectionRange(this.#cursorPos, this.#cursorPos);
|
|
190
65
|
}
|
|
191
66
|
}
|
|
192
67
|
|
|
@@ -195,7 +70,7 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _cursorPos = new
|
|
|
195
70
|
|
|
196
71
|
case 'placeholder':
|
|
197
72
|
{
|
|
198
|
-
|
|
73
|
+
this.#$input.placeholder = newVal ?? '';
|
|
199
74
|
updateAttribute(this, 'aria-placeholder', newVal);
|
|
200
75
|
break;
|
|
201
76
|
}
|
|
@@ -209,14 +84,14 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _cursorPos = new
|
|
|
209
84
|
case 'disabled':
|
|
210
85
|
{
|
|
211
86
|
const isDisabled = isAttrTrue(newVal);
|
|
212
|
-
|
|
87
|
+
this.#$input.disabled = isDisabled;
|
|
213
88
|
updateBooleanAttribute(this, 'disabled', isDisabled);
|
|
214
89
|
break;
|
|
215
90
|
}
|
|
216
91
|
|
|
217
92
|
case 'rows':
|
|
218
93
|
{
|
|
219
|
-
updateAttribute(
|
|
94
|
+
updateAttribute(this.#$input, 'rows', newVal);
|
|
220
95
|
break;
|
|
221
96
|
}
|
|
222
97
|
}
|
|
@@ -239,7 +114,7 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _cursorPos = new
|
|
|
239
114
|
}
|
|
240
115
|
|
|
241
116
|
get placeholder() {
|
|
242
|
-
return getAttribute(this, 'placeholder'
|
|
117
|
+
return getAttribute(this, 'placeholder');
|
|
243
118
|
}
|
|
244
119
|
|
|
245
120
|
set invalid(value) {
|
|
@@ -275,35 +150,89 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _cursorPos = new
|
|
|
275
150
|
}
|
|
276
151
|
|
|
277
152
|
get selectionStart() {
|
|
278
|
-
return
|
|
153
|
+
return this.#$input.selectionStart;
|
|
279
154
|
}
|
|
280
155
|
|
|
281
156
|
set selectionStart(value) {
|
|
282
|
-
|
|
157
|
+
this.#$input.selectionStart = value;
|
|
283
158
|
}
|
|
284
159
|
|
|
285
160
|
get selectionEnd() {
|
|
286
|
-
return
|
|
161
|
+
return this.#$input.selectionEnd;
|
|
287
162
|
}
|
|
288
163
|
|
|
289
164
|
set selectionEnd(value) {
|
|
290
|
-
|
|
165
|
+
this.#$input.selectionEnd = value;
|
|
291
166
|
}
|
|
292
167
|
|
|
293
168
|
get selectionDirection() {
|
|
294
|
-
return
|
|
169
|
+
return this.#$input.selectionDirection;
|
|
295
170
|
}
|
|
296
171
|
|
|
297
172
|
set selectionDirection(value) {
|
|
298
|
-
|
|
173
|
+
this.#$input.selectionDirection = value;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
get focusable() {
|
|
177
|
+
return true;
|
|
299
178
|
}
|
|
300
179
|
|
|
301
180
|
focus() {
|
|
302
|
-
|
|
181
|
+
this.#$input.focus();
|
|
303
182
|
}
|
|
304
183
|
|
|
305
184
|
blur() {
|
|
306
|
-
|
|
307
|
-
}
|
|
185
|
+
this.#$input.blur();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
#onCompositionStart = () => {
|
|
189
|
+
this.#isPendingDk = true;
|
|
190
|
+
};
|
|
191
|
+
#onSelectionChange = () => {
|
|
192
|
+
this.#cursorPos = this.#$input.selectionEnd;
|
|
193
|
+
};
|
|
194
|
+
#onInput = e => {
|
|
195
|
+
e.stopPropagation();
|
|
196
|
+
const nextValue = this.#$input.value;
|
|
197
|
+
const prevValue = this.value;
|
|
198
|
+
|
|
199
|
+
if (prevValue !== nextValue) {
|
|
200
|
+
const nextCursorPos = this.#$input.selectionEnd;
|
|
201
|
+
|
|
202
|
+
if (!this.#isPendingDk) {
|
|
203
|
+
this.#$input.value = prevValue;
|
|
204
|
+
const prevCursorPos = this.#cursorPos;
|
|
205
|
+
const isPrevCursorEnd = prevCursorPos === null || prevCursorPos === prevValue.length;
|
|
206
|
+
|
|
207
|
+
if (!isPrevCursorEnd) {
|
|
208
|
+
this.#$input.setSelectionRange(prevCursorPos, prevCursorPos);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
308
211
|
|
|
309
|
-
|
|
212
|
+
this.#isPendingDk = false;
|
|
213
|
+
this.#cursorPos = nextCursorPos;
|
|
214
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
215
|
+
detail: nextValue,
|
|
216
|
+
bubbles: true
|
|
217
|
+
}));
|
|
218
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
219
|
+
detail: nextValue
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
#onInputFocus = () => {
|
|
224
|
+
this.dispatchEvent(new CustomEvent('-focus'));
|
|
225
|
+
};
|
|
226
|
+
#onInputBlur = () => {
|
|
227
|
+
this.dispatchEvent(new CustomEvent('-blur'));
|
|
228
|
+
};
|
|
229
|
+
#onChangeReactHandler = e => {
|
|
230
|
+
getReactEventHandler(this, 'on-change')?.(e);
|
|
231
|
+
};
|
|
232
|
+
#onFocusReactHandler = () => {
|
|
233
|
+
getReactEventHandler(this, 'on-focus')?.();
|
|
234
|
+
};
|
|
235
|
+
#onBlurReactHandler = () => {
|
|
236
|
+
getReactEventHandler(this, 'on-blur')?.();
|
|
237
|
+
};
|
|
238
|
+
});
|
package/theme.css
CHANGED
|
@@ -7,78 +7,175 @@
|
|
|
7
7
|
--sinch-color-honey-600: #FFAA00;
|
|
8
8
|
--sinch-color-honey-500: #FFBE3C;
|
|
9
9
|
--sinch-color-honey-400: #FFCC66;
|
|
10
|
-
--sinch-color-honey-300: #
|
|
11
|
-
--sinch-color-honey-200: #
|
|
10
|
+
--sinch-color-honey-300: #FFDF9E;
|
|
11
|
+
--sinch-color-honey-200: #FCECCB;
|
|
12
12
|
--sinch-color-honey-100: #FFF7E6;
|
|
13
13
|
--sinch-color-tropical-700: #003D3D;
|
|
14
14
|
--sinch-color-tropical-600: #005757;
|
|
15
15
|
--sinch-color-tropical-500: #007171;
|
|
16
|
-
--sinch-color-tropical-400: #
|
|
16
|
+
--sinch-color-tropical-400: #059688;
|
|
17
17
|
--sinch-color-tropical-300: #66AAAA;
|
|
18
|
-
--sinch-color-tropical-200: #
|
|
19
|
-
--sinch-color-tropical-100: #
|
|
18
|
+
--sinch-color-tropical-200: #A7D5C2;
|
|
19
|
+
--sinch-color-tropical-100: #DCEDE1;
|
|
20
20
|
--sinch-color-tropical-50: #E5F1F1;
|
|
21
|
-
--sinch-color-stormy-
|
|
22
|
-
--sinch-color-stormy-
|
|
23
|
-
--sinch-color-stormy-
|
|
24
|
-
--sinch-color-stormy-
|
|
25
|
-
--sinch-color-stormy-
|
|
26
|
-
--sinch-color-stormy-
|
|
27
|
-
--sinch-color-
|
|
28
|
-
--sinch-color-
|
|
29
|
-
--sinch-color-
|
|
30
|
-
--sinch-color-
|
|
21
|
+
--sinch-color-stormy-700: #000000;
|
|
22
|
+
--sinch-color-stormy-600: #171717;
|
|
23
|
+
--sinch-color-stormy-500: #242424;
|
|
24
|
+
--sinch-color-stormy-400: #595959;
|
|
25
|
+
--sinch-color-stormy-300: #767676;
|
|
26
|
+
--sinch-color-stormy-200: #8C8C8C;
|
|
27
|
+
--sinch-color-stormy-100: #A6A6A6;
|
|
28
|
+
--sinch-color-ocean-700: #1B3E65;
|
|
29
|
+
--sinch-color-ocean-600: #1686CB;
|
|
30
|
+
--sinch-color-ocean-500: #3AA7EA;
|
|
31
|
+
--sinch-color-ocean-400: #6EBBEE;
|
|
32
|
+
--sinch-color-ocean-300: #A1D5F5;
|
|
33
|
+
--sinch-color-ocean-200: #C8E6F9;
|
|
34
|
+
--sinch-color-ocean-100: #DEF2FF;
|
|
35
|
+
--sinch-color-ocean-50: #F3FAFE;
|
|
36
|
+
--sinch-color-snow-700: #CCCCCC;
|
|
37
|
+
--sinch-color-snow-600: #D9D9D9;
|
|
38
|
+
--sinch-color-snow-500: #E0E0E0;
|
|
39
|
+
--sinch-color-snow-400: #F2F2F2;
|
|
40
|
+
--sinch-color-snow-200: #F8F8F8;
|
|
31
41
|
--sinch-color-snow-100: #FFFFFF;
|
|
32
|
-
--sinch-color-raspberry-700: #
|
|
33
|
-
--sinch-color-raspberry-600: #
|
|
34
|
-
--sinch-color-raspberry-500: #
|
|
35
|
-
--sinch-color-raspberry-400: #
|
|
36
|
-
--sinch-color-raspberry-300: #
|
|
37
|
-
--sinch-color-raspberry-200: #
|
|
38
|
-
--sinch-color-raspberry-100: #
|
|
39
|
-
--sinch-color-raspberry-50: #
|
|
40
|
-
--sinch-color-
|
|
41
|
-
--sinch-color-text-inverted: #FFFFFF;
|
|
42
|
-
--sinch-color-text-muted: #677784;
|
|
43
|
-
--sinch-color-text-link: #007171;
|
|
44
|
-
--sinch-color-text-invalid: #E31C3D;
|
|
45
|
-
--sinch-color-error-800: #57000E;
|
|
46
|
-
--sinch-color-error-500: #E31C3D;
|
|
47
|
-
--sinch-color-error-200: #FCD7D4;
|
|
48
|
-
--sinch-color-success-700: #005419;
|
|
49
|
-
--sinch-color-success-500: #2E8540;
|
|
50
|
-
--sinch-color-success-200: #D7F1D8;
|
|
51
|
-
--sinch-color-informative-700: #003B7E;
|
|
52
|
-
--sinch-color-informative-500: #2071CE;
|
|
53
|
-
--sinch-color-informative-200: #D5E5F8;
|
|
54
|
-
--sinch-color-warning-700: #9C2E00;
|
|
55
|
-
--sinch-color-warning-500: #F35B1C;
|
|
56
|
-
--sinch-color-warning-200: #FFE8D6;
|
|
42
|
+
--sinch-color-raspberry-700: #882024;
|
|
43
|
+
--sinch-color-raspberry-600: #D13D42;
|
|
44
|
+
--sinch-color-raspberry-500: #EF5858;
|
|
45
|
+
--sinch-color-raspberry-400: #F38686;
|
|
46
|
+
--sinch-color-raspberry-300: #FFB8B8;
|
|
47
|
+
--sinch-color-raspberry-200: #FBD5D5;
|
|
48
|
+
--sinch-color-raspberry-100: #FFE8E4;
|
|
49
|
+
--sinch-color-raspberry-50: #FFF6F5;
|
|
50
|
+
--sinch-color-night-700: #1223a1;
|
|
57
51
|
--sinch-color-night-400: #3247E9;
|
|
58
52
|
--sinch-color-night-200: #D1D6FA;
|
|
59
|
-
--sinch-color-
|
|
60
|
-
--sinch-color-aqua-200: #AADBEE;
|
|
53
|
+
--sinch-color-grass-700: #006602;
|
|
61
54
|
--sinch-color-grass-400: #39B93D;
|
|
62
55
|
--sinch-color-grass-200: #B4E4B5;
|
|
56
|
+
--sinch-color-dirt-700: #363230;
|
|
63
57
|
--sinch-color-dirt-400: #828282;
|
|
64
58
|
--sinch-color-dirt-200: #E0DDDC;
|
|
65
|
-
--sinch-color-
|
|
66
|
-
--sinch-color-berry-200: #FCA7A7;
|
|
59
|
+
--sinch-color-candy-700: #981b77;
|
|
67
60
|
--sinch-color-candy-400: #E467C3;
|
|
68
61
|
--sinch-color-candy-200: #F6CBEA;
|
|
62
|
+
--sinch-color-mud-700: #6d4e46;
|
|
69
63
|
--sinch-color-mud-400: #8B6559;
|
|
70
64
|
--sinch-color-mud-200: #D7C6C1;
|
|
65
|
+
--sinch-color-orange-700: #974302;
|
|
71
66
|
--sinch-color-orange-400: #FF8C34;
|
|
72
67
|
--sinch-color-orange-200: #FFD4B3;
|
|
68
|
+
--sinch-color-bolt-700: #805500;
|
|
73
69
|
--sinch-color-bolt-400: #FFBE3C;
|
|
74
70
|
--sinch-color-bolt-200: #FFE6B3;
|
|
75
|
-
--sinch-color-
|
|
76
|
-
--sinch-color-
|
|
77
|
-
--sinch-color-
|
|
78
|
-
--sinch-color-
|
|
79
|
-
--sinch-color-
|
|
71
|
+
--sinch-color-violet-700: #4F1B98;
|
|
72
|
+
--sinch-color-violet-400: #9E67E4;
|
|
73
|
+
--sinch-color-violet-200: #DECBF6;
|
|
74
|
+
--sinch-color-error-700: #882024;
|
|
75
|
+
--sinch-color-error-500: #D13D42;
|
|
76
|
+
--sinch-color-error-200: #FBD5D5;
|
|
77
|
+
--sinch-color-success-700: #275D33;
|
|
78
|
+
--sinch-color-success-500: #46A65A;
|
|
79
|
+
--sinch-color-success-200: #D7F1D8;
|
|
80
|
+
--sinch-color-informative-700: #003B7E;
|
|
81
|
+
--sinch-color-informative-500: #2071CE;
|
|
82
|
+
--sinch-color-informative-200: #D5E5F8;
|
|
83
|
+
--sinch-color-warning-700: #9C2E00;
|
|
84
|
+
--sinch-color-warning-500: #F35B1C;
|
|
85
|
+
--sinch-color-warning-200: #FFE8D6;
|
|
86
|
+
--sinch-color-skin-tone-0: #FFCC4D;
|
|
87
|
+
--sinch-color-skin-tone-10: #F7DECE;
|
|
88
|
+
--sinch-color-skin-tone-20: #F3D2A2;
|
|
89
|
+
--sinch-color-skin-tone-30: #D4AB88;
|
|
90
|
+
--sinch-color-skin-tone-40: #AF7E57;
|
|
91
|
+
--sinch-color-skin-tone-50: #7C533E;
|
|
80
92
|
--sinch-color-transparent: transparent;
|
|
81
93
|
|
|
94
|
+
/* Contextual */
|
|
95
|
+
--sinch-color-bg-primary-light: var(--sinch-color-snow-100);
|
|
96
|
+
--sinch-color-bg-primary-contrast: var(--sinch-color-snow-200);
|
|
97
|
+
--sinch-color-bg-comp-green: var(--sinch-color-tropical-100);
|
|
98
|
+
--sinch-color-bg-comp-blue: var(--sinch-color-ocean-100);
|
|
99
|
+
--sinch-color-bg-comp-yellow: var(--sinch-color-honey-200);
|
|
100
|
+
--sinch-color-bg-comp-red: var(--sinch-color-raspberry-100);
|
|
101
|
+
--sinch-color-text-default: var(--sinch-color-stormy-700);
|
|
102
|
+
--sinch-color-text-inverted: var(--sinch-color-snow-100);
|
|
103
|
+
--sinch-color-text-muted: var(--sinch-color-stormy-300);
|
|
104
|
+
--sinch-color-text-disabled: var(--sinch-color-stormy-100);
|
|
105
|
+
--sinch-color-text-link: var(--sinch-color-tropical-500);
|
|
106
|
+
--sinch-color-text-link-disabled: var(--sinch-color-tropical-100);
|
|
107
|
+
--sinch-color-text-invalid: var(--sinch-color-raspberry-600);
|
|
108
|
+
--sinch-color-text-invalid-disabled: var(--sinch-color-raspberry-100);
|
|
109
|
+
--sinch-color-border-default: var(--sinch-color-snow-700);
|
|
110
|
+
--sinch-color-border-light: var(--sinch-color-snow-500);
|
|
111
|
+
--sinch-color-border-dark: var(--sinch-color-stormy-100);
|
|
112
|
+
--sinch-color-border-active: var(--sinch-color-stormy-500);
|
|
113
|
+
--sinch-color-border-disabled: var(--sinch-color-snow-400);
|
|
114
|
+
--sinch-color-border-focus: var(--sinch-color-ocean-500);
|
|
115
|
+
--sinch-color-border-invalid: var(--sinch-color-raspberry-600);
|
|
116
|
+
|
|
117
|
+
/* Color Map */
|
|
118
|
+
--sinch-color-map-light-blue-bg: var(--sinch-color-night-200);
|
|
119
|
+
--sinch-color-map-light-blue-fg: var(--sinch-color-night-700);
|
|
120
|
+
--sinch-color-map-light-brown-bg: var(--sinch-color-mud-200);
|
|
121
|
+
--sinch-color-map-light-brown-fg: var(--sinch-color-mud-700);
|
|
122
|
+
--sinch-color-map-light-gray-bg: var(--sinch-color-dirt-200);
|
|
123
|
+
--sinch-color-map-light-gray-fg: var(--sinch-color-dirt-700);
|
|
124
|
+
--sinch-color-map-light-green-bg: var(--sinch-color-grass-200);
|
|
125
|
+
--sinch-color-map-light-green-fg: var(--sinch-color-grass-700);
|
|
126
|
+
--sinch-color-map-light-orange-bg: var(--sinch-color-orange-200);
|
|
127
|
+
--sinch-color-map-light-orange-fg: var(--sinch-color-orange-700);
|
|
128
|
+
--sinch-color-map-light-pink-bg: var(--sinch-color-candy-200);
|
|
129
|
+
--sinch-color-map-light-pink-fg: var(--sinch-color-candy-700);
|
|
130
|
+
--sinch-color-map-light-violet-bg: var(--sinch-color-violet-200);
|
|
131
|
+
--sinch-color-map-light-violet-fg: var(--sinch-color-violet-700);
|
|
132
|
+
--sinch-color-map-light-yellow-bg: var(--sinch-color-bolt-200);
|
|
133
|
+
--sinch-color-map-light-yellow-fg: var(--sinch-color-bolt-700);
|
|
134
|
+
--sinch-color-map-dark-blue-bg: var(--sinch-color-night-700);
|
|
135
|
+
--sinch-color-map-dark-blue-fg: var(--sinch-color-night-200);
|
|
136
|
+
--sinch-color-map-dark-brown-bg: var(--sinch-color-mud-700);
|
|
137
|
+
--sinch-color-map-dark-brown-fg: var(--sinch-color-mud-200);
|
|
138
|
+
--sinch-color-map-dark-gray-bg: var(--sinch-color-dirt-700);
|
|
139
|
+
--sinch-color-map-dark-gray-fg: var(--sinch-color-dirt-200);
|
|
140
|
+
--sinch-color-map-dark-green-bg: var(--sinch-color-grass-700);
|
|
141
|
+
--sinch-color-map-dark-green-fg: var(--sinch-color-grass-200);
|
|
142
|
+
--sinch-color-map-dark-orange-bg: var(--sinch-color-orange-700);
|
|
143
|
+
--sinch-color-map-dark-orange-fg: var(--sinch-color-orange-200);
|
|
144
|
+
--sinch-color-map-dark-pink-bg: var(--sinch-color-candy-700);
|
|
145
|
+
--sinch-color-map-dark-pink-fg: var(--sinch-color-candy-200);
|
|
146
|
+
--sinch-color-map-dark-violet-bg: var(--sinch-color-violet-700);
|
|
147
|
+
--sinch-color-map-dark-violet-fg: var(--sinch-color-violet-200);
|
|
148
|
+
--sinch-color-map-dark-yellow-bg: var(--sinch-color-bolt-700);
|
|
149
|
+
--sinch-color-map-dark-yellow-fg: var(--sinch-color-bolt-200);
|
|
150
|
+
--sinch-color-map-blue-bg: var(--sinch-color-night-400);
|
|
151
|
+
--sinch-color-map-blue-fg: var(--sinch-color-snow-100);
|
|
152
|
+
--sinch-color-map-brown-bg: var(--sinch-color-mud-400);
|
|
153
|
+
--sinch-color-map-brown-fg: var(--sinch-color-snow-100);
|
|
154
|
+
--sinch-color-map-gray-bg: var(--sinch-color-dirt-400);
|
|
155
|
+
--sinch-color-map-gray-fg: var(--sinch-color-snow-100);
|
|
156
|
+
--sinch-color-map-green-bg: var(--sinch-color-grass-400);
|
|
157
|
+
--sinch-color-map-green-fg: var(--sinch-color-stormy-500);
|
|
158
|
+
--sinch-color-map-orange-bg: var(--sinch-color-orange-400);
|
|
159
|
+
--sinch-color-map-orange-fg: var(--sinch-color-stormy-500);
|
|
160
|
+
--sinch-color-map-pink-bg: var(--sinch-color-candy-400);
|
|
161
|
+
--sinch-color-map-pink-fg: var(--sinch-color-stormy-500);
|
|
162
|
+
--sinch-color-map-violet-bg: var(--sinch-color-violet-400);
|
|
163
|
+
--sinch-color-map-violet-fg: var(--sinch-color-stormy-500);
|
|
164
|
+
--sinch-color-map-yellow-bg: var(--sinch-color-bolt-400);
|
|
165
|
+
--sinch-color-map-yellow-fg: var(--sinch-color-stormy-500);
|
|
166
|
+
--sinch-color-map-skin-tone-0-bg: var(--sinch-color-skin-tone-0);
|
|
167
|
+
--sinch-color-map-skin-tone-0-fg: var(--sinch-color-stormy-500);
|
|
168
|
+
--sinch-color-map-skin-tone-10-bg: var(--sinch-color-skin-tone-10);
|
|
169
|
+
--sinch-color-map-skin-tone-10-fg: var(--sinch-color-stormy-500);
|
|
170
|
+
--sinch-color-map-skin-tone-20-bg: var(--sinch-color-skin-tone-20);
|
|
171
|
+
--sinch-color-map-skin-tone-20-fg: var(--sinch-color-stormy-500);
|
|
172
|
+
--sinch-color-map-skin-tone-30-bg: var(--sinch-color-skin-tone-30);
|
|
173
|
+
--sinch-color-map-skin-tone-30-fg: var(--sinch-color-stormy-500);
|
|
174
|
+
--sinch-color-map-skin-tone-40-bg: var(--sinch-color-skin-tone-40);
|
|
175
|
+
--sinch-color-map-skin-tone-40-fg: var(--sinch-color-stormy-500);
|
|
176
|
+
--sinch-color-map-skin-tone-50-bg: var(--sinch-color-skin-tone-50);
|
|
177
|
+
--sinch-color-map-skin-tone-50-fg: var(--sinch-color-snow-100);
|
|
178
|
+
|
|
82
179
|
/* Typography */
|
|
83
180
|
--sinch-font-family: "Gilroy", "Arial", "sans-serif";
|
|
84
181
|
--sinch-font-weight-emphasized: 600;
|