@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
@@ -0,0 +1,227 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { computePosition, type Rect } from './position';
3
+
4
+ const anchor: Rect = { top: 200, left: 100, width: 120, height: 36 };
5
+ const content = { width: 288, height: 180 };
6
+ const viewport = { width: 1024, height: 768 };
7
+
8
+ describe('computePosition', () => {
9
+ it('places the panel below the anchor by default', () => {
10
+ const result = computePosition({ anchor, content, viewport });
11
+ expect(result).toEqual({ top: 244, left: 100, side: 'bottom' });
12
+ });
13
+
14
+ it('honours sideOffset and alignOffset', () => {
15
+ const result = computePosition({
16
+ anchor,
17
+ content,
18
+ viewport,
19
+ sideOffset: 12,
20
+ alignOffset: -6,
21
+ });
22
+ expect(result.top).toBe(248);
23
+ expect(result.left).toBe(94);
24
+ });
25
+
26
+ it('supports every side', () => {
27
+ expect(computePosition({ anchor, content, viewport, side: 'top' })).toMatchObject({
28
+ top: 12,
29
+ side: 'top',
30
+ });
31
+ expect(computePosition({ anchor, content, viewport, side: 'right' })).toMatchObject({
32
+ left: 228,
33
+ side: 'right',
34
+ });
35
+ // Room on both sides, so the preferred side survives.
36
+ expect(
37
+ computePosition({ anchor: { ...anchor, left: 600 }, content, viewport, side: 'left' })
38
+ ).toMatchObject({ left: 304, side: 'left' });
39
+ });
40
+
41
+ it('aligns start, center and end on the cross axis', () => {
42
+ expect(computePosition({ anchor, content, viewport, align: 'start' }).left).toBe(100);
43
+ expect(computePosition({ anchor, content, viewport, align: 'center' }).left).toBe(16);
44
+ expect(computePosition({ anchor, content, viewport, align: 'end' }).left).toBe(8);
45
+ });
46
+
47
+ it('flips above when there is no room below', () => {
48
+ const low = { ...anchor, top: 700 };
49
+ const result = computePosition({ anchor: low, content, viewport });
50
+ expect(result.side).toBe('top');
51
+ expect(result.top).toBe(700 - 180 - 8);
52
+ });
53
+
54
+ it('flips left when there is no room on the right', () => {
55
+ const wide = { ...anchor, left: 900 };
56
+ const result = computePosition({ anchor: wide, content, viewport, side: 'right' });
57
+ expect(result.side).toBe('left');
58
+ expect(result.left).toBe(900 - 288 - 8);
59
+ });
60
+
61
+ it('keeps the preferred side when neither side fits', () => {
62
+ const result = computePosition({
63
+ anchor: { top: 40, left: 100, width: 20, height: 20 },
64
+ content,
65
+ viewport: { width: 300, height: 100 },
66
+ });
67
+ expect(result.side).toBe('bottom');
68
+ expect(result.top).toBe(8);
69
+ });
70
+
71
+ it('clamps to collision padding on both axes', () => {
72
+ const corner = { top: 760, left: 1000, width: 20, height: 20 };
73
+ const result = computePosition({ anchor: corner, content, viewport, collisionPadding: 16 });
74
+ expect(result.left).toBe(1024 - 288 - 16);
75
+ expect(result.top).toBeGreaterThanOrEqual(16);
76
+ });
77
+
78
+ it('honours a larger collision padding on the cross axis', () => {
79
+ const result = computePosition({
80
+ anchor,
81
+ content: { width: 1000, height: 180 },
82
+ viewport,
83
+ collisionPadding: 24,
84
+ });
85
+ expect(result.left).toBe(24);
86
+ });
87
+
88
+ it('never returns a negative offset when the panel is wider than the viewport', () => {
89
+ const result = computePosition({
90
+ anchor,
91
+ content: { width: 1200, height: 180 },
92
+ viewport,
93
+ });
94
+ expect(result.left).toBe(8);
95
+ });
96
+
97
+ it('centres a panel that is taller than the viewport', () => {
98
+ const result = computePosition({
99
+ anchor,
100
+ content: { width: 200, height: 900 },
101
+ viewport,
102
+ });
103
+ expect(result.top).toBe(8);
104
+ });
105
+ });
106
+
107
+ describe('computePosition edge cases', () => {
108
+ it('flips from top to bottom when there is no room above', () => {
109
+ const result = computePosition({
110
+ anchor: { ...anchor, top: 20 },
111
+ content,
112
+ viewport,
113
+ side: 'top',
114
+ });
115
+ expect(result.side).toBe('bottom');
116
+ expect(result).toEqual({ top: 64, left: 100, side: 'bottom' });
117
+ });
118
+
119
+ it('flips from left to right when there is no room on the left', () => {
120
+ const result = computePosition({
121
+ anchor: { ...anchor, left: 20 },
122
+ content,
123
+ viewport,
124
+ side: 'left',
125
+ });
126
+ expect(result).toEqual({ top: 200, left: 148, side: 'right' });
127
+ });
128
+
129
+ it('does not flip when the preferred side fits exactly', () => {
130
+ // spaceFor('bottom') === content.height, and the flip test is strict.
131
+ const result = computePosition({
132
+ anchor: { ...anchor, top: 544 },
133
+ content,
134
+ viewport,
135
+ });
136
+ expect(result.side).toBe('bottom');
137
+ // Still clamped to viewport - content - collisionPadding.
138
+ expect(result.top).toBe(768 - 180 - 8);
139
+ });
140
+
141
+ it('aligns end and center without clamping when there is room', () => {
142
+ const wideAnchor = { ...anchor, left: 500 };
143
+ expect(computePosition({ anchor: wideAnchor, content, viewport, align: 'end' }).left).toBe(332);
144
+ expect(computePosition({ anchor: wideAnchor, content, viewport, align: 'center' }).left).toBe(
145
+ 416
146
+ );
147
+ });
148
+
149
+ it('clamps the cross axis against the viewport height for horizontal sides', () => {
150
+ const result = computePosition({
151
+ anchor: { top: 700, left: 300, width: 120, height: 36 },
152
+ content: { width: 200, height: 600 },
153
+ viewport,
154
+ side: 'right',
155
+ });
156
+ expect(result.top).toBe(160);
157
+ expect(result.left).toBe(428);
158
+ expect(result.side).toBe('right');
159
+ });
160
+
161
+ it('clamps the main axis when a horizontal panel is wider than the viewport', () => {
162
+ const result = computePosition({
163
+ anchor: { ...anchor, left: 500 },
164
+ content: { width: 1200, height: 100 },
165
+ viewport,
166
+ side: 'right',
167
+ });
168
+ expect(result.left).toBe(8);
169
+ });
170
+
171
+ it('clamps a negative alignOffset back inside the padding', () => {
172
+ const result = computePosition({
173
+ anchor: { top: 200, left: 0, width: 120, height: 36 },
174
+ content,
175
+ viewport,
176
+ alignOffset: -40,
177
+ });
178
+ expect(result.left).toBe(8);
179
+ });
180
+
181
+ it('clamps an alignOffset that pushes past the right edge', () => {
182
+ const result = computePosition({
183
+ anchor: { top: 200, left: 900, width: 120, height: 36 },
184
+ content,
185
+ viewport,
186
+ alignOffset: 100,
187
+ });
188
+ expect(result.left).toBe(1024 - 288 - 8);
189
+ });
190
+
191
+ it('handles a zero-size anchor at the origin', () => {
192
+ expect(
193
+ computePosition({
194
+ anchor: { top: 0, left: 0, width: 0, height: 0 },
195
+ content,
196
+ viewport,
197
+ })
198
+ ).toEqual({ top: 8, left: 8, side: 'bottom' });
199
+ });
200
+
201
+ it('treats explicit defaults the same as omitted options', () => {
202
+ expect(
203
+ computePosition({
204
+ anchor,
205
+ content,
206
+ viewport,
207
+ side: 'bottom',
208
+ align: 'start',
209
+ sideOffset: 8,
210
+ alignOffset: 0,
211
+ collisionPadding: 8,
212
+ })
213
+ ).toEqual(computePosition({ anchor, content, viewport }));
214
+ });
215
+
216
+ it('flips a top panel down and keeps it inside the viewport', () => {
217
+ const result = computePosition({
218
+ anchor: { top: 8, left: 24, width: 160, height: 40 },
219
+ content: { width: 288, height: 400 },
220
+ viewport,
221
+ side: 'top',
222
+ });
223
+ expect(result.side).toBe('bottom');
224
+ expect(result.top).toBeGreaterThanOrEqual(8);
225
+ expect(result.top + 400).toBeLessThanOrEqual(768 - 8);
226
+ });
227
+ });
@@ -0,0 +1,129 @@
1
+ export type Side = 'top' | 'right' | 'bottom' | 'left';
2
+ export type Align = 'start' | 'center' | 'end';
3
+
4
+ export type Rect = {
5
+ top: number;
6
+ left: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+
11
+ export type Size = {
12
+ width: number;
13
+ height: number;
14
+ };
15
+
16
+ export type PositionOptions = {
17
+ /** The element the panel is anchored to, in viewport coordinates. */
18
+ anchor: Rect;
19
+ /** Measured panel size. */
20
+ content: Size;
21
+ /** Viewport size (normally window.innerWidth/innerHeight). */
22
+ viewport: Size;
23
+ side?: Side;
24
+ align?: Align;
25
+ /** Distance between the anchor and the panel, along the side axis. */
26
+ sideOffset?: number;
27
+ /** Nudge along the cross axis. */
28
+ alignOffset?: number;
29
+ /** Minimum distance the panel keeps from the viewport edges. */
30
+ collisionPadding?: number;
31
+ };
32
+
33
+ export type PositionResult = {
34
+ top: number;
35
+ left: number;
36
+ /** The side actually used after collision handling. */
37
+ side: Side;
38
+ };
39
+
40
+ const OPPOSITE: Record<Side, Side> = {
41
+ top: 'bottom',
42
+ bottom: 'top',
43
+ left: 'right',
44
+ right: 'left',
45
+ };
46
+
47
+ const isHorizontal = (side: Side) => side === 'left' || side === 'right';
48
+
49
+ function clamp(value: number, min: number, max: number): number {
50
+ if (max < min) return min;
51
+ return Math.min(Math.max(value, min), max);
52
+ }
53
+
54
+ function spaceFor(side: Side, anchor: Rect, viewport: Size, padding: number): number {
55
+ switch (side) {
56
+ case 'top':
57
+ return anchor.top - padding;
58
+ case 'bottom':
59
+ return viewport.height - (anchor.top + anchor.height) - padding;
60
+ case 'left':
61
+ return anchor.left - padding;
62
+ case 'right':
63
+ return viewport.width - (anchor.left + anchor.width) - padding;
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Places a floating panel beside an anchor, flipping to the opposite side when
69
+ * the preferred side has less room, then clamping to the viewport.
70
+ *
71
+ * Pure so the arithmetic can be tested without a DOM: the component only
72
+ * measures and applies the result.
73
+ */
74
+ export function computePosition({
75
+ anchor,
76
+ content,
77
+ viewport,
78
+ side = 'bottom',
79
+ align = 'start',
80
+ sideOffset = 8,
81
+ alignOffset = 0,
82
+ collisionPadding = 8,
83
+ }: PositionOptions): PositionResult {
84
+ const crossExtent = isHorizontal(side) ? content.height : content.width;
85
+ const mainExtent = isHorizontal(side) ? content.width : content.height;
86
+ const vertical = !isHorizontal(side);
87
+
88
+ const preferredSpace = spaceFor(side, anchor, viewport, collisionPadding);
89
+ const oppositeSpace = spaceFor(OPPOSITE[side], anchor, viewport, collisionPadding);
90
+ const resolvedSide =
91
+ preferredSpace < mainExtent && oppositeSpace > preferredSpace ? OPPOSITE[side] : side;
92
+
93
+ // Cross-axis offset from the anchor's leading edge.
94
+ const anchorCrossStart = vertical ? anchor.left : anchor.top;
95
+ const anchorCrossSize = vertical ? anchor.width : anchor.height;
96
+ let cross =
97
+ align === 'start'
98
+ ? anchorCrossStart
99
+ : align === 'end'
100
+ ? anchorCrossStart + anchorCrossSize - crossExtent
101
+ : anchorCrossStart + (anchorCrossSize - crossExtent) / 2;
102
+ cross += alignOffset;
103
+
104
+ // Main-axis offset from the anchor's edge.
105
+ let main: number;
106
+ switch (resolvedSide) {
107
+ case 'bottom':
108
+ main = anchor.top + anchor.height + sideOffset;
109
+ break;
110
+ case 'top':
111
+ main = anchor.top - content.height - sideOffset;
112
+ break;
113
+ case 'right':
114
+ main = anchor.left + anchor.width + sideOffset;
115
+ break;
116
+ default:
117
+ main = anchor.left - content.width - sideOffset;
118
+ }
119
+
120
+ const crossLimit = (vertical ? viewport.width : viewport.height) - crossExtent - collisionPadding;
121
+ const boundedCross = clamp(cross, collisionPadding, crossLimit);
122
+
123
+ const mainLimit = (vertical ? viewport.height : viewport.width) - mainExtent - collisionPadding;
124
+ const boundedMain = clamp(main, collisionPadding, mainLimit);
125
+
126
+ return vertical
127
+ ? { top: boundedMain, left: boundedCross, side: resolvedSide }
128
+ : { top: boundedCross, left: boundedMain, side: resolvedSide };
129
+ }