@vonage/vivid 3.26.0 → 3.28.2

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 (381) hide show
  1. package/README.md +4 -1
  2. package/accordion/index.js +0 -2
  3. package/accordion-item/index.js +0 -2
  4. package/alert/index.js +0 -2
  5. package/avatar/index.js +0 -2
  6. package/badge/index.js +0 -2
  7. package/banner/index.js +0 -2
  8. package/breadcrumb-item/index.js +0 -2
  9. package/button/index.js +0 -2
  10. package/calendar/index.js +0 -1
  11. package/calendar-event/index.js +0 -2
  12. package/card/index.js +0 -2
  13. package/checkbox/index.js +0 -2
  14. package/combobox/index.js +0 -3
  15. package/custom-elements.json +440 -51
  16. package/data-grid/index.js +1 -5
  17. package/dialog/index.js +0 -2
  18. package/empty-state/index.js +0 -2
  19. package/fab/index.js +0 -2
  20. package/file-picker/index.js +24 -0
  21. package/header/index.js +1 -1
  22. package/icon/index.js +0 -2
  23. package/index.d.ts +3 -3
  24. package/index.js +31 -35
  25. package/layout/index.js +1 -1
  26. package/lib/accordion/accordion.d.ts +5 -5
  27. package/lib/accordion/accordion.template.d.ts +3 -3
  28. package/lib/accordion/definition.d.ts +2 -2
  29. package/lib/accordion/index.d.ts +1 -1
  30. package/lib/accordion-item/accordion-item.d.ts +12 -12
  31. package/lib/accordion-item/accordion-item.template.d.ts +4 -4
  32. package/lib/accordion-item/definition.d.ts +1 -1
  33. package/lib/accordion-item/index.d.ts +1 -1
  34. package/lib/action-group/action-group.d.ts +11 -11
  35. package/lib/action-group/action-group.template.d.ts +4 -4
  36. package/lib/action-group/definition.d.ts +2 -2
  37. package/lib/action-group/index.d.ts +1 -1
  38. package/lib/alert/alert.d.ts +22 -22
  39. package/lib/alert/alert.template.d.ts +4 -4
  40. package/lib/alert/definition.d.ts +2 -2
  41. package/lib/alert/index.d.ts +1 -1
  42. package/lib/avatar/avatar.d.ts +14 -14
  43. package/lib/avatar/avatar.template.d.ts +4 -4
  44. package/lib/avatar/definition.d.ts +2 -2
  45. package/lib/avatar/index.d.ts +1 -1
  46. package/lib/badge/badge.d.ts +14 -14
  47. package/lib/badge/badge.template.d.ts +4 -4
  48. package/lib/badge/definition.d.ts +4 -4
  49. package/lib/badge/index.d.ts +1 -1
  50. package/lib/banner/banner.d.ts +20 -20
  51. package/lib/banner/banner.template.d.ts +4 -4
  52. package/lib/banner/definition.d.ts +2 -2
  53. package/lib/banner/index.d.ts +1 -1
  54. package/lib/breadcrumb/breadcrumb.d.ts +3 -3
  55. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -4
  56. package/lib/breadcrumb/definition.d.ts +1 -1
  57. package/lib/breadcrumb/index.d.ts +1 -1
  58. package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -5
  59. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -4
  60. package/lib/breadcrumb-item/definition.d.ts +1 -1
  61. package/lib/breadcrumb-item/index.d.ts +1 -1
  62. package/lib/button/button.d.ts +18 -18
  63. package/lib/button/button.template.d.ts +4 -4
  64. package/lib/button/definition.d.ts +2 -2
  65. package/lib/button/index.d.ts +1 -1
  66. package/lib/calendar/calendar.d.ts +13 -13
  67. package/lib/calendar/calendar.template.d.ts +4 -4
  68. package/lib/calendar/definition.d.ts +1 -1
  69. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -2
  70. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -6
  71. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -9
  72. package/lib/calendar/index.d.ts +1 -1
  73. package/lib/calendar-event/calendar-event.d.ts +13 -13
  74. package/lib/calendar-event/calendar-event.template.d.ts +4 -4
  75. package/lib/calendar-event/definition.d.ts +2 -2
  76. package/lib/calendar-event/index.d.ts +1 -1
  77. package/lib/card/card.d.ts +10 -10
  78. package/lib/card/card.template.d.ts +4 -4
  79. package/lib/card/definition.d.ts +1 -1
  80. package/lib/card/index.d.ts +1 -1
  81. package/lib/checkbox/checkbox.d.ts +10 -11
  82. package/lib/checkbox/checkbox.template.d.ts +4 -4
  83. package/lib/checkbox/definition.d.ts +1 -1
  84. package/lib/checkbox/index.d.ts +1 -1
  85. package/lib/combobox/combobox.d.ts +12 -13
  86. package/lib/combobox/combobox.template.d.ts +4 -4
  87. package/lib/combobox/definition.d.ts +3 -4
  88. package/lib/combobox/index.d.ts +1 -1
  89. package/lib/components.d.ts +52 -52
  90. package/lib/data-grid/data-grid-cell.d.ts +22 -22
  91. package/lib/data-grid/data-grid-cell.template.d.ts +4 -4
  92. package/lib/data-grid/data-grid-row.d.ts +4 -4
  93. package/lib/data-grid/data-grid-row.template.d.ts +3 -3
  94. package/lib/data-grid/data-grid.d.ts +20 -20
  95. package/lib/data-grid/data-grid.options.d.ts +38 -38
  96. package/lib/data-grid/data-grid.template.d.ts +3 -3
  97. package/lib/data-grid/definition.d.ts +6 -6
  98. package/lib/data-grid/index.d.ts +1 -1
  99. package/lib/dialog/definition.d.ts +2 -2
  100. package/lib/dialog/dialog.d.ts +26 -26
  101. package/lib/dialog/dialog.template.d.ts +4 -4
  102. package/lib/dialog/index.d.ts +1 -1
  103. package/lib/divider/definition.d.ts +1 -1
  104. package/lib/divider/divider.d.ts +3 -3
  105. package/lib/divider/divider.template.d.ts +4 -4
  106. package/lib/divider/index.d.ts +1 -1
  107. package/lib/elevation/definition.d.ts +1 -1
  108. package/lib/elevation/elevation.d.ts +5 -5
  109. package/lib/elevation/elevation.template.d.ts +4 -4
  110. package/lib/elevation/index.d.ts +1 -1
  111. package/lib/empty-state/definition.d.ts +3 -3
  112. package/lib/empty-state/empty-state.d.ts +5 -5
  113. package/lib/empty-state/empty-state.template.d.ts +4 -4
  114. package/lib/empty-state/index.d.ts +1 -1
  115. package/lib/enums.d.ts +60 -60
  116. package/lib/fab/definition.d.ts +4 -4
  117. package/lib/fab/fab.d.ts +12 -12
  118. package/lib/fab/fab.template.d.ts +4 -4
  119. package/lib/fab/index.d.ts +1 -1
  120. package/lib/file-picker/definition.d.ts +3 -0
  121. package/lib/file-picker/file-picker.d.ts +22 -0
  122. package/lib/file-picker/file-picker.template.d.ts +4 -0
  123. package/lib/file-picker/index.d.ts +1 -0
  124. package/lib/focus/definition.d.ts +3 -3
  125. package/lib/focus/focus.d.ts +3 -3
  126. package/lib/focus/focus.template.d.ts +4 -4
  127. package/lib/focus/index.d.ts +1 -1
  128. package/lib/header/definition.d.ts +3 -3
  129. package/lib/header/header.d.ts +5 -5
  130. package/lib/header/header.template.d.ts +4 -4
  131. package/lib/header/index.d.ts +1 -1
  132. package/lib/icon/definition.d.ts +4 -4
  133. package/lib/icon/icon.d.ts +12 -12
  134. package/lib/icon/icon.placeholder.d.ts +1 -1
  135. package/lib/icon/icon.template.d.ts +4 -4
  136. package/lib/icon/index.d.ts +1 -1
  137. package/lib/layout/definition.d.ts +4 -4
  138. package/lib/layout/index.d.ts +1 -1
  139. package/lib/layout/layout.d.ts +17 -17
  140. package/lib/layout/layout.template.d.ts +4 -4
  141. package/lib/listbox/definition.d.ts +4 -4
  142. package/lib/listbox/index.d.ts +1 -1
  143. package/lib/listbox/listbox.d.ts +6 -6
  144. package/lib/listbox/listbox.template.d.ts +4 -4
  145. package/lib/menu/definition.d.ts +12 -12
  146. package/lib/menu/index.d.ts +1 -1
  147. package/lib/menu/menu.d.ts +16 -14
  148. package/lib/menu/menu.template.d.ts +3 -3
  149. package/lib/menu-item/definition.d.ts +3 -3
  150. package/lib/menu-item/index.d.ts +1 -1
  151. package/lib/menu-item/menu-item.d.ts +14 -14
  152. package/lib/menu-item/menu-item.template.d.ts +4 -4
  153. package/lib/nav/definition.d.ts +3 -3
  154. package/lib/nav/index.d.ts +1 -1
  155. package/lib/nav/nav.d.ts +3 -3
  156. package/lib/nav/nav.template.d.ts +4 -4
  157. package/lib/nav-disclosure/definition.d.ts +3 -3
  158. package/lib/nav-disclosure/index.d.ts +1 -1
  159. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -10
  160. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -4
  161. package/lib/nav-item/definition.d.ts +3 -3
  162. package/lib/nav-item/index.d.ts +1 -1
  163. package/lib/nav-item/nav-item.d.ts +7 -7
  164. package/lib/nav-item/nav-item.template.d.ts +4 -4
  165. package/lib/note/definition.d.ts +4 -4
  166. package/lib/note/index.d.ts +1 -1
  167. package/lib/note/note.d.ts +10 -10
  168. package/lib/note/note.template.d.ts +4 -4
  169. package/lib/number-field/definition.d.ts +5 -5
  170. package/lib/number-field/index.d.ts +1 -1
  171. package/lib/number-field/number-field.d.ts +13 -13
  172. package/lib/number-field/number-field.template.d.ts +4 -4
  173. package/lib/option/definition.d.ts +3 -3
  174. package/lib/option/index.d.ts +1 -1
  175. package/lib/option/option.d.ts +12 -12
  176. package/lib/option/option.template.d.ts +4 -4
  177. package/lib/pagination/definition.d.ts +3 -3
  178. package/lib/pagination/index.d.ts +1 -1
  179. package/lib/pagination/pagination.d.ts +18 -18
  180. package/lib/pagination/pagination.template.d.ts +4 -4
  181. package/lib/popup/definition.d.ts +5 -5
  182. package/lib/popup/index.d.ts +1 -1
  183. package/lib/popup/popup.d.ts +21 -21
  184. package/lib/popup/popup.template.d.ts +4 -4
  185. package/lib/progress/definition.d.ts +4 -4
  186. package/lib/progress/index.d.ts +1 -1
  187. package/lib/progress/progress.d.ts +9 -9
  188. package/lib/progress/progress.template.d.ts +5 -5
  189. package/lib/progress-ring/definition.d.ts +4 -4
  190. package/lib/progress-ring/index.d.ts +1 -1
  191. package/lib/progress-ring/progress-ring.d.ts +7 -7
  192. package/lib/progress-ring/progress-ring.template.d.ts +4 -4
  193. package/lib/radio/definition.d.ts +3 -3
  194. package/lib/radio/index.d.ts +1 -1
  195. package/lib/radio/radio.d.ts +7 -7
  196. package/lib/radio/radio.template.d.ts +4 -4
  197. package/lib/radio-group/definition.d.ts +11 -11
  198. package/lib/radio-group/index.d.ts +1 -1
  199. package/lib/radio-group/radio-group.d.ts +4 -4
  200. package/lib/radio-group/radio-group.template.d.ts +4 -4
  201. package/lib/select/definition.d.ts +4 -4
  202. package/lib/select/index.d.ts +1 -1
  203. package/lib/select/select.d.ts +17 -18
  204. package/lib/select/select.template.d.ts +4 -4
  205. package/lib/side-drawer/definition.d.ts +3 -3
  206. package/lib/side-drawer/index.d.ts +1 -1
  207. package/lib/side-drawer/side-drawer.d.ts +9 -9
  208. package/lib/side-drawer/side-drawer.template.d.ts +4 -4
  209. package/lib/slider/definition.d.ts +3 -3
  210. package/lib/slider/index.d.ts +1 -1
  211. package/lib/slider/slider.d.ts +4 -4
  212. package/lib/slider/slider.template.d.ts +4 -4
  213. package/lib/switch/definition.d.ts +4 -4
  214. package/lib/switch/index.d.ts +1 -1
  215. package/lib/switch/switch.d.ts +7 -7
  216. package/lib/switch/switch.template.d.ts +4 -4
  217. package/lib/tab/definition.d.ts +4 -4
  218. package/lib/tab/index.d.ts +1 -1
  219. package/lib/tab/tab.d.ts +14 -14
  220. package/lib/tab/tab.template.d.ts +3 -3
  221. package/lib/tab-panel/definition.d.ts +3 -3
  222. package/lib/tab-panel/index.d.ts +1 -1
  223. package/lib/tab-panel/tab-panel.d.ts +3 -3
  224. package/lib/tab-panel/tab-panel.template.d.ts +2 -2
  225. package/lib/tabs/definition.d.ts +3 -3
  226. package/lib/tabs/index.d.ts +1 -1
  227. package/lib/tabs/tabs.d.ts +15 -15
  228. package/lib/tabs/tabs.template.d.ts +2 -2
  229. package/lib/tag/definition.d.ts +4 -4
  230. package/lib/tag/index.d.ts +1 -1
  231. package/lib/tag/tag.d.ts +22 -22
  232. package/lib/tag/tag.template.d.ts +4 -4
  233. package/lib/tag-group/definition.d.ts +3 -3
  234. package/lib/tag-group/index.d.ts +1 -1
  235. package/lib/tag-group/tag-group.d.ts +3 -3
  236. package/lib/tag-group/tag-group.template.d.ts +4 -4
  237. package/lib/text-anchor/definition.d.ts +3 -3
  238. package/lib/text-anchor/index.d.ts +1 -1
  239. package/lib/text-anchor/text-anchor.d.ts +7 -7
  240. package/lib/text-anchor/text-anchor.template.d.ts +4 -4
  241. package/lib/text-area/definition.d.ts +4 -4
  242. package/lib/text-area/index.d.ts +1 -1
  243. package/lib/text-area/text-area.d.ts +8 -9
  244. package/lib/text-area/text-area.template.d.ts +4 -4
  245. package/lib/text-field/definition.d.ts +4 -4
  246. package/lib/text-field/index.d.ts +1 -1
  247. package/lib/text-field/text-field.d.ts +13 -14
  248. package/lib/text-field/text-field.template.d.ts +4 -4
  249. package/lib/toggletip/definition.d.ts +3 -3
  250. package/lib/toggletip/index.d.ts +1 -1
  251. package/lib/toggletip/toggletip.d.ts +15 -15
  252. package/lib/toggletip/toggletip.template.d.ts +4 -4
  253. package/lib/tooltip/definition.d.ts +3 -3
  254. package/lib/tooltip/index.d.ts +1 -1
  255. package/lib/tooltip/tooltip.d.ts +14 -14
  256. package/lib/tooltip/tooltip.template.d.ts +4 -4
  257. package/lib/tree-item/definition.d.ts +3 -3
  258. package/lib/tree-item/index.d.ts +1 -1
  259. package/lib/tree-item/tree-item.d.ts +7 -7
  260. package/lib/tree-item/tree-item.template.d.ts +4 -4
  261. package/lib/tree-view/definition.d.ts +3 -3
  262. package/lib/tree-view/index.d.ts +1 -1
  263. package/lib/tree-view/tree-view.d.ts +3 -3
  264. package/lib/tree-view/tree-view.template.d.ts +2 -2
  265. package/listbox/index.js +17 -21
  266. package/menu/index.js +2 -5
  267. package/menu-item/index.js +1 -4
  268. package/nav/index.js +1 -1
  269. package/nav-disclosure/index.js +1 -3
  270. package/nav-item/index.js +1 -3
  271. package/note/index.js +1 -3
  272. package/number-field/index.js +1 -4
  273. package/option/index.js +0 -2
  274. package/package.json +10 -8
  275. package/pagination/index.js +2 -6
  276. package/popup/index.js +0 -3
  277. package/progress/index.js +1 -1
  278. package/radio/index.js +1 -1
  279. package/radio-group/index.js +3 -3
  280. package/select/index.js +1 -4
  281. package/shared/affix.js +2 -5
  282. package/shared/anchor.js +2 -1
  283. package/shared/apply-mixins.js +1 -1
  284. package/shared/definition.js +7 -9
  285. package/shared/definition10.js +13 -17
  286. package/shared/definition11.js +6 -9
  287. package/shared/definition12.js +16 -18
  288. package/shared/definition13.js +6 -8
  289. package/shared/definition14.js +7 -12
  290. package/shared/definition15.js +43 -52
  291. package/shared/definition16.js +8 -71
  292. package/shared/definition17.js +36 -45
  293. package/shared/definition18.js +19 -24
  294. package/shared/definition19.js +45 -49
  295. package/shared/definition2.js +24 -28
  296. package/shared/definition20.js +390 -281
  297. package/shared/definition21.js +12 -16
  298. package/shared/definition22.js +82 -168
  299. package/shared/definition23.js +35 -41
  300. package/shared/definition24.js +6 -8
  301. package/shared/definition25.js +10 -14
  302. package/shared/definition26.js +40 -42
  303. package/shared/definition27.js +2285 -48
  304. package/shared/definition28.js +46 -38
  305. package/shared/definition29.js +38 -370
  306. package/shared/definition3.js +5 -9
  307. package/shared/definition30.js +348 -302
  308. package/shared/definition31.js +365 -14
  309. package/shared/definition32.js +12 -71
  310. package/shared/definition33.js +63 -26
  311. package/shared/definition34.js +24 -40
  312. package/shared/definition35.js +32 -436
  313. package/shared/definition36.js +428 -217
  314. package/shared/definition37.js +175 -77
  315. package/shared/definition38.js +50 -34
  316. package/shared/definition39.js +36 -430
  317. package/shared/definition4.js +3 -5
  318. package/shared/definition40.js +358 -589
  319. package/shared/definition41.js +644 -75
  320. package/shared/definition42.js +70 -587
  321. package/shared/definition43.js +503 -84
  322. package/shared/definition44.js +124 -52
  323. package/shared/definition45.js +57 -19
  324. package/shared/definition46.js +17 -487
  325. package/shared/definition47.js +477 -102
  326. package/shared/definition48.js +109 -19
  327. package/shared/definition49.js +17 -276
  328. package/shared/definition5.js +7 -8
  329. package/shared/definition50.js +253 -101
  330. package/shared/definition51.js +114 -629
  331. package/shared/definition52.js +92 -85
  332. package/shared/definition53.js +112 -70
  333. package/shared/definition54.js +65 -294
  334. package/shared/definition55.js +303 -0
  335. package/shared/definition6.js +17 -23
  336. package/shared/definition7.js +44 -47
  337. package/shared/definition8.js +3 -5
  338. package/shared/definition9.js +13 -17
  339. package/shared/design-system/index.d.ts +3 -3
  340. package/shared/focus2.js +1 -3
  341. package/shared/form-associated.js +1 -1
  342. package/shared/form-elements.js +16 -20
  343. package/shared/icon.js +2 -1171
  344. package/shared/index.js +41 -1549
  345. package/shared/listbox.js +1 -1
  346. package/shared/patterns/affix.d.ts +9 -9
  347. package/shared/patterns/focus.d.ts +3 -3
  348. package/shared/patterns/form-elements/form-elements.d.ts +57 -57
  349. package/shared/patterns/form-elements/index.d.ts +1 -1
  350. package/shared/patterns/index.d.ts +3 -3
  351. package/shared/repeat.js +1 -1
  352. package/shared/text-anchor.template.js +38 -40
  353. package/shared/text-field.js +1 -1
  354. package/shared/text-field2.js +1 -1
  355. package/shared/when.js +19 -5
  356. package/side-drawer/index.js +1 -1
  357. package/slider/index.js +1 -4
  358. package/styles/core/all.css +1 -1
  359. package/styles/core/theme.css +1 -1
  360. package/styles/core/typography.css +1 -1
  361. package/styles/tokens/theme-dark.css +17 -17
  362. package/styles/tokens/theme-light.css +17 -17
  363. package/switch/index.js +1 -3
  364. package/tab/index.js +1 -3
  365. package/tab-panel/index.js +1 -1
  366. package/tabs/index.js +3 -5
  367. package/tag/index.js +1 -3
  368. package/tag-group/index.js +1 -1
  369. package/text-anchor/index.js +0 -2
  370. package/text-area/index.js +1 -3
  371. package/text-field/index.js +1 -3
  372. package/toggletip/index.js +1 -5
  373. package/tooltip/index.js +1 -4
  374. package/tree-item/index.js +2 -4
  375. package/tree-view/index.js +1 -1
  376. package/vivid.api.json +210 -848
  377. package/shared/es.object.assign.js +0 -68
  378. package/shared/es.regexp.to-string.js +0 -61
  379. package/shared/es.string.includes.js +0 -83
  380. package/shared/string-trim.js +0 -40
  381. package/shared/to-string.js +0 -51
