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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (445) hide show
  1. package/css/capsule-core.css +25 -10
  2. package/css/capsule-core.css.map +1 -1
  3. package/dist/capsule/capsule.esm.js +1 -1
  4. package/dist/capsule/capsule.esm.js.map +1 -1
  5. package/dist/capsule/index.esm.js +1 -1
  6. package/dist/capsule/index.esm.js.map +1 -1
  7. package/dist/capsule/{p-a6aaf3f4.entry.js → p-0e558c7f.entry.js} +3 -3
  8. package/dist/capsule/p-0e558c7f.entry.js.map +1 -0
  9. package/dist/capsule/{p-452b9998.entry.js → p-1bd11889.entry.js} +2 -2
  10. package/dist/capsule/p-1bd11889.entry.js.map +1 -0
  11. package/dist/capsule/p-32cdf894.entry.js +2 -0
  12. package/dist/capsule/p-32cdf894.entry.js.map +1 -0
  13. package/dist/capsule/p-3b042fd1.entry.js +2 -0
  14. package/dist/capsule/{p-6793ef7a.entry.js.map → p-3b042fd1.entry.js.map} +1 -1
  15. package/dist/capsule/{p-b976b6f0.entry.js → p-41bc3c58.entry.js} +2 -2
  16. package/dist/capsule/{p-b976b6f0.entry.js.map → p-41bc3c58.entry.js.map} +1 -1
  17. package/dist/capsule/p-5965b15e.entry.js +2 -0
  18. package/dist/capsule/{p-f6c74d69.entry.js.map → p-5965b15e.entry.js.map} +1 -1
  19. package/dist/capsule/{p-447d49b9.entry.js → p-5d62e610.entry.js} +2 -2
  20. package/dist/capsule/{p-447d49b9.entry.js.map → p-5d62e610.entry.js.map} +1 -1
  21. package/dist/capsule/p-60508b1e.entry.js +20 -0
  22. package/dist/capsule/p-60508b1e.entry.js.map +1 -0
  23. package/dist/capsule/{p-6dcaee48.entry.js → p-de2a16e4.entry.js} +2 -2
  24. package/dist/capsule/{p-6dcaee48.entry.js.map → p-de2a16e4.entry.js.map} +1 -1
  25. package/dist/capsule/p-e1255160.js.map +1 -1
  26. package/dist/capsule/p-f2393be6.js.map +1 -1
  27. package/dist/capsule/p-fa6b7678.js +3 -0
  28. package/dist/capsule/p-fa6b7678.js.map +1 -0
  29. package/dist/cjs/capsule.cjs.js +10 -10
  30. package/dist/cjs/capsule.cjs.js.map +1 -1
  31. package/dist/cjs/cpsl-alert_34.cjs.entry.js +17036 -13428
  32. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -1
  33. package/dist/cjs/cpsl-animation.cjs.entry.js +8 -4
  34. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  35. package/dist/cjs/cpsl-col.cjs.entry.js +25 -6
  36. package/dist/cjs/cpsl-col.cjs.entry.js.map +1 -1
  37. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  38. package/dist/cjs/cpsl-hero.cjs.entry.js +38 -0
  39. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -0
  40. package/dist/cjs/cpsl-identicon.cjs.entry.js +2 -2
  41. package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
  42. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  43. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +3 -2
  44. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  45. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  46. package/dist/cjs/index-65f57499.js +1439 -0
  47. package/dist/cjs/index-65f57499.js.map +1 -0
  48. package/dist/cjs/index.cjs.js +47 -16
  49. package/dist/cjs/index.cjs.js.map +1 -1
  50. package/dist/cjs/loader.cjs.js +2 -2
  51. package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
  52. package/dist/collection/assets/icons/bank.svg +3 -0
  53. package/dist/collection/assets/icons/credit-card.svg +3 -0
  54. package/dist/collection/assets/icons/dot.svg +3 -0
  55. package/dist/collection/assets/icons/download.svg +3 -0
  56. package/dist/collection/assets/icons/globe.svg +3 -0
  57. package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
  58. package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
  59. package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
  60. package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
  61. package/dist/collection/assets/icons/index.js +21 -3
  62. package/dist/collection/assets/icons/index.js.map +1 -1
  63. package/dist/collection/assets/icons/link-external.svg +3 -0
  64. package/dist/collection/assets/icons/log-out.svg +3 -0
  65. package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
  66. package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
  67. package/dist/collection/assets/icons/qr-code-02.svg +3 -0
  68. package/dist/collection/assets/icons/qr-code.svg +3 -0
  69. package/dist/collection/assets/icons/refresh.svg +3 -3
  70. package/dist/collection/assets/icons/search.svg +3 -0
  71. package/dist/collection/assets/icons/send.svg +3 -0
  72. package/dist/collection/assets/icons/shield.svg +3 -0
  73. package/dist/collection/assets/icons/stripe-brand.svg +3 -0
  74. package/dist/collection/collection-manifest.json +4 -3
  75. package/dist/collection/components/cpsl-alert/cpsl-alert.js +3 -3
  76. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  77. package/dist/collection/components/cpsl-animation/cpsl-animation.js +4 -1
  78. package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -1
  79. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +5 -2
  80. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  81. package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
  82. package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +13 -131
  83. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
  84. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  85. package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
  86. package/dist/collection/components/cpsl-button/cpsl-button.js +9 -5
  87. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  88. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +2 -2
  89. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -1
  90. package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
  91. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  92. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  93. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
  94. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +13 -7
  95. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  96. package/dist/collection/components/cpsl-col/cpsl-col.js +21 -5
  97. package/dist/collection/components/cpsl-col/cpsl-col.js.map +1 -1
  98. package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
  99. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  100. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +3 -2
  101. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  102. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  103. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  104. package/dist/collection/components/cpsl-dropdown/dropdown-interface.js.map +1 -1
  105. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +5 -5
  106. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  107. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  108. package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
  109. package/dist/collection/components/cpsl-hero/cpsl-hero.js +64 -9
  110. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  111. package/dist/collection/components/cpsl-hero/cpsl-hero.stories.js.map +1 -1
  112. package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
  113. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  114. package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
  115. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
  116. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
  117. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
  118. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  119. package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js.map +1 -1
  120. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
  121. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  122. package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
  123. package/dist/collection/components/cpsl-input/cpsl-input.js +117 -11
  124. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  125. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +2 -1
  126. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  127. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +2 -2
  128. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -1
  129. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +2 -1
  130. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  131. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  132. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -1
  133. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  134. package/dist/collection/components/cpsl-popover/cpsl-popover.css +2 -0
  135. package/dist/collection/components/cpsl-popover/cpsl-popover.js +16 -6
  136. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  137. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
  138. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
  139. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  140. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  141. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  142. package/dist/collection/components/cpsl-select/cpsl-select.css +17 -0
  143. package/dist/collection/components/cpsl-select/cpsl-select.js +96 -4
  144. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  145. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  146. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
  147. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +14 -3
  148. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  149. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
  150. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
  151. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
  152. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  153. package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
  154. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  155. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  156. package/dist/collection/components/cpsl-table/cpsl-table.js +3 -1
  157. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  158. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
  159. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +5 -2
  160. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  161. package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
  162. package/dist/collection/components/cpsl-text/cpsl-text.js +7 -3
  163. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  164. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
  165. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  166. package/dist/collection/interface.js.map +1 -1
  167. package/dist/collection/utils/media.js +3 -0
  168. package/dist/collection/utils/media.js.map +1 -1
  169. package/dist/collection/utils/theme/generateBorderRadii.js +4 -3
  170. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  171. package/dist/collection/utils/theme/generateFont.js +1 -1
  172. package/dist/collection/utils/theme/generateFont.js.map +1 -1
  173. package/dist/collection/utils/theme/generatePalette.js +28 -9
  174. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  175. package/dist/collection/utils/theme/generateTheme.js +13 -3
  176. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  177. package/dist/collection/utils/theme/utils.js +1 -0
  178. package/dist/collection/utils/theme/utils.js.map +1 -1
  179. package/dist/esm/capsule.js +11 -11
  180. package/dist/esm/capsule.js.map +1 -1
  181. package/dist/esm/cpsl-alert_34.entry.js +17036 -13428
  182. package/dist/esm/cpsl-alert_34.entry.js.map +1 -1
  183. package/dist/esm/cpsl-animation.entry.js +7 -3
  184. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  185. package/dist/esm/cpsl-col.entry.js +25 -6
  186. package/dist/esm/cpsl-col.entry.js.map +1 -1
  187. package/dist/esm/cpsl-grid.entry.js +3 -3
  188. package/dist/esm/cpsl-hero.entry.js +34 -0
  189. package/dist/esm/cpsl-hero.entry.js.map +1 -0
  190. package/dist/esm/cpsl-identicon.entry.js +2 -2
  191. package/dist/esm/cpsl-info-box.entry.js +3 -3
  192. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  193. package/dist/esm/cpsl-modal-v2.entry.js +3 -2
  194. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  195. package/dist/esm/cpsl-row.entry.js +2 -2
  196. package/dist/esm/index-91db3414.js +1408 -0
  197. package/dist/esm/index-91db3414.js.map +1 -0
  198. package/dist/esm/index.js +47 -16
  199. package/dist/esm/index.js.map +1 -1
  200. package/dist/esm/loader.js +3 -3
  201. package/dist/loader/cdn.js +1 -3
  202. package/dist/loader/index.cjs.js +1 -3
  203. package/dist/loader/index.d.ts +3 -0
  204. package/dist/loader/index.es2017.js +1 -3
  205. package/dist/loader/index.js +1 -3
  206. package/dist/scripts/buildAssets.js +1 -1
  207. package/dist/types/assets/icons/index.d.ts +20 -2
  208. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +8 -0
  209. package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +6 -0
  210. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +10 -0
  211. package/dist/types/components/cpsl-auth-modal/cpsl-auth-modal.d.ts +58 -0
  212. package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +11 -0
  213. package/dist/types/components/cpsl-button/cpsl-button.d.ts +30 -1
  214. package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +3 -0
  215. package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +6 -0
  216. package/dist/types/components/cpsl-code-input/cpsl-code-input.d.ts +19 -0
  217. package/dist/types/components/cpsl-col/cpsl-col.d.ts +96 -0
  218. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +31 -0
  219. package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +15 -0
  220. package/dist/types/components/cpsl-dropdown/dropdown-interface.d.ts +1 -1
  221. package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +43 -0
  222. package/dist/types/components/cpsl-grid/cpsl-grid.d.ts +3 -0
  223. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +21 -1
  224. package/dist/types/components/cpsl-icon/cpsl-icon.d.ts +6 -0
  225. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
  226. package/dist/types/components/cpsl-identicon/cpsl-identicon.d.ts +4 -0
  227. package/dist/types/components/cpsl-input/cpsl-input.d.ts +148 -0
  228. package/dist/types/components/cpsl-input/input-interface.d.ts +5 -0
  229. package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +32 -0
  230. package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +3 -0
  231. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +14 -0
  232. package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +15 -0
  233. package/dist/types/components/cpsl-pill/cpsl-pill.d.ts +3 -0
  234. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +53 -0
  235. package/dist/types/components/cpsl-progress-indicator/cpsl-progress-indicator.d.ts +6 -0
  236. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +11 -0
  237. package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +6 -0
  238. package/dist/types/components/cpsl-select/cpsl-select.d.ts +67 -1
  239. package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +10 -0
  240. package/dist/types/components/cpsl-slide-button/cpsl-slide-button.d.ts +18 -0
  241. package/dist/types/components/cpsl-spinner/cpsl-spinner.d.ts +8 -0
  242. package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +6 -0
  243. package/dist/types/components/cpsl-tab/cpsl-tab.d.ts +11 -0
  244. package/dist/types/components/cpsl-tabs/cpsl-tabs.d.ts +13 -0
  245. package/dist/types/components/cpsl-text/cpsl-text.d.ts +16 -1
  246. package/dist/types/components/cpsl-tile-button/cpsl-tile-button.d.ts +6 -0
  247. package/dist/types/components.d.ts +216 -118
  248. package/dist/types/interface.d.ts +13 -0
  249. package/dist/types/stencil-public-runtime.d.ts +3 -10
  250. package/dist/types/utils/theme/generatePalette.d.ts +4 -2
  251. package/dist/types/utils/theme/generateTheme.d.ts +5 -1
  252. package/package.json +6 -12
  253. package/readme.md +47 -2
  254. package/dist/capsule/p-0462f723.js +0 -2
  255. package/dist/capsule/p-0462f723.js.map +0 -1
  256. package/dist/capsule/p-303e6e89.entry.js +0 -29
  257. package/dist/capsule/p-303e6e89.entry.js.map +0 -1
  258. package/dist/capsule/p-452b9998.entry.js.map +0 -1
  259. package/dist/capsule/p-6793ef7a.entry.js +0 -2
  260. package/dist/capsule/p-7dde3172.js +0 -3
  261. package/dist/capsule/p-7dde3172.js.map +0 -1
  262. package/dist/capsule/p-a6aaf3f4.entry.js.map +0 -1
  263. package/dist/capsule/p-f6c74d69.entry.js +0 -2
  264. package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
  265. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  266. package/dist/cjs/index-528f7428.js +0 -2107
  267. package/dist/cjs/index-528f7428.js.map +0 -1
  268. package/dist/collection/assets/icons/double-arc.svg +0 -13
  269. package/dist/collection/assets/icons/single-arc.svg +0 -11
  270. package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js +0 -29
  271. package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js.map +0 -1
  272. package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js +0 -37
  273. package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js.map +0 -1
  274. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +0 -29
  275. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +0 -1
  276. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +0 -37
  277. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +0 -1
  278. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +0 -29
  279. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +0 -1
  280. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +0 -37
  281. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +0 -1
  282. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +0 -29
  283. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +0 -1
  284. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +0 -37
  285. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +0 -1
  286. package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js +0 -29
  287. package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js.map +0 -1
  288. package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js +0 -37
  289. package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js.map +0 -1
  290. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +0 -29
  291. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +0 -1
  292. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +0 -37
  293. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +0 -1
  294. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +0 -29
  295. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +0 -1
  296. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +0 -37
  297. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +0 -1
  298. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +0 -29
  299. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +0 -1
  300. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +0 -37
  301. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +0 -1
  302. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js +0 -29
  303. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js.map +0 -1
  304. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js +0 -37
  305. package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js.map +0 -1
  306. package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js +0 -29
  307. package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js.map +0 -1
  308. package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js +0 -37
  309. package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js.map +0 -1
  310. package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js +0 -29
  311. package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js.map +0 -1
  312. package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js +0 -37
  313. package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js.map +0 -1
  314. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +0 -29
  315. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +0 -1
  316. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +0 -37
  317. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +0 -1
  318. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js +0 -29
  319. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js.map +0 -1
  320. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js +0 -37
  321. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js.map +0 -1
  322. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +0 -29
  323. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +0 -1
  324. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +0 -37
  325. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +0 -1
  326. package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js +0 -29
  327. package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js.map +0 -1
  328. package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js +0 -37
  329. package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js.map +0 -1
  330. package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js +0 -29
  331. package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js.map +0 -1
  332. package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js +0 -37
  333. package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js.map +0 -1
  334. package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js +0 -29
  335. package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js.map +0 -1
  336. package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js +0 -37
  337. package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js.map +0 -1
  338. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js +0 -29
  339. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js.map +0 -1
  340. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js +0 -37
  341. package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js.map +0 -1
  342. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js +0 -29
  343. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js.map +0 -1
  344. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js +0 -37
  345. package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js.map +0 -1
  346. package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js +0 -29
  347. package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js.map +0 -1
  348. package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js +0 -37
  349. package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js.map +0 -1
  350. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
  351. package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js +0 -29
  352. package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js.map +0 -1
  353. package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js +0 -37
  354. package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js.map +0 -1
  355. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +0 -29
  356. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +0 -1
  357. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +0 -37
  358. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +0 -1
  359. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +0 -29
  360. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +0 -1
  361. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +0 -37
  362. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +0 -1
  363. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js +0 -29
  364. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js.map +0 -1
  365. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js +0 -37
  366. package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js.map +0 -1
  367. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +0 -29
  368. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +0 -1
  369. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +0 -37
  370. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +0 -1
  371. package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js +0 -29
  372. package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js.map +0 -1
  373. package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js +0 -37
  374. package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js.map +0 -1
  375. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +0 -29
  376. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +0 -1
  377. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +0 -37
  378. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +0 -1
  379. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js +0 -29
  380. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js.map +0 -1
  381. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js +0 -37
  382. package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js.map +0 -1
  383. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js +0 -29
  384. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js.map +0 -1
  385. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js +0 -37
  386. package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js.map +0 -1
  387. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +0 -29
  388. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +0 -1
  389. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +0 -37
  390. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +0 -1
  391. package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js +0 -29
  392. package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js.map +0 -1
  393. package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js +0 -37
  394. package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js.map +0 -1
  395. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +0 -29
  396. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +0 -1
  397. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +0 -37
  398. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +0 -1
  399. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +0 -29
  400. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +0 -1
  401. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +0 -37
  402. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +0 -1
  403. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js +0 -29
  404. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js.map +0 -1
  405. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js +0 -37
  406. package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js.map +0 -1
  407. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js +0 -29
  408. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js.map +0 -1
  409. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js +0 -37
  410. package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js.map +0 -1
  411. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +0 -29
  412. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +0 -1
  413. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +0 -37
  414. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +0 -1
  415. package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js +0 -29
  416. package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js.map +0 -1
  417. package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js +0 -37
  418. package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js.map +0 -1
  419. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +0 -29
  420. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +0 -1
  421. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +0 -37
  422. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +0 -1
  423. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js +0 -29
  424. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js.map +0 -1
  425. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js +0 -37
  426. package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js.map +0 -1
  427. package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js +0 -29
  428. package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js.map +0 -1
  429. package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js +0 -37
  430. package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js.map +0 -1
  431. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js +0 -29
  432. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js.map +0 -1
  433. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js +0 -37
  434. package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js.map +0 -1
  435. package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
  436. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  437. package/dist/esm/index-b188f201.js +0 -2076
  438. package/dist/esm/index-b188f201.js.map +0 -1
  439. package/dist/esm/polyfills/core-js.js +0 -11
  440. package/dist/esm/polyfills/dom.js +0 -79
  441. package/dist/esm/polyfills/es5-html-element.js +0 -1
  442. package/dist/esm/polyfills/index.js +0 -34
  443. package/dist/esm/polyfills/system.js +0 -6
  444. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +0 -39
  445. /package/dist/types/Users/{briancorbin/Documents/Programming/Capsule/component-library/core → norwood/capsule-repos/web-sdk/packages/core-components}/.stencil/scripts/buildAssets.d.ts +0 -0
