@usecapsule/core-components 2.0.9 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/css/capsule-core.css +54 -19
  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-415384b7.entry.js → p-0d0a0037.entry.js} +2 -2
  8. package/dist/capsule/p-107e1ff5.entry.js +29 -0
  9. package/dist/capsule/p-107e1ff5.entry.js.map +1 -0
  10. package/dist/capsule/p-86e48e61.js +3 -0
  11. package/dist/capsule/p-86e48e61.js.map +1 -0
  12. package/dist/capsule/p-ad14a817.entry.js +2 -0
  13. package/dist/capsule/p-b6b38e73.js +2 -0
  14. package/dist/capsule/p-b6b38e73.js.map +1 -0
  15. package/dist/capsule/p-d28b96ba.entry.js +10 -0
  16. package/dist/capsule/{p-b76350fd.entry.js.map → p-d28b96ba.entry.js.map} +1 -1
  17. package/dist/capsule/{p-4d957466.entry.js → p-fa078837.entry.js} +2 -2
  18. package/dist/capsule/{p-fa4e3c14.entry.js → p-fcead80b.entry.js} +2 -2
  19. package/dist/cjs/capsule.cjs.js +2 -2
  20. package/dist/cjs/constants-0869a780.js +29 -0
  21. package/dist/cjs/constants-0869a780.js.map +1 -0
  22. package/dist/cjs/{cpsl-alert_18.cjs.entry.js → cpsl-alert_29.cjs.entry.js} +615 -187
  23. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +1 -0
  24. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  25. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  26. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  29. package/dist/cjs/{index-87ba56f9.js → index-5733071e.js} +6 -3
  30. package/dist/cjs/index-5733071e.js.map +1 -0
  31. package/dist/cjs/index.cjs.js +53 -24
  32. package/dist/cjs/index.cjs.js.map +1 -1
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/collection/assets/icons/brush.svg +3 -0
  35. package/dist/collection/assets/icons/check-circle.svg +3 -0
  36. package/dist/collection/assets/icons/file.svg +3 -0
  37. package/dist/collection/assets/icons/home.svg +3 -0
  38. package/dist/collection/assets/icons/index.js +7 -1
  39. package/dist/collection/assets/icons/index.js.map +1 -1
  40. package/dist/collection/assets/icons/lightning-01.svg +3 -0
  41. package/dist/collection/assets/icons/lightning.svg +2 -2
  42. package/dist/collection/assets/icons/settings.svg +4 -0
  43. package/dist/collection/collection-manifest.json +11 -0
  44. package/dist/collection/components/cpsl-alert/cpsl-alert.css +21 -11
  45. package/dist/collection/components/cpsl-alert/cpsl-alert.js +34 -26
  46. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  47. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  48. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.css +67 -0
  49. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +69 -0
  50. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -0
  51. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +29 -0
  52. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +1 -0
  53. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +37 -0
  54. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +1 -0
  55. package/dist/collection/components/cpsl-avatar/cpsl-avatar.css +31 -0
  56. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +81 -0
  57. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js.map +1 -0
  58. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +29 -0
  59. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +1 -0
  60. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +37 -0
  61. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +1 -0
  62. package/dist/collection/components/cpsl-button/cpsl-button.css +175 -51
  63. package/dist/collection/components/cpsl-button/cpsl-button.js +46 -5
  64. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  65. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +88 -0
  66. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +78 -0
  67. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -0
  68. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +29 -0
  69. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +1 -0
  70. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +37 -0
  71. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +1 -0
  72. package/dist/collection/components/cpsl-card/cpsl-card.css +81 -0
  73. package/dist/collection/components/cpsl-card/cpsl-card.js +19 -0
  74. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -0
  75. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +29 -0
  76. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +1 -0
  77. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +37 -0
  78. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +1 -0
  79. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +110 -0
  80. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +64 -0
  81. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js.map +1 -0
  82. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +29 -0
  83. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +1 -0
  84. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +37 -0
  85. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +1 -0
  86. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
  87. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  88. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  89. package/dist/collection/components/cpsl-drawer/cpsl-drawer.css +90 -0
  90. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +149 -0
  91. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -0
  92. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +29 -0
  93. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +1 -0
  94. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +37 -0
  95. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +1 -0
  96. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  97. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  98. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  99. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  100. package/dist/collection/components/cpsl-input/cpsl-input.css +35 -19
  101. package/dist/collection/components/cpsl-input/cpsl-input.js +47 -6
  102. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  103. package/dist/collection/components/cpsl-modal/cpsl-modal.css +12 -2
  104. package/dist/collection/components/cpsl-modal/cpsl-modal.js +20 -2
  105. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  106. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.css +50 -0
  107. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +78 -0
  108. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -0
  109. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +29 -0
  110. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +1 -0
  111. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +37 -0
  112. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +1 -0
  113. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +61 -3
  114. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +35 -17
  115. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  116. package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +67 -0
  117. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +174 -0
  118. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -0
  119. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +29 -0
  120. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +1 -0
  121. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +37 -0
  122. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +1 -0
  123. package/dist/collection/components/cpsl-pill/cpsl-pill.js +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 +97 -0
  126. package/dist/collection/components/cpsl-radio/cpsl-radio.js +66 -0
  127. package/dist/collection/components/cpsl-radio/cpsl-radio.js.map +1 -0
  128. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +29 -0
  129. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +1 -0
  130. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +37 -0
  131. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +1 -0
  132. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  133. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  134. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  135. package/dist/collection/components/cpsl-switch/cpsl-switch.css +115 -0
  136. package/dist/collection/components/cpsl-switch/cpsl-switch.js +64 -0
  137. package/dist/collection/components/cpsl-switch/cpsl-switch.js.map +1 -0
  138. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +29 -0
  139. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +1 -0
  140. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +37 -0
  141. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +1 -0
  142. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  143. package/dist/collection/components/cpsl-table/cpsl-table.css +179 -0
  144. package/dist/collection/components/cpsl-table/cpsl-table.js +88 -0
  145. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -0
  146. package/dist/collection/components/cpsl-table/table-interface.js +2 -0
  147. package/dist/collection/components/cpsl-table/table-interface.js.map +1 -0
  148. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +29 -0
  149. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +1 -0
  150. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +37 -0
  151. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +1 -0
  152. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  153. package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
  154. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  155. package/dist/collection/constants.js +14 -0
  156. package/dist/collection/constants.js.map +1 -1
  157. package/dist/collection/index.js.map +1 -1
  158. package/dist/collection/interface.js.map +1 -1
  159. package/dist/collection/utils/theme/generateBorderRadii.js +24 -7
  160. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  161. package/dist/collection/utils/theme/generatePalette.js +22 -18
  162. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  163. package/dist/collection/utils/theme/utils.js +8 -0
  164. package/dist/collection/utils/theme/utils.js.map +1 -1
  165. package/dist/esm/capsule.js +3 -3
  166. package/dist/esm/constants-6acf4ea8.js +23 -0
  167. package/dist/esm/constants-6acf4ea8.js.map +1 -0
  168. package/dist/esm/{cpsl-alert_18.entry.js → cpsl-alert_29.entry.js} +605 -188
  169. package/dist/esm/cpsl-alert_29.entry.js.map +1 -0
  170. package/dist/esm/cpsl-animation.entry.js +2 -2
  171. package/dist/esm/cpsl-col.entry.js +2 -2
  172. package/dist/esm/cpsl-grid.entry.js +3 -3
  173. package/dist/esm/cpsl-info-box.entry.js +2 -2
  174. package/dist/esm/cpsl-row.entry.js +2 -2
  175. package/dist/esm/{index-fd970ca2.js → index-8fe9f35e.js} +6 -3
  176. package/dist/esm/index-8fe9f35e.js.map +1 -0
  177. package/dist/esm/index.js +53 -24
  178. package/dist/esm/index.js.map +1 -1
  179. package/dist/esm/loader.js +3 -3
  180. package/dist/types/assets/icons/index.d.ts +6 -0
  181. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +2 -2
  182. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +5 -0
  183. package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +6 -0
  184. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -0
  185. package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +9 -0
  186. package/dist/types/components/cpsl-card/cpsl-card.d.ts +3 -0
  187. package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +7 -0
  188. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +9 -0
  189. package/dist/types/components/cpsl-input/cpsl-input.d.ts +4 -0
  190. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +1 -0
  191. package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +9 -0
  192. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -1
  193. package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +14 -0
  194. package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +7 -0
  195. package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +7 -0
  196. package/dist/types/components/cpsl-table/cpsl-table.d.ts +9 -0
  197. package/dist/types/components/cpsl-table/table-interface.d.ts +19 -0
  198. package/dist/types/components.d.ts +435 -6
  199. package/dist/types/constants.d.ts +14 -0
  200. package/dist/types/index.d.ts +1 -1
  201. package/dist/types/interface.d.ts +35 -0
  202. package/dist/types/utils/theme/utils.d.ts +1 -0
  203. package/package.json +3 -2
  204. package/dist/capsule/p-2ce99420.entry.js +0 -29
  205. package/dist/capsule/p-2ce99420.entry.js.map +0 -1
  206. package/dist/capsule/p-6b02ea8d.entry.js +0 -2
  207. package/dist/capsule/p-b2997f3c.js +0 -3
  208. package/dist/capsule/p-b2997f3c.js.map +0 -1
  209. package/dist/capsule/p-b76350fd.entry.js +0 -10
  210. package/dist/capsule/p-c2bf050b.js +0 -2
  211. package/dist/capsule/p-c2bf050b.js.map +0 -1
  212. package/dist/cjs/constants-4bb85cc5.js +0 -12
  213. package/dist/cjs/constants-4bb85cc5.js.map +0 -1
  214. package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +0 -1
  215. package/dist/cjs/index-87ba56f9.js.map +0 -1
  216. package/dist/esm/constants-7b49abd5.js +0 -9
  217. package/dist/esm/constants-7b49abd5.js.map +0 -1
  218. package/dist/esm/cpsl-alert_18.entry.js.map +0 -1
  219. package/dist/esm/index-fd970ca2.js.map +0 -1
  220. /package/dist/capsule/{p-415384b7.entry.js.map → p-0d0a0037.entry.js.map} +0 -0
  221. /package/dist/capsule/{p-6b02ea8d.entry.js.map → p-ad14a817.entry.js.map} +0 -0
  222. /package/dist/capsule/{p-4d957466.entry.js.map → p-fa078837.entry.js.map} +0 -0
  223. /package/dist/capsule/{p-fa4e3c14.entry.js.map → p-fcead80b.entry.js.map} +0 -0
  224. /package/dist/types/Users/{vinay → taylorbosch}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -1,7 +1,6 @@
