@aquera/nile-elements 1.0.1-beta-1.2 → 1.0.1-beta-1.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 (416) hide show
  1. package/README.md +4 -0
  2. package/demo/index.html +23 -8
  3. package/demo/nxtgen.css +38 -3
  4. package/demo/variables.css +45 -0
  5. package/dist/index.cjs.js +1 -1
  6. package/dist/index.esm.js +1 -1
  7. package/dist/index.js +229 -167
  8. package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
  9. package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
  10. package/dist/nile-accordion/nile-accordion.esm.js +4 -4
  11. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  12. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  13. package/dist/nile-auto-complete/nile-auto-complete.esm.js +4 -4
  14. package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
  15. package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
  16. package/dist/nile-avatar/nile-avatar.esm.js +5 -4
  17. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  18. package/dist/nile-avatar/nile-avatar.test.cjs.js.map +1 -1
  19. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  20. package/dist/nile-badge/index.cjs.js +1 -1
  21. package/dist/nile-badge/index.esm.js +1 -1
  22. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  23. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  24. package/dist/nile-badge/nile-badge.esm.js +1 -1
  25. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  26. package/dist/nile-badge/nile-badge.test.cjs.js.map +1 -1
  27. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  28. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
  29. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
  30. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +5 -4
  31. package/dist/nile-button/index.cjs.js +1 -1
  32. package/dist/nile-button/index.esm.js +1 -1
  33. package/dist/nile-button/nile-button.cjs.js +1 -1
  34. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  35. package/dist/nile-button/nile-button.esm.js +5 -3
  36. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  37. package/dist/nile-button/nile-button.test.cjs.js.map +1 -1
  38. package/dist/nile-button/nile-button.test.esm.js +1 -1
  39. package/dist/nile-button-filter/nile-button-filter.cjs.js +1 -1
  40. package/dist/nile-button-filter/nile-button-filter.cjs.js.map +1 -1
  41. package/dist/nile-button-filter/nile-button-filter.esm.js +12 -10
  42. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  43. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  44. package/dist/nile-calendar/nile-calendar.esm.js +7 -5
  45. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  46. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
  47. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  48. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  49. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  50. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  51. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  52. package/dist/nile-checkbox/nile-checkbox.css.esm.js +3 -0
  53. package/dist/nile-checkbox/nile-checkbox.esm.js +9 -7
  54. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  55. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  56. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  57. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  58. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  59. package/dist/nile-code-editor/nile-code-editor.esm.js +3 -2
  60. package/dist/nile-dialog/index.cjs.js +1 -1
  61. package/dist/nile-dialog/index.esm.js +1 -1
  62. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  63. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  64. package/dist/nile-dialog/nile-dialog.esm.js +7 -6
  65. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  66. package/dist/nile-dialog/nile-dialog.test.cjs.js.map +1 -1
  67. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  68. package/dist/nile-drawer/index.cjs.js +1 -1
  69. package/dist/nile-drawer/index.esm.js +1 -1
  70. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  71. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  72. package/dist/nile-drawer/nile-drawer.esm.js +3 -2
  73. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  74. package/dist/nile-drawer/nile-drawer.test.cjs.js.map +1 -1
  75. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  76. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  77. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  78. package/dist/nile-empty-state/nile-empty-state.esm.js +8 -8
  79. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  80. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  81. package/dist/nile-error-message/nile-error-message.esm.js +7 -6
  82. package/dist/nile-error-notification/nile-error-notification.cjs.js +1 -1
  83. package/dist/nile-error-notification/nile-error-notification.cjs.js.map +1 -1
  84. package/dist/nile-error-notification/nile-error-notification.esm.js +2 -1
  85. package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
  86. package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
  87. package/dist/nile-file-preview/nile-file-preview.template.esm.js +49 -41
  88. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +3 -3
  89. package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
  90. package/dist/nile-file-upload/nile-file-upload.template.esm.js +35 -31
  91. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  92. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  93. package/dist/nile-filter-chip/nile-filter-chip.esm.js +3 -3
  94. package/dist/nile-form-error-message/nile-form-error-message.cjs.js +1 -1
  95. package/dist/nile-form-error-message/nile-form-error-message.cjs.js.map +1 -1
  96. package/dist/nile-form-error-message/nile-form-error-message.esm.js +3 -3
  97. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  98. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
  99. package/dist/nile-form-help-text/nile-form-help-text.esm.js +5 -5
  100. package/dist/nile-hero/nile-hero.cjs.js +1 -1
  101. package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
  102. package/dist/nile-hero/nile-hero.esm.js +4 -4
  103. package/dist/nile-hero-header/nile-hero-header.cjs.js +1 -1
  104. package/dist/nile-hero-header/nile-hero-header.cjs.js.map +1 -1
  105. package/dist/nile-hero-header/nile-hero-header.esm.js +2 -2
  106. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  107. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  108. package/dist/nile-icon/icons/svg/ng-action.cjs.js +2 -0
  109. package/dist/nile-icon/icons/svg/ng-action.cjs.js.map +1 -0
  110. package/dist/nile-icon/icons/svg/ng-action.esm.js +1 -0
  111. package/dist/nile-icon/icons/svg/ng-alert-circle.cjs.js +2 -0
  112. package/dist/nile-icon/icons/svg/ng-alert-circle.cjs.js.map +1 -0
  113. package/dist/nile-icon/icons/svg/ng-alert-circle.esm.js +1 -0
  114. package/dist/nile-icon/icons/svg/ng-button-loading-blue-animated.cjs.js +2 -0
  115. package/dist/nile-icon/icons/svg/ng-button-loading-blue-animated.cjs.js.map +1 -0
  116. package/dist/nile-icon/icons/svg/ng-button-loading-blue-animated.esm.js +1 -0
  117. package/dist/nile-icon/icons/svg/ng-button-loading-blue.cjs.js +2 -0
  118. package/dist/nile-icon/icons/svg/ng-button-loading-blue.cjs.js.map +1 -0
  119. package/dist/nile-icon/icons/svg/ng-button-loading-blue.esm.js +1 -0
  120. package/dist/nile-icon/icons/svg/ng-check-circle-broken.cjs.js +2 -0
  121. package/dist/nile-icon/icons/svg/ng-check-circle-broken.cjs.js.map +1 -0
  122. package/dist/nile-icon/icons/svg/ng-check-circle-broken.esm.js +1 -0
  123. package/dist/nile-icon/icons/svg/ng-check.cjs.js +2 -0
  124. package/dist/nile-icon/icons/svg/ng-check.cjs.js.map +1 -0
  125. package/dist/nile-icon/icons/svg/ng-check.esm.js +1 -0
  126. package/dist/nile-icon/icons/svg/ng-file-06.cjs.js +2 -0
  127. package/dist/nile-icon/icons/svg/ng-file-06.cjs.js.map +1 -0
  128. package/dist/nile-icon/icons/svg/ng-file-06.esm.js +1 -0
  129. package/dist/nile-icon/icons/svg/ng-image-03.cjs.js +2 -0
  130. package/dist/nile-icon/icons/svg/ng-image-03.cjs.js.map +1 -0
  131. package/dist/nile-icon/icons/svg/ng-image-03.esm.js +1 -0
  132. package/dist/nile-icon/icons/svg/ng-minus.cjs.js +2 -0
  133. package/dist/nile-icon/icons/svg/ng-minus.cjs.js.map +1 -0
  134. package/dist/nile-icon/icons/svg/ng-minus.esm.js +1 -0
  135. package/dist/nile-icon/icons/svg/ng-x-circle.cjs.js +2 -0
  136. package/dist/nile-icon/icons/svg/ng-x-circle.cjs.js.map +1 -0
  137. package/dist/nile-icon/icons/svg/ng-x-circle.esm.js +1 -0
  138. package/dist/nile-icon/index.cjs.js +1 -1
  139. package/dist/nile-icon/index.cjs.js.map +1 -1
  140. package/dist/nile-icon/index.esm.js +3 -3
  141. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  142. package/dist/nile-icon/nile-icon.test.cjs.js.map +1 -1
  143. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  144. package/dist/nile-icon-button/index.cjs.js +1 -1
  145. package/dist/nile-icon-button/index.esm.js +1 -1
  146. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  147. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  148. package/dist/nile-icon-button/nile-icon-button.esm.js +6 -4
  149. package/dist/nile-input/index.cjs.js +1 -1
  150. package/dist/nile-input/index.esm.js +1 -1
  151. package/dist/nile-input/nile-input.cjs.js +1 -1
  152. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  153. package/dist/nile-input/nile-input.esm.js +10 -8
  154. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  155. package/dist/nile-input/nile-input.test.cjs.js.map +1 -1
  156. package/dist/nile-input/nile-input.test.esm.js +1 -1
  157. package/dist/nile-list-item/nile-list-item.cjs.js +1 -1
  158. package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -1
  159. package/dist/nile-list-item/nile-list-item.esm.js +3 -2
  160. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  161. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  162. package/dist/nile-menu/nile-menu.esm.js +1 -1
  163. package/dist/nile-menu-item/index.cjs.js +1 -1
  164. package/dist/nile-menu-item/index.esm.js +1 -1
  165. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  166. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  167. package/dist/nile-menu-item/nile-menu-item.esm.js +5 -3
  168. package/dist/nile-option/index.cjs.js +1 -1
  169. package/dist/nile-option/index.esm.js +1 -1
  170. package/dist/nile-option/nile-option.cjs.js +1 -1
  171. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  172. package/dist/nile-option/nile-option.esm.js +1 -1
  173. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  174. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  175. package/dist/nile-pagination/nile-pagination.esm.js +24 -21
  176. package/dist/nile-section-message/nile-section-message.cjs.js +1 -1
  177. package/dist/nile-section-message/nile-section-message.cjs.js.map +1 -1
  178. package/dist/nile-section-message/nile-section-message.esm.js +4 -4
  179. package/dist/nile-select/index.cjs.js +1 -1
  180. package/dist/nile-select/index.esm.js +1 -1
  181. package/dist/nile-select/nile-select.cjs.js +1 -1
  182. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  183. package/dist/nile-select/nile-select.esm.js +6 -5
  184. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  185. package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
  186. package/dist/nile-select/nile-select.test.esm.js +12 -12
  187. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +1 -1
  188. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +1 -1
  189. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +1 -0
  190. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  191. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  192. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +7 -1
  193. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  194. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  195. package/dist/nile-switcher/nile-switcher.esm.js +3 -1
  196. package/dist/nile-tab/index.cjs.js +1 -1
  197. package/dist/nile-tab/index.esm.js +1 -1
  198. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  199. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  200. package/dist/nile-tab/nile-tab.esm.js +3 -3
  201. package/dist/nile-tab-group/index.cjs.js +1 -1
  202. package/dist/nile-tab-group/index.esm.js +1 -1
  203. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  204. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  205. package/dist/nile-tab-group/nile-tab-group.esm.js +3 -3
  206. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  207. package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +1 -1
  208. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  209. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  210. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  211. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
  212. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
  213. package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +11 -5
  214. package/dist/nile-table-header-item/nile-table-header-item.esm.js +15 -10
  215. package/dist/nile-tag/index.cjs.js +1 -1
  216. package/dist/nile-tag/index.esm.js +1 -1
  217. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  218. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  219. package/dist/nile-tag/nile-tag.esm.js +2 -2
  220. package/dist/nile-toast/index.cjs.js +1 -1
  221. package/dist/nile-toast/index.esm.js +1 -1
  222. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  223. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  224. package/dist/nile-toast/nile-toast.esm.js +11 -11
  225. package/dist/nile-tree/index.cjs.js +1 -1
  226. package/dist/nile-tree/index.esm.js +1 -1
  227. package/dist/nile-tree/nile-tree.cjs.js +1 -1
  228. package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
  229. package/dist/nile-tree/nile-tree.esm.js +1 -1
  230. package/dist/nile-tree-item/index.cjs.js +1 -1
  231. package/dist/nile-tree-item/index.esm.js +1 -1
  232. package/dist/nile-tree-item/nile-tree-item.cjs.js +1 -1
  233. package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -1
  234. package/dist/nile-tree-item/nile-tree-item.esm.js +5 -5
  235. package/dist/nile-virtual-select/index.cjs.js +1 -1
  236. package/dist/nile-virtual-select/index.esm.js +1 -1
  237. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
  238. package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
  239. package/dist/nile-virtual-select/nile-virtual-select.esm.js +6 -5
  240. package/dist/src/nile-accordion/nile-accordion.js +2 -2
  241. package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
  242. package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
  243. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  244. package/dist/src/nile-avatar/nile-avatar.js +5 -4
  245. package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
  246. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +2 -1
  247. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
  248. package/dist/src/nile-button/nile-button.js +4 -2
  249. package/dist/src/nile-button/nile-button.js.map +1 -1
  250. package/dist/src/nile-button-filter/nile-button-filter.js +5 -3
  251. package/dist/src/nile-button-filter/nile-button-filter.js.map +1 -1
  252. package/dist/src/nile-calendar/nile-calendar.js +4 -2
  253. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  254. package/dist/src/nile-checkbox/nile-checkbox.css.js +3 -0
  255. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  256. package/dist/src/nile-checkbox/nile-checkbox.js +4 -2
  257. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  258. package/dist/src/nile-code-editor/nile-code-editor.js +2 -1
  259. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  260. package/dist/src/nile-dialog/nile-dialog.js +2 -1
  261. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  262. package/dist/src/nile-drawer/nile-drawer.js +2 -1
  263. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  264. package/dist/src/nile-empty-state/nile-empty-state.js +7 -7
  265. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  266. package/dist/src/nile-error-message/nile-error-message.js +4 -3
  267. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  268. package/dist/src/nile-error-notification/nile-error-notification.js +2 -1
  269. package/dist/src/nile-error-notification/nile-error-notification.js.map +1 -1
  270. package/dist/src/nile-file-preview/nile-file-preview.template.js +20 -12
  271. package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
  272. package/dist/src/nile-file-upload/nile-file-upload.template.js +14 -10
  273. package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
  274. package/dist/src/nile-filter-chip/nile-filter-chip.js +1 -1
  275. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  276. package/dist/src/nile-form-error-message/nile-form-error-message.js +1 -1
  277. package/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -1
  278. package/dist/src/nile-form-help-text/nile-form-help-text.js +2 -2
  279. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  280. package/dist/src/nile-hero/nile-hero.js +2 -2
  281. package/dist/src/nile-hero/nile-hero.js.map +1 -1
  282. package/dist/src/nile-hero-header/nile-hero-header.js +2 -2
  283. package/dist/src/nile-hero-header/nile-hero-header.js.map +1 -1
  284. package/dist/src/nile-icon/icons/svg/index.d.ts +10 -0
  285. package/dist/src/nile-icon/icons/svg/index.js +10 -0
  286. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  287. package/dist/src/nile-icon/icons/svg/ng-action.d.ts +5 -0
  288. package/dist/src/nile-icon/icons/svg/ng-action.js +5 -0
  289. package/dist/src/nile-icon/icons/svg/ng-action.js.map +1 -0
  290. package/dist/src/nile-icon/icons/svg/ng-alert-circle.d.ts +5 -0
  291. package/dist/src/nile-icon/icons/svg/ng-alert-circle.js +5 -0
  292. package/dist/src/nile-icon/icons/svg/ng-alert-circle.js.map +1 -0
  293. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.d.ts +5 -0
  294. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.js +5 -0
  295. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.js.map +1 -0
  296. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.d.ts +5 -0
  297. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.js +5 -0
  298. package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.js.map +1 -0
  299. package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.d.ts +5 -0
  300. package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.js +5 -0
  301. package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.js.map +1 -0
  302. package/dist/src/nile-icon/icons/svg/ng-check.d.ts +5 -0
  303. package/dist/src/nile-icon/icons/svg/ng-check.js +5 -0
  304. package/dist/src/nile-icon/icons/svg/ng-check.js.map +1 -0
  305. package/dist/src/nile-icon/icons/svg/ng-file-06.d.ts +5 -0
  306. package/dist/src/nile-icon/icons/svg/ng-file-06.js +5 -0
  307. package/dist/src/nile-icon/icons/svg/ng-file-06.js.map +1 -0
  308. package/dist/src/nile-icon/icons/svg/ng-image-03.d.ts +5 -0
  309. package/dist/src/nile-icon/icons/svg/ng-image-03.js +5 -0
  310. package/dist/src/nile-icon/icons/svg/ng-image-03.js.map +1 -0
  311. package/dist/src/nile-icon/icons/svg/ng-minus.d.ts +5 -0
  312. package/dist/src/nile-icon/icons/svg/ng-minus.js +5 -0
  313. package/dist/src/nile-icon/icons/svg/ng-minus.js.map +1 -0
  314. package/dist/src/nile-icon/icons/svg/ng-x-circle.d.ts +5 -0
  315. package/dist/src/nile-icon/icons/svg/ng-x-circle.js +5 -0
  316. package/dist/src/nile-icon/icons/svg/ng-x-circle.js.map +1 -0
  317. package/dist/src/nile-icon/index.d.ts +1 -0
  318. package/dist/src/nile-icon/index.js +36 -0
  319. package/dist/src/nile-icon/index.js.map +1 -1
  320. package/dist/src/nile-icon-button/nile-icon-button.d.ts +0 -1
  321. package/dist/src/nile-icon-button/nile-icon-button.js +4 -10
  322. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  323. package/dist/src/nile-input/nile-input.js +5 -3
  324. package/dist/src/nile-input/nile-input.js.map +1 -1
  325. package/dist/src/nile-list-item/nile-list-item.js +1 -0
  326. package/dist/src/nile-list-item/nile-list-item.js.map +1 -1
  327. package/dist/src/nile-menu/nile-menu.js +1 -1
  328. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  329. package/dist/src/nile-menu-item/nile-menu-item.js +4 -2
  330. package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  331. package/dist/src/nile-pagination/nile-pagination.js +8 -5
  332. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  333. package/dist/src/nile-section-message/nile-section-message.js +6 -6
  334. package/dist/src/nile-section-message/nile-section-message.js.map +1 -1
  335. package/dist/src/nile-select/nile-select.js +5 -4
  336. package/dist/src/nile-select/nile-select.js.map +1 -1
  337. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js +1 -0
  338. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js.map +1 -1
  339. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +7 -1
  340. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  341. package/dist/src/nile-switcher/nile-switcher.js +3 -1
  342. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  343. package/dist/src/nile-tab/nile-tab.js +1 -1
  344. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  345. package/dist/src/nile-tab-group/nile-tab-group.js +3 -3
  346. package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
  347. package/dist/src/nile-table-header-item/nile-table-header-item.css.js +8 -2
  348. package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
  349. package/dist/src/nile-table-header-item/nile-table-header-item.js +13 -8
  350. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  351. package/dist/src/nile-tag/nile-tag.js +1 -1
  352. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  353. package/dist/src/nile-toast/nile-toast.d.ts +1 -1
  354. package/dist/src/nile-toast/nile-toast.js +8 -8
  355. package/dist/src/nile-toast/nile-toast.js.map +1 -1
  356. package/dist/src/nile-tree-item/nile-tree-item.js +2 -2
  357. package/dist/src/nile-tree-item/nile-tree-item.js.map +1 -1
  358. package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +5 -5
  359. package/dist/src/nile-virtual-select/nile-virtual-select.js +10 -9
  360. package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
  361. package/dist/tsconfig.tsbuildinfo +1 -1
  362. package/package.json +1 -1
  363. package/src/nile-accordion/nile-accordion.ts +2 -2
  364. package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
  365. package/src/nile-avatar/nile-avatar.ts +5 -4
  366. package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +2 -1
  367. package/src/nile-button/nile-button.ts +4 -2
  368. package/src/nile-button-filter/nile-button-filter.ts +5 -3
  369. package/src/nile-calendar/nile-calendar.ts +4 -2
  370. package/src/nile-checkbox/nile-checkbox.css.ts +3 -0
  371. package/src/nile-checkbox/nile-checkbox.ts +4 -2
  372. package/src/nile-code-editor/nile-code-editor.ts +2 -1
  373. package/src/nile-dialog/nile-dialog.ts +2 -1
  374. package/src/nile-drawer/nile-drawer.ts +2 -1
  375. package/src/nile-empty-state/nile-empty-state.ts +7 -7
  376. package/src/nile-error-message/nile-error-message.ts +4 -3
  377. package/src/nile-error-notification/nile-error-notification.ts +2 -1
  378. package/src/nile-file-preview/nile-file-preview.template.ts +20 -12
  379. package/src/nile-file-upload/nile-file-upload.template.ts +14 -10
  380. package/src/nile-filter-chip/nile-filter-chip.ts +1 -1
  381. package/src/nile-form-error-message/nile-form-error-message.ts +1 -1
  382. package/src/nile-form-help-text/nile-form-help-text.ts +2 -2
  383. package/src/nile-hero/nile-hero.ts +2 -2
  384. package/src/nile-hero-header/nile-hero-header.ts +2 -2
  385. package/src/nile-icon/icons/svg/index.ts +10 -0
  386. package/src/nile-icon/icons/svg/ng-action.ts +5 -0
  387. package/src/nile-icon/icons/svg/ng-alert-circle.ts +5 -0
  388. package/src/nile-icon/icons/svg/ng-button-loading-blue-animated.ts +5 -0
  389. package/src/nile-icon/icons/svg/ng-button-loading-blue.ts +5 -0
  390. package/src/nile-icon/icons/svg/ng-check-circle-broken.ts +5 -0
  391. package/src/nile-icon/icons/svg/ng-check.ts +5 -0
  392. package/src/nile-icon/icons/svg/ng-file-06.ts +5 -0
  393. package/src/nile-icon/icons/svg/ng-image-03.ts +5 -0
  394. package/src/nile-icon/icons/svg/ng-minus.ts +5 -0
  395. package/src/nile-icon/icons/svg/ng-x-circle.ts +5 -0
  396. package/src/nile-icon/index.ts +38 -0
  397. package/src/nile-icon-button/nile-icon-button.ts +4 -12
  398. package/src/nile-input/nile-input.ts +5 -3
  399. package/src/nile-list-item/nile-list-item.ts +1 -0
  400. package/src/nile-menu/nile-menu.ts +1 -1
  401. package/src/nile-menu-item/nile-menu-item.ts +4 -2
  402. package/src/nile-pagination/nile-pagination.ts +8 -5
  403. package/src/nile-section-message/nile-section-message.ts +6 -6
  404. package/src/nile-select/nile-select.ts +5 -4
  405. package/src/nile-sidebar-menu-items/nile-sidebar-menu-items.ts +1 -0
  406. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +7 -1
  407. package/src/nile-switcher/nile-switcher.ts +3 -1
  408. package/src/nile-tab/nile-tab.ts +1 -1
  409. package/src/nile-tab-group/nile-tab-group.ts +3 -3
  410. package/src/nile-table-header-item/nile-table-header-item.css.ts +8 -2
  411. package/src/nile-table-header-item/nile-table-header-item.ts +13 -8
  412. package/src/nile-tag/nile-tag.ts +1 -1
  413. package/src/nile-toast/nile-toast.ts +8 -8
  414. package/src/nile-tree-item/nile-tree-item.ts +2 -2
  415. package/src/nile-virtual-select/nile-virtual-select.ts +6 -5
  416. package/vscode-html-custom-data.json +7 -7
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var i,a,t,s,e,r,o,n,c,h,d,l,m,p,f,_templateObject,y;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_lit){a=_lit.html;},function(_nileAccordionCssCjsJs){t=_nileAccordionCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){e=_internalAnimateCjsJs.s;r=_internalAnimateCjsJs.a;o=_internalAnimateCjsJs.b;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){c=_litDecoratorsJs.query;h=_litDecoratorsJs.property;d=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){l=_utilitiesAnimationRegistryCjsJs.s;m=_utilitiesAnimationRegistryCjsJs.g;},function(_internalEventCjsJs){p=_internalEventCjsJs.w;},function(_internalWatchCjsJs){f=_internalWatchCjsJs.w;}],execute:function execute(){_export("N",y=/*#__PURE__*/function(_s){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.open=!1,_this.variant="light",_this.expandIconPlacement="right",_this.size="md",_this.disabled=!1;return _this;}_inherits(y,_s);return _createClass(y,[{key:"firstUpdated",value:function firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0";}},{key:"handleSummaryClick",value:function handleSummaryClick(){this.disabled||(this.open?this.hide():this.show(),this.header.focus());}},{key:"handleSummaryKeyDown",value:function handleSummaryKeyDown(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.open?this.hide():this.show()),"ArrowUp"!==i.key&&"ArrowLeft"!==i.key||(i.preventDefault(),this.hide()),"ArrowDown"!==i.key&&"ArrowRight"!==i.key||(i.preventDefault(),this.show());}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _m,_i,_a,_m2,_i2,_a2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=13;break;}if(!this.emit("nile-show",{cancelable:!0}).defaultPrevented){_context2.next=3;break;}return _context2.abrupt("return",void(this.open=!1));case 3:_context2.next=5;return e(this.body);case 5:this.body.hidden=!1;_m=m(this,"accordian.show",{dir:"ltr"}),_i=_m.keyframes,_a=_m.options;_context2.next=9;return r(this.body,o(_i,this.body.scrollHeight),_a);case 9:this.body.style.height="auto";this.emit("nile-after-show");_context2.next=23;break;case 13:if(!this.emit("nile-hide",{cancelable:!0}).defaultPrevented){_context2.next=15;break;}return _context2.abrupt("return",void(this.open=!0));case 15:_context2.next=17;return e(this.body);case 17:_m2=m(this,"accordian.hide",{dir:"ltr"}),_i2=_m2.keyframes,_a2=_m2.options;_context2.next=20;return r(this.body,o(_i2,this.body.scrollHeight),_a2);case 20:this.body.hidden=!0;this.body.style.height="auto";this.emit("nile-after-hide");case 23:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(!this.open&&!this.disabled)){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!0,p(this,"nile-after-show")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(this.open&&!this.disabled)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!1,p(this,"nile-after-hide")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <div\n part=\"header\"\n id=\"header\"\n class=\"","\"\n role=\"button\"\n aria-expanded=","\n aria-controls=\"content\"\n aria-disabled=","\n tabindex=","\n @click=","\n @keydown=","\n >\n <slot name=\"summary\" part=\"summary\" class=\"accordian__summary\">","</slot>\n\n <span part=\"summary-icon\" class=\"accordian__summary-icon\">\n <slot name=\"expand-icon\">\n <nile-icon name=\"arrowright\"></nile-icon>\n </slot>\n <slot name=\"collapse-icon\">\n <nile-icon name=\"arrowright\"></nile-icon>\n </slot>\n </span>\n </div>\n\n <div class=\"accordian__body\" role=\"region\" aria-labelledby=\"header\">\n <slot part=\"content\" id=\"content\" \n class=\"","\"></slot>\n </div>\n </div>\n "])),n({accordian:!0,"accordian--open":this.open,"accordian--disabled":this.disabled,"accordian--sm":"sm"==this.size,"accordian--md":"md"==this.size,"accordian--lg":"lg"==this.size}),n({accordian__header:!0,"accordian__header--dark":"dark"==this.variant,"accordian__header--arrow-left":"left"==this.expandIconPlacement}),this.open?"true":"false",this.disabled?"true":"false",this.disabled?"-1":"0",this.handleSummaryClick,this.handleSummaryKeyDown,this.summary,n({accordian__content:!0,"accordian__content--arrow-left":"left"==this.expandIconPlacement}));}}]);}(s));y.styles=t,i([c(".accordian")],y.prototype,"accordian",void 0),i([c(".accordian__header")],y.prototype,"header",void 0),i([c(".accordian__body")],y.prototype,"body",void 0),i([c(".accordian__expand-icon-slot")],y.prototype,"expandIconSlot",void 0),i([h({type:Boolean,reflect:!0})],y.prototype,"open",void 0),i([h({reflect:!0})],y.prototype,"variant",void 0),i([h({reflect:!0})],y.prototype,"expandIconPlacement",void 0),i([h({reflect:!0})],y.prototype,"size",void 0),i([h()],y.prototype,"summary",void 0),i([h({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),i([f("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),_export("N",y=i([d("nile-accordion")],y)),l("accordian.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),l("accordian.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var i,t,a,s,e,r,o,n,c,h,d,l,m,p,f,_templateObject,v;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_nileAccordionCssCjsJs){a=_nileAccordionCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){e=_internalAnimateCjsJs.s;r=_internalAnimateCjsJs.a;o=_internalAnimateCjsJs.b;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){c=_litDecoratorsJs.query;h=_litDecoratorsJs.property;d=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){l=_utilitiesAnimationRegistryCjsJs.s;m=_utilitiesAnimationRegistryCjsJs.g;},function(_internalEventCjsJs){p=_internalEventCjsJs.w;},function(_internalWatchCjsJs){f=_internalWatchCjsJs.w;}],execute:function execute(){_export("N",v=/*#__PURE__*/function(_s){function v(){var _this;_classCallCheck(this,v);_this=_callSuper(this,v,arguments),_this.open=!1,_this.variant="light",_this.expandIconPlacement="right",_this.size="md",_this.disabled=!1;return _this;}_inherits(v,_s);return _createClass(v,[{key:"firstUpdated",value:function firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0";}},{key:"handleSummaryClick",value:function handleSummaryClick(){this.disabled||(this.open?this.hide():this.show(),this.header.focus());}},{key:"handleSummaryKeyDown",value:function handleSummaryKeyDown(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.open?this.hide():this.show()),"ArrowUp"!==i.key&&"ArrowLeft"!==i.key||(i.preventDefault(),this.hide()),"ArrowDown"!==i.key&&"ArrowRight"!==i.key||(i.preventDefault(),this.show());}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _m,_i,_t,_m2,_i2,_t2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=13;break;}if(!this.emit("nile-show",{cancelable:!0}).defaultPrevented){_context2.next=3;break;}return _context2.abrupt("return",void(this.open=!1));case 3:_context2.next=5;return e(this.body);case 5:this.body.hidden=!1;_m=m(this,"accordian.show",{dir:"ltr"}),_i=_m.keyframes,_t=_m.options;_context2.next=9;return r(this.body,o(_i,this.body.scrollHeight),_t);case 9:this.body.style.height="auto";this.emit("nile-after-show");_context2.next=23;break;case 13:if(!this.emit("nile-hide",{cancelable:!0}).defaultPrevented){_context2.next=15;break;}return _context2.abrupt("return",void(this.open=!0));case 15:_context2.next=17;return e(this.body);case 17:_m2=m(this,"accordian.hide",{dir:"ltr"}),_i2=_m2.keyframes,_t2=_m2.options;_context2.next=20;return r(this.body,o(_i2,this.body.scrollHeight),_t2);case 20:this.body.hidden=!0;this.body.style.height="auto";this.emit("nile-after-hide");case 23:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(!this.open&&!this.disabled)){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!0,p(this,"nile-after-show")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(this.open&&!this.disabled)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!1,p(this,"nile-after-hide")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <div\n part=\"header\"\n id=\"header\"\n class=\"","\"\n role=\"button\"\n aria-expanded=","\n aria-controls=\"content\"\n aria-disabled=","\n tabindex=","\n @click=","\n @keydown=","\n >\n <slot name=\"summary\" part=\"summary\" class=\"accordian__summary\">","</slot>\n\n <span part=\"summary-icon\" class=\"accordian__summary-icon\">\n <slot name=\"expand-icon\">\n <nile-icon name=\"var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n <slot name=\"collapse-icon\">\n <nile-icon name=\"var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n </span>\n </div>\n\n <div class=\"accordian__body\" role=\"region\" aria-labelledby=\"header\">\n <slot part=\"content\" id=\"content\" \n class=\"","\"></slot>\n </div>\n </div>\n "])),n({accordian:!0,"accordian--open":this.open,"accordian--disabled":this.disabled,"accordian--sm":"sm"==this.size,"accordian--md":"md"==this.size,"accordian--lg":"lg"==this.size}),n({accordian__header:!0,"accordian__header--dark":"dark"==this.variant,"accordian__header--arrow-left":"left"==this.expandIconPlacement}),this.open?"true":"false",this.disabled?"true":"false",this.disabled?"-1":"0",this.handleSummaryClick,this.handleSummaryKeyDown,this.summary,n({accordian__content:!0,"accordian__content--arrow-left":"left"==this.expandIconPlacement}));}}]);}(s));v.styles=a,i([c(".accordian")],v.prototype,"accordian",void 0),i([c(".accordian__header")],v.prototype,"header",void 0),i([c(".accordian__body")],v.prototype,"body",void 0),i([c(".accordian__expand-icon-slot")],v.prototype,"expandIconSlot",void 0),i([h({type:Boolean,reflect:!0})],v.prototype,"open",void 0),i([h({reflect:!0})],v.prototype,"variant",void 0),i([h({reflect:!0})],v.prototype,"expandIconPlacement",void 0),i([h({reflect:!0})],v.prototype,"size",void 0),i([h()],v.prototype,"summary",void 0),i([h({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),i([f("open",{waitUntilFirstUpdate:!0})],v.prototype,"handleOpenChange",null),_export("N",v=i([d("nile-accordion")],v)),l("accordian.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),l("accordian.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}});}};});
2
2
  //# sourceMappingURL=nile-accordion.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-accordion.cjs.js","sources":["../../../src/nile-accordion/nile-accordion.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult} from 'lit';\nimport {styles} from './nile-accordion.css';\nimport NileElement from '../internal/nile-element';\nimport { animateTo, shimKeyframesHeightAuto, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Nile detail component.\n *\n * @tag nile-accordion\n *\n */\n@customElement('nile-accordion')\nexport class NileAccordion extends NileElement {\n\n/**\n * @summary Accordian show a brief summary and expand to show additional content.\n *\n * @dependency nile-icon\n *\n * @slot - The accordian' main content.\n * @slot summary - The accordian' summary. Alternatively, you can use the `summary` attribute.\n * @slot expand-icon - Optional expand icon to use instead of the default. Works best with `<nile-icon>`.\n * @slot collapse-icon - Optional collapse icon to use instead of the default. Works best with `<nile-icon>`.\n *\n * @event nile-show - Emitted when the accordian opens.\n * @event nile-after-show - Emitted after the accordian opens and all animations are complete.\n * @event nile-hide - Emitted when the accordian closes.\n * @event nile-after-hide - Emitted after the accordian closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart header - The header that wraps both the summary and the expand/collapse icon.\n * @csspart summary - The container that wraps the summary.\n * @csspart summary-icon - The container that wraps the expand/collapse icons.\n * @csspart content - The accordian content.\n *\n * @animation accordian.show - The animation to use when showing accordian. You can use `height: auto` with this animation.\n * @animation accordian.hide - The animation to use when hiding accordian. You can use `height: auto` with this animation.\n */\n\nstatic styles: CSSResultGroup = styles;\n\n\n@query('.accordian') accordian: HTMLElement;\n@query('.accordian__header') header: HTMLElement;\n@query('.accordian__body') body: HTMLElement;\n@query('.accordian__expand-icon-slot') expandIconSlot: HTMLSlotElement;\n\n/**\n * Indicates whether or not the accordian is open. You can toggle this attribute to show and hide the accordian, or you\n * can use the `show()` and `hide()` methods and this attribute will reflect the accordian' open state.\n */\n@property({ type: Boolean, reflect: true }) open = false;\n\n/**\n * Indicates the visual style of the accordian component. Accepted values are `'dark'` or `'light'`.\n * Defaults to `'light'`.\n */\n@property({ reflect: true }) variant: 'dark' | 'light' = 'light';\n\n/**\n * Specifies the direction of the arrow indicator. Accepted values are `'left'` or `'right'`.\n * Defaults to `'right'`.\n */\n@property({ reflect: true }) expandIconPlacement: 'left' | 'right' = 'right';\n\n/**\n * Specifies the size of the accordian component. Accepted values are `'sm'`, `'md'`, or `'lg'`.\n * Defaults to `'md'`.\n */\n@property({ reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n/** The summary to show in the header. If you need to display HTML, use the `summary` slot instead. */\n@property() summary: string;\n\n/** Disables the accordian so it can't be toggled. */\n@property({ type: Boolean, reflect: true }) disabled = false;\n\nfirstUpdated() {\n this.body.hidden = !this.open;\n this.body.style.height = this.open ? 'auto' : '0';\n}\n\nprivate handleSummaryClick() {\n if (!this.disabled) {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n\n this.header.focus();\n }\n}\n\nprivate handleSummaryKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {\n event.preventDefault();\n this.hide();\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n event.preventDefault();\n this.show();\n }\n}\n\n@watch('open', { waitUntilFirstUpdate: true })\nasync handleOpenChange() {\n if (this.open) {\n // Show\n const nileShow = this.emit('nile-show', { cancelable: true });\n if (nileShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n await stopAnimations(this.body);\n this.body.hidden = false;\n\n const { keyframes, options } = getAnimation(this, 'accordian.show', { dir: 'ltr' });\n await animateTo(this.body, shimKeyframesHeightAuto(keyframes, this.body.scrollHeight), options);\n this.body.style.height = 'auto';\n\n this.emit('nile-after-show');\n } else {\n // Hide\n const nileHide = this.emit('nile-hide', { cancelable: true });\n if (nileHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n await stopAnimations(this.body);\n\n const { keyframes, options } = getAnimation(this, 'accordian.hide', { dir: 'ltr' });\n await animateTo(this.body, shimKeyframesHeightAuto(keyframes, this.body.scrollHeight), options);\n this.body.hidden = true;\n this.body.style.height = 'auto';\n\n this.emit('nile-after-hide');\n }\n}\n\n/** Shows the accordian. */\nasync show() {\n if (this.open || this.disabled) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n}\n\n/** Hides the accordian */\nasync hide() {\n if (!this.open || this.disabled) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n}\n\nrender() {\n const isRtl = true;\n\n return html`\n <div\n part=\"base\"\n class=${classMap({\n accordian: true,\n 'accordian--open': this.open,\n 'accordian--disabled': this.disabled,\n 'accordian--sm':this.size=='sm',\n 'accordian--md':this.size=='md',\n 'accordian--lg':this.size=='lg',\n })}\n >\n <div\n part=\"header\"\n id=\"header\"\n class=\"${classMap({\n 'accordian__header':true,\n 'accordian__header--dark':this.variant=='dark',\n 'accordian__header--arrow-left':'left'==this.expandIconPlacement\n })}\"\n role=\"button\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"content\"\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleSummaryClick}\n @keydown=${this.handleSummaryKeyDown}\n >\n <slot name=\"summary\" part=\"summary\" class=\"accordian__summary\">${this.summary}</slot>\n\n <span part=\"summary-icon\" class=\"accordian__summary-icon\">\n <slot name=\"expand-icon\">\n <nile-icon name=\"arrowright\"></nile-icon>\n </slot>\n <slot name=\"collapse-icon\">\n <nile-icon name=\"arrowright\"></nile-icon>\n </slot>\n </span>\n </div>\n\n <div class=\"accordian__body\" role=\"region\" aria-labelledby=\"header\">\n <slot part=\"content\" id=\"content\" \n class=\"${classMap({\n 'accordian__content':true,\n 'accordian__content--arrow-left':this.expandIconPlacement=='left'\n })}\"></slot>\n </div>\n </div>\n `;\n}\n}\n\nsetDefaultAnimation('accordian.show', {\nkeyframes: [\n { height: '0', opacity: '0' },\n { height: 'auto', opacity: '1' }\n],\noptions: { duration: 250, easing: 'linear' }\n});\n\nsetDefaultAnimation('accordian.hide', {\nkeyframes: [\n { height: 'auto', opacity: '1' },\n { height: '0', opacity: '0' }\n],\noptions: { duration: 250, easing: 'linear' }\n});\n\nexport default NileAccordion;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-accordion': NileAccordion;\n }\n}\n"],"names":["NileAccordion","y","constructor","this","open","variant","expandIconPlacement","size","disabled","_this","_inherits","_s","_createClass","key","value","firstUpdated","body","hidden","style","height","handleSummaryClick","hide","show","header","focus","handleSummaryKeyDown","event","preventDefault","_handleOpenChange","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_m","_i","_a","_m2","_i2","_a2","wrap","_callee$","_context2","prev","next","emit","cancelable","defaultPrevented","stopAnimations","getAnimation","dir","keyframes","options","animateTo","shimKeyframesHeightAuto","scrollHeight","abrupt","stop","handleOpenChange","_callee2","_callee2$","_context3","waitForEvent","_callee3","_callee3$","_context4","render","html","_templateObject","_taggedTemplateLiteral","classMap","accordian","accordian__header","summary","accordian__content","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","watch","waitUntilFirstUpdate","customElement","setDefaultAnimation","opacity","duration","easing"],"mappings":"quXAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAuCqCC,KAAAA,CAAIC,IAAAA,CAAAA,CAAG,CAMtBD,CAAAA,KAAAA,CAAOE,OAAqB,CAAA,OAAA,CAM5BF,KAAAA,CAAmBG,mBAAAA,CAAqB,OAMxCH,CAAAA,KAAAA,CAAII,IAAuB,CAAA,IAAA,CAMZJ,KAAAA,CAAQK,QAAAA,CAAAA,CAAG,CAuJtD,QAAAC,KAAA,EArJDC,SAAA,CAAAT,CAAA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E/B,MAAQ,CAAA,GAAA,CAAKoE,OAAS,CAAA,GAAA,CAAA,CACxB,CAAEpE,MAAQ,CAAA,MAAA,CAAQoE,OAAS,CAAA,GAAA,CAAA,CAAA,CAE7BpC,QAAS,CAAEqC,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ,YAGlCH,CAAoB,CAAA,gBAAA,CAAkB,CACtCpC,SAAAA,CAAW,CACT,CAAE/B,MAAAA,CAAQ,MAAQoE,CAAAA,OAAAA,CAAS,KAC3B,CAAEpE,MAAAA,CAAQ,GAAKoE,CAAAA,OAAAA,CAAS,MAE1BpC,OAAS,CAAA,CAAEqC,QAAU,CAAA,GAAA,CAAKC,OAAQ"}
