@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
@@ -1,72 +1,193 @@
1
- import { a as attr, o as observable, h as html, r as registerFactory } from './index.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
2
  import { a as iconRegistries } from './definition27.js';
3
- import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
4
- import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './index2.js';
5
3
  import { R as Reflector } from './Reflector.js';
6
4
  import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
7
- import { m as memoizeWith } from './icon.js';
8
- import { T as TextField$1 } from './text-field2.js';
9
- import { s as styles } from './text-field.js';
5
+ import { D as DelegatesARIATextbox } from './text-field2.js';
6
+ import { a as applyMixins } from './apply-mixins.js';
7
+ import { F as FormAssociated } from './form-associated.js';
8
+ import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
10
9
  import { w as when } from './when.js';
11
- import { s as slotted } from './slotted.js';
10
+ import { r as ref } from './ref.js';
12
11
  import { c as classNames } from './class-names.js';
13
12
 
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);
13
+ class _TextArea extends FoundationElement {
31
14
  }
32
-
33
15
  /**
34
- * Convert array of 16 byte values to UUID string format of the form:
35
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
16
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(TextArea:class)} component.
17
+ *
18
+ * @internal
36
19
  */
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]];
20
+ class FormAssociatedTextArea extends FormAssociated(_TextArea) {
21
+ constructor() {
22
+ super(...arguments);
23
+ this.proxy = document.createElement("textarea");
24
+ }
48
25
  }
49
26
 
