@rededor/cura 1.0.0-alpha.8 → 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 (263) 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 +20 -15
  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-label/cura-label.js +3 -3
  91. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -1
  92. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  93. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  94. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  95. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  96. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  97. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  98. package/dist/collection/components/text/cura-display/cura-display.css +16 -0
  99. package/dist/collection/components/text/cura-display/cura-display.js +37 -10
  100. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  101. package/dist/collection/components/text/cura-display/cura-display.stories.js +13 -2
  102. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  103. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  104. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +9 -1
  105. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  106. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +1 -1
  107. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  108. package/dist/components/cura-alert.js +1 -1
  109. package/dist/components/cura-avatar.js +1 -1
  110. package/dist/components/cura-badge-distance.d.ts +11 -0
  111. package/dist/components/cura-badge-distance.js +73 -0
  112. package/dist/components/cura-badge-distance.js.map +1 -0
  113. package/dist/components/cura-button-outline.js +11 -6
  114. package/dist/components/cura-button-outline.js.map +1 -1
  115. package/dist/components/cura-button-select.js +2 -2
  116. package/dist/components/cura-button-select.js.map +1 -1
  117. package/dist/components/cura-button-transparent2.js +13 -8
  118. package/dist/components/cura-button-transparent2.js.map +1 -1
  119. package/dist/components/cura-button.definitions.js +10 -0
  120. package/dist/components/cura-button.definitions.js.map +1 -0
  121. package/dist/components/cura-button.js +10 -4
  122. package/dist/components/cura-button.js.map +1 -1
  123. package/dist/components/cura-calendar.js +118 -15
  124. package/dist/components/cura-calendar.js.map +1 -1
  125. package/dist/components/cura-card.js +1 -1
  126. package/dist/components/cura-checkbox.js +1 -1
  127. package/dist/components/cura-display.js +21 -11
  128. package/dist/components/cura-display.js.map +1 -1
  129. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  130. package/dist/components/cura-dropdown-search-option.js +5 -3
  131. package/dist/components/cura-dropdown-search-option.js.map +1 -1
  132. package/dist/components/cura-dropdown-search.js +3 -3
  133. package/dist/components/cura-dropdown-search.js.map +1 -1
  134. package/dist/components/cura-heading2.js +1 -1
  135. package/dist/components/cura-icon2.js +1 -1
  136. package/dist/components/cura-icons-view.js +4 -4
  137. package/dist/components/cura-icons-view.js.map +1 -1
  138. package/dist/components/cura-label2.js +1 -1
  139. package/dist/components/cura-label2.js.map +1 -1
  140. package/dist/components/cura-loader-bar2.js +1 -1
  141. package/dist/components/cura-loader-circle2.js +1 -1
  142. package/dist/components/cura-page-template.js +1 -1
  143. package/dist/components/cura-paragraph2.js +2 -2
  144. package/dist/components/cura-paragraph2.js.map +1 -1
  145. package/dist/components/cura-radio.js +1 -1
  146. package/dist/components/cura-select-option2.js +1 -1
  147. package/dist/components/cura-select2.js +3 -3
  148. package/dist/components/cura-switch.js +1 -1
  149. package/dist/components/cura-toast.js +1 -1
  150. package/dist/components/index.js +8 -6
  151. package/dist/components/index.js.map +1 -1
  152. package/dist/cura/cura.esm.js +1 -1
  153. package/dist/cura/cura.esm.js.map +1 -1
  154. package/dist/cura/p-0a923806.entry.js +2 -0
  155. package/dist/cura/p-0a923806.entry.js.map +1 -0
  156. package/dist/cura/{p-260edb61.entry.js → p-0d435e42.entry.js} +2 -2
  157. package/dist/cura/{p-8433fec9.entry.js → p-0dd837cf.entry.js} +2 -2
  158. package/dist/cura/{p-c63f4695.entry.js → p-2203e829.entry.js} +2 -2
  159. package/dist/cura/{p-6373c7cd.entry.js → p-4c7a2419.entry.js} +2 -2
  160. package/dist/cura/p-4ef24fbd.entry.js +2 -0
  161. package/dist/cura/p-4ef24fbd.entry.js.map +1 -0
  162. package/dist/cura/p-57b8b468.entry.js +2 -0
  163. package/dist/cura/p-57b8b468.entry.js.map +1 -0
  164. package/dist/cura/p-599acc84.entry.js +2 -0
  165. package/dist/cura/p-599acc84.entry.js.map +1 -0
  166. package/dist/cura/p-6682619b.entry.js +2 -0
  167. package/dist/cura/p-6682619b.entry.js.map +1 -0
  168. package/dist/cura/{p-5fcfbf32.entry.js → p-66c5cf5f.entry.js} +2 -2
  169. package/dist/cura/{p-4eaeb590.entry.js → p-84d8c67d.entry.js} +2 -2
  170. package/dist/cura/p-a00d2c68.entry.js +2 -0
  171. package/dist/cura/p-a00d2c68.entry.js.map +1 -0
  172. package/dist/cura/{p-a9dad622.entry.js → p-a5cf0fd6.entry.js} +2 -2
  173. package/dist/cura/{p-70c369b1.js → p-a6c3c0ea.js} +2 -2
  174. package/dist/cura/{p-70c369b1.js.map → p-a6c3c0ea.js.map} +1 -1
  175. package/dist/cura/{p-f016eb62.entry.js → p-ad8a7e0f.entry.js} +2 -2
  176. package/dist/cura/p-b301a1ef.entry.js +2 -0
  177. package/dist/cura/p-b301a1ef.entry.js.map +1 -0
  178. package/dist/cura/{p-0b1829ed.entry.js → p-dc5d0c29.entry.js} +2 -2
  179. package/dist/cura/p-dc5d0c29.entry.js.map +1 -0
  180. package/dist/cura/p-df5c3a86.entry.js +2 -0
  181. package/dist/cura/{p-17a878d4.entry.js.map → p-df5c3a86.entry.js.map} +1 -1
  182. package/dist/cura/p-dfc65f66.entry.js +2 -0
  183. package/dist/cura/p-efcb32eb.js +2 -0
  184. package/dist/cura/p-efcb32eb.js.map +1 -0
  185. package/dist/cura/p-f9433d24.entry.js +2 -0
  186. package/dist/cura/p-f9433d24.entry.js.map +1 -0
  187. package/dist/esm/{app-globals-f2da2b14.js → app-globals-488bf508.js} +7 -7
  188. package/dist/esm/{app-globals-f2da2b14.js.map → app-globals-488bf508.js.map} +1 -1
  189. package/dist/esm/cura-accordion_12.entry.js +20 -15
  190. package/dist/esm/cura-accordion_12.entry.js.map +1 -1
  191. package/dist/esm/cura-alert.entry.js +1 -1
  192. package/dist/esm/cura-avatar.entry.js +1 -1
  193. package/dist/esm/cura-badge-distance.entry.js +42 -0
  194. package/dist/esm/cura-badge-distance.entry.js.map +1 -0
  195. package/dist/esm/cura-button-outline.entry.js +10 -6
  196. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  197. package/dist/esm/cura-button-select.entry.js +2 -2
  198. package/dist/esm/cura-button-select.entry.js.map +1 -1
  199. package/dist/esm/cura-button-transparent.entry.js +11 -7
  200. package/dist/esm/cura-button-transparent.entry.js.map +1 -1
  201. package/dist/esm/cura-button.definitions-617d3bad.js +10 -0
  202. package/dist/esm/cura-button.definitions-617d3bad.js.map +1 -0
  203. package/dist/esm/cura-calendar.entry.js +99 -10
  204. package/dist/esm/cura-calendar.entry.js.map +1 -1
  205. package/dist/esm/cura-card.entry.js +1 -1
  206. package/dist/esm/cura-checkbox.entry.js +1 -1
  207. package/dist/esm/cura-display.entry.js +19 -10
  208. package/dist/esm/cura-display.entry.js.map +1 -1
  209. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  210. package/dist/esm/cura-dropdown-search-option.entry.js +5 -3
  211. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
  212. package/dist/esm/cura-dropdown-search.entry.js +3 -3
  213. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  214. package/dist/esm/cura-icons-view.entry.js +4 -4
  215. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  216. package/dist/esm/cura-loader-bar.entry.js +1 -1
  217. package/dist/esm/cura-radio.entry.js +1 -1
  218. package/dist/esm/cura-switch.entry.js +1 -1
  219. package/dist/esm/cura-toast.entry.js +1 -1
  220. package/dist/esm/cura.js +2 -2
  221. package/dist/esm/loader.js +2 -2
  222. package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.d.ts +12 -0
  223. package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.stories.d.ts +39 -0
  224. package/dist/types/components/buttons/cura-button/cura-button.d.ts +5 -0
  225. package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +23 -0
  226. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +6 -1
  227. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +23 -0
  228. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +6 -0
  229. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +11 -0
  230. package/dist/types/components/buttons/cura-button.definitions.d.ts +6 -0
  231. package/dist/types/components/cura-calendar/cura-calendar.d.ts +13 -7
  232. package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +23 -1
  233. package/dist/types/components/forms/cura-label/cura-label.d.ts +1 -1
  234. package/dist/types/components/text/cura-display/cura-display.d.ts +6 -0
  235. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +14 -0
  236. package/dist/types/components.d.ts +67 -14
  237. package/package.json +2 -2
  238. package/dist/cura/p-0b1829ed.entry.js.map +0 -1
  239. package/dist/cura/p-17a878d4.entry.js +0 -2
  240. package/dist/cura/p-335323b5.entry.js +0 -2
  241. package/dist/cura/p-335323b5.entry.js.map +0 -1
  242. package/dist/cura/p-3c4215a8.entry.js +0 -2
  243. package/dist/cura/p-3c4215a8.entry.js.map +0 -1
  244. package/dist/cura/p-67e34464.entry.js +0 -2
  245. package/dist/cura/p-67e34464.entry.js.map +0 -1
  246. package/dist/cura/p-79fa3b97.entry.js +0 -2
  247. package/dist/cura/p-79fa3b97.entry.js.map +0 -1
  248. package/dist/cura/p-9a4094e3.entry.js +0 -2
  249. package/dist/cura/p-9a4094e3.entry.js.map +0 -1
  250. package/dist/cura/p-af2036a7.entry.js +0 -2
  251. package/dist/cura/p-b0d66386.entry.js +0 -2
  252. package/dist/cura/p-b0d66386.entry.js.map +0 -1
  253. package/dist/cura/p-c518a91c.entry.js +0 -2
  254. package/dist/cura/p-c518a91c.entry.js.map +0 -1
  255. /package/dist/cura/{p-260edb61.entry.js.map → p-0d435e42.entry.js.map} +0 -0
  256. /package/dist/cura/{p-8433fec9.entry.js.map → p-0dd837cf.entry.js.map} +0 -0
  257. /package/dist/cura/{p-c63f4695.entry.js.map → p-2203e829.entry.js.map} +0 -0
  258. /package/dist/cura/{p-6373c7cd.entry.js.map → p-4c7a2419.entry.js.map} +0 -0
  259. /package/dist/cura/{p-5fcfbf32.entry.js.map → p-66c5cf5f.entry.js.map} +0 -0
  260. /package/dist/cura/{p-4eaeb590.entry.js.map → p-84d8c67d.entry.js.map} +0 -0
  261. /package/dist/cura/{p-a9dad622.entry.js.map → p-a5cf0fd6.entry.js.map} +0 -0
  262. /package/dist/cura/{p-f016eb62.entry.js.map → p-ad8a7e0f.entry.js.map} +0 -0
  263. /package/dist/cura/{p-af2036a7.entry.js.map → p-dfc65f66.entry.js.map} +0 -0
