@slipstream-ui/core 0.8.0 → 0.10.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 (379) hide show
  1. package/dist/index.d.mts +203 -8
  2. package/dist/index.d.ts +203 -8
  3. package/dist/index.js +1737 -965
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1729 -961
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +2 -2
  8. package/dist/manifests/alert.manifest.json +1 -1
  9. package/dist/manifests/announcement-bar.manifest.json +1 -1
  10. package/dist/manifests/app-shell.manifest.json +1 -1
  11. package/dist/manifests/applied-filters.manifest.json +1 -1
  12. package/dist/manifests/article-card.manifest.json +1 -1
  13. package/dist/manifests/auth-layout.manifest.json +1 -1
  14. package/dist/manifests/autocomplete.manifest.json +1 -1
  15. package/dist/manifests/avatar.manifest.json +1 -1
  16. package/dist/manifests/badge.manifest.json +1 -1
  17. package/dist/manifests/block.manifest.json +1 -1
  18. package/dist/manifests/bottom-nav.manifest.json +1 -1
  19. package/dist/manifests/breadcrumb.manifest.json +1 -1
  20. package/dist/manifests/button-group.manifest.json +1 -1
  21. package/dist/manifests/button.manifest.json +1 -1
  22. package/dist/manifests/calendar.manifest.json +175 -0
  23. package/dist/manifests/card.manifest.json +1 -1
  24. package/dist/manifests/checkbox.manifest.json +1 -1
  25. package/dist/manifests/comparison-table.manifest.json +1 -1
  26. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  27. package/dist/manifests/contact-strip.manifest.json +1 -1
  28. package/dist/manifests/container.manifest.json +1 -1
  29. package/dist/manifests/cta-section.manifest.json +1 -1
  30. package/dist/manifests/data-table.manifest.json +8 -1
  31. package/dist/manifests/date-picker-popover.manifest.json +202 -0
  32. package/dist/manifests/date-picker.manifest.json +1 -1
  33. package/dist/manifests/date-range-picker.manifest.json +1 -1
  34. package/dist/manifests/deal-card.manifest.json +1 -1
  35. package/dist/manifests/dialog.manifest.json +1 -1
  36. package/dist/manifests/document-card.manifest.json +1 -1
  37. package/dist/manifests/drawer.manifest.json +1 -1
  38. package/dist/manifests/empty-state.manifest.json +1 -1
  39. package/dist/manifests/entity-card.manifest.json +1 -1
  40. package/dist/manifests/feature-grid.manifest.json +1 -1
  41. package/dist/manifests/feature-row.manifest.json +1 -1
  42. package/dist/manifests/fieldset.manifest.json +1 -1
  43. package/dist/manifests/file-upload.manifest.json +1 -1
  44. package/dist/manifests/filter-bar.manifest.json +1 -1
  45. package/dist/manifests/filter-chips.manifest.json +13 -1
  46. package/dist/manifests/filter-panel.manifest.json +1 -1
  47. package/dist/manifests/flex.manifest.json +1 -1
  48. package/dist/manifests/form-field.manifest.json +1 -1
  49. package/dist/manifests/form-layout.manifest.json +1 -1
  50. package/dist/manifests/form.manifest.json +1 -1
  51. package/dist/manifests/grid.manifest.json +1 -1
  52. package/dist/manifests/heading.manifest.json +1 -1
  53. package/dist/manifests/hero.manifest.json +1 -1
  54. package/dist/manifests/image.manifest.json +142 -0
  55. package/dist/manifests/input-group.manifest.json +1 -1
  56. package/dist/manifests/input.manifest.json +1 -1
  57. package/dist/manifests/label.manifest.json +1 -1
  58. package/dist/manifests/link-tabs.manifest.json +1 -1
  59. package/dist/manifests/link.manifest.json +1 -1
  60. package/dist/manifests/list.manifest.json +1 -1
  61. package/dist/manifests/load-more.manifest.json +1 -1
  62. package/dist/manifests/logo-cloud.manifest.json +1 -1
  63. package/dist/manifests/menu.manifest.json +1 -1
  64. package/dist/manifests/metric-card.manifest.json +1 -1
  65. package/dist/manifests/multi-select.manifest.json +1 -1
  66. package/dist/manifests/newsletter.manifest.json +1 -1
  67. package/dist/manifests/page-header.manifest.json +1 -1
  68. package/dist/manifests/pagination.manifest.json +1 -1
  69. package/dist/manifests/password-input.manifest.json +1 -1
  70. package/dist/manifests/popover.manifest.json +86 -4
  71. package/dist/manifests/process-steps.manifest.json +1 -1
  72. package/dist/manifests/progress.manifest.json +1 -1
  73. package/dist/manifests/prose.manifest.json +1 -1
  74. package/dist/manifests/radio.manifest.json +1 -1
  75. package/dist/manifests/range-slider.manifest.json +1 -1
  76. package/dist/manifests/search.manifest.json +1 -1
  77. package/dist/manifests/section-heading.manifest.json +1 -1
  78. package/dist/manifests/section.manifest.json +1 -1
  79. package/dist/manifests/segmented-control.manifest.json +1 -1
  80. package/dist/manifests/select-menu.manifest.json +1 -1
  81. package/dist/manifests/select.manifest.json +8 -1
  82. package/dist/manifests/separator.manifest.json +1 -1
  83. package/dist/manifests/site-footer.manifest.json +1 -1
  84. package/dist/manifests/site-header.manifest.json +13 -3
  85. package/dist/manifests/skeleton.manifest.json +1 -1
  86. package/dist/manifests/spinner.manifest.json +1 -1
  87. package/dist/manifests/stat-band.manifest.json +1 -1
  88. package/dist/manifests/stepper.manifest.json +7 -1
  89. package/dist/manifests/switch.manifest.json +1 -1
  90. package/dist/manifests/table-card.manifest.json +1 -1
  91. package/dist/manifests/table-of-contents.manifest.json +1 -1
  92. package/dist/manifests/table.manifest.json +1 -1
  93. package/dist/manifests/tabs.manifest.json +1 -1
  94. package/dist/manifests/testimonial.manifest.json +1 -1
  95. package/dist/manifests/text.manifest.json +1 -1
  96. package/dist/manifests/textarea.manifest.json +1 -1
  97. package/dist/manifests/theme-toggle.manifest.json +1 -1
  98. package/dist/manifests/time-picker.manifest.json +1 -1
  99. package/dist/manifests/timeline.manifest.json +1 -1
  100. package/dist/manifests/toast.manifest.json +1 -1
  101. package/dist/manifests/tombstone-card.manifest.json +1 -1
  102. package/dist/manifests/tooltip.manifest.json +12 -1
  103. package/dist/src/components/accordion/Accordion.js +26 -19
  104. package/dist/src/components/accordion/Accordion.js.map +1 -1
  105. package/dist/src/components/accordion/Accordion.mjs +26 -19
  106. package/dist/src/components/accordion/Accordion.mjs.map +1 -1
  107. package/dist/src/components/alert/Alert.js +1 -1
  108. package/dist/src/components/alert/Alert.js.map +1 -1
  109. package/dist/src/components/alert/Alert.mjs +1 -1
  110. package/dist/src/components/alert/Alert.mjs.map +1 -1
  111. package/dist/src/components/app-shell/AppShell.js +1 -1
  112. package/dist/src/components/app-shell/AppShell.js.map +1 -1
  113. package/dist/src/components/app-shell/AppShell.mjs +1 -1
  114. package/dist/src/components/app-shell/AppShell.mjs.map +1 -1
  115. package/dist/src/components/article-card/ArticleCard.js +2 -2
  116. package/dist/src/components/article-card/ArticleCard.js.map +1 -1
  117. package/dist/src/components/article-card/ArticleCard.mjs +2 -2
  118. package/dist/src/components/article-card/ArticleCard.mjs.map +1 -1
  119. package/dist/src/components/calendar/Calendar.d.ts +34 -0
  120. package/dist/src/components/calendar/Calendar.js +233 -0
  121. package/dist/src/components/calendar/Calendar.js.map +1 -0
  122. package/dist/src/components/calendar/Calendar.mjs +208 -0
  123. package/dist/src/components/calendar/Calendar.mjs.map +1 -0
  124. package/dist/src/components/calendar/index.d.ts +1 -0
  125. package/dist/src/components/calendar/index.js +23 -0
  126. package/dist/src/components/calendar/index.js.map +1 -0
  127. package/dist/src/components/calendar/index.mjs +2 -0
  128. package/dist/src/components/calendar/index.mjs.map +1 -0
  129. package/dist/src/components/checkbox/Checkbox.js +1 -1
  130. package/dist/src/components/checkbox/Checkbox.js.map +1 -1
  131. package/dist/src/components/checkbox/Checkbox.mjs +1 -1
  132. package/dist/src/components/checkbox/Checkbox.mjs.map +1 -1
  133. package/dist/src/components/comparison-table/ComparisonTable.js +1 -1
  134. package/dist/src/components/comparison-table/ComparisonTable.js.map +1 -1
  135. package/dist/src/components/comparison-table/ComparisonTable.mjs +1 -1
  136. package/dist/src/components/comparison-table/ComparisonTable.mjs.map +1 -1
  137. package/dist/src/components/cta-section/CTASection.js +1 -1
  138. package/dist/src/components/cta-section/CTASection.js.map +1 -1
  139. package/dist/src/components/cta-section/CTASection.mjs +1 -1
  140. package/dist/src/components/cta-section/CTASection.mjs.map +1 -1
  141. package/dist/src/components/data-table/DataTable.d.ts +3 -1
  142. package/dist/src/components/data-table/DataTable.js +2 -4
  143. package/dist/src/components/data-table/DataTable.js.map +1 -1
  144. package/dist/src/components/data-table/DataTable.mjs +2 -4
  145. package/dist/src/components/data-table/DataTable.mjs.map +1 -1
  146. package/dist/src/components/date-picker-popover/DatePickerPopover.d.ts +33 -0
  147. package/dist/src/components/date-picker-popover/DatePickerPopover.js +117 -0
  148. package/dist/src/components/date-picker-popover/DatePickerPopover.js.map +1 -0
  149. package/dist/src/components/date-picker-popover/DatePickerPopover.mjs +83 -0
  150. package/dist/src/components/date-picker-popover/DatePickerPopover.mjs.map +1 -0
  151. package/dist/src/components/date-picker-popover/index.d.ts +1 -0
  152. package/dist/src/components/date-picker-popover/index.js +23 -0
  153. package/dist/src/components/date-picker-popover/index.js.map +1 -0
  154. package/dist/src/components/date-picker-popover/index.mjs +2 -0
  155. package/dist/src/components/date-picker-popover/index.mjs.map +1 -0
  156. package/dist/src/components/drawer/Drawer.js +2 -1
  157. package/dist/src/components/drawer/Drawer.js.map +1 -1
  158. package/dist/src/components/drawer/Drawer.mjs +2 -1
  159. package/dist/src/components/drawer/Drawer.mjs.map +1 -1
  160. package/dist/src/components/filter-chips/FilterChips.d.ts +4 -0
  161. package/dist/src/components/filter-chips/FilterChips.js +35 -4
  162. package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
  163. package/dist/src/components/filter-chips/FilterChips.mjs +35 -4
  164. package/dist/src/components/filter-chips/FilterChips.mjs.map +1 -1
  165. package/dist/src/components/image/Image.d.ts +34 -0
  166. package/dist/src/components/image/Image.js +75 -0
  167. package/dist/src/components/image/Image.js.map +1 -0
  168. package/dist/src/components/image/Image.mjs +41 -0
  169. package/dist/src/components/image/Image.mjs.map +1 -0
  170. package/dist/src/components/image/index.d.ts +1 -0
  171. package/dist/src/components/image/index.js +29 -0
  172. package/dist/src/components/image/index.js.map +1 -0
  173. package/dist/src/components/image/index.mjs +5 -0
  174. package/dist/src/components/image/index.mjs.map +1 -0
  175. package/dist/src/components/link/Link.js +4 -4
  176. package/dist/src/components/link/Link.js.map +1 -1
  177. package/dist/src/components/link/Link.mjs +4 -4
  178. package/dist/src/components/link/Link.mjs.map +1 -1
  179. package/dist/src/components/page-header/PageHeader.js +1 -1
  180. package/dist/src/components/page-header/PageHeader.js.map +1 -1
  181. package/dist/src/components/page-header/PageHeader.mjs +1 -1
  182. package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
  183. package/dist/src/components/popover/Popover.d.ts +36 -3
  184. package/dist/src/components/popover/Popover.js +118 -22
  185. package/dist/src/components/popover/Popover.js.map +1 -1
  186. package/dist/src/components/popover/Popover.mjs +117 -22
  187. package/dist/src/components/popover/Popover.mjs.map +1 -1
  188. package/dist/src/components/radio/Radio.js +1 -1
  189. package/dist/src/components/radio/Radio.js.map +1 -1
  190. package/dist/src/components/radio/Radio.mjs +1 -1
  191. package/dist/src/components/radio/Radio.mjs.map +1 -1
  192. package/dist/src/components/range-slider/RangeSlider.js +3 -3
  193. package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
  194. package/dist/src/components/range-slider/RangeSlider.mjs +3 -3
  195. package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
  196. package/dist/src/components/section-heading/SectionHeading.js +1 -1
  197. package/dist/src/components/section-heading/SectionHeading.js.map +1 -1
  198. package/dist/src/components/section-heading/SectionHeading.mjs +1 -1
  199. package/dist/src/components/section-heading/SectionHeading.mjs.map +1 -1
  200. package/dist/src/components/select/Select.d.ts +10 -0
  201. package/dist/src/components/select/Select.js +2 -2
  202. package/dist/src/components/select/Select.js.map +1 -1
  203. package/dist/src/components/select/Select.mjs +2 -2
  204. package/dist/src/components/select/Select.mjs.map +1 -1
  205. package/dist/src/components/site-header/SiteHeader.d.ts +25 -3
  206. package/dist/src/components/site-header/SiteHeader.js +141 -6
  207. package/dist/src/components/site-header/SiteHeader.js.map +1 -1
  208. package/dist/src/components/site-header/SiteHeader.mjs +141 -6
  209. package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
  210. package/dist/src/components/stepper/Stepper.d.ts +18 -0
  211. package/dist/src/components/stepper/Stepper.js +2 -1
  212. package/dist/src/components/stepper/Stepper.js.map +1 -1
  213. package/dist/src/components/stepper/Stepper.mjs +2 -1
  214. package/dist/src/components/stepper/Stepper.mjs.map +1 -1
  215. package/dist/src/components/timeline/Timeline.js +17 -13
  216. package/dist/src/components/timeline/Timeline.js.map +1 -1
  217. package/dist/src/components/timeline/Timeline.mjs +17 -13
  218. package/dist/src/components/timeline/Timeline.mjs.map +1 -1
  219. package/dist/src/components/tooltip/Tooltip.d.ts +5 -0
  220. package/dist/src/components/tooltip/Tooltip.js +9 -2
  221. package/dist/src/components/tooltip/Tooltip.js.map +1 -1
  222. package/dist/src/components/tooltip/Tooltip.mjs +9 -2
  223. package/dist/src/components/tooltip/Tooltip.mjs.map +1 -1
  224. package/dist/src/index.d.ts +3 -0
  225. package/dist/src/utils/date.d.ts +32 -0
  226. package/dist/src/utils/date.js +171 -0
  227. package/dist/src/utils/date.js.map +1 -0
  228. package/dist/src/utils/date.mjs +134 -0
  229. package/dist/src/utils/date.mjs.map +1 -0
  230. package/dist/src/utils/position.d.ts +42 -0
  231. package/dist/src/utils/position.js +91 -0
  232. package/dist/src/utils/position.js.map +1 -0
  233. package/dist/src/utils/position.mjs +67 -0
  234. package/dist/src/utils/position.mjs.map +1 -0
  235. package/dist/styles-full.css +1 -1
  236. package/dist/styles.css +1 -1
  237. package/package.json +1 -1
  238. package/src/components/accordion/Accordion.test.tsx +14 -3
  239. package/src/components/accordion/Accordion.tsx +34 -21
  240. package/src/components/alert/Alert.tsx +1 -1
  241. package/src/components/app-shell/AppShell.tsx +1 -1
  242. package/src/components/article-card/ArticleCard.tsx +2 -2
  243. package/src/components/calendar/Calendar.test.tsx +277 -0
  244. package/src/components/calendar/Calendar.tsx +273 -0
  245. package/src/components/calendar/index.ts +1 -0
  246. package/src/components/checkbox/Checkbox.tsx +1 -1
  247. package/src/components/comparison-table/ComparisonTable.tsx +1 -1
  248. package/src/components/cta-section/CTASection.tsx +1 -1
  249. package/src/components/data-table/DataTable.test.tsx +21 -0
  250. package/src/components/data-table/DataTable.tsx +4 -1
  251. package/src/components/date-picker-popover/DatePickerPopover.test.tsx +223 -0
  252. package/src/components/date-picker-popover/DatePickerPopover.tsx +117 -0
  253. package/src/components/date-picker-popover/index.ts +1 -0
  254. package/src/components/drawer/Drawer.test.tsx +12 -0
  255. package/src/components/drawer/Drawer.tsx +8 -1
  256. package/src/components/filter-chips/FilterChips.test.tsx +11 -0
  257. package/src/components/filter-chips/FilterChips.tsx +40 -4
  258. package/src/components/image/Image.test.tsx +94 -0
  259. package/src/components/image/Image.tsx +71 -0
  260. package/src/components/image/index.ts +1 -0
  261. package/src/components/link/Link.test.tsx +2 -1
  262. package/src/components/link/Link.tsx +4 -4
  263. package/src/components/page-header/PageHeader.tsx +1 -1
  264. package/src/components/popover/Popover.test.tsx +307 -3
  265. package/src/components/popover/Popover.tsx +228 -91
  266. package/src/components/radio/Radio.tsx +1 -1
  267. package/src/components/range-slider/RangeSlider.tsx +3 -3
  268. package/src/components/section-heading/SectionHeading.tsx +1 -1
  269. package/src/components/select/Select.test.tsx +14 -0
  270. package/src/components/select/Select.tsx +7 -2
  271. package/src/components/site-header/SiteHeader.test.tsx +103 -1
  272. package/src/components/site-header/SiteHeader.tsx +220 -16
  273. package/src/components/stepper/Stepper.test.tsx +12 -0
  274. package/src/components/stepper/Stepper.tsx +15 -1
  275. package/src/components/timeline/Timeline.test.tsx +11 -0
  276. package/src/components/timeline/Timeline.tsx +13 -2
  277. package/src/components/tooltip/Tooltip.test.tsx +15 -0
  278. package/src/components/tooltip/Tooltip.tsx +19 -2
  279. package/src/index.ts +3 -0
  280. package/src/manifests/accordion.manifest.json +2 -2
  281. package/src/manifests/alert.manifest.json +1 -1
  282. package/src/manifests/announcement-bar.manifest.json +1 -1
  283. package/src/manifests/app-shell.manifest.json +1 -1
  284. package/src/manifests/applied-filters.manifest.json +1 -1
  285. package/src/manifests/article-card.manifest.json +1 -1
  286. package/src/manifests/auth-layout.manifest.json +1 -1
  287. package/src/manifests/autocomplete.manifest.json +1 -1
  288. package/src/manifests/avatar.manifest.json +1 -1
  289. package/src/manifests/badge.manifest.json +1 -1
  290. package/src/manifests/block.manifest.json +1 -1
  291. package/src/manifests/bottom-nav.manifest.json +1 -1
  292. package/src/manifests/breadcrumb.manifest.json +1 -1
  293. package/src/manifests/button-group.manifest.json +1 -1
  294. package/src/manifests/button.manifest.json +1 -1
  295. package/src/manifests/calendar.manifest.json +175 -0
  296. package/src/manifests/card.manifest.json +1 -1
  297. package/src/manifests/checkbox.manifest.json +1 -1
  298. package/src/manifests/comparison-table.manifest.json +1 -1
  299. package/src/manifests/confirm-dialog.manifest.json +1 -1
  300. package/src/manifests/contact-strip.manifest.json +1 -1
  301. package/src/manifests/container.manifest.json +1 -1
  302. package/src/manifests/cta-section.manifest.json +1 -1
  303. package/src/manifests/data-table.manifest.json +8 -1
  304. package/src/manifests/date-picker-popover.manifest.json +202 -0
  305. package/src/manifests/date-picker.manifest.json +1 -1
  306. package/src/manifests/date-range-picker.manifest.json +1 -1
  307. package/src/manifests/deal-card.manifest.json +1 -1
  308. package/src/manifests/dialog.manifest.json +1 -1
  309. package/src/manifests/document-card.manifest.json +1 -1
  310. package/src/manifests/drawer.manifest.json +1 -1
  311. package/src/manifests/empty-state.manifest.json +1 -1
  312. package/src/manifests/entity-card.manifest.json +1 -1
  313. package/src/manifests/feature-grid.manifest.json +1 -1
  314. package/src/manifests/feature-row.manifest.json +1 -1
  315. package/src/manifests/fieldset.manifest.json +1 -1
  316. package/src/manifests/file-upload.manifest.json +1 -1
  317. package/src/manifests/filter-bar.manifest.json +1 -1
  318. package/src/manifests/filter-chips.manifest.json +13 -1
  319. package/src/manifests/filter-panel.manifest.json +1 -1
  320. package/src/manifests/flex.manifest.json +1 -1
  321. package/src/manifests/form-field.manifest.json +1 -1
  322. package/src/manifests/form-layout.manifest.json +1 -1
  323. package/src/manifests/form.manifest.json +1 -1
  324. package/src/manifests/grid.manifest.json +1 -1
  325. package/src/manifests/heading.manifest.json +1 -1
  326. package/src/manifests/hero.manifest.json +1 -1
  327. package/src/manifests/image.manifest.json +142 -0
  328. package/src/manifests/input-group.manifest.json +1 -1
  329. package/src/manifests/input.manifest.json +1 -1
  330. package/src/manifests/label.manifest.json +1 -1
  331. package/src/manifests/link-tabs.manifest.json +1 -1
  332. package/src/manifests/link.manifest.json +1 -1
  333. package/src/manifests/list.manifest.json +1 -1
  334. package/src/manifests/load-more.manifest.json +1 -1
  335. package/src/manifests/logo-cloud.manifest.json +1 -1
  336. package/src/manifests/menu.manifest.json +1 -1
  337. package/src/manifests/metric-card.manifest.json +1 -1
  338. package/src/manifests/multi-select.manifest.json +1 -1
  339. package/src/manifests/newsletter.manifest.json +1 -1
  340. package/src/manifests/page-header.manifest.json +1 -1
  341. package/src/manifests/pagination.manifest.json +1 -1
  342. package/src/manifests/password-input.manifest.json +1 -1
  343. package/src/manifests/popover.manifest.json +86 -4
  344. package/src/manifests/process-steps.manifest.json +1 -1
  345. package/src/manifests/progress.manifest.json +1 -1
  346. package/src/manifests/prose.manifest.json +1 -1
  347. package/src/manifests/radio.manifest.json +1 -1
  348. package/src/manifests/range-slider.manifest.json +1 -1
  349. package/src/manifests/search.manifest.json +1 -1
  350. package/src/manifests/section-heading.manifest.json +1 -1
  351. package/src/manifests/section.manifest.json +1 -1
  352. package/src/manifests/segmented-control.manifest.json +1 -1
  353. package/src/manifests/select-menu.manifest.json +1 -1
  354. package/src/manifests/select.manifest.json +8 -1
  355. package/src/manifests/separator.manifest.json +1 -1
  356. package/src/manifests/site-footer.manifest.json +1 -1
  357. package/src/manifests/site-header.manifest.json +13 -3
  358. package/src/manifests/skeleton.manifest.json +1 -1
  359. package/src/manifests/spinner.manifest.json +1 -1
  360. package/src/manifests/stat-band.manifest.json +1 -1
  361. package/src/manifests/stepper.manifest.json +7 -1
  362. package/src/manifests/switch.manifest.json +1 -1
  363. package/src/manifests/table-card.manifest.json +1 -1
  364. package/src/manifests/table-of-contents.manifest.json +1 -1
  365. package/src/manifests/table.manifest.json +1 -1
  366. package/src/manifests/tabs.manifest.json +1 -1
  367. package/src/manifests/testimonial.manifest.json +1 -1
  368. package/src/manifests/text.manifest.json +1 -1
  369. package/src/manifests/textarea.manifest.json +1 -1
  370. package/src/manifests/theme-toggle.manifest.json +1 -1
  371. package/src/manifests/time-picker.manifest.json +1 -1
  372. package/src/manifests/timeline.manifest.json +1 -1
  373. package/src/manifests/toast.manifest.json +1 -1
  374. package/src/manifests/tombstone-card.manifest.json +1 -1
  375. package/src/manifests/tooltip.manifest.json +12 -1
  376. package/src/utils/date.test.ts +190 -0
  377. package/src/utils/date.ts +162 -0
  378. package/src/utils/position.test.ts +227 -0
  379. package/src/utils/position.ts +129 -0
