@vonage/vivid 3.52.0 → 3.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +1 -1
  2. package/accordion/index.cjs +1 -1
  3. package/accordion/index.js +1 -1
  4. package/accordion-item/index.cjs +1 -1
  5. package/accordion-item/index.js +1 -1
  6. package/alert/index.cjs +3 -3
  7. package/alert/index.js +3 -3
  8. package/appearance-ui/index.cjs +1 -1
  9. package/appearance-ui/index.js +1 -1
  10. package/audio-player/index.cjs +3 -3
  11. package/audio-player/index.js +3 -3
  12. package/avatar/index.cjs +1 -1
  13. package/avatar/index.js +1 -1
  14. package/badge/index.cjs +1 -1
  15. package/badge/index.js +1 -1
  16. package/banner/index.cjs +2 -2
  17. package/banner/index.js +2 -2
  18. package/breadcrumb-item/index.cjs +1 -1
  19. package/breadcrumb-item/index.js +1 -1
  20. package/button/index.cjs +2 -2
  21. package/button/index.js +2 -2
  22. package/card/index.cjs +2 -2
  23. package/card/index.js +2 -2
  24. package/checkbox/index.cjs +3 -2
  25. package/checkbox/index.js +3 -2
  26. package/combobox/index.cjs +5 -5
  27. package/combobox/index.js +5 -5
  28. package/custom-elements.json +1162 -99
  29. package/data-grid/index.cjs +1 -1
  30. package/data-grid/index.js +1 -1
  31. package/date-picker/index.cjs +7 -6
  32. package/date-picker/index.js +7 -6
  33. package/date-range-picker/index.cjs +7 -6
  34. package/date-range-picker/index.js +7 -6
  35. package/dial-pad/index.cjs +33 -0
  36. package/dial-pad/index.js +31 -0
  37. package/dialog/index.cjs +4 -4
  38. package/dialog/index.js +4 -4
  39. package/divider/index.cjs +1 -1
  40. package/divider/index.js +1 -1
  41. package/elevation/index.cjs +1 -1
  42. package/elevation/index.js +1 -1
  43. package/empty-state/index.cjs +2 -2
  44. package/empty-state/index.js +2 -2
  45. package/fab/index.cjs +2 -2
  46. package/fab/index.js +2 -2
  47. package/file-picker/index.cjs +4 -3
  48. package/file-picker/index.js +4 -3
  49. package/header/index.cjs +2 -2
  50. package/header/index.js +2 -2
  51. package/icon/index.cjs +1 -1
  52. package/icon/index.js +1 -1
  53. package/index.cjs +132 -122
  54. package/index.js +46 -43
  55. package/layout/index.cjs +1 -1
  56. package/layout/index.js +1 -1
  57. package/lib/appearance-ui/appearance-ui.d.ts +1 -1
  58. package/lib/audio-player/audio-player.d.ts +4 -0
  59. package/lib/audio-player/locale.d.ts +2 -0
  60. package/lib/components.d.ts +2 -0
  61. package/lib/dial-pad/definition.d.ts +3 -0
  62. package/lib/dial-pad/dial-pad.d.ts +17 -0
  63. package/lib/dial-pad/dial-pad.template.d.ts +4 -0
  64. package/lib/dial-pad/locale.d.ts +18 -0
  65. package/lib/enums.d.ts +7 -0
  66. package/lib/menu/menu.d.ts +1 -0
  67. package/lib/nav-disclosure/nav-disclosure.d.ts +5 -0
  68. package/lib/text-anchor/definition.d.ts +1 -0
  69. package/lib/text-anchor/text-anchor.d.ts +5 -0
  70. package/lib/video-player/definition.d.ts +3 -0
  71. package/lib/video-player/locale.d.ts +1 -0
  72. package/lib/video-player/video-player.d.ts +17 -0
  73. package/lib/video-player/video-player.template.d.ts +4 -0
  74. package/lib/video-player/vivid-video-svg.d.ts +1 -0
  75. package/listbox/index.cjs +2 -2
  76. package/listbox/index.js +2 -2
  77. package/locales/en-GB.cjs +33 -1
  78. package/locales/en-GB.js +33 -1
  79. package/locales/en-US.cjs +201 -1
  80. package/locales/en-US.js +201 -1
  81. package/locales/ja-JP.cjs +200 -1
  82. package/locales/ja-JP.js +200 -1
  83. package/locales/zh-CN.cjs +202 -1
  84. package/locales/zh-CN.js +202 -1
  85. package/menu/index.cjs +6 -6
  86. package/menu/index.js +6 -6
  87. package/menu-item/index.cjs +2 -2
  88. package/menu-item/index.js +2 -2
  89. package/nav/index.cjs +1 -1
  90. package/nav/index.js +1 -1
  91. package/nav-disclosure/index.cjs +2 -2
  92. package/nav-disclosure/index.js +2 -2
  93. package/nav-item/index.cjs +2 -2
  94. package/nav-item/index.js +2 -2
  95. package/note/index.cjs +2 -2
  96. package/note/index.js +2 -2
  97. package/number-field/index.cjs +5 -4
  98. package/number-field/index.js +5 -4
  99. package/option/index.cjs +2 -2
  100. package/option/index.js +2 -2
  101. package/package.json +1 -1
  102. package/pagination/index.cjs +3 -3
  103. package/pagination/index.js +3 -3
  104. package/popup/index.cjs +4 -4
  105. package/popup/index.js +4 -4
  106. package/progress/index.cjs +1 -1
  107. package/progress/index.js +1 -1
  108. package/progress-ring/index.cjs +1 -1
  109. package/progress-ring/index.js +1 -1
  110. package/radio/index.cjs +1 -1
  111. package/radio/index.js +1 -1
  112. package/radio-group/index.cjs +1 -1
  113. package/radio-group/index.js +1 -1
  114. package/range-slider/index.cjs +2 -2
  115. package/range-slider/index.js +2 -2
  116. package/select/index.cjs +7 -6
  117. package/select/index.js +7 -6
  118. package/selectable-box/index.cjs +5 -4
  119. package/selectable-box/index.js +5 -4
  120. package/shared/applyMixinsWithObservables.cjs +15 -0
  121. package/shared/applyMixinsWithObservables.js +13 -0
  122. package/shared/definition.cjs +1 -1
  123. package/shared/definition.js +1 -1
  124. package/shared/definition11.cjs +3 -3
  125. package/shared/definition11.js +3 -3
  126. package/shared/definition14.cjs +2 -2
  127. package/shared/definition14.js +2 -2
  128. package/shared/definition15.cjs +8 -9
  129. package/shared/definition15.js +8 -9
  130. package/shared/definition16.cjs +3 -3
  131. package/shared/definition16.js +3 -3
  132. package/shared/definition17.cjs +2 -2
  133. package/shared/definition17.js +3 -3
  134. package/shared/definition18.cjs +3 -3
  135. package/shared/definition18.js +3 -3
  136. package/shared/definition19.cjs +3 -3
  137. package/shared/definition19.js +3 -3
  138. package/shared/definition20.cjs +196 -224
  139. package/shared/definition20.js +191 -219
  140. package/shared/definition21.cjs +264 -67
  141. package/shared/definition21.js +263 -65
  142. package/shared/definition22.cjs +66 -57
  143. package/shared/definition22.js +64 -56
  144. package/shared/definition23.cjs +42 -76
  145. package/shared/definition23.js +41 -75
  146. package/shared/definition24.cjs +70 -2402
  147. package/shared/definition24.js +69 -2401
  148. package/shared/definition25.cjs +2402 -46
  149. package/shared/definition25.js +2401 -45
  150. package/shared/definition26.cjs +63 -30
  151. package/shared/definition26.js +62 -29
  152. package/shared/definition27.cjs +28 -56
  153. package/shared/definition27.js +27 -55
  154. package/shared/definition28.cjs +35 -881
  155. package/shared/definition28.js +34 -879
  156. package/shared/definition29.cjs +922 -60
  157. package/shared/definition29.js +922 -61
  158. package/shared/definition30.cjs +68 -86
  159. package/shared/definition30.js +67 -85
  160. package/shared/definition31.cjs +98 -21
  161. package/shared/definition31.js +98 -21
  162. package/shared/definition32.cjs +24 -12
  163. package/shared/definition32.js +23 -11
  164. package/shared/definition33.cjs +11 -50
  165. package/shared/definition33.js +10 -49
  166. package/shared/definition34.cjs +26 -515
  167. package/shared/definition34.js +26 -515
  168. package/shared/definition35.cjs +448 -194
  169. package/shared/definition35.js +448 -192
  170. package/shared/definition36.cjs +256 -202
  171. package/shared/definition36.js +253 -201
  172. package/shared/definition37.cjs +204 -65
  173. package/shared/definition37.js +203 -63
  174. package/shared/definition38.cjs +63 -57
  175. package/shared/definition38.js +60 -55
  176. package/shared/definition39.cjs +65 -432
  177. package/shared/definition39.js +64 -431
  178. package/shared/definition4.cjs +2 -2
  179. package/shared/definition4.js +2 -2
  180. package/shared/definition40.cjs +441 -34
  181. package/shared/definition40.js +438 -31
  182. package/shared/definition41.cjs +34 -576
  183. package/shared/definition41.js +33 -575
  184. package/shared/definition42.cjs +531 -654
  185. package/shared/definition42.js +531 -654
  186. package/shared/definition43.cjs +690 -114
  187. package/shared/definition43.js +689 -113
  188. package/shared/definition44.cjs +124 -79
  189. package/shared/definition44.js +122 -77
  190. package/shared/definition45.cjs +78 -520
  191. package/shared/definition45.js +77 -518
  192. package/shared/definition46.cjs +520 -119
  193. package/shared/definition46.js +518 -118
  194. package/shared/definition47.cjs +118 -135
  195. package/shared/definition47.js +117 -134
  196. package/shared/definition48.cjs +151 -19
  197. package/shared/definition48.js +150 -18
  198. package/shared/definition49.cjs +21 -84
  199. package/shared/definition49.js +20 -83
  200. package/shared/definition5.cjs +100 -19
  201. package/shared/definition5.js +100 -19
  202. package/shared/definition50.cjs +52 -505
  203. package/shared/definition50.js +51 -504
  204. package/shared/definition51.cjs +526 -28
  205. package/shared/definition51.js +525 -27
  206. package/shared/definition52.cjs +28 -123
  207. package/shared/definition52.js +26 -122
  208. package/shared/definition53.cjs +110 -309
  209. package/shared/definition53.js +110 -308
  210. package/shared/definition54.cjs +255 -271
  211. package/shared/definition54.js +255 -271
  212. package/shared/definition55.cjs +315 -776
  213. package/shared/definition55.js +314 -775
  214. package/shared/definition56.cjs +818 -107
  215. package/shared/definition56.js +817 -106
  216. package/shared/definition57.cjs +85 -55
  217. package/shared/definition57.js +84 -54
  218. package/shared/definition58.cjs +125 -72
  219. package/shared/definition58.js +124 -71
  220. package/shared/definition59.cjs +72 -285
  221. package/shared/definition59.js +73 -286
  222. package/shared/definition6.cjs +1 -1
  223. package/shared/definition6.js +1 -1
  224. package/shared/definition60.cjs +298 -39
  225. package/shared/definition60.js +297 -38
  226. package/shared/definition61.cjs +66044 -1687
  227. package/shared/definition61.js +66043 -1686
  228. package/shared/definition62.cjs +50 -0
  229. package/shared/definition62.js +46 -0
  230. package/shared/definition63.cjs +1828 -0
  231. package/shared/definition63.js +1824 -0
  232. package/shared/definition7.cjs +2 -2
  233. package/shared/definition7.js +2 -2
  234. package/shared/definition8.cjs +2 -2
  235. package/shared/definition8.js +2 -2
  236. package/shared/definition9.cjs +1 -1
  237. package/shared/definition9.js +1 -1
  238. package/shared/enums.cjs +9 -0
  239. package/shared/enums.js +9 -1
  240. package/shared/icon.cjs +20 -2
  241. package/shared/icon.js +21 -3
  242. package/shared/index2.cjs +73 -37
  243. package/shared/index2.js +73 -37
  244. package/shared/key-codes2.js +1 -1
  245. package/shared/listbox.cjs +1 -1
  246. package/shared/listbox.js +1 -1
  247. package/shared/localization/Locale.d.ts +4 -0
  248. package/shared/patterns/form-elements/form-elements.d.ts +2 -3
  249. package/shared/presentationDate.cjs +16 -5
  250. package/shared/presentationDate.js +16 -5
  251. package/shared/text-anchor.cjs +6 -0
  252. package/shared/text-anchor.js +6 -0
  253. package/shared/text-anchor.template.cjs +6 -1
  254. package/shared/text-anchor.template.js +6 -1
  255. package/shared/text-field.cjs +1 -1
  256. package/shared/text-field.js +1 -1
  257. package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
  258. package/shared/utils/numberConverter.d.ts +2 -0
  259. package/side-drawer/index.cjs +1 -1
  260. package/side-drawer/index.js +1 -1
  261. package/slider/index.cjs +1 -1
  262. package/slider/index.js +1 -1
  263. package/split-button/index.cjs +2 -2
  264. package/split-button/index.js +2 -2
  265. package/styles/core/all.css +1 -1
  266. package/styles/core/theme.css +1 -1
  267. package/styles/core/typography.css +1 -1
  268. package/styles/tokens/theme-dark.css +4 -4
  269. package/styles/tokens/theme-light.css +4 -4
  270. package/styles/tokens/vivid-2-compat.css +1 -1
  271. package/switch/index.cjs +2 -2
  272. package/switch/index.js +2 -2
  273. package/tab/index.cjs +2 -2
  274. package/tab/index.js +2 -2
  275. package/tab-panel/index.cjs +1 -1
  276. package/tab-panel/index.js +1 -1
  277. package/tabs/index.cjs +4 -4
  278. package/tabs/index.js +4 -4
  279. package/tag/index.cjs +2 -2
  280. package/tag/index.js +2 -2
  281. package/tag-group/index.cjs +1 -1
  282. package/tag-group/index.js +1 -1
  283. package/text-area/index.cjs +4 -3
  284. package/text-area/index.js +4 -3
  285. package/text-field/index.cjs +4 -3
  286. package/text-field/index.js +4 -3
  287. package/time-picker/index.cjs +8 -7
  288. package/time-picker/index.js +8 -7
  289. package/toggletip/index.cjs +5 -5
  290. package/toggletip/index.js +5 -5
  291. package/tooltip/index.cjs +5 -5
  292. package/tooltip/index.js +5 -5
  293. package/tree-item/index.cjs +2 -2
  294. package/tree-item/index.js +2 -2
  295. package/tree-view/index.cjs +1 -1
  296. package/tree-view/index.js +1 -1
  297. package/video-player/index.cjs +17 -0
  298. package/video-player/index.js +15 -0
  299. package/vivid.api.json +332 -0
