buildgrid-ui 1.16.0 โ 1.17.1
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 +211 -103
- package/dist/blocks/html-text-editor/html-text-area.d.ts +21 -2
- package/dist/buildgrid-ui.css +1 -1
- package/dist/buildgrid-ui.es.js +1809 -1653
- package/dist/buildgrid-ui.umd.js +59 -59
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/use-sanitized-html.d.ts +59 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,167 +1,275 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>BuildGrid UI</h1>
|
|
3
|
+
<p><strong>A modern React component library built for real-world projects</strong></p>
|
|
4
|
+
|
|
5
|
+
<img src="https://adrianomaringolo.github.io/buildgrid-ui/assets/images/buildgrid-ui-launch-0df921f6559272569468298e74d3d7b8.png" alt="BuildGrid UI - Modern React Component Library" width="100%" style="max-width: 800px; border-radius: 12px; margin: 20px 0;" />
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<a href="https://www.npmjs.com/package/buildgrid-ui"><img src="https://img.shields.io/npm/v/buildgrid-ui.svg" alt="npm version"></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/buildgrid-ui"><img src="https://img.shields.io/npm/dm/buildgrid-ui.svg" alt="npm downloads"></a>
|
|
10
|
+
<a href="https://github.com/adrianomaringolo/buildgrid-ui/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/buildgrid-ui.svg" alt="license"></a>
|
|
11
|
+
<a href="https://github.com/adrianomaringolo/buildgrid-ui"><img src="https://img.shields.io/github/stars/adrianomaringolo/buildgrid-ui.svg" alt="github stars"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<a href="https://adrianomaringolo.github.io/buildgrid-ui/">๐ Documentation</a> โข
|
|
16
|
+
<a href="https://adrianomaringolo.github.io/buildgrid-ui/">๐จ Storybook</a> โข
|
|
17
|
+
<a href="https://adrianomaringolo.github.io/buildgrid-ui/changelog">๐ Changelog</a> โข
|
|
18
|
+
<a href="https://github.com/adrianomaringolo/buildgrid-ui/discussions">๐ฌ Discussions</a>
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
2
21
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
A React component library built using [Vite](https://vitejs.dev) and [shadcn](https://ui.shadcn.com/) as the foundation. This library is designed to integrate seamlessly with React and Next.js applications and includes support for [TailwindCSS](https://tailwindcss.com). It also provides a Storybook setup to display and document the components.
|
|
22
|
+
---
|
|
6
23
|
|
|
7
|
-
## Features
|
|
24
|
+
## โจ Features
|
|
8
25
|
|
|
9
|
-
|
|
10
|
-
- **TailwindCSS Integration** for utility-first styling.
|
|
11
|
-
- **shadcn Components** as a robust base.
|
|
12
|
-
- **Storybook** for component documentation and testing.
|
|
13
|
-
- **Semantic Versioning** with automated releases using [semantic-release](https://semantic-release.gitbook.io/semantic-release/).
|
|
26
|
+
BuildGrid UI is a comprehensive React component library featuring **44+ components** and **12 specialized blocks**, all built with production use in mind.
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
- ๐ฏ **Battle-Tested** - Components refined through real-world usage
|
|
29
|
+
- ๐จ **Modern Stack** - Built with React 19, TypeScript, and Tailwind CSS
|
|
30
|
+
- โฟ **Accessible** - WCAG compliant with full keyboard navigation
|
|
31
|
+
- ๐ฑ **Responsive** - Mobile-first design approach
|
|
32
|
+
- ๐ญ **Customizable** - Flexible theming and styling options
|
|
33
|
+
- ๐ **Well Documented** - Comprehensive docs with interactive examples
|
|
34
|
+
- ๐ง **Developer Friendly** - Full TypeScript support with IntelliSense
|
|
35
|
+
- ๐ **Production Ready** - Used in real applications
|
|
16
36
|
|
|
17
|
-
##
|
|
37
|
+
## ๐ Quick Start
|
|
18
38
|
|
|
19
39
|
### Installation
|
|
20
40
|
|
|
21
|
-
To install the library, run:
|
|
22
|
-
|
|
23
41
|
```bash
|
|
24
42
|
npm install buildgrid-ui
|
|
25
43
|
# or
|
|
26
44
|
yarn add buildgrid-ui
|
|
45
|
+
# or
|
|
46
|
+
pnpm add buildgrid-ui
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Setup
|
|
50
|
+
|
|
51
|
+
1. **Import the theme styles** in your app's entry point:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// src/main.tsx or src/index.tsx
|
|
55
|
+
import 'buildgrid-ui/theme'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
2. **Configure Tailwind CSS** (v3):
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
// tailwind.config.js
|
|
62
|
+
module.exports = {
|
|
63
|
+
content: [
|
|
64
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
65
|
+
'./node_modules/buildgrid-ui/**/*.{js,ts,jsx,tsx}',
|
|
66
|
+
],
|
|
67
|
+
theme: {
|
|
68
|
+
extend: {},
|
|
69
|
+
},
|
|
70
|
+
plugins: [],
|
|
71
|
+
}
|
|
27
72
|
```
|
|
28
73
|
|
|
29
74
|
### Usage
|
|
30
75
|
|
|
31
|
-
|
|
76
|
+
```tsx
|
|
77
|
+
import { Button, Card, Input } from 'buildgrid-ui'
|
|
78
|
+
|
|
79
|
+
function App() {
|
|
80
|
+
return (
|
|
81
|
+
<Card>
|
|
82
|
+
<Card.Header>
|
|
83
|
+
<Card.Title>Welcome to BuildGrid UI</Card.Title>
|
|
84
|
+
</Card.Header>
|
|
85
|
+
<Card.Content>
|
|
86
|
+
<Input placeholder="Enter your name" />
|
|
87
|
+
</Card.Content>
|
|
88
|
+
<Card.Footer>
|
|
89
|
+
<Button>Get Started</Button>
|
|
90
|
+
</Card.Footer>
|
|
91
|
+
</Card>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
32
95
|
|
|
33
|
-
|
|
34
|
-
import { Button } from "buildgrid-ui";
|
|
96
|
+
## ๐ฆ What's Included
|
|
35
97
|
|
|
36
|
-
|
|
98
|
+
### Components (44)
|
|
37
99
|
|
|
38
|
-
|
|
39
|
-
|
|
100
|
+
**Form Elements**
|
|
101
|
+
- Input, Textarea, Select, Checkbox, Radio Group
|
|
102
|
+
- Autocomplete, Multi-Select, Tag Input
|
|
103
|
+
- Currency Input, Password Input, Adaptive Input
|
|
104
|
+
- Number Stepper, Slider, Switch
|
|
40
105
|
|
|
41
|
-
|
|
106
|
+
**Navigation**
|
|
107
|
+
- Button, Navigation Menu, Tabs
|
|
108
|
+
- Pagination, Dropdown Menu, Command
|
|
42
109
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```
|
|
110
|
+
**Feedback**
|
|
111
|
+
- Alert, Alert Dialog, Toast/Toaster
|
|
112
|
+
- Progress, Spinner, Skeleton
|
|
47
113
|
|
|
48
|
-
|
|
114
|
+
**Layout**
|
|
115
|
+
- Card, Separator, Sheet, Dialog
|
|
116
|
+
- Popover, Tooltip, Collapsible, Accordion
|
|
49
117
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
118
|
+
**Display**
|
|
119
|
+
- Avatar, Badge, Calendar, Carousel
|
|
120
|
+
- Table, Toggle, Toggle Group
|
|
54
121
|
|
|
55
|
-
|
|
122
|
+
### Blocks (12)
|
|
56
123
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
124
|
+
**Complex Components**
|
|
125
|
+
- Data Table - Feature-rich table with sorting, filtering, and pagination
|
|
126
|
+
- HTML Text Editor - Rich text editor with formatting toolbar
|
|
127
|
+
- File Upload Dropzone - Drag-and-drop file upload with progress
|
|
128
|
+
- Lazy Image Gallery - Performance-optimized image gallery
|
|
129
|
+
- Month Navigator - Calendar navigation component
|
|
130
|
+
- Bento Grid - Flexible grid layout system
|
|
131
|
+
- Help Carousel - Interactive help/tutorial carousel
|
|
132
|
+
- Empty Message - Elegant empty state component
|
|
133
|
+
- Navigable List - Keyboard-navigable list component
|
|
134
|
+
- Paginated Items - Pagination wrapper for any content
|
|
135
|
+
- Pagination Controls - Customizable pagination UI
|
|
136
|
+
- Sidebar - Flexible sidebar with multiple directions
|
|
69
137
|
|
|
70
|
-
|
|
138
|
+
### Utilities
|
|
71
139
|
|
|
72
|
-
|
|
140
|
+
**Hooks**
|
|
141
|
+
- `useLocalStorage` - Persistent state management
|
|
142
|
+
- `useDebounce` - Debounced values
|
|
143
|
+
- `useCopyToClipboard` - Copy to clipboard functionality
|
|
144
|
+
- `useSanitizedHtml` - Safe HTML rendering with DOMPurify
|
|
73
145
|
|
|
74
|
-
|
|
146
|
+
**Formatters**
|
|
147
|
+
- Currency formatting utilities
|
|
148
|
+
- Date formatting utilities
|
|
75
149
|
|
|
76
|
-
|
|
150
|
+
**Types**
|
|
151
|
+
- TypeScript utility types for better DX
|
|
77
152
|
|
|
78
|
-
|
|
79
|
-
git clone https://github.com/adrianomaringolo/buildgrid-ui.git
|
|
80
|
-
cd buildgrid-ui
|
|
81
|
-
npm install
|
|
82
|
-
```
|
|
153
|
+
## ๐ Documentation
|
|
83
154
|
|
|
84
|
-
|
|
155
|
+
Visit our [comprehensive documentation](https://adrianomaringolo.github.io/buildgrid-ui/) for:
|
|
85
156
|
|
|
86
|
-
|
|
157
|
+
- ๐ **Component API** - Detailed props and usage examples
|
|
158
|
+
- ๐จ **Interactive Examples** - Live component demos
|
|
159
|
+
- โฟ **Accessibility Guidelines** - WCAG compliance information
|
|
160
|
+
- ๐ก **Best Practices** - Recommended usage patterns
|
|
161
|
+
- ๐ญ **Storybook Integration** - Visual component explorer
|
|
87
162
|
|
|
88
|
-
|
|
89
|
-
npm run storybook
|
|
90
|
-
```
|
|
163
|
+
## ๐ Development
|
|
91
164
|
|
|
92
|
-
|
|
165
|
+
### Prerequisites
|
|
93
166
|
|
|
94
|
-
|
|
167
|
+
- Node.js 18+
|
|
168
|
+
- npm, yarn, or pnpm
|
|
95
169
|
|
|
96
|
-
|
|
170
|
+
### Setup
|
|
97
171
|
|
|
98
172
|
```bash
|
|
173
|
+
# Clone the repository
|
|
174
|
+
git clone https://github.com/adrianomaringolo/buildgrid-ui.git
|
|
175
|
+
cd buildgrid-ui
|
|
176
|
+
|
|
177
|
+
# Install dependencies
|
|
178
|
+
npm install
|
|
179
|
+
|
|
180
|
+
# Start Storybook
|
|
181
|
+
npm run storybook
|
|
182
|
+
|
|
183
|
+
# Build the library
|
|
99
184
|
npm run build
|
|
185
|
+
|
|
186
|
+
# Run tests
|
|
187
|
+
npm test
|
|
100
188
|
```
|
|
101
189
|
|
|
102
|
-
|
|
190
|
+
### Project Structure
|
|
103
191
|
|
|
104
|
-
|
|
192
|
+
```
|
|
193
|
+
buildgrid-ui/
|
|
194
|
+
โโโ src/
|
|
195
|
+
โ โโโ components/ # Basic UI components
|
|
196
|
+
โ โโโ blocks/ # Complex composed components
|
|
197
|
+
โ โโโ lib/
|
|
198
|
+
โ โ โโโ hooks/ # Custom React hooks
|
|
199
|
+
โ โ โโโ utils/ # Utility functions
|
|
200
|
+
โ โ โโโ types/ # TypeScript types
|
|
201
|
+
โ โโโ styles/ # Global styles
|
|
202
|
+
โโโ website/ # Documentation site
|
|
203
|
+
โโโ .storybook/ # Storybook configuration
|
|
204
|
+
```
|
|
105
205
|
|
|
106
|
-
##
|
|
206
|
+
## ๐ค Contributing
|
|
107
207
|
|
|
108
|
-
This
|
|
208
|
+
We welcome contributions from the community! This is my first open-source project, and I'm excited to see what we can build together.
|
|
109
209
|
|
|
110
|
-
###
|
|
210
|
+
### Ways to Contribute
|
|
111
211
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
2. Pre-release versions (e.g., `1.0.0-alpha.1`) will be automatically created.
|
|
212
|
+
- ๐ **Report bugs** - [Create an issue](https://github.com/adrianomaringolo/buildgrid-ui/issues/new?template=bug_report.yml)
|
|
213
|
+
- โจ **Request features** - [Create a feature request](https://github.com/adrianomaringolo/buildgrid-ui/issues/new?template=feature_request.yml)
|
|
214
|
+
- ๐ **Improve docs** - [Create a documentation issue](https://github.com/adrianomaringolo/buildgrid-ui/issues/new?template=documentation.yml)
|
|
215
|
+
- ๐ง **Submit PRs** - Fix bugs or add features
|
|
216
|
+
- ๐ฌ **Join discussions** - [GitHub Discussions](https://github.com/adrianomaringolo/buildgrid-ui/discussions)
|
|
118
217
|
|
|
119
|
-
|
|
218
|
+
### Quick Start for Contributors
|
|
120
219
|
|
|
121
|
-
|
|
220
|
+
1. Fork the repository
|
|
221
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
222
|
+
3. Make your changes and test them
|
|
223
|
+
4. Commit using conventional commits: `git commit -m 'feat: add amazing feature'`
|
|
224
|
+
5. Push to your fork: `git push origin feature/amazing-feature`
|
|
225
|
+
6. Open a Pull Request
|
|
122
226
|
|
|
123
|
-
|
|
227
|
+
Please read our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
|
|
124
228
|
|
|
125
|
-
|
|
229
|
+
## ๐ Roadmap
|
|
126
230
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
231
|
+
- [ ] Additional form components
|
|
232
|
+
- [ ] Enhanced theming system
|
|
233
|
+
- [ ] Dark mode improvements
|
|
234
|
+
- [ ] More specialized blocks
|
|
235
|
+
- [ ] Performance optimizations
|
|
236
|
+
- [ ] Accessibility improvements
|
|
237
|
+
- [ ] Additional utility hooks
|
|
133
238
|
|
|
134
|
-
|
|
239
|
+
## ๐ Acknowledgments
|
|
135
240
|
|
|
136
|
-
|
|
241
|
+
BuildGrid UI is built on the shoulders of giants:
|
|
137
242
|
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
243
|
+
- [React](https://react.dev/) - The foundation
|
|
244
|
+
- [Radix UI](https://www.radix-ui.com/) - Accessible primitives
|
|
245
|
+
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first styling
|
|
246
|
+
- [shadcn/ui](https://ui.shadcn.com/) - Design inspiration
|
|
247
|
+
- [Vite](https://vitejs.dev/) - Build tool
|
|
248
|
+
- [Storybook](https://storybook.js.org/) - Component development
|
|
249
|
+
- [Docusaurus](https://docusaurus.io/) - Documentation platform
|
|
143
250
|
|
|
144
|
-
|
|
251
|
+
## ๐ License
|
|
145
252
|
|
|
146
|
-
This project
|
|
253
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
147
254
|
|
|
148
|
-
|
|
255
|
+
## ๐ Links
|
|
149
256
|
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
257
|
+
- **Documentation**: https://adrianomaringolo.github.io/buildgrid-ui/
|
|
258
|
+
- **NPM Package**: https://www.npmjs.com/package/buildgrid-ui
|
|
259
|
+
- **GitHub**: https://github.com/adrianomaringolo/buildgrid-ui
|
|
260
|
+
- **Storybook**: https://adrianomaringolo.github.io/buildgrid-ui/
|
|
261
|
+
- **Changelog**: https://adrianomaringolo.github.io/buildgrid-ui/changelog
|
|
155
262
|
|
|
156
|
-
|
|
263
|
+
## ๐ฌ Community & Support
|
|
157
264
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
265
|
+
- ๐ [Report Issues](https://github.com/adrianomaringolo/buildgrid-ui/issues)
|
|
266
|
+
- ๐ก [Feature Requests](https://github.com/adrianomaringolo/buildgrid-ui/issues/new?template=feature_request.yml)
|
|
160
267
|
- ๐ฌ [Discussions](https://github.com/adrianomaringolo/buildgrid-ui/discussions)
|
|
161
|
-
-
|
|
268
|
+
- ๐ง Contact: [adrianomaringolo](https://github.com/adrianomaringolo)
|
|
162
269
|
|
|
163
270
|
---
|
|
164
271
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
272
|
+
<div align="center">
|
|
273
|
+
<p>Built with โค๏ธ by <a href="https://adrianomaringolo.dev">Adriano Maringolo</a></p>
|
|
274
|
+
<p>If you find this project useful, please consider giving it a โญ๏ธ</p>
|
|
275
|
+
</div>
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import './unreset.css';
|
|
2
|
-
export
|
|
2
|
+
export interface HtmlTextAreaProps {
|
|
3
3
|
children: string;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Predefined sanitization preset
|
|
6
|
+
* @default 'full'
|
|
7
|
+
*/
|
|
8
|
+
preset?: 'basic' | 'rich' | 'full' | 'comments';
|
|
9
|
+
/**
|
|
10
|
+
* Custom DOMPurify configuration options (overrides preset)
|
|
11
|
+
*/
|
|
12
|
+
sanitizeOptions?: import('dompurify').Config;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to allow all HTML tags and attributes (less secure)
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
allowAll?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Additional CSS classes for the container
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const HtmlTextArea: ({ children, preset, sanitizeOptions, allowAll, className, }: HtmlTextAreaProps) => import("react/jsx-runtime").JSX.Element;
|