@@ -4,7 +4,7 @@
4
4
  "tier": "organism",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "site-header",
9
9
  "exportName": "SiteHeader",
10
10
  "description": "Marketing/site header: sticky bar with brand, horizontal navigation with prefix-aware active states, right-aligned actions and a mobile drawer.",
@@ -20,7 +20,7 @@
20
20
  "name": "items",
21
21
  "type": "SiteNavItem[]",
22
22
  "required": true,
23
- "description": "Primary nav: { href, label, external? }."
23
+ "description": "Primary nav. A plain item is { href, label, external? }; an item with `columns` renders as a mega-panel disclosure (desktop) and a <details> group (mobile)."
24
24
  },
25
25
  {
26
26
  "name": "activeHref",
@@ -133,6 +133,11 @@
133
133
  "title": "Marketing header",
134
134
  "code": "<SiteHeader\n brand={<img src=\"/logo.svg\" alt=\"Acme\" className=\"h-8\" />}\n items={[{ href: '/docs', label: 'Docs' }, { href: '/pricing', label: 'Pricing' }]}\n activeHref={pathname}\n linkComponent={RouterLink}\n actions={<ThemeToggle />}\n/>",
135
135
  "description": "Prefix-active nav with a mobile drawer."
136
+ },
137
+ {
138
+ "title": "Persona mega menus",
139
+ "code": "<SiteHeader\n brand={<span>Acme</span>}\n items={[\n {\n label: 'Dancers',\n columns: [\n {\n heading: 'Plan your season',\n items: [\n { href: '/events', label: 'All events', description: 'Every genre in Utah' },\n { href: '/deadlines', label: 'Deadlines' },\n ],\n },\n ],\n },\n { href: '/directory', label: 'Directory' },\n ]}\n activeHref={pathname}\n/>",
140
+ "description": "Nested persona panels on desktop and <details> groups in the mobile drawer."
136
141
  }
