@aquera/nile-elements 0.0.2 → 0.0.3-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 (259) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +3 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +3 -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/nile-button/nile-button.d.ts +2 -2
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.css.js +5 -1
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js +25 -1
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.css.js +9 -11
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.d.ts +3 -2
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js +32 -8
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/index.d.ts +1 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/index.js +2 -0
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/index.js.map +1 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.d.ts +12 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js +178 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.d.ts +70 -0
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +494 -0
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/index.d.ts +1 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/index.js +2 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/index.js.map +1 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.css.d.ts +12 -0
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.css.js +33 -0
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.css.js.map +1 -0
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.d.ts +31 -0
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.js +44 -0
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -0
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/index.d.ts +1 -0
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/index.js +2 -0
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/index.js.map +1 -0
  37. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.d.ts +12 -0
  38. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js +31 -0
  39. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -0
  40. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.d.ts +31 -0
  41. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js +44 -0
  42. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -0
  43. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.d.ts +2 -1
  44. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js +1 -0
  45. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  46. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +7 -0
  47. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
  48. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +18 -24
  49. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  50. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.css.js +8 -0
  51. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.css.js.map +1 -1
  52. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.d.ts +2 -3
  53. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js +24 -20
  54. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  55. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +17 -9
  56. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  57. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +2 -2
  58. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +24 -15
  59. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  60. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +7 -0
  61. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  62. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +2 -0
  63. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js +23 -0
  64. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  65. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.css.js +68 -41
  66. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.css.js.map +1 -1
  67. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.d.ts +1 -1
  68. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js +9 -6
  69. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js.map +1 -1
  70. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js +8 -2
  71. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  72. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +15 -18
  73. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  74. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  75. package/dist/index.cjs.js +1 -1
  76. package/dist/index.esm.js +1 -1
  77. package/dist/index.iife.js +567 -192
  78. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  79. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  80. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  81. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  82. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  83. package/dist/nile-checkbox/nile-checkbox.css.esm.js +5 -1
  84. package/dist/nile-checkbox/nile-checkbox.esm.js +15 -5
  85. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  86. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  87. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  88. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  89. package/dist/nile-chip/nile-chip.css.esm.js +9 -11
  90. package/dist/nile-chip/nile-chip.esm.js +17 -7
  91. package/dist/nile-date-picker/index.cjs.js +2 -0
  92. package/dist/nile-date-picker/index.cjs.js.map +1 -0
  93. package/dist/nile-date-picker/index.esm.js +1 -0
  94. package/dist/nile-date-picker/nile-date-picker.cjs.js +2 -0
  95. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -0
  96. package/dist/nile-date-picker/nile-date-picker.css.cjs.js +2 -0
  97. package/dist/nile-date-picker/nile-date-picker.css.cjs.js.map +1 -0
  98. package/dist/nile-date-picker/nile-date-picker.css.esm.js +166 -0
  99. package/dist/nile-date-picker/nile-date-picker.esm.js +85 -0
  100. package/dist/nile-form-error-message/index.cjs.js +2 -0
  101. package/dist/nile-form-error-message/index.cjs.js.map +1 -0
  102. package/dist/nile-form-error-message/index.esm.js +1 -0
  103. package/dist/nile-form-error-message/nile-form-error-message.cjs.js +2 -0
  104. package/dist/nile-form-error-message/nile-form-error-message.cjs.js.map +1 -0
  105. package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js +2 -0
  106. package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js.map +1 -0
  107. package/dist/nile-form-error-message/nile-form-error-message.css.esm.js +21 -0
  108. package/dist/nile-form-error-message/nile-form-error-message.esm.js +5 -0
  109. package/dist/nile-form-help-text/index.cjs.js +2 -0
  110. package/dist/nile-form-help-text/index.cjs.js.map +1 -0
  111. package/dist/nile-form-help-text/index.esm.js +1 -0
  112. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +2 -0
  113. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -0
  114. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +2 -0
  115. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -0
  116. package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +19 -0
  117. package/dist/nile-form-help-text/nile-form-help-text.esm.js +5 -0
  118. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  119. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  120. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -0
  121. package/dist/nile-input/nile-input.cjs.js +1 -1
  122. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  123. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  124. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  125. package/dist/nile-input/nile-input.css.esm.js +7 -0
  126. package/dist/nile-input/nile-input.esm.js +12 -23
  127. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  128. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  129. package/dist/nile-radio-group/nile-radio-group.css.cjs.js +1 -1
  130. package/dist/nile-radio-group/nile-radio-group.css.cjs.js.map +1 -1
  131. package/dist/nile-radio-group/nile-radio-group.css.esm.js +10 -2
  132. package/dist/nile-radio-group/nile-radio-group.esm.js +14 -14
  133. package/dist/nile-select/nile-select.cjs.js +1 -1
  134. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  135. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  136. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  137. package/dist/nile-select/nile-select.css.esm.js +17 -9
  138. package/dist/nile-select/nile-select.esm.js +18 -17
  139. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  140. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  141. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  142. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  143. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +7 -0
  144. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +11 -2
  145. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  146. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  147. package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
  148. package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
  149. package/dist/nile-tag/nile-tag.css.esm.js +70 -43
  150. package/dist/nile-tag/nile-tag.esm.js +7 -4
  151. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  152. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  153. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  154. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  155. package/dist/nile-textarea/nile-textarea.css.esm.js +8 -2
  156. package/dist/nile-textarea/nile-textarea.esm.js +12 -20
  157. package/dist/src/index.d.ts +3 -0
  158. package/dist/src/index.js +3 -0
  159. package/dist/src/index.js.map +1 -1
  160. package/dist/src/nile-button/nile-button.d.ts +2 -2
  161. package/dist/src/nile-button/nile-button.js.map +1 -1
  162. package/dist/src/nile-checkbox/nile-checkbox.css.js +5 -1
  163. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  164. package/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -0
  165. package/dist/src/nile-checkbox/nile-checkbox.js +25 -1
  166. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  167. package/dist/src/nile-chip/nile-chip.css.js +9 -11
  168. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  169. package/dist/src/nile-chip/nile-chip.d.ts +3 -2
  170. package/dist/src/nile-chip/nile-chip.js +32 -8
  171. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  172. package/dist/src/nile-date-picker/index.d.ts +1 -0
  173. package/dist/src/nile-date-picker/index.js +2 -0
  174. package/dist/src/nile-date-picker/index.js.map +1 -0
  175. package/dist/src/nile-date-picker/nile-date-picker.css.d.ts +12 -0
  176. package/dist/src/nile-date-picker/nile-date-picker.css.js +178 -0
  177. package/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -0
  178. package/dist/src/nile-date-picker/nile-date-picker.d.ts +70 -0
  179. package/dist/src/nile-date-picker/nile-date-picker.js +494 -0
  180. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -0
  181. package/dist/src/nile-form-error-message/index.d.ts +1 -0
  182. package/dist/src/nile-form-error-message/index.js +2 -0
  183. package/dist/src/nile-form-error-message/index.js.map +1 -0
  184. package/dist/src/nile-form-error-message/nile-form-error-message.css.d.ts +12 -0
  185. package/dist/src/nile-form-error-message/nile-form-error-message.css.js +33 -0
  186. package/dist/src/nile-form-error-message/nile-form-error-message.css.js.map +1 -0
  187. package/dist/src/nile-form-error-message/nile-form-error-message.d.ts +31 -0
  188. package/dist/src/nile-form-error-message/nile-form-error-message.js +44 -0
  189. package/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -0
  190. package/dist/src/nile-form-help-text/index.d.ts +1 -0
  191. package/dist/src/nile-form-help-text/index.js +2 -0
  192. package/dist/src/nile-form-help-text/index.js.map +1 -0
  193. package/dist/src/nile-form-help-text/nile-form-help-text.css.d.ts +12 -0
  194. package/dist/src/nile-form-help-text/nile-form-help-text.css.js +31 -0
  195. package/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -0
  196. package/dist/src/nile-form-help-text/nile-form-help-text.d.ts +31 -0
  197. package/dist/src/nile-form-help-text/nile-form-help-text.js +44 -0
  198. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -0
  199. package/dist/src/nile-icon-button/nile-icon-button.d.ts +2 -1
  200. package/dist/src/nile-icon-button/nile-icon-button.js +1 -0
  201. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  202. package/dist/src/nile-input/nile-input.css.js +7 -0
  203. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  204. package/dist/src/nile-input/nile-input.js +18 -24
  205. package/dist/src/nile-input/nile-input.js.map +1 -1
  206. package/dist/src/nile-radio-group/nile-radio-group.css.js +8 -0
  207. package/dist/src/nile-radio-group/nile-radio-group.css.js.map +1 -1
  208. package/dist/src/nile-radio-group/nile-radio-group.d.ts +2 -3
  209. package/dist/src/nile-radio-group/nile-radio-group.js +24 -20
  210. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  211. package/dist/src/nile-select/nile-select.css.js +17 -9
  212. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  213. package/dist/src/nile-select/nile-select.d.ts +2 -2
  214. package/dist/src/nile-select/nile-select.js +24 -15
  215. package/dist/src/nile-select/nile-select.js.map +1 -1
  216. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +7 -0
  217. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  218. package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +2 -0
  219. package/dist/src/nile-slide-toggle/nile-slide-toggle.js +23 -0
  220. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  221. package/dist/src/nile-tag/nile-tag.css.js +68 -41
  222. package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
  223. package/dist/src/nile-tag/nile-tag.d.ts +1 -1
  224. package/dist/src/nile-tag/nile-tag.js +9 -6
  225. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  226. package/dist/src/nile-textarea/nile-textarea.css.js +8 -2
  227. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  228. package/dist/src/nile-textarea/nile-textarea.js +15 -18
  229. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  230. package/dist/tsconfig.tsbuildinfo +1 -1
  231. package/package.json +1 -1
  232. package/src/index.ts +3 -0
  233. package/src/nile-button/nile-button.ts +2 -2
  234. package/src/nile-checkbox/nile-checkbox.css.ts +5 -1
  235. package/src/nile-checkbox/nile-checkbox.ts +26 -1
  236. package/src/nile-chip/nile-chip.css.ts +9 -11
  237. package/src/nile-chip/nile-chip.ts +32 -6
  238. package/src/nile-date-picker/index.ts +1 -0
  239. package/src/nile-date-picker/nile-date-picker.css.ts +180 -0
  240. package/src/nile-date-picker/nile-date-picker.ts +588 -0
  241. package/src/nile-form-error-message/index.ts +1 -0
  242. package/src/nile-form-error-message/nile-form-error-message.css.ts +35 -0
  243. package/src/nile-form-error-message/nile-form-error-message.ts +54 -0
  244. package/src/nile-form-help-text/index.ts +1 -0
  245. package/src/nile-form-help-text/nile-form-help-text.css.ts +33 -0
  246. package/src/nile-form-help-text/nile-form-help-text.ts +54 -0
  247. package/src/nile-icon-button/nile-icon-button.ts +2 -1
  248. package/src/nile-input/nile-input.css.ts +7 -0
  249. package/src/nile-input/nile-input.ts +71 -38
  250. package/src/nile-radio-group/nile-radio-group.css.ts +8 -0
  251. package/src/nile-radio-group/nile-radio-group.ts +25 -15
  252. package/src/nile-select/nile-select.css.ts +17 -9
  253. package/src/nile-select/nile-select.ts +24 -12
  254. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +7 -0
  255. package/src/nile-slide-toggle/nile-slide-toggle.ts +24 -0
  256. package/src/nile-tag/nile-tag.css.ts +68 -41
  257. package/src/nile-tag/nile-tag.ts +11 -8
  258. package/src/nile-textarea/nile-textarea.css.ts +8 -2
  259. package/src/nile-textarea/nile-textarea.ts +20 -18
