@usecapsule/core-components 3.3.0-dev.1 → 3.3.0-dev.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/css/capsule-core.css +25 -10
  2. package/css/capsule-core.css.map +1 -1
  3. package/dist/capsule/capsule.esm.js +1 -1
  4. package/dist/capsule/capsule.esm.js.map +1 -1
  5. package/dist/capsule/index.esm.js +1 -1
  6. package/dist/capsule/index.esm.js.map +1 -1
  7. package/dist/capsule/p-0e558c7f.entry.js +10 -0
  8. package/dist/capsule/{p-05cb769b.entry.js.map → p-0e558c7f.entry.js.map} +1 -1
  9. package/dist/capsule/{p-69c3c53b.entry.js → p-1bd11889.entry.js} +2 -2
  10. package/dist/capsule/{p-69c3c53b.entry.js.map → p-1bd11889.entry.js.map} +1 -1
  11. package/dist/capsule/p-32cdf894.entry.js +2 -0
  12. package/dist/capsule/p-32cdf894.entry.js.map +1 -0
  13. package/dist/capsule/p-3b042fd1.entry.js +2 -0
  14. package/dist/capsule/p-5965b15e.entry.js +2 -0
  15. package/dist/capsule/{p-c1aa1ffb.entry.js.map → p-5965b15e.entry.js.map} +1 -1
  16. package/dist/capsule/{p-742bda0b.entry.js → p-5d62e610.entry.js} +2 -2
  17. package/dist/capsule/p-60508b1e.entry.js +20 -0
  18. package/dist/capsule/p-60508b1e.entry.js.map +1 -0
  19. package/dist/cjs/capsule.cjs.js +1 -1
  20. package/dist/cjs/{cpsl-alert_33.cjs.entry.js → cpsl-alert_34.cjs.entry.js} +17028 -13461
  21. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -0
  22. package/dist/cjs/cpsl-animation.cjs.entry.js +3 -2
  23. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cpsl-hero.cjs.entry.js +9 -6
  25. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  29. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
  30. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  31. package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
  32. package/dist/cjs/index-65f57499.js +2 -2
  33. package/dist/cjs/index.cjs.js +35 -12
  34. package/dist/cjs/index.cjs.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
  37. package/dist/collection/assets/icons/bank.svg +3 -0
  38. package/dist/collection/assets/icons/credit-card.svg +3 -0
  39. package/dist/collection/assets/icons/dot.svg +3 -0
  40. package/dist/collection/assets/icons/download.svg +3 -0
  41. package/dist/collection/assets/icons/globe.svg +3 -0
  42. package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
  43. package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
  44. package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
  45. package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
  46. package/dist/collection/assets/icons/index.js +21 -1
  47. package/dist/collection/assets/icons/index.js.map +1 -1
  48. package/dist/collection/assets/icons/link-external.svg +3 -0
  49. package/dist/collection/assets/icons/log-out.svg +3 -0
  50. package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
  51. package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
  52. package/dist/collection/assets/icons/qr-code-02.svg +3 -0
  53. package/dist/collection/assets/icons/qr-code.svg +3 -0
  54. package/dist/collection/assets/icons/refresh.svg +3 -3
  55. package/dist/collection/assets/icons/search.svg +3 -0
  56. package/dist/collection/assets/icons/send.svg +3 -0
  57. package/dist/collection/assets/icons/shield.svg +3 -0
  58. package/dist/collection/assets/icons/stripe-brand.svg +3 -0
  59. package/dist/collection/collection-manifest.json +2 -1
  60. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  61. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  62. package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
  63. package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +11 -129
  64. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
  65. package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
  66. package/dist/collection/components/cpsl-button/cpsl-button.js +6 -5
  67. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  68. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  69. package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
  70. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
  71. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +11 -7
  72. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  73. package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
  74. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +1 -1
  75. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  76. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
  77. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  78. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +1 -6
  79. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  80. package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
  81. package/dist/collection/components/cpsl-hero/cpsl-hero.js +63 -9
  82. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  83. package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
  84. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  85. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
  86. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
  87. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
  88. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  89. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
  90. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  91. package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
  92. package/dist/collection/components/cpsl-input/cpsl-input.js +100 -28
  93. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  94. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
  95. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  96. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  97. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  98. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  99. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  100. package/dist/collection/components/cpsl-popover/cpsl-popover.css +2 -0
  101. package/dist/collection/components/cpsl-popover/cpsl-popover.js +9 -11
  102. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  103. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
  104. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
  105. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  106. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  107. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  108. package/dist/collection/components/cpsl-select/cpsl-select.css +17 -0
  109. package/dist/collection/components/cpsl-select/cpsl-select.js +95 -5
  110. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  111. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  112. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
  113. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  114. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  115. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
  116. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
  117. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
  118. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  119. package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
  120. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  121. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  122. package/dist/collection/components/cpsl-table/cpsl-table.js +1 -9
  123. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  124. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
  125. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -4
  126. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  127. package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
  128. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  129. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  130. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
  131. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  132. package/dist/collection/interface.js.map +1 -1
  133. package/dist/collection/utils/theme/generateBorderRadii.js +4 -3
  134. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  135. package/dist/collection/utils/theme/generatePalette.js +22 -6
  136. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  137. package/dist/collection/utils/theme/generateTheme.js +9 -3
  138. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  139. package/dist/collection/utils/theme/utils.js.map +1 -1
  140. package/dist/esm/capsule.js +1 -1
  141. package/dist/esm/{cpsl-alert_33.entry.js → cpsl-alert_34.entry.js} +17029 -13463
  142. package/dist/esm/cpsl-alert_34.entry.js.map +1 -0
  143. package/dist/esm/cpsl-animation.entry.js +2 -1
  144. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  145. package/dist/esm/cpsl-hero.entry.js +10 -7
  146. package/dist/esm/cpsl-hero.entry.js.map +1 -1
  147. package/dist/esm/cpsl-identicon.entry.js +1 -1
  148. package/dist/esm/cpsl-info-box.entry.js +2 -2
  149. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  150. package/dist/esm/cpsl-modal-v2.entry.js +1 -1
  151. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  152. package/dist/esm/cpsl-row.entry.js +1 -1
  153. package/dist/esm/index-91db3414.js +2 -2
  154. package/dist/esm/index.js +35 -12
  155. package/dist/esm/index.js.map +1 -1
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/types/assets/icons/index.d.ts +20 -0
  158. package/dist/types/components/{cpsl-modal/cpsl-modal.d.ts → cpsl-auth-modal/cpsl-auth-modal.d.ts} +3 -23
  159. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
  160. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +18 -3
  161. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
  162. package/dist/types/components/cpsl-input/cpsl-input.d.ts +13 -3
  163. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
  164. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -0
  165. package/dist/types/components/cpsl-select/cpsl-select.d.ts +22 -1
  166. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  167. package/dist/types/components.d.ts +222 -146
  168. package/dist/types/interface.d.ts +13 -0
  169. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  170. package/dist/types/utils/theme/generatePalette.d.ts +4 -2
  171. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  172. package/package.json +3 -2
  173. package/dist/capsule/p-0462f723.js +0 -2
  174. package/dist/capsule/p-0462f723.js.map +0 -1
  175. package/dist/capsule/p-05cb769b.entry.js +0 -10
  176. package/dist/capsule/p-0eea90f8.entry.js +0 -2
  177. package/dist/capsule/p-4203888d.entry.js +0 -29
  178. package/dist/capsule/p-4203888d.entry.js.map +0 -1
  179. package/dist/capsule/p-c1aa1ffb.entry.js +0 -2
  180. package/dist/capsule/p-d351f076.entry.js +0 -2
  181. package/dist/capsule/p-d351f076.entry.js.map +0 -1
  182. package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
  183. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  184. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +0 -1
  185. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
  186. package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
  187. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  188. package/dist/esm/cpsl-alert_33.entry.js.map +0 -1
  189. /package/dist/capsule/{p-0eea90f8.entry.js.map → p-3b042fd1.entry.js.map} +0 -0
  190. /package/dist/capsule/{p-742bda0b.entry.js.map → p-5d62e610.entry.js.map} +0 -0
