@rededor/cura 1.1.0 → 1.2.0-alpha.0

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 (238) hide show
  1. package/dist/assets/assets/cura-assets.zip +0 -0
  2. package/dist/cjs/app-globals-4d07f363.js.map +1 -1
  3. package/dist/cjs/cura-accordion_12.cjs.entry.js +21 -15
  4. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
  5. package/dist/cjs/cura-alert.cjs.entry.js +2 -2
  6. package/dist/cjs/cura-avatar.cjs.entry.js +2 -2
  7. package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
  8. package/dist/cjs/cura-badge-number.cjs.entry.js +29 -0
  9. package/dist/cjs/cura-badge-number.cjs.entry.js.map +1 -0
  10. package/dist/cjs/cura-button-outline.cjs.entry.js +2 -2
  11. package/dist/cjs/cura-button-select.cjs.entry.js +69 -58
  12. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  13. package/dist/cjs/cura-button-transparent.cjs.entry.js +2 -2
  14. package/dist/cjs/cura-calendar.cjs.entry.js +120 -234
  15. package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-card.cjs.entry.js +2 -2
  17. package/dist/cjs/cura-checkbox.cjs.entry.js +2 -2
  18. package/dist/cjs/cura-display.cjs.entry.js +2 -2
  19. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +2 -2
  20. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +3 -3
  21. package/dist/cjs/cura-dropdown-search.cjs.entry.js +30 -4
  22. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
  23. package/dist/cjs/cura-icons-view.cjs.entry.js +4 -4
  24. package/dist/cjs/cura-input-date.cjs.entry.js +188 -0
  25. package/dist/cjs/cura-input-date.cjs.entry.js.map +1 -0
  26. package/dist/cjs/cura-loader-bar.cjs.entry.js +2 -2
  27. package/dist/cjs/cura-radio.cjs.entry.js +2 -2
  28. package/dist/cjs/cura-switch.cjs.entry.js +2 -2
  29. package/dist/cjs/cura-toast.cjs.entry.js +2 -2
  30. package/dist/cjs/cura.cjs.js +2 -2
  31. package/dist/cjs/index-6dc29195.js +126 -0
  32. package/dist/cjs/index-6dc29195.js.map +1 -0
  33. package/dist/cjs/{index-98e7ba54.js → index-e6d728ec.js} +70 -3
  34. package/dist/{esm/index-1ad98520.js.map → cjs/index-e6d728ec.js.map} +1 -1
  35. package/dist/cjs/loader.cjs.js +2 -2
  36. package/dist/collection/collection-manifest.json +2 -0
  37. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +30 -0
  38. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +66 -0
  39. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +1 -0
  40. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js +56 -0
  41. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js.map +1 -0
  42. package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
  43. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
  44. package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +49 -21
  45. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +110 -113
  46. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  47. package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js +133 -0
  48. package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js.map +1 -0
  49. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
  50. package/dist/collection/components/cura-alert/cura-alert.js +1 -1
  51. package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
  52. package/dist/collection/components/cura-calendar/cura-calendar.css +2 -0
  53. package/dist/collection/components/cura-calendar/cura-calendar.js +79 -47
  54. package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
  55. package/dist/collection/components/cura-card/cura-card.js +1 -1
  56. package/dist/collection/components/cura-icon/cura-icon.js +1 -1
  57. package/dist/collection/components/cura-icons-view/cura-icons-view.js +3 -3
  58. package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
  59. package/dist/collection/components/cura-toast/cura-toast.js +1 -1
  60. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  61. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
  62. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  63. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +1 -1
  64. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +28 -2
  65. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  66. package/dist/collection/components/forms/cura-input-date/cura-input-date.css +79 -0
  67. package/dist/collection/components/forms/cura-input-date/cura-input-date.js +424 -0
  68. package/dist/collection/components/forms/cura-input-date/cura-input-date.js.map +1 -0
  69. package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js +138 -0
  70. package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js.map +1 -0
  71. package/dist/collection/components/forms/cura-input-text/cura-input-text.css +5 -2
  72. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +41 -2
  73. package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
  74. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +73 -21
  75. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -1
  76. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +3 -0
  77. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -1
  78. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  79. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  80. package/dist/collection/components/forms/cura-select/cura-select.css +5 -2
  81. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  82. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  83. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  84. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  85. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  86. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  87. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  88. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  89. package/dist/components/cura-alert.js +1 -1
  90. package/dist/components/cura-avatar.js +1 -1
  91. package/dist/components/cura-badge-number.d.ts +11 -0
  92. package/dist/components/cura-badge-number.js +8 -0
  93. package/dist/components/cura-badge-number.js.map +1 -0
  94. package/dist/components/cura-badge-number2.js +49 -0
  95. package/dist/components/cura-badge-number2.js.map +1 -0
  96. package/dist/components/cura-button-outline.js +1 -1
  97. package/dist/components/cura-button-select.js +81 -65
  98. package/dist/components/cura-button-select.js.map +1 -1
  99. package/dist/components/cura-button-transparent2.js +1 -1
  100. package/dist/components/cura-button.js +1 -1
  101. package/dist/components/cura-calendar.js +1 -4073
  102. package/dist/components/cura-calendar.js.map +1 -1
  103. package/dist/components/cura-calendar2.js +4082 -0
  104. package/dist/components/cura-calendar2.js.map +1 -0
  105. package/dist/components/cura-card.js +1 -1
  106. package/dist/components/cura-checkbox.js +1 -1
  107. package/dist/components/cura-display.js +1 -1
  108. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  109. package/dist/components/cura-dropdown-search-option.js +2 -2
  110. package/dist/components/cura-dropdown-search.js +29 -3
  111. package/dist/components/cura-dropdown-search.js.map +1 -1
  112. package/dist/components/cura-heading2.js +1 -1
  113. package/dist/components/cura-icon2.js +1 -1
  114. package/dist/components/cura-icons-view.js +3 -3
  115. package/dist/components/cura-input-date.d.ts +11 -0
  116. package/dist/components/cura-input-date.js +270 -0
  117. package/dist/components/cura-input-date.js.map +1 -0
  118. package/dist/components/cura-input-text2.js +10 -2
  119. package/dist/components/cura-input-text2.js.map +1 -1
  120. package/dist/components/cura-label2.js +1 -1
  121. package/dist/components/cura-loader-bar2.js +1 -1
  122. package/dist/components/cura-loader-circle2.js +1 -1
  123. package/dist/components/cura-page-template.js +1 -1
  124. package/dist/components/cura-paragraph2.js +1 -1
  125. package/dist/components/cura-radio.js +1 -1
  126. package/dist/components/cura-select-option2.js +1 -1
  127. package/dist/components/cura-select2.js +4 -4
  128. package/dist/components/cura-select2.js.map +1 -1
  129. package/dist/components/cura-switch.js +1 -1
  130. package/dist/components/cura-toast.js +1 -1
  131. package/dist/components/index.js +4 -0
  132. package/dist/components/index.js.map +1 -1
  133. package/dist/cura/cura.esm.js +1 -1
  134. package/dist/cura/cura.esm.js.map +1 -1
  135. package/dist/cura/p-0b7a7306.js.map +1 -1
  136. package/dist/cura/{p-0d435e42.entry.js → p-116a1cd6.entry.js} +2 -2
  137. package/dist/cura/p-272c784a.js +2 -0
  138. package/dist/cura/p-272c784a.js.map +1 -0
  139. package/dist/cura/{p-4c7a2419.entry.js → p-2d267d23.entry.js} +2 -2
  140. package/dist/cura/{p-9b658260.entry.js → p-33772510.entry.js} +2 -2
  141. package/dist/cura/{p-afd2c148.entry.js → p-41c3d47d.entry.js} +2 -2
  142. package/dist/cura/{p-fbf20e5a.entry.js → p-44e3325a.entry.js} +2 -2
  143. package/dist/cura/p-4e14c01c.entry.js +2 -0
  144. package/dist/cura/p-563ba0cd.entry.js +2 -0
  145. package/dist/cura/p-563ba0cd.entry.js.map +1 -0
  146. package/dist/cura/{p-57b8b468.entry.js → p-8f3db0fe.entry.js} +2 -2
  147. package/dist/cura/{p-a00d2c68.entry.js → p-907b3d12.entry.js} +2 -2
  148. package/dist/cura/p-a2ae6bd2.entry.js +2 -0
  149. package/dist/cura/p-a2ae6bd2.entry.js.map +1 -0
  150. package/dist/cura/{p-6682619b.entry.js → p-b2d5db22.entry.js} +2 -2
  151. package/dist/cura/p-b43b69f3.entry.js +2 -0
  152. package/dist/cura/p-b43b69f3.entry.js.map +1 -0
  153. package/dist/cura/{p-5ac9d510.entry.js → p-be10b681.entry.js} +2 -2
  154. package/dist/cura/p-be10b681.entry.js.map +1 -0
  155. package/dist/cura/{p-a5cf0fd6.entry.js → p-c6508bd7.entry.js} +2 -2
  156. package/dist/cura/{p-2203e829.entry.js → p-dcd2e5bb.entry.js} +2 -2
  157. package/dist/cura/{p-84d8c67d.entry.js → p-e5023e34.entry.js} +2 -2
  158. package/dist/cura/p-e8bc6381.entry.js +2 -0
  159. package/dist/cura/p-e8bc6381.entry.js.map +1 -0
  160. package/dist/cura/p-ed97cf3c.entry.js +2 -0
  161. package/dist/cura/p-ed97cf3c.entry.js.map +1 -0
  162. package/dist/cura/{p-ad8a7e0f.entry.js → p-fcbf4311.entry.js} +2 -2
  163. package/dist/cura/{p-66c5cf5f.entry.js → p-fd083399.entry.js} +2 -2
  164. package/dist/cura/p-fd5ed6b0.js +3 -0
  165. package/dist/cura/p-fd5ed6b0.js.map +1 -0
  166. package/dist/cura/{p-f9433d24.entry.js → p-fdce91a7.entry.js} +2 -2
  167. package/dist/esm/app-globals-6ca7103d.js.map +1 -1
  168. package/dist/esm/cura-accordion_12.entry.js +21 -15
  169. package/dist/esm/cura-accordion_12.entry.js.map +1 -1
  170. package/dist/esm/cura-alert.entry.js +2 -2
  171. package/dist/esm/cura-avatar.entry.js +2 -2
  172. package/dist/esm/cura-badge-distance.entry.js +1 -1
  173. package/dist/esm/cura-badge-number.entry.js +25 -0
  174. package/dist/esm/cura-badge-number.entry.js.map +1 -0
  175. package/dist/esm/cura-button-outline.entry.js +2 -2
  176. package/dist/esm/cura-button-select.entry.js +69 -58
  177. package/dist/esm/cura-button-select.entry.js.map +1 -1
  178. package/dist/esm/cura-button-transparent.entry.js +2 -2
  179. package/dist/esm/cura-calendar.entry.js +51 -165
  180. package/dist/esm/cura-calendar.entry.js.map +1 -1
  181. package/dist/esm/cura-card.entry.js +2 -2
  182. package/dist/esm/cura-checkbox.entry.js +2 -2
  183. package/dist/esm/cura-display.entry.js +2 -2
  184. package/dist/esm/cura-dropdown-search-option-title.entry.js +2 -2
  185. package/dist/esm/cura-dropdown-search-option.entry.js +3 -3
  186. package/dist/esm/cura-dropdown-search.entry.js +30 -4
  187. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  188. package/dist/esm/cura-icons-view.entry.js +4 -4
  189. package/dist/esm/cura-input-date.entry.js +184 -0
  190. package/dist/esm/cura-input-date.entry.js.map +1 -0
  191. package/dist/esm/cura-loader-bar.entry.js +2 -2
  192. package/dist/esm/cura-radio.entry.js +2 -2
  193. package/dist/esm/cura-switch.entry.js +2 -2
  194. package/dist/esm/cura-toast.entry.js +2 -2
  195. package/dist/esm/cura.js +3 -3
  196. package/dist/esm/{index-1ad98520.js → index-747aad85.js} +70 -3
  197. package/dist/esm/index-747aad85.js.map +1 -0
  198. package/dist/esm/index-fbee309a.js +120 -0
  199. package/dist/esm/index-fbee309a.js.map +1 -0
  200. package/dist/esm/loader.js +3 -3
  201. package/dist/types/components/badges/cura-badge-number/cura-badge-number.d.ts +8 -0
  202. package/dist/types/components/badges/cura-badge-number/cura-badge-number.stories.d.ts +39 -0
  203. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +12 -34
  204. package/dist/types/components/buttons/cura-button-select/cura-button-select.stories.d.ts +105 -0
  205. package/dist/types/components/cura-calendar/cura-calendar.d.ts +50 -42
  206. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +2 -0
  207. package/dist/types/components/forms/cura-input-date/cura-input-date.d.ts +92 -0
  208. package/dist/types/components/forms/cura-input-date/cura-input-date.stories.d.ts +125 -0
  209. package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +6 -0
  210. package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +15 -0
  211. package/dist/types/components.d.ts +158 -48
  212. package/package.json +2 -2
  213. package/dist/cjs/index-98e7ba54.js.map +0 -1
  214. package/dist/cura/p-312791fb.js +0 -3
  215. package/dist/cura/p-312791fb.js.map +0 -1
  216. package/dist/cura/p-42dfa3a7.entry.js +0 -2
  217. package/dist/cura/p-42dfa3a7.entry.js.map +0 -1
  218. package/dist/cura/p-5ac9d510.entry.js.map +0 -1
  219. package/dist/cura/p-a9cda3b1.entry.js +0 -2
  220. package/dist/cura/p-a9cda3b1.entry.js.map +0 -1
  221. package/dist/cura/p-df5c3a86.entry.js +0 -2
  222. package/dist/cura/p-df5c3a86.entry.js.map +0 -1
  223. package/dist/cura/p-dfc65f66.entry.js +0 -2
  224. /package/dist/cura/{p-0d435e42.entry.js.map → p-116a1cd6.entry.js.map} +0 -0
  225. /package/dist/cura/{p-4c7a2419.entry.js.map → p-2d267d23.entry.js.map} +0 -0
  226. /package/dist/cura/{p-9b658260.entry.js.map → p-33772510.entry.js.map} +0 -0
  227. /package/dist/cura/{p-afd2c148.entry.js.map → p-41c3d47d.entry.js.map} +0 -0
  228. /package/dist/cura/{p-fbf20e5a.entry.js.map → p-44e3325a.entry.js.map} +0 -0
  229. /package/dist/cura/{p-dfc65f66.entry.js.map → p-4e14c01c.entry.js.map} +0 -0
  230. /package/dist/cura/{p-57b8b468.entry.js.map → p-8f3db0fe.entry.js.map} +0 -0
  231. /package/dist/cura/{p-a00d2c68.entry.js.map → p-907b3d12.entry.js.map} +0 -0
  232. /package/dist/cura/{p-6682619b.entry.js.map → p-b2d5db22.entry.js.map} +0 -0
  233. /package/dist/cura/{p-a5cf0fd6.entry.js.map → p-c6508bd7.entry.js.map} +0 -0
  234. /package/dist/cura/{p-2203e829.entry.js.map → p-dcd2e5bb.entry.js.map} +0 -0
  235. /package/dist/cura/{p-84d8c67d.entry.js.map → p-e5023e34.entry.js.map} +0 -0
  236. /package/dist/cura/{p-ad8a7e0f.entry.js.map → p-fcbf4311.entry.js.map} +0 -0
  237. /package/dist/cura/{p-66c5cf5f.entry.js.map → p-fd083399.entry.js.map} +0 -0
  238. /package/dist/cura/{p-f9433d24.entry.js.map → p-fdce91a7.entry.js.map} +0 -0
