@vonage/vivid 4.4.0 → 4.6.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 (235) hide show
  1. package/custom-elements.json +7181 -6876
  2. package/elevation/index.cjs +1 -1
  3. package/elevation/index.js +1 -1
  4. package/index.cjs +80 -74
  5. package/index.js +23 -22
  6. package/lib/components.d.ts +1 -0
  7. package/lib/fab/fab.d.ts +1 -1
  8. package/lib/icon/icon.d.ts +1 -1
  9. package/lib/menu/menu.d.ts +2 -1
  10. package/lib/number-field/number-field.d.ts +3 -1
  11. package/lib/searchable-select/definition.d.ts +4 -0
  12. package/lib/searchable-select/locale.d.ts +6 -0
  13. package/lib/searchable-select/option-tag.d.ts +14 -0
  14. package/lib/searchable-select/option-tag.template.d.ts +4 -0
  15. package/lib/searchable-select/searchable-select.d.ts +29 -0
  16. package/lib/searchable-select/searchable-select.form-associated.d.ts +10 -0
  17. package/lib/searchable-select/searchable-select.template.d.ts +4 -0
  18. package/lib/select/select.d.ts +4 -1
  19. package/lib/tab/locale.d.ts +3 -0
  20. package/lib/tab/tab.d.ts +5 -1
  21. package/lib/tabs/tabs.d.ts +2 -0
  22. package/lib/tag/definition.d.ts +1 -0
  23. package/lib/text-field/text-field.d.ts +3 -1
  24. package/lib/video-player/video-player.d.ts +0 -1
  25. package/listbox/index.cjs +1 -1
  26. package/listbox/index.js +1 -1
  27. package/locales/de-DE.cjs +12 -0
  28. package/locales/de-DE.js +12 -0
  29. package/locales/en-GB.cjs +12 -0
  30. package/locales/en-GB.js +12 -0
  31. package/locales/en-US.cjs +12 -0
  32. package/locales/en-US.js +12 -0
  33. package/locales/ja-JP.cjs +12 -0
  34. package/locales/ja-JP.js +12 -0
  35. package/locales/zh-CN.cjs +12 -0
  36. package/locales/zh-CN.js +12 -0
  37. package/package.json +6 -1
  38. package/popup/index.cjs +1 -1
  39. package/popup/index.js +1 -1
  40. package/searchable-select/index.cjs +5 -0
  41. package/searchable-select/index.js +3 -0
  42. package/select/index.cjs +1 -1
  43. package/select/index.js +1 -1
  44. package/selectable-box/index.cjs +1 -1
  45. package/selectable-box/index.js +1 -1
  46. package/shared/anchored.js +1 -1
  47. package/shared/calendar-event.js +1 -1
  48. package/shared/definition.cjs +2 -2
  49. package/shared/definition.js +2 -2
  50. package/shared/definition11.cjs +1 -1
  51. package/shared/definition11.js +1 -1
  52. package/shared/definition12.cjs +1 -1
  53. package/shared/definition12.js +1 -1
  54. package/shared/definition13.js +1 -1
  55. package/shared/definition14.cjs +1 -1
  56. package/shared/definition14.js +1 -1
  57. package/shared/definition15.cjs +7 -8
  58. package/shared/definition15.js +2 -3
  59. package/shared/definition16.cjs +11 -7
  60. package/shared/definition16.js +10 -6
  61. package/shared/definition17.cjs +2 -2
  62. package/shared/definition17.js +2 -2
  63. package/shared/definition18.cjs +5 -6
  64. package/shared/definition18.js +3 -4
  65. package/shared/definition19.cjs +5 -6
  66. package/shared/definition19.js +3 -4
  67. package/shared/definition20.cjs +16 -38
  68. package/shared/definition20.js +17 -39
  69. package/shared/definition21.cjs +7 -6
  70. package/shared/definition21.js +8 -7
  71. package/shared/definition23.cjs +1 -1
  72. package/shared/definition23.js +2 -2
  73. package/shared/definition24.cjs +2 -2
  74. package/shared/definition24.js +2 -2
  75. package/shared/definition25.cjs +6 -7
  76. package/shared/definition25.js +2 -3
  77. package/shared/definition26.cjs +1 -1
  78. package/shared/definition26.js +2 -2
  79. package/shared/definition27.cjs +1 -1
  80. package/shared/definition27.js +1 -1
  81. package/shared/definition28.js +1 -1
  82. package/shared/definition29.cjs +8 -4
  83. package/shared/definition29.js +8 -4
  84. package/shared/definition3.cjs +1 -1
  85. package/shared/definition3.js +2 -2
  86. package/shared/definition30.cjs +4 -2
  87. package/shared/definition30.js +4 -2
  88. package/shared/definition31.cjs +1 -1
  89. package/shared/definition31.js +2 -2
  90. package/shared/definition32.cjs +1 -1
  91. package/shared/definition32.js +1 -1
  92. package/shared/definition34.cjs +2 -3
  93. package/shared/definition34.js +2 -3
  94. package/shared/definition35.cjs +21 -16
  95. package/shared/definition35.js +16 -11
  96. package/shared/definition36.cjs +50 -207
  97. package/shared/definition36.js +51 -207
  98. package/shared/definition37.js +1 -1
  99. package/shared/definition38.cjs +1 -1
  100. package/shared/definition38.js +1 -1
  101. package/shared/definition4.cjs +6 -4
  102. package/shared/definition4.js +7 -5
  103. package/shared/definition41.cjs +1 -1
  104. package/shared/definition41.js +1 -1
  105. package/shared/definition42.cjs +6 -7
  106. package/shared/definition42.js +6 -7
  107. package/shared/definition43.cjs +998 -643
  108. package/shared/definition43.js +992 -638
  109. package/shared/definition44.cjs +723 -112
  110. package/shared/definition44.js +722 -111
  111. package/shared/definition45.cjs +121 -79
  112. package/shared/definition45.js +120 -78
  113. package/shared/definition46.cjs +81 -616
  114. package/shared/definition46.js +80 -614
  115. package/shared/definition47.cjs +609 -116
  116. package/shared/definition47.js +607 -115
  117. package/shared/definition48.cjs +116 -134
  118. package/shared/definition48.js +115 -133
  119. package/shared/definition49.cjs +149 -19
  120. package/shared/definition49.js +148 -18
  121. package/shared/definition5.cjs +5 -6
  122. package/shared/definition5.js +5 -6
  123. package/shared/definition50.cjs +21 -82
  124. package/shared/definition50.js +20 -81
  125. package/shared/definition51.cjs +78 -494
  126. package/shared/definition51.js +77 -493
  127. package/shared/definition52.cjs +568 -28
  128. package/shared/definition52.js +567 -27
  129. package/shared/definition53.cjs +28 -123
  130. package/shared/definition53.js +27 -123
  131. package/shared/definition54.cjs +115 -296
  132. package/shared/definition54.js +114 -295
  133. package/shared/definition55.cjs +258 -318
  134. package/shared/definition55.js +252 -312
  135. package/shared/definition56.cjs +303 -784
  136. package/shared/definition56.js +298 -779
  137. package/shared/definition57.cjs +802 -95
  138. package/shared/definition57.js +801 -94
  139. package/shared/definition58.cjs +95 -60
  140. package/shared/definition58.js +94 -59
  141. package/shared/definition59.cjs +117 -75
  142. package/shared/definition59.js +116 -74
  143. package/shared/definition6.cjs +1 -1
  144. package/shared/definition6.js +1 -1
  145. package/shared/definition60.cjs +70 -285
  146. package/shared/definition60.js +71 -286
  147. package/shared/definition61.cjs +296 -325
  148. package/shared/definition61.js +295 -324
  149. package/shared/definition62.cjs +66160 -27
  150. package/shared/definition62.js +66159 -26
  151. package/shared/definition63.cjs +24 -1952
  152. package/shared/definition63.js +23 -1950
  153. package/shared/definition64.cjs +1976 -0
  154. package/shared/definition64.js +1971 -0
  155. package/shared/definition7.cjs +1 -1
  156. package/shared/definition7.js +1 -1
  157. package/shared/definition8.cjs +2 -3
  158. package/shared/definition8.js +3 -4
  159. package/shared/definition9.cjs +1 -1
  160. package/shared/definition9.js +1 -1
  161. package/shared/dialog/index.d.ts +1 -0
  162. package/shared/form-elements.cjs +236 -0
  163. package/shared/form-elements.js +229 -0
  164. package/shared/icon.js +1 -1
  165. package/shared/index2.cjs +6 -256
  166. package/shared/index2.js +6 -249
  167. package/shared/listbox-option.cjs +204 -0
  168. package/shared/listbox-option.js +201 -0
  169. package/shared/listbox.cjs +3 -3
  170. package/shared/listbox.js +1 -1
  171. package/shared/localization/Locale.d.ts +4 -0
  172. package/shared/localized.cjs +26 -2
  173. package/shared/localized.js +25 -2
  174. package/shared/playbackRates.cjs +13 -0
  175. package/shared/playbackRates.js +11 -0
  176. package/shared/presentationDate.cjs +11 -11
  177. package/shared/presentationDate.js +11 -11
  178. package/shared/scrollIntoView.cjs +51 -0
  179. package/shared/scrollIntoView.js +49 -0
  180. package/shared/slider.template.cjs +1 -1
  181. package/shared/slider.template.js +1 -1
  182. package/shared/text-anchor.cjs +1 -1
  183. package/shared/text-anchor.js +1 -1
  184. package/shared/text-field.cjs +1 -1
  185. package/shared/text-field.js +1 -1
  186. package/shared/utils/playbackRates.d.ts +1 -0
  187. package/shared/utils/scrollIntoView.d.ts +1 -0
  188. package/side-drawer/index.cjs +1 -1
  189. package/side-drawer/index.js +1 -1
  190. package/slider/index.cjs +1 -1
  191. package/slider/index.js +1 -1
  192. package/split-button/index.cjs +1 -1
  193. package/split-button/index.js +1 -1
  194. package/styles/core/all.css +1 -1
  195. package/styles/core/theme.css +1 -1
  196. package/styles/core/typography.css +1 -1
  197. package/styles/tokens/theme-dark.css +4 -4
  198. package/styles/tokens/theme-light.css +4 -4
  199. package/styles/tokens/vivid-2-compat.css +1 -1
  200. package/switch/index.cjs +1 -1
  201. package/switch/index.js +1 -1
  202. package/tab/index.cjs +1 -1
  203. package/tab/index.js +1 -1
  204. package/tab-panel/index.cjs +1 -1
  205. package/tab-panel/index.js +1 -1
  206. package/tabs/index.cjs +1 -1
  207. package/tabs/index.js +1 -1
  208. package/tag/index.cjs +1 -1
  209. package/tag/index.js +1 -1
  210. package/tag-group/index.cjs +1 -1
  211. package/tag-group/index.js +1 -1
  212. package/text-area/index.cjs +1 -1
  213. package/text-area/index.js +1 -1
  214. package/text-field/index.cjs +1 -1
  215. package/text-field/index.js +1 -1
  216. package/time-picker/index.cjs +1 -1
  217. package/time-picker/index.js +1 -1
  218. package/toggletip/index.cjs +1 -1
  219. package/toggletip/index.js +1 -1
  220. package/tooltip/index.cjs +1 -1
  221. package/tooltip/index.js +1 -1
  222. package/tree-item/index.cjs +1 -1
  223. package/tree-item/index.js +1 -1
  224. package/tree-view/index.cjs +1 -1
  225. package/tree-view/index.js +1 -1
  226. package/video-player/index.cjs +1 -1
  227. package/video-player/index.js +1 -1
  228. package/vivid.api.json +312 -8
  229. package/appearance-ui/index.cjs +0 -102
  230. package/appearance-ui/index.js +0 -100
  231. package/lib/appearance-ui/appearance-ui.d.ts +0 -12
  232. package/lib/appearance-ui/appearance-ui.template.d.ts +0 -4
  233. package/lib/appearance-ui/definition.d.ts +0 -3
  234. package/shared/video-player.cjs +0 -65860
  235. package/shared/video-player.js +0 -65857
