@usecapsule/core-components 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. package/css/capsule-core.css +93 -24
  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-397edab5.entry.js +2 -0
  8. package/dist/capsule/{p-ad14a817.entry.js.map → p-397edab5.entry.js.map} +1 -1
  9. package/dist/capsule/p-52d6ebee.entry.js +2 -0
  10. package/dist/capsule/{p-fcead80b.entry.js.map → p-52d6ebee.entry.js.map} +1 -1
  11. package/dist/capsule/p-5ed5e96c.entry.js +2 -0
  12. package/dist/capsule/p-5ed5e96c.entry.js.map +1 -0
  13. package/dist/capsule/p-6e71539d.js +3 -0
  14. package/dist/capsule/p-6e71539d.js.map +1 -0
  15. package/dist/capsule/p-6e900654.entry.js +29 -0
  16. package/dist/capsule/p-6e900654.entry.js.map +1 -0
  17. package/dist/capsule/{p-0d0a0037.entry.js → p-70f95c93.entry.js} +2 -2
  18. package/dist/capsule/{p-0d0a0037.entry.js.map → p-70f95c93.entry.js.map} +1 -1
  19. package/dist/capsule/p-86e6cba5.entry.js +10 -0
  20. package/dist/capsule/{p-d28b96ba.entry.js.map → p-86e6cba5.entry.js.map} +1 -1
  21. package/dist/capsule/p-f2393be6.js +2 -0
  22. package/dist/capsule/p-f2393be6.js.map +1 -0
  23. package/dist/capsule/{p-fa078837.entry.js → p-f9351426.entry.js} +2 -2
  24. package/dist/capsule/{p-fa078837.entry.js.map → p-f9351426.entry.js.map} +1 -1
  25. package/dist/cjs/capsule.cjs.js +10 -10
  26. package/dist/cjs/capsule.cjs.js.map +1 -1
  27. package/dist/cjs/{constants-0869a780.js → constants-9b1b01bb.js} +3 -3
  28. package/dist/cjs/{constants-0869a780.js.map → constants-9b1b01bb.js.map} +1 -1
  29. package/dist/cjs/{cpsl-alert_29.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +663 -94
  30. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
  31. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  32. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  33. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  34. package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
  35. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  36. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +55 -0
  37. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -0
  38. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  39. package/dist/cjs/index-85125285.js +1414 -0
  40. package/dist/cjs/index-85125285.js.map +1 -0
  41. package/dist/cjs/index.cjs.js +116 -107
  42. package/dist/cjs/index.cjs.js.map +1 -1
  43. package/dist/cjs/loader.cjs.js +2 -2
  44. package/dist/collection/assets/icons/chevron-up.svg +2 -2
  45. package/dist/collection/assets/icons/close.svg +3 -4
  46. package/dist/collection/assets/icons/cube.svg +3 -0
  47. package/dist/collection/assets/icons/farcaster-brand.svg +10 -0
  48. package/dist/collection/assets/icons/farcaster.svg +10 -0
  49. package/dist/collection/assets/icons/image.svg +3 -0
  50. package/dist/collection/assets/icons/index.js +9 -1
  51. package/dist/collection/assets/icons/index.js.map +1 -1
  52. package/dist/collection/assets/icons/menu.svg +3 -0
  53. package/dist/collection/assets/icons/refresh.svg +3 -0
  54. package/dist/collection/assets/icons/stars.svg +4 -0
  55. package/dist/collection/assets/icons/x.svg +3 -0
  56. package/dist/collection/collection-manifest.json +7 -2
  57. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  58. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  59. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  60. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +20 -4
  61. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  62. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  63. package/dist/collection/components/cpsl-button/cpsl-button.css +113 -17
  64. package/dist/collection/components/cpsl-button/cpsl-button.js +63 -7
  65. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  66. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +1 -0
  67. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
  68. package/dist/collection/components/cpsl-card/cpsl-card.css +1 -1
  69. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  70. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -1
  71. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +2 -2
  72. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  73. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +1 -1
  74. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +2 -2
  75. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  76. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  77. package/dist/collection/components/cpsl-divider/cpsl-divider.css +1 -1
  78. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  79. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +84 -11
  80. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  81. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  82. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  83. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.css +211 -0
  84. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +406 -0
  85. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -0
  86. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +29 -0
  87. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +1 -0
  88. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +37 -0
  89. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +1 -0
  90. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  91. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  92. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
  93. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  94. package/dist/collection/components/cpsl-input/cpsl-input.css +7 -6
  95. package/dist/collection/components/cpsl-input/cpsl-input.js +3 -8
  96. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  97. package/dist/collection/components/cpsl-modal/cpsl-modal.css +4 -4
  98. package/dist/collection/components/cpsl-modal/cpsl-modal.js +1 -0
  99. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  100. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.css +91 -0
  101. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +224 -0
  102. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -0
  103. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +29 -0
  104. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +1 -0
  105. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +37 -0
  106. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +1 -0
  107. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  108. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +1 -1
  109. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  110. package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +4 -0
  111. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  112. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -1
  113. package/dist/collection/components/cpsl-pill/cpsl-pill.css +1 -1
  114. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  115. package/dist/collection/components/cpsl-popover/cpsl-popover.css +98 -0
  116. package/dist/collection/components/cpsl-popover/cpsl-popover.js +511 -0
  117. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -0
  118. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +29 -0
  119. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +1 -0
  120. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +37 -0
  121. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +1 -0
  122. package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
  123. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +1 -1
  124. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  125. package/dist/collection/components/cpsl-radio/cpsl-radio.css +2 -2
  126. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  127. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  128. package/dist/collection/components/cpsl-select/cpsl-select.css +229 -0
  129. package/dist/collection/components/cpsl-select/cpsl-select.js +409 -0
  130. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -0
  131. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +29 -0
  132. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +1 -0
  133. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +37 -0
  134. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +1 -0
  135. package/dist/collection/components/cpsl-select-item/cpsl-select-item.css +114 -0
  136. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +85 -0
  137. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -0
  138. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +29 -0
  139. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +1 -0
  140. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +37 -0
  141. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +1 -0
  142. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +3 -3
  143. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  144. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  145. package/dist/collection/components/cpsl-switch/cpsl-switch.css +4 -4
  146. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  147. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  148. package/dist/collection/components/cpsl-table/cpsl-table.css +48 -60
  149. package/dist/collection/components/cpsl-table/cpsl-table.js +34 -58
  150. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  151. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +2 -2
  152. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  153. package/dist/collection/components/cpsl-text/cpsl-text.css +4 -0
  154. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  155. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  156. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +1 -1
  157. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  158. package/dist/collection/constants.js +2 -2
  159. package/dist/collection/constants.js.map +1 -1
  160. package/dist/collection/interface.js.map +1 -1
  161. package/dist/collection/utils/theme/generateBorderRadii.js +40 -39
  162. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  163. package/dist/collection/utils/theme/generatePalette.js +11 -3
  164. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  165. package/dist/collection/utils/theme/generateTheme.js +2 -2
  166. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  167. package/dist/collection/utils/theme/utils.js +1 -0
  168. package/dist/collection/utils/theme/utils.js.map +1 -1
  169. package/dist/esm/capsule.js +11 -11
  170. package/dist/esm/capsule.js.map +1 -1
  171. package/dist/esm/{constants-6acf4ea8.js → constants-fce138fa.js} +3 -3
  172. package/dist/esm/{constants-6acf4ea8.js.map → constants-fce138fa.js.map} +1 -1
  173. package/dist/esm/{cpsl-alert_29.entry.js → cpsl-alert_33.entry.js} +660 -95
  174. package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
  175. package/dist/esm/cpsl-animation.entry.js +2 -2
  176. package/dist/esm/cpsl-col.entry.js +2 -2
  177. package/dist/esm/cpsl-grid.entry.js +3 -3
  178. package/dist/esm/cpsl-info-box.entry.js +3 -3
  179. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  180. package/dist/esm/cpsl-modal-v2.entry.js +51 -0
  181. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -0
  182. package/dist/esm/cpsl-row.entry.js +2 -2
  183. package/dist/esm/index-b9a060b3.js +1383 -0
  184. package/dist/esm/index-b9a060b3.js.map +1 -0
  185. package/dist/esm/index.js +116 -107
  186. package/dist/esm/index.js.map +1 -1
  187. package/dist/esm/loader.js +3 -3
  188. package/dist/loader/cdn.js +1 -3
  189. package/dist/loader/index.cjs.js +1 -3
  190. package/dist/loader/index.es2017.js +1 -3
  191. package/dist/loader/index.js +1 -3
  192. package/dist/types/assets/icons/index.d.ts +8 -0
  193. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +1 -0
  194. package/dist/types/components/cpsl-button/cpsl-button.d.ts +4 -1
  195. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +10 -1
  196. package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +34 -0
  197. package/dist/types/components/cpsl-input/cpsl-input.d.ts +1 -1
  198. package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +17 -0
  199. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +35 -0
  200. package/dist/types/components/cpsl-select/cpsl-select.d.ts +38 -0
  201. package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +8 -0
  202. package/dist/types/components/cpsl-table/cpsl-table.d.ts +6 -3
  203. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  204. package/dist/types/components.d.ts +596 -28
  205. package/dist/types/constants.d.ts +2 -2
  206. package/dist/types/interface.d.ts +68 -1
  207. package/dist/types/stencil-public-runtime.d.ts +3 -8
  208. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  209. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  210. package/dist/types/utils/theme/utils.d.ts +4 -1
  211. package/package.json +2 -2
  212. package/dist/capsule/p-107e1ff5.entry.js +0 -29
  213. package/dist/capsule/p-107e1ff5.entry.js.map +0 -1
  214. package/dist/capsule/p-86e48e61.js +0 -3
  215. package/dist/capsule/p-86e48e61.js.map +0 -1
  216. package/dist/capsule/p-ad14a817.entry.js +0 -2
  217. package/dist/capsule/p-b6b38e73.js +0 -2
  218. package/dist/capsule/p-b6b38e73.js.map +0 -1
  219. package/dist/capsule/p-d28b96ba.entry.js +0 -10
  220. package/dist/capsule/p-fcead80b.entry.js +0 -2
  221. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +0 -1
  222. package/dist/cjs/index-5733071e.js +0 -2020
  223. package/dist/cjs/index-5733071e.js.map +0 -1
  224. package/dist/collection/components/cpsl-table/table-interface.js +0 -2
  225. package/dist/collection/components/cpsl-table/table-interface.js.map +0 -1
  226. package/dist/esm/cpsl-alert_29.entry.js.map +0 -1
  227. package/dist/esm/index-8fe9f35e.js +0 -1990
  228. package/dist/esm/index-8fe9f35e.js.map +0 -1
  229. package/dist/esm/polyfills/core-js.js +0 -11
  230. package/dist/esm/polyfills/dom.js +0 -79
  231. package/dist/esm/polyfills/es5-html-element.js +0 -1
  232. package/dist/esm/polyfills/index.js +0 -34
  233. package/dist/esm/polyfills/system.js +0 -6
  234. package/dist/types/components/cpsl-table/table-interface.d.ts +0 -19
@@ -68,11 +68,12 @@
68
68
  --button-padding-start: 16px;
69
69
  --button-padding-end: 16px;
70
70
  --button-icon-size: var(--cpls-font-size-body-l);
71
+ --button-font-weight: 500;
71
72
  --button-primary-color: var(--cpsl-color-primary-button-text);
72
73
  --button-primary-background-color: var(--cpsl-color-primary-button-surface-default);
73
74
  --button-primary-border-color: var(--cpsl-color-primary-button-border-default);
74
75
  --button-primary-icon-color: var(--cpsl-color-primary-button-text);
75
- --button-primary-disabled-color: var(--cpsl-color-primary-button-text);
76
+ --button-primary-disabled-color: var(--cpsl-color-text-disabled);
76
77
  --button-primary-disabled-background-color: var(--cpsl-color-primary-button-surface-disabled);
77
78
  --button-primary-disabled-border-color: var(--cpsl-color-primary-button-border-disabled);
78
79
  --button-primary-disabled-icon-color: var(--cpsl-color-primary-button-text);
@@ -88,7 +89,7 @@
88
89
  --button-secondary-background-color: var(--cpsl-color-secondary-button-surface-default);
89
90
  --button-secondary-border-color: var(--cpsl-color-secondary-button-border-default);
90
91
  --button-secondary-icon-color: var(--cpsl-color-secondary-button-text);
91
- --button-secondary-disabled-color: var(--cpsl-color-secondary-button-text);
92
+ --button-secondary-disabled-color: var(--cpsl-color-text-disabled);
92
93
  --button-secondary-disabled-background-color: var(--cpsl-color-secondary-button-surface-disabled);
93
94
  --button-secondary-disabled-border-color: var(--cpsl-color-secondary-button-border-disabled);
94
95
  --button-secondary-disabled-icon-color: var(--cpsl-color-secondary-button-text);
@@ -100,12 +101,34 @@
100
101
  --button-secondary-active-background-color: var(--cpsl-color-secondary-button-surface-pressed);
101
102
  --button-secondary-active-border-color: var(--cpsl-color-secondary-button-border-default);
102
103
  --button-secondary-active-icon-color: var(--cpsl-color-secondary-button-text);
103
- --button-icon-color: var(--cpsl-color-icon-button-default);
104
- --button-icon-disabled-color: var(--cpsl-color-icon-button-disabled);
105
- --button-icon-hover-color: var(--cpsl-color-icon-button-hover);
106
- height: 100%;
104
+ --button-ghost-color: var(--cpsl-color-ghost-button-default);
105
+ --button-ghost-disabled-color: var(--cpsl-color-ghost-button-disabled);
106
+ --button-ghost-hover-color: var(--cpsl-color-ghost-button-hover);
107
+ --button-destructive-color: var(--cpsl-color-destructive-button-text);
108
+ --button-destructive-background-color: var(--cpsl-color-destructive-button-surface-default);
109
+ --button-destructive-border-color: var(--cpsl-color-destructive-button-border-default);
110
+ --button-destructive-icon-color: var(--cpsl-color-destructive-button-text);
111
+ --button-destructive-disabled-color: var(--cpsl-color-text-disabled);
112
+ --button-destructive-disabled-background-color: var(--cpsl-color-destructive-button-surface-disabled);
113
+ --button-destructive-disabled-border-color: var(--cpsl-color-destructive-button-border-disabled);
114
+ --button-destructive-disabled-icon-color: var(--cpsl-color-destructive-button-text);
115
+ --button-destructive-hover-color: var(--cpsl-color-destructive-button-text);
116
+ --button-destructive-hover-background-color: var(--cpsl-color-destructive-button-surface-hover);
117
+ --button-destructive-hover-border-color: var(--cpsl-color-destructive-button-border-default);
118
+ --button-destructive-hover-icon-color: var(--cpsl-color-destructive-button-text);
119
+ --button-destructive-active-color: var(--cpsl-color-destructive-button-text);
120
+ --button-destructive-active-background-color: var(--cpsl-color-destructive-button-surface-pressed);
121
+ --button-destructive-active-border-color: var(--cpsl-color-destructive-button-border-default);
122
+ --button-destructive-active-icon-color: var(--cpsl-color-destructive-button-text);
123
+ height: fit-content;
124
+ width: fit-content;
107
125
  display: inline-block;
108
126
  font-family: var(--cpsl-font-family, inherit);
127
+ -webkit-tap-highlight-color: transparent;
128
+ }
129
+ :host a {
130
+ height: fit-content;
131
+ width: auto !important;
109
132
  }