137
142
  ],
138
143
  "antiPatterns": [
@@ -150,8 +155,13 @@
150
155
  },
151
156
  {
152
157
  "feature": "Mobile navigation",
153
- "implementation": "Burger opens a focus-trapped Drawer with the same items",
158
+ "implementation": "Burger opens a focus-trapped Drawer with the same items; nested items render as native <details> disclosures",
154
159
  "userRequirements": "Keep the same item list for both breakpoints"
160
+ },
161
+ {
162
+ "feature": "Mega panels",
163
+ "implementation": "Trigger mirrors aria-expanded/aria-controls; panels open on hover or click, stay open while tabbing, close on Escape or an outside pointer",
164
+ "userRequirements": "Use headings and short descriptions so the panel is scannable"
155
165
  }
156
166
  ],
157
167
  "contentGuidelines": [
@@ -126,7 +126,7 @@
126
126
  ],
127
127
  "package": "@slipstream-ui/core",
128
128
  "importPath": "@slipstream-ui/core",
129
- "version": "0.8.0",
129
+ "version": "0.10.0",
130
130
  "sourceDir": "skeleton",
131
131
  "exportName": "Skeleton"
132
132
  }
@@ -52,7 +52,7 @@
52
52
  ],
53
53
  "package": "@slipstream-ui/core",