50
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
51
- const native = {
52
- randomUUID
27
+ /**
28
+ * Resize mode for a TextArea
29
+ * @public
30
+ */
31
+ const TextAreaResize = {
32
+ /**
33
+ * No resize.
34
+ */
35
+ none: "none",
36
+ /**
37
+ * Resize vertically and horizontally.
38
+ */
39
+ both: "both",
40
+ /**
41
+ * Resize horizontally.
42
+ */
43
+ horizontal: "horizontal",
44
+ /**
45
+ * Resize vertically.
46
+ */
47
+ vertical: "vertical",
53
48
  };
54
49
 
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
- return unsafeStringify(rnds);
67
- }
50
+ /**
51
+ * A Text Area Custom HTML Element.
52
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.
53
+ *
54
+ * @slot - The default slot for the label
55
+ * @csspart label - The label
56
+ * @csspart root - The element wrapping the control
57
+ * @csspart control - The textarea element
58
+ * @fires change - Emits a custom 'change' event when the textarea emits a change event
59
+ *
60
+ * @public
61
+ */
62
+ let TextArea$1 = class TextArea extends FormAssociatedTextArea {
63
+ constructor() {
64
+ super(...arguments);
65
+ /**
66
+ * The resize mode of the element.
67
+ * @public
68
+ * @remarks
69
+ * HTML Attribute: resize
70
+ */
71
+ this.resize = TextAreaResize.none;
72
+ /**
73
+ * Sizes the element horizontally by a number of character columns.
74
+ *
75
+ * @public
76
+ * @remarks
77
+ * HTML Attribute: cols
78
+ */
79
+ this.cols = 20;
80
+ /**
81
+ * @internal
82
+ */
83
+ this.handleTextInput = () => {
84
+ this.value = this.control.value;
85
+ };
86
+ }
87
+ readOnlyChanged() {
88
+ if (this.proxy instanceof HTMLTextAreaElement) {
89
+ this.proxy.readOnly = this.readOnly;
90
+ }
91
+ }
92
+ autofocusChanged() {
93
+ if (this.proxy instanceof HTMLTextAreaElement) {
94
+ this.proxy.autofocus = this.autofocus;
95
+ }
96
+ }
97
+ listChanged() {
98
+ if (this.proxy instanceof HTMLTextAreaElement) {
99
+ this.proxy.setAttribute("list", this.list);
100
+ }
101
+ }
102
+ maxlengthChanged() {
103
+ if (this.proxy instanceof HTMLTextAreaElement) {
104
+ this.proxy.maxLength = this.maxlength;
105
+ }
106
+ }
107
+ minlengthChanged() {
108
+ if (this.proxy instanceof HTMLTextAreaElement) {
109
+ this.proxy.minLength = this.minlength;
110
+ }
111
+ }
112
+ spellcheckChanged() {
113
+ if (this.proxy instanceof HTMLTextAreaElement) {
114
+ this.proxy.spellcheck = this.spellcheck;
115
+ }
116
+ }
117
+ /**
118
+ * Selects all the text in the text area
119
+ *
120
+ * @public
121
+ */
122
+ select() {
123
+ this.control.select();
124
+ /**
125
+ * The select event does not permeate the shadow DOM boundary.
126
+ * This fn effectively proxies the select event,
127
+ * emitting a `select` event whenever the internal
128
+ * control emits a `select` event
129
+ */
130
+ this.$emit("select");
131
+ }
132
+ /**
133
+ * Change event handler for inner control.
134
+ * @remarks
135
+ * "Change" events are not `composable` so they will not
136
+ * permeate the shadow DOM boundary. This fn effectively proxies
137
+ * the change event, emitting a `change` event whenever the internal
138
+ * control emits a `change` event
139
+ * @internal
140
+ */
141
+ handleChange() {
142
+ this.$emit("change");
143
+ }
144
+ /** {@inheritDoc (FormAssociated:interface).validate} */
145
+ validate() {
146
+ super.validate(this.control);
147
+ }
148
+ };
149
+ __decorate([
150
+ attr({ mode: "boolean" })
151
+ ], TextArea$1.prototype, "readOnly", void 0);
152
+ __decorate([
153
+ attr
154
+ ], TextArea$1.prototype, "resize", void 0);
155
+ __decorate([
156
+ attr({ mode: "boolean" })
157
+ ], TextArea$1.prototype, "autofocus", void 0);
158
+ __decorate([
159
+ attr({ attribute: "form" })
160
+ ], TextArea$1.prototype, "formId", void 0);
161
+ __decorate([
162
+ attr
163
+ ], TextArea$1.prototype, "list", void 0);
164
+ __decorate([
165
+ attr({ converter: nullableNumberConverter })
166
+ ], TextArea$1.prototype, "maxlength", void 0);
167
+ __decorate([
168
+ attr({ converter: nullableNumberConverter })
169
+ ], TextArea$1.prototype, "minlength", void 0);
170
+ __decorate([
171
+ attr
172
+ ], TextArea$1.prototype, "name", void 0);
173
+ __decorate([
174
+ attr
175
+ ], TextArea$1.prototype, "placeholder", void 0);
176
+ __decorate([
177
+ attr({ converter: nullableNumberConverter, mode: "fromView" })
178
+ ], TextArea$1.prototype, "cols", void 0);
179
+ __decorate([
180
+ attr({ converter: nullableNumberConverter, mode: "fromView" })
181
+ ], TextArea$1.prototype, "rows", void 0);
182
+ __decorate([
183
+ attr({ mode: "boolean" })
184
+ ], TextArea$1.prototype, "spellcheck", void 0);
185
+ __decorate([
186
+ observable
187
+ ], TextArea$1.prototype, "defaultSlottedNodes", void 0);
188
+ applyMixins(TextArea$1, DelegatesARIATextbox);
68
189
 
69
- const generateRandomId = () => v4();
190
+ 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}";
70
191
 
71
192
  var __defProp = Object.defineProperty;
72
193
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -85,256 +206,58 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
85
206
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
86
207
  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);
