newron-ui 1.0.117 → 1.0.119
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 +85 -47
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -0
- package/dist/{styles.css → newron.css} +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,15 @@ To use the Newron UI Library in your React projects, you can install it via npm:
|
|
|
10
10
|
npm install newron-ui --save
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Import newron-ui css in App.js
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import "newron-ui/dist/newron.css";
|
|
17
|
+
```
|
|
18
|
+
|
|
13
19
|
## Locally Running the Library and Setup
|
|
14
20
|
|
|
15
|
-
**Run This in Both App where you want use and also Newron-ui
|
|
21
|
+
**Run This in Both App where you want use and also Newron-ui**
|
|
16
22
|
|
|
17
23
|
```bash
|
|
18
24
|
npm link
|
|
@@ -96,7 +102,7 @@ npm link
|
|
|
96
102
|
Import the components you need from the library in your React application and use them in your UI:
|
|
97
103
|
|
|
98
104
|
```jsx
|
|
99
|
-
import React from
|
|
105
|
+
import React from "react";
|
|
100
106
|
import {
|
|
101
107
|
Button,
|
|
102
108
|
Card,
|
|
@@ -106,23 +112,30 @@ import {
|
|
|
106
112
|
SearchBar,
|
|
107
113
|
ResponsiveLayoutWrapper,
|
|
108
114
|
Datalist,
|
|
109
|
-
DynamicForm
|
|
110
|
-
} from
|
|
115
|
+
DynamicForm,
|
|
116
|
+
} from "newron-ui";
|
|
111
117
|
|
|
112
118
|
const App = () => {
|
|
113
119
|
return (
|
|
114
120
|
<ResponsiveLayoutWrapper>
|
|
115
121
|
{/* Use the components here */}
|
|
116
|
-
<Card title=
|
|
117
|
-
<Button variant=
|
|
122
|
+
<Card title="Sample Card" content="This is a sample card component." />
|
|
123
|
+
<Button variant="primary" size="lg">
|
|
118
124
|
Click Me
|
|
119
125
|
</Button>
|
|
120
|
-
<Input type=
|
|
121
|
-
<Dropdown options={[
|
|
122
|
-
<Select options={[
|
|
123
|
-
<SearchBar onSearch={searchText => console.log(searchText)} />
|
|
124
|
-
<Datalist
|
|
125
|
-
|
|
126
|
+
<Input type="text" placeholder="Enter text..." />
|
|
127
|
+
<Dropdown options={["Option 1", "Option 2", "Option 3"]} />
|
|
128
|
+
<Select options={["Option 1", "Option 2", "Option 3"]} />
|
|
129
|
+
<SearchBar onSearch={(searchText) => console.log(searchText)} />
|
|
130
|
+
<Datalist
|
|
131
|
+
options={["Option 1", "Option 2", "Option 3"]}
|
|
132
|
+
onSelect={(option) => console.log(option)}
|
|
133
|
+
/>
|
|
134
|
+
<DynamicForm
|
|
135
|
+
initialValues={initialValues}
|
|
136
|
+
validationSchema={validationSchema}
|
|
137
|
+
fields={fields}
|
|
138
|
+
/>
|
|
126
139
|
</ResponsiveLayoutWrapper>
|
|
127
140
|
);
|
|
128
141
|
};
|
|
@@ -159,12 +172,12 @@ Props:
|
|
|
159
172
|
Usage Example:
|
|
160
173
|
|
|
161
174
|
```jsx
|
|
162
|
-
import React from
|
|
163
|
-
import { Button } from
|
|
175
|
+
import React from "react";
|
|
176
|
+
import { Button } from "newron-ui-lib";
|
|
164
177
|
|
|
165
178
|
const MyComponent = () => {
|
|
166
179
|
return (
|
|
167
|
-
<Button variant=
|
|
180
|
+
<Button variant="primary" size="lg">
|
|
168
181
|
Click Me
|
|
169
182
|
</Button>
|
|
170
183
|
);
|
|
@@ -183,11 +196,13 @@ Props:
|
|
|
183
196
|
Usage Example:
|
|
184
197
|
|
|
185
198
|
```jsx
|
|
186
|
-
import React from
|
|
187
|
-
import { Card } from
|
|
199
|
+
import React from "react";
|
|
200
|
+
import { Card } from "newron-ui-lib";
|
|
188
201
|
|
|
189
202
|
const MyComponent = () => {
|
|
190
|
-
return
|
|
203
|
+
return (
|
|
204
|
+
<Card title="Sample Card" content="This is a sample card component." />
|
|
205
|
+
);
|
|
191
206
|
};
|
|
192
207
|
```
|
|
193
208
|
|
|
@@ -207,11 +222,19 @@ Props:
|
|
|
207
222
|
Usage Example:
|
|
208
223
|
|
|
209
224
|
```jsx
|
|
210
|
-
import React from
|
|
211
|
-
import { Input } from
|
|
225
|
+
import React from "react";
|
|
226
|
+
import { Input } from "newron-ui-lib";
|
|
212
227
|
|
|
213
228
|
const MyComponent = () => {
|
|
214
|
-
return
|
|
229
|
+
return (
|
|
230
|
+
<Input
|
|
231
|
+
label="Username:"
|
|
232
|
+
field={field}
|
|
233
|
+
form={form}
|
|
234
|
+
variant="outlined"
|
|
235
|
+
size="small"
|
|
236
|
+
/>
|
|
237
|
+
);
|
|
215
238
|
};
|
|
216
239
|
```
|
|
217
240
|
|
|
@@ -226,11 +249,11 @@ Props:
|
|
|
226
249
|
Usage Example:
|
|
227
250
|
|
|
228
251
|
```jsx
|
|
229
|
-
import React from
|
|
230
|
-
import { Dropdown } from
|
|
252
|
+
import React from "react";
|
|
253
|
+
import { Dropdown } from "newron-ui-lib";
|
|
231
254
|
|
|
232
255
|
const MyComponent = () => {
|
|
233
|
-
return <Dropdown options={[
|
|
256
|
+
return <Dropdown options={["Option 1", "Option 2", "Option 3"]} />;
|
|
234
257
|
};
|
|
235
258
|
```
|
|
236
259
|
|
|
@@ -245,11 +268,11 @@ Props:
|
|
|
245
268
|
Usage Example:
|
|
246
269
|
|
|
247
270
|
```jsx
|
|
248
|
-
import React from
|
|
249
|
-
import { Select } from
|
|
271
|
+
import React from "react";
|
|
272
|
+
import { Select } from "newron-ui-lib";
|
|
250
273
|
|
|
251
274
|
const MyComponent = () => {
|
|
252
|
-
return <Select options={[
|
|
275
|
+
return <Select options={["Option 1", "Option 2", "Option 3"]} />;
|
|
253
276
|
};
|
|
254
277
|
```
|
|
255
278
|
|
|
@@ -264,12 +287,12 @@ Props:
|
|
|
264
287
|
Usage Example:
|
|
265
288
|
|
|
266
289
|
```jsx
|
|
267
|
-
import React from
|
|
268
|
-
import { SearchBar } from
|
|
290
|
+
import React from "react";
|
|
291
|
+
import { SearchBar } from "newron-ui-lib";
|
|
269
292
|
|
|
270
293
|
const MyComponent = () => {
|
|
271
|
-
const handleSearch = searchText => {
|
|
272
|
-
console.log(
|
|
294
|
+
const handleSearch = (searchText) => {
|
|
295
|
+
console.log("Searching for:", searchText);
|
|
273
296
|
// Perform the search action here
|
|
274
297
|
};
|
|
275
298
|
|
|
@@ -284,11 +307,15 @@ A wrapper component to create a responsive layout for your components.
|
|
|
284
307
|
Usage Example:
|
|
285
308
|
|
|
286
309
|
```jsx
|
|
287
|
-
import React from
|
|
288
|
-
import { ResponsiveLayoutWrapper } from
|
|
310
|
+
import React from "react";
|
|
311
|
+
import { ResponsiveLayoutWrapper } from "newron-ui-lib";
|
|
289
312
|
|
|
290
313
|
const MyComponent = () => {
|
|
291
|
-
return
|
|
314
|
+
return (
|
|
315
|
+
<ResponsiveLayoutWrapper>
|
|
316
|
+
{/* Your components go here */}
|
|
317
|
+
</ResponsiveLayoutWrapper>
|
|
318
|
+
);
|
|
292
319
|
};
|
|
293
320
|
```
|
|
294
321
|
|
|
@@ -304,17 +331,22 @@ Props:
|
|
|
304
331
|
Usage Example:
|
|
305
332
|
|
|
306
333
|
```jsx
|
|
307
|
-
import React, { useState } from
|
|
308
|
-
import { Datalist } from
|
|
334
|
+
import React, { useState } from "react";
|
|
335
|
+
import { Datalist } from "newron-ui-lib";
|
|
309
336
|
|
|
310
337
|
const MyComponent = () => {
|
|
311
|
-
const [selectedOption, setSelectedOption] = useState(
|
|
338
|
+
const [selectedOption, setSelectedOption] = useState("");
|
|
312
339
|
|
|
313
|
-
const handleSelect = option => {
|
|
340
|
+
const handleSelect = (option) => {
|
|
314
341
|
setSelectedOption(option);
|
|
315
342
|
};
|
|
316
343
|
|
|
317
|
-
return
|
|
344
|
+
return (
|
|
345
|
+
<Datalist
|
|
346
|
+
options={["Option 1", "Option 2", "Option 3"]}
|
|
347
|
+
onSelect={handleSelect}
|
|
348
|
+
/>
|
|
349
|
+
);
|
|
318
350
|
};
|
|
319
351
|
```
|
|
320
352
|
|
|
@@ -331,26 +363,32 @@ Props:
|
|
|
331
363
|
Usage Example:
|
|
332
364
|
|
|
333
365
|
```jsx
|
|
334
|
-
import React from
|
|
335
|
-
import { DynamicForm } from
|
|
336
|
-
import * as Yup from
|
|
366
|
+
import React from "react";
|
|
367
|
+
import { DynamicForm } from "newron-ui-lib";
|
|
368
|
+
import * as Yup from "yup";
|
|
337
369
|
|
|
338
370
|
const MyComponent = () => {
|
|
339
371
|
const initialValues = {
|
|
340
|
-
username:
|
|
341
|
-
password:
|
|
372
|
+
username: "",
|
|
373
|
+
password: "",
|
|
342
374
|
};
|
|
343
375
|
|
|
344
376
|
const validationSchema = Yup.object({
|
|
345
|
-
username: Yup.string().required(
|
|
346
|
-
password: Yup.string().required(
|
|
377
|
+
username: Yup.string().required("Username is required"),
|
|
378
|
+
password: Yup.string().required("Password is required"),
|
|
347
379
|
});
|
|
348
380
|
|
|
349
381
|
const fields = [
|
|
350
382
|
// Define your form fields here
|
|
351
383
|
];
|
|
352
384
|
|
|
353
|
-
return
|
|
385
|
+
return (
|
|
386
|
+
<DynamicForm
|
|
387
|
+
initialValues={initialValues}
|
|
388
|
+
validationSchema={validationSchema}
|
|
389
|
+
fields={fields}
|
|
390
|
+
/>
|
|
391
|
+
);
|
|
354
392
|
};
|
|
355
393
|
```
|
|
356
394
|
|