@aquera/nile-elements 0.0.3-9 → 0.0.4-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/internal/watch.d.ts +3 -3
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js.map +1 -1
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.d.ts +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.js +2 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.js.map +1 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.d.ts +12 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js +186 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.d.ts +70 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +477 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js +1 -1
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -17
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +13 -317
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-drawer/index.js.map +1 -1
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-footer/index.js.map +1 -1
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -1
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-heading/index.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/index.js.map +1 -1
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-loader/nile-loader.js +2 -2
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-loader/nile-loader.js.map +1 -1
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-menu/nile-menu.js.map +1 -1
  37. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  38. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
  39. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-popup/nile-popup.js.map +1 -1
  40. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
  41. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio/nile-radio.js.map +1 -1
  42. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  43. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +1 -1
  44. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  45. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-sidebar/index.js.map +1 -1
  46. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  47. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-spinner/nile-spinner.js.map +1 -1
  48. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js.map +1 -1
  49. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  50. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toolbar/index.js.map +1 -1
  51. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  52. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/watch.d.ts +3 -3
  53. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/custom-element-fc8dd455.cjs.js.map +1 -1
  55. package/dist/index-cd2f9c12.esm.js +35 -0
  56. package/dist/index-cd83c5c8.cjs.js +22 -0
  57. package/dist/index-cd83c5c8.cjs.js.map +1 -0
  58. package/dist/index.cjs.js +1 -1
  59. package/dist/index.esm.js +1 -1
  60. package/dist/index.iife.js +441 -280
  61. package/dist/internal/animate.cjs.js +1 -1
  62. package/dist/internal/animate.cjs.js.map +1 -1
  63. package/dist/internal/default-value.cjs.js.map +1 -1
  64. package/dist/internal/event.cjs.js.map +1 -1
  65. package/dist/internal/form.cjs.js +1 -1
  66. package/dist/internal/form.cjs.js.map +1 -1
  67. package/dist/internal/nile-element.cjs.js.map +1 -1
  68. package/dist/internal/offset.cjs.js.map +1 -1
  69. package/dist/internal/scroll.cjs.js.map +1 -1
  70. package/dist/internal/slot.cjs.js +1 -1
  71. package/dist/internal/slot.cjs.js.map +1 -1
  72. package/dist/internal/tabbable.cjs.js.map +1 -1
  73. package/dist/internal/watch.cjs.js +1 -1
  74. package/dist/internal/watch.cjs.js.map +1 -1
  75. package/dist/nile-auto-complete/index.cjs.js +1 -1
  76. package/dist/nile-auto-complete/index.esm.js +1 -1
  77. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  78. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  79. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  80. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  81. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
  82. package/dist/nile-auto-complete/nile-auto-complete.esm.js +2 -2
  83. package/dist/nile-badge/index.cjs.js.map +1 -1
  84. package/dist/nile-button/index.cjs.js +1 -1
  85. package/dist/nile-button/index.esm.js +1 -1
  86. package/dist/nile-button/nile-button.cjs.js +1 -1
  87. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  88. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  89. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  90. package/dist/nile-button/nile-button.css.esm.js +1 -1
  91. package/dist/nile-button/nile-button.esm.js +2 -2
  92. package/dist/nile-calendar/index.cjs.js +2 -0
  93. package/dist/nile-calendar/index.cjs.js.map +1 -0
  94. package/dist/nile-calendar/index.esm.js +1 -0
  95. package/dist/nile-calendar/nile-calendar.cjs.js +2 -0
  96. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -0
  97. package/dist/nile-calendar/nile-calendar.css.cjs.js +2 -0
  98. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -0
  99. package/dist/nile-calendar/nile-calendar.css.esm.js +174 -0
  100. package/dist/nile-calendar/nile-calendar.esm.js +68 -0
  101. package/dist/nile-checkbox/index.cjs.js +1 -1
  102. package/dist/nile-checkbox/index.esm.js +1 -1
  103. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  104. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  105. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  106. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  107. package/dist/nile-checkbox/nile-checkbox.css.esm.js +1 -1
  108. package/dist/nile-checkbox/nile-checkbox.esm.js +2 -2
  109. package/dist/nile-chip/index.cjs.js +1 -1
  110. package/dist/nile-chip/index.esm.js +1 -1
  111. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  112. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  113. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  114. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  115. package/dist/nile-chip/nile-chip.css.esm.js +1 -1
  116. package/dist/nile-chip/nile-chip.esm.js +2 -2
  117. package/dist/nile-date-picker/index.cjs.js +1 -1
  118. package/dist/nile-date-picker/index.esm.js +1 -1
  119. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  120. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  121. package/dist/nile-date-picker/nile-date-picker.css.cjs.js +1 -1
  122. package/dist/nile-date-picker/nile-date-picker.css.cjs.js.map +1 -1
  123. package/dist/nile-date-picker/nile-date-picker.css.esm.js +2 -2
  124. package/dist/nile-date-picker/nile-date-picker.esm.js +9 -83
  125. package/dist/nile-drawer/index.cjs.js +1 -1
  126. package/dist/nile-drawer/index.cjs.js.map +1 -1
  127. package/dist/nile-drawer/index.esm.js +1 -1
  128. package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
  129. package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
  130. package/dist/nile-drawer/nile-drawer.css.esm.js +1 -1
  131. package/dist/nile-dropdown/index.cjs.js +1 -1
  132. package/dist/nile-dropdown/index.esm.js +1 -1
  133. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  134. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  135. package/dist/nile-dropdown/nile-dropdown.css.cjs.js +1 -1
  136. package/dist/nile-dropdown/nile-dropdown.css.cjs.js.map +1 -1
  137. package/dist/nile-dropdown/nile-dropdown.css.esm.js +1 -1
  138. package/dist/nile-dropdown/nile-dropdown.esm.js +2 -2
  139. package/dist/nile-error-message/index.cjs.js +1 -1
  140. package/dist/nile-error-message/index.esm.js +1 -1
  141. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  142. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  143. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  144. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  145. package/dist/nile-error-message/nile-error-message.css.esm.js +1 -1
  146. package/dist/nile-error-message/nile-error-message.esm.js +2 -2
  147. package/dist/nile-footer/index.cjs.js +1 -1
  148. package/dist/nile-footer/index.cjs.js.map +1 -1
  149. package/dist/nile-footer/index.esm.js +1 -1
  150. package/dist/nile-footer/nile-footer.css.cjs.js +1 -1
  151. package/dist/nile-footer/nile-footer.css.cjs.js.map +1 -1
  152. package/dist/nile-footer/nile-footer.css.esm.js +1 -1
  153. package/dist/nile-form-error-message/index.cjs.js +1 -1
  154. package/dist/nile-form-error-message/index.esm.js +1 -1
  155. package/dist/nile-form-error-message/nile-form-error-message.cjs.js +1 -1
  156. package/dist/nile-form-error-message/nile-form-error-message.cjs.js.map +1 -1
  157. package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js +1 -1
  158. package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js.map +1 -1
  159. package/dist/nile-form-error-message/nile-form-error-message.css.esm.js +1 -1
  160. package/dist/nile-form-error-message/nile-form-error-message.esm.js +2 -2
  161. package/dist/nile-form-help-text/index.cjs.js +1 -1
  162. package/dist/nile-form-help-text/index.esm.js +1 -1
  163. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  164. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
  165. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
  166. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -1
  167. package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +1 -1
  168. package/dist/nile-form-help-text/nile-form-help-text.esm.js +2 -2
  169. package/dist/nile-heading/index.cjs.js.map +1 -1
  170. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  171. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  172. package/dist/nile-icon/index.cjs.js +1 -1
  173. package/dist/nile-icon/index.cjs.js.map +1 -1
  174. package/dist/nile-icon/index.esm.js +1 -1
  175. package/dist/nile-icon/utils.cjs.js.map +1 -1
  176. package/dist/nile-icon-button/index.cjs.js +1 -1
  177. package/dist/nile-icon-button/index.esm.js +1 -1
  178. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  179. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  180. package/dist/nile-icon-button/nile-icon-button.css.cjs.js +1 -1
  181. package/dist/nile-icon-button/nile-icon-button.css.cjs.js.map +1 -1
  182. package/dist/nile-icon-button/nile-icon-button.css.esm.js +1 -1
  183. package/dist/nile-icon-button/nile-icon-button.esm.js +2 -2
  184. package/dist/nile-input/index.cjs.js +1 -1
  185. package/dist/nile-input/index.esm.js +1 -1
  186. package/dist/nile-input/nile-input.cjs.js +1 -1
  187. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  188. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  189. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  190. package/dist/nile-input/nile-input.css.esm.js +1 -1
  191. package/dist/nile-input/nile-input.esm.js +2 -2
  192. package/dist/nile-loader/index.cjs.js +1 -1
  193. package/dist/nile-loader/index.esm.js +1 -1
  194. package/dist/nile-loader/nile-loader.cjs.js +1 -1
  195. package/dist/nile-loader/nile-loader.cjs.js.map +1 -1
  196. package/dist/nile-loader/nile-loader.css.cjs.js.map +1 -1
  197. package/dist/nile-loader/nile-loader.esm.js +2 -2
  198. package/dist/nile-menu/index.cjs.js +1 -1
  199. package/dist/nile-menu/index.esm.js +1 -1
  200. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  201. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  202. package/dist/nile-menu/nile-menu.css.cjs.js +1 -1
  203. package/dist/nile-menu/nile-menu.css.cjs.js.map +1 -1
  204. package/dist/nile-menu/nile-menu.css.esm.js +1 -1
  205. package/dist/nile-menu/nile-menu.esm.js +2 -2
  206. package/dist/nile-menu-item/index.cjs.js +1 -1
  207. package/dist/nile-menu-item/index.esm.js +1 -1
  208. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  209. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  210. package/dist/nile-menu-item/nile-menu-item.css.cjs.js +1 -1
  211. package/dist/nile-menu-item/nile-menu-item.css.cjs.js.map +1 -1
  212. package/dist/nile-menu-item/nile-menu-item.css.esm.js +1 -1
  213. package/dist/nile-menu-item/nile-menu-item.esm.js +2 -2
  214. package/dist/nile-option/index.cjs.js +1 -1
  215. package/dist/nile-option/index.esm.js +1 -1
  216. package/dist/nile-option/nile-option.cjs.js +1 -1
  217. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  218. package/dist/nile-option/nile-option.css.cjs.js +1 -1
  219. package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
  220. package/dist/nile-option/nile-option.css.esm.js +1 -1
  221. package/dist/nile-option/nile-option.esm.js +2 -2
  222. package/dist/nile-popup/index.cjs.js +1 -1
  223. package/dist/nile-popup/index.esm.js +1 -1
  224. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  225. package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
  226. package/dist/nile-popup/nile-popup.css.cjs.js +1 -1
  227. package/dist/nile-popup/nile-popup.css.cjs.js.map +1 -1
  228. package/dist/nile-popup/nile-popup.css.esm.js +1 -1
  229. package/dist/nile-popup/nile-popup.esm.js +2 -2
  230. package/dist/nile-progress-bar/index.cjs.js +1 -1
  231. package/dist/nile-progress-bar/index.esm.js +1 -1
  232. package/dist/nile-progress-bar/nile-progress-bar.cjs.js +1 -1
  233. package/dist/nile-progress-bar/nile-progress-bar.cjs.js.map +1 -1
  234. package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
  235. package/dist/nile-progress-bar/nile-progress-bar.esm.js +2 -2
  236. package/dist/nile-radio/index.cjs.js +1 -1
  237. package/dist/nile-radio/index.esm.js +1 -1
  238. package/dist/nile-radio/nile-radio.cjs.js +1 -1
  239. package/dist/nile-radio/nile-radio.cjs.js.map +1 -1
  240. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  241. package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
  242. package/dist/nile-radio/nile-radio.css.esm.js +1 -1
  243. package/dist/nile-radio/nile-radio.esm.js +2 -2
  244. package/dist/nile-radio-group/index.cjs.js +1 -1
  245. package/dist/nile-radio-group/index.esm.js +1 -1
  246. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  247. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  248. package/dist/nile-radio-group/nile-radio-group.css.cjs.js.map +1 -1
  249. package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
  250. package/dist/nile-select/index.cjs.js +1 -1
  251. package/dist/nile-select/index.esm.js +1 -1
  252. package/dist/nile-select/nile-select.cjs.js +1 -1
  253. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  254. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  255. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  256. package/dist/nile-select/nile-select.css.esm.js +1 -1
  257. package/dist/nile-select/nile-select.esm.js +2 -2
  258. package/dist/nile-sidebar/index.cjs.js.map +1 -1
  259. package/dist/nile-slide-toggle/index.cjs.js +1 -1
  260. package/dist/nile-slide-toggle/index.esm.js +1 -1
  261. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  262. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  263. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  264. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +2 -2
  265. package/dist/nile-spinner/index.cjs.js +1 -1
  266. package/dist/nile-spinner/index.esm.js +1 -1
  267. package/dist/nile-spinner/nile-spinner.cjs.js +1 -1
  268. package/dist/nile-spinner/nile-spinner.cjs.js.map +1 -1
  269. package/dist/nile-spinner/nile-spinner.css.cjs.js +1 -1
  270. package/dist/nile-spinner/nile-spinner.css.cjs.js.map +1 -1
  271. package/dist/nile-spinner/nile-spinner.css.esm.js +1 -1
  272. package/dist/nile-spinner/nile-spinner.esm.js +2 -2
  273. package/dist/nile-tag/index.cjs.js +1 -1
  274. package/dist/nile-tag/index.esm.js +1 -1
  275. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  276. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  277. package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
  278. package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
  279. package/dist/nile-tag/nile-tag.css.esm.js +1 -1
  280. package/dist/nile-tag/nile-tag.esm.js +2 -2
  281. package/dist/nile-textarea/index.cjs.js +1 -1
  282. package/dist/nile-textarea/index.esm.js +1 -1
  283. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  284. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  285. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  286. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  287. package/dist/nile-textarea/nile-textarea.css.esm.js +1 -1
  288. package/dist/nile-textarea/nile-textarea.esm.js +2 -2
  289. package/dist/nile-toolbar/index.cjs.js +1 -1
  290. package/dist/nile-toolbar/index.cjs.js.map +1 -1
  291. package/dist/nile-toolbar/index.esm.js +1 -1
  292. package/dist/nile-toolbar/nile-toolbar.css.cjs.js +1 -1
  293. package/dist/nile-toolbar/nile-toolbar.css.cjs.js.map +1 -1
  294. package/dist/nile-toolbar/nile-toolbar.css.esm.js +1 -1
  295. package/dist/nile-tooltip/index.cjs.js +1 -1
  296. package/dist/nile-tooltip/index.esm.js +1 -1
  297. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  298. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  299. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  300. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  301. package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -1
  302. package/dist/nile-tooltip/nile-tooltip.esm.js +2 -2
  303. package/dist/{property-bf6307e2.esm.js → property-09139d3c.esm.js} +1 -1
  304. package/dist/property-0f6a51ec.cjs.js +6 -0
  305. package/dist/property-0f6a51ec.cjs.js.map +1 -0
  306. package/dist/src/index.d.ts +1 -0
  307. package/dist/src/index.js +1 -0
  308. package/dist/src/index.js.map +1 -1
  309. package/dist/src/internal/watch.d.ts +3 -3
  310. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  311. package/dist/src/nile-badge/index.js.map +1 -1
  312. package/dist/src/nile-button/nile-button.js.map +1 -1
  313. package/dist/src/nile-calendar/index.d.ts +1 -0
  314. package/dist/src/nile-calendar/index.js +2 -0
  315. package/dist/src/nile-calendar/index.js.map +1 -0
  316. package/dist/src/nile-calendar/nile-calendar.css.d.ts +12 -0
  317. package/dist/src/nile-calendar/nile-calendar.css.js +186 -0
  318. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -0
  319. package/dist/src/nile-calendar/nile-calendar.d.ts +70 -0
  320. package/dist/src/nile-calendar/nile-calendar.js +477 -0
  321. package/dist/src/nile-calendar/nile-calendar.js.map +1 -0
  322. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  323. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  324. package/dist/src/nile-date-picker/nile-date-picker.css.js +1 -1
  325. package/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
  326. package/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -17
  327. package/dist/src/nile-date-picker/nile-date-picker.js +13 -317
  328. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  329. package/dist/src/nile-drawer/index.js.map +1 -1
  330. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  331. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  332. package/dist/src/nile-footer/index.js.map +1 -1
  333. package/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -1
  334. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  335. package/dist/src/nile-heading/index.js.map +1 -1
  336. package/dist/src/nile-icon/index.js.map +1 -1
  337. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  338. package/dist/src/nile-input/nile-input.js.map +1 -1
  339. package/dist/src/nile-loader/nile-loader.js +2 -2
  340. package/dist/src/nile-loader/nile-loader.js.map +1 -1
  341. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  342. package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  343. package/dist/src/nile-option/nile-option.js.map +1 -1
  344. package/dist/src/nile-popup/nile-popup.js.map +1 -1
  345. package/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
  346. package/dist/src/nile-radio/nile-radio.js.map +1 -1
  347. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  348. package/dist/src/nile-select/nile-select.js +1 -1
  349. package/dist/src/nile-select/nile-select.js.map +1 -1
  350. package/dist/src/nile-sidebar/index.js.map +1 -1
  351. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  352. package/dist/src/nile-spinner/nile-spinner.js.map +1 -1
  353. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  354. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  355. package/dist/src/nile-toolbar/index.js.map +1 -1
  356. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  357. package/dist/src/watch.d.ts +3 -3
  358. package/dist/tsconfig.tsbuildinfo +1 -1
  359. package/dist/utilities/animation-registry.cjs.js.map +1 -1
  360. package/dist/watch.cjs.js +1 -1
  361. package/dist/watch.cjs.js.map +1 -1
  362. package/package.json +1 -1
  363. package/src/index.ts +1 -0
  364. package/src/nile-calendar/index.ts +1 -0
  365. package/src/nile-calendar/nile-calendar.css.ts +188 -0
  366. package/src/nile-calendar/nile-calendar.ts +571 -0
  367. package/src/nile-date-picker/nile-date-picker.css.ts +1 -1
  368. package/src/nile-date-picker/nile-date-picker.ts +14 -381
  369. package/src/nile-loader/nile-loader.ts +2 -2
  370. package/src/nile-select/nile-select.ts +1 -1
  371. package/dist/index-adad7634.cjs.js +0 -22
  372. package/dist/index-adad7634.cjs.js.map +0 -1
  373. package/dist/index-f1b94546.esm.js +0 -35
  374. package/dist/property-ec52a751.cjs.js +0 -6
  375. package/dist/property-ec52a751.cjs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nile-date-picker.js","sourceRoot":"","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD,OAAO,eAAe,CAAC;AAGvB;;;;;GAKG;AAEH,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,WAAW;IAA/C;;QASU,iBAAY,GAAW,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC7C,gBAAW,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAIX,mBAAc,GAAG,KAA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C;IACJ,CAAC;CACF,CAAA;AA7gByB;IAAvB,KAAK,CAAC,eAAe,CAAC;gDAAwB;AAEH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAAwB;AAEvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAkB;AAEG;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;sDAE/B;AAEgC;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;qDACxC;AAEqB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA6B;AAC3B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDAAyB;AAExB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAe;AAG3C;IADC,KAAK,CAAC,OAAO,CAAC;kDAuBd;AAxDU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAyhB1B;SAzhBY,cAAc;AA2hB3B,eAAe,cAAc,CAAC","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 property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\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 private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n\n\n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n private getDaysArray(year: number, month: number): number[] {\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n return Array.from({ length: daysInMonth }, (_, i) => i + 1);\n }\n\n private nextMonth(): void {\n\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.currentYear++;\n } else {\n this.currentMonth++;\n }\n this.requestUpdate();\n }\n\n private prevMonth(): void {\n\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.currentYear--;\n } else {\n this.currentMonth--;\n }\n this.requestUpdate();\n }\n\n private selectDate(day: number, month: number, year: number): void {\n const selectedDate = new Date(year, month, day);\n\n if (this.range) {\n if (this.startDate && this.endDate) {\n this.startDate = null;\n this.endDate = null;\n }\n\n if (this.isSelectingStart) {\n this.startDate = selectedDate;\n if (this.endDate && selectedDate > this.endDate) {\n this.endDate = null;\n }\n this.isSelectingStart = false;\n } else {\n this.isSelectingStart = true;\n\n if (this.startDate && selectedDate < this.startDate) {\n this.startDate = selectedDate;\n this.endDate = null;\n this.isSelectingStart = false;\n } else {\n this.endDate = selectedDate;\n }\n }\n } else {\n this.value = selectedDate;\n this.emit('nile-changed', { value: this.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n this.requestUpdate();\n }\n\n private confimRange() {\n if (this.startDate && this.endDate) {\n this.emit('nile-range-changed', {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n }\n\n private renderMonth(\n year: number,\n month: number,\n daysArray: number[]\n ): TemplateResult {\n const firstDay = new Date(year, month, 1).getDay();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const prevMonthDays = this.getDaysArray(\n month === 0 ? year - 1 : year,\n month === 0 ? 11 : month - 1\n );\n const nextMonthDays = this.getDaysArray(\n month === 11 ? year + 1 : year,\n month === 11 ? 0 : month + 1\n );\n const fillerDaysBefore = prevMonthDays.slice(\n prevMonthDays.length - firstDay\n );\n const fillerDaysAfter = nextMonthDays.slice(0, 6 - lastDay);\n const allDays = [...fillerDaysBefore, ...daysArray, ...fillerDaysAfter];\n\n const isSelectedDate = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return '';\n\n if (!this.range && this.value) {\n const isSelected =\n day === this.value.getDate() &&\n month === this.value.getMonth() &&\n year === this.value.getFullYear();\n if (isSelected) return 'selected-date';\n }\n\n const isStartDate =\n this.startDate &&\n day === this.startDate.getDate() &&\n month === this.startDate.getMonth() &&\n year === this.startDate.getFullYear();\n const isEndDate =\n this.endDate &&\n day === this.endDate.getDate() &&\n month === this.endDate.getMonth() &&\n year === this.endDate.getFullYear();\n\n return isStartDate ? 'range-start' : isEndDate ? 'range-end' : '';\n };\n\n const isInRange = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return false;\n if (this.startDate && this.endDate) {\n const date = new Date(year, month, day);\n return date >= this.startDate && date <= this.endDate;\n }\n return false;\n };\n\n return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon name=\"arrowleft\" color=\"black\" @click=\"${this.prevMonth}\">\n </nile-icon>\n <span\n >${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n ${year}</span\n >\n <nile-icon name=\"arrowright\" color=\"black\" @click=\"${this.nextMonth}\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n return html` <div\n class=\"day ${isSelectedDate(\n day,\n month,\n year,\n isCurrentMonth\n )} ${isInRange(day, month, year, isCurrentMonth)\n ? 'in-range'\n : ''} ${!isCurrentMonth ? 'filler' : ''}\"\n @click=\"${() => {\n if (isCurrentMonth) {\n this.selectDate(day, month, year);\n }\n }}\"\n >\n ${day}\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n private formatDate(date: Date | null): string {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n private formatDateRange(value: { startDate: Date | null, endDate: Date | null }): string {\n if(!value){\n return value;\n }\n if (!value.startDate || !value.endDate) return '';\n return `${this.formatDate(value.startDate)} - ${this.formatDate(value.endDate)}`;\n }\n\n private handleStartDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.startDate = null;\n }\n if (date && (!this.endDate || date <= this.endDate)) {\n this.startDate = date;\n } else {\n this.startDate = null;\n this.endDate = null;\n }\n this.requestUpdate();\n }\n\n private handleEndDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.endDate = null;\n }\n if (date && (!this.startDate || date >= this.startDate)) {\n this.endDate = date;\n } else {\n this.endDate = null;\n\n }\n this.requestUpdate();\n }\n\n private parseDate(dateString: string): Date | null {\n const [day, month, year] = dateString.split('/').map(Number);\n const date = new Date(year, month - 1, day);\n return !isNaN(date.getTime()) ? date : null;\n }\n\n private isValidDateInput(input: any): boolean {\n const regex = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$/;\n return regex.test(input);\n }\n\n private formatTime(date: Date | null): string {\n if (!date) return '';\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n return `${hours}:${minutes}:${seconds}`;\n }\n\n // Validate time in HH:MM:SS format\n private isValidTimeInput(input: string): boolean {\n const regex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;\n return regex.test(input);\n }\n\n// Parse time string to a Date object\nprivate parseTime(input: string, date: Date): Date | null {\n if (!this.isValidTimeInput(input)) {\n return null;\n }\n const [hour, minute, second] = input.split(':').map(Number);\n const newDate = new Date(date.getTime());\n newDate.setHours(hour, minute, second);\n return newDate;\n}\n\nprivate handleStartTimeInput(event: CustomEvent): void {\n if (!this.startDate) {\n this.startDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.startDate);\n if (time) {\n this.startDate = time;\n } else {\n this.startDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\nprivate handleEndTimeInput(event: CustomEvent): void {\n if (!this.endDate) {\n this.endDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.endDate);\n if (time) {\n this.endDate = time;\n } else {\n this.endDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n const daysArray = this.getDaysArray(this.currentYear, this.currentMonth);\n const nextMonth = (this.currentMonth + 1) % 12;\n const nextYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);\n\n return html`\n <nile-dropdown>\n ${this.range ? html`\n <nile-input\n slot=\"trigger\"\n label=\"Choose a date range\"\n readonly\n value=\"${this.formatDateRange(this.rangeValue)}\"\n >\n <nile-icon name=\"calendar\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n ` : html`\n <nile-input\n slot=\"trigger\"\n label=\"Choose a date\"\n readonly\n value=\"${this.formatDate(this.value)}\"\n >\n <nile-icon name=\"calendar\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n `}\n\n <div class=\"base\">\n <div class=\"calendar-wrapper\">\n <div class=\"calendar-container ${this.range ? 'with-margin' : ''}\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n ${this.range\n ? html`\n <div class=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n (this.currentMonth + 1) % 12,\n this.getDaysArray(\n this.currentYear,\n (this.currentMonth + 1) % 12\n )\n )}\n </div>\n `\n : ''}\n </div>\n ${this.range\n ? html`\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.startDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleStartDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.startDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.endDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleEndDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.endDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"> </nile-input>\n </div>\n<nile-button class=\"apply-button\" ?disabled=\"${\n !this.startDate || !this.endDate\n }\" @click=\"${this.confimRange}\"> Apply</nile-button>\n\n </div>\n </div>\n `\n : ''}\n </div>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-date-picker.js","sourceRoot":"","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD,OAAO,eAAe,CAAC;AAGvB;;;;;GAKG;AAEI,IA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IAAI,EAAE,CAAC;sDAAwB;AAEvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAkB;AAEG;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;sDAE/B;AAEgC;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;qDACxC;AAEqB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA6B;AAC3B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDAAyB;AAExB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAe;AAG3C;IADC,KAAK,CAAC,OAAO,CAAC;kDAuBd;AAxDU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA0K1B;SA1KY,cAAc;AA4K3B,eAAe,cAAc,CAAC","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 property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\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 private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n handleChanged(event:any) {\n this.emit('nile-changed', { value: event.detail.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n\n return html`\n <nile-dropdown .hoist=\"${true}\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"${this.range}\" .range=\"${this.range}\" @nile-changed=\"${this.handleChanged}\"> </nile-calendar>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-drawer/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;;;GAKG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,UAAU;IAA1C;;QAwHE;;WAEG;QAEH,SAAI,GAAG,KAAK,CAAC;QAiBI,iBAAY,GAAG,KAAK,CAAC;IA+CxC,CAAC;IA9DC,0CAA0C;IAElC,mBAAmB;QACzB,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,sCAAsC;YACtC,qBAAqB;SACtB;aAAM;YACL,oCAAoC;YACpC,0DAA0D;YAC1D,iCAAiC;YACjC,cAAc;SACf;IACH,CAAC;IAID,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAE;YACnD,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;gBAAE,IAAI,CAAC,WAAW,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,iBAAuC;QAC7C,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjC,IAAI,CAAC,mBAAmB,EAAE,CAAC;SAC5B;IACH,CAAC;IAED,IAAI,cAAc;QAChB,OAAO;YACL,kBAAkB,EAAE,IAAI,CAAC,IAAI;YAC7B,oBAAoB,EAAE,CAAC,IAAI,CAAC,IAAI;SACjC,CAAC;IACJ,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACX,OAAO,IAAI,CAAA;wBACS,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC;;;;;;;;;KAShD,CAAC;IACJ,CAAC;CACF,CAAA;AA3LiB,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqH1B,CAAA;AAMF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC9B;AAiBJ;IAAR,KAAK,EAAE;gDAA8B;AA7I3B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA4LtB;SA5LY,UAAU","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 { css, PropertyValues } from 'lit';\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-drawer.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-drawer\n *\n */\n@customElement('nile-drawer')\nexport class NileDrawer extends LitElement {\n static override styles = css`\n @keyframes slide-from-right {\n 0% {\n transform: translateX(100%);\n }\n\n 100% {\n transform: translateX(0);\n }\n }\n :not(:defined) {\n visibility: hidden;\n }\n :host {\n box-sizing: border-box;\n position: fixed;\n display: none;\n top: 0;\n right: 0;\n bottom: 0;\n width: 424px;\n padding: var(--bl-size-xl);\n padding-top: max(env(safe-area-inset-top), var(--bl-size-xl));\n padding-right: max(env(safe-area-inset-right), var(--bl-size-xl));\n padding-bottom: max(env(safe-area-inset-bottom), var(--bl-size-xl));\n background: var(--bl-color-primary-background);\n box-shadow: var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);\n transform: translateX(0); //translateX(100%);\n transition: transform var(--bl-drawer-animation-duration, 0.25s);\n z-index: 999;\n background-color: #fff;\n border-left: 1px solid #e5e5e5;\n }\n\n :host([open]) .drawer {\n transform: translateX(0);\n animation: slide-from-right var(--bl-drawer-animation-duration, 0.25s);\n position: fixed;\n box-shadow: 0px 14px 28px rgb(119 125 130 / 15%);\n }\n\n .nds-drawer {\n box-sizing: border-box;\n position: fixed;\n display: flex;\n top: 0;\n right: 0;\n bottom: 0;\n width: 424px;\n padding: var(--bl-size-xl);\n padding-top: max(env(safe-area-inset-top), var(--bl-size-xl));\n padding-right: max(env(safe-area-inset-right), var(--bl-size-xl));\n padding-bottom: max(env(safe-area-inset-bottom), var(--bl-size-xl));\n background: var(--bl-color-primary-background);\n box-shadow: var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);\n transform: translateX(100%);\n transition: transform var(--bl-drawer-animation-duration, 0.25s);\n z-index: 999;\n }\n\n iframe {\n height: 100%;\n width: 100%;\n border: none;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n gap: var(--bl-size-xl);\n flex: 1;\n }\n\n header {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n gap: var(--bl-size-2xs);\n background-color: white;\n }\n\n header .header-buttons {\n display: flex;\n gap: 24px;\n margin-left: auto;\n }\n\n header h2 {\n font: var(--bl-font-title-1-medium);\n color: var(--bl-color-secondary);\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n\n .content {\n flex: 1;\n overflow-y: scroll;\n }\n\n .iframe-content {\n flex: 1;\n }\n\n @media only screen and (max-width: 424px) {\n :host([open]) .drawer {\n width: calc(100vw - 24px);\n }\n }\n\n .header-section {\n width: 100%;\n background-color: #e5e5e5;\n }\n .nds-drawer--closed {\n display: none;\n }\n `;\n\n /**\n * Sets drawer open-close status\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n // private domExistenceSchedule: number;\n\n private toggleDialogHandler() {\n if (this.open) {\n this.domExistence = true;\n // FIXME: Allow events without payload\n // this.onOpen('');\n } else {\n // Give some time for exit animation\n // this.domExistenceSchedule = window.setTimeout(() => {\n // this.domExistence = false;\n // }, 1000);\n }\n }\n\n @state() private domExistence = false;\n\n connectedCallback() {\n super.connectedCallback();\n window?.addEventListener('nile-drawer-open', event => {\n if (event.target !== this) this.closeDrawer();\n });\n }\n\n private closeDrawer() {\n this.open = false;\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('open')) {\n this.toggleDialogHandler();\n }\n }\n\n get buttonClassMap() {\n return {\n 'nds-drawer--open': this.open,\n 'nds-drawer--closed': !this.open,\n };\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n <div class=\"btn ${classMap(this.buttonClassMap)}\">\n <slot name=\"header\">\n <div class=\"header-section\">\n <nile-heading name=\"Edit Config\"></nile-heading>\n </div>\n </slot>\n <slot name=\"content\"></slot>\n <slot name=\"footer\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-drawer': NileDrawer;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-drawer/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqH3B,CAAC;AAMF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC9B;AAiBJ;IAAR,KAAK,EAAE;gDAA8B;AA7I3B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA4LtB;SA5LY,UAAU","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 { css, PropertyValues } from 'lit';\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-drawer.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-drawer\n *\n */\n@customElement('nile-drawer')\nexport class NileDrawer extends LitElement {\n static override styles = css`\n @keyframes slide-from-right {\n 0% {\n transform: translateX(100%);\n }\n\n 100% {\n transform: translateX(0);\n }\n }\n :not(:defined) {\n visibility: hidden;\n }\n :host {\n box-sizing: border-box;\n position: fixed;\n display: none;\n top: 0;\n right: 0;\n bottom: 0;\n width: 424px;\n padding: var(--bl-size-xl);\n padding-top: max(env(safe-area-inset-top), var(--bl-size-xl));\n padding-right: max(env(safe-area-inset-right), var(--bl-size-xl));\n padding-bottom: max(env(safe-area-inset-bottom), var(--bl-size-xl));\n background: var(--bl-color-primary-background);\n box-shadow: var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);\n transform: translateX(0); //translateX(100%);\n transition: transform var(--bl-drawer-animation-duration, 0.25s);\n z-index: 999;\n background-color: #fff;\n border-left: 1px solid #e5e5e5;\n }\n\n :host([open]) .drawer {\n transform: translateX(0);\n animation: slide-from-right var(--bl-drawer-animation-duration, 0.25s);\n position: fixed;\n box-shadow: 0px 14px 28px rgb(119 125 130 / 15%);\n }\n\n .nds-drawer {\n box-sizing: border-box;\n position: fixed;\n display: flex;\n top: 0;\n right: 0;\n bottom: 0;\n width: 424px;\n padding: var(--bl-size-xl);\n padding-top: max(env(safe-area-inset-top), var(--bl-size-xl));\n padding-right: max(env(safe-area-inset-right), var(--bl-size-xl));\n padding-bottom: max(env(safe-area-inset-bottom), var(--bl-size-xl));\n background: var(--bl-color-primary-background);\n box-shadow: var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);\n transform: translateX(100%);\n transition: transform var(--bl-drawer-animation-duration, 0.25s);\n z-index: 999;\n }\n\n iframe {\n height: 100%;\n width: 100%;\n border: none;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n gap: var(--bl-size-xl);\n flex: 1;\n }\n\n header {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n gap: var(--bl-size-2xs);\n background-color: white;\n }\n\n header .header-buttons {\n display: flex;\n gap: 24px;\n margin-left: auto;\n }\n\n header h2 {\n font: var(--bl-font-title-1-medium);\n color: var(--bl-color-secondary);\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n\n .content {\n flex: 1;\n overflow-y: scroll;\n }\n\n .iframe-content {\n flex: 1;\n }\n\n @media only screen and (max-width: 424px) {\n :host([open]) .drawer {\n width: calc(100vw - 24px);\n }\n }\n\n .header-section {\n width: 100%;\n background-color: #e5e5e5;\n }\n .nds-drawer--closed {\n display: none;\n }\n `;\n\n /**\n * Sets drawer open-close status\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n // private domExistenceSchedule: number;\n\n private toggleDialogHandler() {\n if (this.open) {\n this.domExistence = true;\n // FIXME: Allow events without payload\n // this.onOpen('');\n } else {\n // Give some time for exit animation\n // this.domExistenceSchedule = window.setTimeout(() => {\n // this.domExistence = false;\n // }, 1000);\n }\n }\n\n @state() private domExistence = false;\n\n connectedCallback() {\n super.connectedCallback();\n window?.addEventListener('nile-drawer-open', event => {\n if (event.target !== this) this.closeDrawer();\n });\n }\n\n private closeDrawer() {\n this.open = false;\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('open')) {\n this.toggleDialogHandler();\n }\n }\n\n get buttonClassMap() {\n return {\n 'nds-drawer--open': this.open,\n 'nds-drawer--closed': !this.open,\n };\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n <div class=\"btn ${classMap(this.buttonClassMap)}\">\n <slot name=\"header\">\n <div class=\"header-section\">\n <nile-heading name=\"Edit Config\"></nile-heading>\n </div>\n </slot>\n <slot name=\"content\"></slot>\n <slot name=\"footer\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-drawer': NileDrawer;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-dropdown.js","sourceRoot":"","sources":["../../../src/nile-dropdown/nile-dropdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAG,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,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E,OAAO,EAAE,IAAI,EAAE,CAAC;sDAA0B;AAMvE;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAAiC;AAGpC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAc;AAGZ;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAuB;AAGvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAc;AAMZ;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAe;AA+P3C;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAkC7C;AA5VU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAoYxB;SApYY,YAAY;AAsYzB,mBAAmB,CAAC,eAAe,EAAE;IACnC,SAAS,EAAE;QACT,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;QAC1B,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;KACzB;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;CAC3C,CAAC,CAAC;AAEH,mBAAmB,CAAC,eAAe,EAAE;IACnC,SAAS,EAAE;QACT,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QACxB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;KAC3B;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;CAC3C,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-dropdown.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\n\n/**\n * Nile icon component.\n *\n * @tag nile-dropdown\n * @summary Dropdowns expose additional content that \"drops down\" in a panel.\n * @dependency nile-popup\n *\n * @slot - The dropdown's main content.\n * @slot trigger - The dropdown's trigger, usually a `<nile-button>` element.\n *\n * @event nile-show - Emitted when the dropdown opens.\n * @event nile-after-show - Emitted after the dropdown opens and all animations are complete.\n * @event nile-hide - Emitted when the dropdown closes.\n * @event nile-after-hide - Emitted after the dropdown closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart trigger - The container that wraps the trigger.\n * @csspart panel - The panel that gets shown when the dropdown is open.\n *\n * @animation dropdown.show - The animation to use when showing the dropdown.\n * @animation dropdown.hide - The animation to use when hiding the dropdown.\n */\n@customElement('nile-dropdown')\nexport class NileDropdown extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @query('.dropdown') popup: NilePopup;\n @query('.dropdown__trigger') trigger: HTMLSlotElement;\n @query('.dropdown__panel') panel: HTMLSlotElement;\n\n\n /**\n * Indicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you\n * can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel\n * inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom-start';\n\n /** Disables the dropdown so the panel will not open. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @property({ attribute: 'stay-open-on-select', type: Boolean, reflect: true }) stayOpenOnSelect = false;\n\n /**\n * The dropdown will close when the user interacts outside of this element (e.g. clicking). Useful for composing other\n * components that use a dropdown internally.\n */\n @property({ attribute: false }) containingElement?: HTMLElement;\n\n /** The distance in pixels from which to offset the panel away from its trigger. */\n @property({ type: Number }) distance = 0;\n\n\n @property({ type: Boolean }) noOpenOnClick = false;\n\n /** The distance in pixels from which to offset the panel along its trigger. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handlePanelSelect = this.handlePanelSelect.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n\n if (!this.containingElement) {\n this.containingElement = this;\n }\n }\n\n firstUpdated() {\n this.panel.hidden = !this.open;\n\n // If the dropdown is visible on init, update its position\n if (this.open) {\n this.addOpenListeners();\n this.popup.active = true;\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.hide();\n }\n\n focusOnTrigger() {\n const trigger = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n if (typeof trigger?.focus === 'function') {\n trigger.focus();\n }\n }\n\n getMenu() {\n return this.panel.assignedElements({ flatten: true }).find(el => el.tagName.toLowerCase() === 'nile-menu') as\n | NileMenu\n | undefined;\n }\n\n handleKeyDown(event: KeyboardEvent) {\n // Close when escape is pressed inside an open dropdown. We need to listen on the panel itself and stop propagation\n // in case any ancestors are also listening for this key.\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n // Close when escape or tab is pressed\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n this.focusOnTrigger();\n this.hide();\n return;\n }\n\n // Handle tabbing\n if (event.key === 'Tab') {\n // Tabbing within an open menu should close the dropdown and refocus the trigger\n if (this.open && document.activeElement?.tagName.toLowerCase() === 'nile-menu-item') {\n event.preventDefault();\n this.hide();\n this.focusOnTrigger();\n return;\n }\n\n // Tabbing outside of the containing element closes the panel\n //\n // If the dropdown is used within a shadow DOM, we need to obtain the activeElement within that shadowRoot,\n // otherwise `document.activeElement` will only return the name of the parent shadow DOM element.\n setTimeout(() => {\n const activeElement =\n this.containingElement?.getRootNode() instanceof ShadowRoot\n ? document.activeElement?.shadowRoot?.activeElement\n : document.activeElement;\n\n if (\n !this.containingElement ||\n activeElement?.closest(this.containingElement.tagName.toLowerCase()) !== this.containingElement\n ) {\n this.hide();\n }\n });\n }\n }\n\n handleDocumentMouseDown(event: MouseEvent) {\n // Close when clicking outside of the containing element\n const path = event.composedPath();\n if (this.containingElement && !path.includes(this.containingElement)) {\n this.hide();\n }\n }\n\n handlePanelSelect(event: any) {\n const target = event.target as HTMLElement;\n\n // Hide the dropdown when a menu item is selected\n if (!this.stayOpenOnSelect && target.tagName.toLowerCase() === 'nile-menu') {\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerClick() {\n if(this.noOpenOnClick){\n return;\n }\n if (this.open) {\n this.hide();\n } else {\n this.show();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerKeyDown(event: KeyboardEvent) {\n // When spacebar/enter is pressed, show the panel but don't focus on the menu. This let's the user press the same\n // key again to hide the menu in case they don't want to make a selection.\n // if (['Enter'].includes(event.key)) {\n // event.preventDefault();\n // this.handleTriggerClick();\n // return;\n // }\n\n const menu = this.getMenu();\n\n if (menu) {\n const menuItems = menu.getAllItems();\n const firstMenuItem = menuItems[0];\n const lastMenuItem = menuItems[menuItems.length - 1];\n\n // When up/down is pressed, we make the assumption that the user is familiar with the menu and plans to make a\n // selection. Rather than toggle the panel, we focus on the menu (if one exists) and activate the first item for\n // faster navigation.\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.open) {\n this.show();\n }\n\n if (menuItems.length > 0) {\n // Focus on the first/last menu item after showing\n this.updateComplete.then(() => {\n if (event.key === 'ArrowDown' || event.key === 'Home') {\n menu.setCurrentItem(firstMenuItem);\n firstMenuItem.focus();\n }\n\n if (event.key === 'ArrowUp' || event.key === 'End') {\n menu.setCurrentItem(lastMenuItem);\n lastMenuItem.focus();\n }\n });\n }\n }\n }\n }\n\n handleTriggerKeyUp(event: KeyboardEvent) {\n // Prevent space from triggering a click event in Firefox\n if (event.key === ' ') {\n event.preventDefault();\n }\n }\n\n handleTriggerSlotChange() {\n this.updateAccessibleTrigger();\n }\n\n //\n // Slotted triggers can be arbitrary content, but we need to link them to the dropdown panel with `aria-haspopup` and\n // `aria-expanded`. These must be applied to the \"accessible trigger\" (the tabbable portion of the trigger element\n // that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,\n // a child of the slotted element, or an element in the slotted element's shadow root.\n //\n // For example, the accessible trigger of an <nile-button> is a <button> located inside its shadow root.\n //\n // To determine this, we assume the first tabbable element in the trigger slot is the \"accessible trigger.\"\n //\n updateAccessibleTrigger() {\n const assignedElements = this.trigger.assignedElements({ flatten: true }) as HTMLElement[];\n const accessibleTrigger = assignedElements.find(el => getTabbableBoundary(el).start);\n let target: HTMLElement;\n\n if (accessibleTrigger) {\n switch (accessibleTrigger.tagName.toLowerCase()) {\n // nile buttons have to update the internal button so it's announced correctly by screen readers\n case 'nile-button':\n case 'nile-icon-button':\n target = (accessibleTrigger as NileButton | NileIconButton).button;\n break;\n\n default:\n target = accessibleTrigger;\n }\n\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n /** Shows the dropdown panel. */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the dropdown panel */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n /**\n * Instructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu\n * is activated.\n */\n reposition() {\n this.popup.reposition();\n }\n\n addOpenListeners() {\n this.panel.addEventListener('nile-select', this.handlePanelSelect);\n this.panel.addEventListener('keydown', this.handleKeyDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n removeOpenListeners() {\n if (this.panel) {\n this.panel.removeEventListener('nile-select', this.handlePanelSelect);\n this.panel.removeEventListener('keydown', this.handleKeyDown);\n }\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.disabled) {\n this.open = false;\n return;\n }\n\n this.updateAccessibleTrigger();\n\n if (this.open) {\n // Show\n this.emit('nile-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.panel.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'dropdown.show', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n this.removeOpenListeners();\n\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'dropdown.hide', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.panel.hidden = true;\n this.popup.active = false;\n\n this.emit('nile-after-hide');\n }\n }\n\n render() {\n return html`\n <nile-popup\n part=\"base\"\n id=\"dropdown\"\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': this.open\n })}\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n @keyup=${this.handleTriggerKeyUp}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-labelledby=\"dropdown\"\n ></slot>\n </nile-popup>\n `;\n }\n}\n\nsetDefaultAnimation('dropdown.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('dropdown.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nexport default NileDropdown;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-dropdown': NileDropdown;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-dropdown.js","sourceRoot":"","sources":["../../../src/nile-dropdown/nile-dropdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,S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,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QACxB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;KAC3B;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;CAC3C,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-dropdown.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\n\n/**\n * Nile icon component.\n *\n * @tag nile-dropdown\n * @summary Dropdowns expose additional content that \"drops down\" in a panel.\n * @dependency nile-popup\n *\n * @slot - The dropdown's main content.\n * @slot trigger - The dropdown's trigger, usually a `<nile-button>` element.\n *\n * @event nile-show - Emitted when the dropdown opens.\n * @event nile-after-show - Emitted after the dropdown opens and all animations are complete.\n * @event nile-hide - Emitted when the dropdown closes.\n * @event nile-after-hide - Emitted after the dropdown closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart trigger - The container that wraps the trigger.\n * @csspart panel - The panel that gets shown when the dropdown is open.\n *\n * @animation dropdown.show - The animation to use when showing the dropdown.\n * @animation dropdown.hide - The animation to use when hiding the dropdown.\n */\n@customElement('nile-dropdown')\nexport class NileDropdown extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @query('.dropdown') popup: NilePopup;\n @query('.dropdown__trigger') trigger: HTMLSlotElement;\n @query('.dropdown__panel') panel: HTMLSlotElement;\n\n\n /**\n * Indicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you\n * can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel\n * inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom-start';\n\n /** Disables the dropdown so the panel will not open. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @property({ attribute: 'stay-open-on-select', type: Boolean, reflect: true }) stayOpenOnSelect = false;\n\n /**\n * The dropdown will close when the user interacts outside of this element (e.g. clicking). Useful for composing other\n * components that use a dropdown internally.\n */\n @property({ attribute: false }) containingElement?: HTMLElement;\n\n /** The distance in pixels from which to offset the panel away from its trigger. */\n @property({ type: Number }) distance = 0;\n\n\n @property({ type: Boolean }) noOpenOnClick = false;\n\n /** The distance in pixels from which to offset the panel along its trigger. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handlePanelSelect = this.handlePanelSelect.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n\n if (!this.containingElement) {\n this.containingElement = this;\n }\n }\n\n firstUpdated() {\n this.panel.hidden = !this.open;\n\n // If the dropdown is visible on init, update its position\n if (this.open) {\n this.addOpenListeners();\n this.popup.active = true;\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.hide();\n }\n\n focusOnTrigger() {\n const trigger = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n if (typeof trigger?.focus === 'function') {\n trigger.focus();\n }\n }\n\n getMenu() {\n return this.panel.assignedElements({ flatten: true }).find(el => el.tagName.toLowerCase() === 'nile-menu') as\n | NileMenu\n | undefined;\n }\n\n handleKeyDown(event: KeyboardEvent) {\n // Close when escape is pressed inside an open dropdown. We need to listen on the panel itself and stop propagation\n // in case any ancestors are also listening for this key.\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n // Close when escape or tab is pressed\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n this.focusOnTrigger();\n this.hide();\n return;\n }\n\n // Handle tabbing\n if (event.key === 'Tab') {\n // Tabbing within an open menu should close the dropdown and refocus the trigger\n if (this.open && document.activeElement?.tagName.toLowerCase() === 'nile-menu-item') {\n event.preventDefault();\n this.hide();\n this.focusOnTrigger();\n return;\n }\n\n // Tabbing outside of the containing element closes the panel\n //\n // If the dropdown is used within a shadow DOM, we need to obtain the activeElement within that shadowRoot,\n // otherwise `document.activeElement` will only return the name of the parent shadow DOM element.\n setTimeout(() => {\n const activeElement =\n this.containingElement?.getRootNode() instanceof ShadowRoot\n ? document.activeElement?.shadowRoot?.activeElement\n : document.activeElement;\n\n if (\n !this.containingElement ||\n activeElement?.closest(this.containingElement.tagName.toLowerCase()) !== this.containingElement\n ) {\n this.hide();\n }\n });\n }\n }\n\n handleDocumentMouseDown(event: MouseEvent) {\n // Close when clicking outside of the containing element\n const path = event.composedPath();\n if (this.containingElement && !path.includes(this.containingElement)) {\n this.hide();\n }\n }\n\n handlePanelSelect(event: any) {\n const target = event.target as HTMLElement;\n\n // Hide the dropdown when a menu item is selected\n if (!this.stayOpenOnSelect && target.tagName.toLowerCase() === 'nile-menu') {\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerClick() {\n if(this.noOpenOnClick){\n return;\n }\n if (this.open) {\n this.hide();\n } else {\n this.show();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerKeyDown(event: KeyboardEvent) {\n // When spacebar/enter is pressed, show the panel but don't focus on the menu. This let's the user press the same\n // key again to hide the menu in case they don't want to make a selection.\n // if (['Enter'].includes(event.key)) {\n // event.preventDefault();\n // this.handleTriggerClick();\n // return;\n // }\n\n const menu = this.getMenu();\n\n if (menu) {\n const menuItems = menu.getAllItems();\n const firstMenuItem = menuItems[0];\n const lastMenuItem = menuItems[menuItems.length - 1];\n\n // When up/down is pressed, we make the assumption that the user is familiar with the menu and plans to make a\n // selection. Rather than toggle the panel, we focus on the menu (if one exists) and activate the first item for\n // faster navigation.\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.open) {\n this.show();\n }\n\n if (menuItems.length > 0) {\n // Focus on the first/last menu item after showing\n this.updateComplete.then(() => {\n if (event.key === 'ArrowDown' || event.key === 'Home') {\n menu.setCurrentItem(firstMenuItem);\n firstMenuItem.focus();\n }\n\n if (event.key === 'ArrowUp' || event.key === 'End') {\n menu.setCurrentItem(lastMenuItem);\n lastMenuItem.focus();\n }\n });\n }\n }\n }\n }\n\n handleTriggerKeyUp(event: KeyboardEvent) {\n // Prevent space from triggering a click event in Firefox\n if (event.key === ' ') {\n event.preventDefault();\n }\n }\n\n handleTriggerSlotChange() {\n this.updateAccessibleTrigger();\n }\n\n //\n // Slotted triggers can be arbitrary content, but we need to link them to the dropdown panel with `aria-haspopup` and\n // `aria-expanded`. These must be applied to the \"accessible trigger\" (the tabbable portion of the trigger element\n // that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,\n // a child of the slotted element, or an element in the slotted element's shadow root.\n //\n // For example, the accessible trigger of an <nile-button> is a <button> located inside its shadow root.\n //\n // To determine this, we assume the first tabbable element in the trigger slot is the \"accessible trigger.\"\n //\n updateAccessibleTrigger() {\n const assignedElements = this.trigger.assignedElements({ flatten: true }) as HTMLElement[];\n const accessibleTrigger = assignedElements.find(el => getTabbableBoundary(el).start);\n let target: HTMLElement;\n\n if (accessibleTrigger) {\n switch (accessibleTrigger.tagName.toLowerCase()) {\n // nile buttons have to update the internal button so it's announced correctly by screen readers\n case 'nile-button':\n case 'nile-icon-button':\n target = (accessibleTrigger as NileButton | NileIconButton).button;\n break;\n\n default:\n target = accessibleTrigger;\n }\n\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n /** Shows the dropdown panel. */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the dropdown panel */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n /**\n * Instructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu\n * is activated.\n */\n reposition() {\n this.popup.reposition();\n }\n\n addOpenListeners() {\n this.panel.addEventListener('nile-select', this.handlePanelSelect);\n this.panel.addEventListener('keydown', this.handleKeyDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n removeOpenListeners() {\n if (this.panel) {\n this.panel.removeEventListener('nile-select', this.handlePanelSelect);\n this.panel.removeEventListener('keydown', this.handleKeyDown);\n }\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.disabled) {\n this.open = false;\n return;\n }\n\n this.updateAccessibleTrigger();\n\n if (this.open) {\n // Show\n this.emit('nile-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.panel.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'dropdown.show', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n this.removeOpenListeners();\n\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'dropdown.hide', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.panel.hidden = true;\n this.popup.active = false;\n\n this.emit('nile-after-hide');\n }\n }\n\n render() {\n return html`\n <nile-popup\n part=\"base\"\n id=\"dropdown\"\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': this.open\n })}\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n @keyup=${this.handleTriggerKeyUp}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-labelledby=\"dropdown\"\n ></slot>\n </nile-popup>\n `;\n }\n}\n\nsetDefaultAnimation('dropdown.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('dropdown.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nexport default NileDropdown;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-dropdown': NileDropdown;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-error-message.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAiB,EAAE;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;GAGG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAAhD;;QAeE,kBAAa,GAAkB,EAAE,CAAC;QAGlC,kBAAa,GAAkB,IAAI,CAAC;IAoFtC,CAAC;IArGQ,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAiBD,UAAU,CAAC,KAAa,EAAE,MAAW;QACnC,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC;QACrE,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAC9B,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAEhE,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,cAAc,GAAG,IAAI,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lit/decorators.js';\nimport { styles } from './nile-error-message.css';\n\nconst convertToStringArray = (value: any): Array<string> => {\n if (Array.isArray(value)) {\n return value.map(item => String(item));\n }\n return [];\n};\n\n/**\n * A custom error message component that displays error information to the user.\n * @customElement nile-error-message\n */\n@customElement('nile-error-message')\nexport class NileErrorMessage extends LitElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({\n type: Array,\n attribute: 'error-messages',\n hasChanged: (newVal, oldVal) =>\n JSON.stringify(newVal) !== JSON.stringify(oldVal), // Optional: to detect deep changes\n converter: {\n toAttribute: value => JSON.stringify(value),\n fromAttribute: value => convertToStringArray(JSON.parse(value || '[]')),\n },\n })\n errorMessages: Array<string> = [];\n\n @property({ type: Number })\n expandedIndex: number | null = null;\n\n expandText(index: number, target: any) {\n const element = target.querySelector('.nile-error-message__summary');\n const originalHeight = element.clientHeight;\n element.style.whiteSpace = 'normal';\n element.style.height = 'auto';\n const expandedHeight = Math.min(element.clientHeight, 5.5 * 12);\n\n element.style.height = originalHeight + 'px';\n\n requestAnimationFrame(() => {\n element.style.height = expandedHeight + 'px';\n });\n }\n\n collapseText(target: any) {\n const element = target.querySelector('.nile-error-message__summary');\n const expandedHeight = element.clientHeight;\n element.style.height = expandedHeight + 'px';\n\n requestAnimationFrame(() => {\n element.style.height = '14px';\n element.style.whiteSpace = 'nowrap';\n });\n }\n\n toggleExpand(index: number, event: any) {\n if (this.shadowRoot) {\n if (this.expandedIndex !== null && this.expandedIndex !== index) {\n const prevExpandable = this.shadowRoot.querySelectorAll(\n '.nile-error-message__expandable'\n )[this.expandedIndex];\n if (prevExpandable) {\n this.collapseText(prevExpandable);\n }\n }\n }\n\n if (this.expandedIndex === index) {\n this.expandedIndex = null;\n this.collapseText(event.currentTarget);\n } else {\n this.expandedIndex = index;\n this.expandText(index, event.currentTarget);\n }\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"nile-error-message\">\n <div class=\"nile-error-message__info\">\n <nile-icon\n name=\"info2\"\n size=\"14\"\n class=\"nile-error-message__icon\"\n part=\"icon\"\n ></nile-icon>\n ${this.errorMessages.length}\n ${this.errorMessages.length > 1 ? 'attributes' : 'attribute'} are not\n valid\n </div>\n ${this.errorMessages.map(\n (errorMessage, index) => html`\n <div\n class=\"nile-error-message__expandable ${index !== 0\n ? 'bordered'\n : ''} ${this.expandedIndex === index ? 'expanded' : ''}\"\n @click=\"${(event: any) => this.toggleExpand(index, event)}\"\n >\n <div class=\"nile-error-message__content\">\n <nile-icon\n name=\"arrowright\"\n size=\"14\"\n class=\"nile-error-message__arrow\"\n ></nile-icon>\n <div class=\"nile-error-message__summary\">${errorMessage}</div>\n </div>\n </div>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-error-message': NileErrorMessage;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-error-message.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAiB,EAAE;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;GAGG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAeL,kBAAa,GAAkB,EAAE,CAAC;QAGlC,kBAAa,GAAkB,IAAI,CAAC;IAoFtC,CAAC;IArGQ,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAA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AAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YAC3C,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;SACxE;KACF,CAAC;uDACgC;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDACS;AAlBzB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAsG5B;SAtGY,gBAAgB","sourcesContent":["import {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-error-message.css';\n\nconst convertToStringArray = (value: any): Array<string> => {\n if (Array.isArray(value)) {\n return value.map(item => String(item));\n }\n return [];\n};\n\n/**\n * A custom error message component that displays error information to the user.\n * @customElement nile-error-message\n */\n@customElement('nile-error-message')\nexport class NileErrorMessage extends LitElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({\n type: Array,\n attribute: 'error-messages',\n hasChanged: (newVal, oldVal) =>\n JSON.stringify(newVal) !== JSON.stringify(oldVal), // Optional: to detect deep changes\n converter: {\n toAttribute: value => JSON.stringify(value),\n fromAttribute: value => convertToStringArray(JSON.parse(value || '[]')),\n },\n })\n errorMessages: Array<string> = [];\n\n @property({ type: Number })\n expandedIndex: number | null = null;\n\n expandText(index: number, target: any) {\n const element = target.querySelector('.nile-error-message__summary');\n const originalHeight = element.clientHeight;\n element.style.whiteSpace = 'normal';\n element.style.height = 'auto';\n const expandedHeight = Math.min(element.clientHeight, 5.5 * 12);\n\n element.style.height = originalHeight + 'px';\n\n requestAnimationFrame(() => {\n element.style.height = expandedHeight + 'px';\n });\n }\n\n collapseText(target: any) {\n const element = target.querySelector('.nile-error-message__summary');\n const expandedHeight = element.clientHeight;\n element.style.height = expandedHeight + 'px';\n\n requestAnimationFrame(() => {\n element.style.height = '14px';\n element.style.whiteSpace = 'nowrap';\n });\n }\n\n toggleExpand(index: number, event: any) {\n if (this.shadowRoot) {\n if (this.expandedIndex !== null && this.expandedIndex !== index) {\n const prevExpandable = this.shadowRoot.querySelectorAll(\n '.nile-error-message__expandable'\n )[this.expandedIndex];\n if (prevExpandable) {\n this.collapseText(prevExpandable);\n }\n }\n }\n\n if (this.expandedIndex === index) {\n this.expandedIndex = null;\n this.collapseText(event.currentTarget);\n } else {\n this.expandedIndex = index;\n this.expandText(index, event.currentTarget);\n }\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"nile-error-message\">\n <div class=\"nile-error-message__info\">\n <nile-icon\n name=\"info2\"\n size=\"14\"\n class=\"nile-error-message__icon\"\n part=\"icon\"\n ></nile-icon>\n ${this.errorMessages.length}\n ${this.errorMessages.length > 1 ? 'attributes' : 'attribute'} are not\n valid\n </div>\n ${this.errorMessages.map(\n (errorMessage, index) => html`\n <div\n class=\"nile-error-message__expandable ${index !== 0\n ? 'bordered'\n : ''} ${this.expandedIndex === index ? 'expanded' : ''}\"\n @click=\"${(event: any) => this.toggleExpand(index, event)}\"\n >\n <div class=\"nile-error-message__content\">\n <nile-icon\n name=\"arrowright\"\n size=\"14\"\n class=\"nile-error-message__arrow\"\n ></nile-icon>\n <div class=\"nile-error-message__summary\">${errorMessage}</div>\n </div>\n </div>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-error-message': NileErrorMessage;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-footer/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAEzC;;;;;GAKG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,UAAU;IAEzC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;IAET,CAAC;IACJ,CAAC;CAGD,CAAA;AAzBY,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAyBtB;SAzBY,UAAU;AA2BvB,eAAe,UAAU,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-footer.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-footer\n *\n */\n@customElement('nile-footer')\nexport class NileFooter extends LitElement {\n\n\t/**\n\t * The styles for Footer\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot> </slot>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFooter;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-footer': NileFooter;\n }\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-footer/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAEzC;;;;;GAKG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAEzC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;IAET,CAAC;IACJ,CAAC;CAGD,CAAA;AAzBY,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAyBtB;SAzBY,UAAU;AA2BvB,eAAe,UAAU,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-footer.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-footer\n *\n */\n@customElement('nile-footer')\nexport class NileFooter extends LitElement {\n\n\t/**\n\t * The styles for Footer\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot> </slot>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFooter;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-footer': NileFooter;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-form-error-message.js","sourceRoot":"","sources":["../../../src/nile-form-error-message/nile-form-error-message.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAErD;;;;;GAKG;AAEH,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,UAAU;IAEnD;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;;;IAIT,CAAC;IACJ,CAAC;CAGD,CAAA;AA3BY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CA2BhC;SA3BY,oBAAoB;AA6BjC,eAAe,oBAAoB,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-form-error-message.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-form-error-message\n *\n */\n@customElement('nile-form-error-message')\nexport class NileFormErrorMessage extends LitElement {\n\n\t/**\n\t * The styles for FormErrorMessage\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n <div class=\"nile-form-error-message\">\n <nile-icon name=\"info2\" size=\"14\" class=\"nile-form-error-message__icon\" color=\"#A4121C\"> </nile-icon> <slot> </slot>\n </div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFormErrorMessage;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-form-error-message': NileFormErrorMessage;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-form-error-message.js","sourceRoot":"","sources":["../../../src/nile-form-error-message/nile-form-error-message.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAErD;;;;;GAKG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAEnD;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;;;IAIT,CAAC;IACJ,CAAC;CAGD,CAAA;AA3BY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CA2BhC;SA3BY,oBAAoB;AA6BjC,eAAe,oBAAoB,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-form-error-message.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-form-error-message\n *\n */\n@customElement('nile-form-error-message')\nexport class NileFormErrorMessage extends LitElement {\n\n\t/**\n\t * The styles for FormErrorMessage\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n <div class=\"nile-form-error-message\">\n <nile-icon name=\"info2\" size=\"14\" class=\"nile-form-error-message__icon\" color=\"#A4121C\"> </nile-icon> <slot> </slot>\n </div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFormErrorMessage;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-form-error-message': NileFormErrorMessage;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-form-help-text.js","sourceRoot":"","sources":["../../../src/nile-form-help-text/nile-form-help-text.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAEjD;;;;;GAKG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAE/C;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;;;IAIT,CAAC;IACJ,CAAC;CAGD,CAAA;AA3BY,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA2B5B;SA3BY,gBAAgB;AA6B7B,eAAe,gBAAgB,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-form-help-text.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-form-help-text\n *\n */\n@customElement('nile-form-help-text')\nexport class NileFormHelpText extends LitElement {\n\n\t/**\n\t * The styles for FormHelpText\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n <div class=\"nile-form-help-text\">\n <slot> </slot>\n </div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFormHelpText;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-form-help-text': NileFormHelpText;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-form-help-text.js","sourceRoot":"","sources":["../../../src/nile-form-help-text/nile-form-help-text.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAA2C,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAEjD;;;;;GAKG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAE/C;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;;;IAIT,CAAC;IACJ,CAAC;CAGD,CAAA;AA3BY,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA2B5B;SA3BY,gBAAgB;AA6B7B,eAAe,gBAAgB,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-form-help-text.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-form-help-text\n *\n */\n@customElement('nile-form-help-text')\nexport class NileFormHelpText extends LitElement {\n\n\t/**\n\t * The styles for FormHelpText\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n <div class=\"nile-form-help-text\">\n <slot> </slot>\n </div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileFormHelpText;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-form-help-text': NileFormHelpText;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-heading/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;GAMG;AAEH,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAA3C;;QAgBE;;WAEG;QAEH,SAAI,GAAG,EAAE,CAAC;QACV;;WAEG;QACwC,SAAI,GAAG,UAAU,CAAC;IAS/D,CAAC;IAPC,sBAAsB;IACtB,+DAA+D;IAC/D,IAAI;IAEK,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AAhCiB,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;GAa1B,CAAA;AAMF;IADC,QAAQ,EAAE;yCACD;AAIiC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAmB;AAxBlD,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAiCvB;SAjCY,WAAW","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n/**\n * An nile-heading element.\n *\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n@customElement('nile-heading')\nexport class NileHeading extends LitElement {\n static override styles = css`\n :host {\n display: block;\n border: solid 1px gray;\n padding: 16px;\n font-size: var(--nile-type-scale-5);\n padding-bottom: var(--nile-spacing-1-x); \n }\n\n :host([size='header-1']) {\n font-size: var(--nile-type-scale-5, 18px);\n font-weight: var(--nile-font-weight-bold, 600);\n }\n `;\n\n /**\n * Button Lab\n */\n @property()\n name = '';\n /**\n * Text Size\n */\n @property({ type: String, reflect: true }) size = 'header-1';\n\n // override render() {\n // return html` <h1 class=\"nds--heading\">${this.name}</h1> `;\n // }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-heading': NileHeading;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-heading/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;GAMG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAgBL;;WAEG;QAEH,SAAI,GAAG,EAAE,CAAC;QACV;;WAEG;QACwC,SAAI,GAAG,UAAU,CAAC;IAS/D,CAAC;IAPC,sBAAsB;IACtB,+DAA+D;IAC/D,IAAI;IAEK,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AA/Be,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;GAa3B,CAAC;AAMF;IADC,QAAQ,EAAE;yCACD;AAIiC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAmB;AAxBlD,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAiCvB;SAjCY,WAAW","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n/**\n * An nile-heading element.\n *\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n@customElement('nile-heading')\nexport class NileHeading extends LitElement {\n static override styles = css`\n :host {\n display: block;\n border: solid 1px gray;\n padding: 16px;\n font-size: var(--nile-type-scale-5);\n padding-bottom: var(--nile-spacing-1-x); \n }\n\n :host([size='header-1']) {\n font-size: var(--nile-type-scale-5, 18px);\n font-weight: var(--nile-font-weight-bold, 600);\n }\n `;\n\n /**\n * Button Lab\n */\n @property()\n name = '';\n /**\n * Text Size\n */\n @property({ type: String, reflect: true }) size = 'header-1';\n\n // override render() {\n // return html` <h1 class=\"nds--heading\">${this.name}</h1> `;\n // }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-heading': NileHeading;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-icon/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAUrC,MAAM,SAAS,GAAc,KAAkB,CAAC;AAEhD,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,eAAe,GAAG,EAAE,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A;AAhKiB,eAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B1B,CAAA;AA9EF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACZ;AAQ9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACrB;AAOrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAClB;AAOxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACG;AAO9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACZ;AAG9B;IADC,KAAK,EAAE;sCACU;AAEU;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAA2B;AAKzB;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAa;AAGzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACR;AAMS;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAY;AAvD7B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyNpB;SAzNY,QAAQ","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport type { TemplateResult } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport * as Icons from './icons/svg';\n\ninterface IconPaths {\n [key: string]: string;\n}\n\ninterface ButtonClassMap {\n [key:string]: boolean;\n}\n\nconst iconPaths: IconPaths = Icons as IconPaths;\n\nconst SMALL_ICON_SIZE = 16;\nconst LARGE_ICON_SIZE = 24;\n\n/**\n * Nile icon component.\n *\n * @tag nile-icon\n *\n */\n@customElement('nile-icon')\nexport class NileIcon extends LitElement {\n /**\n * The name of the icon set\n * @attr icon set\n * @type {IconName | undefined}\n */\n @property({ type: String, reflect: true })\n public set?: string = 'local';\n\n /**\n * The name of the icon\n * @attr name\n * @type {IconName | undefined}\n */\n @property({ type: String, reflect: true })\n public name?: string;\n\n /**\n * A description of what the icon represents\n * @attr description\n */\n @property({ type: String, reflect: true })\n public description = '';\n\n /**\n * A path to a custom SVG file to display as the icon\n * @attr customSvgPath\n */\n @property({ type: String })\n public customSvgPath?: string;\n\n /**\n * A size of what the icon represents\n * @attr size\n */\n @property({ type: String, reflect: true })\n public size = SMALL_ICON_SIZE;\n\n @state()\n private _svg = '';\n\n @property({ type: String }) override title = 'agents';\n\n /**\n * Color\n */\n @property({ reflect: true }) color: any ;\n\n @property({ type: Boolean })\n public push = false;\n\n /**\n * Retain Viewbox\n */\n\n @property({ reflect: true }) frame: any;\n\n static override styles = css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n contain: content;\n }\n\n .nds-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .nds-icon svg {\n height: var(--nile-svg-height);\n width: var(--nile-svg-width);\n stroke: var(--nile-svg-stroke);\n stroke-width: var(--nile-svg-stroke-width);\n }\n\n .nds-icon svg path {\n fill: var(--nile-svg-fill);\n }\n\n .nds-icon--push {\n margin-right: 12px;\n }\n `;\n\n private _getIconSize(): number {\n return this.name?.endsWith('-small') ? SMALL_ICON_SIZE : LARGE_ICON_SIZE;\n }\n\n protected override async updated(\n changedProperties: PropertyValues\n ): Promise<void> {\n if (changedProperties.has('size')) {\n this.style.setProperty('--nile-svg-height', `${this.size}px`);\n this.style.setProperty('--nile-svg-width', `${this.size}px`);\n }\n if (changedProperties.has('color')) {\n this.style.setProperty('--nile-svg-fill', `${this.color}`);\n }\n if (\n changedProperties.has('name') ||\n changedProperties.has('customSvgPath')\n ) {\n let iconName = this.name ? this.removeHyphens(this.name) : undefined;\n if (iconName && iconPaths[iconName]) {\n this._svg = atob(iconPaths[iconName]);\n } else if (this.customSvgPath) {\n this._svg = await this.fetchSvg(this.customSvgPath);\n } else {\n throw new Error(`No icon named \"${this.name}\"`);\n }\n }\n this.addAttributesToSvg();\n }\n\n private addAttributesToSvg(){\n const svg = this.renderRoot.querySelector('#svg')\n const attrs = svg?.attributes\n if(!attrs?.getNamedItem('xmlns')){\n svg?.setAttribute('xmlns',\"http://www.w3.org/2000/svg\");\n }\n if(!attrs?.getNamedItem('version')){\n svg?.setAttribute(\"version\",\"1.1\")\n }\n if(this.frame){\n svg?.setAttribute('viewBox',`0 0 ${this.frame} ${this.frame}`)\n }\n else if(!attrs?.getNamedItem('viewBox')){\n const viewboxLogic = this.frame\n ? `0 0 ${this.frame} ${this.frame}`\n : '0 0 16 16';\n svg?.setAttribute('viewBox',viewboxLogic)\n }\n\n if(!attrs?.getNamedItem('height')){\n svg?.setAttribute('height',String(this.size));\n svg?.setAttribute('width',String(this.size));\n }\n\n svg?.setAttribute('aria-hidden',`${this.description === ''}`);\n svg?.setAttribute('aria-label',this.description || '');\n\n const additionalClasses = Object.keys(this.buttonClassMap).filter((key:string)=> this.buttonClassMap[key])\n\n svg?.classList.add('nds-icon',...additionalClasses)\n }\n\n private async fetchSvg(path: string): Promise<string> {\n const response = await fetch(path);\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n return await response.text();\n }\n\n private removeHyphens(iconName: string) {\n return iconName.replace(/-/g, '');\n }\n\n private getSvgTemplate(){\n const svgTagRegexPattern =/<svg\\s[^>]*>/;\n const regexToGetSVGAttrs = this._svg.match(svgTagRegexPattern);\n const svgAttrs = regexToGetSVGAttrs?.[0].replace('<svg','').replace('>','')\n const svgBody = this._svg.replace(\n svgTagRegexPattern,\n ''\n )\n .replace('</svg>', '')\n return `<svg\n id='svg'\n focusable='true'\n role='img'\n ${svgAttrs}\n >\n ${svgBody}\n </svg>`\n }\n\n get buttonClassMap() {\n return {\n 'nds-icon--push': this.push,\n } as ButtonClassMap;\n }\n\n protected override render(): TemplateResult {\n const size = this.size;\n const color = this.color;\n\n /**\n * When icons are outside frame\n */\n const viewboxLogic = this.frame\n ? `0 0 ${this.frame} ${this.frame}`\n : '0 0 16 16';\n\n\n if (\n (!this._svg.includes('fill=') || this._svg.includes('fill=\"inherit\"')) &&\n !this.color\n ) {\n // Case 1: _svg does not have fill color or has fill=\"inherit\" and this.color is not mentioned\n this.style.setProperty('--nile-svg-fill', `#7F7F7F`);\n\n } else if (this.color) {\n // Case 2: If this.color is mentioned, use it as fill, regardless of _svg color\n this.style.setProperty('--nile-svg-fill', `${this.color}`);\n }\n\n return html`\n <span class=\"nds-icon ${classMap(this.buttonClassMap)}\">\n ${unsafeSVG(this.getSvgTemplate())}\n </span>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-icon': NileIcon;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-icon/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAUrC,MAAM,SAAS,GAAc,KAAkB,CAAC;AAEhD,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;GAKG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QACL;;;;WAIG;QAEI,QAAG,GAA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,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACZ;AAQ9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACrB;AAOrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAClB;AAOxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACG;AAO9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACZ;AAG9B;IADC,KAAK,EAAE;sCACU;AAEU;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAA2B;AAKzB;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAa;AAGzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACR;AAMS;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAY;AAvD7B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyNpB;SAzNY,QAAQ","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport type { TemplateResult } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport * as Icons from './icons/svg';\n\ninterface IconPaths {\n [key: string]: string;\n}\n\ninterface ButtonClassMap {\n [key:string]: boolean;\n}\n\nconst iconPaths: IconPaths = Icons as IconPaths;\n\nconst SMALL_ICON_SIZE = 16;\nconst LARGE_ICON_SIZE = 24;\n\n/**\n * Nile icon component.\n *\n * @tag nile-icon\n *\n */\n@customElement('nile-icon')\nexport class NileIcon extends LitElement {\n /**\n * The name of the icon set\n * @attr icon set\n * @type {IconName | undefined}\n */\n @property({ type: String, reflect: true })\n public set?: string = 'local';\n\n /**\n * The name of the icon\n * @attr name\n * @type {IconName | undefined}\n */\n @property({ type: String, reflect: true })\n public name?: string;\n\n /**\n * A description of what the icon represents\n * @attr description\n */\n @property({ type: String, reflect: true })\n public description = '';\n\n /**\n * A path to a custom SVG file to display as the icon\n * @attr customSvgPath\n */\n @property({ type: String })\n public customSvgPath?: string;\n\n /**\n * A size of what the icon represents\n * @attr size\n */\n @property({ type: String, reflect: true })\n public size = SMALL_ICON_SIZE;\n\n @state()\n private _svg = '';\n\n @property({ type: String }) override title = 'agents';\n\n /**\n * Color\n */\n @property({ reflect: true }) color: any ;\n\n @property({ type: Boolean })\n public push = false;\n\n /**\n * Retain Viewbox\n */\n\n @property({ reflect: true }) frame: any;\n\n static override styles = css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n contain: content;\n }\n\n .nds-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .nds-icon svg {\n height: var(--nile-svg-height);\n width: var(--nile-svg-width);\n stroke: var(--nile-svg-stroke);\n stroke-width: var(--nile-svg-stroke-width);\n }\n\n .nds-icon svg path {\n fill: var(--nile-svg-fill);\n }\n\n .nds-icon--push {\n margin-right: 12px;\n }\n `;\n\n private _getIconSize(): number {\n return this.name?.endsWith('-small') ? SMALL_ICON_SIZE : LARGE_ICON_SIZE;\n }\n\n protected override async updated(\n changedProperties: PropertyValues\n ): Promise<void> {\n if (changedProperties.has('size')) {\n this.style.setProperty('--nile-svg-height', `${this.size}px`);\n this.style.setProperty('--nile-svg-width', `${this.size}px`);\n }\n if (changedProperties.has('color')) {\n this.style.setProperty('--nile-svg-fill', `${this.color}`);\n }\n if (\n changedProperties.has('name') ||\n changedProperties.has('customSvgPath')\n ) {\n let iconName = this.name ? this.removeHyphens(this.name) : undefined;\n if (iconName && iconPaths[iconName]) {\n this._svg = atob(iconPaths[iconName]);\n } else if (this.customSvgPath) {\n this._svg = await this.fetchSvg(this.customSvgPath);\n } else {\n throw new Error(`No icon named \"${this.name}\"`);\n }\n }\n this.addAttributesToSvg();\n }\n\n private addAttributesToSvg(){\n const svg = this.renderRoot.querySelector('#svg')\n const attrs = svg?.attributes\n if(!attrs?.getNamedItem('xmlns')){\n svg?.setAttribute('xmlns',\"http://www.w3.org/2000/svg\");\n }\n if(!attrs?.getNamedItem('version')){\n svg?.setAttribute(\"version\",\"1.1\")\n }\n if(this.frame){\n svg?.setAttribute('viewBox',`0 0 ${this.frame} ${this.frame}`)\n }\n else if(!attrs?.getNamedItem('viewBox')){\n const viewboxLogic = this.frame\n ? `0 0 ${this.frame} ${this.frame}`\n : '0 0 16 16';\n svg?.setAttribute('viewBox',viewboxLogic)\n }\n\n if(!attrs?.getNamedItem('height')){\n svg?.setAttribute('height',String(this.size));\n svg?.setAttribute('width',String(this.size));\n }\n\n svg?.setAttribute('aria-hidden',`${this.description === ''}`);\n svg?.setAttribute('aria-label',this.description || '');\n\n const additionalClasses = Object.keys(this.buttonClassMap).filter((key:string)=> this.buttonClassMap[key])\n\n svg?.classList.add('nds-icon',...additionalClasses)\n }\n\n private async fetchSvg(path: string): Promise<string> {\n const response = await fetch(path);\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n return await response.text();\n }\n\n private removeHyphens(iconName: string) {\n return iconName.replace(/-/g, '');\n }\n\n private getSvgTemplate(){\n const svgTagRegexPattern =/<svg\\s[^>]*>/;\n const regexToGetSVGAttrs = this._svg.match(svgTagRegexPattern);\n const svgAttrs = regexToGetSVGAttrs?.[0].replace('<svg','').replace('>','')\n const svgBody = this._svg.replace(\n svgTagRegexPattern,\n ''\n )\n .replace('</svg>', '')\n return `<svg\n id='svg'\n focusable='true'\n role='img'\n ${svgAttrs}\n >\n ${svgBody}\n </svg>`\n }\n\n get buttonClassMap() {\n return {\n 'nds-icon--push': this.push,\n } as ButtonClassMap;\n }\n\n protected override render(): TemplateResult {\n const size = this.size;\n const color = this.color;\n\n /**\n * When icons are outside frame\n */\n const viewboxLogic = this.frame\n ? `0 0 ${this.frame} ${this.frame}`\n : '0 0 16 16';\n\n\n if (\n (!this._svg.includes('fill=') || this._svg.includes('fill=\"inherit\"')) &&\n !this.color\n ) {\n // Case 1: _svg does not have fill color or has fill=\"inherit\" and this.color is not mentioned\n this.style.setProperty('--nile-svg-fill', `#7F7F7F`);\n\n } else if (this.color) {\n // Case 2: If this.color is mentioned, use it as fill, regardless of _svg color\n this.style.setProperty('--nile-svg-fill', `${this.color}`);\n }\n\n return html`\n <span class=\"nds-icon ${classMap(this.buttonClassMap)}\">\n ${unsafeSVG(this.getSvgTemplate())}\n </span>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-icon': NileIcon;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-icon-button.js","sourceRoot":"","sources":["../../../src/nile-icon-button/nile-icon-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAE9C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH;;;;;GAKG;AAEH,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,WAAW;IAA/C;;QAKmB,aAAQ,GAAG,KAAK,CAAC;QAuBlC;;;WAGG;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Gb;IAAX,QAAQ,EAAE;4CAAe;AAGd;IAAX,QAAQ,EAAE;8CAAkD;AAGjD;IAAX,QAAQ,EAAE;gDAAmB;AAMlB;IAAX,QAAQ,EAAE;6CAAY;AAGqB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAkB;AAnClD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA2G1B;SA3GY,cAAc;AA8G3B,eAAe,cAAc,CAAC","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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-icon-button.css';\n\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { literal, html } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @event nile-blur - Emitted when the icon button loses focus.\n * @event nile-focus - Emitted when the icon button gains focus.\n *\n * @csspart base - The component's base wrapper.\n */\n/**\n * Nile icon component.\n *\n * @tag nile-icon-button\n *\n */\n@customElement('nile-icon-button')\nexport class NileIconButton extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @query('.icon-button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n\n /** The name of the icon to draw. Available names depend on the icon library being used. */\n @property() name?: string;\n\n /** The name of a registered custom icon library. */\n @property() library?: string;\n\n /**\n * An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and\n * can result in XSS attacks.\n */\n @property() src?: string;\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href?: string;\n\n /** Tells the browser where to open the link. Only used when `href` is set. */\n @property() target?: '_blank' | '_parent' | '_self' | '_top';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is set. */\n @property() download?: string;\n\n /**\n * A description that gets read by assistive devices. For optimal accessibility, you should always include a label\n * that describes what the icon button does.\n */\n @property() label = '';\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n private handleClick(event: MouseEvent) {\n if (this.disabled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /** Simulates a click on the icon button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the icon button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the icon button. */\n blur() {\n this.button.blur();\n }\n\n render(): TemplateResult {\n const isLink = this.href ? true : false;\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/binding-positions, lit/no-invalid-html */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n 'icon-button': true,\n 'icon-button--disabled': !isLink && this.disabled,\n 'icon-button--focused': this.hasFocus\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : 'button')}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink && this.target ? 'noreferrer noopener' : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n aria-label=\"${this.label}\"\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n >\n <nile-icon\n class=\"icon-button__icon\"\n name=${ifDefined(this.name)}\n library=${ifDefined(this.library)}\n src=${ifDefined(this.src)}\n aria-hidden=\"true\"\n size=\"14\"\n ></nile-icon>\n </${tag}>\n `;\n }\n}\n\n\nexport default NileIconButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-icon-button': NileIconButton;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-icon-button.js","sourceRoot":"","sources":["../../../src/nile-icon-button/nile-icon-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAE9C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QAKY,aAAQ,GAAG,KAAK,CAAC;QAuBlC;;;WAGG;QACS,UAAK,GAAG,EAAE,CAAC;QAEvB,2BAA2B;QACiB,aAAQ,GAAG,KAAK,CAAC;IAwE/D,CAAC;IAtES,UAAU;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAEO,WAAW,CAAC,KAAiB;QACnC,IA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023\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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-icon-button.css';\n\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { literal, html } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @event nile-blur - Emitted when the icon button loses focus.\n * @event nile-focus - Emitted when the icon button gains focus.\n *\n * @csspart base - The component's base wrapper.\n */\n/**\n * Nile icon component.\n *\n * @tag nile-icon-button\n *\n */\n@customElement('nile-icon-button')\nexport class NileIconButton extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @query('.icon-button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n\n /** The name of the icon to draw. Available names depend on the icon library being used. */\n @property() name?: string;\n\n /** The name of a registered custom icon library. */\n @property() library?: string;\n\n /**\n * An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and\n * can result in XSS attacks.\n */\n @property() src?: string;\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href?: string;\n\n /** Tells the browser where to open the link. Only used when `href` is set. */\n @property() target?: '_blank' | '_parent' | '_self' | '_top';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is set. */\n @property() download?: string;\n\n /**\n * A description that gets read by assistive devices. For optimal accessibility, you should always include a label\n * that describes what the icon button does.\n */\n @property() label = '';\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n private handleClick(event: MouseEvent) {\n if (this.disabled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /** Simulates a click on the icon button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the icon button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the icon button. */\n blur() {\n this.button.blur();\n }\n\n render(): TemplateResult {\n const isLink = this.href ? true : false;\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/binding-positions, lit/no-invalid-html */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n 'icon-button': true,\n 'icon-button--disabled': !isLink && this.disabled,\n 'icon-button--focused': this.hasFocus\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : 'button')}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink && this.target ? 'noreferrer noopener' : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n aria-label=\"${this.label}\"\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n >\n <nile-icon\n class=\"icon-button__icon\"\n name=${ifDefined(this.name)}\n library=${ifDefined(this.library)}\n src=${ifDefined(this.src)}\n aria-hidden=\"true\"\n size=\"14\"\n ></nile-icon>\n </${tag}>\n `;\n }\n}\n\n\nexport default NileIconButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-icon-button': NileIconButton;\n }\n}\n"]}