@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,326 +1,145 @@
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';
1
+ import { F as FoundationElement, a as attr, h as html, r as registerFactory } from './index.js';
2
2
  import { a as iconRegistries } from './definition27.js';
3
- import './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
- import { R as Reflector } from './Reflector.js';
6
- import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
7
- import { D as DelegatesARIATextbox } from './text-field2.js';
3
+ import { A as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
8
4
  import { a as applyMixins } from './apply-mixins.js';
9
- import { F as FormAssociated } from './form-associated.js';
5
+ import { I as Icon } from './icon.js';
10
6
  import { w as when } from './when.js';
11
- import { r as ref } from './ref.js';
12
7
  import { c as classNames } from './class-names.js';
13
8
 
14
- class _TextArea extends FoundationElement {
15
- }
16
- /**
17
- * A form-associated base class for the {@link @microsoft/fast-foundation#(TextArea:class)} component.
18
- *
19
- * @internal
20
- */
21
- class FormAssociatedTextArea extends FormAssociated(_TextArea) {
22
- constructor() {
23
- super(...arguments);
24
- this.proxy = document.createElement("textarea");
25
- }
26
- }
27
-
28
- /**
29
- * Resize mode for a TextArea
30
- * @public
31
- */
32
- const TextAreaResize = {
33
- /**
34
- * No resize.
35
- */
36
- none: "none",
37
- /**
38
- * Resize vertically and horizontally.
39
- */
40
- both: "both",
41
- /**
42
- * Resize horizontally.
43
- */
44
- horizontal: "horizontal",
45
- /**
46
- * Resize vertically.
47
- */
48
- vertical: "vertical",
49
- };
50
-
51
- /**
52
- * A Text Area Custom HTML Element.
53
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.
54
- *
55
- * @slot - The default slot for the label
56
- * @csspart label - The label
57
- * @csspart root - The element wrapping the control
58
- * @csspart control - The textarea element
59
- * @fires change - Emits a custom 'change' event when the textarea emits a change event
60
- *
61
- * @public
62
- */
63
- let TextArea$1 = class TextArea extends FormAssociatedTextArea {
64
- constructor() {
65
- super(...arguments);
66
- /**
67
- * The resize mode of the element.
68
- * @public
69
- * @remarks
70
- * HTML Attribute: resize
71
- */
72
- this.resize = TextAreaResize.none;
73
- /**
74
- * Sizes the element horizontally by a number of character columns.
75
- *
76
- * @public
77
- * @remarks
78
- * HTML Attribute: cols
79
- */
80
- this.cols = 20;
81
- /**
82
- * @internal
83
- */
84
- this.handleTextInput = () => {
85
- this.value = this.control.value;
86
- };
87
- }
88
- readOnlyChanged() {
89
- if (this.proxy instanceof HTMLTextAreaElement) {
90
- this.proxy.readOnly = this.readOnly;
91
- }
92
- }
93
- autofocusChanged() {
94
- if (this.proxy instanceof HTMLTextAreaElement) {
95
- this.proxy.autofocus = this.autofocus;
96
- }
97
- }
98
- listChanged() {
99
- if (this.proxy instanceof HTMLTextAreaElement) {
100
- this.proxy.setAttribute("list", this.list);
101
- }
102
- }
103
- maxlengthChanged() {
104
- if (this.proxy instanceof HTMLTextAreaElement) {
105
- this.proxy.maxLength = this.maxlength;
106
- }
107
- }
108
- minlengthChanged() {
109
- if (this.proxy instanceof HTMLTextAreaElement) {
110
- this.proxy.minLength = this.minlength;
111
- }
112
- }
113
- spellcheckChanged() {
114
- if (this.proxy instanceof HTMLTextAreaElement) {
115
- this.proxy.spellcheck = this.spellcheck;
116
- }
117
- }
118
- /**
119
- * Selects all the text in the text area
120
- *
121
- * @public
122
- */
123
- select() {
124
- this.control.select();
125
- /**
126
- * The select event does not permeate the shadow DOM boundary.
127
- * This fn effectively proxies the select event,
128
- * emitting a `select` event whenever the internal
129
- * control emits a `select` event
130
- */
131
- this.$emit("select");
132
- }
133
- /**
134
- * Change event handler for inner control.
135
- * @remarks
136
- * "Change" events are not `composable` so they will not
137
- * permeate the shadow DOM boundary. This fn effectively proxies
138
- * the change event, emitting a `change` event whenever the internal
139
- * control emits a `change` event
140
- * @internal
141
- */
142
- handleChange() {
143
- this.$emit("change");
144
- }
145
- /** {@inheritDoc (FormAssociated:interface).validate} */
146
- validate() {
147
- super.validate(this.control);
148
- }
149
- };
150
- __decorate([
151
- attr({ mode: "boolean" })
152
- ], TextArea$1.prototype, "readOnly", void 0);
153
- __decorate([
154
- attr
155
- ], TextArea$1.prototype, "resize", void 0);
156
- __decorate([
157
- attr({ mode: "boolean" })
158
- ], TextArea$1.prototype, "autofocus", void 0);
159
- __decorate([
160
- attr({ attribute: "form" })
161
- ], TextArea$1.prototype, "formId", void 0);
162
- __decorate([
163
- attr
164
- ], TextArea$1.prototype, "list", void 0);
165
- __decorate([
166
- attr({ converter: nullableNumberConverter })
167
- ], TextArea$1.prototype, "maxlength", void 0);
168
- __decorate([
169
- attr({ converter: nullableNumberConverter })
170
- ], TextArea$1.prototype, "minlength", void 0);
171
- __decorate([
172
- attr
173
- ], TextArea$1.prototype, "name", void 0);
174
- __decorate([
175
- attr
176
- ], TextArea$1.prototype, "placeholder", void 0);
177
- __decorate([
178
- attr({ converter: nullableNumberConverter, mode: "fromView" })
179
- ], TextArea$1.prototype, "cols", void 0);
180
- __decorate([
181
- attr({ converter: nullableNumberConverter, mode: "fromView" })
182
- ], TextArea$1.prototype, "rows", void 0);
183
- __decorate([
184
- attr({ mode: "boolean" })
185
- ], TextArea$1.prototype, "spellcheck", void 0);
186
- __decorate([
187
- observable
188
- ], TextArea$1.prototype, "defaultSlottedNodes", void 0);
189
- applyMixins(TextArea$1, DelegatesARIATextbox);
190
-
191
- const styles = ":host{display:inline-block}.base{display:inline-grid;grid-template-columns:1fr max-content;inline-size:100%;row-gap:4px}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-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))}@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}";
192
-
193
9
  var __defProp = Object.defineProperty;
194
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
195
- var __typeError = (msg) => {
196
- throw TypeError(msg);
197
- };
198
10
  var __decorateClass = (decorators, target, key, kind) => {
199
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ var result = void 0 ;
200
12
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
201
13
  if (decorator = decorators[i])
202
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
203
- if (kind && result) __defProp(target, key, result);
14
+ result = (decorator(target, key, result) ) || result;
15
+ if (result) __defProp(target, key, result);
204
16
  return result;
205
17
  };
206
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
207
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
208
- 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);
209
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
210
- var _reflectToTextArea;
211
- let TextArea = class extends TextArea$1 {
18
+ class Tag extends FoundationElement {
212
19
  constructor() {
213
20
  super(...arguments);
214
- __privateAdd(this, _reflectToTextArea);
21
+ this.removable = false;
22
+ this.disabled = false;
23
+ this.selectable = false;
24
+ this.selected = false;
25
+ this.#select = () => {
26
+ if (!this.selectable || this.disabled) {
27
+ return;
28
+ }
29
+ this.selected = !this.selected;
30
+ this.$emit("selected-change");
31
+ };
32
+ }
33
+ remove() {
34
+ if (!this.removable || this.selectable) {
35
+ return;
36
+ }
37
+ this.$emit("removed");
38
+ this.parentElement && this.parentElement.removeChild(this);
215
39
  }
216
- connectedCallback() {
217
- super.connectedCallback();
218
- __privateSet(this, _reflectToTextArea, new Reflector(this, this.control));
219
- __privateGet(this, _reflectToTextArea).property("value", "value", true);
40
+ #select;
41
+ handleKeydown(e) {
42
+ if (e.key === "Enter") {
43
+ this.#select();
44
+ }
45
+ if (e.key === "Delete" || e.key === "Backspace") {
46
+ this.remove();
47
+ }
48
+ return true;
220
49
  }
221
- disconnectedCallback() {
222
- super.disconnectedCallback();
223
- __privateGet(this, _reflectToTextArea).destroy();
50
+ handleClick() {
51
+ this.#select();
224
52
  }
225
- };
226
- _reflectToTextArea = new WeakMap();
53
+ }
227
54
  __decorateClass([
228
55
  attr
229
- ], TextArea.prototype, "wrap", 2);
230
- TextArea = __decorateClass([
231
- errorText,
232
- formElements
233
- ], TextArea);
234
- applyMixinsWithObservables(
235
- TextArea,
236
- FormElementCharCount,
237
- FormElementHelperText,
238
- FormElementSuccessText
239
- );
56
+ ], Tag.prototype, "connotation");
57
+ __decorateClass([
58
+ attr
59
+ ], Tag.prototype, "shape");
60
+ __decorateClass([
61
+ attr
62
+ ], Tag.prototype, "appearance");
63
+ __decorateClass([
64
+ attr
65
+ ], Tag.prototype, "label");
66
+ __decorateClass([
67
+ attr({ mode: "boolean" })
68
+ ], Tag.prototype, "removable");
69
+ __decorateClass([
70
+ attr({ mode: "boolean" })
71
+ ], Tag.prototype, "disabled");
72
+ __decorateClass([
73
+ attr({ mode: "boolean" })
74
+ ], Tag.prototype, "selectable");
75
+ __decorateClass([
76
+ attr({ mode: "boolean" })
77
+ ], Tag.prototype, "selected");
78
+ applyMixins(Tag, AffixIcon);
79
+
80
+ const styles = ".base.connotation-cta{--_connotation-color-contrast: var(--vvd-tag-cta-contrast, var(--vvd-color-cta-800));--_connotation-color-soft: var(--vvd-tag-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-tag-cta-pale, var(--vvd-color-cta-300));--_connotation-color-fierce: var(--vvd-tag-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-firm-all: var(--vvd-tag-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-tag-cta-faint, var(--vvd-color-cta-50));--_connotation-color-dim: var(--vvd-tag-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-contrast: var(--vvd-tag-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-soft: var(--vvd-tag-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-tag-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-tag-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-firm-all: var(--vvd-tag-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-faint: var(--vvd-tag-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-dim: var(--vvd-tag-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.base:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base:where(.active,:active):where(:not(.disabled,:disabled)).appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled).appearance-duotone{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-100)}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-pale);--_appearance-color-outline: transparent}.base:where(.selected):where(:not(.disabled,:disabled)).appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: var(--_connotation-color-pale)}.base{--tag-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;position:relative;display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);block-size:var(--tag-block-size);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);column-gap:8px;font:var(--vvd-typography-base-bold);max-inline-size:100%;padding-inline:8px;vertical-align:middle}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.base: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))}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{cursor:not-allowed;pointer-events:none}.base.removable{cursor:auto}.label{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}slot[name=icon]{font-size:calc(var(--tag-block-size) / 1.5);line-height:1}.dismiss-button{display:flex;align-items:center;border-radius:inherit;background-color:var(--_appearance-color-fill);cursor:pointer}";
240
81
 
