npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@creativecommons/cc-global-components

v0.5.0

Published

Global components used across Creative Commons web properties.

Downloads

10

Readme

cc-global-components

Vue.js components for consistent navigation and branding across Creative Commons web properties

Status

Development: This project is currently in development.

Overview

This project is built using vue-sfc-rollup which is is a CLI templating utility that scaffolds a minimal setup for compiling a Vue library - into a form ready to share via npm or via CDN.

The folder structure is as follows:

  • build/ : This has the rollup config for compiling files.
  • dev/: Use for serving the components for local testing during development.
  • src: This directory contains a sub-directory:
    • components: This is where our components code is found. For this project, we have three components:
      • cc-explore.vue: The component for the Explore CC banner.
      • cc-global-header.vue: The component for the Global Navigation Menus
      • cc-global-footer.vue: The component for the Global CC footer.
      • index.js: Where our components are exported. Any new component must be registered in this file.

Components

CC Explore

CC Explore requires a donation-url attribute which is the URL used for the Donation button and a logo-url attribute which is the location of the logo for the CC Web property this component is used on.

<cc-explore
  donation-url="http://example.com"
  logo-url="/example/logo-white.png"
/>

CC Global Header

The CC Global Header has three required attributes, base-url, donation-url and logo-url, which are the URLs used for the API call, Donation button and Logo respectively. There is one additional attribute useMenuPlaceholders you can set which renders placeholder Menu Items if you are in a development environment. However, if you have WordPress setup correctly and you want to test this component with real Nav Menu items, you should not pass the useMenuPlaceholders attribute. For a development environment, an example of a base-url is http://127.0.0.1:8000.

<cc-global-header
  base-url="http://127.0.0.1:8000"
  donation-url="http:/example.com"
  use-menu-placeholders
  logo-url="/example/logo-black.png"
/>

CC Global Footer

CC Global Footer requires a donation-url attribute which is the URL used for the Donation button and a logo-url attribute which is the location of the logo for the CC Web property this component is used on.

<cc-global-footer
  donation-url="http://example.com"
  logo-url="/example/logo-white.png"
/>

Mixed Content Issues for the logo-url attribute

Mixed content occurs when initial HTML is loaded over a secure HTTPS connection, but other resources (such as images) are loaded over an insecure HTTP connection. Most modern browsers don't display pages with mixed content correctly so it is worth noting that the URL entered into the logo-url attribute be appropriately served over HTTPS.

Usage

Integrate the CC Global Components into downstream projects with the following steps.

  1. Add Vue JS via CDN
  2. Add the stylesheets for Fonts and Vocabulary
  3. Include the CC Global Components from CDN
  4. Create a parent div element with class container so as to add a default left and right padding to the components. The CC-Global-Footer can be excluded from this parent element since it's required to have a full width.
  5. Add the desired component(s) to your template within a container div
  6. Render the components in the template via JavaScript

Example for the cc-explore component:

<link
  rel="stylesheet"
  href="https://unpkg.com/@creativecommons/[email protected]/dist/css/fonts.css"
/>
<link
  rel="stylesheet"
  href="https://unpkg.com/@creativecommons/[email protected]/dist/css/vocabulary-styles.css"
/>
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/@creativecommons/[email protected]/dist/cc-globals.min.js"></script>

<div class="container">
  <div id="explore-cc">
    <cc-explore
      donation-url="http://example.com"
      logo-url="/example/logo-white.png"
    />
  </div>
</div>

<script>
  const cc_explore = Vue.createApp({});
  cc_explore.use(CcGlobal);
  cc_explore.mount("#explore-cc");
</script>

For the cc-global-header component, you will need to add Axios via CDN:

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

Development

See our contributing guide.

License