@rufous/ui 0.1.5 β†’ 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.
Files changed (3) hide show
  1. package/README.md +151 -69
  2. package/dist/main.js +3 -3
  3. 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
- Usage
21
- Before using any components, import the global styles:
18
+ ```
19
+
20
+ ---
21
+
22
+ ## 🎯 Usage
22
23
 
23
- javascript
24
- Copy
25
- Edit
24
+ Before using any components, **import the global styles**:
25
+
26
+ ```javascript
26
27
  import "@rufous/ui/style.css";
27
- Examples
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
- 🧱 Button
31
- jsx
32
- Copy
33
- Edit
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
- ✍️ Floating Input
46
- jsx
47
- Copy
48
- Edit
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
- 🎨 Theme Provider
67
- jsx
68
- Copy
69
- Edit
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 onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}>
90
+ <Button
91
+ onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
92
+ >
80
93
  Light
81
94
  </Button>
82
- <Button onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}>
95
+ <Button
96
+ onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
97
+ >
83
98
  Dark
84
99
  </Button>
85
100
  </>
86
101
  );
87
102
  }
88
- β˜‘οΈ Checkbox
89
- jsx
90
- Copy
91
- Edit
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
- πŸ–Ό Icons (Extra Example)
105
- jsx
106
- Copy
107
- Edit
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
- Props Reference
121
- Button
122
- Prop Type Default Description
123
- variant string primary Sets the button style
124
- size string medium Sets the button size
125
- onClick function - Click event handler
126
-
127
- FloatingInput
128
- Prop Type Default Description
129
- label string - Floating label text
130
- name string - Input name attribute
131
- value string - Input value
132
- onChange function - Change event handler
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
- yaml
145
- Copy
146
- Edit
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
- This way, a **new user** can:
169
+ ### **Checkbox**
151
170
 
152
- 1. Install `@rufous/ui`
153
- 2. Import `@rufous/ui/style.css`
154
- 3. Copy any of the working code snippets into their app
155
- 4. Immediately see each component in action
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
- If you want, I can also **combine all these snippets into one runnable `App.js` example** so users can test all components at once instead of copy-pasting separately. That would make your README even more developer-friendly.
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
@@ -36,12 +36,12 @@ import {
36
36
  import {
37
37
  Button
38
38
  } from "./chunk-ASP3DBRX.js";
39
- import {
40
- FloatingInput
41
- } from "./chunk-AWA5Y5LH.js";
42
39
  import {
43
40
  Checkbox
44
41
  } from "./chunk-QKDJLUKZ.js";
42
+ import {
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.5",
4
+ "version": "0.1.6",
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
+ }