@@ -28,7 +28,7 @@ export class CpslSelect {
28
28
  item.setAttribute('selected', 'false');
29
29
  }
30
30
  });
31
- if (!Boolean(this.selectedValue)) {
31
+ if (!this.selectedValue) {
32
32
  this.hasSelectedItem = false;
33
33
  }
34
34
  };
@@ -48,6 +48,8 @@ export class CpslSelect {
48
48
  this.hasFocus = false;
49
49
  this.popoverOpen = false;
50
50
  this.hasSelectedItem = false;
51
+ this.anchorElId = undefined;
52
+ this.autoWidth = false;
51
53
  this.disabled = false;
52
54
  this.dropdownMaxHeight = undefined;
53
55
  this.errorText = undefined;
@@ -60,6 +62,8 @@ export class CpslSelect {
60
62
  this.selectedValue = undefined;
61
63
  this.showFormattedSelectedItem = undefined;
62
64
  this.showOptionalLabel = false;
65
+ this.showSearch = false;
66
+ this.searchPlaceholder = undefined;
63
67
  }
64
68
  onValueChange() {
65
69
  this.popoverEl.closePopover();
@@ -78,12 +82,15 @@ export class CpslSelect {
78
82
  }
79
83
  componentDidLoad() {
80
84
  this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`);
81
- this.anchorEl = this.el.shadowRoot.getElementById('select-container');
85
+ this.anchorEl = this.anchorElId ? document.getElementById(this.anchorElId) : this.el.shadowRoot.getElementById('select-container');
82
86
  this.selectItem();
83
87
  }
84
88
  render() {
85
- var _a, _b, _c, _d;
86
- return (h(Host, { key: '3d3f052d6702fc9b74b03fc55b2766eec299c449', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) } }, 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: '90ef0cd5ae49233665debddbfe9dd096e6434374', id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && h("slot", { name: "selected-item" }), h("div", { key: '6bee82c04abdfc2ad735f63e2ab793304fb6996a', class: "selected-container-content", id: "selected-container-content" }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (h("cpsl-text", { class: { 'selected-text': true, 'placeholder': !Boolean(this.selectedValue) } }, !Boolean(this.selectedValue) ? (_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select' : (_c = (_b = this.formatValue) === null || _b === void 0 ? void 0 : _b.call(this, this.selectedValue)) !== null && _c !== void 0 ? _c : this.selectedValue))), h("cpsl-icon", { key: 'f74f7d8b6201ba9032d5e1ccd75c487f0e4251bb', class: { 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }, icon: "chevronUp" }), h("input", { key: '0f14ad55bc376590da75f5e4f8664f9fcb893c6d', id: this.inputId, disabled: this.disabled, class: { disabled: this.disabled }, value: this.selectedValue, onFocus: this.onFocus, onBlur: this.onBlur, onKeyPress: this.handleEnterPress, inputmode: "none" })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", null, (_d = this.errorText) !== null && _d !== void 0 ? _d : this.helperText))), h("cpsl-popover", { key: 'df6d347b953633d1f8ecb71d4ee5767da4ddb223', autoWidth: false, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, h("div", { key: '524ffcfc61bcba174422770542516028ee37ad48', class: "dropdown" }, h("div", { key: 'fb72dace14c9dd43b48654e22bb268b2ffb06876', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, h("slot", { key: 'a67f1f8ebcb08b0827dbff2e2a5896cf707d6182', name: "items" }))))));
89
+ var _a, _b, _c, _d, _e;
90
+ return (h(Host, { key: '72be0f8b2d2eb537dc174bdc74aafa9b3c5a80e6', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) } }, this.label && (h("label", { key: '95a25acd1fad10b5ce01be175f5469468dbe5cdb', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '1f19b97f0d973264a9fa4c814b43095249496431', id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && h("slot", { key: '325527b35284e3058551175b2c392be1557a1a5e', name: "selected-item" }), h("div", { key: '4da5f55d383ee4725f81bd6d9d174c9231d74f1a', class: { 'selected-container-content': true, 'hidden': this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (h("cpsl-text", { key: 'bc83e992888ae73bc863d96ef11d2b849a6f60f8', class: { 'selected-text': true, 'placeholder': !this.selectedValue } }, !this.selectedValue ? ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select') : ((_c = (_b = this.formatValue) === null || _b === void 0 ? void 0 : _b.call(this, this.selectedValue)) !== null && _c !== void 0 ? _c : this.selectedValue)))), h("cpsl-icon", { key: 'f96b40c6101c561b1e7cc605f157697209dd1e59', class: { 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }, icon: "chevronUp" }), h("input", { key: '8f660d9215da0960eb4ca37292fd4c400b65de77', id: this.inputId, disabled: this.disabled, class: { disabled: this.disabled }, value: this.selectedValue, onFocus: this.onFocus, onBlur: this.onBlur, onKeyPress: this.handleEnterPress, inputmode: "none" })), (this.errorText || this.helperText) && (h("div", { key: '26eacb913e1d727ada026ef75a9d7d96478bae9b', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '3ec7937586e52f0858c2e4595596349d8ae4a57d' }, (_d = this.errorText) !== null && _d !== void 0 ? _d : this.helperText))), h("cpsl-popover", { key: '746e0d3b68f1f550c44cdb00f1a846209b34957d', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, h("div", { key: 'c1ec487ab2857c0613f3748123d25da32793a008', part: "dropdown", class: "dropdown" }, this.showSearch && (h("div", { key: '342450b93fa5b20d7663c8390ed006921e77b9d4', class: "search-container" }, h("cpsl-input", { key: 'a72472c811025a6d60e4c9bebe37fe7b56707f5d', onClick: e => e.stopPropagation(), placeholder: (_e = this.searchPlaceholder) !== null && _e !== void 0 ? _e : 'Search', value: "", onCpslInput: e => {
91
+ e.stopPropagation();
92
+ this.cpslSearchChange.emit(e.detail.value);
93
+ } }))), h("div", { key: 'c6977cc371d4fb6fce0162d983c53a15dce89590', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, h("slot", { key: 'b867d8f557e56105b7a5c7a5f84d26ef3fd25ac5', name: "items" }))))));
87
94
  }
88
95
  static get is() { return "cpsl-select"; }
89
96
  static get encapsulation() { return "shadow"; }
@@ -99,6 +106,41 @@ export class CpslSelect {
99
106
  }
100
107
  static get properties() {
101
108
  return {
109
+ "anchorElId": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": true,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "ID of element to anchor popover to."
122
+ },
123
+ "attribute": "anchor-el-id",
124
+ "reflect": false
125
+ },
126
+ "autoWidth": {
127
+ "type": "boolean",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": true,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "If `true` the popover container will use the width of the content, else it will be set to the width of the trigger.\nDefault is `false`"
139
+ },
140
+ "attribute": "auto-width",
141
+ "reflect": false,
142
+ "defaultValue": "false"
143
+ },
102
144
  "disabled": {
103
145
  "type": "boolean",
104
146
  "mutable": false,
@@ -304,6 +346,41 @@ export class CpslSelect {
304
346
  "attribute": "show-optional-label",
305
347
  "reflect": false,
306
348
  "defaultValue": "false"
349
+ },
350
+ "showSearch": {
351
+ "type": "boolean",
352
+ "mutable": false,
353
+ "complexType": {
354
+ "original": "boolean",
355
+ "resolved": "boolean",
356
+ "references": {}
357
+ },
358
+ "required": false,
359
+ "optional": false,
360
+ "docs": {
361
+ "tags": [],
362
+ "text": "If `true`, the dropdown will contain a search field."
363
+ },
364
+ "attribute": "show-search",
365
+ "reflect": false,
366
+ "defaultValue": "false"
367
+ },
368
+ "searchPlaceholder": {
369
+ "type": "string",
370
+ "mutable": false,
371
+ "complexType": {
372
+ "original": "string",
373
+ "resolved": "string",
374
+ "references": {}
375
+ },
376
+ "required": false,
377
+ "optional": true,
378
+ "docs": {
379
+ "tags": [],
380
+ "text": "Placeholder for the search field."
381
+ },
382
+ "attribute": "search-placeholder",
383
+ "reflect": false
307
384
  }
308
385
  };
309
386
  }
@@ -371,6 +448,21 @@ export class CpslSelect {
371
448
  "resolved": "string",
372
449
  "references": {}
373
450
  }
451
+ }, {
452
+ "method": "cpslSearchChange",
453
+ "name": "cpslSearchChange",
454
+ "bubbles": true,
455
+ "cancelable": true,
456
+ "composed": true,
457
+ "docs": {
458
+ "tags": [],
459
+ "text": "Emitted when the search value changes."
460
+ },
461
+ "complexType": {
462
+ "original": "string",
463
+ "resolved": "string",
464
+ "references": {}
465
+ }
374
466
  }];
375
467
  }
376
468
  static get elementRef() { return "el"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-select.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select/cpsl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO7G,MAAM,OAAO,UAAU;;QAGb,YAAO,GAAG,eAAe,QAAQ,EAAE,EAAE,CAAC;QAmHtC,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAE9B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC;QAEM,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YAErB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC;QAEM,qBAAgB,GAAG,CAAC,EAAiB,EAAE,EAAE;YAC/C,IAAI,EAAE,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBACvB,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAA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ent":["import { Component, Host, Element, h, Prop, State, EventEmitter, Event, Watch, Listen } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select',\n styleUrl: 'cpsl-select.scss',\n shadow: true,\n})\nexport class CpslSelect {\n @Element() el!: HTMLCpslSelectElement;\n private popoverEl!: HTMLCpslPopoverElement;\n private inputId = `cpsl-select-${inputIds++}`;\n\n @State() anchorEl!: HTMLDivElement;\n @State() hasFocus = false;\n @State() popoverOpen = false;\n @State() hasSelectedItem = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * Set the max height of the dropdown.\n */\n @Prop() dropdownMaxHeight?: number;\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 * Format value for display when selected.\n */\n @Prop() formatValue?: (value: string) => 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 * ID of the element, must be unique for the popover trigger.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() id: string = `${this.inputId}-trigger`;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * Placeholder to display if `selectedValue` is empty.\n */\n @Prop() placeholder?: 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 * Value of the selected item.\n */\n @Prop() selectedValue?: string;\n\n /**\n * Will show the formatted selected item (passed in the `selected-item` slot) in the select rather than the item value.\n */\n @Prop() showFormattedSelectedItem?: boolean;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\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 the value changes.\n */\n @Event() cpslSelectValueChange!: EventEmitter<string>;\n\n @Watch('selectedValue')\n onValueChange() {\n this.popoverEl.closePopover();\n }\n\n @Watch('selectedValue')\n handleValueChange() {\n this.selectItem();\n }\n\n @Listen('cpslSelectItemClick')\n selectItemClickHandler(event: CustomEvent<string>) {\n this.cpslSelectValueChange.emit(event.detail);\n }\n\n @Listen('cpslOpen')\n onPopoverOpen() {\n this.popoverOpen = true;\n }\n\n @Listen('cpslClose')\n onPopoverClose() {\n this.popoverOpen = false;\n }\n\n componentDidLoad() {\n this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`) as HTMLCpslPopoverElement;\n this.anchorEl = this.el.shadowRoot.getElementById('select-container') as HTMLDivElement;\n\n this.selectItem();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n this.popoverEl.closePopover();\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n\n this.cpslFocus.emit(ev);\n };\n\n private handleEnterPress = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter') {\n ev.preventDefault();\n this.el.dispatchEvent(new MouseEvent('mousedown'));\n }\n };\n\n private selectItem = () => {\n const items = Array.from(this.el.querySelectorAll('cpsl-select-item')) as HTMLCpslSelectItemElement[];\n\n items.forEach(item => {\n if (item.value === this.selectedValue) {\n item.setAttribute('selected', 'true');\n this.hasSelectedItem = true;\n } else {\n item.setAttribute('selected', 'false');\n }\n });\n\n if (!Boolean(this.selectedValue)) {\n this.hasSelectedItem = false;\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.hasFocus && !this.el.contains(event.target as Node)) {\n this.hasFocus = false;\n window.removeEventListener('click', this.handleClickOutside);\n }\n };\n\n private handleClick = () => {\n if (!this.disabled) {\n this.hasFocus = true;\n window.addEventListener('click', this.handleClickOutside);\n }\n };\n\n render() {\n return (\n <Host id={this.id} class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) }}>\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 id=\"select-container\" class={{ 'select-container': true, 'error-container': Boolean(this.errorText) }} onMouseDown={this.handleClick}>\n {this.hasSelectedItem && this.showFormattedSelectedItem && <slot name=\"selected-item\"></slot>}\n <div class=\"selected-container-content\" id=\"selected-container-content\">\n {(!this.hasSelectedItem || !this.showFormattedSelectedItem) && (\n <cpsl-text class={{ 'selected-text': true, 'placeholder': !Boolean(this.selectedValue) }}>\n {!Boolean(this.selectedValue) ? this.placeholder ?? 'Select' : this.formatValue?.(this.selectedValue) ?? this.selectedValue}\n </cpsl-text>\n )}\n </div>\n <cpsl-icon class={{ 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }} icon=\"chevronUp\" />\n <input\n id={this.inputId}\n disabled={this.disabled}\n class={{ disabled: this.disabled }}\n value={this.selectedValue}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyPress={this.handleEnterPress}\n inputmode=\"none\"\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 <cpsl-popover autoWidth={false} trigger={this.id} preventBlur={this.hasFocus} disabled={this.disabled} anchorEl={this.anchorEl}>\n <div class=\"dropdown\">\n <div class=\"dropdown-inner\" style={{ maxHeight: `${this.dropdownMaxHeight}px` }}>\n <slot name=\"items\"></slot>\n </div>\n </div>\n </cpsl-popover>\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
1
+ {"version":3,"file":"cpsl-select.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select/cpsl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Element, h, Prop, State, EventEmitter, Event, Watch, Listen } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select',\n styleUrl: 'cpsl-select.scss',\n shadow: true,\n})\nexport class CpslSelect {\n @Element() el!: HTMLCpslSelectElement;\n private popoverEl!: HTMLCpslPopoverElement;\n private inputId = `cpsl-select-${inputIds++}`;\n\n @State() anchorEl!: HTMLElement;\n @State() hasFocus = false;\n @State() popoverOpen = false;\n @State() hasSelectedItem = false;\n\n /**\n * ID of element to anchor popover to.\n */\n @Prop() anchorElId?: string;\n\n /**\n * If `true` the popover container will use the width of the content, else it will be set to the width of the trigger.\n * Default is `false`\n */\n @Prop() autoWidth?: boolean = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * Set the max height of the dropdown.\n */\n @Prop() dropdownMaxHeight?: number;\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 * Format value for display when selected.\n */\n @Prop() formatValue?: (value: string) => 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 * ID of the element, must be unique for the popover trigger.\n */\n\n @Prop() id: string = `${this.inputId}-trigger`;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * Placeholder to display if `selectedValue` is empty.\n */\n @Prop() placeholder?: 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 * Value of the selected item.\n */\n @Prop() selectedValue?: string;\n\n /**\n * Will show the formatted selected item (passed in the `selected-item` slot) in the select rather than the item value.\n */\n @Prop() showFormattedSelectedItem?: boolean;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the dropdown will contain a search field.\n */\n @Prop() showSearch = false;\n\n /**\n * Placeholder for the search field.\n */\n @Prop() searchPlaceholder?: string;\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 the value changes.\n */\n @Event() cpslSelectValueChange!: EventEmitter<string>;\n\n /**\n * Emitted when the search value changes.\n */\n @Event() cpslSearchChange!: EventEmitter<string>;\n\n @Watch('selectedValue')\n onValueChange() {\n this.popoverEl.closePopover();\n }\n\n @Watch('selectedValue')\n handleValueChange() {\n this.selectItem();\n }\n\n @Listen('cpslSelectItemClick')\n selectItemClickHandler(event: CustomEvent<string>) {\n this.cpslSelectValueChange.emit(event.detail);\n }\n\n @Listen('cpslOpen')\n onPopoverOpen() {\n this.popoverOpen = true;\n }\n\n @Listen('cpslClose')\n onPopoverClose() {\n this.popoverOpen = false;\n }\n\n componentDidLoad() {\n this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`) as HTMLCpslPopoverElement;\n this.anchorEl = this.anchorElId ? document.getElementById(this.anchorElId) : this.el.shadowRoot.getElementById('select-container');\n\n this.selectItem();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n this.popoverEl.closePopover();\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n\n this.cpslFocus.emit(ev);\n };\n\n private handleEnterPress = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter') {\n ev.preventDefault();\n this.el.dispatchEvent(new MouseEvent('mousedown'));\n }\n };\n\n private selectItem = () => {\n const items = Array.from(this.el.querySelectorAll('cpsl-select-item')) as HTMLCpslSelectItemElement[];\n\n items.forEach(item => {\n if (item.value === this.selectedValue) {\n item.setAttribute('selected', 'true');\n this.hasSelectedItem = true;\n } else {\n item.setAttribute('selected', 'false');\n }\n });\n\n if (!this.selectedValue) {\n this.hasSelectedItem = false;\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.hasFocus && !this.el.contains(event.target as Node)) {\n this.hasFocus = false;\n window.removeEventListener('click', this.handleClickOutside);\n }\n };\n\n private handleClick = () => {\n if (!this.disabled) {\n this.hasFocus = true;\n window.addEventListener('click', this.handleClickOutside);\n }\n };\n\n render() {\n return (\n <Host id={this.id} class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) }}>\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 id=\"select-container\" class={{ 'select-container': true, 'error-container': Boolean(this.errorText) }} onMouseDown={this.handleClick}>\n {this.hasSelectedItem && this.showFormattedSelectedItem && <slot name=\"selected-item\"></slot>}\n <div class={{ 'selected-container-content': true, 'hidden': this.showFormattedSelectedItem }} id=\"selected-container-content\" style={{}}>\n {(!this.hasSelectedItem || !this.showFormattedSelectedItem) && (\n <cpsl-text class={{ 'selected-text': true, 'placeholder': !this.selectedValue }}>\n {!this.selectedValue ? (this.placeholder ?? 'Select') : (this.formatValue?.(this.selectedValue) ?? this.selectedValue)}\n </cpsl-text>\n )}\n </div>\n <cpsl-icon class={{ 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }} icon=\"chevronUp\" />\n <input\n id={this.inputId}\n disabled={this.disabled}\n class={{ disabled: this.disabled }}\n value={this.selectedValue}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyPress={this.handleEnterPress}\n inputmode=\"none\"\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 <cpsl-popover part=\"popover\" autoWidth={this.autoWidth} trigger={this.id} preventBlur={this.hasFocus} disabled={this.disabled} anchorEl={this.anchorEl}>\n <div part=\"dropdown\" class=\"dropdown\">\n {this.showSearch && (\n <div class=\"search-container\">\n <cpsl-input\n onClick={e => e.stopPropagation()}\n placeholder={this.searchPlaceholder ?? 'Search'}\n value=\"\"\n onCpslInput={e => {\n e.stopPropagation();\n this.cpslSearchChange.emit(e.detail.value);\n }}\n />\n </div>\n )}\n <div class=\"dropdown-inner\" style={{ maxHeight: `${this.dropdownMaxHeight}px` }}>\n <slot name=\"items\"></slot>\n </div>\n </div>\n </cpsl-popover>\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -8,7 +8,7 @@ export class CpslSelectItem {
8
8
  this.value = undefined;
9
9
  }
10
10
  render() {
11
- return (h(Host, { key: '5bc53f915d04dbdbad5a301cec8b7a6dcef21d82' }, h("div", { key: 'cd3beea4b16d1c01b21ca1b54d03da6e501f52bb', class: "outer-container", onClick: this.handleItemClick }, h("div", { key: 'c63a0a44649b4837d0d67f983d274785f41204c6', class: { 'inner-container': true, 'selected': this.selected } }, h("slot", { key: '99e548871325528b7d52295c9e6740324f5add51' })))));
11
+ return (h(Host, { key: 'c0407d16cc7afc4fba47acd8236da3f276d6e6dc' }, h("div", { key: '22b2c12c9c5b6109da3bc932b52e538da514a95d', part: "outer-container", class: "outer-container", onClick: this.handleItemClick }, h("div", { key: '1e7a33b947aec6444168a173ca8aa0059c40e823', part: "inner-container", class: { 'inner-container': true, 'selected': this.selected } }, h("slot", { key: '0e9d4878f0e8301ef0182038216249a63071eb27' })))));
12
12
  }
13
13
  static get is() { return "cpsl-select-item"; }
14
14
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-select-item.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select-item/cpsl-select-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,cAAc;;QAiBjB,oBAAe,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC;;;;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,eAAe;gBACxD,4DAAK,KAAK,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAChE,8DAAa,CACT,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select-item',\n styleUrl: 'cpsl-select-item.scss',\n shadow: true,\n})\nexport class CpslSelectItem {\n /**\n * Whether the item is selected or not.\n */\n @Prop() selected?: boolean;\n\n /**\n * Value of the item.\n */\n @Prop() value: string;\n\n /**\n * Called when item is clicked.\n * @internal\n */\n @Event() cpslSelectItemClick: EventEmitter<string>;\n\n private handleItemClick = () => {\n this.cpslSelectItemClick.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n <div class=\"outer-container\" onClick={this.handleItemClick}>\n <div class={{ 'inner-container': true, 'selected': this.selected }}>\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-select-item.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select-item/cpsl-select-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,cAAc;;QAiBjB,oBAAe,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC;;;;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,eAAe;gBAC/E,4DAAK,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE;oBACvF,8DAAa,CACT,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select-item',\n styleUrl: 'cpsl-select-item.scss',\n shadow: true,\n})\nexport class CpslSelectItem {\n /**\n * Whether the item is selected or not.\n */\n @Prop() selected?: boolean;\n\n /**\n * Value of the item.\n */\n @Prop() value: string;\n\n /**\n * Called when item is clicked.\n * @internal\n */\n @Event() cpslSelectItemClick: EventEmitter<string>;\n\n private handleItemClick = () => {\n this.cpslSelectItemClick.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n <div part=\"outer-container\" class=\"outer-container\" onClick={this.handleItemClick}>\n <div part=\"inner-container\" class={{ 'inner-container': true, 'selected': this.selected }}>\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -23,28 +23,36 @@ export class CpslSlideButton {
23
23
  };
24
24
  const dragMouseDown = (e) => {
25
25
  e.preventDefault();
26
+ // get the mouse cursor position at startup:
26
27
  pos3 = e.clientX;
27
28
  document.onmouseup = closeDragElement;
29
+ // call a function whenever the cursor moves:
28
30
  document.onmousemove = elementMouseDrag;
29
31
  };
30
32
  const dragTouchDown = (e) => {
31
33
  e.preventDefault();
32
34
  const touchLocation = e.targetTouches[0];
35
+ // get the mouse cursor position at startup:
33
36
  pos3 = touchLocation.clientX;
34
37
  document.ontouchend = closeDragElement;
38
+ // call a function whenever the cursor moves:
35
39
  document.ontouchmove = elementTouchDrag;
36
40
  };
37
41
  const elementMouseDrag = (e) => {
38
42
  e.preventDefault();
43
+ // calculate the new cursor position:
39
44
  pos1 = pos3 - e.clientX;
40
45
  pos3 = e.clientX;
46
+ // set the element's new position:
41
47
  finishElementDrag(pos1);
42
48
  };
43
49
  const elementTouchDrag = (e) => {
44
50
  e.preventDefault();
45
51
  const touchLocation = e.targetTouches[0];
52
+ // calculate the new cursor position:
46
53
  pos1 = pos3 - touchLocation.clientX;
47
54
  pos3 = touchLocation.clientX;
55
+ // set the element's new position:
48
56
  finishElementDrag(pos1);
49
57
  };
50
58
  const finishElementDrag = (pos) => {
@@ -77,6 +85,7 @@ export class CpslSlideButton {
77
85
  endIconEl.style.opacity = '0%';
78
86
  endBackgroundEl.style.opacity = '0%';
79
87
  }
88
+ // stop moving when mouse button is released:
80
89
  document.onmouseup = null;
81
90
  document.onmousemove = null;
82
91
  document.ontouchend = null;
@@ -90,7 +99,9 @@ export class CpslSlideButton {
90
99
  const sliderContainerEl = this.sliderContainerEl;
91
100
  const containerWidth = sliderContainerEl.clientWidth;
92
101
  const sliderHeight = el.getBoundingClientRect().height;
102
+ // Offset min by 1 for 1px left padding
93
103
  const minX = 1;
104
+ // Offset max by the slider width and 1px for padding
94
105
  const maxX = containerWidth - sliderHeight - 1;
95
106
  let pos1 = 0, pos3 = 0;
96
107
  el.onpointerdown = pointerDown;
@@ -114,7 +125,7 @@ export class CpslSlideButton {
114
125
  return this.el.shadowRoot.getElementById('end-icon');
115
126
  }
116
127
  render() {
117
- return (h(Host, { key: '2c1481d71b13947115c6aca7ae38d88204f72f52' }, h("div", { key: '42880b0a9ac2c130fb3f7c03e79d1e73a72df1ab', id: "slider-container", class: "slider-container" }, h("div", { key: '62c5f7fe9b77c0cd16615fa78f3135a6c235ef53', id: "start-slider-container-background", class: { 'start-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: '0caceb1b45b6bea67d8b6f2a61884f7ae7f4b6f9', id: "end-slider-container-background", class: { 'end-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: '7bef562aed22abdda9183471a48242ec8f74e816', id: "slider", class: { slider: true, disabled: this.disabled } }, h("cpsl-icon", { key: 'e2ac31a4c8ed8cecd5495f0bd1b61d47055c4f0c', id: "start-icon", class: { 'start-icon': true, 'icon': true }, icon: this.startIcon }), h("cpsl-icon", { key: 'c28b7aedf9289dc0bccc1c359a2ca7e2390a49ab', id: "end-icon", class: { 'end-icon': true, 'icon': true }, icon: this.endIcon })), h("span", { key: 'f698ecc109722522c13c825b506311aebbbce116', id: "start-text", class: { 'start-text': true, 'disabled': this.disabled } }, this.startText), h("span", { key: 'bcbc4a152084760322b5c3377680b950cdfc4b4e', id: "end-text", class: "end-text" }, this.endText))));
128
+ return (h(Host, { key: '59a886a50251c2a35b5f9b7c82a24b6bbead4835' }, h("div", { key: 'a40904f525abdb06933010b738d30e7bc5318254', id: "slider-container", class: "slider-container" }, h("div", { key: 'f0142fc9e9ba63544ef4ca25ac4710ad75f35866', id: "start-slider-container-background", class: { 'start-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: '36f24475cfe8002f5fe6b532a4a5bed906ee502e', id: "end-slider-container-background", class: { 'end-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: '27ba6f34102be72b6daae01fe8e0748ebeeb906e', id: "slider", class: { slider: true, disabled: this.disabled } }, h("cpsl-icon", { key: '241d0ae75ae75974d16c2b57de631c0abf418c6b', id: "start-icon", class: { 'start-icon': true, 'icon': true }, icon: this.startIcon }), h("cpsl-icon", { key: '719ab71c28ae7041b1371fb85a073467e7b5e0d3', id: "end-icon", class: { 'end-icon': true, 'icon': true }, icon: this.endIcon })), h("span", { key: '2f770d1fd8eea0bd90e4072393952113565201e0', id: "start-text", class: { 'start-text': true, 'disabled': this.disabled } }, this.startText), h("span", { key: '377d99ef277482f649585bf8c5176a212c4610b8', id: "end-text", class: "end-text" }, this.endText))));
118
129
  }
119
130
  static get is() { return "cpsl-slide-button"; }
120
131
  static get encapsulation() { return "shadow"; }
@@ -152,7 +163,7 @@ export class CpslSlideButton {
152
163
  "mutable": false,
153
164
  "complexType": {
154
165
  "original": "IconType",
155
- "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\"",
166
+ "resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"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\"",
156
167
  "references": {
157
168
  "IconType": {
158
169
  "location": "import",
@@ -192,7 +203,7 @@ export class CpslSlideButton {
192
203
  "mutable": false,
193
204
  "complexType": {
194
205
  "original": "IconType",
195
- "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\"",
206
+ "resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"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\"",
196
207
  "references": {
197
208
  "IconType": {
198
209
  "location": "import",
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-slide-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-slide-button/cpsl-slide-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,eAAe;;;;;;;;IAiC1B,gBAAgB;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,WAAW,CAAC,EAAe;QACjC,MAAM,WAAW,GAAG,CAAC,CAAe,EAAE,EAAE;YACtC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;YAEjB,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;gBACtB,KAAK,OAAO;oBACV,EAAE,CAAC,WAAW,GAAG,aAAa,CAAC;oBAC/B,MAAM;gBACR;oBACE,EAAE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E,IAAI,CAAC,QAAQ,EAAE;oBAC/D,kEAAW,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,GAAI;oBAChG,kEAAW,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,GAAI,CACtF;gBACN,6DAAM,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAC3E,IAAI,CAAC,SAAS,CACV;gBACP,6DAAM,EAAE,EAAC,UAAU,EAAC,KAAK,EAAC,UAAU,IACjC,IAAI,CAAC,OAAO,CACR,CACH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, EventEmitter, Event } from '@stencil/core';\nimport { IconType } from '../../interface';\n\n@Component({\n tag: 'cpsl-slide-button',\n styleUrl: 'cpsl-slide-button.scss',\n shadow: true,\n})\nexport class CpslSlideButton {\n @Element() el!: HTMLCpslSlideButtonElement;\n\n /**\n * Whether or not the component is disabled. If true, the component will display the `startText`.\n */\n @Prop() disabled: boolean;\n\n /**\n * The name of the ending icon to show.\n */\n @Prop() endIcon: IconType;\n\n /**\n * The ending text.\n */\n @Prop() endText: string;\n\n /**\n * The name of the starting icon to show.\n */\n @Prop() startIcon: IconType;\n\n /**\n * The starting text.\n */\n @Prop() startText: string;\n\n /**\n * The `cpslComplete` event is fired when the slider is at the end.\n */\n @Event() cpslComplete!: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.dragElement(this.el.shadowRoot.getElementById('slider'));\n }\n\n private dragElement(el: HTMLElement) {\n const pointerDown = (e: PointerEvent) => {\n pos3 = e.clientX;\n\n switch (e.pointerType) {\n case 'mouse':\n el.onmousedown = dragMouseDown;\n break;\n default:\n el.ontouchstart = dragTouchDown;\n }\n };\n\n const dragMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementMouseDrag;\n };\n\n const dragTouchDown = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // get the mouse cursor position at startup:\n pos3 = touchLocation.clientX;\n document.ontouchend = closeDragElement;\n // call a function whenever the cursor moves:\n document.ontouchmove = elementTouchDrag;\n };\n\n const elementMouseDrag = (e: MouseEvent) => {\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos3 = e.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const elementTouchDrag = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // calculate the new cursor position:\n pos1 = pos3 - touchLocation.clientX;\n pos3 = touchLocation.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const finishElementDrag = (pos: number) => {\n const newPos = el.offsetLeft - pos;\n if (newPos >= minX && newPos <= maxX) {\n const newPosPercent = Math.max(Math.min(Math.round((newPos / maxX) * 100) / 100, 100), 0);\n\n startTextEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endTextEl.style.opacity = `${newPosPercent * 100}%`;\n\n startIconEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endIconEl.style.opacity = `${newPosPercent * 100}%`;\n\n endBackgroundEl.style.opacity = `${newPosPercent * 100}%`;\n\n el.style.left = `${newPos}px`;\n }\n };\n\n const closeDragElement = () => {\n if (el.offsetLeft + sliderHeight >= containerWidth - sliderHeight / 2) {\n el.style.left = `${maxX}px`;\n startTextEl.style.opacity = '0%';\n endTextEl.style.opacity = '100%';\n startIconEl.style.opacity = '0%';\n endIconEl.style.opacity = '100%';\n endBackgroundEl.style.opacity = '100%';\n this.cpslComplete.emit(true);\n } else {\n el.style.left = `${minX}px`;\n startTextEl.style.opacity = '100%';\n endTextEl.style.opacity = '0%';\n startIconEl.style.opacity = '100%';\n endIconEl.style.opacity = '0%';\n endBackgroundEl.style.opacity = '0%';\n }\n // stop moving when mouse button is released:\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n };\n\n const startIconEl = this.startIconEl;\n const endIconEl = this.endIconEl;\n const startTextEl = this.startTextEl;\n const endTextEl = this.endTextEl;\n const endBackgroundEl = this.endBackgroundEl;\n\n const sliderContainerEl = this.sliderContainerEl;\n const containerWidth = sliderContainerEl.clientWidth;\n\n const sliderHeight = el.getBoundingClientRect().height;\n\n // Offset min by 1 for 1px left padding\n const minX = 1;\n // Offset max by the slider width and 1px for padding\n const maxX = containerWidth - sliderHeight - 1;\n\n let pos1 = 0,\n pos3 = 0;\n\n el.onpointerdown = pointerDown;\n }\n\n private get sliderContainerEl() {\n return this.el.shadowRoot.getElementById('slider-container');\n }\n\n private get startTextEl() {\n return this.el.shadowRoot.getElementById('start-text');\n }\n\n private get endTextEl() {\n return this.el.shadowRoot.getElementById('end-text');\n }\n\n private get endBackgroundEl() {\n return this.el.shadowRoot.getElementById('end-slider-container-background');\n }\n\n private get startIconEl() {\n return this.el.shadowRoot.getElementById('start-icon');\n }\n\n private get endIconEl() {\n return this.el.shadowRoot.getElementById('end-icon');\n }\n\n render() {\n return (\n <Host>\n <div id=\"slider-container\" class=\"slider-container\">\n <div id=\"start-slider-container-background\" class={{ 'start-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"end-slider-container-background\" class={{ 'end-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"slider\" class={{ slider: true, disabled: this.disabled }}>\n <cpsl-icon id=\"start-icon\" class={{ 'start-icon': true, 'icon': true }} icon={this.startIcon} />\n <cpsl-icon id=\"end-icon\" class={{ 'end-icon': true, 'icon': true }} icon={this.endIcon} />\n </div>\n <span id=\"start-text\" class={{ 'start-text': true, 'disabled': this.disabled }}>\n {this.startText}\n </span>\n <span id=\"end-text\" class=\"end-text\">\n {this.endText}\n </span>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-slide-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-slide-button/cpsl-slide-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,eAAe;;;;;;;;IAiC1B,gBAAgB;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,WAAW,CAAC,EAAe;QACjC,MAAM,WAAW,GAAG,CAAC,CAAe,EAAE,EAAE;YACtC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;YAEjB,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;gBACtB,KAAK,OAAO;oBACV,EAAE,CAAC,WAAW,GAAG,aAAa,CAAC;oBAC/B,MAAM;gBACR;oBACE,EAAE,CAAC,YAAY,GAAG,aAAa,CAAC;YACpC,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,CAAC,CAAa,EAAE,EAAE;YACtC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,4CAA4C;YAC5C,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;YACjB,QAAQ,CAAC,SAAS,GAAG,gBAAgB,CAAC;YACtC,6CAA6C;YAC7C,QAAQ,CAAC,WAAW,GAAG,gBAAgB,CAAC;QAC1C,CAAC,CAAC;QAEF,MAAM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EAAW,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,GAAI,CACtF;gBACN,6DAAM,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAC3E,IAAI,CAAC,SAAS,CACV;gBACP,6DAAM,EAAE,EAAC,UAAU,EAAC,KAAK,EAAC,UAAU,IACjC,IAAI,CAAC,OAAO,CACR,CACH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, EventEmitter, Event } from '@stencil/core';\nimport { IconType } from '../../interface';\n\n@Component({\n tag: 'cpsl-slide-button',\n styleUrl: 'cpsl-slide-button.scss',\n shadow: true,\n})\nexport class CpslSlideButton {\n @Element() el!: HTMLCpslSlideButtonElement;\n\n /**\n * Whether or not the component is disabled. If true, the component will display the `startText`.\n */\n @Prop() disabled: boolean;\n\n /**\n * The name of the ending icon to show.\n */\n @Prop() endIcon: IconType;\n\n /**\n * The ending text.\n */\n @Prop() endText: string;\n\n /**\n * The name of the starting icon to show.\n */\n @Prop() startIcon: IconType;\n\n /**\n * The starting text.\n */\n @Prop() startText: string;\n\n /**\n * The `cpslComplete` event is fired when the slider is at the end.\n */\n @Event() cpslComplete!: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.dragElement(this.el.shadowRoot.getElementById('slider'));\n }\n\n private dragElement(el: HTMLElement) {\n const pointerDown = (e: PointerEvent) => {\n pos3 = e.clientX;\n\n switch (e.pointerType) {\n case 'mouse':\n el.onmousedown = dragMouseDown;\n break;\n default:\n el.ontouchstart = dragTouchDown;\n }\n };\n\n const dragMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementMouseDrag;\n };\n\n const dragTouchDown = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // get the mouse cursor position at startup:\n pos3 = touchLocation.clientX;\n document.ontouchend = closeDragElement;\n // call a function whenever the cursor moves:\n document.ontouchmove = elementTouchDrag;\n };\n\n const elementMouseDrag = (e: MouseEvent) => {\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos3 = e.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const elementTouchDrag = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // calculate the new cursor position:\n pos1 = pos3 - touchLocation.clientX;\n pos3 = touchLocation.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const finishElementDrag = (pos: number) => {\n const newPos = el.offsetLeft - pos;\n if (newPos >= minX && newPos <= maxX) {\n const newPosPercent = Math.max(Math.min(Math.round((newPos / maxX) * 100) / 100, 100), 0);\n\n startTextEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endTextEl.style.opacity = `${newPosPercent * 100}%`;\n\n startIconEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endIconEl.style.opacity = `${newPosPercent * 100}%`;\n\n endBackgroundEl.style.opacity = `${newPosPercent * 100}%`;\n\n el.style.left = `${newPos}px`;\n }\n };\n\n const closeDragElement = () => {\n if (el.offsetLeft + sliderHeight >= containerWidth - sliderHeight / 2) {\n el.style.left = `${maxX}px`;\n startTextEl.style.opacity = '0%';\n endTextEl.style.opacity = '100%';\n startIconEl.style.opacity = '0%';\n endIconEl.style.opacity = '100%';\n endBackgroundEl.style.opacity = '100%';\n this.cpslComplete.emit(true);\n } else {\n el.style.left = `${minX}px`;\n startTextEl.style.opacity = '100%';\n endTextEl.style.opacity = '0%';\n startIconEl.style.opacity = '100%';\n endIconEl.style.opacity = '0%';\n endBackgroundEl.style.opacity = '0%';\n }\n // stop moving when mouse button is released:\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n };\n\n const startIconEl = this.startIconEl;\n const endIconEl = this.endIconEl;\n const startTextEl = this.startTextEl;\n const endTextEl = this.endTextEl;\n const endBackgroundEl = this.endBackgroundEl;\n\n const sliderContainerEl = this.sliderContainerEl;\n const containerWidth = sliderContainerEl.clientWidth;\n\n const sliderHeight = el.getBoundingClientRect().height;\n\n // Offset min by 1 for 1px left padding\n const minX = 1;\n // Offset max by the slider width and 1px for padding\n const maxX = containerWidth - sliderHeight - 1;\n\n let pos1 = 0,\n pos3 = 0;\n\n el.onpointerdown = pointerDown;\n }\n\n private get sliderContainerEl() {\n return this.el.shadowRoot.getElementById('slider-container');\n }\n\n private get startTextEl() {\n return this.el.shadowRoot.getElementById('start-text');\n }\n\n private get endTextEl() {\n return this.el.shadowRoot.getElementById('end-text');\n }\n\n private get endBackgroundEl() {\n return this.el.shadowRoot.getElementById('end-slider-container-background');\n }\n\n private get startIconEl() {\n return this.el.shadowRoot.getElementById('start-icon');\n }\n\n private get endIconEl() {\n return this.el.shadowRoot.getElementById('end-icon');\n }\n\n render() {\n return (\n <Host>\n <div id=\"slider-container\" class=\"slider-container\">\n <div id=\"start-slider-container-background\" class={{ 'start-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"end-slider-container-background\" class={{ 'end-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"slider\" class={{ slider: true, disabled: this.disabled }}>\n <cpsl-icon id=\"start-icon\" class={{ 'start-icon': true, 'icon': true }} icon={this.startIcon} />\n <cpsl-icon id=\"end-icon\" class={{ 'end-icon': true, 'icon': true }} icon={this.endIcon} />\n </div>\n <span id=\"start-text\" class={{ 'start-text': true, 'disabled': this.disabled }}>\n {this.startText}\n </span>\n <span id=\"end-text\" class=\"end-text\">\n {this.endText}\n </span>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -54,18 +54,13 @@
54
54
  * }
55
55
  */
56
56
  :host {
57
- --path-color: var(--cpsl-color-spinner-path);
58
- --circle-color: var(--cpsl-color-spinner-circle);
57
+ --bar-width: 12px;
58
+ --bar-color: var(--cpsl-color-foreground-0);
59
+ --background-color: var(--cpsl-color-background-0);
59
60
  display: flex;
60
61
  justify-content: center;
61
62
  align-items: center;
62
63
  }
63
- :host path {
64
- stroke: var(--path-color);
65
- }
66
- :host circle {
67
- fill: var(--circle-color);
68
- }
69
64
  @keyframes spin {
70
65
  0% {
71
66
  -webkit-transform: rotate(0deg);
@@ -91,4 +86,31 @@
91
86
  100% {
92
87
  -webkit-transform: rotate(360deg);
93
88
  }
89
+ }
90
+
91
+ .loader {
92
+ position: relative;
93
+ width: 100%;
94
+ aspect-ratio: 1;
95
+ background: conic-gradient(transparent, transparent 12%, var(--bar-color));
96
+ border-radius: 50%;
97
+ margin: auto;
98
+ animation: spin 0.8s cubic-bezier(0.3, 0.5, 0.5, 0.5) infinite;
99
+ }
100
+ .loader::before, .loader::after {
101
+ content: "";
102
+ position: absolute;
103
+ border-radius: inherit;
104
+ }
105
+ .loader::before {
106
+ top: 0;
107
+ left: 50%;
108
+ transform: translateX(-50%);
109
+ background: linear-gradient(to left, var(--bar-color) 50%, transparent 50%);
110
+ width: var(--bar-width);
111
+ aspect-ratio: 1;
112
+ }
113
+ .loader::after {
114
+ inset: var(--bar-width);
115
+ background: var(--background-color);
94
116
  }
@@ -5,13 +5,11 @@ export class CpslSpinner {
5
5
  this.speed = 1;
6
6
  }
7
7
  render() {
8
- return (h(Host, { key: '10b3edc28ae27a3feaf90e9a23f8833f9880e717', style: {
9
- 'height': `${this.size}px`,
10
- 'width': `${this.size}px`,
11
- 'animation': `spin ${this.speed}s linear infinite`,
12
- '-webkit-animation': `spin ${this.speed}s linear infinite`,
13
- '-moz-animation': `spin ${this.speed}s linear infinite`,
14
- } }, h("svg", { key: '2ce2e8a1d0b7ad7b34cbcdc0984883363740c0f5', height: this.size, width: this.size, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 54 54", fill: "none" }, h("path", { key: 'e16659e096d7f2557e0fe829ed239c63a3e08011', d: "M43.1586 17C39.8082 11.5978 33.8243 8 27 8C16.5066 8 8 16.5066 8 27C8 37.4934 16.5066 46 27 46C33.8242 46 39.8082 42.4022 43.1586 37", "stroke-width": "6", "stroke-linecap": "round" }), h("circle", { key: '1cc780ff25da0556aa3012cfa28b457443689dec', cx: "45", cy: "27", r: "5" }))));
8
+ return (h(Host, { key: 'a7de26e1a17fb0abc34f1f046a922ef591c6e6f3', style: {
9
+ height: `${this.size}px`,
10
+ width: `${this.size}px`,
11
+ ['--bar-width']: `${this.size * 0.12}px`,
12
+ } }, h("div", { key: '0a2faf4d46509c15e59cd685a2799b0c5c0eb85c', class: "loader" })));
15
13
  }
16
14
  static get is() { return "cpsl-spinner"; }
17
15
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-spinner.js","sourceRoot":"","sources":["../../../../src/components/cpsl-spinner/cpsl-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,WAAW;;oBAKE,EAAE;qBAMD,CAAC;;IAE1B,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBAC1B,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBACzB,WAAW,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;gBAClD,mBAAmB,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;gBAC1D,gBAAgB,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;aACxD;YAED,4DAAK,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM;gBAC1G,6DACE,CAAC,EAAC,sIAAsI,kBAC3H,GAAG,oBACD,OAAO,GACtB;gBACF,+DAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,CAC5B,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-spinner',\n styleUrl: 'cpsl-spinner.scss',\n shadow: true,\n})\nexport class CpslSpinner {\n /**\n * Size of the spinner in pixels.\n * Default is 50.\n */\n @Prop() size?: number = 54;\n\n /**\n * Rotation speed of the spinner in seconds.\n * Default is 1.\n */\n @Prop() speed?: number = 1;\n\n render() {\n return (\n <Host\n style={{\n 'height': `${this.size}px`,\n 'width': `${this.size}px`,\n 'animation': `spin ${this.speed}s linear infinite`,\n '-webkit-animation': `spin ${this.speed}s linear infinite`,\n '-moz-animation': `spin ${this.speed}s linear infinite`,\n }}\n >\n <svg height={this.size} width={this.size} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 54 54\" fill=\"none\">\n <path\n d=\"M43.1586 17C39.8082 11.5978 33.8243 8 27 8C16.5066 8 8 16.5066 8 27C8 37.4934 16.5066 46 27 46C33.8242 46 39.8082 42.4022 43.1586 37\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"45\" cy=\"27\" r=\"5\" />\n </svg>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-spinner.js","sourceRoot":"","sources":["../../../../src/components/cpsl-spinner/cpsl-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,WAAW;;oBAKE,EAAE;qBAMD,CAAC;;IAE1B,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBACxB,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBACvB,CAAC,aAAa,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI;aACzC;YAED,4DAAK,KAAK,EAAC,QAAQ,GAAG,CACjB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-spinner',\n styleUrl: 'cpsl-spinner.scss',\n shadow: true,\n})\nexport class CpslSpinner {\n /**\n * Size of the spinner in pixels.\n * Default is 50.\n */\n @Prop() size?: number = 54;\n\n /**\n * Rotation speed of the spinner in seconds.\n * Default is 1.\n */\n @Prop() speed?: number = 1;\n\n render() {\n return (\n <Host\n style={{\n height: `${this.size}px`,\n width: `${this.size}px`,\n ['--bar-width']: `${this.size * 0.12}px`,\n }}\n >\n <div class=\"loader\" />\n </Host>\n );\n }\n}\n"]}
@@ -7,7 +7,7 @@ export class CpslSwitch {
7
7
  this.checked = undefined;
8
8
  }
9
9
  render() {
10
- return (h(Host, { key: '4bb60b7497853c9445787089fb279bcf4755246b' }, h("input", { key: 'a8b054f90aba1040019d848737bf0e90f0796964', type: "checkbox", checked: this.checked }), h("span", { key: '569ddefabbef07dd1b9930475541b9dcb0352c80', onClick: this.handleSwitchClick, class: { container: true, checked: this.checked } }, h("span", { key: '23cc58424353fcd969546058e9849c8a85fddad1', class: { thumb: true, checked: this.checked } }))));
10
+ return (h(Host, { key: 'd324dea22ae9e0ce4755a91944f4f1e610ccabe1' }, h("input", { key: 'd132f929923c331ccb91e550ecd5098acb6c24df', type: "checkbox", checked: this.checked }), h("span", { key: '172dedb09d220dbe4a3ea95032ab0e4ea194bcd4', onClick: this.handleSwitchClick, class: { container: true, checked: this.checked } }, h("span", { key: 'e3d9bec7fdddb3445cc9db05886a705aeb3d9bea', class: { thumb: true, checked: this.checked } }))));
11
11
  }
12
12
  static get is() { return "cpsl-switch"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -1,5 +1,8 @@
1
1
  :host {
2
- --tab-color: var(--cpsl-color-text-primary);
2
+ --tab-color: var(--cpsl-color-text-secondary);
3
+ --tab-gap: 2px;
4
+ --tab-icon-height: 16px;
5
+ --tab-icon-width: 16px;
3
6
  padding-top: var(--tab-top-padding);
4
7
  padding-bottom: var(--tab-bottom-padding);
5
8
  padding-left: var(--tab-left-padding);
@@ -10,6 +13,20 @@
10
13
  cursor: pointer;
11
14
  z-index: 10;
12
15
  }
16
+ :host ::slotted([slot=start]) {
17
+ --icon-color: var(--tab-color);
18
+ --height: var(--tab-icon-height);
19
+ --width: var(--tab-icon-width);
20
+ }
21
+ :host ::slotted([slot=end]) {
22
+ --icon-color: var(--tab-color);
23
+ --height: var(--tab-icon-height);
24
+ --width: var(--tab-icon-width);
25
+ }
26
+
27
+ :host(.selected) {
28
+ --tab-color: var(--cpsl-color-text-primary);
29
+ }
13
30
 
14
31
  .tab-container {
15
32
  align-items: center;
@@ -20,4 +37,10 @@
20
37
  white-space: nowrap;
21
38
  font-weight: 500;
22
39
  color: var(--tab-color);
40
+ display: flex;
41
+ gap: var(--tab-gap);
42
+ }
43
+
44
+ .content {
45
+ flex: 1 1 auto;
23
46
  }
@@ -21,7 +21,7 @@ export class CpslTab {
21
21
  }
22
22
  }
23
23
  render() {
24
- return (h(Host, { key: 'e95f29b005dfda39d9e973c9fc540567024eec27', onClick: this.onTabClicked }, h("div", { key: '13f246e19210d03b75ee73b8afe739bcb7fb3d7d', class: { 'tab-container': true } }, h("slot", { key: 'add7e0bea1d4c4addbed47fbde20f5ec05b52035' }))));
24
+ return (h(Host, { key: '43eb0e4547870b335aa19196bf391f2062df2b34', class: { selected: this.selected }, onClick: this.onTabClicked }, h("div", { key: '79d6974ea7641668144f6a9ba0250fc3262611e3', class: { 'tab-container': true } }, h("slot", { key: 'a52f47df870df25287254127d1e0754e98a9a02f', name: "start" }), h("div", { key: 'e97e9949a12bf7388599fdaec26c478436f284b2', class: "content" }, h("slot", { key: '05bdc0bb599c21f6b703c704f629e5368e86c818' })), h("slot", { key: '66169d0d87d651fe61f0dc2216a868a5f17bd78c', name: "end" }))));
25
25
  }
26
26
  static get is() { return "cpsl-tab"; }
27
27
  static get encapsulation() { return "shadow"; }