@@ -2,73 +2,194 @@
2
2
 
3
3
  const index = require('./index.cjs');
4
4
  const definition = require('./definition27.cjs');
5
- const affix = require('./affix.cjs');
6
- const index$1 = require('./index2.cjs');
7
5
  const Reflector = require('./Reflector.cjs');
8
6
  const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
9
- const icon = require('./icon.cjs');
10
7
  const textField = require('./text-field2.cjs');
11
- const textField$1 = require('./text-field.cjs');
8
+ const applyMixins = require('./apply-mixins.cjs');
9
+ const formAssociated = require('./form-associated.cjs');
10
+ const formElements = require('./form-elements.cjs');
12
11
  const when = require('./when.cjs');
13
- const slotted = require('./slotted.cjs');
12
+ const ref = require('./ref.cjs');
14
13
  const classNames = require('./class-names.cjs');
15
14
 
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);
15
+ class _TextArea extends index.FoundationElement {
33
16
  }
34
-
35
17
  /**
36
- * Convert array of 16 byte values to UUID string format of the form:
37
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
18
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(TextArea:class)} component.
19
+ *
20
+ * @internal
38
21
  */
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]];
22
+ class FormAssociatedTextArea extends formAssociated.FormAssociated(_TextArea) {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.proxy = document.createElement("textarea");
26
+ }
50
27
  }