@@ -5,7 +5,7 @@ export class CpslTileButton {
5
5
  this.icon = undefined;
6
6
  }
7
7
  render() {
8
- return (h(Host, { key: 'b7efccced9e21362a8886affca5f1e5d76561128' }, h("button", { key: 'f4507790f04e74551830475b01e28c346776b21d', class: "button-native" }, h("cpsl-icon", { key: '0709e96b514f503171f5e3c5c1982ad75e1fd722', exportparts: "icon", src: this.src, icon: this.icon }), h("slot", { key: 'f0107493204c5d605a37f994360171507b1004de' }))));
8
+ return (h(Host, { key: 'efb0b13e1e196e598d5ed3a7a4ddd90c4886778d' }, h("button", { key: 'bce5128aba915f22fd60af8ffd5dbcaefd0b4253', class: "button-native" }, h("cpsl-icon", { key: 'efdc98a5146432a589355983b2e5098d3d41ec28', exportparts: "icon", src: this.src, icon: this.icon }), h("slot", { key: '6bc4e41a608e42855c48130606c62a2562b9da36' }))));
9
9
  }
10
10
  static get is() { return "cpsl-tile-button"; }
11
11
  static get encapsulation() { return "shadow"; }
@@ -43,7 +43,7 @@ export class CpslTileButton {
43
43
  "mutable": false,
44
44
  "complexType": {
45
45
  "original": "IconType",
46
- "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
46
+ "resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
47
47
  "references": {
48
48
  "IconType": {
49
49
  "location": "import",
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Icons } from './assets/icons';\nimport { Images } from './assets/images';\n\nexport type PredefinedColors =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'light'\n | 'medium'\n | 'dark';\n\n// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nexport type AutocompleteTypes =\n | 'on'\n | 'off'\n | 'name'\n | 'honorific-prefix'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'honorific-suffix'\n | 'nickname'\n | 'email'\n | 'username'\n | 'new-password'\n | 'current-password'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'address-level4'\n | 'address-level3'\n | 'address-level2'\n | 'address-level1'\n | 'country'\n | 'country-name'\n | 'postal-code'\n | 'cc-name'\n | 'cc-given-name'\n | 'cc-additional-name'\n | 'cc-family-name'\n | 'cc-family-name'\n | 'cc-number'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-csc'\n | 'cc-type'\n | 'transaction-currency'\n | 'transaction-amount'\n | 'language'\n | 'bday'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'sex'\n | 'tel'\n | 'tel-country-code'\n | 'tel-national'\n | 'tel-area-code'\n | 'tel-local'\n | 'tel-extension'\n | 'impp'\n | 'url'\n | 'photo';\n\nexport type TextFieldTypes =\n | 'date'\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'time'\n | 'week'\n | 'month'\n | 'datetime-local';\n\nexport type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);\n\nexport type Color = LiteralUnion<PredefinedColors, string>;\n\nexport type CssClassMap = { [className: string]: boolean };\n\nexport type IconType = keyof typeof Icons;\n\nexport type ImageType = keyof typeof Images;\n\nexport type Theme = {\n foregroundColor?: string;\n backgroundColor?: string;\n borderRadius?: BorderRadius;\n font?: string;\n customPalette?: CustomPalette;\n customFontSizes?: CustomFontSizes;\n customBorderRadii?: CustomBorderRadii;\n};\n\nexport type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface CustomBorderRadii {\n input?: string;\n select?: string;\n fileSelect?: string;\n alert?: string;\n tabs?: string;\n primaryButton?: string;\n secondaryButton?: string;\n destructiveButton?: string;\n tileButton?: string;\n modal?: string;\n pill?: string;\n qrCode?: string;\n infoBox?: string;\n tableContainer?: string;\n switch?: string;\n checkbox?: string;\n radio?: string;\n avatar?: string;\n card?: string;\n buttonGroup?: string;\n}\nexport interface CustomFontSizes {\n body2XS?: string;\n bodyXS?: string;\n bodyS?: string;\n bodyM?: string;\n bodyL?: string;\n bodyXL?: string;\n headingXS?: string;\n headingS?: string;\n headingM?: string;\n headingL?: string;\n headingXL?: string;\n heading2XL?: string;\n}\n\nexport interface CustomPalette {\n text?: {\n primary?: string;\n secondary?: string;\n subtle?: string;\n inverted?: string;\n error?: string;\n };\n modal?: {\n surface?: {\n main?: string;\n footer?: string;\n };\n border?: string;\n };\n input?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n };\n select?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n dropdown?: {\n border?: string;\n };\n };\n file?: {\n surface?: {\n disabled?: string;\n default?: string;\n drag?: string;\n };\n border?: {\n placeholder?: string;\n error?: string;\n };\n };\n tileButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n };\n border?: string;\n };\n primaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n secondaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n destructiveButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n divider?: string;\n spinner?: {\n path?: string;\n circle?: string;\n };\n pill?: {\n text?: string;\n container?: {\n background?: string;\n border?: string;\n };\n };\n progressIndicator?: {\n active?: string;\n next?: string;\n previous?: string;\n };\n qr?: {\n fill?: string;\n background?: string;\n border?: string;\n };\n slideButton?: {\n slider?: {\n background?: string;\n border?: string;\n text?: string;\n container?: {\n start?: {\n background?: string;\n border?: string;\n };\n end?: {\n background?: string;\n border?: string;\n };\n };\n };\n start?: {\n text?: string;\n };\n end?: {\n text?: string;\n };\n };\n alert?: {\n surface?: {\n error?: string;\n };\n border?: {\n error?: string;\n };\n };\n switch?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n thumb?: {\n default?: string;\n checked?: string;\n };\n };\n checkbox?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n icon?: string;\n };\n radio?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n };\n card?: {\n surface?: string;\n border?: string;\n };\n}\n\nexport interface InteractionCallback {\n eventName: string;\n callback: (ev: any) => void;\n}\n"]}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Icons } from './assets/icons';\nimport { Images } from './assets/images';\n\nexport type PredefinedColors = 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark';\n\n// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nexport type AutocompleteTypes =\n | 'on'\n | 'off'\n | 'name'\n | 'honorific-prefix'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'honorific-suffix'\n | 'nickname'\n | 'email'\n | 'username'\n | 'new-password'\n | 'current-password'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'address-level4'\n | 'address-level3'\n | 'address-level2'\n | 'address-level1'\n | 'country'\n | 'country-name'\n | 'postal-code'\n | 'cc-name'\n | 'cc-given-name'\n | 'cc-additional-name'\n | 'cc-family-name'\n | 'cc-family-name'\n | 'cc-number'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-csc'\n | 'cc-type'\n | 'transaction-currency'\n | 'transaction-amount'\n | 'language'\n | 'bday'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'sex'\n | 'tel'\n | 'tel-country-code'\n | 'tel-national'\n | 'tel-area-code'\n | 'tel-local'\n | 'tel-extension'\n | 'impp'\n | 'url'\n | 'photo';\n\nexport type TextFieldTypes = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'time' | 'week' | 'month' | 'datetime-local';\n\nexport type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);\n\nexport type Color = LiteralUnion<PredefinedColors, string>;\n\nexport type CssClassMap = { [className: string]: boolean };\n\nexport type IconType = keyof typeof Icons;\n\nexport type ImageType = keyof typeof Images;\n\nexport type Theme = {\n foregroundColor?: string;\n backgroundColor?: string;\n accentColor?: string;\n darkForegroundColor?: string;\n darkBackgroundColor?: string;\n darkAccentColor?: string;\n mode?: 'light' | 'dark';\n borderRadius?: BorderRadius;\n font?: string;\n customPalette?: CustomPalette;\n customFontSizes?: CustomFontSizes;\n customBorderRadii?: CustomBorderRadii;\n};\n\nexport type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface CustomBorderRadii {\n input?: string;\n select?: string;\n fileSelect?: string;\n alert?: string;\n tabs?: string;\n primaryButton?: string;\n secondaryButton?: string;\n destructiveButton?: string;\n tileButton?: string;\n modal?: string;\n pill?: string;\n qrCode?: string;\n infoBox?: string;\n tableContainer?: string;\n switch?: string;\n checkbox?: string;\n radio?: string;\n avatar?: string;\n card?: string;\n buttonGroup?: string;\n}\nexport interface CustomFontSizes {\n body2XS?: string;\n bodyXS?: string;\n bodyS?: string;\n bodyM?: string;\n bodyL?: string;\n bodyXL?: string;\n headingXS?: string;\n headingS?: string;\n headingM?: string;\n headingL?: string;\n headingXL?: string;\n heading2XL?: string;\n}\n\nexport interface CustomPalette {\n text?: {\n primary?: string;\n secondary?: string;\n subtle?: string;\n inverted?: string;\n error?: string;\n };\n modal?: {\n surface?: {\n main?: string;\n footer?: string;\n };\n border?: string;\n };\n input?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n };\n select?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n dropdown?: {\n border?: string;\n };\n };\n file?: {\n surface?: {\n disabled?: string;\n default?: string;\n drag?: string;\n };\n border?: {\n placeholder?: string;\n error?: string;\n };\n };\n tileButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n };\n border?: string;\n };\n primaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n secondaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n destructiveButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n divider?: string;\n spinner?: {\n path?: string;\n circle?: string;\n };\n pill?: {\n text?: string;\n container?: {\n background?: string;\n border?: string;\n };\n };\n progressIndicator?: {\n active?: string;\n next?: string;\n previous?: string;\n };\n qr?: {\n fill?: string;\n background?: string;\n border?: string;\n };\n slideButton?: {\n slider?: {\n background?: string;\n border?: string;\n text?: string;\n container?: {\n start?: {\n background?: string;\n border?: string;\n };\n end?: {\n background?: string;\n border?: string;\n };\n };\n };\n start?: {\n text?: string;\n };\n end?: {\n text?: string;\n };\n };\n alert?: {\n surface?: {\n error?: string;\n };\n border?: {\n error?: string;\n };\n };\n switch?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n thumb?: {\n default?: string;\n checked?: string;\n };\n };\n checkbox?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n icon?: string;\n };\n radio?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n };\n card?: {\n surface?: string;\n border?: string;\n };\n iconGroup?: {\n surface?: string;\n border?: string;\n icon?: {\n default?: string;\n disabled?: string;\n };\n };\n}\n\nexport interface InteractionCallback {\n eventName: string;\n callback: (ev: any) => void;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { getCssBorderRadii } from "./utils";
2
- export const generateBorderRadii = ({ borderRadius, customBorderRadii, }) => {
2
+ export const generateBorderRadii = ({ borderRadius, customBorderRadii }) => {
3
3
  let mediumRadius, largeRadius, checkboxRadius = 4;
4
4
  const fullRadius = 1000;
5
5
  let isFull = false;
@@ -50,12 +50,13 @@ export const generateBorderRadii = ({ borderRadius, customBorderRadii, }) => {
50
50
  document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);
51
51
  document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);
52
52
  document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);
53
- document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isFull ? fullRadius : mediumRadius}px`);
53
+ document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);
54
54
  document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);
55
55
  document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);
56
+ document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);
56
57
  document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);
57
58
  document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);
58
- document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${mediumRadius}px`);
59
+ document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);
59
60
  document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);
