@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16

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 (275) hide show
  1. package/components/accordion/index.cjs +183 -6
  2. package/components/accordion/index.js +136 -88
  3. package/components/action-bar/index.cjs +85 -4
  4. package/components/action-bar/index.js +72 -50
  5. package/components/action-button/index.cjs +205 -3
  6. package/components/action-button/index.js +167 -93
  7. package/components/action-group/index.cjs +7 -1
  8. package/components/action-group/index.js +12 -8
  9. package/components/action-group-DHp8RHDf.js +392 -0
  10. package/components/action-group-MPf19RPV.cjs +391 -0
  11. package/components/action-menu/index.cjs +91 -11
  12. package/components/action-menu/index.js +66 -47
  13. package/components/avatar/index.cjs +63 -3
  14. package/components/avatar/index.js +54 -42
  15. package/components/base-COw9n7UR.cjs +119 -0
  16. package/components/base-DmeVy0cq.js +120 -0
  17. package/components/button/index.cjs +134 -2
  18. package/components/button/index.js +106 -72
  19. package/components/button-base-7Ak55xFd.cjs +206 -0
  20. package/components/button-base-C3kf6BTK.js +207 -0
  21. package/components/button-group/index.cjs +45 -1
  22. package/components/button-group/index.js +37 -25
  23. package/components/calendar/index.cjs +632 -1
  24. package/components/calendar/index.js +637 -7
  25. package/components/checkbox/index.cjs +111 -4
  26. package/components/checkbox/index.js +98 -53
  27. package/components/checkbox-mixin-8cL-vfDy.js +84 -0
  28. package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
  29. package/components/clear-button-Co6oKSgl.js +59 -0
  30. package/components/clear-button-X_HDY2eH.cjs +58 -0
  31. package/components/close-button-DPBK6Kpu.cjs +59 -0
  32. package/components/close-button-Miw9ZjoJ.js +60 -0
  33. package/components/color-area/index.cjs +440 -13
  34. package/components/color-area/index.js +322 -187
  35. package/components/color-controller-BjDZaxhX.js +491 -0
  36. package/components/color-controller-C3c_vb2P.cjs +490 -0
  37. package/components/color-field/index.cjs +95 -2
  38. package/components/color-field/index.js +77 -41
  39. package/components/color-handle/index.cjs +64 -3
  40. package/components/color-handle/index.js +58 -37
  41. package/components/color-loupe/index.cjs +7 -1
  42. package/components/color-loupe/index.js +12 -8
  43. package/components/color-loupe-BQqNR8YD.cjs +88 -0
  44. package/components/color-loupe-B_DDFv8l.js +89 -0
  45. package/components/color-menu/index.cjs +217 -12
  46. package/components/color-menu/index.js +187 -93
  47. package/components/color-palette/index.cjs +89 -1
  48. package/components/color-palette/index.js +78 -51
  49. package/components/color-palette-group/index.cjs +259 -3
  50. package/components/color-palette-group/index.js +193 -105
  51. package/components/color-picker/index.cjs +114 -6
  52. package/components/color-picker/index.js +92 -72
  53. package/components/color-slider/index.cjs +585 -1
  54. package/components/color-slider/index.js +590 -7
  55. package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
  56. package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
  57. package/components/date-time-picker/index.cjs +1357 -31
  58. package/components/date-time-picker/index.js +951 -637
  59. package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
  60. package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
  61. package/components/divider/index.cjs +54 -1
  62. package/components/divider/index.js +49 -30
  63. package/components/divider.module-Cm5LcDRV.cjs +20 -0
  64. package/components/divider.module-DauH6k2_.js +21 -0
  65. package/components/element-resolution-DCsrhGZO.cjs +112 -0
  66. package/components/element-resolution-nMlmW4Jy.js +113 -0
  67. package/components/field-group/index.cjs +7 -1
  68. package/components/field-group/index.js +12 -8
  69. package/components/field-group-DNmY8W9v.cjs +86 -0
  70. package/components/field-group-DVdAWCQF.js +87 -0
  71. package/components/field-label/index.cjs +7 -1
  72. package/components/field-label/index.js +12 -8
  73. package/components/field-label-CKH9EXpR.cjs +156 -0
  74. package/components/field-label-Dpsecoc6.js +157 -0
  75. package/components/focus-group-BqDAk9Is.js +337 -0
  76. package/components/focus-group-DFzOlalL.cjs +336 -0
  77. package/components/focus-visible-B-B8-P9R.cjs +104 -0
  78. package/components/focus-visible-BUPRWlsh.js +105 -0
  79. package/components/focusable-BPrTcZPd.cjs +262 -0
  80. package/components/focusable-ChCLg1k4.js +263 -0
  81. package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
  82. package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
  83. package/components/icon/index.cjs +90 -1
  84. package/components/icon/index.js +74 -46
  85. package/components/index.cjs +174 -1
  86. package/components/index.js +174 -172
  87. package/components/infield-button/index.cjs +46 -2
  88. package/components/infield-button/index.js +41 -30
  89. package/components/label/index.cjs +37 -1
  90. package/components/label/index.js +36 -24
  91. package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
  92. package/components/language-resolution-iN9EImbb.cjs +57 -0
  93. package/components/like-anchor-D62faRNG.cjs +79 -0
  94. package/components/like-anchor-v3cJ9RWM.js +80 -0
  95. package/components/manage-help-text-BYx84zZR.cjs +125 -0
  96. package/components/manage-help-text-DOuMTGht.js +126 -0
  97. package/components/menu/index.cjs +1297 -29
  98. package/components/menu/index.js +954 -499
  99. package/components/multi-language-field/index.cjs +132 -2
  100. package/components/multi-language-field/index.js +118 -88
  101. package/components/number-field/index.cjs +613 -10
  102. package/components/number-field/index.js +442 -243
  103. package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
  104. package/components/observe-slot-presence-DcMdoumP.js +79 -0
  105. package/components/observe-slot-text-CSofZeeF.cjs +104 -0
  106. package/components/observe-slot-text-CjnkkBPn.js +105 -0
  107. package/components/options/index.cjs +693 -60
  108. package/components/options/index.js +519 -953
  109. package/components/overlay/index.cjs +367 -21
  110. package/components/overlay/index.js +273 -189
  111. package/components/overlay-CN8ISP1F.js +2485 -0
  112. package/components/overlay-LViy9VWM.cjs +2484 -0
  113. package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
  114. package/components/pending-state-e4RbXe9u.cjs +75 -0
  115. package/components/picker/index.cjs +9 -1
  116. package/components/picker/index.js +15 -11
  117. package/components/picker-DNde3awt.cjs +672 -0
  118. package/components/picker-PfUAF05y.js +673 -0
  119. package/components/picker-button/index.cjs +56 -4
  120. package/components/picker-button/index.js +45 -34
  121. package/components/platform-CxDar3Dn.cjs +68 -0
  122. package/components/platform-Cxn0WbyT.js +69 -0
  123. package/components/popover/index.cjs +7 -1
  124. package/components/popover/index.js +12 -8
  125. package/components/popover-BkbYhl3i.js +74 -0
  126. package/components/popover-BkgUf0kL.cjs +74 -0
  127. package/components/progress-circle/index.cjs +7 -1
  128. package/components/progress-circle/index.js +12 -8
  129. package/components/progress-circle-Hu_ivPHf.js +133 -0
  130. package/components/progress-circle-_Etqsj9f.cjs +132 -0
  131. package/components/radio/index.cjs +244 -2
  132. package/components/radio/index.js +192 -110
  133. package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
  134. package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
  135. package/components/roving-tabindex-AsmAh2In.cjs +95 -0
  136. package/components/roving-tabindex-DPF9NmrH.js +96 -0
  137. package/components/search/index.cjs +115 -8
  138. package/components/search/index.js +96 -66
  139. package/components/select/index.cjs +720 -51
  140. package/components/select/index.js +563 -347
  141. package/components/sized-mixin-DmkrNdWB.js +80 -0
  142. package/components/sized-mixin-UaTVa-AE.cjs +79 -0
  143. package/components/slider/index.cjs +119 -1
  144. package/components/slider/index.js +100 -1113
  145. package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
  146. package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
  147. package/components/strategies-DlMlaSJR.cjs +317 -0
  148. package/components/strategies-DlPQoTFE.js +318 -0
  149. package/components/streaming-listener-D4sHaMub.cjs +145 -0
  150. package/components/streaming-listener-cAz5zJyk.js +146 -0
  151. package/components/swatch/index.cjs +436 -7
  152. package/components/swatch/index.js +350 -205
  153. package/components/switch/index.cjs +61 -2
  154. package/components/switch/index.js +51 -34
  155. package/components/tabs/index.cjs +693 -26
  156. package/components/tabs/index.js +521 -388
  157. package/components/tags/index.cjs +201 -4
  158. package/components/tags/index.js +152 -87
  159. package/components/text-field/index.cjs +49 -3
  160. package/components/text-field/index.js +44 -30
  161. package/components/text-field-11tcnftU.cjs +338 -0
  162. package/components/text-field-Chi9J2Cz.js +339 -0
  163. package/components/text-field.module-CMBS0jSL.js +21 -0
  164. package/components/text-field.module-DIJdV_sA.cjs +20 -0
  165. package/components/toast/index.cjs +177 -12
  166. package/components/toast/index.js +145 -73
  167. package/components/tooltip/index.cjs +221 -6
  168. package/components/tooltip/index.js +156 -109
  169. package/components/unit-input/index.cjs +232 -8
  170. package/components/unit-input/index.js +201 -108
  171. package/components/utils.cjs +25 -1
  172. package/components/utils.js +22 -22
  173. package/package.json +1 -1
  174. package/components/NumberFormatter-DewVDY5w.cjs +0 -18
  175. package/components/NumberFormatter-DgOUVrge.js +0 -136
  176. package/components/NumberParser-Dik4a0h-.cjs +0 -18
  177. package/components/NumberParser-ci9J5EKv.js +0 -173
  178. package/components/action-group-DBImibFn.js +0 -258
  179. package/components/action-group-DJGMcRHb.cjs +0 -20
  180. package/components/async-directive-BX1T1e1_.cjs +0 -22
  181. package/components/async-directive-BfcqVjDp.js +0 -82
  182. package/components/base-BjTwmyRF.cjs +0 -22
  183. package/components/base-CBCg3yyw.cjs +0 -40
  184. package/components/base-D76d76ww.js +0 -26
  185. package/components/base-WsynuqaS.js +0 -677
  186. package/components/button-base-DbkDzb71.js +0 -144
  187. package/components/button-base-XgPLmwP-.cjs +0 -25
  188. package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
  189. package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
  190. package/components/class-map-Di1D_rCm.cjs +0 -22
  191. package/components/class-map-NbVXqBU0.js +0 -51
  192. package/components/clear-button-DQcRdcUa.js +0 -53
  193. package/components/clear-button-OFUFFe7G.cjs +0 -18
  194. package/components/close-button-Cbnb7XXj.cjs +0 -18
  195. package/components/close-button-CqHYZhum.js +0 -51
  196. package/components/color-controller-B0uX6Zso.js +0 -3230
  197. package/components/color-controller-CoUL5f9K.cjs +0 -18
  198. package/components/color-loupe-CaA_Lfkk.cjs +0 -56
  199. package/components/color-loupe-CmMsXbjT.js +0 -81
  200. package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
  201. package/components/dependency-manger-C5HCkMMB.cjs +0 -18
  202. package/components/directive-helpers-Cm6gitnu.js +0 -62
  203. package/components/directive-helpers-DyIRTWwA.cjs +0 -22
  204. package/components/divider.module-DDvBo9zo.cjs +0 -18
  205. package/components/divider.module-DoQWQEIJ.js +0 -21
  206. package/components/element-resolution-BvRLGqIU.cjs +0 -18
  207. package/components/element-resolution-FCUT-wql.js +0 -91
  208. package/components/field-group-DXfBWrkO.js +0 -66
  209. package/components/field-group-DkGst3r5.cjs +0 -23
  210. package/components/field-label-CZ2zzChK.js +0 -106
  211. package/components/field-label-mO1AkUgR.cjs +0 -25
  212. package/components/flow-D-0MTYCm.js +0 -527
  213. package/components/flow-DM3dNAKs.cjs +0 -30
  214. package/components/focus-group-DHeTq18L.js +0 -218
  215. package/components/focus-group-DnxZUBhQ.cjs +0 -18
  216. package/components/focus-visible-B0P9aY_G.cjs +0 -18
  217. package/components/focus-visible-DBlJGoEW.js +0 -74
  218. package/components/focusable-BxtpnzWp.js +0 -153
  219. package/components/focusable-EbipgXRh.cjs +0 -18
  220. package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
  221. package/components/if-defined-C9YGdo33.cjs +0 -22
  222. package/components/if-defined-DOaE2coe.js +0 -27
  223. package/components/index-BwxgAdzi.cjs +0 -57
  224. package/components/index-Cl54m8Yh.js +0 -1490
  225. package/components/index-HjQa8tew.js +0 -1174
  226. package/components/index-Wq3qZJGh.cjs +0 -113
  227. package/components/language-resolution-DJzmyzZq.cjs +0 -18
  228. package/components/like-anchor-Bvn_vLQ8.js +0 -69
  229. package/components/like-anchor-sod1C1fR.cjs +0 -32
  230. package/components/luzmo-icons-4nDFv1Lq.js +0 -229
  231. package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
  232. package/components/manage-help-text-DhgARkZX.cjs +0 -30
  233. package/components/manage-help-text-syYnjKGL.js +0 -92
  234. package/components/mutation-controller-DH7YOCyj.js +0 -52
  235. package/components/mutation-controller-DkOMCW-c.cjs +0 -22
  236. package/components/observe-slot-presence-CmVi0zTc.js +0 -68
  237. package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
  238. package/components/observe-slot-text-BPfIQQtz.js +0 -87
  239. package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
  240. package/components/overlay-Cig9r6uU.js +0 -2747
  241. package/components/overlay-KSKMzzkh.cjs +0 -47
  242. package/components/pending-state-CaH1si5b.cjs +0 -26
  243. package/components/picker-BfBP7XJN.js +0 -461
  244. package/components/picker-xIphqE6d.cjs +0 -123
  245. package/components/platform-BM-uMWpX.js +0 -69
  246. package/components/platform-BiXhwqk3.cjs +0 -18
  247. package/components/popover-DjX0aAnY.js +0 -67
  248. package/components/popover-KFfO0IYL.cjs +0 -30
  249. package/components/progress-circle-BvRJNuNo.cjs +0 -33
  250. package/components/progress-circle-DXH9z8-6.js +0 -97
  251. package/components/query-BL-TJj7K.cjs +0 -22
  252. package/components/query-D_KR_GUc.js +0 -51
  253. package/components/query-assigned-elements-DjfhL1cl.js +0 -36
  254. package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
  255. package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
  256. package/components/query-assigned-nodes-C76XVPWY.js +0 -36
  257. package/components/random-id-CqvckpWe.cjs +0 -18
  258. package/components/roving-tabindex-By_fCy_e.cjs +0 -18
  259. package/components/roving-tabindex-DOg4z6ZU.js +0 -66
  260. package/components/sized-mixin-CPxE5C96.cjs +0 -18
  261. package/components/sized-mixin-D4ACoVUr.js +0 -63
  262. package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
  263. package/components/state-D8JEtYqe.cjs +0 -22
  264. package/components/state-Deh-vKYE.js +0 -29
  265. package/components/strategies-9indNIEb.js +0 -195
  266. package/components/strategies-BACP6MhR.cjs +0 -18
  267. package/components/streaming-listener-B00MvALi.cjs +0 -18
  268. package/components/streaming-listener-CP-JE6Fa.js +0 -91
  269. package/components/style-map-CeilmSgs.cjs +0 -22
  270. package/components/style-map-IgqIKvlE.js +0 -53
  271. package/components/text-field-CeG75PPO.cjs +0 -85
  272. package/components/text-field-DCl-AFM-.js +0 -314
  273. package/components/text-field.module-C2KVUJcX.js +0 -21
  274. package/components/text-field.module-DXhFA9G-.cjs +0 -18
  275. package/components/when-CDZyJPvd.cjs +0 -22
