@vonage/vivid 3.52.0 → 3.54.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 (299) hide show
  1. package/README.md +1 -1
  2. package/accordion/index.cjs +1 -1
  3. package/accordion/index.js +1 -1
  4. package/accordion-item/index.cjs +1 -1
  5. package/accordion-item/index.js +1 -1
  6. package/alert/index.cjs +3 -3
  7. package/alert/index.js +3 -3
  8. package/appearance-ui/index.cjs +1 -1
  9. package/appearance-ui/index.js +1 -1
  10. package/audio-player/index.cjs +3 -3
  11. package/audio-player/index.js +3 -3
  12. package/avatar/index.cjs +1 -1
  13. package/avatar/index.js +1 -1
  14. package/badge/index.cjs +1 -1
  15. package/badge/index.js +1 -1
  16. package/banner/index.cjs +2 -2
  17. package/banner/index.js +2 -2
  18. package/breadcrumb-item/index.cjs +1 -1
  19. package/breadcrumb-item/index.js +1 -1
  20. package/button/index.cjs +2 -2
  21. package/button/index.js +2 -2
  22. package/card/index.cjs +2 -2
  23. package/card/index.js +2 -2
  24. package/checkbox/index.cjs +3 -2
  25. package/checkbox/index.js +3 -2
  26. package/combobox/index.cjs +5 -5
  27. package/combobox/index.js +5 -5
  28. package/custom-elements.json +1162 -99
  29. package/data-grid/index.cjs +1 -1
  30. package/data-grid/index.js +1 -1
  31. package/date-picker/index.cjs +7 -6
  32. package/date-picker/index.js +7 -6
  33. package/date-range-picker/index.cjs +7 -6
  34. package/date-range-picker/index.js +7 -6
  35. package/dial-pad/index.cjs +33 -0
  36. package/dial-pad/index.js +31 -0
  37. package/dialog/index.cjs +4 -4
  38. package/dialog/index.js +4 -4
  39. package/divider/index.cjs +1 -1
  40. package/divider/index.js +1 -1
  41. package/elevation/index.cjs +1 -1
  42. package/elevation/index.js +1 -1
  43. package/empty-state/index.cjs +2 -2
  44. package/empty-state/index.js +2 -2
  45. package/fab/index.cjs +2 -2
  46. package/fab/index.js +2 -2
  47. package/file-picker/index.cjs +4 -3
  48. package/file-picker/index.js +4 -3
  49. package/header/index.cjs +2 -2
  50. package/header/index.js +2 -2
  51. package/icon/index.cjs +1 -1
  52. package/icon/index.js +1 -1
  53. package/index.cjs +132 -122
  54. package/index.js +46 -43
  55. package/layout/index.cjs +1 -1
  56. package/layout/index.js +1 -1
  57. package/lib/appearance-ui/appearance-ui.d.ts +1 -1
  58. package/lib/audio-player/audio-player.d.ts +4 -0
  59. package/lib/audio-player/locale.d.ts +2 -0
  60. package/lib/components.d.ts +2 -0
  61. package/lib/dial-pad/definition.d.ts +3 -0
  62. package/lib/dial-pad/dial-pad.d.ts +17 -0
  63. package/lib/dial-pad/dial-pad.template.d.ts +4 -0
  64. package/lib/dial-pad/locale.d.ts +18 -0
  65. package/lib/enums.d.ts +7 -0
  66. package/lib/menu/menu.d.ts +1 -0
  67. package/lib/nav-disclosure/nav-disclosure.d.ts +5 -0
  68. package/lib/text-anchor/definition.d.ts +1 -0
  69. package/lib/text-anchor/text-anchor.d.ts +5 -0
  70. package/lib/video-player/definition.d.ts +3 -0
  71. package/lib/video-player/locale.d.ts +1 -0
  72. package/lib/video-player/video-player.d.ts +17 -0
  73. package/lib/video-player/video-player.template.d.ts +4 -0
  74. package/lib/video-player/vivid-video-svg.d.ts +1 -0
  75. package/listbox/index.cjs +2 -2
  76. package/listbox/index.js +2 -2
  77. package/locales/en-GB.cjs +33 -1
  78. package/locales/en-GB.js +33 -1
  79. package/locales/en-US.cjs +201 -1
  80. package/locales/en-US.js +201 -1
  81. package/locales/ja-JP.cjs +200 -1
  82. package/locales/ja-JP.js +200 -1
  83. package/locales/zh-CN.cjs +202 -1
  84. package/locales/zh-CN.js +202 -1
  85. package/menu/index.cjs +6 -6
  86. package/menu/index.js +6 -6
  87. package/menu-item/index.cjs +2 -2
  88. package/menu-item/index.js +2 -2
  89. package/nav/index.cjs +1 -1
  90. package/nav/index.js +1 -1
  91. package/nav-disclosure/index.cjs +2 -2
  92. package/nav-disclosure/index.js +2 -2
  93. package/nav-item/index.cjs +2 -2
  94. package/nav-item/index.js +2 -2
  95. package/note/index.cjs +2 -2
  96. package/note/index.js +2 -2
  97. package/number-field/index.cjs +5 -4
  98. package/number-field/index.js +5 -4
  99. package/option/index.cjs +2 -2
  100. package/option/index.js +2 -2
  101. package/package.json +1 -1
  102. package/pagination/index.cjs +3 -3
  103. package/pagination/index.js +3 -3
  104. package/popup/index.cjs +4 -4
  105. package/popup/index.js +4 -4
  106. package/progress/index.cjs +1 -1
  107. package/progress/index.js +1 -1
  108. package/progress-ring/index.cjs +1 -1
  109. package/progress-ring/index.js +1 -1
  110. package/radio/index.cjs +1 -1
  111. package/radio/index.js +1 -1
  112. package/radio-group/index.cjs +1 -1
  113. package/radio-group/index.js +1 -1
  114. package/range-slider/index.cjs +2 -2
  115. package/range-slider/index.js +2 -2
  116. package/select/index.cjs +7 -6
  117. package/select/index.js +7 -6
  118. package/selectable-box/index.cjs +5 -4
  119. package/selectable-box/index.js +5 -4
  120. package/shared/applyMixinsWithObservables.cjs +15 -0
  121. package/shared/applyMixinsWithObservables.js +13 -0
  122. package/shared/definition.cjs +1 -1
  123. package/shared/definition.js +1 -1
  124. package/shared/definition11.cjs +3 -3
  125. package/shared/definition11.js +3 -3
  126. package/shared/definition14.cjs +2 -2
  127. package/shared/definition14.js +2 -2
  128. package/shared/definition15.cjs +8 -9
  129. package/shared/definition15.js +8 -9
  130. package/shared/definition16.cjs +3 -3
  131. package/shared/definition16.js +3 -3
  132. package/shared/definition17.cjs +2 -2
  133. package/shared/definition17.js +3 -3
  134. package/shared/definition18.cjs +3 -3
  135. package/shared/definition18.js +3 -3
  136. package/shared/definition19.cjs +3 -3
  137. package/shared/definition19.js +3 -3
  138. package/shared/definition20.cjs +196 -224
  139. package/shared/definition20.js +191 -219
  140. package/shared/definition21.cjs +264 -67
  141. package/shared/definition21.js +263 -65
  142. package/shared/definition22.cjs +66 -57
  143. package/shared/definition22.js +64 -56
  144. package/shared/definition23.cjs +42 -76
  145. package/shared/definition23.js +41 -75
  146. package/shared/definition24.cjs +70 -2402
  147. package/shared/definition24.js +69 -2401
  148. package/shared/definition25.cjs +2402 -46
  149. package/shared/definition25.js +2401 -45
  150. package/shared/definition26.cjs +63 -30
  151. package/shared/definition26.js +62 -29
  152. package/shared/definition27.cjs +28 -56
  153. package/shared/definition27.js +27 -55
  154. package/shared/definition28.cjs +35 -881
  155. package/shared/definition28.js +34 -879
  156. package/shared/definition29.cjs +922 -60
  157. package/shared/definition29.js +922 -61
  158. package/shared/definition30.cjs +68 -86
  159. package/shared/definition30.js +67 -85
  160. package/shared/definition31.cjs +98 -21
  161. package/shared/definition31.js +98 -21
  162. package/shared/definition32.cjs +24 -12
  163. package/shared/definition32.js +23 -11
  164. package/shared/definition33.cjs +11 -50
  165. package/shared/definition33.js +10 -49
  166. package/shared/definition34.cjs +26 -515
  167. package/shared/definition34.js +26 -515
  168. package/shared/definition35.cjs +448 -194
  169. package/shared/definition35.js +448 -192
  170. package/shared/definition36.cjs +256 -202
  171. package/shared/definition36.js +253 -201
  172. package/shared/definition37.cjs +204 -65
  173. package/shared/definition37.js +203 -63
  174. package/shared/definition38.cjs +63 -57
  175. package/shared/definition38.js +60 -55
  176. package/shared/definition39.cjs +65 -432
  177. package/shared/definition39.js +64 -431
  178. package/shared/definition4.cjs +2 -2
  179. package/shared/definition4.js +2 -2
  180. package/shared/definition40.cjs +441 -34
  181. package/shared/definition40.js +438 -31
  182. package/shared/definition41.cjs +34 -576
  183. package/shared/definition41.js +33 -575
  184. package/shared/definition42.cjs +531 -654
  185. package/shared/definition42.js +531 -654
  186. package/shared/definition43.cjs +690 -114
  187. package/shared/definition43.js +689 -113
  188. package/shared/definition44.cjs +124 -79
  189. package/shared/definition44.js +122 -77
  190. package/shared/definition45.cjs +78 -520
  191. package/shared/definition45.js +77 -518
  192. package/shared/definition46.cjs +520 -119
  193. package/shared/definition46.js +518 -118
  194. package/shared/definition47.cjs +118 -135
  195. package/shared/definition47.js +117 -134
  196. package/shared/definition48.cjs +151 -19
  197. package/shared/definition48.js +150 -18
  198. package/shared/definition49.cjs +21 -84
  199. package/shared/definition49.js +20 -83
  200. package/shared/definition5.cjs +100 -19
  201. package/shared/definition5.js +100 -19
  202. package/shared/definition50.cjs +52 -505
  203. package/shared/definition50.js +51 -504
  204. package/shared/definition51.cjs +526 -28
  205. package/shared/definition51.js +525 -27
  206. package/shared/definition52.cjs +28 -123
  207. package/shared/definition52.js +26 -122
  208. package/shared/definition53.cjs +110 -309
  209. package/shared/definition53.js +110 -308
  210. package/shared/definition54.cjs +255 -271
  211. package/shared/definition54.js +255 -271
  212. package/shared/definition55.cjs +315 -776
  213. package/shared/definition55.js +314 -775
  214. package/shared/definition56.cjs +818 -107
  215. package/shared/definition56.js +817 -106
  216. package/shared/definition57.cjs +85 -55
  217. package/shared/definition57.js +84 -54
  218. package/shared/definition58.cjs +125 -72
  219. package/shared/definition58.js +124 -71
  220. package/shared/definition59.cjs +72 -285
  221. package/shared/definition59.js +73 -286
  222. package/shared/definition6.cjs +1 -1
  223. package/shared/definition6.js +1 -1
  224. package/shared/definition60.cjs +298 -39
  225. package/shared/definition60.js +297 -38
  226. package/shared/definition61.cjs +66044 -1687
  227. package/shared/definition61.js +66043 -1686
  228. package/shared/definition62.cjs +50 -0
  229. package/shared/definition62.js +46 -0
  230. package/shared/definition63.cjs +1828 -0
  231. package/shared/definition63.js +1824 -0
  232. package/shared/definition7.cjs +2 -2
  233. package/shared/definition7.js +2 -2
  234. package/shared/definition8.cjs +2 -2
  235. package/shared/definition8.js +2 -2
  236. package/shared/definition9.cjs +1 -1
  237. package/shared/definition9.js +1 -1
  238. package/shared/enums.cjs +9 -0
  239. package/shared/enums.js +9 -1
  240. package/shared/icon.cjs +20 -2
  241. package/shared/icon.js +21 -3
  242. package/shared/index2.cjs +73 -37
  243. package/shared/index2.js +73 -37
  244. package/shared/key-codes2.js +1 -1
  245. package/shared/listbox.cjs +1 -1
  246. package/shared/listbox.js +1 -1
  247. package/shared/localization/Locale.d.ts +4 -0
  248. package/shared/patterns/form-elements/form-elements.d.ts +2 -3
  249. package/shared/presentationDate.cjs +16 -5
  250. package/shared/presentationDate.js +16 -5
  251. package/shared/text-anchor.cjs +6 -0
  252. package/shared/text-anchor.js +6 -0
  253. package/shared/text-anchor.template.cjs +6 -1
  254. package/shared/text-anchor.template.js +6 -1
  255. package/shared/text-field.cjs +1 -1
  256. package/shared/text-field.js +1 -1
  257. package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
  258. package/shared/utils/numberConverter.d.ts +2 -0
  259. package/side-drawer/index.cjs +1 -1
  260. package/side-drawer/index.js +1 -1
  261. package/slider/index.cjs +1 -1
  262. package/slider/index.js +1 -1
  263. package/split-button/index.cjs +2 -2
  264. package/split-button/index.js +2 -2
  265. package/styles/core/all.css +1 -1
  266. package/styles/core/theme.css +1 -1
  267. package/styles/core/typography.css +1 -1
  268. package/styles/tokens/theme-dark.css +4 -4
  269. package/styles/tokens/theme-light.css +4 -4
  270. package/styles/tokens/vivid-2-compat.css +1 -1
  271. package/switch/index.cjs +2 -2
  272. package/switch/index.js +2 -2
  273. package/tab/index.cjs +2 -2
  274. package/tab/index.js +2 -2
  275. package/tab-panel/index.cjs +1 -1
  276. package/tab-panel/index.js +1 -1
  277. package/tabs/index.cjs +4 -4
  278. package/tabs/index.js +4 -4
  279. package/tag/index.cjs +2 -2
  280. package/tag/index.js +2 -2
  281. package/tag-group/index.cjs +1 -1
  282. package/tag-group/index.js +1 -1
  283. package/text-area/index.cjs +4 -3
  284. package/text-area/index.js +4 -3
  285. package/text-field/index.cjs +4 -3
  286. package/text-field/index.js +4 -3
  287. package/time-picker/index.cjs +8 -7
  288. package/time-picker/index.js +8 -7
  289. package/toggletip/index.cjs +5 -5
  290. package/toggletip/index.js +5 -5
  291. package/tooltip/index.cjs +5 -5
  292. package/tooltip/index.js +5 -5
  293. package/tree-item/index.cjs +2 -2
  294. package/tree-item/index.js +2 -2
  295. package/tree-view/index.cjs +1 -1
  296. package/tree-view/index.js +1 -1
  297. package/video-player/index.cjs +17 -0
  298. package/video-player/index.js +15 -0
  299. package/vivid.api.json +332 -0
