@redvars/peacock 3.1.2 → 3.1.3

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 (346) hide show
  1. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.d.ts +0 -1
  2. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.js +0 -1
  3. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.js.map +1 -1
  4. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.d.ts +1 -1
  5. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js +1 -1
  6. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js.map +1 -1
  7. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.d.ts +1 -1
  8. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js +1 -1
  9. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js.map +1 -1
  10. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.d.ts +99 -0
  11. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.js +292 -0
  12. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.js.map +1 -0
  13. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.d.ts +1 -0
  14. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.js +2 -0
  15. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.js.map +1 -0
  16. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.d.ts +10 -0
  17. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.js +22 -0
  18. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.js.map +1 -0
  19. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.d.ts +4 -6
  20. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js +8 -25
  21. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js.map +1 -1
  22. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.d.ts +26 -0
  23. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.js +60 -0
  24. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.js.map +1 -0
  25. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.d.ts +1 -0
  26. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.js +2 -0
  27. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.js.map +1 -0
  28. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.d.ts +6 -0
  29. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.js +7 -0
  30. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.js.map +1 -0
  31. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.d.ts +1 -2
  32. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js +1 -8
  33. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js.map +1 -1
  34. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.d.ts +1 -0
  35. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.js +47 -0
  36. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.js.map +1 -0
  37. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.d.ts +27 -0
  38. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.js +31 -0
  39. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.js.map +1 -0
  40. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.d.ts +1 -0
  41. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.js +2 -0
  42. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.js.map +1 -0
  43. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.d.ts +9 -0
  44. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.js +25 -0
  45. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.js.map +1 -0
  46. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.d.ts +35 -0
  47. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.js +81 -0
  48. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.js.map +1 -0
  49. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.d.ts +1 -0
  50. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.js +2 -0
  51. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.js.map +1 -0
  52. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.d.ts +3 -2
  53. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js +4 -4
  54. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js.map +1 -1
  55. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.d.ts +4 -0
  56. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js +4 -0
  57. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js.map +1 -1
  58. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js +24 -18
  59. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js.map +1 -1
  60. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.d.ts +1 -0
  61. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.js +2 -0
  62. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.js.map +1 -0
  63. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.d.ts +9 -0
  64. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.js +125 -0
  65. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.js.map +1 -0
  66. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.d.ts +4 -0
  67. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js +22 -1
  68. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js.map +1 -1
  69. package/.rollup.cache/E/git/redvars/peacock/components/dist/tsconfig.tsbuildinfo +1 -1
  70. package/bin/typedoc-gen.mjs +3 -4
  71. package/demo/index.html +45 -41
  72. package/dist/LoaderUtils.d.ts +23 -0
  73. package/dist/LoaderUtils.d.ts.map +1 -0
  74. package/dist/assets/styles/tokens.css +21 -53
  75. package/dist/avatar/avatar.d.ts +28 -0
  76. package/dist/avatar/avatar.d.ts.map +1 -0
  77. package/dist/avatar/index.d.ts +2 -0
  78. package/dist/avatar/index.d.ts.map +1 -0
  79. package/dist/avatar/p-avatar.d.ts +4 -0
  80. package/dist/avatar/p-avatar.d.ts.map +1 -0
  81. package/dist/avatar.js +42 -40
  82. package/dist/avatar.js.map +1 -1
  83. package/dist/badge/badge.d.ts +24 -0
  84. package/dist/badge/badge.d.ts.map +1 -0
  85. package/dist/badge/index.d.ts +2 -0
  86. package/dist/badge/index.d.ts.map +1 -0
  87. package/dist/badge/p-badge.d.ts +4 -0
  88. package/dist/badge/p-badge.d.ts.map +1 -0
  89. package/dist/badge.js +37 -36
  90. package/dist/badge.js.map +1 -1
  91. package/dist/button/button.d.ts +103 -0
  92. package/dist/button/button.d.ts.map +1 -0
  93. package/dist/button/index.d.ts +2 -0
  94. package/dist/button/index.d.ts.map +1 -0
  95. package/dist/button.js +710 -0
  96. package/dist/button.js.map +1 -0
  97. package/dist/class-map-BzIzngvN.js +89 -0
  98. package/dist/class-map-BzIzngvN.js.map +1 -0
  99. package/dist/class-map-CBk4-iMN.js +11 -0
  100. package/dist/class-map-CBk4-iMN.js.map +1 -0
  101. package/dist/class-map-Cavm-B1S.js +11 -0
  102. package/dist/class-map-Cavm-B1S.js.map +1 -0
  103. package/dist/class-map-DL5vM0J2.js +11 -0
  104. package/dist/class-map-DL5vM0J2.js.map +1 -0
  105. package/dist/class-map-IbP5VjmB.js +11 -0
  106. package/dist/class-map-IbP5VjmB.js.map +1 -0
  107. package/dist/clock/ClockController.d.ts +11 -0
  108. package/dist/clock/ClockController.d.ts.map +1 -0
  109. package/dist/clock/clock.d.ts +26 -0
  110. package/dist/clock/clock.d.ts.map +1 -0
  111. package/dist/clock/index.d.ts +2 -0
  112. package/dist/clock/index.d.ts.map +1 -0
  113. package/dist/clock.js +42 -35
  114. package/dist/clock.js.map +1 -1
  115. package/dist/code-highlighter/code-highlighter.d.ts +27 -0
  116. package/dist/code-highlighter/code-highlighter.d.ts.map +1 -0
  117. package/dist/code-highlighter/index.d.ts +2 -0
  118. package/dist/code-highlighter/index.d.ts.map +1 -0
  119. package/dist/code-highlighter/local.d.ts +7 -0
  120. package/dist/code-highlighter/local.d.ts.map +1 -0
  121. package/dist/code-highlighter.js +66 -0
  122. package/dist/code-highlighter.js.map +1 -0
  123. package/dist/custom-elements-jsdocs.json +589 -34
  124. package/dist/directive-CkFJvUQK.js +45 -0
  125. package/dist/directive-CkFJvUQK.js.map +1 -0
  126. package/dist/divider/divider.d.ts +28 -0
  127. package/dist/divider/divider.d.ts.map +1 -0
  128. package/dist/divider/index.d.ts +2 -0
  129. package/dist/divider/index.d.ts.map +1 -0
  130. package/dist/divider.js +55 -61
  131. package/dist/divider.js.map +1 -1
  132. package/dist/elevation/elevation.d.ts +28 -0
  133. package/dist/elevation/elevation.d.ts.map +1 -0
  134. package/dist/elevation/index.d.ts +2 -0
  135. package/dist/elevation/index.d.ts.map +1 -0
  136. package/dist/elevation-Bl1N6qEq.js +100 -0
  137. package/dist/elevation-Bl1N6qEq.js.map +1 -0
  138. package/dist/elevation-CbF5he8B.js +103 -0
  139. package/dist/elevation-CbF5he8B.js.map +1 -0
  140. package/dist/elevation-D3F6Z1jU.js +100 -0
  141. package/dist/elevation-D3F6Z1jU.js.map +1 -0
  142. package/dist/elevation.js +77 -0
  143. package/dist/elevation.js.map +1 -0
  144. package/dist/focus-ring/FocusAttachableController.d.ts +10 -0
  145. package/dist/focus-ring/FocusAttachableController.d.ts.map +1 -0
  146. package/dist/focus-ring/focus-ring.d.ts +36 -0
  147. package/dist/focus-ring/focus-ring.d.ts.map +1 -0
  148. package/dist/focus-ring/index.d.ts +2 -0
  149. package/dist/focus-ring/index.d.ts.map +1 -0
  150. package/dist/focus-ring.js +105 -0
  151. package/dist/focus-ring.js.map +1 -0
  152. package/dist/icon/datasource.d.ts +3 -0
  153. package/dist/icon/datasource.d.ts.map +1 -0
  154. package/dist/icon/icon.d.ts +42 -0
  155. package/dist/icon/icon.d.ts.map +1 -0
  156. package/dist/icon/index.d.ts +2 -0
  157. package/dist/icon/index.d.ts.map +1 -0
  158. package/dist/icon/p-icon.d.ts +4 -0
  159. package/dist/icon/p-icon.d.ts.map +1 -0
  160. package/dist/icon.js +26 -26
  161. package/dist/icon.js.map +1 -1
  162. package/dist/index.d.ts +9 -0
  163. package/dist/index.d.ts.map +1 -0
  164. package/dist/index.js +9 -5
  165. package/dist/index.js.map +1 -1
  166. package/dist/link/link.css.d.ts +3 -0
  167. package/dist/link/link.css.d.ts.map +1 -0
  168. package/dist/lit-element-B7NX__Gq.js +2851 -0
  169. package/dist/lit-element-B7NX__Gq.js.map +1 -0
  170. package/dist/lit-element-Bq5B2QNv.js +28 -0
  171. package/dist/lit-element-Bq5B2QNv.js.map +1 -0
  172. package/dist/lit-element-CkD27PXL.js +28 -0
  173. package/dist/lit-element-CkD27PXL.js.map +1 -0
  174. package/dist/lit-element-DHH1_Q-3.js +28 -0
  175. package/dist/lit-element-DHH1_Q-3.js.map +1 -0
  176. package/dist/peacock-loader.d.ts +2 -0
  177. package/dist/peacock-loader.d.ts.map +1 -0
  178. package/dist/peacock-loader.js +465 -116
  179. package/dist/peacock-loader.js.map +1 -1
  180. package/dist/property-BXcRN0hQ.js +39 -0
  181. package/dist/property-BXcRN0hQ.js.map +1 -0
  182. package/dist/property-CR1ZrEd9.js +45 -0
  183. package/dist/property-CR1ZrEd9.js.map +1 -0
  184. package/dist/property-CqSbFxyM.js +45 -0
  185. package/dist/property-CqSbFxyM.js.map +1 -0
  186. package/dist/property-DNaigT7h.js +39 -0
  187. package/dist/property-DNaigT7h.js.map +1 -0
  188. package/dist/property-yt9tIYgR.js +39 -0
  189. package/dist/property-yt9tIYgR.js.map +1 -0
  190. package/dist/query-CV342L_h.js +189 -0
  191. package/dist/query-CV342L_h.js.map +1 -0
  192. package/dist/ripple-Blc5Rqhb.js +102 -0
  193. package/dist/ripple-Blc5Rqhb.js.map +1 -0
  194. package/dist/ripple-BqTcEQAP.js +102 -0
  195. package/dist/ripple-BqTcEQAP.js.map +1 -0
  196. package/dist/ripple-BqUjb18i.js +105 -0
  197. package/dist/ripple-BqUjb18i.js.map +1 -0
  198. package/dist/ripple-Buzs-MON.js +106 -0
  199. package/dist/ripple-Buzs-MON.js.map +1 -0
  200. package/dist/ripple-Bz5B_LoE.js +102 -0
  201. package/dist/ripple-Bz5B_LoE.js.map +1 -0
  202. package/dist/ripple-CAq7Ix6x.js +106 -0
  203. package/dist/ripple-CAq7Ix6x.js.map +1 -0
  204. package/dist/ripple-CDqSm_Vy.js +106 -0
  205. package/dist/ripple-CDqSm_Vy.js.map +1 -0
  206. package/dist/ripple-CJtPH28B.js +102 -0
  207. package/dist/ripple-CJtPH28B.js.map +1 -0
  208. package/dist/ripple-CKTd8obC.js +92 -0
  209. package/dist/ripple-CKTd8obC.js.map +1 -0
  210. package/dist/ripple-CKnDWTVQ.js +107 -0
  211. package/dist/ripple-CKnDWTVQ.js.map +1 -0
  212. package/dist/ripple-CeR8eLuc.js +93 -0
  213. package/dist/ripple-CeR8eLuc.js.map +1 -0
  214. package/dist/ripple-Czp3eR6w.js +127 -0
  215. package/dist/ripple-Czp3eR6w.js.map +1 -0
  216. package/dist/ripple-DIab1MaY.js +106 -0
  217. package/dist/ripple-DIab1MaY.js.map +1 -0
  218. package/dist/ripple-DUFMimxZ.js +120 -0
  219. package/dist/ripple-DUFMimxZ.js.map +1 -0
  220. package/dist/ripple-DVmDdoNV.js +102 -0
  221. package/dist/ripple-DVmDdoNV.js.map +1 -0
  222. package/dist/ripple-DYnhXK5d.js +118 -0
  223. package/dist/ripple-DYnhXK5d.js.map +1 -0
  224. package/dist/ripple-DnudV47f.js +102 -0
  225. package/dist/ripple-DnudV47f.js.map +1 -0
  226. package/dist/ripple-DsC-h31M.js +119 -0
  227. package/dist/ripple-DsC-h31M.js.map +1 -0
  228. package/dist/ripple-DvM0SPd9.js +128 -0
  229. package/dist/ripple-DvM0SPd9.js.map +1 -0
  230. package/dist/ripple-NWIiDgX2.js +128 -0
  231. package/dist/ripple-NWIiDgX2.js.map +1 -0
  232. package/dist/ripple-X3U_R8lT.js +106 -0
  233. package/dist/ripple-X3U_R8lT.js.map +1 -0
  234. package/dist/ripple.js +128 -0
  235. package/dist/ripple.js.map +1 -0
  236. package/dist/src/LoaderUtils.d.ts +0 -1
  237. package/dist/src/avatar/avatar.d.ts +1 -1
  238. package/dist/src/badge/badge.d.ts +1 -1
  239. package/dist/src/button/button.d.ts +99 -0
  240. package/dist/src/button/index.d.ts +1 -0
  241. package/dist/src/clock/ClockController.d.ts +10 -0
  242. package/dist/src/clock/clock.d.ts +4 -6
  243. package/dist/src/code-highlighter/code-highlighter.d.ts +26 -0
  244. package/dist/src/code-highlighter/index.d.ts +1 -0
  245. package/dist/src/code-highlighter/local.d.ts +6 -0
  246. package/dist/src/divider/divider.d.ts +1 -2
  247. package/dist/src/elevation/elevation.css.d.ts +1 -0
  248. package/dist/src/elevation/elevation.d.ts +27 -0
  249. package/dist/src/elevation/index.d.ts +1 -0
  250. package/dist/src/focus-ring/FocusAttachableController.d.ts +9 -0
  251. package/dist/src/focus-ring/focus-ring.d.ts +35 -0
  252. package/dist/src/focus-ring/index.d.ts +1 -0
  253. package/dist/src/icon/icon.d.ts +3 -2
  254. package/dist/src/index.d.ts +4 -0
  255. package/dist/src/ripple/index.d.ts +1 -0
  256. package/dist/src/ripple/ripple.d.ts +9 -0
  257. package/dist/src/utils.d.ts +4 -0
  258. package/dist/state-BXOdKkbT.js +10 -0
  259. package/dist/state-BXOdKkbT.js.map +1 -0
  260. package/dist/state-BfUul2Gq.js +10 -0
  261. package/dist/state-BfUul2Gq.js.map +1 -0
  262. package/dist/state-CNX6DhqO.js +10 -0
  263. package/dist/state-CNX6DhqO.js.map +1 -0
  264. package/dist/state-Cl3mjeR1.js +10 -0
  265. package/dist/state-Cl3mjeR1.js.map +1 -0
  266. package/dist/state-WDFgnqnd.js +36 -0
  267. package/dist/state-WDFgnqnd.js.map +1 -0
  268. package/dist/style-inject.es--nCJ9F_D.js +55 -0
  269. package/dist/style-inject.es--nCJ9F_D.js.map +1 -0
  270. package/dist/style-inject.es-tgCJW-Cu.js +29 -0
  271. package/dist/style-inject.es-tgCJW-Cu.js.map +1 -0
  272. package/dist/styleMixins.css-0Uq-6ouM.js +14 -0
  273. package/dist/styleMixins.css-0Uq-6ouM.js.map +1 -0
  274. package/dist/styleMixins.css-B8H9wDNA.js +17 -0
  275. package/dist/styleMixins.css-B8H9wDNA.js.map +1 -0
  276. package/dist/styleMixins.css-DrUsqddl.js +17 -0
  277. package/dist/styleMixins.css-DrUsqddl.js.map +1 -0
  278. package/dist/styleMixins.css-fokZCyF-.js +17 -0
  279. package/dist/styleMixins.css-fokZCyF-.js.map +1 -0
  280. package/dist/styleMixins.css.d.ts +10 -0
  281. package/dist/styleMixins.css.d.ts.map +1 -0
  282. package/dist/text/text.css.d.ts +3 -0
  283. package/dist/text/text.css.d.ts.map +1 -0
  284. package/dist/tsconfig.tsbuildinfo +1 -1
  285. package/dist/typedoc.json +340489 -0
  286. package/dist/utils-BVap5huR.js +157 -0
  287. package/dist/utils-BVap5huR.js.map +1 -0
  288. package/dist/utils-CY3RyfcA.js +157 -0
  289. package/dist/utils-CY3RyfcA.js.map +1 -0
  290. package/dist/utils-CdOdn2dW.js +149 -0
  291. package/dist/utils-CdOdn2dW.js.map +1 -0
  292. package/dist/utils-DD_cg6Ms.js +157 -0
  293. package/dist/utils-DD_cg6Ms.js.map +1 -0
  294. package/dist/utils.d.ts +8 -0
  295. package/dist/utils.d.ts.map +1 -0
  296. package/package.json +4 -2
  297. package/readme.md +1 -1
  298. package/rollup.config.js +9 -1
  299. package/scss/mixin.scss +50 -0
  300. package/src/LoaderUtils.ts +122 -122
  301. package/src/avatar/avatar.scss +38 -0
  302. package/src/avatar/avatar.ts +1 -1
  303. package/src/badge/badge.scss +31 -0
  304. package/src/badge/badge.ts +1 -1
  305. package/src/button/_button-sizes.scss +59 -0
  306. package/src/button/button.scss +430 -0
  307. package/src/button/button.ts +304 -0
  308. package/src/button/demo/index.html +42 -0
  309. package/src/button/index.ts +1 -0
  310. package/src/clock/ClockController.ts +32 -0
  311. package/src/clock/clock.scss +9 -0
  312. package/src/clock/clock.ts +39 -57
  313. package/src/code-highlighter/code-highlighter.scss +0 -0
  314. package/src/code-highlighter/code-highlighter.ts +58 -0
  315. package/src/code-highlighter/demo/index.html +58 -0
  316. package/src/code-highlighter/index.ts +1 -0
  317. package/src/code-highlighter/local.ts +11 -0
  318. package/src/divider/divider.scss +56 -0
  319. package/src/divider/divider.ts +1 -7
  320. package/src/elevation/demo/index.html +58 -0
  321. package/src/elevation/elevation.scss +61 -0
  322. package/src/elevation/elevation.ts +32 -0
  323. package/src/elevation/index.ts +1 -0
  324. package/src/focus-ring/FocusAttachableController.ts +36 -0
  325. package/src/focus-ring/demo/index.html +58 -0
  326. package/src/focus-ring/focus-ring.scss +22 -0
  327. package/src/focus-ring/focus-ring.ts +83 -0
  328. package/src/focus-ring/index.ts +1 -0
  329. package/src/icon/icon.scss +19 -0
  330. package/src/icon/icon.ts +131 -131
  331. package/src/index.ts +9 -5
  332. package/src/link/demo/index.html +34 -0
  333. package/src/link/link.scss +24 -0
  334. package/src/peacock-loader.ts +69 -64
  335. package/src/ripple/index.ts +1 -0
  336. package/src/ripple/ripple.ts +134 -0
  337. package/src/styles.d.ts +3 -1
  338. package/src/text/text.scss +48 -0
  339. package/src/utils.ts +29 -1
  340. package/tsconfig.json +23 -22
  341. package/demo/int.html +0 -31
  342. package/src/avatar/avatar.css.ts +0 -41
  343. package/src/badge/badge.css.ts +0 -34
  344. package/src/clock/clock.css.ts +0 -12
  345. package/src/divider/divider.css.ts +0 -58
  346. package/src/icon/icon.css.ts +0 -22
