@vonage/vivid 3.50.1 → 3.52.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 (262) hide show
  1. package/alert/index.cjs +1 -1
  2. package/alert/index.js +1 -1
  3. package/appearance-ui/index.cjs +19 -11
  4. package/appearance-ui/index.js +19 -11
  5. package/audio-player/index.cjs +2 -1
  6. package/audio-player/index.js +2 -1
  7. package/card/index.cjs +1 -1
  8. package/card/index.js +1 -1
  9. package/combobox/index.cjs +2 -5
  10. package/combobox/index.js +2 -5
  11. package/custom-elements.json +1626 -613
  12. package/date-picker/index.cjs +3 -6
  13. package/date-picker/index.js +3 -6
  14. package/date-range-picker/index.cjs +2 -5
  15. package/date-range-picker/index.js +2 -5
  16. package/dialog/index.cjs +1 -1
  17. package/dialog/index.js +1 -1
  18. package/elevation/index.cjs +1 -1
  19. package/elevation/index.js +1 -1
  20. package/file-picker/index.cjs +0 -2
  21. package/file-picker/index.js +0 -2
  22. package/header/index.cjs +1 -1
  23. package/header/index.js +1 -1
  24. package/index.cjs +60 -58
  25. package/index.js +22 -23
  26. package/lib/avatar/definition.d.ts +1 -1
  27. package/lib/button/button.d.ts +8 -0
  28. package/lib/button/definition.d.ts +1 -1
  29. package/lib/calendar-event/definition.d.ts +1 -1
  30. package/lib/components.d.ts +1 -0
  31. package/lib/layout/definition.d.ts +1 -1
  32. package/lib/menu-item/menu-item.d.ts +3 -0
  33. package/lib/range-slider/definition.d.ts +3 -0
  34. package/lib/range-slider/locale.d.ts +4 -0
  35. package/lib/range-slider/range-slider.d.ts +32 -0
  36. package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
  37. package/lib/range-slider/range-slider.template.d.ts +4 -0
  38. package/lib/range-slider/utils/lerp.d.ts +2 -0
  39. package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
  40. package/lib/slider/slider.template.d.ts +1 -0
  41. package/lib/split-button/definition.d.ts +1 -1
  42. package/listbox/index.cjs +23 -22
  43. package/listbox/index.js +23 -22
  44. package/locales/en-GB.cjs +4 -0
  45. package/locales/en-GB.js +4 -0
  46. package/locales/en-US.cjs +4 -0
  47. package/locales/en-US.js +4 -0
  48. package/locales/ja-JP.cjs +5 -1
  49. package/locales/ja-JP.js +5 -1
  50. package/locales/zh-CN.cjs +4 -0
  51. package/locales/zh-CN.js +4 -0
  52. package/menu/index.cjs +3 -3
  53. package/menu/index.js +3 -3
  54. package/menu-item/index.cjs +2 -2
  55. package/menu-item/index.js +2 -2
  56. package/number-field/index.cjs +0 -2
  57. package/number-field/index.js +0 -2
  58. package/package.json +34 -34
  59. package/popup/index.cjs +2 -2
  60. package/popup/index.js +2 -2
  61. package/range-slider/index.cjs +22 -0
  62. package/range-slider/index.js +20 -0
  63. package/select/index.cjs +3 -3
  64. package/select/index.js +3 -3
  65. package/selectable-box/index.cjs +1 -1
  66. package/selectable-box/index.js +1 -1
  67. package/shared/Reflector.cjs +5 -1
  68. package/shared/Reflector.js +5 -1
  69. package/shared/affix.cjs +11 -4
  70. package/shared/affix.js +12 -4
  71. package/shared/anchored.cjs +26 -1
  72. package/shared/anchored.js +27 -3
  73. package/shared/definition.cjs +8 -3
  74. package/shared/definition.js +8 -3
  75. package/shared/definition10.cjs +5 -5
  76. package/shared/definition10.js +5 -5
  77. package/shared/definition11.cjs +129 -46
  78. package/shared/definition11.js +130 -47
  79. package/shared/definition12.cjs +12 -14
  80. package/shared/definition12.js +12 -14
  81. package/shared/definition13.cjs +118 -75
  82. package/shared/definition13.js +118 -75
  83. package/shared/definition14.cjs +33 -32
  84. package/shared/definition14.js +33 -32
  85. package/shared/definition15.cjs +20 -7
  86. package/shared/definition15.js +20 -7
  87. package/shared/definition16.cjs +37 -42
  88. package/shared/definition16.js +36 -41
  89. package/shared/definition17.cjs +125 -65
  90. package/shared/definition17.js +126 -66
  91. package/shared/definition18.cjs +30 -14
  92. package/shared/definition18.js +30 -14
  93. package/shared/definition19.cjs +116 -80
  94. package/shared/definition19.js +116 -80
  95. package/shared/definition2.cjs +10 -5
  96. package/shared/definition2.js +10 -5
  97. package/shared/definition20.cjs +16 -15
  98. package/shared/definition20.js +16 -15
  99. package/shared/definition21.cjs +6 -10
  100. package/shared/definition21.js +6 -10
  101. package/shared/definition22.cjs +14 -18
  102. package/shared/definition22.js +14 -18
  103. package/shared/definition23.cjs +34 -35
  104. package/shared/definition23.js +34 -35
  105. package/shared/definition24.cjs +116 -69
  106. package/shared/definition24.js +116 -69
  107. package/shared/definition25.cjs +2 -4
  108. package/shared/definition25.js +2 -4
  109. package/shared/definition26.cjs +9 -8
  110. package/shared/definition26.js +9 -8
  111. package/shared/definition27.cjs +7 -5
  112. package/shared/definition27.js +7 -5
  113. package/shared/definition28.cjs +209 -143
  114. package/shared/definition28.js +209 -143
  115. package/shared/definition29.cjs +13 -4
  116. package/shared/definition29.js +13 -4
  117. package/shared/definition3.cjs +7 -10
  118. package/shared/definition3.js +7 -10
  119. package/shared/definition30.cjs +7 -5
  120. package/shared/definition30.js +7 -5
  121. package/shared/definition31.cjs +2 -4
  122. package/shared/definition31.js +2 -4
  123. package/shared/definition32.cjs +1 -3
  124. package/shared/definition32.js +1 -3
  125. package/shared/definition33.cjs +7 -10
  126. package/shared/definition33.js +7 -10
  127. package/shared/definition34.cjs +76 -59
  128. package/shared/definition34.js +76 -59
  129. package/shared/definition35.cjs +19 -20
  130. package/shared/definition35.js +19 -20
  131. package/shared/definition36.cjs +30 -14
  132. package/shared/definition36.js +30 -14
  133. package/shared/definition37.cjs +33 -46
  134. package/shared/definition37.js +33 -46
  135. package/shared/definition38.cjs +31 -33
  136. package/shared/definition38.js +31 -33
  137. package/shared/definition39.cjs +13 -4
  138. package/shared/definition39.js +13 -4
  139. package/shared/definition4.cjs +23 -11
  140. package/shared/definition4.js +23 -11
  141. package/shared/definition40.cjs +19 -14
  142. package/shared/definition40.js +19 -14
  143. package/shared/definition41.cjs +534 -635
  144. package/shared/definition41.js +534 -635
  145. package/shared/definition42.cjs +674 -106
  146. package/shared/definition42.js +673 -105
  147. package/shared/definition43.cjs +122 -79
  148. package/shared/definition43.js +120 -77
  149. package/shared/definition44.cjs +72 -567
  150. package/shared/definition44.js +71 -565
  151. package/shared/definition45.cjs +520 -118
  152. package/shared/definition45.js +518 -117
  153. package/shared/definition46.cjs +117 -130
  154. package/shared/definition46.js +116 -129
  155. package/shared/definition47.cjs +152 -18
  156. package/shared/definition47.js +151 -17
  157. package/shared/definition48.cjs +20 -77
  158. package/shared/definition48.js +19 -76
  159. package/shared/definition49.cjs +52 -495
  160. package/shared/definition49.js +51 -494
  161. package/shared/definition5.cjs +20 -17
  162. package/shared/definition5.js +20 -17
  163. package/shared/definition50.cjs +525 -24
  164. package/shared/definition50.js +524 -23
  165. package/shared/definition51.cjs +28 -119
  166. package/shared/definition51.js +26 -118
  167. package/shared/definition52.cjs +113 -266
  168. package/shared/definition52.js +113 -265
  169. package/shared/definition53.cjs +285 -245
  170. package/shared/definition53.js +285 -245
  171. package/shared/definition54.cjs +285 -751
  172. package/shared/definition54.js +284 -750
  173. package/shared/definition55.cjs +828 -95
  174. package/shared/definition55.js +827 -94
  175. package/shared/definition56.cjs +127 -76
  176. package/shared/definition56.js +127 -76
  177. package/shared/definition57.cjs +125 -71
  178. package/shared/definition57.js +124 -70
  179. package/shared/definition58.cjs +73 -287
  180. package/shared/definition58.js +74 -288
  181. package/shared/definition59.cjs +298 -40
  182. package/shared/definition59.js +297 -39
  183. package/shared/definition6.cjs +3 -4
  184. package/shared/definition6.js +3 -4
  185. package/shared/definition60.cjs +24 -1784
  186. package/shared/definition60.js +23 -1783
  187. package/shared/definition61.cjs +1819 -11
  188. package/shared/definition61.js +1818 -11
  189. package/shared/definition7.cjs +7 -5
  190. package/shared/definition7.js +7 -5
  191. package/shared/definition8.cjs +25 -18
  192. package/shared/definition8.js +25 -18
  193. package/shared/definition9.cjs +6 -9
  194. package/shared/definition9.js +6 -9
  195. package/shared/icon.cjs +7 -2
  196. package/shared/icon.js +7 -2
  197. package/shared/index2.cjs +1 -1
  198. package/shared/index2.js +1 -1
  199. package/shared/key-codes2.cjs +8 -0
  200. package/shared/key-codes2.js +5 -1
  201. package/shared/localization/Locale.d.ts +2 -0
  202. package/shared/patterns/anchored.d.ts +4 -0
  203. package/shared/patterns/index.d.ts +0 -1
  204. package/shared/presentationDate.cjs +126 -78
  205. package/shared/presentationDate.js +126 -78
  206. package/shared/slider.template.cjs +71 -0
  207. package/shared/slider.template.js +67 -0
  208. package/shared/text-anchor.template.cjs +30 -35
  209. package/shared/text-anchor.template.js +30 -35
  210. package/shared/text-field.cjs +1 -1
  211. package/shared/text-field.js +1 -1
  212. package/side-drawer/index.cjs +1 -1
  213. package/side-drawer/index.js +1 -1
  214. package/slider/index.cjs +2 -1
  215. package/slider/index.js +2 -1
  216. package/split-button/index.cjs +1 -1
  217. package/split-button/index.js +1 -1
  218. package/styles/core/all.css +1 -1
  219. package/styles/core/theme.css +1 -1
  220. package/styles/core/typography.css +1 -1
  221. package/styles/fonts/spezia-variable.css +39 -13
  222. package/styles/tokens/theme-dark.css +4 -4
  223. package/styles/tokens/theme-light.css +4 -4
  224. package/styles/tokens/vivid-2-compat.css +4 -2
  225. package/switch/index.cjs +1 -1
  226. package/switch/index.js +1 -1
  227. package/tab/index.cjs +1 -1
  228. package/tab/index.js +1 -1
  229. package/tab-panel/index.cjs +1 -1
  230. package/tab-panel/index.js +1 -1
  231. package/tabs/index.cjs +3 -3
  232. package/tabs/index.js +3 -3
  233. package/tag/index.cjs +1 -1
  234. package/tag/index.js +1 -1
  235. package/tag-group/index.cjs +1 -1
  236. package/tag-group/index.js +1 -1
  237. package/text-area/index.cjs +1 -1
  238. package/text-area/index.js +1 -1
  239. package/text-field/index.cjs +1 -4
  240. package/text-field/index.js +1 -4
  241. package/time-picker/index.cjs +4 -7
  242. package/time-picker/index.js +4 -7
  243. package/toggletip/index.cjs +3 -3
  244. package/toggletip/index.js +3 -3
  245. package/tooltip/index.cjs +3 -3
  246. package/tooltip/index.js +3 -3
  247. package/tree-item/index.cjs +1 -1
  248. package/tree-item/index.js +1 -1
  249. package/tree-view/index.cjs +1 -1
  250. package/tree-view/index.js +1 -1
  251. package/vivid.api.json +117 -1
  252. package/focus/index.cjs +0 -7
  253. package/focus/index.js +0 -5
  254. package/lib/focus/definition.d.ts +0 -3
  255. package/lib/focus/focus.d.ts +0 -3
  256. package/lib/focus/focus.template.d.ts +0 -4
  257. package/lib/popup/popup.d.ts +0 -21
  258. package/shared/focus.cjs +0 -8
  259. package/shared/focus.js +0 -6
  260. package/shared/focus2.cjs +0 -11
  261. package/shared/focus2.js +0 -9
  262. package/shared/patterns/focus.d.ts +0 -3
