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

@hotosm/ui

v0.2.0-b6

Published

Shared UI components with HOT theming.

Downloads

378

Readme

HOT Shared UI


Shared UI Components with HOT Theming

This repository contains HOT themed UI components to reduce code duplication and simplify the lives of developers needing to prototype and develop well designed web applications quickly.

They are available as Web Components with support for usage in almost all modern web frameworks.

The main goal of this project is not to re-invent the wheel, or add an extra burden of development and maintenance.

Quick start

There are two options: NPM and Components Bundle.

NPM

Appropriate for applications that have installable dependencies

npm install @hotosm/ui

Import the library in your project and use the components.

<script>
  import '@hotosm/ui/dist/style.css';
  import '@hotosm/ui/dist/hotosm-ui.js';
</script>
<hot-logo><hot-logo>

React

  import { Logo } from '@hotosm/ui/components/react';
<Logo />

Components Bundle

  • This is the compiled JavaScript bundle generated from the TypeScript code.
  • The components require no additional dependencies and are minified.

Appropriate for HTML / Markdown / HTMX.

<link
  rel="stylesheet"
  href="https://s3.amazonaws.com/hotosm-ui/latest/dist/style.css"
/>

<script
  type="module"
  src="https://s3.amazonaws.com/hotosm-ui/latest/dist/hotosm-ui.js"
></script>

<hot-logo></hot-logo>

Using Extra Shoelace Components

The HOT UI library contains many composite components, such as headers, sidebars, tracking banners, etc, and does not re-invent the wheel for low-level components.

Shoelace is an UI library that is exported directly from @hotosm/ui.

To access the low-level components, such as buttons, dropdowns, modals, etc, simply import the component of the same name from the [Shoelace docs] (https://shoelace.style):

import '@hotosm/ui/components/button/button';
<hot-button disabled variant="secondary">Can't Click Me</hot-button>

React Shoelace Wrappers

import { Button } from '@hotosm/ui/components';
<Button disabled variant="secondary">Can't Click Me</Button>

Examples

You can found examples for HTML and also all common frameworks (React, Svelte, Vue) under /examples.

Development

HOT UI is developed in TypeScript, using Lit and @lit/react.

Primarily we want to have:

  • Low level components exported from the Shoelace web component library, simply re-exported with our default styling / CSS overrides.
  • A few composite components (header, sidebar, etc):
    • Consistent styling across most of our tools where it counts.
    • Reduction in duplicated logic, such as user management, OAuth login, etc.
  • Improved developer experience, reduced development time for new tools, while maintaining consistency in look and feel of applications.

How to contribute

  • Clone the project git clone [email protected]:hotosm/ui.git
  • Install dependencies pnpm install
  • Run the storybook pnpm run dev
  • Write code!

There's also a React storybook that you can use for testing:

  • Run the React storybook pnpm run dev-react

For styling, check /theme:

  • hot-sl.css has a Shoelace theme, re-defining styles variables

License

HOT UI is free and open source software! you may use any HOT UI project under the terms of the GNU Affero General Public License (AGPL) Version 3.