
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
A modern, tree-shakeable React UI component library built on top of Material-UI, featuring enhanced components with additional functionality and TypeScript support.
npm install tui-lib2
Make sure you have these peer dependencies installed:
npm install react react-dom @mui/material @emotion/react @emotion/styled
import React from "react";
import { Button, ThemeProvider, lightTheme } from "tui-lib2";
function App() {
return (
<ThemeProvider theme={lightTheme}>
<Button variant="contained" color="primary">
Hello World
</Button>
</ThemeProvider>
);
}
Enhanced button component with loading states and improved composition.
import { Button } from 'tui-lib2';
// Basic usage
<Button variant="contained" color="primary">
Click me
</Button>
// With loading state
<Button
variant="contained"
loading={true}
loadingPosition="start"
startIcon={<SaveIcon />}
>
Save
</Button>
// With icons
<Button
variant="outlined"
startIcon={<AddIcon />}
endIcon={<SendIcon />}
>
Add & Send
</Button>
Prop | Type | Default | Description |
---|---|---|---|
variant | 'text' | 'outlined' | 'contained' | 'text' | The variant to use |
color | 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | 'primary' | The color of the component |
size | 'small' | 'medium' | 'large' | 'medium' | The size of the component |
loading | boolean | false | If true, shows loading indicator |
loadingPosition | 'start' | 'center' | 'end' | 'center' | Position of loading indicator |
disabled | boolean | false | If true, the component is disabled |
Enhanced theme provider with pre-built themes and custom theme support.
import {
ThemeProvider,
lightTheme,
darkTheme,
createTheme
} from "tui-lib2";
// With pre-built light theme
<ThemeProvider theme={lightTheme}>
<App />
</ThemeProvider>
// With pre-built dark theme
<ThemeProvider theme={darkTheme}>
<App />
</ThemeProvider>
// With custom theme
const customTheme = createTheme({
palette: {
primary: {
main: "#6366f1",
},
},
});
<ThemeProvider theme={customTheme}>
<App />
</ThemeProvider>
The library comes with carefully crafted light and dark themes:
subtle
and subtleWhite
colors// Using custom colors
<Button variant="contained" color="subtle">
Subtle Button
</Button>
<Button variant="outlined" color="subtleWhite">
Subtle White Button
</Button>
This library is optimized for tree shaking. You can import components individually:
// ✅ Good - Tree shakeable
import { Button } from "tui-lib2";
// ✅ Also good - Individual import
import Button from "tui-lib2/dist/components/Button";
// ❌ Avoid - Imports everything
import * as TUI from "tui-lib2";
Full TypeScript support with exported types:
import { ButtonProps, ThemeProviderProps } from "tui-lib2";
// Component with typed props
const MyButton: React.FC<ButtonProps> = (props) => {
return <Button {...props} />;
};
import type {
// Component Props
ButtonProps,
ThemeProviderProps,
// Shared Types
BaseComponentProps,
ComponentSize,
ComponentColor,
ComponentVariant,
LoadingPosition,
// Material-UI Re-exports
Theme,
SxProps,
} from "tui-lib2";
import { ThemeProvider, createTheme } from "@mui/material/styles";
const theme = createTheme({
palette: {
primary: {
main: "#6366f1",
},
secondary: {
main: "#ec4899",
},
},
shape: {
borderRadius: 12,
},
});
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>;
Use the sx
prop for custom styling:
<Button
variant="contained"
sx={{
borderRadius: "20px",
textTransform: "none",
fontWeight: "bold",
}}
>
Custom Styled Button
</Button>
Comprehensive component documentation is available via Storybook:
npm run storybook
Visit http://localhost:6006
to view the interactive documentation.
npm run build
This creates both ESM and CJS builds in the dist
folder.
npm run build:watch
npm run storybook
Analyze bundle size:
npm run analyze
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Modern React UI component library built on Material-UI
The npm package tui-lib22 receives a total of 52 weekly downloads. As such, tui-lib22 popularity was classified as not popular.
We found that tui-lib22 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.