@nectary/components 0.35.0 → 0.36.1

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.
Files changed (39) hide show
  1. package/alert/index.d.ts +4 -0
  2. package/alert/index.js +17 -32
  3. package/alert/types.d.ts +1 -7
  4. package/alert/utils.d.ts +3 -0
  5. package/alert/utils.js +6 -1
  6. package/button/index.js +2 -2
  7. package/horizontal-stepper/types.d.ts +4 -0
  8. package/horizontal-stepper-item/types.d.ts +9 -0
  9. package/icon-button/index.js +9 -3
  10. package/inline-alert/index.d.ts +17 -0
  11. package/inline-alert/index.js +154 -0
  12. package/inline-alert/types.d.ts +15 -0
  13. package/inline-alert/utils.d.ts +5 -0
  14. package/inline-alert/utils.js +6 -0
  15. package/package.json +1 -1
  16. package/popover/index.js +82 -72
  17. package/select/index.js +1 -1
  18. package/select/types.d.ts +4 -0
  19. package/select-option/types.d.ts +26 -3
  20. package/tag/index.js +1 -1
  21. package/text/index.js +1 -1
  22. package/time-picker/index.js +9 -1
  23. package/vertical-stepper/index.d.ts +13 -0
  24. package/vertical-stepper/index.js +95 -0
  25. package/vertical-stepper/types.d.ts +13 -0
  26. package/vertical-stepper/types.js +1 -0
  27. package/vertical-stepper-item/index.d.ts +13 -0
  28. package/vertical-stepper-item/index.js +100 -0
  29. package/vertical-stepper-item/types.d.ts +24 -0
  30. package/vertical-stepper-item/utils.d.ts +2 -0
  31. package/vertical-stepper-item/utils.js +1 -0
  32. package/alert-button/index.d.ts +0 -11
  33. package/alert-button/index.js +0 -59
  34. package/alert-button/types.d.ts +0 -8
  35. package/alert-close/index.d.ts +0 -12
  36. package/alert-close/index.js +0 -38
  37. package/alert-close/types.d.ts +0 -3
  38. /package/{alert-button → inline-alert}/types.js +0 -0
  39. /package/{alert-close → vertical-stepper-item}/types.js +0 -0
