@rufous/ui 0.1.3 → 0.1.5

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 CHANGED
@@ -1,3 +1,160 @@
1
1
  # rufous-ui
2
2
 
3
- UI library for rufous
3
+ # @rufous/ui
4
+
5
+ A modern and reusable UI component library for React.
6
+ Includes buttons, floating inputs, checkboxes, theme support, and icons.
7
+
8
+ ---
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @rufous/ui
14
+ or
15
+
16
+ bash
17
+ Copy
18
+ Edit
19
+ yarn add @rufous/ui
20
+ Usage
21
+ Before using any components, import the global styles:
22
+
23
+ javascript
24
+ Copy
25
+ Edit
26
+ import "@rufous/ui/style.css";
27
+ Examples
28
+ Below are usage examples of all the components available in the showcase.
29
+
30
+ 🧱 Button
31
+ jsx
32
+ Copy
33
+ Edit
34
+ import React from "react";
35
+ import { Button } from "@rufous/ui";
36
+ import "@rufous/ui/style.css";
37
+
38
+ export default function Example() {
39
+ return (
40
+ <Button onClick={() => alert("Rufous Button clicked!")}>
41
+ Click Me
42
+ </Button>
43
+ );
44
+ }
45
+ ✍️ Floating Input
46
+ jsx
47
+ Copy
48
+ Edit
49
+ import React, { useState } from "react";
50
+ import { FloatingInput } from "@rufous/ui";
51
+ import "@rufous/ui/style.css";
52
+
53
+ export default function Example() {
54
+ const [name, setName] = useState("");
55
+
56
+ return (
57
+ <FloatingInput
58
+ label="Your Name"
59
+ name="name"
60
+ value={name}
61
+ onChange={(e) => setName(e.target.value)}
62
+ required
63
+ />
64
+ );
65
+ }
66
+ 🎨 Theme Provider
67
+ jsx
68
+ Copy
69
+ Edit
70
+ import React from "react";
71
+ import { Button, useRufousTheme, APP_THEMES } from "@rufous/ui";
72
+ import "@rufous/ui/style.css";
73
+
74
+ export default function Example() {
75
+ const { previewTheme } = useRufousTheme();
76
+
77
+ return (
78
+ <>
79
+ <Button onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}>
80
+ Light
81
+ </Button>
82
+ <Button onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}>
83
+ Dark
84
+ </Button>
85
+ </>
86
+ );
87
+ }
88
+ ☑️ Checkbox
89
+ jsx
90
+ Copy
91
+ Edit
92
+ import React from "react";
93
+ import { Checkbox } from "@rufous/ui";
94
+ import "@rufous/ui/style.css";
95
+
96
+ export default function Example() {
97
+ return (
98
+ <>
99
+ <Checkbox label="Unchecked" />
100
+ <Checkbox checked={true} label="Checked" />
101
+ </>
102
+ );
103
+ }
104
+ 🖼 Icons (Extra Example)
105
+ jsx
106
+ Copy
107
+ Edit
108
+ import React from "react";
109
+ import { CopyIcon, EditIcon } from "@rufous/ui";
110
+ import "@rufous/ui/style.css";
111
+
112
+ export default function Example() {
113
+ return (
114
+ <div style={{ display: "flex", gap: "10px" }}>
115
+ <CopyIcon onClick={() => alert("Copied!")} />
116
+ <EditIcon onClick={() => alert("Edit clicked!")} />
117
+ </div>
118
+ );
119
+ }
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
143
+
144
+ yaml
145
+ Copy
146
+ Edit
147
+
148
+ ---
149
+
150
+ This way, a **new user** can:
151
+
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
156
+
157
+ ---
158
+
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.
160
+ ```
@@ -1,28 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React__default from 'react';
2
2
 
3
- // customThemeProvider.d.ts
4
-
5
-
6
-
7
- type Theme = {
8
- themeKey: string;
9
- customStyles: any; // Replace `any` with a proper type if you have a defined theme structure
10
- };
11
-
12
- type RufousThemeContextType = {
13
- theme: Theme;
14
- previewTheme: (key: string) => void;
15
- saveTheme: (inputKey?: string) => void;
16
- cancelTheme: () => void;
17
- currentThemeKey: string;
18
- committedThemeKey: string;
19
- updateSettings: () => void;
20
- };
21
-
22
- declare const RufousThemeProvider: React.FC<{
23
- children: ReactNode;
24
- }>;
25
-
26
- declare const useRufousTheme: () => RufousThemeContextType;
3
+ declare const RufousThemeProvider: ({ children }: {
4
+ children: any;
5
+ }) => React__default.JSX.Element;
6
+ declare const useRufousTheme: () => any;
27
7
 
28
8
  export { RufousThemeProvider, useRufousTheme };
@@ -1,28 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React__default from 'react';
2
2
 
3
- // customThemeProvider.d.ts
4
-
5
-
6
-
7
- type Theme = {
8
- themeKey: string;
9
- customStyles: any; // Replace `any` with a proper type if you have a defined theme structure
10
- };
11
-
12
- type RufousThemeContextType = {
13
- theme: Theme;
14
- previewTheme: (key: string) => void;
15
- saveTheme: (inputKey?: string) => void;
16
- cancelTheme: () => void;
17
- currentThemeKey: string;
18
- committedThemeKey: string;
19
- updateSettings: () => void;
20
- };
21
-
22
- declare const RufousThemeProvider: React.FC<{
23
- children: ReactNode;
24
- }>;
25
-
26
- declare const useRufousTheme: () => RufousThemeContextType;
3
+ declare const RufousThemeProvider: ({ children }: {
4
+ children: any;
5
+ }) => React__default.JSX.Element;
6
+ declare const useRufousTheme: () => any;
27
7
 
28
8
  export { RufousThemeProvider, useRufousTheme };
@@ -1,7 +1,4 @@
1
1
  import "../chunk-ZZ37BKUK.js";
2
- import {
3
- nineDotMenuIcon_default
4
- } from "../chunk-D7SFBVJY.js";
5
2
  import {
6
3
  rufousLauncherBird_default
7
4
  } from "../chunk-QZFGQ5JM.js";
@@ -26,6 +23,9 @@ import {
26
23
  import {
27
24
  hierarchyIcon_default
28
25
  } from "../chunk-WZAU77G7.js";
26
+ import {
27
+ nineDotMenuIcon_default
28
+ } from "../chunk-D7SFBVJY.js";
29
29
  export {
30
30
  archivedIcon_default as ArchivedIcon,
31
31
  copyIcon_default as CopyIcon,
package/dist/main.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import {
2
- FloatingInput
3
- } from "./chunk-AWA5Y5LH.js";
4
- import "./chunk-ZZ37BKUK.js";
2
+ RufousThemeProvider,
3
+ useRufousTheme
4
+ } from "./chunk-BCGCLMKA.js";
5
5
  import {
6
- nineDotMenuIcon_default
7
- } from "./chunk-D7SFBVJY.js";
6
+ APP_THEMES
7
+ } from "./chunk-2FHTGYR4.js";
8
+ import "./chunk-ZZ37BKUK.js";
8
9
  import {
9
10
  rufousLauncherBird_default
10
11
  } from "./chunk-QZFGQ5JM.js";
@@ -29,19 +30,18 @@ import {
29
30
  import {
30
31
  hierarchyIcon_default
31
32
  } from "./chunk-WZAU77G7.js";
33
+ import {
34
+ nineDotMenuIcon_default
35
+ } from "./chunk-D7SFBVJY.js";
32
36
  import {
33
37
  Button
34
38
  } from "./chunk-ASP3DBRX.js";
39
+ import {
40
+ FloatingInput
41
+ } from "./chunk-AWA5Y5LH.js";
35
42
  import {
36
43
  Checkbox
37
44
  } 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.3",
4
+ "version": "0.1.5",
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",
@@ -55,4 +56,4 @@
55
56
  "react": "^18.0.0 || ^19.0.0",
56
57
  "react-dom": "^18.0.0 || ^19.0.0"
57
58
  }
58
- }
59
+ }
@@ -1,17 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
-
15
- // lib/Contexts/rufousThemeProvider.d.ts
16
- var rufousThemeProvider_d_exports = {};
17
- module.exports = __toCommonJS(rufousThemeProvider_d_exports);
@@ -1,28 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- // customThemeProvider.d.ts
4
-
5
-
6
-
7
- type Theme = {
8
- themeKey: string;
9
- customStyles: any; // Replace `any` with a proper type if you have a defined theme structure
10
- };
11
-
12
- type RufousThemeContextType = {
13
- theme: Theme;
14
- previewTheme: (key: string) => void;
15
- saveTheme: (inputKey?: string) => void;
16
- cancelTheme: () => void;
17
- currentThemeKey: string;
18
- committedThemeKey: string;
19
- updateSettings: () => void;
20
- };
21
-
22
- declare const RufousThemeProvider: React.FC<{
23
- children: ReactNode;
24
- }>;
25
-
26
- declare const useRufousTheme: () => RufousThemeContextType;
27
-
28
- export { RufousThemeProvider, useRufousTheme };
@@ -1,28 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- // customThemeProvider.d.ts
4
-
5
-
6
-
7
- type Theme = {
8
- themeKey: string;
9
- customStyles: any; // Replace `any` with a proper type if you have a defined theme structure
10
- };
11
-
12
- type RufousThemeContextType = {
13
- theme: Theme;
14
- previewTheme: (key: string) => void;
15
- saveTheme: (inputKey?: string) => void;
16
- cancelTheme: () => void;
17
- currentThemeKey: string;
18
- committedThemeKey: string;
19
- updateSettings: () => void;
20
- };
21
-
22
- declare const RufousThemeProvider: React.FC<{
23
- children: ReactNode;
24
- }>;
25
-
26
- declare const useRufousTheme: () => RufousThemeContextType;
27
-
28
- export { RufousThemeProvider, useRufousTheme };
File without changes