@rededor/cura 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/dist/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/icons/iconset-default-tmp.svg +4 -0
  3. package/dist/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/{app-globals-0e3b7fc6.js → app-globals-2988084b.js} +5 -5
  5. package/dist/cjs/app-globals-2988084b.js.map +1 -0
  6. package/dist/cjs/cura-accordion_8.cjs.entry.js +445 -0
  7. package/dist/cjs/cura-accordion_8.cjs.entry.js.map +1 -0
  8. package/dist/cjs/cura-alert.cjs.entry.js +67 -0
  9. package/dist/cjs/cura-alert.cjs.entry.js.map +1 -0
  10. package/dist/cjs/cura-button-outline.cjs.entry.js +83 -0
  11. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -0
  12. package/dist/cjs/cura-button-select.cjs.entry.js +97 -0
  13. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -0
  14. package/dist/cjs/cura-button-transparent.cjs.entry.js +83 -0
  15. package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -0
  16. package/dist/cjs/cura-checkbox.cjs.entry.js +144 -0
  17. package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -0
  18. package/dist/cjs/cura-display.cjs.entry.js +74 -0
  19. package/dist/cjs/cura-display.cjs.entry.js.map +1 -0
  20. package/dist/cjs/cura-forms.definitions-11be2ebd.js +20 -0
  21. package/dist/cjs/cura-forms.definitions-11be2ebd.js.map +1 -0
  22. package/dist/cjs/cura-icon.definitions-b73b0178.js +21 -0
  23. package/dist/cjs/cura-icon.definitions-b73b0178.js.map +1 -0
  24. package/dist/cjs/cura-icons-view.cjs.entry.js +36 -0
  25. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -0
  26. package/dist/cjs/cura-input-text.cjs.entry.js +3907 -0
  27. package/dist/cjs/cura-input-text.cjs.entry.js.map +1 -0
  28. package/dist/cjs/cura-label.cjs.entry.js +69 -0
  29. package/dist/cjs/cura-label.cjs.entry.js.map +1 -0
  30. package/dist/cjs/cura-radio.cjs.entry.js +114 -0
  31. package/dist/cjs/cura-radio.cjs.entry.js.map +1 -0
  32. package/dist/cjs/cura-switch.cjs.entry.js +89 -0
  33. package/dist/cjs/cura-switch.cjs.entry.js.map +1 -0
  34. package/dist/cjs/cura.cjs.js +3 -3
  35. package/dist/cjs/{index-404d93e9.js → index-7616f620.js} +35 -1
  36. package/dist/cjs/index-7616f620.js.map +1 -0
  37. package/dist/cjs/index.cjs.js +7 -0
  38. package/dist/cjs/index.cjs.js.map +1 -1
  39. package/dist/cjs/loader.cjs.js +3 -3
  40. package/dist/collection/api/cura-api.type.js.map +1 -1
  41. package/dist/collection/api/modules/cura-theme-breakpoints-module.js +1 -1
  42. package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
  43. package/dist/collection/api/modules/cura-theme-colors-module.js +1 -1
  44. package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
  45. package/dist/collection/api/theme-presets/static.js +2 -2
  46. package/dist/collection/api/theme-presets/static.js.map +1 -1
  47. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  48. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  49. package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
  50. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  51. package/dist/collection/assets-raw/icons/default/swap.svg +3 -0
  52. package/dist/collection/collection-manifest.json +7 -0
  53. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +10 -6
  54. package/dist/collection/components/buttons/cura-button/cura-button.css +4 -0
  55. package/dist/collection/components/buttons/cura-button/cura-button.stories.js +2 -2
  56. package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
  57. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +4 -0
  58. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +2 -2
  59. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
  60. package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +139 -0
  61. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +263 -0
  62. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -0
  63. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +4 -0
  64. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +2 -2
  65. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
  66. package/dist/collection/components/cura-alert/cura-alert.css +30 -0
  67. package/dist/collection/components/cura-alert/cura-alert.js +167 -0
  68. package/dist/collection/components/cura-alert/cura-alert.js.map +1 -0
  69. package/dist/collection/components/cura-alert/cura-alert.stories.js +95 -0
  70. package/dist/collection/components/cura-alert/cura-alert.stories.js.map +1 -0
  71. package/dist/collection/components/cura-icon/cura-icon.definitions.js +15 -0
  72. package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -0
  73. package/dist/collection/components/cura-icon/cura-icon.js +9 -16
  74. package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
  75. package/dist/collection/components/cura-icon/cura-icon.stories.js +7 -6
  76. package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
  77. package/dist/collection/components/cura-icons-view/cura-icons-view.css +16 -17
  78. package/dist/collection/components/cura-icons-view/cura-icons-view.js +10 -3
  79. package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
  80. package/dist/collection/components/cura-page-template/cura-page-template.css +13 -9
  81. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +163 -0
  82. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +431 -0
  83. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -0
  84. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js +196 -0
  85. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js.map +1 -0
  86. package/dist/collection/components/forms/cura-forms.definitions.js +15 -0
  87. package/dist/collection/components/forms/cura-forms.definitions.js.map +1 -0
  88. package/dist/collection/components/forms/cura-input-text/cura-input-text.css +326 -0
  89. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +655 -0
  90. package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -0
  91. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +224 -0
  92. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -0
  93. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +46 -0
  94. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -0
  95. package/dist/collection/components/forms/cura-label/cura-label.css +70 -0
  96. package/dist/collection/components/forms/cura-label/cura-label.js +190 -0
  97. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -0
  98. package/dist/collection/components/forms/cura-label/cura-label.stories.js +137 -0
  99. package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -0
  100. package/dist/collection/components/forms/cura-radio/cura-radio.css +146 -0
  101. package/dist/collection/components/forms/cura-radio/cura-radio.js +365 -0
  102. package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -0
  103. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js +175 -0
  104. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js.map +1 -0
  105. package/dist/collection/components/forms/cura-switch/cura-switch.css +100 -0
  106. package/dist/collection/components/forms/cura-switch/cura-switch.js +266 -0
  107. package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -0
  108. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js +137 -0
  109. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js.map +1 -0
  110. package/dist/collection/components/text/cura-display/cura-display.css +21 -38
  111. package/dist/collection/components/text/cura-display/cura-display.js +80 -49
  112. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  113. package/dist/collection/components/text/cura-display/cura-display.stories.js +78 -33
  114. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  115. package/dist/collection/components/text/cura-heading/cura-heading.css +50 -24
  116. package/dist/collection/components/text/cura-heading/cura-heading.js +94 -39
  117. package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
  118. package/dist/collection/components/text/cura-heading/cura-heading.stories.js +92 -36
  119. package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
  120. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +37 -38
  121. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +62 -41
  122. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
  123. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +78 -46
  124. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  125. package/dist/collection/index.js +3 -1
  126. package/dist/collection/index.js.map +1 -1
  127. package/dist/components/cura-accordion-item.js +1 -1
  128. package/dist/components/cura-accordion-item.js.map +1 -1
  129. package/dist/components/cura-alert.d.ts +11 -0
  130. package/dist/components/cura-alert.js +105 -0
  131. package/dist/components/cura-alert.js.map +1 -0
  132. package/dist/components/cura-button-select.d.ts +11 -0
  133. package/dist/components/cura-button-select.js +127 -0
  134. package/dist/components/cura-button-select.js.map +1 -0
  135. package/dist/components/cura-checkbox.d.ts +11 -0
  136. package/dist/components/cura-checkbox.js +192 -0
  137. package/dist/components/cura-checkbox.js.map +1 -0
  138. package/dist/components/cura-display.js +41 -35
  139. package/dist/components/cura-display.js.map +1 -1
  140. package/dist/components/cura-forms.definitions.js +18 -0
  141. package/dist/components/cura-forms.definitions.js.map +1 -0
  142. package/dist/components/cura-heading.js +1 -87
  143. package/dist/components/cura-heading.js.map +1 -1
  144. package/dist/components/cura-heading2.js +104 -0
  145. package/dist/components/cura-heading2.js.map +1 -0
  146. package/dist/components/cura-icon2.js +24 -17
  147. package/dist/components/cura-icon2.js.map +1 -1
  148. package/dist/components/cura-icons-view.js +31 -7
  149. package/dist/components/cura-icons-view.js.map +1 -1
  150. package/dist/components/cura-input-text.d.ts +11 -0
  151. package/dist/components/cura-input-text.js +3961 -0
  152. package/dist/components/cura-input-text.js.map +1 -0
  153. package/dist/components/cura-label.d.ts +11 -0
  154. package/dist/components/cura-label.js +8 -0
  155. package/dist/components/cura-label.js.map +1 -0
  156. package/dist/components/cura-label2.js +88 -0
  157. package/dist/components/cura-label2.js.map +1 -0
  158. package/dist/components/cura-page-template.js +1 -1
  159. package/dist/components/cura-page-template.js.map +1 -1
  160. package/dist/components/cura-paragraph.js +1 -80
  161. package/dist/components/cura-paragraph.js.map +1 -1
  162. package/dist/components/cura-paragraph2.js +86 -0
  163. package/dist/components/cura-paragraph2.js.map +1 -0
  164. package/dist/components/cura-radio.d.ts +11 -0
  165. package/dist/components/cura-radio.js +154 -0
  166. package/dist/components/cura-radio.js.map +1 -0
  167. package/dist/components/cura-switch.d.ts +11 -0
  168. package/dist/components/cura-switch.js +119 -0
  169. package/dist/components/cura-switch.js.map +1 -0
  170. package/dist/components/index.js +23 -5
  171. package/dist/components/index.js.map +1 -1
  172. package/dist/cura/cura.esm.js +1 -1
  173. package/dist/cura/cura.esm.js.map +1 -1
  174. package/dist/cura/cura.js +1 -1
  175. package/dist/cura/index.esm.js +1 -1
  176. package/dist/cura/index.esm.js.map +1 -1
  177. package/dist/cura/p-120926c5.system.js +2 -0
  178. package/dist/cura/p-120926c5.system.js.map +1 -0
  179. package/dist/cura/p-1228e771.entry.js +2 -0
  180. package/dist/cura/p-1228e771.entry.js.map +1 -0
  181. package/dist/cura/p-2d42ccf4.entry.js +2 -0
  182. package/dist/cura/p-2d42ccf4.entry.js.map +1 -0
  183. package/dist/cura/p-3688570d.js +2 -0
  184. package/dist/cura/p-3688570d.js.map +1 -0
  185. package/dist/cura/p-36a83bc7.system.js +3 -0
  186. package/dist/cura/p-36a83bc7.system.js.map +1 -0
  187. package/dist/cura/p-3f3355f3.system.entry.js +2 -0
  188. package/dist/cura/p-3f3355f3.system.entry.js.map +1 -0
  189. package/dist/cura/p-48426f60.system.js +2 -0
  190. package/dist/cura/p-48426f60.system.js.map +1 -0
  191. package/dist/cura/p-4df84c9e.entry.js +2 -0
  192. package/dist/cura/p-4df84c9e.entry.js.map +1 -0
  193. package/dist/cura/p-70cefaf8.entry.js +2 -0
  194. package/dist/cura/p-70cefaf8.entry.js.map +1 -0
  195. package/dist/cura/p-72a9ed55.entry.js +2 -0
  196. package/dist/cura/p-72a9ed55.entry.js.map +1 -0
  197. package/dist/cura/p-75b2e4d1.system.entry.js +2 -0
  198. package/dist/cura/p-75b2e4d1.system.entry.js.map +1 -0
  199. package/dist/cura/p-880917c1.entry.js +2 -0
  200. package/dist/cura/p-880917c1.entry.js.map +1 -0
  201. package/dist/cura/p-9471c93e.system.entry.js +2 -0
  202. package/dist/cura/p-9471c93e.system.entry.js.map +1 -0
  203. package/dist/cura/p-98014544.entry.js +2 -0
  204. package/dist/cura/p-98014544.entry.js.map +1 -0
  205. package/dist/cura/p-98352c92.system.entry.js +2 -0
  206. package/dist/cura/p-98352c92.system.entry.js.map +1 -0
  207. package/dist/cura/p-a32889a4.system.js +2 -0
  208. package/dist/cura/p-a32889a4.system.js.map +1 -0
  209. package/dist/cura/p-a6d20c12.system.entry.js +2 -0
  210. package/dist/cura/p-a6d20c12.system.entry.js.map +1 -0
  211. package/dist/cura/p-ab8c9a8f.system.entry.js +2 -0
  212. package/dist/cura/p-ab8c9a8f.system.entry.js.map +1 -0
  213. package/dist/cura/p-ad194144.entry.js +2 -0
  214. package/dist/cura/p-ad194144.entry.js.map +1 -0
  215. package/dist/cura/p-b0e13882.system.entry.js +2 -0
  216. package/dist/cura/p-b0e13882.system.entry.js.map +1 -0
  217. package/dist/cura/p-ba66d7be.js +3 -0
  218. package/dist/cura/{p-c0c00396.system.js.map → p-ba66d7be.js.map} +1 -1
  219. package/dist/cura/p-bb3f9d05.entry.js +2 -0
  220. package/dist/cura/p-bb3f9d05.entry.js.map +1 -0
  221. package/dist/cura/p-c791725b.js +2 -0
  222. package/dist/cura/p-c791725b.js.map +1 -0
  223. package/dist/cura/p-c9afb94f.entry.js +2 -0
  224. package/dist/cura/p-c9afb94f.entry.js.map +1 -0
  225. package/dist/cura/p-d3f9c888.system.js +2 -0
  226. package/dist/cura/p-d3f9c888.system.js.map +1 -0
  227. package/dist/cura/p-e5e259fd.system.entry.js +2 -0
  228. package/dist/cura/p-e5e259fd.system.entry.js.map +1 -0
  229. package/dist/cura/p-edeffbfc.entry.js +2 -0
  230. package/dist/cura/p-edeffbfc.entry.js.map +1 -0
  231. package/dist/cura/p-eea5ca70.system.entry.js +2 -0
  232. package/dist/cura/p-eea5ca70.system.entry.js.map +1 -0
  233. package/dist/cura/p-f6e61abf.system.entry.js +2 -0
  234. package/dist/cura/p-f6e61abf.system.entry.js.map +1 -0
  235. package/dist/cura/p-f89f2ecc.system.entry.js +2 -0
  236. package/dist/cura/p-f89f2ecc.system.entry.js.map +1 -0
  237. package/dist/cura/p-f8fffdc1.js +2 -0
  238. package/dist/cura/p-f8fffdc1.js.map +1 -0
  239. package/dist/cura/p-fc4ba4ce.system.js +2 -0
  240. package/dist/cura/p-fc4ba4ce.system.js.map +1 -0
  241. package/dist/cura/p-fef52079.entry.js +2 -0
  242. package/dist/cura/p-fef52079.entry.js.map +1 -0
  243. package/dist/cura/p-ffd41520.system.entry.js +2 -0
  244. package/dist/cura/p-ffd41520.system.entry.js.map +1 -0
  245. package/dist/esm/{app-globals-cc003eaf.js → app-globals-29001758.js} +5 -5
  246. package/dist/esm/app-globals-29001758.js.map +1 -0
  247. package/dist/esm/cura-accordion_8.entry.js +434 -0
  248. package/dist/esm/cura-accordion_8.entry.js.map +1 -0
  249. package/dist/esm/cura-alert.entry.js +63 -0
  250. package/dist/esm/cura-alert.entry.js.map +1 -0
  251. package/dist/esm/cura-button-outline.entry.js +79 -0
  252. package/dist/esm/cura-button-outline.entry.js.map +1 -0
  253. package/dist/esm/cura-button-select.entry.js +93 -0
  254. package/dist/esm/cura-button-select.entry.js.map +1 -0
  255. package/dist/esm/cura-button-transparent.entry.js +79 -0
  256. package/dist/esm/cura-button-transparent.entry.js.map +1 -0
  257. package/dist/esm/cura-checkbox.entry.js +140 -0
  258. package/dist/esm/cura-checkbox.entry.js.map +1 -0
  259. package/dist/esm/cura-display.entry.js +70 -0
  260. package/dist/esm/cura-display.entry.js.map +1 -0
  261. package/dist/esm/cura-forms.definitions-0f774253.js +18 -0
  262. package/dist/esm/cura-forms.definitions-0f774253.js.map +1 -0
  263. package/dist/esm/cura-icon.definitions-a63d1862.js +18 -0
  264. package/dist/esm/cura-icon.definitions-a63d1862.js.map +1 -0
  265. package/dist/esm/cura-icons-view.entry.js +32 -0
  266. package/dist/esm/cura-icons-view.entry.js.map +1 -0
  267. package/dist/esm/cura-input-text.entry.js +3903 -0
  268. package/dist/esm/cura-input-text.entry.js.map +1 -0
  269. package/dist/esm/cura-label.entry.js +65 -0
  270. package/dist/esm/cura-label.entry.js.map +1 -0
  271. package/dist/esm/cura-radio.entry.js +110 -0
  272. package/dist/esm/cura-radio.entry.js.map +1 -0
  273. package/dist/esm/cura-switch.entry.js +85 -0
  274. package/dist/esm/cura-switch.entry.js.map +1 -0
  275. package/dist/esm/cura.js +4 -4
  276. package/dist/esm/{index-d99da69e.js → index-81f1a268.js} +35 -2
  277. package/dist/{esm-es5/index-d99da69e.js.map → esm/index-81f1a268.js.map} +1 -1
  278. package/dist/esm/index.js +4 -0
  279. package/dist/esm/index.js.map +1 -1
  280. package/dist/esm/loader.js +4 -4
  281. package/dist/esm-es5/app-globals-29001758.js +2 -0
  282. package/dist/esm-es5/app-globals-29001758.js.map +1 -0
  283. package/dist/esm-es5/cura-accordion_8.entry.js +2 -0
  284. package/dist/esm-es5/cura-accordion_8.entry.js.map +1 -0
  285. package/dist/esm-es5/cura-alert.entry.js +2 -0
  286. package/dist/esm-es5/cura-alert.entry.js.map +1 -0
  287. package/dist/esm-es5/cura-button-outline.entry.js +2 -0
  288. package/dist/esm-es5/cura-button-outline.entry.js.map +1 -0
  289. package/dist/esm-es5/cura-button-select.entry.js +2 -0
  290. package/dist/esm-es5/cura-button-select.entry.js.map +1 -0
  291. package/dist/esm-es5/cura-button-transparent.entry.js +2 -0
  292. package/dist/esm-es5/cura-button-transparent.entry.js.map +1 -0
  293. package/dist/esm-es5/cura-checkbox.entry.js +2 -0
  294. package/dist/esm-es5/cura-checkbox.entry.js.map +1 -0
  295. package/dist/esm-es5/cura-display.entry.js +2 -0
  296. package/dist/esm-es5/cura-display.entry.js.map +1 -0
  297. package/dist/esm-es5/cura-forms.definitions-0f774253.js +2 -0
  298. package/dist/esm-es5/cura-forms.definitions-0f774253.js.map +1 -0
  299. package/dist/esm-es5/cura-icon.definitions-a63d1862.js +2 -0
  300. package/dist/esm-es5/cura-icon.definitions-a63d1862.js.map +1 -0
  301. package/dist/esm-es5/cura-icons-view.entry.js +2 -0
  302. package/dist/esm-es5/cura-icons-view.entry.js.map +1 -0
  303. package/dist/esm-es5/cura-input-text.entry.js +2 -0
  304. package/dist/esm-es5/cura-input-text.entry.js.map +1 -0
  305. package/dist/esm-es5/cura-label.entry.js +2 -0
  306. package/dist/esm-es5/cura-label.entry.js.map +1 -0
  307. package/dist/esm-es5/cura-radio.entry.js +2 -0
  308. package/dist/esm-es5/cura-radio.entry.js.map +1 -0
  309. package/dist/esm-es5/cura-switch.entry.js +2 -0
  310. package/dist/esm-es5/cura-switch.entry.js.map +1 -0
  311. package/dist/esm-es5/cura.js +1 -1
  312. package/dist/esm-es5/cura.js.map +1 -1
  313. package/dist/esm-es5/index-81f1a268.js +3 -0
  314. package/dist/esm-es5/index-81f1a268.js.map +1 -0
  315. package/dist/esm-es5/index.js +1 -1
  316. package/dist/esm-es5/index.js.map +1 -1
  317. package/dist/esm-es5/loader.js +1 -1
  318. package/dist/esm-es5/loader.js.map +1 -1
  319. package/dist/types/api/cura-api.type.d.ts +1 -0
  320. package/dist/types/components/buttons/cura-button/cura-button.d.ts +1 -1
  321. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +51 -0
  322. package/dist/types/components/cura-alert/cura-alert.d.ts +16 -0
  323. package/dist/types/components/cura-alert/cura-alert.stories.d.ts +79 -0
  324. package/dist/types/components/cura-icon/cura-icon.d.ts +0 -42
  325. package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +47 -0
  326. package/dist/types/components/cura-icons-view/cura-icons-view.d.ts +2 -1
  327. package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +100 -0
  328. package/dist/types/components/forms/cura-checkbox/cura-checkbox.stories.d.ts +199 -0
  329. package/dist/types/components/forms/cura-forms.definitions.d.ts +14 -0
  330. package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +138 -0
  331. package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +224 -0
  332. package/dist/types/components/forms/cura-input-text/mask-presets/input-mask-presets.d.ts +5 -0
  333. package/dist/types/components/forms/cura-label/cura-label.d.ts +54 -0
  334. package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +126 -0
  335. package/dist/types/components/forms/cura-radio/cura-radio.d.ts +81 -0
  336. package/dist/types/components/forms/cura-radio/cura-radio.stories.d.ts +180 -0
  337. package/dist/types/components/forms/cura-switch/cura-switch.d.ts +62 -0
  338. package/dist/types/components/forms/cura-switch/cura-switch.stories.d.ts +135 -0
  339. package/dist/types/components/text/cura-display/cura-display.d.ts +29 -18
  340. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +52 -14
  341. package/dist/types/components/text/cura-heading/cura-heading.d.ts +34 -17
  342. package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +58 -6
  343. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +24 -12
  344. package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +47 -9
  345. package/dist/types/components.d.ts +741 -46
  346. package/dist/types/index.d.ts +9 -0
  347. package/package.json +5 -6
  348. package/dist/cjs/app-globals-0e3b7fc6.js.map +0 -1
  349. package/dist/cjs/cura-accordion_12.cjs.entry.js +0 -674
  350. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
  351. package/dist/cjs/index-404d93e9.js.map +0 -1
  352. package/dist/cura/p-319699df.entry.js +0 -2
  353. package/dist/cura/p-319699df.entry.js.map +0 -1
  354. package/dist/cura/p-46d20db3.js +0 -3
  355. package/dist/cura/p-46d20db3.js.map +0 -1
  356. package/dist/cura/p-50ea2036.system.js +0 -2
  357. package/dist/cura/p-50ea2036.system.js.map +0 -1
  358. package/dist/cura/p-5250cb43.system.js +0 -2
  359. package/dist/cura/p-5250cb43.system.js.map +0 -1
  360. package/dist/cura/p-5cc3c8bd.system.entry.js +0 -2
  361. package/dist/cura/p-5cc3c8bd.system.entry.js.map +0 -1
  362. package/dist/cura/p-788e035b.system.js +0 -2
  363. package/dist/cura/p-788e035b.system.js.map +0 -1
  364. package/dist/cura/p-c0c00396.system.js +0 -3
  365. package/dist/cura/p-d5c64a5f.js +0 -2
  366. package/dist/cura/p-d5c64a5f.js.map +0 -1
  367. package/dist/esm/app-globals-cc003eaf.js.map +0 -1
  368. package/dist/esm/cura-accordion_12.entry.js +0 -659
  369. package/dist/esm/cura-accordion_12.entry.js.map +0 -1
  370. package/dist/esm/index-d99da69e.js.map +0 -1
  371. package/dist/esm-es5/app-globals-cc003eaf.js +0 -2
  372. package/dist/esm-es5/app-globals-cc003eaf.js.map +0 -1
  373. package/dist/esm-es5/cura-accordion_12.entry.js +0 -2
  374. package/dist/esm-es5/cura-accordion_12.entry.js.map +0 -1
  375. package/dist/esm-es5/index-d99da69e.js +0 -3
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7616f620.js');
6
+
7
+ const curaAlertCss = ":host{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}:host .conteiner{display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;padding:12px;gap:12px;-ms-flex-negative:0;flex-shrink:0;border:1px solid var(--color-base);border-radius:4px;background-color:var(--color-lighter)}:host .conteiner.floating{-webkit-box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16);box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16)}:host .icon-left{margin-right:5px}:host .icon-right{margin-left:auto;cursor:pointer}:host .text{margin-top:3px}:host .actions{margin-top:5px}";
8
+
9
+ const CuraAlert = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.close = index.createEvent(this, "close", 7);
13
+ this.handleClose = () => {
14
+ this.close.emit();
15
+ this.host.remove();
16
+ };
17
+ this.type = 'info';
18
+ this.floating = false;
19
+ this.label = undefined;
20
+ this.closeable = true;
21
+ this.styles = {};
22
+ }
23
+ setColors() {
24
+ const colors = [
25
+ { name: '--color-lighter', theme: `${this.type}-lighter` },
26
+ { name: '--neutral-black', theme: 'neutral-black' },
27
+ { name: '--color-light', theme: `${this.type}-light` },
28
+ { name: '--color-base', theme: `${this.type}-base` },
29
+ ];
30
+ colors.forEach(color => {
31
+ this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.theme);
32
+ });
33
+ this.styles = Object.assign({}, this.styles);
34
+ }
35
+ connectedCallback() {
36
+ this.setColors();
37
+ }
38
+ getClasses() {
39
+ const classes = {};
40
+ classes['conteiner'] = true;
41
+ classes['floating'] = this.floating;
42
+ return classes;
43
+ }
44
+ getNameIcon() {
45
+ const iconMapping = {
46
+ info: 'infoCircle',
47
+ success: 'checkCircle',
48
+ warning: 'alertCircle',
49
+ error: 'alertTriangle',
50
+ };
51
+ return iconMapping[this.type];
52
+ }
53
+ render() {
54
+ return (index.h(index.Host, null, index.h("div", { class: this.getClasses(), style: this.styles }, index.h("cura-icon", { name: this.getNameIcon(), class: "icon-left", size: 16, color: `${this.type}-dark` }), index.h("div", { class: "content" }, index.h("cura-label", { class: "title", size: "small", color: "neutral-darker", weight: "bold" }, this.label), index.h("cura-paragraph", { class: "text", color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", null)), index.h("div", { class: "actions" }, index.h("slot", { name: "actions" }))), this.closeable ?
55
+ (index.h("cura-icon", { name: "close", size: 16, color: "error-dark", class: "icon-right", onClick: this.handleClose }))
56
+ : '')));
57
+ }
58
+ get host() { return index.getElement(this); }
59
+ static get watchers() { return {
60
+ "type": ["setColors"]
61
+ }; }
62
+ };
63
+ CuraAlert.style = curaAlertCss;
64
+
65
+ exports.cura_alert = CuraAlert;
66
+
67
+ //# sourceMappingURL=cura-alert.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-alert.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,YAAY,GAAG,slBAAslB;;MCM9lB,SAAS;;;;IAgDpB,gBAAW,GAAG;MACZ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;MAClB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KACpB,CAAC;gBAhDuD,MAAM;oBAC3B,KAAK;;qBAEN,IAAI;kBAE9B,EAAE;;EAKX,SAAS;IACP,MAAM,MAAM,GAAG;MACb,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,UAAU,EAAE;MAC1D,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,EAAE;MACnD,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,QAAQ,EAAE;MACtD,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,OAAO,EAAE;KACrD,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,KAAK;MAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC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ACJ,IAAI,CAAC,SAAS;OACfA,uBAAW,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,YAAY,EAAC,KAAK,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,WAAW,GAAc;QAC9G,EAAE,CACA,CACD,EACP;GACH;;;;;;;;;;","names":["h","Host"],"sources":["./src/components/cura-alert/cura-alert.scss?tag=cura-alert&encapsulation=shadow","./src/components/cura-alert/cura-alert.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n\n .conteiner {\n display: flex;\n box-sizing: border-box;\n padding: 12px;\n gap: 12px;\n flex-shrink: 0;\n border: 1px solid var(--color-base);\n border-radius: 4px;\n background-color: var(--color-lighter);\n &.floating {\n box-shadow: 0px 4px 8px 0px rgba(38, 38, 38, 0.16);\n }\n }\n\n .icon-left {\n margin-right: 5px;\n }\n\n .icon-right {\n margin-left: auto;\n cursor: pointer;\n }\n\n .text {\n margin-top: 3px;\n }\n\n .actions {\n margin-top: 5px;\n }\n}\n","import { Component, Element, Prop, Host, h, State, Watch, Event, EventEmitter } from '@stencil/core';\n@Component({\n tag: 'cura-alert',\n styleUrl: 'cura-alert.scss',\n shadow: true,\n})\nexport class CuraAlert {\n @Element() host: HTMLElement;\n\n @Prop() type: 'info' | 'success' | 'warning' | 'error' = 'info';\n @Prop({ reflect: true }) floating = false;\n @Prop({ reflect: true }) label: string;\n @Prop({reflect: true}) closeable = true;\n @State()\n styles = {};\n\n @Event({ eventName: 'close' }) close: EventEmitter<void>;\n\n @Watch('type')\n setColors() {\n const colors = [\n { name: '--color-lighter', theme: `${this.type}-lighter` },\n { name: '--neutral-black', theme: 'neutral-black' },\n { name: '--color-light', theme: `${this.type}-light` },\n { name: '--color-base', theme: `${this.type}-base` },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.theme);\n });\n this.styles = {...this.styles};\n }\n\n connectedCallback() {\n this.setColors();\n }\n\n getClasses() {\n const classes = {};\n classes['conteiner'] = true;\n classes['floating'] = this.floating;\n return classes;\n }\n\n getNameIcon() {\n const iconMapping = {\n info: 'infoCircle',\n success: 'checkCircle',\n warning: 'alertCircle',\n error: 'alertTriangle',\n };\n return iconMapping[this.type];\n }\n\n handleClose = () => {\n this.close.emit();\n this.host.remove();\n };\n\n render() {\n return (\n <Host>\n <div class={this.getClasses()} style={this.styles}>\n <cura-icon name={this.getNameIcon()} class=\"icon-left\" size={16} color={`${this.type}-dark`}></cura-icon>\n <div class=\"content\">\n <cura-label class=\"title\" size=\"small\" color=\"neutral-darker\" weight=\"bold\">\n {this.label}\n </cura-label>\n <cura-paragraph class=\"text\" color={`${this.type}-darker`} size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <slot></slot>\n </cura-paragraph>\n <div class=\"actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n { this.closeable ?\n (<cura-icon name=\"close\" size={16} color=\"error-dark\" class=\"icon-right\" onClick={this.handleClose}></cura-icon>)\n : '' }\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,83 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7616f620.js');
6
+
7
+ const curaButtonOutlineCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle}:host button,:host a{outline:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;-webkit-transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;border-radius:var(--border-radius);background-color:transparent;border:none;-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-base);box-shadow:inset 0px 0px 0px 2px var(--color-base);padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-light);box-shadow:inset 0px 0px 0px 2px var(--color-light)}:host button:not(.disabled):not(.isLoading):hover .label,:host a:not(.disabled):not(.isLoading):hover .label{color:var(--color-light)}:host button:not(.disabled):not(.isLoading):hover cura-icon,:host a:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-light) !important}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-dark);box-shadow:inset 0px 0px 0px 2px var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active .label,:host a:not(.disabled):not(.inverted):not(.isLoading):active .label{color:var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active cura-icon,:host a:not(.disabled):not(.inverted):not(.isLoading):active cura-icon{--color:var(--color-dark) !important}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:1;-webkit-transition:opacity 0.2s linear;transition:opacity 0.2s linear}:host button.icon-right .button-container,:host a.icon-right .button-container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host button .label,:host a .label{-ms-flex:1;flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\");color:var(--color-base)}:host button .label.inverted,:host a .label.inverted{color:var(--neutral-white)}:host button.medium .label,:host a.medium .label{font-size:1.14em}:host button.small .label,:host a.small .label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed;-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-base);box-shadow:inset 0px 0px 0px 2px var(--neutral-base)}:host button.disabled .label,:host button.disabled .label.inverted,:host a.disabled .label,:host a.disabled .label.inverted{color:var(--neutral-dark)}:host button.disabled.inverted,:host a.disabled.inverted{opacity:0.6;-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-white);box-shadow:inset 0px 0px 0px 2px var(--neutral-white)}:host button.disabled.inverted .label,:host button.disabled.inverted .label.inverted,:host a.disabled.inverted .label,:host a.disabled.inverted .label.inverted{color:var(--neutral-white)}:host button.disabled.inverted cura-icon,:host a.disabled.inverted cura-icon{--color:var(--neutral-white) !important}:host button.disabled.inverted cura-loader-circle,:host a.disabled.inverted cura-loader-circle{--color:var(--neutral-white) !important}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only .label,:host a.icon-only .label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button.inverted,:host a.inverted{-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-white);box-shadow:inset 0px 0px 0px 2px var(--neutral-white)}:host button.inverted:not(.disabled):not(.isLoading):hover,:host a.inverted:not(.disabled):not(.isLoading):hover{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-lighter);box-shadow:inset 0px 0px 0px 2px var(--color-lighter)}:host button.inverted:not(.disabled):not(.isLoading):hover .label,:host a.inverted:not(.disabled):not(.isLoading):hover .label{color:var(--color-lighter)}:host button.inverted:not(.disabled):not(.isLoading):hover cura-icon,:host a.inverted:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-lighter) !important}:host button.inverted:not(.disabled):not(.isLoading):active,:host a.inverted:not(.disabled):not(.isLoading):active{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-light);box-shadow:inset 0px 0px 0px 2px var(--color-light)}:host button.inverted:not(.disabled):not(.isLoading):active .label,:host a.inverted:not(.disabled):not(.isLoading):active .label{color:var(--color-light)}:host button.inverted:not(.disabled):not(.isLoading):active cura-icon,:host a.inverted:not(.disabled):not(.isLoading):active cura-icon{--color:var(--color-light) !important}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}";
8
+
9
+ const CuraButtonOutline = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.size = 'large';
13
+ this.disabled = false;
14
+ this.isLoading = false;
15
+ this.iconName = undefined;
16
+ this.iconset = 'default';
17
+ this.iconPosition = 'left';
18
+ this.iconOnly = false;
19
+ this.href = undefined;
20
+ this.target = "_self";
21
+ this.color = 'accent';
22
+ this.fontColor = 'dark';
23
+ this.textAlign = 'left';
24
+ this.styles = {};
25
+ }
26
+ handleChangeColor() {
27
+ this.setColors();
28
+ }
29
+ connectedCallback() {
30
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
31
+ this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
32
+ this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
33
+ this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
34
+ this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
35
+ this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
36
+ this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
37
+ this.styles['--font-weight-medium'] = this.weights.medium;
38
+ this.styles['--text-align'] = this.textAlign;
39
+ this.setColors();
40
+ }
41
+ getClasses() {
42
+ const classes = {};
43
+ classes[`${this.size.toLowerCase()}`] = true;
44
+ classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
45
+ classes[`icon-only`] = this.iconOnly;
46
+ classes['inverted'] = this.fontColor === 'light';
47
+ classes['disabled'] = this.disabled;
48
+ classes['isLoading'] = this.isLoading;
49
+ return classes;
50
+ }
51
+ setColors() {
52
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`) });
53
+ }
54
+ getIcon() {
55
+ if (!this.iconName)
56
+ return '';
57
+ const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
58
+ const color = this.getSymbolColor();
59
+ return index.h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: color });
60
+ }
61
+ getSymbolColor() {
62
+ return this.disabled
63
+ ? 'neutral-dark'
64
+ : this.fontColor === 'light'
65
+ ? 'neutral-white'
66
+ : `${this.color}-base`;
67
+ }
68
+ handleClick(e) {
69
+ if (this.disabled || this.isLoading)
70
+ e.preventDefault();
71
+ }
72
+ render() {
73
+ return (index.h(index.Host, null, this.href ? (index.h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e) }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e) }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
74
+ }
75
+ static get watchers() { return {
76
+ "color": ["handleChangeColor"]
77
+ }; }
78
+ };
79
+ CuraButtonOutline.style = curaButtonOutlineCss;
80
+
81
+ exports.cura_button_outline = CuraButtonOutline;
82
+
83
+ //# sourceMappingURL=cura-button-outline.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-button-outline.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG,kjOAAkjO;;MCOlkO,iBAAiB;;;gBAKgC,OAAO;oBAKjC,KAAK;qBAIJ,KAAK;;mBASP,SAAS;wBAIc,MAAM;oBAI5B,KAAK;;kBASP,OAAO;iBAKvB,QAAQ;qBAQ6B,MAAM;qBAKK,MAAM;kBAGpD,EAAE;;EAdpB,iBAAiB;IACf,IAAI,CAAC,SAAS,EAAE,CAAC;GAClB;EAgBD,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,C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AAO,CACjF,EACPA,gCAAoB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,GAAuB,CACjF,CACV,CACM,EACP;GACH;;;;;;;;;","names":["h","Host"],"sources":["./src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","./src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n border: none;\n box-shadow: inset 0px 0px 0px 2px var(--color-base);\n\n &:not(.disabled):not(.isLoading):hover {\n box-shadow: inset 0px 0px 0px 2px var(--color-light);\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active { \n box-shadow: inset 0px 0px 0px 2px var(--color-dark);\n .label { color: var(--color-dark); }\n cura-icon { --color: var(--color-dark) !important; }\n }\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label() {\n color: var(--color-base);\n &.inverted { color: var(--neutral-white); }\n }\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n box-shadow: inset 0px 0px 0px 2px var(--neutral-base);\n .label, .label.inverted { color: var(--neutral-dark); }\n &.inverted {\n opacity: 0.6;\n box-shadow: inset 0px 0px 0px 2px var(--neutral-white);\n .label, .label.inverted { color: var(--neutral-white); }\n cura-icon { --color: var(--neutral-white) !important; }\n cura-loader-circle { --color: var(--neutral-white) !important; }\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Light version, inverted.\n &.inverted {\n box-shadow: inset 0px 0px 0px 2px var(--neutral-white);\n &:not(.disabled):not(.isLoading):hover { \n box-shadow: inset 0px 0px 0px 2px var(--color-lighter);\n .label { color: var(--color-lighter); }\n cura-icon { --color: var(--color-lighter) !important; }\n }\n &:not(.disabled):not(.isLoading):active {\n box-shadow: inset 0px 0px 0px 2px var(--color-light);\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n }\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n})\nexport class CuraButtonOutline {\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({reflect: true}) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({reflect: true}) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({reflect: true}) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({reflect: true}) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({reflect: true}) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({reflect: true}) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({reflect: true}) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({reflect: true}) href: string;\n /**\n * Set target if link.\n */\n @Prop({reflect: true}) target = \"_self\";\n\n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n /**\n * Set the font color to dark or light.\n */\n @Prop({reflect: true}) fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({reflect: true}) textAlign: 'left' | 'center' | 'right' = 'left';\n\n\n @State() styles = {};\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['inverted'] = this.fontColor === 'light';\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n return classes;\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`)\n };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const color = this.getSymbolColor();\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={color}></cura-icon>;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-dark'\n : this.fontColor === 'light'\n ? 'neutral-white'\n : `${this.color}-base`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) e.preventDefault();\n }\n\n render() {\n return (\n <Host>\n { this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"version":3}
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7616f620.js');
6
+
7
+ const curaButtonSelectCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle}:host button,:host a{outline:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;-webkit-transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;border-radius:var(--border-radius);background-color:var(--neutral-purewhite);border:none;-webkit-box-shadow:inset 0px 0px 0px 2px var(--primary-base);box-shadow:inset 0px 0px 0px 2px var(--primary-base);padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.disabled):hover,:host a:not(.disabled):hover{background-color:var(--color-lighter);-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-base);box-shadow:inset 0px 0px 0px 2px var(--color-base)}:host button:not(.disabled):hover .label,:host a:not(.disabled):hover .label{color:var(--neutral-purewhite-black)}:host button:focus,:host a:focus{-webkit-box-shadow:inset 0px 0px 0px 2px var(--info-base) !important;box-shadow:inset 0px 0px 0px 2px var(--info-base) !important}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .label,:host a .label{-ms-flex:1;flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\");color:var(--primary-base)}:host button.medium .label,:host a.medium .label{font-size:1.14em}:host button.small .label,:host a.small .label{font-size:1em}:host button .button-container,:host a .button-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:1;-webkit-transition:opacity 0.2s linear;transition:opacity 0.2s linear;gap:5px}:host button.icon-right .button-container,:host a.icon-right .button-container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host button.selected,:host a.selected{cursor:pointer;background-color:var(--color-base);-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-darker);box-shadow:inset 0px 0px 0px 2px var(--color-darker)}:host button.selected .label,:host a.selected .label{color:var(--neutral-purewhite-black)}:host button.disabled,:host a.disabled{cursor:not-allowed;background-color:var(--neutral-white-primary-darker);-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-medium-primary-base);box-shadow:inset 0px 0px 0px 2px var(--neutral-medium-primary-base)}:host button.disabled .label,:host a.disabled .label{color:var(--neutral-medium-primary-base)}";
8
+
9
+ const CuraButtonOutline = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.onclick = index.createEvent(this, "onclick", 7);
13
+ this.theme = window.CuraAPI.theme;
14
+ this.size = 'medium';
15
+ this.disabled = false;
16
+ this.selected = false;
17
+ this.iconPosition = 'right';
18
+ this.color = 'accent';
19
+ this.background = 'light';
20
+ this.fontcolor = 'dark';
21
+ this.hovered = false;
22
+ this.styles = {};
23
+ }
24
+ setColors() {
25
+ const colors = [
26
+ { name: '--color-base', theme: `${this.color}-base` },
27
+ { name: '--color-darker', theme: `${this.color}-darker` },
28
+ { name: '--color-lighter', theme: `${this.color}-lighter` },
29
+ { name: '--neutral-purewhite-black', theme: this.fontcolor === 'light' ? 'neutral-purewhite' : 'neutral-black' },
30
+ { name: '--neutral-white-primary-darker', theme: this.background === 'light' ? 'neutral-white' : 'primary-darker' },
31
+ { name: '--neutral-medium-primary-base', theme: this.background === 'light' ? 'neutral-medium' : 'primary-base' },
32
+ ];
33
+ colors.forEach(color => {
34
+ this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme) });
35
+ });
36
+ }
37
+ setStyles() {
38
+ this.weights = this.theme.fonts.getWeights();
39
+ this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
40
+ this.styles['--font-size'] = this.theme.fonts.getSize();
41
+ this.styles['--font-family'] = this.theme.fonts.getFamily();
42
+ this.styles['--font-weight-medium'] = this.weights.medium;
43
+ this.styles['--neutral-purewhite'] = this.theme.colors.getColor("neutral-purewhite");
44
+ this.styles['--neutral-black'] = this.theme.colors.getColor("neutral-black");
45
+ this.styles['--primary-base'] = this.theme.colors.getColor("primary-base");
46
+ this.styles['--info-base'] = this.theme.colors.getColor("info-base");
47
+ }
48
+ connectedCallback() {
49
+ this.setStyles();
50
+ this.setColors();
51
+ }
52
+ handleMouseEnter() {
53
+ if (this.disabled)
54
+ return;
55
+ this.hovered = true;
56
+ }
57
+ handleMouseLeave() {
58
+ this.hovered = false;
59
+ }
60
+ getIcon() {
61
+ if (!this.selected)
62
+ return '';
63
+ const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
64
+ const iconName = this.hovered ? 'closeCircle' : 'checkCircle';
65
+ const fontcolor = this.disabled
66
+ ? (this.background === 'light' ? 'neutral-medium' : 'primary-base')
67
+ : this.selected && this.fontcolor === "dark" ? 'neutral-black' : "neutral-purewhite";
68
+ return index.h("cura-icon", { class: "button-icon", name: iconName, size: iconSize, color: fontcolor });
69
+ }
70
+ handleClick(e) {
71
+ if (this.disabled)
72
+ e.preventDefault();
73
+ this.selected = !this.selected;
74
+ this.onclick.emit({ selected: this.selected });
75
+ }
76
+ getClasses() {
77
+ const classes = {};
78
+ classes[`${this.size.toLowerCase()}`] = true;
79
+ classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
80
+ classes['disabled'] = this.disabled;
81
+ classes['selected'] = this.selected;
82
+ return classes;
83
+ }
84
+ render() {
85
+ return (index.h(index.Host, null, index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("div", { class: "button-container" }, this.getIcon(), index.h("span", { class: "label" }, index.h("slot", null))))));
86
+ }
87
+ static get watchers() { return {
88
+ "background": ["setColors", "getIcon"],
89
+ "color": ["setColors"],
90
+ "fontcolor": ["setColors", "getIcon"]
91
+ }; }
92
+ };
93
+ CuraButtonOutline.style = curaButtonSelectCss;
94
+
95
+ exports.cura_button_select = CuraButtonOutline;
96
+
97
+ //# sourceMappingURL=cura-button-select.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-button-select.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,y1GAAy1G;;MCQx2G,iBAAiB;;;;IAuC5B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAA;gBAnCkC,QAAQ;oBAIlC,KAAK;oBAIL,KAAK;wBAIiB,OAAO;iBAIjD,QAAQ;sBAIe,OAAO;qBAKR,MAAM;mBAIzB,KAAK;kBAEN,EAAE;;EAWpB,SAAS;IACP,MAAM,MAAM,GAAG;MACb,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,OAAO,EAAE;MACrD,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,SAAS,EAAE;MACzD,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,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AGD,WAAW,CAAC,CAAQ;IAClB,IAAI,IAAI,CAAC,QAAQ;MAAE,CAAC,CAAC,cAAc,EAAE,CAAC;IACtC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;GAChD;EAGD,UAAU;IACR,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IAC7C,OAAO,CAAC,QAAQ,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1D,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpC,OAAO,OAAO,CAAC;GAChB;EAED,MAAM;IACJ,QACEA,QAACC,UAAI,QACHD,oBAAQ,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAC9B,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACnC,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAC3C,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,IAC3CA,iBAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,OAAO,EAAE,EACfA,kBAAM,KAAK,EAAC,OAAO,IAACA,qBAAa,CAAO,CACpC,CACC,CACJ,EACP;GACH;;;;;;;;;;;","names":["h","Host"],"sources":["./src/components/buttons/cura-button-select/cura-button-select.scss?tag=cura-button-select&encapsulation=shadow","./src/components/buttons/cura-button-select/cura-button-select.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: var(--neutral-purewhite);\n border: none;\n box-shadow: inset 0px 0px 0px 2px var(--primary-base);\n\n &:not(.disabled):hover {\n background-color: var(--color-lighter);\n box-shadow: inset 0px 0px 0px 2px var(--color-base);\n .label {\n color: var(--neutral-purewhite-black);\n }\n }\n\n &:focus {\n box-shadow: inset 0px 0px 0px 2px var(--info-base) !important;\n }\n }\n\n @include button-sizes();\n\n @include button-label() {\n color: var(--primary-base);\n }\n\n // Children Elements\n @include button-container() {\n gap: 5px;\n }\n\n @mixin button-icon() {\n margin: 0;\n }\n\n // selected state\n @include button-selected() {\n background-color: var(--color-base);\n box-shadow: inset 0px 0px 0px 2px var(--color-darker);\n .label {\n color: var(--neutral-purewhite-black);\n }\n }\n\n // Disabled state\n @include button-disabled() {\n background-color: var(--neutral-white-primary-darker);\n box-shadow: inset 0px 0px 0px 2px var(--neutral-medium-primary-base);\n .label {\n color: var(--neutral-medium-primary-base);\n }\n }\n\n }\n}\n","import { Component, Host, h, Prop, Watch, State, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\n\nexport class CuraButtonOutline {\n /**\n * Button size: small | medium (default) | large = medium\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n /**\n * Disabled state. Boolean.\n */\n @Prop({ reflect: true }) disabled = false;\n /**\n * selected state. Boolean.\n */\n @Prop({ reflect: true }) selected = false;\n /**\n * Icon position: left (default) | right.\n */\n @Prop({ reflect: true }) iconPosition: 'left' | 'right' = 'right';\n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n /**\n * Set the font color to dark or light.\n */\n @Prop() background: 'dark' | 'light' = 'light';\n /**\n * fontcolor theme of the checkbox.\n * Can be 'dark' or 'light'.\n */\n @Prop() fontcolor: 'dark' | 'light' = 'dark';\n /**\n * hovered state. Boolean.\n */\n @State() hovered = false;\n\n @State() styles = {};\n\n @Event({ eventName: \"onclick\" }) onclick: EventEmitter<{ selected: boolean; }>;\n\n theme = window.CuraAPI.theme\n\n weights;\n\n @Watch('background')\n @Watch('color')\n @Watch('fontcolor')\n setColors() {\n const colors = [\n { name: '--color-base', theme: `${this.color}-base` },\n { name: '--color-darker', theme: `${this.color}-darker` },\n { name: '--color-lighter', theme: `${this.color}-lighter` },\n { name: '--neutral-purewhite-black', theme: this.fontcolor === 'light' ? 'neutral-purewhite' : 'neutral-black' },\n { name: '--neutral-white-primary-darker', theme: this.background === 'light' ? 'neutral-white' : 'primary-darker' },\n { name: '--neutral-medium-primary-base', theme: this.background === 'light' ? 'neutral-medium' : 'primary-base' },\n ];\n\n colors.forEach(color => {\n this.styles = {\n ...this.styles,\n [color.name]: this.theme.colors.getColor(color.theme)\n };\n });\n }\n\n setStyles() {\n this.weights = this.theme.fonts.getWeights();\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--neutral-purewhite'] = this.theme.colors.getColor(\"neutral-purewhite\");\n this.styles['--neutral-black'] = this.theme.colors.getColor(\"neutral-black\");\n this.styles['--primary-base'] = this.theme.colors.getColor(\"primary-base\");\n this.styles['--info-base'] = this.theme.colors.getColor(\"info-base\");\n }\n\n connectedCallback() {\n this.setStyles()\n this.setColors();\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Watch('background')\n @Watch('fontcolor')\n getIcon() {\n if (!this.selected) return '';\n\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const iconName = this.hovered ? 'closeCircle' : 'checkCircle';\n const fontcolor =\n this.disabled\n ? (this.background === 'light' ? 'neutral-medium' : 'primary-base')\n : this.selected && this.fontcolor === \"dark\" ? 'neutral-black' : \"neutral-purewhite\";\n\n return <cura-icon class=\"button-icon\" name={iconName} size={iconSize} color={fontcolor}></cura-icon>;\n }\n\n\n handleClick(e: Event) {\n if (this.disabled) e.preventDefault();\n this.selected = !this.selected;\n this.onclick.emit({ selected: this.selected });\n }\n\n\n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n render() {\n return (\n <Host>\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}>\n <div class=\"button-container\">\n {this.getIcon()}\n <span class=\"label\"><slot></slot></span>\n </div>\n </button>\n </Host>\n );\n }\n\n}\n"],"version":3}
@@ -0,0 +1,83 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7616f620.js');
6
+
7
+ const curaButtonTransparentCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle}:host button,:host a{outline:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;-webkit-transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;border-radius:var(--border-radius);background-color:transparent;border-width:0px;border-color:transparent;padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.disabled):not(.isLoading):hover .label,:host a:not(.disabled):not(.isLoading):hover .label{color:var(--color-light)}:host button:not(.disabled):not(.isLoading):hover cura-icon,:host a:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-light) !important}:host button:not(.disabled):not(.inverted):not(.isLoading):active .label,:host a:not(.disabled):not(.inverted):not(.isLoading):active .label{color:var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active cura-icon,:host a:not(.disabled):not(.inverted):not(.isLoading):active cura-icon{--color:var(--color-dark) !important}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:1;-webkit-transition:opacity 0.2s linear;transition:opacity 0.2s linear}:host button.icon-right .button-container,:host a.icon-right .button-container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host button .label,:host a .label{-ms-flex:1;flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\");color:var(--color-base)}:host button .label.inverted,:host a .label.inverted{color:var(--neutral-white)}:host button.medium .label,:host a.medium .label{font-size:1.14em}:host button.small .label,:host a.small .label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed;border-color:var(--neutral-base)}:host button.disabled .label,:host button.disabled .label.inverted,:host a.disabled .label,:host a.disabled .label.inverted{color:var(--neutral-dark)}:host button.disabled.inverted,:host a.disabled.inverted{opacity:0.6}:host button.disabled.inverted .label,:host button.disabled.inverted .label.inverted,:host a.disabled.inverted .label,:host a.disabled.inverted .label.inverted{color:var(--neutral-white)}:host button.disabled.inverted cura-icon,:host a.disabled.inverted cura-icon{--color:var(--neutral-white) !important}:host button.disabled.inverted cura-loader-circle,:host a.disabled.inverted cura-loader-circle{--color:var(--neutral-white) !important}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only .label,:host a.icon-only .label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button.inverted:not(.isLoading):not(.disabled):hover .label,:host a.inverted:not(.isLoading):not(.disabled):hover .label{color:var(--color-lighter)}:host button.inverted:not(.isLoading):not(.disabled):hover cura-icon,:host a.inverted:not(.isLoading):not(.disabled):hover cura-icon{--color:var(--color-lighter) !important}:host button.inverted:not(.isLoading):not(.disabled):active .label,:host a.inverted:not(.isLoading):not(.disabled):active .label{color:var(--color-light)}:host button.inverted:not(.isLoading):not(.disabled):active cura-icon,:host a.inverted:not(.isLoading):not(.disabled):active cura-icon{--color:var(--color-light) !important}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}";
8
+
9
+ const CuraButtonTransparent = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.size = 'large';
13
+ this.disabled = false;
14
+ this.isLoading = false;
15
+ this.iconName = undefined;
16
+ this.iconset = 'default';
17
+ this.iconPosition = 'left';
18
+ this.iconOnly = false;
19
+ this.href = undefined;
20
+ this.target = "_self";
21
+ this.color = 'accent';
22
+ this.fontColor = 'dark';
23
+ this.textAlign = 'left';
24
+ this.styles = {};
25
+ }
26
+ handleChangeColor() {
27
+ this.setColors();
28
+ }
29
+ connectedCallback() {
30
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
31
+ this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
32
+ this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
33
+ this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
34
+ this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
35
+ this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
36
+ this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
37
+ this.styles['--font-weight-medium'] = this.weights.medium;
38
+ this.styles['--text-align'] = this.textAlign;
39
+ this.setColors();
40
+ }
41
+ getClasses() {
42
+ const classes = {};
43
+ classes[`${this.size.toLowerCase()}`] = true;
44
+ classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
45
+ classes[`icon-only`] = this.iconOnly;
46
+ classes['inverted'] = this.fontColor === 'light';
47
+ classes['disabled'] = this.disabled;
48
+ classes['isLoading'] = this.isLoading;
49
+ return classes;
50
+ }
51
+ setColors() {
52
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`) });
53
+ }
54
+ getIcon() {
55
+ if (!this.iconName)
56
+ return '';
57
+ const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
58
+ const color = this.getSymbolColor();
59
+ return index.h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: color });
60
+ }
61
+ getSymbolColor() {
62
+ return this.disabled
63
+ ? 'neutral-dark'
64
+ : this.fontColor === 'light'
65
+ ? 'neutral-white'
66
+ : `${this.color}-base`;
67
+ }
68
+ handleClick(e) {
69
+ if (this.disabled || this.isLoading)
70
+ e.preventDefault();
71
+ }
72
+ render() {
73
+ return (index.h(index.Host, null, this.href ? (index.h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e) }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e) }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
74
+ }
75
+ static get watchers() { return {
76
+ "color": ["handleChangeColor"]
77
+ }; }
78
+ };
79
+ CuraButtonTransparent.style = curaButtonTransparentCss;
80
+
81
+ exports.cura_button_transparent = CuraButtonTransparent;
82
+
83
+ //# sourceMappingURL=cura-button-transparent.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-button-transparent.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,wBAAwB,GAAG,8vLAA8vL;;MCOlxL,qBAAqB;;;gBAK6B,OAAO;oB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AC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,EAC/B,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IACnCA,kBAAM,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,OAAO,EAAE,EAChBA,kBAAM,KAAK,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,EAAC,IAAEA,qBAAa,CAAO,CACjF,EACPA,gCAAoB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,GAAuB,CACjF,CACV,CACM,EACP;GACH;;;;;;;;;","names":["h","Host"],"sources":["./src/components/buttons/cura-button-transparent/cura-button-transparent.scss?tag=cura-button-transparent&encapsulation=shadow","./src/components/buttons/cura-button-transparent/cura-button-transparent.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n border-width: 0px;\n border-color: transparent;\n\n &:not(.disabled):not(.isLoading):hover {\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active { \n .label { color: var(--color-dark); }\n cura-icon { --color: var(--color-dark) !important; }\n }\n }\n \n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label() {\n color: var(--color-base);\n &.inverted { color: var(--neutral-white); }\n }\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n border-color: var(--neutral-base);\n .label, .label.inverted { color: var(--neutral-dark); }\n &.inverted {\n opacity: 0.6;\n .label, .label.inverted { color: var(--neutral-white); }\n cura-icon { --color: var(--neutral-white) !important; }\n cura-loader-circle { --color: var(--neutral-white) !important; }\n }\n }\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n &.inverted {\n &:not(.isLoading):not(.disabled):hover { \n .label { color: var(--color-lighter); }\n cura-icon { --color: var(--color-lighter) !important; }\n }\n &:not(.isLoading):not(.disabled):active {\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n }\n\n // Loading State\n @include button-loading();\n\n }\n}\n","import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-transparent',\n styleUrl: 'cura-button-transparent.scss',\n shadow: true,\n})\nexport class CuraButtonTransparent {\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({reflect: true}) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({reflect: true}) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({reflect: true}) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({reflect: true}) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({reflect: true}) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({reflect: true}) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({reflect: true}) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({reflect: true}) href: string;\n /**\n * Set target if link.\n */\n @Prop({reflect: true}) target = \"_self\";\n\n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n /**\n * Set the font color to dark or light.\n */\n @Prop({reflect: true}) fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({reflect: true}) textAlign: 'left' | 'center' | 'right' = 'left';\n\n\n @State() styles = {};\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['inverted'] = this.fontColor === 'light';\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n return classes;\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`)\n };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const color = this.getSymbolColor();\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={color}></cura-icon>;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-dark'\n : this.fontColor === 'light'\n ? 'neutral-white'\n : `${this.color}-base`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) e.preventDefault();\n }\n\n render() {\n return (\n <Host>\n { this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"version":3}
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7616f620.js');
6
+ const curaForms_definitions = require('./cura-forms.definitions-11be2ebd.js');
7
+
8
+ const curaCheckboxCss = "@charset \"UTF-8\";:host{display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;-webkit-box-sizing:border-box;box-sizing:border-box}.container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row-reverse;flex-direction:row-reverse;gap:var(--gap)}.position.container{-ms-flex-direction:row;flex-direction:row}.position .label-wrapper{-ms-flex-pack:end;justify-content:end}.position .message{text-align:right}.position .label{-ms-flex-order:1;order:1}.info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.label-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center;gap:5px}.control{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;cursor:pointer;position:relative}.checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid var(--primary-base-neutral-medium);border-radius:4px;background:var(--neutral-lighter-neutral-purewhite);-ms-flex:1 0;flex:1 0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;position:relative;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;width:var(--size);height:var(--size);-ms-flex:0 0 var(--size);flex:0 0 var(--size)}.icon{position:absolute;display:-ms-flexbox;display:flex;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s}.checkbox:focus{border-color:var(--info-base) !important}.disabled .checkbox{background:var(--primary-darker-neutral-white);border-color:var(--primary-base-neutral-base);cursor:not-allowed}.disabled .checkbox:hover{border-color:var(--primary-base-neutral-base) !important}.disabled.checked .checkbox,.disabled.indeterminate .checkbox{background:var(--primary-base-neutral-white);border-color:var(--primary-base-neutral-base)}.disabled.checked .checkbox:hover,.disabled.indeterminate .checkbox:hover{border-color:var(--primary-base-neutral-base) !important;background:var(--primary-base-neutral-white)}.disabled .checkbox:focus{border-color:var(--primary-base-neutral-base)}.checked .checkbox,.indeterminate .checkbox{border-color:var(--color-dark);background:var(--color-base)}.checked .checkbox:hover,.indeterminate .checkbox:hover{border-color:var(--color-light) !important;background:var(--color-lighter)}.checked .icon,.indeterminate .icon{opacity:1}:not(.disabled):not(.checked):not(.indeterminate) .checkbox:hover{border-color:var(--primary-base-neutral-dark)}.success .checkbox{border-color:var(--success-base);background:var(--success-lighter)}.success .checkbox:hover{border-color:var(--success-base) !important}.success.checked .checkbox{border-color:var(--success-dark-base);background:var(--success-base-lighter)}.success.checked .checkbox:hover{border-color:var(--success-dark-base)}.error .checkbox{border-color:var(--error-base);background:var(--error-lighter)}.error .checkbox:hover{border-color:var(--error-base) !important}.error.checked .checkbox{border-color:var(--error-dark-base);background:var(--error-base-lighter)}.error.checked .checkbox:hover{border-color:var(--error-dark-base)}input{appearance:none;-webkit-appearance:none;-moz-appearance:none}";
9
+
10
+ const CuraCheckbox = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.onchange = index.createEvent(this, "onchange", 7);
14
+ this.isDarkbackground = () => this.background === 'dark';
15
+ this.isDarkIconColor = () => this.iconColor === 'dark';
16
+ /**
17
+ * Handles click event on the checkbox.
18
+ * Emits onchange event with value, checked, and indeterminate states.
19
+ */
20
+ this.handleClick = () => {
21
+ if (this.disabled)
22
+ return;
23
+ this.indeterminate = false;
24
+ this.checked = !this.checked;
25
+ this.onchange.emit({ value: this.value, checked: this.checked, indeterminate: this.indeterminate });
26
+ };
27
+ this.checked = false;
28
+ this.indeterminate = false;
29
+ this.status = 'default';
30
+ this.disabled = false;
31
+ this.required = false;
32
+ this.label = undefined;
33
+ this.ontabindex = 0;
34
+ this.position = 'left';
35
+ this.value = undefined;
36
+ this.name = undefined;
37
+ this.size = 'medium';
38
+ this.background = 'light';
39
+ this.iconColor = 'dark';
40
+ this.color = 'accent';
41
+ this.styles = {};
42
+ }
43
+ sizeHandler() {
44
+ this.styles['--size'] = `${curaForms_definitions.formsSizes[this.size].size}px`;
45
+ this.styles['--gap'] = `${curaForms_definitions.formsSizes[this.size].gap}px`;
46
+ }
47
+ /**
48
+ * Watches changes in color and background properties to update styles.
49
+ */
50
+ setColors() {
51
+ const colors = [
52
+ { name: '--color-base', background: `${this.color}-base` },
53
+ { name: '--color-lighter', background: `${this.color}-lighter` },
54
+ { name: '--color-light', background: `${this.color}-light` },
55
+ { name: '--color-dark', background: `${this.color}-dark` },
56
+ { name: '--info-base', background: 'info-base' },
57
+ { name: '--error-base', background: 'error-base' },
58
+ { name: '--success-lighter', background: 'success-lighter' },
59
+ { name: '--success-base', background: 'success-base' },
60
+ { name: '--success-dark', background: 'success-dark' },
61
+ { name: '--error-lighter', background: 'error-lighter' },
62
+ { name: '--primary-base-neutral-white', background: this.isDarkbackground() ? 'primary-base' : 'neutral-white' },
63
+ { name: '--primary-base-neutral-medium', background: this.isDarkbackground() ? 'primary-base' : 'neutral-medium' },
64
+ { name: '--neutral-lighter-neutral-purewhite', background: this.isDarkbackground() ? 'neutral-lighter' : 'neutral-purewhite' },
65
+ { name: '--primary-darker-neutral-white', background: this.isDarkbackground() ? 'primary-darker' : 'neutral-white' },
66
+ { name: '--primary-base-neutral-base', background: this.isDarkbackground() ? 'primary-base' : 'neutral-base' },
67
+ { name: '--primary-base-neutral-dark', background: this.isDarkbackground() ? 'primary-base' : 'neutral-dark' },
68
+ { name: '--primary-base-neutral-medium', background: this.isDarkbackground() ? 'primary-base' : 'neutral-medium' },
69
+ { name: '--success-base-lighter', background: this.isDarkbackground() ? 'success-base' : 'success-lighter' },
70
+ { name: '--success-dark-base', background: this.isDarkbackground() ? 'success-dark' : 'success-base' },
71
+ { name: '--error-base-lighter', background: this.isDarkbackground() ? 'error-base' : 'error-lighter' },
72
+ { name: '--error-dark-base', background: this.isDarkbackground() ? 'error-dark' : 'error-base' },
73
+ ];
74
+ colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.background));
75
+ this.styles = Object.assign({}, this.styles);
76
+ }
77
+ connectedCallback() {
78
+ this.sizeHandler();
79
+ this.setColors();
80
+ }
81
+ /**
82
+ * Retrieves classes based on component state for conditional styling.
83
+ */
84
+ getClasses() {
85
+ const classes = {};
86
+ classes['container'] = true;
87
+ classes['checked'] = this.checked;
88
+ classes['disabled'] = this.disabled;
89
+ classes['indeterminate'] = this.indeterminate;
90
+ classes['position'] = this.position === 'right';
91
+ classes[this.status] = true;
92
+ return classes;
93
+ }
94
+ /**
95
+ * Assigns color based on status and background theme.
96
+ * @param defaultColor Default color.
97
+ */
98
+ assignColor(type) {
99
+ if (this.disabled)
100
+ return this.isDarkbackground() ? 'primary-darker' : 'neutral-medium';
101
+ const statusColors = {
102
+ success: {
103
+ icon: 'success-dark',
104
+ label: this.isDarkbackground() ? 'success-lighter' : 'success-darker',
105
+ message: this.isDarkbackground() ? 'success-base' : 'success-dark'
106
+ },
107
+ error: {
108
+ icon: 'error-dark',
109
+ label: this.isDarkbackground() ? 'error-lighter' : 'neutral-darker',
110
+ message: this.isDarkbackground() ? 'error-base' : 'error-dark'
111
+ },
112
+ default: {
113
+ icon: this.isDarkIconColor() ? 'neutral-black' : 'neutral-purewhite',
114
+ label: this.isDarkbackground() ? 'neutral-white' : 'neutral-black',
115
+ message: this.isDarkbackground() ? 'primary-lighter' : 'neutral-dark'
116
+ }
117
+ };
118
+ return statusColors[this.status][type];
119
+ }
120
+ /**
121
+ * Retrieves icon element based on checkbox state.
122
+ */
123
+ getIcon() {
124
+ const iconName = this.indeterminate ? 'minus' : "check";
125
+ const iconColor = this.assignColor('icon');
126
+ const iconSize = this.size === 'large' ? 20 : "micro";
127
+ return index.h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
128
+ }
129
+ render() {
130
+ return (index.h(index.Host, null, index.h("div", { class: this.getClasses(), style: this.styles }, index.h("div", { class: "info" }, index.h("div", { class: "label-wrapper" }, index.h("cura-label", { class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", null))), index.h("div", { class: "checkbox", onClick: this.handleClick, tabIndex: this.ontabindex }, index.h("input", { type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
131
+ }
132
+ get host() { return index.getElement(this); }
133
+ static get watchers() { return {
134
+ "size": ["sizeHandler"],
135
+ "color": ["setColors"],
136
+ "background": ["setColors", "assignColor"],
137
+ "iconColor": ["assignColor"]
138
+ }; }
139
+ };
140
+ CuraCheckbox.style = curaCheckboxCss;
141
+
142
+ exports.cura_checkbox = CuraCheckbox;
143
+
144
+ //# sourceMappingURL=cura-checkbox.cjs.entry.js.map