godown 3.0.0-canary.10 → 3.0.0-canary.12

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 (390) hide show
  1. package/README.md +3 -3
  2. package/alert.d.ts +1 -0
  3. package/alert.d.ts.map +1 -1
  4. package/avatar.d.ts +1 -0
  5. package/avatar.d.ts.map +1 -1
  6. package/button.d.ts +1 -0
  7. package/button.d.ts.map +1 -1
  8. package/card.d.ts +1 -0
  9. package/card.d.ts.map +1 -1
  10. package/carousel.d.ts +1 -0
  11. package/carousel.d.ts.map +1 -1
  12. package/components/alert.d.ts +2 -1
  13. package/components/alert.d.ts.map +1 -1
  14. package/components/alert.js +6 -8
  15. package/components/alert.js.map +1 -1
  16. package/components/avatar.d.ts +2 -1
  17. package/components/avatar.d.ts.map +1 -1
  18. package/components/avatar.js +8 -5
  19. package/components/avatar.js.map +1 -1
  20. package/components/breath.d.ts +3 -2
  21. package/components/breath.d.ts.map +1 -1
  22. package/components/breath.js +6 -5
  23. package/components/breath.js.map +1 -1
  24. package/components/button.d.ts +5 -3
  25. package/components/button.d.ts.map +1 -1
  26. package/components/button.js +20 -3
  27. package/components/button.js.map +1 -1
  28. package/components/card.d.ts +2 -1
  29. package/components/card.d.ts.map +1 -1
  30. package/components/card.js +5 -4
  31. package/components/card.js.map +1 -1
  32. package/components/carousel.d.ts +3 -1
  33. package/components/carousel.d.ts.map +1 -1
  34. package/components/carousel.js +17 -11
  35. package/components/carousel.js.map +1 -1
  36. package/components/details.d.ts +2 -1
  37. package/components/details.d.ts.map +1 -1
  38. package/components/details.js +3 -2
  39. package/components/details.js.map +1 -1
  40. package/components/dialog.d.ts +2 -2
  41. package/components/dialog.d.ts.map +1 -1
  42. package/components/dialog.js +5 -3
  43. package/components/dialog.js.map +1 -1
  44. package/components/divider.d.ts +2 -3
  45. package/components/divider.d.ts.map +1 -1
  46. package/components/divider.js +5 -6
  47. package/components/divider.js.map +1 -1
  48. package/components/dragbox.d.ts +2 -1
  49. package/components/dragbox.d.ts.map +1 -1
  50. package/components/dragbox.js +4 -2
  51. package/components/dragbox.js.map +1 -1
  52. package/components/flex.d.ts +2 -1
  53. package/components/flex.d.ts.map +1 -1
  54. package/components/flex.js +5 -4
  55. package/components/flex.js.map +1 -1
  56. package/components/form.d.ts +2 -1
  57. package/components/form.d.ts.map +1 -1
  58. package/components/form.js.map +1 -1
  59. package/components/grid.d.ts +2 -1
  60. package/components/grid.d.ts.map +1 -1
  61. package/components/grid.js +5 -4
  62. package/components/grid.js.map +1 -1
  63. package/components/input.d.ts +2 -1
  64. package/components/input.d.ts.map +1 -1
  65. package/components/input.js +3 -2
  66. package/components/input.js.map +1 -1
  67. package/components/layout.d.ts +2 -1
  68. package/components/layout.d.ts.map +1 -1
  69. package/components/layout.js +6 -6
  70. package/components/layout.js.map +1 -1
  71. package/components/link.d.ts +4 -0
  72. package/components/link.d.ts.map +1 -1
  73. package/components/link.js +10 -1
  74. package/components/link.js.map +1 -1
  75. package/components/progress.d.ts +2 -1
  76. package/components/progress.d.ts.map +1 -1
  77. package/components/progress.js +5 -4
  78. package/components/progress.js.map +1 -1
  79. package/components/range.d.ts +3 -2
  80. package/components/range.d.ts.map +1 -1
  81. package/components/range.js +8 -7
  82. package/components/range.js.map +1 -1
  83. package/components/rotate.d.ts +2 -1
  84. package/components/rotate.d.ts.map +1 -1
  85. package/components/rotate.js +1 -1
  86. package/components/rotate.js.map +1 -1
  87. package/components/router.d.ts +9 -9
  88. package/components/router.d.ts.map +1 -1
  89. package/components/router.js.map +1 -1
  90. package/components/select.d.ts +2 -1
  91. package/components/select.d.ts.map +1 -1
  92. package/components/select.js +11 -5
  93. package/components/select.js.map +1 -1
  94. package/components/skeleton.d.ts +2 -1
  95. package/components/skeleton.d.ts.map +1 -1
  96. package/components/skeleton.js +5 -4
  97. package/components/skeleton.js.map +1 -1
  98. package/components/split.d.ts +2 -1
  99. package/components/split.d.ts.map +1 -1
  100. package/components/split.js +4 -3
  101. package/components/split.js.map +1 -1
  102. package/components/switch.d.ts +2 -1
  103. package/components/switch.d.ts.map +1 -1
  104. package/components/switch.js +4 -3
  105. package/components/switch.js.map +1 -1
  106. package/components/text.d.ts +2 -1
  107. package/components/text.d.ts.map +1 -1
  108. package/components/text.js +9 -6
  109. package/components/text.js.map +1 -1
  110. package/components/time.d.ts +2 -2
  111. package/components/time.d.ts.map +1 -1
  112. package/components/time.js +3 -2
  113. package/components/time.js.map +1 -1
  114. package/components/tooltip.d.ts +2 -1
  115. package/components/tooltip.d.ts.map +1 -1
  116. package/components/tooltip.js +4 -3
  117. package/components/tooltip.js.map +1 -1
  118. package/components/typewriter.d.ts +2 -2
  119. package/components/typewriter.d.ts.map +1 -1
  120. package/components/typewriter.js +4 -5
  121. package/components/typewriter.js.map +1 -1
  122. package/core/global-style.d.ts.map +1 -1
  123. package/core/global-style.js +1 -1
  124. package/core/global-style.js.map +1 -1
  125. package/core/super-anchor.d.ts +2 -1
  126. package/core/super-anchor.d.ts.map +1 -1
  127. package/core/super-anchor.js +4 -3
  128. package/core/super-anchor.js.map +1 -1
  129. package/core/super-input.d.ts +3 -2
  130. package/core/super-input.d.ts.map +1 -1
  131. package/core/super-input.js +10 -4
  132. package/core/super-input.js.map +1 -1
  133. package/core/super-openable.d.ts.map +1 -1
  134. package/core/super-openable.js +1 -1
  135. package/core/super-openable.js.map +1 -1
  136. package/custom-elements.json +1 -1
  137. package/details.d.ts +1 -0
  138. package/details.d.ts.map +1 -1
  139. package/dev/alert.d.ts +1 -0
  140. package/dev/alert.d.ts.map +1 -1
  141. package/dev/alert.js +1 -0
  142. package/dev/alert.js.map +1 -1
  143. package/dev/avatar.d.ts +1 -0
  144. package/dev/avatar.d.ts.map +1 -1
  145. package/dev/avatar.js +1 -0
  146. package/dev/avatar.js.map +1 -1
  147. package/dev/button.d.ts +1 -0
  148. package/dev/button.d.ts.map +1 -1
  149. package/dev/button.js +1 -0
  150. package/dev/button.js.map +1 -1
  151. package/dev/card.d.ts +1 -0
  152. package/dev/card.d.ts.map +1 -1
  153. package/dev/card.js +1 -0
  154. package/dev/card.js.map +1 -1
  155. package/dev/carousel.d.ts +1 -0
  156. package/dev/carousel.d.ts.map +1 -1
  157. package/dev/carousel.js +1 -0
  158. package/dev/carousel.js.map +1 -1
  159. package/dev/components/alert.d.ts +2 -1
  160. package/dev/components/alert.d.ts.map +1 -1
  161. package/dev/components/alert.js +12 -10
  162. package/dev/components/alert.js.map +1 -1
  163. package/dev/components/avatar.d.ts +2 -1
  164. package/dev/components/avatar.d.ts.map +1 -1
  165. package/dev/components/avatar.js +21 -7
  166. package/dev/components/avatar.js.map +1 -1
  167. package/dev/components/breath.d.ts +3 -2
  168. package/dev/components/breath.d.ts.map +1 -1
  169. package/dev/components/breath.js +17 -5
  170. package/dev/components/breath.js.map +1 -1
  171. package/dev/components/button.d.ts +5 -3
  172. package/dev/components/button.d.ts.map +1 -1
  173. package/dev/components/button.js +23 -2
  174. package/dev/components/button.js.map +1 -1
  175. package/dev/components/card.d.ts +2 -1
  176. package/dev/components/card.d.ts.map +1 -1
  177. package/dev/components/card.js +8 -5
  178. package/dev/components/card.js.map +1 -1
  179. package/dev/components/carousel.d.ts +3 -1
  180. package/dev/components/carousel.d.ts.map +1 -1
  181. package/dev/components/carousel.js +27 -13
  182. package/dev/components/carousel.js.map +1 -1
  183. package/dev/components/details.d.ts +2 -1
  184. package/dev/components/details.d.ts.map +1 -1
  185. package/dev/components/details.js +8 -3
  186. package/dev/components/details.js.map +1 -1
  187. package/dev/components/dialog.d.ts +2 -2
  188. package/dev/components/dialog.d.ts.map +1 -1
  189. package/dev/components/dialog.js +12 -10
  190. package/dev/components/dialog.js.map +1 -1
  191. package/dev/components/divider.d.ts +2 -3
  192. package/dev/components/divider.d.ts.map +1 -1
  193. package/dev/components/divider.js +19 -7
  194. package/dev/components/divider.js.map +1 -1
  195. package/dev/components/dragbox.d.ts +2 -1
  196. package/dev/components/dragbox.d.ts.map +1 -1
  197. package/dev/components/dragbox.js +9 -1
  198. package/dev/components/dragbox.js.map +1 -1
  199. package/dev/components/flex.d.ts +2 -1
  200. package/dev/components/flex.d.ts.map +1 -1
  201. package/dev/components/flex.js +16 -4
  202. package/dev/components/flex.js.map +1 -1
  203. package/dev/components/form.d.ts +2 -1
  204. package/dev/components/form.d.ts.map +1 -1
  205. package/dev/components/form.js.map +1 -1
  206. package/dev/components/grid.d.ts +2 -1
  207. package/dev/components/grid.d.ts.map +1 -1
  208. package/dev/components/grid.js +16 -4
  209. package/dev/components/grid.js.map +1 -1
  210. package/dev/components/input.d.ts +2 -1
  211. package/dev/components/input.d.ts.map +1 -1
  212. package/dev/components/input.js +2 -1
  213. package/dev/components/input.js.map +1 -1
  214. package/dev/components/layout.d.ts +2 -1
  215. package/dev/components/layout.d.ts.map +1 -1
  216. package/dev/components/layout.js +13 -6
  217. package/dev/components/layout.js.map +1 -1
  218. package/dev/components/link.d.ts +4 -0
  219. package/dev/components/link.d.ts.map +1 -1
  220. package/dev/components/link.js +10 -1
  221. package/dev/components/link.js.map +1 -1
  222. package/dev/components/progress.d.ts +2 -1
  223. package/dev/components/progress.d.ts.map +1 -1
  224. package/dev/components/progress.js +7 -2
  225. package/dev/components/progress.js.map +1 -1
  226. package/dev/components/range.d.ts +3 -2
  227. package/dev/components/range.d.ts.map +1 -1
  228. package/dev/components/range.js +27 -22
  229. package/dev/components/range.js.map +1 -1
  230. package/dev/components/rotate.d.ts +2 -1
  231. package/dev/components/rotate.d.ts.map +1 -1
  232. package/dev/components/rotate.js +1 -1
  233. package/dev/components/rotate.js.map +1 -1
  234. package/dev/components/router.d.ts +9 -9
  235. package/dev/components/router.d.ts.map +1 -1
  236. package/dev/components/router.js.map +1 -1
  237. package/dev/components/select.d.ts +2 -1
  238. package/dev/components/select.d.ts.map +1 -1
  239. package/dev/components/select.js +18 -7
  240. package/dev/components/select.js.map +1 -1
  241. package/dev/components/skeleton.d.ts +2 -1
  242. package/dev/components/skeleton.d.ts.map +1 -1
  243. package/dev/components/skeleton.js +4 -3
  244. package/dev/components/skeleton.js.map +1 -1
  245. package/dev/components/split.d.ts +2 -1
  246. package/dev/components/split.d.ts.map +1 -1
  247. package/dev/components/split.js +15 -11
  248. package/dev/components/split.js.map +1 -1
  249. package/dev/components/switch.d.ts +2 -1
  250. package/dev/components/switch.d.ts.map +1 -1
  251. package/dev/components/switch.js +15 -14
  252. package/dev/components/switch.js.map +1 -1
  253. package/dev/components/text.d.ts +2 -1
  254. package/dev/components/text.d.ts.map +1 -1
  255. package/dev/components/text.js +8 -4
  256. package/dev/components/text.js.map +1 -1
  257. package/dev/components/time.d.ts +2 -2
  258. package/dev/components/time.d.ts.map +1 -1
  259. package/dev/components/time.js +5 -2
  260. package/dev/components/time.js.map +1 -1
  261. package/dev/components/tooltip.d.ts +2 -1
  262. package/dev/components/tooltip.d.ts.map +1 -1
  263. package/dev/components/tooltip.js +24 -12
  264. package/dev/components/tooltip.js.map +1 -1
  265. package/dev/components/typewriter.d.ts +2 -2
  266. package/dev/components/typewriter.d.ts.map +1 -1
  267. package/dev/components/typewriter.js +11 -4
  268. package/dev/components/typewriter.js.map +1 -1
  269. package/dev/core/global-style.d.ts.map +1 -1
  270. package/dev/core/global-style.js +10 -1
  271. package/dev/core/global-style.js.map +1 -1
  272. package/dev/core/super-anchor.d.ts +2 -1
  273. package/dev/core/super-anchor.d.ts.map +1 -1
  274. package/dev/core/super-anchor.js +8 -5
  275. package/dev/core/super-anchor.js.map +1 -1
  276. package/dev/core/super-input.d.ts +3 -2
  277. package/dev/core/super-input.d.ts.map +1 -1
  278. package/dev/core/super-input.js +13 -5
  279. package/dev/core/super-input.js.map +1 -1
  280. package/dev/core/super-openable.d.ts.map +1 -1
  281. package/dev/core/super-openable.js +1 -1
  282. package/dev/core/super-openable.js.map +1 -1
  283. package/dev/details.d.ts +1 -0
  284. package/dev/details.d.ts.map +1 -1
  285. package/dev/details.js +1 -0
  286. package/dev/details.js.map +1 -1
  287. package/dev/dialog.d.ts +1 -0
  288. package/dev/dialog.d.ts.map +1 -1
  289. package/dev/dialog.js +1 -0
  290. package/dev/dialog.js.map +1 -1
  291. package/dev/divider.d.ts +1 -0
  292. package/dev/divider.d.ts.map +1 -1
  293. package/dev/divider.js +1 -0
  294. package/dev/divider.js.map +1 -1
  295. package/dev/dragbox.d.ts +1 -0
  296. package/dev/dragbox.d.ts.map +1 -1
  297. package/dev/dragbox.js +1 -0
  298. package/dev/dragbox.js.map +1 -1
  299. package/dev/flex.d.ts +1 -0
  300. package/dev/flex.d.ts.map +1 -1
  301. package/dev/flex.js +1 -0
  302. package/dev/flex.js.map +1 -1
  303. package/dev/form.d.ts +1 -0
  304. package/dev/form.d.ts.map +1 -1
  305. package/dev/form.js +1 -0
  306. package/dev/form.js.map +1 -1
  307. package/dev/grid.d.ts +1 -0
  308. package/dev/grid.d.ts.map +1 -1
  309. package/dev/grid.js +1 -0
  310. package/dev/grid.js.map +1 -1
  311. package/dev/layout.d.ts.map +1 -1
  312. package/dev/progress.d.ts.map +1 -1
  313. package/dev/router.d.ts.map +1 -1
  314. package/dev/split.d.ts +1 -1
  315. package/dev/split.d.ts.map +1 -1
  316. package/dev/typewriter.d.ts +1 -0
  317. package/dev/typewriter.d.ts.map +1 -1
  318. package/dev/typewriter.js +1 -0
  319. package/dev/typewriter.js.map +1 -1
  320. package/dialog.d.ts +1 -0
  321. package/dialog.d.ts.map +1 -1
  322. package/divider.d.ts +1 -0
  323. package/divider.d.ts.map +1 -1
  324. package/dragbox.d.ts +1 -0
  325. package/dragbox.d.ts.map +1 -1
  326. package/flex.d.ts +1 -0
  327. package/flex.d.ts.map +1 -1
  328. package/form.d.ts +1 -0
  329. package/form.d.ts.map +1 -1
  330. package/grid.d.ts +1 -0
  331. package/grid.d.ts.map +1 -1
  332. package/layout.d.ts.map +1 -1
  333. package/package.json +9 -5
  334. package/progress.d.ts.map +1 -1
  335. package/router.d.ts.map +1 -1
  336. package/split.d.ts +1 -1
  337. package/split.d.ts.map +1 -1
  338. package/src/alert.ts +2 -0
  339. package/src/avatar.ts +2 -0
  340. package/src/button.ts +2 -0
  341. package/src/card.ts +2 -0
  342. package/src/carousel.ts +2 -0
  343. package/src/components/alert.ts +18 -16
  344. package/src/components/avatar.ts +25 -11
  345. package/src/components/breath.ts +22 -10
  346. package/src/components/button.ts +21 -15
  347. package/src/components/card.ts +9 -6
  348. package/src/components/carousel.ts +36 -21
  349. package/src/components/details.ts +10 -5
  350. package/src/components/dialog.ts +19 -18
  351. package/src/components/divider.ts +19 -7
  352. package/src/components/dragbox.ts +16 -9
  353. package/src/components/flex.ts +17 -5
  354. package/src/components/form.ts +4 -4
  355. package/src/components/grid.ts +17 -5
  356. package/src/components/input.ts +5 -4
  357. package/src/components/layout.ts +15 -8
  358. package/src/components/link.ts +10 -2
  359. package/src/components/progress.ts +9 -4
  360. package/src/components/range.ts +44 -45
  361. package/src/components/rotate.ts +9 -6
  362. package/src/components/router.ts +27 -19
  363. package/src/components/select.ts +31 -20
  364. package/src/components/skeleton.ts +6 -5
  365. package/src/components/split.ts +23 -19
  366. package/src/components/switch.ts +20 -19
  367. package/src/components/text.ts +7 -9
  368. package/src/components/time.ts +12 -9
  369. package/src/components/tooltip.ts +26 -14
  370. package/src/components/typewriter.ts +19 -14
  371. package/src/core/global-style.ts +23 -4
  372. package/src/core/super-anchor.ts +11 -8
  373. package/src/core/super-input.ts +23 -21
  374. package/src/core/super-openable.ts +5 -5
  375. package/src/details.ts +2 -0
  376. package/src/dialog.ts +2 -0
  377. package/src/divider.ts +2 -0
  378. package/src/dragbox.ts +2 -0
  379. package/src/flex.ts +2 -0
  380. package/src/form.ts +2 -0
  381. package/src/grid.ts +2 -0
  382. package/src/layout.ts +1 -0
  383. package/src/progress.ts +1 -0
  384. package/src/router.ts +1 -0
  385. package/src/split.ts +1 -1
  386. package/src/typewriter.ts +2 -0
  387. package/typewriter.d.ts +1 -0
  388. package/typewriter.d.ts.map +1 -1
  389. package/vscode.html-custom-data.json +1 -1
  390. package/web-types.json +1 -1