1
1
  import { mix, readableColorIsBlack } from "color2k";
2
- import { getCssColors, isColor } from "./utils";
3
- import { DEFAULT_THEME } from "../../constants";
4
- const MIXES = [0, 0.08, 0.16, 0.32, 0.48, 0.64, 0.8, 0.96];
2
+ import { getCssColors, isColor, overlayMix } from "./utils";
3
+ import { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from "../../constants";
5
4
  export const generatePalette = ({ foregroundColor, backgroundColor, customPalette }) => {
6
5
  if (!Boolean(foregroundColor) || !isColor(foregroundColor)) {
7
6
  foregroundColor = DEFAULT_THEME.foregroundColor;
@@ -17,26 +16,31 @@ export const generatePalette = ({ foregroundColor, backgroundColor, customPalett
17
16
  };
18
17
  const backgroundMixColor = isDarkBackground ? '#FFFFFF' : '#000000';
19
18
  const foregroundMixColor = isDarkBackground ? '#000000' : '#FFFFFF';
20
- MIXES.forEach(value => {
19
+ COLOR_MIXES.forEach(value => {
21
20
  palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));
22
21
  palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));
23
22
  });
24
23
  document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);
25
- document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[1]);
26
- document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[2]);
27
- document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[3]);
28
- document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[4]);
29
- document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[5]);
30
- document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[6]);
31
- document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[7]);
24
+ document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);
25
+ document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);
26
+ document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);
27
+ document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);
28
+ document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);
29
+ document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);
30
+ document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);
31
+ document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);
32
32
  document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);