51
28
 
52
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
53
- const native = {
54
- randomUUID
29
+ /**
30
+ * Resize mode for a TextArea
31
+ * @public
32
+ */
33
+ const TextAreaResize = {
34
+ /**
35
+ * No resize.
36
+ */
37
+ none: "none",
38
+ /**
39
+ * Resize vertically and horizontally.
40
+ */
41
+ both: "both",
42
+ /**
43
+ * Resize horizontally.
44
+ */
45
+ horizontal: "horizontal",
46
+ /**
47
+ * Resize vertically.
48
+ */
49
+ vertical: "vertical",
55
50
  };
56
51
 
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
- return unsafeStringify(rnds);
69
- }
52
+ /**
53
+ * A Text Area Custom HTML Element.
54
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.
55
+ *
56
+ * @slot - The default slot for the label
57
+ * @csspart label - The label
58
+ * @csspart root - The element wrapping the control
59
+ * @csspart control - The textarea element
60
+ * @fires change - Emits a custom 'change' event when the textarea emits a change event
61
+ *
62
+ * @public
63
+ */
64
+ let TextArea$1 = class TextArea extends FormAssociatedTextArea {
65
+ constructor() {
66
+ super(...arguments);
67
+ /**
68
+ * The resize mode of the element.
69
+ * @public
70
+ * @remarks
71
+ * HTML Attribute: resize
72
+ */
73
+ this.resize = TextAreaResize.none;
74
+ /**
75
+ * Sizes the element horizontally by a number of character columns.
76
+ *
77
+ * @public
78
+ * @remarks
79
+ * HTML Attribute: cols
80
+ */
81
+ this.cols = 20;
82
+ /**
83
+ * @internal
84
+ */
85
+ this.handleTextInput = () => {
86
+ this.value = this.control.value;
87
+ };
88
+ }
89
+ readOnlyChanged() {
90
+ if (this.proxy instanceof HTMLTextAreaElement) {
91
+ this.proxy.readOnly = this.readOnly;
92
+ }
93
+ }
94
+ autofocusChanged() {
95
+ if (this.proxy instanceof HTMLTextAreaElement) {
96
+ this.proxy.autofocus = this.autofocus;
97
+ }
98
+ }
99
+ listChanged() {
100
+ if (this.proxy instanceof HTMLTextAreaElement) {
101
+ this.proxy.setAttribute("list", this.list);
102
+ }
103
+ }
104
+ maxlengthChanged() {
105
+ if (this.proxy instanceof HTMLTextAreaElement) {
106
+ this.proxy.maxLength = this.maxlength;
107
+ }
108
+ }
109
+ minlengthChanged() {
110
+ if (this.proxy instanceof HTMLTextAreaElement) {
111
+ this.proxy.minLength = this.minlength;
112
+ }
113
+ }
114
+ spellcheckChanged() {
115
+ if (this.proxy instanceof HTMLTextAreaElement) {
116
+ this.proxy.spellcheck = this.spellcheck;
117
+ }
118
+ }
119
+ /**
120
+ * Selects all the text in the text area
121
+ *
122
+ * @public
123
+ */
124
+ select() {
125
+ this.control.select();
126
+ /**
127
+ * The select event does not permeate the shadow DOM boundary.
128
+ * This fn effectively proxies the select event,
129
+ * emitting a `select` event whenever the internal
130
+ * control emits a `select` event
131
+ */
132
+ this.$emit("select");
133
+ }
134
+ /**
135
+ * Change event handler for inner control.
136
+ * @remarks
137
+ * "Change" events are not `composable` so they will not
138
+ * permeate the shadow DOM boundary. This fn effectively proxies
139
+ * the change event, emitting a `change` event whenever the internal
140
+ * control emits a `change` event
141
+ * @internal
142
+ */
143
+ handleChange() {
144
+ this.$emit("change");
145
+ }
146
+ /** {@inheritDoc (FormAssociated:interface).validate} */
147
+ validate() {
148
+ super.validate(this.control);
149
+ }
150
+ };
151
+ index.__decorate([
152
+ index.attr({ mode: "boolean" })
153
+ ], TextArea$1.prototype, "readOnly", void 0);
154
+ index.__decorate([
155
+ index.attr
156
+ ], TextArea$1.prototype, "resize", void 0);
157
+ index.__decorate([
158
+ index.attr({ mode: "boolean" })
159
+ ], TextArea$1.prototype, "autofocus", void 0);
160
+ index.__decorate([
161
+ index.attr({ attribute: "form" })
162
+ ], TextArea$1.prototype, "formId", void 0);
163
+ index.__decorate([
164
+ index.attr
165
+ ], TextArea$1.prototype, "list", void 0);
166
+ index.__decorate([
167
+ index.attr({ converter: index.nullableNumberConverter })
168
+ ], TextArea$1.prototype, "maxlength", void 0);
169
+ index.__decorate([
170
+ index.attr({ converter: index.nullableNumberConverter })
171
+ ], TextArea$1.prototype, "minlength", void 0);
172
+ index.__decorate([
173
+ index.attr
174
+ ], TextArea$1.prototype, "name", void 0);
175
+ index.__decorate([
176
+ index.attr
177
+ ], TextArea$1.prototype, "placeholder", void 0);
178
+ index.__decorate([
179
+ index.attr({ converter: index.nullableNumberConverter, mode: "fromView" })
180
+ ], TextArea$1.prototype, "cols", void 0);
181
+ index.__decorate([
182
+ index.attr({ converter: index.nullableNumberConverter, mode: "fromView" })
183
+ ], TextArea$1.prototype, "rows", void 0);
184
+ index.__decorate([
185
+ index.attr({ mode: "boolean" })
186
+ ], TextArea$1.prototype, "spellcheck", void 0);
187
+ index.__decorate([
188
+ index.observable
189
+ ], TextArea$1.prototype, "defaultSlottedNodes", void 0);
190
+ applyMixins.applyMixins(TextArea$1, textField.DelegatesARIATextbox);
70
191
 
