@rufous/ui 0.1.5 β 0.1.7
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 +151 -69
- package/dist/main.js +9 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# rufous-ui
|
|
2
|
-
|
|
3
1
|
# @rufous/ui
|
|
4
2
|
|
|
5
3
|
A modern and reusable UI component library for React.
|
|
@@ -7,45 +5,55 @@ Includes buttons, floating inputs, checkboxes, theme support, and icons.
|
|
|
7
5
|
|
|
8
6
|
---
|
|
9
7
|
|
|
10
|
-
## Installation
|
|
8
|
+
## π¦ Installation
|
|
11
9
|
|
|
12
10
|
```bash
|
|
13
11
|
npm install @rufous/ui
|
|
12
|
+
```
|
|
13
|
+
|
|
14
14
|
or
|
|
15
15
|
|
|
16
|
-
bash
|
|
17
|
-
Copy
|
|
18
|
-
Edit
|
|
16
|
+
```bash
|
|
19
17
|
yarn add @rufous/ui
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## π― Usage
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
Before using any components, **import the global styles**:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
26
27
|
import "@rufous/ui/style.css";
|
|
27
|
-
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## π§© Components Showcase
|
|
33
|
+
|
|
28
34
|
Below are usage examples of all the components available in the showcase.
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### π§± Button
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
34
41
|
import React from "react";
|
|
35
42
|
import { Button } from "@rufous/ui";
|
|
36
43
|
import "@rufous/ui/style.css";
|
|
37
44
|
|
|
38
45
|
export default function Example() {
|
|
39
46
|
return (
|
|
40
|
-
<Button onClick={() => alert("Rufous Button clicked!")}>
|
|
41
|
-
Click Me
|
|
42
|
-
</Button>
|
|
47
|
+
<Button onClick={() => alert("Rufous Button clicked!")}>Click Me</Button>
|
|
43
48
|
);
|
|
44
49
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### βοΈ Floating Input
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
49
57
|
import React, { useState } from "react";
|
|
50
58
|
import { FloatingInput } from "@rufous/ui";
|
|
51
59
|
import "@rufous/ui/style.css";
|
|
@@ -63,10 +71,13 @@ export default function Example() {
|
|
|
63
71
|
/>
|
|
64
72
|
);
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### π¨ Theme Provider
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
70
81
|
import React from "react";
|
|
71
82
|
import { Button, useRufousTheme, APP_THEMES } from "@rufous/ui";
|
|
72
83
|
import "@rufous/ui/style.css";
|
|
@@ -76,19 +87,26 @@ export default function Example() {
|
|
|
76
87
|
|
|
77
88
|
return (
|
|
78
89
|
<>
|
|
79
|
-
<Button
|
|
90
|
+
<Button
|
|
91
|
+
onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
|
|
92
|
+
>
|
|
80
93
|
Light
|
|
81
94
|
</Button>
|
|
82
|
-
<Button
|
|
95
|
+
<Button
|
|
96
|
+
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
97
|
+
>
|
|
83
98
|
Dark
|
|
84
99
|
</Button>
|
|
85
100
|
</>
|
|
86
101
|
);
|
|
87
102
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### βοΈ Checkbox
|
|
108
|
+
|
|
109
|
+
```jsx
|
|
92
110
|
import React from "react";
|
|
93
111
|
import { Checkbox } from "@rufous/ui";
|
|
94
112
|
import "@rufous/ui/style.css";
|
|
@@ -101,10 +119,13 @@ export default function Example() {
|
|
|
101
119
|
</>
|
|
102
120
|
);
|
|
103
121
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### πΌ Icons (Extra Example)
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
108
129
|
import React from "react";
|
|
109
130
|
import { CopyIcon, EditIcon } from "@rufous/ui";
|
|
110
131
|
import "@rufous/ui/style.css";
|
|
@@ -117,44 +138,105 @@ export default function Example() {
|
|
|
117
138
|
</div>
|
|
118
139
|
);
|
|
119
140
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
Prop
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
required boolean false Mark field as required
|
|
134
|
-
|
|
135
|
-
Checkbox
|
|
136
|
-
Prop Type Default Description
|
|
137
|
-
label string - Checkbox label
|
|
138
|
-
checked boolean false Checked state
|
|
139
|
-
onChange function - Change event handler
|
|
140
|
-
|
|
141
|
-
License
|
|
142
|
-
MIT Β© Rufous UI
|
|
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 |
|
|
143
154
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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 |
|
|
147
166
|
|
|
148
167
|
---
|
|
149
168
|
|
|
150
|
-
|
|
169
|
+
### **Checkbox**
|
|
151
170
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
171
|
+
| Prop | Type | Default | Description |
|
|
172
|
+
| -------- | -------- | ------- | -------------------- |
|
|
173
|
+
| label | string | - | Checkbox label |
|
|
174
|
+
| checked | boolean | false | Checked state |
|
|
175
|
+
| onChange | function | - | Change event handler |
|
|
156
176
|
|
|
157
177
|
---
|
|
158
178
|
|
|
159
|
-
|
|
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
|
+
}
|
|
160
236
|
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## π License
|
|
241
|
+
|
|
242
|
+
MIT Β© Rufous UI
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-BCGCLMKA.js";
|
|
5
|
-
import {
|
|
6
|
-
APP_THEMES
|
|
7
|
-
} from "./chunk-2FHTGYR4.js";
|
|
2
|
+
FloatingInput
|
|
3
|
+
} from "./chunk-AWA5Y5LH.js";
|
|
8
4
|
import "./chunk-ZZ37BKUK.js";
|
|
9
5
|
import {
|
|
10
6
|
rufousLauncherBird_default
|
|
@@ -36,12 +32,16 @@ import {
|
|
|
36
32
|
import {
|
|
37
33
|
Button
|
|
38
34
|
} from "./chunk-ASP3DBRX.js";
|
|
39
|
-
import {
|
|
40
|
-
FloatingInput
|
|
41
|
-
} from "./chunk-AWA5Y5LH.js";
|
|
42
35
|
import {
|
|
43
36
|
Checkbox
|
|
44
37
|
} from "./chunk-QKDJLUKZ.js";
|
|
38
|
+
import {
|
|
39
|
+
RufousThemeProvider,
|
|
40
|
+
useRufousTheme
|
|
41
|
+
} from "./chunk-BCGCLMKA.js";
|
|
42
|
+
import {
|
|
43
|
+
APP_THEMES
|
|
44
|
+
} from "./chunk-2FHTGYR4.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.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "./dist/style.css",
|
|
7
7
|
"files": [
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0",
|
|
57
57
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|