@nectary/components 0.48.1 → 0.49.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/types.d.ts +2 -2
- package/accordion-item/types.d.ts +3 -3
- package/action-menu/index.js +0 -1
- package/action-menu/types.d.ts +2 -2
- package/action-menu-option/index.js +1 -1
- package/action-menu-option/types.d.ts +2 -2
- package/alert/index.d.ts +2 -1
- package/alert/index.js +4 -3
- package/alert/types.d.ts +3 -3
- package/alert/utils.d.ts +1 -1
- package/avatar/types.d.ts +3 -3
- package/avatar/utils.d.ts +1 -1
- package/badge/types.d.ts +3 -3
- package/badge/utils.d.ts +1 -1
- package/button/types.d.ts +3 -3
- package/button/utils.d.ts +1 -1
- package/card/types.d.ts +2 -2
- package/card-container/types.d.ts +2 -2
- package/chat/types.d.ts +2 -2
- package/chat-block/types.d.ts +3 -3
- package/chat-bubble/types.d.ts +4 -4
- package/checkbox/types.d.ts +2 -2
- package/chip/types.d.ts +2 -2
- package/code-tag/index.d.ts +13 -0
- package/code-tag/index.js +36 -0
- package/code-tag/types.d.ts +11 -0
- package/code-tag/types.js +1 -0
- package/color-menu/index.js +0 -3
- package/color-menu/types.d.ts +2 -2
- package/color-swatch/types.d.ts +2 -2
- package/date-picker/index.js +0 -6
- package/date-picker/types.d.ts +2 -2
- package/date-picker/utils.d.ts +6 -6
- package/dialog/index.js +0 -1
- package/dialog/types.d.ts +2 -2
- package/emoji/types.d.ts +2 -2
- package/emoji/utils.js +0 -4
- package/emoji-picker/index.js +1 -3
- package/emoji-picker/types.d.ts +4 -4
- package/field/types.d.ts +2 -2
- package/file-drop/types.d.ts +3 -3
- package/file-picker/index.js +0 -1
- package/file-picker/types.d.ts +3 -3
- package/file-status/types.d.ts +3 -3
- package/file-status/utils.d.ts +1 -1
- package/flag/types.d.ts +2 -2
- package/flag/utils.js +0 -2
- package/grid/types.d.ts +2 -2
- package/grid-item/types.d.ts +2 -2
- package/help-tooltip/types.d.ts +2 -2
- package/horizontal-stepper/types.d.ts +2 -2
- package/horizontal-stepper-item/types.d.ts +3 -3
- package/icon/types.d.ts +2 -2
- package/icon-button/types.d.ts +3 -3
- package/icon-button/utils.d.ts +1 -1
- package/icons/types.d.ts +2 -2
- package/icons-branded/types.d.ts +2 -2
- package/icons-channel/types.d.ts +2 -2
- package/illustrations/types.d.ts +4 -4
- package/inline-alert/index.d.ts +4 -3
- package/inline-alert/index.js +6 -5
- package/inline-alert/types.d.ts +3 -3
- package/inline-alert/utils.d.ts +1 -1
- package/input/index.js +17 -3
- package/input/types.d.ts +9 -3
- package/input/utils.d.ts +3 -0
- package/input/utils.js +6 -1
- package/link/types.d.ts +2 -2
- package/list/types.d.ts +2 -2
- package/list-item/types.d.ts +2 -2
- package/logo/types.d.ts +2 -2
- package/package.json +10 -9
- package/pagination/index.js +0 -6
- package/pagination/types.d.ts +2 -2
- package/pop/index.js +0 -16
- package/pop/types.d.ts +3 -3
- package/pop/utils.d.ts +1 -1
- package/popover/types.d.ts +3 -3
- package/popover/utils.d.ts +2 -2
- package/progress/types.d.ts +2 -2
- package/radio/types.d.ts +2 -2
- package/radio-option/types.d.ts +2 -2
- package/rich-text/index.d.ts +12 -0
- package/rich-text/index.js +56 -0
- package/rich-text/types.d.ts +12 -0
- package/rich-text/types.js +1 -0
- package/rich-text/utils.d.ts +5 -0
- package/rich-text/utils.js +6 -0
- package/segment/types.d.ts +2 -2
- package/segment-collapse/types.d.ts +2 -2
- package/segmented-control/types.d.ts +2 -2
- package/segmented-control-option/types.d.ts +2 -2
- package/segmented-icon-control/types.d.ts +2 -2
- package/segmented-icon-control-option/types.d.ts +2 -2
- package/select-button/index.js +1 -1
- package/select-button/types.d.ts +2 -2
- package/select-menu/index.js +0 -1
- package/select-menu/types.d.ts +2 -2
- package/select-menu-option/index.js +1 -1
- package/select-menu-option/types.d.ts +2 -2
- package/spinner/types.d.ts +2 -2
- package/table/types.d.ts +2 -2
- package/table-body/types.d.ts +2 -2
- package/table-cell/types.d.ts +3 -3
- package/table-head/types.d.ts +2 -2
- package/table-head-cell/types.d.ts +2 -2
- package/table-row/types.d.ts +2 -2
- package/tabs/types.d.ts +2 -2
- package/tabs-icon-option/index.js +1 -1
- package/tabs-icon-option/types.d.ts +2 -2
- package/tabs-option/index.js +1 -1
- package/tabs-option/types.d.ts +2 -2
- package/tag/types.d.ts +2 -2
- package/text/index.js +1 -3
- package/text/types.d.ts +3 -3
- package/text/utils.d.ts +1 -1
- package/text/utils.js +1 -1
- package/textarea/index.js +1 -1
- package/textarea/types.d.ts +2 -2
- package/theme/fonts.css +33 -0
- package/theme/fonts.json +33 -0
- package/tile-control/types.d.ts +2 -2
- package/tile-control-option/types.d.ts +2 -2
- package/time-picker/index.js +0 -4
- package/time-picker/types.d.ts +2 -2
- package/title/index.js +0 -2
- package/title/types.d.ts +4 -4
- package/title/utils.d.ts +3 -2
- package/title/utils.js +17 -0
- package/toast/types.d.ts +3 -3
- package/toast/utils.d.ts +1 -1
- package/toast-manager/index.js +0 -1
- package/toast-manager/types.d.ts +2 -2
- package/toggle/types.d.ts +2 -2
- package/tooltip/tooltip-state.d.ts +1 -1
- package/tooltip/types.d.ts +3 -3
- package/tooltip/utils.d.ts +2 -2
- package/utils/context.d.ts +5 -5
- package/utils/context.js +0 -1
- package/utils/countries.d.ts +1 -1
- package/utils/dom.d.ts +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +2 -1
- package/utils/markdown.d.ts +1 -0
- package/utils/markdown.js +128 -0
- package/utils/rect.js +0 -1
- package/utils/size.d.ts +4 -4
- package/vertical-stepper/types.d.ts +2 -2
- package/vertical-stepper-item/types.d.ts +3 -3
package/tabs/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TRect, TSinchElementReact } from '../types';
|
|
2
2
|
import type { SyntheticEvent } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TSinchTabsElement = HTMLElement & {
|
|
4
4
|
/** Value */
|
|
5
5
|
value: string;
|
|
6
6
|
nthOptionRect(index: number): TRect | null;
|
|
@@ -9,7 +9,7 @@ export declare type TSinchTabsElement = HTMLElement & {
|
|
|
9
9
|
/** Value */
|
|
10
10
|
setAttribute(name: 'value', value: string): void;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type TSinchTabsReact = TSinchElementReact<TSinchTabsElement> & {
|
|
13
13
|
/** Value */
|
|
14
14
|
value: string;
|
|
15
15
|
/** Label that is used for a11y */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
2
|
-
const templateHTML = '<style>:host{display:block;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:column;padding:12px 16px 0;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}:host([data-checked]) #button{--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}
|
|
2
|
+
const templateHTML = '<style>:host{display:block;outline:0}#button{all:initial;position:relative;display:flex;flex-direction:column;padding:12px 16px 0;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}#button:disabled{cursor:unset;pointer-events:none;--sinch-color-icon:var(--sinch-color-border-default)}:host([data-checked]) #button{--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}::slotted(*){display:block}</style><sinch-tooltip id="tooltip" inverted><button id="button"><slot name="icon"></slot></button></sinch-tooltip>';
|
|
3
3
|
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
5
|
defineCustomElement('sinch-tabs-icon-option', class extends NectaryElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type TSinchTabsIconOptionElement = HTMLElement & {
|
|
3
3
|
/** Value */
|
|
4
4
|
value: string;
|
|
5
5
|
/** Disabled */
|
|
@@ -9,7 +9,7 @@ export declare type TSinchTabsIconOptionElement = HTMLElement & {
|
|
|
9
9
|
/** Disabled */
|
|
10
10
|
setAttribute(name: 'disabled', value: ''): void;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type TSinchTabsIconOptionReact = TSinchElementReact<TSinchTabsIconOptionElement> & {
|
|
13
13
|
/** Value */
|
|
14
14
|
value: string;
|
|
15
15
|
/** Label that is used for a11y */
|
package/tabs-option/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../text';
|
|
2
2
|
import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
3
|
-
const templateHTML = '<style>:host{display:block}#button{all:initial;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 16px;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;color:var(--sinch-color-stormy-300);--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}:host([data-checked]) #button{color:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}#
|
|
3
|
+
const templateHTML = '<style>:host{display:block}#button{all:initial;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 16px;box-sizing:border-box;cursor:pointer;border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);height:40px;color:var(--sinch-color-stormy-300);--sinch-color-icon:var(--sinch-color-stormy-300);--sinch-size-icon:16px}#button:hover{background-color:var(--sinch-color-tropical-100)}#button:focus-visible::before{content:"";position:absolute;inset:0;bottom:-3px;border:2px solid var(--sinch-color-border-focus);border-top-left-radius:var(--sinch-shape-radius-l);border-top-right-radius:var(--sinch-shape-radius-l);pointer-events:none}#button:disabled{cursor:unset;pointer-events:none;color:var(--sinch-color-border-default);--sinch-color-icon:var(--sinch-color-border-default)}:host([data-checked]) #button{color:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([data-checked]) #button::after{content:"";position:absolute;left:4px;right:4px;bottom:-1px;pointer-events:none;border-top:2px solid var(--sinch-color-tropical-500)}#text{flex-shrink:1;flex-basis:auto;min-width:0}::slotted(*){display:block}</style><button id="button"><slot name="icon"></slot><sinch-text id="text" type="m" ellipsis></sinch-text></button>';
|
|
4
4
|
const template = document.createElement('template');
|
|
5
5
|
template.innerHTML = templateHTML;
|
|
6
6
|
defineCustomElement('sinch-tabs-option', class extends NectaryElement {
|
package/tabs-option/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type TSinchTabsOptionElement = HTMLElement & {
|
|
3
3
|
/** Value */
|
|
4
4
|
value: string;
|
|
5
5
|
/** Text */
|
|
@@ -13,7 +13,7 @@ export declare type TSinchTabsOptionElement = HTMLElement & {
|
|
|
13
13
|
/** Disabled */
|
|
14
14
|
setAttribute(name: 'disabled', value: ''): void;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type TSinchTabsOptionReact = TSinchElementReact<TSinchTabsOptionElement> & {
|
|
17
17
|
/** Value */
|
|
18
18
|
value: string;
|
|
19
19
|
/** Text */
|
package/tag/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type TSinchTagElement = HTMLElement & {
|
|
3
3
|
/** Text */
|
|
4
4
|
text: string;
|
|
5
5
|
/** Color, gray by default */
|
|
@@ -13,7 +13,7 @@ export declare type TSinchTagElement = HTMLElement & {
|
|
|
13
13
|
/** Small */
|
|
14
14
|
setAttribute(name: 'small', value: ''): void;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type TSinchTagReact = TSinchElementReact<TSinchTagElement> & {
|
|
17
17
|
/** Text */
|
|
18
18
|
text: string;
|
|
19
19
|
/** Color, gray by default */
|
package/text/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../icons/cancel';
|
|
2
2
|
import { defineCustomElement, getBooleanAttribute, updateBooleanAttribute, NectaryElement, getLiteralAttribute, updateLiteralAttribute, isAttrTrue } from '../utils';
|
|
3
|
-
const templateHTML = '<style>:host{display:block;font:var(--sinch-font-text-m)}:host([inline]:not([inline=false])){display:inline}:host([type="s"]){font:var(--sinch-font-text-s)}:host([type=xs]){font:var(--sinch-font-text-xs)}:host([type=xxs]){font:var(--sinch-font-text-xxs)}:host([emphasized]:not([emphasized=false])){font-weight:var(--sinch-font-weight-emphasized)}:host([ellipsis]:not([ellipsis=false])){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--sinch-text-white-space:nowrap}</style><slot></slot>';
|
|
3
|
+
const templateHTML = '<style>:host{display:block;font:var(--sinch-font-text-m);font-style:inherit;font-weight:inherit;text-decoration:inherit}:host([inline]:not([inline=false])){display:inline}:host([type="s"]){font:var(--sinch-font-text-s)}:host([type=xs]){font:var(--sinch-font-text-xs)}:host([type=xxs]){font:var(--sinch-font-text-xxs)}:host([emphasized]:not([emphasized=false])){font-weight:var(--sinch-font-weight-emphasized)}:host([ellipsis]:not([ellipsis=false])){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--sinch-text-white-space:nowrap}</style><slot></slot>';
|
|
4
4
|
import { assertType, typeValues } from './utils';
|
|
5
5
|
const template = document.createElement('template');
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
@@ -12,9 +12,7 @@ defineCustomElement('sinch-text', class extends NectaryElement {
|
|
|
12
12
|
}
|
|
13
13
|
connectedCallback() {
|
|
14
14
|
this.setAttribute('role', getBooleanAttribute(this, 'inline') ? 'text' : 'paragraph');
|
|
15
|
-
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
get type() {
|
|
19
17
|
return getLiteralAttribute(this, typeValues, 'type');
|
|
20
18
|
}
|
package/text/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type TSinchTextType = 'm' | 's' | 'xs' | 'xxs';
|
|
3
|
+
export type TSinchTextElement = HTMLElement & {
|
|
4
4
|
type: TSinchTextType;
|
|
5
5
|
inline: boolean;
|
|
6
6
|
emphasized: boolean;
|
|
@@ -10,7 +10,7 @@ export declare type TSinchTextElement = HTMLElement & {
|
|
|
10
10
|
setAttribute(name: 'emphasized', value: ''): void;
|
|
11
11
|
setAttribute(name: 'ellipsis', value: ''): void;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type TSinchTextReact = TSinchElementReact<TSinchTextElement> & {
|
|
14
14
|
type: TSinchTextType;
|
|
15
15
|
inline?: boolean;
|
|
16
16
|
emphasized?: boolean;
|
package/text/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchTextType } from './types';
|
|
2
2
|
export declare const typeValues: readonly TSinchTextType[];
|
|
3
|
-
|
|
3
|
+
type TAssertType = (value: string | null) => asserts value is TSinchTextType;
|
|
4
4
|
export declare const assertType: TAssertType;
|
|
5
5
|
export {};
|
package/text/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const typeValues = ['m', 's', 'xs', 'xxs'];
|
|
2
2
|
export const assertType = value => {
|
|
3
3
|
if (value === null || !typeValues.includes(value)) {
|
|
4
|
-
throw new Error(`sinch-
|
|
4
|
+
throw new Error(`sinch-text: invalid "type" attribute: "${value}"`);
|
|
5
5
|
}
|
|
6
6
|
};
|
package/textarea/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
|
|
2
2
|
import { DEFAULT_SIZE } from '../utils/size';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;--sinch-size:var(--sinch-size-m);--sinch-size-icon:var(--sinch-input-icon-size-m);--sinch-shape-radius:var(--sinch-shape-radius-m)}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;background-color:var(--sinch-color-snow-100);border-radius:var(--sinch-shape-radius);padding-right:2px;padding-bottom:2px;overflow:hidden}#input{all:initial;display:block;font:var(--sinch-font-text-m);color:var(--sinch-color-text-default);resize:none;white-space:pre-wrap;padding:8px 10px 8px 12px}#input::placeholder{font:var(--sinch-font-text-m);color:var(--sinch-color-text-muted);opacity:1}#input:disabled{color:var(--sinch-color-
|
|
3
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;--sinch-size:var(--sinch-size-m);--sinch-size-icon:var(--sinch-input-icon-size-m);--sinch-shape-radius:var(--sinch-shape-radius-m)}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;background-color:var(--sinch-color-snow-100);border-radius:var(--sinch-shape-radius);padding-right:2px;padding-bottom:2px;overflow:hidden}#input{all:initial;display:block;font:var(--sinch-font-text-m);color:var(--sinch-color-text-default);resize:none;white-space:pre-wrap;padding:8px 10px 8px 12px}#input::placeholder{font:var(--sinch-font-text-m);color:var(--sinch-color-text-muted);opacity:1}#input:disabled{color:var(--sinch-color-text-disabled);-webkit-text-fill-color:var(--sinch-color-text-disabled)}#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}#border{position:absolute;border:1px solid var(--sinch-color-border-dark);border-radius:var(--sinch-shape-radius);inset:0;pointer-events:none}:host([invalid]:not([invalid=false])) #border{border-color:var(--sinch-color-text-invalid)}#input:focus+#border{border-color:var(--sinch-color-border-focus);border-width:2px}#input:disabled+#border{border-color:var(--sinch-color-snow-500)}#bottom{display:flex;flex-direction:row;align-items:center;gap:8px;padding:8px 10px 10px 12px}#bottom.empty{display:none}</style><div id="wrapper"><textarea id="input"></textarea><div id="border"></div><div id="bottom"><slot name="bottom"></slot></div></div>';
|
|
4
4
|
const template = document.createElement('template');
|
|
5
5
|
template.innerHTML = templateHTML;
|
|
6
6
|
defineCustomElement('sinch-textarea', class extends NectaryElement {
|
package/textarea/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
2
|
import type { SyntheticEvent } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TSinchTextareaElement = HTMLElement & {
|
|
4
4
|
/** Value */
|
|
5
5
|
value: string;
|
|
6
6
|
/** Text that appears in the text field when it has no value set */
|
|
@@ -35,7 +35,7 @@ export declare type TSinchTextareaElement = HTMLElement & {
|
|
|
35
35
|
/** Whether the text field is resizable */
|
|
36
36
|
setAttribute(name: 'resizable', value: ''): void;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type TSinchTextareaReact = TSinchElementReact<TSinchTextareaElement> & {
|
|
39
39
|
/** Value */
|
|
40
40
|
value: string;
|
|
41
41
|
/** Text that appears in the text field when it has no value set */
|
package/theme/fonts.css
CHANGED
|
@@ -31,6 +31,39 @@
|
|
|
31
31
|
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700.woff") format("woff");
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: "DM Sans";
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
font-style: italic;
|
|
38
|
+
font-display: swap;
|
|
39
|
+
src:
|
|
40
|
+
local("DMSans-Italic"),
|
|
41
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff2") format("woff2"),
|
|
42
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff") format("woff");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: "DM Sans";
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
font-style: italic;
|
|
49
|
+
font-display: swap;
|
|
50
|
+
src:
|
|
51
|
+
local("DMSans-MediumItalic"),
|
|
52
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff2") format("woff2"),
|
|
53
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff") format("woff");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: "DM Sans";
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
font-style: italic;
|
|
60
|
+
font-display: swap;
|
|
61
|
+
src:
|
|
62
|
+
local("DMSans-BoldItalic"),
|
|
63
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff2") format("woff2"),
|
|
64
|
+
url("https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff") format("woff");
|
|
65
|
+
}
|
|
66
|
+
|
|
34
67
|
@font-face {
|
|
35
68
|
font-family: "DM Mono";
|
|
36
69
|
font-weight: 400;
|
package/theme/fonts.json
CHANGED
|
@@ -32,6 +32,39 @@
|
|
|
32
32
|
"woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700.woff"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
"family": "DM Sans",
|
|
37
|
+
"weight": 400,
|
|
38
|
+
"style": "italic",
|
|
39
|
+
"display": "swap",
|
|
40
|
+
"src": {
|
|
41
|
+
"local": "DMSans-Italic",
|
|
42
|
+
"woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff2",
|
|
43
|
+
"woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-400-italic.woff"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"family": "DM Sans",
|
|
48
|
+
"weight": 500,
|
|
49
|
+
"style": "italic",
|
|
50
|
+
"display": "swap",
|
|
51
|
+
"src": {
|
|
52
|
+
"local": "DMSans-MediumItalic",
|
|
53
|
+
"woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff2",
|
|
54
|
+
"woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-500-italic.woff"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"family": "DM Sans",
|
|
59
|
+
"weight": 700,
|
|
60
|
+
"style": "italic",
|
|
61
|
+
"display": "swap",
|
|
62
|
+
"src": {
|
|
63
|
+
"local": "DMSans-BoldItalic",
|
|
64
|
+
"woff2": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff2",
|
|
65
|
+
"woff": "https://d2vu40klajma73.cloudfront.net/DM-Sans-700-italic.woff"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
35
68
|
{
|
|
36
69
|
"family": "DM Mono",
|
|
37
70
|
"weight": 400,
|
package/tile-control/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
2
|
import type { SyntheticEvent } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TSinchTileControlElement = HTMLElement & {
|
|
4
4
|
/** Value */
|
|
5
5
|
value: string;
|
|
6
6
|
/** Small */
|
|
@@ -20,7 +20,7 @@ export declare type TSinchTileControlElement = HTMLElement & {
|
|
|
20
20
|
/** Number of columns from 1 to 8 */
|
|
21
21
|
setAttribute(name: 'cols', value: string): void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type TSinchTileControlReact = TSinchElementReact<TSinchTileControlElement> & {
|
|
24
24
|
/** Value */
|
|
25
25
|
value: string;
|
|
26
26
|
/** Multiple */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type TSinchTileControlOptionElement = HTMLElement & {
|
|
3
3
|
/** Value */
|
|
4
4
|
value: string;
|
|
5
5
|
/** Text content */
|
|
@@ -21,7 +21,7 @@ export declare type TSinchTileControlOptionElement = HTMLElement & {
|
|
|
21
21
|
/** Small */
|
|
22
22
|
setAttribute(name: 'small', value: ''): void;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type TSinchTileControlOptionReact = TSinchElementReact<TSinchTileControlOptionElement> & {
|
|
25
25
|
/** Value */
|
|
26
26
|
value: string;
|
|
27
27
|
/** Text content */
|
package/time-picker/index.js
CHANGED
|
@@ -53,7 +53,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
|
|
|
53
53
|
const HOUR_12_DIGIT_RADIUS = HOUR_12_RADIUS + HOUR_12_DIGIT_SIZE / 2;
|
|
54
54
|
const HOUR_24_DIGIT_RADIUS = HOUR_24_RADIUS + HOUR_24_DIGIT_SIZE / 2;
|
|
55
55
|
const hours12Frag = document.createDocumentFragment();
|
|
56
|
-
|
|
57
56
|
for (let i = 0; i < 12; i++) {
|
|
58
57
|
const rad = Math.PI / 6 * (i - 3);
|
|
59
58
|
const el = document.createElement('div');
|
|
@@ -66,7 +65,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
|
|
|
66
65
|
hours12Frag.appendChild(el);
|
|
67
66
|
}
|
|
68
67
|
this.#$pickerHours.appendChild(hours12Frag);
|
|
69
|
-
|
|
70
68
|
const hours24Frag = document.createDocumentFragment();
|
|
71
69
|
for (let i = 12; i < 24; i++) {
|
|
72
70
|
const rad = Math.PI / 6 * (i - 3);
|
|
@@ -80,7 +78,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
|
|
|
80
78
|
hours24Frag.appendChild(el);
|
|
81
79
|
}
|
|
82
80
|
this.#$pickerHours.appendChild(hours24Frag);
|
|
83
|
-
|
|
84
81
|
const minutesFrag = document.createDocumentFragment();
|
|
85
82
|
for (let i = 0; i < 60; i += 5) {
|
|
86
83
|
const rad = Math.PI / 30 * (i - 15);
|
|
@@ -207,7 +204,6 @@ defineCustomElement('sinch-time-picker', class extends NectaryElement {
|
|
|
207
204
|
if (dy < 0) {
|
|
208
205
|
cssDeg += 180;
|
|
209
206
|
}
|
|
210
|
-
|
|
211
207
|
const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
|
|
212
208
|
return [cssDeg, rowIndex];
|
|
213
209
|
}
|
package/time-picker/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TRect, TSinchElementReact } from '../types';
|
|
2
2
|
import type { SyntheticEvent } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TSinchTimePickerElement = HTMLElement & {
|
|
4
4
|
/** Time value in ISO 8601 format */
|
|
5
5
|
value: string;
|
|
6
6
|
/** AM/PM 12-hour clock system, `false` by default */
|
|
@@ -21,7 +21,7 @@ export declare type TSinchTimePickerElement = HTMLElement & {
|
|
|
21
21
|
/** Submit button label that is used for a11y */
|
|
22
22
|
setAttribute(name: 'submit-aria-label', value: string): void;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type TSinchTimePickerReact = TSinchElementReact<TSinchTimePickerElement> & {
|
|
25
25
|
/** Time value in ISO 8601 format */
|
|
26
26
|
value: string;
|
|
27
27
|
/** AM/PM 12-hour clock system, `false` by default */
|
package/title/index.js
CHANGED
package/title/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type TSinchTitleType = 'xl' | 'l' | 'm' | 's' | 'xs';
|
|
3
|
+
export type TSinchTitleLevel = '1' | '2' | '3' | '4' | '5' | '6';
|
|
4
|
+
export type TSinchTitleElement = HTMLElement & {
|
|
5
5
|
text: string;
|
|
6
6
|
type: TSinchTitleType;
|
|
7
7
|
level: TSinchTitleLevel;
|
|
@@ -11,7 +11,7 @@ export declare type TSinchTitleElement = HTMLElement & {
|
|
|
11
11
|
setAttribute(name: 'level', value: TSinchTitleLevel): void;
|
|
12
12
|
setAttribute(name: 'ellipsis', value: ''): void;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type TSinchTitleReact = TSinchElementReact<TSinchTitleElement> & {
|
|
15
15
|
text: string;
|
|
16
16
|
type: TSinchTitleType;
|
|
17
17
|
level: TSinchTitleLevel;
|
package/title/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { TSinchTitleLevel, TSinchTitleType } from './types';
|
|
2
2
|
export declare const typeValues: readonly TSinchTitleType[];
|
|
3
3
|
export declare const levelValues: readonly TSinchTitleLevel[];
|
|
4
|
-
|
|
4
|
+
type TAssertLevel = (value: string | null) => asserts value is TSinchTitleLevel;
|
|
5
5
|
export declare const assertLevel: TAssertLevel;
|
|
6
|
-
|
|
6
|
+
type TAssertType = (value: string | null) => asserts value is TSinchTitleType;
|
|
7
7
|
export declare const assertType: TAssertType;
|
|
8
8
|
export declare const getTitleLevelFromType: (type: TSinchTitleType) => TSinchTitleLevel;
|
|
9
|
+
export declare const getTitleTypeFromLevel: (level: TSinchTitleLevel) => TSinchTitleType;
|
|
9
10
|
export {};
|
package/title/utils.js
CHANGED
|
@@ -25,4 +25,21 @@ export const getTitleLevelFromType = type => {
|
|
|
25
25
|
default:
|
|
26
26
|
throw new Error(`sinch-title: invalid type value: ${type}`);
|
|
27
27
|
}
|
|
28
|
+
};
|
|
29
|
+
export const getTitleTypeFromLevel = level => {
|
|
30
|
+
switch (level) {
|
|
31
|
+
case '1':
|
|
32
|
+
return 'xl';
|
|
33
|
+
case '2':
|
|
34
|
+
return 'l';
|
|
35
|
+
case '3':
|
|
36
|
+
return 'm';
|
|
37
|
+
case '4':
|
|
38
|
+
return 's';
|
|
39
|
+
case '5':
|
|
40
|
+
case '6':
|
|
41
|
+
return 'xs';
|
|
42
|
+
default:
|
|
43
|
+
throw new Error(`sinch-title: invalid level value: ${level}`);
|
|
44
|
+
}
|
|
28
45
|
};
|
package/toast/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type TSinchToastType = 'info' | 'warn' | 'error' | 'success';
|
|
3
|
+
export type TSinchToastElement = HTMLElement & {
|
|
4
4
|
/** Type */
|
|
5
5
|
type: TSinchToastType;
|
|
6
6
|
/** Text */
|
|
@@ -16,7 +16,7 @@ export declare type TSinchToastElement = HTMLElement & {
|
|
|
16
16
|
/** Persistent, i.e. doesn't automatically dissapear after 5s */
|
|
17
17
|
setAttribute(name: 'persistent', value: ''): void;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type TSinchToastReact = TSinchElementReact<TSinchToastElement> & {
|
|
20
20
|
/** Type */
|
|
21
21
|
type: TSinchToastType;
|
|
22
22
|
/** Text */
|
package/toast/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchToastType } from './types';
|
|
2
2
|
export declare const typeValues: readonly TSinchToastType[];
|
|
3
|
-
|
|
3
|
+
type TAssertType = (value: string | null) => asserts value is TSinchToastType;
|
|
4
4
|
export declare const assertType: TAssertType;
|
|
5
5
|
export {};
|
package/toast-manager/index.js
CHANGED
package/toast-manager/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TRect, TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type TSinchToastManagerElement = HTMLElement & {
|
|
3
3
|
readonly containerRect: TRect;
|
|
4
4
|
nthActionRect: (nth: number) => TRect | null;
|
|
5
5
|
nthCloseRect: (nth: number) => TRect | null;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type TSinchToastManagerReact = TSinchElementReact<TSinchToastManagerElement> & {};
|
package/toggle/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
2
|
import type { SyntheticEvent } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TSinchToggleElement = HTMLElement & {
|
|
4
4
|
checked: boolean;
|
|
5
5
|
small: boolean;
|
|
6
6
|
labeled: boolean;
|
|
@@ -14,7 +14,7 @@ export declare type TSinchToggleElement = HTMLElement & {
|
|
|
14
14
|
setAttribute(name: 'disabled', value: ''): void;
|
|
15
15
|
setAttribute(name: 'text', value: string): void;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type TSinchToggleReact = TSinchElementReact<TSinchToggleElement> & {
|
|
18
18
|
checked?: boolean;
|
|
19
19
|
small?: boolean;
|
|
20
20
|
labeled?: boolean;
|
package/tooltip/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TRect, TSinchElementReact } from '../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type TSinchTooltipOrientation = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
3
|
+
export type TSinchTooltipElement = HTMLElement & {
|
|
4
4
|
/** Text */
|
|
5
5
|
text: string;
|
|
6
6
|
/** @deprecated */
|
|
@@ -24,7 +24,7 @@ export declare type TSinchTooltipElement = HTMLElement & {
|
|
|
24
24
|
/** Orientation, where it *points to* from origin */
|
|
25
25
|
setAttribute(name: 'orientation', value: TSinchTooltipOrientation): void;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type TSinchTooltipReact = TSinchElementReact<TSinchTooltipElement> & {
|
|
28
28
|
/** Text */
|
|
29
29
|
text: string;
|
|
30
30
|
/** @deprecated */
|
package/tooltip/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TSinchPopOrientation } from '../pop/types';
|
|
2
1
|
import type { TSinchTooltipOrientation } from './types';
|
|
2
|
+
import type { TSinchPopOrientation } from '../pop/types';
|
|
3
3
|
export declare const orientationValues: readonly TSinchTooltipOrientation[];
|
|
4
4
|
export declare const getPopOrientation: (orientation: TSinchTooltipOrientation) => TSinchPopOrientation;
|
|
5
|
-
|
|
5
|
+
type TAssertOrientation = (value: string | null) => asserts value is TSinchTooltipOrientation;
|
|
6
6
|
export declare const assertOrientation: TAssertOrientation;
|
|
7
7
|
export {};
|
package/utils/context.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type TContextName = 'visibility' | 'keydown' | 'size';
|
|
2
|
+
export type TContextKeydown = {
|
|
3
3
|
code: string;
|
|
4
4
|
preventDefault: () => void;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
|
|
6
|
+
export type TContextVisibility = boolean;
|
|
7
|
+
export type TContextSize = string;
|
|
8
|
+
type TContextDataType = {
|
|
9
9
|
visibility: TContextVisibility;
|
|
10
10
|
keydown: TContextKeydown;
|
|
11
11
|
size: TContextSize;
|
package/utils/context.js
CHANGED
package/utils/countries.d.ts
CHANGED
package/utils/dom.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function getLiteralAttribute<T extends readonly string[]>($elemen
|
|
|
11
11
|
export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: null): T[number] | null;
|
|
12
12
|
export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: T[number]): T[number];
|
|
13
13
|
export declare const clampNumber: (value: number, min: number, max: number) => number;
|
|
14
|
-
|
|
14
|
+
type IntegerOptions = {
|
|
15
15
|
min?: number;
|
|
16
16
|
max?: number;
|
|
17
17
|
defaultValue?: number | null;
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseMarkdown: (md: string) => string;
|