@rededor/cura 1.0.0-alpha.7 → 1.0.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 (267) hide show
  1. package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/assets/icons/iconset-default-tmp.svg +4 -0
  3. package/dist/assets/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/{app-globals-bcffd819.js → app-globals-b77d5b06.js} +7 -7
  5. package/dist/cjs/{app-globals-bcffd819.js.map → app-globals-b77d5b06.js.map} +1 -1
  6. package/dist/cjs/cura-accordion_12.cjs.entry.js +30 -16
  7. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
  8. package/dist/cjs/cura-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/cura-badge-distance.cjs.entry.js +46 -0
  11. package/dist/cjs/cura-badge-distance.cjs.entry.js.map +1 -0
  12. package/dist/cjs/cura-button-outline.cjs.entry.js +10 -6
  13. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cura-button-select.cjs.entry.js +2 -2
  15. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-button-transparent.cjs.entry.js +11 -7
  17. package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -1
  18. package/dist/cjs/cura-button.definitions-f036371c.js +12 -0
  19. package/dist/cjs/cura-button.definitions-f036371c.js.map +1 -0
  20. package/dist/cjs/cura-calendar.cjs.entry.js +99 -10
  21. package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
  22. package/dist/cjs/cura-card.cjs.entry.js +1 -1
  23. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  24. package/dist/cjs/cura-display.cjs.entry.js +19 -10
  25. package/dist/cjs/cura-display.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
  27. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +5 -3
  28. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -1
  29. package/dist/cjs/cura-dropdown-search.cjs.entry.js +3 -3
  30. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
  31. package/dist/cjs/cura-icons-view.cjs.entry.js +4 -4
  32. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  33. package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
  34. package/dist/cjs/cura-radio.cjs.entry.js +1 -1
  35. package/dist/cjs/cura-switch.cjs.entry.js +1 -1
  36. package/dist/cjs/cura-toast.cjs.entry.js +1 -1
  37. package/dist/cjs/cura.cjs.js +2 -2
  38. package/dist/cjs/loader.cjs.js +2 -2
  39. package/dist/collection/api/theme-presets/theme-maternity.js +6 -6
  40. package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
  41. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  42. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  43. package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
  44. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  45. package/dist/collection/assets-raw/icons/default/drug.svg +3 -0
  46. package/dist/collection/collection-manifest.json +1 -0
  47. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.css +28 -0
  48. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +94 -0
  49. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js.map +1 -0
  50. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.stories.js +56 -0
  51. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.stories.js.map +1 -0
  52. package/dist/collection/components/buttons/cura-button/cura-button.css +61 -65
  53. package/dist/collection/components/buttons/cura-button/cura-button.js +26 -3
  54. package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
  55. package/dist/collection/components/buttons/cura-button/cura-button.stories.js +28 -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 +50 -53
  58. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +28 -6
  59. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
  60. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +28 -2
  61. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
  62. package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +29 -33
  63. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +1 -1
  64. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +37 -54
  65. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +31 -9
  66. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
  67. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +16 -6
  68. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
  69. package/dist/collection/components/buttons/cura-button.definitions.js +7 -0
  70. package/dist/collection/components/buttons/cura-button.definitions.js.map +1 -0
  71. package/dist/collection/components/cura-alert/cura-alert.js +1 -1
  72. package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
  73. package/dist/collection/components/cura-calendar/cura-calendar.css +18 -1
  74. package/dist/collection/components/cura-calendar/cura-calendar.js +93 -17
  75. package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
  76. package/dist/collection/components/cura-calendar/cura-calendar.stories.js +24 -4
  77. package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -1
  78. package/dist/collection/components/cura-card/cura-card.js +1 -1
  79. package/dist/collection/components/cura-icon/cura-icon.js +1 -1
  80. package/dist/collection/components/cura-icons-view/cura-icons-view.js +3 -3
  81. package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
  82. package/dist/collection/components/cura-toast/cura-toast.js +1 -1
  83. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  84. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +48 -29
  85. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +4 -2
  86. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -1
  87. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  88. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +3 -3
  89. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  90. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
  91. package/dist/collection/components/forms/cura-label/cura-label.js +3 -3
  92. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -1
  93. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  94. package/dist/collection/components/forms/cura-select/cura-select.js +14 -3
  95. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
  96. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  97. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  98. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  99. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  100. package/dist/collection/components/text/cura-display/cura-display.css +16 -0
  101. package/dist/collection/components/text/cura-display/cura-display.js +37 -10
  102. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  103. package/dist/collection/components/text/cura-display/cura-display.stories.js +13 -2
  104. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  105. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  106. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +9 -1
  107. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  108. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +1 -1
  109. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  110. package/dist/components/cura-alert.js +1 -1
  111. package/dist/components/cura-avatar.js +1 -1
  112. package/dist/components/cura-badge-distance.d.ts +11 -0
  113. package/dist/components/cura-badge-distance.js +73 -0
  114. package/dist/components/cura-badge-distance.js.map +1 -0
  115. package/dist/components/cura-button-outline.js +11 -6
  116. package/dist/components/cura-button-outline.js.map +1 -1
  117. package/dist/components/cura-button-select.js +2 -2
  118. package/dist/components/cura-button-select.js.map +1 -1
  119. package/dist/components/cura-button-transparent2.js +13 -8
  120. package/dist/components/cura-button-transparent2.js.map +1 -1
  121. package/dist/components/cura-button.definitions.js +10 -0
  122. package/dist/components/cura-button.definitions.js.map +1 -0
  123. package/dist/components/cura-button.js +10 -4
  124. package/dist/components/cura-button.js.map +1 -1
  125. package/dist/components/cura-calendar.js +118 -15
  126. package/dist/components/cura-calendar.js.map +1 -1
  127. package/dist/components/cura-card.js +1 -1
  128. package/dist/components/cura-checkbox.js +1 -1
  129. package/dist/components/cura-display.js +21 -11
  130. package/dist/components/cura-display.js.map +1 -1
  131. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  132. package/dist/components/cura-dropdown-search-option.js +5 -3
  133. package/dist/components/cura-dropdown-search-option.js.map +1 -1
  134. package/dist/components/cura-dropdown-search.js +3 -3
  135. package/dist/components/cura-dropdown-search.js.map +1 -1
  136. package/dist/components/cura-heading2.js +1 -1
  137. package/dist/components/cura-icon2.js +1 -1
  138. package/dist/components/cura-icons-view.js +4 -4
  139. package/dist/components/cura-icons-view.js.map +1 -1
  140. package/dist/components/cura-label2.js +1 -1
  141. package/dist/components/cura-label2.js.map +1 -1
  142. package/dist/components/cura-loader-bar2.js +1 -1
  143. package/dist/components/cura-loader-circle2.js +1 -1
  144. package/dist/components/cura-page-template.js +1 -1
  145. package/dist/components/cura-paragraph2.js +2 -2
  146. package/dist/components/cura-paragraph2.js.map +1 -1
  147. package/dist/components/cura-radio.js +1 -1
  148. package/dist/components/cura-select-option2.js +1 -1
  149. package/dist/components/cura-select2.js +15 -5
  150. package/dist/components/cura-select2.js.map +1 -1
  151. package/dist/components/cura-switch.js +1 -1
  152. package/dist/components/cura-toast.js +1 -1
  153. package/dist/components/index.js +8 -6
  154. package/dist/components/index.js.map +1 -1
  155. package/dist/cura/cura.esm.js +1 -1
  156. package/dist/cura/cura.esm.js.map +1 -1
  157. package/dist/cura/p-0a923806.entry.js +2 -0
  158. package/dist/cura/p-0a923806.entry.js.map +1 -0
  159. package/dist/cura/{p-260edb61.entry.js → p-0d435e42.entry.js} +2 -2
  160. package/dist/cura/{p-8433fec9.entry.js → p-0dd837cf.entry.js} +2 -2
  161. package/dist/cura/{p-c63f4695.entry.js → p-2203e829.entry.js} +2 -2
  162. package/dist/cura/{p-6373c7cd.entry.js → p-4c7a2419.entry.js} +2 -2
  163. package/dist/cura/p-4ef24fbd.entry.js +2 -0
  164. package/dist/cura/p-4ef24fbd.entry.js.map +1 -0
  165. package/dist/cura/p-57b8b468.entry.js +2 -0
  166. package/dist/cura/p-57b8b468.entry.js.map +1 -0
  167. package/dist/cura/p-599acc84.entry.js +2 -0
  168. package/dist/cura/p-599acc84.entry.js.map +1 -0
  169. package/dist/cura/p-6682619b.entry.js +2 -0
  170. package/dist/cura/p-6682619b.entry.js.map +1 -0
  171. package/dist/cura/{p-5fcfbf32.entry.js → p-66c5cf5f.entry.js} +2 -2
  172. package/dist/cura/{p-4eaeb590.entry.js → p-84d8c67d.entry.js} +2 -2
  173. package/dist/cura/p-a00d2c68.entry.js +2 -0
  174. package/dist/cura/p-a00d2c68.entry.js.map +1 -0
  175. package/dist/cura/{p-a9dad622.entry.js → p-a5cf0fd6.entry.js} +2 -2
  176. package/dist/cura/{p-70c369b1.js → p-a6c3c0ea.js} +2 -2
  177. package/dist/cura/{p-70c369b1.js.map → p-a6c3c0ea.js.map} +1 -1
  178. package/dist/cura/{p-f016eb62.entry.js → p-ad8a7e0f.entry.js} +2 -2
  179. package/dist/cura/p-b301a1ef.entry.js +2 -0
  180. package/dist/cura/p-b301a1ef.entry.js.map +1 -0
  181. package/dist/cura/{p-0b1829ed.entry.js → p-dc5d0c29.entry.js} +2 -2
  182. package/dist/cura/p-dc5d0c29.entry.js.map +1 -0
  183. package/dist/cura/p-df5c3a86.entry.js +2 -0
  184. package/dist/cura/{p-17a878d4.entry.js.map → p-df5c3a86.entry.js.map} +1 -1
  185. package/dist/cura/p-dfc65f66.entry.js +2 -0
  186. package/dist/cura/p-efcb32eb.js +2 -0
  187. package/dist/cura/p-efcb32eb.js.map +1 -0
  188. package/dist/cura/p-f9433d24.entry.js +2 -0
  189. package/dist/cura/p-f9433d24.entry.js.map +1 -0
  190. package/dist/esm/{app-globals-f2da2b14.js → app-globals-488bf508.js} +7 -7
  191. package/dist/esm/{app-globals-f2da2b14.js.map → app-globals-488bf508.js.map} +1 -1
  192. package/dist/esm/cura-accordion_12.entry.js +30 -16
  193. package/dist/esm/cura-accordion_12.entry.js.map +1 -1
  194. package/dist/esm/cura-alert.entry.js +1 -1
  195. package/dist/esm/cura-avatar.entry.js +1 -1
  196. package/dist/esm/cura-badge-distance.entry.js +42 -0
  197. package/dist/esm/cura-badge-distance.entry.js.map +1 -0
  198. package/dist/esm/cura-button-outline.entry.js +10 -6
  199. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  200. package/dist/esm/cura-button-select.entry.js +2 -2
  201. package/dist/esm/cura-button-select.entry.js.map +1 -1
  202. package/dist/esm/cura-button-transparent.entry.js +11 -7
  203. package/dist/esm/cura-button-transparent.entry.js.map +1 -1
  204. package/dist/esm/cura-button.definitions-617d3bad.js +10 -0
  205. package/dist/esm/cura-button.definitions-617d3bad.js.map +1 -0
  206. package/dist/esm/cura-calendar.entry.js +99 -10
  207. package/dist/esm/cura-calendar.entry.js.map +1 -1
  208. package/dist/esm/cura-card.entry.js +1 -1
  209. package/dist/esm/cura-checkbox.entry.js +1 -1
  210. package/dist/esm/cura-display.entry.js +19 -10
  211. package/dist/esm/cura-display.entry.js.map +1 -1
  212. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  213. package/dist/esm/cura-dropdown-search-option.entry.js +5 -3
  214. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
  215. package/dist/esm/cura-dropdown-search.entry.js +3 -3
  216. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  217. package/dist/esm/cura-icons-view.entry.js +4 -4
  218. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  219. package/dist/esm/cura-loader-bar.entry.js +1 -1
  220. package/dist/esm/cura-radio.entry.js +1 -1
  221. package/dist/esm/cura-switch.entry.js +1 -1
  222. package/dist/esm/cura-toast.entry.js +1 -1
  223. package/dist/esm/cura.js +2 -2
  224. package/dist/esm/loader.js +2 -2
  225. package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.d.ts +12 -0
  226. package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.stories.d.ts +39 -0
  227. package/dist/types/components/buttons/cura-button/cura-button.d.ts +5 -0
  228. package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +23 -0
  229. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +6 -1
  230. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +23 -0
  231. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +6 -0
  232. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +11 -0
  233. package/dist/types/components/buttons/cura-button.definitions.d.ts +6 -0
  234. package/dist/types/components/cura-calendar/cura-calendar.d.ts +13 -7
  235. package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +23 -1
  236. package/dist/types/components/forms/cura-label/cura-label.d.ts +1 -1
  237. package/dist/types/components/forms/cura-select/cura-select.d.ts +1 -0
  238. package/dist/types/components/text/cura-display/cura-display.d.ts +6 -0
  239. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +14 -0
  240. package/dist/types/components.d.ts +67 -14
  241. package/package.json +2 -2
  242. package/dist/cura/p-0b1829ed.entry.js.map +0 -1
  243. package/dist/cura/p-17a878d4.entry.js +0 -2
  244. package/dist/cura/p-335323b5.entry.js +0 -2
  245. package/dist/cura/p-335323b5.entry.js.map +0 -1
  246. package/dist/cura/p-67e34464.entry.js +0 -2
  247. package/dist/cura/p-67e34464.entry.js.map +0 -1
  248. package/dist/cura/p-79fa3b97.entry.js +0 -2
  249. package/dist/cura/p-79fa3b97.entry.js.map +0 -1
  250. package/dist/cura/p-89014323.entry.js +0 -2
  251. package/dist/cura/p-89014323.entry.js.map +0 -1
  252. package/dist/cura/p-9a4094e3.entry.js +0 -2
  253. package/dist/cura/p-9a4094e3.entry.js.map +0 -1
  254. package/dist/cura/p-af2036a7.entry.js +0 -2
  255. package/dist/cura/p-b0d66386.entry.js +0 -2
  256. package/dist/cura/p-b0d66386.entry.js.map +0 -1
  257. package/dist/cura/p-c518a91c.entry.js +0 -2
  258. package/dist/cura/p-c518a91c.entry.js.map +0 -1
  259. /package/dist/cura/{p-260edb61.entry.js.map → p-0d435e42.entry.js.map} +0 -0
  260. /package/dist/cura/{p-8433fec9.entry.js.map → p-0dd837cf.entry.js.map} +0 -0
  261. /package/dist/cura/{p-c63f4695.entry.js.map → p-2203e829.entry.js.map} +0 -0
  262. /package/dist/cura/{p-6373c7cd.entry.js.map → p-4c7a2419.entry.js.map} +0 -0
  263. /package/dist/cura/{p-5fcfbf32.entry.js.map → p-66c5cf5f.entry.js.map} +0 -0
  264. /package/dist/cura/{p-4eaeb590.entry.js.map → p-84d8c67d.entry.js.map} +0 -0
  265. /package/dist/cura/{p-a9dad622.entry.js.map → p-a5cf0fd6.entry.js.map} +0 -0
  266. /package/dist/cura/{p-f016eb62.entry.js.map → p-ad8a7e0f.entry.js.map} +0 -0
  267. /package/dist/cura/{p-af2036a7.entry.js.map → p-dfc65f66.entry.js.map} +0 -0