54
54
  "importPath": "@slipstream-ui/core",
55
- "version": "0.8.0",
55
+ "version": "0.10.0",
56
56
  "sourceDir": "spinner",
57
57
  "exportName": "Spinner"
58
58
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "stat-band",
9
9
  "exportName": "StatBand",
10
10
  "description": "Semantic description list of headline stats with labels, optional hints and column presets.",
@@ -77,6 +77,12 @@
77
77
  "type": "(index: number) => void",
78
78
  "required": false,
79
79
  "description": "Makes steps clickable (for revisit flows)."
80
+ },
81
+ {
82
+ "name": "labels",
83
+ "type": "{ completed?: string; current?: string; upcoming?: string }",
84
+ "required": false,
85
+ "description": "Screen-reader state suffixes for each step. Default to the English \" (completed)\", \" (current step)\" and \" (upcoming)\"."
80
86
  }
81
87
  ],
82
88
  "examples": [
@@ -153,7 +159,7 @@
153
159
  ],
154
160
  "package": "@slipstream-ui/core",
155
161
  "importPath": "@slipstream-ui/core",
156
- "version": "0.8.0",
162
+ "version": "0.10.0",
157
163
  "sourceDir": "stepper",
158
164
  "exportName": "Stepper"
159
165
  }
@@ -102,7 +102,7 @@
102
102
  ],
