@geckoui/geckoui 1.3.0 → 1.3.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 +142 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
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 [OKLCH](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) color values with CSS custom properties (`--color-*`) powered by Tailwind CSS v4. You can override colors using **any CSS color format** — oklch, hex, rgb, hsl, etc.
|
|
78
|
+
|
|
79
|
+
### Dark Mode
|
|
80
|
+
|
|
81
|
+
Add the `.dark` class to your root element:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<div className="dark">
|
|
85
|
+
<App />
|
|
86
|
+
</div>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Customizing Colors
|
|
90
|
+
|
|
91
|
+
Override CSS variables to match your brand:
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
:root {
|
|
95
|
+
--color-primary-500: oklch(0.65 0.24 330);
|
|
96
|
+
--color-primary-600: oklch(0.55 0.22 330);
|
|
97
|
+
|
|
98
|
+
/* hex works too */
|
|
99
|
+
--color-primary-700: #6d28d9;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Import after the base styles:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import "@geckoui/geckoui/styles.css";
|
|
107
|
+
|
|
108
|
+
import "./my-theme.css";
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Advanced Usage
|
|
112
|
+
|
|
113
|
+
### Custom Styling with Data Attributes
|
|
114
|
+
|
|
115
|
+
Components use `data-*` attributes for variant/state styling:
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
/* Target specific variants */
|
|
119
|
+
.GeckoUIButton[data-variant="filled"][data-color="primary"] {
|
|
120
|
+
/* Your custom styles */
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.GeckoUIInput__input {
|
|
124
|
+
/* Style the inner input element */
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## TypeScript
|
|
129
|
+
|
|
130
|
+
All components are fully typed. Import types as needed:
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import type { ButtonProps, InputProps } from "@geckoui/geckoui";
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
This project is licensed under the MIT License.
|
|
139
|
+
|
|
140
|
+
## Support
|
|
141
|
+
|
|
142
|
+
For issues and feature requests, please visit our [@geckoui/geckoui](https://github.com/geckoui/geckoui).
|