@@ -287,6 +287,31 @@ function startOfDay(dirtyDate) {
287
287
  return date;
288
288
  }
289
289
 
290
+ /**
291
+ * @name addWeeks
292
+ * @category Week Helpers
293
+ * @summary Add the specified number of weeks to the given date.
294
+ *
295
+ * @description
296
+ * Add the specified number of week to the given date.
297
+ *
298
+ * @param {Date|Number} date - the date to be changed
299
+ * @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
300
+ * @returns {Date} the new date with the weeks added
301
+ * @throws {TypeError} 2 arguments required
302
+ *
303
+ * @example
304
+ * // Add 4 weeks to 1 September 2014:
305
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
306
+ * //=> Mon Sep 29 2014 00:00:00
307
+ */
308
+ function addWeeks(dirtyDate, dirtyAmount) {
309
+ requiredArgs(2, arguments);
310
+ var amount = toInteger(dirtyAmount);
311
+ var days = amount * 7;
312
+ return addDays(dirtyDate, days);
313
+ }
314
+
290
315
  /**
291
316
  * Days in 1 week.
292
317
  *
@@ -3075,6 +3100,30 @@ function subMonths(dirtyDate, dirtyAmount) {
3075
3100
  return addMonths(dirtyDate, -amount);
3076
3101
  }
3077
3102
 
3103
+ /**
3104
+ * @name subWeeks
3105
+ * @category Week Helpers
3106
+ * @summary Subtract the specified number of weeks from the given date.
3107
+ *
3108
+ * @description
3109
+ * Subtract the specified number of weeks from the given date.
3110
+ *
3111
+ * @param {Date|Number} date - the date to be changed
3112
+ * @param {Number} amount - the amount of weeks to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
3113
+ * @returns {Date} the new date with the weeks subtracted
3114
+ * @throws {TypeError} 2 arguments required
3115
+ *
3116
+ * @example
3117
+ * // Subtract 4 weeks from 1 September 2014:
3118
+ * const result = subWeeks(new Date(2014, 8, 1), 4)
3119
+ * //=> Mon Aug 04 2014 00:00:00
3120
+ */
3121
+ function subWeeks(dirtyDate, dirtyAmount) {
3122
+ requiredArgs(2, arguments);
3123
+ var amount = toInteger(dirtyAmount);
3124
+ return addWeeks(dirtyDate, -amount);
3125
+ }
3126
+
3078
3127
  var dateFormats$1 = {
3079
3128
  full: 'EEEE, d MMMM yyyy',
3080
3129
  long: 'd MMMM yyyy',
@@ -3514,7 +3563,7 @@ var locale = {
3514
3563
  };
3515
3564
  const ptBR = locale;
3516
3565
 
3517
- const curaCalendarCss = ":host{display:block;width:var(--width)}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);padding:0 12px 12px 12px;min-width:300px;border:1px solid var(--neutral-light);border-radius:4px;overflow:hidden;background:#fff;box-shadow:0 4px 8px var(--neutral-light);font-family:var(--font-family)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:0px 12px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--accent-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected,:host .date.default-dates{color:var(--neutral-black) !important;background:var(--accent-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date.range.interval{border-radius:0;background-color:var(--accent-light);color:var(--neutral-black)}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date:hover{background:var(--accent-light);border-radius:50%;color:var(--neutral-black)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
3566
+ const curaCalendarCss = ":host{display:block;width:var(--width)}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);padding:0 12px 12px 12px;min-width:280px;border:1px solid var(--neutral-light);border-radius:4px;overflow:hidden;background:#fff;box-shadow:0 4px 8px var(--neutral-light);font-family:var(--font-family)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:0px 12px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--accent-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected,:host .date.default-dates{color:var(--neutral-black) !important;background:var(--accent-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date.range.interval{border-radius:0;background-color:var(--accent-light);color:var(--neutral-black)}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date:hover{background:var(--accent-light);border-radius:50%;color:var(--neutral-black)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
3518
3567
  const CuraCalendarStyle0 = curaCalendarCss;
3519
3568
 
3520
3569
  const CuraCalendar = class {
@@ -3524,8 +3573,8 @@ const CuraCalendar = class {
3524
3573
  this.theme = window.CuraAPI.theme;
3525
3574
  this.weights = this.theme.fonts.getWeights();
3526
3575
  this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
3527
- this.period = [];
3528
- this.width = '300px';
3576
+ this.period = null;
3577
+ this.width = '280px';
3529
3578
  this.mode = 'single';
3530
3579
  this.dateFormat = 'yyyy-MM-dd';
3531
3580
  this.locale = 'pt-BR';
@@ -3534,6 +3583,8 @@ const CuraCalendar = class {
3534
3583
  this.enable = [];
3535
3584
  this.defaultDate = [];
3536
3585
  this.limitRange = null;
3586
+ this.disablePassDates = false;
3587
+ this.collapsed = null;
3537
3588
  this.currentDate = new Date();
3538
3589
  this.selectedDates = [];
3539
3590
  this.rangeStart = null;
@@ -3584,6 +3635,9 @@ const CuraCalendar = class {
3584
3635
  * @returns {boolean} Whether the date is valid.
3585
3636
  */
3586
3637
  isDateInValidPeriod(date) {
3638
+ if (this.period === null) {
3639
+ return true;
3640
+ }
3587
3641
  return this.period.includes(format(date, this.dateFormat));
3588
3642
  }
3589
3643
  /**
@@ -3611,6 +3665,12 @@ const CuraCalendar = class {
3611
3665
  * @returns {boolean} Whether the date is disabled.
3612
3666
  */
3613
3667
  isDateInDisabledPeriod(date) {
3668
+ const today = new Date();
3669
+ today.setHours(0, 0, 0, 0);
3670
+ if (this.disablePassDates)
3671
+ return isBefore(date, today);
3672
+ if (this.disable === null)
3673
+ return false;
3614
3674
  return this.isDateInList(this.expandDateRanges(this.disable), date);
3615
3675
  }
3616
3676
  /**
@@ -3620,7 +3680,7 @@ const CuraCalendar = class {
3620
3680
  * @returns {boolean} Whether the date is enabled.
3621
3681
  */
3622
3682
  isDateInEnabledPeriod(date) {
3623
- if (this.enable.length === 0)
3683
+ if (this.enable === null || [])
3624
3684
  return true;
3625
3685
  return this.isDateInList(this.expandDateRanges(this.enable), date);
3626
3686
  }
@@ -3664,7 +3724,7 @@ const CuraCalendar = class {
3664
3724
  */
3665
3725
  onMonthDropdownChange(event) {
3666
3726
  const { months } = this.fetchMonthNames();
3667
- const newMonth = event.detail.value;
3727
+ const newMonth = event.detail;
3668
3728
  this.selectMonth = newMonth;
3669
3729
  this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
3670
3730
  }
@@ -3674,7 +3734,7 @@ const CuraCalendar = class {
3674
3734
  * @param {CustomEvent} event - The change event.
3675
3735
  */
3676
3736
  onYearDropdownChange(event) {
3677
- const newYear = event.detail.value;
3737
+ const newYear = event.detail;
3678
3738
  this.selectYear = newYear;
3679
3739
  this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
3680
3740
  }
@@ -3766,11 +3826,38 @@ const CuraCalendar = class {
3766
3826
  *
3767
3827
  * @returns {(Date | null)[]} An array of dates and nulls for the current month view.
3768
3828
  */
3829
+ showNotColapsedCalendar() {
3830
+ if (this.collapsed) {
3831
+ this.fetchDaysOfWeek();
3832
+ }
3833
+ else
3834
+ (this.fetchDaysOfMonth());
3835
+ this.collapsed = false;
3836
+ }
3837
+ showColapsedCalendar() {
3838
+ this.collapsed = true;
3839
+ return this.fetchDaysOfWeek();
3840
+ }
3841
+ fetchDaysOfWeek() {
3842
+ const DAYS_IN_CALENDAR_VIEW = 7;
3843
+ const start = startOfWeek(this.currentDate);
3844
+ const end = endOfWeek(this.currentDate);
3845
+ const daysIncurrentDate = eachDayOfInterval({ start, end });
3846
+ return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
3847
+ }
3848
+ updateCurrentWeek(direction) {
3849
+ let newWeek = new Date(this.currentDate);
3850
+ if (direction === 'prev')
3851
+ newWeek = subWeeks(this.currentDate, 1);
3852
+ if (direction === 'next')
3853
+ newWeek = addWeeks(this.currentDate, 1);
3854
+ this.currentDate = newWeek;
3855
+ }
3769
3856
  fetchDaysOfMonth() {
3770
- const start = startOfMonth(this.currentDate);
3771
- const end = endOfMonth(this.currentDate);
3772
3857
  const WEEKS_IN_CALENDAR_VIEW = 6;
3773
3858
  const DAYS_IN_CALENDAR_VIEW = 42;
3859
+ const start = startOfMonth(this.currentDate);
3860
+ const end = endOfMonth(this.currentDate);
3774
3861
  const daysIncurrentDate = eachDayOfInterval({ start, end });
3775
3862
  const prevMonthStart = startOfMonth(addMonths(start, -1));
3776
3863
  const prevMonthEnd = endOfMonth(prevMonthStart);
@@ -3825,7 +3912,7 @@ const CuraCalendar = class {
3825
3912
  */
3826
3913
  determinePrevButtonColor() {
3827
3914
  const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
3828
- return isPrevDisabled ? 'neutral-light' : 'primary-base';
3915
+ return isPrevDisabled && 'primary-base';
3829
3916
  }
3830
3917
  /**
3831
3918
  * Get the status of a given date, determining its position and interval status.
@@ -3899,7 +3986,9 @@ const CuraCalendar = class {
3899
3986
  }
3900
3987
  render() {
3901
3988
  const { months } = this.fetchMonthNames();
3902
- return (h(Host, { key: '7219f5c7370d5f51eaca3893ee5d9378b3bb9cf5', style: this.getHostCSSProperties() }, h("div", { key: 'c1a1a5f3af3c1f782e8db1b768e4d2c3d00e7cfe', class: "calendar", style: this.styles }, h("header", { key: 'a31b15cb3c58a952476370fe10fd546083e3de13', class: "header" }, h("div", { key: '0f4f3113996c4d43477ef9dbed3f94b54f0f1e18', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '1aab96a34d0265cf18d54c77d0f874e11e1ebbfc', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: () => this.updateCurrentMonth('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { key: index, value: month }, month)))), h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: 'bbf1cabd623f27736c1acb29479f8bd3e4d9d465', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: () => this.updateCurrentMonth('next') }))), h("span", { key: '05eb9071b488607a2e6a40b687a074150382e81e', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: '1a107295063579356f75ee714b712cb265e408eb', class: "dates" }, this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))))));
3989
+ return (h(Host, { key: '49e48240bb1da756c8d4ee8dff554a24b1da8038', style: this.getHostCSSProperties() }, h("div", { key: 'bfa7c4b9362c6a9b3c35639ebb720a3fd2601fa4', class: "calendar", style: this.styles }, h("header", { key: 'aa6803cb2bf8b6f7b58cdd9796921aadfc40abca', class: "header" }, h("div", { key: 'efa9f7c0598677defca5f31220e3b1f0dbc16037', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '759a409d176a47c44be9615bf342d8a6d296ded6', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { key: index, value: month }, month)))), h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: '650919445aa94fd26b9605da79dbaa1950652c0d', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), h("span", { key: '3934dec68753250503976b462b6589327b7be613', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: '47e46d363c972877b97889c3c5756c14d42046de', class: "dates" }, !this.collapsed ?
3990
+ this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : ''))) :
3991
+ this.fetchDaysOfWeek().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (h("div", { class: 'collapsed-container' }, h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'plusCircle' }, "Veja mais datas"))) : (h("div", { class: 'collapsed-container' }, h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'minusCircle' }, "Veja menos datas")))) : null)));
3903
3992
  }
3904
3993
  };
3905
3994
  CuraCalendar.style = CuraCalendarStyle0;