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

@ukic/canary-web-components

v2.0.0-canary.30

Published

A web component UI library compiled with StencilJS

Downloads

18,653

Readme

[Canary]: The UK Intelligence Community Web Components UI Kit

OGL V3 License MIT License

The Intelligence Community Design System helps the United Kingdom's Intelligence Community (MI6, GCHQ, MI5, and partners) to quickly build powerful capabilities that are accessible and easy to use.

This is a joint project led by MI6, working with GCHQ and MI5.

Installing

To install the components:

Step one

In the root of your project:

// using npm
npm install @ukic/canary-web-components @ukic/fonts

// using yarn
rm package-lock.json
yarn add @ukic/canary-web-components @ukic/fonts

Step two

Import defineCustomElements in your file. Where you do this will depend on your framework or build tool, but the format is as follows:

import { defineCustomElements } from "@ukic/canary-web-components/loader";

Step three

Call defineCustomElements in your file. Again, the file you edit will depend on your framework or build tool, but the format is as follows:

//other code
...
defineCustomElements();

Step four

In your HTML, you can now declare a component as follows:

<ic-data-table ...></ic-data-table>

Step five

To get the correct styling with the ICDS components, import the core CSS file. Depending on your framework or build tool, this can be included in either a CSS file or Javascript\Typescript file.

Add the following into the top level CSS file for your project.

@import "@ukic/fonts/dist/fonts.css";
/* Include @import "@ukic/web-components/dist/core/core.css if used alongside @ukic/web-components package */
@import "@ukic/canary-web-components/dist/core/core.css";

In order to be rendered consistently across browsers and in line with modern standards, each of the ICDS components uses styles from a global CSS file based on Normalize.css.

If you would like to import these styles to apply them to the rest of your project and slotted elements used within any of the ICDS components, add the following into the top level CSS file as well.

@import "@ukic/canary-web-components/dist/core/normalize.css";

Webpack example

Webpack is a tool for bundling web applications. This example assumes the following config in webpack.config.js. For more detailed information on Webpack configuration, please refer to the Webpack documentation.

const path = require("path");

module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "main.js",
    path: path.resolve(__dirname, "dist"),
  },
  devServer: {
    static: "./dist",
  },
  mode: "development",
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: ["style-loader", "css-loader"],
      },
    ],
  },
};

Step one

// using npm
npm install @ukic/canary-web-components @ukic/fonts

// using yarn
rm package-lock.json
yarn add @ukic/canary-web-components @ukic/fonts

Step two

In the file defined as the entry in the webpack.config.js, add the following:

//src/index.js
import "@ukic/fonts/dist/fonts.css";
import "@ukic/canary-web-components/dist/core/core.css";

import { defineCustomElements } from "@ukic/canary-web-components/loader";

defineCustomElements();

Step three

You can now use any of the ICDS components so long as your HTML page includes the output file defined in your webpack.config.js. For example, including an ic-status-tag below:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Getting Started with ICDS</title>
  </head>
  <body>
    <script src="dist/main.js"></script>
    <ic-data-table ....></ic-data-table>
  </body>
</html>

Contributing

We have a couple of resources to help you with contributing.

Security

If you've found a vulnerability, we want to know so that we can fix it. Our security policy tells you how to do this.

Questions about the departments

The team is only able to talk about the projects we've put on GitHub 🕵️. We unfortunately can't talk about the work of our departments 😢.

Visit our websites to learn more about:

Known Issues

At the time of writing, there is an issue with importing Stencil components into another Stencil component library for Unit tests. The current workaround is to initially build and test the canary component within the web components directory and then move across when ready.

License

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation. The documentation is and available under the terms of the Open Government License v3.0.

© Crown copyright 2022