@cofhe/react 0.0.0-alpha-20260413110630 → 0.0.0-alpha-20260518122951

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,6 +1,6 @@
1
1
  # @cofhe/react
2
2
 
3
- React component and hook for the CoFHE SDK - featuring the advanced FnxEncryptInput component.
3
+ React component and hook for the CoFHE SDK - featuring the advanced CofheEncryptInput component.
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,7 +16,6 @@ pnpm add @cofhe/react @cofhe/sdk
16
16
 
17
17
  ```tsx
18
18
  import { CofheProvider } from '@cofhe/react';
19
- import '@cofhe/react/styles.css'; // Import component styles
20
19
  import { createCofheClient } from '@cofhe/sdk/web';
21
20
 
22
21
  const client = createCofheClient(config);
@@ -30,14 +29,49 @@ function App() {
30
29
  }
31
30
  ```
32
31
 
33
- ### 2. Use the FnxEncryptInput component
32
+ ### Hooks-only usage
33
+
34
+ If you only want hooks/providers and do not want package CSS or UI components, import from the root package only:
35
+
36
+ ```tsx
37
+ import { CofheProvider, useCofheClient } from '@cofhe/react';
38
+
39
+ function App() {
40
+ return (
41
+ <CofheProvider config={config}>
42
+ <YourHookDrivenApp />
43
+ </CofheProvider>
44
+ );
45
+ }
46
+ ```
47
+
48
+ If you do want the styled React UI components, import them from `@cofhe/react/ui`:
34
49
 
35
50
  ```tsx
36
- import { FnxEncryptInput, FheTypesList } from '@cofhe/react';
51
+ import { CofheProvider } from '@cofhe/react';
52
+ import { CofheFloatingButtonWithProvider } from '@cofhe/react/ui';
53
+
54
+ function App() {
55
+ return (
56
+ <CofheProvider config={config}>
57
+ <YourApp />
58
+ <CofheFloatingButtonWithProvider />
59
+ </CofheProvider>
60
+ );
61
+ }
62
+ ```
63
+
64
+ The `@cofhe/react/ui` entrypoint includes the package styles automatically.
65
+
66
+ ### 2. Use the CofheEncryptInput component
67
+
68
+ ```tsx
69
+ import { FheTypesList } from '@cofhe/react';
70
+ import { CofheEncryptInput } from '@cofhe/react/ui';
37
71
 
38
72
  function MyComponent() {
39
73
  return (
40
- <FnxEncryptInput
74
+ <CofheEncryptInput
41
75
  placeholder="Enter value to encrypt..."
42
76
  options={FheTypesList} // Pre-defined FHE types
43
77
  showProgressBar={true}
@@ -75,7 +109,7 @@ function CustomComponent() {
75
109
  }
76
110
  ```
77
111
 
78
- ## FnxEncryptInput Component
112
+ ## CofheEncryptInput Component
79
113
 
80
114
  Advanced input component with integrated features:
81
115
 
@@ -85,7 +119,7 @@ Advanced input component with integrated features:
85
119
  - ✅ **Real-time Input Validation** - Validates input against selected FHE type
86
120
  - ✅ **Progress Tracking** - Shows encryption steps with progress bar
87
121
  - ✅ **Copy to Clipboard** - Copy encrypted results with one click
88
- - ✅ **Material-UI Icons** - Beautiful, consistent iconography
122
+ - ✅ **Bundled Iconography** - Consistent icons with no extra consumer install
89
123
  - ✅ **Responsive Design** - Works on desktop and mobile
90
124
  - ✅ **Dark Mode Support** - Automatic dark/light theme support
91
125
  - ✅ **TypeScript Support** - Full type safety
@@ -93,7 +127,7 @@ Advanced input component with integrated features:
93
127
  ### Props
94
128
 
95
129
  ```tsx
96
- interface FnxEncryptInputProps {
130
+ interface CofheEncryptInputProps {
97
131
  placeholder?: string;
98
132
  initialValue?: string;
99
133
  options?: FheTypeOption[]; // Use FheTypesList or custom options
@@ -131,20 +165,16 @@ const {
131
165
 
132
166
  ## Styling
133
167
 
134
- The package includes Tailwind CSS styles. Import them in your app:
135
-
136
- ```tsx
137
- import '@cofhe/react/styles.css';
138
- ```
168
+ The root `@cofhe/react` entrypoint is headless and does not load package styles.
139
169
 
140
- If you're using Tailwind CSS in your project, the component classes will work automatically.
170
+ If you import components from `@cofhe/react/ui`, the package styles are loaded automatically.
141
171
 
142
172
  ## Dependencies
143
173
 
144
174
  ### Required Peer Dependencies
145
175
 
146
- - `react` ^16.8.0 || ^17.0.0 || ^18.0.0
147
- - `react-dom` ^16.8.0 || ^17.0.0 || ^18.0.0
176
+ - `react` ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
177
+ - `react-dom` ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
148
178
  - `viem` ^2.38.6
149
179
 
150
180
  ### CoFHE SDK Dependencies