godown 3.0.0-canary.8 → 3.0.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 (510) hide show
  1. package/README.md +38 -9
  2. package/alert.d.ts +1 -0
  3. package/alert.d.ts.map +1 -1
  4. package/alert.js +1 -5
  5. package/alert.js.map +1 -1
  6. package/avatar.d.ts +1 -0
  7. package/avatar.d.ts.map +1 -1
  8. package/avatar.js +1 -5
  9. package/avatar.js.map +1 -1
  10. package/badge.d.ts +9 -0
  11. package/badge.d.ts.map +1 -0
  12. package/badge.js +2 -0
  13. package/badge.js.map +1 -0
  14. package/breath.js +1 -5
  15. package/breath.js.map +1 -1
  16. package/build/godown+lit.iife.js +59 -0
  17. package/build/godown+lit.iife.js.map +1 -0
  18. package/build/godown+lit.js +59 -0
  19. package/build/godown+lit.js.map +1 -0
  20. package/build/godown+lit.umd.js +59 -0
  21. package/build/godown+lit.umd.js.map +1 -0
  22. package/build/godown.iife.js +47 -0
  23. package/build/godown.js +48 -0
  24. package/build/godown.js.map +1 -0
  25. package/build/godown.umd.js +48 -0
  26. package/build/godown.umd.js.map +1 -0
  27. package/button.d.ts +1 -0
  28. package/button.d.ts.map +1 -1
  29. package/button.js +1 -5
  30. package/button.js.map +1 -1
  31. package/card.d.ts +1 -0
  32. package/card.d.ts.map +1 -1
  33. package/card.js +1 -5
  34. package/card.js.map +1 -1
  35. package/carousel.d.ts +1 -0
  36. package/carousel.d.ts.map +1 -1
  37. package/carousel.js +1 -5
  38. package/carousel.js.map +1 -1
  39. package/components/alert.d.ts +4 -1
  40. package/components/alert.d.ts.map +1 -1
  41. package/components/alert.js +1 -176
  42. package/components/alert.js.map +1 -1
  43. package/components/avatar.d.ts +8 -2
  44. package/components/avatar.d.ts.map +1 -1
  45. package/components/avatar.js +1 -61
  46. package/components/avatar.js.map +1 -1
  47. package/components/badge.d.ts +23 -0
  48. package/components/badge.d.ts.map +1 -0
  49. package/components/badge.js +2 -0
  50. package/components/badge.js.map +1 -0
  51. package/components/breath.d.ts +7 -4
  52. package/components/breath.d.ts.map +1 -1
  53. package/components/breath.js +1 -79
  54. package/components/breath.js.map +1 -1
  55. package/components/button.d.ts +19 -10
  56. package/components/button.d.ts.map +1 -1
  57. package/components/button.js +1 -165
  58. package/components/button.js.map +1 -1
  59. package/components/card.d.ts +3 -2
  60. package/components/card.d.ts.map +1 -1
  61. package/components/card.js +1 -53
  62. package/components/card.js.map +1 -1
  63. package/components/carousel.d.ts +10 -5
  64. package/components/carousel.d.ts.map +1 -1
  65. package/components/carousel.js +1 -112
  66. package/components/carousel.js.map +1 -1
  67. package/components/details.d.ts +6 -2
  68. package/components/details.d.ts.map +1 -1
  69. package/components/details.js +1 -49
  70. package/components/details.js.map +1 -1
  71. package/components/dialog.d.ts +8 -3
  72. package/components/dialog.d.ts.map +1 -1
  73. package/components/dialog.js +1 -93
  74. package/components/dialog.js.map +1 -1
  75. package/components/divider.d.ts +3 -3
  76. package/components/divider.d.ts.map +1 -1
  77. package/components/divider.js +1 -36
  78. package/components/divider.js.map +1 -1
  79. package/components/dragbox.d.ts +11 -9
  80. package/components/dragbox.d.ts.map +1 -1
  81. package/components/dragbox.js +1 -109
  82. package/components/dragbox.js.map +1 -1
  83. package/components/flex.d.ts +4 -1
  84. package/components/flex.d.ts.map +1 -1
  85. package/components/flex.js +1 -54
  86. package/components/flex.js.map +1 -1
  87. package/components/form.d.ts +3 -3
  88. package/components/form.d.ts.map +1 -1
  89. package/components/form.js +1 -77
  90. package/components/form.js.map +1 -1
  91. package/components/grid.d.ts +10 -3
  92. package/components/grid.d.ts.map +1 -1
  93. package/components/grid.js +1 -55
  94. package/components/grid.js.map +1 -1
  95. package/components/heading.d.ts +29 -0
  96. package/components/heading.d.ts.map +1 -0
  97. package/components/heading.js +2 -0
  98. package/components/heading.js.map +1 -0
  99. package/components/input.d.ts +7 -3
  100. package/components/input.d.ts.map +1 -1
  101. package/components/input.js +1 -50
  102. package/components/input.js.map +1 -1
  103. package/components/layout.d.ts +8 -9
  104. package/components/layout.d.ts.map +1 -1
  105. package/components/layout.js +1 -46
  106. package/components/layout.js.map +1 -1
  107. package/components/link.d.ts +8 -1
  108. package/components/link.d.ts.map +1 -1
  109. package/components/link.js +1 -42
  110. package/components/link.js.map +1 -1
  111. package/components/progress.d.ts +4 -11
  112. package/components/progress.d.ts.map +1 -1
  113. package/components/progress.js +1 -67
  114. package/components/progress.js.map +1 -1
  115. package/components/range.d.ts +22 -15
  116. package/components/range.d.ts.map +1 -1
  117. package/components/range.js +1 -273
  118. package/components/range.js.map +1 -1
  119. package/components/rotate.d.ts +4 -2
  120. package/components/rotate.d.ts.map +1 -1
  121. package/components/rotate.js +1 -56
  122. package/components/rotate.js.map +1 -1
  123. package/components/router.d.ts +20 -24
  124. package/components/router.d.ts.map +1 -1
  125. package/components/router.js +1 -250
  126. package/components/router.js.map +1 -1
  127. package/components/select.d.ts +8 -4
  128. package/components/select.d.ts.map +1 -1
  129. package/components/select.js +1 -212
  130. package/components/select.js.map +1 -1
  131. package/components/skeleton.d.ts +3 -1
  132. package/components/skeleton.d.ts.map +1 -1
  133. package/components/skeleton.js +1 -54
  134. package/components/skeleton.js.map +1 -1
  135. package/components/split.d.ts +25 -2
  136. package/components/split.d.ts.map +1 -1
  137. package/components/split.js +1 -128
  138. package/components/split.js.map +1 -1
  139. package/components/switch.d.ts +8 -5
  140. package/components/switch.d.ts.map +1 -1
  141. package/components/switch.js +1 -92
  142. package/components/switch.js.map +1 -1
  143. package/components/text.d.ts +3 -1
  144. package/components/text.d.ts.map +1 -1
  145. package/components/text.js +1 -43
  146. package/components/text.js.map +1 -1
  147. package/components/time.d.ts +8 -6
  148. package/components/time.d.ts.map +1 -1
  149. package/components/time.js +1 -85
  150. package/components/time.js.map +1 -1
  151. package/components/tooltip.d.ts +14 -2
  152. package/components/tooltip.d.ts.map +1 -1
  153. package/components/tooltip.js +1 -66
  154. package/components/tooltip.js.map +1 -1
  155. package/components/typewriter.d.ts +8 -14
  156. package/components/typewriter.d.ts.map +1 -1
  157. package/components/typewriter.js +1 -129
  158. package/components/typewriter.js.map +1 -1
  159. package/core/global-style.d.ts +2 -2
  160. package/core/global-style.d.ts.map +1 -1
  161. package/core/global-style.js +1 -45
  162. package/core/global-style.js.map +1 -1
  163. package/core/super-anchor.d.ts +2 -1
  164. package/core/super-anchor.d.ts.map +1 -1
  165. package/core/super-anchor.js +1 -38
  166. package/core/super-anchor.js.map +1 -1
  167. package/core/super-input.d.ts +6 -5
  168. package/core/super-input.d.ts.map +1 -1
  169. package/core/super-input.js +1 -111
  170. package/core/super-input.js.map +1 -1
  171. package/core/super-openable.d.ts +1 -1
  172. package/core/super-openable.d.ts.map +1 -1
  173. package/core/super-openable.js +1 -37
  174. package/core/super-openable.js.map +1 -1
  175. package/custom-elements.json +1 -1
  176. package/details.d.ts +1 -0
  177. package/details.d.ts.map +1 -1
  178. package/details.js +1 -5
  179. package/details.js.map +1 -1
  180. package/dev/alert.d.ts +1 -0
  181. package/dev/alert.d.ts.map +1 -1
  182. package/dev/alert.js +1 -0
  183. package/dev/alert.js.map +1 -1
  184. package/dev/avatar.d.ts +1 -0
  185. package/dev/avatar.d.ts.map +1 -1
  186. package/dev/avatar.js +1 -0
  187. package/dev/avatar.js.map +1 -1
  188. package/dev/badge.d.ts +9 -0
  189. package/dev/badge.d.ts.map +1 -0
  190. package/dev/badge.js +5 -0
  191. package/dev/badge.js.map +1 -0
  192. package/dev/button.d.ts +1 -0
  193. package/dev/button.d.ts.map +1 -1
  194. package/dev/button.js +1 -0
  195. package/dev/button.js.map +1 -1
  196. package/dev/card.d.ts +1 -0
  197. package/dev/card.d.ts.map +1 -1
  198. package/dev/card.js +1 -0
  199. package/dev/card.js.map +1 -1
  200. package/dev/carousel.d.ts +1 -0
  201. package/dev/carousel.d.ts.map +1 -1
  202. package/dev/carousel.js +1 -0
  203. package/dev/carousel.js.map +1 -1
  204. package/dev/components/alert.d.ts +4 -1
  205. package/dev/components/alert.d.ts.map +1 -1
  206. package/dev/components/alert.js +20 -23
  207. package/dev/components/alert.js.map +1 -1
  208. package/dev/components/avatar.d.ts +8 -2
  209. package/dev/components/avatar.d.ts.map +1 -1
  210. package/dev/components/avatar.js +23 -13
  211. package/dev/components/avatar.js.map +1 -1
  212. package/dev/components/badge.d.ts +23 -0
  213. package/dev/components/badge.d.ts.map +1 -0
  214. package/dev/components/badge.js +107 -0
  215. package/dev/components/badge.js.map +1 -0
  216. package/dev/components/breath.d.ts +7 -4
  217. package/dev/components/breath.d.ts.map +1 -1
  218. package/dev/components/breath.js +30 -26
  219. package/dev/components/breath.js.map +1 -1
  220. package/dev/components/button.d.ts +19 -10
  221. package/dev/components/button.d.ts.map +1 -1
  222. package/dev/components/button.js +47 -28
  223. package/dev/components/button.js.map +1 -1
  224. package/dev/components/card.d.ts +3 -2
  225. package/dev/components/card.d.ts.map +1 -1
  226. package/dev/components/card.js +23 -33
  227. package/dev/components/card.js.map +1 -1
  228. package/dev/components/carousel.d.ts +10 -5
  229. package/dev/components/carousel.d.ts.map +1 -1
  230. package/dev/components/carousel.js +33 -26
  231. package/dev/components/carousel.js.map +1 -1
  232. package/dev/components/details.d.ts +6 -2
  233. package/dev/components/details.d.ts.map +1 -1
  234. package/dev/components/details.js +24 -26
  235. package/dev/components/details.js.map +1 -1
  236. package/dev/components/dialog.d.ts +8 -3
  237. package/dev/components/dialog.d.ts.map +1 -1
  238. package/dev/components/dialog.js +21 -17
  239. package/dev/components/dialog.js.map +1 -1
  240. package/dev/components/divider.d.ts +3 -3
  241. package/dev/components/divider.d.ts.map +1 -1
  242. package/dev/components/divider.js +29 -17
  243. package/dev/components/divider.js.map +1 -1
  244. package/dev/components/dragbox.d.ts +11 -9
  245. package/dev/components/dragbox.d.ts.map +1 -1
  246. package/dev/components/dragbox.js +11 -4
  247. package/dev/components/dragbox.js.map +1 -1
  248. package/dev/components/flex.d.ts +4 -1
  249. package/dev/components/flex.d.ts.map +1 -1
  250. package/dev/components/flex.js +25 -9
  251. package/dev/components/flex.js.map +1 -1
  252. package/dev/components/form.d.ts +3 -3
  253. package/dev/components/form.d.ts.map +1 -1
  254. package/dev/components/form.js +2 -5
  255. package/dev/components/form.js.map +1 -1
  256. package/dev/components/grid.d.ts +10 -3
  257. package/dev/components/grid.d.ts.map +1 -1
  258. package/dev/components/grid.js +18 -10
  259. package/dev/components/grid.js.map +1 -1
  260. package/dev/components/heading.d.ts +29 -0
  261. package/dev/components/heading.d.ts.map +1 -0
  262. package/dev/components/heading.js +103 -0
  263. package/dev/components/heading.js.map +1 -0
  264. package/dev/components/input.d.ts +7 -3
  265. package/dev/components/input.d.ts.map +1 -1
  266. package/dev/components/input.js +18 -18
  267. package/dev/components/input.js.map +1 -1
  268. package/dev/components/layout.d.ts +8 -9
  269. package/dev/components/layout.d.ts.map +1 -1
  270. package/dev/components/layout.js +38 -25
  271. package/dev/components/layout.js.map +1 -1
  272. package/dev/components/link.d.ts +8 -1
  273. package/dev/components/link.d.ts.map +1 -1
  274. package/dev/components/link.js +15 -3
  275. package/dev/components/link.js.map +1 -1
  276. package/dev/components/progress.d.ts +4 -11
  277. package/dev/components/progress.d.ts.map +1 -1
  278. package/dev/components/progress.js +43 -49
  279. package/dev/components/progress.js.map +1 -1
  280. package/dev/components/range.d.ts +22 -15
  281. package/dev/components/range.d.ts.map +1 -1
  282. package/dev/components/range.js +56 -61
  283. package/dev/components/range.js.map +1 -1
  284. package/dev/components/rotate.d.ts +4 -2
  285. package/dev/components/rotate.d.ts.map +1 -1
  286. package/dev/components/rotate.js +3 -5
  287. package/dev/components/rotate.js.map +1 -1
  288. package/dev/components/router.d.ts +20 -24
  289. package/dev/components/router.d.ts.map +1 -1
  290. package/dev/components/router.js +23 -36
  291. package/dev/components/router.js.map +1 -1
  292. package/dev/components/select.d.ts +8 -4
  293. package/dev/components/select.d.ts.map +1 -1
  294. package/dev/components/select.js +44 -32
  295. package/dev/components/select.js.map +1 -1
  296. package/dev/components/skeleton.d.ts +3 -1
  297. package/dev/components/skeleton.d.ts.map +1 -1
  298. package/dev/components/skeleton.js +9 -9
  299. package/dev/components/skeleton.js.map +1 -1
  300. package/dev/components/split.d.ts +25 -2
  301. package/dev/components/split.d.ts.map +1 -1
  302. package/dev/components/split.js +71 -38
  303. package/dev/components/split.js.map +1 -1
  304. package/dev/components/switch.d.ts +8 -5
  305. package/dev/components/switch.d.ts.map +1 -1
  306. package/dev/components/switch.js +28 -31
  307. package/dev/components/switch.js.map +1 -1
  308. package/dev/components/text.d.ts +3 -1
  309. package/dev/components/text.d.ts.map +1 -1
  310. package/dev/components/text.js +12 -15
  311. package/dev/components/text.js.map +1 -1
  312. package/dev/components/time.d.ts +8 -6
  313. package/dev/components/time.d.ts.map +1 -1
  314. package/dev/components/time.js +8 -14
  315. package/dev/components/time.js.map +1 -1
  316. package/dev/components/tooltip.d.ts +14 -2
  317. package/dev/components/tooltip.d.ts.map +1 -1
  318. package/dev/components/tooltip.js +54 -24
  319. package/dev/components/tooltip.js.map +1 -1
  320. package/dev/components/typewriter.d.ts +8 -14
  321. package/dev/components/typewriter.d.ts.map +1 -1
  322. package/dev/components/typewriter.js +22 -37
  323. package/dev/components/typewriter.js.map +1 -1
  324. package/dev/core/global-style.d.ts +2 -2
  325. package/dev/core/global-style.d.ts.map +1 -1
  326. package/dev/core/global-style.js +18 -14
  327. package/dev/core/global-style.js.map +1 -1
  328. package/dev/core/super-anchor.d.ts +2 -1
  329. package/dev/core/super-anchor.d.ts.map +1 -1
  330. package/dev/core/super-anchor.js +25 -23
  331. package/dev/core/super-anchor.js.map +1 -1
  332. package/dev/core/super-input.d.ts +6 -5
  333. package/dev/core/super-input.d.ts.map +1 -1
  334. package/dev/core/super-input.js +43 -36
  335. package/dev/core/super-input.js.map +1 -1
  336. package/dev/core/super-openable.d.ts +1 -1
  337. package/dev/core/super-openable.d.ts.map +1 -1
  338. package/dev/core/super-openable.js +2 -2
  339. package/dev/core/super-openable.js.map +1 -1
  340. package/dev/details.d.ts +1 -0
  341. package/dev/details.d.ts.map +1 -1
  342. package/dev/details.js +1 -0
  343. package/dev/details.js.map +1 -1
  344. package/dev/dialog.d.ts +1 -0
  345. package/dev/dialog.d.ts.map +1 -1
  346. package/dev/dialog.js +1 -0
  347. package/dev/dialog.js.map +1 -1
  348. package/dev/divider.d.ts +1 -0
  349. package/dev/divider.d.ts.map +1 -1
  350. package/dev/divider.js +1 -0
  351. package/dev/divider.js.map +1 -1
  352. package/dev/dragbox.d.ts +1 -0
  353. package/dev/dragbox.d.ts.map +1 -1
  354. package/dev/dragbox.js +1 -0
  355. package/dev/dragbox.js.map +1 -1
  356. package/dev/flex.d.ts +1 -0
  357. package/dev/flex.d.ts.map +1 -1
  358. package/dev/flex.js +1 -0
  359. package/dev/flex.js.map +1 -1
  360. package/dev/form.d.ts +1 -0
  361. package/dev/form.d.ts.map +1 -1
  362. package/dev/form.js +1 -0
  363. package/dev/form.js.map +1 -1
  364. package/dev/grid.d.ts +1 -0
  365. package/dev/grid.d.ts.map +1 -1
  366. package/dev/grid.js +1 -0
  367. package/dev/grid.js.map +1 -1
  368. package/dev/heading.d.ts +9 -0
  369. package/dev/heading.d.ts.map +1 -0
  370. package/dev/heading.js +5 -0
  371. package/dev/heading.js.map +1 -0
  372. package/dev/index.d.ts +2 -0
  373. package/dev/index.d.ts.map +1 -1
  374. package/dev/index.js +2 -0
  375. package/dev/index.js.map +1 -1
  376. package/dev/layout.d.ts.map +1 -1
  377. package/dev/progress.d.ts.map +1 -1
  378. package/dev/router.d.ts.map +1 -1
  379. package/dev/split.d.ts +1 -1
  380. package/dev/split.d.ts.map +1 -1
  381. package/dev/typewriter.d.ts +1 -0
  382. package/dev/typewriter.d.ts.map +1 -1
  383. package/dev/typewriter.js +1 -0
  384. package/dev/typewriter.js.map +1 -1
  385. package/dialog.d.ts +1 -0
  386. package/dialog.d.ts.map +1 -1
  387. package/dialog.js +1 -5
  388. package/dialog.js.map +1 -1
  389. package/divider.d.ts +1 -0
  390. package/divider.d.ts.map +1 -1
  391. package/divider.js +1 -5
  392. package/divider.js.map +1 -1
  393. package/dragbox.d.ts +1 -0
  394. package/dragbox.d.ts.map +1 -1
  395. package/dragbox.js +1 -5
  396. package/dragbox.js.map +1 -1
  397. package/flex.d.ts +1 -0
  398. package/flex.d.ts.map +1 -1
  399. package/flex.js +1 -5
  400. package/flex.js.map +1 -1
  401. package/form.d.ts +1 -0
  402. package/form.d.ts.map +1 -1
  403. package/form.js +1 -5
  404. package/form.js.map +1 -1
  405. package/grid.d.ts +1 -0
  406. package/grid.d.ts.map +1 -1
  407. package/grid.js +1 -5
  408. package/grid.js.map +1 -1
  409. package/heading.d.ts +9 -0
  410. package/heading.d.ts.map +1 -0
  411. package/heading.js +2 -0
  412. package/heading.js.map +1 -0
  413. package/index.d.ts +2 -0
  414. package/index.d.ts.map +1 -1
  415. package/index.js +1 -56
  416. package/index.js.map +1 -1
  417. package/input.js +1 -5
  418. package/input.js.map +1 -1
  419. package/layout.d.ts.map +1 -1
  420. package/layout.js +1 -5
  421. package/layout.js.map +1 -1
  422. package/link.js +1 -5
  423. package/link.js.map +1 -1
  424. package/package.json +11 -6
  425. package/progress.d.ts.map +1 -1
  426. package/progress.js +1 -5
  427. package/progress.js.map +1 -1
  428. package/range.js +1 -5
  429. package/range.js.map +1 -1
  430. package/rotate.js +1 -5
  431. package/rotate.js.map +1 -1
  432. package/router.d.ts.map +1 -1
  433. package/router.js +1 -5
  434. package/router.js.map +1 -1
  435. package/select.js +1 -5
  436. package/select.js.map +1 -1
  437. package/skeleton.js +1 -5
  438. package/skeleton.js.map +1 -1
  439. package/split.d.ts +1 -1
  440. package/split.d.ts.map +1 -1
  441. package/split.js +1 -5
  442. package/split.js.map +1 -1
  443. package/src/alert.ts +2 -0
  444. package/src/avatar.ts +2 -0
  445. package/src/badge.ts +13 -0
  446. package/src/button.ts +2 -0
  447. package/src/card.ts +2 -0
  448. package/src/carousel.ts +2 -0
  449. package/src/components/alert.ts +26 -29
  450. package/src/components/avatar.ts +28 -17
  451. package/src/components/badge.ts +107 -0
  452. package/src/components/breath.ts +38 -31
  453. package/src/components/button.ts +55 -46
  454. package/src/components/card.ts +26 -34
  455. package/src/components/carousel.ts +48 -38
  456. package/src/components/details.ts +27 -28
  457. package/src/components/dialog.ts +30 -26
  458. package/src/components/divider.ts +29 -17
  459. package/src/components/dragbox.ts +25 -19
  460. package/src/components/flex.ts +26 -11
  461. package/src/components/form.ts +7 -9
  462. package/src/components/grid.ts +31 -13
  463. package/src/components/heading.ts +105 -0
  464. package/src/components/input.ts +23 -22
  465. package/src/components/layout.ts +26 -31
  466. package/src/components/link.ts +15 -4
  467. package/src/components/progress.ts +51 -52
  468. package/src/components/range.ts +82 -94
  469. package/src/components/rotate.ts +12 -11
  470. package/src/components/router.ts +59 -48
  471. package/src/components/select.ts +59 -47
  472. package/src/components/skeleton.ts +13 -11
  473. package/src/components/split.ts +90 -49
  474. package/src/components/switch.ts +38 -37
  475. package/src/components/text.ts +14 -21
  476. package/src/components/time.ts +20 -14
  477. package/src/components/tooltip.ts +54 -29
  478. package/src/components/typewriter.ts +41 -47
  479. package/src/core/global-style.ts +33 -19
  480. package/src/core/super-anchor.ts +30 -26
  481. package/src/core/super-input.ts +54 -54
  482. package/src/core/super-openable.ts +7 -7
  483. package/src/details.ts +2 -0
  484. package/src/dialog.ts +2 -0
  485. package/src/divider.ts +2 -0
  486. package/src/dragbox.ts +2 -0
  487. package/src/flex.ts +2 -0
  488. package/src/form.ts +2 -0
  489. package/src/grid.ts +2 -0
  490. package/src/heading.ts +13 -0
  491. package/src/index.ts +2 -0
  492. package/src/layout.ts +1 -0
  493. package/src/progress.ts +1 -0
  494. package/src/router.ts +1 -0
  495. package/src/split.ts +1 -1
  496. package/src/typewriter.ts +2 -0
  497. package/switch.js +1 -5
  498. package/switch.js.map +1 -1
  499. package/text.js +1 -5
  500. package/text.js.map +1 -1
  501. package/time.js +1 -5
  502. package/time.js.map +1 -1
  503. package/tooltip.js +1 -5
  504. package/tooltip.js.map +1 -1
  505. package/typewriter.d.ts +1 -0
  506. package/typewriter.d.ts.map +1 -1
  507. package/typewriter.js +1 -5
  508. package/typewriter.js.map +1 -1
  509. package/vscode.html-custom-data.json +1 -1
  510. package/web-types.json +1 -1
