tw-react-components 0.0.164 โ 0.0.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -1
- package/index.esm.js +292 -255
- package/package.json +1 -1
- package/src/components/Badge/index.d.ts +1 -0
- package/src/components/Block/index.d.ts +1 -0
- package/src/components/Button/index.d.ts +1 -0
- package/src/components/Collapsible/index.d.ts +14 -3
- package/src/components/DataTable/index.d.ts +2 -1
- package/src/components/Dialog/ConfirmDialog.d.ts +1 -0
- package/src/components/Dialog/Dialog.d.ts +27 -9
- package/src/components/Dialog/FormDialog.d.ts +2 -1
- package/src/components/Dialog/ListSorterDialog.d.ts +2 -1
- package/src/components/Dialog/PdfViewerDialog.d.ts +1 -0
- package/src/components/DropdownMenu/index.d.ts +62 -29
- package/src/components/Form/controls/Label.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/DateSelector.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/DaysView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/MonthsView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/TimeSelector.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/YearsView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/index.d.ts +1 -1
- package/src/components/Form/controls/custom/file.d.ts +1 -1
- package/src/components/Form/controls/custom/select/index.d.ts +2 -2
- package/src/components/Form/controls/primitive/BasicInput.d.ts +3 -1
- package/src/components/Hint/index.d.ts +7 -3
- package/src/components/Layout/index.d.ts +8 -9
- package/src/components/List/index.d.ts +34 -20
- package/src/components/ListSorter/index.d.ts +2 -1
- package/src/components/Navbar/index.d.ts +1 -0
- package/src/components/Pagination/index.d.ts +1 -0
- package/src/components/Popover/index.d.ts +4 -1
- package/src/components/Separator/index.d.ts +4 -1
- package/src/components/Sheet/index.d.ts +21 -5
- package/src/components/Sidebar/index.d.ts +107 -63
- package/src/components/Skeleton/index.d.ts +4 -1
- package/src/components/Spinner/index.d.ts +1 -0
- package/src/components/Switch/index.d.ts +2 -2
- package/src/components/Table/index.d.ts +30 -8
- package/src/components/Tabs/index.d.ts +18 -5
- package/src/components/ThemeSelector/index.d.ts +1 -0
- package/src/components/Tooltip/index.d.ts +1 -0
- package/src/helpers/getDisplayDate.d.ts +6 -1
- package/src/helpers/getValueFromCookie.d.ts +1 -1
- package/src/test-setup.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,3 +1,175 @@
|
|
|
1
1
|
# TailwindCSS React Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
[](https://codecov.io/gh/bacali95/tw-react-components)
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
A comprehensive library of React components built with TailwindCSS for creating beautiful and responsive dashboards.
|
|
8
|
+
|
|
9
|
+
## Demo
|
|
10
|
+
|
|
11
|
+
Check out the [live demo](https://bacali95.github.io/tw-react-components) to see the components in action.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- ๐จ Beautiful UI components built with TailwindCSS
|
|
16
|
+
- ๐ Light and dark mode support
|
|
17
|
+
- ๐ฑ Fully responsive design
|
|
18
|
+
- โฟ Accessible components using Radix UI
|
|
19
|
+
- ๐งฉ Customizable and extensible
|
|
20
|
+
- ๐งช Well-tested with comprehensive test coverage
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Using npm
|
|
26
|
+
npm install tw-react-components
|
|
27
|
+
|
|
28
|
+
# Using yarn
|
|
29
|
+
yarn add tw-react-components
|
|
30
|
+
|
|
31
|
+
# Using pnpm
|
|
32
|
+
pnpm add tw-react-components
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- React 18 or later
|
|
38
|
+
- TailwindCSS 3
|
|
39
|
+
|
|
40
|
+
## Setup
|
|
41
|
+
|
|
42
|
+
### 1. Configure TailwindCSS
|
|
43
|
+
|
|
44
|
+
Add the required plugins to your `tailwind.config.js`:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
module.exports = {
|
|
48
|
+
content: [
|
|
49
|
+
// ...
|
|
50
|
+
'./node_modules/tw-react-components/**/*.{js,ts,jsx,tsx}',
|
|
51
|
+
],
|
|
52
|
+
plugins: [
|
|
53
|
+
require('@tailwindcss/forms'),
|
|
54
|
+
require('tailwindcss-animate'),
|
|
55
|
+
// Include the custom plugin from tw-react-components (optional)
|
|
56
|
+
require('tw-react-components/tailwindcss-plugin'),
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Import the CSS
|
|
62
|
+
|
|
63
|
+
Add the following import to your main CSS file:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
@import 'tw-react-components/index.css';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Available Components
|
|
70
|
+
|
|
71
|
+
This library provides a wide range of components:
|
|
72
|
+
|
|
73
|
+
- **Layout:** Building blocks for page layouts
|
|
74
|
+
|
|
75
|
+
- `Layout` - Main container for your application
|
|
76
|
+
- `Flex` - Flexible box layout component
|
|
77
|
+
- `Block` - Block-level layout component
|
|
78
|
+
- `Card` - Container with styling and functionality
|
|
79
|
+
|
|
80
|
+
- **Navigation:**
|
|
81
|
+
|
|
82
|
+
- `Navbar` - Top navigation bar
|
|
83
|
+
- `Sidebar` - Side navigation component
|
|
84
|
+
- `Tabs` - Tabbed interface component
|
|
85
|
+
|
|
86
|
+
- **Data Display:**
|
|
87
|
+
|
|
88
|
+
- `Table` - Regular table component
|
|
89
|
+
- `DataTable` - Advanced data table with sorting and filtering
|
|
90
|
+
- `List` - Displaying lists of data
|
|
91
|
+
- `ListSorter` - Sortable list component
|
|
92
|
+
- `Badge` - Small status indicator
|
|
93
|
+
|
|
94
|
+
- **Input & Form:**
|
|
95
|
+
|
|
96
|
+
- `Button` - Various button styles
|
|
97
|
+
- `Form` - Form controls and helpers
|
|
98
|
+
- `Switch` - Toggle switch component
|
|
99
|
+
|
|
100
|
+
- **Feedback & Overlay:**
|
|
101
|
+
|
|
102
|
+
- `Dialog` - Modal dialog boxes
|
|
103
|
+
- `Popover` - Content that appears over the UI
|
|
104
|
+
- `Tooltip` - Information shown on hover
|
|
105
|
+
- `Sheet` - Slide-in panels
|
|
106
|
+
- `Skeleton` - Loading placeholders
|
|
107
|
+
- `Spinner` - Loading indicator
|
|
108
|
+
- `Hint` - Contextual hints and tips
|
|
109
|
+
|
|
110
|
+
- **Utilities:**
|
|
111
|
+
- `Separator` - Visual dividers
|
|
112
|
+
- `Collapsible` - Expandable/collapsible content
|
|
113
|
+
- `DropdownMenu` - Menu that appears on click
|
|
114
|
+
- `Pagination` - Navigate through pages of content
|
|
115
|
+
- `ThemeSelector` - Toggle between light and dark themes
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
```jsx
|
|
120
|
+
import React from 'react';
|
|
121
|
+
|
|
122
|
+
import { Button, Card, Flex } from 'tw-react-components';
|
|
123
|
+
|
|
124
|
+
function MyComponent() {
|
|
125
|
+
return (
|
|
126
|
+
<Card className="p-4">
|
|
127
|
+
<h2 className="text-lg font-medium">Card Title</h2>
|
|
128
|
+
<p className="mt-2 text-sm text-gray-500">Card content goes here</p>
|
|
129
|
+
|
|
130
|
+
<Flex className="mt-4 justify-end gap-2">
|
|
131
|
+
<Button variant="outline">Cancel</Button>
|
|
132
|
+
<Button>Submit</Button>
|
|
133
|
+
</Flex>
|
|
134
|
+
</Card>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Development
|
|
140
|
+
|
|
141
|
+
This project uses [Nx](https://nx.dev) as a build system and [Yarn](https://yarnpkg.com/) as a package manager.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Install dependencies
|
|
145
|
+
yarn
|
|
146
|
+
|
|
147
|
+
# Start the development server
|
|
148
|
+
yarn start
|
|
149
|
+
|
|
150
|
+
# Build the library
|
|
151
|
+
yarn build
|
|
152
|
+
|
|
153
|
+
# Run tests
|
|
154
|
+
yarn test
|
|
155
|
+
|
|
156
|
+
# Lint the code
|
|
157
|
+
yarn lint
|
|
158
|
+
|
|
159
|
+
# Format the code
|
|
160
|
+
yarn prettier:fix
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Contributing
|
|
164
|
+
|
|
165
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
166
|
+
|
|
167
|
+
1. Fork the repository
|
|
168
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
169
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
170
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
171
|
+
5. Open a Pull Request
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|