@@ -0,0 +1,100 @@
1
+ import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
+
4
+ var _$label, _$description, _$circleText;
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
+ import '../icons/check';
11
+ import '../icons/exclamation';
12
+ import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
13
+ const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;width:100%;min-height:68px;display:flex;flex-direction:column}#circle-wrapper{display:flex;flex-direction:row;align-items:flex-start;gap:8px;min-width:0}#circle{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background-color:var(--sinch-color-snow-700);font:var(--sinch-font-title-s);line-height:32px;text-align:center;color:var(--sinch-color-stormy-500);border:1px solid transparent;border-radius:50%;box-sizing:border-box;--sinch-icon-size:20px}#label-wrapper{margin-top:4px;min-width:0;flex:1}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-stormy-500);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#description{font:var(--sinch-font-text-xs);color:var(--sinch-color-stormy-300);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#icon-error,#icon-success{display:none}#content{display:none;padding:16px 0 16px 40px}#progress{position:absolute;width:1px;left:16px;top:32px;bottom:0;background-color:var(--sinch-color-snow-700);transform:translateX(-50%)}#bar{position:absolute;width:1px;height:0;background-color:var(--sinch-color-stormy-400);left:0;top:0}:host(:last-of-type) #progress{display:none}:host([data-progress=active]) #content{display:block}:host([data-progress=active]) #circle{color:var(--sinch-color-snow-100);background-color:var(--sinch-color-stormy-400)}:host([data-progress=done]) #circle{border-color:var(--sinch-color-stormy-400)}:host([data-progress=done]:not([status])) #icon-success{display:block}:host([data-progress=done][status=error]) #circle{background-color:var(--sinch-color-error-200);border-color:var(--sinch-color-stormy-400)}:host([data-progress=done][status=error]) #icon-error{display:block}:host([data-progress=done]:not([status=skip])) #circle-text{display:none}:host([data-progress=done]) #bar{height:100%}</style><div id="wrapper"><div id="progress"><div id="bar"></div></div><div id="circle-wrapper"><div id="circle" aria-hidden="true"><sinch-icon-check id="icon-success"></sinch-icon-check><sinch-icon-exclamation id="icon-error"></sinch-icon-exclamation><span id="circle-text"></span></div><div id="label-wrapper"><div id="label"></div><div id="description"></div></div></div><div id="content"><slot></slot></div></div>';
14
+ import { statusValues } from './utils';
15
+ const template = document.createElement('template');
16
+ template.innerHTML = templateHTML;
17
+ defineCustomElement('sinch-vertical-stepper-item', (_$label = new WeakMap(), _$description = new WeakMap(), _$circleText = new WeakMap(), class extends NectaryElement {
18
+ constructor() {
19
+ super();
20
+
21
+ _classPrivateFieldInitSpec(this, _$label, {
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+
26
+ _classPrivateFieldInitSpec(this, _$description, {
27
+ writable: true,
28
+ value: void 0
29
+ });
30
+
31
+ _classPrivateFieldInitSpec(this, _$circleText, {
32
+ writable: true,
33
+ value: void 0
34
+ });
35
+
36
+ const shadowRoot = this.attachShadow();
37
+ shadowRoot.appendChild(template.content.cloneNode(true));
38
+
39
+ _classPrivateFieldSet(this, _$label, shadowRoot.querySelector('#label'));
40
+
41
+ _classPrivateFieldSet(this, _$description, shadowRoot.querySelector('#description'));
42
+
43
+ _classPrivateFieldSet(this, _$circleText, shadowRoot.querySelector('#circle-text'));
44
+ }
45
+
46
+ connectedCallback() {}
47
+
48
+ disconnectedCallback() {}
49
+
50
+ static get observedAttributes() {
51
+ return ['label', 'description', 'data-index'];
52
+ }
53
+
54
+ attributeChangedCallback(name, oldVal, newVal) {
55
+ switch (name) {
56
+ case 'label':
57
+ {
58
+ _classPrivateFieldGet(this, _$label).textContent = newVal;
59
+ break;
60
+ }
61
+
62
+ case 'description':
63
+ {
64
+ _classPrivateFieldGet(this, _$description).textContent = newVal;
65
+ break;
66
+ }
67
+
68
+ case 'data-index':
69
+ {
70
+ _classPrivateFieldGet(this, _$circleText).textContent = newVal;
71
+ break;
72
+ }
73
+ }
74
+ }
75
+
76
+ set label(value) {
77
+ updateAttribute(this, 'label', value);
78
+ }
79
+
80
+ get label() {
81
+ return getAttribute(this, 'label', '');
82
+ }
83
+
84
+ set description(value) {
85
+ updateAttribute(this, 'description', value);
86
+ }
87
+
88
+ get description() {
89
+ return getAttribute(this, 'description', '');
90
+ }
91
+
92
+ get status() {
93
+ return getLiteralAttribute(this, statusValues, 'status', null);
94
+ }
95
+
96
+ set status(value) {
97
+ updateLiteralAttribute(this, statusValues, 'status', value);
98
+ }
99
+
100
+ }));
@@ -0,0 +1,24 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ export declare type TSinchVerticalStepperStatusType = 'error' | 'skip';
3
+ export declare type TSinchVerticalStepperItemElement = HTMLElement & {
4
+ /** Label */
5
+ label: string;
6
+ /** Description */
7
+ description: string | null;
8
+ /** Status */
9
+ status: TSinchVerticalStepperStatusType | null;
10
+ /** Label */
11
+ setAttribute(name: 'label', value: string): void;
12
+ /** Description */
13
+ setAttribute(name: 'description', value: string): void;
14
+ /** Status */
15
+ setAttribute(name: 'status', value: TSinchVerticalStepperStatusType): void;
16
+ };
17
+ export declare type TSinchVerticalStepperItemReact = TSinchElementReact<TSinchVerticalStepperItemElement> & {
18
+ /** Label */
19
+ label: string;
20
+ /** Description */
21
+ description?: string;
22
+ /** Status */
23
+ status?: TSinchVerticalStepperStatusType;
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { TSinchVerticalStepperStatusType } from './types';
2
+ export declare const statusValues: TSinchVerticalStepperStatusType[];
@@ -0,0 +1 @@
1
+ export const statusValues = ['skip', 'error'];
@@ -1,11 +0,0 @@
1
- import type { TSinchAlertButtonElement, TSinchAlertButtonReact } from './types';
2
- declare global {
3
- namespace JSX {
4
- interface IntrinsicElements {
5
- 'sinch-alert-button': TSinchAlertButtonReact;
6
- }
7
- }
8
- interface HTMLElementTagNameMap {
9
- 'sinch-alert-button': TSinchAlertButtonElement;
10
- }
11
- }
@@ -1,59 +0,0 @@
1
- import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
-
4
- var _$button;
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
- import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } from '../utils';
11
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;padding:9px 16px;border:1px solid var(--sinch-color-stormy-500);border-radius:var(--sinch-shape-radius-s);font:var(--sinch-font-body);font-size:14px;line-height:14px;color:var(--sinch-color-stormy-500);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;height:32px;box-sizing:border-box}</style><button></button>';
12
- const template = document.createElement('template');
13
- template.innerHTML = templateHTML;
14
- defineCustomElement('sinch-alert-button', (_$button = new WeakMap(), class extends NectaryElement {
15
- constructor() {
16
- super();
17
-
18
- _classPrivateFieldInitSpec(this, _$button, {
19
- writable: true,
20
- value: void 0
21
- });
22
-
23
- const shadowRoot = this.attachShadow();
24
- shadowRoot.appendChild(template.content.cloneNode(true));
25
-
26
- _classPrivateFieldSet(this, _$button, shadowRoot.querySelector('button'));
27
- }
28
-
29
- get text() {
30
- return getAttribute(this, 'text', '');
31
- }
32
-
33
- set text(value) {
34
- updateAttribute(this, 'text', value);
35
- }
36
-
37
- static get observedAttributes() {
38
- return ['text'];
39
- }
40
-
41
- attributeChangedCallback(name, _, newVal) {
42
- switch (name) {
43
- case 'text':
44
- {
45
- _classPrivateFieldGet(this, _$button).textContent = newVal;
46
- break;
47
- }
48
- }
49
- }
50
-
51
- focus() {
52
- _classPrivateFieldGet(this, _$button).focus();
53
- }
54
-
55
- blur() {
56
- _classPrivateFieldGet(this, _$button).blur();
57
- }
58
-
59
- }));
@@ -1,8 +0,0 @@
1
- import type { TSinchElementReact } from '../types';
2
- export declare type TSinchAlertButtonElement = HTMLElement & {
3
- text: string;
4
- setAttribute(name: 'text', value: string): void;
5
- };
6
- export declare type TSinchAlertButtonReact = TSinchElementReact<TSinchAlertButtonElement> & {
7
- text: string;
8
- };
@@ -1,12 +0,0 @@
1
- import '../icons/close';
2
- import type { TSinchAlertCloseElement, TSinchAlertCloseReact } from './types';
3
- declare global {
4
- namespace JSX {
5
- interface IntrinsicElements {
6
- 'sinch-alert-close': TSinchAlertCloseReact;
7
- }
8
- }
9
- interface HTMLElementTagNameMap {
10
- 'sinch-alert-close': TSinchAlertCloseElement;
11
- }
12
- }
@@ -1,38 +0,0 @@
1
- import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
-
4
- var _$button;
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
- import '../icons/close';
11
- import { defineCustomElement, NectaryElement } from '../utils';
12
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;display:block;width:24px;height:24px;box-sizing:border-box;cursor:pointer;--sinch-size-icon:24px}sinch-icon-close{display:block;pointer-events:none}</style><button aria-label="close"><sinch-icon-close></sinch-icon-close></button>';
13
- const template = document.createElement('template');
14
- template.innerHTML = templateHTML;
15
- defineCustomElement('sinch-alert-close', (_$button = new WeakMap(), class extends NectaryElement {
16
- constructor() {
17
- super();
18
-
19
- _classPrivateFieldInitSpec(this, _$button, {
20
- writable: true,
21
- value: void 0
22
- });
23
-
24
- const shadowRoot = this.attachShadow();
25
- shadowRoot.appendChild(template.content.cloneNode(true));
26
-
27
- _classPrivateFieldSet(this, _$button, shadowRoot.querySelector('button'));
28
- }
29
-
30
- focus() {
31
- _classPrivateFieldGet(this, _$button).focus();
32
- }
33
-
34
- blur() {
35
- _classPrivateFieldGet(this, _$button).blur();
36
- }
37
-
38
- }));
@@ -1,3 +0,0 @@
1
- import type { TSinchElementReact } from '../types';
2
- export declare type TSinchAlertCloseElement = HTMLElement;
3
- export declare type TSinchAlertCloseReact = TSinchElementReact<TSinchAlertCloseElement>;
File without changes
File without changes