@@ -1,233 +1,444 @@
1
- import { a as Size, B as Button, b as buttonRegistries } from './definition7.js';
2
- import { g as global$1, l as fails$1, k as functionUncurryThis, G as _export, F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, S as volatile, h as html, r as registerFactory } from './index.js';
3
- import { t as toString$1 } from './to-string.js';
4
- import { w as whitespaces$1, s as stringTrim } from './string-trim.js';
5
- import './es.regexp.to-string.js';
6
- import './es.string.includes.js';
7
- import { e as elements } from './node-observation.js';
1
+ import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { B as Button, S as Shape, b as buttonRegistries } from './definition7.js';
3
+ import { D as Divider, d as dividerRegistries } from './definition24.js';
4
+ import { b as AffixIcon } from './affix.js';
5
+ import './focus.js';
6
+ import { f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
7
+ import { S as StartEnd } from './start-end.js';
8
+ 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 { b as keyArrowDown, c as keyArrowUp } from './key-codes.js';
12
+ import { f as focusTemplateFactory } from './focus2.js';
13
+ import { w as when } from './when.js';
8
14
  import { r as ref } from './ref.js';
9
- import { r as repeat } from './repeat.js';
10
- import { c as children } from './children.js';
11
15
  import { c as classNames } from './class-names.js';
12
- import { w as when } from './when.js';
13
-
14
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n.control {\n display: inline-flex;\n justify-content: space-between;\n}\n\n.buttons-wrapper {\n display: flex;\n column-gap: 4px;\n}\n\n.dots {\n align-self: center;\n text-align: center;\n}\n.dots:not(.size-super-condensed) {\n font: var(--vvd-typography-base-bold);\n}\n.dots.size-super-condensed {\n font: var(--vvd-typography-base-condensed-bold);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.dots.size-condensed {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.dots.size-normal {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}";
15
-
16
- var global = global$1;
17
- var fails = fails$1;
18
- var uncurryThis = functionUncurryThis;
19
- var toString = toString$1;
20
- var trim = stringTrim.trim;
21
- var whitespaces = whitespaces$1;
22
-
23
- var $parseInt$1 = global.parseInt;
24
- var Symbol = global.Symbol;
25
- var ITERATOR = Symbol && Symbol.iterator;
26
- var hex = /^[+-]?0x/i;
27
- var exec = uncurryThis(hex.exec);
28
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
29
- // MS Edge 18- broken with boxed symbols
30
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
31
-
32
- // `parseInt` method
33
- // https://tc39.es/ecma262/#sec-parseint-string-radix
34
- var numberParseInt = FORCED ? function parseInt(string, radix) {
35
- var S = trim(toString(string));
36
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
37
- } : $parseInt$1;
38
-
39
- var $ = _export;
40
- var $parseInt = numberParseInt;
41
16
 
42
- // `parseInt` method
43
- // https://tc39.es/ecma262/#sec-parseint-string-radix
44
- $({ global: true, forced: parseInt != $parseInt }, {
45
- parseInt: $parseInt
46
- });
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
+ }
47
30
 
48
- const MAX_DIGITS_AND_PLACEHOLDERS = 7;
49
- const totalConverter = {
50
- fromView: value => parseInt(value, 10),
51
- toView: value => value.toString()
52
- };
53
- class Pagination extends FoundationElement {
54
- constructor() {
55
- super();
56
- this.navIcons = false;
57
- this.total = 0;
58
- this.selectedIndex = 0;
59
- this.addEventListener('tabpressed', e => {
60
- const {
61
- value: currentLabel,
62
- shiftKey
63
- } = e.detail;
64
- const index = this.paginationButtons.findIndex(button => Number(button.label) === currentLabel);
65
- const focusDirection = shiftKey ? -1 : 1;
66
- const newIndex = index + focusDirection;
67
- if (newIndex < 0) {
68
- return this.prevButton.focus();
69
- }
70
- if (newIndex > this.paginationButtons.length - 1) {
71
- return this.nextButton.focus();
72
- }
73
- this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
74
- });
75
- }
76
- get pagesList() {
77
- return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
78
- if (i === 0) return 1;
79
- if (i === arr.length - 1) return this.total;
80
- if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
81
- if (this.selectedIndex < 4) {
82
- if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
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
+ class NumberField$1 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;
83
88
  }
84
- if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
85
- if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
86
- if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
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;
87
105
  }
88
- if (this.selectedIndex > this.total - 5) {
89
- if (i > 1) return this.total - (6 - i);
90
- if (i === 1) return '...';
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;
91
130
  }
92
- }
93
- return i + 1;
94
- });
95
- }
96
- totalChanged(_, newValue) {
97
- if (newValue < 0) {
98
- this.total = 0;
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;
99
273
  }
100
- this.selectedIndex = 0;
101
- }
102
- selectedIndexChanged(oldValue, newValue) {
103
- if (oldValue === undefined) return;
104
- this.$emit('pagination-change', {
105
- selectedIndex: newValue,
106
- total: this.total,
107
- oldIndex: oldValue
108
- });
109
- }
110
- paginationButtonsChanged(_, newValue) {
111
- newValue.forEach(button => {
112
- button.shadowRoot.querySelector('button').classList.add('icon-only');
113
- });
114
- }
115
274
  }
