@vonage/vivid 3.32.0 → 3.34.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 (218) hide show
  1. package/accordion/index.js +5 -5
  2. package/accordion-item/index.js +4 -4
  3. package/action-group/index.js +1 -1
  4. package/alert/index.js +6 -6
  5. package/avatar/index.js +2 -2
  6. package/badge/index.js +2 -2
  7. package/banner/index.js +5 -5
  8. package/breadcrumb/index.js +1 -1
  9. package/breadcrumb-item/index.js +3 -3
  10. package/button/index.js +4 -4
  11. package/calendar/index.js +1 -1
  12. package/calendar-event/index.js +1 -1
  13. package/card/index.js +3 -3
  14. package/checkbox/index.js +5 -3
  15. package/combobox/index.js +8 -8
  16. package/custom-elements.json +246 -16
  17. package/data-grid/index.js +2 -2
  18. package/date-picker/index.js +9 -9
  19. package/dialog/index.js +6 -6
  20. package/divider/index.js +1 -1
  21. package/elevation/index.js +1 -1
  22. package/empty-state/index.js +2 -2
  23. package/fab/index.js +4 -4
  24. package/file-picker/index.js +5 -5
  25. package/focus/index.js +1 -1
  26. package/header/index.js +2 -2
  27. package/icon/index.js +1 -1
  28. package/index.js +59 -59
  29. package/layout/index.js +1 -1
  30. package/lib/calendar/calendar.d.ts +1 -1
  31. package/lib/date-picker/calendar/dateStr.d.ts +1 -0
  32. package/lib/date-picker/calendar/month.d.ts +1 -0
  33. package/lib/date-picker/calendar/year.d.ts +2 -0
  34. package/lib/date-picker/date-picker.d.ts +2 -0
  35. package/lib/icon/icon.d.ts +0 -1
  36. package/lib/listbox/listbox.d.ts +9 -1
  37. package/lib/text-field/text-field.d.ts +1 -0
  38. package/listbox/index.js +20 -16
  39. package/locales/en-GB.js +48 -14
  40. package/locales/en-US.js +48 -14
  41. package/locales/ja-JP.js +48 -14
  42. package/locales/zh-CN.js +48 -14
  43. package/menu/index.js +8 -8
  44. package/menu-item/index.js +4 -4
  45. package/nav/index.js +1 -1
  46. package/nav-disclosure/index.js +3 -3
  47. package/nav-item/index.js +3 -3
  48. package/note/index.js +2 -3
  49. package/number-field/index.js +6 -6
  50. package/option/index.js +3 -3
  51. package/package.json +2 -16
  52. package/pagination/index.js +5 -5
  53. package/popup/index.js +6 -6
  54. package/progress/index.js +1 -1
  55. package/progress-ring/index.js +1 -1
  56. package/radio/index.js +2 -2
  57. package/radio-group/index.js +1 -1
  58. package/select/index.js +8 -8
  59. package/shared/affix.js +25 -9
  60. package/shared/apply-mixins.js +1 -1
  61. package/shared/breadcrumb-item.js +5 -5
  62. package/shared/button.js +13 -13
  63. package/shared/calendar-event.js +36 -16
  64. package/shared/definition.js +133 -194
  65. package/shared/definition10.js +225 -40
  66. package/shared/definition11.js +36 -32
  67. package/shared/definition12.js +763 -98
  68. package/shared/definition13.js +125 -89
  69. package/shared/definition14.js +207 -27
  70. package/shared/definition15.js +710 -731
  71. package/shared/definition16.js +1289 -47
  72. package/shared/definition17.js +6113 -93
  73. package/shared/definition18.js +242 -164
  74. package/shared/definition19.js +47 -692
  75. package/shared/definition2.js +199 -117
  76. package/shared/definition20.js +59 -1671
  77. package/shared/definition21.js +95 -255
  78. package/shared/definition22.js +2218 -1167
  79. package/shared/definition23.js +61 -5784
  80. package/shared/definition24.js +28 -117
  81. package/shared/definition25.js +52 -66
  82. package/shared/definition26.js +391 -214
  83. package/shared/definition27.js +441 -34
  84. package/shared/definition28.js +85 -73
  85. package/shared/definition29.js +21 -2283
  86. package/shared/definition3.js +61 -24
  87. package/shared/definition30.js +13 -49
  88. package/shared/definition31.js +54 -39
  89. package/shared/definition32.js +413 -375
  90. package/shared/definition33.js +223 -304
  91. package/shared/definition34.js +197 -13
  92. package/shared/definition35.js +88 -73
  93. package/shared/definition36.js +75 -25
  94. package/shared/definition37.js +434 -34
  95. package/shared/definition38.js +32 -432
  96. package/shared/definition39.js +677 -187
  97. package/shared/definition4.js +157 -12
  98. package/shared/definition40.js +95 -48
  99. package/shared/definition41.js +577 -31
  100. package/shared/definition42.js +126 -424
  101. package/shared/definition43.js +114 -618
  102. package/shared/definition44.js +24 -80
  103. package/shared/definition45.js +71 -543
  104. package/shared/definition46.js +499 -92
  105. package/shared/definition47.js +19 -133
  106. package/shared/definition48.js +129 -52
  107. package/shared/definition49.js +281 -17
  108. package/shared/definition5.js +71 -36
  109. package/shared/definition50.js +153 -484
  110. package/shared/definition51.js +131 -98
  111. package/shared/definition52.js +131 -16
  112. package/shared/definition53.js +80 -264
  113. package/shared/definition54.js +293 -118
  114. package/shared/definition55.js +12 -117
  115. package/shared/definition56.js +39 -68
  116. package/shared/definition57.js +166 -288
  117. package/shared/definition6.js +56 -111
  118. package/shared/definition7.js +120 -195
  119. package/shared/definition8.js +58 -23
  120. package/shared/definition9.js +92 -66
  121. package/shared/focus.js +2 -1
  122. package/shared/focus2.js +1 -1
  123. package/shared/form-associated.js +2 -2
  124. package/shared/icon.js +48 -27
  125. package/shared/index.js +7 -27
  126. package/shared/index2.js +108 -80
  127. package/shared/key-codes.js +1 -1
  128. package/shared/listbox.js +88 -11
  129. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  130. package/shared/radio.js +23 -7
  131. package/shared/repeat.js +1 -1
  132. package/shared/text-anchor.js +21 -4
  133. package/shared/text-anchor.template.js +37 -40
  134. package/shared/text-field.js +2 -2
  135. package/shared/text-field2.js +15 -15
  136. package/shared/tree-item.js +12 -12
  137. package/side-drawer/index.js +1 -1
  138. package/slider/index.js +2 -2
  139. package/split-button/index.js +3 -3
  140. package/style.css +6097 -0
  141. package/styles/core/all.css +1 -1
  142. package/styles/core/theme.css +1 -1
  143. package/styles/core/typography.css +1 -1
  144. package/styles/tokens/theme-dark.css +4 -4
  145. package/styles/tokens/theme-light.css +4 -4
  146. package/styles/tokens/vivid-2-compat.css +1 -1
  147. package/switch/index.js +3 -3
  148. package/tab/index.js +3 -3
  149. package/tab-panel/index.js +1 -1
  150. package/tabs/index.js +5 -5
  151. package/tag/index.js +3 -3
  152. package/tag-group/index.js +1 -1
  153. package/text-anchor/index.js +1 -1
  154. package/text-area/index.js +3 -3
  155. package/text-field/index.js +3 -3
  156. package/toggletip/index.js +7 -7
  157. package/tooltip/index.js +7 -7
  158. package/tree-item/index.js +3 -3
  159. package/tree-view/index.js +1 -1
  160. package/lib/accordion/index.d.ts +0 -1
  161. package/lib/accordion-item/index.d.ts +0 -1
  162. package/lib/action-group/index.d.ts +0 -1
  163. package/lib/alert/index.d.ts +0 -1
  164. package/lib/avatar/index.d.ts +0 -1
  165. package/lib/badge/index.d.ts +0 -1
  166. package/lib/banner/index.d.ts +0 -1
  167. package/lib/breadcrumb/index.d.ts +0 -1
  168. package/lib/breadcrumb-item/index.d.ts +0 -1
  169. package/lib/button/index.d.ts +0 -1
  170. package/lib/calendar/index.d.ts +0 -1
  171. package/lib/calendar-event/index.d.ts +0 -1
  172. package/lib/card/index.d.ts +0 -1
  173. package/lib/checkbox/index.d.ts +0 -1
  174. package/lib/combobox/index.d.ts +0 -1
  175. package/lib/data-grid/index.d.ts +0 -1
  176. package/lib/date-picker/index.d.ts +0 -1
  177. package/lib/dialog/index.d.ts +0 -1
  178. package/lib/divider/index.d.ts +0 -1
  179. package/lib/elevation/index.d.ts +0 -1
  180. package/lib/empty-state/index.d.ts +0 -1
  181. package/lib/fab/index.d.ts +0 -1
  182. package/lib/file-picker/index.d.ts +0 -1
  183. package/lib/focus/index.d.ts +0 -1
  184. package/lib/header/index.d.ts +0 -1
  185. package/lib/icon/index.d.ts +0 -1
  186. package/lib/layout/index.d.ts +0 -1
  187. package/lib/listbox/index.d.ts +0 -1
  188. package/lib/menu/index.d.ts +0 -1
  189. package/lib/menu-item/index.d.ts +0 -1
  190. package/lib/nav/index.d.ts +0 -1
  191. package/lib/nav-disclosure/index.d.ts +0 -1
  192. package/lib/nav-item/index.d.ts +0 -1
  193. package/lib/note/index.d.ts +0 -1
  194. package/lib/number-field/index.d.ts +0 -1
  195. package/lib/option/index.d.ts +0 -1
  196. package/lib/pagination/index.d.ts +0 -1
  197. package/lib/popup/index.d.ts +0 -1
  198. package/lib/progress/index.d.ts +0 -1
  199. package/lib/progress-ring/index.d.ts +0 -1
  200. package/lib/radio/index.d.ts +0 -1
  201. package/lib/radio-group/index.d.ts +0 -1
  202. package/lib/select/index.d.ts +0 -1
  203. package/lib/side-drawer/index.d.ts +0 -1
  204. package/lib/slider/index.d.ts +0 -1
  205. package/lib/split-button/index.d.ts +0 -1
  206. package/lib/switch/index.d.ts +0 -1
  207. package/lib/tab/index.d.ts +0 -1
  208. package/lib/tab-panel/index.d.ts +0 -1
  209. package/lib/tabs/index.d.ts +0 -1
  210. package/lib/tag/index.d.ts +0 -1
  211. package/lib/tag-group/index.d.ts +0 -1
  212. package/lib/text-anchor/index.d.ts +0 -1
  213. package/lib/text-area/index.d.ts +0 -1
  214. package/lib/text-field/index.d.ts +0 -1
  215. package/lib/toggletip/index.d.ts +0 -1
  216. package/lib/tooltip/index.d.ts +0 -1
  217. package/lib/tree-item/index.d.ts +0 -1
  218. package/lib/tree-view/index.d.ts +0 -1