@@ -15,14 +15,644 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- import { L as u } from "../index-Cl54m8Yh.js";
19
- const l = () => {
20
- if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
21
- const o = document.createElement("style");
22
- o.setAttribute("data-luzmo-vars", ""), o.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(o);
18
+ const initializeGlobalLuzmoCSSVariables = () => {
19
+ if (typeof document !== "undefined" && !document.querySelector("style[data-luzmo-vars]")) {
20
+ const styleElement = document.createElement("style");
21
+ styleElement.setAttribute("data-luzmo-vars", "");
22
+ styleElement.textContent = `html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}`;
23
+ document.head.appendChild(styleElement);
23
24
  }
24
25
  };
25
- l();
26
+ initializeGlobalLuzmoCSSVariables();
27
+ import { getLocalTimeZone, today, isSameMonth, parseDate, toCalendarDate, startOfMonth, isSameDay, endOfMonth, startOfWeek, getWeeksInMonth, DateFormatter } from "@internationalized/date";
28
+ import { NumberFormatter } from "@internationalized/number";
29
+ import { unsafeCSS, html } from "lit";
30
+ import { classMap } from "lit/directives/class-map.js";
31
+ import { ifDefined } from "lit/directives/if-defined.js";
32
+ import { a as LuzmoElement } from "../base-DmeVy0cq.js";
33
+ import { S as SizedMixin } from "../sized-mixin-DmkrNdWB.js";
34
+ import "../action-button/index.js";
35
+ import "../icon/index.js";
36
+ import { luzmoAngleLeft, luzmoAngleRight } from "@luzmo/icons";
37
+ import { property, state } from "lit/decorators.js";
38
+ const styles = ':host{inline-size:var(--luzmo-calendar-width, var(--calendar-width));display:inline-block}.header{inline-size:100%;align-items:center;display:flex}.title{color:var(--highcontrast-calendar-date-text-color, var(--luzmo-calendar-date-text-color, var(--calendar-date-text-color)));font-size:var(--luzmo-calendar-title-text-size, var(--calendar-title-text-size));font-weight:var(--luzmo-calendar-title-font-weight, var(--calendar-title-font-weight));line-height:var(--luzmo-calendar-title-height, var(--calendar-title-height));text-align:center;white-space:nowrap;text-overflow:ellipsis;flex-grow:1;order:1;margin:0;overflow:hidden}.nextMonth,.prevMonth{transform:var(--logical-rotation)}.nextMonth:not([disabled]),.prevMonth:not([disabled]){color:var(--highcontrast-calendar-button-icon-color, var(--luzmo-calendar-button-icon-color, var(--calendar-button-icon-color)))}.prevMonth{order:0}.nextMonth{order:2}.dayOfWeek{inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));color:var(--highcontrast-calendar-day-title-text-color, var(--luzmo-calendar-day-title-text-color, var(--calendar-day-title-text-color)));font-size:var(--luzmo-calendar-day-title-text-size, var(--calendar-day-title-text-size));font-weight:var(--luzmo-calendar-day-title-text-font-weight, var(--calendar-day-title-text-font-weight));text-transform:uppercase;cursor:default;flex-direction:column;justify-content:flex-end;display:flex;border-block-end:none!important;-webkit-text-decoration:none!important;text-decoration:none!important}:host([title]) .dayOfWeek{text-decoration:underline;letter-spacing:var(--luzmo-calendar-title-text-letter-spacing, var(--calendar-title-text-letter-spacing));border-block-end:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.body{outline:none}.table{table-layout:fixed;border-collapse:collapse;border-spacing:0;-webkit-user-select:none;user-select:none}.table-cell{text-align:center;box-sizing:initial;block-size:var(--luzmo-calendar-day-height, var(--calendar-day-height));inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));padding:var(--luzmo-calendar-day-padding, var(--calendar-day-padding));position:relative}.table-cell:focus{outline:0}.date{box-sizing:border-box;block-size:var(--luzmo-calendar-day-height, var(--calendar-day-height));inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));margin:var(--luzmo-calendar-day-padding, var(--calendar-day-padding));border-radius:var(--luzmo-calendar-day-border-radius, var(--calendar-day-border-radius));border:var(--luzmo-calendar-day-border-size, var(--calendar-day-border-size)) solid transparent;font-size:var(--luzmo-calendar-day-text-size, var(--calendar-day-text-size));line-height:calc(var(--luzmo-calendar-day-width, var(--calendar-day-width)) - var(--luzmo-calendar-day-border-size, var(--calendar-day-border-size)) * 2);white-space:nowrap;cursor:pointer;display:block;position:absolute;inset-block-start:0;inset-inline-start:0}.date:lang(ja),.date:lang(ko),.date:lang(zh){font-size:var(--luzmo-calendar-day-text-size-han, var(--calendar-day-text-size-han))}.date.is-disabled{cursor:default;pointer-events:none}.date.is-outsideMonth{display:none}.date:before{content:"";box-sizing:border-box;inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));block-size:var(--luzmo-calendar-day-height, var(--calendar-day-height));border-radius:var(--luzmo-calendar-day-border-radius, var(--calendar-day-border-radius));border:var(--luzmo-calendar-day-border-size, var(--calendar-day-border-size)) solid transparent;position:absolute;inset-block-start:calc(50% - var(--luzmo-calendar-day-width, var(--calendar-day-width)) / 2);inset-inline-start:calc(50% - var(--luzmo-calendar-day-width, var(--calendar-day-width)) / 2)}.date.is-selected:not(.is-range-selection){font-weight:var(--luzmo-calendar-day-text-font-weight-selected, var(--calendar-day-text-font-weight-selected))}.date.is-selected:not(.is-range-selection):before{display:none}.date.is-today{font-weight:var(--luzmo-calendar-day-today-text-font-weight, var(--calendar-day-today-text-font-weight))}.date.is-range-selection{margin:var(--luzmo-calendar-day-padding, var(--calendar-day-padding)) 0;border-width:var(--luzmo-calendar-border-width-reset, var(--calendar-border-width-reset));line-height:var(--luzmo-calendar-day-height, var(--calendar-day-height));border-radius:var(--luzmo-calendar-border-radius-reset, var(--calendar-border-radius-reset));inline-size:calc(var(--luzmo-calendar-day-width, var(--calendar-day-width)) + var(--luzmo-calendar-day-padding, var(--calendar-day-padding)) * 2)}.date.is-range-selection.is-range-end,.date.is-range-selection.is-range-start,.date.is-range-selection.is-selection-end,.date.is-range-selection.is-selection-start{inline-size:calc(var(--luzmo-calendar-day-width, var(--calendar-day-width)) + var(--luzmo-calendar-day-padding, var(--calendar-day-padding)))}.date.is-range-selection.is-selection-end,.date.is-range-selection.is-selection-start{font-weight:var(--luzmo-calendar-day-text-font-weight-cap-selected, var(--calendar-day-text-font-weight-cap-selected))}.date.is-range-selection.is-selection-end:after,.date.is-range-selection.is-selection-start:after{block-size:var(--luzmo-calendar-day-height, var(--calendar-day-height));inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));border-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width));content:"";display:block;position:absolute;inset-block-start:0}.date.is-range-selection.is-range-start,.date.is-range-selection.is-selection-start{border-start-start-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width));border-end-start-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width));margin-inline-start:var(--luzmo-calendar-day-padding, var(--calendar-day-padding));padding-inline-end:var(--luzmo-calendar-day-padding, var(--calendar-day-padding))}.date.is-range-selection.is-range-start:after,.date.is-range-selection.is-range-start:before,.date.is-range-selection.is-selection-start:after,.date.is-range-selection.is-selection-start:before{inset-inline-start:0}.date.is-range-selection.is-range-end,.date.is-range-selection.is-selection-end{border-start-end-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width));border-end-end-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width));margin-inline-end:var(--luzmo-calendar-day-padding, var(--calendar-day-padding));padding-inline-start:var(--luzmo-calendar-day-padding, var(--calendar-day-padding))}.date.is-range-selection.is-range-end:after,.date.is-range-selection.is-range-end:before,.date.is-range-selection.is-selection-end:after,.date.is-range-selection.is-selection-end:before{inset-inline:auto 0}.date.is-range-selection.is-range-start.is-range-end,.date.is-range-selection.is-selection-end.is-range-start,.date.is-range-selection.is-selection-start.is-range-end,.date.is-range-selection.is-selection-start.is-selection-end{inline-size:var(--luzmo-calendar-day-width, var(--calendar-day-width));border-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width))}.date{color:var(--highcontrast-calendar-day-text-color, var(--luzmo-calendar-day-text-color, var(--calendar-day-text-color)))}.date:active{background-color:var(--highcontrast-calendar-day-background-color-down, var(--luzmo-calendar-day-background-color-down, var(--calendar-day-background-color-down)))}.date.is-selected{color:var(--highcontrast-calendar-day-text-color-selected, var(--luzmo-calendar-day-text-color-selected, var(--calendar-day-text-color-selected)));background:var(--highcontrast-calendar-day-background-color-selected, var(--luzmo-calendar-day-background-color-selected, var(--calendar-day-background-color-selected)))}.date.is-selected:not(.is-range-selection){background:var(--highcontrast-calendar-day-background-color-cap-selected, var(--luzmo-calendar-day-background-color-cap-selected, var(--calendar-day-background-color-cap-selected)));color:var(--highcontrast-calendar-day-text-color-cap-selected, var(--luzmo-calendar-day-text-color-cap-selected, var(--calendar-day-text-color-cap-selected)));border-color:var(--highcontrast-calendar-day-border-color-cap-selected, var(--luzmo-calendar-day-border-color-cap-selected, var(--calendar-day-border-color-cap-selected)))}.date.is-today{color:var(--highcontrast-calendar-day-today-text-color, var(--luzmo-calendar-day-today-text-color, var(--calendar-day-today-text-color)));background-color:var(--highcontrast-calendar-day-today-background-color, var(--luzmo-calendar-day-today-background-color, var(--calendar-day-today-background-color)))}.date.is-today,.date.is-today:before{border-color:var(--highcontrast-calendar-day-today-border-color, var(--luzmo-calendar-day-today-border-color, var(--calendar-day-today-border-color)))}@media (hover: hover){.date:hover{color:var(--highcontrast-calendar-day-text-color-hover, var(--luzmo-calendar-day-text-color-hover, var(--calendar-day-text-color-hover)))}.date:hover:not(.is-selection-end,.is-selection-start):before{background:var(--highcontrast-calendar-day-background-color-hover, var(--luzmo-calendar-day-background-color-hover, var(--calendar-day-background-color-hover)))}.date.is-range-selection:hover:before,.date.is-selected:hover:not(.is-selection-end,.is-selection-start):before{background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--luzmo-calendar-day-background-color-selected-hover, var(--calendar-day-background-color-selected-hover)))}.date.is-today.is-selected:not(.is-range-selection):hover:before{background:var(--highcontrast-calendar-day-today-background-color-selected-hover, var(--luzmo-calendar-day-today-background-color-selected-hover, var(--calendar-day-today-background-color-selected-hover)))}}.date.is-today.is-disabled{color:var(--highcontrast-calendar-day-today-text-color-disabled, var(--luzmo-calendar-day-today-text-color-disabled, var(--calendar-day-today-text-color-disabled)))}.date.is-today.is-disabled,.date.is-today.is-disabled:before{border-color:var(--highcontrast-calendar-day-today-border-color-disabled, var(--luzmo-calendar-day-today-border-color-disabled, var(--calendar-day-today-border-color-disabled)))}.table-cell:focus-within .date:not(.is-range-selection){background:var(--highcontrast-calendar-day-background-color-key-focus, var(--luzmo-calendar-day-background-color-key-focus, var(--calendar-day-background-color-key-focus)));color:var(--highcontrast-calendar-day-text-color-key-focus, var(--luzmo-calendar-day-text-color-key-focus, var(--calendar-day-text-color-key-focus)))}.table-cell:focus-within .date.is-selected:not(.is-range-selection),.table-cell:focus-within .date.is-today:not(.is-range-selection),.table-cell:focus-within .date:not(.is-range-selection),.table-cell:focus-within .date:not(.is-range-selection):active{border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--luzmo-calendar-day-border-color-key-focus, var(--calendar-day-border-color-key-focus)))}.table-cell:focus-within .date.is-selected:not(.is-range-selection),.table-cell:focus-within .date:not(.is-range-selection):active{color:var(--highcontrast-calendar-day-text-color-selected, var(--luzmo-calendar-day-text-color-selected, var(--calendar-day-text-color-selected)));background:var(--highcontrast-calendar-day-background-color-cap-selected, var(--luzmo-calendar-day-background-color-cap-selected, var(--calendar-day-background-color-cap-selected)));border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--luzmo-calendar-day-border-color-cap-selected-focus, var(--calendar-day-border-color-cap-selected-focus)))}.table-cell:focus-within .date.is-range-selection:before,.table-cell:focus-within .date.is-selected:before{background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--luzmo-calendar-day-background-color-selected-hover, var(--calendar-day-background-color-selected-hover)))}.table-cell:focus-within .date:before{border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--luzmo-calendar-day-border-color-key-focus, var(--calendar-day-border-color-key-focus)))}.date.is-disabled{color:var(--highcontrast-calendar-day-text-color-disabled, var(--luzmo-calendar-day-text-color-disabled, var(--calendar-day-text-color-disabled)))}.date.is-selection-end,.date.is-selection-start{color:var(--highcontrast-calendar-day-text-color-cap-selected, var(--luzmo-calendar-day-text-color-cap-selected, var(--calendar-day-text-color-cap-selected)))}.date.is-selection-end:after,.date.is-selection-start:after{background-color:var(--highcontrast-calendar-day-background-color-selected, var(--luzmo-calendar-day-background-color-selected, var(--calendar-day-background-color-selected)))}.date.is-selection-end.is-disabled,.date.is-selection-start.is-disabled{color:var(--highcontrast-calendar-day-text-color-disabled, var(--luzmo-calendar-day-text-color-disabled, var(--calendar-day-text-color-disabled)))}@media (forced-colors: active){.nextMonth,.prevMonth{--highcontrast-calendar-button-icon-color: ButtonText}.date{--highcontrast-calendar-day-background-color-cap-selected: Highlight;--highcontrast-calendar-day-background-color-down: ButtonFace;--highcontrast-calendar-day-background-color-hover: Transparent;--highcontrast-calendar-day-background-color-key-focus: ButtonFace;--highcontrast-calendar-day-background-color-selected-hover: Transparent;--highcontrast-calendar-day-background-color-selected: Highlight;--highcontrast-calendar-day-border-color-key-focus: ButtonText;--highcontrast-calendar-day-text-color-cap-selected: HighlightText;--highcontrast-calendar-day-text-color-disabled: GrayText;--highcontrast-calendar-day-text-color-hover: ButtonText;--highcontrast-calendar-day-text-color-key-focus: ButtonText;--highcontrast-calendar-day-text-color-selected: HighlightText;--highcontrast-calendar-day-text-color: CanvasText;--highcontrast-calendar-date-text-color: CanvasText;--highcontrast-calendar-day-title-text-color: CanvasText;--highcontrast-calendar-day-today-background-color-selected-hover: Highlight;--highcontrast-calendar-day-today-border-color-disabled: GrayText;--highcontrast-calendar-day-today-border-color: ButtonText;--highcontrast-calendar-day-today-text-color-disabled: GrayText;--highcontrast-calendar-day-today-text-color: ButtonText;forced-color-adjust:none}.date.is-range-selection.is-today{color:HighlightText}.date.is-range-selection.is-selection-end:after,.date.is-range-selection.is-selection-start:after{content:none}.date.is-disabled.is-range-selection,.date.is-disabled.is-selected{background:Highlight;color:HighlightText}}:host{--calendar-background-color: var(--luzmo-background-color-white)}:host{font-family:var(--luzmo-font-family);--calendar-day-width: var(--luzmo-component-height);--calendar-day-height: var(--luzmo-component-height);--calendar-border-radius-reset: 0;--calendar-border-width-reset: 0;--calendar-day-border-size: var(--luzmo-border-width);--calendar-margin-y: calc(var(--luzmo-spacing) * 3);--calendar-margin-x: var(--luzmo-component-height);--calendar-day-padding: var(--luzmo-spacing-2);--calendar-width: calc( (var(--calendar-day-width) + var(--calendar-day-padding) * 2) * 7 );--calendar-title-text-letter-spacing: .06em;--calendar-day-title-text-font-weight: bold;--calendar-day-title-text-color: var(--luzmo-font-color-disabled);--calendar-title-height: var(--luzmo-component-height);--calendar-title-font-weight: bold;--calendar-title-text-size: var(--luzmo-font-size);--calendar-day-title-text-size: var(--luzmo-font-size);--calendar-day-text-size-han: var(--luzmo-font-size);--calendar-date-text-color: var(--luzmo-font-color);--calendar-day-text-color: var(--luzmo-font-color);--calendar-day-text-size: var(--luzmo-font-size);--calendar-day-border-radius: var(--luzmo-border-radius);--calendar-day-text-color-selected: var(--luzmo-primary-inverse-color);--calendar-day-text-color-hover: var(--luzmo-font-color-hover);--calendar-day-text-color-cap-selected: var(--luzmo-primary-inverse-color);--calendar-day-border-color-cap-selected: var(--luzmo-primary);--calendar-day-border-color-cap-selected-focus: var(--luzmo-primary-focus);--calendar-day-text-font-weight-selected: var(--bold-font-weight);--calendar-day-text-font-weight-cap-selected: var(--bold-font-weight);--calendar-day-today-text-color: var(--luzmo-primary);--calendar-day-today-background-color: var(--luzmo-background-color-hover);--calendar-day-today-text-font-weight: normal;--calendar-day-today-border-color: transparent;--calendar-day-today-text-color-disabled: var(--luzmo-font-color-disabled);--calendar-day-today-border-color-disabled: transparent;--calendar-day-text-color-disabled: var(--luzmo-font-color-disabled);--calendar-day-text-color-key-focus: var(--luzmo-primary-down);--calendar-day-background-color-cap-selected: var(--luzmo-primary);--calendar-button-icon-color: var(--luzmo-font-color)}:host:dir(rtl),:host([dir=rtl]){--logical-rotation: matrix(-1, 0, 0, 1, 0, 0)}:host([size=s]){--calendar-day-width: var(--luzmo-component-height-s);--calendar-day-height: var(--luzmo-component-height-s);--calendar-day-border-radius: var(--luzmo-border-radius-s);--calendar-title-height: var(--luzmo-component-height-s);--calendar-title-text-size: var(--luzmo-font-size-s);--calendar-day-title-text-size: var(--luzmo-font-size-s);--calendar-day-text-size-han: var(--luzmo-font-size-s);--calendar-day-text-size: var(--luzmo-font-size-s)}:host([size=l]){--calendar-day-width: var(--luzmo-component-height-l);--calendar-day-height: var(--luzmo-component-height-l);--calendar-day-border-radius: var(--luzmo-border-radius-l);--calendar-title-height: var(--luzmo-component-height-l);--calendar-title-text-size: var(--luzmo-font-size-l);--calendar-day-title-text-size: var(--luzmo-font-size-l);--calendar-day-text-size-han: var(--luzmo-font-size-l);--calendar-day-text-size: var(--luzmo-font-size-l)}:host([size=xl]){--calendar-day-width: var(--luzmo-component-height-xl);--calendar-day-height: var(--luzmo-component-height-xl);--calendar-day-border-radius: var(--luzmo-border-radius-xl);--calendar-title-height: var(--luzmo-component-height-xl);--calendar-title-text-size: var(--luzmo-font-size-xl);--calendar-day-title-text-size: var(--luzmo-font-size-xl);--calendar-day-text-size-han: var(--luzmo-font-size-xl);--calendar-day-text-size: var(--luzmo-font-size-xl)}.table-cell span[role=button]{border-radius:var(--luzmo-calendar-day-width, var(--calendar-day-width))}';
39
+ var __defProp = Object.defineProperty;
40
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
41
+ var __decorateClass = (decorators, target, key, kind) => {
42
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
43
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
44
+ if (decorator = decorators[i])
45
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
46
+ if (kind && result) __defProp(target, key, result);
47
+ return result;
48
+ };
49
+ const DAYS_PER_WEEK = 7;
50
+ class LuzmoCalendar extends SizedMixin(LuzmoElement, {
51
+ validSizes: ["s", "m", "l", "xl"],
52
+ noDefaultSize: true
53
+ }) {
54
+ constructor() {
55
+ super();
56
+ this.disabled = false;
57
+ this.labels = {
58
+ previous: "Previous",
59
+ next: "Next",
60
+ today: "Today",
61
+ selected: "Selected"
62
+ };
63
+ this.currentDate = this.today;
64
+ this.timeZone = getLocalTimeZone();
65
+ this.weekdays = [];
66
+ this.currentMonthDates = [];
67
+ this._isDateFocusIntent = false;
68
+ this.numberFormatter = new NumberFormatter(this._language);
69
+ this.setNumberFormatter();
70
+ this.setWeekdays();
71
+ this.setCurrentMonthDates();
72
+ }
73
+ /**
74
+ * The styles of the calendar
75
+ * @internal
76
+ */
77
+ static get styles() {
78
+ return [unsafeCSS(styles)];
79
+ }
80
+ /**
81
+ * The language used to format the dates and weekdays.
82
+ * @internal
83
+ */
84
+ get _language() {
85
+ try {
86
+ if (this.language) {
87
+ const locale = new Intl.Locale(this.language);
88
+ return locale.language;
89
+ }
90
+ return "en";
91
+ } catch {
92
+ return "en";
93
+ }
94
+ }
95
+ /**
96
+ * The current date in the calendar
97
+ * @internal
98
+ */
99
+ get today() {
100
+ return today(this.timeZone);
101
+ }
102
+ set isDateFocusIntent(value) {
103
+ if (this._isDateFocusIntent === value) return;
104
+ this._isDateFocusIntent = value;
105
+ this.requestUpdate("isDateFocusIntent", !value);
106
+ }
107
+ /**
108
+ * @internal
109
+ */
110
+ get isDateFocusIntent() {
111
+ return this._isDateFocusIntent;
112
+ }
113
+ setDateFocusIntent() {
114
+ this.isDateFocusIntent = true;
115
+ }
116
+ resetDateFocusIntent() {
117
+ this.isDateFocusIntent = false;
118
+ }
119
+ connectedCallback() {
120
+ super.connectedCallback();
121
+ document.addEventListener("mousedown", this.resetDateFocusIntent);
122
+ }
123
+ disconnectedCallback() {
124
+ super.disconnectedCallback();
125
+ document.removeEventListener("mousedown", this.resetDateFocusIntent);
126
+ }
127
+ /**
128
+ * Resets the component's value
129
+ */
130
+ clear() {
131
+ this._value = void 0;
132
+ }
133
+ willUpdate(changedProperties) {
134
+ if (changedProperties.has("language")) {
135
+ this.setNumberFormatter();
136
+ this.setWeekdays();
137
+ this.setCurrentMonthDates();
138
+ }
139
+ const changesMin = changedProperties.has("min");
140
+ const changesMax = changedProperties.has("max");
141
+ const changesValue = changedProperties.has("value");
142
+ const changesDates = changesMin || changesMax || changesValue;
143
+ if (changesDates) {
144
+ this.convertToCalendarDates();
145
+ this.checkDatePropsCompliance(changesMin || changesMax);
146
+ this.updateCurrentDate();
147
+ }
148
+ const previousDate = changedProperties.get("currentDate");
149
+ const changesMonth = changedProperties.has("currentDate") && (!previousDate || !isSameMonth(previousDate, this.currentDate));
150
+ if (changesMonth) {
151
+ this.setCurrentMonthDates();
152
+ this.setAttribute("aria-label", this.monthAndYear);
153
+ }
154
+ }
155
+ updated(changedProperties) {
156
+ if (changedProperties.has("currentDate") && this.isDateFocusIntent)
157
+ this.focusCurrentDate();
158
+ }
159
+ /**
160
+ * Focuses the tabbable day element in the calendar represented by the current date.
161
+ * Useful while navigating through the calendar as the focus might be lost when the month changes.
162
+ */
163
+ focusCurrentDate() {
164
+ var _a;
165
+ const elementToFocus = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(
166
+ 'td span[tabindex="0"]'
167
+ );
168
+ if (elementToFocus) elementToFocus.focus();
169
+ }
170
+ convertToCalendarDates() {
171
+ this._min = this.min ? parseDate(this.min) : void 0;
172
+ this._max = this.max ? parseDate(this.max) : void 0;
173
+ this._value = this.value ? parseDate(this.value) : void 0;
174
+ const era = "AD";
175
+ this._min = this._min && toCalendarDate(this._min).set({ era });
176
+ this._max = this._max && toCalendarDate(this._max).set({ era });
177
+ this._value = this._value && toCalendarDate(this._value).set({ era });
178
+ }
179
+ /**
180
+ * Validates the component's date properties (min, max and value) compliance with one another.
181
+ * If the [min, max] constraint interval is invalid, both properties are reset.
182
+ * If the value is not within the [min, max] (valid) interval, it is reset.
183
+ *
184
+ * @param checkInterval - Whether to check the [min, max] interval
185
+ */
186
+ checkDatePropsCompliance(checkInterval) {
187
+ if (checkInterval && this._min && this._max) {
188
+ const isValidInterval = this._min.compare(this._max) < 0;
189
+ if (!isValidInterval) {
190
+ if (console.warn)
191
+ console.warn(
192
+ this,
193
+ `<${this.localName}> expects the 'min' to be less than 'max'. Please ensure that 'min' property's date is earlier than 'max' property's date.`
194
+ );
195
+ this._min = void 0;
196
+ this._max = void 0;
197
+ }
198
+ }
199
+ if (this._value && this.isNonCompliantDate(this._value)) {
200
+ if (console.warn)
201
+ console.warn(
202
+ this,
203
+ `<${this.localName}> expects the preselected value to comply with the min and max constraints. Please ensure that 'value' property's date is in between the dates for the 'min' and 'max' properties.`
204
+ );
205
+ this._value = void 0;
206
+ }
207
+ }
208
+ updateCurrentDate() {
209
+ if (this._value) {
210
+ this.currentDate = this._value;
211
+ return;
212
+ }
213
+ const isTodayNonCompliant = this.isNonCompliantDate(this.today);
214
+ if (isTodayNonCompliant) {
215
+ if (this._min) this.currentDate = this._min;
216
+ else if (this._max) this.currentDate = this._max;
217
+ } else this.currentDate = this.today;
218
+ }
219
+ /**
220
+ * Whether the date is non-compliant with the min and max constraints
221
+ */
222
+ isNonCompliantDate(date) {
223
+ return Boolean(
224
+ this._min && date.compare(this._min) < 0 || this._max && date.compare(this._max) > 0
225
+ );
226
+ }
227
+ render() {
228
+ return html` ${this.renderCalendarHeader()}${this.renderCalendarGrid()} `;
229
+ }
230
+ /**
231
+ * The month and year of the calendar
232
+ * @internal
233
+ */
234
+ get monthAndYear() {
235
+ return this.formatDate(this.currentDate, {
236
+ month: "long",
237
+ year: "numeric"
238
+ });
239
+ }
240
+ renderCalendarHeader() {
241
+ return html`
242
+ <div class="header" @focusin=${this.resetDateFocusIntent}>
243
+ <h2
244
+ class="title"
245
+ aria-live="polite"
246
+ aria-atomic="true"
247
+ data-test-id="calendar-title"
248
+ >
249
+ ${this.monthAndYear}
250
+ </h2>
251
+
252
+ <luzmo-action-button
253
+ quiet
254
+ size="s"
255
+ label=${this.labels.previous}
256
+ class="prevMonth"
257
+ data-test-id="prev-btn"
258
+ ?disabled=${this.isPreviousMonthDisabled}
259
+ @click=${this.handlePreviousMonth}
260
+ >
261
+ <div slot="icon">
262
+ <slot name="prev-icon">
263
+ <luzmo-icon
264
+ block
265
+ .size=${this.size}
266
+ .icon=${luzmoAngleLeft}
267
+ ></luzmo-icon>
268
+ </slot>
269
+ </div>
270
+ </luzmo-action-button>
271
+
272
+ <luzmo-action-button
273
+ quiet
274
+ size="s"
275
+ label=${this.labels.next}
276
+ class="nextMonth"
277
+ data-test-id="next-btn"
278
+ ?disabled=${this.isNextMonthDisabled}
279
+ @click=${this.handleNextMonth}
280
+ >
281
+ <div slot="icon">
282
+ <slot name="next-icon">
283
+ <luzmo-icon
284
+ block
285
+ .size=${this.size}
286
+ .icon=${luzmoAngleRight}
287
+ ></luzmo-icon>
288
+ </slot>
289
+ </div>
290
+ </luzmo-action-button>
291
+ </div>
292
+ `;
293
+ }
294
+ /**
295
+ * Whether the previous month is disabled
296
+ * @internal
297
+ */
298
+ get isPreviousMonthDisabled() {
299
+ if (this.disabled) return true;
300
+ const currentMonthStart = startOfMonth(this.currentDate);
301
+ const previousMonthStart = currentMonthStart.subtract({ months: 1 });
302
+ return currentMonthStart.era !== previousMonthStart.era || isSameDay(currentMonthStart, previousMonthStart);
303
+ }
304
+ /**
305
+ * Whether the next month is disabled
306
+ * @internal
307
+ */
308
+ get isNextMonthDisabled() {
309
+ if (this.disabled) return true;
310
+ const currentMonthEnd = endOfMonth(this.currentDate);
311
+ const nextMonthEnd = currentMonthEnd.add({ months: 1 });
312
+ return currentMonthEnd.era !== nextMonthEnd.era || isSameDay(currentMonthEnd, nextMonthEnd);
313
+ }
314
+ handlePreviousMonth() {
315
+ let newCurrentDate = startOfMonth(this.currentDate).subtract({
316
+ months: 1
317
+ });
318
+ if (this._value && isSameMonth(newCurrentDate, this._value))
319
+ newCurrentDate = this._value;
320
+ else if (isSameMonth(newCurrentDate, this.today))
321
+ newCurrentDate = this.today;
322
+ this.currentDate = newCurrentDate;
323
+ }
324
+ handleNextMonth() {
325
+ let newCurrentDate = startOfMonth(this.currentDate).add({
326
+ months: 1
327
+ });
328
+ if (this._value && isSameMonth(newCurrentDate, this._value))
329
+ newCurrentDate = this._value;
330
+ else if (isSameMonth(newCurrentDate, this.today))
331
+ newCurrentDate = this.today;
332
+ this.currentDate = newCurrentDate;
333
+ }
334
+ renderCalendarGrid() {
335
+ return html`
336
+ <table
337
+ role="grid"
338
+ aria-readonly="true"
339
+ aria-disabled=${this.disabled}
340
+ role="presentation"
341
+ class="table body"
342
+ @keydown=${this.handleKeydown}
343
+ >
344
+ ${this.renderCalendarTableHead()} ${this.renderCalendarTableBody()}
345
+ </table>
346
+ `;
347
+ }
348
+ renderCalendarTableHead() {
349
+ return html`
350
+ <thead role="presentation">
351
+ <tr role="row">
352
+ ${this.renderWeekdayColumns()}
353
+ </tr>
354
+ </thead>
355
+ `;
356
+ }
357
+ renderWeekdayColumns() {
358
+ return this.weekdays.map((weekday) => this.renderWeekdayColumn(weekday));
359
+ }
360
+ renderWeekdayColumn(weekday) {
361
+ return html`
362
+ <th role="columnheader" scope="col" class="table-cell">
363
+ <abbr class="dayOfWeek" title=${weekday.long}> ${weekday.narrow} </abbr>
364
+ </th>
365
+ `;
366
+ }
367
+ renderCalendarTableBody() {
368
+ return html`
369
+ <tbody role="presentation">
370
+ ${this.renderCalendarWeeks()}
371
+ </tbody>
372
+ `;
373
+ }
374
+ renderCalendarWeeks() {
375
+ return this.currentMonthDates.map(
376
+ (week) => html`
377
+ <tr role="row">
378
+ ${this.renderDatesInWeek(week)}
379
+ </tr>
380
+ `
381
+ );
382
+ }
383
+ renderDatesInWeek(week) {
384
+ return week.map((date) => this.renderCalendarTableCell(date));
385
+ }
386
+ parseDateCellProperties(calendarDate) {
387
+ const props = {
388
+ isOutsideMonth: false,
389
+ isSelected: false,
390
+ isToday: false,
391
+ isDisabled: false,
392
+ isTabbable: false
393
+ };
394
+ props.isOutsideMonth = calendarDate.month !== this.currentDate.month;
395
+ if (props.isOutsideMonth) return props;
396
+ props.isDisabled = this.disabled || this.isMinLimitReached(calendarDate) || this.isMaxLimitReached(calendarDate);
397
+ props.isToday = isSameDay(calendarDate, this.today);
398
+ if (props.isDisabled) return props;
399
+ props.isTabbable = isSameDay(calendarDate, this.currentDate);
400
+ props.isSelected = Boolean(
401
+ this._value && isSameDay(this._value, calendarDate)
402
+ );
403
+ return props;
404
+ }
405
+ renderCalendarTableCell(calendarDate) {
406
+ const { isOutsideMonth, isSelected, isToday, isDisabled, isTabbable } = this.parseDateCellProperties(calendarDate);
407
+ const dayClasses = {
408
+ date: true,
409
+ "is-outsideMonth": isOutsideMonth,
410
+ "is-selected": isSelected,
411
+ "is-today": isToday,
412
+ "is-disabled": isDisabled
413
+ };
414
+ let currentDayLabelPrefix = "";
415
+ if (isToday) currentDayLabelPrefix = `${this.labels.today}, `;
416
+ else if (isSelected) currentDayLabelPrefix = `${this.labels.selected}, `;
417
+ const currentDayLabel = currentDayLabelPrefix + this.formatDate(calendarDate, {
418
+ weekday: "long",
419
+ year: "numeric",
420
+ month: "long",
421
+ day: "numeric"
422
+ });
423
+ return html`
424
+ <td role="gridcell" class="table-cell">
425
+ <span
426
+ role="button"
427
+ tabindex=${ifDefined(
428
+ isOutsideMonth ? void 0 : isTabbable ? "0" : "-1"
429
+ )}
430
+ aria-label=${currentDayLabel}
431
+ aria-disabled=${isOutsideMonth || isDisabled}
432
+ data-value=${calendarDate.toString()}
433
+ @mousedown=${this.handleDaySelect}
434
+ >
435
+ <span role="presentation" class=${classMap(dayClasses)}>
436
+ ${this.formatNumber(calendarDate.day)}
437
+ </span>
438
+ </span>
439
+ </td>
440
+ `;
441
+ }
442
+ handleKeydown(event) {
443
+ this.setDateFocusIntent();
444
+ switch (event.code) {
445
+ case "ArrowLeft": {
446
+ this.moveToPreviousDay();
447
+ break;
448
+ }
449
+ case "ArrowDown": {
450
+ this.moveToNextWeek();
451
+ break;
452
+ }
453
+ case "ArrowRight": {
454
+ this.moveToNextDay();
455
+ break;
456
+ }
457
+ case "ArrowUp": {
458
+ this.moveToPreviousWeek();
459
+ break;
460
+ }
461
+ case "Space":
462
+ case "Enter": {
463
+ this.handleDaySelect(event);
464
+ break;
465
+ }
466
+ }
467
+ }
468
+ handleDaySelect(event) {
469
+ if (this.disabled) {
470
+ event.preventDefault();
471
+ return;
472
+ }
473
+ const cellButton = event.target.closest(
474
+ 'span[role="button"]'
475
+ );
476
+ const dateString = cellButton && cellButton.dataset.value;
477
+ if (!dateString) return;
478
+ const calendarDateEngaged = parseDate(dateString);
479
+ const isAlreadySelected = this._value && isSameDay(this._value, calendarDateEngaged);
480
+ if (isAlreadySelected || this.isMinLimitReached(calendarDateEngaged) || this.isMaxLimitReached(calendarDateEngaged)) {
481
+ event.preventDefault();
482
+ return;
483
+ }
484
+ this._value = calendarDateEngaged;
485
+ this.value = calendarDateEngaged.toString();
486
+ this.dispatchEvent(
487
+ new CustomEvent("change", {
488
+ bubbles: true,
489
+ composed: true,
490
+ cancelable: true,
491
+ detail: {
492
+ value: this.value
493
+ }
494
+ })
495
+ );
496
+ }
497
+ moveToPreviousDay() {
498
+ const previousDay = this.currentDate.subtract({ days: 1 });
499
+ if (this.canMoveBackToDate(previousDay)) this.currentDate = previousDay;
500
+ }
501
+ moveToNextDay() {
502
+ const nextDay = this.currentDate.add({ days: 1 });
503
+ if (this.canMoveForwardToDate(nextDay)) this.currentDate = nextDay;
504
+ }
505
+ moveToPreviousWeek() {
506
+ const previousWeek = this.currentDate.subtract({ weeks: 1 });
507
+ if (this.canMoveBackToDate(previousWeek)) {
508
+ this.currentDate = previousWeek;
509
+ return;
510
+ }
511
+ let dayToFocus = previousWeek.add({ days: 1 });
512
+ while (!this.canMoveBackToDate(dayToFocus)) {
513
+ dayToFocus = dayToFocus.add({ days: 1 });
514
+ }
515
+ this.currentDate = dayToFocus;
516
+ }
517
+ moveToNextWeek() {
518
+ const nextWeek = this.currentDate.add({ weeks: 1 });
519
+ if (this.canMoveForwardToDate(nextWeek)) {
520
+ this.currentDate = nextWeek;
521
+ return;
522
+ }
523
+ let dayToFocus = nextWeek.subtract({ days: 1 });
524
+ while (!this.canMoveForwardToDate(dayToFocus)) {
525
+ dayToFocus = dayToFocus.subtract({ days: 1 });
526
+ }
527
+ this.currentDate = dayToFocus;
528
+ }
529
+ canMoveBackToDate(previousDate) {
530
+ if (this.isMinLimitReached(previousDate)) return false;
531
+ return isSameMonth(this.currentDate, previousDate) || !this.isPreviousMonthDisabled;
532
+ }
533
+ canMoveForwardToDate(nextDate) {
534
+ if (this.isMaxLimitReached(nextDate)) return false;
535
+ return isSameMonth(this.currentDate, nextDate) || !this.isNextMonthDisabled;
536
+ }
537
+ /**
538
+ * Defines the array with data for the days of the week, starting on the first day of the week according to the
539
+ * defined location (Sunday, Monday, etc.)
540
+ */
541
+ setWeekdays() {
542
+ const weekStart = startOfWeek(this.currentDate, this._language);
543
+ this.weekdays = [...Array.from({ length: DAYS_PER_WEEK }).keys()].map(
544
+ (dayIndex) => {
545
+ const date = weekStart.add({ days: dayIndex });
546
+ return {
547
+ narrow: this.formatDate(date, { weekday: "narrow" }),
548
+ long: this.formatDate(date, { weekday: "long" })
549
+ };
550
+ }
551
+ );
552
+ }
553
+ /**
554
+ * Defines the 2D-array with the dates of the current month
555
+ */
556
+ setCurrentMonthDates() {
557
+ const numberOfWeeks = getWeeksInMonth(this.currentDate, this._language);
558
+ const newCurrentMonthDates = Array.from({
559
+ length: numberOfWeeks
560
+ });
561
+ for (const weekIndex of Array.from({ length: numberOfWeeks }).keys())
562
+ newCurrentMonthDates[weekIndex] = this.getDatesInWeek(
563
+ this.currentDate,
564
+ weekIndex
565
+ );
566
+ this.currentMonthDates = newCurrentMonthDates;
567
+ }
568
+ /**
569
+ * Returns an array with all days of the week in a specific month, corresponding to the given index,
570
+ * starting with the first day of the week according to the language
571
+ *
572
+ * @param weekIndex - The index of the week
573
+ */
574
+ getDatesInWeek(monthDate, weekIndex) {
575
+ const dates = [];
576
+ let date = startOfWeek(
577
+ startOfMonth(monthDate).add({
578
+ weeks: weekIndex
579
+ }),
580
+ this._language
581
+ );
582
+ while (dates.length < DAYS_PER_WEEK) {
583
+ dates.push(date);
584
+ const nextDate = date.add({ days: 1 });
585
+ if (isSameDay(date, nextDate)) break;
586
+ date = nextDate;
587
+ }
588
+ return dates;
589
+ }
590
+ isMinLimitReached(calendarDate) {
591
+ return Boolean(this._min && calendarDate.compare(this._min) < 0);
592
+ }
593
+ isMaxLimitReached(calendarDate) {
594
+ return Boolean(this._max && calendarDate.compare(this._max) > 0);
595
+ }
596
+ /**
597
+ * Formats a `CalendarDate` object using the current language and the provided date format options
598
+ *
599
+ * @param calendarDate - The `CalendarDate` object that will be formatted
600
+ * @param options - All date format options that will be used by the formatter
601
+ */
602
+ formatDate(calendarDate, options) {
603
+ return new DateFormatter(this._language, options).format(
604
+ calendarDate.toDate(this.timeZone)
605
+ );
606
+ }
607
+ setNumberFormatter() {
608
+ this.numberFormatter = new NumberFormatter(this._language);
609
+ }
610
+ formatNumber(number) {
611
+ return this.numberFormatter.format(number);
612
+ }
613
+ }
614
+ __decorateClass([
615
+ property({ type: String })
616
+ ], LuzmoCalendar.prototype, "value", 2);
617
+ __decorateClass([
618
+ property({ type: String })
619
+ ], LuzmoCalendar.prototype, "min", 2);
620
+ __decorateClass([
621
+ property({ type: String })
622
+ ], LuzmoCalendar.prototype, "max", 2);
623
+ __decorateClass([
624
+ property({ type: Boolean, reflect: true })
625
+ ], LuzmoCalendar.prototype, "disabled", 2);
626
+ __decorateClass([
627
+ property({ type: String, reflect: true })
628
+ ], LuzmoCalendar.prototype, "language", 2);
629
+ __decorateClass([
630
+ property({ type: Object })
631
+ ], LuzmoCalendar.prototype, "labels", 2);
632
+ __decorateClass([
633
+ state()
634
+ ], LuzmoCalendar.prototype, "currentDate", 2);
635
+ __decorateClass([
636
+ state()
637
+ ], LuzmoCalendar.prototype, "_value", 2);
638
+ __decorateClass([
639
+ state()
640
+ ], LuzmoCalendar.prototype, "_min", 2);
641
+ __decorateClass([
642
+ state()
643
+ ], LuzmoCalendar.prototype, "_max", 2);
644
+ __decorateClass([
645
+ state()
646
+ ], LuzmoCalendar.prototype, "weekdays", 2);
647
+ __decorateClass([
648
+ state()
649
+ ], LuzmoCalendar.prototype, "currentMonthDates", 2);
650
+ __decorateClass([
651
+ state()
652
+ ], LuzmoCalendar.prototype, "isDateFocusIntent", 1);
653
+ if (!customElements.get("luzmo-calendar")) {
654
+ customElements.define("luzmo-calendar", LuzmoCalendar);
655
+ }
26
656
  export {
27
- u as LuzmoCalendar
657
+ LuzmoCalendar
28
658
  };