@redvars/peacock 3.1.1 → 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.
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.d.ts +0 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.js +0 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/LoaderUtils.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.css.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.d.ts +20 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js +20 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.d.ts +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js +5 -4
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.d.ts +16 -2
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js +28 -11
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.d.ts +0 -5
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js +0 -5
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.d.ts +99 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.js +292 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/button.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/button/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.d.ts +10 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.js +22 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/ClockController.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.js +12 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.d.ts +25 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js +41 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.d.ts +26 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.js +60 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.d.ts +6 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.js +7 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/local.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.js +58 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.d.ts +27 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js +61 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.js +47 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.d.ts +27 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.js +31 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/elevation.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/elevation/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.d.ts +9 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.js +25 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/FocusAttachableController.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.d.ts +35 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.js +81 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/focus-ring.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/focus-ring/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.d.ts +23 -2
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js +20 -4
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.d.ts +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.d.ts +6 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js +6 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js +35 -19
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.d.ts +9 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.js +125 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/ripple/ripple.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.d.ts +5 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js +54 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/tsconfig.tsbuildinfo +1 -1
- package/bin/typedoc-gen.mjs +63 -0
- package/custom-elements-manifest.config.mjs +5 -6
- package/demo/index.html +45 -42
- package/dist/LoaderUtils.d.ts +23 -0
- package/dist/LoaderUtils.d.ts.map +1 -0
- package/dist/assets/styles/tokens.css +21 -53
- package/dist/avatar/avatar.d.ts +28 -0
- package/dist/avatar/avatar.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/p-avatar.d.ts +4 -0
- package/dist/avatar/p-avatar.d.ts.map +1 -0
- package/dist/avatar.js +100 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge/badge.d.ts +24 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/badge/p-badge.d.ts +4 -0
- package/dist/badge/p-badge.d.ts.map +1 -0
- package/dist/badge.js +90 -0
- package/dist/badge.js.map +1 -0
- package/dist/button/button.d.ts +103 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button.js +710 -0
- package/dist/button.js.map +1 -0
- package/dist/class-map-BzIzngvN.js +89 -0
- package/dist/class-map-BzIzngvN.js.map +1 -0
- package/dist/class-map-CBk4-iMN.js +11 -0
- package/dist/class-map-CBk4-iMN.js.map +1 -0
- package/dist/class-map-Cavm-B1S.js +11 -0
- package/dist/class-map-Cavm-B1S.js.map +1 -0
- package/dist/class-map-DL5vM0J2.js +11 -0
- package/dist/class-map-DL5vM0J2.js.map +1 -0
- package/dist/class-map-DpvLRi0h.js +11 -0
- package/dist/class-map-DpvLRi0h.js.map +1 -0
- package/dist/class-map-IbP5VjmB.js +11 -0
- package/dist/class-map-IbP5VjmB.js.map +1 -0
- package/dist/clock/ClockController.d.ts +11 -0
- package/dist/clock/ClockController.d.ts.map +1 -0
- package/dist/clock/clock.d.ts +26 -0
- package/dist/clock/clock.d.ts.map +1 -0
- package/dist/clock/index.d.ts +2 -0
- package/dist/clock/index.d.ts.map +1 -0
- package/dist/clock.js +77 -0
- package/dist/clock.js.map +1 -0
- package/dist/code-highlighter/code-highlighter.d.ts +27 -0
- package/dist/code-highlighter/code-highlighter.d.ts.map +1 -0
- package/dist/code-highlighter/index.d.ts +2 -0
- package/dist/code-highlighter/index.d.ts.map +1 -0
- package/dist/code-highlighter/local.d.ts +7 -0
- package/dist/code-highlighter/local.d.ts.map +1 -0
- package/dist/code-highlighter.js +66 -0
- package/dist/code-highlighter.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +1211 -0
- package/dist/directive-BKuZRRPO.js +9 -0
- package/dist/directive-BKuZRRPO.js.map +1 -0
- package/dist/directive-CkFJvUQK.js +45 -0
- package/dist/directive-CkFJvUQK.js.map +1 -0
- package/dist/divider/divider.d.ts +28 -0
- package/dist/divider/divider.d.ts.map +1 -0
- package/dist/divider/index.d.ts +2 -0
- package/dist/divider/index.d.ts.map +1 -0
- package/dist/divider.js +117 -0
- package/dist/divider.js.map +1 -0
- package/dist/elevation/elevation.d.ts +28 -0
- package/dist/elevation/elevation.d.ts.map +1 -0
- package/dist/elevation/index.d.ts +2 -0
- package/dist/elevation/index.d.ts.map +1 -0
- package/dist/elevation-Bl1N6qEq.js +100 -0
- package/dist/elevation-Bl1N6qEq.js.map +1 -0
- package/dist/elevation-CbF5he8B.js +103 -0
- package/dist/elevation-CbF5he8B.js.map +1 -0
- package/dist/elevation-D3F6Z1jU.js +100 -0
- package/dist/elevation-D3F6Z1jU.js.map +1 -0
- package/dist/elevation.js +77 -0
- package/dist/elevation.js.map +1 -0
- package/dist/focus-ring/FocusAttachableController.d.ts +10 -0
- package/dist/focus-ring/FocusAttachableController.d.ts.map +1 -0
- package/dist/focus-ring/focus-ring.d.ts +36 -0
- package/dist/focus-ring/focus-ring.d.ts.map +1 -0
- package/dist/focus-ring/index.d.ts +2 -0
- package/dist/focus-ring/index.d.ts.map +1 -0
- package/dist/focus-ring.js +105 -0
- package/dist/focus-ring.js.map +1 -0
- package/dist/icon/datasource.d.ts +3 -0
- package/dist/icon/datasource.d.ts.map +1 -0
- package/dist/icon/icon.d.ts +42 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/p-icon.d.ts +4 -0
- package/dist/icon/p-icon.d.ts.map +1 -0
- package/dist/{component/icon.js → icon.js} +43 -124
- package/dist/icon.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -67
- package/dist/index.js.map +1 -1
- package/dist/link/link.css.d.ts +3 -0
- package/dist/link/link.css.d.ts.map +1 -0
- package/dist/lit-element-B7NX__Gq.js +2851 -0
- package/dist/lit-element-B7NX__Gq.js.map +1 -0
- package/dist/lit-element-Bq5B2QNv.js +28 -0
- package/dist/lit-element-Bq5B2QNv.js.map +1 -0
- package/dist/lit-element-CkD27PXL.js +28 -0
- package/dist/lit-element-CkD27PXL.js.map +1 -0
- package/dist/lit-element-DHH1_Q-3.js +28 -0
- package/dist/lit-element-DHH1_Q-3.js.map +1 -0
- package/dist/peacock-loader.d.ts +2 -0
- package/dist/peacock-loader.d.ts.map +1 -0
- package/dist/peacock-loader.js +479 -121
- package/dist/peacock-loader.js.map +1 -1
- package/dist/property-BXcRN0hQ.js +39 -0
- package/dist/property-BXcRN0hQ.js.map +1 -0
- package/dist/property-CR1ZrEd9.js +45 -0
- package/dist/property-CR1ZrEd9.js.map +1 -0
- package/dist/property-CqSbFxyM.js +45 -0
- package/dist/property-CqSbFxyM.js.map +1 -0
- package/dist/{directive-CKEA2P55.js → property-D4Kn9TsY.js} +6 -13
- package/dist/property-D4Kn9TsY.js.map +1 -0
- package/dist/property-DNaigT7h.js +39 -0
- package/dist/property-DNaigT7h.js.map +1 -0
- package/dist/property-yt9tIYgR.js +39 -0
- package/dist/property-yt9tIYgR.js.map +1 -0
- package/dist/query-CV342L_h.js +189 -0
- package/dist/query-CV342L_h.js.map +1 -0
- package/dist/ripple-Blc5Rqhb.js +102 -0
- package/dist/ripple-Blc5Rqhb.js.map +1 -0
- package/dist/ripple-BqTcEQAP.js +102 -0
- package/dist/ripple-BqTcEQAP.js.map +1 -0
- package/dist/ripple-BqUjb18i.js +105 -0
- package/dist/ripple-BqUjb18i.js.map +1 -0
- package/dist/ripple-Buzs-MON.js +106 -0
- package/dist/ripple-Buzs-MON.js.map +1 -0
- package/dist/ripple-Bz5B_LoE.js +102 -0
- package/dist/ripple-Bz5B_LoE.js.map +1 -0
- package/dist/ripple-CAq7Ix6x.js +106 -0
- package/dist/ripple-CAq7Ix6x.js.map +1 -0
- package/dist/ripple-CDqSm_Vy.js +106 -0
- package/dist/ripple-CDqSm_Vy.js.map +1 -0
- package/dist/ripple-CJtPH28B.js +102 -0
- package/dist/ripple-CJtPH28B.js.map +1 -0
- package/dist/ripple-CKTd8obC.js +92 -0
- package/dist/ripple-CKTd8obC.js.map +1 -0
- package/dist/ripple-CKnDWTVQ.js +107 -0
- package/dist/ripple-CKnDWTVQ.js.map +1 -0
- package/dist/ripple-CeR8eLuc.js +93 -0
- package/dist/ripple-CeR8eLuc.js.map +1 -0
- package/dist/ripple-Czp3eR6w.js +127 -0
- package/dist/ripple-Czp3eR6w.js.map +1 -0
- package/dist/ripple-DIab1MaY.js +106 -0
- package/dist/ripple-DIab1MaY.js.map +1 -0
- package/dist/ripple-DUFMimxZ.js +120 -0
- package/dist/ripple-DUFMimxZ.js.map +1 -0
- package/dist/ripple-DVmDdoNV.js +102 -0
- package/dist/ripple-DVmDdoNV.js.map +1 -0
- package/dist/ripple-DYnhXK5d.js +118 -0
- package/dist/ripple-DYnhXK5d.js.map +1 -0
- package/dist/ripple-DnudV47f.js +102 -0
- package/dist/ripple-DnudV47f.js.map +1 -0
- package/dist/ripple-DsC-h31M.js +119 -0
- package/dist/ripple-DsC-h31M.js.map +1 -0
- package/dist/ripple-DvM0SPd9.js +128 -0
- package/dist/ripple-DvM0SPd9.js.map +1 -0
- package/dist/ripple-NWIiDgX2.js +128 -0
- package/dist/ripple-NWIiDgX2.js.map +1 -0
- package/dist/ripple-X3U_R8lT.js +106 -0
- package/dist/ripple-X3U_R8lT.js.map +1 -0
- package/dist/ripple.js +128 -0
- package/dist/ripple.js.map +1 -0
- package/dist/src/LoaderUtils.d.ts +0 -1
- package/dist/src/avatar/avatar.d.ts +20 -1
- package/dist/src/avatar/p-avatar.d.ts +0 -7
- package/dist/src/badge/badge.d.ts +16 -2
- package/dist/src/badge/p-badge.d.ts +0 -5
- package/dist/src/button/button.d.ts +99 -0
- package/dist/src/button/index.d.ts +1 -0
- package/dist/src/clock/ClockController.d.ts +10 -0
- package/dist/src/clock/clock.css.d.ts +1 -0
- package/dist/src/clock/clock.d.ts +25 -0
- package/dist/src/clock/index.d.ts +1 -0
- package/dist/src/code-highlighter/code-highlighter.d.ts +26 -0
- package/dist/src/code-highlighter/index.d.ts +1 -0
- package/dist/src/code-highlighter/local.d.ts +6 -0
- package/dist/src/divider/divider.css.d.ts +1 -0
- package/dist/src/divider/divider.d.ts +27 -0
- package/dist/src/divider/index.d.ts +1 -0
- package/dist/src/elevation/elevation.css.d.ts +1 -0
- package/dist/src/elevation/elevation.d.ts +27 -0
- package/dist/src/elevation/index.d.ts +1 -0
- package/dist/src/focus-ring/FocusAttachableController.d.ts +9 -0
- package/dist/src/focus-ring/focus-ring.d.ts +35 -0
- package/dist/src/focus-ring/index.d.ts +1 -0
- package/dist/src/icon/icon.d.ts +23 -2
- package/dist/src/icon/p-icon.d.ts +0 -7
- package/dist/src/index.d.ts +6 -0
- package/dist/src/ripple/index.d.ts +1 -0
- package/dist/src/ripple/ripple.d.ts +9 -0
- package/dist/src/utils.d.ts +5 -0
- package/dist/state-BXOdKkbT.js +10 -0
- package/dist/state-BXOdKkbT.js.map +1 -0
- package/dist/state-BfUul2Gq.js +10 -0
- package/dist/state-BfUul2Gq.js.map +1 -0
- package/dist/state-CNX6DhqO.js +10 -0
- package/dist/state-CNX6DhqO.js.map +1 -0
- package/dist/state-Cl3mjeR1.js +10 -0
- package/dist/state-Cl3mjeR1.js.map +1 -0
- package/dist/state-CxzmLNIi.js +10 -0
- package/dist/state-CxzmLNIi.js.map +1 -0
- package/dist/state-WDFgnqnd.js +36 -0
- package/dist/state-WDFgnqnd.js.map +1 -0
- package/dist/style-inject.es--nCJ9F_D.js +55 -0
- package/dist/style-inject.es--nCJ9F_D.js.map +1 -0
- package/dist/style-inject.es-tgCJW-Cu.js +29 -0
- package/dist/style-inject.es-tgCJW-Cu.js.map +1 -0
- package/dist/styleMixins.css-0Uq-6ouM.js +14 -0
- package/dist/styleMixins.css-0Uq-6ouM.js.map +1 -0
- package/dist/styleMixins.css-B8H9wDNA.js +17 -0
- package/dist/styleMixins.css-B8H9wDNA.js.map +1 -0
- package/dist/styleMixins.css-CivfMYtB.js +17 -0
- package/dist/styleMixins.css-CivfMYtB.js.map +1 -0
- package/dist/styleMixins.css-DrUsqddl.js +17 -0
- package/dist/styleMixins.css-DrUsqddl.js.map +1 -0
- package/dist/styleMixins.css-fokZCyF-.js +17 -0
- package/dist/styleMixins.css-fokZCyF-.js.map +1 -0
- package/dist/styleMixins.css.d.ts +10 -0
- package/dist/styleMixins.css.d.ts.map +1 -0
- package/dist/text/text.css.d.ts +3 -0
- package/dist/text/text.css.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typedoc.json +340489 -0
- package/dist/utils-BVap5huR.js +157 -0
- package/dist/utils-BVap5huR.js.map +1 -0
- package/dist/utils-CY3RyfcA.js +157 -0
- package/dist/utils-CY3RyfcA.js.map +1 -0
- package/dist/utils-CdOdn2dW.js +149 -0
- package/dist/utils-CdOdn2dW.js.map +1 -0
- package/dist/utils-DD_cg6Ms.js +157 -0
- package/dist/utils-DD_cg6Ms.js.map +1 -0
- package/dist/utils-_5no4mk7.js +128 -0
- package/dist/utils-_5no4mk7.js.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +11 -9
- package/readme.md +5 -17
- package/rollup.config.js +79 -37
- package/scratch.mjs +0 -0
- package/scss/mixin.scss +50 -0
- package/src/LoaderUtils.ts +122 -122
- package/src/avatar/avatar.scss +38 -0
- package/src/avatar/avatar.ts +20 -1
- package/src/avatar/p-avatar.ts +0 -7
- package/src/badge/badge.scss +31 -0
- package/src/badge/badge.ts +31 -9
- package/src/badge/demo/index.html +9 -1
- package/src/badge/p-badge.ts +0 -5
- package/src/button/_button-sizes.scss +59 -0
- package/src/button/button.scss +430 -0
- package/src/button/button.ts +304 -0
- package/src/button/demo/index.html +42 -0
- package/src/button/index.ts +1 -0
- package/src/clock/ClockController.ts +32 -0
- package/src/clock/clock.scss +9 -0
- package/src/clock/clock.ts +39 -0
- package/{demo/int.html → src/clock/demo/index.html} +7 -10
- package/src/clock/index.ts +1 -0
- package/src/code-highlighter/code-highlighter.scss +0 -0
- package/src/code-highlighter/code-highlighter.ts +58 -0
- package/src/code-highlighter/demo/index.html +58 -0
- package/src/code-highlighter/index.ts +1 -0
- package/src/code-highlighter/local.ts +11 -0
- package/src/divider/demo/index.html +58 -0
- package/src/divider/divider.scss +56 -0
- package/src/divider/divider.ts +59 -0
- package/src/divider/index.ts +1 -0
- package/src/elevation/demo/index.html +58 -0
- package/src/elevation/elevation.scss +61 -0
- package/src/elevation/elevation.ts +32 -0
- package/src/elevation/index.ts +1 -0
- package/src/focus-ring/FocusAttachableController.ts +36 -0
- package/src/focus-ring/demo/index.html +58 -0
- package/src/focus-ring/focus-ring.scss +22 -0
- package/src/focus-ring/focus-ring.ts +83 -0
- package/src/focus-ring/index.ts +1 -0
- package/src/icon/icon.scss +19 -0
- package/src/icon/icon.ts +131 -111
- package/src/icon/p-icon.ts +0 -7
- package/src/index.ts +9 -3
- package/src/link/demo/index.html +34 -0
- package/src/link/link.scss +24 -0
- package/src/peacock-loader.ts +69 -55
- package/src/ripple/index.ts +1 -0
- package/src/ripple/ripple.ts +134 -0
- package/src/styles.d.ts +3 -1
- package/src/text/text.scss +48 -0
- package/src/utils.ts +72 -1
- package/tsconfig.json +23 -22
- package/assets/tokens.css +0 -522
- package/copyDesignFiles.js +0 -11
- package/custom-elements.md +0 -192
- package/dist/avatar-GQwWRGRw.js +0 -418
- package/dist/avatar-GQwWRGRw.js.map +0 -1
- package/dist/avatar-jfcIDB8G.js +0 -424
- package/dist/avatar-jfcIDB8G.js.map +0 -1
- package/dist/component/avatar.js +0 -92
- package/dist/component/avatar.js.map +0 -1
- package/dist/component/icon.js.map +0 -1
- package/dist/directive-CKEA2P55.js.map +0 -1
- package/dist/utils-CSwoJIcG.js +0 -171
- package/dist/utils-CSwoJIcG.js.map +0 -1
- package/dist/web-types.json +0 -78
- package/readme-gen.mjs +0 -24
- package/src/avatar/avatar.css.ts +0 -41
- package/src/badge/badge.css.ts +0 -33
- package/src/icon/icon.css.ts +0 -22
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
var _Button_id, _Button_tabindex;
|
|
2
|
+
import { __classPrivateFieldGet, __decorate } from "tslib";
|
|
3
|
+
import { html, LitElement } from 'lit';
|
|
4
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import styles from './button.scss';
|
|
7
|
+
import { observerSlotChangesWithCallback, throttle } from '../utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* @label Button
|
|
10
|
+
* @tag p-button
|
|
11
|
+
* @rawTag button
|
|
12
|
+
*
|
|
13
|
+
* @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.
|
|
14
|
+
* @overview
|
|
15
|
+
* <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>
|
|
16
|
+
*
|
|
17
|
+
* @cssprop --divider-color - Controls the color of the divider.
|
|
18
|
+
* @cssprop --divider-padding - Controls the padding of the divider.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <pc-button>Button</pc-button>
|
|
23
|
+
* ```
|
|
24
|
+
* @tags display
|
|
25
|
+
*/
|
|
26
|
+
export class Button extends LitElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
_Button_id.set(this, crypto.randomUUID());
|
|
30
|
+
_Button_tabindex.set(this, 0);
|
|
31
|
+
this.htmlType = 'button';
|
|
32
|
+
/**
|
|
33
|
+
* The visual style of the button.
|
|
34
|
+
*
|
|
35
|
+
* Possible variant values:
|
|
36
|
+
* `"filled"` is a filled button.
|
|
37
|
+
* `"outlined"` is an outlined button.
|
|
38
|
+
* `"text"` is a transparent button.
|
|
39
|
+
* `"tonal"` is a light color button.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
this.variant = 'filled';
|
|
43
|
+
/**
|
|
44
|
+
* Button size.
|
|
45
|
+
* Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
|
|
46
|
+
*/
|
|
47
|
+
this.size = 'sm';
|
|
48
|
+
/**
|
|
49
|
+
* If true, the user cannot interact with the button. Defaults to `false`.
|
|
50
|
+
*/
|
|
51
|
+
this.disabled = false;
|
|
52
|
+
/**
|
|
53
|
+
* 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`.
|
|
54
|
+
*/
|
|
55
|
+
this.softDisabled = false;
|
|
56
|
+
/**
|
|
57
|
+
* If button is disabled, the reason why it is disabled.
|
|
58
|
+
*/
|
|
59
|
+
this.disabledReason = '';
|
|
60
|
+
/**
|
|
61
|
+
* Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
|
|
62
|
+
*/
|
|
63
|
+
this.color = 'primary';
|
|
64
|
+
/**
|
|
65
|
+
* Icon alignment.
|
|
66
|
+
* Possible values are `"start"`, `"end"`. Defaults to `"end"`.
|
|
67
|
+
*/
|
|
68
|
+
this.iconAlign = 'end';
|
|
69
|
+
/**
|
|
70
|
+
* Sets or retrieves the window or frame at which to target content.
|
|
71
|
+
*/
|
|
72
|
+
this.target = '_self';
|
|
73
|
+
this.selected = false;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
76
|
+
*/
|
|
77
|
+
this.throttleDelay = 200;
|
|
78
|
+
/**
|
|
79
|
+
* States
|
|
80
|
+
*/
|
|
81
|
+
this.isPressed = false;
|
|
82
|
+
this.slotHasContent = false;
|
|
83
|
+
this.__dispatchClickWithThrottle = event => {
|
|
84
|
+
this.__dispatchClick(event);
|
|
85
|
+
};
|
|
86
|
+
this.__dispatchClick = (event) => {
|
|
87
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
88
|
+
// prevent the click from propagating to other event listeners as well as
|
|
89
|
+
// prevent the default action.
|
|
90
|
+
if (this.softDisabled || (this.disabled && this.href)) {
|
|
91
|
+
event.stopImmediatePropagation();
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.focus();
|
|
96
|
+
this.dispatchEvent(new CustomEvent('button:click', {
|
|
97
|
+
bubbles: true,
|
|
98
|
+
composed: true,
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
this.__handlePress = (event) => {
|
|
102
|
+
if (event instanceof KeyboardEvent &&
|
|
103
|
+
event.type === 'keydown' &&
|
|
104
|
+
(event.key === 'Enter' || event.key === ' ')) {
|
|
105
|
+
this.isPressed = true;
|
|
106
|
+
}
|
|
107
|
+
else if (event.type === 'mousedown') {
|
|
108
|
+
this.isPressed = true;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.isPressed = false;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
focus() {
|
|
116
|
+
this.buttonElement?.focus();
|
|
117
|
+
}
|
|
118
|
+
blur() {
|
|
119
|
+
this.buttonElement?.blur();
|
|
120
|
+
}
|
|
121
|
+
connectedCallback() {
|
|
122
|
+
super.connectedCallback();
|
|
123
|
+
window.addEventListener('mouseup', this.__handlePress);
|
|
124
|
+
}
|
|
125
|
+
disconnectedCallback() {
|
|
126
|
+
window.removeEventListener('mouseup', this.__handlePress);
|
|
127
|
+
super.disconnectedCallback();
|
|
128
|
+
}
|
|
129
|
+
firstUpdated() {
|
|
130
|
+
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
131
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot'), hasContent => {
|
|
132
|
+
this.slotHasContent = hasContent;
|
|
133
|
+
this.requestUpdate();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
__renderDisabledReason() {
|
|
137
|
+
if (this.disabled && this.disabledReason)
|
|
138
|
+
return html `<div
|
|
139
|
+
id="disabled-reason-${__classPrivateFieldGet(this, _Button_id, "f")}"
|
|
140
|
+
role="tooltip"
|
|
141
|
+
aria-label=${this.disabledReason}
|
|
142
|
+
class="sr-only"
|
|
143
|
+
>
|
|
144
|
+
{this.disabledReason}
|
|
145
|
+
</div>`;
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
/* @ts-ignore */
|
|
149
|
+
__isLink() {
|
|
150
|
+
return !!this.href;
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
const isLink = this.__isLink();
|
|
154
|
+
const { variant, subVariant } = this.getVariant();
|
|
155
|
+
const cssClasses = {
|
|
156
|
+
button: true,
|
|
157
|
+
'button-element': true,
|
|
158
|
+
[`size-${this.size}`]: true,
|
|
159
|
+
[`variant-${variant}`]: true,
|
|
160
|
+
[`variant-${subVariant}`]: !!subVariant,
|
|
161
|
+
[`color-${this.color}`]: true,
|
|
162
|
+
disabled: this.disabled || this.softDisabled,
|
|
163
|
+
pressed: this.isPressed,
|
|
164
|
+
'has-content': this.slotHasContent,
|
|
165
|
+
};
|
|
166
|
+
if (!isLink) {
|
|
167
|
+
return html `<button
|
|
168
|
+
class=${classMap(cssClasses)}
|
|
169
|
+
tabindex=${__classPrivateFieldGet(this, _Button_tabindex, "f")}
|
|
170
|
+
type=${this.htmlType}
|
|
171
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
172
|
+
@mousedown=${this.__handlePress}
|
|
173
|
+
@keydown=${this.__handlePress}
|
|
174
|
+
@keyup=${this.__handlePress}
|
|
175
|
+
?aria-describedby=${(this.disabled || this.softDisabled) &&
|
|
176
|
+
this.disabledReason
|
|
177
|
+
? `disabled-reason-${__classPrivateFieldGet(this, _Button_id, "f")}`
|
|
178
|
+
: null}
|
|
179
|
+
aria-disabled=${`${this.disabled || this.softDisabled}`}
|
|
180
|
+
?disabled=${this.disabled}
|
|
181
|
+
>
|
|
182
|
+
${this.renderButtonContent()}
|
|
183
|
+
</button>`;
|
|
184
|
+
}
|
|
185
|
+
return html `<a
|
|
186
|
+
class=${classMap(cssClasses)}
|
|
187
|
+
tabindex=${__classPrivateFieldGet(this, _Button_tabindex, "f")}
|
|
188
|
+
href=${this.href}
|
|
189
|
+
target=${this.target}
|
|
190
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
191
|
+
@mousedown=${this.__handlePress}
|
|
192
|
+
@keydown=${this.__handlePress}
|
|
193
|
+
@keyup=${this.__handlePress}
|
|
194
|
+
role="button"
|
|
195
|
+
aria-describedby=${this.disabled && this.disabledReason
|
|
196
|
+
? `disabled-reason-${__classPrivateFieldGet(this, _Button_id, "f")}`
|
|
197
|
+
: null}
|
|
198
|
+
aria-disabled=${`${this.disabled}`}
|
|
199
|
+
>
|
|
200
|
+
<div class="icon">
|
|
201
|
+
<slot name="icon"></slot>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div class="slot-container">
|
|
205
|
+
<slot></slot>
|
|
206
|
+
</div>
|
|
207
|
+
</a>`;
|
|
208
|
+
}
|
|
209
|
+
getVariant() {
|
|
210
|
+
const variants = this.variant?.split('.');
|
|
211
|
+
if (!['filled', 'outlined', 'text', 'tonal', 'neo'].includes(variants[0])) {
|
|
212
|
+
variants.unshift('filled');
|
|
213
|
+
}
|
|
214
|
+
const [variant, subVariant] = variants;
|
|
215
|
+
return { variant, subVariant };
|
|
216
|
+
}
|
|
217
|
+
renderButtonContent() {
|
|
218
|
+
return html `
|
|
219
|
+
<p-focus-ring class="focus-ring" .control=${this}></p-focus-ring>
|
|
220
|
+
<p-elevation class="elevation"></p-elevation>
|
|
221
|
+
<div class="neo-background"></div>
|
|
222
|
+
<div class="background"></div>
|
|
223
|
+
<div class="outline"></div>
|
|
224
|
+
<p-ripple class="ripple"></p-ripple>
|
|
225
|
+
|
|
226
|
+
<div class="button-content">
|
|
227
|
+
${this.iconAlign === 'start'
|
|
228
|
+
? html `<slot name="icon"></slot></div>`
|
|
229
|
+
: null}
|
|
230
|
+
|
|
231
|
+
<div class="slot-container">
|
|
232
|
+
<slot></slot>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
${this.iconAlign === 'end' ? html `<slot name="icon"></slot>` : null}
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
${this.__renderDisabledReason()}
|
|
239
|
+
`;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
_Button_id = new WeakMap(), _Button_tabindex = new WeakMap();
|
|
243
|
+
Button.styles = [styles];
|
|
244
|
+
__decorate([
|
|
245
|
+
query('.button')
|
|
246
|
+
], Button.prototype, "buttonElement", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
property({ type: String })
|
|
249
|
+
], Button.prototype, "htmlType", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
property()
|
|
252
|
+
], Button.prototype, "variant", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
property()
|
|
255
|
+
], Button.prototype, "size", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
property({ reflect: true })
|
|
258
|
+
], Button.prototype, "disabled", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ reflect: true })
|
|
261
|
+
], Button.prototype, "softDisabled", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property()
|
|
264
|
+
], Button.prototype, "disabledReason", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
property({ reflect: true })
|
|
267
|
+
], Button.prototype, "color", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
property()
|
|
270
|
+
], Button.prototype, "iconAlign", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
property({ reflect: true })
|
|
273
|
+
], Button.prototype, "href", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ reflect: true })
|
|
276
|
+
], Button.prototype, "configAria", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property()
|
|
279
|
+
], Button.prototype, "target", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property()
|
|
282
|
+
], Button.prototype, "selected", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property()
|
|
285
|
+
], Button.prototype, "throttleDelay", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
state()
|
|
288
|
+
], Button.prototype, "isPressed", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
state()
|
|
291
|
+
], Button.prototype, "slotHasContent", void 0);
|
|
292
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/button/button.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,U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AAE;6CAAqB;AAMxB;IADP,KAAK,EAAE;yCACkB;AAGlB;IADP,KAAK,EAAE;8CACuB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './button.scss';\nimport { observerSlotChangesWithCallback, throttle } from '../utils.js';\n\n/**\n * @label Button\n * @tag p-button\n * @rawTag button\n *\n * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.\n * @overview\n * <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>\n *\n * @cssprop --divider-color - Controls the color of the divider.\n * @cssprop --divider-padding - Controls the padding of the divider.\n *\n * @example\n * ```html\n * <pc-button>Button</pc-button>\n * ```\n * @tags display\n */\nexport class Button extends LitElement {\n static override styles = [styles];\n\n #id = crypto.randomUUID();\n\n #tabindex?: number = 0;\n\n @query('.button') private readonly buttonElement!: HTMLElement | null;\n\n @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =\n 'button';\n\n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n *\n */\n @property() variant:\n | 'elevated'\n | 'filled'\n | 'tonal'\n | 'outlined'\n | 'text'\n | 'neo' = 'filled';\n\n /**\n * Button size.\n * Possible values are `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property() size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * If true, the user cannot interact with the button. Defaults to `false`.\n */\n @property({ reflect: true }) disabled: boolean = false;\n\n /**\n * 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`.\n */\n @property({ reflect: true }) softDisabled: boolean = false;\n\n /**\n * If button is disabled, the reason why it is disabled.\n */\n @property() disabledReason: string = '';\n\n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'secondary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'white'\n | 'black' = 'primary';\n\n /**\n * Icon alignment.\n * Possible values are `\"start\"`, `\"end\"`. Defaults to `\"end\"`.\n */\n @property() iconAlign: 'start' | 'end' = 'end';\n\n /**\n * Hyperlink to navigate to on click.\n */\n @property({ reflect: true }) href?: string;\n\n @property({ reflect: true }) configAria?: { [key: string]: any };\n\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n @property() target: string = '_self';\n\n @property() selected: boolean = false;\n\n /**\n * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.\n */\n @property() throttleDelay = 200;\n\n /**\n * States\n */\n @state()\n private isPressed = false;\n\n @state()\n private slotHasContent = false;\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('mouseup', this.__handlePress);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('mouseup', this.__handlePress);\n super.disconnectedCallback();\n }\n\n override firstUpdated() {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n observerSlotChangesWithCallback(\n this.renderRoot.querySelector('slot'),\n hasContent => {\n this.slotHasContent = hasContent;\n this.requestUpdate();\n },\n );\n }\n\n private __dispatchClickWithThrottle: (\n event: MouseEvent | KeyboardEvent,\n ) => void = event => {\n this.__dispatchClick(event);\n };\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n this.focus();\n this.dispatchEvent(\n new CustomEvent('button:click', {\n bubbles: true,\n composed: true,\n }),\n );\n };\n\n __renderDisabledReason() {\n if (this.disabled && this.disabledReason)\n return html`<div\n id=\"disabled-reason-${this.#id}\"\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"sr-only\"\n >\n {this.disabledReason}\n </div>`;\n return null;\n }\n\n __handlePress = (event: KeyboardEvent | MouseEvent) => {\n if (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n this.isPressed = true;\n } else if (event.type === 'mousedown') {\n this.isPressed = true;\n } else {\n this.isPressed = false;\n }\n };\n\n /* @ts-ignore */\n private __isLink() {\n return !!this.href;\n }\n\n override render() {\n const isLink = this.__isLink();\n const { variant, subVariant } = this.getVariant();\n\n const cssClasses = {\n button: true,\n 'button-element': true,\n [`size-${this.size}`]: true,\n [`variant-${variant}`]: true,\n [`variant-${subVariant}`]: !!subVariant,\n [`color-${this.color}`]: true,\n disabled: this.disabled || this.softDisabled,\n pressed: this.isPressed,\n 'has-content': this.slotHasContent,\n };\n\n if (!isLink) {\n return html`<button\n class=${classMap(cssClasses)}\n tabindex=${this.#tabindex}\n type=${this.htmlType}\n @click=${this.__dispatchClickWithThrottle}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n ?aria-describedby=${(this.disabled || this.softDisabled) &&\n this.disabledReason\n ? `disabled-reason-${this.#id}`\n : null}\n aria-disabled=${`${this.disabled || this.softDisabled}`}\n ?disabled=${this.disabled}\n >\n ${this.renderButtonContent()}\n </button>`;\n }\n return html`<a\n class=${classMap(cssClasses)}\n tabindex=${this.#tabindex}\n href=${this.href}\n target=${this.target}\n @click=${this.__dispatchClickWithThrottle}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n role=\"button\"\n aria-describedby=${this.disabled && this.disabledReason\n ? `disabled-reason-${this.#id}`\n : null}\n aria-disabled=${`${this.disabled}`}\n >\n <div class=\"icon\">\n <slot name=\"icon\"></slot>\n </div>\n\n <div class=\"slot-container\">\n <slot></slot>\n </div>\n </a>`;\n }\n\n getVariant() {\n const variants = this.variant?.split('.');\n if (!['filled', 'outlined', 'text', 'tonal', 'neo'].includes(variants[0])) {\n variants.unshift('filled');\n }\n const [variant, subVariant] = variants as [string, string?];\n return { variant, subVariant };\n }\n\n renderButtonContent() {\n return html`\n <p-focus-ring class=\"focus-ring\" .control=${this}></p-focus-ring>\n <p-elevation class=\"elevation\"></p-elevation>\n <div class=\"neo-background\"></div>\n <div class=\"background\"></div>\n <div class=\"outline\"></div>\n <p-ripple class=\"ripple\"></p-ripple>\n\n <div class=\"button-content\">\n ${this.iconAlign === 'start'\n ? html`<slot name=\"icon\"></slot></div>`\n : null}\n\n <div class=\"slot-container\">\n <slot></slot>\n </div>\n\n ${this.iconAlign === 'end' ? html`<slot name=\"icon\"></slot>` : null}\n </div>\n\n ${this.__renderDisabledReason()}\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './button.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { Button } from './button.js';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare class ClockController implements ReactiveController {
|
|
3
|
+
host: ReactiveControllerHost;
|
|
4
|
+
value: Date;
|
|
5
|
+
timeout: number;
|
|
6
|
+
private _timerID?;
|
|
7
|
+
constructor(host: ReactiveControllerHost, timeout?: number);
|
|
8
|
+
hostConnected(): void;
|
|
9
|
+
hostDisconnected(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class ClockController {
|
|
2
|
+
constructor(host, timeout = 1000) {
|
|
3
|
+
this.value = new Date();
|
|
4
|
+
this.host = host;
|
|
5
|
+
this.host.addController(this);
|
|
6
|
+
this.timeout = timeout;
|
|
7
|
+
}
|
|
8
|
+
hostConnected() {
|
|
9
|
+
// Start a timer when the host is connected
|
|
10
|
+
this._timerID = setInterval(() => {
|
|
11
|
+
this.value = new Date();
|
|
12
|
+
// Update the host with new value
|
|
13
|
+
this.host.requestUpdate();
|
|
14
|
+
}, this.timeout);
|
|
15
|
+
}
|
|
16
|
+
hostDisconnected() {
|
|
17
|
+
// Clear the timer when the host is disconnected
|
|
18
|
+
clearInterval(this._timerID);
|
|
19
|
+
this._timerID = undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ClockController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClockController.js","sourceRoot":"","sources":["../../../src/clock/ClockController.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IAS1B,YAAY,IAA4B,EAAE,OAAO,GAAG,IAAI;QANxD,UAAK,GAAG,IAAI,IAAI,EAAE,CAAC;QAOjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,aAAa;QACX,2CAA2C;QAC3C,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,iCAAiC;YACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QAC5B,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,gBAAgB;QACd,gDAAgD;QAChD,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { ReactiveController, ReactiveControllerHost } from 'lit';\r\n\r\nexport class ClockController implements ReactiveController {\r\n host: ReactiveControllerHost;\r\n\r\n value = new Date();\r\n\r\n timeout: number;\r\n\r\n private _timerID?: any;\r\n\r\n constructor(host: ReactiveControllerHost, timeout = 1000) {\r\n this.host = host;\r\n this.host.addController(this);\r\n this.timeout = timeout;\r\n }\r\n\r\n hostConnected() {\r\n // Start a timer when the host is connected\r\n this._timerID = setInterval(() => {\r\n this.value = new Date();\r\n // Update the host with new value\r\n this.host.requestUpdate();\r\n }, this.timeout);\r\n }\r\n\r\n hostDisconnected() {\r\n // Clear the timer when the host is disconnected\r\n clearInterval(this._timerID);\r\n this._timerID = undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { getTypography } from '../styleMixins.css.js';
|
|
3
|
+
export const styles = css `
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.current-time {
|
|
9
|
+
${getTypography('body-medium')}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
//# sourceMappingURL=clock.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.css.js","sourceRoot":"","sources":["../../../src/clock/clock.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;MAMnB,aAAa,CAAC,aAAa,CAAC;;CAEjC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { getTypography } from '../styleMixins.css.js';\n\nexport const styles = css`\n :host {\n display: inline-block;\n }\n\n .current-time {\n ${getTypography('body-medium')}\n }\n`;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ClockController } from './ClockController.js';
|
|
3
|
+
/**
|
|
4
|
+
* @label Clock
|
|
5
|
+
* @tag p-clock
|
|
6
|
+
* @rawTag clock
|
|
7
|
+
*
|
|
8
|
+
* @summary Displays the current time in a given timezone.
|
|
9
|
+
* @overview
|
|
10
|
+
* - Clocks are used to display the current time in a specified timezone.
|
|
11
|
+
* - They can be displayed in various formats, including 12-hour and 24-hour time.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <p-clock></p-clock>
|
|
16
|
+
* ```
|
|
17
|
+
* @tags display
|
|
18
|
+
*/
|
|
19
|
+
export declare class Clock extends LitElement {
|
|
20
|
+
static styles: import("lit").CSSResultGroup[];
|
|
21
|
+
clockController: ClockController;
|
|
22
|
+
timezone?: string;
|
|
23
|
+
__formatDate(date: Date): string;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import styles from './clock.scss';
|
|
5
|
+
import { ClockController } from './ClockController.js';
|
|
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
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.clockController = new ClockController(this, 100);
|
|
26
|
+
}
|
|
27
|
+
__formatDate(date) {
|
|
28
|
+
return date.toLocaleTimeString('en-US', {
|
|
29
|
+
timeZone: this.timezone,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const currentDate = this.__formatDate(this.clockController.value);
|
|
34
|
+
return html `<div class="current-time">${currentDate}</div>`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
Clock.styles = [styles];
|
|
38
|
+
__decorate([
|
|
39
|
+
property()
|
|
40
|
+
], Clock.prototype, "timezone", void 0);
|
|
41
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../../src/clock/clock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAGE,oBAAe,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAcnD,CAAC;IAVC,YAAY,CAAC,IAAU;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;YACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAClE,OAAO,IAAI,CAAA,6BAA6B,WAAW,QAAQ,CAAC;IAC9D,CAAC;;AAfM,YAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIb;IAAX,QAAQ,EAAE;uCAAmB","sourcesContent":["import { html, LitElement } from 'lit';\r\nimport { property } from 'lit/decorators.js';\r\nimport styles from './clock.scss';\r\nimport { ClockController } from './ClockController.js';\r\n\r\n/**\r\n * @label Clock\r\n * @tag p-clock\r\n * @rawTag clock\r\n *\r\n * @summary Displays the current time in a given timezone.\r\n * @overview\r\n * - Clocks are used to display the current time in a specified timezone.\r\n * - They can be displayed in various formats, including 12-hour and 24-hour time.\r\n *\r\n * @example\r\n * ```html\r\n * <p-clock></p-clock>\r\n * ```\r\n * @tags display\r\n */\r\nexport class Clock extends LitElement {\r\n static styles = [styles];\r\n\r\n clockController = new ClockController(this, 100);\r\n\r\n @property() timezone?: string;\r\n\r\n __formatDate(date: Date) {\r\n return date.toLocaleTimeString('en-US', {\r\n timeZone: this.timezone,\r\n });\r\n }\r\n\r\n render() {\r\n const currentDate = this.__formatDate(this.clockController.value);\r\n return html`<div class=\"current-time\">${currentDate}</div>`;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Clock } from './clock.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { Clock } from './clock.js';\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Code Highlighter
|
|
4
|
+
* @tag p-code-highlighter
|
|
5
|
+
* @rawTag code-highlighter
|
|
6
|
+
*
|
|
7
|
+
* @summary The code highlighter component is used to display code snippets with syntax highlighting.
|
|
8
|
+
* @overview
|
|
9
|
+
* <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>
|
|
10
|
+
*
|
|
11
|
+
* @cssprop --divider-color - Controls the color of the divider.
|
|
12
|
+
* @cssprop --divider-padding - Controls the padding of the divider.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <p-divider style="width: 12rem;">or</p-divider>
|
|
17
|
+
* ```
|
|
18
|
+
* @tags display
|
|
19
|
+
*/
|
|
20
|
+
export declare class CodeHighlighter extends LitElement {
|
|
21
|
+
static styles: import("lit").CSSResultGroup[];
|
|
22
|
+
vertical: boolean;
|
|
23
|
+
slotHasContent: boolean;
|
|
24
|
+
firstUpdated(): void;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
package/.rollup.cache/E/git/redvars/peacock/components/dist/src/code-highlighter/code-highlighter.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import styles from './code-highlighter.scss';
|
|
6
|
+
import { observerSlotChangesWithCallback } from '../utils.js';
|
|
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
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.vertical = false;
|
|
29
|
+
this.slotHasContent = false;
|
|
30
|
+
}
|
|
31
|
+
firstUpdated() {
|
|
32
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot'), hasContent => {
|
|
33
|
+
this.slotHasContent = hasContent;
|
|
34
|
+
this.requestUpdate();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return html `<div
|
|
39
|
+
class=${classMap({
|
|
40
|
+
divider: true,
|
|
41
|
+
vertical: this.vertical,
|
|
42
|
+
'slot-has-content': this.slotHasContent,
|
|
43
|
+
})}
|
|
44
|
+
>
|
|
45
|
+
<div class="line"></div>
|
|
46
|
+
<div class="slot-container">
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="line"></div>
|
|
50
|
+
</div>`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
CodeHighlighter.styles = [styles];
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ type: Boolean, reflect: true })
|
|
56
|
+
], CodeHighlighter.prototype, "vertical", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
state()
|
|
59
|
+
], CodeHighlighter.prototype, "slotHasContent", void 0);
|
|
60
|
+
//# sourceMappingURL=code-highlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-highlighter.js","sourceRoot":"","sources":["../../../src/code-highlighter/code-highlighter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QAG8C,aAAQ,GAAG,KAAK,CAAC;QAG7D,mBAAc,GAAG,KAAK,CAAC;IA2BzB,CAAC;IAzBC,YAAY;QACV,+BAA+B,CAC7B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,EACrC,UAAU,CAAC,EAAE;YACX,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC;YACjC,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CACF,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;cACD,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,kBAAkB,EAAE,IAAI,CAAC,cAAc;SACxC,CAAC;;;;;;;WAOG,CAAC;IACV,CAAC;;AA/BM,sBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAEmB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAkB;AAG7D;IADC,KAAK,EAAE;uDACe","sourcesContent":["import { html, LitElement } from 'lit';\r\nimport { property, state } from 'lit/decorators.js';\r\nimport { classMap } from 'lit/directives/class-map.js';\r\nimport styles from './code-highlighter.scss';\r\nimport { observerSlotChangesWithCallback } from '../utils.js';\r\n\r\n/**\r\n * @label Code Highlighter\r\n * @tag p-code-highlighter\r\n * @rawTag code-highlighter\r\n *\r\n * @summary The code highlighter component is used to display code snippets with syntax highlighting.\r\n * @overview\r\n * <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>\r\n *\r\n * @cssprop --divider-color - Controls the color of the divider.\r\n * @cssprop --divider-padding - Controls the padding of the divider.\r\n *\r\n * @example\r\n * ```html\r\n * <p-divider style=\"width: 12rem;\">or</p-divider>\r\n * ```\r\n * @tags display\r\n */\r\nexport class CodeHighlighter extends LitElement {\r\n static styles = [styles];\r\n\r\n @property({ type: Boolean, reflect: true }) vertical = false;\r\n\r\n @state()\r\n slotHasContent = false;\r\n\r\n firstUpdated() {\r\n observerSlotChangesWithCallback(\r\n this.renderRoot.querySelector('slot'),\r\n hasContent => {\r\n this.slotHasContent = hasContent;\r\n this.requestUpdate();\r\n },\r\n );\r\n }\r\n\r\n render() {\r\n return html`<div\r\n class=${classMap({\r\n divider: true,\r\n vertical: this.vertical,\r\n 'slot-has-content': this.slotHasContent,\r\n })}\r\n >\r\n <div class=\"line\"></div>\r\n <div class=\"slot-container\">\r\n <slot></slot>\r\n </div>\r\n <div class=\"line\"></div>\r\n </div>`;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeHighlighter } from './code-highlighter.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-highlighter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { CodeHighlighter } from './code-highlighter.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/code-highlighter/local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAKf;IACF,OAAO,EAAE,iBAAiB;IAC1B,eAAe,EAAE,mBAAmB;IACpC,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,aAAa;CAC1B,CAAC","sourcesContent":["export const locale: {\n loading: string;\n copyToClipboard: string;\n copied: string;\n copiedCode: string;\n} = {\n loading: 'Loading code...',\n copyToClipboard: 'Copy to clipboard',\n copied: 'Copied',\n copiedCode: 'Copied code',\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|