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