1
+ {"version":3,"file":"nile-accordion.cjs.js","sources":["../../../src/nile-accordion/nile-accordion.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult} from 'lit';\nimport {styles} from './nile-accordion.css';\nimport NileElement from '../internal/nile-element';\nimport { animateTo, shimKeyframesHeightAuto, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Nile detail component.\n *\n * @tag nile-accordion\n *\n */\n@customElement('nile-accordion')\nexport class NileAccordion extends NileElement {\n\n/**\n * @summary Accordian show a brief summary and expand to show additional content.\n *\n * @dependency nile-icon\n *\n * @slot - The accordian' main content.\n * @slot summary - The accordian' summary. Alternatively, you can use the `summary` attribute.\n * @slot expand-icon - Optional expand icon to use instead of the default. Works best with `<nile-icon>`.\n * @slot collapse-icon - Optional collapse icon to use instead of the default. Works best with `<nile-icon>`.\n *\n * @event nile-show - Emitted when the accordian opens.\n * @event nile-after-show - Emitted after the accordian opens and all animations are complete.\n * @event nile-hide - Emitted when the accordian closes.\n * @event nile-after-hide - Emitted after the accordian closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart header - The header that wraps both the summary and the expand/collapse icon.\n * @csspart summary - The container that wraps the summary.\n * @csspart summary-icon - The container that wraps the expand/collapse icons.\n * @csspart content - The accordian content.\n *\n * @animation accordian.show - The animation to use when showing accordian. You can use `height: auto` with this animation.\n * @animation accordian.hide - The animation to use when hiding accordian. You can use `height: auto` with this animation.\n */\n\nstatic styles: CSSResultGroup = styles;\n\n\n@query('.accordian') accordian: HTMLElement;\n@query('.accordian__header') header: HTMLElement;\n@query('.accordian__body') body: HTMLElement;\n@query('.accordian__expand-icon-slot') expandIconSlot: HTMLSlotElement;\n\n/**\n * Indicates whether or not the accordian is open. You can toggle this attribute to show and hide the accordian, or you\n * can use the `show()` and `hide()` methods and this attribute will reflect the accordian' open state.\n */\n@property({ type: Boolean, reflect: true }) open = false;\n\n/**\n * Indicates the visual style of the accordian component. Accepted values are `'dark'` or `'light'`.\n * Defaults to `'light'`.\n */\n@property({ reflect: true }) variant: 'dark' | 'light' = 'light';\n\n/**\n * Specifies the direction of the arrow indicator. Accepted values are `'left'` or `'right'`.\n * Defaults to `'right'`.\n */\n@property({ reflect: true }) expandIconPlacement: 'left' | 'right' = 'right';\n\n/**\n * Specifies the size of the accordian component. Accepted values are `'sm'`, `'md'`, or `'lg'`.\n * Defaults to `'md'`.\n */\n@property({ reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n/** The summary to show in the header. If you need to display HTML, use the `summary` slot instead. */\n@property() summary: string;\n\n/** Disables the accordian so it can't be toggled. */\n@property({ type: Boolean, reflect: true }) disabled = false;\n\nfirstUpdated() {\n this.body.hidden = !this.open;\n this.body.style.height = this.open ? 'auto' : '0';\n}\n\nprivate handleSummaryClick() {\n if (!this.disabled) {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n\n this.header.focus();\n }\n}\n\nprivate handleSummaryKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {\n event.preventDefault();\n this.hide();\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n event.preventDefault();\n this.show();\n }\n}\n\n@watch('open', { waitUntilFirstUpdate: true })\nasync handleOpenChange() {\n if (this.open) {\n // Show\n const nileShow = this.emit('nile-show', { cancelable: true });\n if (nileShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n await stopAnimations(this.body);\n this.body.hidden = false;\n\n const { keyframes, options } = getAnimation(this, 'accordian.show', { dir: 'ltr' });\n await animateTo(this.body, shimKeyframesHeightAuto(keyframes, this.body.scrollHeight), options);\n this.body.style.height = 'auto';\n\n this.emit('nile-after-show');\n } else {\n // Hide\n const nileHide = this.emit('nile-hide', { cancelable: true });\n if (nileHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n await stopAnimations(this.body);\n\n const { keyframes, options } = getAnimation(this, 'accordian.hide', { dir: 'ltr' });\n await animateTo(this.body, shimKeyframesHeightAuto(keyframes, this.body.scrollHeight), options);\n this.body.hidden = true;\n this.body.style.height = 'auto';\n\n this.emit('nile-after-hide');\n }\n}\n\n/** Shows the accordian. */\nasync show() {\n if (this.open || this.disabled) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n}\n\n/** Hides the accordian */\nasync hide() {\n if (!this.open || this.disabled) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n}\n\nrender() {\n const isRtl = true;\n\n return html`\n <div\n part=\"base\"\n class=${classMap({\n accordian: true,\n 'accordian--open': this.open,\n 'accordian--disabled': this.disabled,\n 'accordian--sm':this.size=='sm',\n 'accordian--md':this.size=='md',\n 'accordian--lg':this.size=='lg',\n })}\n >\n <div\n part=\"header\"\n id=\"header\"\n class=\"${classMap({\n 'accordian__header':true,\n 'accordian__header--dark':this.variant=='dark',\n 'accordian__header--arrow-left':'left'==this.expandIconPlacement\n })}\"\n role=\"button\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"content\"\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleSummaryClick}\n @keydown=${this.handleSummaryKeyDown}\n >\n <slot name=\"summary\" part=\"summary\" class=\"accordian__summary\">${this.summary}</slot>\n\n <span part=\"summary-icon\" class=\"accordian__summary-icon\">\n <slot name=\"expand-icon\">\n <nile-icon name=\"var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n <slot name=\"collapse-icon\">\n <nile-icon name=\"var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n </span>\n </div>\n\n <div class=\"accordian__body\" role=\"region\" aria-labelledby=\"header\">\n <slot part=\"content\" id=\"content\" \n class=\"${classMap({\n 'accordian__content':true,\n 'accordian__content--arrow-left':this.expandIconPlacement=='left'\n })}\"></slot>\n </div>\n </div>\n `;\n}\n}\n\nsetDefaultAnimation('accordian.show', {\nkeyframes: [\n { height: '0', opacity: '0' },\n { height: 'auto', opacity: '1' }\n],\noptions: { duration: 250, easing: 'linear' }\n});\n\nsetDefaultAnimation('accordian.hide', {\nkeyframes: [\n { height: 'auto', opacity: '1' },\n { height: '0', opacity: '0' }\n],\noptions: { duration: 250, easing: 'linear' }\n});\n\nexport default NileAccordion;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-accordion': NileAccordion;\n }\n}\n"],"names":["NileAccordion","v","constructor","this","open","variant","expandIconPlacement","size","disabled","_this","_inherits","_s","_createClass","key","value","firstUpdated","body","hidden","style","height","handleSummaryClick","hide","show","header","focus","handleSummaryKeyDown","event","preventDefault","_handleOpenChange","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_m","_i","_t","_m2","_i2","_t2","wrap","_callee$","_context2","prev","next","emit","cancelable","defaultPrevented","stopAnimations","getAnimation","dir","keyframes","options","animateTo","shimKeyframesHeightAuto","scrollHeight","abrupt","stop","handleOpenChange","_callee2","_callee2$","_context3","waitForEvent","_callee3","_callee3$","_context4","render","html","_templateObject","_taggedTemplateLiteral","classMap","accordian","accordian__header","summary","accordian__content","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","watch","waitUntilFirstUpdate","customElement","setDefaultAnimation","opacity","duration","easing"],"mappings":"quXAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAuCqCC,KAAAA,CAAIC,IAAAA,CAAAA,CAAG,CAMtBD,CAAAA,KAAAA,CAAOE,OAAqB,CAAA,OAAA,CAM5BF,KAAAA,CAAmBG,mBAAAA,CAAqB,OAMxCH,CAAAA,KAAAA,CAAII,IAAuB,CAAA,IAAA,CAMZJ,KAAAA,CAAQK,QAAAA,CAAAA,CAAG,CAuJtD,QAAAC,KAAA,EArJDC,SAAA,CAAAT,CAAA,CAAAU,EAAA,SAAAC,YAAA,CAAAX,CAAA,GAAAY,GAAA,gBAAAC,KAAA,UAAAC,YAAAA,CAAAA,CAAAA,CACEZ,IAAKa,CAAAA,IAAAA,CAAKC,MAAUd,CAAAA,CAAAA,IAAAA,CAAKC,IACzBD,CAAAA,IAAAA,CAAKa,IAAKE,CAAAA,KAAAA,CAAMC,MAAShB,CAAAA,IAAAA,CAAKC,IAAO,CAAA,MAAA,CAAS,GAC/C,EAEO,GAAAS,GAAA,sBAAAC,KAAA,UAAAM,kBAAAA,CAAAA,CAAAA,CACDjB,IAAKK,CAAAA,QAAAA,GACJL,IAAKC,CAAAA,IAAAA,CACPD,IAAKkB,CAAAA,IAAAA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@ -1,4 +1,4 @@
1
- import{__decorate as i}from"tslib";import{html as a}from"lit";import{s as t}from"./nile-accordion.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{s as e,a as r,b as o}from"../internal/animate.esm.js";import{classMap as n}from"lit/directives/class-map.js";import{query as c,property as h,customElement as d}from"lit/decorators.js";import{s as l,g as m}from"../utilities/animation-registry.esm.js";import{w as p}from"../internal/event.esm.js";import{w as f}from"../internal/watch.esm.js";let y=class extends s{constructor(){super(...arguments),this.open=!1,this.variant="light",this.expandIconPlacement="right",this.size="md",this.disabled=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.disabled||(this.open?this.hide():this.show(),this.header.focus())}handleSummaryKeyDown(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.open?this.hide():this.show()),"ArrowUp"!==i.key&&"ArrowLeft"!==i.key||(i.preventDefault(),this.hide()),"ArrowDown"!==i.key&&"ArrowRight"!==i.key||(i.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await e(this.body),this.body.hidden=!1;const{keyframes:i,options:a}=m(this,"accordian.show",{dir:"ltr"});await r(this.body,o(i,this.body.scrollHeight),a),this.body.style.height="auto",this.emit("nile-after-show")}else{if(this.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await e(this.body);const{keyframes:i,options:a}=m(this,"accordian.hide",{dir:"ltr"});await r(this.body,o(i,this.body.scrollHeight),a),this.body.hidden=!0,this.body.style.height="auto",this.emit("nile-after-hide")}}async show(){if(!this.open&&!this.disabled)return this.open=!0,p(this,"nile-after-show")}async hide(){if(this.open&&!this.disabled)return this.open=!1,p(this,"nile-after-hide")}render(){return a`
1
+ import{__decorate as i}from"tslib";import{html as t}from"lit";import{s as a}from"./nile-accordion.css.esm.js";import{N as e}from"../internal/nile-element.esm.js";import{s,a as r,b as o}from"../internal/animate.esm.js";import{classMap as n}from"lit/directives/class-map.js";import{query as c,property as h,customElement as d}from"lit/decorators.js";import{s as l,g as m}from"../utilities/animation-registry.esm.js";import{w as p}from"../internal/event.esm.js";import{w as f}from"../internal/watch.esm.js";let v=class extends e{constructor(){super(...arguments),this.open=!1,this.variant="light",this.expandIconPlacement="right",this.size="md",this.disabled=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.disabled||(this.open?this.hide():this.show(),this.header.focus())}handleSummaryKeyDown(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.open?this.hide():this.show()),"ArrowUp"!==i.key&&"ArrowLeft"!==i.key||(i.preventDefault(),this.hide()),"ArrowDown"!==i.key&&"ArrowRight"!==i.key||(i.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await s(this.body),this.body.hidden=!1;const{keyframes:i,options:t}=m(this,"accordian.show",{dir:"ltr"});await r(this.body,o(i,this.body.scrollHeight),t),this.body.style.height="auto",this.emit("nile-after-show")}else{if(this.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await s(this.body);const{keyframes:i,options:t}=m(this,"accordian.hide",{dir:"ltr"});await r(this.body,o(i,this.body.scrollHeight),t),this.body.hidden=!0,this.body.style.height="auto",this.emit("nile-after-hide")}}async show(){if(!this.open&&!this.disabled)return this.open=!0,p(this,"nile-after-show")}async hide(){if(this.open&&!this.disabled)return this.open=!1,p(this,"nile-after-hide")}render(){return t`
2
2
  <div
3
3
  part="base"
4
4
  class=${n({accordian:!0,"accordian--open":this.open,"accordian--disabled":this.disabled,"accordian--sm":"sm"==this.size,"accordian--md":"md"==this.size,"accordian--lg":"lg"==this.size})}
@@ -19,10 +19,10 @@ import{__decorate as i}from"tslib";import{html as a}from"lit";import{s as t}from
19
19
 
20
20
  <span part="summary-icon" class="accordian__summary-icon">
21
21
  <slot name="expand-icon">
22
- <nile-icon name="arrowright"></nile-icon>
22
+ <nile-icon name="var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system"></nile-icon>
23
23
  </slot>
24
24
  <slot name="collapse-icon">
25
- <nile-icon name="arrowright"></nile-icon>
25
+ <nile-icon name="var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system"></nile-icon>
26
26
  </slot>
27
27
  </span>
28
28
  </div>
@@ -32,4 +32,4 @@ import{__decorate as i}from"tslib";import{html as a}from"lit";import{s as t}from
32
32
  class="${n({accordian__content:!0,"accordian__content--arrow-left":"left"==this.expandIconPlacement})}"></slot>
33
33
  </div>
34
34
  </div>
35
- `}};y.styles=t,i([c(".accordian")],y.prototype,"accordian",void 0),i([c(".accordian__header")],y.prototype,"header",void 0),i([c(".accordian__body")],y.prototype,"body",void 0),i([c(".accordian__expand-icon-slot")],y.prototype,"expandIconSlot",void 0),i([h({type:Boolean,reflect:!0})],y.prototype,"open",void 0),i([h({reflect:!0})],y.prototype,"variant",void 0),i([h({reflect:!0})],y.prototype,"expandIconPlacement",void 0),i([h({reflect:!0})],y.prototype,"size",void 0),i([h()],y.prototype,"summary",void 0),i([h({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),i([f("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),y=i([d("nile-accordion")],y),l("accordian.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),l("accordian.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}});export{y as N};
35
+ `}};v.styles=a,i([c(".accordian")],v.prototype,"accordian",void 0),i([c(".accordian__header")],v.prototype,"header",void 0),i([c(".accordian__body")],v.prototype,"body",void 0),i([c(".accordian__expand-icon-slot")],v.prototype,"expandIconSlot",void 0),i([h({type:Boolean,reflect:!0})],v.prototype,"open",void 0),i([h({reflect:!0})],v.prototype,"variant",void 0),i([h({reflect:!0})],v.prototype,"expandIconPlacement",void 0),i([h({reflect:!0})],v.prototype,"size",void 0),i([h()],v.prototype,"summary",void 0),i([h({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),i([f("open",{waitUntilFirstUpdate:!0})],v.prototype,"handleOpenChange",null),v=i([d("nile-accordion")],v),l("accordian.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),l("accordian.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}});export{v as N};
@@ -1,2 +1,2 @@
1
- System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,r,l,h,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,a;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;r=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_virtualize001CjsJs){p=_virtualize001CjsJs.v;},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_h){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[];return _this;}_inherits(a,_h);return _createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(a,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;};}},{key:"updated",value:function updated(t){_superPropGet(a,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction));}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"button-loading-blue-animated\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>\n "])),this.handleSelect,p({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>"])),this.handleSelect,this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var e=this.renderItemFunction(t);return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n ","\n </nile-menu-item>\n "])),e,e);}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this4=this;var t=this.menuItems.reduce(function(t,i){var e=_this4.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement2;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.show());}},{key:"handleFocus",value:function handleFocus(){var _this5=this;this.openOnFocus&&setTimeout(function(){var _this5$dropdownElemen;_this5.isDropdownOpen=!0,(_this5$dropdownElemen=_this5.dropdownElement)===null||_this5$dropdownElemen===void 0?void 0:_this5$dropdownElemen.show();},300);}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement3;this.isDropdownOpen=!0,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this6=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this6.value)&&e.push(t);}),e;}}]);}(h));a.styles=l,t([s("nile-dropdown")],a.prototype,"dropdownElement",void 0),t([n({type:Boolean})],a.prototype,"disabled",void 0),t([n({type:Boolean})],a.prototype,"isDropdownOpen",void 0),t([n({type:Boolean})],a.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],a.prototype,"openOnFocus",void 0),t([n({type:String})],a.prototype,"value",void 0),t([n({type:String})],a.prototype,"placeholder",void 0),t([n({type:Boolean})],a.prototype,"noBorder",void 0),t([n({type:Boolean})],a.prototype,"noOutline",void 0),t([n({type:Boolean})],a.prototype,"noPadding",void 0),t([n({type:Boolean})],a.prototype,"loading",void 0),t([n({attribute:!1})],a.prototype,"filterFunction",void 0),t([n({attribute:!1})],a.prototype,"renderItemFunction",void 0),t([n({type:Array})],a.prototype,"allMenuItems",void 0),t([o()],a.prototype,"menuItems",void 0),_export("N",a=t([r("nile-auto-complete")],a));}};});
1
+ System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,r,l,h,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,p;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;r=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_virtualize001CjsJs){a=_virtualize001CjsJs.v;},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_h){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[];return _this;}_inherits(p,_h);return _createClass(p,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(p,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;};}},{key:"updated",value:function updated(t){_superPropGet(p,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction));}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>\n "])),this.handleSelect,a({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>"])),this.handleSelect,this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var e=this.renderItemFunction(t);return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n ","\n </nile-menu-item>\n "])),e,e);}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this4=this;var t=this.menuItems.reduce(function(t,i){var e=_this4.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement2;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.show());}},{key:"handleFocus",value:function handleFocus(){var _this5=this;this.openOnFocus&&setTimeout(function(){var _this5$dropdownElemen;_this5.isDropdownOpen=!0,(_this5$dropdownElemen=_this5.dropdownElement)===null||_this5$dropdownElemen===void 0?void 0:_this5$dropdownElemen.show();},300);}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement3;this.isDropdownOpen=!0,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this6=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this6.value)&&e.push(t);}),e;}}]);}(h));p.styles=l,t([s("nile-dropdown")],p.prototype,"dropdownElement",void 0),t([n({type:Boolean})],p.prototype,"disabled",void 0),t([n({type:Boolean})],p.prototype,"isDropdownOpen",void 0),t([n({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],p.prototype,"openOnFocus",void 0),t([n({type:String})],p.prototype,"value",void 0),t([n({type:String})],p.prototype,"placeholder",void 0),t([n({type:Boolean})],p.prototype,"noBorder",void 0),t([n({type:Boolean})],p.prototype,"noOutline",void 0),t([n({type:Boolean})],p.prototype,"noPadding",void 0),t([n({type:Boolean})],p.prototype,"loading",void 0),t([n({attribute:!1})],p.prototype,"filterFunction",void 0),t([n({attribute:!1})],p.prototype,"renderItemFunction",void 0),t([n({type:Array})],p.prototype,"allMenuItems",void 0),t([o()],p.prototype,"menuItems",void 0),_export("N",p=t([r("nile-auto-complete")],p));}};});
2
2
  //# sourceMappingURL=nile-auto-complete.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n }\n if (changedProperties.has('isDropdownOpen')) this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n }\n }\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"button-loading-blue-animated\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\">\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item:any):TemplateResult{\n const value=this.renderItemFunction(item)\n return html`\n <nile-menu-item value=${value}>\n ${value}\n </nile-menu-item>\n `;\n }\n\n private handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) this.dropdownElement?.show();\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","_h","a","constructor","this","disabled","isDropdownOpen","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","_this","_inherits","_createClass","key","connectedCallback","super","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","_templateObject5","event","detail","emit","dropdownElement","hide","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","setTimeout","_this$dropdownElement3","list","filterFn","_this6","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","String","attribute","Array","state","customElement"],"mappings":"uiIAiBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAQwBC,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,CAEpBD,CAAAA,KAAAA,CAAcE,gBAAY,CAE1BF,CAAAA,KAAAA,CAAmBG,mBAAY,CAAA,CAAA,CAAA,C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A,CAAEC,KAAMC,OAAoC3F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,SAAA,CAAA,IAAA,IAExBF,CAAA,CAAA,CAA7BG,CAAS,CAAA,CAAEI,WAAU,CAAiK7F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAEzJF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BG,CAAAA,CAAS,CAAEI,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkE7F,CAAAwF,CAAAA,SAAAA,CAAA,oBAAA,CAAA,IAAA,EAAA,CAAA,CAE7DF,CAAA,CAAA,CAA1BG,EAAS,CAAEC,IAAAA,CAAMI,KAAgC9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,cAAA,CAAA,IAAA,EAEzCF,CAAAA,CAAAA,CAAAA,CAAA,CAARS,CAA4B/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,WAAA,CAAA,IAAA,gBAlClBxF,CAAgBsF,CAAAA,CAAAA,CAAA,CAD5BU,CAAAA,CAAc,uBACFhG"}
1
+ {"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n }\n if (changedProperties.has('isDropdownOpen')) this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n }\n }\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\">\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item:any):TemplateResult{\n const value=this.renderItemFunction(item)\n return html`\n <nile-menu-item value=${value}>\n ${value}\n </nile-menu-item>\n `;\n }\n\n private handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) this.dropdownElement?.show();\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","_h","p","constructor","this","disabled","isDropdownOpen","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","_this","_inherits","_createClass","key","connectedCallback","super","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","_templateObject5","event","detail","emit","dropdownElement","hide","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","setTimeout","_this$dropdownElement3","list","filterFn","_this6","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","String","attribute","Array","state","customElement"],"mappings":"uiIAiBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAQwBC,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,CAEpBD,CAAAA,KAAAA,CAAcE,gBAAY,CAE1BF,CAAAA,KAAAA,CAAmBG,mBAAY,CAAA,CAAA,CAAA,CAE/BH,KAAAA,CAAW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AoC3F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,SAAA,CAAA,IAAA,IAExBF,CAAA,CAAA,CAA7BG,CAAS,CAAA,CAAEI,WAAU,CAAiK7F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAEzJF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BG,CAAAA,CAAS,CAAEI,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkE7F,CAAAwF,CAAAA,SAAAA,CAAA,oBAAA,CAAA,IAAA,EAAA,CAAA,CAE7DF,CAAA,CAAA,CAA1BG,EAAS,CAAEC,IAAAA,CAAMI,KAAgC9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,cAAA,CAAA,IAAA,EAEzCF,CAAAA,CAAAA,CAAAA,CAAA,CAARS,CAA4B/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,WAAA,CAAA,IAAA,gBAlClBxF,CAAgBsF,CAAAA,CAAAA,CAAA,CAD5BU,CAAAA,CAAc,uBACFhG"}
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";import{query as s,property as n,state as o,customElement as r}from"lit/decorators.js";import{s as l}from"./nile-auto-complete.css.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{v as p}from"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";let a=class extends h{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.noOutline=!1,this.noPadding=!1,this.loading=!1,this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i`
1
+ import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";import{query as s,property as n,state as o,customElement as r}from"lit/decorators.js";import{s as l}from"./nile-auto-complete.css.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{v as a}from"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";let p=class extends h{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.noOutline=!1,this.noPadding=!1,this.loading=!1,this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i`
2
2
  <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts="input">
3
3
  <nile-input class="nile-auto-complete--input"
4
4
  ?no-border=${this.noBorder}
@@ -13,13 +13,13 @@ import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";impor
13
13
  placeholder=${this.placeholder}
14
14
  exportparts="input"
15
15
  >
16
- ${this.loading?i`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="button-loading-blue-animated"></nile-icon>`:e}
16
+ ${this.loading?i`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system"></nile-icon>`:e}
17
17
  </nile-input>
18
18
  ${this.menuItems.length>0&&!this.loading?t:e}
19
19
  </nile-dropdown>
20
20
  `}getVirtualizedContent(){return i`
21
21
  <nile-menu class="virtualized__menu" @nile-select=${this.handleSelect} id="content-menu" exportparts="menu__items-wrapper:options__wrapper">
22
- ${p({items:this.menuItems,renderItem:t=>this.getItemRenderFunction(t),scroller:!0})}
22
+ ${a({items:this.menuItems,renderItem:t=>this.getItemRenderFunction(t),scroller:!0})}
23
23
  </nile-menu>
24
24
  `}getContent(){return i`
25
25
  <nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper">
@@ -28,4 +28,4 @@ import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";impor
28
28
  <nile-menu-item value=${e}>
29
29
  ${e}
30
30
  </nile-menu-item>
31
- `}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&this.dropdownElement?.show()}handleFocus(){this.openOnFocus&&setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300)}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};a.styles=l,t([s("nile-dropdown")],a.prototype,"dropdownElement",void 0),t([n({type:Boolean})],a.prototype,"disabled",void 0),t([n({type:Boolean})],a.prototype,"isDropdownOpen",void 0),t([n({type:Boolean})],a.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],a.prototype,"openOnFocus",void 0),t([n({type:String})],a.prototype,"value",void 0),t([n({type:String})],a.prototype,"placeholder",void 0),t([n({type:Boolean})],a.prototype,"noBorder",void 0),t([n({type:Boolean})],a.prototype,"noOutline",void 0),t([n({type:Boolean})],a.prototype,"noPadding",void 0),t([n({type:Boolean})],a.prototype,"loading",void 0),t([n({attribute:!1})],a.prototype,"filterFunction",void 0),t([n({attribute:!1})],a.prototype,"renderItemFunction",void 0),t([n({type:Array})],a.prototype,"allMenuItems",void 0),t([o()],a.prototype,"menuItems",void 0),a=t([r("nile-auto-complete")],a);export{a as N};
31
+ `}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&this.dropdownElement?.show()}handleFocus(){this.openOnFocus&&setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300)}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};p.styles=l,t([s("nile-dropdown")],p.prototype,"dropdownElement",void 0),t([n({type:Boolean})],p.prototype,"disabled",void 0),t([n({type:Boolean})],p.prototype,"isDropdownOpen",void 0),t([n({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],p.prototype,"openOnFocus",void 0),t([n({type:String})],p.prototype,"value",void 0),t([n({type:String})],p.prototype,"placeholder",void 0),t([n({type:Boolean})],p.prototype,"noBorder",void 0),t([n({type:Boolean})],p.prototype,"noOutline",void 0),t([n({type:Boolean})],p.prototype,"noPadding",void 0),t([n({type:Boolean})],p.prototype,"loading",void 0),t([n({attribute:!1})],p.prototype,"filterFunction",void 0),t([n({attribute:!1})],p.prototype,"renderItemFunction",void 0),t([n({type:Array})],p.prototype,"allMenuItems",void 0),t([o()],p.prototype,"menuItems",void 0),p=t([r("nile-auto-complete")],p);export{p as N};
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-avatar.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,r,a,e,i,s,o,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){r=_lit.html;},function(_litDecoratorsJs){a=_litDecoratorsJs.property;e=_litDecoratorsJs.state;i=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){s=_litDirectivesClassMapJs.classMap;},function(_nileAvatarCssCjsJs){o=_nileAvatarCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",l=/*#__PURE__*/function(_n){function l(){var _this;_classCallCheck(this,l);_this=_callSuper(this,l,arguments),_this.src="",_this.variant="text",_this.icon="user",_this.name="",_this.bgColor="",_this.textColor="",_this.borderColor="",_this.size="md",_this.isRounded=!0,_this.imageError=!1;return _this;}_inherits(l,_n);return _createClass(l,[{key:"generateInitials",value:function generateInitials(){if(!this.name)return"";var t=this.name.split(" ").filter(function(t){return t.length>0;}).map(function(t){return t.charAt(0).toUpperCase();}).slice(0,2);return t.length>1?t[0]+t[1]:t[0];}},{key:"generateVariantCode",value:function generateVariantCode(t){var r=t.charCodeAt(0),a=1==t.length?r:t.charCodeAt(1);return(r*a+r%23+a%23)%5;}},{key:"getDefaultIconSize",value:function getDefaultIconSize(){switch(this.size){case"xs":return"6";case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28";}}},{key:"render",value:function render(){if("image"!=this.variant||this.imageError){var _t=this.generateInitials();return"text"==this.variant&&_t?this.getContentWrapped(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["",""])),_t),_t):this.getContentWrapped(this.getIconContent(),_t);}return this.getImageContent();}},{key:"getContentWrapped",value:function getContentWrapped(t,a){var e=this.generateVariantCode(a);return r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div\n class=","\n part=\"avatar__content\"\n style=\"\n background-color: ",";\n color:",";\n border: 1px solid ",";\n border-color:","\"\n >\n ","\n </div>"])),s({text__avatar:!0,avatar__xs:"xs"===this.size,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded,variant__orange:0===e&&!this.bgColor,variant__pink:1===e&&!this.bgColor,variant__blue:2===e&&!this.bgColor,variant__light_blue:3===e&&!this.bgColor,variant__green:4===e&&!this.bgColor}),this.bgColor,this.textColor?this.textColor:"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500) )",this.borderColor?this.borderColor:"var(--ng-colors-border-secondary)",a?"".concat(this.borderColor?this.borderColor:"var(--ng-colors-border-secondary)"):"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))",t);}},{key:"getIconContent",value:function getIconContent(){return r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n name=\"","\"\n color=\"","\"\n size=\"","\"\n ></nile-icon>"])),this.icon,this.textColor?this.textColor:"var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500))",this.getDefaultIconSize());}},{key:"getImageContent",value:function getImageContent(){var _this2=this;return r(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" \n <img\n src=\"","\"\n class=\"avatar\"\n class=","\n part=\"avatar__image\"\n style=\"\tbackground-image: url(","), linear-gradient(lightgray, lightgray);\"\n @error=\"","\"\n @load=\"","\"\n />"])),this.src,s({avatar:!0,avatar__xs:"xs"===this.size,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded}),this.src,function(){return _this2.imageError=!0;},function(){return _this2.imageError=!1;});}}],[{key:"styles",get:function get(){return[o];}}]);}(n));t([a({type:String,reflect:!0})],l.prototype,"src",void 0),t([a({type:String,reflect:!0})],l.prototype,"variant",void 0),t([a({type:String,reflect:!0})],l.prototype,"icon",void 0),t([a({type:String,reflect:!0})],l.prototype,"name",void 0),t([a({type:String,reflect:!0,attribute:"bg-color"})],l.prototype,"bgColor",void 0),t([a({type:String,reflect:!0,attribute:"text-color"})],l.prototype,"textColor",void 0),t([a({type:String,reflect:!0,attribute:"border-color"})],l.prototype,"borderColor",void 0),t([a({reflect:!0})],l.prototype,"size",void 0),t([a({type:Boolean,reflect:!0})],l.prototype,"isRounded",void 0),t([e()],l.prototype,"imageError",void 0),_export("N",l=t([i("nile-avatar")],l));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-avatar.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,r,e,a,i,s,o,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){r=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;a=_litDecoratorsJs.state;i=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){s=_litDirectivesClassMapJs.classMap;},function(_nileAvatarCssCjsJs){o=_nileAvatarCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",l=/*#__PURE__*/function(_n){function l(){var _this;_classCallCheck(this,l);_this=_callSuper(this,l,arguments),_this.src="",_this.variant="text",_this.icon="var(--nile-icon-user, var(--ng-icon-user-01))",_this.name="",_this.bgColor="",_this.textColor="",_this.borderColor="",_this.size="md",_this.isRounded=!0,_this.imageError=!1;return _this;}_inherits(l,_n);return _createClass(l,[{key:"generateInitials",value:function generateInitials(){if(!this.name)return"";var t=this.name.split(" ").filter(function(t){return t.length>0;}).map(function(t){return t.charAt(0).toUpperCase();}).slice(0,2);return t.length>1?t[0]+t[1]:t[0];}},{key:"generateVariantCode",value:function generateVariantCode(t){var r=t.charCodeAt(0),e=1==t.length?r:t.charCodeAt(1);return(r*e+r%23+e%23)%5;}},{key:"getDefaultIconSize",value:function getDefaultIconSize(){switch(this.size){case"xs":return"6";case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28";}}},{key:"render",value:function render(){if("image"!=this.variant||this.imageError){var _t=this.generateInitials();return"text"==this.variant&&_t?this.getContentWrapped(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["",""])),_t),_t):this.getContentWrapped(this.getIconContent(),_t);}return this.getImageContent();}},{key:"getContentWrapped",value:function getContentWrapped(t,e){var a=this.generateVariantCode(e);return r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div\n class=","\n part=\"avatar__content\"\n style=\"\n background-color: ",";\n color:",";\n border: 1px solid ",";\n border-color:","\"\n >\n ","\n </div>"])),s({text__avatar:!0,avatar__xs:"xs"===this.size,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded,variant__orange:0===a&&!this.bgColor,variant__pink:1===a&&!this.bgColor,variant__blue:2===a&&!this.bgColor,variant__light_blue:3===a&&!this.bgColor,variant__green:4===a&&!this.bgColor}),this.bgColor,this.textColor?this.textColor:"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500))",this.borderColor?this.borderColor:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))",e?"".concat(this.borderColor?this.borderColor:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))"):"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))",t);}},{key:"getIconContent",value:function getIconContent(){return r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n name=\"","\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n color=\"","\"\n size=\"","\"\n ></nile-icon>"])),this.icon,this.textColor?this.textColor:"var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500))",this.getDefaultIconSize());}},{key:"getImageContent",value:function getImageContent(){var _this2=this;return r(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" \n <img\n src=\"","\"\n class=\"avatar\"\n class=","\n part=\"avatar__image\"\n style=\"\tbackground-image: url(","), linear-gradient(lightgray, lightgray);\"\n @error=\"","\"\n @load=\"","\"\n />"])),this.src,s({avatar:!0,avatar__xs:"xs"===this.size,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded}),this.src,function(){return _this2.imageError=!0;},function(){return _this2.imageError=!1;});}}],[{key:"styles",get:function get(){return[o];}}]);}(n));t([e({type:String,reflect:!0})],l.prototype,"src",void 0),t([e({type:String,reflect:!0})],l.prototype,"variant",void 0),t([e({type:String,reflect:!0})],l.prototype,"icon",void 0),t([e({type:String,reflect:!0})],l.prototype,"name",void 0),t([e({type:String,reflect:!0,attribute:"bg-color"})],l.prototype,"bgColor",void 0),t([e({type:String,reflect:!0,attribute:"text-color"})],l.prototype,"textColor",void 0),t([e({type:String,reflect:!0,attribute:"border-color"})],l.prototype,"borderColor",void 0),t([e({reflect:!0})],l.prototype,"size",void 0),t([e({type:Boolean,reflect:!0})],l.prototype,"isRounded",void 0),t([a()],l.prototype,"imageError",void 0),_export("N",l=t([i("nile-avatar")],l));}};});
2
2
  //# sourceMappingURL=nile-avatar.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-avatar.cjs.js","sources":["../../../src/nile-avatar/nile-avatar.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport { styles } from './nile-avatar.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile icon component.\n *\n * @tag nile-avatar\n *\n */\n@customElement('nile-avatar')\nexport class NileAvatar extends NileElement {\n /**\n * The styles for Avatar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /** Gives the url to the Avatar */\n @property({ type: String, reflect: true }) src = '';\n\n /** Gives the icon to the Avatar */\n @property({ type: String, reflect: true }) variant:'icon' | 'image' | 'text' = 'text';\n\n /** Gives the icon to the Avatar */\n @property({ type: String, reflect: true }) icon = 'user';\n\n /** Gives the default Image Letters to the Avatar */\n @property({ type: String, reflect: true }) name: String = '';\n\n /** Gives the default bg color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'bg-color' }) bgColor = '';\n\n /** Gives the default text color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'text-color' }) textColor = '';\n\n /** Gives the default border color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'border-color' }) borderColor = '';\n\n /** Size of the Avatar */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' = 'md';\n\n /** Gives a border radius of 50% to the Avatar */\n @property({ type: Boolean, reflect: true }) isRounded = true;\n\n @state() private imageError = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n private generateInitials(): string {\n if (!this.name) {\n return '';\n }\n const nameParts = this.name\n .split(' ')\n .filter(part => part.length > 0)\n .map(part => part.charAt(0).toUpperCase())\n .slice(0, 2);\n return nameParts.length > 1 ? nameParts[0] + nameParts[1] : nameParts[0];\n }\n\n private generateVariantCode(initials: string): number {\n const char1 = initials.charCodeAt(0);\n const char2 = initials.length == 1 ? char1 : initials.charCodeAt(1);\n const multifactor = char1 * char2 + (char1 % 23) + (char2 % 23);\n return multifactor % 5;\n }\n\n private getDefaultIconSize() {\n switch (this.size) {\n case 'xs':\n return '6';\n case 'sm':\n return '10';\n case 'md':\n return '16';\n case 'lg':\n return '20';\n case 'xl':\n return '24';\n case '2xl':\n return '28';\n default:\n return '16';\n }\n }\n\n public render(): TemplateResult {\n if('image'==this.variant && !this.imageError){\n return this.getImageContent()\n }\n else{\n const defaultInitials = this.generateInitials();\n if('text'==this.variant && defaultInitials){\n return this.getContentWrapped(html`${defaultInitials}`,defaultInitials);\n }\n else{\n return this.getContentWrapped(this.getIconContent(),defaultInitials)\n }\n }\n }\n\n getContentWrapped(content:TemplateResult,defaultInitials:string){\n const variant__code = this.generateVariantCode(defaultInitials);\n return html`\n <div\n class=${classMap({\n text__avatar: true,\n avatar__xs: this.size === 'xs',\n avatar__small: this.size === 'sm',\n avatar__medium: this.size === 'md',\n avatar__large: this.size === 'lg',\n avatar__extralarge: this.size === 'xl',\n avatar__2xl: this.size === '2xl',\n avatar__rounded: this.isRounded,\n variant__orange: variant__code === 0 && !this.bgColor,\n variant__pink: variant__code === 1 && !this.bgColor,\n variant__blue: variant__code === 2 && !this.bgColor,\n variant__light_blue: variant__code === 3 && !this.bgColor,\n variant__green: variant__code === 4 && !this.bgColor,\n })}\n part=\"avatar__content\"\n style=\"\n background-color: ${this.bgColor};\n color:${this.textColor?this.textColor:\"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500) )\"};\n border: 1px solid ${this.borderColor ? this.borderColor : 'var(--ng-colors-border-secondary)'};\n border-color:${defaultInitials ? `${this.borderColor ? this.borderColor : 'var(--ng-colors-border-secondary)'}` : 'var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))'}\"\n >\n ${content}\n </div>`\n }\n\n getIconContent(){\n return html`\n <nile-icon\n name=\"${this.icon}\"\n color=\"${this.textColor?this.textColor:'var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500))'}\"\n size=\"${this.getDefaultIconSize()}\"\n ></nile-icon>`\n }\n\n getImageContent(){\n return html` \n <img\n src=\"${this.src}\"\n class=\"avatar\"\n class=${classMap({\n avatar: true,\n avatar__xs: this.size === 'xs',\n avatar__small: this.size === 'sm',\n avatar__medium: this.size === 'md',\n avatar__large: this.size === 'lg',\n avatar__extralarge: this.size === 'xl',\n avatar__2xl: this.size === '2xl',\n avatar__rounded: this.isRounded,\n })}\n part=\"avatar__image\"\n style=\"\tbackground-image: url(${this.src}), linear-gradient(lightgray, lightgray);\"\n @error=\"${()=>this.imageError=true}\"\n @load=\"${()=>this.imageError=false}\"\n />`\n }\n\n /* #endregion */\n}\n\nexport default NileAvatar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-avatar': NileAvatar;\n }\n}\n"],"names":["NileAvatar","_n","l","constructor","this","src","variant","icon","name","bgColor","textColor","borderColor","size","isRounded","imageError","_this","_inherits","_createClass","key","value","generateInitials","nameParts","split","filter","part","length","map","charAt","toUpperCase","slice","generateVariantCode","initials","char1","charCodeAt","char2","getDefaultIconSize","render","defaultInitials","getContentWrapped","html","_templateObject","_taggedTemplateLiteral","getIconContent","getImageContent","content","variant__code","_templateObject2","classMap","text__avatar","avatar__xs","avatar__small","avatar__medium","avatar__large","avatar__extralarge","avatar__2xl","avatar__rounded","variant__orange","variant__pink","variant__blue","variant__light_blue","variant__green","_templateObject3","_this2","_templateObject4","avatar","get","styles","NileElement","__decorate","property","type","String","reflect","prototype","attribute","Boolean","state","customElement"],"mappings":"kzGA2BaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAUsCC,KAAAA,CAAGC,GAAAA,CAAG,GAGND,KAAAA,CAAOE,OAAAA,CAA6B,OAGpCF,KAAAA,CAAIG,IAAAA,CAAG,OAGPH,KAAAA,CAAII,IAAAA,CAAW,GAGQJ,KAAAA,CAAOK,OAAAA,CAAG,GAGRL,KAAAA,CAASM,SAAAA,CAAG,GAGVN,KAAAA,CAAWO,WAAAA,CAAG,GAGvDP,KAAAA,CAAIQ,IAAAA,CAA6C,IAGlCR,CAAAA,KAAAA,CAASS,SAAG,CAAA,CAAA,CAAA,CAEvCT,KAAAA,CAAUU,UAAG,CAAA,CAAA,CAyH/B,QAAAC,KAAA,EAxJQC,SAAA,CAAAd,CAAA,CAAAD,EAAA,SAAAgB,YAAA,CAAAf,CAAA,GAAAgB,GAAA,oBAAAC,KAAA,CAqCC,SAAAC,gBAAAA,CAAAA,CAAAA,CACN,IAAKhB,IAAKI,CAAAA,IAAAA,CACR,MAAO,EAET,CAAA,GAAMa,CAAAA,EAAYjB,IAAKI,CAAAA,IAAAA,CACpBc,KA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licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport { styles } from './nile-avatar.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile icon component.\n *\n * @tag nile-avatar\n *\n */\n@customElement('nile-avatar')\nexport class NileAvatar extends NileElement {\n /**\n * The styles for Avatar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /** Gives the url to the Avatar */\n @property({ type: String, reflect: true }) src = '';\n\n /** Gives the icon to the Avatar */\n @property({ type: String, reflect: true }) variant:'icon' | 'image' | 'text' = 'text';\n\n /** Gives the icon to the Avatar */\n @property({ type: String, reflect: true }) icon = 'var(--nile-icon-user, var(--ng-icon-user-01))';\n\n /** Gives the default Image Letters to the Avatar */\n @property({ type: String, reflect: true }) name: String = '';\n\n /** Gives the default bg color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'bg-color' }) bgColor = '';\n\n /** Gives the default text color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'text-color' }) textColor = '';\n\n /** Gives the default border color to the Avatar */\n @property({ type: String, reflect: true, attribute: 'border-color' }) borderColor = '';\n\n /** Size of the Avatar */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' = 'md';\n\n /** Gives a border radius of 50% to the Avatar */\n @property({ type: Boolean, reflect: true }) isRounded = true;\n\n @state() private imageError = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n private generateInitials(): string {\n if (!this.name) {\n return '';\n }\n const nameParts = this.name\n .split(' ')\n .filter(part => part.length > 0)\n .map(part => part.charAt(0).toUpperCase())\n .slice(0, 2);\n return nameParts.length > 1 ? nameParts[0] + nameParts[1] : nameParts[0];\n }\n\n private generateVariantCode(initials: string): number {\n const char1 = initials.charCodeAt(0);\n const char2 = initials.length == 1 ? char1 : initials.charCodeAt(1);\n const multifactor = char1 * char2 + (char1 % 23) + (char2 % 23);\n return multifactor % 5;\n }\n\n private getDefaultIconSize() {\n switch (this.size) {\n case 'xs':\n return '6';\n case 'sm':\n return '10';\n case 'md':\n return '16';\n case 'lg':\n return '20';\n case 'xl':\n return '24';\n case '2xl':\n return '28';\n default:\n return '16';\n }\n }\n\n public render(): TemplateResult {\n if('image'==this.variant && !this.imageError){\n return this.getImageContent()\n }\n else{\n const defaultInitials = this.generateInitials();\n if('text'==this.variant && defaultInitials){\n return this.getContentWrapped(html`${defaultInitials}`,defaultInitials);\n }\n else{\n return this.getContentWrapped(this.getIconContent(),defaultInitials)\n }\n }\n }\n\n getContentWrapped(content:TemplateResult,defaultInitials:string){\n const variant__code = this.generateVariantCode(defaultInitials);\n return html`\n <div\n class=${classMap({\n text__avatar: true,\n avatar__xs: this.size === 'xs',\n avatar__small: this.size === 'sm',\n avatar__medium: this.size === 'md',\n avatar__large: this.size === 'lg',\n avatar__extralarge: this.size === 'xl',\n avatar__2xl: this.size === '2xl',\n avatar__rounded: this.isRounded,\n variant__orange: variant__code === 0 && !this.bgColor,\n variant__pink: variant__code === 1 && !this.bgColor,\n variant__blue: variant__code === 2 && !this.bgColor,\n variant__light_blue: variant__code === 3 && !this.bgColor,\n variant__green: variant__code === 4 && !this.bgColor,\n })}\n part=\"avatar__content\"\n style=\"\n background-color: ${this.bgColor};\n color:${this.textColor?this.textColor:\"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500))\"};\n border: 1px solid ${this.borderColor ? this.borderColor : 'var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))'};\n border-color:${defaultInitials ? `${this.borderColor ? this.borderColor : 'var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))'}` : 'var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))'}\"\n >\n ${content}\n </div>`\n }\n\n getIconContent(){\n return html`\n <nile-icon\n name=\"${this.icon}\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n color=\"${this.textColor?this.textColor:'var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500))'}\"\n size=\"${this.getDefaultIconSize()}\"\n ></nile-icon>`\n }\n\n getImageContent(){\n return html` \n <img\n src=\"${this.src}\"\n class=\"avatar\"\n class=${classMap({\n avatar: true,\n avatar__xs: this.size === 'xs',\n avatar__small: this.size === 'sm',\n avatar__medium: this.size === 'md',\n avatar__large: this.size === 'lg',\n avatar__extralarge: this.size === 'xl',\n avatar__2xl: this.size === '2xl',\n avatar__rounded: this.isRounded,\n })}\n part=\"avatar__image\"\n style=\"\tbackground-image: url(${this.src}), linear-gradient(lightgray, lightgray);\"\n @error=\"${()=>this.imageError=true}\"\n @load=\"${()=>this.imageError=false}\"\n />`\n }\n\n /* #endregion */\n}\n\nexport default NileAvatar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-avatar': NileAvatar;\n }\n}\n"],"names":["NileAvatar","_n","l","constructor","this","src","variant","icon","name","bgColor","textColor","borderColor","size","isRounded","imageError","_this","_inherits","_createClass","key","value","generateInitials","nameParts","split","filter","part","length","map","charAt","toUpperCase","slice","generateVariantCode","initials","char1","charCodeAt","char2","getDefaultIconSize","render","defaultInitials","getContentWrapped","html","_templateObject","_taggedTemplateLiteral","getIconContent","getImageContent","content","variant__code","_templateObject2","classMap","text__avatar","avatar__xs","avatar__small","avatar__medium","avatar__large","avatar__extralarge","avatar__2xl","avatar__rounded","variant__orange","variant__pink","variant__blue","variant__light_blue","variant__green","_templateObject3","_this2","_templateObject4","avatar","get","styles","NileElement","__decorate","property","type","String","reflect","prototype","attribute","Boolean","state","customElement"],"mappings":"kzGA2BaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAUsCC,KAAAA,CAAGC,GAAAA,CAAG,GAGND,KAAAA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AA,CAAA,CAA8DxE,CAAAyE,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAGvCL,CAAA,CAAA,CAA3CC,CAAS,CAAA,CAAEC,IAAMK,CAAAA,OAAAA,CAASH,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyBxE,CAAAyE,CAAAA,SAAAA,CAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CAE5CL,CAAA,CAAA,CAAhBQ,CAAmC5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyE,SAAA,CAAA,YAAA,CAAA,IAAA,EApCzBzE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAUoE,CAAA,CAAA,CADtBS,CAAc,CAAA,aAAA,CAAA,CAAA,CACF7E"}