@@ -1,316 +1,12 @@
1
- import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, h as html, r as registerFactory } from './index.js';
2
- import { B as Button, a as buttonRegistries } from './definition11.js';
3
- import { D as Divider, a as dividerRegistries } from './definition21.js';
4
- import { A as AffixIcon } from './affix.js';
5
- import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './index2.js';
6
- import { L as Localized } from './localized.js';
7
- import { S as StartEnd } from './start-end.js';
1
+ import { F as FoundationElement, a as attr, h as html, r as registerFactory } from './index.js';
2
+ import { a as iconRegistries } from './definition27.js';
3
+ import { A as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
4
+ import './index2.js';
8
5
  import { a as applyMixins } from './apply-mixins.js';
9
- import { D as DelegatesARIATextbox } from './text-field2.js';
10
- import { F as FormAssociated } from './form-associated.js';
11
- import { f as keyArrowDown, e as keyArrowUp } from './key-codes.js';
12
- import { S as Shape } from './enums.js';
13
6
  import { w as when } from './when.js';
14
- import { r as ref } from './ref.js';
15
7
  import { c as classNames } from './class-names.js';
16
8
 
17
- class _NumberField extends FoundationElement {
18
- }
19
- /**
20
- * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
21
- *
22
- * @internal
23
- */
24
- class FormAssociatedNumberField extends FormAssociated(_NumberField) {
25
- constructor() {
26
- super(...arguments);
27
- this.proxy = document.createElement("input");
28
- }
29
- }
30
-
31
- /**
32
- * A Number Field Custom HTML Element.
33
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
34
- *
35
- * @slot start - Content which can be provided before the number field input
36
- * @slot end - Content which can be provided after the number field input
37
- * @slot - The default slot for the label
38
- * @slot step-up-glyph - The glyph for the step up control
39
- * @slot step-down-glyph - The glyph for the step down control
40
- * @csspart label - The label
41
- * @csspart root - The element wrapping the control, including start and end slots
42
- * @csspart control - The element representing the input
43
- * @csspart controls - The step up and step down controls
44
- * @csspart step-up - The step up control
45
- * @csspart step-down - The step down control
46
- * @fires input - Fires a custom 'input' event when the value has changed
47
- * @fires change - Fires a custom 'change' event when the value has changed
48
- *
49
- * @public
50
- */
51
- let NumberField$1 = class NumberField extends FormAssociatedNumberField {
52
- constructor() {
53
- super(...arguments);
54
- /**
55
- * When true, spin buttons will not be rendered
56
- * @public
57
- * @remarks
58
- * HTML Attribute: autofocus
59
- */
60
- this.hideStep = false;
61
- /**
62
- * Amount to increment or decrement the value by
63
- * @public
64
- * @remarks
65
- * HTMLAttribute: step
66
- */
67
- this.step = 1;
68
- /**
69
- * Flag to indicate that the value change is from the user input
70
- * @internal
71
- */
72
- this.isUserInput = false;
73
- }
74
- /**
75
- * Ensures that the max is greater than the min and that the value
76
- * is less than the max
77
- * @param previous - the previous max value
78
- * @param next - updated max value
79
- *
80
- * @internal
81
- */
82
- maxChanged(previous, next) {
83
- var _a;
84
- this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
85
- const min = Math.min(this.min, this.max);
86
- if (this.min !== undefined && this.min !== min) {
87
- this.min = min;
88
- }
89
- this.value = this.getValidValue(this.value);
90
- }
91
- /**
92
- * Ensures that the min is less than the max and that the value
93
- * is greater than the min
94
- * @param previous - previous min value
95
- * @param next - updated min value
96
- *
97
- * @internal
98
- */
99
- minChanged(previous, next) {
100
- var _a;
101
- this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
102
- const max = Math.max(this.min, this.max);
103
- if (this.max !== undefined && this.max !== max) {
104
- this.max = max;
105
- }
106
- this.value = this.getValidValue(this.value);
107
- }
108
- /**
109
- * The value property, typed as a number.
110
- *
111
- * @public
112
- */
113
- get valueAsNumber() {
114
- return parseFloat(super.value);
115
- }
116
- set valueAsNumber(next) {
117
- this.value = next.toString();
118
- }
119
- /**
120
- * Validates that the value is a number between the min and max
121
- * @param previous - previous stored value
122
- * @param next - value being updated
123
- * @param updateControl - should the text field be updated with value, defaults to true
124
- * @internal
125
- */
126
- valueChanged(previous, next) {
127
- this.value = this.getValidValue(next);
128
- if (next !== this.value) {
129
- return;
130
- }
131
- if (this.control && !this.isUserInput) {
132
- this.control.value = this.value;
133
- }
134
- super.valueChanged(previous, this.value);
135
- if (previous !== undefined && !this.isUserInput) {
136
- this.$emit("input");
137
- this.$emit("change");
138
- }
139
- this.isUserInput = false;
140
- }
141
- /** {@inheritDoc (FormAssociated:interface).validate} */
142
- validate() {
143
- super.validate(this.control);
144
- }
145
- /**
146
- * Sets the internal value to a valid number between the min and max properties
147
- * @param value - user input
148
- *
149
- * @internal
150
- */
151
- getValidValue(value) {
152
- var _a, _b;
153
- let validValue = parseFloat(parseFloat(value).toPrecision(12));
154
- if (isNaN(validValue)) {
155
- validValue = "";
156
- }
157
- else {
158
- validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
159
- validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
160
- }
161
- return validValue;
162
- }
163
- /**
164
- * Increments the value using the step value
165
- *
166
- * @public
167
- */
168
- stepUp() {
169
- const value = parseFloat(this.value);
170
- const stepUpValue = !isNaN(value)
171
- ? value + this.step
172
- : this.min > 0
173
- ? this.min
174
- : this.max < 0
175
- ? this.max
176
- : !this.min
177
- ? this.step
178
- : 0;
179
- this.value = stepUpValue.toString();
180
- }
181
- /**
182
- * Decrements the value using the step value
183
- *
184
- * @public
185
- */
186
- stepDown() {
187
- const value = parseFloat(this.value);
188
- const stepDownValue = !isNaN(value)
189
- ? value - this.step
190
- : this.min > 0
191
- ? this.min
192
- : this.max < 0
193
- ? this.max
194
- : !this.min
195
- ? 0 - this.step
196
- : 0;
197
- this.value = stepDownValue.toString();
198
- }
199
- /**
200
- * Sets up the initial state of the number field
201
- * @internal
202
- */
203
- connectedCallback() {
204
- super.connectedCallback();
205
- this.proxy.setAttribute("type", "number");
206
- this.validate();
207
- this.control.value = this.value;
208
- if (this.autofocus) {
209
- DOM.queueUpdate(() => {
210
- this.focus();
211
- });
212
- }
213
- }
214
- /**
215
- * Selects all the text in the number field
216
- *
217
- * @public
218
- */
219
- select() {
220
- this.control.select();
221
- /**
222
- * The select event does not permeate the shadow DOM boundary.
223
- * This fn effectively proxies the select event,
224
- * emitting a `select` event whenever the internal
225
- * control emits a `select` event
226
- */
227
- this.$emit("select");
228
- }
229
- /**
230
- * Handles the internal control's `input` event
231
- * @internal
232
- */
233
- handleTextInput() {
234
- this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
235
- this.isUserInput = true;
236
- this.value = this.control.value;
237
- }
238
- /**
239
- * Change event handler for inner control.
240
- * @remarks
241
- * "Change" events are not `composable` so they will not
242
- * permeate the shadow DOM boundary. This fn effectively proxies
243
- * the change event, emitting a `change` event whenever the internal
244
- * control emits a `change` event
245
- * @internal
246
- */
247
- handleChange() {
248
- this.$emit("change");
249
- }
250
- /**
251
- * Handles the internal control's `keydown` event
252
- * @internal
253
- */
254
- handleKeyDown(e) {
255
- const key = e.key;
256
- switch (key) {
257
- case keyArrowUp:
258
- this.stepUp();
259
- return false;
260
- case keyArrowDown:
261
- this.stepDown();
262
- return false;
263
- }
264
- return true;
265
- }
266
- /**
267
- * Handles populating the input field with a validated value when
268
- * leaving the input field.
269
- * @internal
270
- */
271
- handleBlur() {
272
- this.control.value = this.value;
273
- }
274
- };
275
- __decorate([
276
- attr({ attribute: "readonly", mode: "boolean" })
277
- ], NumberField$1.prototype, "readOnly", void 0);
278
- __decorate([
279
- attr({ mode: "boolean" })
280
- ], NumberField$1.prototype, "autofocus", void 0);
281
- __decorate([
282
- attr({ attribute: "hide-step", mode: "boolean" })
283
- ], NumberField$1.prototype, "hideStep", void 0);
284
- __decorate([
285
- attr
286
- ], NumberField$1.prototype, "placeholder", void 0);
287
- __decorate([
288
- attr
289
- ], NumberField$1.prototype, "list", void 0);
290
- __decorate([
291
- attr({ converter: nullableNumberConverter })
292
- ], NumberField$1.prototype, "maxlength", void 0);
293
- __decorate([
294
- attr({ converter: nullableNumberConverter })
295
- ], NumberField$1.prototype, "minlength", void 0);
296
- __decorate([
297
- attr({ converter: nullableNumberConverter })
298
- ], NumberField$1.prototype, "size", void 0);
299
- __decorate([
300
- attr({ converter: nullableNumberConverter })
301
- ], NumberField$1.prototype, "step", void 0);
302
- __decorate([
303
- attr({ converter: nullableNumberConverter })
304
- ], NumberField$1.prototype, "max", void 0);
305
- __decorate([
306
- attr({ converter: nullableNumberConverter })
307
- ], NumberField$1.prototype, "min", void 0);
308
- __decorate([
309
- observable
310
- ], NumberField$1.prototype, "defaultSlottedNodes", void 0);
311
- applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
312
-
313
- const styles = ":host{display:inline-block}.base{--_text-field-gutter-start:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4);--_text-field-gutter-end:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4);--_text-field-icon-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2);display:inline-grid;width:100%;gap:4px;grid-template-columns:min-content 1fr max-content}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base{--_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-text-field-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-field-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-text-field-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-text-field-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)}.label:not(slot),.label::slotted(label){box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important;contain:inline-size!important;font:var(--vvd-typography-base);grid-column:1/4;grid-row:1}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base);grid-column:3/4}.fieldset{position:relative;display:flex;align-items:center;background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;padding-block:0;transition:color .2s,background-color .2s}.fieldset:after{position:absolute;display:block;border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";inline-size:100%;pointer-events:none;transition:box-shadow .2s}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:not(.shape-pill) .fieldset{border-radius:8px}.base.shape-pill .fieldset{border-radius:24px}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit}.control:not(slot),.control::slotted(input){width:100%!important;box-sizing:border-box!important;border:0 none!important;border-radius:inherit!important;margin:initial!important;appearance:none!important;background-color:transparent!important;block-size:100%!important;color:inherit!important;font:inherit;outline:transparent;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{position:absolute;z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));line-height:1;transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.fieldset:has(.wrapper .control:focus-within):after{--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 not selector(:has(*)){.wrapper:focus-within:after{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));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0}}.base{--_text-field-gutter-end: 70px}.control::-webkit-outer-spin-button,.control::-webkit-inner-spin-button{appearance:none}.control-buttons{position:absolute;z-index:1;right:3px;display:flex}.readonly .control-buttons,.disabled .control-buttons{pointer-events:none}.control-buttons .divider{margin-block:8px}.control-buttons>*{flex-shrink:0}\n";
9
+ const styles = ".base{display:flex;align-items:flex-start;padding:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--vvd-color-canvas-text);column-gap:16px}.base.connotation-success{--_connotation-color-intermediate: var(--vvd-note-success-intermediate, var(--vvd-color-success-500));--_connotation-color-faint: var(--vvd-note-success-faint, var(--vvd-color-success-50));--_connotation-color-fierce: var(--vvd-note-success-fierce, var(--vvd-color-success-700))}.base.connotation-information{--_connotation-color-intermediate: var(--vvd-note-information-intermediate, var(--vvd-color-information-500));--_connotation-color-faint: var(--vvd-note-information-faint, var(--vvd-color-information-50));--_connotation-color-fierce: var(--vvd-note-information-fierce, var(--vvd-color-information-700))}.base.connotation-alert{--_connotation-color-intermediate: var(--vvd-note-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-faint: var(--vvd-note-alert-faint, var(--vvd-color-alert-50));--_connotation-color-fierce: var(--vvd-note-alert-fierce, var(--vvd-color-alert-700))}.base.connotation-warning{--_connotation-color-intermediate: var(--vvd-note-warning-intermediate, var(--vvd-color-warning-300));--_connotation-color-faint: var(--vvd-note-warning-faint, var(--vvd-color-warning-50));--_connotation-color-fierce: var(--vvd-note-warning-fierce, var(--vvd-color-warning-700))}.base:not(.connotation-success,.connotation-information,.connotation-alert,.connotation-warning){--_connotation-color-intermediate: var(--vvd-note-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-note-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-fierce: var(--vvd-note-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--_connotation-color-fierce);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-intermediate)}@supports (contain: content){.base{contain:content}}@supports not (contain: content){.base{overflow:hidden}}slot[name=icon]{color:var(--_appearance-color-outline);font-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.text{display:flex;min-height:24px;flex-direction:column;flex-grow:1;align-items:flex-start;justify-content:center;gap:4px;text-align:start}.text .headline{font:var(--vvd-typography-base-bold)}.text .message{font:var(--vvd-typography-base)}\n";
314
10
 