60
61
  document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);
61
62
  document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);
@@ -1 +1 @@
1
- {"version":3,"file":"generateBorderRadii.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateBorderRadii.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,YAAY,EACZ,iBAAiB,GACiC,EAAE,EAAE;IACtD,IAAI,YAAoB,EACtB,WAAmB,EACnB,cAAc,GAAW,CAAC,CAAC;IAC7B,MAAM,UAAU,GAAG,IAAI,CAAC;IACxB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,MAAM,GAAG,KAAK,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AQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Theme } from '../../interface';\nimport { getCssBorderRadii } from './utils';\n\nexport const generateBorderRadii = ({\n borderRadius,\n customBorderRadii,\n}: Pick<Theme, 'borderRadius' | 'customBorderRadii'>) => {\n let mediumRadius: number,\n largeRadius: number,\n checkboxRadius: number = 4;\n const fullRadius = 1000;\n let isFull = false;\n let isNone = false;\n\n switch (borderRadius) {\n case 'none': {\n isNone = true;\n mediumRadius = 0;\n largeRadius = 0;\n checkboxRadius = 0;\n break;\n }\n case 'xs': {\n mediumRadius = 2;\n largeRadius = 4;\n checkboxRadius = 2;\n break;\n }\n case 'sm': {\n mediumRadius = 4;\n largeRadius = 8;\n break;\n }\n case 'md': {\n mediumRadius = 8;\n largeRadius = 16;\n break;\n }\n case 'xl': {\n mediumRadius = 16;\n largeRadius = 32;\n break;\n }\n case 'full': {\n mediumRadius = 24;\n largeRadius = 32;\n isFull = true;\n break;\n }\n default:\n case 'lg': {\n mediumRadius = 12;\n largeRadius = 24;\n break;\n }\n }\n\n document.documentElement.style.setProperty('--cpsl-border-radius-input', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty(\n '--cpsl-border-radius-primary-button',\n `${isFull ? fullRadius : mediumRadius}px`,\n );\n document.documentElement.style.setProperty(\n '--cpsl-border-radius-secondary-button',\n `${isFull ? fullRadius : mediumRadius}px`,\n );\n document.documentElement.style.setProperty(\n '--cpsl-border-radius-destructive-button',\n `${isFull ? fullRadius : mediumRadius}px`,\n );\n document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-button-group', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-card', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-modal', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-checkbox', `${checkboxRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);\n\n if (customBorderRadii) {\n const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);\n Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n"]}
1
+ {"version":3,"file":"generateBorderRadii.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateBorderRadii.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAqD,EAAE,EAAE;IAC5H,IAAI,YAAoB,EACtB,WAAmB,EACnB,cAAc,GAAW,CAAC,CAAC;IAC7B,MAAM,UAAU,GAAG,IAAI,CAAC;IACxB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,QAAQ,YA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AAC,CAAC;QAChE,MAAM,CAAC,OAAO,CAAC,kBAAkB,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;IAC3G,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Theme } from '../../interface';\nimport { getCssBorderRadii } from './utils';\n\nexport const generateBorderRadii = ({ borderRadius, customBorderRadii }: Pick<Theme, 'borderRadius' | 'customBorderRadii'>) => {\n let mediumRadius: number,\n largeRadius: number,\n checkboxRadius: number = 4;\n const fullRadius = 1000;\n let isFull = false;\n let isNone = false;\n\n switch (borderRadius) {\n case 'none': {\n isNone = true;\n mediumRadius = 0;\n largeRadius = 0;\n checkboxRadius = 0;\n break;\n }\n case 'xs': {\n mediumRadius = 2;\n largeRadius = 4;\n checkboxRadius = 2;\n break;\n }\n case 'sm': {\n mediumRadius = 4;\n largeRadius = 8;\n break;\n }\n case 'md': {\n mediumRadius = 8;\n largeRadius = 16;\n break;\n }\n case 'xl': {\n mediumRadius = 16;\n largeRadius = 32;\n break;\n }\n case 'full': {\n mediumRadius = 24;\n largeRadius = 32;\n isFull = true;\n break;\n }\n default:\n case 'lg': {\n mediumRadius = 12;\n largeRadius = 24;\n break;\n }\n }\n\n document.documentElement.style.setProperty('--cpsl-border-radius-input', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-button-group', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-card', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-modal', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-checkbox', `${checkboxRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);\n\n if (customBorderRadii) {\n const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);\n Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n"]}
@@ -1,24 +1,29 @@
1
1
  import { mix, readableColorIsBlack } from "color2k";