103
103
  "package": "@slipstream-ui/core",
104
104
  "importPath": "@slipstream-ui/core",
105
- "version": "0.8.0",
105
+ "version": "0.10.0",
106
106
  "sourceDir": "switch",
107
107
  "exportName": "Switch"
108
108
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "table-card",
9
9
  "exportName": "TableCard",
10
10
  "description": "Table shell with title/description, header actions, optional toolbar, edge-to-edge body and a footer row.",
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "table-of-contents",
9
9
  "exportName": "TableOfContents",
10
10
  "description": "Sticky 'On this page' navigation with real anchor links, nested levels and aria-current, plus a useScrollSpy hook for the active heading.",
@@ -78,7 +78,7 @@
78
78
  ],
79
79
  "package": "@slipstream-ui/core",
80
80
  "importPath": "@slipstream-ui/core",
81
- "version": "0.8.0",
81
+ "version": "0.10.0",
82
82
  "sourceDir": "table",
83
83
  "exportName": "Table"
84
84
  }
@@ -138,7 +138,7 @@
138
138
  ],
139
139
  "package": "@slipstream-ui/core",
140
140
  "importPath": "@slipstream-ui/core",
141
- "version": "0.8.0",
141
+ "version": "0.10.0",
142
142
  "sourceDir": "tabs",
143
143
  "exportName": "Tabs"
144
144
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "testimonial",
9
9
  "exportName": "Testimonial",
10
10
  "description": "Semantic written testimonial with quote, person, role, company, avatar and logo slots.",
@@ -107,7 +107,7 @@
107
107
  ],
