A comprehensive React component library with Tailwind CSS styling for Proprietary PuzzleHR Apps
npm install puzzlehr-componentsA comprehensive React component library built with TypeScript and styled with Tailwind CSS.
``bash`
npm install @puzzle/components
This package requires the following peer dependencies to be installed in your project:
`bash`
npm install react react-dom react-router-dom @fortawesome/react-fontawesome @fortawesome/free-solid-svg-icons tailwindcss
Import the component styles in your main CSS file or at the root of your application:
`css`
@import '@puzzle/components/dist/colors.css';
Make sure your tailwind.config.js includes the component library in the content array:
`javascript`
module.exports = {
content: [
"./src/*/.{js,jsx,ts,tsx}",
"./node_modules/@puzzle/components/dist/*/.{js,jsx,ts,tsx}"
],
theme: {
extend: {
colors: {
puzzlegreen: '#1c6b19',
puzzlegreenLighter: '#258b21',
}
},
},
plugins: [],
}
`tsx
import { Button, CustomMultiSelect, Container } from '@puzzle/components';
function App() {
return (
label="Click me!"
buttonType="primary"
onClick={() => console.log('Clicked!')}
/>
{ id: '1', label: 'Option 1' },
{ id: '2', label: 'Option 2' },
]}
onChange={(values) => console.log(values)}
placeholder="Select options..."
/>
);
}
`
To view and interact with all components, run Storybook:
`bash`
npm run storybook
To build the library:
`bash`
npm run build
To publish a new version:
`bash`
npm run prepublishOnly
npm publish
This library uses Tailwind CSS for styling with custom puzzle green colors:
- puzzlegreen: #1c6b19puzzlegreenLighter
- : #258b21
The components are designed to work seamlessly with Tailwind CSS and follow consistent design patterns.
All components are built with TypeScript and include full type definitions. Import types as needed:
`tsx`
import type { ButtonProps } from '@puzzle/components';
MIT
1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature'
3. Commit your changes ()git push origin feature/amazing-feature`)
4. Push to the branch (
5. Open a Pull Request