@nova-design-system/nova-webcomponents 3.1.0 → 3.2.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 (409) hide show
  1. package/dist/cjs/{index-9bda5507.js → index-108ddff0.js} +20 -4
  2. package/dist/cjs/index-108ddff0.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -0
  4. package/dist/cjs/index.cjs.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/native.cjs.js +2 -2
  7. package/dist/cjs/nv-alert.cjs.entry.js +1 -1
  8. package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
  10. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  12. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  13. package/dist/cjs/nv-calendar.cjs.entry.js +16 -37
  14. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  16. package/dist/cjs/nv-datagrid.cjs.entry.js +95 -103
  17. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +2 -2
  19. package/dist/cjs/nv-datagridcolumn.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
  21. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
  22. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
  23. package/dist/cjs/nv-fielddate.cjs.entry.js +2 -2
  24. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  25. package/dist/cjs/nv-fielddaterange.cjs.entry.js +73 -18
  26. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nv-fielddropdown.cjs.entry.js +84 -60
  28. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
  30. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +116 -104
  31. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nv-fieldnumber.cjs.entry.js +2 -2
  33. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nv-fieldpassword.cjs.entry.js +2 -2
  35. package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nv-fieldradio.cjs.entry.js +1 -1
  37. package/dist/cjs/nv-fieldselect.cjs.entry.js +2 -2
  38. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nv-fieldslider.cjs.entry.js +663 -0
  40. package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -0
  41. package/dist/cjs/nv-fieldtext.cjs.entry.js +5 -5
  42. package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
  43. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +5 -5
  44. package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
  45. package/dist/cjs/nv-fieldtime.cjs.entry.js +11 -11
  46. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  47. package/dist/cjs/nv-icon.cjs.entry.js +3 -3
  48. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  49. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +3 -3
  50. package/dist/cjs/nv-menu.cjs.entry.js +2 -2
  51. package/dist/cjs/nv-menuitem.cjs.entry.js +2 -2
  52. package/dist/cjs/nv-popover.cjs.entry.js +2 -2
  53. package/dist/cjs/nv-row.cjs.entry.js +2 -2
  54. package/dist/cjs/nv-stack.cjs.entry.js +2 -2
  55. package/dist/cjs/nv-table.cjs.entry.js +3 -3
  56. package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
  57. package/dist/cjs/nv-toggle.cjs.entry.js +3 -3
  58. package/dist/cjs/nv-tooltip.cjs.entry.js +3 -3
  59. package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
  60. package/dist/collection/collection-manifest.json +1 -0
  61. package/dist/collection/components/nv-calendar/nv-calendar.css +6 -2
  62. package/dist/collection/components/nv-calendar/nv-calendar.js +14 -35
  63. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  64. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +131 -48
  65. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  66. package/dist/collection/components/nv-datagrid/nv-datagrid.js +94 -152
  67. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  68. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +20 -1
  69. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -1
  70. package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +7 -1
  71. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +85 -17
  72. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  73. package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +7 -1
  74. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -0
  75. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
  76. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +173 -106
  77. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  78. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +31 -1
  79. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +202 -190
  80. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
  81. package/dist/collection/components/nv-fieldmultiselect/{nv-fieldmultiselect.css → styles/nv-fieldmultiselect.css} +15 -4
  82. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +7 -1
  83. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +7 -1
  84. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +7 -1
  85. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +264 -0
  86. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -0
  87. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +1035 -0
  88. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -0
  89. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +77 -0
  90. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +1 -0
  91. package/dist/collection/components/nv-fieldslider/partials/field-input.js +33 -0
  92. package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -0
  93. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +34 -0
  94. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +1 -0
  95. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +18 -0
  96. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +1 -0
  97. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +18 -0
  98. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +1 -0
  99. package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +267 -0
  100. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +159 -0
  101. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +1 -0
  102. package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +15 -1
  103. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +9 -1
  104. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
  105. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +4 -3
  106. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
  107. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +7 -1
  108. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
  109. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +9 -9
  110. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +7 -1
  111. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  112. package/dist/collection/components/nv-icon/nv-icons.js +1 -0
  113. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  114. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  115. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  116. package/dist/collection/components/nv-menu/nv-menu.js +1 -1
  117. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  118. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  119. package/dist/collection/components/nv-row/nv-row.js +1 -1
  120. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  121. package/dist/collection/components/nv-table/nv-table.js +2 -2
  122. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  123. package/dist/collection/components/nv-tooltip/nv-tooltip.css +1 -0
  124. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  125. package/dist/collection/interfaces/Column.js.map +1 -1
  126. package/dist/components/index.js +2 -1
  127. package/dist/components/index.js.map +1 -1
  128. package/dist/components/nv-alert.js +2 -2
  129. package/dist/components/nv-avatar.js +2 -2
  130. package/dist/components/nv-badge.js +1 -1
  131. package/dist/components/nv-breadcrumb.js +3 -3
  132. package/dist/components/nv-breadcrumbs.js +1 -1
  133. package/dist/components/nv-button.js +1 -1
  134. package/dist/components/nv-calendar.js +1 -1
  135. package/dist/components/nv-col.js +1 -1
  136. package/dist/components/nv-datagrid.js +97 -109
  137. package/dist/components/nv-datagrid.js.map +1 -1
  138. package/dist/components/nv-datagridcolumn.js +4 -3
  139. package/dist/components/nv-datagridcolumn.js.map +1 -1
  140. package/dist/components/nv-dialog.js +6 -6
  141. package/dist/components/nv-dialogfooter.js +1 -1
  142. package/dist/components/nv-dialogheader.js +1 -1
  143. package/dist/components/nv-fieldcheckbox.js +1 -1
  144. package/dist/components/nv-fielddate.js +9 -9
  145. package/dist/components/nv-fielddate.js.map +1 -1
  146. package/dist/components/nv-fielddaterange.js +83 -27
  147. package/dist/components/nv-fielddaterange.js.map +1 -1
  148. package/dist/components/nv-fielddropdown.js +98 -72
  149. package/dist/components/nv-fielddropdown.js.map +1 -1
  150. package/dist/components/nv-fielddropdownitem.js +1 -1
  151. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  152. package/dist/components/nv-fieldmultiselect.js +132 -120
  153. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  154. package/dist/components/nv-fieldnumber.js +5 -5
  155. package/dist/components/nv-fieldnumber.js.map +1 -1
  156. package/dist/components/nv-fieldpassword.js +5 -5
  157. package/dist/components/nv-fieldpassword.js.map +1 -1
  158. package/dist/components/nv-fieldradio.js +1 -1
  159. package/dist/components/nv-fieldselect.js +5 -5
  160. package/dist/components/nv-fieldselect.js.map +1 -1
  161. package/dist/components/nv-fieldslider.d.ts +11 -0
  162. package/dist/components/nv-fieldslider.js +726 -0
  163. package/dist/components/nv-fieldslider.js.map +1 -0
  164. package/dist/components/nv-fieldtext.js +1 -1
  165. package/dist/components/nv-fieldtextarea.js +5 -5
  166. package/dist/components/nv-fieldtextarea.js.map +1 -1
  167. package/dist/components/nv-fieldtime.js +15 -15
  168. package/dist/components/nv-fieldtime.js.map +1 -1
  169. package/dist/components/nv-icon.js +1 -1
  170. package/dist/components/nv-iconbutton.js +1 -1
  171. package/dist/components/nv-loader.js +1 -1
  172. package/dist/components/nv-menu.js +5 -5
  173. package/dist/components/nv-menuitem.js +1 -1
  174. package/dist/components/nv-popover.js +1 -1
  175. package/dist/components/nv-row.js +2 -2
  176. package/dist/components/nv-stack.js +2 -2
  177. package/dist/components/nv-table.js +3 -3
  178. package/dist/components/nv-tablecolumn.js +1 -1
  179. package/dist/components/nv-toggle.js +3 -3
  180. package/dist/components/nv-tooltip.js +1 -1
  181. package/dist/components/{p-10faa938.js → p-04cb3a6f.js} +5 -5
  182. package/dist/components/{p-10faa938.js.map → p-04cb3a6f.js.map} +1 -1
  183. package/dist/components/{p-0a0f6daf.js → p-07a89754.js} +3 -3
  184. package/dist/components/{p-0a0f6daf.js.map → p-07a89754.js.map} +1 -1
  185. package/dist/components/{p-10b37876.js → p-0ab80d95.js} +3 -3
  186. package/dist/components/{p-10b37876.js.map → p-0ab80d95.js.map} +1 -1
  187. package/dist/components/{p-02752770.js → p-33e231f4.js} +2 -2
  188. package/dist/components/{p-02752770.js.map → p-33e231f4.js.map} +1 -1
  189. package/dist/components/{p-854c32dc.js → p-4656efae.js} +21 -42
  190. package/dist/components/p-4656efae.js.map +1 -0
  191. package/dist/components/{p-35a70c5e.js → p-581e67cc.js} +3 -3
  192. package/dist/components/{p-35a70c5e.js.map → p-581e67cc.js.map} +1 -1
  193. package/dist/components/{p-1c45c0f2.js → p-679e0fa9.js} +16 -4
  194. package/dist/components/p-679e0fa9.js.map +1 -0
  195. package/dist/components/p-76a30bf1.js +88 -0
  196. package/dist/components/p-76a30bf1.js.map +1 -0
  197. package/dist/components/{p-f5cb0a63.js → p-83c8873a.js} +3 -3
  198. package/dist/components/{p-f5cb0a63.js.map → p-83c8873a.js.map} +1 -1
  199. package/dist/components/{p-f76bb0c3.js → p-c0a91091.js} +5 -5
  200. package/dist/components/p-c0a91091.js.map +1 -0
  201. package/dist/components/{p-41c56ddc.js → p-cbdc2c8b.js} +5 -5
  202. package/dist/components/{p-41c56ddc.js.map → p-cbdc2c8b.js.map} +1 -1
  203. package/dist/components/{p-a2527411.js → p-cbe9521f.js} +3 -3
  204. package/dist/components/{p-a2527411.js.map → p-cbe9521f.js.map} +1 -1
  205. package/dist/components/{p-608eb9da.js → p-d19b41d2.js} +2 -2
  206. package/dist/components/{p-608eb9da.js.map → p-d19b41d2.js.map} +1 -1
  207. package/dist/components/{p-eb632278.js → p-d63f1cbe.js} +3 -3
  208. package/dist/components/{p-eb632278.js.map → p-d63f1cbe.js.map} +1 -1
  209. package/dist/components/{p-e00cbb8a.js → p-dd2273a3.js} +2 -2
  210. package/dist/components/{p-e00cbb8a.js.map → p-dd2273a3.js.map} +1 -1
  211. package/dist/components/{p-9decffb6.js → p-f0a5e7e4.js} +7 -7
  212. package/dist/components/p-f0a5e7e4.js.map +1 -0
  213. package/dist/components/{p-b48d5a94.js → p-f1859ddc.js} +4 -4
  214. package/dist/components/{p-b48d5a94.js.map → p-f1859ddc.js.map} +1 -1
  215. package/dist/esm/{index-1fb7a9a6.js → index-8f0e5f19.js} +20 -4
  216. package/dist/esm/index-8f0e5f19.js.map +1 -0
  217. package/dist/esm/index.js +1 -0
  218. package/dist/esm/index.js.map +1 -1
  219. package/dist/esm/loader.js +3 -3
  220. package/dist/esm/native.js +3 -3
  221. package/dist/esm/nv-alert.entry.js +1 -1
  222. package/dist/esm/nv-avatar.entry.js +1 -1
  223. package/dist/esm/nv-badge_2.entry.js +1 -1
  224. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  225. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  226. package/dist/esm/nv-button.entry.js +1 -1
  227. package/dist/esm/nv-calendar.entry.js +16 -37
  228. package/dist/esm/nv-calendar.entry.js.map +1 -1
  229. package/dist/esm/nv-col.entry.js +1 -1
  230. package/dist/esm/nv-datagrid.entry.js +95 -103
  231. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  232. package/dist/esm/nv-datagridcolumn.entry.js +2 -2
  233. package/dist/esm/nv-datagridcolumn.entry.js.map +1 -1
  234. package/dist/esm/nv-dialog.entry.js +1 -1
  235. package/dist/esm/nv-dialogfooter_2.entry.js +1 -1
  236. package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
  237. package/dist/esm/nv-fielddate.entry.js +2 -2
  238. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  239. package/dist/esm/nv-fielddaterange.entry.js +73 -18
  240. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  241. package/dist/esm/nv-fielddropdown.entry.js +84 -60
  242. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  243. package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
  244. package/dist/esm/nv-fieldmultiselect.entry.js +116 -104
  245. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  246. package/dist/esm/nv-fieldnumber.entry.js +2 -2
  247. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  248. package/dist/esm/nv-fieldpassword.entry.js +2 -2
  249. package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
  250. package/dist/esm/nv-fieldradio.entry.js +1 -1
  251. package/dist/esm/nv-fieldselect.entry.js +2 -2
  252. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  253. package/dist/esm/nv-fieldslider.entry.js +659 -0
  254. package/dist/esm/nv-fieldslider.entry.js.map +1 -0
  255. package/dist/esm/nv-fieldtext.entry.js +5 -5
  256. package/dist/esm/nv-fieldtext.entry.js.map +1 -1
  257. package/dist/esm/nv-fieldtextarea.entry.js +5 -5
  258. package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
  259. package/dist/esm/nv-fieldtime.entry.js +11 -11
  260. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  261. package/dist/esm/nv-icon.entry.js +3 -3
  262. package/dist/esm/nv-icon.entry.js.map +1 -1
  263. package/dist/esm/nv-iconbutton_2.entry.js +3 -3
  264. package/dist/esm/nv-menu.entry.js +2 -2
  265. package/dist/esm/nv-menuitem.entry.js +2 -2
  266. package/dist/esm/nv-popover.entry.js +2 -2
  267. package/dist/esm/nv-row.entry.js +2 -2
  268. package/dist/esm/nv-stack.entry.js +2 -2
  269. package/dist/esm/nv-table.entry.js +3 -3
  270. package/dist/esm/nv-tablecolumn.entry.js +1 -1
  271. package/dist/esm/nv-toggle.entry.js +3 -3
  272. package/dist/esm/nv-tooltip.entry.js +3 -3
  273. package/dist/esm/nv-tooltip.entry.js.map +1 -1
  274. package/dist/native/index.esm.js +1 -1
  275. package/dist/native/index.esm.js.map +1 -1
  276. package/dist/native/native.css +1 -1
  277. package/dist/native/native.esm.js +1 -1
  278. package/dist/native/native.esm.js.map +1 -1
  279. package/dist/native/{p-7fd4d13d.entry.js → p-0323daf6.entry.js} +2 -2
  280. package/dist/native/{p-14c07207.entry.js → p-05d95d4d.entry.js} +2 -2
  281. package/dist/native/{p-90e6d9dd.entry.js → p-0ec1e2e3.entry.js} +2 -2
  282. package/dist/native/{p-c7b201cd.entry.js → p-16a4cdf3.entry.js} +2 -2
  283. package/dist/native/{p-1da72182.entry.js → p-19fb0fd0.entry.js} +2 -2
  284. package/dist/native/p-1e3d3374.entry.js +2 -0
  285. package/dist/native/{p-9135fdf5.entry.js.map → p-1e3d3374.entry.js.map} +1 -1
  286. package/dist/native/p-21e7132f.entry.js +2 -0
  287. package/dist/native/{p-ae7ab110.entry.js.map → p-21e7132f.entry.js.map} +1 -1
  288. package/dist/native/{p-c0f79bac.entry.js → p-221b8f72.entry.js} +2 -2
  289. package/dist/native/p-2805f9f2.entry.js +2 -0
  290. package/dist/native/{p-5d21532a.entry.js.map → p-2805f9f2.entry.js.map} +1 -1
  291. package/dist/native/p-3f2b6a22.entry.js +2 -0
  292. package/dist/native/p-3f2b6a22.entry.js.map +1 -0
  293. package/dist/native/{p-0245863d.entry.js → p-407fc32d.entry.js} +2 -2
  294. package/dist/native/{p-3cd77d82.entry.js → p-4c0d81b0.entry.js} +2 -2
  295. package/dist/native/{p-615947e7.entry.js → p-519b4819.entry.js} +2 -2
  296. package/dist/native/{p-7042ba8a.entry.js → p-5382eab2.entry.js} +2 -2
  297. package/dist/native/p-5ba3fc3c.entry.js +2 -0
  298. package/dist/native/{p-b94d9f0b.entry.js.map → p-5ba3fc3c.entry.js.map} +1 -1
  299. package/dist/native/{p-656c56f0.entry.js → p-60b204ac.entry.js} +2 -2
  300. package/dist/native/p-7092a675.entry.js +2 -0
  301. package/dist/native/p-711a7778.js +3 -0
  302. package/dist/native/p-711a7778.js.map +1 -0
  303. package/dist/native/p-759c9ce4.entry.js +2 -0
  304. package/dist/native/p-759c9ce4.entry.js.map +1 -0
  305. package/dist/native/{p-efe6a46c.entry.js → p-7c676f2c.entry.js} +2 -2
  306. package/dist/native/p-7c6edd1c.entry.js +2 -0
  307. package/dist/native/p-7c6edd1c.entry.js.map +1 -0
  308. package/dist/native/p-987c79d8.entry.js +2 -0
  309. package/dist/native/p-987c79d8.entry.js.map +1 -0
  310. package/dist/native/{p-b8b6875d.entry.js → p-9fba8663.entry.js} +2 -2
  311. package/dist/native/{p-08a75cfa.entry.js → p-a2c0f1a7.entry.js} +2 -2
  312. package/dist/native/p-aa86af25.entry.js +2 -0
  313. package/dist/native/{p-49cac014.entry.js.map → p-aa86af25.entry.js.map} +1 -1
  314. package/dist/native/p-adc96c3a.entry.js +2 -0
  315. package/dist/native/{p-4d164ed6.entry.js.map → p-adc96c3a.entry.js.map} +1 -1
  316. package/dist/native/p-b0fc08e7.entry.js +2 -0
  317. package/dist/native/p-b0fc08e7.entry.js.map +1 -0
  318. package/dist/native/{p-c67186f8.entry.js → p-c930adb7.entry.js} +2 -2
  319. package/dist/native/{p-3b7ef609.entry.js → p-cfe0a6c6.entry.js} +2 -2
  320. package/dist/native/p-d07ab618.entry.js +2 -0
  321. package/dist/native/{p-7e154bfd.entry.js → p-dac0089b.entry.js} +2 -2
  322. package/dist/native/p-dac0089b.entry.js.map +1 -0
  323. package/dist/native/{p-470588c2.entry.js → p-de2c07a6.entry.js} +3 -3
  324. package/dist/native/p-de2c07a6.entry.js.map +1 -0
  325. package/dist/native/{p-3953464e.entry.js → p-ed488498.entry.js} +2 -2
  326. package/dist/native/p-ef76178b.entry.js +2 -0
  327. package/dist/native/p-ef76178b.entry.js.map +1 -0
  328. package/dist/native/{p-e5de64d5.entry.js → p-f0ddf60b.entry.js} +2 -2
  329. package/dist/native/p-f39803d9.entry.js +2 -0
  330. package/dist/native/p-f39803d9.entry.js.map +1 -0
  331. package/dist/native/p-fb897f7d.entry.js +2 -0
  332. package/dist/native/{p-fc97f071.entry.js.map → p-fb897f7d.entry.js.map} +1 -1
  333. package/dist/native/{p-244f56ac.entry.js → p-fc3bea07.entry.js} +2 -2
  334. package/dist/types/components/nv-calendar/nv-calendar.d.ts +1 -5
  335. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +0 -16
  336. package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +4 -0
  337. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +11 -1
  338. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +47 -26
  339. package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +61 -55
  340. package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +230 -0
  341. package/dist/types/components/nv-fieldslider/nv-fieldslider.docs.d.ts +4 -0
  342. package/dist/types/components/nv-fieldslider/nv-fieldslider.utils.d.ts +46 -0
  343. package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +45 -0
  344. package/dist/types/components/nv-fieldslider/partials/range-thumb.d.ts +37 -0
  345. package/dist/types/components/nv-fieldslider/partials/single-thumb.d.ts +35 -0
  346. package/dist/types/components/nv-fieldslider/partials/tick-marks.d.ts +28 -0
  347. package/dist/types/components/nv-fieldslider/test/nv-fieldslider.utils.test.d.ts +1 -0
  348. package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +1 -0
  349. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  350. package/dist/types/components.d.ts +387 -38
  351. package/dist/types/interfaces/Column.d.ts +5 -1
  352. package/dist/vscode-data.json +121 -9
  353. package/hydrate/index.js +1172 -393
  354. package/hydrate/index.mjs +1172 -393
  355. package/package.json +6 -2
  356. package/dist/cjs/index-9bda5507.js.map +0 -1
  357. package/dist/components/p-1c45c0f2.js.map +0 -1
  358. package/dist/components/p-76646ce9.js +0 -88
  359. package/dist/components/p-76646ce9.js.map +0 -1
  360. package/dist/components/p-854c32dc.js.map +0 -1
  361. package/dist/components/p-9decffb6.js.map +0 -1
  362. package/dist/components/p-f76bb0c3.js.map +0 -1
  363. package/dist/esm/index-1fb7a9a6.js.map +0 -1
  364. package/dist/native/p-2523eead.entry.js +0 -2
  365. package/dist/native/p-2523eead.entry.js.map +0 -1
  366. package/dist/native/p-470588c2.entry.js.map +0 -1
  367. package/dist/native/p-49cac014.entry.js +0 -2
  368. package/dist/native/p-4d164ed6.entry.js +0 -2
  369. package/dist/native/p-4dc1d036.entry.js +0 -2
  370. package/dist/native/p-4e635fa7.entry.js +0 -2
  371. package/dist/native/p-4e635fa7.entry.js.map +0 -1
  372. package/dist/native/p-5d21532a.entry.js +0 -2
  373. package/dist/native/p-7e154bfd.entry.js.map +0 -1
  374. package/dist/native/p-7eba904e.entry.js +0 -2
  375. package/dist/native/p-7eba904e.entry.js.map +0 -1
  376. package/dist/native/p-9135fdf5.entry.js +0 -2
  377. package/dist/native/p-ab002252.js +0 -3
  378. package/dist/native/p-ab002252.js.map +0 -1
  379. package/dist/native/p-ae7ab110.entry.js +0 -2
  380. package/dist/native/p-b94d9f0b.entry.js +0 -2
  381. package/dist/native/p-c71c6f23.entry.js +0 -2
  382. package/dist/native/p-c71c6f23.entry.js.map +0 -1
  383. package/dist/native/p-d9a52884.entry.js +0 -2
  384. package/dist/native/p-d9a52884.entry.js.map +0 -1
  385. package/dist/native/p-f2ef6771.entry.js +0 -2
  386. package/dist/native/p-f5f68992.entry.js +0 -2
  387. package/dist/native/p-f5f68992.entry.js.map +0 -1
  388. package/dist/native/p-fc97f071.entry.js +0 -2
  389. /package/dist/native/{p-7fd4d13d.entry.js.map → p-0323daf6.entry.js.map} +0 -0
  390. /package/dist/native/{p-14c07207.entry.js.map → p-05d95d4d.entry.js.map} +0 -0
  391. /package/dist/native/{p-90e6d9dd.entry.js.map → p-0ec1e2e3.entry.js.map} +0 -0
  392. /package/dist/native/{p-c7b201cd.entry.js.map → p-16a4cdf3.entry.js.map} +0 -0
  393. /package/dist/native/{p-1da72182.entry.js.map → p-19fb0fd0.entry.js.map} +0 -0
  394. /package/dist/native/{p-c0f79bac.entry.js.map → p-221b8f72.entry.js.map} +0 -0
  395. /package/dist/native/{p-0245863d.entry.js.map → p-407fc32d.entry.js.map} +0 -0
  396. /package/dist/native/{p-3cd77d82.entry.js.map → p-4c0d81b0.entry.js.map} +0 -0
  397. /package/dist/native/{p-615947e7.entry.js.map → p-519b4819.entry.js.map} +0 -0
  398. /package/dist/native/{p-7042ba8a.entry.js.map → p-5382eab2.entry.js.map} +0 -0
  399. /package/dist/native/{p-656c56f0.entry.js.map → p-60b204ac.entry.js.map} +0 -0
  400. /package/dist/native/{p-f2ef6771.entry.js.map → p-7092a675.entry.js.map} +0 -0
  401. /package/dist/native/{p-efe6a46c.entry.js.map → p-7c676f2c.entry.js.map} +0 -0
  402. /package/dist/native/{p-b8b6875d.entry.js.map → p-9fba8663.entry.js.map} +0 -0
  403. /package/dist/native/{p-08a75cfa.entry.js.map → p-a2c0f1a7.entry.js.map} +0 -0
  404. /package/dist/native/{p-c67186f8.entry.js.map → p-c930adb7.entry.js.map} +0 -0
  405. /package/dist/native/{p-3b7ef609.entry.js.map → p-cfe0a6c6.entry.js.map} +0 -0
  406. /package/dist/native/{p-4dc1d036.entry.js.map → p-d07ab618.entry.js.map} +0 -0
  407. /package/dist/native/{p-3953464e.entry.js.map → p-ed488498.entry.js.map} +0 -0
  408. /package/dist/native/{p-e5de64d5.entry.js.map → p-f0ddf60b.entry.js.map} +0 -0
  409. /package/dist/native/{p-244f56ac.entry.js.map → p-fc3bea07.entry.js.map} +0 -0
