@react-x11/components 0.1.0 → 0.2.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 (783) hide show
  1. package/README.md +979 -21
  2. package/dist/ansi/cast.d.ts +48 -0
  3. package/dist/ansi/cast.d.ts.map +1 -0
  4. package/dist/ansi/cast.js +135 -0
  5. package/dist/ansi/cast.js.map +1 -0
  6. package/dist/ansi/index.d.ts +10 -0
  7. package/dist/ansi/index.d.ts.map +1 -0
  8. package/dist/ansi/index.js +27 -0
  9. package/dist/ansi/index.js.map +1 -0
  10. package/dist/ansi/palette.d.ts +79 -0
  11. package/dist/ansi/palette.d.ts.map +1 -0
  12. package/dist/ansi/palette.js +155 -0
  13. package/dist/ansi/palette.js.map +1 -0
  14. package/dist/ansi/parse.d.ts +114 -0
  15. package/dist/ansi/parse.d.ts.map +1 -0
  16. package/dist/ansi/parse.js +687 -0
  17. package/dist/ansi/parse.js.map +1 -0
  18. package/dist/ansi/sgr.d.ts +87 -0
  19. package/dist/ansi/sgr.d.ts.map +1 -0
  20. package/dist/ansi/sgr.js +302 -0
  21. package/dist/ansi/sgr.js.map +1 -0
  22. package/dist/ansi/utf8.d.ts +15 -0
  23. package/dist/ansi/utf8.d.ts.map +1 -0
  24. package/dist/ansi/utf8.js +82 -0
  25. package/dist/ansi/utf8.js.map +1 -0
  26. package/dist/calendar/Calendar.d.ts +136 -0
  27. package/dist/calendar/Calendar.d.ts.map +1 -0
  28. package/dist/calendar/Calendar.js +460 -0
  29. package/dist/calendar/Calendar.js.map +1 -0
  30. package/dist/calendar/DatePicker.d.ts +52 -0
  31. package/dist/calendar/DatePicker.d.ts.map +1 -0
  32. package/dist/calendar/DatePicker.js +257 -0
  33. package/dist/calendar/DatePicker.js.map +1 -0
  34. package/dist/calendar/dates.d.ts +90 -0
  35. package/dist/calendar/dates.d.ts.map +1 -0
  36. package/dist/calendar/dates.js +236 -0
  37. package/dist/calendar/dates.js.map +1 -0
  38. package/dist/calendar/index.d.ts +8 -0
  39. package/dist/calendar/index.d.ts.map +1 -0
  40. package/dist/calendar/index.js +15 -0
  41. package/dist/calendar/index.js.map +1 -0
  42. package/dist/charts/components.d.ts +141 -0
  43. package/dist/charts/components.d.ts.map +1 -0
  44. package/dist/charts/components.js +580 -0
  45. package/dist/charts/components.js.map +1 -0
  46. package/dist/charts/data.d.ts +198 -0
  47. package/dist/charts/data.d.ts.map +1 -0
  48. package/dist/charts/data.js +616 -0
  49. package/dist/charts/data.js.map +1 -0
  50. package/dist/charts/hx.d.ts +21 -0
  51. package/dist/charts/hx.d.ts.map +1 -0
  52. package/dist/charts/hx.js +15 -0
  53. package/dist/charts/hx.js.map +1 -0
  54. package/dist/charts/index.d.ts +27 -0
  55. package/dist/charts/index.d.ts.map +1 -0
  56. package/dist/charts/index.js +38 -0
  57. package/dist/charts/index.js.map +1 -0
  58. package/dist/charts/node.d.ts +96 -0
  59. package/dist/charts/node.d.ts.map +1 -0
  60. package/dist/charts/node.js +720 -0
  61. package/dist/charts/node.js.map +1 -0
  62. package/dist/charts/render.d.ts +153 -0
  63. package/dist/charts/render.d.ts.map +1 -0
  64. package/dist/charts/render.js +762 -0
  65. package/dist/charts/render.js.map +1 -0
  66. package/dist/charts/scale.d.ts +42 -0
  67. package/dist/charts/scale.d.ts.map +1 -0
  68. package/dist/charts/scale.js +173 -0
  69. package/dist/charts/scale.js.map +1 -0
  70. package/dist/charts/spec.d.ts +91 -0
  71. package/dist/charts/spec.d.ts.map +1 -0
  72. package/dist/charts/spec.js +33 -0
  73. package/dist/charts/spec.js.map +1 -0
  74. package/dist/charts/timers.d.ts +6 -0
  75. package/dist/charts/timers.d.ts.map +1 -0
  76. package/dist/charts/timers.js +14 -0
  77. package/dist/charts/timers.js.map +1 -0
  78. package/dist/code/hx.d.ts +24 -0
  79. package/dist/code/hx.d.ts.map +1 -0
  80. package/dist/code/hx.js +25 -0
  81. package/dist/code/hx.js.map +1 -0
  82. package/dist/code/index.d.ts +45 -0
  83. package/dist/code/index.d.ts.map +1 -0
  84. package/dist/code/index.js +93 -0
  85. package/dist/code/index.js.map +1 -0
  86. package/dist/code-editor/completion.d.ts +26 -0
  87. package/dist/code-editor/completion.d.ts.map +1 -0
  88. package/dist/code-editor/completion.js +129 -0
  89. package/dist/code-editor/completion.js.map +1 -0
  90. package/dist/code-editor/doc.d.ts +35 -0
  91. package/dist/code-editor/doc.d.ts.map +1 -0
  92. package/dist/code-editor/doc.js +162 -0
  93. package/dist/code-editor/doc.js.map +1 -0
  94. package/dist/code-editor/hx.d.ts +13 -0
  95. package/dist/code-editor/hx.d.ts.map +1 -0
  96. package/dist/code-editor/hx.js +10 -0
  97. package/dist/code-editor/hx.js.map +1 -0
  98. package/dist/code-editor/index.d.ts +88 -0
  99. package/dist/code-editor/index.d.ts.map +1 -0
  100. package/dist/code-editor/index.js +401 -0
  101. package/dist/code-editor/index.js.map +1 -0
  102. package/dist/code-editor/node.d.ts +343 -0
  103. package/dist/code-editor/node.d.ts.map +1 -0
  104. package/dist/code-editor/node.js +1521 -0
  105. package/dist/code-editor/node.js.map +1 -0
  106. package/dist/code-language/hljs.d.ts +47 -0
  107. package/dist/code-language/hljs.d.ts.map +1 -0
  108. package/dist/code-language/hljs.js +211 -0
  109. package/dist/code-language/hljs.js.map +1 -0
  110. package/dist/code-language/index.d.ts +22 -0
  111. package/dist/code-language/index.d.ts.map +1 -0
  112. package/dist/code-language/index.js +20 -0
  113. package/dist/code-language/index.js.map +1 -0
  114. package/dist/code-language/languages/glsl.d.ts +4 -0
  115. package/dist/code-language/languages/glsl.d.ts.map +1 -0
  116. package/dist/code-language/languages/glsl.js +99 -0
  117. package/dist/code-language/languages/glsl.js.map +1 -0
  118. package/dist/code-language/languages/javascript.d.ts +10 -0
  119. package/dist/code-language/languages/javascript.d.ts.map +1 -0
  120. package/dist/code-language/languages/javascript.js +360 -0
  121. package/dist/code-language/languages/javascript.js.map +1 -0
  122. package/dist/code-language/languages/json.d.ts +4 -0
  123. package/dist/code-language/languages/json.d.ts.map +1 -0
  124. package/dist/code-language/languages/json.js +68 -0
  125. package/dist/code-language/languages/json.js.map +1 -0
  126. package/dist/code-language/languages/shell.d.ts +4 -0
  127. package/dist/code-language/languages/shell.d.ts.map +1 -0
  128. package/dist/code-language/languages/shell.js +189 -0
  129. package/dist/code-language/languages/shell.js.map +1 -0
  130. package/dist/code-language/languages/sql.d.ts +11 -0
  131. package/dist/code-language/languages/sql.d.ts.map +1 -0
  132. package/dist/code-language/languages/sql.js +133 -0
  133. package/dist/code-language/languages/sql.js.map +1 -0
  134. package/dist/code-language/lezer.d.ts +24 -0
  135. package/dist/code-language/lezer.d.ts.map +1 -0
  136. package/dist/code-language/lezer.js +148 -0
  137. package/dist/code-language/lezer.js.map +1 -0
  138. package/dist/code-language/registry.d.ts +19 -0
  139. package/dist/code-language/registry.d.ts.map +1 -0
  140. package/dist/code-language/registry.js +56 -0
  141. package/dist/code-language/registry.js.map +1 -0
  142. package/dist/code-language/runs.d.ts +35 -0
  143. package/dist/code-language/runs.d.ts.map +1 -0
  144. package/dist/code-language/runs.js +88 -0
  145. package/dist/code-language/runs.js.map +1 -0
  146. package/dist/code-language/stream.d.ts +70 -0
  147. package/dist/code-language/stream.d.ts.map +1 -0
  148. package/dist/code-language/stream.js +243 -0
  149. package/dist/code-language/stream.js.map +1 -0
  150. package/dist/code-language/textmate.d.ts +27 -0
  151. package/dist/code-language/textmate.d.ts.map +1 -0
  152. package/dist/code-language/textmate.js +86 -0
  153. package/dist/code-language/textmate.js.map +1 -0
  154. package/dist/code-language/theme.d.ts +26 -0
  155. package/dist/code-language/theme.d.ts.map +1 -0
  156. package/dist/code-language/theme.js +108 -0
  157. package/dist/code-language/theme.js.map +1 -0
  158. package/dist/code-language/timers.d.ts +7 -0
  159. package/dist/code-language/timers.d.ts.map +1 -0
  160. package/dist/code-language/timers.js +22 -0
  161. package/dist/code-language/timers.js.map +1 -0
  162. package/dist/code-language/types.d.ts +173 -0
  163. package/dist/code-language/types.d.ts.map +1 -0
  164. package/dist/code-language/types.js +41 -0
  165. package/dist/code-language/types.js.map +1 -0
  166. package/dist/codeblock/index.d.ts +69 -0
  167. package/dist/codeblock/index.d.ts.map +1 -0
  168. package/dist/codeblock/index.js +85 -0
  169. package/dist/codeblock/index.js.map +1 -0
  170. package/dist/color-picker/ColorField.d.ts +39 -0
  171. package/dist/color-picker/ColorField.d.ts.map +1 -0
  172. package/dist/color-picker/ColorField.js +239 -0
  173. package/dist/color-picker/ColorField.js.map +1 -0
  174. package/dist/color-picker/ColorPicker.d.ts +109 -0
  175. package/dist/color-picker/ColorPicker.d.ts.map +1 -0
  176. package/dist/color-picker/ColorPicker.js +757 -0
  177. package/dist/color-picker/ColorPicker.js.map +1 -0
  178. package/dist/color-picker/color.d.ts +105 -0
  179. package/dist/color-picker/color.d.ts.map +1 -0
  180. package/dist/color-picker/color.js +313 -0
  181. package/dist/color-picker/color.js.map +1 -0
  182. package/dist/color-picker/index.d.ts +8 -0
  183. package/dist/color-picker/index.d.ts.map +1 -0
  184. package/dist/color-picker/index.js +19 -0
  185. package/dist/color-picker/index.js.map +1 -0
  186. package/dist/desktop-calendar/eds.d.ts +102 -0
  187. package/dist/desktop-calendar/eds.d.ts.map +1 -0
  188. package/dist/desktop-calendar/eds.js +356 -0
  189. package/dist/desktop-calendar/eds.js.map +1 -0
  190. package/dist/desktop-calendar/ical.d.ts +63 -0
  191. package/dist/desktop-calendar/ical.d.ts.map +1 -0
  192. package/dist/desktop-calendar/ical.js +57 -0
  193. package/dist/desktop-calendar/ical.js.map +1 -0
  194. package/dist/desktop-calendar/index.d.ts +72 -0
  195. package/dist/desktop-calendar/index.d.ts.map +1 -0
  196. package/dist/desktop-calendar/index.js +213 -0
  197. package/dist/desktop-calendar/index.js.map +1 -0
  198. package/dist/embed/client.d.ts +121 -0
  199. package/dist/embed/client.d.ts.map +1 -0
  200. package/dist/embed/client.js +203 -0
  201. package/dist/embed/client.js.map +1 -0
  202. package/dist/embed/host.d.ts +96 -0
  203. package/dist/embed/host.d.ts.map +1 -0
  204. package/dist/embed/host.js +266 -0
  205. package/dist/embed/host.js.map +1 -0
  206. package/dist/embed/index.d.ts +5 -0
  207. package/dist/embed/index.d.ts.map +1 -0
  208. package/dist/embed/index.js +13 -0
  209. package/dist/embed/index.js.map +1 -0
  210. package/dist/embed/timers.d.ts +6 -0
  211. package/dist/embed/timers.d.ts.map +1 -0
  212. package/dist/embed/timers.js +16 -0
  213. package/dist/embed/timers.js.map +1 -0
  214. package/dist/flow/draw.d.ts +45 -0
  215. package/dist/flow/draw.d.ts.map +1 -0
  216. package/dist/flow/draw.js +295 -0
  217. package/dist/flow/draw.js.map +1 -0
  218. package/dist/flow/index.d.ts +64 -0
  219. package/dist/flow/index.d.ts.map +1 -0
  220. package/dist/flow/index.js +306 -0
  221. package/dist/flow/index.js.map +1 -0
  222. package/dist/flow/model.d.ts +158 -0
  223. package/dist/flow/model.d.ts.map +1 -0
  224. package/dist/flow/model.js +566 -0
  225. package/dist/flow/model.js.map +1 -0
  226. package/dist/flow/node.d.ts +429 -0
  227. package/dist/flow/node.d.ts.map +1 -0
  228. package/dist/flow/node.js +3025 -0
  229. package/dist/flow/node.js.map +1 -0
  230. package/dist/flow/paths.d.ts +43 -0
  231. package/dist/flow/paths.d.ts.map +1 -0
  232. package/dist/flow/paths.js +327 -0
  233. package/dist/flow/paths.js.map +1 -0
  234. package/dist/flow/types.d.ts +561 -0
  235. package/dist/flow/types.d.ts.map +1 -0
  236. package/dist/flow/types.js +2 -0
  237. package/dist/flow/types.js.map +1 -0
  238. package/dist/formula/hx.d.ts +24 -0
  239. package/dist/formula/hx.d.ts.map +1 -0
  240. package/dist/formula/hx.js +25 -0
  241. package/dist/formula/hx.js.map +1 -0
  242. package/dist/formula/index.d.ts +74 -0
  243. package/dist/formula/index.d.ts.map +1 -0
  244. package/dist/formula/index.js +155 -0
  245. package/dist/formula/index.js.map +1 -0
  246. package/dist/formula/katex.d.ts +78 -0
  247. package/dist/formula/katex.d.ts.map +1 -0
  248. package/dist/formula/katex.js +130 -0
  249. package/dist/formula/katex.js.map +1 -0
  250. package/dist/formula/layout.d.ts +103 -0
  251. package/dist/formula/layout.d.ts.map +1 -0
  252. package/dist/formula/layout.js +716 -0
  253. package/dist/formula/layout.js.map +1 -0
  254. package/dist/formula/node.d.ts +50 -0
  255. package/dist/formula/node.d.ts.map +1 -0
  256. package/dist/formula/node.js +351 -0
  257. package/dist/formula/node.js.map +1 -0
  258. package/dist/html/controls.d.ts +48 -0
  259. package/dist/html/controls.d.ts.map +1 -0
  260. package/dist/html/controls.js +195 -0
  261. package/dist/html/controls.js.map +1 -0
  262. package/dist/html/css/cascade.d.ts +51 -0
  263. package/dist/html/css/cascade.d.ts.map +1 -0
  264. package/dist/html/css/cascade.js +552 -0
  265. package/dist/html/css/cascade.js.map +1 -0
  266. package/dist/html/css/parse.d.ts +74 -0
  267. package/dist/html/css/parse.d.ts.map +1 -0
  268. package/dist/html/css/parse.js +464 -0
  269. package/dist/html/css/parse.js.map +1 -0
  270. package/dist/html/css/style.d.ts +142 -0
  271. package/dist/html/css/style.d.ts.map +1 -0
  272. package/dist/html/css/style.js +1145 -0
  273. package/dist/html/css/style.js.map +1 -0
  274. package/dist/html/css/ua.d.ts +5 -0
  275. package/dist/html/css/ua.d.ts.map +1 -0
  276. package/dist/html/css/ua.js +171 -0
  277. package/dist/html/css/ua.js.map +1 -0
  278. package/dist/html/css/values.d.ts +78 -0
  279. package/dist/html/css/values.d.ts.map +1 -0
  280. package/dist/html/css/values.js +330 -0
  281. package/dist/html/css/values.js.map +1 -0
  282. package/dist/html/dom.d.ts +112 -0
  283. package/dist/html/dom.d.ts.map +1 -0
  284. package/dist/html/dom.js +374 -0
  285. package/dist/html/dom.js.map +1 -0
  286. package/dist/html/hx.d.ts +24 -0
  287. package/dist/html/hx.d.ts.map +1 -0
  288. package/dist/html/hx.js +29 -0
  289. package/dist/html/hx.js.map +1 -0
  290. package/dist/html/index.d.ts +137 -0
  291. package/dist/html/index.d.ts.map +1 -0
  292. package/dist/html/index.js +339 -0
  293. package/dist/html/index.js.map +1 -0
  294. package/dist/html/layout/block.d.ts +58 -0
  295. package/dist/html/layout/block.d.ts.map +1 -0
  296. package/dist/html/layout/block.js +724 -0
  297. package/dist/html/layout/block.js.map +1 -0
  298. package/dist/html/layout/boxes.d.ts +261 -0
  299. package/dist/html/layout/boxes.d.ts.map +1 -0
  300. package/dist/html/layout/boxes.js +725 -0
  301. package/dist/html/layout/boxes.js.map +1 -0
  302. package/dist/html/layout/flex.d.ts +16 -0
  303. package/dist/html/layout/flex.d.ts.map +1 -0
  304. package/dist/html/layout/flex.js +242 -0
  305. package/dist/html/layout/flex.js.map +1 -0
  306. package/dist/html/layout/floats.d.ts +50 -0
  307. package/dist/html/layout/floats.d.ts.map +1 -0
  308. package/dist/html/layout/floats.js +110 -0
  309. package/dist/html/layout/floats.js.map +1 -0
  310. package/dist/html/layout/inline.d.ts +44 -0
  311. package/dist/html/layout/inline.d.ts.map +1 -0
  312. package/dist/html/layout/inline.js +700 -0
  313. package/dist/html/layout/inline.js.map +1 -0
  314. package/dist/html/layout/table.d.ts +5 -0
  315. package/dist/html/layout/table.d.ts.map +1 -0
  316. package/dist/html/layout/table.js +340 -0
  317. package/dist/html/layout/table.js.map +1 -0
  318. package/dist/html/node.d.ts +149 -0
  319. package/dist/html/node.d.ts.map +1 -0
  320. package/dist/html/node.js +861 -0
  321. package/dist/html/node.js.map +1 -0
  322. package/dist/html/paint.d.ts +48 -0
  323. package/dist/html/paint.d.ts.map +1 -0
  324. package/dist/html/paint.js +495 -0
  325. package/dist/html/paint.js.map +1 -0
  326. package/dist/html/resources.d.ts +48 -0
  327. package/dist/html/resources.d.ts.map +1 -0
  328. package/dist/html/resources.js +156 -0
  329. package/dist/html/resources.js.map +1 -0
  330. package/dist/index.d.ts +48 -0
  331. package/dist/index.d.ts.map +1 -0
  332. package/dist/index.js +92 -0
  333. package/dist/index.js.map +1 -0
  334. package/dist/internal/heights.d.ts +81 -0
  335. package/dist/internal/heights.d.ts.map +1 -0
  336. package/dist/internal/heights.js +193 -0
  337. package/dist/internal/heights.js.map +1 -0
  338. package/dist/internal/hx.d.ts +24 -0
  339. package/dist/internal/hx.d.ts.map +1 -0
  340. package/dist/internal/hx.js +27 -0
  341. package/dist/internal/hx.js.map +1 -0
  342. package/dist/internal/text.d.ts +6 -0
  343. package/dist/internal/text.d.ts.map +1 -0
  344. package/dist/internal/text.js +44 -0
  345. package/dist/internal/text.js.map +1 -0
  346. package/dist/internal/timers.d.ts +8 -0
  347. package/dist/internal/timers.d.ts.map +1 -0
  348. package/dist/internal/timers.js +22 -0
  349. package/dist/internal/timers.js.map +1 -0
  350. package/dist/internal/widget.d.ts +40 -0
  351. package/dist/internal/widget.d.ts.map +1 -0
  352. package/dist/internal/widget.js +44 -0
  353. package/dist/internal/widget.js.map +1 -0
  354. package/dist/markdown/ast.d.ts +126 -0
  355. package/dist/markdown/ast.d.ts.map +1 -0
  356. package/dist/markdown/ast.js +8 -0
  357. package/dist/markdown/ast.js.map +1 -0
  358. package/dist/markdown/hx.d.ts +24 -0
  359. package/dist/markdown/hx.d.ts.map +1 -0
  360. package/dist/markdown/hx.js +25 -0
  361. package/dist/markdown/hx.js.map +1 -0
  362. package/dist/markdown/index.d.ts +90 -0
  363. package/dist/markdown/index.d.ts.map +1 -0
  364. package/dist/markdown/index.js +413 -0
  365. package/dist/markdown/index.js.map +1 -0
  366. package/dist/markdown/parse.d.ts +8 -0
  367. package/dist/markdown/parse.d.ts.map +1 -0
  368. package/dist/markdown/parse.js +911 -0
  369. package/dist/markdown/parse.js.map +1 -0
  370. package/dist/markdown/spans.d.ts +20 -0
  371. package/dist/markdown/spans.d.ts.map +1 -0
  372. package/dist/markdown/spans.js +96 -0
  373. package/dist/markdown/spans.js.map +1 -0
  374. package/dist/media-player/backends.d.ts +64 -0
  375. package/dist/media-player/backends.d.ts.map +1 -0
  376. package/dist/media-player/backends.js +110 -0
  377. package/dist/media-player/backends.js.map +1 -0
  378. package/dist/media-player/control.d.ts +40 -0
  379. package/dist/media-player/control.d.ts.map +1 -0
  380. package/dist/media-player/control.js +44 -0
  381. package/dist/media-player/control.js.map +1 -0
  382. package/dist/media-player/hx.d.ts +24 -0
  383. package/dist/media-player/hx.d.ts.map +1 -0
  384. package/dist/media-player/hx.js +25 -0
  385. package/dist/media-player/hx.js.map +1 -0
  386. package/dist/media-player/index.d.ts +107 -0
  387. package/dist/media-player/index.d.ts.map +1 -0
  388. package/dist/media-player/index.js +219 -0
  389. package/dist/media-player/index.js.map +1 -0
  390. package/dist/media-player/mpv.d.ts +4 -0
  391. package/dist/media-player/mpv.d.ts.map +1 -0
  392. package/dist/media-player/mpv.js +120 -0
  393. package/dist/media-player/mpv.js.map +1 -0
  394. package/dist/media-player/vlc.d.ts +8 -0
  395. package/dist/media-player/vlc.d.ts.map +1 -0
  396. package/dist/media-player/vlc.js +83 -0
  397. package/dist/media-player/vlc.js.map +1 -0
  398. package/dist/richtext/index.d.ts +19 -0
  399. package/dist/richtext/index.d.ts.map +1 -0
  400. package/dist/richtext/index.js +4 -0
  401. package/dist/richtext/index.js.map +1 -0
  402. package/dist/richtext/links.d.ts +12 -0
  403. package/dist/richtext/links.d.ts.map +1 -0
  404. package/dist/richtext/links.js +64 -0
  405. package/dist/richtext/links.js.map +1 -0
  406. package/dist/richtext/menu.d.ts +11 -0
  407. package/dist/richtext/menu.d.ts.map +1 -0
  408. package/dist/richtext/menu.js +43 -0
  409. package/dist/richtext/menu.js.map +1 -0
  410. package/dist/richtext/node.d.ts +151 -0
  411. package/dist/richtext/node.d.ts.map +1 -0
  412. package/dist/richtext/node.js +255 -0
  413. package/dist/richtext/node.js.map +1 -0
  414. package/dist/richtext/runs.d.ts +92 -0
  415. package/dist/richtext/runs.d.ts.map +1 -0
  416. package/dist/richtext/runs.js +158 -0
  417. package/dist/richtext/runs.js.map +1 -0
  418. package/dist/table/hx.d.ts +24 -0
  419. package/dist/table/hx.d.ts.map +1 -0
  420. package/dist/table/hx.js +25 -0
  421. package/dist/table/hx.js.map +1 -0
  422. package/dist/table/index.d.ts +169 -0
  423. package/dist/table/index.d.ts.map +1 -0
  424. package/dist/table/index.js +844 -0
  425. package/dist/table/index.js.map +1 -0
  426. package/dist/table/rows.d.ts +136 -0
  427. package/dist/table/rows.d.ts.map +1 -0
  428. package/dist/table/rows.js +146 -0
  429. package/dist/table/rows.js.map +1 -0
  430. package/dist/terminal/backends.d.ts +105 -0
  431. package/dist/terminal/backends.d.ts.map +1 -0
  432. package/dist/terminal/backends.js +185 -0
  433. package/dist/terminal/backends.js.map +1 -0
  434. package/dist/terminal/hx.d.ts +24 -0
  435. package/dist/terminal/hx.d.ts.map +1 -0
  436. package/dist/terminal/hx.js +25 -0
  437. package/dist/terminal/hx.js.map +1 -0
  438. package/dist/terminal/index.d.ts +160 -0
  439. package/dist/terminal/index.d.ts.map +1 -0
  440. package/dist/terminal/index.js +344 -0
  441. package/dist/terminal/index.js.map +1 -0
  442. package/dist/terminal/title.d.ts +24 -0
  443. package/dist/terminal/title.d.ts.map +1 -0
  444. package/dist/terminal/title.js +129 -0
  445. package/dist/terminal/title.js.map +1 -0
  446. package/dist/terminal/vt/colors.d.ts +63 -0
  447. package/dist/terminal/vt/colors.d.ts.map +1 -0
  448. package/dist/terminal/vt/colors.js +203 -0
  449. package/dist/terminal/vt/colors.js.map +1 -0
  450. package/dist/terminal/vt/diff.d.ts +117 -0
  451. package/dist/terminal/vt/diff.d.ts.map +1 -0
  452. package/dist/terminal/vt/diff.js +358 -0
  453. package/dist/terminal/vt/diff.js.map +1 -0
  454. package/dist/terminal/vt/fonts.d.ts +92 -0
  455. package/dist/terminal/vt/fonts.d.ts.map +1 -0
  456. package/dist/terminal/vt/fonts.js +178 -0
  457. package/dist/terminal/vt/fonts.js.map +1 -0
  458. package/dist/terminal/vt/index.d.ts +78 -0
  459. package/dist/terminal/vt/index.d.ts.map +1 -0
  460. package/dist/terminal/vt/index.js +312 -0
  461. package/dist/terminal/vt/index.js.map +1 -0
  462. package/dist/terminal/vt/keys.d.ts +74 -0
  463. package/dist/terminal/vt/keys.d.ts.map +1 -0
  464. package/dist/terminal/vt/keys.js +309 -0
  465. package/dist/terminal/vt/keys.js.map +1 -0
  466. package/dist/terminal/vt/mouse.d.ts +44 -0
  467. package/dist/terminal/vt/mouse.d.ts.map +1 -0
  468. package/dist/terminal/vt/mouse.js +106 -0
  469. package/dist/terminal/vt/mouse.js.map +1 -0
  470. package/dist/terminal/vt/node.d.ts +246 -0
  471. package/dist/terminal/vt/node.d.ts.map +1 -0
  472. package/dist/terminal/vt/node.js +1068 -0
  473. package/dist/terminal/vt/node.js.map +1 -0
  474. package/dist/terminal/vt/pty.d.ts +81 -0
  475. package/dist/terminal/vt/pty.d.ts.map +1 -0
  476. package/dist/terminal/vt/pty.js +201 -0
  477. package/dist/terminal/vt/pty.js.map +1 -0
  478. package/dist/terminal/vt/renderer.d.ts +179 -0
  479. package/dist/terminal/vt/renderer.d.ts.map +1 -0
  480. package/dist/terminal/vt/renderer.js +357 -0
  481. package/dist/terminal/vt/renderer.js.map +1 -0
  482. package/dist/terminal/vt/timers.d.ts +6 -0
  483. package/dist/terminal/vt/timers.d.ts.map +1 -0
  484. package/dist/terminal/vt/timers.js +16 -0
  485. package/dist/terminal/vt/timers.js.map +1 -0
  486. package/dist/terminal/vt/xterm.d.ts +142 -0
  487. package/dist/terminal/vt/xterm.d.ts.map +1 -0
  488. package/dist/terminal/vt/xterm.js +32 -0
  489. package/dist/terminal/vt/xterm.js.map +1 -0
  490. package/dist/terminal-output/hx.d.ts +24 -0
  491. package/dist/terminal-output/hx.d.ts.map +1 -0
  492. package/dist/terminal-output/hx.js +25 -0
  493. package/dist/terminal-output/hx.js.map +1 -0
  494. package/dist/terminal-output/index.d.ts +92 -0
  495. package/dist/terminal-output/index.d.ts.map +1 -0
  496. package/dist/terminal-output/index.js +179 -0
  497. package/dist/terminal-output/index.js.map +1 -0
  498. package/dist/terminal-output/runs.d.ts +27 -0
  499. package/dist/terminal-output/runs.d.ts.map +1 -0
  500. package/dist/terminal-output/runs.js +66 -0
  501. package/dist/terminal-output/runs.js.map +1 -0
  502. package/dist/three/canvas.d.ts +46 -0
  503. package/dist/three/canvas.d.ts.map +1 -0
  504. package/dist/three/canvas.js +305 -0
  505. package/dist/three/canvas.js.map +1 -0
  506. package/dist/three/events.d.ts +64 -0
  507. package/dist/three/events.d.ts.map +1 -0
  508. package/dist/three/events.js +146 -0
  509. package/dist/three/events.js.map +1 -0
  510. package/dist/three/geometries.d.ts +89 -0
  511. package/dist/three/geometries.d.ts.map +1 -0
  512. package/dist/three/geometries.js +345 -0
  513. package/dist/three/geometries.js.map +1 -0
  514. package/dist/three/globals.d.ts +7 -0
  515. package/dist/three/globals.d.ts.map +1 -0
  516. package/dist/three/globals.js +20 -0
  517. package/dist/three/globals.js.map +1 -0
  518. package/dist/three/hx.d.ts +9 -0
  519. package/dist/three/hx.d.ts.map +1 -0
  520. package/dist/three/hx.js +10 -0
  521. package/dist/three/hx.js.map +1 -0
  522. package/dist/three/index.d.ts +22 -0
  523. package/dist/three/index.d.ts.map +1 -0
  524. package/dist/three/index.js +24 -0
  525. package/dist/three/index.js.map +1 -0
  526. package/dist/three/jsx-dev-runtime.d.ts +19 -0
  527. package/dist/three/jsx-dev-runtime.d.ts.map +1 -0
  528. package/dist/three/jsx-dev-runtime.js +2 -0
  529. package/dist/three/jsx-dev-runtime.js.map +1 -0
  530. package/dist/three/jsx-runtime.d.ts +19 -0
  531. package/dist/three/jsx-runtime.d.ts.map +1 -0
  532. package/dist/three/jsx-runtime.js +2 -0
  533. package/dist/three/jsx-runtime.js.map +1 -0
  534. package/dist/three/jsx.d.ts +198 -0
  535. package/dist/three/jsx.d.ts.map +1 -0
  536. package/dist/three/jsx.js +2 -0
  537. package/dist/three/jsx.js.map +1 -0
  538. package/dist/three/materials.d.ts +125 -0
  539. package/dist/three/materials.d.ts.map +1 -0
  540. package/dist/three/materials.js +229 -0
  541. package/dist/three/materials.js.map +1 -0
  542. package/dist/three/math.d.ts +146 -0
  543. package/dist/three/math.d.ts.map +1 -0
  544. package/dist/three/math.js +464 -0
  545. package/dist/three/math.js.map +1 -0
  546. package/dist/three/objects.d.ts +185 -0
  547. package/dist/three/objects.d.ts.map +1 -0
  548. package/dist/three/objects.js +309 -0
  549. package/dist/three/objects.js.map +1 -0
  550. package/dist/three/passes.d.ts +54 -0
  551. package/dist/three/passes.d.ts.map +1 -0
  552. package/dist/three/passes.js +78 -0
  553. package/dist/three/passes.js.map +1 -0
  554. package/dist/three/postprocess.d.ts +85 -0
  555. package/dist/three/postprocess.d.ts.map +1 -0
  556. package/dist/three/postprocess.js +503 -0
  557. package/dist/three/postprocess.js.map +1 -0
  558. package/dist/three/raycast.d.ts +24 -0
  559. package/dist/three/raycast.d.ts.map +1 -0
  560. package/dist/three/raycast.js +138 -0
  561. package/dist/three/raycast.js.map +1 -0
  562. package/dist/three/reconciler.d.ts +48 -0
  563. package/dist/three/reconciler.d.ts.map +1 -0
  564. package/dist/three/reconciler.js +416 -0
  565. package/dist/three/reconciler.js.map +1 -0
  566. package/dist/three/renderer-direct.d.ts +102 -0
  567. package/dist/three/renderer-direct.d.ts.map +1 -0
  568. package/dist/three/renderer-direct.js +782 -0
  569. package/dist/three/renderer-direct.js.map +1 -0
  570. package/dist/three/renderer-indirect.d.ts +68 -0
  571. package/dist/three/renderer-indirect.d.ts.map +1 -0
  572. package/dist/three/renderer-indirect.js +438 -0
  573. package/dist/three/renderer-indirect.js.map +1 -0
  574. package/dist/three/store.d.ts +81 -0
  575. package/dist/three/store.d.ts.map +1 -0
  576. package/dist/three/store.js +110 -0
  577. package/dist/three/store.js.map +1 -0
  578. package/dist/timeline/hx.d.ts +18 -0
  579. package/dist/timeline/hx.d.ts.map +1 -0
  580. package/dist/timeline/hx.js +10 -0
  581. package/dist/timeline/hx.js.map +1 -0
  582. package/dist/timeline/index.d.ts +152 -0
  583. package/dist/timeline/index.d.ts.map +1 -0
  584. package/dist/timeline/index.js +383 -0
  585. package/dist/timeline/index.js.map +1 -0
  586. package/dist/tray-host/hx.d.ts +24 -0
  587. package/dist/tray-host/hx.d.ts.map +1 -0
  588. package/dist/tray-host/hx.js +25 -0
  589. package/dist/tray-host/hx.js.map +1 -0
  590. package/dist/tray-host/index.d.ts +110 -0
  591. package/dist/tray-host/index.d.ts.map +1 -0
  592. package/dist/tray-host/index.js +191 -0
  593. package/dist/tray-host/index.js.map +1 -0
  594. package/dist/tray-host/manager.d.ts +137 -0
  595. package/dist/tray-host/manager.d.ts.map +1 -0
  596. package/dist/tray-host/manager.js +462 -0
  597. package/dist/tray-host/manager.js.map +1 -0
  598. package/dist/tray-host/notify.d.ts +22 -0
  599. package/dist/tray-host/notify.d.ts.map +1 -0
  600. package/dist/tray-host/notify.js +74 -0
  601. package/dist/tray-host/notify.js.map +1 -0
  602. package/dist/tray-host/protocol.d.ts +106 -0
  603. package/dist/tray-host/protocol.d.ts.map +1 -0
  604. package/dist/tray-host/protocol.js +191 -0
  605. package/dist/tray-host/protocol.js.map +1 -0
  606. package/dist/tree/hx.d.ts +24 -0
  607. package/dist/tree/hx.d.ts.map +1 -0
  608. package/dist/tree/hx.js +25 -0
  609. package/dist/tree/hx.js.map +1 -0
  610. package/dist/tree/index.d.ts +221 -0
  611. package/dist/tree/index.d.ts.map +1 -0
  612. package/dist/tree/index.js +716 -0
  613. package/dist/tree/index.js.map +1 -0
  614. package/dist/tree/internal.d.ts +18 -0
  615. package/dist/tree/internal.d.ts.map +1 -0
  616. package/dist/tree/internal.js +66 -0
  617. package/dist/tree/internal.js.map +1 -0
  618. package/dist/tree/rows.d.ts +177 -0
  619. package/dist/tree/rows.d.ts.map +1 -0
  620. package/dist/tree/rows.js +179 -0
  621. package/dist/tree/rows.js.map +1 -0
  622. package/package.json +166 -12
  623. package/src/ansi/cast.ts +159 -0
  624. package/src/ansi/index.ts +53 -0
  625. package/src/ansi/palette.ts +226 -0
  626. package/src/ansi/parse.ts +780 -0
  627. package/src/ansi/sgr.ts +380 -0
  628. package/src/ansi/utf8.ts +84 -0
  629. package/src/calendar/Calendar.ts +744 -0
  630. package/src/calendar/DatePicker.ts +368 -0
  631. package/src/calendar/dates.ts +307 -0
  632. package/src/calendar/index.ts +51 -0
  633. package/src/charts/components.ts +864 -0
  634. package/src/charts/data.ts +776 -0
  635. package/src/charts/hx.ts +39 -0
  636. package/src/charts/index.ts +99 -0
  637. package/src/charts/node.ts +932 -0
  638. package/src/charts/render.ts +982 -0
  639. package/src/charts/scale.ts +214 -0
  640. package/src/charts/spec.ts +122 -0
  641. package/src/charts/timers.ts +24 -0
  642. package/src/code/hx.ts +51 -0
  643. package/src/code/index.ts +174 -0
  644. package/src/code-editor/completion.ts +161 -0
  645. package/src/code-editor/doc.ts +198 -0
  646. package/src/code-editor/hx.ts +26 -0
  647. package/src/code-editor/index.ts +615 -0
  648. package/src/code-editor/node.ts +1926 -0
  649. package/src/code-language/hljs.ts +302 -0
  650. package/src/code-language/index.ts +51 -0
  651. package/src/code-language/languages/glsl.ts +120 -0
  652. package/src/code-language/languages/javascript.ts +419 -0
  653. package/src/code-language/languages/json.ts +72 -0
  654. package/src/code-language/languages/shell.ts +221 -0
  655. package/src/code-language/languages/sql.ts +165 -0
  656. package/src/code-language/lezer.ts +190 -0
  657. package/src/code-language/registry.ts +66 -0
  658. package/src/code-language/runs.ts +128 -0
  659. package/src/code-language/stream.ts +306 -0
  660. package/src/code-language/textmate.ts +134 -0
  661. package/src/code-language/theme.ts +124 -0
  662. package/src/code-language/timers.ts +36 -0
  663. package/src/code-language/types.ts +252 -0
  664. package/src/codeblock/index.ts +146 -0
  665. package/src/color-picker/ColorField.ts +333 -0
  666. package/src/color-picker/ColorPicker.ts +1069 -0
  667. package/src/color-picker/color.ts +399 -0
  668. package/src/color-picker/index.ts +50 -0
  669. package/src/desktop-calendar/eds.ts +484 -0
  670. package/src/desktop-calendar/ical.ts +119 -0
  671. package/src/desktop-calendar/index.ts +287 -0
  672. package/src/embed/client.ts +311 -0
  673. package/src/embed/host.ts +432 -0
  674. package/src/embed/index.ts +33 -0
  675. package/src/embed/timers.ts +32 -0
  676. package/src/flow/draw.ts +418 -0
  677. package/src/flow/index.ts +473 -0
  678. package/src/flow/model.ts +687 -0
  679. package/src/flow/node.ts +3694 -0
  680. package/src/flow/paths.ts +403 -0
  681. package/src/flow/types.ts +634 -0
  682. package/src/formula/hx.ts +51 -0
  683. package/src/formula/index.ts +243 -0
  684. package/src/formula/katex.ts +209 -0
  685. package/src/formula/layout.ts +876 -0
  686. package/src/formula/node.ts +467 -0
  687. package/src/html/controls.ts +244 -0
  688. package/src/html/css/cascade.ts +606 -0
  689. package/src/html/css/parse.ts +500 -0
  690. package/src/html/css/style.ts +1371 -0
  691. package/src/html/css/ua.ts +174 -0
  692. package/src/html/css/values.ts +358 -0
  693. package/src/html/dom.ts +410 -0
  694. package/src/html/hx.ts +55 -0
  695. package/src/html/index.ts +545 -0
  696. package/src/html/layout/block.ts +876 -0
  697. package/src/html/layout/boxes.ts +981 -0
  698. package/src/html/layout/flex.ts +297 -0
  699. package/src/html/layout/floats.ts +125 -0
  700. package/src/html/layout/inline.ts +870 -0
  701. package/src/html/layout/table.ts +380 -0
  702. package/src/html/node.ts +967 -0
  703. package/src/html/paint.ts +605 -0
  704. package/src/html/resources.ts +214 -0
  705. package/src/index.ts +638 -0
  706. package/src/internal/heights.ts +211 -0
  707. package/src/internal/hx.ts +53 -0
  708. package/src/internal/text.ts +44 -0
  709. package/src/internal/timers.ts +44 -0
  710. package/src/internal/widget.ts +92 -0
  711. package/src/markdown/ast.ts +163 -0
  712. package/src/markdown/hx.ts +51 -0
  713. package/src/markdown/index.ts +686 -0
  714. package/src/markdown/parse.ts +1037 -0
  715. package/src/markdown/spans.ts +143 -0
  716. package/src/media-player/backends.ts +155 -0
  717. package/src/media-player/control.ts +70 -0
  718. package/src/media-player/hx.ts +51 -0
  719. package/src/media-player/index.ts +378 -0
  720. package/src/media-player/mpv.ts +146 -0
  721. package/src/media-player/vlc.ts +97 -0
  722. package/src/richtext/index.ts +42 -0
  723. package/src/richtext/links.ts +78 -0
  724. package/src/richtext/menu.ts +49 -0
  725. package/src/richtext/node.ts +406 -0
  726. package/src/richtext/runs.ts +253 -0
  727. package/src/table/hx.ts +51 -0
  728. package/src/table/index.ts +1219 -0
  729. package/src/table/rows.ts +275 -0
  730. package/src/terminal/backends.ts +242 -0
  731. package/src/terminal/hx.ts +51 -0
  732. package/src/terminal/index.ts +574 -0
  733. package/src/terminal/title.ts +172 -0
  734. package/src/terminal/vt/colors.ts +247 -0
  735. package/src/terminal/vt/diff.ts +467 -0
  736. package/src/terminal/vt/fonts.ts +233 -0
  737. package/src/terminal/vt/index.ts +443 -0
  738. package/src/terminal/vt/keys.ts +369 -0
  739. package/src/terminal/vt/mouse.ts +144 -0
  740. package/src/terminal/vt/node.ts +1242 -0
  741. package/src/terminal/vt/pty.ts +334 -0
  742. package/src/terminal/vt/renderer.ts +555 -0
  743. package/src/terminal/vt/timers.ts +31 -0
  744. package/src/terminal/vt/xterm.ts +193 -0
  745. package/src/terminal-output/hx.ts +51 -0
  746. package/src/terminal-output/index.ts +340 -0
  747. package/src/terminal-output/runs.ts +79 -0
  748. package/src/three/canvas.ts +451 -0
  749. package/src/three/events.ts +197 -0
  750. package/src/three/geometries.ts +429 -0
  751. package/src/three/globals.ts +34 -0
  752. package/src/three/hx.ts +22 -0
  753. package/src/three/index.ts +98 -0
  754. package/src/three/jsx-dev-runtime.ts +27 -0
  755. package/src/three/jsx-runtime.ts +38 -0
  756. package/src/three/jsx.ts +275 -0
  757. package/src/three/materials.ts +270 -0
  758. package/src/three/math.ts +585 -0
  759. package/src/three/objects.ts +397 -0
  760. package/src/three/passes.ts +90 -0
  761. package/src/three/postprocess.ts +677 -0
  762. package/src/three/raycast.ts +189 -0
  763. package/src/three/react-reconciler.d.ts +50 -0
  764. package/src/three/reconciler.ts +624 -0
  765. package/src/three/renderer-direct.ts +1055 -0
  766. package/src/three/renderer-indirect.ts +570 -0
  767. package/src/three/store.ts +207 -0
  768. package/src/timeline/hx.ts +31 -0
  769. package/src/timeline/index.ts +603 -0
  770. package/src/tray-host/hx.ts +51 -0
  771. package/src/tray-host/index.ts +331 -0
  772. package/src/tray-host/manager.ts +639 -0
  773. package/src/tray-host/notify.ts +102 -0
  774. package/src/tray-host/protocol.ts +235 -0
  775. package/src/tree/hx.ts +51 -0
  776. package/src/tree/index.ts +1087 -0
  777. package/src/tree/internal.ts +87 -0
  778. package/src/tree/rows.ts +334 -0
  779. package/src/index.d.ts +0 -2
  780. package/src/index.js +0 -9
  781. package/src/sparkline/index.d.ts +0 -29
  782. package/src/sparkline/index.js +0 -50
  783. package/src/sparkline/node.js +0 -72