@@ -1 +1 @@
1
- {"version":3,"file":"nile-button.cjs.js","sources":["../../../src/nile-button/nile-button.ts"],"sourcesContent":["import '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlController, validValidityState } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { html, literal } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\nimport { styles } from './nile-button.css';\nimport type { CSSResultGroup } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Buttons represent actions that are available to the user.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n * @dependency nile-spinner\n *\n * @event nile-blur - Emitted when the button loses focus.\n * @event nile-focus - Emitted when the button gains focus.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @slot - The button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @csspart base - The component's base wrapper.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The button's label.\n * @csspart suffix - The container that wraps the suffix.\n * @csspart caret - The button's caret icon, an `<nile-icon>` element.\n */\n\n@customElement('nile-button')\nexport class NileButton extends NileElement implements NileFormControl {\n static styles: CSSResultGroup = styles;\n\n private readonly formControlController = new FormControlController(this, {\n form: input => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute is set we need to query\n // the form from the same root using its id\n if (input.hasAttribute('form')) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form')!;\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest('form');\n },\n assumeInteractionOn: ['click']\n });\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @query('.button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n @state() invalid = false;\n @property() title = ''; // make reactive to pass through\n\n /** The button's theme variant. */\n @property({ reflect: true }) variant: 'primary' | 'secondary' | 'tertiary' | 'caution' = 'primary';\n\n /** The button's size. */\n @property({ reflect: true }) size: 'medium' = 'medium';\n\n /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */\n @property({ type: Boolean, reflect: true }) caret = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the button in a loading state. */\n @property({ type: Boolean, reflect: true }) loading = false;\n\n /** Draws an outlined button. */\n @property({ type: Boolean, reflect: true }) outline = false;\n\n /** Draws a pill-style button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /**\n * Draws a circular icon button. When this attribute is present, the button expects a single `<nile-icon>` in the\n * default slot.\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n * `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.\n */\n @property() type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\n * This attribute is ignored when `href` is present.\n */\n @property() name = '';\n\n /**\n * The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\n * button is the submitter. This attribute is ignored when `href` is present.\n */\n @property() value = '';\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href = '';\n\n /** Tells the browser where to open the link. Only used when `href` is present. */\n @property() target: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\n * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\n * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by\n * setting the attribute to an empty string or a value of your choice, respectively.\n */\n @property() rel = 'noreferrer noopener';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is present. */\n @property() download?: string;\n\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property() form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ attribute: 'formaction' }) formAction: string;\n\n /** Used to override the form owner's `enctype` attribute. */\n @property({ attribute: 'formenctype' })\n formEnctype: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';\n\n /** Used to override the form owner's `method` attribute. */\n @property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;\n\n /** Gets the validity state object */\n get validity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validity;\n }\n\n return validValidityState;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validationMessage;\n }\n\n return '';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n firstUpdated() {\n if (this.isButton()) {\n this.formControlController.updateValidity();\n }\n }\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() {\n if (this.type === 'submit') {\n this.formControlController.submit(this);\n }\n\n if (this.type === 'reset') {\n this.formControlController.reset(this);\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private isButton() {\n return this.href ? false : true;\n }\n\n private isLink() {\n return this.href ? true : false;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n if (this.isButton()) {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n }\n\n /** Simulates a click on the button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the button. */\n blur() {\n this.button.blur();\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).checkValidity();\n }\n\n return true;\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).reportValidity();\n }\n\n return true;\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n if (this.isButton()) {\n (this.button as HTMLButtonElement).setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n }\n\n render() {\n const isLink = this.isLink();\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/no-invalid-html */\n /* eslint-disable lit/binding-positions */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n button: true,\n 'button--primary': this.variant === 'primary',\n 'button--secondary': this.variant === 'secondary',\n 'button--tertiary': this.variant === 'tertiary',\n 'button--caution': this.variant === 'caution',\n 'button--medium': this.size === 'medium',\n 'button--caret': this.caret,\n 'button--circle': this.circle,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--loading': this.loading,\n 'button--standard': !this.outline,\n 'button--outline': this.outline,\n 'button--pill': this.pill,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\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.rel : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @invalid=${this.isButton() ? this.handleInvalid : null}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n ${\n this.caret ? html` <nile-icon part=\"caret\" class=\"button__caret\" color=\"white\" name=\"arrowdown\"></nile-icon> ` : ''\n }\n ${this.loading ? html`<nile-spinner></nile-spinner>` : ''}\n </${tag}>\n `;\n }\n}\n\nexport default NileButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button': NileButton;\n }\n}\n"],"names":["NileButton","constructor","this","formControlController","FormControlController","form","input","hasAttribute","doc","getRootNode","formId","getAttribute","getElementById","closest","assumeInteractionOn","hasSlotController","HasSlotController","hasFocus","invalid","title","variant","size","caret","disabled","loading","outline","pill","circle","type","name","value","href","rel","validity","isButton","button","validValidityState","validationMessage","connectedCallback","super","handleHostClick","bind","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","updateValidity","handleBlur","emit","handleFocus","handleClick","submit","reset","event","preventDefault","stopImmediatePropagation","handleInvalid","setValidity","emitInvalidEvent","isLink","handleDisabledChange","click","focus","options","blur","checkValidity","getForm","reportValidity","setCustomValidity","message","render","tag","literal","html","classMap","test","ifDefined","undefined","target","download","NileElement","styles","__decorate","query","prototype","state","property","reflect","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"q8pCAqCaA,CAA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A,CAAAA,CAAAA,CAAA,CADCI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,aACiEzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,aAAA,CAAA,IAAA,EAGjDF,CAAAA,CAAAA,CAAAA,CAAA,CAAtCI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,YAA2CzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,YAAA,CAAA,IAAA,EAGRF,CAAAA,CAAAA,CAAAA,CAAA,CAAzDI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,gBAAkB7D,CAAAA,IAAAA,CAAM4D,OAAmCxF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAG3CF,CAAAA,CAAAA,CAAAA,CAAA,CAAtCI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,YAA6EzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,YAAA,CAAA,IAAA,EA+EpGF,CAAAA,CAAAA,CAAAA,CAAA,CADCQ,CAAAA,CAAM,UAAY,CAAA,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAM1C3F,CAAAoF,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAhMUpF,CAAUkF,CAAAA,CAAAA,CAAA,CADtBU,CAAAA,CAAc,aACF5F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
1
+ {"version":3,"file":"nile-button.cjs.js","sources":["../../../src/nile-button/nile-button.ts"],"sourcesContent":["import '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlController, validValidityState } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { html, literal } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\nimport { styles } from './nile-button.css';\nimport type { CSSResultGroup, TemplateResult } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Buttons represent actions that are available to the user.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n * @dependency nile-spinner\n *\n * @event nile-blur - Emitted when the button loses focus.\n * @event nile-focus - Emitted when the button gains focus.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @slot - The button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @csspart base - The component's base wrapper.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The button's label.\n * @csspart suffix - The container that wraps the suffix.\n * @csspart caret - The button's caret icon, an `<nile-icon>` element.\n */\n\n@customElement('nile-button')\nexport class NileButton extends NileElement implements NileFormControl {\n static styles: CSSResultGroup = styles;\n\n private readonly formControlController = new FormControlController(this, {\n form: input => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute is set we need to query\n // the form from the same root using its id\n if (input.hasAttribute('form')) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form')!;\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest('form');\n },\n assumeInteractionOn: ['click']\n });\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @query('.button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n @state() invalid = false;\n @property() title = ''; // make reactive to pass through\n\n /** The button's theme variant. */\n @property({ reflect: true }) variant: 'primary' | 'secondary' | 'tertiary' | 'caution' = 'primary';\n\n /** The button's size. */\n @property({ reflect: true }) size: 'medium' = 'medium';\n\n /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */\n @property({ type: Boolean, reflect: true }) caret = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the button in a loading state. */\n @property({ type: Boolean, reflect: true }) loading = false;\n\n /** Draws an outlined button. */\n @property({ type: Boolean, reflect: true }) outline = false;\n\n /** Draws a pill-style button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /**\n * Draws a circular icon button. When this attribute is present, the button expects a single `<nile-icon>` in the\n * default slot.\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n * `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.\n */\n @property() type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\n * This attribute is ignored when `href` is present.\n */\n @property() name = '';\n\n /**\n * The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\n * button is the submitter. This attribute is ignored when `href` is present.\n */\n @property() value = '';\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href = '';\n\n /** Tells the browser where to open the link. Only used when `href` is present. */\n @property() target: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\n * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\n * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by\n * setting the attribute to an empty string or a value of your choice, respectively.\n */\n @property() rel = 'noreferrer noopener';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is present. */\n @property() download?: string;\n\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property() form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ attribute: 'formaction' }) formAction: string;\n\n /** Used to override the form owner's `enctype` attribute. */\n @property({ attribute: 'formenctype' })\n formEnctype: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';\n\n /** Used to override the form owner's `method` attribute. */\n @property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;\n\n /** Gets the validity state object */\n get validity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validity;\n }\n\n return validValidityState;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validationMessage;\n }\n\n return '';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n firstUpdated() {\n if (this.isButton()) {\n this.formControlController.updateValidity();\n }\n }\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() {\n if (this.type === 'submit') {\n this.formControlController.submit(this);\n }\n\n if (this.type === 'reset') {\n this.formControlController.reset(this);\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private isButton() {\n return this.href ? false : true;\n }\n\n private isLink() {\n return this.href ? true : false;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n if (this.isButton()) {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n }\n\n /** Simulates a click on the button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the button. */\n blur() {\n this.button.blur();\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).checkValidity();\n }\n\n return true;\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).reportValidity();\n }\n\n return true;\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n if (this.isButton()) {\n (this.button as HTMLButtonElement).setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n }\n\n render(): TemplateResult {\n const isLink = this.isLink();\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/no-invalid-html */\n /* eslint-disable lit/binding-positions */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n button: true,\n 'button--primary': this.variant === 'primary',\n 'button--secondary': this.variant === 'secondary',\n 'button--tertiary': this.variant === 'tertiary',\n 'button--caution': this.variant === 'caution',\n 'button--medium': this.size === 'medium',\n 'button--caret': this.caret,\n 'button--circle': this.circle,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--loading': this.loading,\n 'button--standard': !this.outline,\n 'button--outline': this.outline,\n 'button--pill': this.pill,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\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.rel : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @invalid=${this.isButton() ? this.handleInvalid : null}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n ${\n this.caret ? html` <nile-icon part=\"caret\" class=\"button__caret\" color=\"white\" name=\"arrowdown\"></nile-icon> ` : ''\n }\n ${this.loading ? html`<nile-spinner></nile-spinner>` : ''}\n </${tag}>\n `;\n }\n}\n\nexport default NileButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button': NileButton;\n }\n}\n"],"names":["NileButton","constructor","this","formControlController","FormControlController","form","input","hasAttribute","doc","getRootNode","formId","getAttribute","getElementById","closest","assumeInteractionOn","hasSlotController","HasSlotController","hasFocus","invalid","title","variant","size","caret","disabled","loading","outline","pill","circle","type","name","value","href","rel","validity","isButton","button","validValidityState","validationMessage","connectedCallback","super","handleHostClick","bind","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","updateValidity","handleBlur","emit","handleFocus","handleClick","submit","reset","event","preventDefault","stopImmediatePropagation","handleInvalid","setValidity","emitInvalidEvent","isLink","handleDisabledChange","click","focus","options","blur","checkValidity","getForm","reportValidity","setCustomValidity","message","render","tag","literal","html","classMap","test","ifDefined","undefined","target","download","NileElement","styles","__decorate","query","prototype","state","property","reflect","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"q8pCAqCaA,CAAb,sEAAAC,YAAAA,oEAGmBC,EAAAA,MAAAC,sBAAwB,GAAIC,EAAAA,+BAA4B,CACvEC,IAAAA,CAAMC,cAAAA,CAGJ,CAAA,CAAA,GAAIA,EAAMC,YAAa,CAAA,MAAA,CAAA,CAAS,CAC9B,GAAMC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A,CAAtCI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,YAA2CzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,YAAA,CAAA,IAAA,EAGRF,CAAAA,CAAAA,CAAAA,CAAA,CAAzDI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,gBAAkB7D,CAAAA,IAAAA,CAAM4D,OAAmCxF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAG3CF,CAAAA,CAAAA,CAAAA,CAAA,CAAtCI,CAAAA,CAAS,CAAEG,SAAAA,CAAW,YAA6EzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,YAAA,CAAA,IAAA,EA+EpGF,CAAAA,CAAAA,CAAAA,CAAA,CADCQ,CAAAA,CAAM,UAAY,CAAA,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAM1C3F,CAAAoF,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAhMUpF,CAAUkF,CAAAA,CAAAA,CAAA,CADtBU,CAAAA,CAAc,aACF5F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var e,i,t,s,c,o,h,l,r,n,a,d,m,_templateObject,_templateObject2,_templateObject3,p;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.y;},function(_litDecoratorsJs){t=_litDecoratorsJs.query;s=_litDecoratorsJs.state;c=_litDecoratorsJs.customElement;},function(_nileCheckboxCssCjsJs){o=_nileCheckboxCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalDefaultValueCjsJs){l=_internalDefaultValueCjsJs.d;},function(_litDirectivesIfDefinedJs){r=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesLiveJs){n=_litDirectivesLiveJs.live;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;},function(_property002CjsJs){m=_property002CjsJs.e;},function(_lit){}],execute:function(){p=/*#__PURE__*/function(_d){_inherits(p,_d);var _super=_createSuper(p);function p(){var _this;_classCallCheck(this,p);_this=_super.call(this),_this.hasFocus=!1,_this.title="",_this.name="",_this.size="medium",_this.disabled=!1,_this.checked=!1,_this.label="",_this.indeterminate=!1,_this.defaultChecked=!1,_this.form="",_this.required=!1;return _this;}_createClass(p,[{key:"handleClick",value:function handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}));}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("blur");}},{key:"handleInput",value:function handleInput(){this.emit("input");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("focus");}},{key:"handleStateChange",value:function handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate;}},{key:"click",value:function click(){this.input.click();}},{key:"focus",value:function focus(e){this.input.focus(e);}},{key:"blur",value:function blur(){this.input.blur();}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <label\n part=\"base\"\n class=","\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=","\n name=","\n value=","\n .indeterminate=","\n .checked=","\n .disabled=","\n .required=","\n aria-checked=","\n @click=","\n @input=","\n @blur=","\n @focus=","\n />\n\n <span\n part=\"control","","\"\n class=\"checkbox__control\"\n >\n ","\n ","\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ","\n <slot></slot>\n </div>\n </label>\n "])),h({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size}),this.title,this.name,r(this.value),n(this.indeterminate),n(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleInput,this.handleBlur,this.handleFocus,this.checked?" control--checked":"",this.indeterminate?" control--indeterminate":"",this.checked?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n "]))):"",!this.checked&&this.indeterminate?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n "]))):"","boolean"==typeof this.label?"":this.label);}}]);return p;}(d);p.styles=o,e([t('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([l("checked")],p.prototype,"defaultChecked",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),p=e([c("nile-checkbox")],p);}};});
1
+ System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,o,c,h,r,l,n,a,d,m,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,p;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileCheckboxCssCjsJs){c=_nileCheckboxCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalDefaultValueCjsJs){r=_internalDefaultValueCjsJs.d;},function(_litDirectivesIfDefinedJs){l=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesLiveJs){n=_litDirectivesLiveJs.live;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;},function(_property002CjsJs){m=_property002CjsJs.e;},function(_lit){}],execute:function(){p=/*#__PURE__*/function(_d){_inherits(p,_d);var _super=_createSuper(p);function p(){var _this;_classCallCheck(this,p);_this=_super.call(this),_this.hasFocus=!1,_this.title="",_this.name="",_this.size="medium",_this.disabled=!1,_this.checked=!1,_this.label="",_this.indeterminate=!1,_this.defaultChecked=!1,_this.helpText="",_this.errorMessage="",_this.form="",_this.required=!1;return _this;}_createClass(p,[{key:"handleClick",value:function handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}));}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("blur");}},{key:"handleInput",value:function handleInput(){this.emit("input");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("focus");}},{key:"handleStateChange",value:function handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate;}},{key:"click",value:function click(){this.input.click();}},{key:"focus",value:function focus(e){this.input.focus(e);}},{key:"blur",value:function blur(){this.input.blur();}},{key:"render",value:function render(){var e=!!this.helpText,i=!!this.errorMessage;return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <label\n part=\"base\"\n class=","\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=","\n name=","\n value=","\n .indeterminate=","\n .checked=","\n .disabled=","\n .required=","\n aria-checked=","\n @click=","\n @input=","\n @blur=","\n @focus=","\n />\n\n <span\n part=\"control","","\"\n class=\"checkbox__control\"\n >\n ","\n ","\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ","\n <slot></slot>\n </div>\n </label>\n\n ","\n\n ","\n "])),h({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size}),this.title,this.name,l(this.value),n(this.indeterminate),n(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleInput,this.handleBlur,this.handleFocus,this.checked?" control--checked":"",this.indeterminate?" control--indeterminate":"",this.checked?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n "]))):"",!this.checked&&this.indeterminate?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n "]))):"","boolean"==typeof this.label?"":this.label,e?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",i?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);return p;}(d);p.styles=c,e([i('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:String,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([r("checked")],p.prototype,"defaultChecked",void 0),e([m({attribute:"help-text"})],p.prototype,"helpText",void 0),e([m({attribute:"error-message"})],p.prototype,"errorMessage",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),p=e([o("nile-checkbox")],p);}};});
2
2
  //# sourceMappingURL=nile-checkbox.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-checkbox.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-checkbox.css';\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Checkboxes allow the user to toggle an option on or off.\n *\n * @dependency nile-icon\n *\n * @slot - The checkbox's label.\n *\n * @event nile-blur - Emitted when the checkbox loses focus.\n * @event nile-change - Emitted when the checked state changes.\n * @event nile-focus - Emitted when the checkbox gains focus.\n * @event nile-input - Emitted when the checkbox receives input.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The square container that wraps the checkbox's checked state.\n * @csspart control--checked - Matches the control part when the checkbox is checked.\n * @csspart control--indeterminate - Matches the control part when the checkbox is indeterminate.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart indeterminate-icon - The indeterminate icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the checkbox's label.\n */\n\n/**\n * Nile icon component.\n *\n * @tag nile-checkbox\n *\n */\n@customElement('nile-checkbox')\nexport class NileCheckbox extends NileElement {\n constructor() {\n super();\n }\n\n static styles: CSSResultGroup = styles;\n\n @query('input[type=\"checkbox\"]') input: HTMLInputElement;\n\n @state() private hasFocus = false;\n\n @property() title = ''; // make reactive to pass through\n\n /** The name of the checkbox, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the checkbox, submitted as a name/value pair with form data. */\n @property() value: boolean;\n\n /** The checkbox's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the checkbox. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Label, declared this property for backward compatibility of old component */\n @property({ type: Boolean, reflect: true }) label = '';\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue('checked') defaultChecked = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n private handleClick() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this.dispatchEvent(\n new CustomEvent('valueChange', {\n composed: true,\n bubbles: true,\n detail: {\n checked: this.checked,\n },\n })\n );\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('blur');\n }\n\n private handleInput() {\n this.emit('input');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('focus');\n }\n\n @watch(['checked', 'indeterminate'], { waitUntilFirstUpdate: true })\n handleStateChange() {\n this.input.checked = this.checked; // force a sync update\n this.input.indeterminate = this.indeterminate; // force a sync update\n }\n\n /** Simulates a click on the checkbox. */\n click() {\n this.input.click();\n }\n\n /** Sets focus on the checkbox. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n blur() {\n this.input.blur();\n }\n\n\n render() {\n return html`\n <label\n part=\"base\"\n class=${classMap({\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--indeterminate': this.indeterminate,\n 'checkbox--medium': this.size === 'medium',\n })}\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n name=${this.name}\n value=${ifDefined(this.value)}\n .indeterminate=${live(this.indeterminate)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n aria-checked=${this.checked ? 'true' : 'false'}\n @click=${this.handleClick}\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n />\n\n <span\n part=\"control${this.checked ? ' control--checked' : ''}${this\n .indeterminate\n ? ' control--indeterminate'\n : ''}\"\n class=\"checkbox__control\"\n >\n ${this.checked\n ? html`\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n ${!this.checked && this.indeterminate\n ? html`\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ${typeof this.label === 'boolean' ? '' : this.label}\n <slot></slot>\n </div>\n </label>\n `;\n }\n}\n\nexport default NileCheckbox;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-checkbox': NileCheckbox;\n }\n}\n"],"names":["NileCheckbox","constructor","super","this","hasFocus","title","name","size","disabled","checked","label","indeterminate","defaultChecked","form","required","handleClick","dispatchEvent","CustomEvent","composed","bubbles","detail","handleBlur","emit","handleInput","handleFocus","handleStateChange","input","click","focus","options","blur","render","html","classMap","checkbox","ifDefined","value","live","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","defaultValue","watch","waitUntilFirstUpdate","customElement"],"mappings":"40IAuDaA,CAAb,sEACEC,YAAAA,mCACEC,wBAOeC,MAAQC,UAAG,CAEhBD,CAAAA,MAAAE,KAAQ,CAAA,EAAA,CAGRF,MAAIG,IAAAA,CAAG,EAMUH,CAAAA,MAAII,KAAiC,QAGtBJ,CAAAA,MAAQK,QAAG,CAAA,CAAA,CAAA,CAGXL,MAAOM,OAAAA,CAAAA,CAAG,CAGVN,CAAAA,MAAKO,MAAG,EAMRP,CAAAA,MAAaQ,aAAG,CAAA,CAAA,CAAA,CAGnCR,MAAcS,cAAAA,CAAAA,CAAG,CAObT,CAAAA,MAAIU,KAAG,EAGQV,CAAAA,MAAQW,QAAG,CAAA,CAAA,CA7CtD,eA+COC,+DAAAA,CACNZ,IAAKM,CAAAA,OAAAA,CAAAA,CAAWN,KAAKM,OACrBN,CAAAA,IAAAA,CAAKQ,aAAgB,CAAA,CAAA,CAAA,CACrBR,IAAKa,CAAAA,aAAAA,CACH,GAAIC,YAAAA,CAAY,cAAe,CAC7BC,QAAAA,CAAAA,CAAU,CACVC,CAAAA,OAAAA,CAAAA,CAAS,CACTC,CAAAA,MAAAA,CAAQ,CACNX,OAAAA,CAASN,KAAKM,OAIrB,CAAA,CAAA,CAAA,CAAA,EAEOY,+CACNlB,CAAAA,IAAAA,CAAKC,QAAW,CAAA,CAAA,CAAA,CAChBD,IAAKmB,CAAAA,IAAAA,CAAK,OACX,EAEOC,iDAAAA,CACNpB,IAAKmB,CAAAA,IAAAA,CAAK,OACX,CAAA,EAEOE,iDACNrB,CAAAA,IAAAA,CAAKC,UAAW,CAChBD,CAAAA,IAAAA,CAAKmB,IAAK,CAAA,OAAA,CACX,EAGDG,6DAAAA,CACEtB,IAAKuB,CAAAA,KAAAA,CAAMjB,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checkbox.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-checkbox.css';\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Checkboxes allow the user to toggle an option on or off.\n *\n * @dependency nile-icon\n *\n * @slot - The checkbox's label.\n *\n * @event nile-blur - Emitted when the checkbox loses focus.\n * @event nile-change - Emitted when the checked state changes.\n * @event nile-focus - Emitted when the checkbox gains focus.\n * @event nile-input - Emitted when the checkbox receives input.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The square container that wraps the checkbox's checked state.\n * @csspart control--checked - Matches the control part when the checkbox is checked.\n * @csspart control--indeterminate - Matches the control part when the checkbox is indeterminate.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart indeterminate-icon - The indeterminate icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the checkbox's label.\n */\n\n/**\n * Nile icon component.\n *\n * @tag nile-checkbox\n *\n */\n@customElement('nile-checkbox')\nexport class NileCheckbox extends NileElement {\n constructor() {\n super();\n }\n\n static styles: CSSResultGroup = styles;\n\n @query('input[type=\"checkbox\"]') input: HTMLInputElement;\n\n @state() private hasFocus = false;\n\n @property() title = ''; // make reactive to pass through\n\n /** The name of the checkbox, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the checkbox, submitted as a name/value pair with form data. */\n @property() value: boolean;\n\n /** The checkbox's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the checkbox. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Label, declared this property for backward compatibility of old component */\n @property({ type: String, reflect: true }) label = '';\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue('checked') defaultChecked = false;\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n private handleClick() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this.dispatchEvent(\n new CustomEvent('valueChange', {\n composed: true,\n bubbles: true,\n detail: {\n checked: this.checked,\n },\n })\n );\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('blur');\n }\n\n private handleInput() {\n this.emit('input');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('focus');\n }\n\n @watch(['checked', 'indeterminate'], { waitUntilFirstUpdate: true })\n handleStateChange() {\n this.input.checked = this.checked; // force a sync update\n this.input.indeterminate = this.indeterminate; // force a sync update\n }\n\n /** Simulates a click on the checkbox. */\n click() {\n this.input.click();\n }\n\n /** Sets focus on the checkbox. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n blur() {\n this.input.blur();\n }\n\n\n render() {\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <label\n part=\"base\"\n class=${classMap({\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--indeterminate': this.indeterminate,\n 'checkbox--medium': this.size === 'medium',\n })}\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n name=${this.name}\n value=${ifDefined(this.value)}\n .indeterminate=${live(this.indeterminate)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n aria-checked=${this.checked ? 'true' : 'false'}\n @click=${this.handleClick}\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n />\n\n <span\n part=\"control${this.checked ? ' control--checked' : ''}${this\n .indeterminate\n ? ' control--indeterminate'\n : ''}\"\n class=\"checkbox__control\"\n >\n ${this.checked\n ? html`\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n ${!this.checked && this.indeterminate\n ? html`\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ${typeof this.label === 'boolean' ? '' : this.label}\n <slot></slot>\n </div>\n </label>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n `;\n }\n}\n\nexport default NileCheckbox;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-checkbox': NileCheckbox;\n }\n}\n"],"names":["NileCheckbox","constructor","super","this","hasFocus","title","name","size","disabled","checked","label","indeterminate","defaultChecked","helpText","errorMessage","form","required","handleClick","dispatchEvent","CustomEvent","composed","bubbles","detail","handleBlur","emit","handleInput","handleFocus","handleStateChange","input","click","focus","options","blur","render","hasHelpText","hasErrorMessage","html","classMap","checkbox","ifDefined","value","live","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","String","defaultValue","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"82IAuDaA,CAAb,sEACEC,YAAAA,mCACEC,wBAOeC,MAAQC,QAAAA,CAAAA,CAAG,CAEhBD,CAAAA,MAAAE,MAAQ,EAGRF,CAAAA,MAAIG,IAAG,CAAA,EAAA,CAMUH,MAAII,IAAAA,CAAiC,QAGtBJ,CAAAA,MAAQK,UAAG,CAGXL,CAAAA,MAAOM,OAAG,CAAA,CAAA,CAAA,CAGXN,MAAKO,KAAG,CAAA,EAAA,CAMPP,MAAaQ,aAAAA,CAAAA,CAAG,EAGnCR,MAAcS,cAAAA,CAAAA,CAAG,CAEJT,CAAAA,MAAQU,SAAG,EAEPV,CAAAA,MAAYW,YAAG,CAAA,EAAA,CAO5BX,MAAIY,IAAG,CAAA,EAAA,CAGQZ,MAAQa,QAAAA,CAAAA,CAAG,CAjDtD,eAmDOC,+DAAAA,CACNd,IAAKM,CAAAA,OAAAA,CAAAA,CAAWN,KAAKM,OACrBN,CAAAA,IAAAA,CAAKQ,aAAgB,CAAA,CAAA,CAAA,CACrBR,IAAKe,CAAAA,aAAAA,CACH,GAAIC,YAAAA,CAAY,cAAe,CAC7BC,QAAAA,CAAAA,CAAU,CACVC,CAAAA,OAAAA,CAAAA,CAAS,EACTC,MAAQ,CAAA,CACNb,OAASN,CAAAA,IAAAA,CAAKM,WAIrB,EAEOc,+CAAAA,CACNpB,IAAKC,CAAAA,QAAAA,CAAAA,CAAW,EAChBD,IAAKqB,CAAAA,IAAAA,CAAK,MACX,CAAA,EAEOC,kDACNtB,IAAKqB,CAAAA,IAAAA,CAAK,OACX,CAAA,EAEOE,kDACNvB,IAAKC,CAAA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A,CAA3CI,CAAS,CAAA,CAAEE,KAAMC,OAASF,CAAAA,OAAAA,CAAAA,CAAS,KAAyBjD,CAAA8C,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CA+B7DF,EAAA,CADCW,CAAAA,CAAM,CAAC,SAAA,CAAW,iBAAkB,CAAEC,oBAAAA,CAAAA,CAAsB,CAI5DxD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8C,UAAA,mBAAA,CAAA,IAAA,CAAA,CAtFU9C,EAAY4C,CAAA,CAAA,CADxBa,EAAc,eACFzD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-adad7634.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,o;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",o=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: inline-block;\n }\n\n .checkbox {\n position: relative;\n display: inline-flex;\n align-items: top;\n font-weight: 400;\n color: var(--nile-colors-dark-900);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .checkbox--medium {\n --toggle-size: var(--nile-type-scale-3);\n font-size: var(--nile-type-scale-3);\n }\n\n .checkbox__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--nile-type-scale-3);\n height: var(--nile-type-scale-3);\n border: solid 1px var(--nile-colors-neutral-700);\n background-color: var(--nile-colors-white-base);\n border-radius: 4px;\n transition: var(--nile-transition-duration-default border-color), var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color, var(--nile-transition-duration-default box-shadow);\n }\n\n .checkbox__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n\n /* svg {\n display:none !important;\n } */\n\n /* Hover */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-100);\n border: 1px solid var(--nile-colors-primary-600);\n border-radius: 4px;\n }\n\n /* Focus */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Checked/indeterminate */\n .checkbox--checked .checkbox__control,\n .checkbox--indeterminate .checkbox__control {\n border-color: var(--nile-colors-primary-600);\n background-color: var(--nile-colors-primary-600);\n }\n\n /* Checked/indeterminate + hover */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-900);\n border: 1px solid var(--nile-colors-primary-900);\n }\n\n /* Checked/indeterminate + focus */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Disabled */\n .checkbox--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox__label {\n display: inline-block;\n color: var(--nile-type-scale-3);\n line-height: 14px;\n font-size: 14px;\n margin-inline-start: 0.5em;\n user-select: none;\n margin-top: 2px;\n }\n\n :host([required]) .checkbox__label::after {\n content: '*';\n margin-inline-start: -2px\n }\n\n :host {\n --nile-svg-stroke: white;\n }\n"]))));}};});