110
133
 
111
134
  :host(.full-width) {
@@ -123,12 +146,26 @@
123
146
  --button-icon-size: var(--cpsl-font-size-body-m);
124
147
  }
125
148
 
149
+ :host(.small.primary) {
150
+ --button-padding-top: 13px;
151
+ --button-padding-bottom: 13px;
152
+ }
153
+
126
154
  :host(.medium) {
127
155
  --button-font-size: var(--cpsl-font-size-body-m);
128
156
  --button-padding-top: 14px;
129
157
  --button-padding-bottom: 14px;
130
158
  --button-icon-size: var(--cpsl-font-size-body-l);
131
159
  }
160
+ :host(.medium) :host(.primary) {
161
+ --button-padding-top: 15px;
162
+ --button-padding-bottom: 15px;
163
+ }
164
+
165
+ :host(.medium.primary) {
166
+ --button-padding-top: 15px;
167
+ --button-padding-bottom: 15px;
168
+ }
132
169
 
133
170
  :host(.disabled) {
134
171
  cursor: default;
@@ -145,6 +182,9 @@
145
182
  --button-color: var(--button-primary-color);
146
183
  --button-background-color: var(--button-primary-background-color);
147
184
  --button-border-color: var(--button-primary-border-color);
185
+ --button-padding-start: 17px;
186
+ --button-padding-end: 17px;
187
+ --button-border-width: 0px;
148
188
  }