@@ -291,6 +291,31 @@ function startOfDay(dirtyDate) {
291
291
  return date;
292
292
  }
293
293
 
294
+ /**
295
+ * @name addWeeks
296
+ * @category Week Helpers
297
+ * @summary Add the specified number of weeks to the given date.
298
+ *
299
+ * @description
300
+ * Add the specified number of week to the given date.
301
+ *
302
+ * @param {Date|Number} date - the date to be changed
303
+ * @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`.
304
+ * @returns {Date} the new date with the weeks added
305
+ * @throws {TypeError} 2 arguments required
306
+ *
307
+ * @example
308
+ * // Add 4 weeks to 1 September 2014:
309
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
310
+ * //=> Mon Sep 29 2014 00:00:00
311
+ */
312
+ function addWeeks(dirtyDate, dirtyAmount) {
313
+ requiredArgs(2, arguments);
314
+ var amount = toInteger(dirtyAmount);
315
+ var days = amount * 7;
316
+ return addDays(dirtyDate, days);
317
+ }
318
+
294
319
  /**
295
320
  * Days in 1 week.
296
321
  *
@@ -3079,6 +3104,30 @@ function subMonths(dirtyDate, dirtyAmount) {
3079
3104
  return addMonths(dirtyDate, -amount);
3080
3105
  }
3081
3106
 
3107
+ /**
3108
+ * @name subWeeks
3109
+ * @category Week Helpers
3110
+ * @summary Subtract the specified number of weeks from the given date.
3111
+ *
3112
+ * @description
3113
+ * Subtract the specified number of weeks from the given date.
3114
+ *
3115
+ * @param {Date|Number} date - the date to be changed
3116
+ * @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`.
3117
+ * @returns {Date} the new date with the weeks subtracted
3118
+ * @throws {TypeError} 2 arguments required
3119
+ *
3120
+ * @example
3121
+ * // Subtract 4 weeks from 1 September 2014:
3122
+ * const result = subWeeks(new Date(2014, 8, 1), 4)
3123
+ * //=> Mon Aug 04 2014 00:00:00
3124
+ */
3125
+ function subWeeks(dirtyDate, dirtyAmount) {
3126
+ requiredArgs(2, arguments);
3127
+ var amount = toInteger(dirtyAmount);
3128
+ return addWeeks(dirtyDate, -amount);
3129
+ }
3130
+
3082
3131
  var dateFormats$1 = {
3083
3132
  full: 'EEEE, d MMMM yyyy',
3084
3133
  long: 'd MMMM yyyy',
@@ -3518,7 +3567,7 @@ var locale = {
3518
3567
  };
3519
3568
  const ptBR = locale;
3520
3569
 
3521
- 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}";
3570
+ 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}";
3522
3571
  const CuraCalendarStyle0 = curaCalendarCss;
