@geckoui/geckoui 1.3.0 → 2.0.0-beta-0
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 +157 -0
- package/dist/index.css +12 -3237
- package/dist/index.d.mts +157 -116
- package/dist/index.d.ts +157 -116
- package/dist/index.js +527 -514
- package/dist/index.mjs +524 -503
- package/dist/styles.css +1655 -1513
- package/package.json +22 -15
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://github.com/geckoui/geckoui/raw/develop/GeckoUI.png" alt="Gecko UI" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Gecko UI</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
The only thing our Gecko 🦎 eats is bugs! 🐛<br />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
📚 **Documentation**: [Gecko](https://gecko.productionbug.com)
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @geckoui/geckoui
|
|
17
|
+
# or
|
|
18
|
+
pnpm add @geckoui/geckoui
|
|
19
|
+
# or
|
|
20
|
+
yarn add @geckoui/geckoui
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Install react-hook-form for form components
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install react-hook-form
|
|
27
|
+
|
|
28
|
+
# or
|
|
29
|
+
pnpm add react-hook-form
|
|
30
|
+
|
|
31
|
+
# or
|
|
32
|
+
yarn add react-hook-form
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### 1. Import Styles
|
|
38
|
+
|
|
39
|
+
Import the component styles in your app:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import "@geckoui/geckoui/styles.css";
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> If you use `tailwindcss`, make sure to import the css inside `layer` directive to correctly override the styles:
|
|
46
|
+
|
|
47
|
+
```css title="src/global.css"
|
|
48
|
+
@import "tailwindcss";
|
|
49
|
+
|
|
50
|
+
@layer components {
|
|
51
|
+
@import "@geckoui/geckoui/styles.css";
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Use Components
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Alert, Button, Input } from "@geckoui/geckoui";
|
|
59
|
+
|
|
60
|
+
function App() {
|
|
61
|
+
return (
|
|
62
|
+
<div>
|
|
63
|
+
<Button variant="contained" color="primary">
|
|
64
|
+
Click me
|
|
65
|
+
</Button>
|
|
66
|
+
|
|
67
|
+
<Input placeholder="Enter your name" />
|
|
68
|
+
|
|
69
|
+
<Alert variant="success" title="Operation completed successfully!" />
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Theming
|
|
76
|
+
|
|
77
|
+
GeckoUI uses a powerful CSS variable-based theming system that automatically adapts all components when you change the theme class.
|
|
78
|
+
|
|
79
|
+
### Applying Themes
|
|
80
|
+
|
|
81
|
+
Simply add a theme class to your root element:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// Light theme (default)
|
|
85
|
+
<div className="light">
|
|
86
|
+
<App />
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
// Dark theme
|
|
90
|
+
<div className="dark">
|
|
91
|
+
<App />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
// Custom theme
|
|
95
|
+
<div className="neon">
|
|
96
|
+
<App />
|
|
97
|
+
</div>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Built-in Themes
|
|
101
|
+
|
|
102
|
+
- **Light** (default) - Clean, bright interface
|
|
103
|
+
- **Dark** - Easy on the eyes
|
|
104
|
+
|
|
105
|
+
### Creating Custom Themes
|
|
106
|
+
|
|
107
|
+
Create a CSS file with your theme:
|
|
108
|
+
|
|
109
|
+
```css
|
|
110
|
+
/* my-theme.css */
|
|
111
|
+
.my-theme {
|
|
112
|
+
/* Override any other CSS variables as needed */
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Import it and use it:
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import "./my-theme.css";
|
|
120
|
+
|
|
121
|
+
<div className="my-theme">
|
|
122
|
+
<App />
|
|
123
|
+
</div>;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Advanced Usage
|
|
127
|
+
|
|
128
|
+
### Custom Styling with BEM
|
|
129
|
+
|
|
130
|
+
All components use BEM (Block Element Modifier) naming for easy customization:
|
|
131
|
+
|
|
132
|
+
```css
|
|
133
|
+
/* Target specific component parts */
|
|
134
|
+
.GeckoUIButton--contained-primary {
|
|
135
|
+
/* Your custom styles */
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.GeckoUIInput__input {
|
|
139
|
+
/* Style the inner input element */
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## TypeScript
|
|
144
|
+
|
|
145
|
+
All components are fully typed. Import types as needed:
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import type { ButtonProps, InputProps } from "@geckoui/geckoui";
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
This project is licensed under the MIT License.
|
|
154
|
+
|
|
155
|
+
## Support
|
|
156
|
+
|
|
157
|
+
For issues and feature requests, please visit our [@geckoui/geckoui](https://github.com/geckoui/geckoui).
|