@nectary/components 0.40.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.
Files changed (74) hide show
  1. package/accordion-item/index.js +4 -0
  2. package/action-menu/index.js +11 -13
  3. package/action-menu-option/index.js +2 -1
  4. package/button/index.js +5 -1
  5. package/button/types.d.ts +1 -1
  6. package/checkbox/index.js +4 -0
  7. package/chip/index.js +18 -15
  8. package/chip/types.d.ts +3 -4
  9. package/color-menu/index.d.ts +1 -0
  10. package/color-menu/index.js +37 -51
  11. package/color-menu/types.d.ts +5 -6
  12. package/color-menu/utils.d.ts +1 -0
  13. package/color-menu/utils.js +15 -0
  14. package/color-swatch/index.js +8 -7
  15. package/color-swatch/types.d.ts +3 -4
  16. package/colors.json +14 -10
  17. package/date-picker/index.js +1 -1
  18. package/field/index.js +22 -5
  19. package/file-drop/index.js +1 -1
  20. package/file-picker/index.js +1 -1
  21. package/help-tooltip/index.js +10 -27
  22. package/icon-button/index.d.ts +1 -0
  23. package/icon-button/index.js +26 -15
  24. package/icon-button/types.d.ts +16 -2
  25. package/input/index.js +4 -0
  26. package/link/index.js +5 -1
  27. package/package.json +1 -1
  28. package/pagination/index.js +4 -0
  29. package/pop/index.d.ts +11 -0
  30. package/pop/index.js +391 -0
  31. package/pop/types.d.ts +35 -0
  32. package/pop/utils.d.ts +7 -0
  33. package/pop/utils.js +18 -0
  34. package/popover/index.d.ts +1 -0
  35. package/popover/index.js +91 -230
  36. package/popover/types.d.ts +8 -1
  37. package/popover/utils.d.ts +5 -0
  38. package/popover/utils.js +17 -1
  39. package/radio-option/index.js +4 -0
  40. package/segment-collapse/index.js +4 -0
  41. package/segmented-control-option/index.js +5 -1
  42. package/segmented-icon-control-option/index.js +5 -1
  43. package/select-button/index.js +6 -1
  44. package/select-menu/index.js +12 -13
  45. package/tabs-option/index.js +4 -0
  46. package/tag/index.js +13 -15
  47. package/tag/types.d.ts +3 -4
  48. package/textarea/index.js +4 -0
  49. package/theme.css +76 -10
  50. package/tile-control-option/index.js +5 -1
  51. package/time-picker/index.js +1 -1
  52. package/toggle/index.js +5 -1
  53. package/tooltip/index.d.ts +2 -0
  54. package/tooltip/index.js +160 -17
  55. package/tooltip/types.d.ts +13 -0
  56. package/tooltip/utils.d.ts +5 -0
  57. package/tooltip/utils.js +25 -1
  58. package/types.d.ts +0 -7
  59. package/utils/animation.d.ts +17 -0
  60. package/utils/animation.js +142 -0
  61. package/utils/colors.d.ts +4 -9
  62. package/utils/colors.js +4 -120
  63. package/utils/context.d.ts +15 -0
  64. package/utils/context.js +57 -0
  65. package/utils/index.d.ts +5 -9
  66. package/utils/index.js +49 -50
  67. package/dropdown-checkbox-option/index.d.ts +0 -11
  68. package/dropdown-checkbox-option/index.js +0 -74
  69. package/dropdown-checkbox-option/types.d.ts +0 -15
  70. package/dropdown-radio-option/index.d.ts +0 -11
  71. package/dropdown-radio-option/index.js +0 -74
  72. package/dropdown-radio-option/types.d.ts +0 -15
  73. package/dropdown-radio-option/types.js +0 -1
  74. /package/{dropdown-checkbox-option → pop}/types.js +0 -0
