@rufous/ui 0.1.4 β 0.1.6
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 +241 -2
- package/dist/main.js +8 -8
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,3 +1,242 @@
|
|
|
1
|
-
# rufous
|
|
1
|
+
# @rufous/ui
|
|
2
2
|
|
|
3
|
-
UI library for
|
|
3
|
+
A modern and reusable UI component library for React.
|
|
4
|
+
Includes buttons, floating inputs, checkboxes, theme support, and icons.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## π¦ Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @rufous/ui
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
or
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @rufous/ui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## π― Usage
|
|
23
|
+
|
|
24
|
+
Before using any components, **import the global styles**:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
import "@rufous/ui/style.css";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## π§© Components Showcase
|
|
33
|
+
|
|
34
|
+
Below are usage examples of all the components available in the showcase.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### π§± Button
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
import React from "react";
|
|
42
|
+
import { Button } from "@rufous/ui";
|
|
43
|
+
import "@rufous/ui/style.css";
|
|
44
|
+
|
|
45
|
+
export default function Example() {
|
|
46
|
+
return (
|
|
47
|
+
<Button onClick={() => alert("Rufous Button clicked!")}>Click Me</Button>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### βοΈ Floating Input
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
import React, { useState } from "react";
|
|
58
|
+
import { FloatingInput } from "@rufous/ui";
|
|
59
|
+
import "@rufous/ui/style.css";
|
|
60
|
+
|
|
61
|
+
export default function Example() {
|
|
62
|
+
const [name, setName] = useState("");
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<FloatingInput
|
|
66
|
+
label="Your Name"
|
|
67
|
+
name="name"
|
|
68
|
+
value={name}
|
|
69
|
+
onChange={(e) => setName(e.target.value)}
|
|
70
|
+
required
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### π¨ Theme Provider
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
import React from "react";
|
|
82
|
+
import { Button, useRufousTheme, APP_THEMES } from "@rufous/ui";
|
|
83
|
+
import "@rufous/ui/style.css";
|
|
84
|
+
|
|
85
|
+
export default function Example() {
|
|
86
|
+
const { previewTheme } = useRufousTheme();
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
<Button
|
|
91
|
+
onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
|
|
92
|
+
>
|
|
93
|
+
Light
|
|
94
|
+
</Button>
|
|
95
|
+
<Button
|
|
96
|
+
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
97
|
+
>
|
|
98
|
+
Dark
|
|
99
|
+
</Button>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### βοΈ Checkbox
|
|
108
|
+
|
|
109
|
+
```jsx
|
|
110
|
+
import React from "react";
|
|
111
|
+
import { Checkbox } from "@rufous/ui";
|
|
112
|
+
import "@rufous/ui/style.css";
|
|
113
|
+
|
|
114
|
+
export default function Example() {
|
|
115
|
+
return (
|
|
116
|
+
<>
|
|
117
|
+
<Checkbox label="Unchecked" />
|
|
118
|
+
<Checkbox checked={true} label="Checked" />
|
|
119
|
+
</>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### πΌ Icons (Extra Example)
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
import React from "react";
|
|
130
|
+
import { CopyIcon, EditIcon } from "@rufous/ui";
|
|
131
|
+
import "@rufous/ui/style.css";
|
|
132
|
+
|
|
133
|
+
export default function Example() {
|
|
134
|
+
return (
|
|
135
|
+
<div style={{ display: "flex", gap: "10px" }}>
|
|
136
|
+
<CopyIcon onClick={() => alert("Copied!")} />
|
|
137
|
+
<EditIcon onClick={() => alert("Edit clicked!")} />
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## π Props Reference
|
|
146
|
+
|
|
147
|
+
### **Button**
|
|
148
|
+
|
|
149
|
+
| Prop | Type | Default | Description |
|
|
150
|
+
| ------- | -------- | ------- | --------------------- |
|
|
151
|
+
| variant | string | primary | Sets the button style |
|
|
152
|
+
| size | string | medium | Sets the button size |
|
|
153
|
+
| onClick | function | - | Click event handler |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### **FloatingInput**
|
|
158
|
+
|
|
159
|
+
| Prop | Type | Default | Description |
|
|
160
|
+
| -------- | -------- | ------- | ---------------------- |
|
|
161
|
+
| label | string | - | Floating label text |
|
|
162
|
+
| name | string | - | Input name attribute |
|
|
163
|
+
| value | string | - | Input value |
|
|
164
|
+
| onChange | function | - | Change event handler |
|
|
165
|
+
| required | boolean | false | Mark field as required |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### **Checkbox**
|
|
170
|
+
|
|
171
|
+
| Prop | Type | Default | Description |
|
|
172
|
+
| -------- | -------- | ------- | -------------------- |
|
|
173
|
+
| label | string | - | Checkbox label |
|
|
174
|
+
| checked | boolean | false | Checked state |
|
|
175
|
+
| onChange | function | - | Change event handler |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## π Quick Start Example
|
|
180
|
+
|
|
181
|
+
Hereβs a **full example** using multiple components:
|
|
182
|
+
|
|
183
|
+
```jsx
|
|
184
|
+
import React, { useState } from "react";
|
|
185
|
+
import {
|
|
186
|
+
Button,
|
|
187
|
+
FloatingInput,
|
|
188
|
+
Checkbox,
|
|
189
|
+
CopyIcon,
|
|
190
|
+
EditIcon,
|
|
191
|
+
useRufousTheme,
|
|
192
|
+
APP_THEMES,
|
|
193
|
+
} from "@rufous/ui";
|
|
194
|
+
import "@rufous/ui/style.css";
|
|
195
|
+
|
|
196
|
+
export default function App() {
|
|
197
|
+
const [name, setName] = useState("");
|
|
198
|
+
const { previewTheme } = useRufousTheme();
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<div style={{ padding: "20px" }}>
|
|
202
|
+
<h1>Rufous UI Demo</h1>
|
|
203
|
+
|
|
204
|
+
<Button onClick={() => alert("Hello!")}>Click Me</Button>
|
|
205
|
+
|
|
206
|
+
<FloatingInput
|
|
207
|
+
label="Your Name"
|
|
208
|
+
name="name"
|
|
209
|
+
value={name}
|
|
210
|
+
onChange={(e) => setName(e.target.value)}
|
|
211
|
+
required
|
|
212
|
+
/>
|
|
213
|
+
|
|
214
|
+
<Checkbox label="Accept Terms" />
|
|
215
|
+
|
|
216
|
+
<div style={{ marginTop: "10px" }}>
|
|
217
|
+
<Button
|
|
218
|
+
onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
|
|
219
|
+
>
|
|
220
|
+
Light Theme
|
|
221
|
+
</Button>
|
|
222
|
+
<Button
|
|
223
|
+
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
224
|
+
>
|
|
225
|
+
Dark Theme
|
|
226
|
+
</Button>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<div style={{ display: "flex", gap: "10px", marginTop: "10px" }}>
|
|
230
|
+
<CopyIcon onClick={() => alert("Copied!")} />
|
|
231
|
+
<EditIcon onClick={() => alert("Edit clicked!")} />
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## π License
|
|
241
|
+
|
|
242
|
+
MIT Β© Rufous UI
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
RufousThemeProvider,
|
|
3
|
+
useRufousTheme
|
|
4
|
+
} from "./chunk-BCGCLMKA.js";
|
|
5
|
+
import {
|
|
6
|
+
APP_THEMES
|
|
7
|
+
} from "./chunk-2FHTGYR4.js";
|
|
4
8
|
import "./chunk-ZZ37BKUK.js";
|
|
5
9
|
import {
|
|
6
10
|
rufousLauncherBird_default
|
|
@@ -36,12 +40,8 @@ import {
|
|
|
36
40
|
Checkbox
|
|
37
41
|
} from "./chunk-QKDJLUKZ.js";
|
|
38
42
|
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} from "./chunk-BCGCLMKA.js";
|
|
42
|
-
import {
|
|
43
|
-
APP_THEMES
|
|
44
|
-
} from "./chunk-2FHTGYR4.js";
|
|
43
|
+
FloatingInput
|
|
44
|
+
} from "./chunk-AWA5Y5LH.js";
|
|
45
45
|
export {
|
|
46
46
|
APP_THEMES,
|
|
47
47
|
archivedIcon_default as ArchivedIcon,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rufous/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "./dist/style.css",
|
|
7
7
|
"files": [
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite",
|
|
25
25
|
"build": "tsup lib --dts --format esm,cjs --outDir dist --clean",
|
|
26
|
+
"build:dev": "npm version patch --no-git-tag-version && npm run build",
|
|
26
27
|
"prebuild": "rm -rf dist",
|
|
27
28
|
"lint": "eslint .",
|
|
28
29
|
"preview": "vite preview",
|