315
11
  var __defProp = Object.defineProperty;
316
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -323,224 +19,39 @@ var __decorateClass = (decorators, target, key, kind) => {
323
19
  __defProp(target, key, result);
324
20
  return result;
325
21
  };
326
- const STEP_DIRECTION = {
327
- up: 1,
328
- down: -1
329
- };
330
- const PROXY_REFLECTED_ATTRIBUTES = {
331
- max: true,
332
- min: true
333
- };
334
- function makeStep(element, direction) {
335
- const value = parseFloat(element.value);
336
- const stepUpValue = !isNaN(value) ? value + direction * element.step : element.min > 0 ? element.min : element.max < 0 ? element.max : !element.min ? direction * element.step : 0;
337
- element.value = Number(stepUpValue.toFixed(12)).toString();
22
+ class Note extends FoundationElement {
338
23
  }
339
- let NumberField = class extends NumberField$1 {
340
- constructor() {
341
- super(...arguments);
342
- this.incrementButtonAriaLabel = null;
343
- this.decrementButtonAriaLabel = null;
344
- }
345
- stepChanged(_previous, next) {
346
- this.proxy.setAttribute(
347
- "step",
348
- Number.isFinite(next) ? next.toString() : ""
349
- );
350
- }
351
- attributeChangedCallback(name, previous, next) {
352
- super.attributeChangedCallback(name, previous, next);
353
- if (PROXY_REFLECTED_ATTRIBUTES[name]) {
354
- this.proxy.setAttribute(name, next);
355
- }
356
- }
357
- stepUp() {
358
- makeStep(this, STEP_DIRECTION.up);
359
- }
360
- stepDown() {
361
- makeStep(this, STEP_DIRECTION.down);
362
- }
363
- };
364
- __decorateClass([
365
- attr({ attribute: "increment-button-aria-label" })
366
- ], NumberField.prototype, "incrementButtonAriaLabel", 2);
367
- __decorateClass([
368
- attr({ attribute: "decrement-button-aria-label" })
369
- ], NumberField.prototype, "decrementButtonAriaLabel", 2);
370
- __decorateClass([
371
- attr
372
- ], NumberField.prototype, "appearance", 2);
373
24
  __decorateClass([
374
25
  attr
375
- ], NumberField.prototype, "shape", 2);
26
+ ], Note.prototype, "headline", 2);
376
27
  __decorateClass([
377
28
  attr
378
- ], NumberField.prototype, "autoComplete", 2);
379
- NumberField = __decorateClass([
380
- errorText,
381
- formElements
382
- ], NumberField);
383
- const numberInput = document.createElement("input");
384
- numberInput.type = "number";
385
- NumberField.prototype.getValidValue = function(value) {
386
- if (!this.isUserInput) {
387
- numberInput.value = value;
388
- return numberInput.value;
389
- }
390
- if (value === "" || value === "-" || value === ".") {
391
- return value;
392
- }
393
- const decimalSplit = value.split(".");
394
- let valueSuffix = "";
395
- if (decimalSplit.length === 2 && decimalSplit[1] === "") {
396
- valueSuffix = ".";
397
- numberInput.value = value.slice(0, -1);
398
- } else {
399
- numberInput.value = value;
400
- }
401
- if (numberInput.value === "") {
402
- return this.currentValue;
403
- }
404
- return numberInput.value + valueSuffix;
405
- };
406
- applyMixins(
407
- NumberField,
408
- Localized,
409
- AffixIcon,
410
- FormElementCharCount,
411
- FormElementHelperText,
412
- FormElementSuccessText
413
- );
29
+ ], Note.prototype, "connotation", 2);
30
+ applyMixins(Note, AffixIcon);
414
31
 