@@ -0,0 +1,159 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { clamp, valueToPercent, snapToStep, generateTicks, snapToTicks, } from "../nv-fieldslider.utils";
3
+ describe('nv-fieldslider -> utils', () => {
4
+ describe('clamp', () => {
5
+ it('should clamp value to min when value is below min', () => {
6
+ expect(clamp(-10, 0, 100)).toBe(0);
7
+ });
8
+ it('should clamp value to max when value is above max', () => {
9
+ expect(clamp(150, 0, 100)).toBe(100);
10
+ });
11
+ it('should return value when it is within range', () => {
12
+ expect(clamp(50, 0, 100)).toBe(50);
13
+ });
14
+ it('should handle edge cases', () => {
15
+ expect(clamp(0, 0, 100)).toBe(0);
16
+ expect(clamp(100, 0, 100)).toBe(100);
17
+ });
18
+ it('should handle negative ranges', () => {
19
+ expect(clamp(-150, -200, -100)).toBe(-150);
20
+ expect(clamp(-50, -200, -100)).toBe(-100);
21
+ expect(clamp(-250, -200, -100)).toBe(-200);
22
+ });
23
+ });
24
+ describe('valueToPercent', () => {
25
+ it('should convert value to percentage within range', () => {
26
+ expect(valueToPercent(50, 0, 100)).toBe(50);
27
+ expect(valueToPercent(25, 0, 100)).toBe(25);
28
+ expect(valueToPercent(75, 0, 100)).toBe(75);
29
+ });
30
+ it('should handle values outside the range', () => {
31
+ expect(valueToPercent(-10, 0, 100)).toBe(-10);
32
+ expect(valueToPercent(150, 0, 100)).toBe(150);
33
+ });
34
+ it('should handle custom ranges', () => {
35
+ expect(valueToPercent(30, 20, 40)).toBe(50);
36
+ expect(valueToPercent(10, -10, 10)).toBe(100);
37
+ expect(valueToPercent(0, -10, 10)).toBe(50);
38
+ expect(valueToPercent(-10, -10, 10)).toBe(0);
39
+ });
40
+ it('should return 0 when min equals max', () => {
41
+ expect(valueToPercent(50, 50, 50)).toBe(0);
42
+ expect(valueToPercent(100, 100, 100)).toBe(0);
43
+ });
44
+ it('should handle negative ranges', () => {
45
+ expect(valueToPercent(-150, -200, -100)).toBe(50);
46
+ });
47
+ it('should handle decimal values', () => {
48
+ expect(valueToPercent(2.5, 0, 5)).toBe(50);
49
+ expect(valueToPercent(0.5, 0, 1)).toBe(50);
50
+ });
51
+ });
52
+ describe('snapToStep', () => {
53
+ it('should snap value to nearest step', () => {
54
+ expect(snapToStep(42, 0, 100, 5)).toBe(40);
55
+ expect(snapToStep(43, 0, 100, 5)).toBe(45);
56
+ expect(snapToStep(2.7, 0, 10, 0.5)).toBe(2.5);
57
+ expect(snapToStep(2.8, 0, 10, 0.5)).toBe(3);
58
+ });
59
+ it('should clamp value to min when below min', () => {
60
+ expect(snapToStep(-10, 0, 100, 5)).toBe(0);
61
+ });
62
+ it('should clamp value to max when above max', () => {
63
+ expect(snapToStep(110, 0, 100, 5)).toBe(100);
64
+ });
65
+ it('should handle edge cases', () => {
66
+ // Exactly on a step
67
+ expect(snapToStep(20, 0, 100, 5)).toBe(20);
68
+ // Min and max values
69
+ expect(snapToStep(0, 0, 100, 5)).toBe(0);
70
+ expect(snapToStep(100, 0, 100, 5)).toBe(100);
71
+ // Value between min and first step
72
+ expect(snapToStep(2, 0, 100, 5)).toBe(0);
73
+ expect(snapToStep(3, 0, 100, 5)).toBe(5);
74
+ });
75
+ it('should handle negative ranges', () => {
76
+ expect(snapToStep(-152, -200, -100, 10)).toBe(-150);
77
+ });
78
+ it("should handle step sizes that don't divide evenly into the range", () => {
79
+ expect(snapToStep(97, 0, 100, 30)).toBe(90);
80
+ expect(snapToStep(98, 0, 100, 30)).toBe(90); // Not 120 because it's clamped to max (100)
81
+ });
82
+ });
83
+ describe('generateTicks', () => {
84
+ it('should generate ticks for a simple range', () => {
85
+ const ticks = generateTicks(0, 10, 2);
86
+ expect(ticks).toEqual([0, 2, 4, 6, 8, 10]);
87
+ });
88
+ it('should include max value when it falls on a step', () => {
89
+ const ticks = generateTicks(0, 10, 5);
90
+ expect(ticks).toEqual([0, 5, 10]);
91
+ });
92
+ it("should include max value even when it doesn't fall on a step", () => {
93
+ const ticks = generateTicks(0, 11, 5);
94
+ expect(ticks).toEqual([0, 5, 10, 11]);
95
+ });
96
+ it('should handle negative ranges', () => {
97
+ const ticks = generateTicks(-10, 0, 2);
98
+ expect(ticks).toEqual([-10, -8, -6, -4, -2, 0]);
99
+ });
100
+ it('should handle floating point step sizes', () => {
101
+ const ticks = generateTicks(0, 1, 0.2);
102
+ // Using toEqual with approximate values due to floating point precision
103
+ expect(ticks).toEqual([0, 0.2, 0.4, 0.6, 0.8, 1]);
104
+ });
105
+ it('should handle small step sizes correctly', () => {
106
+ const ticks = generateTicks(0, 0.5, 0.1);
107
+ expect(ticks).toEqual([0, 0.1, 0.2, 0.3, 0.4, 0.5]);
108
+ });
109
+ it('should handle case when min equals max', () => {
110
+ const ticks = generateTicks(10, 10, 5);
111
+ expect(ticks).toEqual([10]);
112
+ });
113
+ });
114
+ describe('snapToTicks', () => {
115
+ it('should snap value to closest tick', () => {
116
+ const ticks = [
117
+ { value: 0 },
118
+ { value: 25 },
119
+ { value: 50 },
120
+ { value: 75 },
121
+ { value: 100 },
122
+ ];
123
+ expect(snapToTicks(12, ticks)).toBe(0); // Closer to 0
124
+ expect(snapToTicks(13, ticks)).toBe(25); // Closer to 25
125
+ expect(snapToTicks(37, ticks)).toBe(25); // Closer to 25
126
+ expect(snapToTicks(38, ticks)).toBe(50); // Closer to 50
127
+ expect(snapToTicks(87, ticks)).toBe(75); // Closer to 75
128
+ expect(snapToTicks(88, ticks)).toBe(100); // Closer to 100
129
+ });
130
+ it('should return original value when ticks is empty or undefined', () => {
131
+ expect(snapToTicks(42, [])).toBe(42);
132
+ expect(snapToTicks(42, undefined)).toBe(42);
133
+ });
134
+ it('should return tick value when input exactly matches a tick', () => {
135
+ const ticks = [{ value: 0 }, { value: 50 }, { value: 100 }];
136
+ expect(snapToTicks(0, ticks)).toBe(0);
137
+ expect(snapToTicks(50, ticks)).toBe(50);
138
+ expect(snapToTicks(100, ticks)).toBe(100);
139
+ });
140
+ it('should handle equidistant values by taking the first encountered tick', () => {
141
+ const ticks = [{ value: 0 }, { value: 10 }];
142
+ // Value 5 is exactly equidistant from 0 and 10
143
+ expect(snapToTicks(5, ticks)).toBe(0);
144
+ });
145
+ it('should handle negative and decimal values', () => {
146
+ const ticks = [
147
+ { value: -10 },
148
+ { value: -5.5 },
149
+ { value: 0 },
150
+ { value: 2.25 },
151
+ ];
152
+ expect(snapToTicks(-8, ticks)).toBe(-10);
153
+ expect(snapToTicks(-3, ticks)).toBe(-5.5);
154
+ expect(snapToTicks(1, ticks)).toBe(0);
155
+ expect(snapToTicks(1.5, ticks)).toBe(2.25);
156
+ });
157
+ });
158
+ });
159
+ //# sourceMappingURL=nv-fieldslider.utils.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nv-fieldslider.utils.test.js","sourceRoot":"","sources":["../../../../src/components/nv-fieldslider/test/nv-fieldslider.utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,KAAK,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACrB,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;YAClC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,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C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;YAC/E,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAE5C,+CAA+C;YAC/C,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,KAAK,GAAG;gBACZ,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;gBACd,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE;gBACf,EAAE,KAAK,EAAE,CAAC,EAAE;gBACZ,EAAE,KAAK,EAAE,IAAI,EAAE;aAChB,CAAC;YAEF,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;YACzC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAC1C,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport {\n clamp,\n valueToPercent,\n snapToStep,\n generateTicks,\n snapToTicks,\n} from '../nv-fieldslider.utils';\n\ndescribe('nv-fieldslider -> utils', () => {\n describe('clamp', () => {\n it('should clamp value to min when value is below min', () => {\n expect(clamp(-10, 0, 100)).toBe(0);\n });\n\n it('should clamp value to max when value is above max', () => {\n expect(clamp(150, 0, 100)).toBe(100);\n });\n\n it('should return value when it is within range', () => {\n expect(clamp(50, 0, 100)).toBe(50);\n });\n\n it('should handle edge cases', () => {\n expect(clamp(0, 0, 100)).toBe(0);\n expect(clamp(100, 0, 100)).toBe(100);\n });\n\n it('should handle negative ranges', () => {\n expect(clamp(-150, -200, -100)).toBe(-150);\n expect(clamp(-50, -200, -100)).toBe(-100);\n expect(clamp(-250, -200, -100)).toBe(-200);\n });\n });\n\n describe('valueToPercent', () => {\n it('should convert value to percentage within range', () => {\n expect(valueToPercent(50, 0, 100)).toBe(50);\n expect(valueToPercent(25, 0, 100)).toBe(25);\n expect(valueToPercent(75, 0, 100)).toBe(75);\n });\n\n it('should handle values outside the range', () => {\n expect(valueToPercent(-10, 0, 100)).toBe(-10);\n expect(valueToPercent(150, 0, 100)).toBe(150);\n });\n\n it('should handle custom ranges', () => {\n expect(valueToPercent(30, 20, 40)).toBe(50);\n expect(valueToPercent(10, -10, 10)).toBe(100);\n expect(valueToPercent(0, -10, 10)).toBe(50);\n expect(valueToPercent(-10, -10, 10)).toBe(0);\n });\n\n it('should return 0 when min equals max', () => {\n expect(valueToPercent(50, 50, 50)).toBe(0);\n expect(valueToPercent(100, 100, 100)).toBe(0);\n });\n\n it('should handle negative ranges', () => {\n expect(valueToPercent(-150, -200, -100)).toBe(50);\n });\n\n it('should handle decimal values', () => {\n expect(valueToPercent(2.5, 0, 5)).toBe(50);\n expect(valueToPercent(0.5, 0, 1)).toBe(50);\n });\n });\n\n describe('snapToStep', () => {\n it('should snap value to nearest step', () => {\n expect(snapToStep(42, 0, 100, 5)).toBe(40);\n expect(snapToStep(43, 0, 100, 5)).toBe(45);\n expect(snapToStep(2.7, 0, 10, 0.5)).toBe(2.5);\n expect(snapToStep(2.8, 0, 10, 0.5)).toBe(3);\n });\n\n it('should clamp value to min when below min', () => {\n expect(snapToStep(-10, 0, 100, 5)).toBe(0);\n });\n\n it('should clamp value to max when above max', () => {\n expect(snapToStep(110, 0, 100, 5)).toBe(100);\n });\n\n it('should handle edge cases', () => {\n // Exactly on a step\n expect(snapToStep(20, 0, 100, 5)).toBe(20);\n // Min and max values\n expect(snapToStep(0, 0, 100, 5)).toBe(0);\n expect(snapToStep(100, 0, 100, 5)).toBe(100);\n // Value between min and first step\n expect(snapToStep(2, 0, 100, 5)).toBe(0);\n expect(snapToStep(3, 0, 100, 5)).toBe(5);\n });\n\n it('should handle negative ranges', () => {\n expect(snapToStep(-152, -200, -100, 10)).toBe(-150);\n });\n\n it(\"should handle step sizes that don't divide evenly into the range\", () => {\n expect(snapToStep(97, 0, 100, 30)).toBe(90);\n expect(snapToStep(98, 0, 100, 30)).toBe(90); // Not 120 because it's clamped to max (100)\n });\n });\n\n describe('generateTicks', () => {\n it('should generate ticks for a simple range', () => {\n const ticks = generateTicks(0, 10, 2);\n expect(ticks).toEqual([0, 2, 4, 6, 8, 10]);\n });\n\n it('should include max value when it falls on a step', () => {\n const ticks = generateTicks(0, 10, 5);\n expect(ticks).toEqual([0, 5, 10]);\n });\n\n it(\"should include max value even when it doesn't fall on a step\", () => {\n const ticks = generateTicks(0, 11, 5);\n expect(ticks).toEqual([0, 5, 10, 11]);\n });\n\n it('should handle negative ranges', () => {\n const ticks = generateTicks(-10, 0, 2);\n expect(ticks).toEqual([-10, -8, -6, -4, -2, 0]);\n });\n\n it('should handle floating point step sizes', () => {\n const ticks = generateTicks(0, 1, 0.2);\n // Using toEqual with approximate values due to floating point precision\n expect(ticks).toEqual([0, 0.2, 0.4, 0.6, 0.8, 1]);\n });\n\n it('should handle small step sizes correctly', () => {\n const ticks = generateTicks(0, 0.5, 0.1);\n expect(ticks).toEqual([0, 0.1, 0.2, 0.3, 0.4, 0.5]);\n });\n\n it('should handle case when min equals max', () => {\n const ticks = generateTicks(10, 10, 5);\n expect(ticks).toEqual([10]);\n });\n });\n\n describe('snapToTicks', () => {\n it('should snap value to closest tick', () => {\n const ticks = [\n { value: 0 },\n { value: 25 },\n { value: 50 },\n { value: 75 },\n { value: 100 },\n ];\n\n expect(snapToTicks(12, ticks)).toBe(0); // Closer to 0\n expect(snapToTicks(13, ticks)).toBe(25); // Closer to 25\n expect(snapToTicks(37, ticks)).toBe(25); // Closer to 25\n expect(snapToTicks(38, ticks)).toBe(50); // Closer to 50\n expect(snapToTicks(87, ticks)).toBe(75); // Closer to 75\n expect(snapToTicks(88, ticks)).toBe(100); // Closer to 100\n });\n\n it('should return original value when ticks is empty or undefined', () => {\n expect(snapToTicks(42, [])).toBe(42);\n expect(snapToTicks(42, undefined)).toBe(42);\n });\n\n it('should return tick value when input exactly matches a tick', () => {\n const ticks = [{ value: 0 }, { value: 50 }, { value: 100 }];\n\n expect(snapToTicks(0, ticks)).toBe(0);\n expect(snapToTicks(50, ticks)).toBe(50);\n expect(snapToTicks(100, ticks)).toBe(100);\n });\n\n it('should handle equidistant values by taking the first encountered tick', () => {\n const ticks = [{ value: 0 }, { value: 10 }];\n\n // Value 5 is exactly equidistant from 0 and 10\n expect(snapToTicks(5, ticks)).toBe(0);\n });\n\n it('should handle negative and decimal values', () => {\n const ticks = [\n { value: -10 },\n { value: -5.5 },\n { value: 0 },\n { value: 2.25 },\n ];\n\n expect(snapToTicks(-8, ticks)).toBe(-10);\n expect(snapToTicks(-3, ticks)).toBe(-5.5);\n expect(snapToTicks(1, ticks)).toBe(0);\n expect(snapToTicks(1.5, ticks)).toBe(2.25);\n });\n });\n});\n"]}
@@ -30,7 +30,7 @@ nv-fieldtext[error]:not([error=false]) {
30
30
  --nv-field-border-focus: var(--nv-field-border-default);
31
31
  --nv-field-border-disabled: var(--nv-field-border-default);
32
32
  --nv-field-border-readonly: var(--nv-field-border-default);
33
- --nv-field-focus-box-shadow: var(--color-focus-destructive);
33
+ --nv-field-focus-box-shadow: var(--color-focus-destructive-in-field);
34
34
  }
