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

serto-ui-hashmark

v0.4.3-6

Published

UI components for the decentralized identity ecosystem

Downloads

11

Readme

Serto UI

CircleCI codecov

Install

npm install --save serto-ui styled-components react
# or
yarn add serto-ui styled-components react

Usage

import React from "react";
import { SertoUiProvider, Credential, CredentialViewTypes } from "serto-ui";

const vc = {
  "@context": ["https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1"],
  type: ["VerifiableCredential", "DiplomaCredential"],
  issuer: "did:ethr:rinkeby:0xabc123",
  issuanceDate: "2017-12-05T14:27:42Z",
  credentialSubject: {
    id: "did:ethr:rinkeby:0x123abc",
    degree: "Bachelor of Science in Examples",
    alumniOf: "Example University",
  },
  proof: {
    jwt: "eyJ0eXAiO0000000000etc",
  },
};

const ExampleComponent = () => {
  return (
    <SertoUiProvider>
      <Credential vc={vc} viewType={CredentialViewTypes.COLLAPSIBLE} />
    </SertoUiProvider>
  );
};

Context provider and theme

Serto UI uses Rimble for many elements. The <SertoUiProvider> in the above example sets up the default Serto UI theme that will be used by any child components that use Rimble - this provider should wrap instances of Serto UI components, or your entire app for convenience. You may alternately exclude the provider to use default Rimble styling, or replace the Serto UI styles by passing your own theme prop into the provider. See IdentityTheme.tsx for details about the theme.

Some components also query this provider for values in SertoUiContext. These can be provided by passing the desired context as the value prop into the provider. See App.tsx for an example of this.

Development

Local development alongside your app

If you wish to work on the Serto UI library while importing it into your own app, you can do so for instance using npm link or yarn link.

Set up the Serto UI repo:

git clone https://github.com/SertoID/serto-ui.git
yarn install
yarn link
yarn run watch

In your app you can then run:

yarn link serto-ui

Your app will now use your local copy of Serto UI and should receive any changes as you make them.

Standalone Serto UI development

If you wish to work on the Serto UI library directly, you can do so without another app:

git clone https://github.com/SertoID/serto-ui.git
cd serto-ui
yarn install
yarn run install-peer-deps

You can now run yarn run storybook to work on individual components, or yarn run server:start to run the example create-react-app app.

Note that once you have run install-peer-deps in your local Serto UI library, if you are linking it to your app then your app will end up with duplicate copies of Serto UI's package.json's peerDependencies, and so React (and styled-components if you are using that) will probably break. To resolve this, you will have to link these dependencies: navigate to <your-app>/node_modules/react and run yarn link, and then return to the serto-ui directory and run yarn link react (and repeat for any other peer dependencies that are causing issues, like react-dom and react-router-dom). See this article for more context. Alternately, you can delete serto-ui/node_modules, re-run yarn install, and do not install peer dependencies.