108
108
  "package": "@slipstream-ui/core",
109
109
  "importPath": "@slipstream-ui/core",
110
- "version": "0.8.0",
110
+ "version": "0.10.0",
111
111
  "sourceDir": "text",
112
112
  "exportName": "Text"
113
113
  }
@@ -102,7 +102,7 @@
102
102
  ],
103
103
  "package": "@slipstream-ui/core",
104
104
  "importPath": "@slipstream-ui/core",
105
- "version": "0.8.0",
105
+ "version": "0.10.0",
106
106
  "sourceDir": "textarea",
107
107
  "exportName": "Textarea"
108
108
  }
@@ -112,7 +112,7 @@
112
112
  ],
113
113
  "package": "@slipstream-ui/core",
114
114
  "importPath": "@slipstream-ui/core",
115
- "version": "0.8.0",
115
+ "version": "0.10.0",
116
116
  "sourceDir": "theme-toggle",
117
117
  "exportName": "ThemeToggle"
118
118
  }
@@ -87,7 +87,7 @@
87
87
  ],
88
88
  "package": "@slipstream-ui/core",
89
89
  "importPath": "@slipstream-ui/core",
90
- "version": "0.8.0",
90
+ "version": "0.10.0",
91
91
  "sourceDir": "time-picker",
92
92
  "exportName": "TimePicker"
93
93
  }
@@ -63,7 +63,7 @@
63
63
  ],
64
64
  "package": "@slipstream-ui/core",
65
65
  "importPath": "@slipstream-ui/core",
66
- "version": "0.8.0",
66
+ "version": "0.10.0",
67
67
  "sourceDir": "timeline",
68
68
  "exportName": "Timeline"
69
69
  }
@@ -161,7 +161,7 @@
161
161
  ],
162
162
  "package": "@slipstream-ui/core",
163
163
  "importPath": "@slipstream-ui/core",
164
- "version": "0.8.0",
164
+ "version": "0.10.0",
165
165
  "sourceDir": "toast",
166
166
  "exportName": "ToastProvider"
167
167
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.8.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "tombstone-card",
9
9
  "exportName": "TombstoneCard",
10
10
  "description": "Placeholder card for archived, closed or unavailable marketplace items.",
@@ -25,6 +25,17 @@
25
25
  "required": false,
26
26
  "description": "Delay before showing on hover, in milliseconds"
27
27
  },
28
+ {
29
+ "name": "variant",
30
+ "type": "'default' | 'inverse'",
31
+ "required": false,
32
+ "defaultValue": "default",
33
+ "description": "Bubble palette. default uses the popover surface; inverse flips it (dark bubble in light mode, light bubble in dark mode).",
34
+ "enum": [
35
+ "default",
36
+ "inverse"
37
+ ]
38
+ },
28
39
  {
29
40
  "name": "children",
30
41
  "type": "ReactNode",
@@ -109,7 +120,7 @@
109
120
  ],
110
121
  "package": "@slipstream-ui/core",
111
122
  "importPath": "@slipstream-ui/core",
112
- "version": "0.8.0",
123
+ "version": "0.10.0",
113
124
  "sourceDir": "tooltip",
114
125
  "exportName": "Tooltip"
115
126
  }
