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

ad-mui-theme-package

v0.0.54

Published

Package for transform ADE design token in mui theme

Downloads

26

Readme

New theme and design token

This new theme is designed to have different mode (ade, esd, esp, eac...)

Installation

How to start the project

How to use it

How to deploy package to npm

Installation

With yarn

$ yarn add ad-mui-theme-package @mui/material @emotion/react @emotion/styled

With npm

$ npm install ad-mui-theme-package @mui/material @emotion/react @emotion/styled

How to start

$ make start-storybook

This command build package and install dependencies for storybook. Then it launch storybook on port 6006.

How to use it

Import theme in your app

To use the theme you need to import the provider and wrap your app with it.

import { CustomThemeProvider } from "ad-mui-theme-package";

const App = () => {
  return (
    <CustomThemeProvider mode="ade">
      <div>My app</div>
    </CustomThemeProvider>
  );
};

Theme you can use with this package

ADE | ESP

Use the theme in your component

To use the theme in your component mui component

// import mui component
import { Button } from "@mui/material";

const MyComponent = () => {
  // use theme here
  return <Button color="primary">My component</Button>;
};

Use the theme in your component with sx

To use the theme in your component with sx

// import mui component
import { Button } from "@mui/material";

const MyComponent = () => {
  return (
    <Button
      sx={{
        // use theme here
        color: "primary",
      }}
    >
      My component
    </Button>
  );
};

Use the theme in sx with useTheme

To use the theme in your component you need to import the hook useTheme and use it.

// import useTheme from mui
import { useTheme } from "@mui/material";

const MyComponent = () => {
  // create theme const for use it
  const theme = useTheme();

  return (
    <Box
      sx={{
        // use theme here
        backgroundColor: theme.palette.primary.main,
      }}
    >
      My component
    </Box>
  );
};

Use the theme in sx with useTheme and callback

To use the theme in your component you need to import the hook useTheme and use it.

// import useTheme from mui
import { Theme, useTheme } from "@mui/material";

const MyComponent = () => {
  // create theme const for use it
  const theme = useTheme();

  // use theme here
  // type your theme with mui type
  return (
    <Box
      sx={{
        backgroundColor: (theme: Theme) => theme.palette.primary.main,
      }}
    >
      My component
    </Box>
  );
};

StyledTabs & StyledTab

Components StyledTabs & StyledTab doesn't exist now use Tabs & Tab from @mui/material and it's automatically styled with the theme.

Input phone disabled

If you want to disable the input phone you need to add className disabled and disabled properties to the component PhoneInput.

const CustomInputPhone = ({ ...rest }: PhoneInputProps) => {
  return (
    <>
      <Grid container spacing={2}>
        <InputLabel>
          <Label field={field} />
        </InputLabel>
        <PhoneInput containerClass={"disabled"} disabled={true} {...rest} />
      </Grid>
    </>
  );
};

export default CustomInputPhone;

Custom IconButton

If you want to use custom IconButton you need to import IconButton from @mui/material and add variant props. You can use all color from the theme but you need to add -contained, -outlined, -soft or -ghost at the end of the color.

import { IconButton } from "@mui/material";

const MyComponent = () => {
  return (
    <IconButton variant="primary-contained">
      <Icon />
    </IconButton>
  );
};

How to deploy

Run the following commands to deploy the package to npm.

These commands trigger a workflow that will build the package, publish it to npm, and create a new Github version.

⚠️ The new version takes the version of the tag so be careful, the tag of the new version must be greater than the last published version. Otherwise, the workflow will fail. ⚠️

$ git add <files>
$ git commit -m "<message>"
$ git push
$ git tag <newVersion>
$ git push --tags