@@ -0,0 +1,304 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { property, query, state } from 'lit/decorators.js';
3
+ import { classMap } from 'lit/directives/class-map.js';
4
+ import styles from './button.scss';
5
+ import { observerSlotChangesWithCallback, throttle } from '../utils.js';
6
+
7
+ /**
8
+ * @label Button
9
+ * @tag p-button
10
+ * @rawTag button
11
+ *
12
+ * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.
13
+ * @overview
14
+ * <p>Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.</p>
15
+ *
16
+ * @cssprop --divider-color - Controls the color of the divider.
17
+ * @cssprop --divider-padding - Controls the padding of the divider.
18
+ *
19
+ * @example
20
+ * ```html
21
+ * <pc-button>Button</pc-button>
22
+ * ```
23
+ * @tags display
24
+ */
25
+ export class Button extends LitElement {
26
+ static override styles = [styles];
27
+
28
+ #id = crypto.randomUUID();
29
+
30
+ #tabindex?: number = 0;
31
+
32
+ @query('.button') private readonly buttonElement!: HTMLElement | null;
33
+
34
+ @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =
35
+ 'button';
36
+
37
+ /**
38
+ * The visual style of the button.
39
+ *
40
+ * Possible variant values:
41
+ * `"filled"` is a filled button.
42
+ * `"outlined"` is an outlined button.
43
+ * `"text"` is a transparent button.
44
+ * `"tonal"` is a light color button.
45
+ *
46
+ */
47
+ @property() variant:
48
+ | 'elevated'
49
+ | 'filled'
50
+ | 'tonal'
51
+ | 'outlined'
52
+ | 'text'
53
+ | 'neo' = 'filled';
54
+
55
+ /**
56
+ * Button size.
57
+ * Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
58
+ */
59
+ @property() size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';
60
+
61
+ /**
62
+ * If true, the user cannot interact with the button. Defaults to `false`.
63
+ */
64
+ @property({ reflect: true }) disabled: boolean = false;
65
+
66
+ /**
67
+ * If true, the user cannot interact with the button and the button is visually styled as disabled. But the button is still focusable. Defaults to `false`.
68
+ */
69
+ @property({ reflect: true }) softDisabled: boolean = false;
70
+
71
+ /**
72
+ * If button is disabled, the reason why it is disabled.
73
+ */
74
+ @property() disabledReason: string = '';
75
+
76
+ /**
77
+ * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
78
+ */
79
+ @property({ reflect: true }) color:
80
+ | 'primary'
81
+ | 'secondary'
82
+ | 'success'
83
+ | 'danger'
84
+ | 'warning'
85
+ | 'white'
86
+ | 'black' = 'primary';
87
+
88
+ /**
89
+ * Icon alignment.
90
+ * Possible values are `"start"`, `"end"`. Defaults to `"end"`.
91
+ */
92
+ @property() iconAlign: 'start' | 'end' = 'end';
93
+
94
+ /**
95
+ * Hyperlink to navigate to on click.
96
+ */
97
+ @property({ reflect: true }) href?: string;
98
+
99
+ @property({ reflect: true }) configAria?: { [key: string]: any };
100
+
101
+ /**
102
+ * Sets or retrieves the window or frame at which to target content.
103
+ */
104
+ @property() target: string = '_self';
105
+
106
+ @property() selected: boolean = false;
107
+
108
+ /**
109
+ * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
110
+ */
111
+ @property() throttleDelay = 200;
112
+
113
+ /**
114
+ * States
115
+ */
116
+ @state()
117
+ private isPressed = false;
118
+
119
+ @state()
120
+ private slotHasContent = false;
121
+
122
+ override focus() {
123
+ this.buttonElement?.focus();
124
+ }
125
+
126
+ override blur() {
127
+ this.buttonElement?.blur();
128
+ }
129
+
130
+ override connectedCallback() {
131
+ super.connectedCallback();
132
+ window.addEventListener('mouseup', this.__handlePress);
133
+ }
134
+
135
+ override disconnectedCallback() {
136
+ window.removeEventListener('mouseup', this.__handlePress);
137
+ super.disconnectedCallback();
138
+ }
139
+
140
+ override firstUpdated() {
141
+ this.__dispatchClickWithThrottle = throttle(
142
+ this.__dispatchClick,
143
+ this.throttleDelay,
144
+ );
145
+ observerSlotChangesWithCallback(
146
+ this.renderRoot.querySelector('slot'),
147
+ hasContent => {
148
+ this.slotHasContent = hasContent;
149
+ this.requestUpdate();
150
+ },
151
+ );
152
+ }
153
+
154
+ private __dispatchClickWithThrottle: (
155
+ event: MouseEvent | KeyboardEvent,
156
+ ) => void = event => {
157
+ this.__dispatchClick(event);
158
+ };
159
+
160
+ __dispatchClick = (event: MouseEvent | KeyboardEvent) => {
161
+ // If the button is soft-disabled or a disabled link, we need to explicitly
162
+ // prevent the click from propagating to other event listeners as well as
163
+ // prevent the default action.
164
+ if (this.softDisabled || (this.disabled && this.href)) {
165
+ event.stopImmediatePropagation();
166
+ event.preventDefault();
167
+ return;
168
+ }
169
+
170
+ this.focus();
171
+ this.dispatchEvent(
172
+ new CustomEvent('button:click', {
173
+ bubbles: true,
174
+ composed: true,
175
+ }),
176
+ );
177
+ };
178
+
179
+ __renderDisabledReason() {
180
+ if (this.disabled && this.disabledReason)
181
+ return html`<div
182
+ id="disabled-reason-${this.#id}"
183
+ role="tooltip"
184
+ aria-label=${this.disabledReason}
185
+ class="sr-only"
186
+ >
187
+ {this.disabledReason}
188
+ </div>`;
189
+ return null;
190
+ }
191
+
192
+ __handlePress = (event: KeyboardEvent | MouseEvent) => {
193
+ if (
194
+ event instanceof KeyboardEvent &&
195
+ event.type === 'keydown' &&
196
+ (event.key === 'Enter' || event.key === ' ')
197
+ ) {
198
+ this.isPressed = true;
199
+ } else if (event.type === 'mousedown') {
200
+ this.isPressed = true;
201
+ } else {
202
+ this.isPressed = false;
203
+ }
204
+ };
205
+
206
+ /* @ts-ignore */
207
+ private __isLink() {
208
+ return !!this.href;
209
+ }
210
+
211
+ override render() {
212
+ const isLink = this.__isLink();
213
+ const { variant, subVariant } = this.getVariant();
214
+
215
+ const cssClasses = {
216
+ button: true,
217
+ 'button-element': true,
218
+ [`size-${this.size}`]: true,
219
+ [`variant-${variant}`]: true,
220
+ [`variant-${subVariant}`]: !!subVariant,
221
+ [`color-${this.color}`]: true,
222
+ disabled: this.disabled || this.softDisabled,
223
+ pressed: this.isPressed,
224
+ 'has-content': this.slotHasContent,
225
+ };
226
+
227
+ if (!isLink) {
228
+ return html`<button
229
+ class=${classMap(cssClasses)}
230
+ tabindex=${this.#tabindex}
231
+ type=${this.htmlType}
232
+ @click=${this.__dispatchClickWithThrottle}
233
+ @mousedown=${this.__handlePress}
234
+ @keydown=${this.__handlePress}
235
+ @keyup=${this.__handlePress}
236
+ ?aria-describedby=${(this.disabled || this.softDisabled) &&
237
+ this.disabledReason
238
+ ? `disabled-reason-${this.#id}`
239
+ : null}
240
+ aria-disabled=${`${this.disabled || this.softDisabled}`}
241
+ ?disabled=${this.disabled}
242
+ >
243
+ ${this.renderButtonContent()}
244
+ </button>`;
245
+ }
246
+ return html`<a
247
+ class=${classMap(cssClasses)}
248
+ tabindex=${this.#tabindex}
249
+ href=${this.href}
250
+ target=${this.target}
251
+ @click=${this.__dispatchClickWithThrottle}
252
+ @mousedown=${this.__handlePress}
253
+ @keydown=${this.__handlePress}
254
+ @keyup=${this.__handlePress}
255
+ role="button"
256
+ aria-describedby=${this.disabled && this.disabledReason
257
+ ? `disabled-reason-${this.#id}`
258
+ : null}
259
+ aria-disabled=${`${this.disabled}`}
260
+ >
261
+ <div class="icon">
262
+ <slot name="icon"></slot>
263
+ </div>
264
+
265
+ <div class="slot-container">
266
+ <slot></slot>
267
+ </div>
268
+ </a>`;
269
+ }
270
+
271
+ getVariant() {
272
+ const variants = this.variant?.split('.');
273
+ if (!['filled', 'outlined', 'text', 'tonal', 'neo'].includes(variants[0])) {
274
+ variants.unshift('filled');
275
+ }
276
+ const [variant, subVariant] = variants as [string, string?];
277
+ return { variant, subVariant };
278
+ }
279
+
280
+ renderButtonContent() {
281
+ return html`
282
+ <p-focus-ring class="focus-ring" .control=${this}></p-focus-ring>
283
+ <p-elevation class="elevation"></p-elevation>
284
+ <div class="neo-background"></div>
285
+ <div class="background"></div>
286
+ <div class="outline"></div>
287
+ <p-ripple class="ripple"></p-ripple>
288
+
289
+ <div class="button-content">
290
+ ${this.iconAlign === 'start'
291
+ ? html`<slot name="icon"></slot></div>`
292
+ : null}
293
+
294
+ <div class="slot-container">
295
+ <slot></slot>
296
+ </div>
297
+
298
+ ${this.iconAlign === 'end' ? html`<slot name="icon"></slot>` : null}
299
+ </div>
300
+
301
+ ${this.__renderDisabledReason()}
302
+ `;
303
+ }
304
+ }
@@ -0,0 +1,42 @@
1
+ <!doctype html>
2
+ <html lang='en-GB'>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <link rel='stylesheet' href='/dist/assets/styles/tokens.css' />
6
+ <meta name='viewport' content='width=device-width, initial-scale=1.0, viewport-fit=cover' />
7
+ <link rel='stylesheet' href='/dist/assets/styles/tokens.css' />
8
+ <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
9
+
10
+ <style>
11
+ body {
12
+ background: #fafafa;
13
+ }
14
+ </style>
15
+ </head>
16
+ <body>
17
+
18
+ <a href='#'>Back</a>
19
+
20
+ <p-button>Click</p-button>
21
+
22
+ <p-button variant='elevated' iconAlign='start'><p-icon slot='icon' name='home'></p-icon> Click</p-button>
23
+
24
+ <p-button variant='tonal'>Click</p-button>
25
+
26
+ <p-button variant='outlined'>Click</p-button>
27
+
28
+ <p-button variant='text'>Click</p-button>
29
+
30
+ <p-button variant='neo'>Click</p-button>
31
+
32
+
33
+ <script type='module'>
34
+ import { Button, Elevation, FocusRing, Ripple, Icon } from '/dist/index.js';
35
+ window.customElements.define('p-button', Button);
36
+ window.customElements.define('p-elevation', Elevation);
37
+ window.customElements.define('p-focus-ring', FocusRing);
38
+ window.customElements.define('p-ripple', Ripple);
39
+ window.customElements.define('p-icon', Icon);
40
+ </script>
41
+ </body>
42
+ </html>
@@ -0,0 +1 @@
1
+ export { Button } from './button.js';
@@ -0,0 +1,32 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+
3
+ export class ClockController implements ReactiveController {
4
+ host: ReactiveControllerHost;
5
+
6
+ value = new Date();
7
+
8
+ timeout: number;
9
+
10
+ private _timerID?: any;
11
+
12
+ constructor(host: ReactiveControllerHost, timeout = 1000) {
13
+ this.host = host;
14
+ this.host.addController(this);
15
+ this.timeout = timeout;
16
+ }
17
+
18
+ hostConnected() {
19
+ // Start a timer when the host is connected
20
+ this._timerID = setInterval(() => {
21
+ this.value = new Date();
22
+ // Update the host with new value
23
+ this.host.requestUpdate();
24
+ }, this.timeout);
25
+ }
26
+
27
+ hostDisconnected() {
28
+ // Clear the timer when the host is disconnected
29
+ clearInterval(this._timerID);
30
+ this._timerID = undefined;
31
+ }
32
+ }
@@ -0,0 +1,9 @@
1
+ @use '../../scss/mixin';
2
+
3
+ :host {
4
+ display: inline-block;
5
+ }
6
+
7
+ .current-time {
8
+ @include mixin.get-typography('body-medium')
9
+ }
@@ -1,57 +1,39 @@
1
- import { html, LitElement } from 'lit';
2
- import { property, state } from 'lit/decorators.js';
3
- import { styles } from './clock.css.js';
4
-
5
- /**
6
- * @label Clock
7
- * @tag p-clock
8
- * @rawTag clock
9
- *
10
- * @summary Displays the current time in a given timezone.
11
- * @overview
12
- * - Clocks are used to display the current time in a specified timezone.
13
- * - They can be displayed in various formats, including 12-hour and 24-hour time.
14
- *
15
- * @example
16
- * ```html
17
- * <p-clock></p-clock>
18
- * ```
19
- * @tags display
20
- */
21
- export class Clock extends LitElement {
22
- static styles = [styles];
23
-
24
- @property() timezone?: string;
25
-
26
- // `currentTime` is decorated with `@State()`,
27
- // as we need to trigger a rerender when its
28
- // value changes to show the latest time
29
- @state() currentTime: string = '';
30
-
31
- private _timerId: any;
32
-
33
- connectedCallback() {
34
- super.connectedCallback();
35
- this.__updateCurrentTime();
36
- this._timerId = setInterval(() => {
37
- this.__updateCurrentTime();
38
- }, 1000);
39
- }
40
-
41
- disconnectedCallback() {
42
- if (this._timerId) {
43
- clearInterval(this._timerId);
44
- }
45
- super.disconnectedCallback();
46
- }
47
-
48
- __updateCurrentTime() {
49
- this.currentTime = new Date().toLocaleTimeString('en-US', {
50
- timeZone: this.timezone,
51
- });
52
- }
53
-
54
- render() {
55
- return html`<div class="current-time">${this.currentTime}</div>`;
56
- }
57
- }
1
+ import { html, LitElement } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import styles from './clock.scss';
4
+ import { ClockController } from './ClockController.js';
5
+
6
+ /**
7
+ * @label Clock
8
+ * @tag p-clock
9
+ * @rawTag clock
10
+ *
11
+ * @summary Displays the current time in a given timezone.
12
+ * @overview
13
+ * - Clocks are used to display the current time in a specified timezone.
14
+ * - They can be displayed in various formats, including 12-hour and 24-hour time.
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <p-clock></p-clock>
19
+ * ```
20
+ * @tags display
21
+ */
22
+ export class Clock extends LitElement {
23
+ static styles = [styles];
24
+
25
+ clockController = new ClockController(this, 100);
26
+
27
+ @property() timezone?: string;
28
+
29
+ __formatDate(date: Date) {
30
+ return date.toLocaleTimeString('en-US', {
31
+ timeZone: this.timezone,
32
+ });
33
+ }
34
+
35
+ render() {
36
+ const currentDate = this.__formatDate(this.clockController.value);
37
+ return html`<div class="current-time">${currentDate}</div>`;
38
+ }
39
+ }
File without changes
@@ -0,0 +1,58 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { property, state } from 'lit/decorators.js';
3
+ import { classMap } from 'lit/directives/class-map.js';
4
+ import styles from './code-highlighter.scss';
5
+ import { observerSlotChangesWithCallback } from '../utils.js';
6
+
7
+ /**
8
+ * @label Code Highlighter
9
+ * @tag p-code-highlighter
10
+ * @rawTag code-highlighter
11
+ *
12
+ * @summary The code highlighter component is used to display code snippets with syntax highlighting.
13
+ * @overview
14
+ * <p>The <strong>Code Highlighter</strong> component allows you to display code snippets with syntax highlighting for various programming languages. It supports features like line numbers, code formatting, and a copy-to-clipboard button.</p>
15
+ *
16
+ * @cssprop --divider-color - Controls the color of the divider.
17
+ * @cssprop --divider-padding - Controls the padding of the divider.
18
+ *
19
+ * @example
20
+ * ```html
21
+ * <p-divider style="width: 12rem;">or</p-divider>
22
+ * ```
23
+ * @tags display
24
+ */
25
+ export class CodeHighlighter extends LitElement {
26
+ static styles = [styles];
27
+
28
+ @property({ type: Boolean, reflect: true }) vertical = false;
29
+
30
+ @state()
31
+ slotHasContent = false;
32
+
33
+ firstUpdated() {
34
+ observerSlotChangesWithCallback(
35
+ this.renderRoot.querySelector('slot'),
36
+ hasContent => {
37
+ this.slotHasContent = hasContent;
38
+ this.requestUpdate();
39
+ },
40
+ );
41
+ }
42
+
43
+ render() {
44
+ return html`<div
45
+ class=${classMap({
46
+ divider: true,
47
+ vertical: this.vertical,
48
+ 'slot-has-content': this.slotHasContent,
49
+ })}
50
+ >
51
+ <div class="line"></div>
52
+ <div class="slot-container">
53
+ <slot></slot>
54
+ </div>
55
+ <div class="line"></div>
56
+ </div>`;
57
+ }
58
+ }
@@ -0,0 +1,58 @@
1
+ <!doctype html>
2
+ <html lang='en-GB'>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <meta name='viewport' content='width=device-width, initial-scale=1.0, viewport-fit=cover' />
6
+ <link rel='stylesheet' href='/dist/assets/styles/tokens.css' />
7
+ <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
8
+
9
+ <style>
10
+ body {
11
+ background: #fafafa;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+
17
+
18
+ <style>
19
+ .container-horizontal {
20
+ display: inline-block;
21
+ margin-right: 1rem;
22
+ padding: 1rem;
23
+ width: 200px;
24
+ border: 1px solid var(--color-outline);
25
+ }
26
+
27
+ .container-vertical {
28
+ display: flex;
29
+ height: 150px;
30
+ margin-bottom: 1rem;
31
+ padding: 1rem;
32
+ width: 250px;
33
+ border: 1px solid var(--color-outline);
34
+ }
35
+ </style>
36
+
37
+
38
+
39
+ <div class="container-horizontal">
40
+ <p>Content A</p>
41
+ <p-divider>or</p-divider>
42
+ <p>Content B</p>
43
+ </div>
44
+
45
+ <div class="container-vertical">
46
+ <p>Content A</p>
47
+ <p-divider vertical="true">or</p-divider>
48
+ <p>Content B</p>
49
+ </div>
50
+
51
+
52
+
53
+ <script type='module'>
54
+ import { Divider } from '/dist/index.js';
55
+ window.customElements.define('p-divider', Divider);
56
+ </script>
57
+ </body>
58
+ </html>
@@ -0,0 +1 @@
1
+ export { CodeHighlighter } from './code-highlighter.js';
@@ -0,0 +1,11 @@
1
+ export const locale: {
2
+ loading: string;
3
+ copyToClipboard: string;
4
+ copied: string;
5
+ copiedCode: string;
6
+ } = {
7
+ loading: 'Loading code...',
8
+ copyToClipboard: 'Copy to clipboard',
9
+ copied: 'Copied',
10
+ copiedCode: 'Copied code',
11
+ };
@@ -0,0 +1,56 @@
1
+ @use '../../scss/mixin';
2
+
3
+ :host {
4
+ display: block;
5
+
6
+ --divider-color: var(--color-outline-variant);
7
+ --divider-padding: var(--spacing-200);
8
+ }
9
+
10
+ .divider {
11
+ display: flex;
12
+ margin: 0;
13
+ @include mixin.get-typography(body-small-emphasized);
14
+ color: var(--divider-color);
15
+
16
+ &:not(.vertical) {
17
+ width: 100%;
18
+ padding: var(--divider-padding) 0;
19
+ align-items: center;
20
+ justify-content: center;
21
+
22
+ .line {
23
+ width: 100%;
24
+ border-top: 1px solid var(--divider-color);
25
+ }
26
+
27
+ &.slot-has-content .slot-container {
28
+ padding: 0 var(--spacing-200);
29
+ }
30
+ }
31
+
32
+ &.vertical {
33
+ height: 100%;
34
+ padding: 0 var(--divider-padding);
35
+ flex-direction: column;
36
+ align-items: center;
37
+ justify-content: center;
38
+
39
+ .line {
40
+ height: 100%;
41
+ border-right: 1px solid var(--divider-color);
42
+ }
43
+
44
+ &.slot-has-content .slot-container {
45
+ padding: var(--spacing-200) 0;
46
+ }
47
+ }
48
+ }
49
+
50
+ :host(:not([vertical])) {
51
+ width: auto;
52
+ }
53
+
54
+ :host([vertical]) {
55
+ height: auto;
56
+ }