@tartaguti/ui-components 0.0.0-stage → 0.1.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 (392) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +192 -2
  4. package/THIRD-PARTY-NOTICES.md +29 -0
  5. package/custom-elements.json +16731 -0
  6. package/dist/accordion/tt-accordion-item.d.ts +32 -0
  7. package/dist/accordion/tt-accordion-item.d.ts.map +1 -0
  8. package/dist/accordion/tt-accordion-item.js +247 -0
  9. package/dist/accordion/tt-accordion-item.js.map +1 -0
  10. package/dist/accordion/tt-accordion.d.ts +28 -0
  11. package/dist/accordion/tt-accordion.d.ts.map +1 -0
  12. package/dist/accordion/tt-accordion.js +148 -0
  13. package/dist/accordion/tt-accordion.js.map +1 -0
  14. package/dist/bento/tt-bento-item.d.ts +35 -0
  15. package/dist/bento/tt-bento-item.d.ts.map +1 -0
  16. package/dist/bento/tt-bento-item.js +201 -0
  17. package/dist/bento/tt-bento-item.js.map +1 -0
  18. package/dist/bento/tt-bento.d.ts +25 -0
  19. package/dist/bento/tt-bento.d.ts.map +1 -0
  20. package/dist/bento/tt-bento.js +314 -0
  21. package/dist/bento/tt-bento.js.map +1 -0
  22. package/dist/floating.d.ts +61 -0
  23. package/dist/floating.d.ts.map +1 -0
  24. package/dist/floating.js +120 -0
  25. package/dist/floating.js.map +1 -0
  26. package/dist/index.d.ts +92 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +96 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/interaction/tt-draggable.d.ts +29 -0
  31. package/dist/interaction/tt-draggable.d.ts.map +1 -0
  32. package/dist/interaction/tt-draggable.js +66 -0
  33. package/dist/interaction/tt-draggable.js.map +1 -0
  34. package/dist/interaction/tt-droppable.d.ts +37 -0
  35. package/dist/interaction/tt-droppable.d.ts.map +1 -0
  36. package/dist/interaction/tt-droppable.js +108 -0
  37. package/dist/interaction/tt-droppable.js.map +1 -0
  38. package/dist/interaction/tt-resizable.d.ts +45 -0
  39. package/dist/interaction/tt-resizable.d.ts.map +1 -0
  40. package/dist/interaction/tt-resizable.js +210 -0
  41. package/dist/interaction/tt-resizable.js.map +1 -0
  42. package/dist/interaction/tt-reveal.d.ts +54 -0
  43. package/dist/interaction/tt-reveal.d.ts.map +1 -0
  44. package/dist/interaction/tt-reveal.js +302 -0
  45. package/dist/interaction/tt-reveal.js.map +1 -0
  46. package/dist/motion.d.ts +8 -0
  47. package/dist/motion.d.ts.map +1 -0
  48. package/dist/motion.js +49 -0
  49. package/dist/motion.js.map +1 -0
  50. package/dist/overlay.d.ts +7 -0
  51. package/dist/overlay.d.ts.map +1 -0
  52. package/dist/overlay.js +121 -0
  53. package/dist/overlay.js.map +1 -0
  54. package/dist/safe-url.d.ts +14 -0
  55. package/dist/safe-url.d.ts.map +1 -0
  56. package/dist/safe-url.js +46 -0
  57. package/dist/safe-url.js.map +1 -0
  58. package/dist/scroll-lock.d.ts +22 -0
  59. package/dist/scroll-lock.d.ts.map +1 -0
  60. package/dist/scroll-lock.js +56 -0
  61. package/dist/scroll-lock.js.map +1 -0
  62. package/dist/sidebar/tt-menu-group.d.ts +69 -0
  63. package/dist/sidebar/tt-menu-group.d.ts.map +1 -0
  64. package/dist/sidebar/tt-menu-group.js +358 -0
  65. package/dist/sidebar/tt-menu-group.js.map +1 -0
  66. package/dist/sidebar/tt-menu-item.d.ts +70 -0
  67. package/dist/sidebar/tt-menu-item.d.ts.map +1 -0
  68. package/dist/sidebar/tt-menu-item.js +502 -0
  69. package/dist/sidebar/tt-menu-item.js.map +1 -0
  70. package/dist/sidebar/tt-sidebar-footer.d.ts +39 -0
  71. package/dist/sidebar/tt-sidebar-footer.d.ts.map +1 -0
  72. package/dist/sidebar/tt-sidebar-footer.js +205 -0
  73. package/dist/sidebar/tt-sidebar-footer.js.map +1 -0
  74. package/dist/sidebar/tt-sidebar-header.d.ts +31 -0
  75. package/dist/sidebar/tt-sidebar-header.d.ts.map +1 -0
  76. package/dist/sidebar/tt-sidebar-header.js +150 -0
  77. package/dist/sidebar/tt-sidebar-header.js.map +1 -0
  78. package/dist/sidebar/tt-sidebar.d.ts +72 -0
  79. package/dist/sidebar/tt-sidebar.d.ts.map +1 -0
  80. package/dist/sidebar/tt-sidebar.js +539 -0
  81. package/dist/sidebar/tt-sidebar.js.map +1 -0
  82. package/dist/sr-only.d.ts +15 -0
  83. package/dist/sr-only.d.ts.map +1 -0
  84. package/dist/sr-only.js +27 -0
  85. package/dist/sr-only.js.map +1 -0
  86. package/dist/tokens.css +1124 -0
  87. package/dist/tt-alert.d.ts +26 -0
  88. package/dist/tt-alert.d.ts.map +1 -0
  89. package/dist/tt-alert.js +165 -0
  90. package/dist/tt-alert.js.map +1 -0
  91. package/dist/tt-aspect-ratio.d.ts +40 -0
  92. package/dist/tt-aspect-ratio.d.ts.map +1 -0
  93. package/dist/tt-aspect-ratio.js +98 -0
  94. package/dist/tt-aspect-ratio.js.map +1 -0
  95. package/dist/tt-auth.d.ts +75 -0
  96. package/dist/tt-auth.d.ts.map +1 -0
  97. package/dist/tt-auth.js +520 -0
  98. package/dist/tt-auth.js.map +1 -0
  99. package/dist/tt-avatar.d.ts +26 -0
  100. package/dist/tt-avatar.d.ts.map +1 -0
  101. package/dist/tt-avatar.js +169 -0
  102. package/dist/tt-avatar.js.map +1 -0
  103. package/dist/tt-badge.d.ts +36 -0
  104. package/dist/tt-badge.d.ts.map +1 -0
  105. package/dist/tt-badge.js +135 -0
  106. package/dist/tt-badge.js.map +1 -0
  107. package/dist/tt-breadcrumbs.d.ts +22 -0
  108. package/dist/tt-breadcrumbs.d.ts.map +1 -0
  109. package/dist/tt-breadcrumbs.js +144 -0
  110. package/dist/tt-breadcrumbs.js.map +1 -0
  111. package/dist/tt-button-group.d.ts +32 -0
  112. package/dist/tt-button-group.d.ts.map +1 -0
  113. package/dist/tt-button-group.js +132 -0
  114. package/dist/tt-button-group.js.map +1 -0
  115. package/dist/tt-button.d.ts +31 -0
  116. package/dist/tt-button.d.ts.map +1 -0
  117. package/dist/tt-button.js +483 -0
  118. package/dist/tt-button.js.map +1 -0
  119. package/dist/tt-card.d.ts +26 -0
  120. package/dist/tt-card.d.ts.map +1 -0
  121. package/dist/tt-card.js +429 -0
  122. package/dist/tt-card.js.map +1 -0
  123. package/dist/tt-chart.d.ts +36 -0
  124. package/dist/tt-chart.d.ts.map +1 -0
  125. package/dist/tt-chart.js +332 -0
  126. package/dist/tt-chart.js.map +1 -0
  127. package/dist/tt-checkbox-group.d.ts +38 -0
  128. package/dist/tt-checkbox-group.d.ts.map +1 -0
  129. package/dist/tt-checkbox-group.js +243 -0
  130. package/dist/tt-checkbox-group.js.map +1 -0
  131. package/dist/tt-checkbox.d.ts +35 -0
  132. package/dist/tt-checkbox.d.ts.map +1 -0
  133. package/dist/tt-checkbox.js +354 -0
  134. package/dist/tt-checkbox.js.map +1 -0
  135. package/dist/tt-code-block.d.ts +37 -0
  136. package/dist/tt-code-block.d.ts.map +1 -0
  137. package/dist/tt-code-block.js +409 -0
  138. package/dist/tt-code-block.js.map +1 -0
  139. package/dist/tt-collapsible.d.ts +71 -0
  140. package/dist/tt-collapsible.d.ts.map +1 -0
  141. package/dist/tt-collapsible.js +206 -0
  142. package/dist/tt-collapsible.js.map +1 -0
  143. package/dist/tt-combobox.d.ts +107 -0
  144. package/dist/tt-combobox.d.ts.map +1 -0
  145. package/dist/tt-combobox.js +816 -0
  146. package/dist/tt-combobox.js.map +1 -0
  147. package/dist/tt-company-card.d.ts +30 -0
  148. package/dist/tt-company-card.d.ts.map +1 -0
  149. package/dist/tt-company-card.js +382 -0
  150. package/dist/tt-company-card.js.map +1 -0
  151. package/dist/tt-comparison-table.d.ts +59 -0
  152. package/dist/tt-comparison-table.d.ts.map +1 -0
  153. package/dist/tt-comparison-table.js +441 -0
  154. package/dist/tt-comparison-table.js.map +1 -0
  155. package/dist/tt-component-doc.d.ts +63 -0
  156. package/dist/tt-component-doc.d.ts.map +1 -0
  157. package/dist/tt-component-doc.js +585 -0
  158. package/dist/tt-component-doc.js.map +1 -0
  159. package/dist/tt-confirm.d.ts +45 -0
  160. package/dist/tt-confirm.d.ts.map +1 -0
  161. package/dist/tt-confirm.js +151 -0
  162. package/dist/tt-confirm.js.map +1 -0
  163. package/dist/tt-contact-list.d.ts +18 -0
  164. package/dist/tt-contact-list.d.ts.map +1 -0
  165. package/dist/tt-contact-list.js +101 -0
  166. package/dist/tt-contact-list.js.map +1 -0
  167. package/dist/tt-copy-button.d.ts +25 -0
  168. package/dist/tt-copy-button.d.ts.map +1 -0
  169. package/dist/tt-copy-button.js +194 -0
  170. package/dist/tt-copy-button.js.map +1 -0
  171. package/dist/tt-data-table.d.ts +69 -0
  172. package/dist/tt-data-table.d.ts.map +1 -0
  173. package/dist/tt-data-table.js +542 -0
  174. package/dist/tt-data-table.js.map +1 -0
  175. package/dist/tt-divider.d.ts +19 -0
  176. package/dist/tt-divider.d.ts.map +1 -0
  177. package/dist/tt-divider.js +104 -0
  178. package/dist/tt-divider.js.map +1 -0
  179. package/dist/tt-drawer.d.ts +38 -0
  180. package/dist/tt-drawer.d.ts.map +1 -0
  181. package/dist/tt-drawer.js +433 -0
  182. package/dist/tt-drawer.js.map +1 -0
  183. package/dist/tt-dropdown-menu.d.ts +57 -0
  184. package/dist/tt-dropdown-menu.d.ts.map +1 -0
  185. package/dist/tt-dropdown-menu.js +631 -0
  186. package/dist/tt-dropdown-menu.js.map +1 -0
  187. package/dist/tt-empty-state.d.ts +13 -0
  188. package/dist/tt-empty-state.d.ts.map +1 -0
  189. package/dist/tt-empty-state.js +94 -0
  190. package/dist/tt-empty-state.js.map +1 -0
  191. package/dist/tt-example.d.ts +33 -0
  192. package/dist/tt-example.d.ts.map +1 -0
  193. package/dist/tt-example.js +250 -0
  194. package/dist/tt-example.js.map +1 -0
  195. package/dist/tt-file-upload.d.ts +85 -0
  196. package/dist/tt-file-upload.d.ts.map +1 -0
  197. package/dist/tt-file-upload.js +662 -0
  198. package/dist/tt-file-upload.js.map +1 -0
  199. package/dist/tt-filter.d.ts +62 -0
  200. package/dist/tt-filter.d.ts.map +1 -0
  201. package/dist/tt-filter.js +393 -0
  202. package/dist/tt-filter.js.map +1 -0
  203. package/dist/tt-form.d.ts +33 -0
  204. package/dist/tt-form.d.ts.map +1 -0
  205. package/dist/tt-form.js +202 -0
  206. package/dist/tt-form.js.map +1 -0
  207. package/dist/tt-grid.d.ts +22 -0
  208. package/dist/tt-grid.d.ts.map +1 -0
  209. package/dist/tt-grid.js +106 -0
  210. package/dist/tt-grid.js.map +1 -0
  211. package/dist/tt-icon.d.ts +20 -0
  212. package/dist/tt-icon.d.ts.map +1 -0
  213. package/dist/tt-icon.js +510 -0
  214. package/dist/tt-icon.js.map +1 -0
  215. package/dist/tt-image.d.ts +59 -0
  216. package/dist/tt-image.d.ts.map +1 -0
  217. package/dist/tt-image.js +314 -0
  218. package/dist/tt-image.js.map +1 -0
  219. package/dist/tt-inbox.d.ts +45 -0
  220. package/dist/tt-inbox.d.ts.map +1 -0
  221. package/dist/tt-inbox.js +275 -0
  222. package/dist/tt-inbox.js.map +1 -0
  223. package/dist/tt-input.d.ts +43 -0
  224. package/dist/tt-input.d.ts.map +1 -0
  225. package/dist/tt-input.js +476 -0
  226. package/dist/tt-input.js.map +1 -0
  227. package/dist/tt-kbd.d.ts +39 -0
  228. package/dist/tt-kbd.d.ts.map +1 -0
  229. package/dist/tt-kbd.js +145 -0
  230. package/dist/tt-kbd.js.map +1 -0
  231. package/dist/tt-key-values.d.ts +17 -0
  232. package/dist/tt-key-values.d.ts.map +1 -0
  233. package/dist/tt-key-values.js +126 -0
  234. package/dist/tt-key-values.js.map +1 -0
  235. package/dist/tt-knowledge-doc.d.ts +24 -0
  236. package/dist/tt-knowledge-doc.d.ts.map +1 -0
  237. package/dist/tt-knowledge-doc.js +120 -0
  238. package/dist/tt-knowledge-doc.js.map +1 -0
  239. package/dist/tt-layout.d.ts +36 -0
  240. package/dist/tt-layout.d.ts.map +1 -0
  241. package/dist/tt-layout.js +318 -0
  242. package/dist/tt-layout.js.map +1 -0
  243. package/dist/tt-modal.d.ts +32 -0
  244. package/dist/tt-modal.d.ts.map +1 -0
  245. package/dist/tt-modal.js +553 -0
  246. package/dist/tt-modal.js.map +1 -0
  247. package/dist/tt-navbar.d.ts +33 -0
  248. package/dist/tt-navbar.d.ts.map +1 -0
  249. package/dist/tt-navbar.js +390 -0
  250. package/dist/tt-navbar.js.map +1 -0
  251. package/dist/tt-page-header.d.ts +28 -0
  252. package/dist/tt-page-header.d.ts.map +1 -0
  253. package/dist/tt-page-header.js +166 -0
  254. package/dist/tt-page-header.js.map +1 -0
  255. package/dist/tt-page.d.ts +14 -0
  256. package/dist/tt-page.d.ts.map +1 -0
  257. package/dist/tt-page.js +163 -0
  258. package/dist/tt-page.js.map +1 -0
  259. package/dist/tt-pagination.d.ts +27 -0
  260. package/dist/tt-pagination.d.ts.map +1 -0
  261. package/dist/tt-pagination.js +194 -0
  262. package/dist/tt-pagination.js.map +1 -0
  263. package/dist/tt-preview.d.ts +11 -0
  264. package/dist/tt-preview.d.ts.map +1 -0
  265. package/dist/tt-preview.js +68 -0
  266. package/dist/tt-preview.js.map +1 -0
  267. package/dist/tt-product.d.ts +40 -0
  268. package/dist/tt-product.d.ts.map +1 -0
  269. package/dist/tt-product.js +590 -0
  270. package/dist/tt-product.js.map +1 -0
  271. package/dist/tt-profile-card.d.ts +23 -0
  272. package/dist/tt-profile-card.d.ts.map +1 -0
  273. package/dist/tt-profile-card.js +199 -0
  274. package/dist/tt-profile-card.js.map +1 -0
  275. package/dist/tt-progress.d.ts +26 -0
  276. package/dist/tt-progress.d.ts.map +1 -0
  277. package/dist/tt-progress.js +156 -0
  278. package/dist/tt-progress.js.map +1 -0
  279. package/dist/tt-quantity.d.ts +36 -0
  280. package/dist/tt-quantity.d.ts.map +1 -0
  281. package/dist/tt-quantity.js +396 -0
  282. package/dist/tt-quantity.js.map +1 -0
  283. package/dist/tt-radio-group.d.ts +50 -0
  284. package/dist/tt-radio-group.d.ts.map +1 -0
  285. package/dist/tt-radio-group.js +372 -0
  286. package/dist/tt-radio-group.js.map +1 -0
  287. package/dist/tt-rating.d.ts +54 -0
  288. package/dist/tt-rating.d.ts.map +1 -0
  289. package/dist/tt-rating.js +312 -0
  290. package/dist/tt-rating.js.map +1 -0
  291. package/dist/tt-search.d.ts +47 -0
  292. package/dist/tt-search.d.ts.map +1 -0
  293. package/dist/tt-search.js +360 -0
  294. package/dist/tt-search.js.map +1 -0
  295. package/dist/tt-section.d.ts +13 -0
  296. package/dist/tt-section.d.ts.map +1 -0
  297. package/dist/tt-section.js +98 -0
  298. package/dist/tt-section.js.map +1 -0
  299. package/dist/tt-select.d.ts +62 -0
  300. package/dist/tt-select.d.ts.map +1 -0
  301. package/dist/tt-select.js +662 -0
  302. package/dist/tt-select.js.map +1 -0
  303. package/dist/tt-skeleton.d.ts +20 -0
  304. package/dist/tt-skeleton.d.ts.map +1 -0
  305. package/dist/tt-skeleton.js +143 -0
  306. package/dist/tt-skeleton.js.map +1 -0
  307. package/dist/tt-slider.d.ts +74 -0
  308. package/dist/tt-slider.d.ts.map +1 -0
  309. package/dist/tt-slider.js +426 -0
  310. package/dist/tt-slider.js.map +1 -0
  311. package/dist/tt-social-links.d.ts +34 -0
  312. package/dist/tt-social-links.d.ts.map +1 -0
  313. package/dist/tt-social-links.js +242 -0
  314. package/dist/tt-social-links.js.map +1 -0
  315. package/dist/tt-sparkline.d.ts +19 -0
  316. package/dist/tt-sparkline.d.ts.map +1 -0
  317. package/dist/tt-sparkline.js +191 -0
  318. package/dist/tt-sparkline.js.map +1 -0
  319. package/dist/tt-spinner.d.ts +19 -0
  320. package/dist/tt-spinner.d.ts.map +1 -0
  321. package/dist/tt-spinner.js +93 -0
  322. package/dist/tt-spinner.js.map +1 -0
  323. package/dist/tt-stack.d.ts +42 -0
  324. package/dist/tt-stack.d.ts.map +1 -0
  325. package/dist/tt-stack.js +158 -0
  326. package/dist/tt-stack.js.map +1 -0
  327. package/dist/tt-stat.d.ts +17 -0
  328. package/dist/tt-stat.d.ts.map +1 -0
  329. package/dist/tt-stat.js +134 -0
  330. package/dist/tt-stat.js.map +1 -0
  331. package/dist/tt-switch.d.ts +39 -0
  332. package/dist/tt-switch.d.ts.map +1 -0
  333. package/dist/tt-switch.js +254 -0
  334. package/dist/tt-switch.js.map +1 -0
  335. package/dist/tt-switcher.d.ts +23 -0
  336. package/dist/tt-switcher.d.ts.map +1 -0
  337. package/dist/tt-switcher.js +203 -0
  338. package/dist/tt-switcher.js.map +1 -0
  339. package/dist/tt-table-cell.d.ts +26 -0
  340. package/dist/tt-table-cell.d.ts.map +1 -0
  341. package/dist/tt-table-cell.js +121 -0
  342. package/dist/tt-table-cell.js.map +1 -0
  343. package/dist/tt-table-row.d.ts +31 -0
  344. package/dist/tt-table-row.d.ts.map +1 -0
  345. package/dist/tt-table-row.js +72 -0
  346. package/dist/tt-table-row.js.map +1 -0
  347. package/dist/tt-table.d.ts +44 -0
  348. package/dist/tt-table.d.ts.map +1 -0
  349. package/dist/tt-table.js +270 -0
  350. package/dist/tt-table.js.map +1 -0
  351. package/dist/tt-tabs.d.ts +31 -0
  352. package/dist/tt-tabs.d.ts.map +1 -0
  353. package/dist/tt-tabs.js +223 -0
  354. package/dist/tt-tabs.js.map +1 -0
  355. package/dist/tt-tag-list.d.ts +19 -0
  356. package/dist/tt-tag-list.d.ts.map +1 -0
  357. package/dist/tt-tag-list.js +136 -0
  358. package/dist/tt-tag-list.js.map +1 -0
  359. package/dist/tt-text.d.ts +52 -0
  360. package/dist/tt-text.d.ts.map +1 -0
  361. package/dist/tt-text.js +337 -0
  362. package/dist/tt-text.js.map +1 -0
  363. package/dist/tt-textarea.d.ts +43 -0
  364. package/dist/tt-textarea.d.ts.map +1 -0
  365. package/dist/tt-textarea.js +356 -0
  366. package/dist/tt-textarea.js.map +1 -0
  367. package/dist/tt-thread.d.ts +62 -0
  368. package/dist/tt-thread.d.ts.map +1 -0
  369. package/dist/tt-thread.js +374 -0
  370. package/dist/tt-thread.js.map +1 -0
  371. package/dist/tt-toast.d.ts +49 -0
  372. package/dist/tt-toast.d.ts.map +1 -0
  373. package/dist/tt-toast.js +440 -0
  374. package/dist/tt-toast.js.map +1 -0
  375. package/dist/tt-toggle-group.d.ts +73 -0
  376. package/dist/tt-toggle-group.d.ts.map +1 -0
  377. package/dist/tt-toggle-group.js +273 -0
  378. package/dist/tt-toggle-group.js.map +1 -0
  379. package/dist/tt-toggle.d.ts +54 -0
  380. package/dist/tt-toggle.d.ts.map +1 -0
  381. package/dist/tt-toggle.js +232 -0
  382. package/dist/tt-toggle.js.map +1 -0
  383. package/dist/tt-toolbar.d.ts +26 -0
  384. package/dist/tt-toolbar.d.ts.map +1 -0
  385. package/dist/tt-toolbar.js +164 -0
  386. package/dist/tt-toolbar.js.map +1 -0
  387. package/dist/tt-tooltip.d.ts +42 -0
  388. package/dist/tt-tooltip.d.ts.map +1 -0
  389. package/dist/tt-tooltip.js +299 -0
  390. package/dist/tt-tooltip.js.map +1 -0
  391. package/package.json +84 -4
  392. package/vscode.html-custom-data.json +2907 -0