2
2
  import { getCssColors, isColor, overlayMix } from "./utils";
3
3
  import { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from "../../constants";
4
- export const generatePalette = ({ foregroundColor, backgroundColor, customPalette, }) => {
4
+ export const generatePalette = ({ foregroundColor, backgroundColor, accentColor, isDarkTheme, customPalette, }) => {
5
5
  if (!foregroundColor || !isColor(foregroundColor)) {
6
6
  foregroundColor = DEFAULT_THEME.foregroundColor;
7
7
  }
8
8
  if (!backgroundColor || !isColor(backgroundColor)) {
9
9
  backgroundColor = DEFAULT_THEME.backgroundColor;
10
10
  }
11
- const isDarkBackground = !readableColorIsBlack(backgroundColor);
11
+ if (!Boolean(accentColor) || !isColor(accentColor)) {
12
+ accentColor = foregroundColor;
13
+ }
14
+ const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;
12
15
  const palette = {
13
16
  foregroundColors: [],
14
17
  backgroundColors: [],
15
- isDarkBackground,
18
+ accentColors: [],
16
19
  };
17
- const backgroundMixColor = isDarkBackground ? '#FFFFFF' : '#000000';
18
- const foregroundMixColor = isDarkBackground ? '#000000' : '#FFFFFF';
20
+ const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';
21
+ const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';
22
+ const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';
19
23
  COLOR_MIXES.forEach(value => {
20
24
  palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));
21
25
  palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));
26
+ palette.accentColors.push(mix(accentColor, accentMixColor, value));
22
27
  });
