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

@masa-dev/mui-enhance

v1.1.0

Published

This package enhances MUI.

Downloads

400

Readme

Mui Enhance

This package enhances MUI.

Screenshot

MUI Enhance

Install

npm i @masa-dev/mui-enhance

Usage

import { A, H1, H2, H3, H4, H5, H6, HtmlSanitizedContent, P } from '@masa-dev/mui-enhance';
import { SpanButton } from '@masa-dev/mui-enhance/client';
import { NumberInput, PercentageInput } from '@masa-dev/mui-enhance/client/inputs';
import { Box, Stack } from '@mui/material';
import React from 'react';

export default function App() {
    return <Stack>
        <Headers />
        <Paragraphs />
        <LinksAndButtons />
        <HTMLs />
        <Inputs />
        <InputsWithReactHookForm />
    </Stack >
}

function Headers() {
    return <Group name="Headers">
        <H1>MUI Header1</H1>
        <H2>MUI Header2</H2>
        <H3>MUI Header3</H3>
        <H4>MUI Header4</H4>
        <H5>MUI Header5</H5>
        <H6>MUI Header6</H6>
    </Group>
}

function Paragraphs() {
    return <Group name="Paragraphs">
        <P>MUI Paragraph</P>
    </Group>
}

function LinksAndButtons() {
    return <Group name="Links and Buttons">
        <A href="https://google.com">MUI Link</A>
        <SpanButton onClick={() => alert('clicked')}>SpanButton</SpanButton>
    </Group>
}

function HTMLs() {
    return <Group name="HTML">
        <HtmlSanitizedContent html={"<p>script in html is <b>sanitized</b></p><script>alert('Hello World!')</script>"} />
    </Group>
}

function Inputs() {
    const [n, setN] = React.useState(0);
    const [currency, setCurrency] = React.useState(0);
    const [percentage, setPercentage] = React.useState(0);
    return <Group name="Inputs">
        {n}
        <NumberInput value={n} onChange={setN} />
        {currency}
        <NumberInput endText='JPY' value={currency} onChange={(v) => setCurrency(v)} />
        {percentage}
        <PercentageInput value={percentage} onChange={(v) => setPercentage(v)} />
    </Group>
}

function InputsWithReactHookForm() {
    const { register, watch } = useForm({ defaultValues: { n: 0, currency: 0, percentage: 0 } });
    const n = watch('n');
    const currency = watch('currency');
    const percentage = watch('percentage');
    return <Group name="Inputs with React Hook Form">
        {n}
        <NumberInput {...register('n')} />
        {currency}
        <NumberInput endText='JPY' {...register('currency')} />
        {percentage}
        <PercentageInput {...register('percentage')} />
    </Group>
}

function Group(props: { name: string, children: React.ReactNode }) {
    return <Stack sx={{ padding: 1 }}>
        <Box sx={{ background: "#999", color: "white", padding: "0.3em 0.8em" }}>{props.name}</Box>
        <Stack sx={{ padding: 2 }}>
            {props.children}
        </Stack>
    </Stack>
}

License

MIT