116
- __decorate([attr, __metadata("design:type", String)], Pagination.prototype, "size", void 0);
117
- __decorate([observable, __metadata("design:type", Array)], Pagination.prototype, "paginationButtons", void 0);
118
- __decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "prevButton", void 0);
119
- __decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "nextButton", void 0);
120
- __decorate([attr({
121
- attribute: 'nav-icons',
122
- mode: 'boolean'
123
- }), __metadata("design:type", Object)], Pagination.prototype, "navIcons", void 0);
124
- __decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Pagination.prototype, "pagesList", null);
125
- __decorate([attr({
126
- mode: 'reflect',
127
- converter: totalConverter
128
- }), __metadata("design:type", Number)], Pagination.prototype, "total", void 0);
129
- __decorate([attr({
130
- mode: 'reflect',
131
- converter: totalConverter,
132
- attribute: 'selected-index'
133
- }), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
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);
134
312
 
135
- let _2 = t => t,
136
- _t,
137
- _t2,
138
- _t3,
139
- _t4;
140
- const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
141
- const handleSelection = (value, {
142
- parent: x
143
- }) => {
144
- return x.selectedIndex = Number(value) - 1;
145
- };
146
- const handleKeyDown = (value, {
147
- event,
148
- parent
149
- }) => {
150
- if (event.key === ' ' || event.key === 'Enter') {
151
- handleSelection(value, {
152
- parent
153
- });
154
- }
155
- if (event.key === 'Tab') {
156
- event.target.dispatchEvent(new CustomEvent('tabpressed', {
157
- detail: {
158
- value,
159
- shiftKey: event.shiftKey
160
- },
161
- bubbles: true,
162
- composed: true
163
- }));
164
- }
165
- };
166
- const getClasses = _ => classNames('control');
167
- function getButtonAppearance(value, {
168
- parent
169
- }) {
170
- return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
313
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-text-field-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-text-field-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-text-field-success-firm, var(--vvd-color-success-600));\n /* @cssprop [--vvd-text-field-success-faint=var(--vvd-color-success-50)] */\n --_connotation-color-faint: var(--vvd-text-field-success-faint, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-text-field-success-soft, var(--vvd-color-success-100));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-text-field-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-text-field-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-text-field-alert-firm, var(--vvd-color-alert-600));\n /* @cssprop [--vvd-text-field-alert-faint=var(--vvd-color-alert-50)] */\n --_connotation-color-faint: var(--vvd-text-field-alert-faint, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-text-field-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-text-field-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-text-field-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-text-field-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-text-field-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-text-field-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n padding-block: 0;\n transition: color 0.2s, box-shadow 0.2s, background-color 0.2s;\n /* Shape */\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.wrapper {\n position: relative;\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n\n.control {\n width: 100%;\n box-sizing: border-box;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\n background-color: transparent;\n block-size: 100%;\n border-radius: inherit;\n color: inherit;\n font: inherit;\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n}\n.control:disabled {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control::placeholder, .control:disabled::placeholder {\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color); /* 1. sets text fill to current `color` for safari */\n}\n.base.action-items .control {\n padding-inline-end: var(--text-field-inline-end-padding, calc(var(--_text-field-icon-size) + var(--_text-field-gutter)));\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n\n.action-items-wrapper {\n position: absolute;\n inset-inline-end: calc(var(--_text-field-gutter) / 4);\n}\n.base:not(.action-items) .action-items-wrapper {\n display: none;\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-inline-start: var(--_text-field-gutter);\n line-height: 1;\n}\n.icon + .wrapper .control {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.wrapper:not(:focus-visible, :focus-within) > .focus-indicator, .fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
314
+
315
+ let NumberField = class NumberField extends NumberField$1 {};
316
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
317
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "shape", void 0);
318
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "autoComplete", void 0);
319
+ NumberField = __decorate([formElements], NumberField);
320
+ applyMixins(NumberField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
321
+
322
+ const ADD = 1;
323
+ const SUBTRACT = -1;
324
+ const getStateClasses = ({
325
+ errorValidationMessage,
326
+ disabled,
327
+ value,
328
+ readOnly,
329
+ placeholder,
330
+ appearance,
331
+ shape,
332
+ label,
333
+ successText
334
+ }) => classNames(['error connotation-alert', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label], ['success connotation-success', !!successText]);
335
+ function renderLabel() {
336
+ return html`
337
+ <label for="control" class="label">
338
+ ${x => x.label}
339
+ </label>`;
171
340
  }
172
- const paginationButtonRenderer = buttonTag => html(_t || (_t = _2`
173
- ${0}
174
- ${0}`), when(value => value !== '...', html(_t2 || (_t2 = _2`
175
- <${0} class="vwc-pagination-button"
176
- label="${0}"
177
- appearance="${0}"
178
- size="${0}"
179
- tabindex="0"
180
- aria-pressed="${0}"
181
- @click="${0}"
182
- @keydown="${0}"
183
- </${0}>
184
- `), buttonTag, value => value, getButtonAppearance, (_, {
185
- parent: x
186
- }) => getPaginationSize(x), (value, {
187
- parent
188
- }) => parent.selectedIndex === Number(value) - 1, handleSelection, handleKeyDown, buttonTag)), when(value => value === '...', html(_t3 || (_t3 = _2`<div class="dots size-${0}">...</div>`), getPaginationSize)));
189
- const getPaginationSize = x => {
190
- if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
191
- return Size.SuperCondensed;
192
- }
193
- return x.size;
194
- };
195
- const PaginationTemplate = context => {
341
+ function adjustValueByStep(numberField, direction = ADD) {
342
+ numberField.value = (Number(numberField.value) + direction * (numberField.step ? numberField.step : 1)).toString();
343
+ }
344
+ function setControlButtonShape(numberField) {
345
+ return numberField.shape === Shape.Pill ? Shape.Pill : null;
346
+ }
347
+ function getTabIndex(numberField) {
348
+ return numberField.disabled || numberField.readOnly ? '-1' : null;
349
+ }
350
+ function numberControlButtons(context) {
196
351
  const buttonTag = context.tagFor(Button);
197
- const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
198
- return html(_t4 || (_t4 = _2`
199
- <div class="${0}">
200
- <${0} class="prev-button" ${0}
201
- label="${0}"
202
- icon="${0}"
203
- size="${0}"
204
- ?disabled="${0}"
205
- @click="${0}"
206
- ></${0}>
207
- <div id="buttons-wrapper" class="buttons-wrapper" ${0}>
208
- ${0}
209
- </div>
210
- <${0} class="next-button" ${0}
211
- label="${0}"
212
- icon="${0}"
213
- size="${0}"
214
- ?disabled="${0}"
215
- @click="${0}"
216
- ></${0}>
217
- </div>`), getClasses, buttonTag, ref('prevButton'), x => !x.navIcons ? 'Previous' : null, x => x.navIcons ? 'chevron-left-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === 0, x => x.selectedIndex !== undefined && x.selectedIndex--, buttonTag, children({
218
- property: 'paginationButtons',
219
- filter: elements(buttonTag)
220
- }), repeat(x => x.pagesList, paginationButtonTemplate, {
221
- positioning: true
222
- }), buttonTag, ref('nextButton'), x => !x.navIcons ? 'Next' : null, x => x.navIcons ? 'chevron-right-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === x.total - 1, x => x.selectedIndex !== undefined && x.selectedIndex++, buttonTag);
352
+ const dividerTag = context.tagFor(Divider);
353
+ return html`
354
+ <div class="control-buttons"
355
+ ?inert="${x => x.disabled || x.readOnly}">
356
+ <${buttonTag} id="subtract" icon="minus-line"
357
+ aria-controls="control"
358
+ shape="${setControlButtonShape}"
359
+ size="condensed"
360
+ tabindex="${getTabIndex}"
361
+ @click="${x => adjustValueByStep(x, SUBTRACT)}"></${buttonTag}>
362
+ <${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
363
+ <${buttonTag} id="add" icon="plus-line"
364
+ aria-controls="control"
365
+ shape="${setControlButtonShape}"
366
+ size="condensed"
367
+ tabindex="${getTabIndex}"
368
+ @click="${x => adjustValueByStep(x)}"></${buttonTag}>
369
+ </div>
370
+ `;
371
+ }
372
+ const NumberFieldTemplate = context => {
373
+ const focusTemplate = focusTemplateFactory(context);
374
+ return html`
375
+ <div class="base ${getStateClasses}">
376
+ ${when(x => x.label, renderLabel())}
377
+ <div class="fieldset">
378
+ <input class="control"
379
+ id="control"
380
+ @input="${x => x.handleTextInput()}"
381
+ @change="${x => x.handleChange()}"
382
+ ?autofocus="${x => x.autofocus}"
383
+ ?disabled="${x => x.disabled}"
384
+ list="${x => x.list}"
385
+ step="${x => x.step ? x.step : null}"
386
+ max="${x => x.max}"
387
+ min="${x => x.min}"
388
+ maxlength="${x => x.maxlength}"
389
+ minlength="${x => x.minlength}"
390
+ placeholder="${x => x.placeholder}"
391
+ ?readonly="${x => x.readOnly}"
392
+ ?required="${x => x.required}"
393
+ size="${x => x.size}"
394
+ autocomplete="${x => x.autoComplete}"
395
+ name="${x => x.name}"
396
+ ?spellcheck="${x => x.spellcheck}"
397
+ :value="${x => x.value}"
398
+ type="text"
399
+ aria-atomic="${x => x.ariaAtomic}"
400
+ aria-busy="${x => x.ariaBusy}"
401
+ aria-controls="${x => x.ariaControls}"
402
+ aria-current="${x => x.ariaCurrent}"
403
+ aria-describedby="${x => x.ariaDescribedby}"
404
+ aria-details="${x => x.ariaDetails}"
405
+ aria-disabled="${x => x.ariaDisabled}"
406
+ aria-errormessage="${x => x.ariaErrormessage}"
407
+ aria-flowto="${x => x.ariaFlowto}"
408
+ aria-haspopup="${x => x.ariaHaspopup}"
409
+ aria-hidden="${x => x.ariaHidden}"
410
+ aria-invalid="${x => x.ariaInvalid}"
411
+ aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
412
+ aria-label="${x => x.ariaLabel}"
413
+ aria-labelledby="${x => x.ariaLabelledby}"
414
+ aria-live="${x => x.ariaLive}"
415
+ aria-owns="${x => x.ariaOwns}"
416
+ aria-relevant="${x => x.ariaRelevant}"
417
+ aria-roledescription="${x => x.ariaRoledescription}"
418
+ ${ref('control')}
419
+ />
420
+ ${() => focusTemplate}
421
+ ${() => numberControlButtons(context)}
422
+ </div>
423
+ ${when(x => {
424
+ var _a;
425
+ return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
426
+ }, getFeedbackTemplate('helper', context))}
427
+ ${when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context))}
428
+ ${when(x => x.successText, getFeedbackTemplate('success', context))}
429
+ </div>
430
+ `;
223
431
  };
224
432
 
225
- const paginationDefinition = Pagination.compose({
226
- baseName: 'pagination',
227
- template: PaginationTemplate,
228
- styles: css_248z
433
+ const numberFieldDefinition = NumberField.compose({
434
+ baseName: 'number-field',
435
+ template: NumberFieldTemplate,
436
+ styles: css_248z,
437
+ shadowOptions: {
438
+ delegatesFocus: true
439
+ }
229
440
  });
230
- const paginationRegistries = [paginationDefinition(), buttonRegistries];
231
- const registerPagination = registerFactory(paginationRegistries);
441
+ const numberFieldRegistries = [numberFieldDefinition(), ...buttonRegistries, ...dividerRegistries];
442
+ const registerNumberField = registerFactory(numberFieldRegistries);
232
443
 
233
- export { paginationRegistries as a, paginationDefinition as p, registerPagination as r };
444
+ export { numberFieldRegistries as a, numberFieldDefinition as n, registerNumberField as r };