@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,132 @@
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
+ /**
10
+ * Attaches controls into one unit: the corners where they meet flatten,
11
+ * and their borders collapse onto a single shared edge.
12
+ *
13
+ * Use it when the buttons are alternatives to each other, or steps in one
14
+ * decision. Do NOT use it as a way to save space between unrelated
15
+ * actions: joining "Reload" to "Checkout" tells the reader they belong
16
+ * together, and they do not. A plain flex row with a gap is right for
17
+ * those, which is what tt-toolbar already does.
18
+ *
19
+ * HOW IT REACHES INSIDE ITS CHILDREN. Each control's radius lives on an
20
+ * element in its own shadow root, and ::slotted() only ever matches the
21
+ * host, never anything within it. So a group cannot restyle a button's
22
+ * corners directly. What it can do is set a CUSTOM PROPERTY on the host,
23
+ * because custom properties inherit through the shadow boundary, and each
24
+ * groupable control reads `--tt-group-radius` for its own radius. The
25
+ * group sets that per position, and the child applies it.
26
+ *
27
+ * Works with tt-button, tt-dropdown-menu, tt-select and tt-input.
28
+ */
29
+ let TTButtonGroup = class TTButtonGroup extends LitElement {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.orientation = "horizontal";
33
+ }
34
+ static { this.styles = css `
35
+ /* The browser's own [hidden] rule loses to any :host display, so a
36
+ hidden element would still show. Important, so it always wins. */
37
+ :host([hidden]) {
38
+ display: none !important;
39
+ }
40
+
41
+ :host {
42
+ display: inline-flex;
43
+ font-family: var(--tt-font-sans);
44
+ }
45
+
46
+ .group {
47
+ display: inline-flex;
48
+ /* stretch, so a shorter control still meets its neighbour's edges
49
+ rather than floating in the middle of the row. */
50
+ align-items: stretch;
51
+ }
52
+
53
+ :host([orientation="vertical"]) .group {
54
+ flex-direction: column;
55
+ align-items: stretch;
56
+ }
57
+
58
+ /*
59
+ Everything in the middle loses every corner; the two ends keep only
60
+ their outer ones.
61
+
62
+ :not(:only-child) on the end rules is load-bearing. A lone child is
63
+ first AND last, and the end rules carry a :host([...]) prefix that
64
+ outranks a bare ::slotted(:only-child), so a group of one came out
65
+ with the last-child radius: square on the left, round on the right.
66
+ Excluding it explicitly beats relying on source order against a more
67
+ specific selector.
68
+ */
69
+ ::slotted(*) {
70
+ --tt-group-radius: 0;
71
+ }
72
+
73
+ ::slotted(:only-child) {
74
+ --tt-group-radius: var(--tt-radius);
75
+ }
76
+
77
+ :host([orientation="horizontal"]) ::slotted(:first-child:not(:only-child)) {
78
+ --tt-group-radius: var(--tt-radius) 0 0 var(--tt-radius);
79
+ }
80
+
81
+ :host([orientation="horizontal"]) ::slotted(:last-child:not(:only-child)) {
82
+ --tt-group-radius: 0 var(--tt-radius) var(--tt-radius) 0;
83
+ }
84
+
85
+ :host([orientation="vertical"]) ::slotted(:first-child:not(:only-child)) {
86
+ --tt-group-radius: var(--tt-radius) var(--tt-radius) 0 0;
87
+ }
88
+
89
+ :host([orientation="vertical"]) ::slotted(:last-child:not(:only-child)) {
90
+ --tt-group-radius: 0 0 var(--tt-radius) var(--tt-radius);
91
+ }
92
+
93
+ /*
94
+ Pull each neighbour back over the previous one's border. Two adjacent
95
+ 1px borders otherwise stack into a 2px seam that reads as a gap
96
+ rather than a join.
97
+ */
98
+ :host([orientation="horizontal"]) ::slotted(:not(:first-child)) {
99
+ margin-left: -1px;
100
+ }
101
+
102
+ :host([orientation="vertical"]) ::slotted(:not(:first-child)) {
103
+ margin-top: -1px;
104
+ }
105
+
106
+ /*
107
+ Whatever is hovered or focused draws its border and its focus ring
108
+ on top of its neighbours. Without this the overlap above means the
109
+ NEXT control's border covers the active one's, and the ring gets
110
+ clipped along the edge where they meet.
111
+ */
112
+ ::slotted(:hover),
113
+ ::slotted(:focus-within) {
114
+ z-index: 1;
115
+ }
116
+ `; }
117
+ render() {
118
+ return html `
119
+ <div class="group" part="group" role="group">
120
+ <slot></slot>
121
+ </div>
122
+ `;
123
+ }
124
+ };
125
+ __decorate([
126
+ property({ type: String, reflect: true })
127
+ ], TTButtonGroup.prototype, "orientation", void 0);
128
+ TTButtonGroup = __decorate([
129
+ customElement("tt-button-group")
130
+ ], TTButtonGroup);
131
+ export { TTButtonGroup };
132
+ //# sourceMappingURL=tt-button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-button-group.js","sourceRoot":"","sources":["../src/tt-button-group.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;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAEL,gBAAW,GAA8B,YAAY,CAAC;IA6FxD,CAAC;aA3FQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFlB,AAlFY,CAkFX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;;AA5FD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACY;AAF3C,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA+FzB"}
@@ -0,0 +1,31 @@
1
+ import { LitElement } from "lit";
2
+ export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost";
3
+ export type ButtonSize = "small" | "medium" | "large";
4
+ export type ButtonType = "button" | "submit" | "reset";
5
+ export type ButtonCurrent = "page" | "step" | "location" | "date" | "time" | "true";
6
+ export declare class TTButton extends LitElement {
7
+ variant: ButtonVariant;
8
+ size: ButtonSize;
9
+ disabled: boolean;
10
+ loading: boolean;
11
+ fullWidth: boolean;
12
+ pill: boolean;
13
+ type: ButtonType;
14
+ label: string;
15
+ current: ButtonCurrent | "";
16
+ expanded: "true" | "false" | "";
17
+ private iconOnly;
18
+ protected firstUpdated(): void;
19
+ private handleSlotChange;
20
+ private detectIconOnly;
21
+ private handleClick;
22
+ static styles: import("lit").CSSResult;
23
+ focus(options?: FocusOptions): void;
24
+ render(): import("lit-html").TemplateResult<1>;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ "tt-button": TTButton;
29
+ }
30
+ }
31
+ //# sourceMappingURL=tt-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-button.d.ts","sourceRoot":"","sources":["../src/tt-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAWtD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAIvD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpF,qBACa,QAAS,SAAQ,UAAU;IAEtC,OAAO,EAAE,aAAa,CAAa;IAGnC,IAAI,EAAE,UAAU,CAAY;IAG5B,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAMhB,SAAS,UAAS;IAYlB,IAAI,UAAS;IAGb,IAAI,EAAE,UAAU,CAAY;IAW5B,KAAK,SAAM;IAYX,OAAO,EAAE,aAAa,GAAG,EAAE,CAAM;IAcjC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,EAAE,CAAM;IAMrC,OAAO,CAAC,QAAQ,CAAS;IAQzB,SAAS,CAAC,YAAY;IAKtB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,WAAW;IAWnB,MAAM,CAAC,MAAM,0BA4SX;IAIF,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAc5B,MAAM;CA8BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -0,0 +1,483 @@
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 { property, customElement, state } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ let TTButton = class TTButton extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.variant = "primary";
14
+ this.size = "medium";
15
+ this.disabled = false;
16
+ this.loading = false;
17
+ // Reflected so the :host([full-width]) rule can match. Every multi-word
18
+ // property names its attribute in kebab-case explicitly; Lit's default
19
+ // would be the lowercased `fullwidth`.
20
+ this.fullWidth = false;
21
+ /*
22
+ Fully round ends. Reflected so the :host([pill]) rule can match.
23
+
24
+ A boolean rather than a shape="pill" scale, because there are only two
25
+ answers and the second one has no name worth arguing about. It sets
26
+ --_radius, the same variable the size classes set, so it stays behind
27
+ --tt-group-radius: a pill inside a tt-button-group still flattens its
28
+ inner corners, which is what keeps the group looking like one control.
29
+ */
30
+ this.pill = false;
31
+ this.type = "button";
32
+ /*
33
+ The accessible name, for a button whose whole content is an icon.
34
+
35
+ It has to live here rather than as aria-label on the host, because the
36
+ host is a plain custom element with no role: assistive tech reads the
37
+ inner <button>, and an aria-label on the outside never reaches it. An
38
+ icon-only button without this is announced as just "button".
39
+ */
40
+ this.label = "";
41
+ /*
42
+ Marks this button as the current one in a set: the page you are on in
43
+ tt-pagination, the step you are at in a wizard. Forwarded to the inner
44
+ <button> for the same reason as label: an aria-current on the host
45
+ never reaches what assistive tech reads.
46
+
47
+ Not named ariaCurrent, which every Element already has; shadowing a
48
+ built-in DOM member breaks the element type.
49
+ */
50
+ this.current = "";
51
+ /*
52
+ Whether the thing this button opens is open: a menu, a drawer, a
53
+ collapsible panel. Forwarded to the inner <button> as aria-expanded,
54
+ for the same reason as label and current: on the host it reaches
55
+ nothing. tt-navbar's menu button set aria-expanded on the host and a
56
+ screen reader never heard whether the menu was open.
57
+
58
+ A string, not a boolean, because there are THREE states: "true",
59
+ "false", and "" for a button that opens nothing, which must carry no
60
+ aria-expanded at all. A boolean cannot say the third.
61
+ */
62
+ this.expanded = "";
63
+ // Set from slotchange, not asked for as a prop. There is no CSS
64
+ // selector for "this slot has assigned nodes", and a caller who has to
65
+ // remember a flag will forget it.
66
+ this.iconOnly = false;
67
+ }
68
+ /*
69
+ Also checked on first render. slotchange fires only when something is
70
+ assigned, so a button whose default slot is EMPTY from the start
71
+ (one-line markup, or a design loaded with only an icon) never heard
72
+ one and stayed the wide, padded shape of a text button.
73
+ */
74
+ firstUpdated() {
75
+ const slot = this.renderRoot.querySelector("slot:not([name])");
76
+ if (slot)
77
+ this.detectIconOnly(slot);
78
+ }
79
+ handleSlotChange(event) {
80
+ this.detectIconOnly(event.target);
81
+ }
82
+ detectIconOnly(slot) {
83
+ // Whitespace-only text nodes are not content. Without the trim, the
84
+ // newline between the tags counts as a label and nothing is ever
85
+ // detected as icon-only.
86
+ const hasText = slot
87
+ .assignedNodes({ flatten: true })
88
+ .some((node) => (node.textContent ?? "").trim().length > 0);
89
+ this.iconOnly = !hasText;
90
+ }
91
+ handleClick() {
92
+ if (this.disabled || this.loading)
93
+ return;
94
+ this.dispatchEvent(new CustomEvent("tt-button-click", {
95
+ bubbles: true,
96
+ composed: true,
97
+ }));
98
+ }
99
+ static { this.styles = css `
100
+ /* The browser's own [hidden] rule loses to any :host display, so a
101
+ hidden element would still show. Important, so it always wins. */
102
+ :host([hidden]) {
103
+ display: none !important;
104
+ }
105
+
106
+ :host {
107
+ display: inline-block;
108
+ font-family: var(--tt-font-sans);
109
+ -webkit-font-smoothing: antialiased;
110
+ }
111
+
112
+ :host([full-width]) {
113
+ display: block;
114
+ }
115
+
116
+ button {
117
+ position: relative;
118
+
119
+ /*
120
+ flex, not inline-flex. The host is already the inline box; an
121
+ inline-flex button inside it sat on a LINE inside the host, and a
122
+ line is at least as tall as the inherited line-height. In a
123
+ paragraph with line-height 2 the host grew to 36px around a 32px
124
+ button, so it no longer lined up with a tt-input beside it. A
125
+ block-level button makes no line, so the host is exactly the
126
+ button's height wherever it sits.
127
+ */
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: center;
131
+
132
+ /* Part of the size ramp, not a constant. A large button used to
133
+ carry the same 8px icon gap as a small one, so scaling the button
134
+ did not scale the space inside it and the proportions drifted. */
135
+ gap: var(--_gap);
136
+
137
+ width: 100%;
138
+ box-sizing: border-box;
139
+
140
+ border: 1px solid transparent;
141
+ /* tt-button-group flattens this per position, so controls that
142
+ sit together share one edge instead of stacking two. */
143
+ border-radius: var(--tt-group-radius, var(--_radius));
144
+
145
+ /*
146
+ NO vertical padding. The size classes set min-height from
147
+ --tt-control-*, and vertical padding fights it: 14px text plus
148
+ 10px top and bottom is ~37px, which already exceeds the 36px
149
+ control height, so min-height never applied and neither the
150
+ density modes nor the pointer:coarse touch block did anything to
151
+ buttons. Pad horizontally, let min-height do the vertical.
152
+ */
153
+ padding: 0 var(--tt-space-4);
154
+
155
+ font-family: inherit;
156
+ font-size: var(--tt-text-sm);
157
+ line-height: 1;
158
+ font-weight: 550;
159
+ letter-spacing: -0.01em;
160
+
161
+ cursor: pointer;
162
+ user-select: none;
163
+
164
+ transition:
165
+ background var(--tt-duration-normal) var(--tt-ease),
166
+ border-color var(--tt-duration-normal) var(--tt-ease),
167
+ box-shadow var(--tt-duration-normal) var(--tt-ease),
168
+ transform var(--tt-duration-fast) var(--tt-ease);
169
+ }
170
+
171
+ button:active:not(:disabled):not(.is-loading) {
172
+ transform: scale(0.97);
173
+ }
174
+
175
+ button:focus-visible {
176
+ outline: var(--tt-ring-width) solid var(--tt-ring);
177
+ outline-offset: var(--tt-ring-offset);
178
+ }
179
+
180
+ /* Variants */
181
+
182
+ .primary {
183
+ background: var(--tt-primary);
184
+ color: var(--tt-primary-foreground);
185
+ border-color: var(--tt-primary);
186
+ }
187
+
188
+ .primary:hover:not(:disabled):not(.is-loading) {
189
+ background: color-mix(
190
+ in srgb,
191
+ var(--tt-primary) 88%,
192
+ var(--tt-foreground)
193
+ );
194
+ border-color: color-mix(
195
+ in srgb,
196
+ var(--tt-primary) 88%,
197
+ var(--tt-foreground)
198
+ );
199
+ }
200
+
201
+ .secondary {
202
+ background: var(--tt-secondary);
203
+ color: var(--tt-secondary-foreground);
204
+ border-color: var(--tt-border);
205
+ }
206
+
207
+ .secondary:hover:not(:disabled):not(.is-loading) {
208
+ background: var(--tt-accent);
209
+ border-color: var(--tt-border);
210
+ }
211
+
212
+ /*
213
+ Ghost: no surface of its own until you touch it.
214
+
215
+ The gap this fills is every button that sits ON something rather
216
+ than in a form - a card's corner actions, a toolbar, an icon button
217
+ in a header. secondary has a border and a fill, so three of them in
218
+ a card corner read as three boxes competing with the content they
219
+ are attached to. This one is invisible at rest and only appears
220
+ under the pointer.
221
+
222
+ Muted at rest so it stays subordinate, full foreground on hover so
223
+ it does not look disabled once you are on it.
224
+ */
225
+ .ghost {
226
+ background: transparent;
227
+ color: var(--tt-muted-foreground);
228
+ border-color: transparent;
229
+ }
230
+
231
+ .ghost:hover:not(:disabled):not(.is-loading) {
232
+ background: var(--tt-accent);
233
+ color: var(--tt-foreground);
234
+ }
235
+
236
+ .danger {
237
+ background: var(--tt-destructive);
238
+ color: var(--tt-destructive-foreground);
239
+ border-color: var(--tt-destructive);
240
+ }
241
+
242
+ .danger:hover:not(:disabled):not(.is-loading) {
243
+ background: color-mix(
244
+ in srgb,
245
+ var(--tt-destructive) 88%,
246
+ var(--tt-foreground)
247
+ );
248
+ border-color: color-mix(
249
+ in srgb,
250
+ var(--tt-destructive) 88%,
251
+ var(--tt-foreground)
252
+ );
253
+ }
254
+
255
+ /* Sizes */
256
+
257
+ /*
258
+ --tt-icon-size is set here rather than on ::slotted(tt-icon), because
259
+ custom properties inherit THROUGH the shadow boundary and a selector
260
+ cannot. tt-icon reads it, so a small button gets small icons with no
261
+ coordination at the call site.
262
+ */
263
+ /*
264
+ One size sets one bundle: height, padding, gap, icon size, radius and
265
+ type. Picking any of those independently is how a design system drifts,
266
+ because the ratios between them are the thing that has to hold.
267
+
268
+ Icon sizes are the same 14 / 16 / 18 as before, now expressed in units
269
+ so they move with --tt-unit rather than staying frozen in px while
270
+ everything around them scales.
271
+
272
+ Radius grows with the box: a 40px-tall button with a 32px button's
273
+ corner reads as tight. Both are floored well below the height, so
274
+ neither ever becomes a pill by accident.
275
+ */
276
+ .small {
277
+ min-height: var(--tt-control-sm);
278
+ padding: 0 var(--tt-space-3);
279
+ /* text-sm, not text-xs. A small button used to be 12px while a
280
+ small tt-input beside it was 14px, and the pair read as two
281
+ different sizes rather than one row. */
282
+ font-size: var(--tt-text-sm);
283
+ --_gap: calc(var(--tt-unit) * 1.5); /* 6px */
284
+ --_radius: var(--tt-radius-md);
285
+ --tt-icon-size: calc(var(--tt-unit) * 3.5); /* 14px */
286
+ }
287
+
288
+ /* 16px sides, was 20. At 20 a 36px button was wider than it was
289
+ tall by more than its label needed, and an icon plus a word read
290
+ as a loose row rather than one control. */
291
+ .medium {
292
+ min-height: var(--tt-control-md);
293
+ padding: 0 var(--tt-space-4);
294
+ --_gap: calc(var(--tt-unit) * 2); /* 8px */
295
+ --_radius: var(--tt-radius-md);
296
+ --tt-icon-size: calc(var(--tt-unit) * 4); /* 16px */
297
+ }
298
+
299
+ .large {
300
+ min-height: var(--tt-control-lg);
301
+ padding: 0 var(--tt-space-6);
302
+ font-size: var(--tt-text-md);
303
+ --_gap: calc(var(--tt-unit) * 2.5); /* 10px */
304
+ --_radius: var(--tt-radius-lg);
305
+ --tt-icon-size: calc(var(--tt-unit) * 4.5); /* 18px */
306
+ }
307
+
308
+ /*
309
+ After the size classes on purpose. Each of those sets --_radius, so
310
+ this has to come later to win, and it overrides only the radius: a
311
+ pill keeps its size's height, padding and icon scale.
312
+
313
+ An icon-only pill lands on a circle, which is the right answer and
314
+ needs no separate rule.
315
+ */
316
+ :host([pill]) button {
317
+ --_radius: var(--tt-radius-full);
318
+ }
319
+
320
+ /*
321
+ Icon-only: square, not a wide pill.
322
+
323
+ Horizontal padding sized for a word leaves a lone icon floating in
324
+ the middle of a 56px box. Detected from the slot rather than asked
325
+ for as a prop, so a caller cannot forget to set it.
326
+ */
327
+ .icon-only {
328
+ padding: 0;
329
+ width: var(--tt-control-md);
330
+ }
331
+
332
+ .icon-only.small {
333
+ width: var(--tt-control-sm);
334
+ }
335
+
336
+ .icon-only.large {
337
+ width: var(--tt-control-lg);
338
+ }
339
+
340
+ /* States */
341
+
342
+ button:disabled {
343
+ opacity: var(--tt-opacity-disabled);
344
+ cursor: not-allowed;
345
+ }
346
+
347
+ /* Looks disabled, but is not: see the comment in render(). */
348
+ button.is-loading {
349
+ opacity: var(--tt-opacity-disabled);
350
+ cursor: progress;
351
+ color: transparent;
352
+ }
353
+
354
+ /* Spinner */
355
+
356
+ .spinner {
357
+ position: absolute;
358
+
359
+ width: 16px;
360
+ height: 16px;
361
+
362
+ border: 2px solid currentColor;
363
+ border-top-color: transparent;
364
+ border-radius: var(--tt-radius-full);
365
+
366
+ color: inherit;
367
+
368
+ animation: spin var(--tt-duration-spin) linear infinite;
369
+ }
370
+
371
+ .primary .spinner,
372
+ .danger .spinner {
373
+ color: var(--tt-primary-foreground);
374
+ }
375
+
376
+ .secondary .spinner {
377
+ color: var(--tt-secondary-foreground);
378
+ }
379
+
380
+ ::slotted(tt-icon) {
381
+ flex: 0 0 auto;
382
+ }
383
+
384
+ @keyframes spin {
385
+ to {
386
+ transform: rotate(360deg);
387
+ }
388
+ }
389
+
390
+ /* Durations are handled centrally in tokens.css, including slowing the
391
+ spinner. This is only here for the press transform, which is a state
392
+ rather than a transition and so survives a zeroed duration: without
393
+ this the button would still jump on every click. */
394
+ @media (prefers-reduced-motion: reduce) {
395
+ button:active:not(:disabled):not(.is-loading) {
396
+ transform: none;
397
+ }
398
+ }
399
+ `; }
400
+ // Focus has to be forwarded: focusing the host focuses nothing, since the
401
+ // control lives in the shadow root. Same as tt-slider and tt-input.
402
+ focus(options) {
403
+ this.renderRoot?.querySelector("button")?.focus(options);
404
+ }
405
+ /*
406
+ LOADING IS NOT DISABLED.
407
+
408
+ It used to be: loading set the native `disabled` too. A disabled button
409
+ cannot hold focus, so pressing Save on the keyboard moved focus to
410
+ <body> the instant the request started, and a keyboard user had to
411
+ find their way back from the top of the page. aria-disabled says "not
412
+ available" to a screen reader while focus stays put, and handleClick
413
+ already ignores clicks while loading.
414
+ */
415
+ render() {
416
+ return html `
417
+ <button
418
+ part="button"
419
+ @click=${this.handleClick}
420
+ type=${this.type}
421
+ ?disabled=${this.disabled}
422
+ aria-disabled=${ifDefined(this.loading ? "true" : undefined)}
423
+ aria-busy=${this.loading ? "true" : "false"}
424
+ aria-expanded=${ifDefined(this.expanded || undefined)}
425
+ aria-label=${this.label || nothing}
426
+ aria-current=${ifDefined(this.current || undefined)}
427
+ class="${this.variant} ${this.size} ${this.loading
428
+ ? "is-loading"
429
+ : ""} ${this.iconOnly ? "icon-only" : ""}"
430
+ >
431
+ ${this.loading
432
+ ? html `<span class="spinner" aria-hidden="true"></span>`
433
+ : ""}
434
+
435
+ <slot name="icon"></slot>
436
+ <slot @slotchange=${this.handleSlotChange}></slot>
437
+
438
+ <!-- A trailing icon gets its own slot rather than being ordered by
439
+ hand, because a chevron or an external-link mark belongs after
440
+ the label and slot order is fixed. -->
441
+ <slot name="icon-end"></slot>
442
+ </button>
443
+ `;
444
+ }
445
+ };
446
+ __decorate([
447
+ property({ type: String })
448
+ ], TTButton.prototype, "variant", void 0);
449
+ __decorate([
450
+ property({ type: String })
451
+ ], TTButton.prototype, "size", void 0);
452
+ __decorate([
453
+ property({ type: Boolean, reflect: true })
454
+ ], TTButton.prototype, "disabled", void 0);
455
+ __decorate([
456
+ property({ type: Boolean, reflect: true })
457
+ ], TTButton.prototype, "loading", void 0);
458
+ __decorate([
459
+ property({ type: Boolean, attribute: "full-width", reflect: true })
460
+ ], TTButton.prototype, "fullWidth", void 0);
461
+ __decorate([
462
+ property({ type: Boolean, reflect: true })
463
+ ], TTButton.prototype, "pill", void 0);
464
+ __decorate([
465
+ property({ type: String })
466
+ ], TTButton.prototype, "type", void 0);
467
+ __decorate([
468
+ property({ type: String })
469
+ ], TTButton.prototype, "label", void 0);
470
+ __decorate([
471
+ property({ type: String })
472
+ ], TTButton.prototype, "current", void 0);
473
+ __decorate([
474
+ property({ type: String })
475
+ ], TTButton.prototype, "expanded", void 0);
476
+ __decorate([
477
+ state()
478
+ ], TTButton.prototype, "iconOnly", void 0);
479
+ TTButton = __decorate([
480
+ customElement("tt-button")
481
+ ], TTButton);
482
+ export { TTButton };
483
+ //# sourceMappingURL=tt-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-button.js","sourceRoot":"","sources":["../src/tt-button.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import { LitElement } from "lit";
2
+ export type CardVariant = "default" | "outlined" | "elevated";
3
+ export type CardPadding = "none" | "small" | "medium" | "large";
4
+ export type CardRadius = "none" | "small" | "medium" | "large" | "xlarge";
5
+ export declare class TTCard extends LitElement {
6
+ variant: CardVariant;
7
+ padding: CardPadding;
8
+ radius: CardRadius;
9
+ clickable: boolean;
10
+ inline: boolean;
11
+ heading: string;
12
+ description: string;
13
+ headingLevel: number;
14
+ private hasHeaderSlot;
15
+ private hasActions;
16
+ static styles: import("lit").CSSResult;
17
+ private onKeydown;
18
+ private onSlotChange;
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ "tt-card": TTCard;
24
+ }
25
+ }
26
+ //# sourceMappingURL=tt-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-card.d.ts","sourceRoot":"","sources":["../src/tt-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1E,qBACa,MAAO,SAAQ,UAAU;IAEpC,OAAO,EAAE,WAAW,CAAa;IAMjC,OAAO,EAAE,WAAW,CAAY;IAGhC,MAAM,EAAE,UAAU,CAAY;IAG9B,SAAS,UAAS;IAKlB,MAAM,UAAS;IAUf,OAAO,SAAM;IAGb,WAAW,SAAM;IAKjB,YAAY,SAAK;IAKR,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,UAAU,CAAS;IAEpC,MAAM,CAAC,MAAM,0BA4RX;IAEF,OAAO,CAAC,SAAS,CAYf;IAEF,OAAO,CAAC,YAAY;IAgBpB,MAAM;CA+CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}