71
- const generateRandomId = () => v4();
192
+ const styles = ":host{display:inline-block}.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-firm);--_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-firm);--_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))}.base{display:inline-grid;grid-template-columns:1fr max-content;inline-size:100%;row-gap:4px}@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{box-sizing:border-box;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*(32 + 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}";
72
193
 
73
194
  var __defProp = Object.defineProperty;
74
195
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -87,256 +208,58 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
87
208
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
88
209
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
89
210
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
90
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
91
- var _TextField_instances, handleLabelChange_fn, _reflectToInput, _helperTextMirrorEl, _helperTextSlotMutationObserver, updateHelperTextMutationObserver_fn, updateMirroredHelperText_fn;
92
- const safariWorkaroundClassName = "_vvd-3-text-field-safari-workaround";
93
- const getSafariWorkaroundStyleSheet = icon.memoizeWith(
94
- () => "",
95
- () => {
96
- const styleSheet = new CSSStyleSheet();
97
- const supportsReplaceSync = "replaceSync" in styleSheet;
98
- if (supportsReplaceSync) {
99
- styleSheet.replaceSync(`
100
- .${safariWorkaroundClassName}::placeholder {
101
- opacity: 1 !important;
102
- -webkit-text-fill-color: var(--_low-ink-color) !important;
103
- }`);
104
- }
105
- return styleSheet;
106
- }
107
- );
108
- const installSafariWorkaroundStyle = (forElement) => {
109
- const root = forElement.getRootNode();
110
- const workaroundStyleSheet = getSafariWorkaroundStyleSheet();
111
- const supportsAdoptedStyleSheets = "adoptedStyleSheets" in root;
112
- if (!supportsAdoptedStyleSheets) {
113
- return;
114
- }
115
- if (!root.adoptedStyleSheets.includes(workaroundStyleSheet)) {
116
- root.adoptedStyleSheets = [
117
- ...root.adoptedStyleSheets,
118
- workaroundStyleSheet
119
- ];
120
- }
121
- };
122
- exports.TextField = class TextField extends textField.TextField {
211
+ var _reflectToTextArea;
212
+ let TextArea = class extends TextArea$1 {
123
213
  constructor() {
124
214
  super(...arguments);
125
- __privateAdd(this, _TextField_instances);
126
- /**
127
- * @internal
128
- */
129
- this._labelEl = null;
130
- __privateAdd(this, _reflectToInput);
131
- __privateAdd(this, _helperTextMirrorEl);
132
- __privateAdd(this, _helperTextSlotMutationObserver);
133
- }
134
- /**
135
- * @internal
136
- */
137
- labelChanged() {
138
- if (this._labelEl) {
139
- __privateMethod(this, _TextField_instances, handleLabelChange_fn).call(this, this._labelEl);
140
- }
215
+ __privateAdd(this, _reflectToTextArea);
141
216
  }
142
217
  connectedCallback() {
143
218
  super.connectedCallback();
144
- if (!this.control) {
145
- const uniqueId = this.id || generateRandomId();
146
- const controlId = `vvd-text-field-control-${uniqueId}`;
147
- const helperTextId = `vvd-text-field-helper-text-${uniqueId}`;
148
- const input = document.createElement("input");
149
- input.slot = "_control";
150
- input.id = controlId;
151
- input.className = safariWorkaroundClassName;
152
- this.control = input;
153
- input.addEventListener("input", () => {
154
- this.handleTextInput();
155
- });
156
- input.addEventListener("change", () => {
157
- this.handleChange();
158
- });
159
- input.addEventListener("blur", () => {
160
- this.$emit("blur", void 0, { bubbles: false });
161
- });
162
- input.addEventListener("focus", () => {
163
- this.$emit("focus", void 0, { bubbles: false });
164
- });
165
- this.appendChild(input);
166
- const label = document.createElement("label");
167
- label.slot = "_label";
168
- label.htmlFor = controlId;
169
- this._labelEl = label;
170
- __privateMethod(this, _TextField_instances, handleLabelChange_fn).call(this, label);
171
- __privateSet(this, _helperTextMirrorEl, document.createElement("div"));
172
- __privateGet(this, _helperTextMirrorEl).id = helperTextId;
173
- __privateGet(this, _helperTextMirrorEl).slot = "_mirrored-helper-text";
174
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
175
- this.appendChild(__privateGet(this, _helperTextMirrorEl));
176
- installSafariWorkaroundStyle(this);
177
- }
178
- __privateSet(this, _reflectToInput, new Reflector.Reflector(this, this.control));
179
- __privateGet(this, _reflectToInput).booleanAttribute("autofocus", "autofocus");
180
- __privateGet(this, _reflectToInput).booleanAttribute("disabled", "disabled");
181
- __privateGet(this, _reflectToInput).booleanAttribute("readOnly", "readonly");
182
- __privateGet(this, _reflectToInput).booleanAttribute("required", "required");
183
- __privateGet(this, _reflectToInput).booleanAttribute("spellcheck", "spellcheck");
184
- __privateGet(this, _reflectToInput).attribute("list", "list");
185
- __privateGet(this, _reflectToInput).attribute("maxlength", "maxlength");
186
- __privateGet(this, _reflectToInput).attribute("minlength", "minlength");
187
- __privateGet(this, _reflectToInput).attribute("pattern", "pattern");
188
- __privateGet(this, _reflectToInput).attribute("placeholder", "placeholder");
189
- __privateGet(this, _reflectToInput).attribute("size", "size");
190
- __privateGet(this, _reflectToInput).attribute("autoComplete", "autocomplete");
191
- __privateGet(this, _reflectToInput).attribute("type", "type");
192
- __privateGet(this, _reflectToInput).attribute("ariaAtomic", "aria-atomic");
193
- __privateGet(this, _reflectToInput).attribute("ariaBusy", "aria-busy");
194
- __privateGet(this, _reflectToInput).attribute("ariaCurrent", "aria-current");
195
- __privateGet(this, _reflectToInput).attribute("ariaDetails", "aria-details");
196
- __privateGet(this, _reflectToInput).attribute("ariaDisabled", "aria-disabled");
197
- __privateGet(this, _reflectToInput).attribute("ariaHaspopup", "aria-haspopup");
198
- __privateGet(this, _reflectToInput).attribute("ariaHidden", "aria-hidden");
199
- __privateGet(this, _reflectToInput).attribute("ariaInvalid", "aria-invalid");
200
- __privateGet(this, _reflectToInput).attribute("ariaKeyshortcuts", "aria-keyshortcuts");
201
- __privateGet(this, _reflectToInput).attribute("ariaLabel", "aria-label");
202
- __privateGet(this, _reflectToInput).attribute("ariaLive", "aria-live");
203
- __privateGet(this, _reflectToInput).attribute("ariaRelevant", "aria-relevant");
204
- __privateGet(this, _reflectToInput).attribute(
205
- "ariaRoledescription",
206
- "aria-roledescription"
207
- );
208
- __privateGet(this, _reflectToInput).property("value", "value", true);
209
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
219
+ __privateSet(this, _reflectToTextArea, new Reflector.Reflector(this, this.control));
220
+ __privateGet(this, _reflectToTextArea).property("value", "value", true);
210
221
  }
211
222
  disconnectedCallback() {
212
223
  super.disconnectedCallback();
213
- __privateGet(this, _reflectToInput).destroy();
214
- __privateSet(this, _reflectToInput, void 0);
215
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
216
- }
217
- focus() {
218
- this.control?.focus();
219
- }
220
- /**
221
- * @internal
222
- */
223
- helperTextChanged() {
224
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
225
- }
226
- /**
227
- * @internal
228
- */
229
- _helperTextSlottedContentChanged() {
230
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
231
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
232
- }
233
- };
234
- _TextField_instances = new WeakSet();
235
- handleLabelChange_fn = function(labelEl) {
236
- if (!this.label) {
237
- labelEl.remove();
238
- } else {
239
- labelEl.textContent = this.label;
240
- if (!labelEl.isConnected) {
241
- this.appendChild(labelEl);
242
- }
243
- }
244
- };
245
- _reflectToInput = new WeakMap();
246
- _helperTextMirrorEl = new WeakMap();
247
- _helperTextSlotMutationObserver = new WeakMap();
248
- updateHelperTextMutationObserver_fn = function() {
249
- const usesHelperTextSlot = this._helperTextSlottedContent.length;
250
- const shouldHaveMutationObserver = usesHelperTextSlot && this.isConnected;
251
- if (shouldHaveMutationObserver && !__privateGet(this, _helperTextSlotMutationObserver)) {
252
- __privateSet(this, _helperTextSlotMutationObserver, new MutationObserver((records) => {
253
- if (records.some((record) => record.target !== __privateGet(this, _helperTextMirrorEl))) {
254
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
255
- }
256
- }));
257
- __privateGet(this, _helperTextSlotMutationObserver).observe(this, {
258
- subtree: true,
259
- childList: true,
260
- characterData: true
261
- });
262
- }
263
- if (!shouldHaveMutationObserver && __privateGet(this, _helperTextSlotMutationObserver)) {
264
- __privateGet(this, _helperTextSlotMutationObserver).disconnect();
265
- __privateSet(this, _helperTextSlotMutationObserver, void 0);
266
- }
267
- };
268
- updateMirroredHelperText_fn = function() {
269
- let helperText = this.helperText ?? "";
270
- if (this._helperTextSlottedContent?.length) {
271
- helperText = this._helperTextSlottedContent.map((node) => node.innerText).join(" ");
272
- }
273
- if (__privateGet(this, _helperTextMirrorEl)) {
274
- __privateGet(this, _helperTextMirrorEl).textContent = helperText;
275
- if (helperText) {
276
- this.control.setAttribute(
277
- "aria-describedby",
278
- __privateGet(this, _helperTextMirrorEl).id
279
- );
280
- } else {
281
- this.control.removeAttribute("aria-describedby");
282
- }
224
+ __privateGet(this, _reflectToTextArea).destroy();
283
225
  }
284
226
  };
227
+ _reflectToTextArea = new WeakMap();
285
228
  __decorateClass([
286
229
  index.attr
287
- ], exports.TextField.prototype, "appearance", 2);
288
- __decorateClass([
289
- index.attr
290
- ], exports.TextField.prototype, "shape", 2);
291
- __decorateClass([
292
- index.attr
293
- ], exports.TextField.prototype, "autoComplete", 2);
294
- __decorateClass([
295
- index.observable
296
- ], exports.TextField.prototype, "actionItemsSlottedContent", 2);
297
- __decorateClass([
298
- index.observable
299
- ], exports.TextField.prototype, "leadingActionItemsSlottedContent", 2);
300
- exports.TextField = __decorateClass([
301
- index$1.errorText,
302
- index$1.formElements
303
- ], exports.TextField);
230
+ ], TextArea.prototype, "wrap", 2);
231
+ TextArea = __decorateClass([
232
+ formElements.errorText,
233
+ formElements.formElements
234
+ ], TextArea);
304
235
  applyMixinsWithObservables.applyMixinsWithObservables(
305
- exports.TextField,
306
- affix.AffixIcon,
307
- index$1.FormElementCharCount,
308
- index$1.FormElementHelperText,
309
- index$1.FormElementSuccessText
236
+ TextArea,
237
+ formElements.FormElementCharCount,
238
+ formElements.FormElementHelperText,
239
+ formElements.FormElementSuccessText
310
240
  );