87
208
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
88
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
89
- var _TextField_instances, handleLabelChange_fn, _reflectToInput, _helperTextMirrorEl, _helperTextSlotMutationObserver, updateHelperTextMutationObserver_fn, updateMirroredHelperText_fn;
90
- const safariWorkaroundClassName = "_vvd-3-text-field-safari-workaround";
91
- const getSafariWorkaroundStyleSheet = memoizeWith(
92
- () => "",
93
- () => {
94
- const styleSheet = new CSSStyleSheet();
95
- const supportsReplaceSync = "replaceSync" in styleSheet;
96
- if (supportsReplaceSync) {
97
- styleSheet.replaceSync(`
98
- .${safariWorkaroundClassName}::placeholder {
99
- opacity: 1 !important;
100
- -webkit-text-fill-color: var(--_low-ink-color) !important;
101
- }`);
102
- }
103
- return styleSheet;
104
- }
105
- );
106
- const installSafariWorkaroundStyle = (forElement) => {
107
- const root = forElement.getRootNode();
108
- const workaroundStyleSheet = getSafariWorkaroundStyleSheet();
109
- const supportsAdoptedStyleSheets = "adoptedStyleSheets" in root;
110
- if (!supportsAdoptedStyleSheets) {
111
- return;
112
- }
113
- if (!root.adoptedStyleSheets.includes(workaroundStyleSheet)) {
114
- root.adoptedStyleSheets = [
115
- ...root.adoptedStyleSheets,
116
- workaroundStyleSheet
117
- ];
118
- }
119
- };
120
- let TextField = class extends TextField$1 {
209
+ var _reflectToTextArea;
210
+ let TextArea = class extends TextArea$1 {
121
211
  constructor() {
122
212
  super(...arguments);
123
- __privateAdd(this, _TextField_instances);
124
- /**
125
- * @internal
126
- */
127
- this._labelEl = null;
128
- __privateAdd(this, _reflectToInput);
129
- __privateAdd(this, _helperTextMirrorEl);
130
- __privateAdd(this, _helperTextSlotMutationObserver);
131
- }
132
- /**
133
- * @internal
134
- */
135
- labelChanged() {
136
- if (this._labelEl) {
137
- __privateMethod(this, _TextField_instances, handleLabelChange_fn).call(this, this._labelEl);
138
- }
213
+ __privateAdd(this, _reflectToTextArea);
139
214
  }
140
215
  connectedCallback() {
141
216
  super.connectedCallback();
142
- if (!this.control) {
143
- const uniqueId = this.id || generateRandomId();
144
- const controlId = `vvd-text-field-control-${uniqueId}`;
145
- const helperTextId = `vvd-text-field-helper-text-${uniqueId}`;
146
- const input = document.createElement("input");
147
- input.slot = "_control";
148
- input.id = controlId;
149
- input.className = safariWorkaroundClassName;
150
- this.control = input;
151
- input.addEventListener("input", () => {
152
- this.handleTextInput();
153
- });
154
- input.addEventListener("change", () => {
155
- this.handleChange();
156
- });
157
- input.addEventListener("blur", () => {
158
- this.$emit("blur", void 0, { bubbles: false });
159
- });
160
- input.addEventListener("focus", () => {
161
- this.$emit("focus", void 0, { bubbles: false });
162
- });
163
- this.appendChild(input);
164
- const label = document.createElement("label");
165
- label.slot = "_label";
166
- label.htmlFor = controlId;
167
- this._labelEl = label;
168
- __privateMethod(this, _TextField_instances, handleLabelChange_fn).call(this, label);
169
- __privateSet(this, _helperTextMirrorEl, document.createElement("div"));
170
- __privateGet(this, _helperTextMirrorEl).id = helperTextId;
171
- __privateGet(this, _helperTextMirrorEl).slot = "_mirrored-helper-text";
172
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
173
- this.appendChild(__privateGet(this, _helperTextMirrorEl));
174
- installSafariWorkaroundStyle(this);
175
- }
176
- __privateSet(this, _reflectToInput, new Reflector(this, this.control));
177
- __privateGet(this, _reflectToInput).booleanAttribute("autofocus", "autofocus");
178
- __privateGet(this, _reflectToInput).booleanAttribute("disabled", "disabled");
179
- __privateGet(this, _reflectToInput).booleanAttribute("readOnly", "readonly");
180
- __privateGet(this, _reflectToInput).booleanAttribute("required", "required");
181
- __privateGet(this, _reflectToInput).booleanAttribute("spellcheck", "spellcheck");
182
- __privateGet(this, _reflectToInput).attribute("list", "list");
183
- __privateGet(this, _reflectToInput).attribute("maxlength", "maxlength");
184
- __privateGet(this, _reflectToInput).attribute("minlength", "minlength");
185
- __privateGet(this, _reflectToInput).attribute("pattern", "pattern");
186
- __privateGet(this, _reflectToInput).attribute("placeholder", "placeholder");
187
- __privateGet(this, _reflectToInput).attribute("size", "size");
188
- __privateGet(this, _reflectToInput).attribute("autoComplete", "autocomplete");
189
- __privateGet(this, _reflectToInput).attribute("type", "type");
190
- __privateGet(this, _reflectToInput).attribute("ariaAtomic", "aria-atomic");
191
- __privateGet(this, _reflectToInput).attribute("ariaBusy", "aria-busy");
192
- __privateGet(this, _reflectToInput).attribute("ariaCurrent", "aria-current");
193
- __privateGet(this, _reflectToInput).attribute("ariaDetails", "aria-details");
194
- __privateGet(this, _reflectToInput).attribute("ariaDisabled", "aria-disabled");
195
- __privateGet(this, _reflectToInput).attribute("ariaHaspopup", "aria-haspopup");
196
- __privateGet(this, _reflectToInput).attribute("ariaHidden", "aria-hidden");
197
- __privateGet(this, _reflectToInput).attribute("ariaInvalid", "aria-invalid");
198
- __privateGet(this, _reflectToInput).attribute("ariaKeyshortcuts", "aria-keyshortcuts");
199
- __privateGet(this, _reflectToInput).attribute("ariaLabel", "aria-label");
200
- __privateGet(this, _reflectToInput).attribute("ariaLive", "aria-live");
201
- __privateGet(this, _reflectToInput).attribute("ariaRelevant", "aria-relevant");
202
- __privateGet(this, _reflectToInput).attribute(
203
- "ariaRoledescription",
204
- "aria-roledescription"
205
- );
206
- __privateGet(this, _reflectToInput).property("value", "value", true);
207
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
217
+ __privateSet(this, _reflectToTextArea, new Reflector(this, this.control));
218
+ __privateGet(this, _reflectToTextArea).property("value", "value", true);
208
219
  }
209
220
  disconnectedCallback() {
210
221
  super.disconnectedCallback();
211
- __privateGet(this, _reflectToInput).destroy();
212
- __privateSet(this, _reflectToInput, void 0);
213
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
214
- }
215
- focus() {
216
- this.control?.focus();
217
- }
218
- /**
219
- * @internal
220
- */
221
- helperTextChanged() {
222
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
223
- }
224
- /**
225
- * @internal
226
- */
227
- _helperTextSlottedContentChanged() {
228
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
229
- __privateMethod(this, _TextField_instances, updateHelperTextMutationObserver_fn).call(this);
230
- }
231
- };
232
- _TextField_instances = new WeakSet();
233
- handleLabelChange_fn = function(labelEl) {
234
- if (!this.label) {
235
- labelEl.remove();
236
- } else {
237
- labelEl.textContent = this.label;
238
- if (!labelEl.isConnected) {
239
- this.appendChild(labelEl);
240
- }
241
- }
242
- };
243
- _reflectToInput = new WeakMap();
244
- _helperTextMirrorEl = new WeakMap();
245
- _helperTextSlotMutationObserver = new WeakMap();
246
- updateHelperTextMutationObserver_fn = function() {
247
- const usesHelperTextSlot = this._helperTextSlottedContent.length;
248
- const shouldHaveMutationObserver = usesHelperTextSlot && this.isConnected;
249
- if (shouldHaveMutationObserver && !__privateGet(this, _helperTextSlotMutationObserver)) {
250
- __privateSet(this, _helperTextSlotMutationObserver, new MutationObserver((records) => {
251
- if (records.some((record) => record.target !== __privateGet(this, _helperTextMirrorEl))) {
252
- __privateMethod(this, _TextField_instances, updateMirroredHelperText_fn).call(this);
253
- }
254
- }));
255
- __privateGet(this, _helperTextSlotMutationObserver).observe(this, {
256
- subtree: true,
257
- childList: true,
258
- characterData: true
259
- });
260
- }
261
- if (!shouldHaveMutationObserver && __privateGet(this, _helperTextSlotMutationObserver)) {
262
- __privateGet(this, _helperTextSlotMutationObserver).disconnect();
263
- __privateSet(this, _helperTextSlotMutationObserver, void 0);
264
- }
265
- };
266
- updateMirroredHelperText_fn = function() {
267
- let helperText = this.helperText ?? "";
268
- if (this._helperTextSlottedContent?.length) {
269
- helperText = this._helperTextSlottedContent.map((node) => node.innerText).join(" ");
270
- }
271
- if (__privateGet(this, _helperTextMirrorEl)) {
272
- __privateGet(this, _helperTextMirrorEl).textContent = helperText;
273
- if (helperText) {
274
- this.control.setAttribute(
275
- "aria-describedby",
276
- __privateGet(this, _helperTextMirrorEl).id
277
- );
278
- } else {
279
- this.control.removeAttribute("aria-describedby");
280
- }
222
+ __privateGet(this, _reflectToTextArea).destroy();
281
223
  }
282
224
  };
225
+ _reflectToTextArea = new WeakMap();
283
226
  __decorateClass([
284
227
  attr
285
- ], TextField.prototype, "appearance", 2);
286
- __decorateClass([
287
- attr
288
- ], TextField.prototype, "shape", 2);
289
- __decorateClass([
290
- attr
291
- ], TextField.prototype, "autoComplete", 2);
292
- __decorateClass([
293
- observable
294
- ], TextField.prototype, "actionItemsSlottedContent", 2);
295
- __decorateClass([
296
- observable
297
- ], TextField.prototype, "leadingActionItemsSlottedContent", 2);
298
- TextField = __decorateClass([
228
+ ], TextArea.prototype, "wrap", 2);
229
+ TextArea = __decorateClass([
299
230
  errorText,
300
231
  formElements
301
- ], TextField);
232
+ ], TextArea);
302
233
  applyMixinsWithObservables(
303
- TextField,
304
- AffixIcon,
234
+ TextArea,
305
235
  FormElementCharCount,
306
236
  FormElementHelperText,
307
237
  FormElementSuccessText
308
238
  );