35
35
  nv-fieldtext[success]:not([success=false]) {
36
36
  --nv-field-border-default: var(--components-form-field-border-success);
@@ -95,6 +95,10 @@ nv-fieldtext > .input-wrapper .input-container:has(input:disabled) {
95
95
  background-color: var(--components-form-field-background-disabled);
96
96
  border-color: var(--nv-field-border-disabled);
97
97
  }
98
+ nv-fieldtext > .input-wrapper .input-container > [slot=leading-input] {
99
+ display: block;
100
+ margin-left: var(--form-field-padding-x);
101
+ }
98
102
  nv-fieldtext > .input-wrapper .input-container input {
99
103
  display: flex;
100
104
  align-items: center;
@@ -126,8 +130,15 @@ nv-fieldtext > .input-wrapper .input-container nv-icon.validation {
126
130
  color: var(--nv-field-border-default);
127
131
  margin-right: var(--form-gap-x);
128
132
  }
133
+ nv-fieldtext > .input-wrapper .input-container > [slot=trailing-input] {
134
+ display: block;
135
+ margin-right: var(--form-field-padding-x);
136
+ }
129
137
  nv-fieldtext > .description {
138
+ display: flex;
139
+ align-items: center;
130
140
  align-self: stretch;
141
+ gap: var(--spacing-1);
131
142
  color: var(--components-form-text-description-default);
132
143
  font-family: "TT Norms Pro", sans-serif;
133
144
  font-size: var(--form-description-font-size);
@@ -135,7 +146,10 @@ nv-fieldtext > .description {
135
146
  line-height: var(--form-description-line-height);
136
147
  }
137
148
  nv-fieldtext > .error-description {
149
+ display: flex;
150
+ align-items: center;
138
151
  align-self: stretch;
152
+ gap: var(--spacing-1);
139
153
  color: var(--components-form-text-description-default);
140
154
  font-family: "TT Norms Pro", sans-serif;
141
155
  font-size: var(--form-description-font-size);
@@ -169,7 +169,15 @@ const NvFieldtextDocs = {
169
169
  args: {
170
170
  label: 'Leading Input',
171
171
  },
172
- template: (h("nv-fieldtext", { "data-storybook-args": true }, h("nv-badge", { slot: "leading-input", label: "test", dismissible: true, "data-class": "ml-1" }))),
172
+ template: (h("nv-fieldtext", { "data-storybook-args": true }, h("nv-badge", { slot: "leading-input", label: "test", dismissible: true }))),
173
+ },
174
+ {
175
+ name: 'trailingInputSlot',
176
+ description: 'Content to be placed after the input text, within the input container.',
177
+ args: {
178
+ label: 'Trailing Input',
179
+ },
180
+ template: (h("nv-fieldtext", { "data-storybook-args": true }, h("span", { slot: "trailing-input" }, "MWh"))),
173
181
  },
174
182
  {
175
183
  name: 'labelSlot',
@@ -1 +1 @@
1
- {"version":3,"file":"nv-fieldtext.docs.js","sourceRoot":"","sources":["../../../src/components/nv-fieldtext/nv-fieldtext.docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,eAAe,GAAqC;IACxD,SAAS,EAAE,cAAc;IACzB,aAAa,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IACxC,OAAO,EAAE;QACP;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;YAClD,IAAI,EAAE;gBACJ,KAAK,EAAE,iBAAiB;aACzB;YACD,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACxD,IAAI,EAAE;gBACJ,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,4BAA4B;aAC1C;YACD,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACxD,IAAI,EAAE;gBACJ,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,mBAAmB;aACjC;YACD,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjD,IAAI,EAAE;gBACJ,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EA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F;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EACT,yFAAyF;YAC3F,IAAI,EAAE;gBACJ,KAAK,EAAE,wBAAwB;gBAC/B,gBAAgB,EAAE,4BAA4B;gBAC9C,KAAK,EAAE,IAAI;aACZ;YACD,QAAQ,EAAE,CACR;gBACE,YAAM,IAAI,EAAC,mBAAmB,+BAAgC,CACjD,CAChB;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EACT,0EAA0E;YAC5E,IAAI,EAAE;gBACJ,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,4BAA4B;aAC1C;YACD,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,cAAc,wBAA8B,CAC/C,CAChB;SACF;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EACT,yEAAyE;YAC3E,IAAI,EAAE;gBACJ,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,4BAA4B;aAC1C;YACD,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,aAAa,uBAA6B,CAC7C,CAChB;SACF;KACF;CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\nimport { nameof } from '../../utils/class.utils';\n\nconst NvFieldtextDocs: NovaDocs<Components.NvFieldtext> = {\n component: 'nv-fieldtext',\n subcomponents: ['nv-badge', 'nv-button'],\n stories: [\n {\n name: 'Default',\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.label),\n args: {\n label: 'Textfield Label',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.description),\n args: {\n label: 'Textfield Description',\n description: 'Description will show here',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.placeholder),\n args: {\n label: 'Textfield Placeholder',\n placeholder: 'Type something...',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.name),\n args: {\n label: 'Textfield Name',\n name: 'name',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.value),\n args: {\n label: 'Textfield Value',\n value: 'value',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.type),\n args: {\n label: 'Textfield Type',\n type: 'email',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.disabled),\n args: {\n label: 'Textfield Disabled',\n disabled: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.readonly),\n args: {\n label: 'Textfield Readonly',\n readonly: true,\n value: 'This input is readonly',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.required),\n args: {\n label: 'Textfield Required',\n required: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.error),\n args: {\n label: 'Textfield Error',\n error: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.errorDescription),\n args: {\n label: 'Textfield Error Description',\n description: 'Make sure to be valid.',\n error: true,\n errorDescription: 'This input has an error.',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.success),\n args: {\n label: 'Textfield Success',\n success: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.maxlength),\n args: {\n label: 'Textfield Max Length',\n maxlength: 10,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.minlength),\n args: {\n label: 'Textfield Min Length',\n minlength: 10,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.pattern),\n args: {\n label: 'Textfield Pattern',\n pattern: '[0-9]+',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.autocomplete),\n args: {\n label: 'Textfield Autocomplete',\n autocomplete: 'on',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.multiple),\n args: {\n label: 'Textfield Multiple',\n type: 'email',\n multiple: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.autofocus),\n args: {\n label: 'Textfield Autofocus',\n autofocus: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtextarea>(x => x.fluid),\n args: {\n label: 'Fluid',\n fluid: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: 'leadingInputSlot',\n description:\n 'Content to be placed before the input text, within the input container.',\n args: {\n label: 'Leading Input',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-badge\n slot=\"leading-input\"\n label=\"test\"\n dismissible\n data-class=\"ml-1\"\n ></nv-badge>\n </nv-fieldtext>\n ),\n },\n {\n name: 'labelSlot',\n description:\n 'Content to be placed as the label, will override the label prop.',\n args: {\n label: 'Original Label',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"label\">Label Slot</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'descriptionSlot',\n description:\n 'Content to be placed as the description, will override the description prop.',\n args: {\n label: 'Description Slot',\n description: 'Original description',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"description\">Custom Description</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'errorDescriptionSlot',\n description:\n 'Content to be placed as the error description, will override the errorDescription prop.',\n args: {\n label: 'Error Description Slot',\n errorDescription: 'Original error description',\n error: true,\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"error-description\">Custom Error Description</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'beforeInputSlot',\n description:\n 'Content to be placed before the input text, outside the input container.',\n args: {\n label: 'Before Input Slot',\n description: 'Description will show here',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-button slot=\"before-input\">Before Input Slot</nv-button>\n </nv-fieldtext>\n ),\n },\n {\n name: 'afterInputSlot',\n description:\n 'Content to be placed after the input text, outside the input container.',\n args: {\n label: 'After Input Slot',\n description: 'Description will show here',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-button slot=\"after-input\">After Input Slot</nv-button>\n </nv-fieldtext>\n ),\n },\n ],\n};\n\nexport default NvFieldtextDocs;\n"]}
1
+ {"version":3,"file":"nv-fieldtext.docs.js","sourceRoot":"","sources":["../../../src/components/nv-fieldtext/nv-fieldtext.docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,eAAe,GAAqC;IACxD,SAAS,EAAE,cAAc;IACzB,aAAa,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IACxC,OAAO,EAAE;QACP;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;YAClD,IAAI,EAAE;gBACJ,KAAK,EAAE,iBAAiB;aACzB;YACD,QAAQ,EAAE,kDAAiD;SAC5D;QACD;YACE,IAAI,EAAE,MAAM,CAAyB,CAAC,CAAC,EAAE,CAAC,C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ACzB,WAAW,EAAE,4BAA4B;aAC1C;YACD,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,aAAa,uBAA6B,CAC7C,CAChB;SACF;KACF;CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\nimport { nameof } from '../../utils/class.utils';\n\nconst NvFieldtextDocs: NovaDocs<Components.NvFieldtext> = {\n component: 'nv-fieldtext',\n subcomponents: ['nv-badge', 'nv-button'],\n stories: [\n {\n name: 'Default',\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.label),\n args: {\n label: 'Textfield Label',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.description),\n args: {\n label: 'Textfield Description',\n description: 'Description will show here',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.placeholder),\n args: {\n label: 'Textfield Placeholder',\n placeholder: 'Type something...',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.name),\n args: {\n label: 'Textfield Name',\n name: 'name',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.value),\n args: {\n label: 'Textfield Value',\n value: 'value',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.type),\n args: {\n label: 'Textfield Type',\n type: 'email',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.disabled),\n args: {\n label: 'Textfield Disabled',\n disabled: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.readonly),\n args: {\n label: 'Textfield Readonly',\n readonly: true,\n value: 'This input is readonly',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.required),\n args: {\n label: 'Textfield Required',\n required: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.error),\n args: {\n label: 'Textfield Error',\n error: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.errorDescription),\n args: {\n label: 'Textfield Error Description',\n description: 'Make sure to be valid.',\n error: true,\n errorDescription: 'This input has an error.',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.success),\n args: {\n label: 'Textfield Success',\n success: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.maxlength),\n args: {\n label: 'Textfield Max Length',\n maxlength: 10,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.minlength),\n args: {\n label: 'Textfield Min Length',\n minlength: 10,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.pattern),\n args: {\n label: 'Textfield Pattern',\n pattern: '[0-9]+',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.autocomplete),\n args: {\n label: 'Textfield Autocomplete',\n autocomplete: 'on',\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.multiple),\n args: {\n label: 'Textfield Multiple',\n type: 'email',\n multiple: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtext>(x => x.autofocus),\n args: {\n label: 'Textfield Autofocus',\n autofocus: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: nameof<Components.NvFieldtextarea>(x => x.fluid),\n args: {\n label: 'Fluid',\n fluid: true,\n },\n template: <nv-fieldtext data-storybook-args></nv-fieldtext>,\n },\n {\n name: 'leadingInputSlot',\n description:\n 'Content to be placed before the input text, within the input container.',\n args: {\n label: 'Leading Input',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-badge slot=\"leading-input\" label=\"test\" dismissible></nv-badge>\n </nv-fieldtext>\n ),\n },\n {\n name: 'trailingInputSlot',\n description:\n 'Content to be placed after the input text, within the input container.',\n args: {\n label: 'Trailing Input',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"trailing-input\">MWh</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'labelSlot',\n description:\n 'Content to be placed as the label, will override the label prop.',\n args: {\n label: 'Original Label',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"label\">Label Slot</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'descriptionSlot',\n description:\n 'Content to be placed as the description, will override the description prop.',\n args: {\n label: 'Description Slot',\n description: 'Original description',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"description\">Custom Description</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'errorDescriptionSlot',\n description:\n 'Content to be placed as the error description, will override the errorDescription prop.',\n args: {\n label: 'Error Description Slot',\n errorDescription: 'Original error description',\n error: true,\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <span slot=\"error-description\">Custom Error Description</span>\n </nv-fieldtext>\n ),\n },\n {\n name: 'beforeInputSlot',\n description:\n 'Content to be placed before the input text, outside the input container.',\n args: {\n label: 'Before Input Slot',\n description: 'Description will show here',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-button slot=\"before-input\">Before Input Slot</nv-button>\n </nv-fieldtext>\n ),\n },\n {\n name: 'afterInputSlot',\n description:\n 'Content to be placed after the input text, outside the input container.',\n args: {\n label: 'After Input Slot',\n description: 'Description will show here',\n },\n template: (\n <nv-fieldtext data-storybook-args>\n <nv-button slot=\"after-input\">After Input Slot</nv-button>\n </nv-fieldtext>\n ),\n },\n ],\n};\n\nexport default NvFieldtextDocs;\n"]}
@@ -2,6 +2,7 @@ import { Host, h, } from "@stencil/core";
2
2
  import { v4 as uuidv4 } from "uuid";
3
3
  /**
4
4
  * @slot leading-input - Content to be placed before the input text, within the input container.
5
+ * @slot trailing-input - Content to be placed after the input text, within the input container.
5
6
  * @slot before-input - Content to be placed before the input text, outside the input container.
6
7
  * @slot after-input - Content to be placed after the input text, outside the input container.
7
8
  * @slot label - Content to be placed as the label, will override the label prop.
@@ -110,9 +111,9 @@ export class NvFieldtext {
110
111
  /****************************************************************************/
111
112
  //#region RENDER
112
113
  render() {
113
- return (h(Host, { key: '665db2bee3d93ad7a21f641bc93b0c9d31bf9caf' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '96d2e16c149fdd538f56710ec8bae7a39e89de25', htmlFor: this.inputId }, h("slot", { key: '67b7b1d0419586aedf4fee36535b8f6cd1547c6a', name: "label" }, this.label))), h("div", { key: 'fe6fd071352f58280a472238578861869427c44b', class: "input-wrapper" }, h("slot", { key: '064dae2965497936609689003e6ee46b5f860951', name: "before-input" }), h("div", { key: '2488ba16be15c15652e79e0f1b977b8eae5cc01e', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: '9100ed738f0ad58787aefdea48fe03c07903366b', name: "leading-input" }), h("input", { key: '82f96798277edfe64cc570c62b3cb42e034d7199', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: this.type, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, autofocus: this.autofocus, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), this.error && (h("nv-icon", { key: 'e7502bb7e97f50ec5b768248b1656364c6dec78c', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '1d20db97498c253b7d537c2bd2b083aa7a3fb59a', name: "circle-check", class: "validation", size: "md" }))), h("slot", { key: 'f5c711f25dfc635b507b10db4b91bfa9910988d2', name: "after-input" })), (this.description ||
114
- this.el.querySelector('[slot="description"]')) && (h("div", { key: '1eca7c8d8b44f2c58a42f3c82b328148b6922a36', class: "description" }, h("slot", { key: 'ab645d19fc865f3e45c1adc164c5ea47600e7cc5', name: "description" }, this.description))), (this.errorDescription ||
115
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '7e76601eab36ebfd9f17113f602f1070c2ac27cc', hidden: !this.error, class: "error-description" }, h("slot", { key: '26b8af79934a57af720a1058f75c82fe51edf221', name: "error-description" }, this.errorDescription)))));
114
+ return (h(Host, { key: '852a919f0fcf19b0b67ddf6b0cc2762fc41c9388' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '3c99f456e76ddbc6ec21d3390aea76f849d72b88', htmlFor: this.inputId }, h("slot", { key: '5a11c6f3f0f56b8ab05d0390fec6bd1b15763d02', name: "label" }, this.label))), h("div", { key: 'a305c2ffb63cfd66c70d0074fc62c823cce37f8e', class: "input-wrapper" }, h("slot", { key: '0efd115ea0805160dee0c4b58ad137be2aabc741', name: "before-input" }), h("div", { key: 'ccaaa74adf0df1667bc971eaedb4b9883061851d', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: 'f81025cb44b30e185b3057527cdc2a1662f5252a', name: "leading-input" }), h("input", { key: 'a8b2356d0b5372823f3da9f053d0de8e28bf8c08', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: this.type, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, autofocus: this.autofocus, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), h("slot", { key: 'aa531021a4d3db52839c280cda21d06be6deaa79', name: "trailing-input" }), this.error && (h("nv-icon", { key: 'fc590ef5879887b2990912b16cc247db875af237', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '68023589dc8340647b1aa5fa07f1b9bda248049d', name: "circle-check", class: "validation", size: "md" }))), h("slot", { key: '3d0a53914d87559eab76f4d0b8165ad1d7e4eccf', name: "after-input" })), (this.description ||
115
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: '8641ee0c8638ec43d5a3da0d08ed29991cedfc6a', class: "description" }, h("slot", { key: 'fe4ee537f946b69ef9908f1d086046b03c777f90', name: "description" }, this.description))), (this.errorDescription ||
116
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '865c34d486b86223fbbbc81f22cd3428e4110af8', hidden: !this.error, class: "error-description" }, h("slot", { key: 'ac80b543c58bed6db534b8f1571a70aabf811918', name: "error-description" }, this.errorDescription)))));
116
117
  }