1
+ System.register(["../index-adad7634.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,o;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",o=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: inline-block;\n }\n\n .checkbox {\n position: relative;\n display: inline-flex;\n align-items: top;\n font-weight: 400;\n color: var(--nile-colors-dark-900);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .checkbox--medium {\n --toggle-size: var(--nile-type-scale-3);\n font-size: var(--nile-type-scale-3);\n }\n\n .checkbox__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--nile-type-scale-3);\n height: var(--nile-type-scale-3);\n border: solid 1px var(--nile-colors-neutral-700);\n background-color: var(--nile-colors-white-base);\n border-radius: 4px;\n transition: var(--nile-transition-duration-default border-color), var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color, var(--nile-transition-duration-default box-shadow);\n }\n\n .checkbox__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n\n /* svg {\n display:none !important;\n } */\n\n /* Hover */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-100);\n border: 1px solid var(--nile-colors-primary-600);\n border-radius: 4px;\n }\n\n /* Focus */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Checked/indeterminate */\n .checkbox--checked .checkbox__control,\n .checkbox--indeterminate .checkbox__control {\n border-color: var(--nile-colors-primary-600);\n background-color: var(--nile-colors-primary-600);\n }\n\n /* Checked/indeterminate + hover */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-900);\n border: 1px solid var(--nile-colors-primary-900);\n }\n\n /* Checked/indeterminate + focus */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Disabled */\n .checkbox--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox__label {\n display: inline-block;\n line-height: 14px;\n font-size: 14px;\n margin-inline-start: 0.5em;\n user-select: none;\n margin-top: 2px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0.2px;\n }\n\n :host([required]) .checkbox__label::after {\n content: '*';\n margin-inline-start: -2px\n }\n\n :host {\n --nile-svg-stroke: white;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-checkbox.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-checkbox.css.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Checkbox CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n }\n\n .checkbox {\n position: relative;\n display: inline-flex;\n align-items: top;\n font-weight: 400;\n color: var(--nile-colors-dark-900);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .checkbox--medium {\n --toggle-size: var(--nile-type-scale-3);\n font-size: var(--nile-type-scale-3);\n }\n\n .checkbox__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--nile-type-scale-3);\n height: var(--nile-type-scale-3);\n border: solid 1px var(--nile-colors-neutral-700);\n background-color: var(--nile-colors-white-base);\n border-radius: 4px;\n transition: var(--nile-transition-duration-default border-color), var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color, var(--nile-transition-duration-default box-shadow);\n }\n\n .checkbox__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n\n /* svg {\n display:none !important;\n } */\n\n /* Hover */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-100);\n border: 1px solid var(--nile-colors-primary-600);\n border-radius: 4px;\n }\n\n /* Focus */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Checked/indeterminate */\n .checkbox--checked .checkbox__control,\n .checkbox--indeterminate .checkbox__control {\n border-color: var(--nile-colors-primary-600);\n background-color: var(--nile-colors-primary-600);\n }\n\n /* Checked/indeterminate + hover */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-900);\n border: 1px solid var(--nile-colors-primary-900);\n }\n\n /* Checked/indeterminate + focus */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Disabled */\n .checkbox--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox__label {\n display: inline-block;\n color: var(--nile-type-scale-3);\n line-height: 14px;\n font-size: 14px;\n margin-inline-start: 0.5em;\n user-select: none;\n margin-top: 2px;\n }\n\n :host([required]) .checkbox__label::after {\n content: '*';\n margin-inline-start: -2px\n }\n\n :host {\n --nile-svg-stroke: white;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG"}
1
+ {"version":3,"file":"nile-checkbox.css.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Checkbox CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n }\n\n .checkbox {\n position: relative;\n display: inline-flex;\n align-items: top;\n font-weight: 400;\n color: var(--nile-colors-dark-900);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .checkbox--medium {\n --toggle-size: var(--nile-type-scale-3);\n font-size: var(--nile-type-scale-3);\n }\n\n .checkbox__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--nile-type-scale-3);\n height: var(--nile-type-scale-3);\n border: solid 1px var(--nile-colors-neutral-700);\n background-color: var(--nile-colors-white-base);\n border-radius: 4px;\n transition: var(--nile-transition-duration-default border-color), var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color, var(--nile-transition-duration-default box-shadow);\n }\n\n .checkbox__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n\n /* svg {\n display:none !important;\n } */\n\n /* Hover */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-100);\n border: 1px solid var(--nile-colors-primary-600);\n border-radius: 4px;\n }\n\n /* Focus */\n .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Checked/indeterminate */\n .checkbox--checked .checkbox__control,\n .checkbox--indeterminate .checkbox__control {\n border-color: var(--nile-colors-primary-600);\n background-color: var(--nile-colors-primary-600);\n }\n\n /* Checked/indeterminate + hover */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n background: var(--nile-colors-primary-900);\n border: 1px solid var(--nile-colors-primary-900);\n }\n\n /* Checked/indeterminate + focus */\n .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,\n .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {\n outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);\n outline-offset: 1px;\n }\n\n /* Disabled */\n .checkbox--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox__label {\n display: inline-block;\n line-height: 14px;\n font-size: 14px;\n margin-inline-start: 0.5em;\n user-select: none;\n margin-top: 2px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0.2px;\n }\n\n :host([required]) .checkbox__label::after {\n content: '*';\n margin-inline-start: -2px\n }\n\n :host {\n --nile-svg-stroke: white;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG"}
@@ -88,12 +88,16 @@ import{i as e}from"../index-f1b94546.esm.js";const o=e`
88
88
 
89
89
  .checkbox__label {
90
90
  display: inline-block;
91
- color: var(--nile-type-scale-3);
92
91
  line-height: 14px;
93
92
  font-size: 14px;
94
93
  margin-inline-start: 0.5em;
95
94
  user-select: none;
96
95
  margin-top: 2px;
96
+ color: var(--nile-colors-dark-900);
97
+ font-family: Colfax-regular;
98
+ font-style: normal;
99
+ font-weight: 400;
100
+ letter-spacing: 0.2px;
97
101
  }
98
102
 
99
103
  :host([required]) .checkbox__label::after {
@@ -1,4 +1,4 @@
1
- import{__decorate as e}from"tslib";import{y as i}from"../index-f1b94546.esm.js";import{query as t,state as s,customElement as c}from"lit/decorators.js";import{s as o}from"./nile-checkbox.css.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{d as l}from"../internal/default-value.esm.js";import{ifDefined as r}from"lit/directives/if-defined.js";import{live as n}from"lit/directives/live.js";import{w as a}from"../internal/watch.esm.js";import{N as d}from"../internal/nile-element.esm.js";import{e as m}from"../property-bf6307e2.esm.js";import"lit";let p=class extends d{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){return i`
1
+ import{__decorate as e}from"tslib";import{y as t}from"../index-f1b94546.esm.js";import{query as i,state as s,customElement as o}from"lit/decorators.js";import{s as c}from"./nile-checkbox.css.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{d as r}from"../internal/default-value.esm.js";import{ifDefined as l}from"lit/directives/if-defined.js";import{live as n}from"lit/directives/live.js";import{w as a}from"../internal/watch.esm.js";import{N as d}from"../internal/nile-element.esm.js";import{e as m}from"../property-bf6307e2.esm.js";import"lit";let p=class extends d{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.form="",this.required=!1}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){const e=!!this.helpText,i=!!this.errorMessage;return t`
2
2
  <label
3
3
  part="base"
4
4
  class=${h({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size})}
@@ -8,7 +8,7 @@ import{__decorate as e}from"tslib";import{y as i}from"../index-f1b94546.esm.js";
8
8
  type="checkbox"
9
9
  title=${this.title}
10
10
  name=${this.name}
11
- value=${r(this.value)}
11
+ value=${l(this.value)}
12
12
  .indeterminate=${n(this.indeterminate)}
13
13
  .checked=${n(this.checked)}
14
14
  .disabled=${this.disabled}
@@ -24,7 +24,7 @@ import{__decorate as e}from"tslib";import{y as i}from"../index-f1b94546.esm.js";
24
24
  part="control${this.checked?" control--checked":""}${this.indeterminate?" control--indeterminate":""}"
25
25
  class="checkbox__control"
26
26
  >
27
- ${this.checked?i`
27
+ ${this.checked?t`
28
28
  <nile-icon
29
29
  part="checked-icon"
30
30
  class="checkbox__checked-icon"
@@ -34,7 +34,7 @@ import{__decorate as e}from"tslib";import{y as i}from"../index-f1b94546.esm.js";
34
34
  size="12"
35
35
  ></nile-icon>
36
36
  `:""}
37
- ${!this.checked&&this.indeterminate?i`
37
+ ${!this.checked&&this.indeterminate?t`
38
38
  <nile-icon
39
39
  part="indeterminate-icon"
40
40
  class="checkbox__indeterminate-icon"
@@ -51,4 +51,14 @@ import{__decorate as e}from"tslib";import{y as i}from"../index-f1b94546.esm.js";
51
51
  <slot></slot>
52
52
  </div>
53
53
  </label>
54
- `}};p.styles=o,e([t('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([l("checked")],p.prototype,"defaultChecked",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),p=e([c("nile-checkbox")],p);
54
+
55
+ ${e?t`
56
+ <nile-form-help-text>${this.helpText}</nile-form-help-text>
57
+ `:""}
58
+
59
+ ${i?t`
60
+ <nile-form-error-message
61
+ >${this.errorMessage}</nile-form-error-message
62
+ >
63
+ `:""}
64
+ `}};p.styles=c,e([i('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:String,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([r("checked")],p.prototype,"defaultChecked",void 0),e([m({attribute:"help-text"})],p.prototype,"helpText",void 0),e([m({attribute:"error-message"})],p.prototype,"errorMessage",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),p=e([o("nile-checkbox")],p);
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,o,l,h,n,a,r,p,_templateObject,_templateObject2,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){l=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.e;},function(_lit){}],execute:function(){c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.helpText="",_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1;return _this;}_createClass(c,[{key:"onAutoCompleteOptionsChanged",value:function onAutoCompleteOptionsChanged(){var _this2=this;this.filteredAutoCompleteOptions=_toConsumableArray(this.autoCompleteOptions),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}},{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value),this.onTagsChanged();}},{key:"onTagsChanged",value:function onTagsChanged(){var _this3=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.tags.includes(t);}));}},{key:"connectedCallback",value:function connectedCallback(){var _this4=this;_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this4.value.includes(t);}));}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Enter"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this5=this;var t=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),s=!!this.label||!!t,o=!!this.helpText||!!i;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":s,"form-control--has-help-text":o,"nile-chip--disabled":this.disabled}),s?"false":"true",this.label,h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=\"nile-chip__tags\"\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),function(){return _this5.handleRemove(t);},t);}),this.filteredAutoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,o?"false":"true",this.helpText);}}],[{key:"styles",get:function get(){return[l];}}]);return c;}(r);t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p({type:Boolean})],c.prototype,"warning",void 0),t([p({type:Boolean})],c.prototype,"error",void 0),t([p({type:Boolean})],c.prototype,"success",void 0),t([p({type:Boolean})],c.prototype,"noDuplicates",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([p({type:Boolean})],c.prototype,"noWrap",void 0),t([a("autoCompleteOptions")],c.prototype,"onAutoCompleteOptionsChanged",null),t([a("value")],c.prototype,"onValueChanged",null),t([a("tags")],c.prototype,"onTagsChanged",null),c=t([o("nile-chip")],c);}};});
1
+ System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,o,l,h,n,r,a,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){l=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){r=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.e;},function(_lit){}],execute:function(){c=/*#__PURE__*/function(_a){_inherits(c,_a);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="";return _this;}_createClass(c,[{key:"onAutoCompleteOptionsChanged",value:function onAutoCompleteOptionsChanged(){var _this2=this;this.filteredAutoCompleteOptions=_toConsumableArray(this.autoCompleteOptions),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}},{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value),this.onTagsChanged();}},{key:"onTagsChanged",value:function onTagsChanged(){var _this3=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.tags.includes(t);}));}},{key:"connectedCallback",value:function connectedCallback(){var _this4=this;_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this4.value.includes(t);}));}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Enter"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this5=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n ","\n\n ","\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":i,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),i?"false":"true",this.label,h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t,i){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),h({"nile-chip__tags":!0}),_this5.errorIndexes.includes(i)?"error":"normal",function(){return _this5.handleRemove(t);},t);}),this.filteredAutoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,s?"false":"true",this.helpText,s?e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}],[{key:"styles",get:function get(){return[l];}}]);return c;}(a);t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p({type:Boolean})],c.prototype,"warning",void 0),t([p({type:Boolean})],c.prototype,"error",void 0),t([p({type:Boolean})],c.prototype,"success",void 0),t([p({type:Boolean})],c.prototype,"noDuplicates",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([p({type:Boolean})],c.prototype,"noWrap",void 0),t([p({type:Array})],c.prototype,"errorIndexes",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([r("autoCompleteOptions")],c.prototype,"onAutoCompleteOptionsChanged",null),t([r("value")],c.prototype,"onValueChanged",null),t([r("tags")],c.prototype,"onTagsChanged",null),c=t([o("nile-chip")],c);}};});
2
2
  //# sourceMappingURL=nile-chip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The input's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n // Auto-complete options\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @watch('autoCompleteOptions')\n onAutoCompleteOptionsChanged() {\n this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];\n\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n\n @watch('value')\n onValueChanged() {\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n\n @watch('tags')\n onTagsChanged() {\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.tags.includes(option)\n );\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if (\n event.key === 'Enter' &&\n this.inputValue &&\n (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n tag => html`\n <nile-tag\n class=\"nile-chip__tags\"\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n ${this.helpText}\n </slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","error","success","noDuplicates","label","acceptUserInput","clearable","placeholder","readonly","disabled","helpText","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","styles","onAutoCompleteOptionsChanged","filter","option","includes","onValueChanged","onTagsChanged","connectedCallback","super","handleSelect","event","detail","emit","resetInput","handleRemove","tag","handleInputChange","handleInputKeydown","key","handleFocus","autoComplete","render","hasLabelSlot","test","hasHelpTextSlot","hasLabel","hasHelpText","html","classMap","map","__decorate","NileElement","state","prototype","query","property","type","Boolean","reflect","attribute","Array","watch","customElement"],"mappings":"mrLA0BaA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AUNhE,CAAAwD,CAAAA,SAAAA,CAAA,+BAAA,IAGDH,CAAAA,CAAAA,CAAAA,CAAA,CADCW,CAAM,CAAA,OAAA,CAAA,CAAA,CAINhE,CAAAwD,CAAAA,SAAAA,CAAA,gBAAA,CAAA,IAAA,CAAA,CAGDH,EAAA,CADCW,CAAAA,CAAM,MAQNhE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwD,SAAA,CAAA,eAAA,CAAA,MAvFUxD,CAAQqD,CAAAA,CAAAA,CAAA,CADpBY,CAAAA,CAAc,WACFjE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
1
+ {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // Auto-complete options\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n\n @watch('autoCompleteOptions')\n onAutoCompleteOptionsChanged() {\n this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];\n\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n\n @watch('value')\n onValueChanged() {\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n\n @watch('tags')\n onTagsChanged() {\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.tags.includes(option)\n );\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if (\n event.key === 'Enter' &&\n this.inputValue &&\n (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n ${this.helpText}\n </slot>\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","error","success","noDuplicates","label","acceptUserInput","clearable","placeholder","readonly","disabled","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","errorIndexes","helpText","errorMessage","styles","onAutoCompleteOptionsChanged","filter","option","includes","onValueChanged","onTagsChanged","connectedCallback","super","handleSelect","event","detail","emit","resetInput","handleRemove","tag","handleInputChange","handleInputKeydown","key","handleFocus","autoComplete","render","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","classMap","map","index","__decorate","NileElement","state","prototype","query","property","type","Boolean","reflect","Array","attribute","watch","customElement"],"mappings":"qtLA0BaA,CAAb,sEAAAC,gFAKmBC,EAAAA,MAAiBC,kBAAG,GAAIC,EAAAA,+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AAA,CAAAA,CAAAA,CAAA2D,UAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAEhBH,CAAA,CAAA,CAA5BK,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAmC/D,CAAA2D,CAAAA,SAAAA,CAAA,QAAA,CAAA,IAAA,EAAA,CAAA,CAE1BH,CAAA,CAAA,CAA1BK,EAAS,CAAEC,IAAAA,CAAMG,KAAqCjE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,cAAA,CAAA,IAAA,IAEjBH,CAAA,CAAA,CAArCK,CAAS,CAAA,CAAEK,SAAW,CAAA,WAAA,CAAA,CAAA,CAAA,CAA6BlE,EAAA2D,SAAA,CAAA,UAAA,CAAA,IAAA,EAEVH,CAAAA,CAAAA,CAAAA,CAAA,CAAzCK,CAAAA,CAAS,CAAEK,SAAAA,CAAW,eAAqClE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,cAAA,CAAA,IAAA,EAI5DH,CAAAA,CAAAA,CAAAA,CAAA,CADCW,CAAM,CAAA,qBAAA,CAAA,CAAA,CAUNnE,CAAA2D,CAAAA,SAAAA,CAAA,8BAAA,CAAA,IAAA,CAAA,CAGDH,EAAA,CADCW,CAAAA,CAAM,OAINnE,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,gBAAA,CAAA,MAGDH,CAAA,CAAA,CADCW,CAAM,CAAA,MAAA,CAAA,CAAA,CAQNnE,CAAA2D,CAAAA,SAAAA,CAAA,eAAA,CAAA,IAAA,CAAA,CA3FU3D,CAAQwD,CAAAA,CAAAA,CAAA,CADpBY,CAAAA,CAAc,WACFpE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-adad7634.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){o=_index001CjsJs.i;}],execute:function(){_export("s",r=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 0.125rem;\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n font-size: 0.875rem;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 1rem;\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n font-size: 1.25rem;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n :host {\n display: block;\n font-family: inherit;\n }\n\n .nile-chip {\n padding: 5px 10px;\n background-color: #fff;\n border-radius: 0.25rem;\n border: solid 1px #c7ced4;\n padding: 5px 10px;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n overflow-x: hidden;\n }\n\n .nile-chip--no-wrap {\n flex-wrap: nowrap;\n overflow-x: scroll;\n }\n\n .nile-chip::-webkit-scrollbar {\n height: 2px;\n }\n\n .nile-chip::-webkit-scrollbar-thumb {\n background: var(\n --nile-colors-primary-600\n );\n }\n\n .nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .nile-chip:hover:not(.nile-chip--disabled) {\n background-color: #fff;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--focused:not(.nile-chip--disabled) {\n background-color: #fff;\n border-color: #005ea6;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .nile-chip.nile-chip--warning {\n border-color: #e5bf43;\n }\n\n .nile-chip.nile-chip--error {\n border-color: #e5434d;\n }\n\n .nile-chip.nile-chip--success {\n border-color: #43e5c0;\n }\n\n .nile-chip__auto-complete {\n flex: 1;\n }\n .nile-chip__tags {\n margin: 0.05rem;\n }\n"]))));}};});
1
+ System.register(["../index-adad7634.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){o=_index001CjsJs.i;}],execute:function(){_export("s",r=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 14px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n :host {\n display: block;\n font-family: inherit;\n }\n\n .nile-chip {\n padding: 5px 10px;\n background-color: #fff;\n border-radius: 0.25rem;\n border: solid 1px #c7ced4;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n overflow-x: hidden;\n }\n\n .nile-chip--no-wrap {\n flex-wrap: nowrap;\n overflow-x: scroll;\n }\n\n .nile-chip::-webkit-scrollbar {\n height: 2px;\n }\n\n .nile-chip::-webkit-scrollbar-thumb {\n background: var(\n --nile-colors-primary-600\n );\n }\n\n .nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .nile-chip:hover:not(.nile-chip--disabled) {\n background-color: #fff;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--focused:not(.nile-chip--disabled) {\n background-color: #fff;\n border-color: #005ea6;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .nile-chip.nile-chip--warning {\n border-color: #e5bf43;\n }\n\n .nile-chip.nile-chip--error {\n border-color: #e5434d;\n }\n\n .nile-chip.nile-chip--success {\n border-color: #43e5c0;\n }\n\n .nile-chip__auto-complete {\n flex: 1;\n }\n .nile-chip__tags {\n margin: 0.05rem;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-chip.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-chip.css.cjs.js","sources":["../../../src/nile-chip/nile-chip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Chip CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 0.125rem;\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n font-size: 0.875rem;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 1rem;\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n font-size: 1.25rem;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n :host {\n display: block;\n font-family: inherit;\n }\n\n .nile-chip {\n padding: 5px 10px;\n background-color: #fff;\n border-radius: 0.25rem;\n border: solid 1px #c7ced4;\n padding: 5px 10px;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n overflow-x: hidden;\n }\n\n .nile-chip--no-wrap {\n flex-wrap: nowrap;\n overflow-x: scroll;\n }\n\n .nile-chip::-webkit-scrollbar {\n height: 2px;\n }\n\n .nile-chip::-webkit-scrollbar-thumb {\n background: var(\n --nile-colors-primary-600\n );\n }\n\n .nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .nile-chip:hover:not(.nile-chip--disabled) {\n background-color: #fff;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--focused:not(.nile-chip--disabled) {\n background-color: #fff;\n border-color: #005ea6;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .nile-chip.nile-chip--warning {\n border-color: #e5bf43;\n }\n\n .nile-chip.nile-chip--error {\n border-color: #e5434d;\n }\n\n .nile-chip.nile-chip--success {\n border-color: #43e5c0;\n }\n\n .nile-chip__auto-complete {\n flex: 1;\n }\n .nile-chip__tags {\n margin: 0.05rem;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG"}
1
+ {"version":3,"file":"nile-chip.css.cjs.js","sources":["../../../src/nile-chip/nile-chip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Chip CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 14px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n :host {\n display: block;\n font-family: inherit;\n }\n\n .nile-chip {\n padding: 5px 10px;\n background-color: #fff;\n border-radius: 0.25rem;\n border: solid 1px #c7ced4;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n overflow-x: hidden;\n }\n\n .nile-chip--no-wrap {\n flex-wrap: nowrap;\n overflow-x: scroll;\n }\n\n .nile-chip::-webkit-scrollbar {\n height: 2px;\n }\n\n .nile-chip::-webkit-scrollbar-thumb {\n background: var(\n --nile-colors-primary-600\n );\n }\n\n .nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .nile-chip:hover:not(.nile-chip--disabled) {\n background-color: #fff;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--focused:not(.nile-chip--disabled) {\n background-color: #fff;\n border-color: #005ea6;\n box-shadow: 0 0 0 1px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .nile-chip.nile-chip--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .nile-chip.nile-chip--warning {\n border-color: #e5bf43;\n }\n\n .nile-chip.nile-chip--error {\n border-color: #e5434d;\n }\n\n .nile-chip.nile-chip--success {\n border-color: #43e5c0;\n }\n\n .nile-chip__auto-complete {\n flex: 1;\n }\n .nile-chip__tags {\n margin: 0.05rem;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG"}
@@ -25,19 +25,18 @@ import{i as o}from"../index-f1b94546.esm.js";const r=o`
25
25
  .form-control--has-label .form-control__label {
26
26
  display: inline-block;
27
27
  color: inherit;
28
- margin-bottom: 0.125rem;
29
- }
30
-
31
- .form-control--has-label.form-control--small .form-control__label {
32
- font-size: 0.875rem;
28
+ margin-bottom: 12px;
29
+ color: var(--nile-colors-dark-900);
30
+ font-family: Colfax-regular;
31
+ font-size: 14px;
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ line-height: 14px;
35
+ letter-spacing: 0.2px;
33
36
  }
34
37
 
35
38
  .form-control--has-label.form-control--medium .form-control__label {
36
- font-size: 1rem;
37
- }
38
-
39
- .form-control--has-label.form-control--large .form-control__label {
40
- font-size: 1.25rem;
39
+ font-size: 14px;
41
40
  }
42
41
 
43
42
  :host([required]) .form-control--has-label .form-control__label::after {
@@ -80,7 +79,6 @@ import{i as o}from"../index-f1b94546.esm.js";const r=o`
80
79
  background-color: #fff;
81
80
  border-radius: 0.25rem;
82
81
  border: solid 1px #c7ced4;
83
- padding: 5px 10px;
84
82
  display: flex;
85
83
  flex-wrap: wrap;
86
84
  width: 100%;