@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 @@
1
+ {"version":3,"file":"tt-skeleton.d.ts","sourceRoot":"","sources":["../src/tt-skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;GAIG;AACH,qBACa,UAAW,SAAQ,UAAU;IAExC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAU;IAI3B,KAAK,SAAM;IACX,MAAM,SAAM;IAGZ,KAAK,SAAK;IAEtC,MAAM,CAAC,MAAM,0BAyEX;IAEF,MAAM;CAiCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -0,0 +1,143 @@
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
+ /**
11
+ * Placeholder shape shown while data loads. Use it in the same layout as
12
+ * the real content so nothing jumps when the data arrives: a skeleton
13
+ * that is a different size than what replaces it is worse than a spinner.
14
+ */
15
+ let TTSkeleton = class TTSkeleton extends LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.variant = "text";
19
+ // Any CSS length. Text lines often want a varied width so a paragraph
20
+ // does not look like a solid block.
21
+ this.width = "";
22
+ this.height = "";
23
+ // Number of stacked lines, for the text variant.
24
+ this.lines = 1;
25
+ }
26
+ static { this.styles = css `
27
+ /* The browser's own [hidden] rule loses to any :host display, so a
28
+ hidden element would still show. Important, so it always wins. */
29
+ :host([hidden]) {
30
+ display: none !important;
31
+ }
32
+
33
+ :host {
34
+ display: block;
35
+ }
36
+
37
+ .stack {
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: var(--tt-space-2);
41
+ }
42
+
43
+ .bone {
44
+ background: var(--tt-muted);
45
+ border-radius: var(--tt-radius-sm);
46
+
47
+ /* A moving highlight rather than a pulse: it reads as "loading"
48
+ instead of "broken and flashing". */
49
+ background-image: linear-gradient(
50
+ 90deg,
51
+ transparent 0%,
52
+ color-mix(in srgb, var(--tt-foreground) 6%, transparent) 50%,
53
+ transparent 100%
54
+ );
55
+ background-size: 200% 100%;
56
+ background-repeat: no-repeat;
57
+
58
+ animation: shimmer 1.4s ease-in-out infinite;
59
+ }
60
+
61
+ :host([variant="text"]) .bone {
62
+ height: 0.85em;
63
+ border-radius: var(--tt-radius-sm);
64
+ }
65
+
66
+ :host([variant="title"]) .bone {
67
+ height: 1.4em;
68
+ border-radius: var(--tt-radius-sm);
69
+ }
70
+
71
+ :host([variant="circle"]) .bone {
72
+ border-radius: var(--tt-radius-full);
73
+ aspect-ratio: 1;
74
+ }
75
+
76
+ :host([variant="rect"]) .bone {
77
+ border-radius: var(--tt-radius);
78
+ }
79
+
80
+ /* The last line of a paragraph is rarely full width. */
81
+ .stack .bone:last-child:not(:only-child) {
82
+ width: 70%;
83
+ }
84
+
85
+ @keyframes shimmer {
86
+ from { background-position: 200% 0; }
87
+ to { background-position: -200% 0; }
88
+ }
89
+
90
+ /* Cannot come from a token: an infinite animation at 1ms strobes rather
91
+ than stops, so the shimmer has to be switched off properly. Everything
92
+ else in the library is handled centrally in tokens.css. */
93
+
94
+ @media (prefers-reduced-motion: reduce) {
95
+ .bone {
96
+ animation: none;
97
+ }
98
+ }
99
+ `; }
100
+ render() {
101
+ /*
102
+ A width of "10px; position: fixed" used to write a second
103
+ declaration into the style string. styleMap sets one property per
104
+ key on every update, but its FIRST render still joins them into one
105
+ string, so each value is also checked to be a single valid value for
106
+ its property. Anything else, empty included, is dropped and leaves
107
+ the CSS default.
108
+ */
109
+ const valid = (property, value) => value && CSS.supports(property, value) ? value : undefined;
110
+ const style = styleMap({
111
+ width: valid("width", this.width),
112
+ height: valid("height", this.height),
113
+ });
114
+ const count = this.variant === "text" ? Math.max(1, this.lines) : 1;
115
+ return html `
116
+ <!--
117
+ aria-hidden and aria-busy: a screen reader should hear "loading",
118
+ not a description of grey rectangles. Put aria-busy on the region
119
+ being replaced.
120
+ -->
121
+ <div class="stack" part="stack" aria-hidden="true">
122
+ ${Array.from({ length: count }, () => html `<div class="bone" part="bone" style=${style}></div>`)}
123
+ </div>
124
+ `;
125
+ }
126
+ };
127
+ __decorate([
128
+ property({ type: String, reflect: true })
129
+ ], TTSkeleton.prototype, "variant", void 0);
130
+ __decorate([
131
+ property({ type: String })
132
+ ], TTSkeleton.prototype, "width", void 0);
133
+ __decorate([
134
+ property({ type: String })
135
+ ], TTSkeleton.prototype, "height", void 0);
136
+ __decorate([
137
+ property({ type: Number })
138
+ ], TTSkeleton.prototype, "lines", void 0);
139
+ TTSkeleton = __decorate([
140
+ customElement("tt-skeleton")
141
+ ], TTSkeleton);
142
+ export { TTSkeleton };
143
+ //# sourceMappingURL=tt-skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-skeleton.js","sourceRoot":"","sources":["../src/tt-skeleton.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;AAEvD;;;;GAIG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAEL,YAAO,GAAyC,MAAM,CAAC;QAEvD,sEAAsE;QACtE,oCAAoC;QACR,UAAK,GAAG,EAAE,CAAC;QACX,WAAM,GAAG,EAAE,CAAC;QAExC,iDAAiD;QACrB,UAAK,GAAG,CAAC,CAAC;IA8GxC,CAAC;aA5GQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyElB,AAzEY,CAyEX;IAEF,MAAM;QACJ;;;;;;;UAOE;QACF,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,EAAE,CAChD,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAE7D,MAAM,KAAK,GAAG,QAAQ,CAAC;YACrB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;YACjC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;SACrC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpE,OAAO,IAAI,CAAA;;;;;;;UAOL,KAAK,CAAC,IAAI,CACV,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,IAAI,CAAA,uCAAuC,KAAK,SAAS,CAChE;;KAEJ,CAAC;IACJ,CAAC;;AArHD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACa;AAI3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAa;AAGZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAW;AAV3B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAwHtB"}
@@ -0,0 +1,74 @@
1
+ import { LitElement } from "lit";
2
+ import type { PropertyValues } from "lit";
3
+ /**
4
+ * A value picked from a range.
5
+ *
6
+ * ---------------------------------------------------------------------
7
+ * IT WRAPS A REAL `<input type="range">`, AND THAT IS THE DESIGN.
8
+ *
9
+ * A div with a draggable dot is about forty lines to make look right and
10
+ * several hundred to make correct. The native input already ships:
11
+ *
12
+ * - Arrow keys, Home, End, Page Up, Page Down, all with the right step
13
+ * - role="slider" with aria-valuenow / valuemin / valuemax kept in sync
14
+ * - pointer capture, so a drag survives leaving the element
15
+ * - touch, pen and mouse without a line of code
16
+ * - correct behaviour in a form, including reset
17
+ *
18
+ * Every one of those is a thing hand-rolled sliders get wrong. So this
19
+ * component styles the native control rather than replacing it. The cost
20
+ * is four vendor pseudo-elements below; the alternative cost is the list
21
+ * above.
22
+ *
23
+ * ---------------------------------------------------------------------
24
+ * TWO EVENTS, BECAUSE THERE ARE TWO QUESTIONS.
25
+ *
26
+ * tt-input fires continuously while dragging. Use it to update a
27
+ * preview: a live number, a colour, a zoom level.
28
+ * tt-change fires once, when the drag is released. Use it to save.
29
+ *
30
+ * Collapsing them into one would force every consumer that writes to a
31
+ * server to debounce, and every consumer that draws a preview to poll.
32
+ * The platform already draws this line and this keeps it.
33
+ *
34
+ * It owns its own `value`, like the native input it wraps. Setting the
35
+ * property from outside still wins.
36
+ */
37
+ export declare class TTSlider extends LitElement {
38
+ static formAssociated: boolean;
39
+ private internals;
40
+ name: string;
41
+ value: number;
42
+ min: number;
43
+ max: number;
44
+ step: number;
45
+ label: string;
46
+ labelHidden: boolean;
47
+ showValue: boolean;
48
+ unit: string;
49
+ disabled: boolean;
50
+ private control;
51
+ private sliderId;
52
+ get form(): HTMLFormElement | null;
53
+ get validity(): ValidityState;
54
+ checkValidity(): boolean;
55
+ reportValidity(): boolean;
56
+ focus(options?: FocusOptions): void;
57
+ connectedCallback(): void;
58
+ formResetCallback(): void;
59
+ formStateRestoreCallback(state: string): void;
60
+ updated(changed: PropertyValues): void;
61
+ private syncFormState;
62
+ /** How far along the track the value sits, 0 to 100. */
63
+ private get percent();
64
+ private handleInput;
65
+ private handleChange;
66
+ static styles: import("lit").CSSResult[];
67
+ render(): import("lit-html").TemplateResult<1>;
68
+ }
69
+ declare global {
70
+ interface HTMLElementTagNameMap {
71
+ "tt-slider": TTSlider;
72
+ }
73
+ }
74
+ //# sourceMappingURL=tt-slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-slider.d.ts","sourceRoot":"","sources":["../src/tt-slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,MAAM,CAAC,cAAc,UAAQ;IAE7B,OAAO,CAAC,SAAS,CAA0B;IASA,IAAI,SAAM;IAEzB,KAAK,SAAM;IAEX,GAAG,SAAK;IACR,GAAG,SAAO;IACV,IAAI,SAAK;IAET,KAAK,SAAM;IAIvC,WAAW,UAAS;IAKkC,SAAS,UAAS;IAG5C,IAAI,SAAM;IAEM,QAAQ,UAAS;IAE7C,OAAO,CAAC,OAAO,CAAoB;IAEnD,OAAO,CAAC,QAAQ,CAAwB;IAExC,IAAI,IAAI,2BAEP;IAED,IAAI,QAAQ,kBAEX;IAID,aAAa;IAIb,cAAc;IAUd,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAI5B,iBAAiB;IAKjB,iBAAiB;IASjB,wBAAwB,CAAC,KAAK,EAAE,MAAM;IAKtC,OAAO,CAAC,OAAO,EAAE,cAAc;IAW/B,OAAO,CAAC,aAAa;IAIrB,wDAAwD;IACxD,OAAO,KAAK,OAAO,GASlB;IAED,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,YAAY;IAiBpB,MAAM,CAAC,MAAM,4BA0LV;IAEH,MAAM;CAkDP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -0,0 +1,426 @@
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 { property, customElement, query } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ import { srOnly } from "./sr-only.js";
11
+ let uid = 0;
12
+ /**
13
+ * A value picked from a range.
14
+ *
15
+ * ---------------------------------------------------------------------
16
+ * IT WRAPS A REAL `<input type="range">`, AND THAT IS THE DESIGN.
17
+ *
18
+ * A div with a draggable dot is about forty lines to make look right and
19
+ * several hundred to make correct. The native input already ships:
20
+ *
21
+ * - Arrow keys, Home, End, Page Up, Page Down, all with the right step
22
+ * - role="slider" with aria-valuenow / valuemin / valuemax kept in sync
23
+ * - pointer capture, so a drag survives leaving the element
24
+ * - touch, pen and mouse without a line of code
25
+ * - correct behaviour in a form, including reset
26
+ *
27
+ * Every one of those is a thing hand-rolled sliders get wrong. So this
28
+ * component styles the native control rather than replacing it. The cost
29
+ * is four vendor pseudo-elements below; the alternative cost is the list
30
+ * above.
31
+ *
32
+ * ---------------------------------------------------------------------
33
+ * TWO EVENTS, BECAUSE THERE ARE TWO QUESTIONS.
34
+ *
35
+ * tt-input fires continuously while dragging. Use it to update a
36
+ * preview: a live number, a colour, a zoom level.
37
+ * tt-change fires once, when the drag is released. Use it to save.
38
+ *
39
+ * Collapsing them into one would force every consumer that writes to a
40
+ * server to debounce, and every consumer that draws a preview to poll.
41
+ * The platform already draws this line and this keeps it.
42
+ *
43
+ * It owns its own `value`, like the native input it wraps. Setting the
44
+ * property from outside still wins.
45
+ */
46
+ let TTSlider = class TTSlider extends LitElement {
47
+ constructor() {
48
+ super(...arguments);
49
+ this.internals = this.attachInternals();
50
+ /*
51
+ Reflected, and it has to be. A form-associated custom element is
52
+ submitted under its name CONTENT ATTRIBUTE, not its JS property.
53
+ Without reflect, setting .name from script leaves the attribute
54
+ absent and the field vanishes from FormData with no error anywhere.
55
+ Same trap as tt-switch and tt-checkbox-group.
56
+ */
57
+ this.name = "";
58
+ this.value = 50;
59
+ this.min = 0;
60
+ this.max = 100;
61
+ this.step = 1;
62
+ this.label = "";
63
+ // Hides the label but keeps it as the control's name, as on tt-input.
64
+ this.labelHidden = false;
65
+ // Prints the current value beside the label. Off by default: on a
66
+ // slider whose meaning is relative (volume, opacity) the number is
67
+ // noise, and on one whose meaning is absolute it is essential.
68
+ this.showValue = false;
69
+ // Appended to the printed value only. Never part of the form value.
70
+ this.unit = "";
71
+ this.disabled = false;
72
+ this.sliderId = `tt-slider-${++uid}`;
73
+ }
74
+ static { this.formAssociated = true; }
75
+ get form() {
76
+ return this.internals.form;
77
+ }
78
+ get validity() {
79
+ return this.internals.validity;
80
+ }
81
+ // Form-associated elements do not get these for free, and tt-form
82
+ // calls them rather than reaching into internals.
83
+ checkValidity() {
84
+ return this.internals.checkValidity();
85
+ }
86
+ reportValidity() {
87
+ return this.internals.reportValidity();
88
+ }
89
+ /*
90
+ Focus has to be forwarded by hand. Calling focus() on a custom
91
+ element focuses the host, not the control inside its shadow root, so
92
+ without this a form trying to jump to its first invalid field would
93
+ move focus to something that cannot receive a keystroke.
94
+ */
95
+ focus(options) {
96
+ this.control?.focus(options);
97
+ }
98
+ connectedCallback() {
99
+ super.connectedCallback();
100
+ this.syncFormState();
101
+ }
102
+ formResetCallback() {
103
+ /*
104
+ Back to the middle of the range rather than to 0, because 0 may not
105
+ be in the range at all. A slider from 200 to 800 reset to 0 would
106
+ be outside its own bounds.
107
+ */
108
+ this.value = this.min + (this.max - this.min) / 2;
109
+ }
110
+ formStateRestoreCallback(state) {
111
+ const restored = Number(state);
112
+ if (!Number.isNaN(restored))
113
+ this.value = restored;
114
+ }
115
+ updated(changed) {
116
+ if (changed.has("value") ||
117
+ changed.has("min") ||
118
+ changed.has("max") ||
119
+ changed.has("name")) {
120
+ this.syncFormState();
121
+ }
122
+ }
123
+ syncFormState() {
124
+ this.internals.setFormValue(String(this.value));
125
+ }
126
+ /** How far along the track the value sits, 0 to 100. */
127
+ get percent() {
128
+ const span = this.max - this.min;
129
+ // A zero-width range is a configuration mistake, not a crash. Show a
130
+ // full track rather than dividing by zero and painting NaN.
131
+ if (span <= 0)
132
+ return 100;
133
+ const clamped = Math.min(this.max, Math.max(this.min, this.value));
134
+ return ((clamped - this.min) / span) * 100;
135
+ }
136
+ handleInput(event) {
137
+ const next = Number(event.target.value);
138
+ this.value = next;
139
+ this.dispatchEvent(new CustomEvent("tt-input", {
140
+ detail: { value: next },
141
+ bubbles: true,
142
+ composed: true,
143
+ }));
144
+ }
145
+ handleChange(event) {
146
+ /*
147
+ Stops the native `change` here. It is composed by default, so it
148
+ would cross the shadow boundary and arrive at a listener as an
149
+ untyped event that looks like tt-change but carries no detail.
150
+ */
151
+ event.stopPropagation();
152
+ this.dispatchEvent(new CustomEvent("tt-change", {
153
+ detail: { value: this.value },
154
+ bubbles: true,
155
+ composed: true,
156
+ }));
157
+ }
158
+ static { this.styles = [srOnly, css `
159
+ /* The browser's own [hidden] rule loses to any :host display, so a
160
+ hidden element would still show. Important, so it always wins. */
161
+ :host([hidden]) {
162
+ display: none !important;
163
+ }
164
+
165
+ :host {
166
+ display: block;
167
+
168
+ font-family: var(--tt-font-sans);
169
+ -webkit-font-smoothing: antialiased;
170
+
171
+ color: var(--tt-foreground);
172
+ }
173
+
174
+ :host([disabled]) {
175
+ opacity: var(--tt-opacity-disabled);
176
+ pointer-events: none;
177
+ }
178
+
179
+ .head {
180
+ display: flex;
181
+ align-items: baseline;
182
+ justify-content: space-between;
183
+ gap: var(--tt-space-3);
184
+
185
+ margin-bottom: var(--tt-space-2);
186
+ }
187
+
188
+ label {
189
+ font-size: var(--tt-text-sm);
190
+ font-weight: var(--tt-weight-medium);
191
+ }
192
+
193
+ .value {
194
+ font-family: var(--tt-font-mono);
195
+ font-size: var(--tt-text-xs);
196
+ color: var(--tt-muted-foreground);
197
+
198
+ /* Tabular figures, so the number does not shuffle sideways while
199
+ you drag. A proportional 1 is narrower than a 0. */
200
+ font-variant-numeric: tabular-nums;
201
+ }
202
+
203
+ /* ---- the control ----
204
+
205
+ appearance: none is required before ANY of the vendor
206
+ pseudo-elements below will take effect. Without it the browser
207
+ keeps its own widget and every rule underneath is silently
208
+ ignored, which reads as "my CSS does nothing". */
209
+
210
+ input {
211
+ -webkit-appearance: none;
212
+ appearance: none;
213
+
214
+ display: block;
215
+ width: 100%;
216
+ margin: 0;
217
+
218
+ background: transparent;
219
+ cursor: pointer;
220
+ }
221
+
222
+ input:disabled {
223
+ cursor: not-allowed;
224
+ }
225
+
226
+ /* The filled part is painted with a gradient on the track rather
227
+ than with a second element, so there is nothing to keep in sync
228
+ with the thumb position. One number, --_pct, drives both. */
229
+
230
+ /* Chrome, Edge, Safari */
231
+ input::-webkit-slider-runnable-track {
232
+ height: 6px;
233
+ border-radius: var(--tt-radius-full);
234
+ background: linear-gradient(
235
+ to right,
236
+ var(--tt-primary) 0 var(--_pct),
237
+ var(--tt-muted) var(--_pct) 100%
238
+ );
239
+ }
240
+
241
+ input::-webkit-slider-thumb {
242
+ -webkit-appearance: none;
243
+ appearance: none;
244
+
245
+ width: 16px;
246
+ height: 16px;
247
+
248
+ /* Centres the thumb on the track: half the thumb minus half the
249
+ track. Webkit aligns the thumb's TOP to the track's top, unlike
250
+ Firefox, which centres it for you. */
251
+ margin-top: -5px;
252
+
253
+ border: 2px solid var(--tt-primary);
254
+ border-radius: var(--tt-radius-full);
255
+ background: var(--tt-background);
256
+
257
+ box-shadow: var(--tt-elevation-1);
258
+
259
+ transition: transform var(--tt-duration-fast) var(--tt-ease-out);
260
+ }
261
+
262
+ input:hover::-webkit-slider-thumb,
263
+ input:active::-webkit-slider-thumb {
264
+ transform: scale(1.15);
265
+ }
266
+
267
+ /* Firefox */
268
+ input::-moz-range-track {
269
+ height: 6px;
270
+ border-radius: var(--tt-radius-full);
271
+ background: var(--tt-muted);
272
+ }
273
+
274
+ input::-moz-range-progress {
275
+ height: 6px;
276
+ border-radius: var(--tt-radius-full);
277
+ background: var(--tt-primary);
278
+ }
279
+
280
+ input::-moz-range-thumb {
281
+ width: 16px;
282
+ height: 16px;
283
+
284
+ border: 2px solid var(--tt-primary);
285
+ border-radius: var(--tt-radius-full);
286
+ background: var(--tt-background);
287
+
288
+ transition: transform var(--tt-duration-fast) var(--tt-ease-out);
289
+ }
290
+
291
+ input:hover::-moz-range-thumb,
292
+ input:active::-moz-range-thumb {
293
+ transform: scale(1.15);
294
+ }
295
+
296
+ /*
297
+ The token file's one focus recipe: an outline, never a box-shadow.
298
+ It goes on .field, the box around everything, rather than on the
299
+ input, because the input is only as tall as its thumb and a ring
300
+ drawn on it would cut through the track.
301
+
302
+ ---------------------------------------------------------------
303
+ :has(input:focus-visible), NOT :focus-within.
304
+
305
+ They look interchangeable and are not.
306
+
307
+ :focus-within true whenever anything inside holds focus, and
308
+ clicking a slider gives it focus. So dragging
309
+ the thumb with a mouse drew a ring around the
310
+ whole component, which is not what a ring is
311
+ for: the pointer user can already see what they
312
+ grabbed.
313
+
314
+ :focus-visible the browser's own judgement about whether a
315
+ ring is WARRANTED. Keyboard focus matches;
316
+ a mouse press on a slider does not. Arrow-key
317
+ after a click does, which is right.
318
+
319
+ Note the element: a wrapper inside the shadow root, NOT the host.
320
+
321
+ This first shipped as :host:has(input:focus-visible), and Firefox
322
+ had no keyboard ring at all. The host is a strange element from
323
+ inside its own stylesheet, and engines disagree on whether :has()
324
+ on it may look into the shadow tree: Chrome says yes, Firefox says
325
+ no. :host(:has(...)) is no better, it searches the host's light-DOM
326
+ children and never finds the input in here. An ordinary element
327
+ in the shadow tree has no such question, so the ring lives on one
328
+ and every engine agrees.
329
+
330
+ The ring cannot live on the input itself either: the input is
331
+ thumb-height, so a ring on it cuts the track in half. So the input
332
+ suppresses its own ring and .field draws one, keyed off the
333
+ input's state.
334
+ */
335
+ input:focus-visible {
336
+ outline: none;
337
+ }
338
+
339
+ .field:has(input:focus-visible) {
340
+ border-radius: var(--tt-radius-sm);
341
+ outline: var(--tt-ring-width) solid var(--tt-ring);
342
+ outline-offset: var(--tt-ring-offset);
343
+ }
344
+ `]; }
345
+ render() {
346
+ const showHead = this.label !== "" || this.showValue;
347
+ // .field exists only to draw the focus ring; see the styles above.
348
+ return html `
349
+ <div class="field">
350
+ ${showHead
351
+ ? html `
352
+ <div class="head">
353
+ <label
354
+ for=${this.sliderId}
355
+ part="label"
356
+ class=${this.labelHidden ? "sr-only" : ""}
357
+ >${this.label}</label>
358
+
359
+ ${this.showValue
360
+ ? html `<span class="value" part="value"
361
+ >${this.value}${this.unit}</span
362
+ >`
363
+ : ""}
364
+ </div>
365
+ `
366
+ : ""}
367
+
368
+ <!-- aria-valuetext carries the unit. Without it a screen reader read
369
+ "40" for a slider the screen showed as "40%". -->
370
+ <input
371
+ id=${this.sliderId}
372
+ type="range"
373
+ part="input"
374
+ style=${`--_pct: ${this.percent}%`}
375
+ .value=${String(this.value)}
376
+ min=${this.min}
377
+ max=${this.max}
378
+ step=${this.step}
379
+ ?disabled=${this.disabled}
380
+ aria-label=${ifDefined(this.label ? undefined : "Value")}
381
+ aria-valuetext=${ifDefined(this.unit ? `${this.value}${this.unit}` : undefined)}
382
+ @input=${this.handleInput}
383
+ @change=${this.handleChange}
384
+ />
385
+ </div>
386
+ `;
387
+ }
388
+ };
389
+ __decorate([
390
+ property({ type: String, reflect: true })
391
+ ], TTSlider.prototype, "name", void 0);
392
+ __decorate([
393
+ property({ type: Number })
394
+ ], TTSlider.prototype, "value", void 0);
395
+ __decorate([
396
+ property({ type: Number })
397
+ ], TTSlider.prototype, "min", void 0);
398
+ __decorate([
399
+ property({ type: Number })
400
+ ], TTSlider.prototype, "max", void 0);
401
+ __decorate([
402
+ property({ type: Number })
403
+ ], TTSlider.prototype, "step", void 0);
404
+ __decorate([
405
+ property({ type: String })
406
+ ], TTSlider.prototype, "label", void 0);
407
+ __decorate([
408
+ property({ type: Boolean, attribute: "label-hidden", reflect: true })
409
+ ], TTSlider.prototype, "labelHidden", void 0);
410
+ __decorate([
411
+ property({ type: Boolean, attribute: "show-value" })
412
+ ], TTSlider.prototype, "showValue", void 0);
413
+ __decorate([
414
+ property({ type: String })
415
+ ], TTSlider.prototype, "unit", void 0);
416
+ __decorate([
417
+ property({ type: Boolean, reflect: true })
418
+ ], TTSlider.prototype, "disabled", void 0);
419
+ __decorate([
420
+ query("input")
421
+ ], TTSlider.prototype, "control", void 0);
422
+ TTSlider = __decorate([
423
+ customElement("tt-slider")
424
+ ], TTSlider);
425
+ export { TTSlider };
426
+ //# sourceMappingURL=tt-slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-slider.js","sourceRoot":"","sources":["../src/tt-slider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,IAAI,GAAG,GAAG,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAGG,cAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE3C;;;;;;UAME;QACyC,SAAI,GAAG,EAAE,CAAC;QAEzB,UAAK,GAAG,EAAE,CAAC;QAEX,QAAG,GAAG,CAAC,CAAC;QACR,QAAG,GAAG,GAAG,CAAC;QACV,SAAI,GAAG,CAAC,CAAC;QAET,UAAK,GAAG,EAAE,CAAC;QAEvC,sEAAsE;QAEtE,gBAAW,GAAG,KAAK,CAAC;QAEpB,kEAAkE;QAClE,mEAAmE;QACnE,+DAA+D;QACT,cAAS,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