@aquera/nile-elements 1.5.2 → 1.5.3

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 (517) hide show
  1. package/README.md +6 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +239 -195
  5. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  8. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  9. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
  10. package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
  11. package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
  12. package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
  13. package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
  14. package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
  15. package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
  16. package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
  17. package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
  18. package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
  19. package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
  20. package/dist/nile-file-preview/utils/index.cjs.js +1 -1
  21. package/dist/nile-file-preview/utils/index.esm.js +1 -1
  22. package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
  23. package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
  24. package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
  25. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  26. package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
  27. package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
  28. package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
  29. package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
  30. package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
  31. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
  32. package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
  33. package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
  34. package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
  35. package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
  36. package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
  37. package/dist/nile-file-upload/types/index.cjs.js +1 -1
  38. package/dist/nile-file-upload/types/index.esm.js +1 -1
  39. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
  40. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
  41. package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
  42. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
  43. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  44. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  45. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
  46. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
  47. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
  48. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
  49. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
  50. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
  51. package/dist/nile-grid/nile-grid.cjs.js +1 -1
  52. package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
  53. package/dist/nile-grid/nile-grid.esm.js +2 -2
  54. package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
  55. package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
  56. package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
  57. package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
  58. package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
  59. package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
  60. package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
  61. package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
  62. package/dist/nile-grid/nile-grid.width.esm.js +1 -1
  63. package/dist/nile-input/nile-input.cjs.js +1 -1
  64. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  65. package/dist/nile-input/nile-input.esm.js +1 -1
  66. package/dist/nile-popover/index.cjs.js +1 -1
  67. package/dist/nile-popover/index.esm.js +1 -1
  68. package/dist/nile-popover/nile-popover.cjs.js +4 -4
  69. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  70. package/dist/nile-popover/nile-popover.esm.js +11 -6
  71. package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
  72. package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
  73. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
  74. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  75. package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
  76. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  77. package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
  78. package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
  79. package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
  80. package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
  81. package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
  82. package/dist/src/nile-badge/nile-badge.test.js +554 -35
  83. package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
  84. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
  85. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
  86. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
  87. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
  88. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
  89. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
  90. package/dist/src/nile-button/nile-button.test.js +499 -39
  91. package/dist/src/nile-button/nile-button.test.js.map +1 -1
  92. package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
  93. package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
  94. package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
  95. package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
  96. package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
  97. package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
  98. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
  99. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
  100. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
  101. package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
  102. package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
  103. package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
  104. package/dist/src/nile-card/nile-card.test.js +102 -66
  105. package/dist/src/nile-card/nile-card.test.js.map +1 -1
  106. package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
  107. package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
  108. package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
  109. package/dist/src/nile-chip/nile-chip.test.js +101 -102
  110. package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
  111. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
  112. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
  113. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
  114. package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
  115. package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
  116. package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
  117. package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
  118. package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
  119. package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
  120. package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
  121. package/dist/src/nile-divider/nile-divider.test.js +560 -0
  122. package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
  123. package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
  124. package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
  125. package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
  126. package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
  127. package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
  128. package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
  129. package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
  130. package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
  131. package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
  132. package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
  133. package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
  134. package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
  135. package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
  136. package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
  137. package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
  138. package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
  139. package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
  140. package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
  141. package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
  142. package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
  143. package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
  144. package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
  145. package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
  146. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
  147. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
  148. package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
  149. package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
  150. package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
  151. package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
  152. package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
  153. package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
  154. package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
  155. package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
  156. package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
  157. package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
  158. package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
  159. package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
  160. package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
  161. package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
  162. package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
  163. package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
  164. package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
  165. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  166. package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
  167. package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
  168. package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
  169. package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
  170. package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
  171. package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
  172. package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
  173. package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
  174. package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
  175. package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
  176. package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
  177. package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
  178. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
  179. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
  180. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
  181. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
  182. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
  183. package/dist/src/nile-grid/nile-grid.d.ts +1 -0
  184. package/dist/src/nile-grid/nile-grid.js +5 -1
  185. package/dist/src/nile-grid/nile-grid.js.map +1 -1
  186. package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
  187. package/dist/src/nile-grid/nile-grid.utils.js +13 -0
  188. package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
  189. package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
  190. package/dist/src/nile-heading/nile-heading.test.js +108 -0
  191. package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
  192. package/dist/src/nile-hero/nile-hero.test.js +101 -38
  193. package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
  194. package/dist/src/nile-icon/nile-icon.test.js +103 -40
  195. package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
  196. package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
  197. package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
  198. package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
  199. package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
  200. package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
  201. package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
  202. package/dist/src/nile-input/nile-input.js +1 -1
  203. package/dist/src/nile-input/nile-input.js.map +1 -1
  204. package/dist/src/nile-input/nile-input.test.js +109 -139
  205. package/dist/src/nile-input/nile-input.test.js.map +1 -1
  206. package/dist/src/nile-link/nile-link.test.js +103 -67
  207. package/dist/src/nile-link/nile-link.test.js.map +1 -1
  208. package/dist/src/nile-list/nile-list.test.d.ts +1 -0
  209. package/dist/src/nile-list/nile-list.test.js +108 -0
  210. package/dist/src/nile-list/nile-list.test.js.map +1 -0
  211. package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
  212. package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
  213. package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
  214. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
  215. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
  216. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
  217. package/dist/src/nile-loader/nile-loader.test.js +107 -40
  218. package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
  219. package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
  220. package/dist/src/nile-menu/nile-menu.test.js +113 -0
  221. package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
  222. package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
  223. package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
  224. package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
  225. package/dist/src/nile-option/nile-option.test.d.ts +1 -0
  226. package/dist/src/nile-option/nile-option.test.js +108 -0
  227. package/dist/src/nile-option/nile-option.test.js.map +1 -0
  228. package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
  229. package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
  230. package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
  231. package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
  232. package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
  233. package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
  234. package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
  235. package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
  236. package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
  237. package/dist/src/nile-popover/nile-popover.test.js +103 -68
  238. package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
  239. package/dist/src/nile-popup/nile-popup.test.js +104 -65
  240. package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
  241. package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
  242. package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
  243. package/dist/src/nile-radio/nile-radio.test.js +103 -66
  244. package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
  245. package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
  246. package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
  247. package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
  248. package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
  249. package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
  250. package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
  251. package/dist/src/nile-select/nile-select.test.d.ts +0 -5
  252. package/dist/src/nile-select/nile-select.test.js +105 -244
  253. package/dist/src/nile-select/nile-select.test.js.map +1 -1
  254. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
  255. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
  256. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
  257. package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
  258. package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
  259. package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
  260. package/dist/src/nile-slider/nile-slider.test.js +108 -0
  261. package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
  262. package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
  263. package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
  264. package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
  265. package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
  266. package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
  267. package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
  268. package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
  269. package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
  270. package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
  271. package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
  272. package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
  273. package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
  274. package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
  275. package/dist/src/nile-tab/nile-tab.test.js +108 -0
  276. package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
  277. package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
  278. package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
  279. package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
  280. package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
  281. package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
  282. package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
  283. package/dist/src/nile-tag/nile-tag.test.js +574 -0
  284. package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
  285. package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
  286. package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
  287. package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
  288. package/dist/src/nile-title/nile-title.test.d.ts +1 -0
  289. package/dist/src/nile-title/nile-title.test.js +108 -0
  290. package/dist/src/nile-title/nile-title.test.js.map +1 -0
  291. package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
  292. package/dist/src/nile-toast/nile-toast.test.js +526 -0
  293. package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
  294. package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
  295. package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
  296. package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
  297. package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
  298. package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
  299. package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
  300. package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
  301. package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
  302. package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
  303. package/dist/src/version.js +1 -1
  304. package/dist/src/version.js.map +1 -1
  305. package/dist/tsconfig.tsbuildinfo +1 -1
  306. package/package.json +1 -1
  307. package/rollup.config.js +7 -1
  308. package/src/nile-accordion/nile-accordian.test.ts +102 -116
  309. package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
  310. package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
  311. package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
  312. package/src/nile-avatar/nile-avatar.test.ts +102 -112
  313. package/src/nile-badge/nile-badge.test.ts +642 -30
  314. package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
  315. package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
  316. package/src/nile-button/nile-button.test.ts +593 -61
  317. package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
  318. package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
  319. package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
  320. package/src/nile-calendar/nile-calendar.test.ts +102 -406
  321. package/src/nile-card/nile-card.test.ts +103 -71
  322. package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
  323. package/src/nile-chip/nile-chip.test.ts +102 -136
  324. package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
  325. package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
  326. package/src/nile-dialog/nile-dialog.test.ts +102 -164
  327. package/src/nile-divider/nile-divider.test.ts +659 -0
  328. package/src/nile-drawer/nile-drawer.test.ts +105 -105
  329. package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
  330. package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
  331. package/src/nile-error-message/nile-error-message.test.ts +104 -67
  332. package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
  333. package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
  334. package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
  335. package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
  336. package/src/nile-file-preview/nile-file-preview.ts +23 -56
  337. package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
  338. package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
  339. package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
  340. package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
  341. package/src/nile-file-upload/nile-file-upload.ts +11 -3
  342. package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
  343. package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
  344. package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
  345. package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
  346. package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
  347. package/src/nile-form-group/nile-form-group.test.ts +103 -60
  348. package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
  349. package/src/nile-format-date/nile-format-date.test.ts +106 -0
  350. package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
  351. package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
  352. package/src/nile-grid/nile-grid.ts +6 -1
  353. package/src/nile-grid/nile-grid.utils.ts +18 -1
  354. package/src/nile-heading/nile-heading.test.ts +106 -0
  355. package/src/nile-hero/nile-hero.test.ts +103 -42
  356. package/src/nile-icon/nile-icon.test.ts +103 -50
  357. package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
  358. package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
  359. package/src/nile-input/nile-input.test.ts +105 -164
  360. package/src/nile-input/nile-input.ts +1 -1
  361. package/src/nile-link/nile-link.test.ts +104 -81
  362. package/src/nile-list/nile-list.test.ts +106 -0
  363. package/src/nile-list-item/nile-list-item.test.ts +106 -0
  364. package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
  365. package/src/nile-loader/nile-loader.test.ts +103 -48
  366. package/src/nile-menu/nile-menu.test.ts +106 -0
  367. package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
  368. package/src/nile-option/nile-option.test.ts +106 -0
  369. package/src/nile-option-group/nile-option-group.test.ts +106 -0
  370. package/src/nile-page-header/nile-page-header.test.ts +106 -0
  371. package/src/nile-pagination/nile-pagination.test.ts +106 -0
  372. package/src/nile-popover/nile-popover.test.ts +103 -83
  373. package/src/nile-popup/nile-popup.test.ts +102 -82
  374. package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
  375. package/src/nile-radio/nile-radio.test.ts +103 -78
  376. package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
  377. package/src/nile-section-message/nile-section-message.test.ts +106 -0
  378. package/src/nile-select/nile-select.test.ts +105 -308
  379. package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
  380. package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
  381. package/src/nile-slider/nile-slider.test.ts +106 -0
  382. package/src/nile-spinner/nile-spinner.test.ts +668 -0
  383. package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
  384. package/src/nile-stepper/nile-stepper.test.ts +107 -0
  385. package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
  386. package/src/nile-tab/nile-tab.test.ts +106 -0
  387. package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
  388. package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
  389. package/src/nile-tag/nile-tag.test.ts +675 -0
  390. package/src/nile-textarea/nile-textarea.test.ts +104 -100
  391. package/src/nile-title/nile-title.test.ts +106 -0
  392. package/src/nile-toast/nile-toast.test.ts +625 -0
  393. package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
  394. package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
  395. package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
  396. package/vscode-html-custom-data.json +8 -3
  397. package/web-test-runner.config.mjs +4 -2
  398. package/dist/axe.min-2720cd56.esm.js +0 -1
  399. package/dist/axe.min-69d47269.cjs.js +0 -2
  400. package/dist/axe.min-69d47269.cjs.js.map +0 -1
  401. package/dist/css-tag-bb10c0fa.cjs.js +0 -6
  402. package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
  403. package/dist/css-tag-dc564feb.esm.js +0 -6
  404. package/dist/fixture-958445f8.cjs.js +0 -395
  405. package/dist/fixture-958445f8.cjs.js.map +0 -1
  406. package/dist/fixture-985bba12.esm.js +0 -569
  407. package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
  408. package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
  409. package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
  410. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
  411. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
  412. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
  413. package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
  414. package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
  415. package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
  416. package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
  417. package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
  418. package/dist/nile-badge/nile-badge.test.esm.js +0 -1
  419. package/dist/nile-button/nile-button.test.cjs.js +0 -2
  420. package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
  421. package/dist/nile-button/nile-button.test.esm.js +0 -4
  422. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
  423. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
  424. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
  425. package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
  426. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
  427. package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
  428. package/dist/nile-card/nile-card.test.cjs.js +0 -2
  429. package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
  430. package/dist/nile-card/nile-card.test.esm.js +0 -51
  431. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
  432. package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
  433. package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
  434. package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
  435. package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
  436. package/dist/nile-chip/nile-chip.test.esm.js +0 -1
  437. package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
  438. package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
  439. package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
  440. package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
  441. package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
  442. package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
  443. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
  444. package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
  445. package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
  446. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
  447. package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
  448. package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
  449. package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
  450. package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
  451. package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
  452. package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
  453. package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
  454. package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
  455. package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
  456. package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
  457. package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
  458. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
  459. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
  460. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
  461. package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
  462. package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
  463. package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
  464. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
  465. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
  466. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
  467. package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
  468. package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
  469. package/dist/nile-hero/nile-hero.test.esm.js +0 -14
  470. package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
  471. package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
  472. package/dist/nile-icon/nile-icon.test.esm.js +0 -1
  473. package/dist/nile-input/nile-input.test.cjs.js +0 -2
  474. package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
  475. package/dist/nile-input/nile-input.test.esm.js +0 -17
  476. package/dist/nile-link/nile-link.test.cjs.js +0 -2
  477. package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
  478. package/dist/nile-link/nile-link.test.esm.js +0 -1
  479. package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
  480. package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
  481. package/dist/nile-loader/nile-loader.test.esm.js +0 -1
  482. package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
  483. package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
  484. package/dist/nile-popover/nile-popover.test.esm.js +0 -21
  485. package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
  486. package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
  487. package/dist/nile-popup/nile-popup.test.esm.js +0 -1
  488. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
  489. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
  490. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
  491. package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
  492. package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
  493. package/dist/nile-radio/nile-radio.test.esm.js +0 -1
  494. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
  495. package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
  496. package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
  497. package/dist/nile-select/nile-select.test.cjs.js +0 -2
  498. package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
  499. package/dist/nile-select/nile-select.test.esm.js +0 -55
  500. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
  501. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
  502. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
  503. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
  504. package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
  505. package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
  506. package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
  507. package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
  508. package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
  509. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
  510. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
  511. package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
  512. package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
  513. package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
  514. package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
  515. package/dist/sinon-esm-68c8e378.esm.js +0 -1
  516. package/dist/sinon-esm-97570c13.cjs.js +0 -2
  517. package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