311
241
 
312
- const getStateClasses = ({
242
+ const getClasses = ({
243
+ value,
313
244
  errorValidationMessage,
314
245
  disabled,
315
- value,
316
- readOnly,
317
246
  placeholder,
318
- appearance,
319
- shape,
320
- label,
321
- successText,
322
- actionItemsSlottedContent,
323
- leadingActionItemsSlottedContent,
324
- icon
247
+ readOnly,
248
+ successText
325
249
  }) => classNames.classNames(
326
- ["error", Boolean(errorValidationMessage)],
327
- ["disabled", disabled],
328
- ["has-value", Boolean(value)],
250
+ "base",
329
251
  ["readonly", readOnly],
330
252
  ["placeholder", Boolean(placeholder)],
331
- [`appearance-${appearance}`, Boolean(appearance)],
332
- [`shape-${shape}`, Boolean(shape)],
333
- ["no-label", !label],
334
- ["has-icon", !!icon],
335
- ["success", Boolean(successText)],
336
- ["action-items", !!actionItemsSlottedContent?.length],
337
- ["leading-action-items", !!leadingActionItemsSlottedContent?.length],
338
- ["no-leading", !(leadingActionItemsSlottedContent?.length || icon)]
253
+ ["disabled", disabled],
254
+ ["error", Boolean(errorValidationMessage)],
255
+ ["has-value", Boolean(value)],
256
+ ["success", !!successText]
339
257
  );
258
+ function renderLabel() {
259
+ return index.html` <label for="control" class="label">
260
+ ${(x) => x.label}
261
+ </label>`;
262
+ }
340
263
  function renderCharCount() {
341
264
  return index.html`
342
265
  <span class="char-count"
@@ -344,46 +267,63 @@ function renderCharCount() {
344
267
  >
345
268
  `;
346
269
  }
347
- const TextfieldTemplate = (context) => {
348
- const affixIconTemplate = affix.affixIconTemplateFactory(context);
349
- return index.html` <div class="base ${getStateClasses}">
270
+ const TextAreaTemplate = (context) => {
271
+ return index.html`
272
+ <div class="${getClasses}">
350
273
  ${when.when((x) => x.charCount && x.maxlength, renderCharCount())}
351
- <slot class="label" name="_label"></slot>
352
- <div class="fieldset">
353
- <div class="leading-items-wrapper">
354
- <slot
355
- name="leading-action-items"
356
- ${slotted.slotted("leadingActionItemsSlottedContent")}
357
- ></slot>
358
- ${(x) => affixIconTemplate(x.icon)}
359
- </div>
360
-
361
- <div class="wrapper">
362
- <slot class="control" name="_control"></slot>
363
- </div>
364
- <div class="action-items-wrapper">
365
- <slot
366
- name="action-items"
367
- ${slotted.slotted("actionItemsSlottedContent")}
368
- ></slot>
369
- </div>
370
- </div>
371
- ${index$1.getFeedbackTemplate(context)}
274
+ ${when.when((x) => x.label, renderLabel())}
275
+ <textarea
276
+ class="control"
277
+ id="control"
278
+ ?autofocus="${(x) => x.autofocus}"
279
+ placeholder="${(x) => x.placeholder ? x.placeholder : null}"
280
+ name="${(x) => x.name ? x.name : null}"
281
+ minlength="${(x) => x.minlength ? x.minlength : null}"
282
+ maxlength="${(x) => x.maxlength ? x.maxlength : null}"
283
+ rows="${(x) => x.rows ? x.rows : null}"
284
+ cols="${(x) => x.cols ? x.cols : null}"
285
+ wrap="${(x) => x.wrap ? x.wrap : null}"
286
+ ?readonly="${(x) => x.readOnly}"
287
+ ?disabled="${(x) => x.disabled}"
288
+ ?required="${(x) => x.required}"
289
+ ?spellcheck="${(x) => x.spellcheck}"
290
+ aria-atomic="${(x) => x.ariaAtomic}"
291
+ aria-busy="${(x) => x.ariaBusy}"
292
+ aria-current="${(x) => x.ariaCurrent}"
293
+ aria-details="${(x) => x.ariaDetails}"
294
+ aria-disabled="${(x) => x.ariaDisabled}"
295
+ aria-errormessage="${(x) => x.ariaErrormessage}"
296
+ aria-haspopup="${(x) => x.ariaHaspopup}"
297
+ aria-hidden="${(x) => x.ariaHidden}"
298
+ aria-invalid="${(x) => x.ariaInvalid}"
299
+ aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
300
+ aria-label="${(x) => x.ariaLabel}"
301
+ aria-live="${(x) => x.ariaLive}"
302
+ aria-relevant="${(x) => x.ariaRelevant}"
303
+ aria-roledescription="${(x) => x.ariaRoledescription}"
304
+ @input="${(x) => x.handleTextInput()}"
305
+ @change="${(x) => x.handleChange()}"
306
+ ${ref.ref("control")}
307
+ >
308
+ </textarea>
309
+ ${formElements.getFeedbackTemplate(context)}
372
310
  </div>
373
- <slot name="_mirrored-helper-text"></slot>`;
311
+ `;
374
312
  };
375
313
 
376
- const textFieldDefinition = exports.TextField.compose({
377
- baseName: "text-field",
378
- template: TextfieldTemplate,
379
- styles: textField$1.styles,
380
- shadowOptions: {
381
- delegatesFocus: true
314
+ const textAreaDefinition = TextArea.compose(
315
+ {
316
+ baseName: "text-area",
317
+ template: TextAreaTemplate,
318
+ styles,
319
+ shadowOptions: {
320
+ delegatesFocus: true
321
+ }
382
322
  }
383
- });
384
- const textFieldRegistries = [textFieldDefinition(), ...definition.iconRegistries];
385
- const registerTextField = index.registerFactory(textFieldRegistries);
323
+ );
324
+ const textAreaRegistries = [textAreaDefinition(), ...definition.iconRegistries];
325
+ const registerTextArea = index.registerFactory(textAreaRegistries);
386
326
 
387
- exports.registerTextField = registerTextField;
388
- exports.textFieldDefinition = textFieldDefinition;
389
- exports.textFieldRegistries = textFieldRegistries;
327
+ exports.registerTextArea = registerTextArea;
328
+ exports.textAreaDefinition = textAreaDefinition;
329
+ exports.textAreaRegistries = textAreaRegistries;