23
28
  // BACKGROUND
24
29
  document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);
@@ -40,6 +45,18 @@ export const generatePalette = ({ foregroundColor, backgroundColor, customPalett
40
45
  document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);
41
46
  document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);
42
47
  document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);
48
+ // ACCENT
49
+ document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);
50
+ document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);
51
+ document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);
52
+ document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);
53
+ document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);
54
+ document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);
55
+ document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);
56
+ document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);
57
+ document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);
58
+ // CONTRAST
59
+ document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');
43
60
  const utilityLightMixColor = '#FFFFFF';
44
61
  const utilityLightMixValue = 0.72;
45
62
  // UTILITY
@@ -56,6 +73,5 @@ export const generatePalette = ({ foregroundColor, backgroundColor, customPalett
56
73
  const cssColorVars = getCssColors(customPalette);
57
74
  Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));
58
75
  }
59
- return palette;
60
76
  };
61
77
  //# sourceMappingURL=generatePalette.js.map
@@ -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,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,eAAe,EACf,eAAe,EACf,aAAa,GACwD,EAAW,EAAE;IAClF,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI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AAK,CAAC,WAAW,CACxC,mCAAmC,EACnC,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CACxD,CAAC;IACF,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACxC,kCAAkC,EAClC,GAAG,CAAC,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CACvD,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QACjD,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, 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 = ({\n foregroundColor,\n backgroundColor,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'customPalette'>): Palette => {\n if (!foregroundColor || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!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 const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-red-light',\n mix(red, utilityLightMixColor, utilityLightMixValue),\n );\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-yellow-light',\n mix(yellow, utilityLightMixColor, utilityLightMixValue),\n );\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-green-light',\n mix(green, utilityLightMixColor, utilityLightMixValue),\n );\n\n if (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,EAC9B,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACmG,EAAE,EAAE;IACpH,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACnD,WAAW,GAAG,eAAe,CAAC;IAChC,CAAC;IAED,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C,KAAK,CAAC,WAAW,CAAC,gCAAgC,EAAE,GAAG,CAAC,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACnI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,mCAAmC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACzI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,kCAAkC,EAAE,GAAG,CAAC,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEvI,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QACjD,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;AACH,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 accentColors: string[];\n};\n\nexport const generatePalette = ({\n foregroundColor,\n backgroundColor,\n accentColor,\n isDarkTheme,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette'> & { isDarkTheme: boolean }) => {\n if (!foregroundColor || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!backgroundColor || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n if (!Boolean(accentColor) || !isColor(accentColor)) {\n accentColor = foregroundColor;\n }\n\n const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n accentColors: [],\n };\n\n const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';\n const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n palette.accentColors.push(mix(accentColor, accentMixColor, 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 // ACCENT\n document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);\n\n // CONTRAST\n document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');\n\n const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red-light', mix(red, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow-light', mix(yellow, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-green-light', mix(green, utilityLightMixColor, utilityLightMixValue));\n\n if (customPalette) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n"]}
@@ -6,10 +6,16 @@ import { generatePalette } from "./generatePalette";
6
6
  * Generates css theme variables.
7
7
  * @returns @boolean Whether background is dark or not.
8
8
  */
9
- export const generateTheme = ({ foregroundColor = DEFAULT_THEME.foregroundColor, backgroundColor = DEFAULT_THEME.backgroundColor, font, customPalette, borderRadius, customFontSizes, customBorderRadii, }) => {
10
- const palette = generatePalette({ foregroundColor, backgroundColor, customPalette });
9
+ export const generateTheme = ({ foregroundColor = DEFAULT_THEME.foregroundColor, backgroundColor = DEFAULT_THEME.backgroundColor, accentColor, darkForegroundColor, darkBackgroundColor, darkAccentColor, mode = 'light', font, customPalette, borderRadius, customFontSizes, customBorderRadii, }) => {
10
+ const isDarkTheme = mode === 'dark';
11
+ generatePalette({
12
+ foregroundColor: isDarkTheme ? (darkForegroundColor !== null && darkForegroundColor !== void 0 ? darkForegroundColor : foregroundColor) : foregroundColor,
13
+ backgroundColor: isDarkTheme ? (darkBackgroundColor !== null && darkBackgroundColor !== void 0 ? darkBackgroundColor : backgroundColor) : backgroundColor,
14
+ accentColor: isDarkTheme ? (darkAccentColor !== null && darkAccentColor !== void 0 ? darkAccentColor : accentColor) : accentColor,
15
+ customPalette,
16
+ isDarkTheme,
17
+ });
11
18
  generateFont({ font, customFontSizes });
12
19
  generateBorderRadii({ borderRadius, customBorderRadii });
13
- return palette.isDarkBackground;
14
20
  };
15
21
  //# sourceMappingURL=generateTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateTheme.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,eAAe,GAAG,aAAa,CAAC,eAAe,EAC/C,eAAe,GAAG,aAAa,CAAC,eAAe,EAC/C,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,iBAAiB,GACX,EAAW,EAAE;IACnB,MAAM,OAAO,GAAG,eAAe,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,CAAC;IAErF,YAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAExC,mBAAmB,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAEzD,OAAO,OAAO,CAAC,gBAAgB,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { DEFAULT_THEME } from '../../constants';\nimport { Theme } from '../../interface';\nimport { generateBorderRadii } from './generateBorderRadii';\nimport { generateFont } from './generateFont';\nimport { generatePalette } from './generatePalette';\n\n/**\n * Generates css theme variables.\n * @returns @boolean Whether background is dark or not.\n */\nexport const generateTheme = ({\n foregroundColor = DEFAULT_THEME.foregroundColor,\n backgroundColor = DEFAULT_THEME.backgroundColor,\n font,\n customPalette,\n borderRadius,\n customFontSizes,\n customBorderRadii,\n}: Theme): boolean => {\n const palette = generatePalette({ foregroundColor, backgroundColor, customPalette });\n\n generateFont({ font, customFontSizes });\n\n generateBorderRadii({ borderRadius, customBorderRadii });\n\n return palette.isDarkBackground;\n};\n"]}
1
+ {"version":3,"file":"generateTheme.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,eAAe,GAAG,aAAa,CAAC,eAAe,EAC/C,eAAe,GAAG,aAAa,CAAC,eAAe,EAC/C,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,IAAI,GAAG,OAAO,EACd,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,iBAAiB,GACX,EAAE,EAAE;IACV,MAAM,WAAW,GAAG,IAAI,KAAK,MAAM,CAAC;IAEpC,eAAe,CAAC;QACd,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe;QACzF,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe;QACzF,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW;QACzE,aAAa;QACb,WAAW;KACZ,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAExC,mBAAmB,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { DEFAULT_THEME } from '../../constants';\nimport { Theme } from '../../interface';\nimport { generateBorderRadii } from './generateBorderRadii';\nimport { generateFont } from './generateFont';\nimport { generatePalette } from './generatePalette';\n\n/**\n * Generates css theme variables.\n * @returns @boolean Whether background is dark or not.\n */\nexport const generateTheme = ({\n foregroundColor = DEFAULT_THEME.foregroundColor,\n backgroundColor = DEFAULT_THEME.backgroundColor,\n accentColor,\n darkForegroundColor,\n darkBackgroundColor,\n darkAccentColor,\n mode = 'light',\n font,\n customPalette,\n borderRadius,\n customFontSizes,\n customBorderRadii,\n}: Theme) => {\n const isDarkTheme = mode === 'dark';\n\n generatePalette({\n foregroundColor: isDarkTheme ? (darkForegroundColor ?? foregroundColor) : foregroundColor,\n backgroundColor: isDarkTheme ? (darkBackgroundColor ?? backgroundColor) : backgroundColor,\n accentColor: isDarkTheme ? (darkAccentColor ?? accentColor) : accentColor,\n customPalette,\n isDarkTheme,\n });\n\n generateFont({ font, customFontSizes });\n\n generateBorderRadii({ borderRadius, customBorderRadii });\n};\n"]}
@@ -1 +1 @@
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;AAEpG,2CAA2C;AAC3C,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,CACpF,SAAS,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,iBAAoC,EAA2B,EAAE,CACjG,SAAS,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,YAAoB,EAAE,EAAE;IACpE,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAE9C,MAAM,SAAS,GAAG,OAAO,CACvB,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAC1D,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAC/E,CAAC;IAEF,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import { parseToRgba, rgba } from 'color2k';\nimport { CustomBorderRadii, 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 } =>\n buildVars('--cpsl-color', customPalette);\nexport const getCssBorderRadii = (customBorderRadii: CustomBorderRadii): { [k: string]: string } =>\n buildVars('--cpsl-border-radius', customBorderRadii);\n\nexport const overlayMix = (baseColor: string, overlayColor: string) => {\n const baseRGBA = parseToRgba(baseColor);\n const overlayRGBA = parseToRgba(overlayColor);\n\n const finalRGBA = overlay(\n { r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 },\n { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] },\n );\n\n return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);\n};\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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AE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEtK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import { parseToRgba, rgba } from 'color2k';\nimport { CustomBorderRadii, 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);\nexport const getCssBorderRadii = (customBorderRadii: CustomBorderRadii): { [k: string]: string } => buildVars('--cpsl-border-radius', customBorderRadii);\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"]}
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["cpsl-modal-v2",[[1,"cpsl-modal-v2",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"elevated":[4],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}]]],["cpsl-hero",[[1,"cpsl-hero",{"variant":[513],"title":[513],"subtitle":[513]}]]],["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-identicon",[[1,"cpsl-identicon",{"hash":[1],"size":[2]}]]],["cpsl-info-box",[[1,"cpsl-info-box"]]],["cpsl-row",[[1,"cpsl-row"]]],["cpsl-alert_33",[[1,"cpsl-pagination",{"initialPage":[2,"initial-page"],"totalPages":[2,"total-pages"],"visiblePages":[1026,"visible-pages"],"currentPage":[32]},null,{"currentPage":["watchChange"]}],[1,"cpsl-file-upload",{"errorText":[1,"error-text"],"externalFilename":[1,"external-filename"],"externalSrc":[1,"external-src"],"fileTypes":[16],"helperText":[1,"helper-text"],"label":[1],"required":[4],"showOptionalLabel":[4,"show-optional-label"],"uploadFile":[16],"file":[32],"dragOver":[32],"dragError":[32],"isUploading":[32],"uploadError":[32]}],[1,"cpsl-select",{"disabled":[4],"dropdownMaxHeight":[2,"dropdown-max-height"],"errorText":[1,"error-text"],"formatValue":[16],"helperText":[1,"helper-text"],"id":[1],"label":[1],"placeholder":[1],"required":[4],"selectedValue":[1,"selected-value"],"showFormattedSelectedItem":[4,"show-formatted-selected-item"],"showOptionalLabel":[4,"show-optional-label"],"anchorEl":[32],"hasFocus":[32],"popoverOpen":[32],"hasSelectedItem":[32]},[[0,"cpslSelectItemClick","selectItemClickHandler"],[0,"cpslOpen","onPopoverOpen"],[0,"cpslClose","onPopoverClose"]],{"selectedValue":["onValueChange","handleValueChange"]}],[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],"anchorPosition":[2,"anchor-position"],"noOverlay":[4,"no-overlay"],"open":[4],"size":[8],"transitionDuration":[2,"transition-duration"],"transitionFunction":[1,"transition-function"],"variant":[1],"zIndexOverride":[2,"z-index-override"],"closedAnchorPosition":[32],"showTransition":[32]}],[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",{"hasHorizontalScroll":[32],"hasVerticalScroll":[32]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-app-bar",{"height":[2],"position":[1],"zIndexOverride":[2,"z-index-override"]}],[1,"cpsl-avatar",{"alt":[1],"src":[1],"variant":[1]}],[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-select-item",{"selected":[4],"value":[1]}],[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",{"as":[1],"disabled":[516],"fullWidth":[4,"full-width"],"href":[1],"size":[1],"target":[1],"variant":[513]}],[1,"cpsl-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-popover",{"anchorEl":[16],"anchorOriginHorizontal":[1,"anchor-origin-horizontal"],"anchorOriginVertical":[1,"anchor-origin-vertical"],"autoWidth":[4,"auto-width"],"disabled":[4],"preventBlur":[4,"prevent-blur"],"transformOriginHorizontal":[1,"transform-origin-horizontal"],"transformOriginVertical":[1,"transform-origin-vertical"],"triggerAction":[1,"trigger-action"],"trigger":[1],"windowPadding":[2,"window-padding"],"open":[32],"positionX":[32],"positionY":[32],"closePopover":[64]},null,{"trigger":["onTriggerChange"],"triggerAction":["onTriggerChange"],"preventBlur":["onTriggerChange"],"anchorOriginHorizontal":["onAnchorChange"],"anchorOriginVertical":["onAnchorChange"],"open":["onOpenChange"]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-card"],[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);
19
+ return bootstrapLazy([["cpsl-hero",[[1,"cpsl-hero",{"height":[2],"hideFadeOut":[4,"hide-fade-out"],"variant":[513],"title":[513],"subtitle":[513],"withDefaultTheme":[4,"with-default-theme"]}]]],["cpsl-modal-v2",[[1,"cpsl-modal-v2",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"elevated":[4],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}]]],["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-identicon",[[1,"cpsl-identicon",{"hash":[1],"size":[2]}]]],["cpsl-info-box",[[1,"cpsl-info-box"]]],["cpsl-row",[[1,"cpsl-row"]]],["cpsl-alert_34",[[1,"cpsl-pagination",{"initialPage":[2,"initial-page"],"totalPages":[2,"total-pages"],"visiblePages":[1026,"visible-pages"],"currentPage":[32]},null,{"currentPage":["watchChange"]}],[1,"cpsl-select",{"anchorElId":[1,"anchor-el-id"],"autoWidth":[4,"auto-width"],"disabled":[4],"dropdownMaxHeight":[2,"dropdown-max-height"],"errorText":[1,"error-text"],"formatValue":[16],"helperText":[1,"helper-text"],"id":[1],"label":[1],"placeholder":[1],"required":[4],"selectedValue":[1,"selected-value"],"showFormattedSelectedItem":[4,"show-formatted-selected-item"],"showOptionalLabel":[4,"show-optional-label"],"showSearch":[4,"show-search"],"searchPlaceholder":[1,"search-placeholder"],"anchorEl":[32],"hasFocus":[32],"popoverOpen":[32],"hasSelectedItem":[32]},[[0,"cpslSelectItemClick","selectItemClickHandler"],[0,"cpslOpen","onPopoverOpen"],[0,"cpslClose","onPopoverClose"]],{"selectedValue":["onValueChange","handleValueChange"]}],[1,"cpsl-file-upload",{"errorText":[1,"error-text"],"externalFilename":[1,"external-filename"],"externalSrc":[1,"external-src"],"fileTypes":[16],"helperText":[1,"helper-text"],"label":[1],"required":[4],"showOptionalLabel":[4,"show-optional-label"],"uploadFile":[16],"file":[32],"dragOver":[32],"dragError":[32],"isUploading":[32],"uploadError":[32]}],[1,"cpsl-auth-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"],"hasFooter":[32],"isMobile":[32]},null,{"open":["toggleModal"]}],[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],"anchorPosition":[2,"anchor-position"],"noOverlay":[4,"no-overlay"],"open":[4],"size":[8],"transitionDuration":[2,"transition-duration"],"transitionFunction":[1,"transition-function"],"variant":[1],"zIndexOverride":[2,"z-index-override"],"closedAnchorPosition":[32],"showTransition":[32]}],[1,"cpsl-icon-group",{"expandFrom":[1,"expand-from"],"disabled":[4],"icons":[16],"isHovered":[32]}],[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",{"hasHorizontalScroll":[32],"hasVerticalScroll":[32]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-app-bar",{"height":[2],"position":[1],"zIndexOverride":[2,"z-index-override"]}],[1,"cpsl-avatar",{"alt":[1],"src":[1],"variant":[1]}],[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-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-select-item",{"selected":[4],"value":[1]}],[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",{"as":[1],"disabled":[516],"fullWidth":[4,"full-width"],"href":[1],"size":[1],"target":[1],"variant":[513]}],[1,"cpsl-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"contrastText":[4,"contrast-text"],"enterkeyhint":[1],"errorText":[1,"error-text"],"mask":[1],"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],"maskedInput":[32]},null,{"disabled":["handleDisable"],"mask":["handleSetupMask"],"value":["handleValueChange"]}],[1,"cpsl-popover",{"anchorEl":[16],"anchorOriginHorizontal":[1,"anchor-origin-horizontal"],"anchorOriginVertical":[1,"anchor-origin-vertical"],"autoWidth":[4,"auto-width"],"disabled":[4],"preventBlur":[4,"prevent-blur"],"transformOriginHorizontal":[1,"transform-origin-horizontal"],"transformOriginVertical":[1,"transform-origin-vertical"],"triggerAction":[1,"trigger-action"],"trigger":[1],"windowPadding":[2,"window-padding"],"open":[32],"positionX":[32],"positionY":[32],"closePopover":[64]},null,{"trigger":["onTriggerChange"],"triggerAction":["onTriggerChange"],"preventBlur":["onTriggerChange"],"anchorOriginHorizontal":["onAnchorChange"],"anchorOriginVertical":["onAnchorChange"],"open":["onOpenChange"]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-card"],[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