149
189
  :host(.primary) ::slotted(cpsl-icon) {
150
190
  --icon-color: var(--button-primary-icon-color);
@@ -179,9 +219,9 @@
179
219
  }
180
220
 
181
221
  :host(.secondary) {
182
- --button-border-radius: var(--cpsl-border-radius-secondary-button);
222
+ --button-border-radius: var(--cpsl-border-radius-destructive-button);
183
223
  --button-color: var(--button-secondary-color);
184
- --button-background-color: var(--button-primary-secondary-color);
224
+ --button-background-color: var(--button-secondary-background-color);
185
225
  --button-border-color: var(--button-secondary-border-color);
186
226
  }
187
227
  :host(.secondary) ::slotted(cpsl-icon) {
@@ -216,20 +256,71 @@
216
256
  --button-outline-color: var(--cpsl-color-secondary-button-outline);
217
257
  }
218
258
 
219
- :host(.icon) {
220
- --button-color: transparent;
259
+ :host(.ghost) {
260
+ --button-color: var(--button-ghost-color);
221
261
  --button-background-color: transparent;
222
262
  --button-border-color: transparent;
223
263
  --button-outline-color: transparent;
264
+ --button-padding-start: 0px;
265
+ --button-padding-end: 0px;
266
+ --button-padding-top: 0px;
267
+ --button-padding-bottom: 0px;
268
+ --button-border-width: 0px;
269
+ }
270
+ :host(.ghost) ::slotted(cpsl-icon) {
271
+ --icon-color: var(--button-ghost-color);
272
+ --height: var(--cpsl-font-size-body-xl);
273
+ --width: var(--cpsl-font-size-body-xl);
274
+ }
275
+ :host(.ghost):host(.disabled) {
276
+ --button-color: var(--button-ghost-disabled-color);
277
+ }
278
+ :host(.ghost):host(.disabled) ::slotted(cpsl-icon) {
279
+ --icon-color: var(--button-ghost-disabled-color);
280
+ }
281
+ :host(.ghost) :not(.disabled):hover {
282
+ --button-color: var(--button-ghost-hover-color);
283
+ }
284
+ :host(.ghost) :not(.disabled):hover ::slotted(cpsl-icon) {
285
+ --icon-color: var(--button-ghost-hover-color);
286
+ }
287
+
288
+ :host(.destructive) {
289
+ --button-border-radius: var(--cpsl-border-radius-secondary-button);
290
+ --button-color: var(--button-destructive-color);
291
+ --button-background-color: var(--button-destructive-background-color);
292
+ --button-border-color: var(--button-destructive-border-color);
293
+ }
294
+ :host(.destructive) ::slotted(cpsl-icon) {
295
+ --icon-color: var(--button-destructive-icon-color);
296
+ }
297
+ :host(.destructive):host(.disabled) {
298
+ --button-color: var(--button-destructive-disabled-color);
299
+ --button-background-color: var(--button-destructive-disabled-background-color);
300
+ --button-border-color: var(--button-destructive-disabled-border-color);
301
+ --button-outline-color: transparent;
302
+ }
303
+ :host(.destructive):host(.disabled) ::slotted(cpsl-icon) {
304
+ --icon-color: var(--button-destructive-disabled-icon-color);
305
+ }
306
+ :host(.destructive) :not(.disabled):hover {
307
+ --button-color: var(--button-destructive-hover-color);
308
+ --button-border-color: var(--button-destructive-hover-border-color);
309
+ --button-background-color: var(--button-destructive-hover-background-color);
310
+ }
311
+ :host(.destructive) :not(.disabled):hover ::slotted(cpsl-icon) {
312
+ --icon-color: var(--button-destructive-hover-icon-color);
224
313
  }
225
- :host(.icon) ::slotted(cpsl-icon) {
226
- --icon-color: var(--button-icon-color);
314
+ :host(.destructive) :not(.disabled):active {
315
+ --button-color: var(--button-destructive-active-color);
316
+ --button-border-color: var(--button-destructive-active-border-color);
317
+ --button-background-color: var(--button-destructive-active-background-color);
227
318
  }
228
- :host(.icon):host(.disabled) ::slotted(cpsl-icon) {
229
- --icon-color: var(--button-icon-disabled-color);
319
+ :host(.destructive) :not(.disabled):active ::slotted(cpsl-icon) {
320
+ --icon-color: var(--button-destructive-active-icon-color);
230
321
  }
231
- :host(.icon) :not(.disabled):hover ::slotted(cpsl-icon) {
232
- --icon-color: var(--button-icon-hover-color);
322
+ :host(.destructive) :not(.disabled):focus-visible {
323
+ --button-outline-color: var(--cpsl-color-destructive-button-outline);
233
324
  }
234
325
 
235
326
  .button-native {
@@ -244,11 +335,15 @@
244
335
  padding-top: var(--button-padding-top);
245
336
  padding-bottom: var(--button-padding-bottom);
246
337
  font-size: var(--button-font-size);
338
+ font-weight: var(--button-font-weight);
339
+ font-family: inherit;
340
+ white-space: nowrap;
341
+ text-decoration: none;
247
342
  border: 0px solid transparent;
248
343
  border-width: var(--button-border-width-top) var(--button-border-width-end) var(--button-border-width-bottom) var(--button-border-width-start);
249
344
  cursor: pointer;
250
345
  color: var(--button-color);
251
- background-color: var(--button-background-color);
346
+ background: var(--button-background-color);
252
347
  border-color: var(--button-border-color);
253
348
  display: flex;
254
349
  justify-content: var(--button-justify-content);
@@ -257,6 +352,7 @@
257
352
  gap: var(--button-gap);
258
353
  word-break: break-all;
259
354
  outline-color: var(--button-outline-color);
355
+ -webkit-tap-highlight-color: transparent;
260
356
  }
261
357
  :host-context([dir=rtl]) .button-native {
262
358
  border-top-left-radius: var(--button-border-radius-top-end);
@@ -1,21 +1,25 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslButton {
3
3
  constructor() {
4
+ this.as = 'button';
4
5
  this.disabled = false;
5
6
  this.fullWidth = false;
7
+ this.href = undefined;
6
8
  this.size = 'medium';
9
+ this.target = undefined;
7
10
  this.variant = 'primary';
8
11
  }
9
12
  render() {
10
- return (h(Host, { key: '62f94f1db8f1019d47a3fcd481638dd21769b74f', class: {
13
+ return (h(Host, { key: '554350e7af597bd14c9584f9924f73e04fe44093', class: {
11
14
  'primary': this.variant === 'primary',
12
15
  'secondary': this.variant === 'secondary',
13
- 'icon': this.variant === 'icon',
16
+ 'ghost': this.variant === 'ghost',
17
+ 'destructive': this.variant === 'destructive',
14
18
  'disabled': this.disabled,
15
19
  'full-width': this.fullWidth,
16
20
  'small': this.size === 'small',
17
21
  'medium': this.size === 'medium',
18
- } }, h("button", { key: '8b018abcc84330186611db6319bcf56022f5cccc', part: "button-native", class: "button-native" }, h("slot", { key: 'cad9e0b269752f30514957663de666eee0f2622c', name: "start" }), h("slot", { key: '6170188bf7734375bb3c99ae7ffab4d21c817e32' }), h("slot", { key: '2e483b4c7d21796c4e519c9c553483f633d2c8ac', name: "end" }))));
22
+ } }, h(this.as, { key: '20b6865c03e312d263c523f681bb775d8626fc9c', href: this.href, target: this.target, part: "button-native", class: "button-native" }, h("slot", { key: '4ee8d68b06ce21288e63bfcff9aa186908b89af2', name: "start" }), h("slot", { key: '9c0a5f0daa64c75886d03fb830739c8f8cfb65d9' }), h("slot", { key: 'cf9addee55b0a0d8f487313c972d7b48d6f8c75c', name: "end" }))));
19
23
  }
20
24
  static get is() { return "cpsl-button"; }
21
25
  static get encapsulation() { return "shadow"; }
@@ -31,6 +35,24 @@ export class CpslButton {
31
35
  }
32
36
  static get properties() {
33
37
  return {
38
+ "as": {
39
+ "type": "string",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "'button' | 'a'",
43
+ "resolved": "\"a\" | \"button\"",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": true,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": "The tag for the button.\nOptions are: `\"button\"`, `\"a\".\nDefault is: `\"button\"`."
51
+ },
52
+ "attribute": "as",
53
+ "reflect": false,
54
+ "defaultValue": "'button'"
55
+ },
34
56
  "disabled": {
35
57
  "type": "boolean",
36
58
  "mutable": false,
@@ -67,6 +89,23 @@ export class CpslButton {
67
89
  "reflect": false,
68
90
  "defaultValue": "false"
69
91
  },
92
+ "href": {
93
+ "type": "string",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "string",
97
+ "resolved": "string",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": true,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": "href to use when using a link."
105
+ },
106
+ "attribute": "href",
107
+ "reflect": false
108
+ },
70
109
  "size": {
71
110
  "type": "string",
72
111
  "mutable": false,
@@ -85,22 +124,39 @@ export class CpslButton {
85
124
  "reflect": false,
86
125
  "defaultValue": "'medium'"
87
126
  },
127
+ "target": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": true,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "target to use when using a link."
140
+ },
141
+ "attribute": "target",
142
+ "reflect": false
143
+ },
88
144
  "variant": {
89
145
  "type": "string",
90
146
  "mutable": false,
91
147
  "complexType": {
92
- "original": "'primary' | 'secondary' | 'icon'",
93
- "resolved": "\"icon\" | \"primary\" | \"secondary\"",
148
+ "original": "'primary' | 'secondary' | 'ghost' | 'destructive'",
149
+ "resolved": "\"destructive\" | \"ghost\" | \"primary\" | \"secondary\"",
94
150
  "references": {}
95
151
  },
96
152
  "required": false,
97
153
  "optional": true,
98
154
  "docs": {
99
155
  "tags": [],
100
- "text": "The variant of the button.\nOptions are: `\"primary\"`, `\"secondary\", `\"icon\".\nDefault is: `\"primary\"`."
156
+ "text": "The variant of the button.\nOptions are: `\"primary\"`, `\"secondary\", `\"icon\", `\"text\"`.\nDefault is: `\"primary\"`."
101
157
  },
102
158
  "attribute": "variant",
103
- "reflect": false,
159
+ "reflect": true,
104
160
  "defaultValue": "'primary'"
105
161
  }
106
162
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,UAAU;;wBAKyB,KAAK;yBAMrB,KAAK;oBAOC,QAAQ;uBAOS,SAAS;;IAE9D,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBAEL,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACrC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBACzC,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,MAAM;gBAE/B,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,YAAY,EAAE,IAAI,CAAC,SAAS;gBAE5B,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBAC9B,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;aACjC;YAED,+DAAQ,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe;gBAChD,6DAAM,IAAI,EAAC,OAAO,GAAQ;gBAC1B,8DAAa;gBACb,6DAAM,IAAI,EAAC,KAAK,GAAQ,CACjB,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button',\n styleUrl: 'cpsl-button.scss',\n shadow: true,\n})\nexport class CpslButton {\n /**\n * If the button is disabled.\n * Default is: false.\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the button takes the full width of it's container.\n * Default is: false.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The size of the button.\n * Options are: `\"small\"`, `\"medium\".\n * Default is: `\"medium\"`.\n */\n @Prop() size?: 'small' | 'medium' = 'medium';\n\n /**\n * The variant of the button.\n * Options are: `\"primary\"`, `\"secondary\", `\"icon\".\n * Default is: `\"primary\"`.\n */\n @Prop() variant?: 'primary' | 'secondary' | 'icon' = 'primary';\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n 'primary': this.variant === 'primary',\n 'secondary': this.variant === 'secondary',\n 'icon': this.variant === 'icon',\n // STATE\n 'disabled': this.disabled,\n 'full-width': this.fullWidth,\n // SIZES\n 'small': this.size === 'small',\n 'medium': this.size === 'medium',\n }}\n >\n <button part=\"button-native\" class=\"button-native\">\n <slot name=\"start\"></slot>\n <slot></slot>\n <slot name=\"end\"></slot>\n </button>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,UAAU;;kBAMS,QAAQ;wBAMQ,KAAK;yBAMrB,KAAK;;oBAYC,QAAQ;;uBAY2C,SAAS;;IAEhG,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBAEL,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACrC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBACzC,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBACjC,aAAa,EAAE,IAAI,CAAC,OAAO,KAAK,aAAa;gBAE7C,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,YAAY,EAAE,IAAI,CAAC,SAAS;gBAE5B,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBAC9B,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;aACjC;YAED,EAAC,IAAI,CAAC,EAAE,qDAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe;gBACvF,6DAAM,IAAI,EAAC,OAAO,GAAQ;gBAC1B,8DAAa;gBACb,6DAAM,IAAI,EAAC,KAAK,GAAQ,CAChB,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button',\n styleUrl: 'cpsl-button.scss',\n shadow: true,\n})\nexport class CpslButton {\n /**\n * The tag for the button.\n * Options are: `\"button\"`, `\"a\".\n * Default is: `\"button\"`.\n */\n @Prop() as?: 'button' | 'a' = 'button';\n\n /**\n * If the button is disabled.\n * Default is: false.\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the button takes the full width of it's container.\n * Default is: false.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * href to use when using a link.\n */\n @Prop() href?: string;\n\n /**\n * The size of the button.\n * Options are: `\"small\"`, `\"medium\".\n * Default is: `\"medium\"`.\n */\n @Prop() size?: 'small' | 'medium' = 'medium';\n\n /**\n * target to use when using a link.\n */\n @Prop() target?: string;\n\n /**\n * The variant of the button.\n * Options are: `\"primary\"`, `\"secondary\", `\"icon\", `\"text\"`.\n * Default is: `\"primary\"`.\n */\n @Prop({ reflect: true }) variant?: 'primary' | 'secondary' | 'ghost' | 'destructive' = 'primary';\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n 'primary': this.variant === 'primary',\n 'secondary': this.variant === 'secondary',\n 'ghost': this.variant === 'ghost',\n 'destructive': this.variant === 'destructive',\n // STATE\n 'disabled': this.disabled,\n 'full-width': this.fullWidth,\n // SIZES\n 'small': this.size === 'small',\n 'medium': this.size === 'medium',\n }}\n >\n <this.as href={this.href} target={this.target} part=\"button-native\" class=\"button-native\">\n <slot name=\"start\"></slot>\n <slot></slot>\n <slot name=\"end\"></slot>\n </this.as>\n </Host>\n );\n }\n}\n"]}
@@ -80,6 +80,7 @@
80
80
  --button-padding-end: 0px;
81
81
  --button-padding-top: 0px;
82
82
  --button-padding-bottom: 0px;
83
+ --button-border-radius: var(--cpsl-border-radius-button-group);
83
84
  height: var(--button-size);
84
85
  width: var(--button-size);
85
86
  }
@@ -32,7 +32,7 @@ export class CpslButtonGroup {
32
32
  return this.el.querySelectorAll('&> *:not(cpsl-button)');
33
33
  }
34
34
  render() {
35
- return (h(Host, { key: 'e15232f4180db66b6b7bd21b5e22980f197514be' }, h("slot", { key: 'f3c566eaf9574fb38331e8a44c5c369d1edd5223' })));
35
+ return (h(Host, { key: '18830efc419c35995cc7b31a89e2405e230f4978' }, h("slot", { key: 'f466f88653fd0fe91b258c03706b13adc78be777' })));
36
36
  }
37
37
  static get is() { return "cpsl-button-group"; }
38
38
  static get encapsulation() { return "shadow"; }
@@ -77,5 +77,5 @@
77
77
  overflow: hidden;
78
78
  border: var(--card-border-width) solid var(--card-border-color);
79
79
  border-radius: var(--card-border-radius);
80
- background-color: var(--card-background-color);
80
+ background: var(--card-background-color);
81
81
  }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslCard {
3
3
  render() {
4
- return (h(Host, { key: '8633aeaedaaf81af67835ee3ffc8964ec28ced92' }, h("div", { key: '3f2a22aad0a9dde3c6819ec9746576691d2084e5', class: { card: true } }, h("slot", { key: 'c6f573694f67d2096cac429c27f87f3b04547d4b' }))));
4
+ return (h(Host, { key: '21177f5a9ceec0246dc1fa89a052bfdadacc3063' }, h("div", { key: '0940e0aaf62b24e1be0e99c736069b5bb463854c', class: { card: true }, part: "card-container" }, h("slot", { key: '6317e03f97be9841c03b040845591043bf203e36' }))));
5
5
  }
6
6
  static get is() { return "cpsl-card"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-card.js","sourceRoot":"","sources":["../../../../src/components/cpsl-card/cpsl-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,QAAQ;IACnB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;gBACxB,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-card',\n styleUrl: 'cpsl-card.scss',\n shadow: true,\n})\nexport class CpslCard {\n render() {\n return (\n <Host>\n <div class={{ card: true }}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-card.js","sourceRoot":"","sources":["../../../../src/components/cpsl-card/cpsl-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,QAAQ;IACnB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAC,gBAAgB;gBAC/C,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-card',\n styleUrl: 'cpsl-card.scss',\n shadow: true,\n})\nexport class CpslCard {\n render() {\n return (\n <Host>\n <div class={{ card: true }} part=\"card-container\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -90,7 +90,7 @@ span.container {
90
90
  height: 100%;
91
91
  border-radius: var(--container-border-radius);
92
92
  border: var(--container-border-width) solid;
93
- background-color: var(--container-background-color-default);
93
+ background: var(--container-background-color-default);
94
94
  border-color: var(--container-border-color-default);
95
95
  transition: all 0.15s ease-in-out;
96
96
  }
@@ -102,7 +102,7 @@ span.container cpsl-icon {
102
102
  transition: all 0.15s ease-in-out;
103
103
  }
104
104
  span.container.checked {
105
- background-color: var(--container-background-color-checked);
105
+ background: var(--container-background-color-checked);
106
106
  border-color: var(--container-border-color-checked);
107
107
  }
108
108
  span.container.checked cpsl-icon {
@@ -7,7 +7,7 @@ export class CpslCheckbox {
7
7
  this.checked = undefined;
8
8
  }
9
9
  render() {
10
- return (h(Host, { key: 'b5d7963285854a20983f8655c8a9545b8d0735e9' }, h("input", { key: 'b822a505e826f06d47f1da51fff0c7f310d9c9ce', type: "checkbox", checked: this.checked }), h("span", { key: '3747cf548b8d88ceee19eae5c1df78cdc5f9c87e', onClick: this.handleCheckboxClick, class: { container: true, checked: this.checked } }, h("cpsl-icon", { key: '9d5d0cdba4b22bc2167aed23e7748201320a6553', icon: "check" }))));
10
+ return (h(Host, { key: '236c0b027e72c0c25dbc2fd3183a77400c815f8c' }, h("input", { key: '8c350e21268b87d485b16796b2058c4e47f46e75', type: "checkbox", checked: this.checked }), h("span", { key: 'b1d8fc6dd380b67eb8940f55bba47810c54ee189', onClick: this.handleCheckboxClick, class: { container: true, checked: this.checked } }, h("cpsl-icon", { key: '2b3ddcad1e2b9007bda8135a810b75a1a2cfaeca', icon: "check" }))));
11
11
  }
12
12
  static get is() { return "cpsl-checkbox"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -90,7 +90,7 @@
90
90
  color: var(--input-color);
91
91
  width: var(--input-width);
92
92
  height: var(--input-height);
93
- background-color: var(--input-background-color);
93
+ background: var(--input-background-color);
94
94
  box-sizing: border-box;
95
95
  text-align: center;
96
96
  outline: none;
@@ -87,10 +87,10 @@ export class CpslCodeInput {
87
87
  }
88
88
  render() {
89
89
  var _a;
90
- return (h(Host, { key: '2f52778c8b8b51ef7c875b53394e7275bd93412f' }, h("div", { key: 'e96c3deea7d1e4eaaef4c72fbaca702b6bb46cf1', class: "code-container" }, new Array(this.length).fill(0).map((_, i) => {
90
+ return (h(Host, { key: 'cee793d35dc39dce79834dd7c73038bf50e41442' }, h("div", { key: '1df541a5ae880c512c6c70c3b5f1cf64e1a89b8b', class: "code-container" }, new Array(this.length).fill(0).map((_, i) => {
91
91
  var _a;
92
92
  return (h("input", { class: { 'code-input': true, 'error': Boolean(this.errorText) }, id: `code-input-${i}`, maxLength: 1, onKeyDown: ev => this.handleKeyDown(i, ev), onInput: ev => this.handleInput(i, ev), onFocus: () => this.handleFocus(i), onPaste: this.handlePaste, min: 0, max: 9, value: (_a = this.code) === null || _a === void 0 ? void 0 : _a[i], inputMode: this.type === 'number' ? 'numeric' : 'text' }));
93
- })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("cpsl-icon", { icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
93
+ })), (this.errorText || this.helperText) && (h("div", { key: '2001f525a89d0b57287cd97367c6646de0de163a', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("cpsl-icon", { key: 'c274e60e8fd04e18b2ebff6386d1fa46916d2d66', icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), h("span", { key: '56566c698720936d4225eea8b07f042e67f570e5' }, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
94
94
  }
95
95
  static get is() { return "cpsl-code-input"; }
96
96
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-code-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-code-input/cpsl-code-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,aAAa;;QAmChB,gBAAW,GAAG,CAAC,GAAW,EAAE,EAAc,EAAE,EAAE;;YACpD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;YAClC,IAAI,EAAE,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC;gBACjC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,C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EAAE,EAAE,CAAC,EAC1C,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAClC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAG,CAAC,CAAC,EACrB,SAAS,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GACtD,CACH,CAAA;aAAA,CAAC,CACE;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CACtC,WAAK,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,iBAAW,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,GAAI;gBAC3E,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, Event, EventEmitter } from '@stencil/core';\nimport { CodeChangeEventDetail } from './code-change-interface';\n\n@Component({\n tag: 'cpsl-code-input',\n styleUrl: 'cpsl-code-input.scss',\n shadow: true,\n})\nexport class CpslCodeInput {\n @Element() el!: HTMLCpslCodeInputElement;\n\n /**\n * Value of the code.\n */\n // eslint-disable-next-line @stencil-community/strict-mutable\n @Prop({ mutable: true }) code: string;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * Length of the code.\n */\n @Prop() length: number;\n\n /**\n * Type of characters to accept in the code.\n * Defaults to number.\n */\n @Prop() type?: 'number' | 'string' = 'number';\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n */\n @Event() cpslInput!: EventEmitter<CodeChangeEventDetail>;\n\n private handleInput = (ind: number, ev: InputEvent) => {\n const inputElements = this.inputs;\n if (ev.inputType == 'insertText') {\n if (this.type === 'number' && isNaN(parseInt(ev.data))) {\n inputElements[ind].value = '';\n return;\n }\n inputElements[Math.min(this.length - 1, ind + 1)].focus();\n\n const newCode = `${this.code ?? ''}${ev.data}`;\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n }\n };\n\n private handleKeyDown = (ind: number, ev: KeyboardEvent) => {\n const inputElements = this.inputs;\n\n switch (ev.key) {\n case 'Backspace': {\n let newCode;\n if (!inputElements[ind].value) {\n inputElements[Math.max(0, ind - 1)].value = '';\n inputElements[Math.max(0, ind - 1)].focus();\n newCode = this.code.substring(0, ind - 1);\n } else {\n newCode = this.code.substring(0, ind);\n }\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n break;\n }\n case 'ArrowLeft': {\n setTimeout(() => {\n this.inputs[ind].setSelectionRange(1, 1);\n }, 0);\n break;\n }\n default: {\n break;\n }\n }\n };\n\n private handleFocus = (ind: number) => {\n const inputElements = this.inputs;\n\n for (const input of inputElements) {\n if (!input.value) {\n input.focus();\n break;\n } else if (input.id === `code-input-${this.length - 1}`) {\n input.focus();\n break;\n }\n }\n\n setTimeout(() => {\n inputElements[ind].setSelectionRange(1, 1);\n }, 0);\n };\n\n // TODO: figure out why pasting a string populates the first input\n private handlePaste = (e: ClipboardEvent) => {\n const inputElements = this.inputs;\n const pastedCode = e.clipboardData.getData('text');\n\n if (this.type === 'number' && isNaN(parseInt(pastedCode))) {\n // Remove illegal value from the first input. Not using a timeout here doesn't change the value properly.\n setTimeout(() => {\n inputElements[0].value = '';\n }, 0);\n return;\n }\n\n this.cpslInput.emit({\n value: pastedCode,\n });\n inputElements.forEach((input, index) => {\n input.value = pastedCode.charAt(index);\n });\n inputElements[this.length - 1].focus();\n };\n\n private get inputs() {\n return Array.from(this.el.shadowRoot.querySelectorAll('input'));\n }\n\n render() {\n return (\n <Host>\n <div class=\"code-container\">\n {new Array(this.length).fill(0).map((_, i) => (\n <input\n class={{ 'code-input': true, 'error': Boolean(this.errorText) }}\n id={`code-input-${i}`}\n maxLength={1}\n onKeyDown={ev => this.handleKeyDown(i, ev)}\n onInput={ev => this.handleInput(i, ev)}\n onFocus={() => this.handleFocus(i)}\n onPaste={this.handlePaste}\n min={0}\n max={9}\n value={this.code?.[i]}\n inputMode={this.type === 'number' ? 'numeric' : 'text'}\n />\n ))}\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-code-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-code-input/cpsl-code-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,aAAa;;QAmChB,gBAAW,GAAG,CAAC,GAAW,EAAE,EAAc,EAAE,EAAE;;YACpD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;YAClC,IAAI,EAAE,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC;gBACjC,IAAI,IAAI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AAE,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1C,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAClC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAG,CAAC,CAAC,EACrB,SAAS,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GACtD,CACH,CAAA;aAAA,CAAC,CACE;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CACtC,4DAAK,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,kEAAW,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,GAAI;gBAC3E,+DAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, Event, EventEmitter } from '@stencil/core';\nimport { CodeChangeEventDetail } from './code-change-interface';\n\n@Component({\n tag: 'cpsl-code-input',\n styleUrl: 'cpsl-code-input.scss',\n shadow: true,\n})\nexport class CpslCodeInput {\n @Element() el!: HTMLCpslCodeInputElement;\n\n /**\n * Value of the code.\n */\n // eslint-disable-next-line @stencil-community/strict-mutable\n @Prop({ mutable: true }) code: string;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * Length of the code.\n */\n @Prop() length: number;\n\n /**\n * Type of characters to accept in the code.\n * Defaults to number.\n */\n @Prop() type?: 'number' | 'string' = 'number';\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n */\n @Event() cpslInput!: EventEmitter<CodeChangeEventDetail>;\n\n private handleInput = (ind: number, ev: InputEvent) => {\n const inputElements = this.inputs;\n if (ev.inputType == 'insertText') {\n if (this.type === 'number' && isNaN(parseInt(ev.data))) {\n inputElements[ind].value = '';\n return;\n }\n inputElements[Math.min(this.length - 1, ind + 1)].focus();\n\n const newCode = `${this.code ?? ''}${ev.data}`;\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n }\n };\n\n private handleKeyDown = (ind: number, ev: KeyboardEvent) => {\n const inputElements = this.inputs;\n\n switch (ev.key) {\n case 'Backspace': {\n let newCode;\n if (!inputElements[ind].value) {\n inputElements[Math.max(0, ind - 1)].value = '';\n inputElements[Math.max(0, ind - 1)].focus();\n newCode = this.code.substring(0, ind - 1);\n } else {\n newCode = this.code.substring(0, ind);\n }\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n break;\n }\n case 'ArrowLeft': {\n setTimeout(() => {\n this.inputs[ind].setSelectionRange(1, 1);\n }, 0);\n break;\n }\n default: {\n break;\n }\n }\n };\n\n private handleFocus = (ind: number) => {\n const inputElements = this.inputs;\n\n for (const input of inputElements) {\n if (!input.value) {\n input.focus();\n break;\n } else if (input.id === `code-input-${this.length - 1}`) {\n input.focus();\n break;\n }\n }\n\n setTimeout(() => {\n inputElements[ind].setSelectionRange(1, 1);\n }, 0);\n };\n\n // TODO: figure out why pasting a string populates the first input\n private handlePaste = (e: ClipboardEvent) => {\n const inputElements = this.inputs;\n const pastedCode = e.clipboardData.getData('text');\n\n if (this.type === 'number' && isNaN(parseInt(pastedCode))) {\n // Remove illegal value from the first input. Not using a timeout here doesn't change the value properly.\n setTimeout(() => {\n inputElements[0].value = '';\n }, 0);\n return;\n }\n\n this.cpslInput.emit({\n value: pastedCode,\n });\n inputElements.forEach((input, index) => {\n input.value = pastedCode.charAt(index);\n });\n inputElements[this.length - 1].focus();\n };\n\n private get inputs() {\n return Array.from(this.el.shadowRoot.querySelectorAll('input'));\n }\n\n render() {\n return (\n <Host>\n <div class=\"code-container\">\n {new Array(this.length).fill(0).map((_, i) => (\n <input\n class={{ 'code-input': true, 'error': Boolean(this.errorText) }}\n id={`code-input-${i}`}\n maxLength={1}\n onKeyDown={ev => this.handleKeyDown(i, ev)}\n onInput={ev => this.handleInput(i, ev)}\n onFocus={() => this.handleFocus(i)}\n onPaste={this.handlePaste}\n min={0}\n max={9}\n value={this.code?.[i]}\n inputMode={this.type === 'number' ? 'numeric' : 'text'}\n />\n ))}\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -89,7 +89,7 @@ export class CpslCol {
89
89
  }
90
90
  render() {
91
91
  const isRTL = document.dir === 'rtl';
92
- return (h(Host, { key: 'e883138d5be5bfcffaa61fc3f440cfaf3c2c567d', style: Object.assign(Object.assign(Object.assign(Object.assign({}, this.calculateOffset(isRTL)), this.calculatePull(isRTL)), this.calculatePush(isRTL)), this.calculateSize()) }, h("slot", { key: '51c74a5a0895f34074b65441be91f02c3243ba8c' })));
92
+ return (h(Host, { key: 'c8173c44fb66a24831c110618000da8edadbded8', style: Object.assign(Object.assign(Object.assign(Object.assign({}, this.calculateOffset(isRTL)), this.calculatePull(isRTL)), this.calculatePush(isRTL)), this.calculateSize()) }, h("slot", { key: '04fa1eb6e5d9feaa28141c55cc0cd72a5e0e39a7' })));
93
93
  }
94
94
  static get is() { return "cpsl-col"; }
95
95
  static get encapsulation() { return "shadow"; }
@@ -68,6 +68,6 @@
68
68
 
69
69
  :host div {
70
70
  flex: 1;
71
- background-color: var(--divider-color);
71
+ background: var(--divider-color);
72
72
  height: var(--divider-height);
73
73
  }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslDivider {
3
3
  render() {
4
- return (h(Host, { key: '1ed13a5022a89b899e6a16f168bff6b71c3c2ad8' }, h("div", { key: 'e9fec054de82d84298ac7cf7fc45f239a9a78442' }), h("slot", { key: 'c6ab3f0e787ee245d206b300c68192bfb3515aa6' }), h("div", { key: '5591e16b69c4cdce5cd5b9932923a189440b7fd5' })));
4
+ return (h(Host, { key: 'd5cffdef9344f7dcac4aae1bc2acca8c02d69946' }, h("div", { key: 'e07f8107804df83537a3b8e40d124c66d2fc6f44' }), h("slot", { key: 'd97f02d46a63d32d107838b5aa50654a9593cc8a' }), h("div", { key: '2316aed010b91a65c961e2f30cc2cde03b892429' })));
5
5
  }
6
6
  static get is() { return "cpsl-divider"; }
7
7
  static get encapsulation() { return "shadow"; }