@usecapsule/core-components 3.2.0-dev.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (384) hide show
  1. package/dist/capsule/capsule.esm.js +1 -1
  2. package/dist/capsule/capsule.esm.js.map +1 -1
  3. package/dist/capsule/index.esm.js.map +1 -1
  4. package/dist/capsule/p-0462f723.js.map +1 -1
  5. package/dist/capsule/p-05cb769b.entry.js +10 -0
  6. package/dist/capsule/p-05cb769b.entry.js.map +1 -0
  7. package/dist/capsule/p-0eea90f8.entry.js +2 -0
  8. package/dist/capsule/{p-6793ef7a.entry.js.map → p-0eea90f8.entry.js.map} +1 -1
  9. package/dist/capsule/{p-b976b6f0.entry.js → p-41bc3c58.entry.js} +2 -2
  10. package/dist/capsule/{p-b976b6f0.entry.js.map → p-41bc3c58.entry.js.map} +1 -1
  11. package/dist/capsule/p-7233228e.entry.js +29 -0
  12. package/dist/capsule/p-7233228e.entry.js.map +1 -0
  13. package/dist/capsule/{p-447d49b9.entry.js → p-742bda0b.entry.js} +2 -2
  14. package/dist/capsule/{p-447d49b9.entry.js.map → p-742bda0b.entry.js.map} +1 -1
  15. package/dist/capsule/{p-f6c74d69.entry.js → p-c1aa1ffb.entry.js} +2 -2
  16. package/dist/capsule/{p-f6c74d69.entry.js.map → p-c1aa1ffb.entry.js.map} +1 -1
  17. package/dist/capsule/p-d351f076.entry.js +2 -0
  18. package/dist/capsule/p-d351f076.entry.js.map +1 -0
  19. package/dist/capsule/{p-452b9998.entry.js → p-dc4591d5.entry.js} +2 -2
  20. package/dist/capsule/{p-452b9998.entry.js.map → p-dc4591d5.entry.js.map} +1 -1
  21. package/dist/capsule/{p-6dcaee48.entry.js → p-de2a16e4.entry.js} +2 -2
  22. package/dist/capsule/{p-6dcaee48.entry.js.map → p-de2a16e4.entry.js.map} +1 -1
  23. package/dist/capsule/p-e1255160.js.map +1 -1
  24. package/dist/capsule/p-f2393be6.js.map +1 -1
  25. package/dist/capsule/p-fa6b7678.js +3 -0
  26. package/dist/capsule/p-fa6b7678.js.map +1 -0
  27. package/dist/cjs/capsule.cjs.js +10 -10
  28. package/dist/cjs/capsule.cjs.js.map +1 -1
  29. package/dist/cjs/{cpsl-alert_34.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +136 -95
  30. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
  31. package/dist/cjs/cpsl-animation.cjs.entry.js +5 -2
  32. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  33. package/dist/cjs/cpsl-col.cjs.entry.js +25 -6
  34. package/dist/cjs/cpsl-col.cjs.entry.js.map +1 -1
  35. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  36. package/dist/cjs/cpsl-hero.cjs.entry.js +35 -0
  37. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -0
  38. package/dist/cjs/cpsl-identicon.cjs.entry.js +2 -2
  39. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  40. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +3 -2
  41. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  42. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  43. package/dist/cjs/index-65f57499.js +1439 -0
  44. package/dist/cjs/index-65f57499.js.map +1 -0
  45. package/dist/cjs/index.cjs.js +10 -2
  46. package/dist/cjs/index.cjs.js.map +1 -1
  47. package/dist/cjs/loader.cjs.js +2 -2
  48. package/dist/collection/assets/icons/index.js +1 -3
  49. package/dist/collection/assets/icons/index.js.map +1 -1
  50. package/dist/collection/collection-manifest.json +2 -2
  51. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  52. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  53. package/dist/collection/components/cpsl-animation/cpsl-animation.js +4 -1
  54. package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -1
  55. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +5 -2
  56. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  57. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  58. package/dist/collection/components/cpsl-button/cpsl-button.js +5 -2
  59. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  60. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  61. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
  62. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  63. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  64. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +5 -3
  65. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  66. package/dist/collection/components/cpsl-col/cpsl-col.js +21 -5
  67. package/dist/collection/components/cpsl-col/cpsl-col.js.map +1 -1
  68. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  69. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +3 -2
  70. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  71. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
  72. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  73. package/dist/collection/components/cpsl-dropdown/dropdown-interface.js.map +1 -1
  74. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +6 -1
  75. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  76. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  77. package/dist/collection/components/cpsl-hero/cpsl-hero.js +3 -2
  78. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  79. package/dist/collection/components/cpsl-hero/cpsl-hero.stories.js.map +1 -1
  80. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  81. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  82. package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js.map +1 -1
  83. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  84. package/dist/collection/components/cpsl-input/cpsl-input.js +36 -2
  85. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  86. package/dist/collection/components/cpsl-modal/cpsl-modal.js +1 -1
  87. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  88. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +2 -1
  89. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  90. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  91. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +2 -1
  92. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  93. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  94. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -1
  95. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  96. package/dist/collection/components/cpsl-popover/cpsl-popover.js +18 -6
  97. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  98. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  99. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  100. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  101. package/dist/collection/components/cpsl-select/cpsl-select.js +3 -1
  102. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  103. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  104. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +14 -3
  105. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  106. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  107. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  108. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  109. package/dist/collection/components/cpsl-table/cpsl-table.js +11 -1
  110. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  111. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +7 -1
  112. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  113. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -2
  114. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  115. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  116. package/dist/collection/interface.js.map +1 -1
  117. package/dist/collection/utils/media.js +3 -0
  118. package/dist/collection/utils/media.js.map +1 -1
  119. package/dist/collection/utils/theme/generateBorderRadii.js +1 -1
  120. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  121. package/dist/collection/utils/theme/generatePalette.js +4 -1
  122. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  123. package/dist/collection/utils/theme/generateTheme.js +4 -0
  124. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  125. package/dist/collection/utils/theme/utils.js +1 -0
  126. package/dist/collection/utils/theme/utils.js.map +1 -1
  127. package/dist/esm/capsule.js +11 -11
  128. package/dist/esm/capsule.js.map +1 -1
  129. package/dist/esm/{cpsl-alert_34.entry.js → cpsl-alert_33.entry.js} +137 -95
  130. package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
  131. package/dist/esm/cpsl-animation.entry.js +5 -2
  132. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  133. package/dist/esm/cpsl-col.entry.js +25 -6
  134. package/dist/esm/cpsl-col.entry.js.map +1 -1
  135. package/dist/esm/cpsl-grid.entry.js +3 -3
  136. package/dist/esm/cpsl-hero.entry.js +31 -0
  137. package/dist/esm/cpsl-hero.entry.js.map +1 -0
  138. package/dist/esm/cpsl-identicon.entry.js +2 -2
  139. package/dist/esm/cpsl-info-box.entry.js +2 -2
  140. package/dist/esm/cpsl-modal-v2.entry.js +3 -2
  141. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  142. package/dist/esm/cpsl-row.entry.js +2 -2
  143. package/dist/esm/index-91db3414.js +1408 -0
  144. package/dist/esm/index-91db3414.js.map +1 -0
  145. package/dist/esm/index.js +10 -2
  146. package/dist/esm/index.js.map +1 -1
  147. package/dist/esm/loader.js +3 -3
  148. package/dist/loader/cdn.js +1 -3
  149. package/dist/loader/index.cjs.js +1 -3
  150. package/dist/loader/index.d.ts +3 -0
  151. package/dist/loader/index.es2017.js +1 -3
  152. package/dist/loader/index.js +1 -3
  153. package/dist/scripts/buildAssets.js +1 -1
  154. package/dist/types/assets/icons/index.d.ts +0 -2
  155. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +8 -0
  156. package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +6 -0
  157. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +10 -0
  158. package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +11 -0
  159. package/dist/types/components/cpsl-button/cpsl-button.d.ts +29 -0
  160. package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +3 -0
  161. package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +6 -0
  162. package/dist/types/components/cpsl-code-input/cpsl-code-input.d.ts +19 -0
  163. package/dist/types/components/cpsl-col/cpsl-col.d.ts +96 -0
  164. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +31 -0
  165. package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +15 -0
  166. package/dist/types/components/cpsl-dropdown/dropdown-interface.d.ts +1 -1
  167. package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +43 -0
  168. package/dist/types/components/cpsl-grid/cpsl-grid.d.ts +3 -0
  169. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +5 -0
  170. package/dist/types/components/cpsl-icon/cpsl-icon.d.ts +6 -0
  171. package/dist/types/components/cpsl-identicon/cpsl-identicon.d.ts +4 -0
  172. package/dist/types/components/cpsl-input/cpsl-input.d.ts +138 -0
  173. package/dist/types/components/cpsl-input/input-interface.d.ts +5 -0
  174. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +39 -0
  175. package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +32 -0
  176. package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +3 -0
  177. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +14 -0
  178. package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +15 -0
  179. package/dist/types/components/cpsl-pill/cpsl-pill.d.ts +3 -0
  180. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +55 -2
  181. package/dist/types/components/cpsl-progress-indicator/cpsl-progress-indicator.d.ts +6 -0
  182. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +10 -0
  183. package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +6 -0
  184. package/dist/types/components/cpsl-select/cpsl-select.d.ts +45 -0
  185. package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +10 -0
  186. package/dist/types/components/cpsl-slide-button/cpsl-slide-button.d.ts +18 -0
  187. package/dist/types/components/cpsl-spinner/cpsl-spinner.d.ts +8 -0
  188. package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +6 -0
  189. package/dist/types/components/cpsl-tab/cpsl-tab.d.ts +11 -0
  190. package/dist/types/components/cpsl-tabs/cpsl-tabs.d.ts +13 -0
  191. package/dist/types/components/cpsl-text/cpsl-text.d.ts +15 -0
  192. package/dist/types/components/cpsl-tile-button/cpsl-tile-button.d.ts +6 -0
  193. package/dist/types/components.d.ts +28 -6
  194. package/dist/types/stencil-public-runtime.d.ts +3 -10
  195. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  196. package/dist/types/utils/theme/generatePalette.d.ts +1 -1
  197. package/dist/types/utils/theme/generateTheme.d.ts +4 -0
  198. package/package.json +4 -10
  199. package/readme.md +47 -2
  200. package/dist/capsule/p-303e6e89.entry.js +0 -29
  201. package/dist/capsule/p-303e6e89.entry.js.map +0 -1
  202. package/dist/capsule/p-6793ef7a.entry.js +0 -2
  203. package/dist/capsule/p-7dde3172.js +0 -3
  204. package/dist/capsule/p-7dde3172.js.map +0 -1
  205. package/dist/capsule/p-a6aaf3f4.entry.js +0 -10
  206. package/dist/capsule/p-a6aaf3f4.entry.js.map +0 -1
  207. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +0 -1
  208. package/dist/cjs/index-528f7428.js +0 -2107
  209. package/dist/cjs/index-528f7428.js.map +0 -1
  210. package/dist/collection/assets/icons/double-arc.svg +0 -13
  211. package/dist/collection/assets/icons/single-arc.svg +0 -11
  212. package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js +0 -29
  213. package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js.map +0 -1
  214. package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js +0 -37
  215. package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js.map +0 -1
  216. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +0 -29
  217. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +0 -1
  218. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +0 -37
  219. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +0 -1
  220. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +0 -29
  221. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +0 -1
  222. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +0 -37
  223. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +0 -1
  224. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +0 -29
  225. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +0 -1
  226. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +0 -37
  227. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +0 -1
  228. package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js +0 -29
  229. package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js.map +0 -1
  230. package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js +0 -37
  231. package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js.map +0 -1
  232. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +0 -29
  233. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +0 -1
  234. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +0 -37
  235. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +0 -1
  236. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +0 -29
  237. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +0 -1
  238. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +0 -37
  239. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +0 -1
  240. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +0 -29
  241. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +0 -1
  242. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +0 -37
  243. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +0 -1
  244. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js +0 -29
  245. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js.map +0 -1
  246. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js +0 -37
  247. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js.map +0 -1
  248. package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js +0 -29
  249. package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js.map +0 -1
  250. package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js +0 -37
  251. package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js.map +0 -1
  252. package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js +0 -29
  253. package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js.map +0 -1
  254. package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js +0 -37
  255. package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js.map +0 -1
  256. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +0 -29
  257. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +0 -1
  258. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +0 -37
  259. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +0 -1
  260. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js +0 -29
  261. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js.map +0 -1
  262. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js +0 -37
  263. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js.map +0 -1
  264. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +0 -29
  265. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +0 -1
  266. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +0 -37
  267. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +0 -1
  268. package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js +0 -29
  269. package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js.map +0 -1
  270. package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js +0 -37
  271. package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js.map +0 -1
  272. package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js +0 -29
  273. package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js.map +0 -1
  274. package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js +0 -37
  275. package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js.map +0 -1
  276. package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js +0 -29
  277. package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js.map +0 -1
  278. package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js +0 -37
  279. package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js.map +0 -1
  280. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js +0 -29
  281. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js.map +0 -1
  282. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js +0 -37
  283. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js.map +0 -1
  284. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js +0 -29
  285. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js.map +0 -1
  286. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js +0 -37
  287. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js.map +0 -1
  288. package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js +0 -29
  289. package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js.map +0 -1
  290. package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js +0 -37
  291. package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js.map +0 -1
  292. package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js +0 -29
  293. package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js.map +0 -1
  294. package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js +0 -37
  295. package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js.map +0 -1
  296. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +0 -29
  297. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +0 -1
  298. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +0 -37
  299. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +0 -1
  300. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +0 -29
  301. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +0 -1
  302. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +0 -37
  303. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +0 -1
  304. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js +0 -29
  305. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js.map +0 -1
  306. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js +0 -37
  307. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js.map +0 -1
  308. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +0 -29
  309. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +0 -1
  310. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +0 -37
  311. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +0 -1
  312. package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js +0 -29
  313. package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js.map +0 -1
  314. package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js +0 -37
  315. package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js.map +0 -1
  316. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +0 -29
  317. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +0 -1
  318. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +0 -37
  319. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +0 -1
  320. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js +0 -29
  321. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js.map +0 -1
  322. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js +0 -37
  323. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js.map +0 -1
  324. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js +0 -29
  325. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js.map +0 -1
  326. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js +0 -37
  327. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js.map +0 -1
  328. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +0 -29
  329. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +0 -1
  330. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +0 -37
  331. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +0 -1
  332. package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js +0 -29
  333. package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js.map +0 -1
  334. package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js +0 -37
  335. package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js.map +0 -1
  336. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +0 -29
  337. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +0 -1
  338. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +0 -37
  339. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +0 -1
  340. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +0 -29
  341. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +0 -1
  342. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +0 -37
  343. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +0 -1
  344. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js +0 -29
  345. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js.map +0 -1
  346. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js +0 -37
  347. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js.map +0 -1
  348. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js +0 -29
  349. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js.map +0 -1
  350. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js +0 -37
  351. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js.map +0 -1
  352. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +0 -29
  353. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +0 -1
  354. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +0 -37
  355. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +0 -1
  356. package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js +0 -29
  357. package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js.map +0 -1
  358. package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js +0 -37
  359. package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js.map +0 -1
  360. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +0 -29
  361. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +0 -1
  362. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +0 -37
  363. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +0 -1
  364. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js +0 -29
  365. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js.map +0 -1
  366. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js +0 -37
  367. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js.map +0 -1
  368. package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js +0 -29
  369. package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js.map +0 -1
  370. package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js +0 -37
  371. package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js.map +0 -1
  372. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js +0 -29
  373. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js.map +0 -1
  374. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js +0 -37
  375. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js.map +0 -1
  376. package/dist/esm/cpsl-alert_34.entry.js.map +0 -1
  377. package/dist/esm/index-b188f201.js +0 -2076
  378. package/dist/esm/index-b188f201.js.map +0 -1
  379. package/dist/esm/polyfills/core-js.js +0 -11
  380. package/dist/esm/polyfills/dom.js +0 -79
  381. package/dist/esm/polyfills/es5-html-element.js +0 -1
  382. package/dist/esm/polyfills/index.js +0 -34
  383. package/dist/esm/polyfills/system.js +0 -6
  384. /package/dist/types/Users/{briancorbin/Documents/Programming/Capsule/component-library/core → taylorbosch/Documents/GitHub/Capsule/web-sdk/packages/core-components}/.stencil/scripts/buildAssets.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-dropdown.js","sourceRoot":"","sources":["../../../../src/components/cpsl-dropdown/cpsl-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAsB,KAAK,EAAE,MAAM,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAQ3C,MAAM,OAAO,YAAY;;QAuCf,mBAAc,GAAG,GAAG,EAAE;YAC5B,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7B,CAAC,CAAC;QAEM,eAAU,GAAG,CAAC,IAA8B,EAAE,YAAqB,IAAI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AAK,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;gBACvF,IAAI,CAAC,aAAa,IAAI,CACrB,UAAI,KAAK,EAAC,YAAY;oBACpB,aAAO,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,uBAAuB,GAAI,CAC1G,CACN;gBACA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAC9B,UAAI,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;oBACtC,YAAM,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS;oBACzC,IAAI,CAAC,KAAK;;oBAAE,YAAM,KAAK,EAAC,gBAAgB,IAAE,IAAI,CAAC,KAAK,CAAQ,CAC1D,CACN,CAAC,CACC,CACA,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Element, ComponentInterface, Watch, Listen, EventEmitter, Event } from '@stencil/core';\nimport { Icons } from '../../assets/icons';\nimport { DropdownInputEventDetail } from './dropdown-interface';\n\n@Component({\n tag: 'cpsl-dropdown',\n styleUrl: 'cpsl-dropdown.scss',\n shadow: true,\n})\nexport class CpslDropdown implements ComponentInterface {\n @Element() el: HTMLCpslDropdownElement;\n\n /**\n * Width of the dropdown\n */\n @Prop() width: string = '100%';\n\n /**\n * Whether or not to include search capability\n */\n @Prop() hasCpslSearch: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() searchQuery: string = '';\n @State() filteredItems: Array<DropdownInputEventDetail> = [];\n\n /**\n * Items to be presented in the dropdown\n */\n @Prop() items: Array<DropdownInputEventDetail> = [];\n\n /**\n * The selected item in the dropdown\n */\n @Prop({ mutable: true }) selectedItem?: DropdownInputEventDetail | null = null;\n\n /**\n * Event emitted when the selected item changes\n */\n @Event() selectedItemChange!: EventEmitter<DropdownInputEventDetail>;\n\n @Watch('selectedItem')\n handleSelectedItemChange(newValue: DropdownInputEventDetail | null) {\n if (newValue !== null) {\n this.selectItem(newValue, false);\n }\n }\n\n private toggleDropdown = () => {\n this.isOpen = !this.isOpen;\n };\n\n private selectItem = (item: DropdownInputEventDetail, emitEvent: boolean = true) => {\n this.selectedItem = item;\n this.isOpen = false;\n if (emitEvent) {\n this.selectedItemChange.emit(this.selectedItem);\n }\n };\n\n private handleItemSelect = (item: DropdownInputEventDetail) => () => {\n this.selectItem(item);\n };\n\n private handleSearchQueryChange = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n this.searchQuery = target.value;\n this.filteredItems = this.items.filter(item => item.label.toLowerCase().includes(this.searchQuery.toLowerCase()));\n };\n\n @Watch('isOpen')\n handleOpenChange() {\n if (this.isOpen) {\n this.adjustPosition();\n this.addClickOutsideListener();\n } else {\n this.removeClickOutsideListener();\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n if (this.isOpen) {\n this.adjustPosition();\n }\n }\n\n private adjustPosition() {\n const dropdownOptions = this.el.shadowRoot.querySelector('.dropdown-options') as HTMLElement;\n const parentRect = this.el.parentElement?.getBoundingClientRect();\n const searchBar = this.el.shadowRoot.querySelector('.search-bar') as HTMLElement;\n const viewportHeight = window.innerHeight;\n\n if (parentRect) {\n this.width = `${parentRect.width}px`;\n dropdownOptions.style.left = `${parentRect.x}px`;\n if (window.innerWidth <= 480) {\n searchBar.style.maxHeight = `30px`;\n dropdownOptions.style.top = `425px`;\n dropdownOptions.style.maxHeight = '110px';\n return;\n }\n dropdownOptions.style.top = `${parentRect.y + parentRect.height}px`;\n\n const availableHeight = viewportHeight - parentRect.bottom;\n dropdownOptions.style.maxHeight = `${availableHeight - 8}px`;\n }\n }\n\n private addClickOutsideListener() {\n window.addEventListener('click', this.handleClickOutside);\n }\n\n private removeClickOutsideListener() {\n window.removeEventListener('click', this.handleClickOutside);\n }\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.isOpen && !this.el.contains(event.target as Node)) {\n this.isOpen = false;\n }\n };\n\n componentWillLoad() {\n if (this.items.length > 0) {\n this.filteredItems = [...this.items];\n if (this.selectedItem !== null) {\n this.selectItem(this.selectedItem, false);\n } else {\n this.selectedItem = this.items[0];\n }\n }\n }\n\n disconnectedCallback() {\n this.removeClickOutsideListener();\n }\n\n render() {\n return (\n <Host>\n <button class=\"dropdown-button\" onClick={this.toggleDropdown}>\n {`${this.selectedItem?.selectedLabel || this.selectedItem?.label} ${this.selectedItem?.value}`}\n <div class={`chevron ${this.isOpen ? '' : 'closed'}`} innerHTML={Icons['chevronUp']} />\n </button>\n <ul class={{ 'dropdown-options': true, 'open': this.isOpen }} style={{ width: this.width }}>\n {this.hasCpslSearch && (\n <li class=\"search-bar\">\n <input type=\"text\" placeholder=\"Search...\" value={this.searchQuery} onInput={this.handleSearchQueryChange} />\n </li>\n )}\n {this.filteredItems.map(item => (\n <li onClick={this.handleItemSelect(item)}>\n <span innerHTML={Icons[item.icon]}></span>\n {item.label} <span class=\"dropdown-value\">{item.value}</span>\n </li>\n ))}\n </ul>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-dropdown.js","sourceRoot":"","sources":["../../../../src/components/cpsl-dropdown/cpsl-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EAEP,KAAK,EACL,MAAM,EAEN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CA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0CAAE,KAAK,EAAE;gBAC9F,4DAAK,KAAK,EAAE,WAAW,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,GAAI,CAChF;YACT,2DAAI,KAAK,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;gBACvF,IAAI,CAAC,aAAa,IAAI,CACrB,2DAAI,KAAK,EAAC,YAAY;oBACpB,8DAAO,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,uBAAuB,GAAI,CAC1G,CACN;gBACA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAC9B,UAAI,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;oBACtC,YAAM,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS;oBACzC,IAAI,CAAC,KAAK;;oBAAE,YAAM,KAAK,EAAC,gBAAgB,IAAE,IAAI,CAAC,KAAK,CAAQ,CAC1D,CACN,CAAC,CACC,CACA,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n ComponentInterface,\n Watch,\n Listen,\n EventEmitter,\n Event,\n} from '@stencil/core';\nimport { Icons } from '../../assets/icons';\nimport { DropdownInputEventDetail } from './dropdown-interface';\n\n@Component({\n tag: 'cpsl-dropdown',\n styleUrl: 'cpsl-dropdown.scss',\n shadow: true,\n})\nexport class CpslDropdown implements ComponentInterface {\n @Element() el: HTMLCpslDropdownElement;\n\n /**\n * Width of the dropdown\n */\n @Prop() width: string = '100%';\n\n /**\n * Whether or not to include search capability\n */\n @Prop() hasCpslSearch: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() searchQuery: string = '';\n @State() filteredItems: Array<DropdownInputEventDetail> = [];\n\n /**\n * Items to be presented in the dropdown\n */\n @Prop() items: Array<DropdownInputEventDetail> = [];\n\n /**\n * The selected item in the dropdown\n */\n @Prop({ mutable: true }) selectedItem?: DropdownInputEventDetail | null = null;\n\n /**\n * Event emitted when the selected item changes\n */\n @Event() selectedItemChange!: EventEmitter<DropdownInputEventDetail>;\n\n @Watch('selectedItem')\n handleSelectedItemChange(newValue: DropdownInputEventDetail | null) {\n if (newValue !== null) {\n this.selectItem(newValue, false);\n }\n }\n\n private toggleDropdown = () => {\n this.isOpen = !this.isOpen;\n };\n\n private selectItem = (item: DropdownInputEventDetail, emitEvent: boolean = true) => {\n this.selectedItem = item;\n this.isOpen = false;\n if (emitEvent) {\n this.selectedItemChange.emit(this.selectedItem);\n }\n };\n\n private handleItemSelect = (item: DropdownInputEventDetail) => () => {\n this.selectItem(item);\n };\n\n private handleSearchQueryChange = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n this.searchQuery = target.value;\n this.filteredItems = this.items.filter(item => item.label.toLowerCase().includes(this.searchQuery.toLowerCase()));\n };\n\n @Watch('isOpen')\n handleOpenChange() {\n if (this.isOpen) {\n this.adjustPosition();\n this.addClickOutsideListener();\n } else {\n this.removeClickOutsideListener();\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n if (this.isOpen) {\n this.adjustPosition();\n }\n }\n\n private adjustPosition() {\n const dropdownOptions = this.el.shadowRoot.querySelector('.dropdown-options') as HTMLElement;\n const parentRect = this.el.parentElement?.getBoundingClientRect();\n const searchBar = this.el.shadowRoot.querySelector('.search-bar') as HTMLElement;\n const viewportHeight = window.innerHeight;\n\n if (parentRect) {\n this.width = `${parentRect.width}px`;\n dropdownOptions.style.left = `${parentRect.x}px`;\n if (window.innerWidth <= 480) {\n searchBar.style.maxHeight = `30px`;\n dropdownOptions.style.top = `425px`;\n dropdownOptions.style.maxHeight = '110px';\n return;\n }\n dropdownOptions.style.top = `${parentRect.y + parentRect.height}px`;\n\n const availableHeight = viewportHeight - parentRect.bottom;\n dropdownOptions.style.maxHeight = `${availableHeight - 8}px`;\n }\n }\n\n private addClickOutsideListener() {\n window.addEventListener('click', this.handleClickOutside);\n }\n\n private removeClickOutsideListener() {\n window.removeEventListener('click', this.handleClickOutside);\n }\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.isOpen && !this.el.contains(event.target as Node)) {\n this.isOpen = false;\n }\n };\n\n componentWillLoad() {\n if (this.items.length > 0) {\n this.filteredItems = [...this.items];\n if (this.selectedItem !== null) {\n this.selectItem(this.selectedItem, false);\n } else {\n this.selectedItem = this.items[0];\n }\n }\n }\n\n disconnectedCallback() {\n this.removeClickOutsideListener();\n }\n\n render() {\n return (\n <Host>\n <button class=\"dropdown-button\" onClick={this.toggleDropdown}>\n {`${this.selectedItem?.selectedLabel || this.selectedItem?.label} ${this.selectedItem?.value}`}\n <div class={`chevron ${this.isOpen ? '' : 'closed'}`} innerHTML={Icons['chevronUp']} />\n </button>\n <ul class={{ 'dropdown-options': true, 'open': this.isOpen }} style={{ width: this.width }}>\n {this.hasCpslSearch && (\n <li class=\"search-bar\">\n <input type=\"text\" placeholder=\"Search...\" value={this.searchQuery} onInput={this.handleSearchQueryChange} />\n </li>\n )}\n {this.filteredItems.map(item => (\n <li onClick={this.handleItemSelect(item)}>\n <span innerHTML={Icons[item.icon]}></span>\n {item.label} <span class=\"dropdown-value\">{item.value}</span>\n </li>\n ))}\n </ul>\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-interface.js","sourceRoot":"","sources":["../../../../src/components/cpsl-dropdown/dropdown-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { IconType } from \"../../interface\";\n\nexport interface DropdownInputEventDetail {\n icon: IconType,\n label: string,\n value: string,\n selectedLabel?: string\n}"]}
1
+ {"version":3,"file":"dropdown-interface.js","sourceRoot":"","sources":["../../../../src/components/cpsl-dropdown/dropdown-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { IconType } from '../../interface';\n\nexport interface DropdownInputEventDetail {\n icon: IconType;\n label: string;\n value: string;\n selectedLabel?: string;\n}\n"]}
@@ -115,7 +115,12 @@ export class CpslFileUpload {
115
115
  }
116
116
  render() {
117
117
  var _a, _b, _c;
118
- return (h(Host, { key: '71d945bcac5d443719737781fd9ec5166952760d' }, this.label && (h("label", { class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("slot", { key: '63786e91e0a230d85344da507d0508ac1524cc88', name: "label" }), h("div", { key: '74e7296a0c8ef732094c0e7fab3e0a7db916694b', class: { 'container': true, 'error': Boolean(this.errorText), 'drag': this.dragOver, 'drag-error': this.dragError } }, h("div", { key: '1a3030a828d8e7a742f3dfbff784e213f845859e', class: { 'label-container': true } }, h("slot", { key: '1f77e4c6566deffe7cd830fccb96d21c22daee4b', name: "left-content" })), h("div", { key: '3dc0a113348d15d52aae929792de6ee48da795ca', class: { 'file-container': true } }, this.FileContent), h("input", { key: 'a6fc37d212b5e4284f4eeec56dc4e7a32ff8374b', id: this.inputId, type: "file", accept: (_b = (_a = this.fileTypes) === null || _a === void 0 ? void 0 : _a.join(', ')) !== null && _b !== void 0 ? _b : '*', files: Boolean(this.file) ? [this.file] : undefined, onDrop: this.handleDrop, onDragEnter: this.handleDragEnter, onDragLeave: this.handleDragLeave, onChange: this.handleInputChange })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", null, (_c = this.errorText) !== null && _c !== void 0 ? _c : this.helperText)))));
118
+ return (h(Host, { key: 'fd110192fe9a14089d8671d9091132d7f3d3b2c2' }, this.label && (h("label", { key: '2915f8854e6f53ef3e5c0ebde58ac49ab4dda377', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("slot", { key: '9dcc6ad98cf8ceea075a498fddd9a33eede5b50c', name: "label" }), h("div", { key: 'ba0e490eb3d18e9bf2aedbc60151d27b5cef75a9', class: {
119
+ 'container': true,
120
+ 'error': Boolean(this.errorText),
121
+ 'drag': this.dragOver,
122
+ 'drag-error': this.dragError,
123
+ } }, h("div", { key: '781df9aefcdd73a2ee39ec9d5afd323c9df607d5', class: { 'label-container': true } }, h("slot", { key: '4ead666c56a93bce34c89ee89cf971d10dab9d27', name: "left-content" })), h("div", { key: 'feb54192c2a64da5ffab558ec2739cf2e3243822', class: { 'file-container': true } }, this.FileContent), h("input", { key: '9a1cd7cd2e001a2a1334f772cf7322308e5558cf', id: this.inputId, type: "file", accept: (_b = (_a = this.fileTypes) === null || _a === void 0 ? void 0 : _a.join(', ')) !== null && _b !== void 0 ? _b : '*', files: Boolean(this.file) ? [this.file] : undefined, onDrop: this.handleDrop, onDragEnter: this.handleDragEnter, onDragLeave: this.handleDragLeave, onChange: this.handleInputChange })), (this.errorText || this.helperText) && (h("div", { key: '427df561a22254aae3fffc71838f8b833a83b1c8', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '65074449f66454fa4f49c2708a486442f4576e46' }, (_c = this.errorText) !== null && _c !== void 0 ? _c : this.helperText)))));
119
124
  }
120
125
  static get is() { return "cpsl-file-upload"; }
121
126
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-file-upload.js","sourceRoot":"","sources":["../../../../src/components/cpsl-file-upload/cpsl-file-upload.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS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AC,SAAS,CAAC,EAAE;gBAClF,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter, State, Fragment, Element } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-file-upload',\n styleUrl: 'cpsl-file-upload.scss',\n shadow: true,\n})\nexport class CpslFileUpload {\n @Element() el!: HTMLCpslFileUploadElement;\n\n private inputId = `cpsl-file-upload-${inputIds++}`;\n\n @State() file?: File;\n @State() dragOver?: boolean;\n @State() dragError?: boolean;\n @State() isUploading?: boolean;\n @State() uploadError?: boolean;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Filename for the external source of the selected file.\n */\n @Prop() externalFilename?: string;\n\n /**\n * External source for the selected file.\n */\n @Prop() externalSrc?: string;\n\n /**\n * Valid file types.\n */\n @Prop() fileTypes?: string[];\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * Function to trigger file upload to server.\n * Returns: boolean indicating success or failure.\n */\n @Prop() uploadFile?: (file: File) => Promise<boolean>;\n\n /**\n * Emitted when the file is dropped in the input.\n */\n @Event() cpslOnDrop!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag enters the input.\n */\n @Event() cpslOnDragEnter!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag leaves the input.\n */\n @Event() cpslOnDragLeave!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file changes.\n */\n @Event() cpslFileChange!: EventEmitter<File>;\n\n /**\n * Emitted when the file is removed.\n */\n @Event() cpslFileRemoved!: EventEmitter<void>;\n\n private handleDrop = async (ev: DragEvent) => {\n ev.preventDefault();\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n const file = item.getAsFile();\n await this.addFile(file);\n }\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDrop.emit(ev);\n };\n\n private handleDragEnter = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = true;\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n this.dragError = true;\n }\n\n this.cpslOnDragEnter.emit(ev);\n };\n\n private handleDragLeave = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDragLeave.emit(ev);\n };\n\n private handleInputChange = async (ev: Event) => {\n ev.preventDefault();\n\n const input = this.inputEl;\n\n if (Boolean(input.files.length)) {\n const file = input.files[0];\n\n if (this.isValidFile(file.type)) {\n await this.addFile(file);\n }\n }\n };\n\n private isValidFile = (type: string) => {\n if (Boolean(this.fileTypes?.length) ? !this.fileTypes.includes(type) : false) {\n return false;\n }\n\n return true;\n };\n\n private addFile = async (file: File) => {\n this.file = file;\n this.cpslFileChange.emit(file);\n this.uploadError = false;\n this.isUploading = true;\n const uploadSuccess = Boolean(this.uploadFile) ? await this.uploadFile(file) : true;\n if (!uploadSuccess) {\n this.uploadError = true;\n const input = this.inputEl;\n input.value = '';\n }\n this.isUploading = false;\n };\n\n private removeFile = (e: MouseEvent) => {\n e.preventDefault();\n\n this.file = undefined;\n\n const input = this.inputEl;\n input.value = '';\n\n this.cpslFileRemoved.emit();\n };\n\n get inputEl() {\n return this.el.shadowRoot.getElementById(this.inputId) as HTMLInputElement;\n }\n\n get FileContent() {\n const hasFile = Boolean(this.file) || Boolean(this.externalSrc);\n const isUploading = this.isUploading;\n const error = this.uploadError;\n\n const text = !hasFile ? (\n <Fragment>\n {'Drag file here or '}\n <cpsl-text class=\"inline-text\" variant=\"bodyXS\">\n upload file\n </cpsl-text>\n </Fragment>\n ) : isUploading ? (\n `${this.file.name} is uploading`\n ) : error ? (\n 'Upload Failed'\n ) : (\n this.file?.name || this.externalFilename || ''\n );\n const TopElement = !hasFile ? (\n <cpsl-icon icon=\"image\" />\n ) : isUploading ? (\n <cpsl-spinner />\n ) : error ? (\n <cpsl-icon icon=\"close\" />\n ) : (\n <img class=\"sample-img\" src={Boolean(this.file) ? URL.createObjectURL(this.file) : this.externalSrc} alt=\"Sample Image\" />\n );\n\n return (\n <Fragment>\n {TopElement}\n <span class=\"sample-image-name-container\">\n <cpsl-text class=\"sample-image-name\" variant=\"bodyXS\">\n {text}\n </cpsl-text>\n {hasFile && !error && !isUploading && <cpsl-icon icon=\"close\" onClick={this.removeFile} />}\n </span>\n </Fragment>\n );\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <slot name=\"label\"></slot>\n <div class={{ 'container': true, 'error': Boolean(this.errorText), 'drag': this.dragOver, 'drag-error': this.dragError }}>\n <div class={{ 'label-container': true }}>\n <slot name=\"left-content\"></slot>\n </div>\n <div class={{ 'file-container': true }}>{this.FileContent}</div>\n <input\n id={this.inputId}\n type=\"file\"\n accept={this.fileTypes?.join(', ') ?? '*'}\n files={Boolean(this.file) ? [this.file] : undefined}\n onDrop={this.handleDrop}\n onDragEnter={this.handleDragEnter}\n onDragLeave={this.handleDragLeave}\n onChange={this.handleInputChange}\n />\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
1
+ {"version":3,"file":"cpsl-file-upload.js","sourceRoot":"","sources":["../../../../src/components/cpsl-file-upload/cpsl-file-upload.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxG,MAAM,OAAO,cAAc;;QAGjB,YAAO,GAAG,oBAAoB,QAAQ,EAAE,EAAE,CAAC;QA+E3C,eAAU,GAAG,CAAO,EAAa,EAAE,EAAE;;YAC3C,EAAE,CAAC,cAAc,EAAE,CAAC;YAEpB,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,0CAAG,CAAC,CAAC,CAAC;YAEpD,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9B,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;YAED,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YAEvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAA,CAAC;QAEM,oBAAe,GAAG,CAAC,EAAa,EAAE,E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E,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EACnD,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,GAChC,CACE;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CACtC,4DAAK,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,+DAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter, State, Fragment, Element } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-file-upload',\n styleUrl: 'cpsl-file-upload.scss',\n shadow: true,\n})\nexport class CpslFileUpload {\n @Element() el!: HTMLCpslFileUploadElement;\n\n private inputId = `cpsl-file-upload-${inputIds++}`;\n\n @State() file?: File;\n @State() dragOver?: boolean;\n @State() dragError?: boolean;\n @State() isUploading?: boolean;\n @State() uploadError?: boolean;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Filename for the external source of the selected file.\n */\n @Prop() externalFilename?: string;\n\n /**\n * External source for the selected file.\n */\n @Prop() externalSrc?: string;\n\n /**\n * Valid file types.\n */\n @Prop() fileTypes?: string[];\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * Function to trigger file upload to server.\n * Returns: boolean indicating success or failure.\n */\n @Prop() uploadFile?: (file: File) => Promise<boolean>;\n\n /**\n * Emitted when the file is dropped in the input.\n */\n @Event() cpslOnDrop!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag enters the input.\n */\n @Event() cpslOnDragEnter!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag leaves the input.\n */\n @Event() cpslOnDragLeave!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file changes.\n */\n @Event() cpslFileChange!: EventEmitter<File>;\n\n /**\n * Emitted when the file is removed.\n */\n @Event() cpslFileRemoved!: EventEmitter<void>;\n\n private handleDrop = async (ev: DragEvent) => {\n ev.preventDefault();\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n const file = item.getAsFile();\n await this.addFile(file);\n }\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDrop.emit(ev);\n };\n\n private handleDragEnter = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = true;\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n this.dragError = true;\n }\n\n this.cpslOnDragEnter.emit(ev);\n };\n\n private handleDragLeave = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDragLeave.emit(ev);\n };\n\n private handleInputChange = async (ev: Event) => {\n ev.preventDefault();\n\n const input = this.inputEl;\n\n if (Boolean(input.files.length)) {\n const file = input.files[0];\n\n if (this.isValidFile(file.type)) {\n await this.addFile(file);\n }\n }\n };\n\n private isValidFile = (type: string) => {\n if (Boolean(this.fileTypes?.length) ? !this.fileTypes.includes(type) : false) {\n return false;\n }\n\n return true;\n };\n\n private addFile = async (file: File) => {\n this.file = file;\n this.cpslFileChange.emit(file);\n this.uploadError = false;\n this.isUploading = true;\n const uploadSuccess = Boolean(this.uploadFile) ? await this.uploadFile(file) : true;\n if (!uploadSuccess) {\n this.uploadError = true;\n const input = this.inputEl;\n input.value = '';\n }\n this.isUploading = false;\n };\n\n private removeFile = (e: MouseEvent) => {\n e.preventDefault();\n\n this.file = undefined;\n\n const input = this.inputEl;\n input.value = '';\n\n this.cpslFileRemoved.emit();\n };\n\n get inputEl() {\n return this.el.shadowRoot.getElementById(this.inputId) as HTMLInputElement;\n }\n\n get FileContent() {\n const hasFile = Boolean(this.file) || Boolean(this.externalSrc);\n const isUploading = this.isUploading;\n const error = this.uploadError;\n\n const text = !hasFile ? (\n <Fragment>\n {'Drag file here or '}\n <cpsl-text class=\"inline-text\" variant=\"bodyXS\">\n upload file\n </cpsl-text>\n </Fragment>\n ) : isUploading ? (\n `${this.file.name} is uploading`\n ) : error ? (\n 'Upload Failed'\n ) : (\n this.file?.name || this.externalFilename || ''\n );\n const TopElement = !hasFile ? (\n <cpsl-icon icon=\"image\" />\n ) : isUploading ? (\n <cpsl-spinner />\n ) : error ? (\n <cpsl-icon icon=\"close\" />\n ) : (\n <img\n class=\"sample-img\"\n src={Boolean(this.file) ? URL.createObjectURL(this.file) : this.externalSrc}\n alt=\"Sample Image\"\n />\n );\n\n return (\n <Fragment>\n {TopElement}\n <span class=\"sample-image-name-container\">\n <cpsl-text class=\"sample-image-name\" variant=\"bodyXS\">\n {text}\n </cpsl-text>\n {hasFile && !error && !isUploading && <cpsl-icon icon=\"close\" onClick={this.removeFile} />}\n </span>\n </Fragment>\n );\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <slot name=\"label\"></slot>\n <div\n class={{\n 'container': true,\n 'error': Boolean(this.errorText),\n 'drag': this.dragOver,\n 'drag-error': this.dragError,\n }}\n >\n <div class={{ 'label-container': true }}>\n <slot name=\"left-content\"></slot>\n </div>\n <div class={{ 'file-container': true }}>{this.FileContent}</div>\n <input\n id={this.inputId}\n type=\"file\"\n accept={this.fileTypes?.join(', ') ?? '*'}\n files={Boolean(this.file) ? [this.file] : undefined}\n onDrop={this.handleDrop}\n onDragEnter={this.handleDragEnter}\n onDragLeave={this.handleDragLeave}\n onChange={this.handleInputChange}\n />\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -4,9 +4,9 @@ export class CpslGrid {
4
4
  this.fixed = false;
5
5
  }
6
6
  render() {
7
- return (h(Host, { key: '1596fe7c785ab672325dde24686ec73f3acd1dc1', class: {
7
+ return (h(Host, { key: '76084ea41988e4fdff4a48dc400988d2aa190a56', class: {
8
8
  'grid-fixed': this.fixed,
9
- } }, h("slot", { key: 'a45bcf373f26f5b41484daec4bd6f39f8af1bd6f' })));
9
+ } }, h("slot", { key: '1eb8c755910397d58a2165238a1428769623ef6b' })));
10
10
  }
11
11
  static get is() { return "cpsl-grid"; }
12
12
  static get encapsulation() { return "shadow"; }
@@ -9,12 +9,13 @@ export class CpslHero {
9
9
  this.subtitle = undefined;
10
10
  }
11
11
  render() {
12
- return (h(Host, { key: '526227a9695e8c0846780a3c39034b4d558cf141', class: {
12
+ return (h(Host, { key: '846f2b1808af5f172d659c1531015763190d9eaa', class: {
13
+ // VARIANTS
13
14
  connection: this.variant === 'connection',
14
15
  pending: this.variant === 'pending',
15
16
  approved: this.variant === 'approved',
16
17
  failed: this.variant === 'failed',
17
- } }, h("div", { key: '45ce6b958e3c3b8544e280425da83fbb014ff500', class: "backgroundContainer" }, h("div", { key: 'a5337d2ceddcd7ac725aa9b68ba240e62fc32f37', class: "background" }, h("div", { key: '88703ca494220195a5da3a21aef49e4eee29b928', class: "ring ring3" }), h("div", { key: 'bc9e1eacc99a1993e7f1e76d87c521250d8287f9', class: "ring ring2" }), h("div", { key: 'afaa234eb2d2a312c2d197de435d4396e64b77f1', class: "ring ring1" }), h("div", { key: '0e46b2f228e479019d0cfb8cda850fd3f361da65', class: "ring ring0" }), this.variant === 'connection' && (h("div", { class: `ringCenter connection` }, h("img", { src: Images.heroDefault }))), this.variant === 'pending' && (h("div", { class: `ringCenter pending` }, h("img", { src: Images.heroPending }))), this.variant === 'approved' && (h("div", { class: `ringCenter approved` }, h("img", { src: Images.heroSuccess }))), h("div", { key: 'ecf964e7816cfdd4db690a1a4b21e39f91504457', class: "fadeOut" })), h("div", { key: '0d494d9907b97ca438a5bd1a54d776555da0940e', class: "children" }, this.variant === 'connection' && (h("div", { class: "connectDiagramContainer" }, h("slot", { name: "connectionLeft" }), h("slot", { name: "connectionRight" }))), this.variant === 'failed' && AlertCircle(), this.variant === 'approved' && Checkmark())), h("cpsl-text", { key: '44855a5dbd947bacd51f4dc48d4e2a28f94f1b71', variant: "headingXS", color: "primary", weight: "medium" }, this.title), this.subtitle && (h("cpsl-text", { variant: "bodyM", color: "secondary" }, this.subtitle))));
18
+ } }, h("div", { key: 'f11070c3f78fd6ad2fbb9842d2484b4263112cb3', class: "backgroundContainer" }, h("div", { key: '5a50e2df5669ff92d3bee0b00bd3ed92075dfa7a', class: "background" }, h("div", { key: '24062e48e9d07feb6e79d4ec1c527b2476950f3b', class: "ring ring3" }), h("div", { key: '37913e7689bbdc4165811fb25b747b8badaa287c', class: "ring ring2" }), h("div", { key: 'f265592120f9fa1052e346bd92951f6789d85502', class: "ring ring1" }), h("div", { key: '19e252b63847df7ea5acb450d8e3479a4b2ad561', class: "ring ring0" }), this.variant === 'connection' && (h("div", { key: '8b94818b22a288284509fe63578b68277ed71edc', class: `ringCenter connection` }, h("img", { key: 'c50d6f5be69303e9c9c1c7f885bbacadceb1c5c8', src: Images.heroDefault }))), this.variant === 'pending' && (h("div", { key: '9ab25648fd147203cba45136ab8956adb6bd99d1', class: `ringCenter pending` }, h("img", { key: '9b0d536b4213ab558b37355e3b605fe3b65824ca', src: Images.heroPending }))), this.variant === 'approved' && (h("div", { key: '2ed926910d870e3b9577b0203ce2e68e8389623c', class: `ringCenter approved` }, h("img", { key: 'aab912dbedf89db56946d2de72f7b0883c4fb261', src: Images.heroSuccess }))), h("div", { key: '55421fe06f9649f27d8728414fac8ce0a592efbb', class: "fadeOut" })), h("div", { key: '41a49e438379a139864d0b7b55ee2e89b5c9aaf0', class: "children" }, this.variant === 'connection' && (h("div", { key: 'a874f21784102c8001043cd93e8a281e63939875', class: "connectDiagramContainer" }, h("slot", { key: 'd99d0f2c0248f360da1829403ca9929ce3d9243c', name: "connectionLeft" }), h("slot", { key: '5557ab28d6108ecb660e5d8203b3decd991f4ea6', name: "connectionRight" }))), this.variant === 'failed' && AlertCircle(), this.variant === 'approved' && Checkmark())), h("cpsl-text", { key: '1aeb3912ca6386a8d1ca1f2d18735716db070cb5', variant: "headingXS", color: "primary", weight: "medium" }, this.title), this.subtitle && (h("cpsl-text", { key: 'e01dbe76df7f55f80fc20bce10e8e82c829851fc', variant: "bodyM", color: "secondary" }, this.subtitle))));
18
19
  }
19
20
  static get is() { return "cpsl-hero"; }
20
21
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-hero.js","sourceRoot":"","sources":["../../../../src/components/cpsl-hero/cpsl-hero.tsx"],"names":[],"mappings":"A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,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,WAAW,IACzC,IAAI,CAAC,QAAQ,CACJ,CACb,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { Images } from '../../assets/images';\n\nconst Checkmark = () => (\n <svg width=\"48\" height=\"35\" viewBox=\"0 0 48 35\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M47.219 1.11439C48.2604 2.15579 48.2604 3.84423 47.219 4.88563L17.8856 34.219C16.8442 35.2604 15.1558 35.2604 14.1144 34.219L0.781049 20.8856C-0.26035 19.8442 -0.26035 18.1558 0.781049 17.1144C1.82245 16.073 3.51089 16.073 4.55229 17.1144L16 28.5621L43.4477 1.11439C44.4891 0.0729939 46.1776 0.0729939 47.219 1.11439Z\"\n fill=\"url(#paint0_linear_841_278)\"\n />\n <defs>\n <linearGradient id=\"paint0_linear_841_278\" x1=\"48\" y1=\"17.6667\" x2=\"0\" y2=\"17.6667\" gradientUnits=\"userSpaceOnUse\">\n <stop stop-color=\"#BC82F3\" />\n <stop offset=\"0.485\" stop-color=\"#FF6778\" />\n <stop offset=\"1\" stop-color=\"#FFBA71\" />\n </linearGradient>\n </defs>\n </svg>\n);\n\nconst AlertCircle = () => (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M29 18.3333V29M29 39.6666H29.0267M55.6667 29C55.6667 43.7276 43.7276 55.6666 29 55.6666C14.2724 55.6666 2.33333 43.7276 2.33333 29C2.33333 14.2724 14.2724 2.33331 29 2.33331C43.7276 2.33331 55.6667 14.2724 55.6667 29Z\"\n stroke=\"#F04438\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n);\n\n@Component({\n tag: 'cpsl-hero',\n styleUrl: 'cpsl-hero.scss',\n shadow: true,\n})\nexport class CpslHero {\n /**\n * The variant of the button.\n * Options are: `\"default\"`, `\"loading\", `\"success\".\n * Default is: `\"default\"`.\n */\n @Prop({ reflect: true }) variant?: 'connection' | 'pending' | 'approved' | 'failed' = 'connection';\n\n @Prop({ reflect: true }) title: string;\n\n @Prop({ reflect: true }) subtitle?: string;\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n connection: this.variant === 'connection',\n pending: this.variant === 'pending',\n approved: this.variant === 'approved',\n failed: this.variant === 'failed',\n }}\n >\n <div class=\"backgroundContainer\">\n <div class=\"background\">\n <div class=\"ring ring3\" />\n <div class=\"ring ring2\" />\n <div class=\"ring ring1\" />\n <div class=\"ring ring0\" />\n {this.variant === 'connection' && (\n <div class={`ringCenter connection`}>\n <img src={Images.heroDefault} />\n </div>\n )}\n {this.variant === 'pending' && (\n <div class={`ringCenter pending`}>\n <img src={Images.heroPending} />\n </div>\n )}\n\n {this.variant === 'approved' && (\n <div class={`ringCenter approved`}>\n <img src={Images.heroSuccess} />\n </div>\n )}\n <div class=\"fadeOut\" />\n </div>\n <div class=\"children\">\n {this.variant === 'connection' && (\n <div class=\"connectDiagramContainer\">\n <slot name=\"connectionLeft\" />\n <slot name=\"connectionRight\" />\n </div>\n )}\n {this.variant === 'failed' && AlertCircle()}\n {this.variant === 'approved' && Checkmark()}\n </div>\n </div>\n <cpsl-text variant=\"headingXS\" color=\"primary\" weight=\"medium\">\n {this.title}\n </cpsl-text>\n {this.subtitle && (\n <cpsl-text variant=\"bodyM\" color=\"secondary\">\n {this.subtitle}\n </cpsl-text>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-hero.js","sourceRoot":"","sources":["../../../../src/components/cpsl-hero/cpsl-hero.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAA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K,EAAC,WAAW,IACzC,IAAI,CAAC,QAAQ,CACJ,CACb,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { Images } from '../../assets/images';\n\nconst Checkmark = () => (\n <svg width=\"48\" height=\"35\" viewBox=\"0 0 48 35\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M47.219 1.11439C48.2604 2.15579 48.2604 3.84423 47.219 4.88563L17.8856 34.219C16.8442 35.2604 15.1558 35.2604 14.1144 34.219L0.781049 20.8856C-0.26035 19.8442 -0.26035 18.1558 0.781049 17.1144C1.82245 16.073 3.51089 16.073 4.55229 17.1144L16 28.5621L43.4477 1.11439C44.4891 0.0729939 46.1776 0.0729939 47.219 1.11439Z\"\n fill=\"url(#paint0_linear_841_278)\"\n />\n <defs>\n <linearGradient id=\"paint0_linear_841_278\" x1=\"48\" y1=\"17.6667\" x2=\"0\" y2=\"17.6667\" gradientUnits=\"userSpaceOnUse\">\n <stop stop-color=\"#BC82F3\" />\n <stop offset=\"0.485\" stop-color=\"#FF6778\" />\n <stop offset=\"1\" stop-color=\"#FFBA71\" />\n </linearGradient>\n </defs>\n </svg>\n);\n\nconst AlertCircle = () => (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M29 18.3333V29M29 39.6666H29.0267M55.6667 29C55.6667 43.7276 43.7276 55.6666 29 55.6666C14.2724 55.6666 2.33333 43.7276 2.33333 29C2.33333 14.2724 14.2724 2.33331 29 2.33331C43.7276 2.33331 55.6667 14.2724 55.6667 29Z\"\n stroke=\"#F04438\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n);\n\n@Component({\n tag: 'cpsl-hero',\n styleUrl: 'cpsl-hero.scss',\n shadow: true,\n})\nexport class CpslHero {\n /**\n * The variant of the button.\n * Options are: `\"default\"`, `\"loading\", `\"success\".\n * Default is: `\"default\"`.\n */\n @Prop({ reflect: true }) variant?: 'connection' | 'pending' | 'approved' | 'failed' = 'connection';\n\n @Prop({ reflect: true }) title: string;\n\n @Prop({ reflect: true }) subtitle?: string;\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n connection: this.variant === 'connection',\n pending: this.variant === 'pending',\n approved: this.variant === 'approved',\n failed: this.variant === 'failed',\n }}\n >\n <div class=\"backgroundContainer\">\n <div class=\"background\">\n <div class=\"ring ring3\" />\n <div class=\"ring ring2\" />\n <div class=\"ring ring1\" />\n <div class=\"ring ring0\" />\n {this.variant === 'connection' && (\n <div class={`ringCenter connection`}>\n <img src={Images.heroDefault} />\n </div>\n )}\n {this.variant === 'pending' && (\n <div class={`ringCenter pending`}>\n <img src={Images.heroPending} />\n </div>\n )}\n\n {this.variant === 'approved' && (\n <div class={`ringCenter approved`}>\n <img src={Images.heroSuccess} />\n </div>\n )}\n <div class=\"fadeOut\" />\n </div>\n <div class=\"children\">\n {this.variant === 'connection' && (\n <div class=\"connectDiagramContainer\">\n <slot name=\"connectionLeft\" />\n <slot name=\"connectionRight\" />\n </div>\n )}\n {this.variant === 'failed' && AlertCircle()}\n {this.variant === 'approved' && Checkmark()}\n </div>\n </div>\n <cpsl-text variant=\"headingXS\" color=\"primary\" weight=\"medium\">\n {this.title}\n </cpsl-text>\n {this.subtitle && (\n <cpsl-text variant=\"bodyM\" color=\"secondary\">\n {this.subtitle}\n </cpsl-text>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-hero.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-hero/cpsl-hero.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA0C;IAClD,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,kBAAkB,GAAU,GAAG,EAAE,CAAC;;;;aAI3B,CAAC;AACd,MAAM,eAAe,GAAU,GAAG,EAAE,CAAC,2CAA2C,CAAC;AACjF,MAAM,gBAAgB,GAAU,GAAG,EAAE,CAAC,4CAA4C,CAAC;AACnF,MAAM,cAAc,GAAU,GAAG,EAAE,CAAC,0CAA0C,CAAC;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAU,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,OAAO,GAAU,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,QAAQ,GAAU,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,MAAM,GAAU,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslHero } from './cpsl-hero';\n\nconst meta: Meta<CpslHero & { content?: string }> = {\n title: 'Components/CpslHero',\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslHero & { content?: string }>;\n\nconst ConnectionTemplate: Story = () => `\n<cpsl-hero variant=\"connection\" title=\"Approve Transaction\" subtitle=\"Please review the following transaction details\">\n <cpsl-identicon size={62} hash=\"5yhg423546\" slot=\"connectionLeft\"></cpsl-identicon>\n <cpsl-identicon size={62} hash=\"884884fj4\" slot=\"connectionRight\"></cpsl-identicon>\n</cpsl-hero>`;\nconst PendingTemplate: Story = () => `<cpsl-hero variant=\"pending\"></cpsl-hero>`;\nconst ApprovedTemplate: Story = () => `<cpsl-hero variant=\"approved\"></cpsl-hero>`;\nconst FailedTemplate: Story = () => `<cpsl-hero variant=\"failed\"></cpsl-hero>`;\n\nexport const Connection: Story = ConnectionTemplate.bind({});\nexport const Pending: Story = PendingTemplate.bind({});\nexport const Approved: Story = ApprovedTemplate.bind({});\nexport const Failed: Story = FailedTemplate.bind({});\n"]}
1
+ {"version":3,"file":"cpsl-hero.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-hero/cpsl-hero.stories.tsx"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA0C;IAClD,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,kBAAkB,GAAU,GAAG,EAAE,CAAC;;;;aAI3B,CAAC;AACd,MAAM,eAAe,GAAU,GAAG,EAAE,CAAC,2CAA2C,CAAC;AACjF,MAAM,gBAAgB,GAAU,GAAG,EAAE,CAAC,4CAA4C,CAAC;AACnF,MAAM,cAAc,GAAU,GAAG,EAAE,CAAC,0CAA0C,CAAC;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAU,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,OAAO,GAAU,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,QAAQ,GAAU,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,MAAM,GAAU,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslHero } from './cpsl-hero';\n\nconst meta: Meta<CpslHero & { content?: string }> = {\n title: 'Components/CpslHero',\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslHero & { content?: string }>;\n\nconst ConnectionTemplate: Story = () => `\n<cpsl-hero variant=\"connection\" title=\"Approve Transaction\" subtitle=\"Please review the following transaction details\">\n <cpsl-identicon size={62} hash=\"5yhg423546\" slot=\"connectionLeft\"></cpsl-identicon>\n <cpsl-identicon size={62} hash=\"884884fj4\" slot=\"connectionRight\"></cpsl-identicon>\n</cpsl-hero>`;\nconst PendingTemplate: Story = () => `<cpsl-hero variant=\"pending\"></cpsl-hero>`;\nconst ApprovedTemplate: Story = () => `<cpsl-hero variant=\"approved\"></cpsl-hero>`;\nconst FailedTemplate: Story = () => `<cpsl-hero variant=\"failed\"></cpsl-hero>`;\n\nexport const Connection: Story = ConnectionTemplate.bind({});\nexport const Pending: Story = PendingTemplate.bind({});\nexport const Approved: Story = ApprovedTemplate.bind({});\nexport const Failed: Story = FailedTemplate.bind({});\n"]}
@@ -6,7 +6,7 @@ export class CpslIcon {
6
6
  this.icon = undefined;
7
7
  }
8
8
  render() {
9
- return (h(Host, { key: '91853a486a389f4850a7ae83a25cedba52c645a5', part: "icon", role: "img" }, !Boolean(this.icon) ? h("img", { src: this.src }) : h("div", { innerHTML: Icons[this.icon] })));
9
+ return (h(Host, { key: '6960e6da25cb3cd108021f8a5aa20a92a24f92b3', part: "icon", role: "img" }, !Boolean(this.icon) ? h("img", { src: this.src }) : h("div", { innerHTML: Icons[this.icon] })));
10
10
  }
11
11
  static get is() { return "cpsl-icon"; }
12
12
  static get encapsulation() { return "shadow"; }
@@ -44,7 +44,7 @@ export class CpslIcon {
44
44
  "mutable": false,
45
45
  "complexType": {
46
46
  "original": "IconType",
47
- "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"doubleArc\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"singleArc\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
47
+ "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
48
48
  "references": {
49
49
  "IconType": {
50
50
  "location": "import",
@@ -28,7 +28,7 @@ export class CpslIdenticon {
28
28
  [shapeA, shapeB, shapeC, shapeD],
29
29
  [rotationA, rotationB, rotationC, rotationD],
30
30
  ];
31
- return (h(Host, { key: 'beeaf99134ffc2d93ea5900ee38b26c32afc3a1c', class: {
31
+ return (h(Host, { key: '9e7e42f8de3d9611e30bf8c193d4ff8864805dd9', class: {
32
32
  red: color === 'red',
33
33
  orange: color === 'orange',
34
34
  yellow: color === 'yellow',
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-identicon.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-identicon/cpsl-identicon.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA+C;IACvD,KAAK,EAAE,0BAA0B;IACjC,IAAI,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAU,IAAI,CAAC,EAAE,CAAC,wBAAwB,IAAI,CAAC,IAAI,IAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAU,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslIdenticon } from './cpsl-identicon';\n\nconst meta: Meta<CpslIdenticon & { content?: string }> = {\n title: 'Components/CpslIdenticon',\n args: { hash: 'wruvbwic8932nc4u3cr9394n3cibj3892438cr', size: 40 },\n argTypes: {\n hash: { control: 'text' },\n size: { control: 'number' },\n },\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslIdenticon & { content?: string }>;\n\nconst Template: Story = args => `<cpsl-identicon hash=${args.hash}/>`;\n\nexport const Primary: Story = Template.bind({});\n"]}
1
+ {"version":3,"file":"cpsl-identicon.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-identicon/cpsl-identicon.stories.tsx"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA+C;IACvD,KAAK,EAAE,0BAA0B;IACjC,IAAI,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAU,IAAI,CAAC,EAAE,CAAC,wBAAwB,IAAI,CAAC,IAAI,IAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAU,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslIdenticon } from './cpsl-identicon';\n\nconst meta: Meta<CpslIdenticon & { content?: string }> = {\n title: 'Components/CpslIdenticon',\n args: { hash: 'wruvbwic8932nc4u3cr9394n3cibj3892438cr', size: 40 },\n argTypes: {\n hash: { control: 'text' },\n size: { control: 'number' },\n },\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslIdenticon & { content?: string }>;\n\nconst Template: Story = args => `<cpsl-identicon hash=${args.hash}/>`;\n\nexport const Primary: Story = Template.bind({});\n"]}
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslInfoBox {
3
3
  render() {
4
- return (h(Host, { key: '15b85f109d7e5371f6fa35f38dc35f86a061c46c' }, h("div", { key: '39eae7146dfa17771e1d68045255c9b0db5d0a0c', class: "info-box-container" }, h("slot", { key: '008e3552b563dd2f3b6d10bc7afe59b0f2a2ba3a' }))));
4
+ return (h(Host, { key: '71bc7e0e6976741e4da0fcc6d0135037c416d663' }, h("div", { key: 'd7c1f41e2d60c1e7319ea93b740dc789061f6f2b', class: "info-box-container" }, h("slot", { key: '84681d40c32832a00874901eb9e75679313f2034' }))));
5
5
  }
6
6
  static get is() { return "cpsl-info-box"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -16,6 +16,10 @@ export class CpslInput {
16
16
  this.onBlur = (ev) => {
17
17
  this.hasFocus = false;
18
18
  if (this.focusedValue !== this.value) {
19
+ /**
20
+ * Emits the `cpslChange` event when the input value
21
+ * is different than the value when the input was focused.
22
+ */
19
23
  this.emitValueChange(ev);
20
24
  }
21
25
  this.cpslBlur.emit(ev);
@@ -31,10 +35,13 @@ export class CpslInput {
31
35
  ev.preventDefault();
32
36
  const input = ev.target;
33
37
  const pasteData = ((_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
38
+ // Manually set the value
34
39
  input.value = input.value + pasteData;
35
40
  this.value = this.value + pasteData;
36
41
  pasteData === '' ? this.disableSlots() : this.enableSlots();
42
+ // Emit the cpslPaste event
37
43
  this.cpslPaste.emit(ev);
44
+ // Emit the cpslChange event since the value was modified by paste
38
45
  this.emitInputChange(ev);
39
46
  };
40
47
  this.focusInput = () => {
@@ -78,6 +85,18 @@ export class CpslInput {
78
85
  this.enableSlots();
79
86
  }
80
87
  }
88
+ /**
89
+ * Update the native input element when the value changes
90
+ */
91
+ // @Watch('value')
92
+ // protected valueChanged() {
93
+ // const nativeInput = this.nativeInput;
94
+ // const value = this.value;
95
+ // if (nativeInput && nativeInput.value !== value) {
96
+ // nativeInput.value = value;
97
+ // }
98
+ // Boolean(value) ? this.disableSlots() : this.enableSlots();
99
+ // }
81
100
  componentDidLoad() {
82
101
  this.initButtons();
83
102
  if (Boolean(this.value)) {
@@ -114,12 +133,23 @@ export class CpslInput {
114
133
  });
115
134
  }
116
135
  }
136
+ /**
137
+ * Emits a `cpslInput` event.
138
+ */
117
139
  emitInputChange(event) {
118
140
  this.cpslInput.emit({ value: this.nativeInput.value, event });
119
141
  }
142
+ /**
143
+ * Emits a `cpslChange` event.
144
+ *
145
+ * This API should be called for user committed changes.
146
+ * This API should not be used for external value changes.
147
+ */
120
148
  emitValueChange(event) {
121
149
  const { value } = this;
150
+ // Checks for both null and undefined values
122
151
  const newValue = value == null ? value : value.toString();
152
+ // Emitting a value change should update the internal state for tracking the focused value
123
153
  this.focusedValue = newValue;
124
154
  this.cpslChange.emit({ value: newValue, event });
125
155
  }
@@ -131,7 +161,11 @@ export class CpslInput {
131
161
  }
132
162
  render() {
133
163
  var _a;
134
- return (h(Host, { key: 'c9257766f3dff436dd80db0755994480e803ee36', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (h("label", { class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: 'ae695bceee508db8a4c2ebd6919d6d761d9d3180', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: 'b68c7adeb0e8631f3fb85026df71e9a1f3cb4129', name: "start" }), h("input", { key: '40fc3199639e74f4b481859cb1061f41bdf73e32', class: "native-input", ref: input => (this.nativeInput = input), id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: 'f437ceaa4f50faf59121a97937fc9e91201a3720', name: "end" })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
164
+ return (h(Host, { key: 'fcdf39d74fbf944bfce7aecfcaaa8dea03f08d1b', class: {
165
+ 'disabled': this.disabled,
166
+ 'focused': this.hasFocus,
167
+ 'has-value': Boolean(this.focusedValue) || Boolean(this.value),
168
+ } }, this.label && (h("label", { key: '1925b9b4b93e24681d95911e40ba3a04ab56316e', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '3b06f5daeab283875895ef75fb8b72d495603562', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: '18f58bba907b45c70920f1f0f518df30997f6db6', name: "start" }), h("input", { key: '6dcabf1f887a07c9d1e8349831ab081ba42f597a', class: "native-input", ref: input => (this.nativeInput = input), id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: 'c15f8bc41b7a5f59128c415aa513244d2aa4e057', name: "end" })), (this.errorText || this.helperText) && (h("div", { key: '7d724d32d322c93e0572000376e0e4110537af4d', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '53254d2773c5ec3384e7cdf7de51ae1955564b57' }, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
135
169
  }
136
170
  static get is() { return "cpsl-input"; }
137
171
  static get encapsulation() { return "shadow"; }
@@ -576,7 +610,7 @@ export class CpslInput {
576
610
  "mutable": false,
577
611
  "complexType": {
578
612
  "original": "IconType",
579
- "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"doubleArc\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"singleArc\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
613
+ "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
580
614
  "references": {
581
615
  "IconType": {
582
616
  "location": "import",
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA0RrC,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;YACnC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,EAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n /**\n * Update the native input element when the value changes\n */\n // @Watch('value')\n // protected valueChanged() {\n // const nativeInput = this.nativeInput;\n // const value = this.value;\n // if (nativeInput && nativeInput.value !== value) {\n // nativeInput.value = value;\n // }\n // Boolean(value) ? this.disableSlots() : this.enableSlots();\n // }\n\n componentDidLoad() {\n this.initButtons();\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.nativeInput.value, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value\n input.value = input.value + pasteData;\n this.value = this.value + pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
1
+ {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAIZ,YAA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I,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n /**\n * Update the native input element when the value changes\n */\n // @Watch('value')\n // protected valueChanged() {\n // const nativeInput = this.nativeInput;\n // const value = this.value;\n // if (nativeInput && nativeInput.value !== value) {\n // nativeInput.value = value;\n // }\n // Boolean(value) ? this.disableSlots() : this.enableSlots();\n // }\n\n componentDidLoad() {\n this.initButtons();\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.nativeInput.value, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value\n input.value = input.value + pasteData;\n this.value = this.value + pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host\n class={{\n 'disabled': this.disabled,\n 'focused': this.hasFocus,\n 'has-value': Boolean(this.focusedValue) || Boolean(this.value),\n }}\n >\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -156,7 +156,7 @@ export class CpslModal {
156
156
  liveSnap: {
157
157
  y: function (y) {
158
158
  if (y < 0)
159
- return 0;
159
+ return 0; // Restricts dragging to down
160
160
  return y;
161
161
  },
162
162
  },