package/dev/split.d.ts CHANGED
@@ -3,7 +3,7 @@ export default Split;
3
3
  export * from "./components/split.js";
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
6
- "godown-split-input": Split;
6
+ "godown-split": Split;
7
7
  }
8
8
  }
9
9
  //# sourceMappingURL=split.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../src/split.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAI1C,eAAe,KAAK,CAAC;AAErB,cAAc,uBAAuB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,KAAK,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../src/split.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAI1C,eAAe,KAAK,CAAC;AAErB,cAAc,uBAAuB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,KAAK,CAAC;KACvB;CACF"}
@@ -1,5 +1,6 @@
1
1
  import Typewriter from "./components/typewriter.js";
2
2
  export default Typewriter;
3
+ export * from "./components/typewriter.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-typewriter": Typewriter;
@@ -1 +1 @@
1
- {"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../src/typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAIpD,eAAe,UAAU,CAAC;AAE1B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,UAAU,CAAC;KACjC;CACF"}
1
+ {"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../src/typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAIpD,eAAe,UAAU,CAAC;AAE1B,cAAc,4BAA4B,CAAC;AAE3C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,UAAU,CAAC;KACjC;CACF"}
package/dev/typewriter.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import Typewriter from "./components/typewriter.js";
2
2
  Typewriter.define();
