@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,441 @@
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 } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import "./tt-icon.js";
10
+ import { srOnly } from "./sr-only.js";
11
+ /**
12
+ * Puts several things side by side against the same set of attributes.
13
+ *
14
+ * Most directories make you open two tabs and look back and forth. This
15
+ * is the component that removes that, which the notes call out as a
16
+ * genuine differentiator, and it generalises well beyond suppliers:
17
+ * pricing tiers, product specs, plan features.
18
+ *
19
+ * TWO THINGS MAKE IT ACTUALLY USEFUL rather than just a table turned on
20
+ * its side.
21
+ *
22
+ * First, the ROW LABELS ARE THE FIRST COLUMN and they stick while you
23
+ * scroll sideways. Comparing is a horizontal act, and a comparison where
24
+ * you lose track of which attribute you are reading is worse than two
25
+ * tabs.
26
+ *
27
+ * Second, `differencesOnly` hides every row where all items agree. On a
28
+ * profile with thirty attributes, the four that differ are the entire
29
+ * question, and they are invisible among the twenty-six that do not.
30
+ *
31
+ * Booleans render as a tick or a dash rather than the words true and
32
+ * false, because a column of ticks is scannable and a column of "true" is
33
+ * not.
34
+ */
35
+ let TTComparisonTable = class TTComparisonTable extends LitElement {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.rows = [];
39
+ this.items = [];
40
+ this.differencesOnly = false;
41
+ // Show a remove control on each column header.
42
+ this.removable = false;
43
+ this.emptyText = "Nothing to compare yet";
44
+ }
45
+ /*
46
+ Rows where every item agrees. Compared as JSON because a value may be
47
+ a number, a boolean or a string and they must compare consistently;
48
+ a TemplateResult never equals another, so any row holding one is
49
+ always treated as differing, which is the safe direction.
50
+ */
51
+ get visibleRows() {
52
+ if (!this.differencesOnly || this.items.length < 2)
53
+ return this.rows;
54
+ return this.rows.filter((row) => {
55
+ const first = JSON.stringify(this.items[0].values[row.key] ?? null);
56
+ return this.items.some((item) => JSON.stringify(item.values[row.key] ?? null) !== first);
57
+ });
58
+ }
59
+ // removeItem, not remove: Element.remove() already exists, and
60
+ // shadowing a built-in DOM member breaks the element type outright.
61
+ removeItem(item, index, event) {
62
+ // Only when the button really had focus. Safari does not focus a
63
+ // clicked button, and focus that is not ours is not ours to move.
64
+ if (this.shadowRoot?.activeElement === event.currentTarget) {
65
+ this.pendingFocus = { id: item.id, index };
66
+ }
67
+ this.dispatchEvent(new CustomEvent("tt-remove", {
68
+ detail: { id: item.id },
69
+ bubbles: true,
70
+ composed: true,
71
+ }));
72
+ }
73
+ /*
74
+ The tick and the dash are drawn for the eye and hidden from the screen
75
+ reader, and the words are the other way round. aria-label on the icon
76
+ or on a plain <span> does nothing: neither has a role, and ARIA does
77
+ not let an element with no role carry a name. tt-icon also hides its
78
+ own SVG. Real text is the only thing that is always read.
79
+ */
80
+ updated(changed) {
81
+ if (!changed.has("items") || !this.pendingFocus)
82
+ return;
83
+ const { id, index } = this.pendingFocus;
84
+ this.pendingFocus = undefined;
85
+ // The parent kept the column, so the button and its focus are still
86
+ // there. Nothing to repair.
87
+ if (this.items.some((item) => item.id === id))
88
+ return;
89
+ // The column that slid into the removed one's place, or the new last
90
+ // one; with no columns left, the empty message.
91
+ const buttons = this.renderRoot.querySelectorAll(".remove");
92
+ const next = buttons[Math.min(index, buttons.length - 1)] ??
93
+ this.renderRoot.querySelector(".empty");
94
+ next?.focus();
95
+ }
96
+ renderValue(value) {
97
+ if (value === true) {
98
+ return html `<tt-icon class="yes" name="check" size="16px"></tt-icon
99
+ ><span class="sr-only">Yes</span>`;
100
+ }
101
+ if (value === false) {
102
+ return html `<span class="no" aria-hidden="true">&mdash;</span
103
+ ><span class="sr-only">No</span>`;
104
+ }
105
+ // Null and empty mean "not stated", which is different from "no" and
106
+ // should not be dressed up as either.
107
+ if (value === null || value === undefined || value === "") {
108
+ return html `<span class="unknown">Not stated</span>`;
109
+ }
110
+ return value;
111
+ }
112
+ static { this.styles = [
113
+ srOnly,
114
+ css `
115
+ /* The browser's own [hidden] rule loses to any :host display, so a
116
+ hidden element would still show. Important, so it always wins. */
117
+ :host([hidden]) {
118
+ display: none !important;
119
+ }
120
+
121
+ :host {
122
+ display: block;
123
+ font-family: var(--tt-font-sans);
124
+ }
125
+
126
+ .wrap {
127
+ width: 100%;
128
+ overflow-x: auto;
129
+ box-sizing: border-box;
130
+
131
+ background: var(--tt-card);
132
+ border: 1px solid var(--tt-border);
133
+ border-radius: var(--tt-radius-lg);
134
+
135
+ -webkit-overflow-scrolling: touch;
136
+ }
137
+
138
+ table {
139
+ width: 100%;
140
+ border-collapse: separate;
141
+ border-spacing: 0;
142
+ font-size: var(--tt-text-sm);
143
+ }
144
+
145
+ th,
146
+ td {
147
+ padding: var(--tt-space-3) var(--tt-space-4);
148
+ text-align: left;
149
+ vertical-align: top;
150
+ border-bottom: 1px solid var(--tt-border);
151
+ }
152
+
153
+ /*
154
+ The attribute column sticks. Comparing is a sideways act, and losing
155
+ track of which row you are reading defeats the whole component.
156
+ z-index keeps it above the scrolling cells; the background is
157
+ required or they show through underneath it.
158
+ */
159
+ .attr {
160
+ position: sticky;
161
+ left: 0;
162
+ z-index: 2;
163
+
164
+ min-width: 140px;
165
+ background: var(--tt-card);
166
+ border-right: 1px solid var(--tt-border);
167
+
168
+ /* Reads as pinned rather than as a column that happens to be
169
+ first, and makes it obvious content is passing underneath. A
170
+ token, because a fixed 8% black vanished on the dark theme. */
171
+ box-shadow: var(--tt-shadow-pinned);
172
+ }
173
+
174
+ thead .attr {
175
+ z-index: 3;
176
+ }
177
+
178
+ /* Pins only when ::part(wrap) has a max-height. See the same rule in
179
+ tt-data-table for why it cannot pin to the page. */
180
+ thead th {
181
+ position: sticky;
182
+ top: 0;
183
+ z-index: 1;
184
+
185
+ background: var(--tt-muted);
186
+ vertical-align: bottom;
187
+ }
188
+
189
+ thead .attr {
190
+ background: var(--tt-muted);
191
+ }
192
+
193
+ .item-head {
194
+ display: flex;
195
+ align-items: flex-start;
196
+ gap: var(--tt-space-2);
197
+ min-width: 160px;
198
+ }
199
+
200
+ .item-title {
201
+ display: flex;
202
+ flex-direction: column;
203
+ gap: 2px;
204
+ min-width: 0;
205
+ }
206
+
207
+ .item-label {
208
+ font-size: var(--tt-text-sm);
209
+ font-weight: var(--tt-weight-semibold);
210
+ color: var(--tt-foreground);
211
+ overflow-wrap: anywhere;
212
+ }
213
+
214
+ .item-meta {
215
+ font-size: var(--tt-text-xs);
216
+ font-weight: var(--tt-weight-regular);
217
+ color: var(--tt-muted-foreground);
218
+ }
219
+
220
+ .attr-label {
221
+ font-weight: var(--tt-weight-medium);
222
+ color: var(--tt-foreground);
223
+ }
224
+
225
+ .attr-hint {
226
+ display: block;
227
+ margin-top: 2px;
228
+ font-size: var(--tt-text-xs);
229
+ font-weight: var(--tt-weight-regular);
230
+ color: var(--tt-muted-foreground);
231
+ }
232
+
233
+ .yes {
234
+ color: var(--tt-success);
235
+ }
236
+
237
+ .no {
238
+ color: var(--tt-muted-foreground);
239
+ }
240
+
241
+ /* Absent is not the same as no, and should not look like it. */
242
+ .unknown {
243
+ font-size: var(--tt-text-xs);
244
+ font-style: italic;
245
+ color: var(--tt-muted-foreground);
246
+ }
247
+
248
+ .remove {
249
+ flex: 0 0 auto;
250
+
251
+ display: inline-flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+
255
+ /* Same size rule as tt-search's clear button: a square inside a
256
+ small control, so it grows with the touch and density tokens
257
+ instead of staying a 22px target on a phone. */
258
+ width: calc(var(--tt-control-sm) - 8px);
259
+ height: calc(var(--tt-control-sm) - 8px);
260
+
261
+ padding: 0;
262
+ border: none;
263
+ border-radius: var(--tt-radius-full);
264
+
265
+ background: transparent;
266
+ color: var(--tt-muted-foreground);
267
+
268
+ cursor: pointer;
269
+ }
270
+
271
+ .remove:hover {
272
+ background: var(--tt-accent);
273
+ color: var(--tt-foreground);
274
+ }
275
+
276
+ .remove:focus-visible {
277
+ outline: var(--tt-ring-width) solid var(--tt-ring);
278
+ outline-offset: var(--tt-ring-offset);
279
+ }
280
+
281
+ .empty {
282
+ padding: var(--tt-space-8);
283
+ text-align: center;
284
+ font-size: var(--tt-text-sm);
285
+ color: var(--tt-muted-foreground);
286
+ }
287
+
288
+ /*
289
+ Takes focus when the last column is removed, so it shows the ring
290
+ like anything else with focus. Drawn INSIDE the edge: the scrolling
291
+ .wrap clips anything outside its box, so the usual positive offset
292
+ would be cut off completely.
293
+ */
294
+ .empty:focus-visible {
295
+ outline: var(--tt-ring-width) solid var(--tt-ring);
296
+ outline-offset: calc(var(--tt-ring-width) * -1);
297
+ }
298
+
299
+ tbody tr:last-child th,
300
+ tbody tr:last-child td {
301
+ border-bottom: none;
302
+ }
303
+
304
+ /*
305
+ MOBILE. The sticky column was eating the screen.
306
+
307
+ At 140px min-width plus space-4 padding on both sides it took about
308
+ 172px of a 360px phone, and each item column then wanted 192px - so
309
+ one column filled the remaining space and nothing else was legible.
310
+ A comparison you can only see one side of is not a comparison.
311
+
312
+ Everything here buys horizontal room back: tighter padding, a
313
+ smaller floor on both columns, and smaller type in the attribute
314
+ column, whose labels can wrap onto two lines quite happily. The
315
+ target is that the second item column is partly visible, because a
316
+ half-visible column is what tells you to swipe.
317
+
318
+ 768px, the library's tablet breakpoint, not a one-off value.
319
+ */
320
+ @media (max-width: 768px) {
321
+ th,
322
+ td {
323
+ padding: var(--tt-space-2) var(--tt-space-3);
324
+ }
325
+
326
+ .attr {
327
+ min-width: 92px;
328
+ width: 92px;
329
+ }
330
+
331
+ .attr-label {
332
+ font-size: var(--tt-text-xs);
333
+ }
334
+
335
+ .item-head {
336
+ min-width: 118px;
337
+ }
338
+
339
+ .item-label {
340
+ font-size: var(--tt-text-xs);
341
+ }
342
+
343
+ table {
344
+ font-size: var(--tt-text-xs);
345
+ }
346
+ }
347
+ `,
348
+ ]; }
349
+ render() {
350
+ if (this.items.length === 0) {
351
+ return html `<div class="wrap">
352
+ <div class="empty" part="empty" tabindex="-1">${this.emptyText}</div>
353
+ </div>`;
354
+ }
355
+ const rows = this.visibleRows;
356
+ return html `
357
+ <div class="wrap" part="wrap">
358
+ <table part="table">
359
+ <thead>
360
+ <tr>
361
+ <th class="attr" scope="col">
362
+ <span class="attr-label">Compare</span>
363
+ </th>
364
+
365
+ ${this.items.map((item, index) => html `
366
+ <th scope="col">
367
+ <div class="item-head">
368
+ <span class="item-title">
369
+ <span class="item-label">${item.label}</span>
370
+ ${item.meta
371
+ ? html `<span class="item-meta">${item.meta}</span>`
372
+ : ""}
373
+ </span>
374
+
375
+ ${this.removable
376
+ ? html `
377
+ <button
378
+ class="remove"
379
+ type="button"
380
+ aria-label=${`Remove ${item.label}`}
381
+ @click=${(e) => this.removeItem(item, index, e)}
382
+ >
383
+ <tt-icon name="x" size="14px"></tt-icon>
384
+ </button>
385
+ `
386
+ : ""}
387
+ </div>
388
+ </th>
389
+ `)}
390
+ </tr>
391
+ </thead>
392
+
393
+ <tbody>
394
+ ${rows.length === 0
395
+ ? html `
396
+ <tr>
397
+ <td class="empty" colspan=${this.items.length + 1}>
398
+ These are identical on every attribute.
399
+ </td>
400
+ </tr>
401
+ `
402
+ : rows.map((row) => html `
403
+ <tr>
404
+ <th class="attr" scope="row">
405
+ <span class="attr-label">${row.label}</span>
406
+ ${row.hint
407
+ ? html `<span class="attr-hint">${row.hint}</span>`
408
+ : ""}
409
+ </th>
410
+
411
+ ${this.items.map((item) => html `
412
+ <td>${this.renderValue(item.values[row.key] ?? null)}</td>
413
+ `)}
414
+ </tr>
415
+ `)}
416
+ </tbody>
417
+ </table>
418
+ </div>
419
+ `;
420
+ }
421
+ };
422
+ __decorate([
423
+ property({ type: Array })
424
+ ], TTComparisonTable.prototype, "rows", void 0);
425
+ __decorate([
426
+ property({ type: Array })
427
+ ], TTComparisonTable.prototype, "items", void 0);
428
+ __decorate([
429
+ property({ type: Boolean, attribute: "differences-only" })
430
+ ], TTComparisonTable.prototype, "differencesOnly", void 0);
431
+ __decorate([
432
+ property({ type: Boolean })
433
+ ], TTComparisonTable.prototype, "removable", void 0);
434
+ __decorate([
435
+ property({ type: String, attribute: "empty-text" })
436
+ ], TTComparisonTable.prototype, "emptyText", void 0);
437
+ TTComparisonTable = __decorate([
438
+ customElement("tt-comparison-table")
439
+ ], TTComparisonTable);
440
+ export { TTComparisonTable };
441
+ //# sourceMappingURL=tt-comparison-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-comparison-table.js","sourceRoot":"","sources":["../src/tt-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,CAya7B"}
@@ -0,0 +1,63 @@
1
+ import { LitElement } from "lit";
2
+ import type { TemplateResult } from "lit";
3
+ import "./tt-page.js";
4
+ import "./tt-section.js";
5
+ import "./tt-preview.js";
6
+ import "./tt-example.js";
7
+ import "./tt-code-block.js";
8
+ import "./tt-table.js";
9
+ import "./tt-icon.js";
10
+ import type { TableRow } from "./tt-table.js";
11
+ export interface DocExample {
12
+ title: string;
13
+ description?: string;
14
+ preview: TemplateResult;
15
+ code: string;
16
+ language?: string;
17
+ align?: "center" | "start" | "stretch";
18
+ }
19
+ export interface DocGuidelines {
20
+ use?: string[];
21
+ avoid?: string[];
22
+ }
23
+ export interface DocKeyBinding {
24
+ keys: string;
25
+ action: string;
26
+ }
27
+ export interface DocAccessibility {
28
+ keys?: DocKeyBinding[];
29
+ notes?: string[];
30
+ }
31
+ export interface DocRelated {
32
+ label: string;
33
+ doc: string;
34
+ reason?: string;
35
+ }
36
+ export declare class TTComponentDoc extends LitElement {
37
+ heading: string;
38
+ description: string;
39
+ code: string;
40
+ props: TableRow[];
41
+ events: TableRow[];
42
+ methods: TableRow[];
43
+ slots: TableRow[];
44
+ parts: TableRow[];
45
+ cssProperties: TableRow[];
46
+ importPath: string;
47
+ anatomy: string;
48
+ examples: DocExample[];
49
+ guidelines: DocGuidelines | null;
50
+ accessibility: DocAccessibility | null;
51
+ related: DocRelated[];
52
+ private openDoc;
53
+ static styles: import("lit").CSSResult;
54
+ private renderGuidelines;
55
+ private renderAccessibility;
56
+ render(): TemplateResult<1>;
57
+ }
58
+ declare global {
59
+ interface HTMLElementTagNameMap {
60
+ "tt-component-doc": TTComponentDoc;
61
+ }
62
+ }
63
+ //# sourceMappingURL=tt-component-doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-component-doc.d.ts","sourceRoot":"","sources":["../src/tt-component-doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,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