@@ -1,45 +1,79 @@
1
1
  import { Host, h } from "@stencil/core";
2
- export class CuraButtonOutline {
2
+ export class CuraButtonSelect {
3
3
  constructor() {
4
4
  this.theme = window.CuraAPI.theme;
5
- this.size = 'medium';
6
- this.disabled = false;
7
5
  this.selected = false;
8
- this.iconPosition = 'right';
9
- this.color = 'accent';
10
- this.background = 'light';
11
- this.fontcolor = 'dark';
6
+ this.iconName = undefined;
7
+ this.size = undefined;
8
+ this.counter = undefined;
9
+ this.disabled = undefined;
10
+ this.background = undefined;
11
+ this.color = undefined;
12
12
  this.hovered = false;
13
13
  this.styles = {};
14
14
  }
15
15
  setColors() {
16
16
  const colors = [
17
- { name: '--color-base', theme: `${this.color}-base` },
18
- { name: '--color-darker', theme: `${this.color}-darker` },
19
- { name: '--color-lighter', theme: `${this.color}-lighter` },
20
- { name: '--neutral-purewhite-black', theme: this.fontcolor === 'light' ? 'neutral-purewhite' : 'neutral-black' },
21
- { name: '--neutral-white-primary-darker', theme: this.background === 'light' ? 'neutral-white' : 'primary-darker' },
22
- { name: '--neutral-medium-primary-base', theme: this.background === 'light' ? 'neutral-medium' : 'primary-base' },
17
+ { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },
18
+ { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },
19
+ { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },
20
+ { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },
21
+ { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },
22
+ { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },
23
+ { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },
24
+ { name: '--color-border-disable-unselect', thema: 'neutral-dark' },
25
+ { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },
26
+ { name: '--color-counter', thema: !this.disabled && 'primary-lighter' }
23
27
  ];
24
- colors.forEach(color => {
25
- this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme) });
26
- });
28
+ colors.forEach(color => (this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema)));
29
+ this.styles = Object.assign({}, this.styles);
27
30
  }