@@ -1,82 +1,194 @@
1
- import { a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
- import { a as iconRegistries } from './definition26.js';
3
- import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { a as iconRegistries } from './definition27.js';
3
+ import './affix.js';
4
4
  import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './index2.js';
5
5
  import { R as Reflector } from './Reflector.js';
6
- import { m as memoizeWith } from './icon.js';
7
- import { T as TextField$1 } from './text-field2.js';
6
+ import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
7
+ import { D as DelegatesARIATextbox } from './text-field2.js';
8
8
  import { a as applyMixins } from './apply-mixins.js';
9
- import { s as styles } from './text-field.js';
9
+ import { F as FormAssociated } from './form-associated.js';
10
10
  import { w as when } from './when.js';
11
- import { s as slotted } from './slotted.js';
11
+ import { r as ref } from './ref.js';
12
12
  import { c as classNames } from './class-names.js';
13
13
 
14
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
15
- // require the crypto API and do not support built-in fallback to lower quality random number
16
- // generators (like Math.random()).
17
- let getRandomValues;
18
- const rnds8 = new Uint8Array(16);
19
- function rng() {
20
- // lazy load so that environments that need to polyfill have a chance to do so
21
- if (!getRandomValues) {
22
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
23
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
24
-
25
- if (!getRandomValues) {
26
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
27
- }
28
- }
29
-
30
- return getRandomValues(rnds8);
14
+ class _TextArea extends FoundationElement {
31
15
  }
32
-
33
16
  /**
34
- * Convert array of 16 byte values to UUID string format of the form:
35
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
17
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(TextArea:class)} component.
18
+ *
19
+ * @internal
36
20
  */
37
-
38
- const byteToHex = [];
39
-
40
- for (let i = 0; i < 256; ++i) {
41
- byteToHex.push((i + 0x100).toString(16).slice(1));
42
- }
43
-
44
- function unsafeStringify(arr, offset = 0) {
45
- // Note: Be careful editing this code! It's been tuned for performance
46
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
47
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
21
+ class FormAssociatedTextArea extends FormAssociated(_TextArea) {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.proxy = document.createElement("textarea");
25
+ }
48
26
  }
49
27
 
50
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
51
- const native = {
52
- randomUUID
28
+ /**
29
+ * Resize mode for a TextArea
30
+ * @public
31
+ */
32
+ const TextAreaResize = {
33
+ /**
34
+ * No resize.
35
+ */
36
+ none: "none",
37
+ /**
38
+ * Resize vertically and horizontally.
39
+ */
40
+ both: "both",
41
+ /**
42
+ * Resize horizontally.
43
+ */
44
+ horizontal: "horizontal",
45
+ /**
46
+ * Resize vertically.
47
+ */
48
+ vertical: "vertical",
53
49
  };
54
50
 
55
- function v4(options, buf, offset) {
56
- if (native.randomUUID && !buf && !options) {
57
- return native.randomUUID();
58
- }
59
-
60
- options = options || {};
61
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
62
-
63
- rnds[6] = rnds[6] & 0x0f | 0x40;
64
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
65
-
66
- if (buf) {
67
- offset = offset || 0;
68
-
69
- for (let i = 0; i < 16; ++i) {
70
- buf[offset + i] = rnds[i];
51
+ /**
52
+ * A Text Area Custom HTML Element.
53
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.
54
+ *
55
+ * @slot - The default slot for the label
56
+ * @csspart label - The label
57
+ * @csspart root - The element wrapping the control
58
+ * @csspart control - The textarea element
59
+ * @fires change - Emits a custom 'change' event when the textarea emits a change event
60
+ *
61
+ * @public
62
+ */
63
+ let TextArea$1 = class TextArea extends FormAssociatedTextArea {
64
+ constructor() {
65
+ super(...arguments);
66
+ /**
67
+ * The resize mode of the element.
68
+ * @public
69
+ * @remarks
70
+ * HTML Attribute: resize
71
+ */
72
+ this.resize = TextAreaResize.none;
73
+ /**
74
+ * Sizes the element horizontally by a number of character columns.
75
+ *
76
+ * @public
77
+ * @remarks
78
+ * HTML Attribute: cols
79
+ */
80
+ this.cols = 20;
81
+ /**
82
+ * @internal
83
+ */
84
+ this.handleTextInput = () => {
85
+ this.value = this.control.value;
86
+ };
71
87
  }
88
+ readOnlyChanged() {
89
+ if (this.proxy instanceof HTMLTextAreaElement) {
90
+ this.proxy.readOnly = this.readOnly;
91
+ }
92
+ }
93
+ autofocusChanged() {
94
+ if (this.proxy instanceof HTMLTextAreaElement) {
95
+ this.proxy.autofocus = this.autofocus;
96
+ }
97
+ }
98
+ listChanged() {
99
+ if (this.proxy instanceof HTMLTextAreaElement) {
100
+ this.proxy.setAttribute("list", this.list);
101
+ }
102
+ }
103
+ maxlengthChanged() {
104
+ if (this.proxy instanceof HTMLTextAreaElement) {
105
+ this.proxy.maxLength = this.maxlength;
106
+ }
107
+ }
108
+ minlengthChanged() {
109
+ if (this.proxy instanceof HTMLTextAreaElement) {
110
+ this.proxy.minLength = this.minlength;
111
+ }
112
+ }
113
+ spellcheckChanged() {
114
+ if (this.proxy instanceof HTMLTextAreaElement) {
115
+ this.proxy.spellcheck = this.spellcheck;
116
+ }
117
+ }
118
+ /**
119
+ * Selects all the text in the text area
120
+ *
121
+ * @public
122
+ */
123
+ select() {
124
+ this.control.select();
125
+ /**
126
+ * The select event does not permeate the shadow DOM boundary.
127
+ * This fn effectively proxies the select event,
128
+ * emitting a `select` event whenever the internal
129
+ * control emits a `select` event
130
+ */
131
+ this.$emit("select");
132
+ }
133
+ /**
134
+ * Change event handler for inner control.
135
+ * @remarks
136
+ * "Change" events are not `composable` so they will not
137
+ * permeate the shadow DOM boundary. This fn effectively proxies
138
+ * the change event, emitting a `change` event whenever the internal
139
+ * control emits a `change` event
140
+ * @internal
141
+ */
142
+ handleChange() {
143
+ this.$emit("change");
144
+ }
145
+ /** {@inheritDoc (FormAssociated:interface).validate} */
146
+ validate() {
147
+ super.validate(this.control);
148
+ }
149
+ };
150
+ __decorate([
151
+ attr({ mode: "boolean" })
152
+ ], TextArea$1.prototype, "readOnly", void 0);
153
+ __decorate([
154
+ attr
155
+ ], TextArea$1.prototype, "resize", void 0);
156
+ __decorate([
157
+ attr({ mode: "boolean" })
158
+ ], TextArea$1.prototype, "autofocus", void 0);
159
+ __decorate([
160
+ attr({ attribute: "form" })
161
+ ], TextArea$1.prototype, "formId", void 0);
162
+ __decorate([
163
+ attr
164
+ ], TextArea$1.prototype, "list", void 0);
165
+ __decorate([
166
+ attr({ converter: nullableNumberConverter })
167
+ ], TextArea$1.prototype, "maxlength", void 0);
168
+ __decorate([
169
+ attr({ converter: nullableNumberConverter })
170
+ ], TextArea$1.prototype, "minlength", void 0);
171
+ __decorate([
172
+ attr
173
+ ], TextArea$1.prototype, "name", void 0);
174
+ __decorate([
175
+ attr
176
+ ], TextArea$1.prototype, "placeholder", void 0);
177
+ __decorate([
178
+ attr({ converter: nullableNumberConverter, mode: "fromView" })
179
+ ], TextArea$1.prototype, "cols", void 0);
180
+ __decorate([
181
+ attr({ converter: nullableNumberConverter, mode: "fromView" })
182
+ ], TextArea$1.prototype, "rows", void 0);
183
+ __decorate([
184
+ attr({ mode: "boolean" })
185
+ ], TextArea$1.prototype, "spellcheck", void 0);
186
+ __decorate([
187
+ observable
188
+ ], TextArea$1.prototype, "defaultSlottedNodes", void 0);
189
+ applyMixins(TextArea$1, DelegatesARIATextbox);
72
190
 
73
- return buf;
74
- }
75
-
76
- return unsafeStringify(rnds);
77
- }
78
-
79
- const generateRandomId = () => v4();
191
+ const styles = ":host{display:inline-block}.base{display:inline-grid;grid-template-columns:1fr max-content;inline-size:100%;row-gap:4px}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base.connotation-success{--_connotation-color-primary: var(--vvd-text-area-success-primary, var(--vvd-color-success-500));--_connotation-color-primary-text: var(--vvd-text-area-success-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-success-primary-increment, var(--vvd-color-success-600));--_connotation-color-intermediate: var(--vvd-text-area-success-intermediate, var(--vvd-color-success-500));--_connotation-color-firm: var(--vvd-text-area-success-firm, var(--vvd-color-success-600));--_connotation-color-fierce: var(--vvd-text-area-success-fierce, var(--vvd-color-success-700));--_connotation-color-faint: var(--vvd-text-area-success-faint, var(--vvd-color-success-50));--_connotation-color-soft: var(--vvd-text-area-success-soft, var(--vvd-color-success-100))}.base.connotation-alert{--_connotation-color-primary: var(--vvd-text-area-alert-primary, var(--vvd-color-alert-500));--_connotation-color-primary-text: var(--vvd-text-area-alert-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-alert-primary-increment, var(--vvd-color-alert-600));--_connotation-color-intermediate: var(--vvd-text-area-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-firm: var(--vvd-text-area-alert-firm, var(--vvd-color-alert-600));--_connotation-color-fierce: var(--vvd-text-area-alert-fierce, var(--vvd-color-alert-700));--_connotation-color-faint: var(--vvd-text-area-alert-faint, var(--vvd-color-alert-50));--_connotation-color-soft: var(--vvd-text-area-alert-soft, var(--vvd-color-alert-100))}.base:not(.connotation-success,.connotation-alert){--_connotation-color-primary: var(--vvd-text-area-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-text-area-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-text-area-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-text-area-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-text-area-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-text-area-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-text-area-accent-soft, var(--vvd-color-neutral-100))}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){--_low-ink-color: var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color: var(--_appearance-color-text);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);contain:inline-size;font:var(--vvd-typography-base);grid-column:1/2;grid-row:1;line-height:20px}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base);grid-column:2/-1}.control{padding:8px 16px;border:0 none;border-radius:8px;appearance:none;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);grid-column:1/-1;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));resize:none;transition:box-shadow .2s,background-color .2s,color .2s}@supports selector(::-webkit-resizer){.control::-webkit-resizer{background-image:linear-gradient(315deg,transparent 0,transparent 2px,var(--vvd-color-canvas-text) 2px,var(--vvd-color-canvas-text) 3px,transparent 3px,transparent 5px,var(--vvd-color-canvas-text) 5px,var(--vvd-color-canvas-text) 6px,transparent 6px,transparent 8px,transparent 100%);background-repeat:no-repeat;background-size:10px 10px;block-size:10px;inline-size:10px}}.control:disabled{opacity:1;pointer-events:none;-webkit-text-fill-color:var(--_appearance-color-text)}.control::placeholder,.control:disabled::placeholder{opacity:1;pointer-events:none;-webkit-text-fill-color:var(--_low-ink-color)}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}:host([resize=both]) .control{resize:both}:host([resize=horizontal]) .control{resize:horizontal}:host([resize=vertical]) .control{resize:vertical}\n";
80
192
 
81
193
  var __defProp = Object.defineProperty;
82
194
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -107,196 +219,58 @@ var __privateSet = (obj, member, value, setter) => {
107
219
  setter ? setter.call(obj, value) : member.set(obj, value);
108
220
  return value;
109
221
  };
110
- var __privateMethod = (obj, member, method) => {
111
- __accessCheck(obj, member, "access private method");
112
- return method;
113
- };
114
- var _handleLabelChange, handleLabelChange_fn, _reflectToInput;
115
- const safariWorkaroundClassName = "_vvd-3-text-field-safari-workaround";
116
- const getSafariWorkaroundStyleSheet = memoizeWith(
117
- () => "",
118
- () => {
119
- const styleSheet = new CSSStyleSheet();
120
- const supportsReplaceSync = "replaceSync" in styleSheet;
121
- if (supportsReplaceSync) {
122
- styleSheet.replaceSync(`
123
- .${safariWorkaroundClassName}::placeholder {
124
- opacity: 1 !important;
125
- -webkit-text-fill-color: var(--_low-ink-color) !important;
126
- }`);
127
- }
128
- return styleSheet;
129
- }
130
- );
131
- const installSafariWorkaroundStyle = (forElement) => {
132
- const root = forElement.getRootNode();
133
- const workaroundStyleSheet = getSafariWorkaroundStyleSheet();
134
- const supportsAdoptedStyleSheets = "adoptedStyleSheets" in root;
135
- if (!supportsAdoptedStyleSheets) {
136
- return;
137
- }
138
- if (!root.adoptedStyleSheets.includes(workaroundStyleSheet)) {
139
- root.adoptedStyleSheets = [
140
- ...root.adoptedStyleSheets,
141
- workaroundStyleSheet
142
- ];
143
- }
144
- };
145
- let TextField = class extends TextField$1 {
222
+ var _reflectToTextArea;
223
+ let TextArea = class extends TextArea$1 {
146
224
  constructor() {
147
225
  super(...arguments);
148
- __privateAdd(this, _handleLabelChange);
149
- /**
150
- * @internal
151
- */
152
- this._labelEl = null;
153
- __privateAdd(this, _reflectToInput, void 0);
154
- }
155
- /**
156
- * @internal
157
- */
158
- labelChanged() {
159
- if (this._labelEl) {
160
- __privateMethod(this, _handleLabelChange, handleLabelChange_fn).call(this, this._labelEl);
161
- }
226
+ __privateAdd(this, _reflectToTextArea, void 0);
162
227
  }
163
228
  connectedCallback() {
164
229
  super.connectedCallback();
165
- if (!this.control) {
166
- const uniqueId = this.id || generateRandomId();
167
- const controlId = `vvd-text-field-control-${uniqueId}`;
168
- const input = document.createElement("input");
169
- input.slot = "_control";
170
- input.id = controlId;
171
- input.className = safariWorkaroundClassName;
172
- this.control = input;
173
- __privateSet(this, _reflectToInput, new Reflector(this, input));
174
- __privateGet(this, _reflectToInput).booleanAttribute("autofocus", "autofocus");
175
- __privateGet(this, _reflectToInput).booleanAttribute("disabled", "disabled");
176
- __privateGet(this, _reflectToInput).booleanAttribute("readOnly", "readonly");
177
- __privateGet(this, _reflectToInput).booleanAttribute("required", "required");
178
- __privateGet(this, _reflectToInput).booleanAttribute("spellcheck", "spellcheck");
179
- __privateGet(this, _reflectToInput).attribute("list", "list");
180
- __privateGet(this, _reflectToInput).attribute("maxlength", "maxlength");
181
- __privateGet(this, _reflectToInput).attribute("minlength", "minlength");
182
- __privateGet(this, _reflectToInput).attribute("pattern", "pattern");
183
- __privateGet(this, _reflectToInput).attribute("placeholder", "placeholder");
184
- __privateGet(this, _reflectToInput).attribute("size", "size");
185
- __privateGet(this, _reflectToInput).attribute("autoComplete", "autocomplete");
186
- __privateGet(this, _reflectToInput).attribute("type", "type");
187
- __privateGet(this, _reflectToInput).attribute("ariaAtomic", "aria-atomic");
188
- __privateGet(this, _reflectToInput).attribute("ariaBusy", "aria-busy");
189
- __privateGet(this, _reflectToInput).attribute("ariaCurrent", "aria-current");
190
- __privateGet(this, _reflectToInput).attribute("ariaDetails", "aria-details");
191
- __privateGet(this, _reflectToInput).attribute("ariaDisabled", "aria-disabled");
192
- __privateGet(this, _reflectToInput).attribute("ariaHaspopup", "aria-haspopup");
193
- __privateGet(this, _reflectToInput).attribute("ariaHidden", "aria-hidden");
194
- __privateGet(this, _reflectToInput).attribute("ariaInvalid", "aria-invalid");
195
- __privateGet(this, _reflectToInput).attribute("ariaKeyshortcuts", "aria-keyshortcuts");
196
- __privateGet(this, _reflectToInput).attribute("ariaLabel", "aria-label");
197
- __privateGet(this, _reflectToInput).attribute("ariaLive", "aria-live");
198
- __privateGet(this, _reflectToInput).attribute("ariaRelevant", "aria-relevant");
199
- __privateGet(this, _reflectToInput).attribute(
200
- "ariaRoledescription",
201
- "aria-roledescription"
202
- );
203
- __privateGet(this, _reflectToInput).property("value", "value", true);
204
- input.addEventListener("input", () => {
205
- this.handleTextInput();
206
- });
207
- input.addEventListener("change", () => {
208
- this.handleChange();
209
- });
210
- input.addEventListener("blur", () => {
211
- this.$emit("blur", void 0, { bubbles: false });
212
- });
213
- input.addEventListener("focus", () => {
214
- this.$emit("focus", void 0, { bubbles: false });
215
- });
216
- this.appendChild(input);
217
- const label = document.createElement("label");
218
- label.slot = "_label";
219
- label.htmlFor = controlId;
220
- this._labelEl = label;
221
- __privateMethod(this, _handleLabelChange, handleLabelChange_fn).call(this, label);
222
- installSafariWorkaroundStyle(this);
223
- }
230
+ __privateSet(this, _reflectToTextArea, new Reflector(this, this.control));
231
+ __privateGet(this, _reflectToTextArea).property("value", "value", true);
224
232
  }
225
233
  disconnectedCallback() {
226
234
  super.disconnectedCallback();
227
- __privateGet(this, _reflectToInput).destroy();
228
- }
229
- focus() {
230
- this.control?.focus();
235
+ __privateGet(this, _reflectToTextArea).destroy();
231
236
  }
232
237
  };
233
- _handleLabelChange = new WeakSet();
234
- handleLabelChange_fn = function(labelEl) {
235
- if (!this.label) {
236
- labelEl.remove();
237
- } else {
238
- labelEl.textContent = this.label;
239
- if (!labelEl.isConnected) {
240
- this.appendChild(labelEl);
241
- }
242
- }
243
- };
244
- _reflectToInput = new WeakMap();
245
- __decorateClass([
246
- attr
247
- ], TextField.prototype, "appearance", 2);
248
- __decorateClass([
249
- attr
250
- ], TextField.prototype, "shape", 2);
238
+ _reflectToTextArea = new WeakMap();
251
239
  __decorateClass([
252
240
  attr
253
- ], TextField.prototype, "autoComplete", 2);
254
- __decorateClass([
255
- observable
256
- ], TextField.prototype, "actionItemsSlottedContent", 2);
257
- __decorateClass([
258
- observable
259
- ], TextField.prototype, "leadingActionItemsSlottedContent", 2);
260
- TextField = __decorateClass([
241
+ ], TextArea.prototype, "wrap", 2);
242
+ TextArea = __decorateClass([
261
243
  errorText,
262
244
  formElements
263
- ], TextField);
264
- applyMixins(
265
- TextField,
266
- AffixIcon,
245
+ ], TextArea);
246
+ applyMixinsWithObservables(
247
+ TextArea,
267
248
  FormElementCharCount,
268
249
  FormElementHelperText,
269
250
  FormElementSuccessText
270
251
  );
271
252
 
272
- const getStateClasses = ({
253
+ const getClasses = ({
254
+ value,
273
255
  errorValidationMessage,
274
256
  disabled,
275
- value,
276
- readOnly,
277
257
  placeholder,
278
- appearance,
279
- shape,
280
- label,
281
- successText,
282
- actionItemsSlottedContent,
283
- leadingActionItemsSlottedContent,
284
- icon
258
+ readOnly,
259
+ successText
285
260
  }) => classNames(
286
- ["error", Boolean(errorValidationMessage)],
287
- ["disabled", disabled],
288
- ["has-value", Boolean(value)],
261
+ "base",
289
262
  ["readonly", readOnly],
290
263
  ["placeholder", Boolean(placeholder)],
291
- [`appearance-${appearance}`, Boolean(appearance)],
292
- [`shape-${shape}`, Boolean(shape)],
293
- ["no-label", !label],
294
- ["has-icon", !!icon],
295
- ["success", Boolean(successText)],
296
- ["action-items", !!actionItemsSlottedContent?.length],
297
- ["leading-action-items", !!leadingActionItemsSlottedContent?.length],
298
- ["no-leading", !(leadingActionItemsSlottedContent?.length || icon)]
264
+ ["disabled", disabled],
265
+ ["error", Boolean(errorValidationMessage)],
266
+ ["has-value", Boolean(value)],
267
+ ["success", !!successText]
299
268
  );
269
+ function renderLabel() {
270
+ return html` <label for="control" class="label">
271
+ ${(x) => x.label}
272
+ </label>`;
273
+ }
300
274
  function renderCharCount() {
301
275
  return html`
302
276
  <span class="char-count"
@@ -304,51 +278,61 @@ function renderCharCount() {
304
278
  >
305
279
  `;
306
280
  }
307
- const TextfieldTemplate = (context) => {
308
- const affixIconTemplate = affixIconTemplateFactory(context);
309
- return html` <div class="base ${getStateClasses}">
310
- ${when((x) => x.charCount && x.maxlength, renderCharCount())}
311
- <slot class="label" name="_label"></slot>
312
- <div class="fieldset">
313
- <div class="leading-items-wrapper">
314
- <slot
315
- name="leading-action-items"
316
- ${slotted("leadingActionItemsSlottedContent")}
317
- ></slot>
318
- ${(x) => affixIconTemplate(x.icon)}
319
- </div>
320
-
321
- <div class="wrapper">
322
- <slot class="control" name="_control"></slot>
323
- </div>
324
- <div class="action-items-wrapper">
325
- <slot
326
- name="action-items"
327
- ${slotted("actionItemsSlottedContent")}
328
- ></slot>
329
- </div>
281
+ const TextAreaTemplate = (context) => {
282
+ return html`
283
+ <div class="${getClasses}">
284
+ ${when((x) => x.charCount && x.maxlength, renderCharCount())}
285
+ ${when((x) => x.label, renderLabel())}
286
+ <textarea
287
+ class="control"
288
+ id="control"
289
+ ?autofocus="${(x) => x.autofocus}"
290
+ placeholder="${(x) => x.placeholder ? x.placeholder : null}"
291
+ name="${(x) => x.name ? x.name : null}"
292
+ minlength="${(x) => x.minlength ? x.minlength : null}"
293
+ maxlength="${(x) => x.maxlength ? x.maxlength : null}"
294
+ rows="${(x) => x.rows ? x.rows : null}"
295
+ cols="${(x) => x.cols ? x.cols : null}"
296
+ wrap="${(x) => x.wrap ? x.wrap : null}"
297
+ ?readonly="${(x) => x.readOnly}"
298
+ ?disabled="${(x) => x.disabled}"
299
+ ?required="${(x) => x.required}"
300
+ ?spellcheck="${(x) => x.spellcheck}"
301
+ aria-atomic="${(x) => x.ariaAtomic}"
302
+ aria-busy="${(x) => x.ariaBusy}"
303
+ aria-current="${(x) => x.ariaCurrent}"
304
+ aria-details="${(x) => x.ariaDetails}"
305
+ aria-disabled="${(x) => x.ariaDisabled}"
306
+ aria-errormessage="${(x) => x.ariaErrormessage}"
307
+ aria-haspopup="${(x) => x.ariaHaspopup}"
308
+ aria-hidden="${(x) => x.ariaHidden}"
309
+ aria-invalid="${(x) => x.ariaInvalid}"
310
+ aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
311
+ aria-label="${(x) => x.ariaLabel}"
312
+ aria-live="${(x) => x.ariaLive}"
313
+ aria-relevant="${(x) => x.ariaRelevant}"
314
+ aria-roledescription="${(x) => x.ariaRoledescription}"
315
+ @input="${(x) => x.handleTextInput()}"
316
+ @change="${(x) => x.handleChange()}"
317
+ ${ref("control")}
318
+ >
319
+ </textarea>
320
+ ${getFeedbackTemplate(context)}
330
321
  </div>
331
- ${when(
332
- (x) => !x.successText && !x.errorValidationMessage && x.helperText?.length,
333
- getFeedbackTemplate("helper", context)
334
- )}
335
- ${when(
336
- (x) => !x.successText && x.errorValidationMessage,
337
- getFeedbackTemplate("error", context)
338
- )}
339
- ${when((x) => x.successText, getFeedbackTemplate("success", context))}
340
- </div>`;
322
+ `;
341
323
  };
342
324
 
343
- const textFieldDefinition = TextField.compose({
344
- baseName: "text-field",
345
- template: TextfieldTemplate,
346
- styles,
347
- shadowOptions: {
348
- delegatesFocus: true
325
+ const textAreaDefinition = TextArea.compose(
326
+ {
327
+ baseName: "text-area",
328
+ template: TextAreaTemplate,
329
+ styles,
330
+ shadowOptions: {
331
+ delegatesFocus: true
332
+ }
349
333
  }
350
- });
351
- const textFieldRegistries = [textFieldDefinition(), ...iconRegistries];
352
- const registerTextField = registerFactory(textFieldRegistries);
334
+ );
335
+ const textAreaRegistries = [textAreaDefinition(), ...iconRegistries];
336
+ const registerTextArea = registerFactory(textAreaRegistries);
353
337
 
354
- export { TextField as T, textFieldRegistries as a, registerTextField as r, textFieldDefinition as t };
338
+ export { textAreaRegistries as a, registerTextArea as r, textAreaDefinition as t };