@@ -1,74 +0,0 @@
1
- import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
2
- const templateHTML = '<style>:host{display:block}#wrapper{display:flex;position:relative;box-sizing:border-box;height:40px;padding:4px 10px 4px 6px;align-items:center;gap:6px;user-select:none;cursor:pointer}#text{flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#icon-container{position:relative;width:32px;height:32px}#icon-container::before{content:"";position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:50%;pointer-events:none;background-color:var(--sinch-color-snow-100);border:2px solid var(--sinch-color-stormy-300);transition:background-color .1s linear;box-sizing:border-box}#icon-knob{position:absolute;left:11px;top:11px;width:10px;height:10px;border-radius:50%;transition:opacity .1s linear;opacity:0;background-color:var(--sinch-color-tropical-500);pointer-events:none}:host([data-checked]) #icon-container::before{border-color:var(--sinch-color-tropical-500)}:host([data-checked]) #icon-knob{opacity:1}:host(:hover)>#wrapper,:host([data-selected])>#wrapper{background-color:var(--sinch-color-snow-500)}:host([disabled]:not([disabled=false]))>#wrapper{color:var(--sinch-color-stormy-100);cursor:initial}:host([disabled]:not([disabled=false])) #icon-container::before{border-color:var(--sinch-color-stormy-100)}@media (prefers-reduced-motion){#icon-container::before,#icon-knob{transition:none}}</style><div id="wrapper"><div id="icon-container"><div id="icon-knob"></div></div><span id="text"></span></div>';
3
- const template = document.createElement('template');
4
- template.innerHTML = templateHTML;
5
- defineCustomElement('sinch-dropdown-radio-option', class extends NectaryElement {
6
- #$text;
7
-
8
- constructor() {
9
- super();
10
- const shadowRoot = this.attachShadow();
11
- shadowRoot.appendChild(template.content.cloneNode(true));
12
- this.#$text = shadowRoot.querySelector('#text');
13
- }
14
-
15
- connectedCallback() {
16
- this.setAttribute('role', 'option');
17
- }
18
-
19
- static get observedAttributes() {
20
- return ['text', 'checked'];
21
- }
22
-
23
- attributeChangedCallback(name, oldVal, newVal) {
24
- if (oldVal === newVal) {
25
- return;
26
- }
27
-
28
- switch (name) {
29
- case 'text':
30
- {
31
- this.#$text.textContent = newVal;
32
- break;
33
- }
34
-
35
- case 'checked':
36
- {
37
- updateExplicitBooleanAttribute(this, 'aria-selected', isAttrTrue(newVal));
38
- }
39
- }
40
- }
41
-
42
- set value(value) {
43
- updateAttribute(this, 'value', value);
44
- }
45
-
46
- get value() {
47
- return getAttribute(this, 'value', '');
48
- }
49
-
50
- set text(value) {
51
- updateAttribute(this, 'text', value);
52
- }
53
-
54
- get text() {
55
- return getAttribute(this, 'text', '');
56
- }
57
-
58
- set disabled(isDisabled) {
59
- updateBooleanAttribute(this, 'disabled', isDisabled);
60
- }
61
-
62
- get disabled() {
63
- return getBooleanAttribute(this, 'disabled');
64
- }
65
-
66
- set checked(isChecked) {
67
- updateBooleanAttribute(this, 'checked', isChecked);
68
- }
69
-
70
- get checked() {
71
- return getBooleanAttribute(this, 'checked');
72
- }
73
-
74
- });
@@ -1,15 +0,0 @@
1
- import type { TSinchElementReact } from '../types';
2
- export declare type TSinchDropdownRadioOptionElement = HTMLElement & {
3
- value: string;
4
- text: string;
5
- disabled: boolean;
6
- setAttribute(name: 'value', value: string): void;
7
- setAttribute(name: 'text', value: string): void;
8
- setAttribute(name: 'disabled', value: ''): void;
9
- };
10
- export declare type TSinchDropdownRadioOptionReact = TSinchElementReact<TSinchDropdownRadioOptionElement> & {
11
- value: string;
12
- text: string;
13
- disabled?: boolean;
14
- 'aria-label': string;
15
- };
@@ -1 +0,0 @@
1
- export {};
File without changes