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

cd-lg-design-system

v0.0.2

Published

Web Components for Les Grappes.

Downloads

1

Readme

Built With Stencil npm package minified size downloads per month commits per month

Calcite Components

Calcite Components, part of Esri's Calcite Design System, is a rich library of flexible, framework-agnostic web components for building applications. View the documentation for component descriptions, examples, and API reference, which includes properties, slots, styles, and theming.

Use the CDN

The most common approach for loading Calcite Components is to use the version hosted on the CDN. The components can be loaded via <script> and <link> tags in the head of your HTML document:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@esri/[email protected]/dist/calcite/calcite.esm.js"
></script>
<link
  rel="stylesheet"
  type="text/css"
  href="https://cdn.jsdelivr.net/npm/@esri/[email protected]/dist/calcite/calcite.css"
/>

Once these tags are added, components can be used like any other HTML element. Only components that are used in the application will be loaded.

Use the NPM package

Calcite Components is also provided as an NPM package. To get started, first install the package, then follow the steps below. Alternatively, you can find examples using different frameworks and build tools here.

npm install @esri/calcite-components

1. Build

Choose one of the two builds provided by Calcite Components.

Custom Elements

Custom Elements is the recommended build when leveraging a frontend framework. To use this build, you will need to set the path to Calcite Components' assets. You can either use local assets, which will be explained in a subsequent step, or assets hosted on the CDN.

import { setAssetPath } from "@esri/calcite-components/dist/components";
// CDN hosted assets
setAssetPath("https://cdn.jsdelivr.net/npm/@esri/calcite-components/dist/calcite/assets");

// Local assets
// setAssetPath(PATH); // PATH depends on framework, more info below

Next, you need to import each component you use from the custom elements build. This will automatically define the custom elements on the window.

import "@esri/calcite-components/dist/components/calcite-button";
import "@esri/calcite-components/dist/components/calcite-icon";
import "@esri/calcite-components/dist/components/calcite-slider";

Distribution

When using the Distribution build, you'll need to define the custom elements on the window. You can also choose between local and CDN hosted assets.

import { defineCustomElements } from "@esri/calcite-components/dist/loader";
// CDN hosted assets
defineCustomElements(window, {
  resourcesUrl: "https://cdn.jsdelivr.net/npm/@esri/calcite-components/dist/calcite/assets",
});

// Local assets
// defineCustomElements(window);

Since you defined the custom elements on the window, you do not need to import individual components.

2. Assets

Some components, such as calcite-icon and calcite-date-picker, rely on assets being available at a particular path. As mentioned, with the NPM package you have the option to provide a local path or the URL to the assets hosted on the CDN. Using the CDN hosted assets can help decrease on disk build size.

To use the assets locally, they need to be copied using a build tool or NPM script. The directory for the local assets must be named assets, which eases the copying process. For example, /public/calcite/assets will work, however /public/calcite-assets will not.

The Calcite Components examples repo demonstrates using local assets in a variety of JavaScript frameworks and build tools. Each example has a README with a framework or build tool specific explanation.

cp -r node_modules/@esri/calcite-components/dist/calcite/assets/* ./public/assets/

3. Styles

Finally, load the Cascading Style Sheet (CSS). This is also dependent on your framework or build tool, however in many cases it can be imported in JavaScript:

import "@esri/calcite-components/dist/calcite/calcite.css";

TypeScript

Stencil provides a full set of typings for all the components in this repo. To make TypeScript aware of these components, just import the library:

import "@esri/calcite-components";

This will provide autocomplete of component names/properties, as well as additional HTML element types:

// created elements will implicitly have the correct type already
const loader = document.createElement("calcite-loader");
document.body.appendChild(loader);
loader.active = true;

// you can also explicitly type an element using the generated types
// the type name will always be formatted like HTML{CamelCaseComponentName}Element
const loader = document.querySelector(".my-loader-element") as HTMLCalciteLoaderElement;
loader.active = true;

@stencil/core Version

When using Stencil, make sure the @stencil/core version in your project matches the one used by Calcite Components. You may run into type errors if the @stencil/core versions are different. You can install the same Stencil version used by @esri/calcite-components:

npm install @stencil/core@$(npm view @esri/calcite-components dependencies["@stencil/core"])

Browser Support

Contributing

We welcome contributions to this project. See CONTRIBUTING.md for an overview of contribution guidelines.

License

COPYRIGHT © 2023 Esri

All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.

This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.

See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english

For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA

email: [email protected]