3523
3572
 
3524
3573
  const CuraCalendar = class {
@@ -3528,8 +3577,8 @@ const CuraCalendar = class {
3528
3577
  this.theme = window.CuraAPI.theme;
3529
3578
  this.weights = this.theme.fonts.getWeights();
3530
3579
  this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
3531
- this.period = [];
3532
- this.width = '300px';
3580
+ this.period = null;
3581
+ this.width = '280px';
3533
3582
  this.mode = 'single';
3534
3583
  this.dateFormat = 'yyyy-MM-dd';
3535
3584
  this.locale = 'pt-BR';
@@ -3538,6 +3587,8 @@ const CuraCalendar = class {
3538
3587
  this.enable = [];
3539
3588
  this.defaultDate = [];
3540
3589
  this.limitRange = null;
3590
+ this.disablePassDates = false;
3591
+ this.collapsed = null;
3541
3592
  this.currentDate = new Date();
3542
3593
  this.selectedDates = [];
3543
3594
  this.rangeStart = null;
@@ -3588,6 +3639,9 @@ const CuraCalendar = class {
3588
3639
  * @returns {boolean} Whether the date is valid.
3589
3640
  */
3590
3641
  isDateInValidPeriod(date) {
3642
+ if (this.period === null) {
3643
+ return true;
3644
+ }
3591
3645
  return this.period.includes(format(date, this.dateFormat));
3592
3646
  }
3593
3647
  /**
@@ -3615,6 +3669,12 @@ const CuraCalendar = class {
3615
3669
  * @returns {boolean} Whether the date is disabled.
3616
3670
  */
3617
3671
  isDateInDisabledPeriod(date) {
3672
+ const today = new Date();
3673
+ today.setHours(0, 0, 0, 0);
3674
+ if (this.disablePassDates)
3675
+ return isBefore(date, today);
3676
+ if (this.disable === null)
3677
+ return false;
3618
3678
  return this.isDateInList(this.expandDateRanges(this.disable), date);
3619
3679
  }
3620
3680
  /**
@@ -3624,7 +3684,7 @@ const CuraCalendar = class {
3624
3684
  * @returns {boolean} Whether the date is enabled.
3625
3685
  */
3626
3686
  isDateInEnabledPeriod(date) {
3627
- if (this.enable.length === 0)
3687
+ if (this.enable === null || [])
3628
3688
  return true;
3629
3689
  return this.isDateInList(this.expandDateRanges(this.enable), date);
3630
3690
  }
@@ -3668,7 +3728,7 @@ const CuraCalendar = class {
3668
3728
  */
3669
3729
  onMonthDropdownChange(event) {
3670
3730
  const { months } = this.fetchMonthNames();
3671
- const newMonth = event.detail.value;
3731
+ const newMonth = event.detail;
3672
3732
  this.selectMonth = newMonth;
3673
3733
  this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
3674
3734
  }
@@ -3678,7 +3738,7 @@ const CuraCalendar = class {
3678
3738
  * @param {CustomEvent} event - The change event.
3679
3739
  */
3680
3740
  onYearDropdownChange(event) {
3681
- const newYear = event.detail.value;
3741
+ const newYear = event.detail;
3682
3742
  this.selectYear = newYear;
3683
3743
  this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
3684
3744
  }
@@ -3770,11 +3830,38 @@ const CuraCalendar = class {
3770
3830
  *
3771
3831
  * @returns {(Date | null)[]} An array of dates and nulls for the current month view.
3772
3832
  */
3833
+ showNotColapsedCalendar() {
3834
+ if (this.collapsed) {
3835
+ this.fetchDaysOfWeek();
3836
+ }
3837
+ else
3838
+ (this.fetchDaysOfMonth());
3839
+ this.collapsed = false;
3840
+ }
3841
+ showColapsedCalendar() {
3842
+ this.collapsed = true;
3843
+ return this.fetchDaysOfWeek();
3844
+ }
3845
+ fetchDaysOfWeek() {
3846
+ const DAYS_IN_CALENDAR_VIEW = 7;
3847
+ const start = startOfWeek(this.currentDate);
3848
+ const end = endOfWeek(this.currentDate);
3849
+ const daysIncurrentDate = eachDayOfInterval({ start, end });
3850
+ return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
3851
+ }
3852
+ updateCurrentWeek(direction) {
3853
+ let newWeek = new Date(this.currentDate);
3854
+ if (direction === 'prev')
3855
+ newWeek = subWeeks(this.currentDate, 1);
3856
+ if (direction === 'next')
3857
+ newWeek = addWeeks(this.currentDate, 1);
3858
+ this.currentDate = newWeek;
3859
+ }
3773
3860
  fetchDaysOfMonth() {
3774
- const start = startOfMonth(this.currentDate);
3775
- const end = endOfMonth(this.currentDate);
3776
3861
  const WEEKS_IN_CALENDAR_VIEW = 6;
3777
3862
  const DAYS_IN_CALENDAR_VIEW = 42;
3863
+ const start = startOfMonth(this.currentDate);
3864
+ const end = endOfMonth(this.currentDate);
3778
3865
  const daysIncurrentDate = eachDayOfInterval({ start, end });
3779
3866
  const prevMonthStart = startOfMonth(addMonths(start, -1));
3780
3867
  const prevMonthEnd = endOfMonth(prevMonthStart);
@@ -3829,7 +3916,7 @@ const CuraCalendar = class {
3829
3916
  */
3830
3917
  determinePrevButtonColor() {
3831
3918
  const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
3832
- return isPrevDisabled ? 'neutral-light' : 'primary-base';
3919
+ return isPrevDisabled && 'primary-base';
3833
3920
  }
3834
3921
  /**
3835
3922
  * Get the status of a given date, determining its position and interval status.
@@ -3903,7 +3990,9 @@ const CuraCalendar = class {
3903
3990
  }
3904
3991
  render() {
3905
3992
  const { months } = this.fetchMonthNames();
3906
- return (index.h(index.Host, { key: '7219f5c7370d5f51eaca3893ee5d9378b3bb9cf5', style: this.getHostCSSProperties() }, index.h("div", { key: 'c1a1a5f3af3c1f782e8db1b768e4d2c3d00e7cfe', class: "calendar", style: this.styles }, index.h("header", { key: 'a31b15cb3c58a952476370fe10fd546083e3de13', class: "header" }, index.h("div", { key: '0f4f3113996c4d43477ef9dbed3f94b54f0f1e18', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, index.h("cura-icon", { key: '1aab96a34d0265cf18d54c77d0f874e11e1ebbfc', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: () => this.updateCurrentMonth('prev') }), this.type === 'dropdown' ? (index.h("div", { class: "select" }, index.h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index$1) => (index.h("cura-select-option", { key: index$1, value: month }, month)))), index.h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index$1) => (index.h("cura-select-option", { key: index$1, value: year.toString() }, year.toString())))))) : (index.h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), index.h("cura-icon", { key: 'bbf1cabd623f27736c1acb29479f8bd3e4d9d465', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: () => this.updateCurrentMonth('next') }))), index.h("span", { key: '05eb9071b488607a2e6a40b687a074150382e81e', class: "days-of-week" }, this.fetchWeekDays().map((day, index$1) => (index.h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index$1 }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), index.h("div", { key: '1a107295063579356f75ee714b712cb265e408eb', class: "dates" }, this.fetchDaysOfMonth().map((day, index$1) => (index.h("div", { key: index$1, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))))));
3993
+ return (index.h(index.Host, { key: '49e48240bb1da756c8d4ee8dff554a24b1da8038', style: this.getHostCSSProperties() }, index.h("div", { key: 'bfa7c4b9362c6a9b3c35639ebb720a3fd2601fa4', class: "calendar", style: this.styles }, index.h("header", { key: 'aa6803cb2bf8b6f7b58cdd9796921aadfc40abca', class: "header" }, index.h("div", { key: 'efa9f7c0598677defca5f31220e3b1f0dbc16037', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, index.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' ? (index.h("div", { class: "select" }, index.h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index$1) => (index.h("cura-select-option", { key: index$1, value: month }, month)))), index.h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index$1) => (index.h("cura-select-option", { key: index$1, value: year.toString() }, year.toString())))))) : (index.h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), index.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') }))), index.h("span", { key: '3934dec68753250503976b462b6589327b7be613', class: "days-of-week" }, this.fetchWeekDays().map((day, index$1) => (index.h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index$1 }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), index.h("div", { key: '47e46d363c972877b97889c3c5756c14d42046de', class: "dates" }, !this.collapsed ?
3994
+ this.fetchDaysOfMonth().map((day, index$1) => (index.h("div", { key: index$1, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : ''))) :
3995
+ this.fetchDaysOfWeek().map((day, index$1) => (index.h("div", { key: index$1, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (index.h("div", { class: 'collapsed-container' }, index.h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'plusCircle' }, "Veja mais datas"))) : (index.h("div", { class: 'collapsed-container' }, index.h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'minusCircle' }, "Veja menos datas")))) : null)));
3907
3996
  }
3908
3997
  };
3909
3998
  CuraCalendar.style = CuraCalendarStyle0;