@@ -0,0 +1,190 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import {
3
+ addDays,
4
+ addMonths,
5
+ calendarWeeks,
6
+ dateKeyOf,
7
+ daysInMonth,
8
+ formatDateLabel,
9
+ isValidDateKey,
10
+ monthLabel,
11
+ moveDateKey,
12
+ parseDateKey,
13
+ startOfWeek,
14
+ todayKey,
15
+ weekdayLabels,
16
+ } from './date';
17
+
18
+ describe('date keys', () => {
19
+ it('builds and parses a key', () => {
20
+ expect(dateKeyOf(2026, 10, 13)).toBe('2026-11-13');
21
+ expect(parseDateKey('2026-11-13')).toEqual({ year: 2026, month: 10, day: 13 });
22
+ });
23
+
24
+ it('rejects impossible dates', () => {
25
+ expect(isValidDateKey('2026-13-01')).toBe(false);
26
+ expect(isValidDateKey('2026-02-30')).toBe(false);
27
+ expect(isValidDateKey('2026-1-1')).toBe(false);
28
+ expect(isValidDateKey('not-a-date')).toBe(false);
29
+ expect(parseDateKey('2026-02-30')).toBeNull();
30
+ });
31
+
32
+ it('accepts a leap day only in a leap year', () => {
33
+ expect(isValidDateKey('2028-02-29')).toBe(true);
34
+ expect(isValidDateKey('2026-02-29')).toBe(false);
35
+ });
36
+
37
+ it('round-trips today', () => {
38
+ const now = new Date(2026, 10, 13);
39
+ expect(todayKey(now)).toBe('2026-11-13');
40
+ });
41
+ });
42
+
43
+ describe('arithmetic', () => {
44
+ it('adds days across month and year boundaries', () => {
45
+ expect(addDays('2026-11-30', 1)).toBe('2026-12-01');
46
+ expect(addDays('2026-12-31', 1)).toBe('2027-01-01');
47
+ expect(addDays('2026-03-01', -1)).toBe('2026-02-28');
48
+ expect(addDays('2028-03-01', -1)).toBe('2028-02-29');
49
+ });
50
+
51
+ it('clamps the day when adding months', () => {
52
+ expect(addMonths('2026-01-31', 1)).toBe('2026-02-28');
53
+ expect(addMonths('2028-01-31', 1)).toBe('2028-02-29');
54
+ expect(addMonths('2026-03-31', -1)).toBe('2026-02-28');
55
+ expect(addMonths('2026-12-15', 1)).toBe('2027-01-15');
56
+ });
57
+ });
58
+
59
+ describe('weeks', () => {
60
+ it('starts on Sunday or Monday', () => {
61
+ expect(startOfWeek('2026-11-13', 0)).toBe('2026-11-08');
62
+ expect(startOfWeek('2026-11-13', 1)).toBe('2026-11-09');
63
+ });
64
+
65
+ it('returns six weeks of seven days with neighbour flags', () => {
66
+ const weeks = calendarWeeks(2026, 10, 0);
67
+ expect(weeks).toHaveLength(6);
68
+ expect(weeks.every((week) => week.length === 7)).toBe(true);
69
+ expect(weeks[0]?.[0]?.key).toBe('2026-11-01');
70
+ expect(weeks[0]?.[0]?.inMonth).toBe(true);
71
+ expect(weeks.flat().filter((day) => day.inMonth)).toHaveLength(30);
72
+ });
73
+
74
+ it('marks leading days from the previous month', () => {
75
+ const weeks = calendarWeeks(2026, 10, 1);
76
+ expect(weeks[0]?.[0]?.key).toBe('2026-10-26');
77
+ expect(weeks[0]?.[0]?.inMonth).toBe(false);
78
+ });
79
+ });
80
+
81
+ describe('moveDateKey', () => {
82
+ it('moves by day and by week', () => {
83
+ expect(moveDateKey('2026-11-13', 'left')).toBe('2026-11-12');
84
+ expect(moveDateKey('2026-11-13', 'right')).toBe('2026-11-14');
85
+ expect(moveDateKey('2026-11-13', 'up')).toBe('2026-11-06');
86
+ expect(moveDateKey('2026-11-13', 'down')).toBe('2026-11-20');
87
+ });
88
+
89
+ it('moves to week bounds for either week start', () => {
90
+ expect(moveDateKey('2026-11-13', 'home', 0)).toBe('2026-11-08');
91
+ expect(moveDateKey('2026-11-13', 'end', 0)).toBe('2026-11-14');
92
+ expect(moveDateKey('2026-11-13', 'home', 1)).toBe('2026-11-09');
93
+ expect(moveDateKey('2026-11-13', 'end', 1)).toBe('2026-11-15');
94
+ });
95
+
96
+ it('pages months with clamping', () => {
97
+ expect(moveDateKey('2026-01-31', 'pagedown')).toBe('2026-02-28');
98
+ expect(moveDateKey('2026-03-31', 'pageup')).toBe('2026-02-28');
99
+ expect(moveDateKey('2026-01-15', 'pageup')).toBe('2025-12-15');
100
+ });
101
+ });
102
+
103
+ describe('labels', () => {
104
+ it('formats month and weekday labels', () => {
105
+ expect(monthLabel(2026, 10, 'en-US')).toBe('November 2026');
106
+ expect(weekdayLabels('en-US', 0)).toHaveLength(7);
107
+ expect(weekdayLabels('en-US', 0)[0]).toBe('Sun');
108
+ expect(weekdayLabels('es-ES', 1)[0]).not.toBe('Sun');
109
+ });
110
+
111
+ it('formats a full date for screen readers', () => {
112
+ expect(formatDateLabel('2026-11-13', 'en-US')).toContain('2026');
113
+ expect(formatDateLabel('bad', 'en-US')).toBe('bad');
114
+ });
115
+ });
116
+
117
+ describe('daysInMonth', () => {
118
+ it('knows month lengths including leap years', () => {
119
+ expect(daysInMonth(2026, 1)).toBe(28);
120
+ expect(daysInMonth(2028, 1)).toBe(29);
121
+ expect(daysInMonth(2026, 7)).toBe(31);
122
+ expect(daysInMonth(2026, 11)).toBe(31);
123
+ expect(daysInMonth(2026, 3)).toBe(30);
124
+ });
125
+ });
126
+
127
+ describe('bad input', () => {
128
+ it('rejects impossible month and day numbers', () => {
129
+ expect(parseDateKey('2026-00-10')).toBeNull();
130
+ expect(parseDateKey('2026-13-01')).toBeNull();
131
+ expect(parseDateKey('2026-11-00')).toBeNull();
132
+ expect(parseDateKey('2026-11-32')).toBeNull();
133
+ expect(isValidDateKey('2026-00-10')).toBe(false);
134
+ expect(isValidDateKey('2026-11-00')).toBe(false);
135
+ });
136
+
137
+ it('rejects malformed shapes', () => {
138
+ expect(parseDateKey('')).toBeNull();
139
+ expect(parseDateKey('2026-11-13T00:00')).toBeNull();
140
+ expect(parseDateKey(' 2026-11-13')).toBeNull();
141
+ expect(parseDateKey('2026-11-13 ')).toBeNull();
142
+ expect(parseDateKey('20261113')).toBeNull();
143
+ });
144
+
145
+ it('returns the input unchanged instead of inventing a date', () => {
146
+ expect(addDays('nope', 1)).toBe('nope');
147
+ expect(addDays('2026-02-30', 1)).toBe('2026-02-30');
148
+ expect(addMonths('nope', 1)).toBe('nope');
149
+ expect(startOfWeek('nope')).toBe('nope');
150
+ expect(moveDateKey('nope', 'down')).toBe('nope');
151
+ });
152
+ });
153
+
154
+ describe('defaults and week grids', () => {
155
+ it('defaults to a Sunday week start', () => {
156
+ expect(startOfWeek('2026-11-13')).toBe('2026-11-08');
157
+ expect(moveDateKey('2026-11-13', 'home')).toBe('2026-11-08');
158
+ expect(weekdayLabels()[0]).toBe('Sun');
159
+ expect(monthLabel(2026, 10)).toBe('November 2026');
160
+ });
161
+
162
+ it('produces 42 consecutive days for every month', () => {
163
+ for (const [year, month] of [
164
+ [2026, 0],
165
+ [2026, 7],
166
+ [2028, 1],
167
+ [2026, 11],
168
+ ] as const) {
169
+ const weeks = calendarWeeks(year, month, 0);
170
+ const cells = weeks.flat();
171
+ expect(cells).toHaveLength(42);
172
+ for (let index = 1; index < cells.length; index += 1) {
173
+ expect(cells[index]?.key).toBe(addDays(cells[index - 1]?.key ?? '', 1));
174
+ }
175
+ expect(cells.filter((day) => day.inMonth)).toHaveLength(daysInMonth(year, month));
176
+ }
177
+ });
178
+
179
+ it('includes trailing days from the next month', () => {
180
+ const weeks = calendarWeeks(2026, 7, 0);
181
+ const last = weeks[5]?.[6];
182
+ expect(last?.inMonth).toBe(false);
183
+ expect(last?.key.startsWith('2026-09')).toBe(true);
184
+ expect(last?.day).toBe(Number(last?.key.slice(-2)));
185
+ });
186
+
187
+ it('round-trips today without an argument', () => {
188
+ expect(todayKey()).toBe(todayKey(new Date()));
189
+ });
190
+ });
@@ -0,0 +1,162 @@
1
+ export type DateParts = { year: number; month: number; day: number };
2
+
3
+ export type CalendarMove =
4
+ | 'left'
5
+ | 'right'
6
+ | 'up'
7
+ | 'down'
8
+ | 'home'
9
+ | 'end'
10
+ | 'pageup'
11
+ | 'pagedown';
12
+
13
+ const DAY_MS = 86_400_000;
14
+
15
+ function pad(value: number): string {
16
+ return String(value).padStart(2, '0');
17
+ }
18
+
19
+ /** Builds an ISO date key from zero-based month. */
20
+ export function dateKeyOf(year: number, month: number, day: number): string {
21
+ return `${year}-${pad(month + 1)}-${pad(day)}`;
22
+ }
23
+
24
+ /** True for a real calendar day in `YYYY-MM-DD` form. */
25
+ export function isValidDateKey(value: string): boolean {
26
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
27
+ const parts = parseDateKey(value);
28
+ if (!parts) return false;
29
+ return dateKeyOf(parts.year, parts.month, parts.day) === value;
30
+ }
31
+
32
+ /** Parses a key, or returns null when it is not a real date. */
33
+ export function parseDateKey(value: string): DateParts | null {
34
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
35
+ if (!match) return null;
36
+ const year = Number(match[1]);
37
+ const month = Number(match[2]) - 1;
38
+ const day = Number(match[3]);
39
+ if (month < 0 || month > 11 || day < 1 || day > daysInMonth(year, month)) return null;
40
+ return { year, month, day };
41
+ }
42
+
43
+ export function daysInMonth(year: number, month: number): number {
44
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
45
+ }
46
+
47
+ function utc(key: string): Date {
48
+ const parts = parseDateKey(key);
49
+ if (!parts) return new Date(Date.UTC(1970, 0, 1));
50
+ return new Date(Date.UTC(parts.year, parts.month, parts.day));
51
+ }
52
+
53
+ /** Local-calendar key for a real-world Date (today, a picked day). */
54
+ export function toDateKey(date: Date): string {
55
+ return dateKeyOf(date.getFullYear(), date.getMonth(), date.getDate());
56
+ }
57
+
58
+ /** Key for a Date built with Date.UTC, so arithmetic never drifts by zone. */
59
+ function utcKey(date: Date): string {
60
+ return dateKeyOf(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
61
+ }
62
+
63
+ export function todayKey(now = new Date()): string {
64
+ return toDateKey(now);
65
+ }
66
+
67
+ export function addDays(key: string, delta: number): string {
68
+ if (!parseDateKey(key)) return key;
69
+ const date = utc(key);
70
+ return utcKey(new Date(date.getTime() + delta * DAY_MS));
71
+ }
72
+
73
+ /** Month move that clamps the day instead of rolling into the next month. */
74
+ export function addMonths(key: string, delta: number): string {
75
+ const parts = parseDateKey(key);
76
+ if (!parts) return key;
77
+ const index = parts.year * 12 + parts.month + delta;
78
+ const year = Math.floor(index / 12);
79
+ const month = index % 12;
80
+ return dateKeyOf(year, month, Math.min(parts.day, daysInMonth(year, month)));
81
+ }
82
+
83
+ export function startOfWeek(key: string, weekStartsOn: 0 | 1 = 0): string {
84
+ if (!parseDateKey(key)) return key;
85
+ const date = utc(key);
86
+ const offset = (date.getUTCDay() - weekStartsOn + 7) % 7;
87
+ return addDays(key, -offset);
88
+ }
89
+
90
+ /** Next date key for a keyboard move. */
91
+ export function moveDateKey(key: string, move: CalendarMove, weekStartsOn: 0 | 1 = 0): string {
92
+ switch (move) {
93
+ case 'left':
94
+ return addDays(key, -1);
95
+ case 'right':
96
+ return addDays(key, 1);
97
+ case 'up':
98
+ return addDays(key, -7);
99
+ case 'down':
100
+ return addDays(key, 7);
101
+ case 'home':
102
+ return startOfWeek(key, weekStartsOn);
103
+ case 'end':
104
+ return addDays(startOfWeek(key, weekStartsOn), 6);
105
+ case 'pageup':
106
+ return addMonths(key, -1);
107
+ case 'pagedown':
108
+ return addMonths(key, 1);
109
+ }
110
+ }
111
+
112
+ export type CalendarDay = {
113
+ key: string;
114
+ day: number;
115
+ inMonth: boolean;
116
+ };
117
+
118
+ /** Six stable weeks of cells, including leading/trailing neighbour days. */
119
+ export function calendarWeeks(
120
+ year: number,
121
+ month: number,
122
+ weekStartsOn: 0 | 1 = 0
123
+ ): CalendarDay[][] {
124
+ const first = dateKeyOf(year, month, 1);
125
+ const start = startOfWeek(first, weekStartsOn);
126
+ return Array.from({ length: 6 }, (_, week) =>
127
+ Array.from({ length: 7 }, (_, day) => {
128
+ const key = addDays(start, week * 7 + day);
129
+ const parts = parseDateKey(key);
130
+ return {
131
+ key,
132
+ day: parts?.day ?? 1,
133
+ inMonth: parts?.month === month && parts?.year === year,
134
+ };
135
+ })
136
+ );
137
+ }
138
+
139
+ export function monthLabel(year: number, month: number, locale = 'en-US'): string {
140
+ return new Intl.DateTimeFormat(locale, {
141
+ month: 'long',
142
+ year: 'numeric',
143
+ timeZone: 'UTC',
144
+ }).format(new Date(Date.UTC(year, month, 1)));
145
+ }
146
+
147
+ export function weekdayLabels(locale = 'en-US', weekStartsOn: 0 | 1 = 0): string[] {
148
+ return Array.from({ length: 7 }, (_, index) =>
149
+ new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' }).format(
150
+ new Date(Date.UTC(2024, 0, 7 + weekStartsOn + index))
151
+ )
152
+ );
153
+ }
154
+
155
+ export function formatDateLabel(key: string, locale = 'en-US'): string {
156
+ const parts = parseDateKey(key);
157
+ if (!parts) return key;
158
+ return new Intl.DateTimeFormat(locale, {
159
+ dateStyle: 'medium',
160
+ timeZone: 'UTC',
161
+ }).format(new Date(Date.UTC(parts.year, parts.month, parts.day)));
162
+ }