0.0.80 • Published 4 days ago

mui-industrial v0.0.80

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

📑 mui-industrial

npm.io npm.io npm.io npm.io

NOTE: Project is still in development and is not yet ready for production use. Use without caution.


A zero-maintenance/batteries-included panel manager inspired by VSCode style/aspect that adds via Material-UI (5) elements a self populating/managed and state keeping organization of generated children status bar elements, panels, shortcuts and more.

A root level ContextAPI driven provider/wrapper that allows for the creation of status bars with a variety of elements that can be clicked or have a menu attached to them. The status bar is a self organizing manager that can be placed on either end of the screen and can be configured to even feature consoles and other elements.


💡 See it and learn it

A few links to get you going:


📦 Features

  • Zero Maintenance - No need to worry about managing the state of the panels, the library will handle it for you.
  • Batteries Included - The library comes with a variety of pre-built components that can be used out of the box.
  • Customizable - The library is built on top of MUI and Emotion, so you can customize it to your liking.
  • Easy to use - The library is built to be easy to use and understand.
  • TypeScript - The library is written in TypeScript and comes with type definitions.
  • React 17+ - The library is built on top of React 17+.
  • MUI 5+ - The library is built on top of MUI 5+.

🪄 Installation

Install the latest version with your favorite package manager.

npm install @rand0mC0d3r/mui-industrial --save
yarn i @rand0mC0d3r/mui-industrial

Quick start for your project

import { IndustrialProvider } from 'mui-industrial'
...


function App() {
  ...

  return <>
    ...
    <IndustrialProvider>
      ... your content
      <Status ...>[] // status elements
    </IndustrialProvider>
    ...
  </>
}

export default App

Industrial Provider

The Industrial Provider is the root level component that will provide the context for the status bar and its elements.

PropertyTypeDefaultDescription
positionPlacementPositiontopThe position of the status bar.
childrenReact.ReactNodeundefinedThe children of the provider.

|


<Status> #component

The status component is the primary component that will be used to create the status bar elements. It comes with a handy template that can be used to create a variety of elements. Also it comes in 3 flavors, as a simple status bar, as a status bar with a console and as a status bar with a popper.

DEMO : https://codesandbox.io/s/sample-mui-industrial-status-sample-6xv735?file=/src/App.tsx

<Status>.Template

lorem ipsum dolor sit amet ...

as DEFAULT

lorem ipsum dolor sit amet ...

as CONSOLE

lorem ipsum dolor sit amet ...

as POPPER

lorem ipsum dolor sit amet ...

Hooks

useSnackbars()

There are 2 hooks provided for snackbar population/cleanup: handleSnackbarRegister and handleSnackbarCleaning and a data store partition holding the snackbar current messages: snackbars.

import { useSnackbars } from 'mui-industrial'


export default function () {
  const { snackbars, handleSnackbarRegister, handleSnackbarCleaning } =  useRegisterSnackbar()

  const generateInfoNotification = (message = 'Sample Info Notification') => {
    handleSnackbarRegister({
      message,
      source: 'AutoFixer',
      severity: Severity.INFO,
    })
  }

  const cleanAllNotifications = () => {
    handleSnackbarCleaning()
  }

  return <>
    {snackbars.map(({ id }) => <> ... </>)}
    <button onClick={generateInfoNotification}>Create sample notification</button>
    <button onClick={cleanAllNotifications}>Clear all notifications</button>
  </>
}

The handleSnackbarRegister allows you to create a snackbar that will be displayed on the screen.

PropertyTypeDefaultDescription
severitySnackbarSeverityinfoThe severity of the snackbar.
actionsReact.ReactNodeundefinedThe actions of the snackbar.
sourcestringundefinedThe source of the snackbar.
messagestringundefinedThe message of the snackbar.
codestringundefinedThe code of the snackbar.
autoHideDurationnumberundefinedThe auto hide duration of the snackbar.

The handleSnackbarCleaning allows you to clean all the snackbar messages from the screen.


Dependencies expected (peerDependencies)

The library is built on top of the following dependencies:

  • React && ReactDOM 17.0+
  • MUI 5.0+ && MUI Icons-Material 5.0+
  • inherited via MUI - MUI Styles 5.0+ & Emotion React 11.0+ & Emotion Styled 11.0+

    and related @types

    External package dependencies

  • Re-Resizable 6.9.9+

  • React-Resizable 3.0.4
0.0.80

4 days ago

0.0.79

4 days ago

0.0.74

5 months ago

0.0.75

5 months ago

0.0.76

5 months ago

0.0.77

5 months ago

0.0.78

5 months ago

0.0.73

8 months ago

0.0.64

9 months ago

0.0.65

9 months ago

0.0.66

9 months ago

0.0.67

9 months ago

0.0.68

8 months ago

0.0.69

8 months ago

0.0.70

8 months ago

0.0.71

8 months ago

0.0.72

8 months ago

0.0.63

1 year ago

0.0.62

1 year ago

0.0.61

1 year ago

0.0.60

1 year ago

0.0.59

1 year ago

0.0.57

1 year ago

0.0.56

1 year ago

0.0.55

1 year ago

0.0.54

1 year ago