@@ -507,7 +507,7 @@ _has._curry1(function isEmpty(x) {
507
507
 
508
508
  const isEmpty$1 = isEmpty;
509
509
 
510
- const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;background:var(--vvd-color-surface-2dp);border-radius:8px;counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:\"\"}@supports (inset: 0){[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{inset:0}}@supports not (inset: 0){[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{inset:0}}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content}@supports (inset: 0){.column-headers [role=columnheader i] h2>em{inset-inline-start:0}}@supports not (inset: 0){.column-headers [role=columnheader i] h2>em{left:0}}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}\n";
510
+ const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;border-radius:8px;background:var(--vvd-color-surface-2dp);counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:\"\";inset:0}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content;inset-inline-start:0}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}\n";
511
511
 
512
512
  const ARROW_UP = "ArrowUp";
513
513
  const ARROW_RIGHT = "ArrowRight";
@@ -540,9 +540,13 @@ function getHeaderDescendantGridCell(key, activeElement) {
540
540
  return;
541
541
  }
542
542
  const header = activeElement.closest('[role="columnheader"i]');
543
- const columnHeaders = this.shadowRoot.querySelectorAll('[role="columnheader"i]');
543
+ const columnHeaders = this.shadowRoot.querySelectorAll(
544
+ '[role="columnheader"i]'
545
+ );
544
546
  const i = Array.from(columnHeaders).indexOf(header);
545
- return this.shadowRoot.querySelector(`[role="gridcell"i]:nth-child(${i + 1})`);
547
+ return this.shadowRoot.querySelector(
548
+ `[role="gridcell"i]:nth-child(${i + 1})`
549
+ );
546
550
  }
547
551
 
548
552
  function getDay(el) {
@@ -555,7 +559,9 @@ function getDay(el) {
555
559
  }
556
560
  }
557
561
  function getHour(e, el, hours) {
558
- const rowHeaderOrCell = el.closest('[role="rowheader"], [role="gridcell"i]');
562
+ const rowHeaderOrCell = el.closest(
563
+ '[role="rowheader"], [role="gridcell"i]'
564
+ );
559
565
  if (rowHeaderOrCell) {
560
566
  const DOMRect = rowHeaderOrCell.getBoundingClientRect();
561
567
  const offsetY = e.clientY - DOMRect.y;
@@ -566,11 +572,15 @@ function getHour(e, el, hours) {
566
572
  }
567
573
  const getEventContext = function(e) {
568
574
  if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
569
- throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");
575
+ throw new Error(
576
+ "Invalid event. Event must be instance of KeyboardEvent or MouseEvent"
577
+ );
570
578
  }
571
579
  const [el] = e.composedPath();
572
580
  if (!(el && el instanceof HTMLElement && this.shadowRoot.contains(el))) {
573
- throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");
581
+ throw new Error(
582
+ "Invalid event. Event must contain a target object which is a direct descendant of calendar"
583
+ );
574
584
  }
575
585
  const day = getDay(el);
576
586
  let hour;
@@ -638,7 +648,9 @@ class Calendar extends index.FoundationElement {
638
648
  }
639
649
  getCalendarEventContainingCell(calendarEvent) {
640
650
  const slotName = calendarEvent.getAttribute("slot");
641
- const gridCell = this.shadowRoot.querySelector(`slot[name="${slotName}"i]`);
651
+ const gridCell = this.shadowRoot.querySelector(
652
+ `slot[name="${slotName}"i]`
653
+ );
642
654
  return gridCell.parentElement;
643
655
  }
644
656
  arrowKeysInteractions(key) {
@@ -647,11 +659,19 @@ class Calendar extends index.FoundationElement {
647
659
  if (isCellOrHeader(activeElement)) {
648
660
  focusNext = getNextFocusableGridElement.call(this, key, activeElement);
649
661
  } else if (this.#activeCalendarEvent) {
650
- focusNext = this.getCalendarEventContainingCell(this.#activeCalendarEvent);
662
+ focusNext = this.getCalendarEventContainingCell(
663
+ this.#activeCalendarEvent
664
+ );
651
665
  } else if (activeElement?.matches('em[role="button"i]')) {
652
- focusNext = getHeaderDescendantGridCell.call(this, key, activeElement);
666
+ focusNext = getHeaderDescendantGridCell.call(
667
+ this,
668
+ key,
669
+ activeElement
670
+ );
653
671
  } else {
654
- focusNext = this.shadowRoot.querySelector('[role="columnheader"i]');
672
+ focusNext = this.shadowRoot.querySelector(
673
+ '[role="columnheader"i]'
674
+ );
655
675
  }
656
676
  this.activateElement(focusNext);
657
677
  }
@@ -662,7 +682,9 @@ class Calendar extends index.FoundationElement {
662
682
  el?.focus();
663
683
  }
664
684
  onKeydown({ key }) {
665
- const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some((predefinedKey) => predefinedKey == key);
685
+ const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(
686
+ (predefinedKey) => predefinedKey == key
687
+ );
666
688
  if (isArrow) {
667
689
  this.arrowKeysInteractions(key);
668
690
  }
@@ -684,7 +706,9 @@ __decorateClass([
684
706
 
685
707
  function getValidDateString(date) {
686
708
  const twoDigit = (num) => `0${num}`.slice(-2);
687
- return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(date.getDate())}`;
709
+ return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(
710
+ date.getDate()
711
+ )}`;
688
712
  }
689
713
  const weekdaysMap = /* @__PURE__ */ new Map([
690
714
  ["sunday", 0],
@@ -699,78 +723,97 @@ function getFirstDateOfTheWeek(date = /* @__PURE__ */ new Date(), startDay) {
699
723
  }
700
724
 
701
725
  const HoursTemplate = () => {
702
- return index.html`
703
- <div class="row-headers" role="row">
704
- ${repeat.repeat((x) => x.hoursAsDatetime, index.html`<span role="rowheader">
705
- <time datetime="${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
706
- hour: "numeric",
707
- minute: "numeric",
708
- hour12: false
709
- }).format(x)}">
710
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
711
- hour: "numeric",
712
- hour12: c.parent.hour12
713
- }).format(x)}
714
- </time>
715
- </span>`)}
716
- </div>`;
726
+ return index.html` <div class="row-headers" role="row">
727
+ ${repeat.repeat(
728
+ (x) => x.hoursAsDatetime,
729
+ index.html`<span role="rowheader">
730
+ <time
731
+ datetime="${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
732
+ hour: "numeric",
733
+ minute: "numeric",
734
+ hour12: false
735
+ }).format(x)}"
736
+ >
737
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
738
+ hour: "numeric",
739
+ hour12: c.parent.hour12
740
+ }).format(x)}
741
+ </time>
742
+ </span>`
743
+ )}
744
+ </div>`;
717
745
  };
