@vonage/vivid 3.47.0 → 3.49.0-preview.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 (216) hide show
  1. package/README.md +3 -403
  2. package/accordion/index.cjs +21 -0
  3. package/accordion-item/index.cjs +18 -0
  4. package/action-group/index.cjs +7 -0
  5. package/alert/index.cjs +30 -0
  6. package/alert/index.js +0 -1
  7. package/appearance-ui/index.cjs +96 -0
  8. package/audio-player/index.cjs +34 -0
  9. package/audio-player/index.js +0 -1
  10. package/avatar/index.cjs +11 -0
  11. package/badge/index.cjs +14 -0
  12. package/banner/index.cjs +29 -0
  13. package/banner/index.js +0 -1
  14. package/breadcrumb/index.cjs +13 -0
  15. package/breadcrumb-item/index.cjs +22 -0
  16. package/button/index.cjs +25 -0
  17. package/button/index.js +0 -1
  18. package/calendar/index.cjs +9 -0
  19. package/calendar-event/index.cjs +9 -0
  20. package/card/index.cjs +14 -0
  21. package/checkbox/index.cjs +21 -0
  22. package/combobox/index.cjs +39 -0
  23. package/combobox/index.js +1 -1
  24. package/custom-elements.json +30 -35
  25. package/data-grid/index.cjs +18 -0
  26. package/date-picker/index.cjs +40 -0
  27. package/date-picker/index.js +1 -1
  28. package/date-range-picker/index.cjs +40 -0
  29. package/date-range-picker/index.js +1 -1
  30. package/dialog/index.cjs +31 -0
  31. package/dialog/index.js +1 -1
  32. package/divider/index.cjs +8 -0
  33. package/elevation/index.cjs +7 -0
  34. package/empty-state/index.cjs +12 -0
  35. package/fab/index.cjs +22 -0
  36. package/file-picker/index.cjs +30 -0
  37. package/file-picker/index.js +1 -1
  38. package/focus/index.cjs +7 -0
  39. package/header/index.cjs +8 -0
  40. package/icon/index.cjs +10 -0
  41. package/index.cjs +296 -0
  42. package/index.js +1 -1
  43. package/layout/index.cjs +7 -0
  44. package/lib/menu-item/menu-item.d.ts +1 -0
  45. package/lib/tabs/tabs.d.ts +1 -0
  46. package/listbox/index.cjs +77 -0
  47. package/locales/en-GB.cjs +106 -0
  48. package/locales/en-US.cjs +106 -0
  49. package/locales/ja-JP.cjs +106 -0
  50. package/locales/zh-CN.cjs +106 -0
  51. package/menu/index.cjs +32 -0
  52. package/menu/index.js +0 -1
  53. package/menu-item/index.cjs +22 -0
  54. package/menu-item/index.js +0 -1
  55. package/nav/index.cjs +6 -0
  56. package/nav-disclosure/index.cjs +17 -0
  57. package/nav-disclosure/index.js +0 -1
  58. package/nav-item/index.cjs +22 -0
  59. package/note/index.cjs +16 -0
  60. package/number-field/index.cjs +33 -0
  61. package/number-field/index.js +1 -1
  62. package/option/index.cjs +23 -0
  63. package/package.json +20 -2
  64. package/pagination/index.cjs +28 -0
  65. package/pagination/index.js +0 -1
  66. package/popup/index.cjs +27 -0
  67. package/popup/index.js +0 -1
  68. package/progress/index.cjs +9 -0
  69. package/progress-ring/index.cjs +9 -0
  70. package/radio/index.cjs +14 -0
  71. package/radio-group/index.cjs +14 -0
  72. package/select/index.cjs +38 -0
  73. package/select/index.js +1 -1
  74. package/selectable-box/index.cjs +25 -0
  75. package/shared/Reflector.cjs +67 -0
  76. package/shared/_has.cjs +62 -0
  77. package/shared/affix.cjs +64 -0
  78. package/shared/affix.js +8 -4
  79. package/shared/anchor.cjs +90 -0
  80. package/shared/anchored.cjs +78 -0
  81. package/shared/apply-mixins.cjs +25 -0
  82. package/shared/aria-global.cjs +74 -0
  83. package/shared/aria.cjs +11 -0
  84. package/shared/aria2.cjs +11 -0
  85. package/shared/base-progress.cjs +72 -0
  86. package/shared/breadcrumb-item.cjs +27 -0
  87. package/shared/button.cjs +202 -0
  88. package/shared/calendar-event.cjs +41 -0
  89. package/shared/children.cjs +61 -0
  90. package/shared/class-names.cjs +17 -0
  91. package/shared/definition.cjs +165 -0
  92. package/shared/definition10.cjs +102 -0
  93. package/shared/definition11.cjs +164 -0
  94. package/shared/definition11.js +39 -42
  95. package/shared/definition12.cjs +50 -0
  96. package/shared/definition13.cjs +779 -0
  97. package/shared/definition14.cjs +157 -0
  98. package/shared/definition15.cjs +249 -0
  99. package/shared/definition16.cjs +746 -0
  100. package/shared/definition17.cjs +1372 -0
  101. package/shared/definition18.cjs +175 -0
  102. package/shared/definition19.cjs +416 -0
  103. package/shared/definition2.cjs +232 -0
  104. package/shared/definition20.cjs +278 -0
  105. package/shared/definition21.cjs +83 -0
  106. package/shared/definition22.cjs +74 -0
  107. package/shared/definition23.cjs +106 -0
  108. package/shared/definition24.cjs +2392 -0
  109. package/shared/definition25.cjs +75 -0
  110. package/shared/definition26.cjs +39 -0
  111. package/shared/definition27.cjs +66 -0
  112. package/shared/definition28.cjs +849 -0
  113. package/shared/definition28.js +5 -4
  114. package/shared/definition29.cjs +72 -0
  115. package/shared/definition29.js +1 -1
  116. package/shared/definition3.cjs +72 -0
  117. package/shared/definition30.cjs +98 -0
  118. package/shared/definition30.js +1 -4
  119. package/shared/definition31.cjs +37 -0
  120. package/shared/definition32.cjs +24 -0
  121. package/shared/definition33.cjs +64 -0
  122. package/shared/definition34.cjs +533 -0
  123. package/shared/definition35.cjs +295 -0
  124. package/shared/definition36.cjs +219 -0
  125. package/shared/definition37.cjs +109 -0
  126. package/shared/definition38.cjs +92 -0
  127. package/shared/definition39.cjs +448 -0
  128. package/shared/definition4.cjs +198 -0
  129. package/shared/definition40.cjs +49 -0
  130. package/shared/definition41.cjs +694 -0
  131. package/shared/definition41.js +1 -6
  132. package/shared/definition42.cjs +152 -0
  133. package/shared/definition43.cjs +113 -0
  134. package/shared/definition44.cjs +607 -0
  135. package/shared/definition45.cjs +152 -0
  136. package/shared/definition45.js +1 -6
  137. package/shared/definition46.cjs +166 -0
  138. package/shared/definition46.js +2 -7
  139. package/shared/definition47.cjs +35 -0
  140. package/shared/definition48.cjs +98 -0
  141. package/shared/definition49.cjs +543 -0
  142. package/shared/definition49.js +12 -3
  143. package/shared/definition5.cjs +199 -0
  144. package/shared/definition50.cjs +52 -0
  145. package/shared/definition51.cjs +150 -0
  146. package/shared/definition52.cjs +304 -0
  147. package/shared/definition53.cjs +309 -0
  148. package/shared/definition54.cjs +146 -0
  149. package/shared/definition55.cjs +128 -0
  150. package/shared/definition56.cjs +99 -0
  151. package/shared/definition57.cjs +310 -0
  152. package/shared/definition58.cjs +20 -0
  153. package/shared/definition59.cjs +51 -0
  154. package/shared/definition6.cjs +83 -0
  155. package/shared/definition60.cjs +1810 -0
  156. package/shared/definition7.cjs +72 -0
  157. package/shared/definition8.cjs +152 -0
  158. package/shared/definition9.cjs +69 -0
  159. package/shared/dialog-polyfill.esm.cjs +862 -0
  160. package/shared/direction.cjs +22 -0
  161. package/shared/dom.cjs +23 -0
  162. package/shared/enums.cjs +87 -0
  163. package/shared/focus.cjs +8 -0
  164. package/shared/focus2.cjs +11 -0
  165. package/shared/form-associated.cjs +470 -0
  166. package/shared/icon.cjs +237 -0
  167. package/shared/index.cjs +5061 -0
  168. package/shared/index2.cjs +231 -0
  169. package/shared/key-codes.cjs +115 -0
  170. package/shared/key-codes2.cjs +14 -0
  171. package/shared/listbox.cjs +1072 -0
  172. package/shared/localized.cjs +11 -0
  173. package/shared/numbers.cjs +38 -0
  174. package/shared/patterns/affix.d.ts +5 -1
  175. package/shared/presentationDate.cjs +6192 -0
  176. package/shared/presentationDate.js +1 -6
  177. package/shared/radio.cjs +153 -0
  178. package/shared/ref.cjs +43 -0
  179. package/shared/repeat.cjs +767 -0
  180. package/shared/select.options.cjs +12 -0
  181. package/shared/slotted.cjs +123 -0
  182. package/shared/start-end.cjs +52 -0
  183. package/shared/strings.cjs +11 -0
  184. package/shared/text-anchor.cjs +33 -0
  185. package/shared/text-anchor.template.cjs +48 -0
  186. package/shared/text-field.cjs +5 -0
  187. package/shared/text-field2.cjs +228 -0
  188. package/shared/tree-item.cjs +154 -0
  189. package/shared/when.cjs +31 -0
  190. package/side-drawer/index.cjs +8 -0
  191. package/slider/index.cjs +16 -0
  192. package/split-button/index.cjs +20 -0
  193. package/split-button/index.js +0 -1
  194. package/style.css +1 -1
  195. package/styles/core/all.css +1 -1
  196. package/styles/core/theme.css +1 -1
  197. package/styles/core/typography.css +1 -1
  198. package/styles/tokens/theme-dark.css +4 -4
  199. package/styles/tokens/theme-light.css +4 -4
  200. package/styles/tokens/vivid-2-compat.css +1 -1
  201. package/switch/index.cjs +15 -0
  202. package/switch/index.js +0 -5
  203. package/tab/index.cjs +17 -0
  204. package/tab-panel/index.cjs +6 -0
  205. package/tabs/index.cjs +24 -0
  206. package/tag/index.cjs +17 -0
  207. package/tag-group/index.cjs +7 -0
  208. package/text-anchor/index.cjs +24 -0
  209. package/text-area/index.cjs +25 -0
  210. package/text-field/index.cjs +27 -0
  211. package/toggletip/index.cjs +29 -0
  212. package/toggletip/index.js +0 -1
  213. package/tooltip/index.cjs +29 -0
  214. package/tooltip/index.js +0 -1
  215. package/tree-item/index.cjs +22 -0
  216. package/tree-view/index.cjs +14 -0
