newron-ui 2.0.7 → 2.0.10

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 +1 -371
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,373 +24,7 @@ import "newron-ui/dist/newron.css";
24
24
  npm link
25
25
  ```
26
26
 
27
- ## Components
28
-
29
- **Here are the components available in the Newron UI Library:**
30
-
31
- | Type | Name | Description |
32
- | ---------- | ------------------------- | -------------------------------------------------------- |
33
- | Components | Button | A customizable button component. |
34
- | Components | Card | A card-style component for displaying content. |
35
- | Components | Input | An input field component. |
36
- | Components | Dropdown | A dropdown component for selecting options. |
37
- | Components | Select | A select component for selecting options. |
38
- | Components | SearchBar | A search bar component. |
39
- | Components | ResponsiveLayoutWrapper | A responsive layout wrapper component. |
40
- | Components | Datalist | A datalist component. |
41
- | Components | Datalist2 | Another datalist component. |
42
- | Components | SearchableList | A searchable list component. |
43
- | Components | MultiSelectDatalist | A multi-select datalist component. |
44
- | Components | DynamicForm | A dynamic form component. |
45
- | Components | DataTable | A data table component. |
46
- | Components | Loader | A loader component. |
47
- | Components | Checkbox | A checkbox component. |
48
- | Components | ActionsCell | A cell for action buttons in a table. |
49
- | Components | NoPermission | A component for displaying a "No Permission" message. |
50
- | Components | Breadcrumb | A breadcrumb navigation component. |
51
- | Components | Avatar | An avatar component. |
52
- | Components | Badge | A badge component. |
53
- | Components | Spinner | A spinner component. |
54
- | Components | HoverableButton | A button with hover effects. |
55
- | Components | AscDscShorter | A component for sorting data. |
56
- | Components | Table | A table component. |
57
- | Components | VerticalLine | A vertical line component. |
58
- | Components | HorizontalLine | A horizontal line component. |
59
- | Components | TableSkeleton | A skeleton loader for tables. |
60
- | Components | TablePagination | A pagination component for tables. |
61
- | Components | SelectAllHeader | A header component for selecting all items in a table. |
62
- | Components | TableHeaderSkeleton | A skeleton loader for table headers. |
63
- | Components | TableBodySkeleton | A skeleton loader for table body. |
64
- | Components | ActionHeader | A header for action buttons in a table. |
65
- | Components | UploadFile | A file upload component. |
66
- | Components | FormField | A form field component. |
67
- | Components | CombinedImageUploader | An image uploader component. |
68
- | Components | Stepper | A stepper component. |
69
- | Components | CloseButton | A close button component. |
70
- | Components | ExcelGenerator | A component for generating Excel files. |
71
- | Components | DownloadFile | A component for downloading files. |
72
- | Components | ButtonElement | A button element component. |
73
- | Components | InputElement | An input element component. |
74
- | Components | Profiles | A component for displaying user profiles. |
75
- | Components | ProfileListModel | A list model component for profiles. |
76
- | Hooks | useClickOutsideHandler | A hook for handling clicks outside a specified element. |
77
- | Hooks | useWindowWidthHeight | A hook for tracking window width and height. |
78
- | Hooks | useScrollToLastElement | A hook for scrolling to the last element in a container. |
79
- | Hooks | useColumnWidths | A hook for managing column widths. |
80
- | Hooks | useBodyOverflow | A hook for controlling the overflow of the body. |
81
- | Hooks | useTimeout | A hook for managing timeouts. |
82
- | Hooks | useMediaQuery | A hook for working with media queries. |
83
- | Hooks | usePrevious | A hook for accessing the previous value of a state. |
84
- | Hooks | useDocumentTitle | A hook for setting the document title. |
85
- | Hooks | useKeyPress | A hook for handling keyboard keypress events. |
86
- | Hooks | useOnlineStatus | A hook for detecting online/offline status. |
87
- | Hooks | useScrollPosition | A hook for tracking scroll position. |
88
- | Hooks | useGeolocation | A hook for accessing geolocation information. |
89
- | Hooks | useLocalStorageWithExpiry | A hook for managing local storage with expiry. |
90
- | Hooks | useClipboard | A hook for working with the clipboard. |
91
- | Hooks | useInterval | A hook for managing intervals. |
92
- | Hooks | useHover | A hook for detecting hover status. |
93
- | Hooks | useDocumentVisibility | A hook for monitoring document visibility. |
94
- | Hooks | useDebounce | A hook for debouncing function calls. |
95
- | Hooks | useMediaRecorder | A hook for media recording capabilities. |
96
- | Hooks | useWebSocket | A hook for WebSocket communication. |
97
- | Hooks | useModelPosition | A hook for managing model position. |
98
- | Utilities | getStatusColorClass | A utility function for obtaining status color classes. |
99
-
100
- ## Usage
101
-
102
- Import the components you need from the library in your React application and use them in your UI:
103
-
104
- ```jsx
105
- import React from "react";
106
- import {
107
- Button,
108
- Card,
109
- Input,
110
- Dropdown,
111
- Select,
112
- SearchBar,
113
- ResponsiveLayoutWrapper,
114
- Datalist,
115
- DynamicForm,
116
- } from "newron-ui";
117
-
118
- const App = () => {
119
- return (
120
- <ResponsiveLayoutWrapper>
121
- {/* Use the components here */}
122
- <Card title="Sample Card" content="This is a sample card component." />
123
- <Button variant="primary" size="lg">
124
- Click Me
125
- </Button>
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
- />
139
- </ResponsiveLayoutWrapper>
140
- );
141
- };
142
-
143
- export default App;
144
- ```
145
-
146
- ## Components
147
-
148
- Here are the components available in the Newron UI Library:
149
-
150
- | Component | Props | Description |
151
- | ------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
152
- | `Button` | `variant`: String, `size`: String, `className`: String | A customizable button component with various styles. |
153
- | `Card` | `title`: String, `content`: String | A card component to display content with a title. |
154
- | `Input` | `label`: String, `field`: Object, `form`: Object, rest: Props | An input component to accept user input. |
155
- | `Dropdown` | `options`: Array of Strings | A dropdown component to display a list of options. |
156
- | `Select` | `options`: Array of Strings | A select component to display a dropdown-style select element. |
157
- | `SearchBar` | `onSearch`: Function | A search bar component to input search text and trigger search action. |
158
- | `ResponsiveLayoutWrapper` | None | A wrapper component to create a responsive layout for your components. |
159
- | `Datalist` | `options`: Array of Strings, `onSelect`: Function | A datalist component to search and select data. |
160
- | `DynamicForm` | `initialValues`: Object, `validationSchema`: Yup.Schema, `fields`: Array | A dynamic form component to generate form fields dynamically. |
161
-
162
- ### Button
163
-
164
- A customizable button component with various styles.
165
-
166
- Props:
167
-
168
- - `variant`: The variant of the button. Available options are "primary" (default), "secondary", "success", and "danger".
169
- - `size`: The size of the button. Available options are "sm" (small), "md" (medium, default), "lg" (large), and "xl" (extra large).
170
- - `className`: Additional CSS class names to apply to the button.
171
-
172
- Usage Example:
173
-
174
- ```jsx
175
- import React from "react";
176
- import { Button } from "newron-ui-lib";
177
-
178
- const MyComponent = () => {
179
- return (
180
- <Button variant="primary" size="lg">
181
- Click Me
182
- </Button>
183
- );
184
- };
185
- ```
186
-
187
- ### Card
188
-
189
- A card component to display content with a title and content section.
190
-
191
- Props:
192
-
193
- - `title`: The title of the card. (required)
194
- - `content`: The content of the card. (required)
195
-
196
- Usage Example:
197
-
198
- ```jsx
199
- import React from "react";
200
- import { Card } from "newron-ui-lib";
201
-
202
- const MyComponent = () => {
203
- return (
204
- <Card title="Sample Card" content="This is a sample card component." />
205
- );
206
- };
207
- ```
208
-
209
- ### Input
210
-
211
- An input component to accept user input.
212
-
213
- Props:
214
-
215
- - `label`: The label for the input field.
216
- - `field`: The field object from Formik.
217
- - `form`: The form object from Formik.
218
- - `variant`: The variant of the input field. Available options are "outline" (default), "filled", and "underline".
219
- - `size`: The size of the input field. Available options are "small", "medium" (default), and "large".
220
- - `responsive`: Whether to apply responsive styles to the input field.
221
-
222
- Usage Example:
223
-
224
- ```jsx
225
- import React from "react";
226
- import { Input } from "newron-ui-lib";
227
-
228
- const MyComponent = () => {
229
- return (
230
- <Input
231
- label="Username:"
232
- field={field}
233
- form={form}
234
- variant="outlined"
235
- size="small"
236
- />
237
- );
238
- };
239
- ```
240
-
241
- ### Dropdown
242
-
243
- A dropdown component to display a list of options.
244
-
245
- Props:
246
-
247
- - `options`: An array of options to be displayed in the dropdown. (required)
248
-
249
- Usage Example:
250
-
251
- ```jsx
252
- import React from "react";
253
- import { Dropdown } from "newron-ui-lib";
254
-
255
- const MyComponent = () => {
256
- return <Dropdown options={["Option 1", "Option 2", "Option 3"]} />;
257
- };
258
- ```
259
-
260
- ### Select
261
-
262
- A select component to display a dropdown-style select element.
263
-
264
- Props:
265
-
266
- - `options`: An array of options to be displayed in the select. (required)
267
-
268
- Usage Example:
269
-
270
- ```jsx
271
- import React from "react";
272
- import { Select } from "newron-ui-lib";
273
-
274
- const MyComponent = () => {
275
- return <Select options={["Option 1", "Option 2", "Option 3"]} />;
276
- };
277
- ```
278
-
279
- ### SearchBar
280
-
281
- A search bar component to input search text and trigger search action.
282
-
283
- Props:
284
-
285
- - `onSearch`: A function that will be called when the user performs a search. The search text is passed as an argument to this function. (required)
286
-
287
- Usage Example:
288
-
289
- ```jsx
290
- import React from "react";
291
- import { SearchBar } from "newron-ui-lib";
292
-
293
- const MyComponent = () => {
294
- const handleSearch = (searchText) => {
295
- console.log("Searching for:", searchText);
296
- // Perform the search action here
297
- };
298
-
299
- return <SearchBar onSearch={handleSearch} />;
300
- };
301
- ```
302
-
303
- ### ResponsiveLayoutWrapper
304
-
305
- A wrapper component to create a responsive layout for your components.
306
-
307
- Usage Example:
308
-
309
- ```jsx
310
- import React from "react";
311
- import { ResponsiveLayoutWrapper } from "newron-ui-lib";
312
-
313
- const MyComponent = () => {
314
- return (
315
- <ResponsiveLayoutWrapper>
316
- {/* Your components go here */}
317
- </ResponsiveLayoutWrapper>
318
- );
319
- };
320
- ```
321
-
322
- ### Datalist
323
-
324
- A datalist component to search and select data.
325
-
326
- Props:
327
-
328
- - `options`: An array of options to be displayed in the datalist. (required)
329
- - `onSelect`: A function that will be called when the user selects an option. The selected option is passed as an argument to this function. (required)
330
-
331
- Usage Example:
332
-
333
- ```jsx
334
- import React, { useState } from "react";
335
- import { Datalist } from "newron-ui-lib";
336
-
337
- const MyComponent = () => {
338
- const [selectedOption, setSelectedOption] = useState("");
339
-
340
- const handleSelect = (option) => {
341
- setSelectedOption(option);
342
- };
343
-
344
- return (
345
- <Datalist
346
- options={["Option 1", "Option 2", "Option 3"]}
347
- onSelect={handleSelect}
348
- />
349
- );
350
- };
351
- ```
352
-
353
- ### DynamicForm
354
-
355
- A dynamic form component to generate form fields dynamically.
356
-
357
- Props:
358
-
359
- - `initialValues`: An object containing the initial values for the form fields. (required)
360
- - `validationSchema`: A Yup schema for form validation. (required)
361
- - `fields`: An array of field objects to define the form fields. Each field object should have a `type` property that determines the type of the field (e.g., "text", "password", "dropdown", "datalist", "button", etc.), and other properties specific to each field type.
362
-
363
- Usage Example:
364
-
365
- ```jsx
366
- import React from "react";
367
- import { DynamicForm } from "newron-ui-lib";
368
- import * as Yup from "yup";
369
-
370
- const MyComponent = () => {
371
- const initialValues = {
372
- username: "",
373
- password: "",
374
- };
375
-
376
- const validationSchema = Yup.object({
377
- username: Yup.string().required("Username is required"),
378
- password: Yup.string().required("Password is required"),
379
- });
380
-
381
- const fields = [
382
- // Define your form fields here
383
- ];
384
-
385
- return (
386
- <DynamicForm
387
- initialValues={initialValues}
388
- validationSchema={validationSchema}
389
- fields={fields}
390
- />
391
- );
392
- };
393
- ```
27
+ ## For more information just go https://playground.elern.io/ and check the components for more details and usage.
394
28
 
395
29
  ## Contributing
396
30
 
@@ -403,7 +37,3 @@ We welcome contributions! If you find a bug or have a feature request, please op
403
37
  ## License
404
38
 
405
39
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
406
-
407
- ## Changelog
408
-
409
- With these changes, the README.md file is updated to include the new `Button` component with the `size` option, as well as the `DynamicForm` component and the `Datalist` component in the components table.