718
746
  const DaysTemplate = () => {
719
- return index.html`
720
- <div class="column-headers" role="row">
721
- ${repeat.repeat((x) => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]), index.html`
722
- <div role="columnheader" tabindex="-1">
723
- <time datetime=${(x) => getValidDateString(x)}>
724
- <h2>
725
- <!-- TODO add to column aria-labelledby or describedby to count
747
+ return index.html` <div class="column-headers" role="row">
748
+ ${repeat.repeat(
749
+ (x) => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]),
750
+ index.html` <div role="columnheader" tabindex="-1">
751
+ <time datetime=${(x) => getValidDateString(x)}>
752
+ <h2>
753
+ <!-- TODO add to column aria-labelledby or describedby to count
726
754
  events and related day e.g. "3 events, Sunday, March 8" -->
727
- <em tabindex="0" role="button" aria-label=${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
728
- weekday: "long",
729
- month: "long",
730
- day: "2-digit"
731
- }).format(x)}>
732
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, { day: "2-digit" }).format(x)}
733
- </em>
734
- <small aria-hidden="true">
735
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, { weekday: "short" }).format(x)}
736
- </small>
737
- </h2>
738
- </time>
739
- </div>`)}
740
- </div>`;
755
+ <em
756
+ tabindex="0"
757
+ role="button"
758
+ aria-label=${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
759
+ weekday: "long",
760
+ month: "long",
761
+ day: "2-digit"
762
+ }).format(x)}
763
+ >
764
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
765
+ day: "2-digit"
766
+ }).format(x)}
767
+ </em>
768
+ <small aria-hidden="true">
769
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
770
+ weekday: "short"
771
+ }).format(x)}
772
+ </small>
773
+ </h2>
774
+ </time>
775
+ </div>`
776
+ )}
777
+ </div>`;
741
778
  };