28
- setStyles() {
29
- this.weights = this.theme.fonts.getWeights();
30
- this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
31
- this.styles['--font-size'] = this.theme.fonts.getSize();
32
- this.styles['--font-family'] = this.theme.fonts.getFamily();
33
- this.styles['--font-weight-medium'] = this.weights.medium;
34
- this.styles['--neutral-purewhite'] = this.theme.colors.getColor("neutral-purewhite");
35
- this.styles['--neutral-black'] = this.theme.colors.getColor("neutral-black");
36
- this.styles['--primary-base'] = this.theme.colors.getColor("primary-base");
37
- this.styles['--info-base'] = this.theme.colors.getColor("info-base");
31
+ getClasses() {
32
+ const classes = {};
33
+ classes[`${this.size.toLowerCase()}`] = true;
34
+ classes['icon'] = true;
35
+ classes['disabled'] = this.disabled;
36
+ classes['selected'] = this.selected;
37
+ return classes;
38
38
  }
39
39
  connectedCallback() {
40
- this.setStyles();
41
40
  this.setColors();
42
41
  }
42
+ getLabelFontColor() {
43
+ if (this.disabled)
44
+ return 'neutral-dark';
45
+ if (this.background === 'dark') {
46
+ return this.selected ? 'neutral-black' : 'neutral-white';
47
+ }
48
+ if (this.background === 'light') {
49
+ return this.selected ? 'neutral-white' : 'neutral-black';
50
+ }
51
+ }
52
+ getColorCounter() {
53
+ if (this.background === 'dark' && this.disabled) {
54
+ return !this.selected ? 'neutral-black' : 'neutral-dark';
55
+ }
56
+ if (this.background === 'light' && this.disabled) {
57
+ return 'neutral-pale';
58
+ }
59
+ return `${this.color}-lighter`;
60
+ }
61
+ getColorBagdeNumber() {
62
+ if (this.background === 'dark' && this.disabled) {
63
+ return this.selected ? 'neutral-black' : 'neutral-dark';
64
+ }
65
+ if (this.background === 'light' && this.disabled) {
66
+ return 'neutral-medium';
67
+ }
68
+ return `${this.color}-darker`;
69
+ }
70
+ getIcon() {
71
+ const iconSize = this.size === 'large' ? 24 : this.size === 'medium' ? 20 : 16;
72
+ return h("cura-icon", { class: "button-icon", name: this.iconName, size: iconSize, color: this.getLabelFontColor() });
73
+ }
74
+ getCounter() {
75
+ return (h("cura-badge-number", { color: this.getColorCounter() }, h("cura-label", { color: this.getColorBagdeNumber() }, this.counter)));
76
+ }
43
77
  handleMouseEnter() {
44
78
  if (this.disabled)
45
79
  return;
@@ -48,37 +82,14 @@ export class CuraButtonOutline {
48
82
  handleMouseLeave() {
49
83
  this.hovered = false;
50
84
  }
51
- assignColor() {
52
- if (!this.selected)
53
- return 'primary-base';
54
- const fontcolor = this.disabled
55
- ? (this.background === 'light' ? 'neutral-medium' : 'primary-base')
56
- : this.selected && this.fontcolor === "dark" ? 'neutral-black' : "neutral-purewhite";
57
- return fontcolor;
58
- }
59
- getIcon() {
60
- if (!this.selected)
61
- return;
62
- const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
63
- const iconName = this.hovered ? 'closeCircle' : 'checkCircle';
64
- return h("cura-icon", { class: "button-icon", name: iconName, size: iconSize, color: this.assignColor() });
65
- }
66
85
  handleClick(e) {
67
86
  if (this.disabled)
68
87
  e.preventDefault();
69
88
  this.selected = !this.selected;
70
89
  this.onclick.emit({ selected: this.selected });
71
90
  }
72
- getClasses() {
73
- const classes = {};
74
- classes[`${this.size.toLowerCase()}`] = true;
75
- classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
76
- classes['disabled'] = this.disabled;
77
- classes['selected'] = this.selected;
78
- return classes;
79
- }
80
91
  render() {
81
- return (h(Host, { key: 'bbd95db4048d0bb3d4c17927da18136402bf91dd' }, h("button", { key: 'ae27bbadadf7597d4e6aaa406cbeee3dc47921cd', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: '6cdcdb3c908673c3babad6fd35cedc38ff358b61', class: "button-container" }, this.getIcon(), h("cura-label", { key: 'c058fedf71ac3c33a5711fba7be80dacd6ee8467', class: "label", lineHeight: '0%', color: this.assignColor() }, h("slot", { key: '5976c1f58c3d5bba77cf6cde7acc31fb49fcd25d' }))))));
92
+ return (h(Host, { key: '5b612b060b0a7b40ede004322995f0e410da8759' }, h("button", { key: '616ae769e76d647a3806daf33376ca88eb75da5d', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: 'ef0a6f7ed31c7c2b4eb0f74e3713c0cc99b79080', class: "button-container" }, this.iconName ? this.getIcon() : null, h("cura-label", { key: '0366f6538cc0ccf76c072de862fe60d87fccb937', class: "label", lineHeight: "0%", color: this.getLabelFontColor(), weight: 'regular' }, h("slot", { key: '72a72cc3a128223e7f41212005caff8aefbf1454' })), this.counter ? this.getCounter() : null))));
82
93
  }
83
94
  static get is() { return "cura-button-select"; }
84
95
  static get encapsulation() { return "shadow"; }
@@ -94,95 +105,91 @@ export class CuraButtonOutline {
94
105
  }
95
106
  static get properties() {
96
107
  return {
97
- "size": {
98
- "type": "string",
99
- "mutable": false,
108
+ "selected": {
109
+ "type": "boolean",
110
+ "mutable": true,
100
111
  "complexType": {
101
- "original": "'small' | 'medium' | 'large'",
102
- "resolved": "\"large\" | \"medium\" | \"small\"",
112
+ "original": "boolean",
113
+ "resolved": "boolean",
103
114
  "references": {}
104
115
  },
105
116
  "required": false,
106
117
  "optional": false,
107
118
  "docs": {
108
119
  "tags": [],
109
- "text": "Button size: small | medium (default) | large = medium"
120
+ "text": ""
110
121
  },
111
- "attribute": "size",
122
+ "attribute": "selected",
112
123
  "reflect": true,
113
- "defaultValue": "'medium'"
124
+ "defaultValue": "false"
114
125
  },
115
- "disabled": {
116
- "type": "boolean",
117
- "mutable": false,
126
+ "iconName": {
127
+ "type": "string",
128
+ "mutable": true,
118
129
  "complexType": {
119
- "original": "boolean",
120
- "resolved": "boolean",
130
+ "original": "string",
131
+ "resolved": "string",
121
132
  "references": {}
122
133
  },
123
134
  "required": false,
124
135
  "optional": false,
125
136
  "docs": {
126
137
  "tags": [],
127
- "text": "Disabled state. Boolean."
138
+ "text": ""
128
139
  },
129
- "attribute": "disabled",
130
- "reflect": true,
131
- "defaultValue": "false"
140
+ "attribute": "icon-name",
141
+ "reflect": true
132
142
  },
133
- "selected": {
134
- "type": "boolean",
143
+ "size": {
144
+ "type": "string",
135
145
  "mutable": false,
136
146
  "complexType": {
137
- "original": "boolean",
138
- "resolved": "boolean",
147
+ "original": "'small' | 'medium' | 'large'",
148
+ "resolved": "\"large\" | \"medium\" | \"small\"",
139
149
  "references": {}
140
150
  },
141
151
  "required": false,
142
152
  "optional": false,
143
153
  "docs": {
144
154
  "tags": [],
145
- "text": "selected state. Boolean."
155
+ "text": ""
146
156
  },
147
- "attribute": "selected",
148
- "reflect": true,
149
- "defaultValue": "false"
157
+ "attribute": "size",
158
+ "reflect": true
150
159
  },
151
- "iconPosition": {
152
- "type": "string",
153
- "mutable": false,
160
+ "counter": {
161
+ "type": "any",
162
+ "mutable": true,
154
163
  "complexType": {
155
- "original": "'left' | 'right'",
156
- "resolved": "\"left\" | \"right\"",
164
+ "original": "string | number | null",
165
+ "resolved": "number | string",
157
166
  "references": {}
158
167
  },
159
168
  "required": false,
160
169
  "optional": false,
161
170
  "docs": {
162
171
  "tags": [],
163
- "text": "Icon position: left (default) | right."
172
+ "text": ""
164
173
  },
165
- "attribute": "icon-position",
166
- "reflect": true,
167
- "defaultValue": "'right'"
174
+ "attribute": "counter",
175
+ "reflect": true
168
176
  },
169
- "color": {
170
- "type": "string",
177
+ "disabled": {
178
+ "type": "boolean",
171
179
  "mutable": false,
172
180
  "complexType": {
173
- "original": "string",
174
- "resolved": "string",
181
+ "original": "boolean",
182
+ "resolved": "boolean",
175
183
  "references": {}
176
184
  },
177
185
  "required": false,
178
186
  "optional": false,
179
187
  "docs": {
180
188
  "tags": [],
181
- "text": "Color base from color scheme. Default: accent."
189
+ "text": ""
182
190
  },
183
- "attribute": "color",
184
- "reflect": false,
185
- "defaultValue": "'accent'"
191
+ "attribute": "disabled",
192
+ "reflect": true
186
193
  },
187
194
  "background": {
188
195
  "type": "string",
@@ -196,29 +203,27 @@ export class CuraButtonOutline {
196
203
  "optional": false,
197
204
  "docs": {
198
205
  "tags": [],
199
- "text": "Set the font color to dark or light."
206
+ "text": ""
200
207
  },
201
208
  "attribute": "background",
202
- "reflect": false,
203
- "defaultValue": "'light'"
209
+ "reflect": false
204
210
  },
205
- "fontcolor": {
211
+ "color": {
206
212
  "type": "string",
207
213
  "mutable": false,
208
214
  "complexType": {
209
- "original": "'dark' | 'light'",
210
- "resolved": "\"dark\" | \"light\"",
215
+ "original": "string",
216
+ "resolved": "string",
211
217
  "references": {}
212
218
  },
213
219
  "required": false,
214
220
  "optional": false,
215
221
  "docs": {
216
222
  "tags": [],
217
- "text": "fontcolor theme of the checkbox.\nCan be 'dark' or 'light'."
223
+ "text": ""
218
224
  },
219
- "attribute": "fontcolor",
220
- "reflect": false,
221
- "defaultValue": "'dark'"
225
+ "attribute": "color",
226
+ "reflect": false
222
227
  }
223
228
  };
224
229
  }
@@ -240,12 +245,13 @@ export class CuraButtonOutline {
240
245
  "text": ""
241
246
  },
242
247
  "complexType": {
243
- "original": "{ selected: boolean; }",
248
+ "original": "{ selected: boolean }",
244
249
  "resolved": "{ selected: boolean; }",
245
250
  "references": {}
246
251
  }
247
252
  }];
248
253
  }
254
+ static get elementRef() { return "host"; }
249
255
  static get watchers() {
250
256
  return [{
251
257
  "propName": "background",
@@ -253,15 +259,6 @@ export class CuraButtonOutline {
253
259
  }, {
254
260
  "propName": "color",
255
261
  "methodName": "setColors"
256
- }, {
257
- "propName": "fontcolor",
258
- "methodName": "setColors"
259
- }, {
260
- "propName": "background",
261
- "methodName": "assignColor"
262
- }, {
263
- "propName": "fontcolor",
264
- "methodName": "assignColor"
265
262
  }];
266
263
  }
267
264
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cura-button-select.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQ5F,MAAM,OAAO,iBAAiB;;QAuC5B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAA;oBAnCkC,QAAQ;wBAIlC,KAAK;wBAIL,KAAK;4BAIiB,OAAO;qBAIjD,QAAQ;0BAIe,OAAO;yBAKR,MAAM;uBAIzB,KAAK;sBAEN,EAAE;;IAWpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,OAAO,EAAE;YACrD,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,SAAS,EAAE;YACzD,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,UAAU,EAAE;YAC3D,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,eAAe,EAAE;YAChH,EAAE,IAAI,EAAE,gCAAgC,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EAAE;YACnH,EAAE,IAAI,EAAE,+BAA+B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB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AAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["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 assignColor() {\n if (!this.selected) return 'primary-base'\n\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 fontcolor\n }\n\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\n return <cura-icon class=\"button-icon\" name={iconName} size={iconSize} color={this.assignColor()}></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\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 <cura-label class=\"label\" lineHeight='0%' color={this.assignColor()}><slot></slot></cura-label>\n </div>\n </button>\n </Host>\n );\n }\n\n}\n"]}
1
+ {"version":3,"file":"cura-button-select.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOrG,MAAM,OAAO,gBAAgB;;QAgB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAbsB,KAAK;;;;;;;uBAQrC,KAAK;sBACN,EAAE;;IAUpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,EAAE;YACzG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,QAAQ,EAAE;YAC3H,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,OAAO,EAAE;YACvH,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,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MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,+DACE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAC3C,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAE3C,4DAAK,KAAK,EAAC,kBAAkB;oBAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI;oBACtC,mEAAY,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAC,SAAS;wBACzF,8DAAa,CACF;oBACZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CACpC,CACC,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\nexport class CuraButtonSelect {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, mutable: true }) selected = false;\n @Prop({ reflect: true, mutable: true }) iconName: string;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large';\n @Prop({ reflect: true, mutable: true }) counter: string | number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light';\n @Prop() color: string;\n\n @State() hovered = false;\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 setColors() {\n const colors = [\n { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },\n { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },\n { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },\n { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },\n { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },\n { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },\n { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },\n { name: '--color-border-disable-unselect', thema: 'neutral-dark' },\n { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },\n { name: '--color-counter', thema: !this.disabled && 'primary-lighter' }\n ];\n\n colors.forEach(color => (this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema)));\n this.styles = { ...this.styles };\n\n }\n\n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes['icon'] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n connectedCallback() {\n this.setColors();\n }\n\n getLabelFontColor() {\n if (this.disabled) return 'neutral-dark';\n\n if (this.background === 'dark') {\n return this.selected ? 'neutral-black' : 'neutral-white'\n }\n if (this.background === 'light') {\n return this.selected ? 'neutral-white' : 'neutral-black'\n }\n\n }\n\n getColorCounter() {\n if (this.background === 'dark' && this.disabled) {\n return !this.selected ? 'neutral-black' : 'neutral-dark'\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-pale'\n }\n return `${this.color}-lighter`\n }\n\n getColorBagdeNumber() {\n\n if (this.background === 'dark' && this.disabled) {\n return this.selected ? 'neutral-black' : 'neutral-dark'\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-medium'\n }\n\n return `${this.color}-darker`\n }\n\n getIcon() {\n const iconSize = this.size === 'large' ? 24 : this.size === 'medium' ? 20 : 16;\n\n return <cura-icon class=\"button-icon\" name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-number color={this.getColorCounter()}>\n <cura-label color={this.getColorBagdeNumber()}>{this.counter}</cura-label>\n </cura-badge-number>\n );\n }\n\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\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 render() {\n return (\n <Host>\n <button\n 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 >\n <div class=\"button-container\">\n {this.iconName ? this.getIcon() : null}\n <cura-label class=\"label\" lineHeight=\"0%\" color={this.getLabelFontColor()} weight='regular'>\n <slot></slot>\n </cura-label>\n {this.counter ? this.getCounter() : null}\n </div>\n </button>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,133 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import iconNames from "../../../assets/icons/iconset-default-list";
14
+ const renderCuraButtonSelect = (label, args) => {
15
+ const block = `<cura-button-select ${args.selected
16
+ ? `
17
+ selected="${args.selected}"`
18
+ : ''}${args.disabled
19
+ ? `
20
+ disabled="${args.disabled}"`
21
+ : ''}
22
+ ${args.iconName
23
+ ? `
24
+ icon-name="${args.iconName}"`
25
+ : ''}${args.size
26
+ ? `
27
+ size="${args.size}"`
28
+ : ''}
29
+ ${args.counter
30
+ ? `
31
+ counter="${args.counter}"`
32
+ : ''}
33
+ ${args.background
34
+ ? `
35
+ background="${args.background}"`
36
+ : ''}
37
+ ${args.color
38
+ ? `
39
+ color="${args.color}"`
40
+ : ''}
41
+ >
42
+ ${label}
43
+ </cura-button-select>
44
+ `;
45
+ return `${block}`;
46
+ };
47
+ export default {
48
+ title: 'Componentes/Buttons/Button Select',
49
+ tags: ['autodocs'],
50
+ render: (_a) => {
51
+ var { label } = _a, args = __rest(_a, ["label"]);
52
+ return renderCuraButtonSelect(label, args);
53
+ },
54
+ argTypes: {
55
+ label: {
56
+ control: 'text',
57
+ description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',
58
+ name: 'Label',
59
+ },
60
+ disabled: {
61
+ control: 'boolean',
62
+ description: 'Estado desabilitado.',
63
+ table: {
64
+ category: 'State',
65
+ defaultValue: { summary: false },
66
+ },
67
+ },
68
+ selected: {
69
+ control: 'boolean',
70
+ description: 'Estado selecionado.',
71
+ table: {
72
+ category: 'State',
73
+ defaultValue: { summary: false },
74
+ },
75
+ },
76
+ size: {
77
+ control: { type: 'inline-radio' },
78
+ options: ['small', 'medium', 'large'],
79
+ description: 'Tamanhos disponíveis.',
80
+ table: {
81
+ category: 'Properties',
82
+ defaultValue: { summary: 'large' }
83
+ }
84
+ },
85
+ color: {
86
+ control: { type: 'select' },
87
+ options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
88
+ description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
89
+ table: {
90
+ category: 'Properties',
91
+ }
92
+ },
93
+ iconName: {
94
+ control: { type: 'select' },
95
+ options: ['', ...iconNames],
96
+ description: 'Nome do ícone a ser utilizado no iconset.',
97
+ table: {
98
+ category: 'Icons'
99
+ },
100
+ name: 'icon-name'
101
+ },
102
+ background: {
103
+ control: { type: 'inline-radio' },
104
+ options: ['dark', 'light'],
105
+ description: 'Define cor clara ou escura do componente.',
106
+ table: {
107
+ category: 'Properties',
108
+ defaultValue: { summary: 'light' }
109
+ },
110
+ },
111
+ counter: {
112
+ control: 'number',
113
+ description: 'Define o número a ser exibido pelo componente',
114
+ table: {
115
+ category: 'Properties',
116
+ defaultValue: { summary: 1 },
117
+ },
118
+ },
119
+ },
120
+ };
121
+ export const Button = {
122
+ args: {
123
+ selected: false,
124
+ iconName: 'calendar',
125
+ size: 'medium',
126
+ counter: 1,
127
+ disabled: false,
128
+ background: 'light',
129
+ color: 'primary',
130
+ label: "Button"
131
+ },
132
+ };
133
+ //# sourceMappingURL=cura-button-select.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-button-select.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE;IACxD,MAAM,KAAK,GAAG,uBAAuB,IAAI,CAAC,QAAQ;QAC9C,CAAC,CAAC;oBACU,IAAI,CAAC,QAAQ,GAAG;QAC5B,CAAC,CAAC,EACF,GAAG,IAAI,CAAC,QAAQ;QACZ,CAAC,CAAC;oBACM,IAAI,CAAC,QAAQ,GAAG;QACxB,CAAC,CAAC,EACN;IACJ,IAAI,CAAC,QAAQ;QACL,CAAC,CAAC;qBACO,IAAI,CAAC,QAAQ,GAA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QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,OAAO;QACnB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,QAAQ;KAClB;CACJ,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst renderCuraButtonSelect = (label: string, args: any) => {\n const block = `<cura-button-select ${args.selected\n ? `\n selected=\"${args.selected}\"`\n : ''\n }${args.disabled\n ? `\n disabled=\"${args.disabled}\"`\n : ''\n }\n ${args.iconName\n ? `\n icon-name=\"${args.iconName}\"`\n : ''\n }${args.size\n ? `\n size=\"${args.size}\"`\n : ''\n }\n ${args.counter\n ? `\n counter=\"${args.counter}\"`\n : ''\n }\n ${args.background\n ? `\n background=\"${args.background}\"`\n : ''\n }\n ${args.color\n ? `\n color=\"${args.color}\"`\n : ''\n }\n >\n ${label}\n </cura-button-select>\n `;\n return `${block}`;\n};\n\nexport default {\n title: 'Componentes/Buttons/Button Select',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n return renderCuraButtonSelect(label, args);\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',\n name: 'Label',\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado.',\n table: {\n category: 'State',\n defaultValue: { summary: false },\n },\n },\n selected: {\n control: 'boolean',\n description: 'Estado selecionado.',\n table: {\n category: 'State',\n defaultValue: { summary: false },\n },\n },\n size: {\n control: { type: 'inline-radio' },\n options: ['small', 'medium', 'large'],\n description: 'Tamanhos disponíveis.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'large' }\n }\n },\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n }\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone a ser utilizado no iconset.',\n table: {\n category: 'Icons'\n },\n name: 'icon-name'\n },\n background: {\n control: { type: 'inline-radio' },\n options: ['dark', 'light'],\n description: 'Define cor clara ou escura do componente.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' }\n },\n },\n counter: {\n control: 'number',\n description: 'Define o número a ser exibido pelo componente',\n table: {\n category: 'Properties',\n defaultValue: { summary: 1 },\n },\n },\n },\n};\n\nexport const Button = {\n args: {\n selected: false,\n iconName: 'calendar',\n size: 'medium',\n counter: 1,\n disabled: false,\n background: 'light',\n color: 'primary',\n label: \"Button\"\n },\n};\n"]}
@@ -76,7 +76,7 @@ export class CuraButtonTransparent {
76
76
  render() {
77
77
  const symbolColor = this.getSymbolColor();
78
78
  const labelSize = labelSizes[this.size] || labelSizes["default"];
79
- return (h(Host, { key: 'a149c7f0dd3a413c563f891c9298d66cde905f5e' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
79
+ return (h(Host, { key: 'd7bfd59d8a84d299a3d59dfd2d7b48ca6a9f56ee' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
80
80
  }
81
81
  static get is() { return "cura-button-transparent"; }
82
82
  static get encapsulation() { return "shadow"; }
@@ -43,7 +43,7 @@ export class CuraAlert {
43
43
  return this.icon ? this.icon : iconMapping[this.type];
44
44
  }
45
45
  render() {
46
- return (h(Host, { key: 'b7b63129f2d0c1d2f8b451a7f795befc9e085238' }, h("div", { key: 'b8450a11d65f0bbb3c9f688fccbb38efc7bf223c', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: '9a5dc4295f7c40362a86f77fe805127590812f15', name: this.getNameIcon(), class: "icon-left", size: 16, color: `${this.type}-dark` }), h("div", { key: '6bbe4799d3f73df0cda2e94da2d71cdc1bfc855a', class: "content" }, h("cura-label", { key: '8b761ec2804bb5633893af8ed91f5de268bbf029', class: "title", size: "small", color: "neutral-darker", weight: "bold" }, this.label), h("cura-paragraph", { key: '4e7e7726758c26f1f397e8efc84d5eba1c88b428', class: "text", color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: 'f589c6fb9016b43b3557492a3ef1b4ede4a807a6' })), h("div", { key: 'b212e9255855b96d5c069dd7544675386f00b372', class: "actions" }, h("slot", { key: '174dfcc7dfc4ff3e29185843e010dddae75463f5', name: "actions" }))), this.closeable ?
46
+ return (h(Host, { key: 'c5398d59da323dee68eed1cb7c27841df0e12d14' }, h("div", { key: 'd9bb0ab7a2106e710a113513e6eeb1297b9bd205', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: '54665c81a59cbca3686abc6f5e388da32e2211ed', name: this.getNameIcon(), class: "icon-left", size: 16, color: `${this.type}-dark` }), h("div", { key: '466f9f4aed5096658de1e19521cefe2915b095af', class: "content" }, h("cura-label", { key: '6b3d9cd0352b5d5254305baa5a71a1b1782f637f', class: "title", size: "small", color: "neutral-darker", weight: "bold" }, this.label), h("cura-paragraph", { key: '5dbad5e65d88b59a81b7df97154071a607d73900', class: "text", color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: 'cb75d38c35d34a7bee4e187c640a1269bad192b0' })), h("div", { key: 'a6930bb463601a2ba429b23fad61847e8dee01f3', class: "actions" }, h("slot", { key: '7f4fc8b08a870f578d0b241df00650ebf3db83e0', name: "actions" }))), this.closeable ?
47
47
  (h("cura-icon", { name: "close", size: 16, color: "error-dark", class: "icon-right", onClick: this.handleClose }))
48
48
  : '')));
49
49
  }
@@ -39,7 +39,7 @@ export class CuraAvatar {
39
39
  this.imageSrc = this.imageSrcDefault || `${this.assetsPath}/images/avatar/patient-default.svg`;
40
40
  }
41
41
  render() {
42
- return (h(Host, { key: 'fc8fbe9cdcab86398c83a55d006badb870ee959a', style: this.hostCSSProperties(), role: "img" }, h("div", { key: '6a107805cd770b98e74f7b0475c9896f59e51832', class: this.getClasses(), style: this.styles }, h("img", { key: '4bd7991bd32b0aa6f87d0725303960b0b4c3b0b9', src: this.imageSrc || this.imageSrcDefault || `${this.assetsPath}/images/avatar/patient-default.svg`, onError: () => this.onSrcError() }))));
42
+ return (h(Host, { key: '2760534555a0483e7e30c5f3009ec0cf68d0973b', style: this.hostCSSProperties(), role: "img" }, h("div", { key: '3daf6dd066983dc63525c38b7da498147c0bf387', class: this.getClasses(), style: this.styles }, h("img", { key: 'a5f4de7983722fc3f750404fa985c312590b5e98', src: this.imageSrc || this.imageSrcDefault || `${this.assetsPath}/images/avatar/patient-default.svg`, onError: () => this.onSrcError() }))));
43
43
  }
44
44
  static get is() { return "cura-avatar"; }
45
45
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,8 @@
1
1
  :host {
2
2
  display: block;
3
3
  width: var(--width);
4
+ max-width: 400px;
5
+ margin: 0 auto;
4
6
  }
5
7
  :host .calendar {
6
8
  display: flex;