241
82
  const getClasses = ({
242
- value,
243
- errorValidationMessage,
83
+ connotation,
84
+ appearance,
85
+ shape,
244
86
  disabled,
245
- placeholder,
246
- readOnly,
247
- successText
87
+ selectable,
88
+ removable,
89
+ selected
248
90
  }) => classNames(
249
91
  "base",
250
- ["readonly", readOnly],
251
- ["placeholder", Boolean(placeholder)],
252
92
  ["disabled", disabled],
253
- ["error", Boolean(errorValidationMessage)],
254
- ["has-value", Boolean(value)],
255
- ["success", !!successText]
93
+ ["selectable", selectable],
94
+ ["selected", selectable && selected],
95
+ ["removable", removable && !selectable],
96
+ [`connotation-${connotation}`, Boolean(connotation)],
97
+ [`appearance-${appearance}`, Boolean(appearance)],
98
+ [`shape-${shape}`, Boolean(shape)]
256
99
  );
257
- function renderLabel() {
258
- return html` <label for="control" class="label">
259
- ${(x) => x.label}
260
- </label>`;
261
- }
262
- function renderCharCount() {
100
+ function renderDismissButton(iconTag) {
263
101
  return html`
264
- <span class="char-count"
265
- >${(x) => x.value ? x.value.length : 0} / ${(x) => x.maxlength}</span
266
- >
267
- `;
102
+ <span
103
+ aria-hidden="true"
104
+ class="dismiss-button"
105
+ @click="${(x) => x.remove()}">
106
+ <${iconTag} name="close-line"></${iconTag}>
107
+ </span>`;
268
108
  }
269
- const TextAreaTemplate = (context) => {
270
- return html`
271
- <div class="${getClasses}">
272
- ${when((x) => x.charCount && x.maxlength, renderCharCount())}
273
- ${when((x) => x.label, renderLabel())}
274
- <textarea
275
- class="control"
276
- id="control"
277
- ?autofocus="${(x) => x.autofocus}"
278
- placeholder="${(x) => x.placeholder ? x.placeholder : null}"
279
- name="${(x) => x.name ? x.name : null}"
280
- minlength="${(x) => x.minlength ? x.minlength : null}"
281
- maxlength="${(x) => x.maxlength ? x.maxlength : null}"
282
- rows="${(x) => x.rows ? x.rows : null}"
283
- cols="${(x) => x.cols ? x.cols : null}"
284
- wrap="${(x) => x.wrap ? x.wrap : null}"
285
- ?readonly="${(x) => x.readOnly}"
286
- ?disabled="${(x) => x.disabled}"
287
- ?required="${(x) => x.required}"
288
- ?spellcheck="${(x) => x.spellcheck}"
289
- aria-atomic="${(x) => x.ariaAtomic}"
290
- aria-busy="${(x) => x.ariaBusy}"
291
- aria-current="${(x) => x.ariaCurrent}"
292
- aria-details="${(x) => x.ariaDetails}"
293
- aria-disabled="${(x) => x.ariaDisabled}"
294
- aria-errormessage="${(x) => x.ariaErrormessage}"
295
- aria-haspopup="${(x) => x.ariaHaspopup}"
296
- aria-hidden="${(x) => x.ariaHidden}"
297
- aria-invalid="${(x) => x.ariaInvalid}"
298
- aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
299
- aria-label="${(x) => x.ariaLabel}"
300
- aria-live="${(x) => x.ariaLive}"
301
- aria-relevant="${(x) => x.ariaRelevant}"
302
- aria-roledescription="${(x) => x.ariaRoledescription}"
303
- @input="${(x) => x.handleTextInput()}"
304
- @change="${(x) => x.handleChange()}"
305
- ${ref("control")}
306
- >
307
- </textarea>
308
- ${getFeedbackTemplate(context)}
309
- </div>
310
- `;
109
+ const tagTemplate = (context) => {
110
+ const affixIconTemplate = affixIconTemplateFactory(context);
111
+ const iconTag = context.tagFor(Icon);
112
+ return html` <span
113
+ class="${getClasses}"
114
+ role="option"
115
+ aria-disabled="${(x) => x.disabled}"
116
+ aria-selected="${(x) => x.selectable}"
117
+ tabindex="${(x) => x.disabled ? null : 0}"
118
+ @keydown="${(x, c) => x.handleKeydown(c.event)}"
119
+ @click="${(x) => x.handleClick()}"
120
+ >
121
+ ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
122
+ ${when(
123
+ (x) => x.label,
124
+ (x) => html`<span class="label">${x.label}</span>`
125
+ )}
126
+ ${when((x) => x.removable && !x.selectable, renderDismissButton(iconTag))}
127
+ ${when(
128
+ (x) => x.selectable && x.selected,
129
+ html`<${iconTag} class="selectable-icon" name="check-circle-solid"></${iconTag}>`
130
+ )}
131
+ </span>`;
311
132
  };
312
133
 
313
- const textAreaDefinition = TextArea.compose(
314
- {
315
- baseName: "text-area",
316
- template: TextAreaTemplate,
317
- styles,
318
- shadowOptions: {
319
- delegatesFocus: true
320
- }
134
+ const tagDefinition = Tag.compose({
135
+ baseName: "tag",
136
+ template: tagTemplate,
137
+ styles,
138
+ shadowOptions: {
139
+ delegatesFocus: true
321
140
  }
322
- );
323
- const textAreaRegistries = [textAreaDefinition(), ...iconRegistries];
324
- const registerTextArea = registerFactory(textAreaRegistries);
141
+ });
142
+ const tagRegistries = [tagDefinition(), ...iconRegistries];
143
+ const registerTag = registerFactory(tagRegistries);
325
144
 
326
- export { textAreaRegistries as a, registerTextArea as r, textAreaDefinition as t };
145
+ export { tagRegistries as a, registerTag as r, tagDefinition as t };