@@ -5683,8 +5683,6 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
5683
5683
  this._closePopup(false);
5684
5684
  }
5685
5685
  };
5686
- /// Used to stop the popup from immediately opening when closing popup and returning focus to text field
5687
- this.#isClosingPopup = false;
5688
5686
  this._presentationValue = "";
5689
5687
  this._numCalendars = 1;
5690
5688
  /**
@@ -5790,9 +5788,8 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
5790
5788
  super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
5791
5789
  }
5792
5790
  #dismissOnClickOutside;
5793
- #isClosingPopup;
5794
5791
  #openPopupIfPossible() {
5795
- if (!this.readOnly && !this.#isClosingPopup) {
5792
+ if (!this.readOnly) {
5796
5793
  this._popupOpen = true;
5797
5794
  }
5798
5795
  }
@@ -5803,9 +5800,7 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
5803
5800
  this._popupOpen = false;
5804
5801
  this._monthPickerYear = null;
5805
5802
  if (restoreFocusToTextField) {
5806
- this.#isClosingPopup = true;
5807
5803
  this._textFieldEl.focus();
5808
- this.#isClosingPopup = false;
5809
5804
  }
5810
5805
  }
5811
5806
  /**
@@ -0,0 +1,153 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+ const formAssociated = require('./form-associated.cjs');
5
+ const keyCodes = require('./key-codes.cjs');
6
+
7
+ class _Radio extends index.FoundationElement {
8
+ }
9
+ /**
10
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Radio:class)} component.
11
+ *
12
+ * @internal
13
+ */
14
+ class FormAssociatedRadio extends formAssociated.CheckableFormAssociated(_Radio) {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.proxy = document.createElement("input");
18
+ }
19
+ }
20
+
21
+ /**
22
+ * A Radio Custom HTML Element.
23
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.
24
+ *
25
+ * @slot checked-indicator - The checked indicator
26
+ * @slot - The default slot for the label
27
+ * @csspart control - The element representing the visual radio control
28
+ * @csspart label - The label
29
+ * @fires change - Emits a custom change event when the checked state changes
30
+ *
31
+ * @public
32
+ */
33
+ let Radio$1 = class Radio extends FormAssociatedRadio {
34
+ constructor() {
35
+ super();
36
+ /**
37
+ * The element's value to be included in form submission when checked.
38
+ * Default to "on" to reach parity with input[type="radio"]
39
+ *
40
+ * @internal
41
+ */
42
+ this.initialValue = "on";
43
+ /**
44
+ * @internal
45
+ */
46
+ this.keypressHandler = (e) => {
47
+ switch (e.key) {
48
+ case keyCodes.keySpace:
49
+ if (!this.checked && !this.readOnly) {
50
+ this.checked = true;
51
+ }
52
+ return;
53
+ }
54
+ return true;
55
+ };
56
+ this.proxy.setAttribute("type", "radio");
57
+ }
58
+ readOnlyChanged() {
59
+ if (this.proxy instanceof HTMLInputElement) {
60
+ this.proxy.readOnly = this.readOnly;
61
+ }
62
+ }
63
+ /**
64
+ * @internal
65
+ */
66
+ defaultCheckedChanged() {
67
+ var _a;
68
+ if (this.$fastController.isConnected && !this.dirtyChecked) {
69
+ // Setting this.checked will cause us to enter a dirty state,
70
+ // but if we are clean when defaultChecked is changed, we want to stay
71
+ // in a clean state, so reset this.dirtyChecked
72
+ if (!this.isInsideRadioGroup()) {
73
+ this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;
74
+ this.dirtyChecked = false;
75
+ }
76
+ }
77
+ }
78
+ /**
79
+ * @internal
80
+ */
81
+ connectedCallback() {
82
+ var _a, _b;
83
+ super.connectedCallback();
84
+ this.validate();
85
+ if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" &&
86
+ this.getAttribute("tabindex") === null) {
87
+ if (!this.disabled) {
88
+ this.setAttribute("tabindex", "0");
89
+ }
90
+ }
91
+ if (this.checkedAttribute) {
92
+ if (!this.dirtyChecked) {
93
+ // Setting this.checked will cause us to enter a dirty state,
94
+ // but if we are clean when defaultChecked is changed, we want to stay
95
+ // in a clean state, so reset this.dirtyChecked
96
+ if (!this.isInsideRadioGroup()) {
97
+ this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;
98
+ this.dirtyChecked = false;
99
+ }
100
+ }
101
+ }
102
+ }
103
+ isInsideRadioGroup() {
104
+ const parent = this.closest("[role=radiogroup]");
105
+ return parent !== null;
106
+ }
107
+ /**
108
+ * @internal
109
+ */
110
+ clickHandler(e) {
111
+ if (!this.disabled && !this.readOnly && !this.checked) {
112
+ this.checked = true;
113
+ }
114
+ }
115
+ };
116
+ index.__decorate([
117
+ index.attr({ attribute: "readonly", mode: "boolean" })
118
+ ], Radio$1.prototype, "readOnly", void 0);
119
+ index.__decorate([
120
+ index.observable
121
+ ], Radio$1.prototype, "name", void 0);
122
+ index.__decorate([
123
+ index.observable
124
+ ], Radio$1.prototype, "defaultSlottedNodes", void 0);
125
+
126
+ var __defProp = Object.defineProperty;
127
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
128
+ var __decorateClass = (decorators, target, key, kind) => {
129
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
130
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
131
+ if (decorator = decorators[i])
132
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
133
+ if (kind && result)
134
+ __defProp(target, key, result);
135
+ return result;
136
+ };
137
+ class Radio extends Radio$1 {
138
+ constructor() {
139
+ super(...arguments);
140
+ this.ariaLabel = null;
141
+ }
142
+ }
143
+ __decorateClass([
144
+ index.attr({ attribute: "aria-label" })
145
+ ], Radio.prototype, "ariaLabel", 2);
146
+ __decorateClass([
147
+ index.attr
148
+ ], Radio.prototype, "label", 2);
149
+ __decorateClass([
150
+ index.attr
151
+ ], Radio.prototype, "connotation", 2);
152
+
153
+ exports.Radio = Radio;
package/shared/ref.cjs ADDED
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+
5
+ /**
6
+ * The runtime behavior for template references.
7
+ * @public
8
+ */
9
+ class RefBehavior {
10
+ /**
11
+ * Creates an instance of RefBehavior.
12
+ * @param target - The element to reference.
13
+ * @param propertyName - The name of the property to assign the reference to.
14
+ */
15
+ constructor(target, propertyName) {
16
+ this.target = target;
17
+ this.propertyName = propertyName;
18
+ }
19
+ /**
20
+ * Bind this behavior to the source.
21
+ * @param source - The source to bind to.
22
+ * @param context - The execution context that the binding is operating within.
23
+ */
24
+ bind(source) {
25
+ source[this.propertyName] = this.target;
26
+ }
27
+ /**
28
+ * Unbinds this behavior from the source.
29
+ * @param source - The source to unbind from.
30
+ */
31
+ /* eslint-disable-next-line @typescript-eslint/no-empty-function */
32
+ unbind() { }
33
+ }
34
+ /**
35
+ * A directive that observes the updates a property with a reference to the element.
36
+ * @param propertyName - The name of the property to assign the reference to.
37
+ * @public
38
+ */
39
+ function ref(propertyName) {
40
+ return new index.AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName);
41
+ }
42
+
43
+ exports.ref = ref;