309
239
 
310
- const getStateClasses = ({
240
+ const getClasses = ({
241
+ value,
311
242
  errorValidationMessage,
312
243
  disabled,
313
- value,
314
- readOnly,
315
244
  placeholder,
316
- appearance,
317
- shape,
318
- label,
319
- successText,
320
- actionItemsSlottedContent,
321
- leadingActionItemsSlottedContent,
322
- icon
245
+ readOnly,
246
+ successText
323
247
  }) => classNames(
324
- ["error", Boolean(errorValidationMessage)],
325
- ["disabled", disabled],
326
- ["has-value", Boolean(value)],
248
+ "base",
327
249
  ["readonly", readOnly],
328
250
  ["placeholder", Boolean(placeholder)],
329
- [`appearance-${appearance}`, Boolean(appearance)],
330
- [`shape-${shape}`, Boolean(shape)],
331
- ["no-label", !label],
332
- ["has-icon", !!icon],
333
- ["success", Boolean(successText)],
334
- ["action-items", !!actionItemsSlottedContent?.length],
335
- ["leading-action-items", !!leadingActionItemsSlottedContent?.length],
336
- ["no-leading", !(leadingActionItemsSlottedContent?.length || icon)]
251
+ ["disabled", disabled],
252
+ ["error", Boolean(errorValidationMessage)],
253
+ ["has-value", Boolean(value)],
254
+ ["success", !!successText]
337
255
  );
256
+ function renderLabel() {
257
+ return html` <label for="control" class="label">
258
+ ${(x) => x.label}
259
+ </label>`;
260
+ }
338
261
  function renderCharCount() {
339
262
  return html`
340
263
  <span class="char-count"
@@ -342,44 +265,61 @@ function renderCharCount() {
342
265
  >
343
266
  `;
344
267
  }
345
- const TextfieldTemplate = (context) => {
346
- const affixIconTemplate = affixIconTemplateFactory(context);
347
- return html` <div class="base ${getStateClasses}">
268
+ const TextAreaTemplate = (context) => {
269
+ return html`
270
+ <div class="${getClasses}">
348
271
  ${when((x) => x.charCount && x.maxlength, renderCharCount())}
349
- <slot class="label" name="_label"></slot>
350
- <div class="fieldset">
351
- <div class="leading-items-wrapper">
352
- <slot
353
- name="leading-action-items"
354
- ${slotted("leadingActionItemsSlottedContent")}
355
- ></slot>
356
- ${(x) => affixIconTemplate(x.icon)}
357
- </div>
358
-
359
- <div class="wrapper">
360
- <slot class="control" name="_control"></slot>
361
- </div>
362
- <div class="action-items-wrapper">
363
- <slot
364
- name="action-items"
365
- ${slotted("actionItemsSlottedContent")}
366
- ></slot>
367
- </div>
368
- </div>
272
+ ${when((x) => x.label, renderLabel())}
273
+ <textarea
274
+ class="control"
275
+ id="control"
276
+ ?autofocus="${(x) => x.autofocus}"
277
+ placeholder="${(x) => x.placeholder ? x.placeholder : null}"
278
+ name="${(x) => x.name ? x.name : null}"
279
+ minlength="${(x) => x.minlength ? x.minlength : null}"
280
+ maxlength="${(x) => x.maxlength ? x.maxlength : null}"
281
+ rows="${(x) => x.rows ? x.rows : null}"
282
+ cols="${(x) => x.cols ? x.cols : null}"
283
+ wrap="${(x) => x.wrap ? x.wrap : null}"
284
+ ?readonly="${(x) => x.readOnly}"
285
+ ?disabled="${(x) => x.disabled}"
286
+ ?required="${(x) => x.required}"
287
+ ?spellcheck="${(x) => x.spellcheck}"
288
+ aria-atomic="${(x) => x.ariaAtomic}"
289
+ aria-busy="${(x) => x.ariaBusy}"
290
+ aria-current="${(x) => x.ariaCurrent}"
291
+ aria-details="${(x) => x.ariaDetails}"
292
+ aria-disabled="${(x) => x.ariaDisabled}"
293
+ aria-errormessage="${(x) => x.ariaErrormessage}"
294
+ aria-haspopup="${(x) => x.ariaHaspopup}"
295
+ aria-hidden="${(x) => x.ariaHidden}"
296
+ aria-invalid="${(x) => x.ariaInvalid}"
297
+ aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
298
+ aria-label="${(x) => x.ariaLabel}"
299
+ aria-live="${(x) => x.ariaLive}"
300
+ aria-relevant="${(x) => x.ariaRelevant}"
301
+ aria-roledescription="${(x) => x.ariaRoledescription}"
302
+ @input="${(x) => x.handleTextInput()}"
303
+ @change="${(x) => x.handleChange()}"
304
+ ${ref("control")}
305
+ >
306
+ </textarea>
369
307
  ${getFeedbackTemplate(context)}
370
308
  </div>
371
- <slot name="_mirrored-helper-text"></slot>`;
309
+ `;
372
310
  };
373
311
 
374
- const textFieldDefinition = TextField.compose({
375
- baseName: "text-field",
376
- template: TextfieldTemplate,
377
- styles,
378
- shadowOptions: {
379
- delegatesFocus: true
312
+ const textAreaDefinition = TextArea.compose(
313
+ {
314
+ baseName: "text-area",
315
+ template: TextAreaTemplate,
316
+ styles,
317
+ shadowOptions: {
318
+ delegatesFocus: true
319
+ }
380
320
  }
381
- });
382
- const textFieldRegistries = [textFieldDefinition(), ...iconRegistries];
383
- const registerTextField = registerFactory(textFieldRegistries);
321
+ );
322
+ const textAreaRegistries = [textAreaDefinition(), ...iconRegistries];
323
+ const registerTextArea = registerFactory(textAreaRegistries);
384
324
 
385
- export { TextField as T, textFieldRegistries as a, registerTextField as r, textFieldDefinition as t };
325
+ export { textAreaRegistries as a, registerTextArea as r, textAreaDefinition as t };