@vonage/vivid 3.51.0 → 3.53.0

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