@@ -11,7 +11,8 @@ import { NileFilePreview } from './nile-file-preview';
11
11
 
12
12
  export function getHorizontalUploadingState(
13
13
  file: File,
14
- uploadStatus: number
14
+ uploadStatus: number,
15
+ nileFilePreview: NileFilePreview
15
16
  ): TemplateResult {
16
17
  return html`
17
18
  <div class="uploading" part="horizontal-uploading-state">
@@ -23,11 +24,11 @@ import { NileFilePreview } from './nile-file-preview';
23
24
  </div>
24
25
  <nile-progress-bar
25
26
  part="horizontal-progress-bar"
26
- value="${uploadStatus}"
27
+ .value="${uploadStatus}"
27
28
  ></nile-progress-bar>
28
29
  <p class="horizontal-file-name" part="horizontal-file-name">${file.name}</p>
29
30
  </div>
30
- <slot @click=${(e: CustomEvent<RemoveFileDetail>) => cancelFileUpload(file, e)} name="cancelIcon">
31
+ <slot @click=${(e: CustomEvent<RemoveFileDetail>) => cancelFileUpload(file, e, nileFilePreview)} name="cancelIcon">
31
32
  <nile-icon
32
33
  name="close"
33
34
  size="14"
@@ -41,7 +42,8 @@ import { NileFilePreview } from './nile-file-preview';
41
42
  export function getHorizontalPreviewState(
42
43
  url: string,
43
44
  file: File,
44
- originalUrl: string
45
+ originalUrl: string,
46
+ showFileType: boolean
45
47
  ): TemplateResult {
46
48
  return html`
47
49
  <div class="preview horizontal-div" part="horizontal-preview-state">
@@ -55,8 +57,14 @@ export function getHorizontalPreviewState(
55
57
  />
56
58
  </div>
57
59
  <div class="preview-file-info" part="horizontal-preview-file-info">
58
- <p part="horizontal-preview-file-info-name">${file.name}</p>
59
- <p part="horizontal-preview-file-info-type">${getFileType(file.type)} &#8226; ${formatFileSize(Number(file.size))}</p>
60
+ <p part="horizontal-preview-file-info-name">
61
+ <slot name="file-name">${file.name}</slot>
62
+ </p>
63
+ <p part="horizontal-preview-file-info-type">
64
+ <slot name="file-type">${getFileType(file, showFileType)}</slot>
65
+ &#8226;
66
+ <slot name="file-size">${formatFileSize(Number(file.size))}</slot>
67
+ </p>
60
68
  </div>
61
69
  </div>
62
70
  <div class="preview-actions" part="horizontal-preview-actions">
@@ -75,7 +83,8 @@ export function getHorizontalPreviewState(
75
83
 
76
84
  export function getHorizontalNoPreviewState(
77
85
  file: File,
78
- originalUrl: string
86
+ originalUrl: string,
87
+ showFileType: boolean
79
88
  ): TemplateResult {
80
89
  return html`
81
90
  <div class="no-preview horizontal-div" part="horizontal-no-preview-state">
@@ -84,8 +93,14 @@ export function getHorizontalNoPreviewState(
84
93
  <nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
85
94
  </div>
86
95
  <div class="preview-file-info" part="horizontal-no-preview-file-info">
87
- <p part="horizontal-no-preview-file-info-name">${file.name}</p>
88
- <p part="horizontal-no-preview-file-info-type">${getFileType(file.type)} &#8226; ${formatFileSize(Number(file.size))}</p>
96
+ <p part="horizontal-no-preview-file-info-name">
97
+ <slot name="file-name">${file.name}</slot>
98
+ </p>
99
+ <p part="horizontal-no-preview-file-info-type">
100
+ <slot name="file-type">${getFileType(file, showFileType)}</slot>
101
+ &#8226;
102
+ <slot name="file-size">${formatFileSize(Number(file.size))}</slot>
103
+ </p>
89
104
  </div>
90
105
  </div>
91
106
  <div>
@@ -116,12 +131,16 @@ export function getHorizontalErrorState(
116
131
  <nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
117
132
  </div>
118
133
  <div class="file-info" part="horizontal-error-file-info">
119
- <p class="horizontal-file-name" part="horizontal-error-file-info-name">${file.name}</p>
134
+ <p class="horizontal-file-name" part="horizontal-error-file-info-name">
135
+ <slot name="file-name">
136
+ ${file.name}
137
+ </slot>
138
+ </p>
120
139
  ${
121
140
  nileFilePreview.isStringTruncated
122
- ? html`<nile-tooltip content=${errorMessage}>
141
+ ? html`<nile-lite-tooltip .content=${errorMessage}>
123
142
  <span>${errorMessage}</span>
124
- </nile-tooltip>`
143
+ </nile-lite-tooltip>`
125
144
  : html`<span>${errorMessage}</span>`
126
145
  }
127
146
  </div>
@@ -141,7 +160,8 @@ export function getHorizontalErrorState(
141
160
  // vertical states
142
161
  export function getVerticalUploadingState(
143
162
  file: File,
144
- uploadStatus: number
163
+ uploadStatus: number,
164
+ nileFilePreview: NileFilePreview
145
165
  ): TemplateResult {
146
166
  return html`
147
167
  <div class="vertical-div vertical-uploading" part="vertical-uploading-state">
@@ -158,7 +178,7 @@ export function getVerticalUploadingState(
158
178
  <p class="vertical-file-name" part="vertical-file-name">${file.name}</p>
159
179
  </div>
160
180
 
161
- <slot @click=${(e: CustomEvent<RemoveFileDetail>) => cancelFileUpload(file, e)} name="cancelIcon">
181
+ <slot @click=${(e: CustomEvent<RemoveFileDetail>) => cancelFileUpload(file, e, nileFilePreview)} name="cancelIcon">
162
182
  <nile-icon
163
183
  name="close"
164
184
  size="14"
@@ -174,7 +194,8 @@ export function getVerticalUploadingState(
174
194
  export function getVerticalPreviewState(
175
195
  url: string,
176
196
  file: File,
177
- originalUrl: string
197
+ originalUrl: string,
198
+ showFileType: boolean
178
199
  ): TemplateResult {
179
200
  return html`
180
201
  <div class="vertical-div vertical-preview" part="vertical-preview-state">
@@ -188,8 +209,14 @@ export function getVerticalPreviewState(
188
209
  </div>
189
210
 
190
211
  <div class="content-container" part="vertical-preview-file-info">
191
- <p part="vertical-preview-file-info-name">${file.name}</p>
192
- <p part="vertical-preview-file-info-type">${getFileType(file.type)} &#8226; ${formatFileSize(Number(file.size))}</p>
212
+ <p part="vertical-preview-file-info-name">
213
+ <slot name="file-name">${file.name}</slot>
214
+ </p>
215
+ <p part="vertical-preview-file-info-type">
216
+ <slot name="file-type">${getFileType(file, showFileType)}</slot>
217
+ &#8226;
218
+ <slot name="file-size">${formatFileSize(Number(file.size))}</slot>
219
+ </p>
193
220
  </div>
194
221
 
195
222
  <slot @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)} name="cancelIcon">
@@ -206,7 +233,8 @@ export function getVerticalPreviewState(
206
233
 
207
234
  export function getVerticalNoPreviewState(
208
235
  file: File,
209
- originalUrl: string
236
+ originalUrl: string,
237
+ showFileType: boolean
210
238
  ): TemplateResult {
211
239
  return html`
212
240
  <div class="vertical-div vertical-no-preview" part="vertical-no-preview-state">
@@ -215,8 +243,14 @@ export function getVerticalNoPreviewState(
215
243
  </div>
216
244
 
217
245
  <div class="content-container" part="vertical-no-preview-file-info">
218
- <p part="vertical-no-preview-file-info-name">${file.name}</p>
219
- <p part="vertical-no-preview-file-info-type">${getFileType(file.type)} &#8226; ${formatFileSize(Number(file.size))}</p>
246
+ <p part="vertical-no-preview-file-info-name">
247
+ <slot name="file-name">${file.name}</slot>
248
+ </p>
249
+ <p part="vertical-no-preview-file-info-type">
250
+ <slot name="file-type">${getFileType(file, showFileType)}</slot>
251
+ &#8226;
252
+ <slot name="file-size">${formatFileSize(Number(file.size))}</slot>
253
+ </p>
220
254
  </div>
221
255
 
222
256
  <slot @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)} name="cancelIcon">
@@ -245,12 +279,14 @@ export function getVerticalErrorState(
245
279
  </div>
246
280
 
247
281
  <div class="file-info-vertical-state" part="vertical-error-file-info">
248
- <p class="vertical-file-name" part="vertical-error-file-info-name">${file.name}</p>
282
+ <p class="vertical-file-name" part="vertical-error-file-info-name">
283
+ <slot name="file-name">${file.name}</slot>
284
+ </p>
249
285
  ${
250
286
  nileFilePreview.isStringTruncated
251
- ? html`<nile-tooltip content=${errorMessage}>
287
+ ? html`<nile-lite-tooltip .content=${errorMessage}>
252
288
  <span>${errorMessage}</span>
253
- </nile-tooltip>`
289
+ </nile-lite-tooltip>`
254
290
  : html`<span>${errorMessage}</span>`
255
291
  }
256
292
  </div>
@@ -1,38 +1,106 @@
1
- /**
2
- * Copyright Aquera Inc 2025
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
1
+ import { expect, fixture, html } from '@open-wc/testing';
2
+ import './nile-file-preview';
3
+ import type { NileFilePreview } from './nile-file-preview';
7
4
 
8
-
9
- import { fixture, assert, expect, html } from '@open-wc/testing';
10
- import './nile-file-preview'; // Just import to register the element
11
-
12
- describe('<nile-preview>', () => {
13
- let element: HTMLElement;
14
-
15
- beforeEach(async () => {
16
- element = await fixture(html`<nile-file-preview></nile-file-preview>`);
17
- });
18
-
19
- it('passes accessibility test', async () => {
20
- await expect(element).to.be.accessible();
21
- });
22
-
23
- it('renders with the correct tag name', () => {
24
- expect(element.tagName.toLowerCase()).to.equal('nile-preview');
25
- });
26
-
27
- it('renders with slot content when provided', async () => {
28
- const testContent = 'Test Content';
29
- element = await fixture(html`<nile-file-preview>${testContent}</nile-file-preview>`);
30
-
31
- const slot = (element.shadowRoot!.querySelector('slot') as HTMLSlotElement);
32
- assert.exists(slot, 'Slot should exist');
33
-
34
- const assignedNodes = slot.assignedNodes({ flatten: true });
35
- expect(assignedNodes.length).to.be.greaterThan(0);
36
- expect(assignedNodes[0].textContent?.trim()).to.equal(testContent);
37
- });
38
- });
5
+ describe('NileFilePreview', () => {
6
+ it('1. renders', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el).to.exist; });
7
+ it('2. shadow root', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot).to.not.be.null; });
8
+ it('3. tag name', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.tagName.toLowerCase()).to.equal('nile-file-preview'); });
9
+ it('4. is defined', async () => { expect(customElements.get('nile-file-preview')).to.exist; });
10
+ it('5. has styles', async () => { expect((await import('./nile-file-preview')).NileFilePreview.styles).to.exist; });
11
+ it('6. shadow mode', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.mode).to.equal('open'); });
12
+ it('7. isConnected', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.isConnected).to.be.true; });
13
+ it('8. removal', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.remove(); expect(el.isConnected).to.be.false; });
14
+ it('9. outerHTML', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.outerHTML).to.contain('nile-file-preview'); });
15
+ it('10. matches', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview class="x"></nile-file-preview>`); expect(el.matches('.x')).to.be.true; });
16
+ it('11. closest', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.closest('nile-file-preview')).to.equal(el); });
17
+ it('12. cloneNode', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-file-preview'); });
18
+ it('13. dispatchEvent', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
19
+ it('14. updateComplete', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
20
+ it('15. render method', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.render).to.be.a('function'); });
21
+ it('16. shadowRoot host', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.host).to.equal(el); });
22
+ it('17. class attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview class="fp"></nile-file-preview>`); expect(el.classList.contains('fp')).to.be.true; });
23
+ it('18. id attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview id="fp1"></nile-file-preview>`); expect(el.id).to.equal('fp1'); });
24
+ it('19. hidden', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview hidden></nile-file-preview>`); expect(el.hidden).to.be.true; });
25
+ it('20. nodeType', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.nodeType).to.equal(1); });
26
+ it('21. localName', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.localName).to.equal('nile-file-preview'); });
27
+ it('22. namespaceURI', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
28
+ it('23. ownerDocument', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.ownerDocument).to.equal(document); });
29
+ it('24. multiple instances', async () => { const c = await fixture(html`<div><nile-file-preview></nile-file-preview><nile-file-preview></nile-file-preview></div>`); expect(c.querySelectorAll('nile-file-preview').length).to.equal(2); });
30
+ it('25. parent-child', async () => { const c = await fixture(html`<div><nile-file-preview></nile-file-preview></div>`); expect(c.querySelector('nile-file-preview')!.parentElement).to.equal(c); });
31
+ it('26. createElement', async () => { const el = document.createElement('nile-file-preview') as NileFilePreview; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
32
+ it('27. dataset', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview data-idx="0"></nile-file-preview>`); expect(el.dataset.idx).to.equal('0'); });
33
+ it('28. classList add', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
34
+ it('29. getBoundingClientRect', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.getBoundingClientRect()).to.exist; });
35
+ it('30. style attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview style="color:red"></nile-file-preview>`); expect(el.style.color).to.equal('red'); });
36
+ it('31. aria-label', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview aria-label="FP"></nile-file-preview>`); expect(el.getAttribute('aria-label')).to.equal('FP'); });
37
+ it('32. dir', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview dir="rtl"></nile-file-preview>`); expect(el.dir).to.equal('rtl'); });
38
+ it('33. lang attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview lang="en"></nile-file-preview>`); expect(el.lang).to.equal('en'); });
39
+ it('34. tabindex', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview tabindex="0"></nile-file-preview>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
40
+ it('35. requestUpdate', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
41
+ it('36. shadow childNodes', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
42
+ it('37. scrollIntoView', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.scrollIntoView).to.be.a('function'); });
43
+ it('38. focus method', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.focus).to.be.a('function'); });
44
+ it('39. blur method', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.blur).to.be.a('function'); });
45
+ it('40. class toggle', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
46
+ it('41. toggle hidden', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.hidden = true; expect(el.hidden).to.be.true; });
47
+ it('42. dispatchCustomEvent', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
48
+ it('43. nested in div', async () => { const c = await fixture(html`<div><nile-file-preview></nile-file-preview></div>`); expect(c.querySelector('nile-file-preview')).to.exist; });
49
+ it('44. default errorMessage', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.errorMessage).to.equal(''); });
50
+ it('45. default fileUrl', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.fileUrl).to.equal(''); });
51
+ it('46. default uploadStatus', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.uploadStatus).to.equal(0); });
52
+ it('47. default state', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.state).to.exist; });
53
+ it('48. default variant', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.variant).to.exist; });
54
+ it('49. set errorMessage', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview error-message="Error"></nile-file-preview>`); expect(el.getAttribute('error-message')).to.equal('Error'); });
55
+ it('50. set fileUrl', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview file-url="http://test.com/f.png"></nile-file-preview>`); expect(el.getAttribute('file-url')).to.equal('http://test.com/f.png'); });
56
+ it('51. set inputFileName', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview input-file-name="test.png"></nile-file-preview>`); expect(el.getAttribute('input-file-name')).to.equal('test.png'); });
57
+ it('52. no canvas', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
58
+ it('53. no video', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
59
+ it('54. no audio', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
60
+ it('55. no nav', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nav')).to.be.null; });
61
+ it('56. no aside', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
62
+ it('57. no table', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
63
+ it('58. no anchor', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
64
+ it('59. no svg', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
65
+ it('60. no form', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
66
+ it('61. title attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview title="FP"></nile-file-preview>`); expect(el.title).to.equal('FP'); });
67
+ it('62. no h1', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
68
+ it('63. no pre', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
69
+ it('64. no code', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
70
+ it('65. no hr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('hr')).to.be.null; });
71
+ it('66. no ul', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('ul')).to.be.null; });
72
+ it('67. no textarea', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
73
+ it('68. no select', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
74
+ it('69. no nile-badge', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-badge')).to.be.null; });
75
+ it('70. no nile-radio', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-radio')).to.be.null; });
76
+ it('71. no nile-dialog', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-dialog')).to.be.null; });
77
+ it('72. no nile-drawer', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-drawer')).to.be.null; });
78
+ it('73. no nile-slider', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-slider')).to.be.null; });
79
+ it('74. no nile-accordion', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-accordion')).to.be.null; });
80
+ it('75. setAttribute data', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
81
+ it('76. removeAttribute hidden', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview hidden></nile-file-preview>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
82
+ it('77. setAttribute class', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
83
+ it('78. aria-describedby', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview aria-describedby="d"></nile-file-preview>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
84
+ it('79. multiple re-renders', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
85
+ it('80. contains', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview><span id="s1">C</span></nile-file-preview>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
86
+ it('81. data attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview data-x="1"></nile-file-preview>`); expect(el.getAttribute('data-x')).to.equal('1'); });
87
+ it('82. role attr', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview role="img"></nile-file-preview>`); expect(el.getAttribute('role')).to.equal('img'); });
88
+ it('83. no section', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('section')).to.be.null; });
89
+ it('84. no header', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('header')).to.be.null; });
90
+ it('85. no footer', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('footer')).to.be.null; });
91
+ it('86. no main', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('main')).to.be.null; });
92
+ it('87. no article', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('article')).to.be.null; });
93
+ it('88. no nile-toolbar', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-toolbar')).to.be.null; });
94
+ it('89. no nile-link', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-link')).to.be.null; });
95
+ it('90. no nile-menu', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-menu')).to.be.null; });
96
+ it('91. no nile-textarea', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-textarea')).to.be.null; });
97
+ it('92. no nile-card', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-card')).to.be.null; });
98
+ it('93. no nile-tab', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-tab')).to.be.null; });
99
+ it('94. no nile-stepper', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-stepper')).to.be.null; });
100
+ it('95. no nile-pagination', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-pagination')).to.be.null; });
101
+ it('96. no nile-calendar', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-calendar')).to.be.null; });
102
+ it('97. no nile-select', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-select')).to.be.null; });
103
+ it('98. no nile-input', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-input')).to.be.null; });
104
+ it('99. no nile-checkbox', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview></nile-file-preview>`); expect(el.shadowRoot!.querySelector('nile-checkbox')).to.be.null; });
105
+ it('100. full integration', async () => { const el = await fixture<NileFilePreview>(html`<nile-file-preview class="fp" id="fp1" error-message="" input-file-name="doc.pdf"></nile-file-preview>`); expect(el.id).to.equal('fp1'); expect(el.shadowRoot).to.not.be.null; expect(el.getAttribute('error-message')).to.equal(''); expect(el.getAttribute('input-file-name')).to.equal('doc.pdf'); });
106
+ });
@@ -8,7 +8,7 @@
8
8
  import {styles} from './nile-file-preview.css';
9
9
  import NileElement from '../internal/nile-element';
10
10
  import { customElement, property } from 'lit/decorators.js';
11
- import { generatePreviewUrl } from './utils';
11
+ import { generatePreviewUrl, isRealImage } from './utils';
12
12
  import { FilePreviewState, FilePreviewVariant, FilePreviewErrorMessages, FilePreviewEvent } from './types';
13
13
  import { LitElement, html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';
14
14
  import {
@@ -40,12 +40,13 @@ export class NileFilePreview extends NileElement {
40
40
  }
41
41
 
42
42
  @property({ type: String }) errorMessage: string = "";
43
- @property({ type: Object }) inputFile: File;
43
+ @property({ type: Object }) inputFile: File;
44
44
  @property({ type: String }) fileUrl: string = "";
45
45
  @property({ type: Number }) uploadStatus: number = 0;
46
46
  @property({ type: String }) state: FilePreviewState = FilePreviewState.DEFAULT;
47
47
  @property({ type: String }) variant: FilePreviewVariant = FilePreviewVariant.HORIZONTAL;
48
48
  @property({ type: String }) inputFileName: string = "";
49
+ @property({ type: Boolean, reflect: true, attribute: true }) showFileType: boolean = false;
49
50
  private inputFileHtml: TemplateResult | null = null;
50
51
  private originalUrl: string = "";
51
52
  public isStringTruncated: boolean = false;
@@ -72,7 +73,7 @@ export class NileFilePreview extends NileElement {
72
73
  this.createState(this.inputFile);
73
74
  }
74
75
  } else if (changedProperties.has('inputFile') && this.inputFile) {
75
- this.createState(this.inputFile);
76
+ this.createState(this.inputFile);
76
77
  this.emit(FilePreviewEvent.NILE_RECEIVE);
77
78
 
78
79
  } else if (changedProperties.has('fileUrl') && this.fileUrl) {
@@ -87,9 +88,9 @@ export class NileFilePreview extends NileElement {
87
88
  private createUploadState( file: File, uploadStatus: number): void {
88
89
  const isHorizontal = this.variant === FilePreviewVariant.HORIZONTAL;
89
90
 
90
- this.inputFileHtml = isHorizontal
91
- ? getHorizontalUploadingState(file, uploadStatus)
92
- : getVerticalUploadingState(file, uploadStatus);
91
+ this.inputFileHtml = isHorizontal
92
+ ? getHorizontalUploadingState(file, uploadStatus, this)
93
+ : getVerticalUploadingState(file, uploadStatus, this);
93
94
 
94
95
  this.requestUpdate();
95
96
  }
@@ -118,22 +119,28 @@ export class NileFilePreview extends NileElement {
118
119
  public async createState(file: File): Promise<void> {
119
120
  const isHorizontal = this.variant === FilePreviewVariant.HORIZONTAL;
120
121
 
121
- if (!this.errorMessage) {
122
- if (file && file.type.startsWith('image/')) {
122
+ if (!this.errorMessage) {
123
+ let isImage = false;
124
+ try {
125
+ isImage = file && await isRealImage(file);
126
+ } catch (error) {
127
+ isImage = false;
128
+ }
129
+ if (isImage) {
123
130
  try {
124
131
  const url = await generatePreviewUrl(file);
125
132
  this.inputFileHtml = isHorizontal
126
- ? getHorizontalPreviewState(url, file, this.originalUrl)
127
- : getVerticalPreviewState(url, file, this.originalUrl);
133
+ ? getHorizontalPreviewState(url, file, this.originalUrl, this.showFileType)
134
+ : getVerticalPreviewState(url, file, this.originalUrl, this.showFileType);
128
135
  } catch (error) {
129
136
  this.inputFileHtml = isHorizontal
130
- ? getHorizontalNoPreviewState(file, this.originalUrl)
131
- : getVerticalNoPreviewState(file, this.originalUrl);
137
+ ? getHorizontalNoPreviewState(file, this.originalUrl, this.showFileType)
138
+ : getVerticalNoPreviewState(file, this.originalUrl, this.showFileType);
132
139
  }
133
140
  } else {
134
141
  this.inputFileHtml = isHorizontal
135
- ? getHorizontalNoPreviewState(file, this.originalUrl)
136
- : getVerticalNoPreviewState(file, this.originalUrl);
142
+ ? getHorizontalNoPreviewState(file, this.originalUrl, this.showFileType)
143
+ : getVerticalNoPreviewState(file, this.originalUrl, this.showFileType);
137
144
  }
138
145
  } else {
139
146
  this.inputFileHtml = isHorizontal
@@ -143,50 +150,10 @@ export class NileFilePreview extends NileElement {
143
150
  this.requestUpdate();
144
151
  }
145
152
 
146
- private customFile = new File([], "Harsh", { type: "image/png" })
147
-
148
- getState(): TemplateResult {
149
- if(this.variant === "horizontal") return this.getHorizontalStates();
150
- return this.getVerticalStates();
151
- }
152
-
153
- getHorizontalStates(): TemplateResult {
154
- switch(this.state) {
155
- case FilePreviewState.UPLOADING:
156
- return getHorizontalUploadingState(this.customFile, 2);
157
- case FilePreviewState.PREVIEW:
158
- return getHorizontalPreviewState("https://s6.imgcdn.dev/YINe6a.jpg", this.customFile, this.originalUrl);
159
- case FilePreviewState.NO_PREVIEW:
160
- return getHorizontalNoPreviewState(this.customFile, this.originalUrl);
161
- case FilePreviewState.ERROR:
162
- return getHorizontalErrorState(this.customFile, FilePreviewErrorMessages.CUSTOM_ERROR, this.originalUrl, this);
163
- default:
164
- return this.inputFileHtml || html``;
165
- }
166
- }
167
-
168
- getVerticalStates(): TemplateResult {
169
- switch(this.state) {
170
- case FilePreviewState.UPLOADING:
171
- return getVerticalUploadingState(this.customFile, 2);
172
- case FilePreviewState.PREVIEW:
173
- return getVerticalPreviewState("https://s6.imgcdn.dev/YINe6a.jpg", this.customFile, this.originalUrl);
174
- case FilePreviewState.NO_PREVIEW:
175
- return getVerticalNoPreviewState(this.customFile, this.originalUrl);
176
- case FilePreviewState.ERROR:
177
- return getVerticalErrorState(this.customFile, FilePreviewErrorMessages.CUSTOM_ERROR, this.originalUrl, this);
178
- default:
179
- return this.inputFileHtml || html``;
180
- }
181
- }
182
-
183
153
  public render(): TemplateResult {
184
- if (this.state) {
185
- return this.getState();
186
- }
187
154
  return html`${this.inputFileHtml ?? html``}`;
188
155
  }
189
-
156
+
190
157
 
191
158
  disconnectedCallback(): void {
192
159
  super.disconnectedCallback();
@@ -202,4 +169,4 @@ declare global {
202
169
  interface HTMLElementTagNameMap {
203
170
  'nile-file-preview': NileFilePreview;
204
171
  }
205
- }
172
+ }
@@ -1,5 +1,5 @@
1
1
  import NileFilePreview from "../nile-file-preview";
2
- import { RemoveFileDetail, FilePreviewEvent, FilePreviewErrorMessages } from "../types";
2
+ import { RemoveFileDetail, FilePreviewEvent, FilePreviewErrorMessages, FilePreviewState } from "../types";
3
3
 
4
4
  export const generatePreviewUrl = (file: File): Promise<string> => {
5
5
  return new Promise((resolve, reject) => {
@@ -34,7 +34,7 @@ export const removeFile = (removeFile: File, e: CustomEvent<RemoveFileDetail>, o
34
34
  }
35
35
  };
36
36
 
37
- export const cancelFileUpload = (file: File, e: CustomEvent<RemoveFileDetail>) => {
37
+ export const cancelFileUpload = (file: File, e: CustomEvent<RemoveFileDetail>, nileFilePreview: NileFilePreview) => {
38
38
  if(e.target) {
39
39
  e.target.dispatchEvent(
40
40
  new CustomEvent(FilePreviewEvent.NILE_CANCEL_UPLOAD, {
@@ -43,22 +43,31 @@ export const cancelFileUpload = (file: File, e: CustomEvent<RemoveFileDetail>) =
43
43
  composed: true,
44
44
  })
45
45
  );
46
+ nileFilePreview.state = FilePreviewState.ERROR;
47
+ nileFilePreview.errorMessage = FilePreviewErrorMessages.UPLOAD_CANCEL;
48
+ nileFilePreview.requestUpdate();
46
49
  }
47
50
  }
48
51
 
49
52
  export const formatFileSize = (bytes: number): string => {
50
- const kb = bytes / 1024;
51
- const mb = kb / 1024;
52
- const gb = mb / 1024;
53
+ const kb = bytes / 1000;
54
+ const mb = bytes / 1_000_000;
55
+ const gb = bytes / 1_000_000_000;
53
56
 
54
57
  if (gb >= 1) return gb.toFixed(2) + ' GB';
55
58
  if (mb >= 1) return mb.toFixed(2) + ' MB';
56
59
  if (kb >= 1) return kb.toFixed(2) + ' KB';
57
60
  return bytes + ' B';
58
- }
61
+ };
59
62
 
60
- export const getFileType = (type: string): string => {
61
- return type.split('/')[1].toUpperCase();
63
+ export const getFileType = (file: File, showFileType: boolean): string => {
64
+ if(showFileType) {
65
+ return file.name.split('.').pop() || '';
66
+ }
67
+ const type = file.type || '';
68
+ const parts = type.split('/');
69
+ const subtype = parts[1] || '';
70
+ return subtype.toUpperCase();
62
71
  }
63
72
 
64
73
  export const truncateString = (nileFilePreview: NileFilePreview): void => {
@@ -69,4 +78,24 @@ export const truncateString = (nileFilePreview: NileFilePreview): void => {
69
78
  nileFilePreview.isStringTruncated = true;
70
79
  nileFilePreview.requestUpdate();
71
80
  }
81
+ }
82
+
83
+ export const isRealImage = (file: File): Promise<boolean> => {
84
+ return new Promise((resolve) => {
85
+ const blob = new Blob([file], { type: file.type });
86
+ const url = URL.createObjectURL(blob);
87
+ const img = new Image();
88
+
89
+ img.onload = () => {
90
+ URL.revokeObjectURL(url);
91
+ resolve(true);
92
+ };
93
+
94
+ img.onerror = () => {
95
+ URL.revokeObjectURL(url);
96
+ resolve(false);
97
+ };
98
+
99
+ img.src = url;
100
+ });
72
101
  }
@@ -13,6 +13,7 @@ import {css} from 'lit';
13
13
  export const styles = css`
14
14
  :host {
15
15
  display: inline-block;
16
+ width: 100%;
16
17
  }
17
18
 
18
19
  * {
@@ -26,7 +27,7 @@ export const styles = css`
26
27
  flex-direction: column;
27
28
  justify-content: center;
28
29
  align-items: flex-start;
29
- width: min-content;
30
+ width: 100%;
30
31
  }
31
32
 
32
33
  input {
@@ -34,10 +35,8 @@ export const styles = css`
34
35
  }
35
36
 
36
37
  .horizontal-div {
37
- margin-bottom: 10px;
38
38
  height: 62px;
39
- max-width: 648px;
40
- width: 648px;
39
+ width: 100%;
41
40
  min-width: 230px;
42
41
  padding: 12px;
43
42
  display: flex;
@@ -50,6 +49,16 @@ export const styles = css`
50
49
  background-color: var(--nile-colors-white-base);
51
50
  }
52
51
 
52
+ @media (width < 400px) {
53
+ .browse-file-button {
54
+ display: none;
55
+ }
56
+
57
+ .horizontal-div {
58
+ cursor: pointer;
59
+ }
60
+ }
61
+
53
62
  .hover-border {
54
63
  border-color: var(--nile-colors-primary-600);
55
64
  }
@@ -90,7 +99,6 @@ export const styles = css`
90
99
  border: 1px dashed var(--nile-colors-neutral-500);
91
100
  background-color: var(--nile-colors-white-base);
92
101
  position: relative;
93
- margin-bottom: 10px;
94
102
  }
95
103
 
96
104
  .vertical-div:hover {
@@ -593,6 +601,7 @@ export const styles = css`
593
601
  justify-content: flex-start;
594
602
  align-items: center;
595
603
  gap: var(--nile-spacing-one-half-x);
604
+ margin-top: 10px;
596
605
  }
597
606
 
598
607
  .upload-error > nile-tooltip > span {
@@ -607,6 +616,7 @@ export const styles = css`
607
616
  .vertical-upload-error {
608
617
  display: flex;
609
618
  gap: 4px;
619
+ margin-top: 10px;
610
620
  }
611
621
 
612
622
  .vertical-upload-error nile-tooltip span, .vertical-upload-error span {