742
779
  const ColumnTemplate = index.html`
743
- <div role="gridcell" tabindex="-1">
744
- <slot name="day-${(_, c) => c.index}"></slot>
745
- </div>
746
- `;
780
+ <div role="gridcell" tabindex="-1">
781
+ <slot name="day-${(_, c) => c.index}"></slot>
782
+ </div>
783
+ `;
747
784
  const CalendarTemplate = () => index.html`
748
- <div role="grid" @keydown=${(x, c) => x.onKeydown(c.event)}>
749
- ${DaysTemplate}
750
- <div class="calendar-row" role="rowgroup">
751
- ${HoursTemplate}
752
- <div class="calendar-grid-presentation" role="presentation">
753
- <div class="hours" role="list">
754
- ${repeat.repeat((x) => Array.from({ length: x.hoursAsDatetime.length + 1 }), index.html`
755
- <div role="listitem"></div>`)}
756
- </div>
757
- <div class="columns" role="row">
758
- ${repeat.repeat((x) => Array.from(Array(x._days)), ColumnTemplate, { positioning: true })}
759
- </div>
760
- <slot></slot>
761
- </div>
762
- </div>
763
- </div>
785
+ <div role="grid" @keydown=${(x, c) => x.onKeydown(c.event)}>
786
+ ${DaysTemplate}
787
+ <div class="calendar-row" role="rowgroup">
788
+ ${HoursTemplate}
789
+ <div class="calendar-grid-presentation" role="presentation">
790
+ <div class="hours" role="list">
791
+ ${repeat.repeat(
792
+ (x) => Array.from({ length: x.hoursAsDatetime.length + 1 }),
793
+ index.html` <div role="listitem"></div>`
794
+ )}
795
+ </div>
796
+ <div class="columns" role="row">
797
+ ${repeat.repeat((x) => Array.from(Array(x._days)), ColumnTemplate, {
798
+ positioning: true
799
+ })}
800
+ </div>
801
+ <slot></slot>
802
+ </div>
803
+ </div>
804
+ </div>
764
805
  `;
765
806
 
766
- const calendarDefinition = Calendar.compose({
767
- baseName: "calendar",
768
- template: CalendarTemplate,
769
- styles,
770
- shadowOptions: {
771
- delegatesFocus: true
807
+ const calendarDefinition = Calendar.compose(
808
+ {
809
+ baseName: "calendar",
810
+ template: CalendarTemplate,
811
+ styles,
812
+ shadowOptions: {
813
+ delegatesFocus: true
814
+ }
772
815
  }
773
- });
816
+ );
774
817
  const calendarRegistries = [calendarDefinition()];
775
818
  const registerCalendar = index.registerFactory(calendarRegistries);
776
819
 
@@ -505,7 +505,7 @@ _curry1(function isEmpty(x) {
505
505
 
506
506
  const isEmpty$1 = isEmpty;
507
507
 
508
- const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;background:var(--vvd-color-surface-2dp);border-radius:8px;counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:\"\"}@supports (inset: 0){[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{inset:0}}@supports not (inset: 0){[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{inset:0}}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content}@supports (inset: 0){.column-headers [role=columnheader i] h2>em{inset-inline-start:0}}@supports not (inset: 0){.column-headers [role=columnheader i] h2>em{left:0}}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}\n";
508
+ const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;border-radius:8px;background:var(--vvd-color-surface-2dp);counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:\"\";inset:0}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content;inset-inline-start:0}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}\n";
509
509
 
510
510
  const ARROW_UP = "ArrowUp";
511
511
  const ARROW_RIGHT = "ArrowRight";
@@ -538,9 +538,13 @@ function getHeaderDescendantGridCell(key, activeElement) {
538
538
  return;
539
539
  }
540
540
  const header = activeElement.closest('[role="columnheader"i]');
541
- const columnHeaders = this.shadowRoot.querySelectorAll('[role="columnheader"i]');
541
+ const columnHeaders = this.shadowRoot.querySelectorAll(
542
+ '[role="columnheader"i]'
543
+ );
542
544
  const i = Array.from(columnHeaders).indexOf(header);
543
- return this.shadowRoot.querySelector(`[role="gridcell"i]:nth-child(${i + 1})`);
545
+ return this.shadowRoot.querySelector(
546
+ `[role="gridcell"i]:nth-child(${i + 1})`
547
+ );
544
548
  }
545
549
 
546
550
  function getDay(el) {
@@ -553,7 +557,9 @@ function getDay(el) {
553
557
  }
554
558
  }
555
559
  function getHour(e, el, hours) {
556
- const rowHeaderOrCell = el.closest('[role="rowheader"], [role="gridcell"i]');
560
+ const rowHeaderOrCell = el.closest(
561
+ '[role="rowheader"], [role="gridcell"i]'
562
+ );
557
563
  if (rowHeaderOrCell) {
558
564
  const DOMRect = rowHeaderOrCell.getBoundingClientRect();
559
565
  const offsetY = e.clientY - DOMRect.y;
@@ -564,11 +570,15 @@ function getHour(e, el, hours) {
564
570
  }
565
571
  const getEventContext = function(e) {
566
572
  if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
567
- throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");
573
+ throw new Error(
574
+ "Invalid event. Event must be instance of KeyboardEvent or MouseEvent"
575
+ );
568
576
  }
569
577
  const [el] = e.composedPath();
570
578
  if (!(el && el instanceof HTMLElement && this.shadowRoot.contains(el))) {
571
- throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");
579
+ throw new Error(
580
+ "Invalid event. Event must contain a target object which is a direct descendant of calendar"
581
+ );
572
582
  }
573
583
  const day = getDay(el);
574
584
  let hour;
@@ -636,7 +646,9 @@ class Calendar extends FoundationElement {
636
646
  }
637
647
  getCalendarEventContainingCell(calendarEvent) {
638
648
  const slotName = calendarEvent.getAttribute("slot");
639
- const gridCell = this.shadowRoot.querySelector(`slot[name="${slotName}"i]`);
649
+ const gridCell = this.shadowRoot.querySelector(
650
+ `slot[name="${slotName}"i]`
651
+ );
640
652
  return gridCell.parentElement;
641
653
  }
642
654
  arrowKeysInteractions(key) {
@@ -645,11 +657,19 @@ class Calendar extends FoundationElement {
645
657
  if (isCellOrHeader(activeElement)) {
646
658
  focusNext = getNextFocusableGridElement.call(this, key, activeElement);
647
659
  } else if (this.#activeCalendarEvent) {
648
- focusNext = this.getCalendarEventContainingCell(this.#activeCalendarEvent);
660
+ focusNext = this.getCalendarEventContainingCell(
661
+ this.#activeCalendarEvent
662
+ );
649
663
  } else if (activeElement?.matches('em[role="button"i]')) {
650
- focusNext = getHeaderDescendantGridCell.call(this, key, activeElement);
664
+ focusNext = getHeaderDescendantGridCell.call(
665
+ this,
666
+ key,
667
+ activeElement
668
+ );
651
669
  } else {
652
- focusNext = this.shadowRoot.querySelector('[role="columnheader"i]');
670
+ focusNext = this.shadowRoot.querySelector(
671
+ '[role="columnheader"i]'
672
+ );
653
673
  }
654
674
  this.activateElement(focusNext);
655
675
  }
@@ -660,7 +680,9 @@ class Calendar extends FoundationElement {
660
680
  el?.focus();
661
681
  }
662
682
  onKeydown({ key }) {
663
- const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some((predefinedKey) => predefinedKey == key);
683
+ const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(
684
+ (predefinedKey) => predefinedKey == key
685
+ );
664
686
  if (isArrow) {
665
687
  this.arrowKeysInteractions(key);
666
688
  }
@@ -682,7 +704,9 @@ __decorateClass([
682
704
 
683
705
  function getValidDateString(date) {
684
706
  const twoDigit = (num) => `0${num}`.slice(-2);
685
- return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(date.getDate())}`;
707
+ return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(
708
+ date.getDate()
709
+ )}`;
686
710
  }
687
711
  const weekdaysMap = /* @__PURE__ */ new Map([
688
712
  ["sunday", 0],
@@ -697,78 +721,97 @@ function getFirstDateOfTheWeek(date = /* @__PURE__ */ new Date(), startDay) {
697
721
  }
698
722
 
699
723
  const HoursTemplate = () => {
700
- return html`
701
- <div class="row-headers" role="row">
702
- ${repeat((x) => x.hoursAsDatetime, html`<span role="rowheader">
703
- <time datetime="${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
704
- hour: "numeric",
705
- minute: "numeric",
706
- hour12: false
707
- }).format(x)}">
708
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
709
- hour: "numeric",
710
- hour12: c.parent.hour12
711
- }).format(x)}
712
- </time>
713
- </span>`)}
714
- </div>`;
724
+ return html` <div class="row-headers" role="row">
725
+ ${repeat(
726
+ (x) => x.hoursAsDatetime,
727
+ html`<span role="rowheader">
728
+ <time
729
+ datetime="${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
730
+ hour: "numeric",
731
+ minute: "numeric",
732
+ hour12: false
733
+ }).format(x)}"
734
+ >
735
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
736
+ hour: "numeric",
737
+ hour12: c.parent.hour12
738
+ }).format(x)}
739
+ </time>
740
+ </span>`
741
+ )}
742
+ </div>`;
715
743
  };
716
744
  const DaysTemplate = () => {
717
- return html`
718
- <div class="column-headers" role="row">
719
- ${repeat((x) => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]), html`
720
- <div role="columnheader" tabindex="-1">
721
- <time datetime=${(x) => getValidDateString(x)}>
722
- <h2>
723
- <!-- TODO add to column aria-labelledby or describedby to count
745
+ return html` <div class="column-headers" role="row">
746
+ ${repeat(
747
+ (x) => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]),
748
+ html` <div role="columnheader" tabindex="-1">
749
+ <time datetime=${(x) => getValidDateString(x)}>
750
+ <h2>
751
+ <!-- TODO add to column aria-labelledby or describedby to count
724
752
  events and related day e.g. "3 events, Sunday, March 8" -->
725
- <em tabindex="0" role="button" aria-label=${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
726
- weekday: "long",
727
- month: "long",
728
- day: "2-digit"
729
- }).format(x)}>
730
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, { day: "2-digit" }).format(x)}
731
- </em>
732
- <small aria-hidden="true">
733
- ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, { weekday: "short" }).format(x)}
734
- </small>
735
- </h2>
736
- </time>
737
- </div>`)}
738
- </div>`;
753
+ <em
754
+ tabindex="0"
755
+ role="button"
756
+ aria-label=${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
757
+ weekday: "long",
758
+ month: "long",
759
+ day: "2-digit"
760
+ }).format(x)}
761
+ >
762
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
763
+ day: "2-digit"
764
+ }).format(x)}
765
+ </em>
766
+ <small aria-hidden="true">
767
+ ${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
768
+ weekday: "short"
769
+ }).format(x)}
770
+ </small>
771
+ </h2>
772
+ </time>
773
+ </div>`
774
+ )}
775
+ </div>`;
739
776
  };
740
777
  const ColumnTemplate = html`