package/shared/index2.js CHANGED
@@ -1,45 +1,57 @@
1
- import { _ as __decorate, a as attr, b as __metadata, o as observable, v as volatile, h as html, d as __classPrivateFieldGet, f as __classPrivateFieldSet } from './index.js';
2
1
  import { I as Icon } from './icon.js';
2
+ import { a as attr, o as observable, v as volatile, h as html } from './index.js';
3
3
  import { w as when } from './when.js';
4
4
  import enUS from '../locales/en-US.js';
5
5
 
6
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n.message {\n display: flex;\n contain: inline-size;\n font: var(--vvd-typography-base-condensed);\n gap: 4px;\n grid-column: 1/-1;\n}\n.message-text {\n color: var(--vvd-color-canvas-text);\n}\n.helper-message .message-text {\n color: var(--_low-ink-color);\n}\n.message-icon {\n font-size: 16px;\n}\n.success-message .message-icon {\n color: var(--vvd-color-success-500);\n}\n.error-message .message-icon {\n color: var(--vvd-color-alert-500);\n}";
6
+ const messageStyles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n.message {\n display: flex;\n contain: inline-size;\n font: var(--vvd-typography-base-condensed);\n gap: 4px;\n grid-column: 1/-1;\n}\n.message-text {\n color: var(--vvd-color-canvas-text);\n}\n.helper-message .message-text {\n color: var(--_low-ink-color);\n}\n.message-icon {\n font-size: 16px;\n}\n.success-message .message-icon {\n color: var(--vvd-color-success-500);\n}\n.error-message .message-icon {\n color: var(--vvd-color-alert-500);\n}";
7
7
 