@@ -1,10 +1,8 @@
1
- import { godown } from "@godown/element/decorators/godown.js";
2
- import { styles } from "@godown/element/decorators/styles.js";
3
- import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
- import { css, html } from "lit";
1
+ import { attr, godown, htmlSlot, styles } from "@godown/element";
2
+ import { css, html, type TemplateResult } from "lit";
5
3
  import { property } from "lit/decorators.js";
6
4
 
7
- import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
5
+ import { scopePrefix } from "../core/global-style.js";
8
6
  import SuperOpenable, { type Direction8 } from "../core/super-openable.js";
9
7
 
10
8
  const protoName = "tooltip";
@@ -15,7 +13,7 @@ const cssScope = scopePrefix(protoName);
15
13
  *
16
14
  * If it has the tip property, ignore the slot tip.
17
15
  *
18
- * @slot tip - Tip element.
16
+ * @slot tip - Tip element if no `tip` provided.
19
17
  * @slot - Content.
20
18
  * @category feedback
21
19
  */
@@ -23,19 +21,22 @@ const cssScope = scopePrefix(protoName);
23
21
  @styles(
24
22
  css`
25
23
  :host {
26
- ${cssScope}--tip-background: var(${cssGlobalVars.background});
27
- display: inline-block;
24
+ ${cssScope}--tip-background: inherit;
28
25
  width: fit-content;
29
26
  }
27
+
28
+ :host,
29
+ [part=root] {
30
+ display: inline-flex;
31
+ }
30
32
 
31
- [part="root"] {
32
- display: flex;
33
+ [part=root] {
33
34
  position: relative;
34
35
  transition: inherit;
35
36
  border-radius: inherit;
36
37
  }
37
38
 
38
- [part="tip"] {
39
+ [part=tip] {
39
40
  width: fit-content;
40
41
  height: fit-content;
41
42
  position: absolute;
@@ -44,28 +45,32 @@ const cssScope = scopePrefix(protoName);
44
45
  user-select: none;
45
46
  }
46
47
 
47
- :host([open]) [part="tip"],
48
- :host(:hover) [part="tip"],
49
- [part="tip"]:hover {
48
+ :host([open]) [part=tip] {
50
49
  visibility: visible;
51
50
  }
52
51
 
53
- .passive{
52
+ .passive {
54
53
  background: var(${cssScope}--tip-background);
55
- padding: 0 .5em;
54
+ }
55
+
56
+ [propagation] [part=tip] {
57
+ pointer-events: none;
56
58
  }
57
59
  `,
58
60
  css`
59
- [direction^="top"] {
61
+ [direction^=top] [part=tip] {
60
62
  bottom: 100%;
61
63
  }
62
- [direction^="bottom"] {
64
+
65
+ [direction^=bottom] [part=tip] {
63
66
  top: 100%;
64
67
  }
65
- [direction$="right"] {
68
+
69
+ [direction$=right] [part=tip] {
66
70
  left: 100%;
67
71
  }
68
- [direction$="left"] {
72
+
73
+ [direction$=left] [part=tip] {
69
74
  right: 100%;
70
75
  }
71
76
  `,
@@ -76,11 +81,13 @@ class Tooltip extends SuperOpenable {
76
81
  */
77
82
  @property()
78
83
  tip: string;
84
+
79
85
  /**
80
86
  * Direction of opening the tip.
81
87
  */
82
88
  @property()
83
89
  direction: Direction8 = "top";
90
+
84
91
  /**
85
92
  * Content alignment.
86
93
  */
@@ -91,7 +98,19 @@ class Tooltip extends SuperOpenable {
91
98
  * If true, allow penetration of the tip.
92
99
  */
93
100
  @property({ type: Boolean })
94
- propagation: boolean;
101
+ propagation = false;
102
+
103
+ /**
104
+ * How can tips be triggered.
105
+ *
106
+ * If `focus`, element will be focusable, open tip when focused.
107
+ *
108
+ * If `hover`, element will open tip when hovered.
109
+ *
110
+ * @default "hover"
111
+ */
112
+ @property()
113
+ type: "hover" | "focus" = "hover";
95
114
 
96
115
  static aligns = {
97
116
  start: "flex-start",
@@ -101,18 +120,24 @@ class Tooltip extends SuperOpenable {
101
120
  "flex-end": "flex-end",
102
121
  };
103
122
 
104
- protected render() {
123
+ protected render(): TemplateResult<1> {
105
124
  const align = Tooltip.aligns[this.align] || "inherit";
106
- return html`<div part="root" style="justify-content:${align};align-items:${align}">
125
+ const isFocusable = this.type === "focus";
126
+ return html`<div
127
+ part="root"
128
+ ${attr(this.observedRecord)}
129
+ tabindex="${isFocusable ? 0 : -1}"
130
+ @focus="${isFocusable ? () => (this.open = true) : null}"
131
+ @blur="${isFocusable ? () => (this.open = false) : null}"
132
+ @mouseenter="${isFocusable ? null : () => (this.open = true)}"
133
+ @mouseleave="${isFocusable ? null : () => (this.open = false)}"
134
+ style="justify-content:${align};align-items:${align}"
135
+ >
107
136
  ${htmlSlot()}
108
- <div part="tip" direction="${this.direction}" style="pointer-events:${this.propagation ? "none" : "all"}">
109
- ${
110
- this.tip
111
- ? html`<span class="passive">${this.tip}</span>`
112
- : htmlSlot("tip")
113
- }</div>
137
+ <div part="tip">${this.tip ? html`<span class="passive">${this.tip}</span>` : htmlSlot("tip")}</div>
114
138
  </div>`;
115
139
  }
116
140
  }
117
141
 
118
142
  export default Tooltip;
143
+ export { Tooltip };
@@ -1,9 +1,5 @@
1
- import { godown } from "@godown/element/decorators/godown.js";
2
- import { styles } from "@godown/element/decorators/styles.js";
3
- import { classList } from "@godown/element/directives/class-list.js";
4
- import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
- import { random } from "@godown/element/tools/lib.js";
6
- import { css, html, type PropertyValueMap } from "lit";
1
+ import { attr, godown, htmlSlot, random, styles } from "@godown/element";
2
+ import { css, html, type PropertyValueMap, type TemplateResult } from "lit";
7
3
  import { property, query, state } from "lit/decorators.js";
8
4
 
9
5
  import { GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -17,11 +13,15 @@ const cssScope = scopePrefix(protoName);
17
13
  * @category effect
18
14
  */
19
15
  @godown(protoName)
20
- @styles(css`
16
+ @styles(
17
+ css`
21
18
  :host {
22
19
  ${cssScope}--cursor-width: .05em;
23
- font-family: monospace;
24
- white-space: nowrap;
20
+ }
21
+
22
+ :host,
23
+ :host([contents]) [part="root"] {
24
+ display: inline-block;
25
25
  }
26
26
 
27
27
  i {
@@ -42,91 +42,84 @@ const cssScope = scopePrefix(protoName);
42
42
  slot {
43
43
  display: none;
44
44
  }
45
-
46
- .hidden {
47
- visibility: hidden;
48
- }
49
- `)
45
+ `,
46
+ )
50
47
  class Typewriter extends GlobalStyle {
51
48
  /**
52
49
  * Raw text.
53
50
  */
54
51
  @property()
55
- text = "";
56
- /**
57
- * Start immediately after {@linkcode Typewriter.firstUpdated}.
58
- */
59
- @property({ type: Boolean })
60
- stopped = false;
52
+ content = "";
53
+
61
54
  /**
62
55
  * If true, hide the cursor
63
56
  */
64
57
  @property({ type: Boolean })
65
58
  ended = false;
59
+
66
60
  /**
67
61
  * Maximum random time.
68
62
  */
69
63
  @property({ type: Number })
70
64
  max = 100;
65
+
71
66
  /**
72
67
  * Minimum random time.
73
68
  */
74
69
  @property({ type: Number })
75
70
  min = 50;
71
+
76
72
  /**
77
73
  * Fixed time.
78
74
  */
79
75
  @property({ type: Number })
80
76
  delay = 0;
77
+
81
78
  /**
82
79
  * The index at the beginning.
83
80
  */
84
81
  @property({ type: Number })
85
82
  index = 0;
86
- /**
87
- * Internal text.
88
- */
83
+
89
84
  @state()
90
- content = "";
85
+ contentInternal = "";
86
+
87
+ protected timeoutID: number;
91
88
 
92
- timeoutID: number;
93
89
  @query("i")
94
- _i: HTMLElement;
90
+ protected _i: HTMLElement;
95
91
 
96
92
  /**
97
- * {@linkcode Typewriter.text} length.
93
+ * {@linkcode Typewriter.content} length.
98
94
  */
99
- get len() {
100
- return this.text.length;
95
+ get len(): number {
96
+ return this.content.length;
101
97
  }
102
98
 
103
- protected render() {
104
- return html`${htmlSlot()}${this.content}<i part="cursor" class="${
105
- classList({
106
- hidden: this.ended,
107
- })
108
- }"></i>`;
99
+ protected render(): TemplateResult<1> {
100
+ return html`<div part="root" ${attr(this.observedRecord)}>
101
+ ${htmlSlot()} ${this.contentInternal}
102
+ <i part="cursor" ?hidden="${this.ended}"></i>
103
+ </div>`;
109
104
  }
110
105
 
111
- protected firstUpdated() {
112
- if (!this.text) {
113
- this.text = this._slot?.assignedNodes()[0]?.textContent.trim() || "";
114
- }
115
- if (!this.stopped && this.len) {
106
+ protected firstUpdated(): void {
107
+ this.content ||= this._slot?.assignedNodes()[0]?.textContent.trim() || "";
108
+ if (!this.ended && this.len) {
116
109
  this.write();
117
110
  }
118
111
  }
119
112
 
120
- protected updated(changedProperties: PropertyValueMap<this>) {
113
+ protected updated(changedProperties: PropertyValueMap<this>): void {
121
114
  if (changedProperties.has("index")) {
122
- this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.content }));
115
+ this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.contentInternal }));
123
116
  }
124
117
  }
125
118
 
126
- write(at = this.index) {
127
- this.content = this.text.slice(0, at + 1);
119
+ write(at: number = this.index): void {
120
+ this.contentInternal = this.content.slice(0, at + 1);
128
121
  const timeout = this.delay || random(this.max, this.min);
129
- this.timeoutID = window.setTimeout(() => {
122
+ this.timeoutID = setTimeout(() => {
130
123
  const nx = at + 1;
131
124
  if (nx <= this.len) {
132
125
  this.index = nx;
@@ -135,13 +128,14 @@ class Typewriter extends GlobalStyle {
135
128
  }, timeout);
136
129
  }
137
130
 
138
- stop() {
131
+ stop(): void {
139
132
  clearTimeout(this.timeoutID);
140
133
  }
141
134
 
142
- end() {
135
+ end(): void {
143
136
  this.ended = true;
144
137
  }
145
138
  }
146
139
 
147
140
  export default Typewriter;
141
+ export { Typewriter };
@@ -1,26 +1,32 @@
1
1
  import { type Gradients, presetsRGB } from "@godown/colors/presets-rgb.js";
2
2
  import { travel } from "@godown/colors/travel.js";
3
- import GodownElement from "@godown/element";
4
- import GodownConfig from "@godown/element/config.js";
5
- import { trim } from "@godown/element/tools/lib.js";
6
- import { css, CSSResult, unsafeCSS } from "lit";
7
-
8
- GodownElement.godownConfig ||= new GodownConfig();
3
+ import { GodownElement, joinProperties, trim } from "@godown/element";
4
+ import { css, type CSSResult, unsafeCSS } from "lit";
9
5
 
10
6
  export class GlobalStyle extends GodownElement {
11
7
  }
12
8
 
13
9
  const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
14
10
 
15
- export function scopePrefix(scope: string, len = 1) {
11
+ export function scopePrefix(scope: string, len = 1): CSSResult {
16
12
  return variablePrefix(cssvar + "-".repeat(len) + scope);
17
13
  }
18
14
 
19
- export function variablePrefix(variable: string) {
20
- return unsafeCSS("--" + variable);
15
+ export function variablePrefix(variable: string): CSSResult {
16
+ return unsafeCSS(`--${variable}`);
21
17
  }
22
18
 
23
- export const cssGlobalVars = {
19
+ export const cssGlobalVars: {
20
+ foreground: CSSResult;
21
+ background: CSSResult;
22
+ clipBackground: CSSResult;
23
+ active: CSSResult;
24
+ passive: CSSResult;
25
+ _colors: PresetsGradientsCSSResult;
26
+ input: CSSResult;
27
+ white: CSSResult;
28
+ black: CSSResult;
29
+ } = {
24
30
  foreground: scopePrefix("foreground", 2),
25
31
  background: scopePrefix("background", 2),
26
32
  clipBackground: scopePrefix("clip-background", 2),
@@ -45,17 +51,16 @@ GlobalStyle.styles = [
45
51
  const colorKey = scopePrefix("color", 2) + endKey;
46
52
  return `${colorKey}:rgb(${rgb});`;
47
53
  }, presetsRGB).join("")
54
+ + joinProperties({
55
+ [cssGlobalVars.background + ""]: `var(${cssGlobalVars._colors.darkgray[9]})`,
56
+ [cssGlobalVars.foreground + ""]: `var(${cssGlobalVars._colors.lightgray[0]})`,
57
+ [cssGlobalVars.active + ""]: `var(${cssGlobalVars._colors.blue[6]})`,
58
+ [cssGlobalVars.passive + ""]: `var(${cssGlobalVars._colors.darkgray[6]})`,
59
+ [cssGlobalVars.clipBackground + ""]:
60
+ `linear-gradient(to bottom, var(${cssGlobalVars.foreground}), var(${cssGlobalVars.passive}))`,
61
+ })
48
62
  + "}",
49
63
  ),
50
- css`
51
- :host {
52
- ${cssGlobalVars.background}: var(${cssGlobalVars._colors.darkgray[9]});
53
- ${cssGlobalVars.foreground}: var(${cssGlobalVars._colors.lightgray[0]});
54
- ${cssGlobalVars.active}: var(${cssGlobalVars._colors.blue[6]});
55
- ${cssGlobalVars.passive}: var(${cssGlobalVars._colors.darkgray[6]});
56
- ${cssGlobalVars.clipBackground}: linear-gradient(180deg, var(${cssGlobalVars.foreground}), var(${cssGlobalVars.passive}));
57
- }
58
- `,
59
64
  css`
60
65
  * {
61
66
  border: 0;
@@ -82,5 +87,14 @@ GlobalStyle.styles = [
82
87
  svg {
83
88
  user-select: none;
84
89
  }
90
+
91
+ :host([contents]) {
92
+ display: contents;
93
+ }
94
+
95
+ :where(:host([contents]) [part=root]) {
96
+ all: inherit;
97
+ display: revert;
98
+ }
85
99
  `,
86
100
  ];
@@ -1,32 +1,30 @@
1
- import { styles } from "@godown/element/decorators/index.js";
2
- import { htmlSlot } from "@godown/element/directives/html-slot.js";
3
- import { css, html } from "lit";
1
+ import { attr, htmlSlot, styles } from "@godown/element";
2
+ import { css, html, nothing, type TemplateResult } from "lit";
4
3
  import { property } from "lit/decorators.js";
5
- import { ifDefined } from "lit/directives/if-defined.js";
6
4
 
7
5
  import { GlobalStyle } from "./global-style.js";
8
6
 
9
- @styles(css`
10
- :host {
11
- display: inline-block;
12
- color: currentColor;
13
- text-decoration: none;
14
- cursor: default;
15
- }
7
+ @styles(
8
+ css`
9
+ :host {
10
+ display: inline-block;
11
+ color: currentColor;
12
+ text-decoration: none;
13
+ cursor: default;
14
+ }
16
15
 
17
- :host([href]) {
18
- cursor: pointer;
19
- }
16
+ :host([href]) {
17
+ cursor: pointer;
18
+ }
20
19
 
21
- a {
22
- width: 100%;
23
- display: flex;
24
- color: inherit;
25
- text-decoration: inherit;
26
- justify-content: space-between;
27
- align-items: center;
28
- }
29
- `)
20
+ [part=root] {
21
+ width: 100%;
22
+ color: inherit;
23
+ display: inline-block;
24
+ text-decoration: inherit;
25
+ }
26
+ `,
27
+ )
30
28
  class SuperAnchor extends GlobalStyle {
31
29
  /**
32
30
  * A element href.
@@ -39,14 +37,20 @@ class SuperAnchor extends GlobalStyle {
39
37
  @property()
40
38
  target: "_blank" | "_self" | "_parent" | "_top" = "_self";
41
39
 
42
- protected render() {
43
- return html`<a part="root" href="${ifDefined(this.href)}" target="${this.target}" @click=${this._handleClick}>
40
+ protected render(): TemplateResult<1> {
41
+ return html`<a
42
+ part="root"
43
+ ${attr(this.observedRecord)}
44
+ href="${this.href || nothing}"
45
+ target="${this.target}"
46
+ @click=${this._handleClick}
47
+ >
44
48
  ${htmlSlot()}
45
49
  </a>`;
46
50
  }
47
51
 
48
52
  // eslint-disable-next-line
49
- protected _handleClick(_: MouseEvent) {}
53
+ protected _handleClick(_: MouseEvent): void {}
50
54
  }
51
55
 
52
56
  export default SuperAnchor;