741
- <div role="gridcell" tabindex="-1">
742
- <slot name="day-${(_, c) => c.index}"></slot>
743
- </div>
744
- `;
778
+ <div role="gridcell" tabindex="-1">
779
+ <slot name="day-${(_, c) => c.index}"></slot>
780
+ </div>
781
+ `;
745
782
  const CalendarTemplate = () => html`
746
- <div role="grid" @keydown=${(x, c) => x.onKeydown(c.event)}>
747
- ${DaysTemplate}
748
- <div class="calendar-row" role="rowgroup">
749
- ${HoursTemplate}
750
- <div class="calendar-grid-presentation" role="presentation">
751
- <div class="hours" role="list">
752
- ${repeat((x) => Array.from({ length: x.hoursAsDatetime.length + 1 }), html`
753
- <div role="listitem"></div>`)}
754
- </div>
755
- <div class="columns" role="row">
756
- ${repeat((x) => Array.from(Array(x._days)), ColumnTemplate, { positioning: true })}
757
- </div>
758
- <slot></slot>
759
- </div>
760
- </div>
761
- </div>
783
+ <div role="grid" @keydown=${(x, c) => x.onKeydown(c.event)}>
784
+ ${DaysTemplate}
785
+ <div class="calendar-row" role="rowgroup">
786
+ ${HoursTemplate}
787
+ <div class="calendar-grid-presentation" role="presentation">
788
+ <div class="hours" role="list">
789
+ ${repeat(
790
+ (x) => Array.from({ length: x.hoursAsDatetime.length + 1 }),
791
+ html` <div role="listitem"></div>`
792
+ )}
793
+ </div>
794
+ <div class="columns" role="row">
795
+ ${repeat((x) => Array.from(Array(x._days)), ColumnTemplate, {
796
+ positioning: true
797
+ })}
798
+ </div>
799
+ <slot></slot>
800
+ </div>
801
+ </div>
802
+ </div>
762
803
  `;
763
804
 
764
- const calendarDefinition = Calendar.compose({
765
- baseName: "calendar",
766
- template: CalendarTemplate,
767
- styles,
768
- shadowOptions: {
769
- delegatesFocus: true
805
+ const calendarDefinition = Calendar.compose(
806
+ {
807
+ baseName: "calendar",
808
+ template: CalendarTemplate,
809
+ styles,
810
+ shadowOptions: {
811
+ delegatesFocus: true
812
+ }
770
813
  }
771
- });
814
+ );
772
815
  const calendarRegistries = [calendarDefinition()];
773
816
  const registerCalendar = registerFactory(calendarRegistries);
774
817