3
3
  export default Typewriter;
4
+ export * from "./components/typewriter.js";
4
5
  //# sourceMappingURL=typewriter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typewriter.js","sourceRoot":"","sources":["../src/typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAEpD,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"typewriter.js","sourceRoot":"","sources":["../src/typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAEpD,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC;AAE1B,cAAc,4BAA4B,CAAC"}
package/dialog.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Dialog from "./components/dialog.js";
2
2
  export default Dialog;
3
+ export * from "./components/dialog.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-dialog": Dialog;
package/dialog.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
package/divider.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Divider from "./components/divider.js";
2
2
  export default Divider;
3
+ export * from "./components/divider.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-divider": Divider;
package/divider.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["src/divider.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAI9C,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,OAAO,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["src/divider.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAI9C,eAAe,OAAO,CAAC;AAEvB,cAAc,yBAAyB,CAAC;AAExC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,OAAO,CAAC;KAC3B;CACF"}
package/dragbox.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Dragbox from "./components/dragbox.js";
2
2
  export default Dragbox;
3
+ export * from "./components/dragbox.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-dragbox": Dragbox;
package/dragbox.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dragbox.d.ts","sourceRoot":"","sources":["src/dragbox.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAI9C,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,OAAO,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"dragbox.d.ts","sourceRoot":"","sources":["src/dragbox.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAI9C,eAAe,OAAO,CAAC;AAEvB,cAAc,yBAAyB,CAAC;AAExC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,OAAO,CAAC;KAC3B;CACF"}
package/flex.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Flex from "./components/flex.js";
2
2
  export default Flex;
3
+ export * from "./components/flex.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-flex": Flex;
package/flex.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["src/flex.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
1
+ {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["src/flex.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,cAAc,sBAAsB,CAAC;AAErC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
package/form.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Form from "./components/form.js";
2
2
  export default Form;
3
+ export * from "./components/form.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-form": Form;
package/form.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["src/form.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["src/form.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,cAAc,sBAAsB,CAAC;AAErC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
package/grid.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Grid from "./components/grid.js";
2
2
  export default Grid;
3
+ export * from "./components/grid.js";
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  "godown-grid": Grid;
package/grid.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["src/grid.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["src/grid.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,cAAc,sBAAsB,CAAC;AAErC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
package/layout.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AACvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.0.0-canary.10",
4
- "description": "Simple, stylized, semantic web components",
3
+ "version": "3.0.0-canary.12",
4
+ "description": "Non Composite Web Components Library",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "exports": {
@@ -13,6 +13,7 @@
13
13
  "development": "./dev/*",
14
14
  "default": "./*"
15
15
  },
16
+ "./src/*": "./src/*",
16
17
  "./*.json": "./*.json"
17
18
  },
18
19
  "repository": {
@@ -20,7 +21,10 @@
20
21
  "url": "https://github.com/startracex/godown.git",
21
22
  "directory": "packages/godown"
22
23
  },
23
- "keywords": [],
24
+ "keywords": [
25
+ "web-components",
26
+ "custom-elements"
27
+ ],
24
28
  "author": "startracex",
25
29
  "license": "MIT",
26
30
  "dependencies": {
@@ -28,8 +32,8 @@
28
32
  "lit": "^3.0.0",
29
33
  "tslib": "^2.7.0",
30
34
  "@godown/colors": "^0.0.1",
31
- "@godown/element": "^0.0.3",
32
- "@godown/f7-icon": "^0.0.3"
35
+ "@godown/element": "^0.2.0",
36
+ "@godown/f7-icon": "^0.0.4"
33
37
  },
34
38
  "publishConfig": {
35
39
  "access": "public"
package/progress.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["src/progress.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAIhD,eAAe,QAAQ,CAAC;AAExB,cAAc,0BAA0B,CAAC;AACzC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["src/progress.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAIhD,eAAe,QAAQ,CAAC;AAExB,cAAc,0BAA0B,CAAC;AAEzC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;KAC7B;CACF"}
package/router.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["src/router.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AACvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["src/router.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
package/split.d.ts CHANGED
@@ -3,7 +3,7 @@ export default Split;
3
3
  export * from "./components/split.js";
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
6
- "godown-split-input": Split;
6
+ "godown-split": Split;
7
7
  }
8
8
  }
9
9
  //# sourceMappingURL=split.d.ts.map
package/split.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["src/split.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAI1C,eAAe,KAAK,CAAC;AAErB,cAAc,uBAAuB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,KAAK,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["src/split.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAI1C,eAAe,KAAK,CAAC;AAErB,cAAc,uBAAuB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,KAAK,CAAC;KACvB;CACF"}
package/src/alert.ts CHANGED
@@ -4,6 +4,8 @@ Alert.define();
4
4
 
5
5
  export default Alert;
6
6
 
7
+ export * from "./components/alert.js";
8
+
7
9
  declare global {
8
10
  interface HTMLElementTagNameMap {
9
11
  "godown-alert": Alert;
package/src/avatar.ts CHANGED
@@ -4,6 +4,8 @@ Avatar.define();
4
4
 
5
5
  export default Avatar;
6
6
 
7
+ export * from "./components/avatar.js";
8
+
7
9
  declare global {
8
10
  interface HTMLElementTagNameMap {
9
11
  "godown-avatar": Avatar;
package/src/button.ts CHANGED
@@ -4,6 +4,8 @@ Button.define();
4
4
 
5
5
  export default Button;
6
6
 
7
+ export * from "./components/button.js";
8
+
7
9
  declare global {
8
10
  interface HTMLElementTagNameMap {
9
11
  "godown-button": Button;
package/src/card.ts CHANGED
@@ -4,6 +4,8 @@ Card.define();
4
4
 
5
5
  export default Card;
6
6
 
7
+ export * from "./components/card.js";
8
+
7
9
  declare global {
8
10
  interface HTMLElementTagNameMap {
9
11
  "godown-card": Card;
package/src/carousel.ts CHANGED
@@ -4,6 +4,8 @@ Carousel.define();
4
4
 
5
5
  export default Carousel;
6
6
 
7
+ export * from "./components/carousel.js";
8
+
7
9
  declare global {
8
10
  interface HTMLElementTagNameMap {
9
11
  "godown-carousel": Carousel;
@@ -1,5 +1,6 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
5
  import { htmlStyle } from "@godown/element/directives/html-style.js";
5
6
  import { constructCSSObject, toVar } from "@godown/element/tools/css.js";
@@ -11,7 +12,7 @@ import iconQuestionCircle from "@godown/f7-icon/icons/question-circle.js";
11
12
  import iconSlashCircle from "@godown/f7-icon/icons/slash-circle.js";
12
13
  import iconXmark from "@godown/f7-icon/icons/xmark.js";
13
14
  import iconXmarkCircle from "@godown/f7-icon/icons/xmark-circle.js";
14
- import { css, html } from "lit";
15
+ import { css, html, type TemplateResult } from "lit";
15
16
  import { property } from "lit/decorators.js";
16
17
 
17
18
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -115,7 +116,8 @@ const calls = {
115
116
  @godown(protoName)
116
117
  @styles(
117
118
  css`
118
- :host {
119
+ :host,
120
+ :where(:host([contents]) [part=root]) {
119
121
  border-radius: var(${cssScope}--border-radius);
120
122
  ${cssScope}--border-radius: .25em;
121
123
  ${cssScope}--border-width: .075em;
@@ -147,7 +149,7 @@ const calls = {
147
149
  background: transparent;
148
150
  }
149
151
 
150
- [part=content]{
152
+ [part=content] {
151
153
  color: var(--color);
152
154
  }
153
155
 
@@ -240,32 +242,32 @@ class Alert extends GlobalStyle {
240
242
  @property()
241
243
  variant: "blockquote" | "dark" | "light" = "dark";
242
244
 
243
- protected render() {
245
+ protected render(): TemplateResult<1> {
244
246
  const color = calls[this.call]?.color || this.color;
245
247
  const icon = this.call ? calls[this.call].icon() : htmlSlot("icon");
246
- return [
247
- html`<div part="root" variant="${this.variant}">
248
+ return html`<div part="root" ${attr(this.observedRecord)}>
248
249
  <div part="icon">${icon}</div>
249
250
  <div part="content">
250
- <strong part="title">${this.title || htmlSlot("title")}</strong>
251
+ <strong part="title">
252
+ ${this.title || htmlSlot("title")}
253
+ </strong>
251
254
  ${this.content || htmlSlot()}
252
255
  </div>
253
256
  ${
254
- !this.hideClose && this.variant !== "blockquote"
255
- ? html`<div part="close" tabindex=0 @click="${this.close}">${iconXmark()}</div>`
256
- : ""
257
- }
258
- </div>`,
259
- htmlStyle(this.variant === "light" ? lightStyles[color] : darkStyles[color]),
260
- ];
257
+ !this.hideClose && this.variant !== "blockquote"
258
+ ? html`<div part="close" tabindex=0 @click="${this.close}">${iconXmark()}</div>`
259
+ : ""
260
+ }
261
+ ${htmlStyle(this.variant === "light" ? lightStyles[color] : darkStyles[color])}
262
+ </div>`;
261
263
  }
262
264
 
263
- close() {
265
+ close(): void {
264
266
  this.remove();
265
267
  this.dispatchEvent(new CustomEvent("close", { bubbles: true, composed: true }));
266
268
  }
267
269
 
268
- protected firstUpdated() {
270
+ protected firstUpdated(): void {
269
271
  if (this.autoclose) {
270
272
  setTimeout(() => this.close(), this.autoclose);
271
273
  }
@@ -1,6 +1,9 @@
1
- import { godown, styles } from "@godown/element/decorators/index.js";
2
- import { htmlSlot } from "@godown/element/directives/index.js";
3
- import { css, html } from "lit";
1
+ import { godown } from "@godown/element/decorators/godown.js";
2
+ import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
4
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
+ import { omit } from "@godown/element/tools/lib.js";
6
+ import { css, html, type TemplateResult } from "lit";
4
7
  import { property } from "lit/decorators.js";
5
8
 
6
9
  import { GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -20,15 +23,25 @@ const cssScope = scopePrefix(protoName);
20
23
  @godown(protoName)
21
24
  @styles(
22
25
  css`
23
- :host {
26
+ :host{
24
27
  ${cssScope}--size: 2em;
25
28
  width: var(${cssScope}--size);
26
29
  height: var(${cssScope}--size);
27
- display: inline-block;
28
30
  vertical-align: bottom;
29
31
  }
30
32
 
31
- :host([round]){
33
+ :host,
34
+ [part=root] {
35
+ display: inline-flex;
36
+ }
37
+
38
+ :host([contents]) [part=root] {
39
+ display: inline-flex;
40
+ width: inherit;
41
+ height: inherit;
42
+ }
43
+
44
+ :host([round]) {
32
45
  border-radius:50%;
33
46
  }
34
47
 
@@ -44,7 +57,6 @@ const cssScope = scopePrefix(protoName);
44
57
  border-radius: inherit;
45
58
  width: 100%;
46
59
  height: 100%;
47
- display: flex;
48
60
  align-items: center;
49
61
  justify-content: center;
50
62
  }
@@ -69,8 +81,10 @@ class Avatar extends GlobalStyle {
69
81
  @property({ type: Boolean })
70
82
  round = false;
71
83
 
72
- protected render() {
73
- return html`<div part="root">${this._renderAvatar()}</div>`;
84
+ protected render(): TemplateResult<1> {
85
+ return html`<div part="root" ${attr(omit(this.observedRecord, "src"))}>
86
+ ${this._renderAvatar()}
87
+ </div>`;
74
88
  }
75
89
 
76
90
  private _renderAvatar() {
@@ -83,11 +97,11 @@ class Avatar extends GlobalStyle {
83
97
  return htmlSlot();
84
98
  }
85
99
 
86
- format() {
100
+ format(): string {
87
101
  return this.name;
88
102
  }
89
103
 
90
- _handleError() {
104
+ _handleError(): void {
91
105
  this.src = undefined;
92
106
  }
93
107
  }
@@ -1,7 +1,8 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlStyle } from "@godown/element/directives/html-style.js";
4
- import { css, html } from "lit";
5
+ import { css, html, type TemplateResult } from "lit";
5
6
  import { property } from "lit/decorators.js";
6
7
 
7
8
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -42,15 +43,22 @@ const cssScope = scopePrefix(defineName);
42
43
  `,
43
44
  css`
44
45
  :host {
45
- display: flex;
46
46
  margin: auto;
47
- width: -moz-fit-content;
48
47
  width: fit-content;
49
48
  font-size: 2em;
50
49
  align-items: center;
51
50
  direction: ltr;
52
51
  }
53
52
 
53
+ :host,
54
+ :host([contents]) [part=root] {
55
+ display: flex;
56
+ }
57
+
58
+ [part=root] {
59
+ display: contents;
60
+ }
61
+
54
62
  ::selection {
55
63
  background: none;
56
64
  }
@@ -69,14 +77,16 @@ const cssScope = scopePrefix(defineName);
69
77
  box-sizing: border-box;
70
78
  display: inline-block;
71
79
  animation-iteration-count: infinite;
72
- -webkit-text-fill-color: transparent;
80
+ color: transparent;
73
81
  -webkit-background-clip: text !important;
74
82
  background-clip: text !important;
75
83
  }
84
+
76
85
  .colorful {
77
86
  opacity: 0;
78
87
  animation-name: colorfulN;
79
88
  }
89
+
80
90
  .nocolor {
81
91
  position: absolute;
82
92
  top: 0;
@@ -99,15 +109,17 @@ class Breath extends GlobalStyle {
99
109
  @property()
100
110
  duration: string;
101
111
 
102
- protected render() {
112
+ protected render(): TemplateResult<1> {
103
113
  const texts = this.getTexts();
104
- return [
114
+ return html`<div part="root" ${attr(this.observedRecord)}>
115
+ ${[
105
116
  texts.map(this.renderText),
106
117
  htmlStyle(this.computeStyle(texts.length)),
107
- ];
118
+ ]}
119
+ </div>`;
108
120
  }
109
121
 
110
- protected renderText(text: string) {
122
+ protected renderText(text: string): TemplateResult<1> {
111
123
  return html`<span class="rel">
112
124
  <span class="nocolor">${text}</span>
113
125
  <span class="colorful">${text}</span>
@@ -118,7 +130,7 @@ class Breath extends GlobalStyle {
118
130
  return Array.isArray(this.text) ? this.text : (this.text || this.textContent).split(/\s+/).filter((x) => x);
119
131
  }
120
132
 
121
- protected computeStyle(len: number) {
133
+ protected computeStyle(len: number): string {
122
134
  const gap = 100 / 2 / len;
123
135
  const duration = this.parseDuration() || len * 2 + 2;
124
136
 
@@ -138,7 +150,7 @@ class Breath extends GlobalStyle {
138
150
  );
139
151
  }
140
152
 
141
- protected parseDuration() {
153
+ protected parseDuration(): number {
142
154
  const { duration } = this;
143
155
  if (duration) {
144
156
  if (duration.endsWith("s")) {
@@ -1,10 +1,11 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { part } from "@godown/element/decorators/part.js";
3
3
  import { styles } from "@godown/element/decorators/styles.js";
4
+ import { attr } from "@godown/element/directives/attr.js";
4
5
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
6
  import { htmlStyle } from "@godown/element/directives/html-style.js";
6
7
  import { constructCSSObject, toVar } from "@godown/element/tools/css.js";
7
- import { css, html } from "lit";
8
+ import { css, html, TemplateResult } from "lit";
8
9
  import { property } from "lit/decorators.js";
9
10
 
10
11
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -15,7 +16,8 @@ const cssScope = scopePrefix(protoName);
15
16
  const whiteFont = cssGlobalVars.white;
16
17
  const blackFont = cssGlobalVars.black;
17
18
 
18
- const colors = constructCSSObject(
19
+ type Colors = "teal" | "blue" | "green" | "red" | "purple" | "orange" | "yellow" | "pink" | "gray" | "white" | "black";
20
+ const colors: Record<Colors, string> = constructCSSObject(
19
21
  ["color", "background", "gradients"].map((k) => `${cssScope}--${k}`),
20
22
  {
21
23
  black: [
@@ -118,7 +120,7 @@ const colors = constructCSSObject(
118
120
  css`
119
121
  :host {
120
122
  ${cssScope}--padding-x: .5em;
121
- ${cssScope}--padding-y: .15em;
123
+ ${cssScope}--padding-y: min(calc(var(${cssScope}--padding-x) / 2), .25em);
122
124
  ${cssScope}--padding: var(${cssScope}--padding-y) var(${cssScope}--padding-x);
123
125
  ${cssScope}--modal-animation-duration: 1s;
124
126
  ${cssScope}--ghost-width: .08em;
@@ -142,6 +144,10 @@ const colors = constructCSSObject(
142
144
  cursor: pointer;
143
145
  }
144
146
 
147
+ :host([contents]) [part=root] {
148
+ width: fit-content;
149
+ }
150
+
145
151
  [part=root] {
146
152
  width: 100%;
147
153
  height: 100%;
@@ -190,25 +196,25 @@ class Button extends GlobalStyle {
190
196
  * Whether to disable this element.
191
197
  */
192
198
  @property({ type: Boolean, reflect: true })
193
- disabled: boolean;
199
+ disabled = false;
194
200
 
195
201
  /**
196
202
  * Display ghost.
197
203
  */
198
204
  @property({ type: Boolean, reflect: true })
199
- ghost: boolean;
205
+ ghost = false;
200
206
 
201
207
  /**
202
208
  * Whether this element is active or not.
203
209
  */
204
210
  @property({ type: Boolean, reflect: true })
205
- active: boolean;
211
+ active = false;
206
212
 
207
213
  /**
208
214
  * Display rounded.
209
215
  */
210
216
  @property({ type: Boolean, reflect: true })
211
- round: boolean;
217
+ round = false;
212
218
 
213
219
  /**
214
220
  * The primary color.
@@ -227,9 +233,9 @@ class Button extends GlobalStyle {
227
233
  @part("root")
228
234
  protected _root: HTMLElement;
229
235
 
230
- protected render() {
236
+ protected render(): TemplateResult<1> {
231
237
  const color = this.nextColor();
232
- return html`<div part="root">
238
+ return html`<div part="root" ${attr(this.observedRecord)}>
233
239
  <span part="modal-root"></span>
234
240
  <div part="content">
235
241
  ${[this.content || htmlSlot(), htmlStyle(colors[color])]}
@@ -237,7 +243,7 @@ class Button extends GlobalStyle {
237
243
  </div>`;
238
244
  }
239
245
 
240
- focus() {
246
+ focus(): void {
241
247
  if (this.disabled) {
242
248
  return;
243
249
  }
@@ -245,16 +251,16 @@ class Button extends GlobalStyle {
245
251
  super.focus();
246
252
  }
247
253
 
248
- blur() {
254
+ blur(): void {
249
255
  this.active = false;
250
256
  super.blur();
251
257
  }
252
258
 
253
- firstUpdated() {
259
+ firstUpdated(): void {
254
260
  this.events.add(this, "click", this._handelClick, true);
255
261
  }
256
262
 
257
- protected _handelClick(e: MouseEvent) {
263
+ protected _handelClick(e: MouseEvent): void {
258
264
  if (this.disabled) {
259
265
  e.stopPropagation();
260
266
  e.preventDefault();
@@ -263,7 +269,7 @@ class Button extends GlobalStyle {
263
269
  this._handleModal(e);
264
270
  }
265
271
 
266
- protected _handleModal(e: MouseEvent) {
272
+ protected _handleModal(e: MouseEvent): void {
267
273
  const modal = document.createElement("i");
268
274
  const rect = this.getBoundingClientRect();
269
275
  const h = rect.height;
@@ -278,7 +284,7 @@ class Button extends GlobalStyle {
278
284
  modal.addEventListener("animationend", () => modal.remove(), { once: true });
279
285
  }
280
286
 
281
- nextColor() {
287
+ nextColor(): Colors | "none" {
282
288
  return this.color;
283
289
  }
284
290
  }