@tartaguti/ui-components 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/CHANGELOG.md +13 -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 +16899 -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 +96 -0
  172. package/dist/tt-data-table.d.ts.map +1 -0
  173. package/dist/tt-data-table.js +812 -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 +2911 -0
@@ -0,0 +1,34 @@
1
+ import { LitElement } from "lit";
2
+ export type SocialPlatform = "website" | "linkedin" | "facebook" | "instagram" | "x" | "youtube" | "email" | "phone";
3
+ export interface SocialLink {
4
+ platform: SocialPlatform;
5
+ url: string;
6
+ label?: string;
7
+ }
8
+ /**
9
+ * A row of platform links. Trivial to write once and endlessly repeated,
10
+ * which is exactly what earns a component.
11
+ *
12
+ * `email` and `phone` are in the set on purpose. They are not social
13
+ * networks, but on a business profile they sit in the same row and behave
14
+ * the same way, and splitting them into a second component would mean two
15
+ * rows that have to be styled to look like one.
16
+ *
17
+ * Every href goes through safeUrl, because these come from user-entered
18
+ * profile data. A company that types `javascript:...` into its website
19
+ * field would otherwise get it rendered as a live link on its own page.
20
+ */
21
+ export declare class TTSocialLinks extends LitElement {
22
+ links: SocialLink[];
23
+ size: "small" | "medium";
24
+ labelled: boolean;
25
+ private hrefFor;
26
+ static styles: import("lit").CSSResult;
27
+ render(): import("lit-html").TemplateResult<1>;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ "tt-social-links": TTSocialLinks;
32
+ }
33
+ }
34
+ //# sourceMappingURL=tt-social-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-social-links.d.ts","sourceRoot":"","sources":["../src/tt-social-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMjD,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,GAAG,GACH,SAAS,GACT,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,cAAc,CAAC;IAEzB,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA2ED;;;;;;;;;;;;GAYG;AACH,qBACa,aAAc,SAAQ,UAAU;IAChB,KAAK,EAAE,UAAU,EAAE,CAAM;IAET,IAAI,EAAE,OAAO,GAAG,QAAQ,CACxD;IAIkB,QAAQ,UAAS;IAE9C,OAAO,CAAC,OAAO;IAmBf,MAAM,CAAC,MAAM,0BAqFX;IAEF,MAAM;CAoCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
@@ -0,0 +1,242 @@
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, svg, css } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { safeUrl } from "./safe-url.js";
10
+ /*
11
+ Brand marks live here rather than in tt-icon, deliberately.
12
+
13
+ tt-icon is one set on one grid: 24x24, stroked, 2px, round caps. Brand
14
+ logos are filled shapes at fixed proportions that cannot be redrawn to
15
+ that spec without ceasing to be the logo. Mixing them into the set would
16
+ mean the set no longer has a spec. They are also the one category that
17
+ belongs to someone else, so they change when the owner changes them.
18
+ */
19
+ const MARKS = {
20
+ website: svg `
21
+ <circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2" />
22
+ <path d="M3 12h18" fill="none" stroke="currentColor" stroke-width="2" />
23
+ <path d="M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18Z" fill="none" stroke="currentColor" stroke-width="2" />
24
+ `,
25
+ linkedin: svg `
26
+ <path
27
+ d="M4.98 3.5A2.5 2.5 0 1 1 5 8.5a2.5 2.5 0 0 1 0-5ZM3 9h4v12H3V9Zm7 0h3.8v1.7h.05c.53-.95 1.83-1.95 3.75-1.95C21.4 8.75 22 11 22 14v7h-4v-6.2c0-1.5 0-3.4-2.1-3.4s-2.4 1.6-2.4 3.3V21h-4V9Z"
28
+ />
29
+ `,
30
+ facebook: svg `
31
+ <path
32
+ d="M22 12a10 10 0 1 0-11.6 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.4v7A10 10 0 0 0 22 12Z"
33
+ />
34
+ `,
35
+ instagram: svg `
36
+ <rect x="3" y="3" width="18" height="18" rx="5" fill="none" stroke="currentColor" stroke-width="2" />
37
+ <circle cx="12" cy="12" r="4" fill="none" stroke="currentColor" stroke-width="2" />
38
+ <circle cx="17.5" cy="6.5" r="1.2" />
39
+ `,
40
+ x: svg `
41
+ <path
42
+ d="M17.5 3h3.2l-7 8 8.2 10h-6.4l-5-6.1L4.7 21H1.5l7.5-8.6L1.2 3h6.6l4.5 5.6L17.5 3Zm-1.1 16.1h1.8L7.7 4.8H5.8l10.6 14.3Z"
43
+ />
44
+ `,
45
+ youtube: svg `
46
+ <path
47
+ d="M22.5 7.2a2.7 2.7 0 0 0-1.9-1.9C18.9 4.8 12 4.8 12 4.8s-6.9 0-8.6.5A2.7 2.7 0 0 0 1.5 7.2 28 28 0 0 0 1 12a28 28 0 0 0 .5 4.8 2.7 2.7 0 0 0 1.9 1.9c1.7.5 8.6.5 8.6.5s6.9 0 8.6-.5a2.7 2.7 0 0 0 1.9-1.9A28 28 0 0 0 23 12a28 28 0 0 0-.5-4.8ZM9.8 15.3V8.7l5.7 3.3-5.7 3.3Z"
48
+ />
49
+ `,
50
+ email: svg `
51
+ <rect x="2" y="4" width="20" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="2" />
52
+ <path d="m2 7 10 6 10-6" fill="none" stroke="currentColor" stroke-width="2" />
53
+ `,
54
+ phone: svg `
55
+ <path
56
+ d="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2 4.2 2 2 0 0 1 4 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.1a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2Z"
57
+ fill="none"
58
+ stroke="currentColor"
59
+ stroke-width="2"
60
+ stroke-linejoin="round"
61
+ />
62
+ `,
63
+ };
64
+ const NAMES = {
65
+ website: "Website",
66
+ linkedin: "LinkedIn",
67
+ facebook: "Facebook",
68
+ instagram: "Instagram",
69
+ x: "X",
70
+ youtube: "YouTube",
71
+ email: "Email",
72
+ phone: "Phone",
73
+ };
74
+ /**
75
+ * A row of platform links. Trivial to write once and endlessly repeated,
76
+ * which is exactly what earns a component.
77
+ *
78
+ * `email` and `phone` are in the set on purpose. They are not social
79
+ * networks, but on a business profile they sit in the same row and behave
80
+ * the same way, and splitting them into a second component would mean two
81
+ * rows that have to be styled to look like one.
82
+ *
83
+ * Every href goes through safeUrl, because these come from user-entered
84
+ * profile data. A company that types `javascript:...` into its website
85
+ * field would otherwise get it rendered as a live link on its own page.
86
+ */
87
+ let TTSocialLinks = class TTSocialLinks extends LitElement {
88
+ constructor() {
89
+ super(...arguments);
90
+ this.links = [];
91
+ this.size = "medium";
92
+ // Show the platform name beside the mark, for a contact block rather
93
+ // than a compact row of icons.
94
+ this.labelled = false;
95
+ }
96
+ hrefFor(link) {
97
+ if (link.platform === "email") {
98
+ // mailto: is on safeUrl's allowlist, so this survives the check.
99
+ return safeUrl(link.url.startsWith("mailto:") ? link.url : `mailto:${link.url}`);
100
+ }
101
+ if (link.platform === "phone") {
102
+ return safeUrl(link.url.startsWith("tel:")
103
+ ? link.url
104
+ : `tel:${link.url.replace(/[^\d+]/g, "")}`);
105
+ }
106
+ return safeUrl(link.url);
107
+ }
108
+ static { this.styles = css `
109
+ /* The browser's own [hidden] rule loses to any :host display, so a
110
+ hidden element would still show. Important, so it always wins. */
111
+ :host([hidden]) {
112
+ display: none !important;
113
+ }
114
+
115
+ :host {
116
+ display: block;
117
+ font-family: var(--tt-font-sans);
118
+ }
119
+
120
+ ul {
121
+ display: flex;
122
+ flex-wrap: wrap;
123
+ align-items: center;
124
+ gap: var(--tt-space-2);
125
+
126
+ margin: 0;
127
+ padding: 0;
128
+ list-style: none;
129
+ }
130
+
131
+ /* Real anchors, so middle-click and cmd-click open a new tab and the
132
+ browser shows the destination on hover. A button pretending to be a
133
+ link takes all of that away. */
134
+ a {
135
+ display: inline-flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ gap: var(--tt-space-2);
139
+
140
+ width: var(--tt-control-sm);
141
+ height: var(--tt-control-sm);
142
+
143
+ border: 1px solid var(--tt-border);
144
+ border-radius: var(--tt-radius-full);
145
+
146
+ color: var(--tt-muted-foreground);
147
+ text-decoration: none;
148
+
149
+ transition:
150
+ color var(--tt-duration-fast) var(--tt-ease),
151
+ border-color var(--tt-duration-fast) var(--tt-ease),
152
+ background var(--tt-duration-fast) var(--tt-ease);
153
+ }
154
+
155
+ :host([size="small"]) a {
156
+ width: 28px;
157
+ height: 28px;
158
+ }
159
+
160
+ /* Labelled turns the circle into a pill, so the name has room. */
161
+ :host(:not([size="small"])) .labelled a,
162
+ .labelled a {
163
+ width: auto;
164
+ padding: 0 var(--tt-space-3);
165
+ border-radius: var(--tt-radius-full);
166
+ font-size: var(--tt-text-sm);
167
+ }
168
+
169
+ a:hover {
170
+ color: var(--tt-foreground);
171
+ border-color: var(--tt-border-strong);
172
+ background: var(--tt-accent);
173
+ }
174
+
175
+ a:focus-visible {
176
+ outline: var(--tt-ring-width) solid var(--tt-ring);
177
+ outline-offset: var(--tt-ring-offset);
178
+ }
179
+
180
+ svg {
181
+ display: block;
182
+ width: 16px;
183
+ height: 16px;
184
+ flex: 0 0 auto;
185
+ fill: currentColor;
186
+ }
187
+
188
+ :host([size="small"]) svg {
189
+ width: 14px;
190
+ height: 14px;
191
+ }
192
+
193
+ `; }
194
+ render() {
195
+ return html `
196
+ <ul class=${this.labelled ? "labelled" : ""} part="list">
197
+ ${this.links.map((link) => {
198
+ const href = this.hrefFor(link);
199
+ // A rejected URL renders nothing at all. Showing a dead link is
200
+ // worse than showing no link.
201
+ if (!href)
202
+ return "";
203
+ const name = link.label ?? NAMES[link.platform];
204
+ return html `
205
+ <li>
206
+ <a
207
+ part="link"
208
+ href=${href}
209
+ target=${link.platform === "email" || link.platform === "phone"
210
+ ? "_self"
211
+ : "_blank"}
212
+ rel="noopener noreferrer"
213
+ title=${name}
214
+ aria-label=${name}
215
+ >
216
+ <svg viewBox="0 0 24 24" aria-hidden="true">
217
+ ${MARKS[link.platform]}
218
+ </svg>
219
+
220
+ ${this.labelled ? html `<span>${name}</span>` : ""}
221
+ </a>
222
+ </li>
223
+ `;
224
+ })}
225
+ </ul>
226
+ `;
227
+ }
228
+ };
229
+ __decorate([
230
+ property({ type: Array })
231
+ ], TTSocialLinks.prototype, "links", void 0);
232
+ __decorate([
233
+ property({ type: String, reflect: true })
234
+ ], TTSocialLinks.prototype, "size", void 0);
235
+ __decorate([
236
+ property({ type: Boolean })
237
+ ], TTSocialLinks.prototype, "labelled", void 0);
238
+ TTSocialLinks = __decorate([
239
+ customElement("tt-social-links")
240
+ ], TTSocialLinks);
241
+ export { TTSocialLinks };
242
+ //# sourceMappingURL=tt-social-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-social-links.js","sourceRoot":"","sources":["../src/tt-social-links.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAoBxC;;;;;;;;EAQE;AACF,MAAM,KAAK,GAA8C;IACvD,OAAO,EAAE,GAAG,CAAA;;;;GAIX;IAED,QAAQ,EAAE,GAAG,CAAA;;;;GAIZ;IAED,QAAQ,EAAE,GAAG,CAAA;;;;GAIZ;IAED,SAAS,EAAE,GAAG,CAAA;;;;GAIb;IAED,CAAC,EAAE,GAAG,CAAA;;;;GAIL;IAED,OAAO,EAAE,GAAG,CAAA;;;;GAIX;IAED,KAAK,EAAE,GAAG,CAAA;;;GAGT;IAED,KAAK,EAAE,GAAG,CAAA;;;;;;;;GAQT;CACF,CAAC;AAEF,MAAM,KAAK,GAAmC;IAC5C,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,CA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C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEhC,gEAAgE;YAChE,8BAA8B;YAC9B,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAC;YAErB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEhD,OAAO,IAAI,CAAA;;;;uBAIE,IAAI;yBACF,IAAI,CAAC,QAAQ,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO;gBAC7D,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,QAAQ;;wBAEJ,IAAI;6BACC,IAAI;;;oBAGb,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;;;kBAGtB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;;;WAGtD,CAAC;QACJ,CAAC,CAAC;;KAEL,CAAC;IACJ,CAAC;;AAtJ0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAA0B;AAET;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC/B;AAIkB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAkB;AARnC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAwJzB"}
@@ -0,0 +1,19 @@
1
+ import { LitElement } from "lit";
2
+ export type SparklineTrend = "positive" | "negative" | "neutral";
3
+ export declare class TTSparkline extends LitElement {
4
+ points: number[];
5
+ area: boolean;
6
+ trend: SparklineTrend;
7
+ label: string;
8
+ private get coordinates();
9
+ private get linePath();
10
+ private get areaPath();
11
+ static styles: import("lit").CSSResult;
12
+ render(): import("lit-html").TemplateResult<1>;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ "tt-sparkline": TTSparkline;
17
+ }
18
+ }
19
+ //# sourceMappingURL=tt-sparkline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-sparkline.d.ts","sourceRoot":"","sources":["../src/tt-sparkline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAIjD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjE,qBACa,WAAY,SAAQ,UAAU;IACd,MAAM,EAAE,MAAM,EAAE,CAAM;IAGpB,IAAI,UAAS;IAMC,KAAK,EAAE,cAAc,CAAa;IAIjD,KAAK,SAAM;IAcvC,OAAO,KAAK,WAAW,GAgBtB;IAED,OAAO,KAAK,QAAQ,GAInB;IAGD,OAAO,KAAK,QAAQ,GAInB;IAED,MAAM,CAAC,MAAM,0BAsEX;IAEF,MAAM;CAyCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -0,0 +1,191 @@
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, svg } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { styleMap } from "lit/directives/style-map.js";
10
+ let TTSparkline = class TTSparkline extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.points = [];
14
+ // Fill the area under the line. Reads as volume rather than rate.
15
+ this.area = false;
16
+ // Same vocabulary as tt-stat: sentiment, not direction. A falling
17
+ // refund rate is positive. Reflected because the colour comes from
18
+ // :host([trend]) selectors, which only see attributes: set as a
19
+ // property without reflect, the line stayed grey.
20
+ this.trend = "neutral";
21
+ // Accessible summary. Without one the chart is invisible to a screen
22
+ // reader, since an SVG of a path means nothing on its own.
23
+ this.label = "";
24
+ }
25
+ /*
26
+ The maths, all of it.
27
+
28
+ The viewBox is a fixed 0..100 box and preserveAspectRatio="none" lets
29
+ it stretch to whatever size the host is. So the only job here is
30
+ turning values into percentages:
31
+
32
+ x = index / (count - 1) * 100
33
+ y = 100 - (value - min) / (max - min) * 100
34
+
35
+ y is inverted because SVG counts downward from the top.
36
+ */
37
+ get coordinates() {
38
+ const values = this.points;
39
+ if (values.length < 2)
40
+ return [];
41
+ const min = Math.min(...values);
42
+ const max = Math.max(...values);
43
+ // All values equal: no range to scale against, so draw it flat.
44
+ const range = max - min || 1;
45
+ const flat = max === min;
46
+ return values.map((value, index) => {
47
+ const x = (index / (values.length - 1)) * 100;
48
+ const y = flat ? 50 : 100 - ((value - min) / range) * 100;
49
+ return [x, y];
50
+ });
51
+ }
52
+ get linePath() {
53
+ return this.coordinates
54
+ .map(([x, y], i) => `${i === 0 ? "M" : "L"}${x.toFixed(2)} ${y.toFixed(2)}`)
55
+ .join(" ");
56
+ }
57
+ // The line, then down to the baseline and back, closing the shape.
58
+ get areaPath() {
59
+ const line = this.linePath;
60
+ if (!line)
61
+ return "";
62
+ return `${line} L100 100 L0 100 Z`;
63
+ }
64
+ static { this.styles = css `
65
+ /* The browser's own [hidden] rule loses to any :host display, so a
66
+ hidden element would still show. Important, so it always wins. */
67
+ :host([hidden]) {
68
+ display: none !important;
69
+ }
70
+
71
+ :host {
72
+ /* Positioning context for the end dot. */
73
+ position: relative;
74
+
75
+ display: block;
76
+ width: 100%;
77
+ height: 40px;
78
+
79
+ /* One variable drives stroke and fill, so a trend overrides one
80
+ value rather than several rules. */
81
+ --_color: var(--tt-muted-foreground);
82
+ }
83
+
84
+ :host([trend="positive"]) {
85
+ --_color: var(--tt-success);
86
+ }
87
+
88
+ :host([trend="negative"]) {
89
+ --_color: var(--tt-destructive);
90
+ }
91
+
92
+ svg {
93
+ display: block;
94
+ width: 100%;
95
+ height: 100%;
96
+ overflow: visible;
97
+ }
98
+
99
+ .line {
100
+ fill: none;
101
+ stroke: var(--_color);
102
+ stroke-width: 1.5;
103
+ stroke-linecap: round;
104
+ stroke-linejoin: round;
105
+ }
106
+
107
+ .area {
108
+ fill: var(--_color);
109
+ opacity: 0.12;
110
+ stroke: none;
111
+ }
112
+
113
+ /*
114
+ The end dot is HTML, not an SVG circle. preserveAspectRatio="none"
115
+ stretches everything inside the SVG, a circle included, so at
116
+ 300x40 the old r="2" circle drew as an oval 6px wide and under 1px
117
+ tall. A span placed by percentage keeps the same coordinates and
118
+ stays round at any size.
119
+ */
120
+ .dot {
121
+ --_size: 5px;
122
+
123
+ position: absolute;
124
+ width: var(--_size);
125
+ height: var(--_size);
126
+
127
+ border-radius: var(--tt-radius-full);
128
+ background: var(--_color);
129
+
130
+ /* left/top place the CENTRE on the last point, not the corner. */
131
+ transform: translate(-50%, -50%);
132
+ pointer-events: none;
133
+ }
134
+ `; }
135
+ render() {
136
+ const coords = this.coordinates;
137
+ // Fewer than two points is not a trend. Render nothing rather than
138
+ // a misleading dot or an empty box with a stray line.
139
+ if (coords.length === 0)
140
+ return html ``;
141
+ const last = coords[coords.length - 1];
142
+ return html `
143
+ <svg
144
+ part="chart"
145
+ viewBox="0 0 100 100"
146
+ preserveAspectRatio="none"
147
+ role="img"
148
+ aria-label=${this.label || "Trend"}
149
+ >
150
+ ${this.area
151
+ ? svg `<path class="area" d=${this.areaPath} />`
152
+ : ""}
153
+
154
+ <!--
155
+ vector-effect keeps the stroke an even width. Without it,
156
+ preserveAspectRatio="none" stretches the line thickness along
157
+ with the geometry and it looks wrong at wide sizes.
158
+ -->
159
+ ${svg `<path
160
+ class="line"
161
+ d=${this.linePath}
162
+ vector-effect="non-scaling-stroke"
163
+ />`}
164
+ </svg>
165
+
166
+ <span
167
+ class="dot"
168
+ part="dot"
169
+ aria-hidden="true"
170
+ style=${styleMap({ left: `${last[0]}%`, top: `${last[1]}%` })}
171
+ ></span>
172
+ `;
173
+ }
174
+ };
175
+ __decorate([
176
+ property({ type: Array })
177
+ ], TTSparkline.prototype, "points", void 0);
178
+ __decorate([
179
+ property({ type: Boolean })
180
+ ], TTSparkline.prototype, "area", void 0);
181
+ __decorate([
182
+ property({ type: String, reflect: true })
183
+ ], TTSparkline.prototype, "trend", void 0);
184
+ __decorate([
185
+ property({ type: String })
186
+ ], TTSparkline.prototype, "label", void 0);
187
+ TTSparkline = __decorate([
188
+ customElement("tt-sparkline")
189
+ ], TTSparkline);
190
+ export { TTSparkline };
191
+ //# sourceMappingURL=tt-sparkline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-sparkline.js","sourceRoot":"","sources":["../src/tt-sparkline.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKhD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QACsB,WAAM,GAAa,EAAE,CAAC;QAEjD,kEAAkE;QACrC,SAAI,GAAG,KAAK,CAAC;QAE1C,kEAAkE;QAClE,mEAAmE;QACnE,gEAAgE;QAChE,kDAAkD;QACP,UAAK,GAAmB,SAAS,CAAC;QAE7E,qEAAqE;QACrE,2DAA2D;QAC/B,UAAK,GAAG,EAAE,CAAC;IA8JzC,CAAC;IA5JC;;;;;;;;;;;MAWE;IACF,IAAY,WAAW;QACrB,MAAM,MAAM,GAAG,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c,CAAC;GACjB,WAAW,CA4KvB"}
@@ -0,0 +1,19 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Indeterminate loading indicator, for when you cannot say how long
4
+ * something will take. Prefer tt-skeleton when you know the shape of what
5
+ * is coming: a skeleton tells the user what to expect, a spinner only
6
+ * tells them to wait.
7
+ */
8
+ export declare class TTSpinner extends LitElement {
9
+ size: string;
10
+ label: string;
11
+ static styles: import("lit").CSSResult[];
12
+ render(): import("lit-html").TemplateResult<1>;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ "tt-spinner": TTSpinner;
17
+ }
18
+ }
19
+ //# sourceMappingURL=tt-spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-spinner.d.ts","sourceRoot":"","sources":["../src/tt-spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAK5C;;;;;GAKG;AACH,qBACa,SAAU,SAAQ,UAAU;IAEX,IAAI,SAAU;IAEd,KAAK,SAAa;IAE9C,MAAM,CAAC,MAAM,4BAiCV;IAEH,MAAM;CAwBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
@@ -0,0 +1,93 @@
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 { styleMap } from "lit/directives/style-map.js";
10
+ import { srOnly } from "./sr-only.js";
11
+ /**
12
+ * Indeterminate loading indicator, for when you cannot say how long
13
+ * something will take. Prefer tt-skeleton when you know the shape of what
14
+ * is coming: a skeleton tells the user what to expect, a spinner only
15
+ * tells them to wait.
16
+ */
17
+ let TTSpinner = class TTSpinner extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ // Any CSS length. Inherits currentColor, so it matches its surroundings.
21
+ this.size = "20px";
22
+ this.label = "Loading";
23
+ }
24
+ static { this.styles = [srOnly, css `
25
+ /* The browser's own [hidden] rule loses to any :host display, so a
26
+ hidden element would still show. Important, so it always wins. */
27
+ :host([hidden]) {
28
+ display: none !important;
29
+ }
30
+
31
+ :host {
32
+ display: inline-flex;
33
+ flex: 0 0 auto;
34
+ color: currentColor;
35
+ }
36
+
37
+ .spinner {
38
+ /* The fallback is the default size, for a size that was dropped. */
39
+ width: var(--_size, 20px);
40
+ height: var(--_size, 20px);
41
+
42
+ border: 2px solid currentColor;
43
+ border-top-color: transparent;
44
+ border-radius: var(--tt-radius-full);
45
+
46
+ opacity: 0.85;
47
+
48
+ animation: spin var(--tt-duration-spin) linear infinite;
49
+ }
50
+
51
+ @keyframes spin {
52
+ to {
53
+ transform: rotate(360deg);
54
+ }
55
+ }
56
+
57
+ `]; }
58
+ render() {
59
+ return html `
60
+ <!--
61
+ The label as TEXT inside the status, not as aria-label on it. A
62
+ live region announces its content, and aria-label is not content,
63
+ so "Loading" was never spoken.
64
+
65
+ A size of "20px; position: fixed" used to add a second
66
+ declaration. styleMap sets one property per key, but joins them on
67
+ its first render, so the size must also be one valid length; see
68
+ the same guard in tt-skeleton.
69
+ -->
70
+ <div
71
+ class="spinner"
72
+ part="spinner"
73
+ style=${styleMap({
74
+ "--_size": CSS.supports("width", this.size) ? this.size : undefined,
75
+ })}
76
+ role="status"
77
+ >
78
+ <span class="sr-only">${this.label}</span>
79
+ </div>
80
+ `;
81
+ }
82
+ };
83
+ __decorate([
84
+ property({ type: String })
85
+ ], TTSpinner.prototype, "size", void 0);
86
+ __decorate([
87
+ property({ type: String })
88
+ ], TTSpinner.prototype, "label", void 0);
89
+ TTSpinner = __decorate([
90
+ customElement("tt-spinner")
91
+ ], TTSpinner);
92
+ export { TTSpinner };
93
+ //# sourceMappingURL=tt-spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-spinner.js","sourceRoot":"","sources":["../src/tt-spinner.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QACL,yEAAyE;QAC7C,SAAI,GAAG,MAAM,CAAC;QAEd,UAAK,GAAG,SAAS,CAAC;IA6DhD,CAAC;aA3DQ,WAAM,GAAG,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiC3B,CAAC,AAjCW,CAiCV;IAEH,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;gBAcC,QAAQ,CAAC;YACf,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SACpE,CAAC;;;gCAGsB,IAAI,CAAC,KAAK;;KAErC,CAAC;IACJ,CAAC;;AA9D2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAe;AAEd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAmB;AAJnC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiErB"}
@@ -0,0 +1,42 @@
1
+ import { LitElement } from "lit";
2
+ export type StackOrientation = "vertical" | "horizontal";
3
+ export type StackGap = "none" | "small" | "medium" | "large";
4
+ export type StackAlign = "start" | "center" | "end" | "stretch";
5
+ export type StackJustify = "start" | "center" | "end" | "between";
6
+ /**
7
+ * Lays its children out in a column or a row, with a gap from the
8
+ * spacing scale.
9
+ *
10
+ * The layout every screen repeats, and the library had no general one:
11
+ * tt-grid is a responsive grid, tt-toolbar a row with two sides,
12
+ * tt-button-group joins controls into one unit. So the apps wrote their
13
+ * own `display: flex; gap: ...` in some 26 files, with the same gap
14
+ * spelled 0.75rem in one and 12px in the next. A stack can only take a
15
+ * step of the scale, and because the steps are tokens, a stack also
16
+ * follows the density modes, which a hand-written 12px never will.
17
+ *
18
+ * THE HOST IS THE FLEX CONTAINER. The shadow root holds only a slot, and
19
+ * a slot is display: contents, so the slotted children become flex items
20
+ * of the host itself. With no inner wrapper there is nothing to reach
21
+ * through: a consumer's own `gap` or `flex-wrap` on the element simply
22
+ * wins, because a rule from outside beats :host.
23
+ *
24
+ * No reverse option, on purpose. A row drawn in the opposite order to
25
+ * its markup is read and tabbed through backwards by keyboard and screen
26
+ * reader users. Reorder the markup instead.
27
+ */
28
+ export declare class TTStack extends LitElement {
29
+ orientation: StackOrientation;
30
+ gap: StackGap;
31
+ align: StackAlign;
32
+ justify: StackJustify;
33
+ wrap: boolean;
34
+ static styles: import("lit").CSSResult;
35
+ render(): import("lit-html").TemplateResult<1>;
36
+ }
37
+ declare global {
38
+ interface HTMLElementTagNameMap {
39
+ "tt-stack": TTStack;
40
+ }
41
+ }
42
+ //# sourceMappingURL=tt-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-stack.d.ts","sourceRoot":"","sources":["../src/tt-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,CAAC;AACzD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,OAAQ,SAAQ,UAAU;IAOrC,WAAW,EAAE,gBAAgB,CAAc;IAEA,GAAG,EAAE,QAAQ,CAAY;IAGzB,KAAK,EAAE,UAAU,CAAa;IAI9B,OAAO,EAAE,YAAY,CAAW;IAG/B,IAAI,UAAS;IAEzD,MAAM,CAAC,MAAM,0BAqFX;IAEF,MAAM;CAGP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}