415
- const getStateClasses = ({
416
- errorValidationMessage,
417
- disabled,
418
- value,
419
- readOnly,
420
- placeholder,
421
- appearance,
422
- shape,
423
- label,
424
- successText
425
- }) => classNames(
426
- ["error", Boolean(errorValidationMessage)],
427
- ["disabled", disabled],
428
- ["has-value", Boolean(value)],
429
- ["readonly", readOnly],
430
- ["placeholder", Boolean(placeholder)],
431
- [`appearance-${appearance}`, Boolean(appearance)],
432
- [`shape-${shape}`, Boolean(shape)],
433
- ["no-label", !label],
434
- ["success", !!successText]
435
- );
436
- function renderLabel() {
437
- return html` <label for="control" class="label">
438
- ${(x) => x.label}
439
- </label>`;
440
- }
441
- function setControlButtonShape(numberField) {
442
- return numberField.shape === Shape.Pill ? Shape.Pill : null;
443
- }
444
- function getTabIndex(numberField) {
445
- return numberField.disabled || numberField.readOnly ? "-1" : null;
446
- }
447
- function numberControlButtons(context) {
448
- const buttonTag = context.tagFor(Button);
449
- const dividerTag = context.tagFor(Divider);
450
- return html`
451
- <div class="control-buttons"
452
- ?inert="${(x) => x.disabled || x.readOnly}">
453
- <${buttonTag} id="subtract" icon="minus-line"
454
- aria-label=${(x) => x.decrementButtonAriaLabel || x.locale.numberField.decrementButtonLabel}
455
- shape="${setControlButtonShape}"
456
- type="button"
457
- size="condensed"
458
- tabindex="${getTabIndex}"
459
- @click="${(x) => x.stepDown()}"></${buttonTag}>
460
- <${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
461
- <${buttonTag} id="add" icon="plus-line"
462
- aria-label=${(x) => x.incrementButtonAriaLabel || x.locale.numberField.incrementButtonLabel}
463
- shape="${setControlButtonShape}"
464
- type="button"
465
- size="condensed"
466
- tabindex="${getTabIndex}"
467
- @click="${(x) => x.stepUp()}"></${buttonTag}>
468
- </div>
469
- `;
32
+ const getClasses = ({ connotation }) => classNames("base", `connotation-${connotation}`);
33
+ function getHeaderTemplate() {
34
+ return html`<div class="headline">${(x) => x.headline}</div>`;
470
35
  }
471
- const NumberFieldTemplate = (context) => {
36
+ const NoteTemplate = (context) => {
37
+ const affixIconTemplate = affixIconTemplateFactory(context);
472
38
  return html`
473
- <div class="base ${getStateClasses}">
474
- ${when((x) => x.label, renderLabel())}
475
- <div class="fieldset">
476
- <div class="wrapper">
477
- <input
478
- class="control"
479
- id="control"
480
- @input="${(x) => x.handleTextInput()}"
481
- @change="${(x) => x.handleChange()}"
482
- ?autofocus="${(x) => x.autofocus}"
483
- ?disabled="${(x) => x.disabled}"
484
- list="${(x) => x.list}"
485
- step="${(x) => x.step ? x.step : null}"
486
- max="${(x) => x.max}"
487
- min="${(x) => x.min}"
488
- maxlength="${(x) => x.maxlength}"
489
- minlength="${(x) => x.minlength}"
490
- placeholder="${(x) => x.placeholder}"
491
- ?readonly="${(x) => x.readOnly}"
492
- ?required="${(x) => x.required}"
493
- size="${(x) => x.size}"
494
- autocomplete="${(x) => x.autoComplete}"
495
- name="${(x) => x.name}"
496
- ?spellcheck="${(x) => x.spellcheck}"
497
- :value="${(x) => x.value}"
498
- type="text"
499
- aria-atomic="${(x) => x.ariaAtomic}"
500
- aria-busy="${(x) => x.ariaBusy}"
501
- aria-current="${(x) => x.ariaCurrent}"
502
- aria-details="${(x) => x.ariaDetails}"
503
- aria-disabled="${(x) => x.ariaDisabled}"
504
- aria-errormessage="${(x) => x.ariaErrormessage}"
505
- aria-haspopup="${(x) => x.ariaHaspopup}"
506
- aria-hidden="${(x) => x.ariaHidden}"
507
- aria-invalid="${(x) => x.ariaInvalid}"
508
- aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
509
- aria-label="${(x) => x.ariaLabel}"
510
- aria-live="${(x) => x.ariaLive}"
511
- aria-relevant="${(x) => x.ariaRelevant}"
512
- aria-roledescription="${(x) => x.ariaRoledescription}"
513
- ${ref("control")}
514
- />
515
- </div>
516
- ${() => numberControlButtons(context)}
39
+ <div class="${getClasses}">
40
+ ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
41
+ <div class="text">
42
+ ${when((x) => x.headline, getHeaderTemplate())}
43
+ <slot class="message"></slot>
517
44
  </div>
518
- ${when(
519
- (x) => !x.successText && !x.errorValidationMessage && x.helperText?.length,
520
- getFeedbackTemplate("helper", context)
521
- )}
522
- ${when(
523
- (x) => !x.successText && x.errorValidationMessage,
524
- getFeedbackTemplate("error", context)
525
- )}
526
- ${when((x) => x.successText, getFeedbackTemplate("success", context))}
527
45
  </div>
528
46
  `;
529
47
  };
530
48
 
531
- const numberFieldDefinition = NumberField.compose({
532
- baseName: "number-field",
533
- template: NumberFieldTemplate,
534
- styles,
535
- shadowOptions: {
536
- delegatesFocus: true
537
- }
49
+ const noteDefinition = Note.compose({
50
+ baseName: "note",
51
+ template: NoteTemplate,
52
+ styles
538
53
  });
539
- const numberFieldRegistries = [
540
- numberFieldDefinition(),
541
- ...buttonRegistries,
542
- ...dividerRegistries
543
- ];
544
- const registerNumberField = registerFactory(numberFieldRegistries);
54
+ const noteRegistries = [noteDefinition(), ...iconRegistries];
55
+ const registerNote = registerFactory(noteRegistries);
545
56
 
546
- export { numberFieldRegistries as a, numberFieldDefinition as n, registerNumberField as r };
57
+ export { noteRegistries as a, noteDefinition as n, registerNote as r };