@nectary/components 4.6.6 → 4.6.8

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.
@@ -0,0 +1 @@
1
+ export type TSinchAvatarColor = 'blue' | 'dark-blue' | 'dark-gray' | 'dark-green' | 'dark-orange' | 'dark-pink' | 'dark-red' | 'dark-violet' | 'dark-yellow' | 'default' | 'gray' | 'green' | 'light-blue' | 'light-gray' | 'light-green' | 'light-orange' | 'light-pink' | 'light-red' | 'light-violet' | 'light-yellow' | 'orange' | 'pink' | 'red' | 'violet' | 'yellow' | 'away-default' | 'busy-default' | 'offline-default' | 'online-default';
@@ -0,0 +1 @@
1
+ export {};
package/avatar/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { TSinchAvatarColor } from './colors';
1
2
  import type { TSinchElementReact } from '../types';
2
3
  import type { TSinchSize } from '../utils/size';
3
4
  export type TSinchAvatarStatus = 'online' | 'busy' | 'away' | 'offline';
@@ -7,7 +8,7 @@ export type TSinchAvatarElement = HTMLElement & {
7
8
  /** Alt text */
8
9
  alt: string;
9
10
  /** Background color */
10
- color: string | null;
11
+ color: TSinchAvatarColor | null;
11
12
  /** Status */
12
13
  status: TSinchAvatarStatus | null;
13
14
  /** Size, `m` by default */
@@ -29,7 +30,7 @@ export type TSinchAvatarReact = TSinchElementReact<TSinchAvatarElement> & {
29
30
  /** Alt text */
30
31
  alt?: string;
31
32
  /** Background color */
32
- color?: string;
33
+ color?: TSinchAvatarColor;
33
34
  /** Size, `m` by default */
34
35
  size?: TSinchSize;
35
36
  /** Status */
@@ -0,0 +1 @@
1
+ export type TSinchChipColor = 'blue-default' | 'blue' | 'danger-default' | 'danger' | 'dark-blue-default' | 'dark-blue' | 'dark-gray-default' | 'dark-gray' | 'dark-green-default' | 'dark-green' | 'dark-orange-default' | 'dark-orange' | 'dark-pink-default' | 'dark-pink' | 'dark-red-default' | 'dark-red' | 'dark-violet-default' | 'dark-violet' | 'dark-yellow-default' | 'dark-yellow' | 'gray-default' | 'gray' | 'green-default' | 'green' | 'info-default' | 'info' | 'light-blue-default' | 'light-blue' | 'light-gray-default' | 'light-gray' | 'light-green-default' | 'light-green' | 'light-orange-default' | 'light-orange' | 'light-pink-default' | 'light-pink' | 'light-red-default' | 'light-red' | 'light-violet-default' | 'light-violet' | 'light-yellow-default' | 'light-yellow' | 'neutral-default' | 'neutral' | 'orange-default' | 'orange' | 'pink-default' | 'pink' | 'red-default' | 'red' | 'success-default' | 'success' | 'violet-default' | 'violet' | 'warning-default' | 'warning' | 'yellow-default' | 'yellow';
package/chip/colors.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/chip/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import type { TSinchChipColor } from './colors';
1
2
  import type { TSinchElementReact } from '../types';
2
3
  export type TSinchChipElement = HTMLElement & {
3
4
  /** Text */
4
5
  text: string;
5
6
  /** Color, gray by default */
6
- color: string | null;
7
+ color: TSinchChipColor | null;
7
8
  /** Small */
8
9
  small: boolean;
9
10
  /** Click event */
@@ -23,7 +24,7 @@ export type TSinchChipReact = TSinchElementReact<TSinchChipElement> & {
23
24
  /** Text */
24
25
  text: string;
25
26
  /** Color, gray by default */
26
- color?: string;
27
+ color?: TSinchChipColor;
27
28
  /** Small */
28
29
  small?: boolean;
29
30
  /** Click event handler */
package/link/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import '../icon';
2
2
  import { defineCustomElement, getBooleanAttribute, getAttribute, updateBooleanAttribute, updateAttribute, NectaryElement, isAttrTrue, getReactEventHandler, isAttrEqual } from '../utils';
3
- const templateHTML = '<style>:host{display:inline}a{font:var(--sinch-comp-link-default-font-initial);font-size:inherit;line-height:inherit;text-decoration:var(--sinch-comp-link-default-text-decoration-initial);color:var(--sinch-comp-link-color-default-text-initial);border-radius:.5em;white-space:nowrap;--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-initial)}a:hover{text-decoration:var(--sinch-comp-link-default-text-decoration-hover);color:var(--sinch-comp-link-color-default-text-hover);--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-hover)}a:focus-visible{outline:2px solid var(--sinch-comp-link-color-default-outline-focus);outline-offset:2px}:host([standalone]){display:block}:host([standalone]) a{display:block;font:var(--sinch-comp-link-standalone-font-initial);font-size:inherit;line-height:inherit;text-decoration:none;width:fit-content}#external-icon,#standalone-icon{display:none;height:1em}#icon-prefix{display:none;margin-left:-.25em}:host([external]:not([standalone])) #external-icon{display:inline-block;margin-left:.25em;vertical-align:-.2em;--sinch-global-size-icon:1em}:host([standalone][external]) #external-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([standalone]) #icon-prefix{display:inline}:host([standalone]:not([external])) #standalone-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([disabled]) a{color:var(--sinch-comp-link-color-disabled-text-initial);pointer-events:none;cursor:initial;text-decoration:var(--sinch-comp-link-default-text-decoration-disabled);--sinch-global-color-icon:var(--sinch-comp-link-color-disabled-icon-initial)}#content{white-space:var(--sinch-global-text-white-space,normal)}</style><a referrerpolicy="no-referer" aria-hidden="true"><span id="content"></span><span id="icon-prefix">&nbsp;</span><sinch-icon icons-version="2" name="fa-arrow-up-right-from-square" id="external-icon"></sinch-icon><sinch-icon icons-version="2" name="fa-arrow-right" id="standalone-icon"></sinch-icon></a>';
3
+ const templateHTML = '<style>:host{display:inline}a{font:var(--sinch-comp-link-default-font-initial);font-size:inherit;line-height:inherit;text-decoration:var(--sinch-comp-link-default-text-decoration-initial);color:var(--sinch-comp-link-color-default-text-initial);border-radius:.5em;white-space:nowrap;--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-initial)}a:hover{text-decoration:var(--sinch-comp-link-default-text-decoration-hover);color:var(--sinch-comp-link-color-default-text-hover);--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-hover)}a:focus-visible{outline:2px solid var(--sinch-comp-link-color-default-outline-focus);outline-offset:2px}:host([standalone]){display:block}:host([standalone]) a{display:block;font:var(--sinch-comp-link-standalone-font-initial);font-size:inherit;line-height:inherit;text-decoration:none;width:fit-content}#external-icon,#standalone-icon{display:none;height:1em}#icon-prefix{display:none;margin-left:-.25em}:host([external]:not([standalone])) #external-icon{display:inline-block;margin-left:.25em;vertical-align:-.2em;--sinch-global-size-icon:1em}:host([standalone][external]) #external-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([standalone]) #icon-prefix{display:inline}:host([standalone]:not([external])) #standalone-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([disabled]) a{color:var(--sinch-comp-link-color-disabled-text-initial);pointer-events:none;cursor:initial;text-decoration:var(--sinch-comp-link-default-text-decoration-disabled);--sinch-global-color-icon:var(--sinch-comp-link-color-disabled-icon-initial)}#content{white-space:var(--sinch-global-text-white-space,normal)}</style><a referrerpolicy="no-referer" aria-hidden="true"><span id="content"></span><span id="icon-prefix">&nbsp;</span><sinch-icon icons-version="2" name="fa-arrow-up-right" id="external-icon"></sinch-icon><sinch-icon icons-version="2" name="fa-arrow-right" id="standalone-icon"></sinch-icon></a>';
4
4
  const template = document.createElement('template');
5
5
  template.innerHTML = templateHTML;
6
6
  defineCustomElement('sinch-link', class extends NectaryElement {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "4.6.6",
3
+ "version": "4.6.8",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.22.15",
23
- "@nectary/assets": "2.2.0"
23
+ "@nectary/assets": "2.2.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@babel/cli": "^7.22.15",
@@ -0,0 +1 @@
1
+ export type TSinchTagColor = 'blue' | 'danger' | 'dark-blue' | 'dark-gray' | 'dark-green' | 'dark-orange' | 'dark-pink' | 'dark-red' | 'dark-violet' | 'dark-yellow' | 'default' | 'gray' | 'green' | 'info' | 'light-blue' | 'light-gray' | 'light-green' | 'light-orange' | 'light-pink' | 'light-red' | 'light-violet' | 'light-yellow' | 'orange' | 'pink' | 'red' | 'success' | 'violet' | 'warning' | 'yellow';
package/tag/colors.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/tag/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import type { TSinchTagColor } from './colors';
1
2
  import type { TSinchElementReact } from '../types';
2
3
  export type TSinchTagElement = HTMLElement & {
3
4
  /** Text */
4
5
  text: string;
5
6
  /** Color, gray by default */
6
- color: string | null;
7
+ color: TSinchTagColor | null;
7
8
  /** Small */
8
9
  small: boolean;
9
10
  /** Text */
@@ -17,7 +18,7 @@ export type TSinchTagReact = TSinchElementReact<TSinchTagElement> & {
17
18
  /** Text */
18
19
  text: string;
19
20
  /** Color, gray by default */
20
- color?: string;
21
+ color?: TSinchTagColor;
21
22
  /** Small */
22
23
  small?: boolean;
23
24
  } & {
@@ -3,4 +3,11 @@ export type TSinchCountry = {
3
3
  phoneCode: string;
4
4
  phoneMask: string | null;
5
5
  };
6
+ /**
7
+ * @deprecated -
8
+ * not up to date:
9
+ * - for a general list of country, https://www.npmjs.com/package/countries-list is a better choice
10
+ * - for validating phone numbers, we recommend https://www.npmjs.com/package/google-libphonenumber or https://www.npmjs.com/package/awesome-phonenumber
11
+ * - for the phone masks, we used the `countries-phone-masks` (https://www.npmjs.com/package/countries-phone-masks) in the example, but how well maintained it is is unknown.
12
+ **/
6
13
  export declare const countries: Record<string, TSinchCountry>;