117
118
  static get is() { return "nv-fieldtext"; }
118
119
  static get formAssociated() { return true; }
@@ -1 +1 @@
1
- {"version":3,"file":"nv-fieldtext.js","sourceRoot":"","sources":["../../../src/components/nv-fieldtext/nv-fieldtext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EAEL,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC;;;;;;;GAOG;AAOH,MAAM,OAAO,WAAW;IANxB;QAkCE,uBAAuB;QACvB,8EAA8E;QAC9E,oBAAoB;QAEpB;;;;;WAKG;QAEM,YAAO,GAAW,MAAM,EAAE,CAAC;QA2CpC;;;;;WAKG;QAEH,SAAI,GAA6B,MAAM,CAAC;QAExC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;WAGG;QAEM,aAAQ,GAAY,KAAK,CAAC;QAEnC;;;;WAIG;QAEH,UAAK,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{ TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldtext',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldtext.scss',\n})\nexport class NvFieldtext {\n @Element() el: HTMLNvFieldtextElement;\n private inputElement!: HTMLInputElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Text Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n /**\n * Type of the input.\n * @deprecated use type instead.\n */\n @Prop({ reflect: true })\n readonly textInputType: 'text' | 'tel' | 'email';\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It’s a great way to provide examples or suggestions directly\n * in the field before they start typing.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input’s data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * The type prop lets you specify what kind of information the input field\n * should accept. Choose 'text' for general words or sentences, 'tel' for\n * phone numbers, or 'email' for email addresses. This makes sure users get\n * the right keyboard and validation for what they need to enter.\n */\n @Prop({ reflect: true, mutable: true })\n type: 'text' | 'tel' | 'email' = 'text';\n\n /**\n * The disabled prop lets you turn off the input field so that users can’t\n * type in it. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the input field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the input field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the textfield\n * field.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription?: string;\n\n /**\n * Changes the input field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Limits how many characters users can type into the input field. It’s\n * helpful for making sure users don’t enter too much information, keeping\n * their input within the allowed limit.\n */\n @Prop({ reflect: true })\n readonly maxlength: number;\n\n /**\n * Ensures that users type at least a certain number of characters into the\n * input field. It’s a way to make sure users provide enough information\n * before moving on.\n */\n @Prop({ reflect: true })\n readonly minlength: number;\n\n /**\n * Set rules for how the input should be formatted. For example, you can\n * require that a phone number includes only digits or that an email address\n * has the correct format. If users don’t follow these rules, they’ll get a\n * prompt to correct their input after the form is submitted.\n */\n @Prop({ reflect: true })\n readonly pattern: string;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they’ve used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}`;\n\n /**\n * When used with the email input type, this prop enables the field to accept\n * multiple email addresses. Users can enter several addresses, separating\n * each one with a comma, allowing the form to handle multiple recipients.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the input event on the input element.\n * Emits the inputChanged event with the new value.\n * @param {Event} event - Event object of the input event.\n */\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.valueChanged.emit(input.value);\n };\n\n /**\n * Handles focus when the input container is clicked.\n */\n private handleInputContainerClick = () => {\n this.inputElement.focus();\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n if (this.textInputType) {\n this.type = this.textInputType;\n }\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\" onClick={this.handleInputContainerClick}>\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n type={this.type}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n maxlength={this.maxlength}\n minlength={this.minlength}\n pattern={this.pattern}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n multiple={this.multiple}\n value={this.value}\n onInput={this.handleInput}\n />\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
1
+ {"version":3,"file":"nv-fieldtext.js","sourceRoot":"","sources":["../../../src/components/nv-fieldtext/nv-fieldtext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EAEL,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC;;;;;;;;GAQG;AAOH,MAAM,OAAO,WAAW;IANxB;QAkCE,uBAAuB;QACvB,8EAA8E;QAC9E,oBAAoB;QAEpB;;;;;WAKG;QAEM,YAAO,GAAW,MAAM,EAAE,CAAC;QA2CpC;;;;;WAKG;QAEH,SAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot trailing-input - Content to be placed after the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldtext',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldtext.scss',\n})\nexport class NvFieldtext {\n @Element() el: HTMLNvFieldtextElement;\n private inputElement!: HTMLInputElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Text Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n /**\n * Type of the input.\n * @deprecated use type instead.\n */\n @Prop({ reflect: true })\n readonly textInputType: 'text' | 'tel' | 'email';\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It’s a great way to provide examples or suggestions directly\n * in the field before they start typing.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input’s data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * The type prop lets you specify what kind of information the input field\n * should accept. Choose 'text' for general words or sentences, 'tel' for\n * phone numbers, or 'email' for email addresses. This makes sure users get\n * the right keyboard and validation for what they need to enter.\n */\n @Prop({ reflect: true, mutable: true })\n type: 'text' | 'tel' | 'email' = 'text';\n\n /**\n * The disabled prop lets you turn off the input field so that users can’t\n * type in it. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the input field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the input field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the textfield\n * field.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription?: string;\n\n /**\n * Changes the input field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Limits how many characters users can type into the input field. It’s\n * helpful for making sure users don’t enter too much information, keeping\n * their input within the allowed limit.\n */\n @Prop({ reflect: true })\n readonly maxlength: number;\n\n /**\n * Ensures that users type at least a certain number of characters into the\n * input field. It’s a way to make sure users provide enough information\n * before moving on.\n */\n @Prop({ reflect: true })\n readonly minlength: number;\n\n /**\n * Set rules for how the input should be formatted. For example, you can\n * require that a phone number includes only digits or that an email address\n * has the correct format. If users don’t follow these rules, they’ll get a\n * prompt to correct their input after the form is submitted.\n */\n @Prop({ reflect: true })\n readonly pattern: string;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they’ve used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}`;\n\n /**\n * When used with the email input type, this prop enables the field to accept\n * multiple email addresses. Users can enter several addresses, separating\n * each one with a comma, allowing the form to handle multiple recipients.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the input event on the input element.\n * Emits the inputChanged event with the new value.\n * @param {Event} event - Event object of the input event.\n */\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.valueChanged.emit(input.value);\n };\n\n /**\n * Handles focus when the input container is clicked.\n */\n private handleInputContainerClick = () => {\n this.inputElement.focus();\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n if (this.textInputType) {\n this.type = this.textInputType;\n }\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\" onClick={this.handleInputContainerClick}>\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n type={this.type}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n maxlength={this.maxlength}\n minlength={this.minlength}\n pattern={this.pattern}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n multiple={this.multiple}\n value={this.value}\n onInput={this.handleInput}\n />\n\n <slot name=\"trailing-input\"></slot>\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
@@ -37,7 +37,7 @@ nv-fieldtextarea[error]:not([error=false]) {
37
37
  --nv-field-border-focus: var(--nv-field-border-default);
38
38
  --nv-field-border-disabled: var(--nv-field-border-default);
39
39
  --nv-field-border-readonly: var(--nv-field-border-default);
40
- --nv-field-focus-box-shadow: var(--color-focus-destructive);
40
+ --nv-field-focus-box-shadow: var(--color-focus-destructive-in-field);
41
41
  }
42
42
  nv-fieldtextarea[success]:not([success=false]) {
43
43
  --nv-field-border-default: var(--components-form-field-border-success);
@@ -146,7 +146,10 @@ nv-fieldtextarea .textarea-wrapper .textarea-container nv-icon.validation {
146
146
  color: var(--nv-field-border-default);
147
147
  }
148
148
  nv-fieldtextarea .description {
149
+ display: flex;
150
+ align-items: center;
149
151
  align-self: stretch;
152
+ gap: var(--spacing-1);
150
153
  color: var(--components-form-text-description-default);
151
154
  font-family: "TT Norms Pro", sans-serif;
152
155
  font-size: var(--form-description-font-size);
@@ -154,7 +157,10 @@ nv-fieldtextarea .description {
154
157
  line-height: var(--form-description-line-height);
155
158
  }
156
159
  nv-fieldtextarea .error-description {
160
+ display: flex;
161
+ align-items: center;
157
162
  align-self: stretch;
163
+ gap: var(--spacing-1);
158
164
  color: var(--components-form-text-description-default);
159
165
  font-family: "TT Norms Pro", sans-serif;
160
166
  font-size: var(--form-description-font-size);
@@ -177,9 +177,9 @@ export class NvFieldtextarea {
177
177
  /****************************************************************************/
178
178
  //#region RENDER
179
179
  render() {
180
- return (h(Host, { key: '26197bbab1a4b4571fdb55c8191e6b7879d58504' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'f3f9465b6917b669cd2f8a363bbe719259bda4c4', htmlFor: this.inputId }, h("slot", { key: '81cda2c75f3dbaeace4c0a713083ba1d71738334', name: "label" }, this.label))), h("div", { key: '7c8ce38e9ae3b5524205017add5470ba46cecc20', class: "textarea-wrapper" }, h("div", { key: 'c32da51694a84c55c092838a62801b4e57ab12ac', class: "textarea-container", onClick: this.handleTextareaContainerClick }, h("textarea", { key: '1b3d130b68595c7f49097494e98848e5523ba34d', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
181
- this.el.querySelector('[slot="description"]')) && (h("div", { key: 'ed32145e5c6eb3b5c481835e578c264f24e7a576', class: "description" }, h("slot", { key: '9ca5a874ff2bb5deb377ce8d5fb91235ec754ab0', name: "description" }, this.description))), (this.errorDescription ||
182
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'e858235ef7f47e0849757a718617ebc2877f4ac7', hidden: !this.error, class: "error-description" }, h("slot", { key: '91e053ef76274532046acad6db63e40787a3059f', name: "error-description" }, this.errorDescription)))));
180
+ return (h(Host, { key: '405a8423bb391cc8c1e32d8d64ab587c71b355d1' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'dc5a90e0f9cde1946966cb5b2ad98050c6740869', htmlFor: this.inputId }, h("slot", { key: 'a2c78f23289fcdb742000fa949b98359441268dc', name: "label" }, this.label))), h("div", { key: 'be9840925f442ad964597e77d7c6b9b29b5bae0f', class: "textarea-wrapper" }, h("div", { key: '11b986940cfff801c6599f03850b1fc8c5cf2800', class: "textarea-container", onClick: this.handleTextareaContainerClick }, h("textarea", { key: 'b4d7bbec6ed6d38545935eef997fbc73499bdc15', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
181
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: 'fc2b00df7fccc60ee9ff1f04cd81e059839b29c0', class: "description" }, h("slot", { key: '9cfaf267dfec3412a5a09ee8fe64b244fda69c7b', name: "description" }, this.description))), (this.errorDescription ||
182
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'a56439ef49efeffe303d13f56a0b00f648a7979d', hidden: !this.error, class: "error-description" }, h("slot", { key: '5337f43770894cf6898fcbdc3b77f8a337061597', name: "error-description" }, this.errorDescription)))));
183
183
  }
184
184
  static get is() { return "nv-fieldtextarea"; }
185
185
  static get formAssociated() { return true; }
@@ -970,26 +970,26 @@ export class NvFieldtime {
970
970
  }, key: `${option}-${index}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
971
971
  }
972
972
  render() {
973
- return (h(Host, { key: '35103e6a56955d04ad395b286aaaeaca1493a20e', onclick: e => this.handleHostClick(e) }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '38ffb7ddf37dc7d3f355975c3ae348f5581d384a', htmlFor: this.inputId }, h("slot", { key: '1c41f684aaefd52ae677837ffd55a9895b95524a', name: "label" }, this.label))), h("nv-popover", { key: '325272affdd386690964974b73579f7314e8b464', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '707b2fcd563ea92b818bf5599f8f68f7425fbdc6', class: "input-wrapper", slot: "trigger" }, h("slot", { key: '813597cca8808f9f298eadc8a0dde73714bfcff3', name: "before-input" }), h("div", { key: '47f26e41427825610e37380c929b24dcddb2dc62', class: "input-container" }, h("slot", { key: 'fd17ba01bb66bfcb9972a8145f31f94c8ef21fe1', name: "leading-input" }), startsWithIgnoreCase(this.format, 'HH') && [
974
- h("input", { key: '759608690e370bdb8a61f2d622133558c77c6d0c', ref: el => (this.inputElements[TimeType.Hours] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.hours, onInput: e => this.handleInputChange(e, TimeType.Hours), placeholder: this.format.includes('hh') ? 'hh' : 'HH', inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Hours), name: this.name
973
+ return (h(Host, { key: 'f2e316b464ef324043fca47a25d7511fed662fe9', onclick: e => this.handleHostClick(e) }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '738dd3f9ba307a21ad7f16f77eb09f4f9fed8ccb', htmlFor: this.inputId }, h("slot", { key: '8106132899c67bbc7e9ffb82caf575d599239b9a', name: "label" }, this.label))), h("nv-popover", { key: '8306d0204039862466d83c7e5e2f42b87ea331c4', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '0355aee332a5c5cd2492f22b7d820625273c74e6', class: "input-wrapper", slot: "trigger" }, h("slot", { key: 'a6aaeaba4901b4fe0b0266796c84531d57fbb719', name: "before-input" }), h("div", { key: 'ae78ff8fc1a857a0da7be6e3c29464dbc0b80771', class: "input-container" }, h("slot", { key: '6455a51b2f1edf565ac754e61ac773a920f319d4', name: "leading-input" }), startsWithIgnoreCase(this.format, 'HH') && [
974
+ h("input", { key: '9a48b8ea04698b9443774a2e2bf41383144ba29a', ref: el => (this.inputElements[TimeType.Hours] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.hours, onInput: e => this.handleInputChange(e, TimeType.Hours), placeholder: this.format.includes('hh') ? 'hh' : 'HH', inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Hours), name: this.name
975
975
  ? `${TimeType.Hours}-${this.name}`
976
976
  : TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
977
977
  ], this.format.includes('mm') && [
978
- h("span", { key: 'a377170431ef27f284d368e56d6236c64067e0ca' }, ":"),
979
- h("input", { key: '6cc8faeed02d689a1353966888b0b4dedd8ecb98', ref: el => (this.inputElements[TimeType.Minutes] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.minutes, onInput: e => this.handleInputChange(e, TimeType.Minutes), placeholder: "mm", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Minutes), name: this.name
978
+ h("span", { key: '5f75d09a90c0a8f6f106eb3e24f4f342fcc36d67' }, ":"),
979
+ h("input", { key: 'b3cc508705147ea07218a037f21f425deb9b94af', ref: el => (this.inputElements[TimeType.Minutes] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.minutes, onInput: e => this.handleInputChange(e, TimeType.Minutes), placeholder: "mm", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Minutes), name: this.name
980
980
  ? `${TimeType.Minutes}-${this.name}`
981
981
  : TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
982
982
  ], this.format.includes('ss') && [
983
- h("span", { key: '13da159f3ff13969d501968881569658d06c50fb' }, ":"),
984
- h("input", { key: 'cbac3e8a980397c8f32e1f1056aec8b7aab3be0b', ref: el => (this.inputElements[TimeType.Seconds] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.seconds, onInput: e => this.handleInputChange(e, TimeType.Seconds), placeholder: "ss", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Seconds), name: this.name
983
+ h("span", { key: '00b9320c275b027f9b2fbbebc1f56431783c874e' }, ":"),
984
+ h("input", { key: '3421fb11a4c9d9ba58bbf6f809070ce35d3d1ad6', ref: el => (this.inputElements[TimeType.Seconds] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.seconds, onInput: e => this.handleInputChange(e, TimeType.Seconds), placeholder: "ss", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Seconds), name: this.name
985
985
  ? `${TimeType.Seconds}-${this.name}`
986
986
  : TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
987
- ], h("nv-iconbutton", { key: 'a1a59be923f3529d1d2dbad02b322306fdd6dcb6', name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', "aria-pressed": this.open.toString(), onClick: () => this.HandleDropdownIconClick() }), this.error && (h("nv-icon", { key: '7f51d7b568096e6aee23560d5fe6e52018711aa3', name: "alert-circle", class: "validation", size: "sm" })), this.success && (h("nv-icon", { key: '1c94f8138e808ec3a7690079dc8c8ea210ebb1da', name: "circle-check", class: "validation", size: "sm" }))), h("slot", { key: '7aa247775d7f59eb452fa9f4b511b3a92c88b8fe', name: "after-input" })), h("div", { key: 'b4dab6c5161e69b217748916026f41d9157bb786', class: "time-dropdown", slot: "content" }, h("div", { key: '6d865e6aa3b4d278e4ebff064d417ea42c1d4fe1', class: "time-columns" }, startsWithIgnoreCase(this.format, 'HH') &&
987
+ ], h("nv-iconbutton", { key: 'c61dc8780e1d668f2bf11ac2ace21b89ed460fdb', name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', "aria-pressed": this.open.toString(), onClick: () => this.HandleDropdownIconClick() }), this.error && (h("nv-icon", { key: '5963651793c9c1ec5d47be2a8cea9fed22490bb9', name: "alert-circle", class: "validation", size: "sm" })), this.success && (h("nv-icon", { key: '79953118d4206363f97ffb8d69dd76545795e419', name: "circle-check", class: "validation", size: "sm" }))), h("slot", { key: 'd0a8c104a671f997e6a9da223baa2a37dd3bf349', name: "after-input" })), h("div", { key: '7dec8335599d59e116065bdb0053a9096acaae88', class: "time-dropdown", slot: "content" }, h("div", { key: 'be7d3a3fa7b4def66a7ebdf2f29b489540fa5802', class: "time-columns" }, startsWithIgnoreCase(this.format, 'HH') &&
988
988
  this.RenderTimeOptionsColumn(TimeType.Hours), this.format.includes('mm') &&
989
989
  this.RenderTimeOptionsColumn(TimeType.Minutes), this.format.includes('ss') &&
990
990
  this.RenderTimeOptionsColumn(TimeType.Seconds)))), (this.description ||
991
- this.el.querySelector('[slot="description"]')) && (h("div", { key: '03922dee26128b93d4e8d7f936ada9d3981d1e36', class: "description" }, h("slot", { key: '4aa71a2b10e488c845106aace0a972df790eb450', name: "description" }, this.description))), (this.errorDescription ||
992
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '657232381bcc3644eae65a1beae302c8136b9e8b', hidden: !this.error, class: "error-description" }, h("slot", { key: '0559dbdb62c70b19c73839a2795dc23fa97eddb1', name: "error-description" }, this.errorDescription)))));
991
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: 'ec98cc31482efab33ace4e0bf62c6d5d82890df5', class: "description" }, h("slot", { key: '307b134933cca699d6f00d891a440281f2427d79', name: "description" }, this.description))), (this.errorDescription ||
992
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '71763de75be4e9f14e1cd1788ca06f2265a46d7e', hidden: !this.error, class: "error-description" }, h("slot", { key: 'dbe05c00515a5ccf1b4ba4736b943cfd8cefaaa0', name: "error-description" }, this.errorDescription)))));
993
993
  }
994
994
  static get is() { return "nv-fieldtime"; }
995
995
  static get formAssociated() { return true; }
@@ -34,7 +34,7 @@ nv-fieldtime[error]:not([error=false]) {
34
34
  --nv-field-border-focus: var(--nv-field-border-default);
35
35
  --nv-field-border-disabled: var(--nv-field-border-default);
36
36
  --nv-field-border-readonly: var(--nv-field-border-default);
37
- --nv-field-focus-box-shadow: var(--color-focus-destructive);
37
+ --nv-field-focus-box-shadow: var(--color-focus-destructive-in-field);
38
38
  }
39
39
  nv-fieldtime[success]:not([success=false]) {
40
40
  --nv-field-border-default: var(--components-form-field-border-success);
@@ -184,7 +184,10 @@ nv-fieldtime .input-container:focus, nv-fieldtime .input-container:focus-within
184
184
  box-shadow: 0px 0px 0px var(--focus-field-stroke) var(--color-focus-brand);
185
185
  }
186
186
  nv-fieldtime .description {
187
+ display: flex;
188
+ align-items: center;
187
189
  align-self: stretch;
190
+ gap: var(--spacing-1);
188
191
  color: var(--components-form-text-description-default);
189
192
  font-family: "TT Norms Pro", sans-serif;
190
193
  font-size: var(--form-description-font-size);
@@ -192,7 +195,10 @@ nv-fieldtime .description {
192
195
  line-height: var(--form-description-line-height);
193
196
  }
194
197
  nv-fieldtime .error-description {
198
+ display: flex;
199
+ align-items: center;
195
200
  align-self: stretch;
201
+ gap: var(--spacing-1);
196
202
  color: var(--components-form-text-description-default);
197
203
  font-family: "TT Norms Pro", sans-serif;
198
204
  font-size: var(--form-description-font-size);
@@ -48,7 +48,7 @@ export class NvIcon {
48
48
  /****************************************************************************/
49
49
  //#region RENDER
50
50
  render() {
51
- return (h(Host, { key: '2d362e97f36cae0caf67d7110726cab752d87479', class: clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, h("svg", { key: 'd5bf8a4f2d733f6e5b0cdb5063c1dbafa13ea25c', stroke: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: `nv-icon-${this.size}` }, h("use", { key: '1bd69a2350e76dbcfdec3fa4ecc5c0fca9da0a9f', href: `#${this.name}` }))));
51
+ return (h(Host, { key: '107d58f8858951a11af7bc23be7ae8564ece6b15', class: clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, h("svg", { key: '3e7d4827757d59019b3661a5994d99c5eca995f2', stroke: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: `nv-icon-${this.size}` }, h("use", { key: '0bc93cc49237854d5a8ca2bb50c25e7660c2dfa1', href: `#${this.name}` }))));
52
52
  }
53
53
  static get is() { return "nv-icon"; }
54
54
  static get originalStyleUrls() {
@@ -34,6 +34,7 @@ export const iconNames = [
34
34
  'arrows-move',
35
35
  'aspect-ratio',
36
36
  'atom',
37
+ 'ban',
37
38
  'basket',
38
39
  'battery-1',
39
40
  'battery-2',