@@ -0,0 +1,744 @@
1
+ // <Calendar> — a month grid: one date, or a range, with any day blockable.
2
+ //
3
+ // Ported from react-x11's `src/components/Calendar.js`. Built purely on the
4
+ // host primitives, so there is no `registerElement` here and nothing for the
5
+ // reconciler to learn — a `<Calendar>` is `<box>`es, `<text>` and, for the
6
+ // month nav, two glyphs out of core's system icon set.
7
+ import React, { useImperativeHandle, useMemo, useState } from 'react';
8
+ import type { ReactElement, ReactNode, Ref } from 'react';
9
+ import { createStyles, tint } from 'react-x11/style';
10
+ import type { Style } from 'react-x11/style';
11
+ import { Icon, useTheme } from 'react-x11';
12
+ import type { KeyboardEvent, Theme } from 'react-x11';
13
+ import {
14
+ XK_DOWN,
15
+ XK_END,
16
+ XK_HOME,
17
+ XK_LEFT,
18
+ XK_PAGE_DOWN,
19
+ XK_PAGE_UP,
20
+ XK_RETURN,
21
+ XK_RIGHT,
22
+ XK_UP,
23
+ } from 'react-x11/keysyms';
24
+
25
+ import { hx } from '../internal/hx.js';
26
+ import type { Host } from '../internal/hx.js';
27
+ import { changeEvent } from '../internal/widget.js';
28
+ import type { WidgetChangeEvent } from '../internal/widget.js';
29
+ import {
30
+ addDays,
31
+ addMonths,
32
+ clampDay,
33
+ dayParts,
34
+ firstOfMonth,
35
+ formatMonth,
36
+ localeWeekStart,
37
+ monthGrid,
38
+ monthOf,
39
+ toDay,
40
+ toMonth,
41
+ today,
42
+ weekdayLabels,
43
+ } from './dates.js';
44
+ import type {
45
+ CalendarDay,
46
+ CalendarMonth,
47
+ DayInput,
48
+ DayParts,
49
+ } from './dates.js';
50
+
51
+ // The grid's geometry. A cell is the square the pointer aims at and the band
52
+ // runs through; the pill inside it is what gets filled, rounded and hovered,
53
+ // which is what leaves the band visible on either side of a selected end.
54
+ const CELL_W = 36;
55
+ const CELL_H = 32;
56
+ const PILL_W = 32;
57
+ const PILL_H = 28;
58
+ // Reserved under the number when `dayContent` is given — and only then, so a
59
+ // plain calendar is not 6×8 pixels taller for a feature it is not using.
60
+ const MARKER_H = 8;
61
+ const NAV = 26;
62
+ // The month-nav glyph inside its 26px button. The chevron this calendar drew
63
+ // itself was tall and narrow (7×12) so that it read as an arrow at all; a
64
+ // square box at 12 puts the same ink there, because a system chevron's long
65
+ // axis is its box and its short one is half of that.
66
+ const NAV_CHEVRON = 12;
67
+ const PAD = 8;
68
+ const GAP = 4;
69
+ const WEEKDAY_H = 20;
70
+
71
+ /**
72
+ * How big a `<Calendar>` lays out — exported because `DatePicker` has to size
73
+ * a real X window around one *before* it is laid out, and a popup that
74
+ * guesses is a popup that clips the last week of the month. Everything the
75
+ * sum reads is a constant above it, so the two cannot drift apart.
76
+ *
77
+ * Eight rows in the column (the header, the weekday names, six weeks), so
78
+ * seven gaps between them.
79
+ */
80
+ export const CALENDAR_WIDTH = CELL_W * 7 + PAD * 2;
81
+ export const CALENDAR_HEIGHT = PAD * 2 + NAV + WEEKDAY_H + CELL_H * 6 + GAP * 7;
82
+
83
+ const s = createStyles({
84
+ root: { alignItems: 'flex-start', padding: PAD, gap: GAP },
85
+ header: {
86
+ flexDirection: 'row',
87
+ alignItems: 'center',
88
+ width: CELL_W * 7,
89
+ height: NAV,
90
+ flexShrink: 0,
91
+ },
92
+ title: { flexGrow: 1, textAlign: 'center', fontWeight: 'bold' },
93
+ nav: {
94
+ width: NAV,
95
+ height: NAV,
96
+ alignItems: 'center',
97
+ justifyContent: 'center',
98
+ cursor: 'pointer',
99
+ transition: { backgroundColor: 80 },
100
+ },
101
+ week: { flexDirection: 'row', flexShrink: 0 },
102
+ weekdayCell: {
103
+ width: CELL_W,
104
+ height: WEEKDAY_H,
105
+ alignItems: 'center',
106
+ justifyContent: 'center',
107
+ },
108
+ weekdayLabel: { fontSize: 11 },
109
+ cell: {
110
+ width: CELL_W,
111
+ height: CELL_H,
112
+ alignItems: 'center',
113
+ justifyContent: 'center',
114
+ },
115
+ band: { position: 'absolute', top: 2, bottom: 2 },
116
+ pill: {
117
+ width: PILL_W,
118
+ height: PILL_H,
119
+ alignItems: 'center',
120
+ justifyContent: 'center',
121
+ borderWidth: 1,
122
+ // the 2px the pill gives up on each side of the cell are still part of
123
+ // its target, so the whole square is clickable and the gap between two
124
+ // days is not a dead strip
125
+ hitSlop: 2,
126
+ transition: { backgroundColor: 80 },
127
+ },
128
+ number: { fontSize: 13 },
129
+ markers: {
130
+ flexDirection: 'row',
131
+ height: MARKER_H,
132
+ alignItems: 'center',
133
+ justifyContent: 'center',
134
+ gap: 2,
135
+ },
136
+ });
137
+
138
+ const TRANSPARENT = 'transparent';
139
+
140
+ /** A picked span. Either end may be null while it is being picked. */
141
+ export interface DateRange {
142
+ start: CalendarDay | null;
143
+ end: CalendarDay | null;
144
+ }
145
+
146
+ /** What a range calendar accepts as its value. */
147
+ export interface DateRangeInput {
148
+ start?: DayInput;
149
+ end?: DayInput;
150
+ }
151
+
152
+ /** What a cell is, when `dayContent` is asked what to draw in it. */
153
+ export interface CalendarDayState {
154
+ blocked: boolean;
155
+ /** A day of the neighbouring month, filling a corner of the grid. */
156
+ outside: boolean;
157
+ today: boolean;
158
+ selected: boolean;
159
+ inRange: boolean;
160
+ /** Inside a range that is being previewed rather than picked. */
161
+ preview: boolean;
162
+ focused: boolean;
163
+ /** The colour the day's number is drawn in — a marker that follows it
164
+ * stays legible on the filled ends of a range. */
165
+ color: string;
166
+ }
167
+
168
+ /** A `<Calendar>`'s imperative side, for a control that holds the keyboard on
169
+ * its behalf. `handleKey` reports whether the grid took the key. */
170
+ export interface CalendarHandle {
171
+ handleKey: (ev: KeyboardEvent) => boolean;
172
+ }
173
+
174
+ type BoxProps = Host['box'];
175
+
176
+ interface CalendarCommonProps extends Omit<
177
+ BoxProps,
178
+ 'style' | 'children' | 'ref' | 'onChange' | 'onKeyDown'
179
+ > {
180
+ /** Visible month, `'2026-08'`; controlled with `onMonthChange`. */
181
+ month?: CalendarMonth | null;
182
+ defaultMonth?: DayInput | CalendarMonth;
183
+ onMonthChange?: (month: CalendarMonth) => void;
184
+ /** Earliest selectable day. */
185
+ min?: DayInput;
186
+ /** Latest selectable day. */
187
+ max?: DayInput;
188
+ /** Block a day for any other reason — weekends, holidays, taken slots. */
189
+ isDateBlocked?: (day: CalendarDay, parts: DayParts) => boolean;
190
+ /** Let a range run across blocked days, so only its ends must be free. */
191
+ spanBlocked?: boolean;
192
+ /** Rendered under the number, in a strip reserved only when this is given. */
193
+ dayContent?: (day: CalendarDay, state: CalendarDayState) => ReactNode;
194
+ /** The form-field name reported on the change event. */
195
+ name?: string;
196
+ locale?: string;
197
+ /** `0` Sunday … `6` Saturday. Defaults to the locale's own answer. */
198
+ weekStartsOn?: number;
199
+ /** Whether the grid is a tab stop. `false` for a grid inside a popup, whose
200
+ * trigger holds the keyboard on its behalf. */
201
+ focusable?: boolean;
202
+ /** Draw the day cursor regardless of whether the grid holds the focus. */
203
+ focusVisible?: boolean;
204
+ style?: Style | Style[];
205
+ ref?: Ref<CalendarHandle>;
206
+ }
207
+
208
+ export interface SingleCalendarProps extends CalendarCommonProps {
209
+ mode?: 'single';
210
+ value?: DayInput;
211
+ defaultValue?: DayInput;
212
+ onChange?: (ev: WidgetChangeEvent<CalendarDay | null>) => void;
213
+ }
214
+
215
+ export interface RangeCalendarProps extends CalendarCommonProps {
216
+ mode: 'range';
217
+ value?: DateRangeInput | null;
218
+ defaultValue?: DateRangeInput | null;
219
+ onChange?: (ev: WidgetChangeEvent<DateRange>) => void;
220
+ }
221
+
222
+ export type CalendarProps = SingleCalendarProps | RangeCalendarProps;
223
+
224
+ /** The selection, with every day normalized — and with the two shapes told
225
+ * apart loudly, since passing a range to a single-date calendar otherwise
226
+ * shows up as an empty calendar rather than as the mistake it is. */
227
+ function normalizeValue(
228
+ mode: string,
229
+ value: unknown,
230
+ ): CalendarDay | null | DateRange {
231
+ if (mode === 'range') {
232
+ if (value == null) return { start: null, end: null };
233
+ if (typeof value !== 'object' || value instanceof Date) {
234
+ throw new TypeError(
235
+ "@react-x11/components: a range calendar's value is { start, end }, got " +
236
+ `${JSON.stringify(value)}. Drop mode="range" for a single date.`,
237
+ );
238
+ }
239
+ const range = value as DateRangeInput;
240
+ return { start: toDay(range.start), end: toDay(range.end) };
241
+ }
242
+ if (value != null && typeof value === 'object' && !(value instanceof Date)) {
243
+ throw new TypeError(
244
+ "@react-x11/components: a single-date calendar's value is one day, got " +
245
+ `${JSON.stringify(value)}. Pass mode="range" to select a span.`,
246
+ );
247
+ }
248
+ return toDay(value as DayInput);
249
+ }
250
+
251
+ /**
252
+ * The first blocked day after `start`, up to `last` — where a range that may
253
+ * not contain a blocked day has to stop.
254
+ *
255
+ * Scanned over the days the grid can show rather than per candidate end:
256
+ * nothing off the grid is clickable, and the keyboard's focus is always on it.
257
+ * With no half-picked start there is nothing to scan for.
258
+ */
259
+ function firstBlockedAfter(
260
+ start: CalendarDay | null,
261
+ last: CalendarDay,
262
+ blocked: (day: CalendarDay) => boolean,
263
+ ): CalendarDay | null {
264
+ if (!start) return null;
265
+ for (let d = addDays(start, 1); d <= last; d = addDays(d, 1)) {
266
+ if (blocked(d)) return d;
267
+ }
268
+ return null;
269
+ }
270
+
271
+ /** The day in `month` with the same day-of-month as `day`, or the last one
272
+ * the month has — so paging from the 31st does not skip February. */
273
+ function sameDayIn(month: CalendarMonth, day: CalendarDay): CalendarDay {
274
+ const wanted = Number(day.slice(8));
275
+ const last = Number(addDays(firstOfMonth(addMonths(month, 1)), -1).slice(8));
276
+ return `${month}-${String(Math.min(wanted, last)).padStart(2, '0')}`;
277
+ }
278
+
279
+ /**
280
+ * `direction` is the number of months the button steps, `-1` or `+1` — the
281
+ * argument it already hands `stepMonth`, rather than a second vocabulary
282
+ * beside it. Core's copy of this component took the same shape when the icon
283
+ * set landed, and there a `'left'`/`'right'` string sitting next to a
284
+ * `direction < 0` test had already made every button announce itself as "Next
285
+ * month". One name and one type is what leaves no second comparison to get
286
+ * wrong.
287
+ */
288
+ function NavButton({
289
+ direction,
290
+ disabled,
291
+ onPress,
292
+ theme,
293
+ }: {
294
+ direction: -1 | 1;
295
+ disabled: boolean;
296
+ onPress: () => void;
297
+ theme: Theme;
298
+ }): ReactElement {
299
+ return hx(
300
+ 'box',
301
+ {
302
+ role: 'button',
303
+ 'aria-label': direction < 0 ? 'Previous month' : 'Next month',
304
+ disabled: disabled || undefined,
305
+ onClick: disabled ? undefined : onPress,
306
+ style: [
307
+ s.nav,
308
+ {
309
+ borderRadius: theme.radius,
310
+ cursor: disabled ? 'default' : 'pointer',
311
+ },
312
+ !disabled && {
313
+ ':hover': { backgroundColor: theme.surfaceHover },
314
+ ':active': { backgroundColor: theme.surfaceActive },
315
+ },
316
+ ],
317
+ },
318
+ React.createElement(Icon, {
319
+ name: direction < 0 ? 'chevronLeft' : 'chevronRight',
320
+ size: NAV_CHEVRON,
321
+ // The button carries the `:hover`, but neither colour nor a state block
322
+ // reaches down to the glyph — disabled is the state that has to be
323
+ // handed over by name.
324
+ color: disabled ? theme.border : theme.textMuted,
325
+ }),
326
+ );
327
+ }
328
+
329
+ interface BandShape {
330
+ opensRight: boolean;
331
+ opensLeft: boolean;
332
+ }
333
+
334
+ function DayCell({
335
+ day,
336
+ state,
337
+ theme,
338
+ band,
339
+ onPick,
340
+ onHover,
341
+ dayContent,
342
+ }: {
343
+ day: CalendarDay;
344
+ /** Everything but `color`, which this cell is the one that resolves. */
345
+ state: Omit<CalendarDayState, 'color'>;
346
+ theme: Theme;
347
+ band: BandShape | null;
348
+ onPick: (day: CalendarDay) => void;
349
+ onHover?: ((day: CalendarDay) => void) | undefined;
350
+ dayContent?:
351
+ ((day: CalendarDay, state: CalendarDayState) => ReactNode) | undefined;
352
+ }): ReactElement {
353
+ const { blocked, outside, selected, focused } = state;
354
+ const color = selected
355
+ ? theme.accentText
356
+ : blocked || outside
357
+ ? theme.textMuted
358
+ : theme.text;
359
+ const markers = dayContent?.(day, { ...state, color });
360
+
361
+ return hx(
362
+ 'box',
363
+ {
364
+ role: 'gridcell',
365
+ 'aria-label': day,
366
+ 'aria-selected': selected,
367
+ disabled: blocked || undefined,
368
+ style: s.cell,
369
+ },
370
+ // Behind the pill and out of flow, so an end of the range keeps its own
371
+ // fill while the band still runs out of it towards the next day. Half a
372
+ // cell at each end is what joins one pill to the next without drawing
373
+ // over either.
374
+ band &&
375
+ hx('box', {
376
+ style: [
377
+ s.band,
378
+ {
379
+ left: band.opensRight ? CELL_W / 2 : 0,
380
+ right: band.opensLeft ? CELL_W / 2 : 0,
381
+ backgroundColor: tint(theme.accent, 0.18),
382
+ },
383
+ ],
384
+ }),
385
+ hx(
386
+ 'box',
387
+ {
388
+ onClick: blocked ? undefined : () => onPick(day),
389
+ onMouseEnter: onHover ? () => onHover(day) : undefined,
390
+ style: [
391
+ s.pill,
392
+ {
393
+ cursor: blocked ? 'default' : 'pointer',
394
+ borderRadius: theme.radius,
395
+ backgroundColor: selected ? theme.accent : TRANSPARENT,
396
+ // today keeps its outline whatever else is going on, and every
397
+ // other cell carries the same border in nothing — a border that
398
+ // appears would inset the number by a pixel as the day turns
399
+ borderColor: focused
400
+ ? theme.borderFocus
401
+ : state.today
402
+ ? theme.accent
403
+ : TRANSPARENT,
404
+ },
405
+ !blocked && {
406
+ ':hover': {
407
+ backgroundColor: selected
408
+ ? theme.accentHover
409
+ : theme.surfaceHover,
410
+ },
411
+ ':active': {
412
+ backgroundColor: selected
413
+ ? theme.accentActive
414
+ : theme.surfaceActive,
415
+ },
416
+ },
417
+ ],
418
+ },
419
+ hx(
420
+ 'text',
421
+ { style: [s.number, { color }] },
422
+ String(Number(day.slice(8))),
423
+ ),
424
+ markers ? hx('box', { style: s.markers }, markers) : null,
425
+ ),
426
+ );
427
+ }
428
+
429
+ /**
430
+ * <Calendar value onChange …/> — a month grid: one date, or a range, with any
431
+ * day blockable.
432
+ *
433
+ * <Calendar value={day} onChange={(ev) => setDay(ev.value)} />
434
+ * <Calendar mode="range" value={{ start, end }} onChange={…} />
435
+ *
436
+ * **A day is a `'YYYY-MM-DD'` string** in and out (a `Date` is accepted on the
437
+ * way in and read as its local calendar day). See `dates.ts` for why: a square
438
+ * on a wall calendar is not an instant, and comparing two of them should not
439
+ * depend on which constructor built them.
440
+ *
441
+ * Blocking is `min`/`max` for the usual bounds and `isDateBlocked(day, parts)`
442
+ * for everything else — weekends, holidays, whatever the server said is taken.
443
+ * `parts` is `{ year, month, day, weekday, date }` so the common cases do not
444
+ * have to parse the string back apart.
445
+ *
446
+ * In `range` mode the first click sets the start and reports
447
+ * `{ start, end: null }`, the second completes it. Clicking before the start
448
+ * re-anchors rather than selecting backwards. **A range may not contain a
449
+ * blocked day**: the preview stops at the first one, because an app that
450
+ * blocked a date did not mean "unless it is in the middle", and a selection
451
+ * that quietly included it would have to be validated all over again on the
452
+ * way out. `spanBlocked` is the other reading — only the ends must be free —
453
+ * for holidays a booking is allowed to run across.
454
+ *
455
+ * `dayContent(day, state)` renders under the number, in a strip the grid
456
+ * reserves only when the prop is there. It is the seam for anything drawn per
457
+ * day — an event dot, a price, an availability count — and `state` carries
458
+ * `{ selected, inRange, blocked, outside, today, focused, color }` so a marker
459
+ * can stay legible on the filled ends of the range. `../desktop-calendar/` is
460
+ * the worked example: real events from the user's desktop, as dots.
461
+ *
462
+ * The grid is a **single tab stop**. Arrows move a day at a time and a week at
463
+ * a time, Home/End go to the ends of the week, PageUp/PageDown change month
464
+ * (with Shift, year), Enter and Space select. Moving off the edge of the month
465
+ * turns the page.
466
+ *
467
+ * A calendar inside a popup does not hold the keyboard — the trigger does, on
468
+ * its behalf, because an override-redirect window never takes focus. That is
469
+ * what `focusable: false` plus `focusVisible: true` say together: someone else
470
+ * is feeding this grid its keys through the `handleKey` on its ref, and the
471
+ * day cursor still has to be drawn or the arrows move something invisible.
472
+ */
473
+ export function Calendar(props: CalendarProps): ReactElement {
474
+ const {
475
+ mode = 'single',
476
+ value,
477
+ defaultValue,
478
+ onChange,
479
+ name,
480
+ month,
481
+ defaultMonth,
482
+ onMonthChange,
483
+ min,
484
+ max,
485
+ isDateBlocked,
486
+ spanBlocked = false,
487
+ dayContent,
488
+ locale,
489
+ weekStartsOn,
490
+ focusable = true,
491
+ focusVisible,
492
+ ref,
493
+ style,
494
+ ...boxProps
495
+ } = props as CalendarProps & {
496
+ mode?: string;
497
+ value?: unknown;
498
+ defaultValue?: unknown;
499
+ onChange?: (ev: WidgetChangeEvent<never>) => void;
500
+ };
501
+
502
+ const isRange = mode === 'range';
503
+ const theme = useTheme();
504
+ const minDay = toDay(min);
505
+ const maxDay = toDay(max);
506
+ const todayKey = today();
507
+
508
+ const [ownValue, setOwnValue] = useState(() =>
509
+ normalizeValue(mode, defaultValue ?? null),
510
+ );
511
+ const selection =
512
+ value === undefined ? ownValue : normalizeValue(mode, value);
513
+ const range = isRange ? (selection as DateRange) : null;
514
+ const single = isRange ? null : (selection as CalendarDay | null);
515
+ const anchor = isRange ? (range as DateRange).start : single;
516
+
517
+ const [ownMonth, setOwnMonth] = useState<CalendarMonth>(
518
+ () =>
519
+ toMonth(defaultMonth as DayInput) ??
520
+ monthOf(anchor ?? clampDay(todayKey, minDay, maxDay)),
521
+ );
522
+ const visibleMonth =
523
+ month == null ? ownMonth : (toMonth(month) as CalendarMonth);
524
+
525
+ const [focusedDay, setFocusedDay] = useState<CalendarDay>(() =>
526
+ clampDay(anchor ?? todayKey, minDay, maxDay),
527
+ );
528
+ const [focused, setFocused] = useState(false);
529
+ // Only ever set while a range is half-picked, which is the only time the
530
+ // grid repaints on pointer movement: with nothing pending the highlight is
531
+ // a `:hover` block on one cell and React hears nothing about it.
532
+ const [hovered, setHovered] = useState<CalendarDay | null>(null);
533
+
534
+ const weekStart = weekStartsOn ?? localeWeekStart(locale);
535
+ const weeks = useMemo(
536
+ () => monthGrid(visibleMonth, weekStart),
537
+ [visibleMonth, weekStart],
538
+ );
539
+ const weekdays = useMemo(
540
+ () => weekdayLabels(locale, weekStart),
541
+ [locale, weekStart],
542
+ );
543
+
544
+ const isBlocked = (day: CalendarDay): boolean => {
545
+ if (minDay && day < minDay) return true;
546
+ if (maxDay && day > maxDay) return true;
547
+ return isDateBlocked ? Boolean(isDateBlocked(day, dayParts(day))) : false;
548
+ };
549
+
550
+ const pending = isRange && Boolean(range?.start && !range.end);
551
+
552
+ // The first blocked day after a half-picked start, which is where the range
553
+ // has to stop. Scanned once per render over the days the grid can actually
554
+ // show, rather than per candidate end: nothing outside the grid is clickable
555
+ // and the keyboard's focus is always on it.
556
+ const wall = firstBlockedAfter(
557
+ pending && !spanBlocked ? (range as DateRange).start : null,
558
+ weeks[5][6],
559
+ isBlocked,
560
+ );
561
+
562
+ const canEndAt = (day: CalendarDay): boolean =>
563
+ pending &&
564
+ day >= (range as DateRange).start! &&
565
+ !isBlocked(day) &&
566
+ (!wall || day < wall);
567
+
568
+ const preview = pending && hovered && canEndAt(hovered) ? hovered : null;
569
+ const bandStart = isRange ? (range as DateRange).start : null;
570
+ const bandEnd = isRange ? ((range as DateRange).end ?? preview) : null;
571
+
572
+ const setMonth = (next: CalendarMonth): void => {
573
+ if (month == null) setOwnMonth(next);
574
+ onMonthChange?.(next);
575
+ };
576
+
577
+ const commit = (next: CalendarDay | null | DateRange): void => {
578
+ if (value === undefined) setOwnValue(next);
579
+ onChange?.(
580
+ changeEvent(isRange ? 'date-range' : 'date', name, next) as never,
581
+ );
582
+ };
583
+
584
+ const show = (day: CalendarDay): void => {
585
+ setFocusedDay(day);
586
+ if (monthOf(day) !== visibleMonth) setMonth(monthOf(day));
587
+ };
588
+
589
+ const pick = (day: CalendarDay): void => {
590
+ if (isBlocked(day)) return;
591
+ if (isRange) {
592
+ const start = (range as DateRange).start;
593
+ if (!pending || (start && day < start)) commit({ start: day, end: null });
594
+ else if (canEndAt(day)) commit({ start, end: day });
595
+ else return;
596
+ } else {
597
+ commit(day);
598
+ }
599
+ show(day);
600
+ };
601
+
602
+ const moveFocus = (delta: number): void =>
603
+ show(clampDay(addDays(focusedDay, delta), minDay, maxDay));
604
+
605
+ const stepMonth = (delta: number): void => {
606
+ const next = addMonths(visibleMonth, delta);
607
+ setMonth(next);
608
+ setFocusedDay(clampDay(sameDayIn(next, focusedDay), minDay, maxDay));
609
+ };
610
+
611
+ /** Returns whether the key was the calendar's — a picker wrapping this one
612
+ * still owns Escape and Tab, and has no other way to tell. */
613
+ const handleKey = (ev: KeyboardEvent): boolean => {
614
+ switch (ev.keysym) {
615
+ case XK_LEFT:
616
+ moveFocus(-1);
617
+ return true;
618
+ case XK_RIGHT:
619
+ moveFocus(1);
620
+ return true;
621
+ case XK_UP:
622
+ moveFocus(-7);
623
+ return true;
624
+ case XK_DOWN:
625
+ moveFocus(7);
626
+ return true;
627
+ case XK_HOME:
628
+ moveFocus(-((dayParts(focusedDay).weekday - weekStart + 7) % 7));
629
+ return true;
630
+ case XK_END:
631
+ moveFocus(6 - ((dayParts(focusedDay).weekday - weekStart + 7) % 7));
632
+ return true;
633
+ case XK_PAGE_UP:
634
+ stepMonth(ev.shiftKey ? -12 : -1);
635
+ return true;
636
+ case XK_PAGE_DOWN:
637
+ stepMonth(ev.shiftKey ? 12 : 1);
638
+ return true;
639
+ case XK_RETURN:
640
+ pick(focusedDay);
641
+ return true;
642
+ default:
643
+ break;
644
+ }
645
+ if (ev.codepoint === 32) {
646
+ pick(focusedDay);
647
+ return true;
648
+ }
649
+ return false;
650
+ };
651
+
652
+ useImperativeHandle(ref, () => ({ handleKey }));
653
+
654
+ const canGoBack = !minDay || firstOfMonth(visibleMonth) > minDay;
655
+ const canGoOn = !maxDay || firstOfMonth(addMonths(visibleMonth, 1)) <= maxDay;
656
+
657
+ return hx(
658
+ 'box',
659
+ {
660
+ theme,
661
+ role: 'grid',
662
+ focusable,
663
+ onKeyDown: handleKey,
664
+ onFocus: () => setFocused(true),
665
+ onBlur: () => setFocused(false),
666
+ // the preview belongs to the pointer, and the pointer has left
667
+ onMouseLeave: pending ? () => setHovered(null) : undefined,
668
+ ...boxProps,
669
+ style: [s.root, style],
670
+ },
671
+ hx(
672
+ 'box',
673
+ { style: s.header },
674
+ React.createElement(NavButton, {
675
+ direction: -1,
676
+ disabled: !canGoBack,
677
+ theme,
678
+ onPress: () => stepMonth(-1),
679
+ }),
680
+ hx(
681
+ 'text',
682
+ { style: [s.title, { color: theme.text, fontSize: theme.fontSize }] },
683
+ formatMonth(visibleMonth, locale),
684
+ ),
685
+ React.createElement(NavButton, {
686
+ direction: 1,
687
+ disabled: !canGoOn,
688
+ theme,
689
+ onPress: () => stepMonth(1),
690
+ }),
691
+ ),
692
+ hx(
693
+ 'box',
694
+ { style: s.week },
695
+ weekdays.map((label, i) =>
696
+ hx(
697
+ 'box',
698
+ { key: i, style: s.weekdayCell },
699
+ hx(
700
+ 'text',
701
+ { style: [s.weekdayLabel, { color: theme.textMuted }] },
702
+ label,
703
+ ),
704
+ ),
705
+ ),
706
+ ),
707
+ weeks.map((days, w) =>
708
+ hx(
709
+ 'box',
710
+ { key: w, style: s.week },
711
+ days.map((day) => {
712
+ const inBand =
713
+ bandStart != null &&
714
+ bandEnd != null &&
715
+ bandStart !== bandEnd &&
716
+ day >= bandStart &&
717
+ day <= bandEnd;
718
+ return React.createElement(DayCell, {
719
+ key: day,
720
+ day,
721
+ theme,
722
+ dayContent,
723
+ onPick: pick,
724
+ onHover: pending ? setHovered : undefined,
725
+ band: inBand
726
+ ? { opensRight: day === bandStart, opensLeft: day === bandEnd }
727
+ : null,
728
+ state: {
729
+ blocked: isBlocked(day),
730
+ outside: monthOf(day) !== visibleMonth,
731
+ today: day === todayKey,
732
+ selected: isRange
733
+ ? day === bandStart || day === bandEnd
734
+ : day === single,
735
+ inRange: inBand,
736
+ preview: inBand && (range as DateRange).end == null,
737
+ focused: (focusVisible ?? focused) && day === focusedDay,
738
+ },
739
+ });
740
+ }),
741
+ ),
742
+ ),
743
+ );
744
+ }