33
- document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[1]);
34
- document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[2]);
35
- document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[3]);
36
- document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[4]);
37
- document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[5]);
38
- document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[6]);
39
- document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[7]);
33
+ document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);
34
+ document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);
35
+ document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);
36
+ document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);
37
+ document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);
38
+ document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);
39
+ document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);
40
+ document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);
41
+ document.documentElement.style.setProperty('--cpsl-color-utility-red', overlayMix(foregroundColor, UTILITY_COLORS.red));
42
+ document.documentElement.style.setProperty('--cpsl-color-utility-yellow', overlayMix(foregroundColor, UTILITY_COLORS.yellow));
43
+ document.documentElement.style.setProperty('--cpsl-color-utility-green', overlayMix(foregroundColor, UTILITY_COLORS.green));
40
44
  if (Boolean(customPalette)) {
41
45
  const cssColorVars = getCssColors(customPalette);
42
46
  Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));
@@ -1 +1 @@
1
- {"version":3,"file":"generatePalette.js","sourceRoot":"","sources":["../../../../src/utils/theme/generatePalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,MAAM,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAwE,EAAW,EAAE;IACpK,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3D,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3D,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IAED,MAAM,gBAAgB,GAAG,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAEhE,MAAM,OAAO,GAAY;QACvB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB;KACjB,CAAC;IAEF,MAAM,kBAAkB,GAAG,gBAAgB,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ACjD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface';\nimport { getCssColors, isColor } from './utils';\nimport { DEFAULT_THEME } from '../../constants';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n isDarkBackground: boolean;\n};\n\nconst MIXES = [0, 0.08, 0.16, 0.32, 0.48, 0.64, 0.8, 0.96];\n\nexport const generatePalette = ({ foregroundColor, backgroundColor, customPalette }: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'customPalette'>): Palette => {\n if (!Boolean(foregroundColor) || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!Boolean(backgroundColor) || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n\n const isDarkBackground = !readableColorIsBlack(backgroundColor);\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n isDarkBackground,\n };\n\n const backgroundMixColor = isDarkBackground ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkBackground ? '#000000' : '#FFFFFF';\n\n MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[7]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[7]);\n\n if (Boolean(customPalette)) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n\n return palette;\n};\n"]}
1
+ {"version":3,"file":"generatePalette.js","sourceRoot":"","sources":["../../../../src/utils/theme/generatePalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAwE,EAAW,EAAE;IACpK,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC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IACrG,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface';\nimport { getCssColors, isColor, overlayMix } from './utils';\nimport { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from '../../constants';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n isDarkBackground: boolean;\n};\n\nexport const generatePalette = ({ foregroundColor, backgroundColor, customPalette }: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'customPalette'>): Palette => {\n if (!Boolean(foregroundColor) || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!Boolean(backgroundColor) || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n\n const isDarkBackground = !readableColorIsBlack(backgroundColor);\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n isDarkBackground,\n };\n\n const backgroundMixColor = isDarkBackground ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkBackground ? '#000000' : '#FFFFFF';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);\n\n // UTILITY\n document.documentElement.style.setProperty('--cpsl-color-utility-red', overlayMix(foregroundColor, UTILITY_COLORS.red));\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', overlayMix(foregroundColor, UTILITY_COLORS.yellow));\n document.documentElement.style.setProperty('--cpsl-color-utility-green', overlayMix(foregroundColor, UTILITY_COLORS.green));\n\n if (Boolean(customPalette)) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n\n return palette;\n};\n"]}
@@ -1,3 +1,5 @@
1
+ import { parseToRgba, rgba } from "color2k";
2
+ import { overlay } from "color-blend";
1
3
  export const isColor = strColor => {
2
4
  const s = new Option().style;
3
5
  s.color = strColor;
@@ -18,4 +20,10 @@ const buildVars = (prev, obj) => {
18
20
  return resp;
19
21
  };
20
22
  export const getCssColors = (customPalette) => buildVars('--cpsl-color', customPalette);
23
+ export const overlayMix = (baseColor, overlayColor) => {
24
+ const baseRGBA = parseToRgba(baseColor);
25
+ const overlayRGBA = parseToRgba(overlayColor);
26
+ const finalRGBA = overlay({ r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 }, { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] });
27
+ return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);
28
+ };
21
29
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils/theme/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE;IAChC,MAAM,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC;IACnB,OAAO,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AAGpG,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,GAAQ,EAA2B,EAAE;IACpE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAClD,IAAI,mCAAQ,IAAI,GAAK,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,aAA4B,EAA2B,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { CustomPalette } from '../../interface';\n\nexport const isColor = strColor => {\n const s = new Option().style;\n s.color = strColor;\n return s.color !== '';\n};\n\nconst toKebabCase = (pascal: string) => pascal.replace(/([a-z0–9])([A-Z])/g, '$1-$2').toLowerCase();\n\n// This function handles arrays and objects\nconst buildVars = (prev: string, obj: any): { [k: string]: string } => {\n let resp = {};\n\n for (const k in obj) {\n const name = `${prev}-${toKebabCase(k)}`;\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n resp = { ...resp, ...buildVars(name, obj[k]) };\n } else {\n resp[name] = obj[k];\n }\n }\n\n return resp;\n};\n\nexport const getCssColors = (customPalette: CustomPalette): { [k: string]: string } => buildVars('--cpsl-color', customPalette);\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils/theme/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE;IAChC,MAAM,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC;IACnB,OAAO,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AAGpG,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,GAAQ,EAA2B,EAAE;IACpE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,GA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AAC,CAAC","sourcesContent":["import { parseToRgba, rgba } from 'color2k';\nimport { CustomPalette } from '../../interface';\nimport { overlay } from 'color-blend';\n\nexport const isColor = strColor => {\n const s = new Option().style;\n s.color = strColor;\n return s.color !== '';\n};\n\nconst toKebabCase = (pascal: string) => pascal.replace(/([a-z0–9])([A-Z])/g, '$1-$2').toLowerCase();\n\n// This function handles arrays and objects\nconst buildVars = (prev: string, obj: any): { [k: string]: string } => {\n let resp = {};\n\n for (const k in obj) {\n const name = `${prev}-${toKebabCase(k)}`;\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n resp = { ...resp, ...buildVars(name, obj[k]) };\n } else {\n resp[name] = obj[k];\n }\n }\n\n return resp;\n};\n\nexport const getCssColors = (customPalette: CustomPalette): { [k: string]: string } => buildVars('--cpsl-color', customPalette);\n\nexport const overlayMix = (baseColor: string, overlayColor: string) => {\n const baseRGBA = parseToRgba(baseColor);\n const overlayRGBA = parseToRgba(overlayColor);\n\n const finalRGBA = overlay({ r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 }, { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] });\n\n return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-fd970ca2.js';
2
- export { s as setNonce } from './index-fd970ca2.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-8fe9f35e.js';
2
+ export { s as setNonce } from './index-8fe9f35e.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,7 +16,7 @@ const patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["cpsl-animation",[[1,"cpsl-animation",{"src":[1],"replayAnimation":[64]}]]],["cpsl-col",[[1,"cpsl-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]]]],["cpsl-grid",[[1,"cpsl-grid",{"fixed":[4]}]]],["cpsl-info-box",[[1,"cpsl-info-box"]]],["cpsl-row",[[1,"cpsl-row"]]],["cpsl-alert_18",[[1,"cpsl-code-input",{"code":[1025],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"length":[2],"type":[1]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"inputmode":[1],"label":[1],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"startIconSrc":[1,"start-icon-src"],"startIcon":[1,"start-icon"],"step":[1],"type":[1],"value":[1025],"hasFocus":[32]},null,{"disabled":["handleDisable"]}],[1,"cpsl-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"footerExpanded":[4,"footer-expanded"],"footerTransitionDuration":[2,"footer-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"hasFooter":[32]},null,{"footerExpanded":["toggleHeight"],"open":["toggleModal"]}],[1,"cpsl-slide-button",{"disabled":[4],"endIcon":[1,"end-icon"],"endText":[1,"end-text"],"startIcon":[1,"start-icon"],"startText":[1,"start-text"]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-alert",{"type":[1],"icon":[1]}],[1,"cpsl-button",{"disabled":[516],"variant":[513]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{"width":[1],"hasCpslSearch":[4,"has-cpsl-search"],"items":[16],"selectedItem":[1040],"isOpen":[32],"searchQuery":[32],"filteredItems":[32]},[[9,"resize","handleResize"]],{"selectedItem":["handleSelectedItemChange"],"isOpen":["handleOpenChange"]}],[1,"cpsl-pill",{"text":[1]}],[1,"cpsl-progress-indicator",{"totalSteps":[2,"total-steps"],"step":[2]}],[1,"cpsl-qr-code",{"url":[1],"imageSrc":[1,"image-src"],"size":[2]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-tab",{"selected":[4],"tab":[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{"fullWidth":[4,"full-width"],"selectedTab":[1,"selected-tab"],"selectedTabRect":[32],"loaded":[32]},null,{"fullWidth":["updateSlider"],"selectedTab":["updateTab"]}],[1,"cpsl-text",{"color":[1],"variant":[1],"weight":[1]}],[1,"cpsl-overlay",{"open":[4],"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"]},null,{"open":["toggleHeight"]}],[1,"cpsl-icon",{"src":[1],"icon":[1]}]]]], options);
19
+ return bootstrapLazy([["cpsl-animation",[[1,"cpsl-animation",{"src":[1],"replayAnimation":[64]}]]],["cpsl-col",[[1,"cpsl-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]]]],["cpsl-grid",[[1,"cpsl-grid",{"fixed":[4]}]]],["cpsl-info-box",[[1,"cpsl-info-box"]]],["cpsl-row",[[1,"cpsl-row"]]],["cpsl-alert_29",[[1,"cpsl-pagination",{"initialPage":[2,"initial-page"],"totalPages":[2,"total-pages"],"visiblePages":[1026,"visible-pages"],"currentPage":[32]},null,{"currentPage":["watchChange"]}],[1,"cpsl-alert",{"icon":[1],"variant":[1]}],[1,"cpsl-checkbox",{"checked":[4]}],[1,"cpsl-code-input",{"code":[1025],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"length":[2],"type":[1]}],[1,"cpsl-drawer",{"anchor":[1],"open":[4],"size":[2],"transitionDuration":[2,"transition-duration"],"transitionFunction":[1,"transition-function"],"variant":[1]}],[1,"cpsl-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"footerExpanded":[4,"footer-expanded"],"footerTransitionDuration":[2,"footer-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"],"hasFooter":[32]},null,{"footerExpanded":["toggleHeight"],"open":["toggleModal"]}],[1,"cpsl-slide-button",{"disabled":[4],"endIcon":[1,"end-icon"],"endText":[1,"end-text"],"startIcon":[1,"start-icon"],"startText":[1,"start-text"]}],[1,"cpsl-table",{"columns":[16],"rows":[16]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-app-bar",{"height":[2],"position":[1]}],[1,"cpsl-avatar",{"alt":[1],"src":[1],"variant":[1]}],[1,"cpsl-card"],[1,"cpsl-divider"],[1,"cpsl-dropdown",{"width":[1],"hasCpslSearch":[4,"has-cpsl-search"],"items":[16],"selectedItem":[1040],"isOpen":[32],"searchQuery":[32],"filteredItems":[32]},[[9,"resize","handleResize"]],{"selectedItem":["handleSelectedItemChange"],"isOpen":["handleOpenChange"]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"inputmode":[1],"label":[1],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"showOptionalLabel":[4,"show-optional-label"],"spellcheck":[4],"startIconSrc":[1,"start-icon-src"],"startIcon":[1,"start-icon"],"step":[1],"type":[1],"value":[1025],"hasFocus":[32]},null,{"disabled":["handleDisable"]}],[1,"cpsl-nav-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-pill",{"text":[1]}],[1,"cpsl-progress-indicator",{"totalSteps":[2,"total-steps"],"step":[2]}],[1,"cpsl-qr-code",{"url":[1],"imageSrc":[1,"image-src"],"size":[2]}],[1,"cpsl-radio",{"checked":[4]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-switch",{"checked":[4]}],[1,"cpsl-tab",{"selected":[4],"tab":[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{"fullWidth":[4,"full-width"],"selectedTab":[1,"selected-tab"],"selectedTabRect":[32],"loaded":[32]},null,{"fullWidth":["updateSlider"],"selectedTab":["updateTab"]}],[1,"cpsl-button",{"disabled":[516],"fullWidth":[4,"full-width"],"size":[1],"variant":[1]}],[1,"cpsl-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-overlay",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}],[1,"cpsl-text",{"color":[1],"variant":[1],"weight":[1]}],[1,"cpsl-icon",{"src":[1],"icon":[1]}]]]], options);
20
20
  });
