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

@smwb/summer-ui

v0.0.64

Published

Summer UI is full [**typescript**](https://www.typescriptlang.org/) library with **proto-type** supporting and based on [material](https://material.io/) guideline

Downloads

280

Readme

Summer UI

Summer UI is full typescript library with proto-type supporting and based on material guideline

license

Installation

Summer UI is available as an npm package.

Components demo is available here & Nightly builds ;)

npm:

npm install @smwb/summer-ui

yarn:

yarn add @smwb/summer-ui

Getting started with Summer UI

Here is an example of a basic app using Summer UI's Button component:

import * as React from "react";
import "@smwb/summer-ui/styles/normalize.css";
import "@smwb/summer-ui/styles/css/summer-ui.css";
import { Button } from "@smwb/summer-ui";

function App() {
  return <Button>Hello World</Button>;
}

Full library

If you want to use full library you would import components from project root

import { Button } from "@smwb/summer-ui";

Only component

If you need minify your project you can import just several components from direct path

import Button from "@smwb/summer-ui/dist/components/button/button";

Styles

Dark & Light themes

For build-in dark&light themes use the useTheme hook. This hook returns the current theme and a callback for changing the theme:

import "@smwb/summer-ui/styles/normalize.css";
import "@smwb/summer-ui/styles/css/summer-ui.css";
import { Button } from "@smwb/summer-ui";
import { useTheme } from "@smwb/summer-ui";

function App() {
  const { theme, setTheme } = useTheme();

  return <Button onClick={() => setTheme("dark")} />;
}

Default CSS

import "@smwb/summer-ui/styles/normalize.css";
import "@smwb/summer-ui/styles/css/summer-ui.css";

Custom CSS

Using one of built-in themes
  • theme list node_modules/@smwb/summer-ui/styles/less/themes
  • copy node_modules/@smwb/summer-ui/theme.config.example to the project root and rename to theme.config
  • add script to package.json "less": "lessc -rp=/ ./node_modules/@smwb/summer-ui/styles/less/components.less src/css/summer-ui.css"
  • execute npm run less
  • import css in the project root
import "./css/summer-ui.css";
Using own theme
  • copy file node_modules/@smwb/summer-ui/styles/less/variables.less to folder /src/css/custom
  • copy file node_modules/@smwb/summer-ui/theme.config.example to the project root
    • rename theme.config.example to theme.config
    • edit theme.config @theme to @theme: "custom"
    • edit theme.config @themesFolder to @themesFolder : "/src/css";
  • edit custom.variables.less
  • add script to package.json "less": "lessc -rp=/ ./node_modules/@smwb/summer-ui/styles/less/components.less src/css/summer-ui.css"
  • execute npm run less
  • import css in the project root
import "./css/summer-ui.css";

Integrations

react-final-form

Form demo is available here

Installation:

npm install --save final-form react-final-form
import { Form } from "react-final-form";
import { TextField } from "@smwb/summer-ui/connects/rff";
import { Button } from "@smwb/summer-ui";

interface IForm {
  name: string;
  email: string;
}

const MyForm = () => {
  const onSubmit = (values: IForm) => {
    console.log(values);
  };

  const initialValues: Partial<IForm> = {
    name: "",
    email: "",
  };

  const required = (value: string) => (value ? undefined : "Required Field");

  return (
    <Form
      initialValues={initialValues}
      onSubmit={onSubmit}
      render={({ handleSubmit, values, submitting }) => {
        return (
          <form style={{ display: "flex", gap: "20px", flexDirection: "column" }} onSubmit={handleSubmit}>
            <TextField placeholder="Name" validate={required} name="name" label="Name" />
            <TextField placeholder="Email" validate={required} name="email" type="email" label="Email" />

            <Button type="submit" disabled={submitting}>
              Submit Form
            </Button>
          </form>
        );
      }}
    />
  );
};

react-table

Table demo is available here

Installation:

npm install react-table --save
import { Column, useTable } from "react-table";
import { Table } from "@smwb/summer-ui/connects/rt";

type Item = {
  name: string;
  lastName: string;
  age: number;
};

const columns: ColumnDef<Item>[] = [
  {
    header: "Name",
    cell: (row) => row.renderValue(),
    accessorKey: "name",
  },
  {
    header: "Age",
    cell: (row) => row.renderValue(),
    accessorKey: "age",
  },
  {
    header: "Last Name",
    cell: (row) => row.renderValue(),
    accessorKey: "lastName",
  },
];

const data: Item[] = [
  { name: "First", age: 20, lastName: "Dach" },
  { name: "Alex", age: 10, lastName: "Fax" },
  { name: "John", age: 35, lastName: "Doe" },
  { name: "Bax", age: 30, lastName: "Heller" },
  { name: "Second", age: 47, lastName: "Name" },
  { name: "Abc", age: 14, lastName: "Def" },
];

export const Table = () => {

  return (
    <Table columns={columns} data={data} />;
  );
};