@@ -1,17 +1,18 @@
1
- import{__decorate as t}from"tslib";import{html as r}from"lit";import{property as e,state as a,customElement as i}from"lit/decorators.js";import{classMap as s}from"lit/directives/class-map.js";import{s as o}from"./nile-avatar.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";let l=class extends n{constructor(){super(...arguments),this.src="",this.variant="text",this.icon="user",this.name="",this.bgColor="",this.textColor="",this.borderColor="",this.size="md",this.isRounded=!0,this.imageError=!1}static get styles(){return[o]}generateInitials(){if(!this.name)return"";const t=this.name.split(" ").filter((t=>t.length>0)).map((t=>t.charAt(0).toUpperCase())).slice(0,2);return t.length>1?t[0]+t[1]:t[0]}generateVariantCode(t){const r=t.charCodeAt(0),e=1==t.length?r:t.charCodeAt(1);return(r*e+r%23+e%23)%5}getDefaultIconSize(){switch(this.size){case"xs":return"6";case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28"}}render(){if("image"!=this.variant||this.imageError){const t=this.generateInitials();return"text"==this.variant&&t?this.getContentWrapped(r`${t}`,t):this.getContentWrapped(this.getIconContent(),t)}return this.getImageContent()}getContentWrapped(t,e){const a=this.generateVariantCode(e);return r`
1
+ import{__decorate as t}from"tslib";import{html as r}from"lit";import{property as e,state as a,customElement as i}from"lit/decorators.js";import{classMap as s}from"lit/directives/class-map.js";import{s as o}from"./nile-avatar.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";let l=class extends n{constructor(){super(...arguments),this.src="",this.variant="text",this.icon="var(--nile-icon-user, var(--ng-icon-user-01))",this.name="",this.bgColor="",this.textColor="",this.borderColor="",this.size="md",this.isRounded=!0,this.imageError=!1}static get styles(){return[o]}generateInitials(){if(!this.name)return"";const t=this.name.split(" ").filter((t=>t.length>0)).map((t=>t.charAt(0).toUpperCase())).slice(0,2);return t.length>1?t[0]+t[1]:t[0]}generateVariantCode(t){const r=t.charCodeAt(0),e=1==t.length?r:t.charCodeAt(1);return(r*e+r%23+e%23)%5}getDefaultIconSize(){switch(this.size){case"xs":return"6";case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28"}}render(){if("image"!=this.variant||this.imageError){const t=this.generateInitials();return"text"==this.variant&&t?this.getContentWrapped(r`${t}`,t):this.getContentWrapped(this.getIconContent(),t)}return this.getImageContent()}getContentWrapped(t,e){const a=this.generateVariantCode(e);return r`
2
2
  <div
3
3
  class=${s({text__avatar:!0,avatar__xs:"xs"===this.size,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded,variant__orange:0===a&&!this.bgColor,variant__pink:1===a&&!this.bgColor,variant__blue:2===a&&!this.bgColor,variant__light_blue:3===a&&!this.bgColor,variant__green:4===a&&!this.bgColor})}
4
4
  part="avatar__content"
5
5
  style="
6
6
  background-color: ${this.bgColor};
7
- color:${this.textColor?this.textColor:"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500) )"};
8
- border: 1px solid ${this.borderColor?this.borderColor:"var(--ng-colors-border-secondary)"};
9
- border-color:${e?`${this.borderColor?this.borderColor:"var(--ng-colors-border-secondary)"}`:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))"}"
7
+ color:${this.textColor?this.textColor:"var(--nile-colors-white-base, var(--ng-colors-text-quaternary-500))"};
8
+ border: 1px solid ${this.borderColor?this.borderColor:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))"};
9
+ border-color:${e?`${this.borderColor?this.borderColor:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))"}`:"var(--nile-colors-neutral-500 , var(--ng-colors-border-secondary))"}"
10
10
  >
11
11
  ${t}
12
12
  </div>`}getIconContent(){return r`
13
13
  <nile-icon
14
14
  name="${this.icon}"
15
+ method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
15
16
  color="${this.textColor?this.textColor:"var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500))"}"
16
17
  size="${this.getDefaultIconSize()}"
17
18
  ></nile-icon>`}getImageContent(){return r`