@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,157 @@
|
|
|
1
|
+
import { n } from './property-BXcRN0hQ.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/function r(r){return n({...r,state:true,attribute:false})}
|
|
8
|
+
|
|
9
|
+
async function createCacheFetch(name) {
|
|
10
|
+
let cache = null;
|
|
11
|
+
// This map tracks requests currently being processed
|
|
12
|
+
const inFlightRequests = new Map();
|
|
13
|
+
try {
|
|
14
|
+
cache = await window.caches.open(name);
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
console.warn('window.caches access not allowed');
|
|
18
|
+
}
|
|
19
|
+
return async (url) => {
|
|
20
|
+
// 1. Check if we are already fetching this URL
|
|
21
|
+
if (inFlightRequests.has(url)) {
|
|
22
|
+
// Return the existing promise instead of starting a new one
|
|
23
|
+
return inFlightRequests.get(url);
|
|
24
|
+
}
|
|
25
|
+
// 2. Create the main logic as a promise
|
|
26
|
+
const fetchPromise = (async () => {
|
|
27
|
+
const request = new Request(url);
|
|
28
|
+
// Check Cache first
|
|
29
|
+
if (cache) {
|
|
30
|
+
const cachedResponse = await cache.match(request);
|
|
31
|
+
if (cachedResponse) {
|
|
32
|
+
return cachedResponse.text();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Prepare network request
|
|
36
|
+
const urlObj = new URL(request.url);
|
|
37
|
+
const isSameOrigin = urlObj.origin === window.location.origin;
|
|
38
|
+
const response = await fetch(request.url, {
|
|
39
|
+
method: 'GET',
|
|
40
|
+
mode: isSameOrigin ? 'no-cors' : 'cors',
|
|
41
|
+
credentials: isSameOrigin ? 'same-origin' : 'omit',
|
|
42
|
+
});
|
|
43
|
+
// --- Handle 404 ---
|
|
44
|
+
if (response.status === 404) {
|
|
45
|
+
console.error(`[Fetch Error] Resource not found (404): ${url}`);
|
|
46
|
+
return ''; // Return empty string as requested
|
|
47
|
+
}
|
|
48
|
+
const result = await response.text();
|
|
49
|
+
// Update Cache if applicable
|
|
50
|
+
if (cache && response.status === 200) {
|
|
51
|
+
// We clone the response logic by creating a new Response with the text body
|
|
52
|
+
await cache.put(request, new Response(result, {
|
|
53
|
+
status: response.status,
|
|
54
|
+
statusText: response.statusText,
|
|
55
|
+
headers: response.headers,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
})();
|
|
60
|
+
// 3. Store the promise in the map
|
|
61
|
+
inFlightRequests.set(url, fetchPromise);
|
|
62
|
+
try {
|
|
63
|
+
// 4. Wait for the result
|
|
64
|
+
return await fetchPromise;
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
// 5. Clean up: Remove the promise from the map when done
|
|
68
|
+
// This ensures subsequent calls (after this one finishes) can start fresh
|
|
69
|
+
inFlightRequests.delete(url);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
|
|
74
|
+
function sanitizeSvg(rawSvg) {
|
|
75
|
+
try {
|
|
76
|
+
const parser = new DOMParser();
|
|
77
|
+
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
|
78
|
+
// remove script tags
|
|
79
|
+
const scripts = Array.from(doc.querySelectorAll('script'));
|
|
80
|
+
scripts.forEach(n => n.remove());
|
|
81
|
+
// remove foreignObject and iframe-like elements
|
|
82
|
+
const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
|
|
83
|
+
foreigns.forEach(n => n.remove());
|
|
84
|
+
// remove event handler attributes like onload, onclick, etc.
|
|
85
|
+
const all = Array.from(doc.querySelectorAll('*'));
|
|
86
|
+
all.forEach(el => {
|
|
87
|
+
const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
|
|
88
|
+
attrs.forEach(a => el.removeAttribute(a.name));
|
|
89
|
+
});
|
|
90
|
+
const el = doc.documentElement;
|
|
91
|
+
if (!el)
|
|
92
|
+
return '';
|
|
93
|
+
// serialize back to string
|
|
94
|
+
const serializer = new XMLSerializer();
|
|
95
|
+
return serializer.serializeToString(el);
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
// parsing failed; fall back to empty content to avoid injecting unsafe content
|
|
99
|
+
return '';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function __hasMeaningfulContent(slotElement) {
|
|
103
|
+
const nodes = slotElement.assignedNodes({ flatten: true });
|
|
104
|
+
for (const node of nodes) {
|
|
105
|
+
// If it's an element node, it has content
|
|
106
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
// If it's a text node and contains non-whitespace characters, it has content
|
|
110
|
+
if (node.nodeType === Node.TEXT_NODE &&
|
|
111
|
+
node.textContent.trim().length > 0) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// No meaningful content found
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
function observerSlotChangesWithCallback(slot, callback) {
|
|
119
|
+
const observer = new MutationObserver(() => {
|
|
120
|
+
callback(__hasMeaningfulContent(slot));
|
|
121
|
+
});
|
|
122
|
+
// Observe the elements currently assigned to the slot
|
|
123
|
+
const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
|
|
124
|
+
assignedNodes.forEach(node => {
|
|
125
|
+
observer.observe(node, {
|
|
126
|
+
attributes: true,
|
|
127
|
+
childList: true,
|
|
128
|
+
characterData: true,
|
|
129
|
+
subtree: true,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
callback(__hasMeaningfulContent(slot));
|
|
133
|
+
}
|
|
134
|
+
function throttle(func, delay, options = { leading: true, trailing: true }) {
|
|
135
|
+
let timerId;
|
|
136
|
+
let lastExec = 0;
|
|
137
|
+
return function (...args) {
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
const context = this;
|
|
140
|
+
const now = Date.now();
|
|
141
|
+
const shouldCallNow = options.leading && now - lastExec >= delay;
|
|
142
|
+
if (shouldCallNow) {
|
|
143
|
+
func.apply(context, args);
|
|
144
|
+
lastExec = now;
|
|
145
|
+
}
|
|
146
|
+
else if (options.trailing && !timerId) {
|
|
147
|
+
timerId = setTimeout(() => {
|
|
148
|
+
func.apply(context, args);
|
|
149
|
+
lastExec = Date.now();
|
|
150
|
+
timerId = null;
|
|
151
|
+
}, delay);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export { createCacheFetch as c, observerSlotChangesWithCallback as o, r, sanitizeSvg as s, throttle as t };
|
|
157
|
+
//# sourceMappingURL=utils-DD_cg6Ms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-DD_cg6Ms.js","sources":["../node_modules/@lit/reactive-element/decorators/state.js","../../src/utils.ts"],"sourcesContent":["import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","export async function createCacheFetch(name: string) {\n let cache: Cache | null = null;\n // This map tracks requests currently being processed\n const inFlightRequests = new Map<string, Promise<string>>();\n\n try {\n cache = await window.caches.open(name);\n } catch (e) {\n console.warn('window.caches access not allowed');\n }\n\n return async (url: string): Promise<string> => {\n // 1. Check if we are already fetching this URL\n if (inFlightRequests.has(url)) {\n // Return the existing promise instead of starting a new one\n return inFlightRequests.get(url)!;\n }\n\n // 2. Create the main logic as a promise\n const fetchPromise = (async () => {\n const request = new Request(url);\n\n // Check Cache first\n if (cache) {\n const cachedResponse = await cache.match(request);\n if (cachedResponse) {\n return cachedResponse.text();\n }\n }\n\n // Prepare network request\n const urlObj = new URL(request.url);\n const isSameOrigin = urlObj.origin === window.location.origin;\n\n const response = await fetch(request.url, {\n method: 'GET',\n mode: isSameOrigin ? 'no-cors' : 'cors',\n credentials: isSameOrigin ? 'same-origin' : 'omit',\n });\n\n // --- Handle 404 ---\n if (response.status === 404) {\n console.error(`[Fetch Error] Resource not found (404): ${url}`);\n return ''; // Return empty string as requested\n }\n\n const result = await response.text();\n\n // Update Cache if applicable\n if (cache && response.status === 200) {\n // We clone the response logic by creating a new Response with the text body\n await cache.put(\n request,\n new Response(result, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n }),\n );\n }\n\n return result;\n })();\n\n // 3. Store the promise in the map\n inFlightRequests.set(url, fetchPromise);\n\n try {\n // 4. Wait for the result\n return await fetchPromise;\n } finally {\n // 5. Clean up: Remove the promise from the map when done\n // This ensures subsequent calls (after this one finishes) can start fresh\n inFlightRequests.delete(url);\n }\n };\n}\n\n// Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes\nexport function sanitizeSvg(rawSvg: string) {\n try {\n const parser = new DOMParser();\n const doc = parser.parseFromString(rawSvg, 'image/svg+xml');\n\n // remove script tags\n const scripts = Array.from(doc.querySelectorAll('script'));\n scripts.forEach(n => n.remove());\n\n // remove foreignObject and iframe-like elements\n const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));\n foreigns.forEach(n => n.remove());\n\n // remove event handler attributes like onload, onclick, etc.\n const all = Array.from(doc.querySelectorAll('*'));\n all.forEach(el => {\n const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));\n attrs.forEach(a => el.removeAttribute(a.name));\n });\n\n const el = doc.documentElement;\n if (!el) return '';\n\n // serialize back to string\n const serializer = new XMLSerializer();\n return serializer.serializeToString(el);\n } catch (e) {\n // parsing failed; fall back to empty content to avoid injecting unsafe content\n return '';\n }\n}\n\nfunction __hasMeaningfulContent(slotElement: any) {\n const nodes = slotElement.assignedNodes({ flatten: true });\n\n for (const node of nodes) {\n // If it's an element node, it has content\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n // If it's a text node and contains non-whitespace characters, it has content\n if (\n node.nodeType === Node.TEXT_NODE &&\n node.textContent.trim().length > 0\n ) {\n return true;\n }\n }\n\n // No meaningful content found\n return false;\n}\n\nexport function observerSlotChangesWithCallback(\n slot: HTMLSlotElement | null,\n callback: (hasContent: boolean) => void,\n) {\n const observer = new MutationObserver(() => {\n callback(__hasMeaningfulContent(slot));\n });\n\n // Observe the elements currently assigned to the slot\n const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];\n assignedNodes.forEach(node => {\n observer.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n });\n\n callback(__hasMeaningfulContent(slot));\n}\n\nexport function throttle(\n func: Function,\n delay: number,\n options = { leading: true, trailing: true },\n) {\n let timerId: any;\n let lastExec = 0;\n\n return function (...args: any[]) {\n // @ts-ignore\n const context = this;\n const now = Date.now();\n\n const shouldCallNow = options.leading && now - lastExec >= delay;\n\n if (shouldCallNow) {\n func.apply(context, args);\n lastExec = now;\n } else if (options.trailing && !timerId) {\n timerId = setTimeout(() => {\n func.apply(context, args);\n lastExec = Date.now();\n timerId = null;\n }, delay);\n }\n };\n}\n"],"names":["t"],"mappings":";;AACA;AACA;AACA;AACA;AACA,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOA,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAE,CAAC,SAAS,CAAC,KAAE,CAAC,CAAC;;ACLhD,eAAe,gBAAgB,CAAC,IAAY,EAAA;IACjD,IAAI,KAAK,GAAiB,IAAI;;AAE9B,IAAA,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA2B;AAE3D,IAAA,IAAI;QACF,KAAK,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IACxC;IAAE,OAAO,CAAC,EAAE;AACV,QAAA,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC;IAClD;AAEA,IAAA,OAAO,OAAO,GAAW,KAAqB;;AAE5C,QAAA,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;AAE7B,YAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAE;QACnC;;AAGA,QAAA,MAAM,YAAY,GAAG,CAAC,YAAW;AAC/B,YAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;;YAGhC,IAAI,KAAK,EAAE;gBACT,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;gBACjD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Q,GAAG,CAAC;IAEhB,OAAO,UAAU,GAAG,IAAW,EAAA;;QAE7B,MAAM,OAAO,GAAG,IAAI;AACpB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QAEtB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK;QAEhE,IAAI,aAAa,EAAE;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;YACzB,QAAQ,GAAG,GAAG;QAChB;AAAO,aAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE;AACvC,YAAA,OAAO,GAAG,UAAU,CAAC,MAAK;AACxB,gBAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzB,gBAAA,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;gBACrB,OAAO,GAAG,IAAI;YAChB,CAAC,EAAE,KAAK,CAAC;QACX;AACF,IAAA,CAAC;AACH;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
async function createCacheFetch(name) {
|
|
2
|
+
let cache = null;
|
|
3
|
+
// This map tracks requests currently being processed
|
|
4
|
+
const inFlightRequests = new Map();
|
|
5
|
+
try {
|
|
6
|
+
cache = await window.caches.open(name);
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
console.warn('window.caches access not allowed');
|
|
10
|
+
}
|
|
11
|
+
return async (url) => {
|
|
12
|
+
// 1. Check if we are already fetching this URL
|
|
13
|
+
if (inFlightRequests.has(url)) {
|
|
14
|
+
// Return the existing promise instead of starting a new one
|
|
15
|
+
return inFlightRequests.get(url);
|
|
16
|
+
}
|
|
17
|
+
// 2. Create the main logic as a promise
|
|
18
|
+
const fetchPromise = (async () => {
|
|
19
|
+
const request = new Request(url);
|
|
20
|
+
// Check Cache first
|
|
21
|
+
if (cache) {
|
|
22
|
+
const cachedResponse = await cache.match(request);
|
|
23
|
+
if (cachedResponse) {
|
|
24
|
+
return await cachedResponse.text();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Prepare network request
|
|
28
|
+
const urlObj = new URL(request.url);
|
|
29
|
+
const isSameOrigin = urlObj.origin === window.location.origin;
|
|
30
|
+
const response = await fetch(request.url, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
mode: isSameOrigin ? 'no-cors' : 'cors',
|
|
33
|
+
credentials: isSameOrigin ? 'same-origin' : 'omit',
|
|
34
|
+
});
|
|
35
|
+
// --- Handle 404 ---
|
|
36
|
+
if (response.status === 404) {
|
|
37
|
+
console.error(`[Fetch Error] Resource not found (404): ${url}`);
|
|
38
|
+
return ''; // Return empty string as requested
|
|
39
|
+
}
|
|
40
|
+
const result = await response.text();
|
|
41
|
+
// Update Cache if applicable
|
|
42
|
+
if (cache && response.status === 200) {
|
|
43
|
+
// We clone the response logic by creating a new Response with the text body
|
|
44
|
+
await cache.put(request, new Response(result, {
|
|
45
|
+
status: response.status,
|
|
46
|
+
statusText: response.statusText,
|
|
47
|
+
headers: response.headers,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
})();
|
|
52
|
+
// 3. Store the promise in the map
|
|
53
|
+
inFlightRequests.set(url, fetchPromise);
|
|
54
|
+
try {
|
|
55
|
+
// 4. Wait for the result
|
|
56
|
+
return await fetchPromise;
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
// 5. Clean up: Remove the promise from the map when done
|
|
60
|
+
// This ensures subsequent calls (after this one finishes) can start fresh
|
|
61
|
+
inFlightRequests.delete(url);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
|
|
66
|
+
function sanitizeSvg(rawSvg) {
|
|
67
|
+
try {
|
|
68
|
+
const parser = new DOMParser();
|
|
69
|
+
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
|
70
|
+
// remove script tags
|
|
71
|
+
const scripts = Array.from(doc.querySelectorAll('script'));
|
|
72
|
+
scripts.forEach(n => n.remove());
|
|
73
|
+
// remove foreignObject and iframe-like elements
|
|
74
|
+
const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
|
|
75
|
+
foreigns.forEach(n => n.remove());
|
|
76
|
+
// remove event handler attributes like onload, onclick, etc.
|
|
77
|
+
const all = Array.from(doc.querySelectorAll('*'));
|
|
78
|
+
all.forEach(el => {
|
|
79
|
+
const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
|
|
80
|
+
attrs.forEach(a => el.removeAttribute(a.name));
|
|
81
|
+
});
|
|
82
|
+
const el = doc.documentElement;
|
|
83
|
+
if (!el)
|
|
84
|
+
return '';
|
|
85
|
+
// serialize back to string
|
|
86
|
+
const serializer = new XMLSerializer();
|
|
87
|
+
return serializer.serializeToString(el);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
// parsing failed; fall back to empty content to avoid injecting unsafe content
|
|
91
|
+
return '';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function __hasMeaningfulContent(slotElement) {
|
|
95
|
+
const nodes = slotElement.assignedNodes({ flatten: true });
|
|
96
|
+
for (const node of nodes) {
|
|
97
|
+
// If it's an element node, it has content
|
|
98
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
// If it's a text node and contains non-whitespace characters, it has content
|
|
102
|
+
if (node.nodeType === Node.TEXT_NODE &&
|
|
103
|
+
node.textContent.trim().length > 0) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// No meaningful content found
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
function observerSlotChangesWithCallback(slot, callback) {
|
|
111
|
+
const observer = new MutationObserver(() => {
|
|
112
|
+
callback(__hasMeaningfulContent(slot));
|
|
113
|
+
});
|
|
114
|
+
// Observe the elements currently assigned to the slot
|
|
115
|
+
const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
|
|
116
|
+
assignedNodes.forEach(node => {
|
|
117
|
+
observer.observe(node, {
|
|
118
|
+
attributes: true,
|
|
119
|
+
childList: true,
|
|
120
|
+
characterData: true,
|
|
121
|
+
subtree: true,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
callback(__hasMeaningfulContent(slot));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { createCacheFetch as c, observerSlotChangesWithCallback as o, sanitizeSvg as s };
|
|
128
|
+
//# sourceMappingURL=utils-_5no4mk7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-_5no4mk7.js","sources":["../../src/utils.ts"],"sourcesContent":["export async function createCacheFetch(name: string) {\n let cache: Cache | null = null;\n // This map tracks requests currently being processed\n const inFlightRequests = new Map<string, Promise<string>>();\n\n try {\n cache = await window.caches.open(name);\n } catch (e) {\n console.warn('window.caches access not allowed');\n }\n\n return async (url: string): Promise<string> => {\n // 1. Check if we are already fetching this URL\n if (inFlightRequests.has(url)) {\n // Return the existing promise instead of starting a new one\n return inFlightRequests.get(url)!;\n }\n\n // 2. Create the main logic as a promise\n const fetchPromise = (async () => {\n const request = new Request(url);\n\n // Check Cache first\n if (cache) {\n const cachedResponse = await cache.match(request);\n if (cachedResponse) {\n return await cachedResponse.text();\n }\n }\n\n // Prepare network request\n const urlObj = new URL(request.url);\n const isSameOrigin = urlObj.origin === window.location.origin;\n\n const response = await fetch(request.url, {\n method: 'GET',\n mode: isSameOrigin ? 'no-cors' : 'cors',\n credentials: isSameOrigin ? 'same-origin' : 'omit',\n });\n\n // --- Handle 404 ---\n if (response.status === 404) {\n console.error(`[Fetch Error] Resource not found (404): ${url}`);\n return ''; // Return empty string as requested\n }\n\n const result = await response.text();\n\n // Update Cache if applicable\n if (cache && response.status === 200) {\n // We clone the response logic by creating a new Response with the text body\n await cache.put(\n request,\n new Response(result, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n }),\n );\n }\n\n return result;\n })();\n\n // 3. Store the promise in the map\n inFlightRequests.set(url, fetchPromise);\n\n try {\n // 4. Wait for the result\n return await fetchPromise;\n } finally {\n // 5. Clean up: Remove the promise from the map when done\n // This ensures subsequent calls (after this one finishes) can start fresh\n inFlightRequests.delete(url);\n }\n };\n}\n\n// Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes\nexport function sanitizeSvg(rawSvg: string) {\n try {\n const parser = new DOMParser();\n const doc = parser.parseFromString(rawSvg, 'image/svg+xml');\n\n // remove script tags\n const scripts = Array.from(doc.querySelectorAll('script'));\n scripts.forEach(n => n.remove());\n\n // remove foreignObject and iframe-like elements\n const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));\n foreigns.forEach(n => n.remove());\n\n // remove event handler attributes like onload, onclick, etc.\n const all = Array.from(doc.querySelectorAll('*'));\n all.forEach(el => {\n const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));\n attrs.forEach(a => el.removeAttribute(a.name));\n });\n\n const el = doc.documentElement;\n if (!el) return '';\n\n // serialize back to string\n const serializer = new XMLSerializer();\n return serializer.serializeToString(el);\n } catch (e) {\n // parsing failed; fall back to empty content to avoid injecting unsafe content\n return '';\n }\n}\n\nfunction __hasMeaningfulContent(slotElement: any) {\n const nodes = slotElement.assignedNodes({ flatten: true });\n\n for (const node of nodes) {\n // If it's an element node, it has content\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n // If it's a text node and contains non-whitespace characters, it has content\n if (\n node.nodeType === Node.TEXT_NODE &&\n node.textContent.trim().length > 0\n ) {\n return true;\n }\n }\n\n // No meaningful content found\n return false;\n}\n\nexport function observerSlotChangesWithCallback(\n slot: HTMLSlotElement | null,\n callback: (hasContent: boolean) => void,\n) {\n const observer = new MutationObserver(() => {\n callback(__hasMeaningfulContent(slot));\n });\n\n // Observe the elements currently assigned to the slot\n const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];\n assignedNodes.forEach(node => {\n observer.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n });\n\n callback(__hasMeaningfulContent(slot));\n}\n"],"names":[],"mappings":"AAAO,eAAe,gBAAgB,CAAC,IAAY,EAAA;IACjD,IAAI,KAAK,GAAiB,IAAI;;AAE9B,IAAA,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA2B;AAE3D,IAAA,IAAI;QACF,KAAK,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IACxC;IAAE,OAAO,CAAC,EAAE;AACV,QAAA,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC;IAClD;AAEA,IAAA,OAAO,OAAO,GAAW,KAAqB;;AAE5C,QAAA,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;AAE7B,YAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAE;QACnC;;AAGA,QAAA,MAAM,YAAY,GAAG,CAAC,YAAW;AAC/B,YAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;;YAGhC,IAAI,KAAK,EAAE;gBACT,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;gBACjD,IAAI,cAAc,EAAE;AAClB,oBAAA,OAAO,MAAM,cAAc,CAAC,IAAI,EAAE;gBACpC;YACF;;YAGA,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;YACnC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM;YAE7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;AACxC,gBAAA,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM;gBACvC,WAAW,EAAE,YAAY,GAAG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,OAAO,IAAI;QACb;IACF;;AAGA,IAAA,OAAO,KAAK;AACd;AAEM,SAAU,+BAA+B,CAC7C,IAA4B,EAC5B,QAAuC,EAAA;AAEvC,IAAA,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,MAAK;AACzC,QAAA,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACxC,IAAA,CAAC,CAAC;;AAGF,IAAA,MAAM,aAAa,GAAG,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AAClE,IAAA,aAAa,CAAC,OAAO,CAAC,IAAI,IAAG;AAC3B,QAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;AACrB,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,aAAa,EAAE,IAAI;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACxC;;;;"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function createCacheFetch(name: string): Promise<(url: string) => Promise<string>>;
|
|
2
|
+
export declare function sanitizeSvg(rawSvg: string): string;
|
|
3
|
+
export declare function observerSlotChangesWithCallback(slot: HTMLSlotElement | null, callback: (hasContent: boolean) => void): void;
|
|
4
|
+
export declare function throttle(func: Function, delay: number, options?: {
|
|
5
|
+
leading: boolean;
|
|
6
|
+
trailing: boolean;
|
|
7
|
+
}): (...args: any[]) => void;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,iBAW9B,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,EAiE5C;AAGD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,UA8BzC;AAuBD,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,eAAe,GAAG,IAAI,EAC5B,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,QAkBxC;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,EACb,OAAO;;;CAAoC,IAK1B,GAAG,MAAM,GAAG,EAAE,UAkBhC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@redvars/peacock",
|
|
3
3
|
"description": "The foundation for beautiful user interfaces",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -16,23 +16,24 @@
|
|
|
16
16
|
"./icon.js": "./dist/src/index.js"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"analyze": "cem analyze --config \"./custom-elements-manifest.config.mjs\" && node
|
|
20
|
-
"start": "
|
|
21
|
-
"build": "
|
|
19
|
+
"analyze": "cem analyze --config \"./custom-elements-manifest.config.mjs\" && node bin/typedoc-gen.mjs",
|
|
20
|
+
"start": "rollup -c && concurrently -k -r \"rollup -c -w\" \"web-dev-server\"",
|
|
21
|
+
"build": "rollup -c && npm run analyze -- --exclude dist",
|
|
22
22
|
"prepublish": "rollup -c && npm run analyze -- --exclude dist",
|
|
23
23
|
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
24
24
|
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
25
25
|
"prepare": "husky",
|
|
26
|
-
"copy_design_files": "node copyDesignFiles.js",
|
|
27
26
|
"test": "tsc && wtr --coverage",
|
|
28
27
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"
|
|
30
|
+
"@redvars/peacock-design-tokens": "^0.1.0",
|
|
31
|
+
"lit": "^3.1.4",
|
|
32
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
33
|
+
"rollup-plugin-postcss-lit": "^2.2.0"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
36
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
35
|
-
"@custom-elements-manifest/to-markdown": "^0.1.0",
|
|
36
37
|
"@open-wc/eslint-config": "^12.0.3",
|
|
37
38
|
"@open-wc/testing": "^4.0.0",
|
|
38
39
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -41,13 +42,13 @@
|
|
|
41
42
|
"@types/mocha": "^10.0.7",
|
|
42
43
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
43
44
|
"@typescript-eslint/parser": "^7.16.0",
|
|
44
|
-
"@wc-toolkit/
|
|
45
|
+
"@wc-toolkit/jsdoc-tags": "^1.1.0",
|
|
45
46
|
"@web/dev-server": "^0.4.6",
|
|
46
47
|
"@web/test-runner": "^0.18.2",
|
|
47
48
|
"concurrently": "^8.2.2",
|
|
48
|
-
"custom-element-jet-brains-integration": "^1.7.0",
|
|
49
49
|
"eslint": "^8.57.0",
|
|
50
50
|
"eslint-config-prettier": "^9.1.0",
|
|
51
|
+
"glob": "^13.0.0",
|
|
51
52
|
"husky": "^9.0.11",
|
|
52
53
|
"lint-staged": "^15.2.7",
|
|
53
54
|
"prettier": "^3.3.2",
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"rollup-plugin-summary": "^3.0.1",
|
|
60
61
|
"sass": "^1.97.2",
|
|
61
62
|
"tslib": "^2.6.3",
|
|
63
|
+
"typedoc": "^0.28.16",
|
|
62
64
|
"typescript": "^5.5.3",
|
|
63
65
|
"unplugin-jsdelivr": "^1.0.0"
|
|
64
66
|
},
|
package/readme.md
CHANGED
|
@@ -37,30 +37,18 @@ Visit [https://peacock.redvars.com](https://goatui.com) to view the documentatio
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
```html
|
|
40
|
-
<!doctype html>
|
|
41
|
-
<html lang='en'>
|
|
42
40
|
<head>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<title>Goat UI Component</title>
|
|
46
|
-
|
|
47
|
-
<link href="https://cdn.jsdelivr.net/npm/@redvars/components@3.1.0/dist/assets/styles/tokens.css" rel='stylesheet' />
|
|
48
|
-
|
|
49
|
-
<script type='module'
|
|
50
|
-
src='https://cdn.jsdelivr.net/npm/@redvars/components@3.1.0/dist/peacock-loader.js'></script>
|
|
51
|
-
|
|
52
|
-
<!-- Default font : Noto Sans and Noto Sans Mono -->
|
|
41
|
+
|
|
42
|
+
<!-- Default font : Noto Sans and Noto Sans Mono -->
|
|
53
43
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
54
44
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
55
45
|
<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">
|
|
56
46
|
|
|
57
|
-
|
|
47
|
+
<script type='module'
|
|
48
|
+
src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.1.2/dist/peacock-loader.js'></script>
|
|
58
49
|
</head>
|
|
59
|
-
<body>
|
|
60
|
-
<p-avatar name="Shivaji Varma"></p-icon>
|
|
61
50
|
|
|
62
|
-
|
|
63
|
-
</html>
|
|
51
|
+
<p-avatar name="Shivaji Varma"></p-avatar>
|
|
64
52
|
```
|
|
65
53
|
|
|
66
54
|
# Components
|
package/rollup.config.js
CHANGED
|
@@ -2,42 +2,84 @@ import typescript from '@rollup/plugin-typescript';
|
|
|
2
2
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
3
3
|
import css from 'rollup-plugin-import-css';
|
|
4
4
|
import copy from 'rollup-plugin-copy';
|
|
5
|
+
import { readFile } from 'node:fs/promises';
|
|
6
|
+
import { glob } from 'glob';
|
|
7
|
+
import postcssLit from 'rollup-plugin-postcss-lit';
|
|
8
|
+
import postcss from 'rollup-plugin-postcss';
|
|
9
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
5
10
|
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
export default async function () {
|
|
12
|
+
const files = await findLitComponents();
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
input: ['src/index.ts', 'src/peacock-loader.ts', ...files], // Your main TypeScript entry file
|
|
16
|
+
output: {
|
|
17
|
+
dir: 'dist',
|
|
18
|
+
format: 'esm', // Output as ES Modules (esm), also supports cjs, umd, etc.
|
|
19
|
+
sourcemap: true,
|
|
20
|
+
},
|
|
21
|
+
plugins: [
|
|
22
|
+
typescript(), // The plugin loads options from tsconfig.json by default
|
|
23
|
+
nodeResolve(),
|
|
24
|
+
commonjs(),
|
|
25
|
+
postcss(),
|
|
26
|
+
postcssLit({
|
|
27
|
+
include: 'src/**/*.scss',
|
|
28
|
+
}),
|
|
29
|
+
|
|
30
|
+
copy({
|
|
31
|
+
targets: [
|
|
32
|
+
{
|
|
33
|
+
src: '../readme.md',
|
|
34
|
+
dest: './',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
src: './node_modules/@redvars/peacock-design-tokens/dist/tokens.css',
|
|
38
|
+
dest: './dist/assets/styles/',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
27
43
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function findLitComponents(searchDir = 'src') {
|
|
48
|
+
console.log(`š Scanning for Lit components in "${searchDir}"...\n`);
|
|
49
|
+
/**
|
|
50
|
+
* We look for:
|
|
51
|
+
* 1. Lit imports
|
|
52
|
+
* 2. Class extensions
|
|
53
|
+
* 3. Custom element decorators
|
|
54
|
+
*/
|
|
55
|
+
const LIT_SIGNATURES = [/extends\s+LitElement/];
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
// glob() returns a Promise that resolves to an array of file paths
|
|
59
|
+
// We ignore node_modules and typical build folders
|
|
60
|
+
const files = await glob(`${searchDir}/**/*.{js,ts,mjs}`, {
|
|
61
|
+
ignore: ['**/node_modules/**', '**/dist/**', '**/build/**'],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const results = [];
|
|
65
|
+
|
|
66
|
+
for (const file of files) {
|
|
67
|
+
const content = await readFile(file, 'utf8');
|
|
68
|
+
|
|
69
|
+
// Check if any Lit-specific pattern exists in the file
|
|
70
|
+
const isLit = LIT_SIGNATURES.some(pattern => pattern.test(content));
|
|
71
|
+
|
|
72
|
+
if (isLit) {
|
|
73
|
+
results.push(file);
|
|
74
|
+
console.log(`ā
Found: ${file}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
console.log(
|
|
79
|
+
`\n⨠Search complete. Total Lit components: ${results.length}`,
|
|
80
|
+
);
|
|
81
|
+
return results;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('ā Error during scan:', error);
|
|
84
|
+
}
|
|
85
|
+
}
|
package/scratch.mjs
ADDED
|
File without changes
|
package/scss/mixin.scss
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
@mixin get-typography($name) {
|
|
3
|
+
font-family: var(--typography-#{$name}-font-family) !important;
|
|
4
|
+
font-size: var(--typography-#{$name}-font-size) !important;
|
|
5
|
+
font-weight: var(--typography-#{$name}-font-weight) !important;
|
|
6
|
+
line-height: var(--typography-#{$name}-line-height) !important;
|
|
7
|
+
letter-spacing: var(--typography-#{$name}-letter-spacing) !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin get-typography-not-important($name) {
|
|
11
|
+
font-family: var(--typography-#{$name}-font-family);
|
|
12
|
+
font-size: var(--typography-#{$name}-font-size);
|
|
13
|
+
font-weight: var(--typography-#{$name}-font-weight);
|
|
14
|
+
line-height: var(--typography-#{$name}-line-height);
|
|
15
|
+
letter-spacing: var(--typography-#{$name}-letter-spacing);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin focus-ring($color:var(--color-black)) {
|
|
19
|
+
outline: 2px solid $color;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@mixin for-phone-only {
|
|
23
|
+
@media (max-width: 671px) {
|
|
24
|
+
@content;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin for-tablet-portrait-up {
|
|
29
|
+
@media (min-width: 672px) {
|
|
30
|
+
@content;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@mixin for-tablet-landscape-up {
|
|
35
|
+
@media (min-width: 1056px) {
|
|
36
|
+
@content;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@mixin for-desktop-up {
|
|
41
|
+
@media (min-width: 1312px) {
|
|
42
|
+
@content;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@mixin for-big-desktop-up {
|
|
47
|
+
@media (min-width: 1584px) {
|
|
48
|
+
@content;
|
|
49
|
+
}
|
|
50
|
+
}
|