21
21
 
22
22
  //# sourceMappingURL=capsule.js.map
@@ -0,0 +1,23 @@
1
+ const MOBILE_SIZE = 480;
2
+ const DEFAULT_THEME = {
3
+ foregroundColor: '#121212',
4
+ backgroundColor: '#FAFAFA',
5
+ };
6
+ const COLOR_MIXES = [0, 0.04, 0.08, 0.16, 0.32, 0.48, 0.64, 0.8, 0.96];
7
+ const UTILITY_COLORS = {
8
+ red: 'rgba(240, 68, 56, 1)',
9
+ yellow: 'rgba(251, 188, 4, 1)',
10
+ green: 'rgba(52, 168, 83, 1)',
11
+ };
12
+ const DEFAULT_Z_INDICES = {
13
+ modalNoOverlay: 0,
14
+ appBar: 10000,
15
+ overlay: 10001,
16
+ modal: 10002,
17
+ drawer: 10004,
18
+ modalWrapper: 10005,
19
+ };
20
+
21
+ export { COLOR_MIXES as C, DEFAULT_THEME as D, MOBILE_SIZE as M, UTILITY_COLORS as U, DEFAULT_Z_INDICES as a };
22
+
23
+ //# sourceMappingURL=constants-6acf4ea8.js.map
@@ -0,0 +1 @@
1
+ {"file":"constants-6acf4ea8.js","mappings":"MAEa,WAAW,GAAG,IAAI;MAElB,aAAa,GAAU;IAClC,eAAe,EAAE,SAAS;IAC1B,eAAe,EAAE,SAAS;EAC1B;MAEW,WAAW,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;MAEjE,cAAc,GAAmD;IAC5E,GAAG,EAAE,sBAAsB;IAC3B,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,sBAAsB;EAC7B;MAEW,iBAAiB,GAAG;IAC/B,cAAc,EAAE,CAAC;IACjB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,KAAK;;;;;","names":[],"sources":["src/constants.ts"],"sourcesContent":["import { Theme } from './interface';\n\nexport const MOBILE_SIZE = 480;\n\nexport const DEFAULT_THEME: Theme = {\n foregroundColor: '#121212',\n backgroundColor: '#FAFAFA',\n};\n\nexport const COLOR_MIXES = [0, 0.04, 0.08, 0.16, 0.32, 0.48, 0.64, 0.8, 0.96];\n\nexport const UTILITY_COLORS: { red: string; yellow: string; green: string } = {\n red: 'rgba(240, 68, 56, 1)',\n yellow: 'rgba(251, 188, 4, 1)',\n green: 'rgba(52, 168, 83, 1)',\n};\n\nexport const DEFAULT_Z_INDICES = {\n modalNoOverlay: 0,\n appBar: 10000,\n overlay: 10001,\n modal: 10002,\n drawer: 10004,\n modalWrapper: 10005,\n};\n"],"version":3}