8
- const ElementInternalsKey = 'ElementInternals';
9
- const supportsElementInternals = () => ElementInternalsKey in window && 'setFormValue' in window[ElementInternalsKey].prototype;
10
- class FormElementHelperText {}
11
- __decorate([attr({
12
- attribute: 'helper-text'
13
- }), __metadata("design:type", String)], FormElementHelperText.prototype, "helperText", void 0);
14
- class FormElementSuccessText {}
15
- __decorate([attr({
16
- attribute: 'success-text'
17
- }), __metadata("design:type", String)], FormElementSuccessText.prototype, "successText", void 0);
8
+ var __defProp$1 = Object.defineProperty;
9
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
10
+ var __decorateClass$1 = (decorators, target, key, kind) => {
11
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
15
+ if (kind && result)
16
+ __defProp$1(target, key, result);
17
+ return result;
18
+ };
19
+ const ElementInternalsKey = "ElementInternals";
20
+ const supportsElementInternals = () => ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype;
21
+ class FormElementHelperText {
22
+ }
23
+ __decorateClass$1([
24
+ attr({ attribute: "helper-text" })
25
+ ], FormElementHelperText.prototype, "helperText", 2);
26
+ class FormElementSuccessText {
27
+ }
28
+ __decorateClass$1([
29
+ attr({ attribute: "success-text" })
30
+ ], FormElementSuccessText.prototype, "successText", 2);
18
31
  class FormElementCharCount {
19
32
  constructor() {
20
33
  this.charCount = false;
21
34
  }
22
35
  }