@@ -0,0 +1,201 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css, nothing } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ /**
11
+ * A tile surface for a `tt-bento`.
12
+ *
13
+ * It owns no placement. `bento-span` and `bento-rows` are read by the grid
14
+ * off any direct child, so this component exists purely to give bare
15
+ * content a surface: background, border, the 2xl corner, padding, and the
16
+ * concentric radius its own children read.
17
+ *
18
+ * Anything that already brings its own surface - a tt-card, a tt-stat, a
19
+ * tt-chart - goes straight into the grid and needs none of this:
20
+ *
21
+ * <tt-bento>
22
+ * <tt-stat bento-span="2"></tt-stat>
23
+ * <tt-bento-item bento-span="2">bare content</tt-bento-item>
24
+ * </tt-bento>
25
+ */
26
+ let TTBentoItem = class TTBentoItem extends LitElement {
27
+ constructor() {
28
+ super(...arguments);
29
+ /** Drop the tile surface and render as a bare grid cell. */
30
+ this.plain = false;
31
+ /**
32
+ * The whole tile leads somewhere. Adds hover, focus and keyboard
33
+ * activation. Named clickable, as on tt-card and tt-sidebar-footer.
34
+ */
35
+ this.clickable = false;
36
+ }
37
+ activate(event) {
38
+ // Only a key pressed on the tile itself. Enter on a button inside the
39
+ // tile bubbles here too, and would click the tile as well. Same guard
40
+ // as tt-card.
41
+ if (event.target !== event.currentTarget)
42
+ return;
43
+ if (event.key !== "Enter" && event.key !== " ")
44
+ return;
45
+ event.preventDefault();
46
+ this.click();
47
+ }
48
+ static { this.styles = css `
49
+ /* The browser's own [hidden] rule loses to any :host display, so a
50
+ hidden element would still show. Important, so it always wins. */
51
+ :host([hidden]) {
52
+ display: none !important;
53
+ }
54
+
55
+ :host {
56
+ /*
57
+ No grid-column, no grid-row, no min-width. tt-bento sets all three
58
+ on every direct child through ::slotted, so placement is declared
59
+ once by the thing that owns the grid rather than reimplemented by
60
+ every element that might sit in one.
61
+
62
+ The tile keeps only what a surface is: background, border, corner,
63
+ padding, and the concentric radius it publishes downward.
64
+ */
65
+
66
+ /*
67
+ The tile's own corner, read from whatever contains it.
68
+
69
+ Nested inside another tile it takes the concentric value that tile
70
+ published; standing on its own the fallback fires and it takes the
71
+ full 2xl. That is what makes nesting work: without it a tile drew a
72
+ second 24px arc inside its parent's 24px arc, which is exactly the
73
+ pair of unrelated shapes the concentric rule exists to prevent.
74
+
75
+ This has to live on :host rather than on .tile, because .tile
76
+ publishes --tt-radius-nested for its own children. Two properties
77
+ referencing each other on the SAME element is a cycle, and CSS
78
+ throws both away. Reading on the host and publishing on the child
79
+ keeps them on different elements.
80
+ */
81
+ --_radius: var(--tt-radius-nested, var(--tt-radius-2xl));
82
+
83
+ font-family: var(--tt-font-sans);
84
+ -webkit-font-smoothing: antialiased;
85
+
86
+ color: var(--tt-card-foreground);
87
+ }
88
+
89
+ .tile {
90
+ height: 100%;
91
+ box-sizing: border-box;
92
+
93
+ display: flex;
94
+ flex-direction: column;
95
+
96
+ /* space-4, matched to the smaller module. The concentric calc below
97
+ subtracts the same value, so the two stay in step. */
98
+ padding: var(--tt-space-4);
99
+
100
+ background: var(--tt-card);
101
+ border: 1px solid var(--tt-border);
102
+ border-radius: var(--_radius);
103
+
104
+ /*
105
+ Continuous curvature rather than a circular arc. This is most of why
106
+ an Apple corner looks softer than a plain border-radius at the same
107
+ number. Ignored where unsupported, which degrades to exactly what
108
+ the line above already draws.
109
+ */
110
+ corner-shape: squircle;
111
+
112
+ /*
113
+ Concentric corners for whatever is slotted in. A 24px tile with 20px
114
+ of padding hands its content a 4px curve, so the two arcs stay
115
+ parallel instead of meeting as two unrelated shapes.
116
+
117
+ Only meaningful for children that FILL the padding box. A button
118
+ sitting in the middle of a tile keeps its own radius.
119
+ */
120
+ --tt-radius-nested: max(
121
+ var(--tt-radius-sm),
122
+ calc(var(--_radius) - var(--tt-space-4))
123
+ );
124
+
125
+ transition:
126
+ transform var(--tt-duration-slow) var(--tt-ease-spring),
127
+ box-shadow var(--tt-duration-slow) var(--tt-ease-out),
128
+ border-color var(--tt-duration-normal) var(--tt-ease);
129
+ }
130
+
131
+ :host([plain]) .tile {
132
+ padding: 0;
133
+ background: none;
134
+ border: none;
135
+ border-radius: 0;
136
+ }
137
+
138
+ /*
139
+ The lift. Small on purpose: 2px and a shadow is enough to say "this
140
+ responds", and the spring easing is what makes it feel picked up
141
+ rather than slid. Anything larger reads as a card animation demo.
142
+ */
143
+ :host([clickable]) .tile {
144
+ cursor: pointer;
145
+ }
146
+
147
+ :host([clickable]) .tile:hover {
148
+ transform: translateY(-2px);
149
+ box-shadow: var(--tt-elevation-2);
150
+ border-color: var(--tt-muted-foreground);
151
+ }
152
+
153
+ :host([clickable]) .tile:active {
154
+ transform: translateY(0);
155
+ }
156
+
157
+ :host([clickable]) .tile:focus-visible {
158
+ outline: var(--tt-ring-width) solid var(--tt-ring);
159
+ outline-offset: var(--tt-ring-offset);
160
+ }
161
+
162
+ @media (pointer: coarse) {
163
+ /* Hover lift on a touchscreen fires on tap and sticks until the next
164
+ tap elsewhere, which reads as a stuck tile. */
165
+ :host([clickable]) .tile:hover {
166
+ transform: none;
167
+ box-shadow: none;
168
+ }
169
+ }
170
+ `; }
171
+ render() {
172
+ /*
173
+ A plain tile gets no role and no tabindex at all. Marking a container
174
+ of real content as presentational would hide it, and a tabindex of -1
175
+ on something with nothing to activate is noise in the DOM.
176
+ */
177
+ const interactive = this.clickable;
178
+ return html `
179
+ <div
180
+ class="tile"
181
+ part="tile"
182
+ role=${ifDefined(interactive ? "button" : undefined)}
183
+ tabindex=${ifDefined(interactive ? 0 : undefined)}
184
+ @keydown=${interactive ? this.activate : nothing}
185
+ >
186
+ <slot></slot>
187
+ </div>
188
+ `;
189
+ }
190
+ };
191
+ __decorate([
192
+ property({ type: Boolean, reflect: true })
193
+ ], TTBentoItem.prototype, "plain", void 0);
194
+ __decorate([
195
+ property({ type: Boolean, reflect: true })
196
+ ], TTBentoItem.prototype, "clickable", void 0);
197
+ TTBentoItem = __decorate([
198
+ customElement("tt-bento-item")
199
+ ], TTBentoItem);
200
+ export { TTBentoItem };
201
+ //# sourceMappingURL=tt-bento-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-bento-item.js","sourceRoot":"","sources":["../../src/bento/tt-bento-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,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CAAC;;AAnKD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC7B;AAOd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACzB;AAVP,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAuKvB"}
@@ -0,0 +1,25 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * The grid net. Tiles span whole cells of it, so a composition reads as a
4
+ * deliberate arrangement rather than a row of equal boxes:
5
+ *
6
+ * <tt-bento>
7
+ * <tt-stat bento-span="6" bento-rows="4"></tt-stat>
8
+ * <tt-bento-item bento-span="2" bento-rows="2">module</tt-bento-item>
9
+ * </tt-bento>
10
+ *
11
+ * It measures ITSELF, not the viewport, so a bento in a sidebar and a bento
12
+ * on a full page get the right column count with neither knowing where it
13
+ * is. Cells are square, so a span and a row count describe a shape.
14
+ */
15
+ export declare class TTBento extends LitElement {
16
+ columns: 12 | 24;
17
+ static styles: import("lit").CSSResult[];
18
+ render(): import("lit-html").TemplateResult<1>;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ "tt-bento": TTBento;
23
+ }
24
+ }
25
+ //# sourceMappingURL=tt-bento.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-bento.d.ts","sourceRoot":"","sources":["../../src/bento/tt-bento.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAuJvD;;;;;;;;;;;;GAYG;AACH,qBACa,OAAQ,SAAQ,UAAU;IAkBrC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAM;IAEtB,MAAM,CAAC,MAAM,4BAgIX;IAEF,MAAM;CAOP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -0,0 +1,314 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css, unsafeCSS } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ /*
10
+ The net sizes on offer, and the only two worth offering.
11
+
12
+ Both are highly divisible, which is the only thing a column count is
13
+ really for: 12 gives halves, thirds, quarters and sixths; 24 adds eighths
14
+ and twelfths. That is the same property that made 12 the standard page
15
+ grid - it is the smallest integer with six divisors.
16
+
17
+ 32 is deliberately absent despite being the obvious "finer" choice. Its
18
+ divisors are 1, 2, 4, 8, 16, 32, so it has no thirds at all: on a
19
+ 32-column net you could never express a third of the page, which is the
20
+ single most common asymmetric split there is.
21
+ */
22
+ const NETS = [12, 24];
23
+ /*
24
+ Tiers. Each one states its own column count and its own mapping from an
25
+ authored span to the span it takes at that width.
26
+
27
+ A mapping rather than a single factor, because the two tiers genuinely
28
+ want different behaviour. Halving the net still leaves enough columns for
29
+ a fraction to land somewhere distinct, so that tier is proportional. Two
30
+ columns leaves exactly two possible widths, where proportional collapses:
31
+ a sixth of the net and a half of it both round to one column and the
32
+ anchor stops being an anchor. See the note on that tier.
33
+
34
+ Both axes go through the same mapping, so a SQUARE tile stays exactly
35
+ square at every tier. Other ratios drift a little, because the two axes
36
+ round independently and rounding bites at small counts: a 6x4 becomes a
37
+ 2x1 rather than the 1.5x1 that has no meaning on a grid. That is the
38
+ honest cost of integer tracks, and it lands on height, which is the cheap
39
+ axis on a phone.
40
+
41
+ There is deliberately no minimum size floor anywhere. None is needed: the
42
+ container shrinks along with the counts, so a tile lands at a sensible
43
+ physical size on its own.
44
+ */
45
+ const TIERS = [
46
+ {
47
+ query: "(width < 64rem)",
48
+ /* Half the net. Proportional works cleanly while there are still
49
+ enough columns for a fraction to land on a distinct width. */
50
+ cols: (net) => Math.max(1, Math.round(net / 2)),
51
+ units: (n, _net) => Math.max(1, Math.round(n / 2)),
52
+ },
53
+ {
54
+ query: "(width < 40rem)",
55
+ /*
56
+ Two columns, and NOT a proportional factor.
57
+
58
+ Two is set by the content, not by the maths: a module is an icon
59
+ badge over a value over a label, and on a phone two columns puts a
60
+ cell near 175px, which fits that comfortably and is a generous touch
61
+ target. Three lands near 112px, where the three parts stop fitting
62
+ once the tile's own padding is taken off. Four is 81px, which is
63
+ barely more than the icon.
64
+
65
+ With only two columns there are only two possible widths, so a
66
+ proportional factor breaks down: a sixth of the net and a half of it
67
+ both round to a single column, and the anchor ends up exactly as wide
68
+ as the modules it was supposed to dominate. A bucket is the honest
69
+ model at this size - module width, or full width, and nothing else
70
+ exists. The threshold is a sixth of the net rather than a fixed
71
+ number so it means the same thing on a 12 net and on a 24 one.
72
+ */
73
+ cols: () => 2,
74
+ units: (n, net) => (n <= net / 6 ? 1 : 2),
75
+ },
76
+ ];
77
+ /**
78
+ * Placement rules for every span and row value on the largest net.
79
+ *
80
+ * Generated rather than hand-written. A 24 net needs 24 values on each of
81
+ * two axes across three tiers, which is around a hundred and fifty rules:
82
+ * writable once, unmaintainable forever, and impossible to keep consistent
83
+ * by eye. Generating it means the tier maths is stated once, as maths.
84
+ */
85
+ function placement(max) {
86
+ const rules = [];
87
+ for (let n = 2; n <= max; n++) {
88
+ rules.push(`::slotted([bento-span="${n}"]) { grid-column: span ${n}; }`);
89
+ rules.push(`::slotted([bento-rows="${n}"]) { grid-row: span ${n}; }`);
90
+ }
91
+ return rules.join("\n");
92
+ }
93
+ /**
94
+ * The same values remapped for one tier, per net.
95
+ *
96
+ * Scoped by net, because the mapping depends on how many columns the author
97
+ * started from: a span of 4 is a third of a 12 net and a sixth of a 24 one,
98
+ * and those should not land on the same width.
99
+ */
100
+ function clamp(tier) {
101
+ return NETS.map((net) => {
102
+ const scope = selectorFor(net);
103
+ const rules = [];
104
+ for (let n = 2; n <= net; n++) {
105
+ const next = tier.units(n, net);
106
+ if (next === n)
107
+ continue;
108
+ rules.push(`${scope}::slotted([bento-span="${n}"]) { grid-column: span ${next}; }`);
109
+ rules.push(`${scope}::slotted([bento-rows="${n}"]) { grid-row: span ${next}; }`);
110
+ }
111
+ return rules.join("\n");
112
+ }).join("\n");
113
+ }
114
+ /*
115
+ The default net needs no attribute, so it is the bare selector. Both forms
116
+ keep the same specificity as each other within a tier, which is what lets
117
+ source order decide instead of a specificity fight.
118
+ */
119
+ function selectorFor(net) {
120
+ return net === 12 ? "" : `:host([columns="${net}"]) `;
121
+ }
122
+ /** Column count per net, per tier. */
123
+ function columnCounts(cols) {
124
+ return NETS.map((net) => `${selectorFor(net)}.bento { --_cols: ${cols(net)}; }`).join("\n");
125
+ }
126
+ const GENERATED = unsafeCSS([
127
+ placement(Math.max(...NETS)),
128
+ columnCounts((net) => net),
129
+ ...TIERS.map((tier) => `
130
+ @container tt-bento ${tier.query} {
131
+ ${columnCounts(tier.cols)}
132
+ ${clamp(tier)}
133
+ }
134
+ `),
135
+ ].join("\n"));
136
+ /**
137
+ * The grid net. Tiles span whole cells of it, so a composition reads as a
138
+ * deliberate arrangement rather than a row of equal boxes:
139
+ *
140
+ * <tt-bento>
141
+ * <tt-stat bento-span="6" bento-rows="4"></tt-stat>
142
+ * <tt-bento-item bento-span="2" bento-rows="2">module</tt-bento-item>
143
+ * </tt-bento>
144
+ *
145
+ * It measures ITSELF, not the viewport, so a bento in a sidebar and a bento
146
+ * on a full page get the right column count with neither knowing where it
147
+ * is. Cells are square, so a span and a row count describe a shape.
148
+ */
149
+ let TTBento = class TTBento extends LitElement {
150
+ constructor() {
151
+ super(...arguments);
152
+ /*
153
+ Columns at the widest tier.
154
+
155
+ Twelve by default. Cells are square, so the column count decides how big
156
+ a unit is: on a typical page twelve puts a cell near 85px, which makes a
157
+ module a clean 2x2 and a half-width tile a 6. Twenty-four halves that to
158
+ around 36px, which buys finer control at the cost of every tile becoming
159
+ a four-to-eight span in both directions, where the numbers stop meaning
160
+ anything at a glance.
161
+
162
+ Rough vocabulary on the default net:
163
+ 2x2 a module
164
+ 4x2 a wide readout
165
+ 6x4 a half-width anchor
166
+ 12xN a full-width band
167
+ */
168
+ this.columns = 12;
169
+ }
170
+ static { this.styles = [
171
+ css `
172
+ /* The browser's own [hidden] rule loses to any :host display, so a
173
+ hidden element would still show. Important, so it always wins. */
174
+ :host([hidden]) {
175
+ display: none !important;
176
+ }
177
+
178
+ :host {
179
+ display: block;
180
+
181
+ /*
182
+ A bento is often a grid item of another bento. Without this it
183
+ keeps the default min-width: auto, so one long unbreakable word
184
+ inside can push the outer column past its 1fr share.
185
+ */
186
+ min-width: 0;
187
+
188
+ /*
189
+ The host is the container the tiles measure against. It has to be
190
+ the host rather than the inner grid, because a tile is a light-DOM
191
+ child of this element and looks up its own ancestors.
192
+ */
193
+ container-type: inline-size;
194
+ container-name: tt-bento;
195
+
196
+ font-family: var(--tt-font-sans);
197
+ }
198
+
199
+ .bento {
200
+ display: grid;
201
+
202
+ /*
203
+ A gap reads against the size of what it separates, and on a fine
204
+ net it also has to survive being repeated eleven or twenty-three
205
+ times across the width. Tiles spanning several cells absorb the
206
+ gaps inside them, so the visible gap between two tiles stays this
207
+ value however wide they are.
208
+ */
209
+ --_gap: var(--tt-bento-gap, var(--tt-space-3));
210
+ gap: var(--_gap);
211
+
212
+ grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
213
+
214
+ /*
215
+ Square cells.
216
+
217
+ The row height is the column width, computed the same way the
218
+ column is: the container's inline size less the gaps, divided by
219
+ the column count. cqw is 1% of that inline size, and this
220
+ component already establishes a container for the tier queries, so
221
+ the measurement is there for free.
222
+
223
+ Because it is exact it composes: an NxN tile covers N columns plus
224
+ N-1 gaps across and N rows plus N-1 gaps down, which are the same
225
+ number, so every square span stays square at every width.
226
+
227
+ minmax, not a fixed height, so a tile whose content genuinely
228
+ needs more room grows instead of clipping.
229
+
230
+ NOTE: 100cqw is the host's inline size. Keep the host free of
231
+ horizontal padding and borders, or the two stop agreeing.
232
+ */
233
+ grid-auto-rows: minmax(
234
+ var(
235
+ --tt-bento-row,
236
+ calc((100cqw - (var(--_cols) - 1) * var(--_gap)) / var(--_cols))
237
+ ),
238
+ auto
239
+ );
240
+ }
241
+
242
+ /* ---- Placement ----
243
+
244
+ Every direct child participates, whether or not it is a
245
+ tt-bento-item:
246
+
247
+ <tt-bento>
248
+ <tt-stat bento-span="6" bento-rows="4"></tt-stat>
249
+ <tt-chart bento-span="12"></tt-chart>
250
+ <tt-bento-item>bare content that wants a tile</tt-bento-item>
251
+ </tt-bento>
252
+
253
+ The rules live here rather than in the child, and that is the whole
254
+ design. No component has to know bento exists: the grid reads a
255
+ plain attribute off whatever it was handed. Adding a second
256
+ arrangement later is a second container, not a prop on
257
+ seventy-three components.
258
+
259
+ ::slotted can set layout properties on a slotted element because
260
+ they apply to the element's own box. It cannot reach inside one,
261
+ which is what --tt-group-radius exists for over in tt-button-group.
262
+ Placement is on the outside, so this is the right tool.
263
+
264
+ The attributes are namespaced because the short names are taken:
265
+ tt-textarea already has rows, and tt-table and tt-data-table have
266
+ both rows and columns. A bare rows attribute would quietly give
267
+ <tt-textarea rows="3"> a three-row grid span.
268
+
269
+ The rules themselves are generated above. */
270
+
271
+ ::slotted(*) {
272
+ /* Stops a long unbreakable word inside one child forcing its column
273
+ wider than its share, which is how a grid of 1fr columns quietly
274
+ stops being equal. */
275
+ min-width: 0;
276
+ }
277
+
278
+ /*
279
+ The floor. Very narrow containers, and anyone who has scaled their
280
+ text up far enough that a fraction of the width would be a fraction
281
+ of a word. Everything goes full width and content sets the height.
282
+ */
283
+ @container tt-bento (width < 20rem) {
284
+ .bento {
285
+ --_cols: 1;
286
+ }
287
+
288
+ ::slotted([bento-span]) {
289
+ grid-column: span 1;
290
+ }
291
+
292
+ ::slotted([bento-rows]) {
293
+ grid-row: span 1;
294
+ }
295
+ }
296
+ `,
297
+ GENERATED,
298
+ ]; }
299
+ render() {
300
+ return html `
301
+ <div class="bento" part="bento">
302
+ <slot></slot>
303
+ </div>
304
+ `;
305
+ }
306
+ };
307
+ __decorate([
308
+ property({ type: Number, reflect: true })
309
+ ], TTBento.prototype, "columns", void 0);
310
+ TTBento = __decorate([
311
+ customElement("tt-bento")
312
+ ], TTBento);
313
+ export { TTBento };
314
+ //# sourceMappingURL=tt-bento.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-bento.js","sourceRoot":"","sources":["../../src/bento/tt-bento.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;EAYE;AACF,MAAM,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,CAAU,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;EAqBE;AACF,MAAM,KAAK,GAAG;IACZ;QACE,KAAK,EAAE,iBAAiB;QACxB;wEACgE;QAChE,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACvD,KAAK,EAAE,CAAC,CAAS,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACnE;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB;;;;;;;;;;;;;;;;;UAiBE;QACF,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,KAAK,EAAE,CAAC,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;KAIV,CAAC;IACJ,CAAC;;AA1ID;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACpB;AAlBX,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA6JnB"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Keeping a top-layer element glued to the thing that opened it.
3
+ *
4
+ * THE BUG THIS EXISTS FOR: `scroll` events are not composed, so they do
5
+ * not escape a shadow root. A `window.addEventListener("scroll", fn, true)`
6
+ * never fires for a scroll container living inside some component's shadow
7
+ * DOM, which in this library is the norm rather than the exception: the
8
+ * page scrolls inside tt-layout's `.content`, not on the document. The
9
+ * result was a menu that stayed nailed to the viewport while the button it
10
+ * belonged to scrolled away underneath it.
11
+ *
12
+ * The fix is the same one positioning libraries use: find every scrollable
13
+ * ancestor of the anchor and listen on each of them directly, hopping out
14
+ * of shadow roots on the way up.
15
+ */
16
+ /**
17
+ * Every scrollable ancestor of `element` in the FLATTENED tree.
18
+ *
19
+ * Three different "parents" matter here, and using the wrong one is why
20
+ * the first version of this did nothing:
21
+ *
22
+ * assignedSlot A slotted element renders wherever its slot is, which is
23
+ * inside some other component's shadow root. Its parentNode
24
+ * still points at its light-DOM parent, which is NOT where
25
+ * it visually sits. Stepping to the slot is what follows
26
+ * the element to where it is actually painted.
27
+ * ShadowRoot Has no parentElement, so a plain walk stops dead. Its
28
+ * `host` continues in the outer tree.
29
+ * parentNode The ordinary case.
30
+ *
31
+ * Missing the first one is what left the page's real scroll container
32
+ * unwatched: tt-layout's .content lives in tt-layout's shadow root, and
33
+ * every page is slotted into it, so no parentNode chain ever reaches it.
34
+ */
35
+ export declare function scrollAncestors(element: Element): Element[];
36
+ /**
37
+ * Calls `onChange` whenever the anchor may have moved: any ancestor
38
+ * scrolling, the window scrolling or resizing, or the anchor itself
39
+ * changing size.
40
+ *
41
+ * Returns the unsubscribe function. Call it when the floating element
42
+ * closes, or these listeners outlive it.
43
+ */
44
+ export declare function trackAnchor(anchor: Element, onChange: () => void): () => void;
45
+ export interface PlaceOptions {
46
+ align?: "start" | "end";
47
+ gap?: number;
48
+ edge?: number;
49
+ }
50
+ /**
51
+ * Park a top-layer element under its anchor, flipping above when there
52
+ * is no room below and clamping so it never leaves the viewport.
53
+ *
54
+ * CALL THIS AFTER showPopover(), never before. A closed popover is
55
+ * display:none and a display:none element measures 0x0, so positioning
56
+ * first works with a width of zero: the align=end offset collapses onto
57
+ * the anchor's right edge and the clamp has nothing to clamp with, which
58
+ * puts a menu near the right edge off screen.
59
+ */
60
+ export declare function placeBelow(anchor: Element, floating: HTMLElement, options?: PlaceOptions): void;
61
+ //# sourceMappingURL=floating.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating.d.ts","sourceRoot":"","sources":["../src/floating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CA6B3D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CA2B7E;AAED,MAAM,WAAW,YAAY;IAE3B,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAExB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,YAAiB,GACzB,IAAI,CAqBN"}