23
- __decorate([attr({
24
- attribute: 'char-count',
25
- mode: 'boolean'
26
- }), __metadata("design:type", Object)], FormElementCharCount.prototype, "charCount", void 0);
36
+ __decorateClass$1([
37
+ attr({
38
+ attribute: "char-count",
39
+ mode: "boolean"
40
+ })
41
+ ], FormElementCharCount.prototype, "charCount", 2);
27
42
  function formElements(constructor) {
28
- var _Decorated_blurred, _Decorated_handleInvalidEvent;
29
43
  class Decorated extends constructor {
30
- get errorValidationMessage() {
31
- return this.userValid ? '' : this.validationMessage;
32
- }
33
44
  constructor(...args) {
34
45
  super(...args);
35
46
  this.userValid = true;
36
- _Decorated_blurred.set(this, false);
37
- _Decorated_handleInvalidEvent.set(this, () => {
38
- if (__classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue) return;
39
- __classPrivateFieldSet(this, _Decorated_blurred, true, "f");
47
+ this.#blurred = false;
48
+ this.#handleInvalidEvent = () => {
49
+ if (this.#blurred && this.dirtyValue)
50
+ return;
51
+ this.#blurred = true;
40
52
  this.dirtyValue = true;
41
53
  this.validate();
42
- });
54
+ };
43
55
  this.validate = () => {
44
56
  if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
45
57
  this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
@@ -48,53 +60,61 @@ function formElements(constructor) {
48
60
  }
49
61
  this.userValid = !this.userValid;
50
62
  if (this.proxy instanceof HTMLElement) {
51
- this.userValid = __classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue ? !this.validationMessage : true;
63
+ this.userValid = this.#blurred && this.dirtyValue ? !this.validationMessage : true;
52
64
  }
53
65
  };
54
- this.addEventListener('blur', () => {
55
- __classPrivateFieldSet(this, _Decorated_blurred, true, "f");
66
+ this.addEventListener("blur", () => {
67
+ this.#blurred = true;
56
68
  this.validate();
57
69
  });
58
- this.addEventListener('focus', () => {
59
- __classPrivateFieldSet(this, _Decorated_blurred, false, "f");
70
+ this.addEventListener("focus", () => {
71
+ this.#blurred = false;
60
72
  });
61
- this.addEventListener('invalid', () => {
62
- this.proxy.dispatchEvent(new Event('invalid'));
73
+ this.addEventListener("invalid", () => {
74
+ this.proxy.dispatchEvent(new Event("invalid"));
63
75
  });
64
76
  }
77
+ #blurred;
78
+ get errorValidationMessage() {
79
+ return this.userValid ? "" : this.validationMessage;
80
+ }
65
81
  connectedCallback() {
66
- var _a;
67
- (_a = super.connectedCallback) === null || _a === void 0 ? void 0 : _a.call(this);
68
- this.proxy.addEventListener('invalid', __classPrivateFieldGet(this, _Decorated_handleInvalidEvent, "f"));
82
+ super.connectedCallback?.();
83
+ this.proxy.addEventListener("invalid", this.#handleInvalidEvent);
69
84
  }
85
+ #handleInvalidEvent;
70
86
  disconnectedCallback() {
71
- var _a;
72
- (_a = super.disconnectedCallback) === null || _a === void 0 ? void 0 : _a.call(this);
73
- this.proxy.removeEventListener('invalid', __classPrivateFieldGet(this, _Decorated_handleInvalidEvent, "f"));
87
+ super.disconnectedCallback?.();
88
+ this.proxy.removeEventListener("invalid", this.#handleInvalidEvent);
74
89
  }
75
90
  }
76
- _Decorated_blurred = new WeakMap(), _Decorated_handleInvalidEvent = new WeakMap();
77
- __decorate([attr, __metadata("design:type", String)], Decorated.prototype, "label", void 0);
78
- __decorate([observable, __metadata("design:type", Object)], Decorated.prototype, "userValid", void 0);
79
- __decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Decorated.prototype, "errorValidationMessage", null);
91
+ __decorateClass$1([
92
+ attr
93
+ ], Decorated.prototype, "label", 2);
94
+ __decorateClass$1([
95
+ observable
96
+ ], Decorated.prototype, "userValid", 2);
97
+ __decorateClass$1([
98
+ volatile
99
+ ], Decorated.prototype, "errorValidationMessage", 1);
80
100
  return Decorated;
81
101
  }
82
102
  function getFeedbackTemplate(messageType, context) {
83
103
  const MessageTypeMap = {
84
- 'helper': {
85
- 'messageProperty': 'helperText',
86
- 'className': 'helper',
87
- 'iconType': ''
104
+ "helper": {
105
+ "messageProperty": "helperText",
106
+ "className": "helper",
107
+ "iconType": ""
88
108
  },
89
- 'error': {
90
- 'messageProperty': 'errorValidationMessage',
91
- 'className': 'error',
92
- 'iconType': 'info-line'
109
+ "error": {
110
+ "messageProperty": "errorValidationMessage",
111
+ "className": "error",
112
+ "iconType": "info-line"
93
113
  },
94
- 'success': {
95
- 'messageProperty': 'successText',
96
- 'className': 'success',
97
- 'iconType': 'check-circle-line'
114
+ "success": {
115
+ "messageProperty": "successText",
116
+ "className": "success",
117
+ "iconType": "check-circle-line"
98
118
  }
99
119
  };
100
120
  const iconTag = context.tagFor(Icon);
@@ -102,7 +122,7 @@ function getFeedbackTemplate(messageType, context) {
102
122
  const iconType = messageTypeConfig.iconType;
103
123
  return html`
104
124
  <style>
105
- ${css_248z}
125
+ ${messageStyles}
106
126
 
107
127
  </style>
108
128
  <div class="message ${MessageTypeMap[messageType].className}-message">
@@ -113,61 +133,69 @@ function getFeedbackTemplate(messageType, context) {
113
133
  })}
114
134
  </div>`;
115
135
  }
116
- function feedbackMessage({
117
- messageProperty
118
- }) {
136
+ function feedbackMessage({ messageProperty }) {
119
137
  return html`
120
- <span class="message-text">${x => x[messageProperty]}</span>
138
+ <span class="message-text">${(x) => x[messageProperty]}</span>
121
139
  `;
122
140
  }
123
141
  function errorText(constructor) {
124
- var _Decorated_shouldValidate, _Decorated_prevSuccessText;
125
142
  class Decorated extends constructor {
126
143
  constructor(...args) {
127
144
  super(...args);
128
- _Decorated_shouldValidate.set(this, true);
129
- _Decorated_prevSuccessText.set(this, '');
145
+ this.#shouldValidate = true;
146
+ this.#prevSuccessText = "";
130
147
  this._validate = this.validate;
131
148
  this.validate = () => {
132
- if (__classPrivateFieldGet(this, _Decorated_shouldValidate, "f")) this._validate();
149
+ if (this.#shouldValidate)
150
+ this._validate();
133
151
  };
134
152
  }
153
+ #shouldValidate;
154
+ #prevSuccessText;
135
155
  errorTextChanged(_, newmsg) {
136
156
  if (newmsg) {
137
- this.setValidity({
138
- customError: true
139
- }, newmsg, this.control);
140
- __classPrivateFieldSet(this, _Decorated_prevSuccessText, this.successText, "f");
141
- this.successText = '';
157
+ this.setValidity({ customError: true }, newmsg, this.control);
158
+ this.#prevSuccessText = this.successText;
159
+ this.successText = "";
142
160
  this.userValid = !this.userValid;
143
161
  this.userValid = false;
144
- __classPrivateFieldSet(this, _Decorated_shouldValidate, false, "f");
162
+ this.#shouldValidate = false;
145
163
  } else {
146
- this.setValidity({
147
- customError: false
148
- }, '', this.control);
149
- this.successText = __classPrivateFieldGet(this, _Decorated_prevSuccessText, "f");
164
+ this.setValidity({ customError: false }, "", this.control);
165
+ this.successText = this.#prevSuccessText;
150
166
  this.userValid = true;
151
- __classPrivateFieldSet(this, _Decorated_shouldValidate, true, "f");
167
+ this.#shouldValidate = true;
152
168
  this._validate();
153
169
  }
154
170
  }
155
171
  }
156
- _Decorated_shouldValidate = new WeakMap(), _Decorated_prevSuccessText = new WeakMap();
157
- __decorate([attr({
158
- attribute: 'error-text'
159
- }), __metadata("design:type", String)], Decorated.prototype, "errorText", void 0);
172
+ __decorateClass$1([
173
+ attr({ attribute: "error-text" })
174
+ ], Decorated.prototype, "errorText", 2);
160
175
  return Decorated;
161
176
  }
162
177
 
178
+ var __defProp = Object.defineProperty;
179
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
180
+ var __decorateClass = (decorators, target, key, kind) => {
181
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
182
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
183
+ if (decorator = decorators[i])
184
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
185
+ if (kind && result)
186
+ __defProp(target, key, result);
187
+ return result;
188
+ };
163
189
  class CurrentLocale {
164
190
  constructor() {
165
191
  this.locale = enUS;
166
192
  }
167
193
  }
168
- __decorate([observable, __metadata("design:type", Object)], CurrentLocale.prototype, "locale", void 0);
194
+ __decorateClass([
195
+ observable
196
+ ], CurrentLocale.prototype, "locale", 2);
169
197
  const currentLocale = new CurrentLocale();
170
- const setLocale = locale => {
198
+ const setLocale = (locale) => {
171
199
  currentLocale.locale = locale;
172
200
  };
173
201
 
@@ -97,4 +97,4 @@ const ArrowKeys = {
97
97
  ArrowUp: keyArrowUp,
98
98
  };
99
99
 
100
- export { ArrowKeys as A, keyHome as a, keyArrowDown as b, keyArrowUp as c, keyEnter as d, keySpace as e, keyEscape as f, keyTab as g, keyArrowRight as h, keyArrowLeft as i, keyPageDown as j, keyEnd as k, keyPageUp as l, keyFunction2 as m };
100
+ export { ArrowKeys as A, keySpace as a, keyEnd as b, keyHome as c, keyArrowDown as d, keyArrowUp as e, keyEscape as f, keyTab as g, keyArrowRight as h, keyArrowLeft as i, keyPageDown as j, keyEnter as k, keyPageUp as l, keyFunction2 as m };
package/shared/listbox.js CHANGED
@@ -1,8 +1,8 @@
1
- import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter, b as __metadata } from './index.js';
2
- import { i as isListboxOption } from './definition21.js';
1
+ import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter } from './index.js';
2
+ import { i as isListboxOption } from './definition33.js';
3
3
  import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
4
4
  import { a as applyMixins } from './apply-mixins.js';
5
- import { e as keySpace, f as keyEscape, d as keyEnter, g as keyTab, k as keyEnd, c as keyArrowUp, b as keyArrowDown, a as keyHome } from './key-codes.js';
5
+ import { a as keySpace, f as keyEscape, k as keyEnter, g as keyTab, b as keyEnd, e as keyArrowUp, d as keyArrowDown, c as keyHome } from './key-codes.js';
6
6
  import { u as uniqueId } from './strings.js';
7
7
  import { i as inRange } from './numbers.js';
8
8
 
@@ -30,7 +30,7 @@ function findLastIndex(array, predicate) {
30
30
  *
31
31
  * @public
32
32
  */
33
- class Listbox$1 extends FoundationElement {
33
+ let Listbox$1 = class Listbox extends FoundationElement {
34
34
  constructor() {
35
35
  super(...arguments);
36
36
  /**
@@ -226,7 +226,7 @@ class Listbox$1 extends FoundationElement {
226
226
  handleChange(source, propertyName) {
227
227
  switch (propertyName) {
228
228
  case "selected": {
229
- if (Listbox$1.slottedOptionFilter(source)) {
229
+ if (Listbox.slottedOptionFilter(source)) {
230
230
  this.selectedIndex = this.options.indexOf(source);
231
231
  }
232
232
  this.setSelectedOptions();
@@ -248,7 +248,7 @@ class Listbox$1 extends FoundationElement {
248
248
  if (this.typeaheadTimeout) {
249
249
  window.clearTimeout(this.typeaheadTimeout);
250
250
  }
251
- this.typeaheadTimeout = window.setTimeout(() => (this.typeaheadExpired = true), Listbox$1.TYPE_AHEAD_TIMEOUT_MS);
251
+ this.typeaheadTimeout = window.setTimeout(() => (this.typeaheadExpired = true), Listbox.TYPE_AHEAD_TIMEOUT_MS);
252
252
  if (key.length > 1) {
253
253
  return;
254
254
  }
@@ -374,7 +374,7 @@ class Listbox$1 extends FoundationElement {
374
374
  */
375
375
  selectedOptionsChanged(prev, next) {
376
376
  var _a;
377
- const filteredNext = next.filter(Listbox$1.slottedOptionFilter);
377
+ const filteredNext = next.filter(Listbox.slottedOptionFilter);
378
378
  (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {
379
379
  const notifier = Observable.getNotifier(o);
380
380
  notifier.unsubscribe(this, "selected");
@@ -493,7 +493,7 @@ class Listbox$1 extends FoundationElement {
493
493
  this.typeaheadExpired = false;
494
494
  }
495
495
  }
496
- }
496
+ };
497
497
  /**
498
498
  * A static filter to include only selectable options.
499
499
  *
@@ -989,7 +989,84 @@ __decorate([
989
989
  attr({ converter: nullableNumberConverter })
990
990
  ], ListboxElement.prototype, "size", void 0);
991
991
 
992
- class Listbox extends ListboxElement {}
993
- __decorate([attr, __metadata("design:type", String)], Listbox.prototype, "appearance", void 0);
992
+ /**
993
+ * String values for use with KeyboardEvent.key
994
+ */
995
+ const keyArrowLeft = "ArrowLeft";
996
+ const keyArrowRight = "ArrowRight";
997
+
998
+ var __defProp = Object.defineProperty;
999
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1000
+ var __decorateClass = (decorators, target, key, kind) => {
1001
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1002
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1003
+ if (decorator = decorators[i])
1004
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1005
+ if (kind && result)
1006
+ __defProp(target, key, result);
1007
+ return result;
1008
+ };
1009
+ class Listbox extends ListboxElement {
1010
+ orientationChanged() {
1011
+ if (this.orientation === "horizontal") {
1012
+ this.addEventListener("keydown", this.#horizontalKeydownHandler);
1013
+ } else {
1014
+ this.removeEventListener("keydown", this.#horizontalKeydownHandler);
1015
+ }
1016
+ }
1017
+ /**
1018
+ * Handles `keydown` actions for horizontal listbox navigation and typeahead.
1019
+ *
1020
+ * @internal
1021
+ */
1022
+ #horizontalKeydownHandler(e) {
1023
+ if (this.disabled) {
1024
+ return true;
1025
+ }
1026
+ const key = e.key;
1027
+ switch (key) {
1028
+ case keyArrowRight: {
1029
+ if (!e.shiftKey) {
1030
+ e.preventDefault();
1031
+ this.selectNextOption();
1032
+ }
1033
+ break;
1034
+ }
1035
+ case keyArrowLeft: {
1036
+ if (!e.shiftKey) {
1037
+ e.preventDefault();
1038
+ this.selectPreviousOption();
1039
+ }
1040
+ break;
1041
+ }
1042
+ }
1043
+ }
1044
+ slottedOptionsChanged(prev, next) {
1045
+ super.slottedOptionsChanged(prev, next);
1046
+ this.#disableSlottedChildren();
1047
+ }
1048
+ attributeChangedCallback(name, oldValue, newValue) {
1049
+ super.attributeChangedCallback(name, oldValue, newValue);
1050
+ if (name === "disabled") {
1051
+ this.#disableSlottedChildren();
1052
+ }
1053
+ }
1054
+ #disableSlottedChildren() {
1055
+ this.options.forEach((optionElement) => {
1056
+ if (!optionElement.disabled) {
1057
+ optionElement.disabled = this.disabled;
1058
+ }
1059
+ });
1060
+ }
1061
+ }
1062
+ __decorateClass([
1063
+ attr
1064
+ ], Listbox.prototype, "appearance", 2);
1065
+ __decorateClass([
1066
+ attr
1067
+ ], Listbox.prototype, "orientation", 2);
1068
+ __decorateClass([
1069
+ attr
1070
+ ], Listbox.prototype, "shape", 2);
994
1071
 
995
- export { DelegatesARIAListbox as D, Listbox$1 as L, Listbox as a, ListboxElement as b };
1072
+ export { DelegatesARIAListbox as D, ListboxElement as L, Listbox as a, Listbox$1 as b };
@@ -33,10 +33,10 @@ export declare function formElements<T extends {
33
33
  [x: string]: any;
34
34
  label?: string | undefined;
35
35
  userValid: boolean;
36
- "__#10090@#blurred": boolean;
36
+ "__#2@#blurred": boolean;
37
37
  readonly errorValidationMessage: any;
38
38
  connectedCallback(): void;
39
- "__#10090@#handleInvalidEvent": () => void;
39
+ "__#2@#handleInvalidEvent": () => void;
40
40
  disconnectedCallback(): void;
41
41
  validate: () => void;
42
42
  };
@@ -49,8 +49,8 @@ export declare function errorText<T extends {
49
49
  new (...args: any[]): {
50
50
  [x: string]: any;
51
51
  errorText?: string | undefined;
52
- "__#10091@#shouldValidate": boolean;
53
- "__#10091@#prevSuccessText": string;
52
+ "__#3@#shouldValidate": boolean;
53
+ "__#3@#prevSuccessText": string;
54
54
  errorTextChanged(_: string, newmsg: string | undefined): void;
55
55
  };
56
56
  } & T;
package/shared/radio.js CHANGED
@@ -1,6 +1,6 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, o as observable, b as __metadata } from './index.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index.js';
2
2
  import { C as CheckableFormAssociated } from './form-associated.js';
3
- import { e as keySpace } from './key-codes.js';
3
+ import { a as keySpace } from './key-codes.js';
4
4
 
5
5
  class _Radio extends FoundationElement {
6
6
  }
@@ -28,7 +28,7 @@ class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
28
28
  *
29
29
  * @public
30
30
  */
31
- class Radio$1 extends FormAssociatedRadio {
31
+ let Radio$1 = class Radio extends FormAssociatedRadio {
32
32
  constructor() {
33
33
  super();
34
34
  /**
@@ -110,7 +110,7 @@ class Radio$1 extends FormAssociatedRadio {
110
110
  this.checked = true;
111
111
  }
112
112
  }
113
- }
113
+ };
114
114
  __decorate([
115
115
  attr({ attribute: "readonly", mode: "boolean" })
116
116
  ], Radio$1.prototype, "readOnly", void 0);
@@ -121,8 +121,24 @@ __decorate([
121
121
  observable
122
122
  ], Radio$1.prototype, "defaultSlottedNodes", void 0);
123
123
 
124
- class Radio extends Radio$1 {}
125
- __decorate([attr, __metadata("design:type", String)], Radio.prototype, "label", void 0);
126
- __decorate([attr, __metadata("design:type", String)], Radio.prototype, "connotation", void 0);
124
+ var __defProp = Object.defineProperty;
125
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
126
+ var __decorateClass = (decorators, target, key, kind) => {
127
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
128
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
129
+ if (decorator = decorators[i])
130
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
131
+ if (kind && result)
132
+ __defProp(target, key, result);
133
+ return result;
134
+ };
135
+ class Radio extends Radio$1 {
136
+ }
137
+ __decorateClass([
138
+ attr
139
+ ], Radio.prototype, "label", 2);
140
+ __decorateClass([
141
+ attr
142
+ ], Radio.prototype, "connotation", 2);
127
143
 
128
144
  export { Radio as R };
package/shared/repeat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective, i as HTMLView } from './index.js';
1
+ import { e as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective, f as HTMLView } from './index.js';
2
2
 
3
3
  /** @internal */
4
4
  function newSplice(index, removed, addedCount) {
@@ -1,14 +1,31 @@
1
- import { _ as __decorate, a as attr, b as __metadata } from './index.js';
2
- import { b as AffixIcon } from './affix.js';
1
+ import { A as AffixIcon } from './affix.js';
3
2
  import { A as Anchor } from './anchor.js';
4
3
  import { a as applyMixins } from './apply-mixins.js';
4
+ import { a as attr } from './index.js';
5
5
 
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result)
14
+ __defProp(target, key, result);
15
+ return result;
16
+ };
6
17
  class TextAnchor extends Anchor {
18
+ /**
19
+ * Allows subclasses to provide a body template that will be rendered inside the anchor.
20
+ * @internal
21
+ */
7
22
  getBodyTemplate() {
8
- return undefined;
23
+ return void 0;
9
24
  }
10
25
  }
11
- __decorate([attr, __metadata("design:type", String)], TextAnchor.prototype, "text", void 0);
26
+ __decorateClass([
27
+ attr
28
+ ], TextAnchor.prototype, "text", 2);
12
29
  applyMixins(TextAnchor, AffixIcon);
13
30
 
14
31
  export { TextAnchor as T };
@@ -4,52 +4,49 @@ import { h as html } from './index.js';
4
4
  import { r as ref } from './ref.js';
5
5
  import { c as classNames } from './class-names.js';
6
6
 
7
- const getClasses = ({
8
- text,
9
- icon
10
- }) => classNames('control', ['icon-only', !text && !!icon]);
11
- const textAnchorTemplate = context => {
7
+ const getClasses = ({ text, icon }) => classNames(
8
+ "control",
9
+ ["icon-only", !text && !!icon]
10
+ );
11
+ const textAnchorTemplate = (context) => {
12
12
  const affixIconTemplate = affixIconTemplateFactory(context);
13
13
  const focusTemplate = focusTemplateFactory(context);
14
14
  return html`<a
15
15
  class="${getClasses}"
16
- download="${x => x.download}"
17
- href="${x => x.href}"
18
- hreflang="${x => x.hreflang}"
19
- ping="${x => x.ping}"
20
- referrerpolicy="${x => x.referrerpolicy}"
21
- rel="${x => x.rel}"
22
- target="${x => x.target}"
23
- type="${x => x.type}"
24
- aria-atomic="${x => x.ariaAtomic}"
25
- aria-busy="${x => x.ariaBusy}"
26
- aria-controls="${x => x.ariaControls}"
27
- aria-current="${x => x.ariaCurrent}"
28
- aria-describedby="${x => x.ariaDescribedby}"
29
- aria-details="${x => x.ariaDetails}"
30
- aria-disabled="${x => x.ariaDisabled}"
31
- aria-errormessage="${x => x.ariaErrormessage}"
32
- aria-expanded="${x => x.ariaExpanded}"
33
- aria-flowto="${x => x.ariaFlowto}"
34
- aria-haspopup="${x => x.ariaHaspopup}"
35
- aria-hidden="${x => x.ariaHidden}"
36
- aria-invalid="${x => x.ariaInvalid}"
37
- aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
38
- aria-label="${x => x.ariaLabel}"
39
- aria-labelledby="${x => x.ariaLabelledby}"
40
- aria-live="${x => x.ariaLive}"
41
- aria-owns="${x => x.ariaOwns}"
42
- aria-relevant="${x => x.ariaRelevant}"
43
- aria-roledescription="${x => x.ariaRoledescription}"
44
- ${ref('control')}
16
+ download="${(x) => x.download}"
17
+ href="${(x) => x.href}"
18
+ hreflang="${(x) => x.hreflang}"
19
+ ping="${(x) => x.ping}"
20
+ referrerpolicy="${(x) => x.referrerpolicy}"
21
+ rel="${(x) => x.rel}"
22
+ target="${(x) => x.target}"
23
+ type="${(x) => x.type}"
24
+ aria-atomic="${(x) => x.ariaAtomic}"
25
+ aria-busy="${(x) => x.ariaBusy}"
26
+ aria-controls="${(x) => x.ariaControls}"
27
+ aria-current="${(x) => x.ariaCurrent}"
28
+ aria-describedby="${(x) => x.ariaDescribedby}"
29
+ aria-details="${(x) => x.ariaDetails}"
30
+ aria-disabled="${(x) => x.ariaDisabled}"
31
+ aria-errormessage="${(x) => x.ariaErrormessage}"
32
+ aria-expanded="${(x) => x.ariaExpanded}"
33
+ aria-flowto="${(x) => x.ariaFlowto}"
34
+ aria-haspopup="${(x) => x.ariaHaspopup}"
35
+ aria-hidden="${(x) => x.ariaHidden}"
36
+ aria-invalid="${(x) => x.ariaInvalid}"
37
+ aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
38
+ aria-label="${(x) => x.ariaLabel}"
39
+ aria-labelledby="${(x) => x.ariaLabelledby}"
40
+ aria-live="${(x) => x.ariaLive}"
41
+ aria-owns="${(x) => x.ariaOwns}"
42
+ aria-relevant="${(x) => x.ariaRelevant}"
43
+ aria-roledescription="${(x) => x.ariaRoledescription}"
44
+ ${ref("control")}
45
45
  >
46
46
  ${() => focusTemplate}
47
- ${x => affixIconTemplate(x.icon)}
48
- ${x => x.text}
49
- ${x => {
50
- var _a, _b;
51
- return (_b = (_a = x.getBodyTemplate) === null || _a === void 0 ? void 0 : _a.call(x)) !== null && _b !== void 0 ? _b : '';
52
- }}
47
+ ${(x) => affixIconTemplate(x.icon)}
48
+ ${(x) => x.text}
49
+ ${(x) => x.getBodyTemplate?.() ?? ""}
53
50
  </a>
54
51
  `;
55
52
  };