newron-ui 1.0.101 → 1.0.103

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/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Shaikh Faruk
package/README.md CHANGED
@@ -1,371 +1,122 @@
1
- # Newron UI Library
1
+ ## Directory Structure
2
2
 
3
- This is the Newron UI Library, a collection of React components built with Tailwind CSS for creating beautiful and responsive user interfaces.
4
-
5
- ## Installation
6
-
7
- To use the Newron UI Library in your React projects, you can install it via npm:
3
+ The Project has the following directory structure:
8
4
 
9
5
  ```bash
10
- npm install newron-ui --save
11
- ```
12
-
13
- ## Locally Running the Library and Setup
14
-
15
- **Run This in Both App where you want use and also Newron-ui-lib**
6
+ frontend/
7
+ ├── apps/
8
+ │ ├── student/
9
+ │ │ ├── src/
10
+ │ │ ├── package.json
11
+ │ │ └── ...
12
+ │ ├── newron/
13
+ │ │ ├── src/
14
+ │ │ ├── package.json
15
+ │ │ └── ...
16
+ │ └── entity/
17
+ │ ├── src/
18
+ │ ├── package.json
19
+ │ └── ...
20
+ ├── packages/
21
+ │ ├── newron-uirary/
22
+ │ ├── other-shared-component/
23
+ │ └── ...
24
+ ├── package.json
25
+ ├── yarn.lock (or package-lock.json if using npm)
26
+ └── ...
16
27
 
17
- ```bash
18
- npm link
19
- ```
20
-
21
- ## Components
22
-
23
- **Here are the components available in the Newron UI Library:**
24
-
25
- | Type | Name | Description |
26
- | ---------- | ------------------------- | -------------------------------------------------------- |
27
- | Components | Button | A customizable button component. |
28
- | Components | Card | A card-style component for displaying content. |
29
- | Components | Input | An input field component. |
30
- | Components | Dropdown | A dropdown component for selecting options. |
31
- | Components | Select | A select component for selecting options. |
32
- | Components | SearchBar | A search bar component. |
33
- | Components | ResponsiveLayoutWrapper | A responsive layout wrapper component. |
34
- | Components | Datalist | A datalist component. |
35
- | Components | Datalist2 | Another datalist component. |
36
- | Components | SearchableList | A searchable list component. |
37
- | Components | MultiSelectDatalist | A multi-select datalist component. |
38
- | Components | DynamicForm | A dynamic form component. |
39
- | Components | DataTable | A data table component. |
40
- | Components | Loader | A loader component. |
41
- | Components | Checkbox | A checkbox component. |
42
- | Components | ActionsCell | A cell for action buttons in a table. |
43
- | Components | NoPermission | A component for displaying a "No Permission" message. |
44
- | Components | Breadcrumb | A breadcrumb navigation component. |
45
- | Components | Avatar | An avatar component. |
46
- | Components | Badge | A badge component. |
47
- | Components | Spinner | A spinner component. |
48
- | Components | HoverableButton | A button with hover effects. |
49
- | Components | AscDscShorter | A component for sorting data. |
50
- | Components | Table | A table component. |
51
- | Components | VerticalLine | A vertical line component. |
52
- | Components | HorizontalLine | A horizontal line component. |
53
- | Components | TableSkeleton | A skeleton loader for tables. |
54
- | Components | TablePagination | A pagination component for tables. |
55
- | Components | SelectAllHeader | A header component for selecting all items in a table. |
56
- | Components | TableHeaderSkeleton | A skeleton loader for table headers. |
57
- | Components | TableBodySkeleton | A skeleton loader for table body. |
58
- | Components | ActionHeader | A header for action buttons in a table. |
59
- | Components | UploadFile | A file upload component. |
60
- | Components | FormField | A form field component. |
61
- | Components | CombinedImageUploader | An image uploader component. |
62
- | Components | Stepper | A stepper component. |
63
- | Components | CloseButton | A close button component. |
64
- | Components | ExcelGenerator | A component for generating Excel files. |
65
- | Components | DownloadFile | A component for downloading files. |
66
- | Components | ButtonElement | A button element component. |
67
- | Components | InputElement | An input element component. |
68
- | Components | Profiles | A component for displaying user profiles. |
69
- | Components | ProfileListModel | A list model component for profiles. |
70
- | Hooks | useClickOutsideHandler | A hook for handling clicks outside a specified element. |
71
- | Hooks | useWindowWidthHeight | A hook for tracking window width and height. |
72
- | Hooks | useScrollToLastElement | A hook for scrolling to the last element in a container. |
73
- | Hooks | useColumnWidths | A hook for managing column widths. |
74
- | Hooks | useBodyOverflow | A hook for controlling the overflow of the body. |
75
- | Hooks | useTimeout | A hook for managing timeouts. |
76
- | Hooks | useMediaQuery | A hook for working with media queries. |
77
- | Hooks | usePrevious | A hook for accessing the previous value of a state. |
78
- | Hooks | useDocumentTitle | A hook for setting the document title. |
79
- | Hooks | useKeyPress | A hook for handling keyboard keypress events. |
80
- | Hooks | useOnlineStatus | A hook for detecting online/offline status. |
81
- | Hooks | useScrollPosition | A hook for tracking scroll position. |
82
- | Hooks | useGeolocation | A hook for accessing geolocation information. |
83
- | Hooks | useLocalStorageWithExpiry | A hook for managing local storage with expiry. |
84
- | Hooks | useClipboard | A hook for working with the clipboard. |
85
- | Hooks | useInterval | A hook for managing intervals. |
86
- | Hooks | useHover | A hook for detecting hover status. |
87
- | Hooks | useDocumentVisibility | A hook for monitoring document visibility. |
88
- | Hooks | useDebounce | A hook for debouncing function calls. |
89
- | Hooks | useMediaRecorder | A hook for media recording capabilities. |
90
- | Hooks | useWebSocket | A hook for WebSocket communication. |
91
- | Hooks | useModelPosition | A hook for managing model position. |
92
- | Utilities | getStatusColorClass | A utility function for obtaining status color classes. |
93
-
94
- ## Usage
95
-
96
- Import the components you need from the library in your React application and use them in your UI:
97
-
98
- ```jsx
99
- import React from 'react';
100
- import {
101
- Button,
102
- Card,
103
- Input,
104
- Dropdown,
105
- Select,
106
- SearchBar,
107
- ResponsiveLayoutWrapper,
108
- Datalist,
109
- DynamicForm
110
- } from 'newron-ui';
111
-
112
- const App = () => {
113
- return (
114
- <ResponsiveLayoutWrapper>
115
- {/* Use the components here */}
116
- <Card title='Sample Card' content='This is a sample card component.' />
117
- <Button variant='primary' size='lg'>
118
- Click Me
119
- </Button>
120
- <Input type='text' placeholder='Enter text...' />
121
- <Dropdown options={['Option 1', 'Option 2', 'Option 3']} />
122
- <Select options={['Option 1', 'Option 2', 'Option 3']} />
123
- <SearchBar onSearch={searchText => console.log(searchText)} />
124
- <Datalist options={['Option 1', 'Option 2', 'Option 3']} onSelect={option => console.log(option)} />
125
- <DynamicForm initialValues={initialValues} validationSchema={validationSchema} fields={fields} />
126
- </ResponsiveLayoutWrapper>
127
- );
128
- };
129
-
130
- export default App;
131
28
  ```
132
29
 
133
- ## Components
134
-
135
- Here are the components available in the Newron UI Library:
30
+ ## Setup Instructions
136
31
 
137
- | Component | Props | Description |
138
- | ------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
139
- | `Button` | `variant`: String, `size`: String, `className`: String | A customizable button component with various styles. |
140
- | `Card` | `title`: String, `content`: String | A card component to display content with a title. |
141
- | `Input` | `label`: String, `field`: Object, `form`: Object, rest: Props | An input component to accept user input. |
142
- | `Dropdown` | `options`: Array of Strings | A dropdown component to display a list of options. |
143
- | `Select` | `options`: Array of Strings | A select component to display a dropdown-style select element. |
144
- | `SearchBar` | `onSearch`: Function | A search bar component to input search text and trigger search action. |
145
- | `ResponsiveLayoutWrapper` | None | A wrapper component to create a responsive layout for your components. |
146
- | `Datalist` | `options`: Array of Strings, `onSelect`: Function | A datalist component to search and select data. |
147
- | `DynamicForm` | `initialValues`: Object, `validationSchema`: Yup.Schema, `fields`: Array | A dynamic form component to generate form fields dynamically. |
32
+ 1. **Clone the Repository**: Clone this repository to your local machine using `git clone`:
148
33
 
149
- ### Button
34
+ ```bash
35
+ git clone https://github.com/Newron-EduTech/newron-front.git
36
+ ```
150
37
 
151
- A customizable button component with various styles.
38
+ 2. **Install Dependencies**: Install the dependencies for the project using `yarn` or `npm`:
152
39
 
153
- Props:
40
+ ```bash
41
+ npm install
42
+ ```
154
43
 
155
- - `variant`: The variant of the button. Available options are "primary" (default), "secondary", "success", and "danger".
156
- - `size`: The size of the button. Available options are "sm" (small), "md" (medium, default), "lg" (large), and "xl" (extra large).
157
- - `className`: Additional CSS class names to apply to the button.
44
+ or
158
45
 
159
- Usage Example:
46
+ ```bash
47
+ yarn add
48
+ ```
160
49
 
161
- ```jsx
162
- import React from 'react';
163
- import { Button } from 'newron-ui-lib';
50
+ 3. **Build the shared-component**: Build the shared-component using `yarn` or `npm`:
164
51
 
165
- const MyComponent = () => {
166
- return (
167
- <Button variant='primary' size='lg'>
168
- Click Me
169
- </Button>
170
- );
171
- };
52
+ ```bash
53
+ npm run build:shared
172
54
  ```
173
55
 
174
- ### Card
175
-
176
- A card component to display content with a title and content section.
177
-
178
- Props:
179
-
180
- - `title`: The title of the card. (required)
181
- - `content`: The content of the card. (required)
182
-
183
- Usage Example:
56
+ or
184
57
 
185
- ```jsx
186
- import React from 'react';
187
- import { Card } from 'newron-ui-lib';
188
-
189
- const MyComponent = () => {
190
- return <Card title='Sample Card' content='This is a sample card component.' />;
191
- };
58
+ ```bash
59
+ yarn build:shared
192
60
  ```
193
61
 
194
- ### Input
195
-
196
- An input component to accept user input.
197
-
198
- Props:
62
+ 4. **Start the Project**: Start the project using `yarn` or `npm`:
199
63
 
200
- - `label`: The label for the input field.
201
- - `field`: The field object from Formik.
202
- - `form`: The form object from Formik.
203
- - `variant`: The variant of the input field. Available options are "outline" (default), "filled", and "underline".
204
- - `size`: The size of the input field. Available options are "small", "medium" (default), and "large".
205
- - `responsive`: Whether to apply responsive styles to the input field.
64
+ ## First just run `npm start` then it will ask you to choose which app you want to run then type the app name and hit enter
206
65
 
207
- Usage Example:
208
-
209
- ```jsx
210
- import React from 'react';
211
- import { Input } from 'newron-ui-lib';
212
-
213
- const MyComponent = () => {
214
- return <Input label='Username:' field={field} form={form} variant='outlined' size='small' />;
215
- };
66
+ ```bash
67
+ npm start
216
68
  ```
217
69
 
218
- ### Dropdown
219
-
220
- A dropdown component to display a list of options.
221
-
222
- Props:
70
+ or
223
71
 
224
- - `options`: An array of options to be displayed in the dropdown. (required)
225
-
226
- Usage Example:
227
-
228
- ```jsx
229
- import React from 'react';
230
- import { Dropdown } from 'newron-ui-lib';
231
-
232
- const MyComponent = () => {
233
- return <Dropdown options={['Option 1', 'Option 2', 'Option 3']} />;
234
- };
72
+ ```bash
73
+ yarn start
235
74
  ```
236
75
 
237
- ### Select
76
+ ## To run single shared-component app
238
77
 
239
- A select component to display a dropdown-style select element.
240
-
241
- Props:
242
-
243
- - `options`: An array of options to be displayed in the select. (required)
244
-
245
- Usage Example:
246
-
247
- ```jsx
248
- import React from 'react';
249
- import { Select } from 'newron-ui-lib';
250
-
251
- const MyComponent = () => {
252
- return <Select options={['Option 1', 'Option 2', 'Option 3']} />;
253
- };
78
+ ```bash
79
+ npm run start:shared
254
80
  ```
255
81
 
256
- ### SearchBar
257
-
258
- A search bar component to input search text and trigger search action.
259
-
260
- Props:
82
+ or
261
83
 
262
- - `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)
263
-
264
- Usage Example:
265
-
266
- ```jsx
267
- import React from 'react';
268
- import { SearchBar } from 'newron-ui-lib';
269
-
270
- const MyComponent = () => {
271
- const handleSearch = searchText => {
272
- console.log('Searching for:', searchText);
273
- // Perform the search action here
274
- };
275
-
276
- return <SearchBar onSearch={handleSearch} />;
277
- };
84
+ ```bash
85
+ yarn start:shared
278
86
  ```
279
87
 
280
- ### ResponsiveLayoutWrapper
88
+ ## To run single newron app
281
89
 
282
- A wrapper component to create a responsive layout for your components.
283
-
284
- Usage Example:
285
-
286
- ```jsx
287
- import React from 'react';
288
- import { ResponsiveLayoutWrapper } from 'newron-ui-lib';
289
-
290
- const MyComponent = () => {
291
- return <ResponsiveLayoutWrapper>{/* Your components go here */}</ResponsiveLayoutWrapper>;
292
- };
90
+ ```bash
91
+ npm run newron
293
92
  ```
294
93
 
295
- ### Datalist
94
+ or
296
95
 
297
- A datalist component to search and select data.
298
-
299
- Props:
300
-
301
- - `options`: An array of options to be displayed in the datalist. (required)
302
- - `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)
303
-
304
- Usage Example:
305
-
306
- ```jsx
307
- import React, { useState } from 'react';
308
- import { Datalist } from 'newron-ui-lib';
309
-
310
- const MyComponent = () => {
311
- const [selectedOption, setSelectedOption] = useState('');
312
-
313
- const handleSelect = option => {
314
- setSelectedOption(option);
315
- };
316
-
317
- return <Datalist options={['Option 1', 'Option 2', 'Option 3']} onSelect={handleSelect} />;
318
- };
96
+ ```bash
97
+ yarn newron
319
98
  ```
320
99
 
321
- ### DynamicForm
100
+ ## To run single student app
322
101
 
323
- A dynamic form component to generate form fields dynamically.
324
-
325
- Props:
326
-
327
- - `initialValues`: An object containing the initial values for the form fields. (required)
328
- - `validationSchema`: A Yup schema for form validation. (required)
329
- - `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.
330
-
331
- Usage Example:
332
-
333
- ```jsx
334
- import React from 'react';
335
- import { DynamicForm } from 'newron-ui-lib';
336
- import * as Yup from 'yup';
337
-
338
- const MyComponent = () => {
339
- const initialValues = {
340
- username: '',
341
- password: ''
342
- };
343
-
344
- const validationSchema = Yup.object({
345
- username: Yup.string().required('Username is required'),
346
- password: Yup.string().required('Password is required')
347
- });
348
-
349
- const fields = [
350
- // Define your form fields here
351
- ];
352
-
353
- return <DynamicForm initialValues={initialValues} validationSchema={validationSchema} fields={fields} />;
354
- };
102
+ ```bash
103
+ npm run student
355
104
  ```
356
105
 
357
- ## Contributing
106
+ or
358
107
 
359
- We welcome contributions! If you find a bug or have a feature request, please open an issue or submit a pull request.
360
-
361
- ## Contributors
362
-
363
- - [Shaikh Faruk](https://github.com/Shaikhfaruk) (Maintainer and Contributor)
108
+ ```bash
109
+ yarn student
110
+ ```
364
111
 
365
- ## License
112
+ ## To run single entity app
366
113
 
367
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
114
+ ```bash
115
+ npm run entity
116
+ ```
368
117
 
369
- ## Changelog
118
+ or
370
119
 
371
- 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.
120
+ ```bash
121
+ yarn entity
122
+ ```
@@ -0,0 +1 @@
1
+ .DatePicker_react-date-picker__1U15H{display:inline-flex;position:relative}.DatePicker_react-date-picker__1U15H,.DatePicker_react-date-picker__1U15H *,.DatePicker_react-date-picker__1U15H :after,.DatePicker_react-date-picker__1U15H :before{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.DatePicker_react-date-picker--disabled__Ygu-E{background-color:#f0f0f0;color:#6d6d6d}.DatePicker_react-date-picker__wrapper__7TC58{border:thin solid gray;display:flex;flex-grow:1;flex-shrink:0}.DatePicker_react-date-picker__inputGroup__DRin9{box-sizing:content-box;flex-grow:1;min-width:calc(12px + 4.754em);padding:0 2px}.DatePicker_react-date-picker__inputGroup__divider__BdMVP{padding:1px 0;white-space:pre}.DatePicker_react-date-picker__inputGroup__divider__BdMVP,.DatePicker_react-date-picker__inputGroup__leadingZero__sx1c5{display:inline-block}.DatePicker_react-date-picker__inputGroup__input__tCyqo{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:none;border:0;box-sizing:content-box;color:currentColor;font:inherit;height:100%;min-width:.54em;padding:0 1px;position:relative}.DatePicker_react-date-picker__inputGroup__input__tCyqo::-webkit-inner-spin-button,.DatePicker_react-date-picker__inputGroup__input__tCyqo::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.DatePicker_react-date-picker__inputGroup__input__tCyqo:invalid{background:rgba(255,0,0,.1)}.DatePicker_react-date-picker__inputGroup__input--hasLeadingZero__PFjjl{margin-left:-.54em;padding-left:calc(1px + .54em)}.DatePicker_react-date-picker__button__vCDve{background:transparent;border:0;padding:4px 6px}.DatePicker_react-date-picker__button__vCDve:enabled{cursor:pointer}.DatePicker_react-date-picker__button__vCDve:enabled:focus .DatePicker_react-date-picker__button__icon__tVEvr,.DatePicker_react-date-picker__button__vCDve:enabled:hover .DatePicker_react-date-picker__button__icon__tVEvr{stroke:#0078d7}.DatePicker_react-date-picker__button__vCDve:disabled .DatePicker_react-date-picker__button__icon__tVEvr{stroke:#6d6d6d}.DatePicker_react-date-picker__button__vCDve svg{display:inherit}.DatePicker_react-date-picker__calendar__x-42c{max-width:100vw;width:350px;z-index:1}.DatePicker_react-date-picker__calendar--closed__Q4HlT{display:none}.DatePicker_react-date-picker__calendar__x-42c .DatePicker_react-calendar__4Asdh{border-width:thin}.Calendar_react-calendar__qJHj4{background:#fff;border:1px solid #a0a096;font-family:Arial,Helvetica,sans-serif;line-height:1.125em;max-width:100%;width:350px}.Calendar_react-calendar--doubleView__nGf8t{width:700px}.Calendar_react-calendar--doubleView__nGf8t .Calendar_react-calendar__viewContainer__2btsJ{display:flex;margin:-.5em}.Calendar_react-calendar--doubleView__nGf8t .Calendar_react-calendar__viewContainer__2btsJ>*{margin:.5em;width:50%}.Calendar_react-calendar__qJHj4,.Calendar_react-calendar__qJHj4 *,.Calendar_react-calendar__qJHj4 :after,.Calendar_react-calendar__qJHj4 :before{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.Calendar_react-calendar__qJHj4 button{border:0;margin:0;outline:none}.Calendar_react-calendar__qJHj4 button:enabled:hover{cursor:pointer}.Calendar_react-calendar__navigation__wITu3{display:flex;height:44px;margin-bottom:1em}.Calendar_react-calendar__navigation__wITu3 button{background:none;min-width:44px}.Calendar_react-calendar__navigation__wITu3 button:disabled{background-color:#f0f0f0}.Calendar_react-calendar__navigation__wITu3 button:enabled:focus,.Calendar_react-calendar__navigation__wITu3 button:enabled:hover{background-color:#e6e6e6}.Calendar_react-calendar__month-view__weekdays__Nn0to{font:inherit;font-size:.75em;font-weight:700;text-align:center;text-transform:uppercase}.Calendar_react-calendar__month-view__weekdays__weekday__rtE0x{padding:.5em}.Calendar_react-calendar__month-view__weekNumbers__q-s5B .Calendar_react-calendar__tile__E990-{align-items:center;display:flex;font:inherit;font-size:.75em;font-weight:700;justify-content:center}.Calendar_react-calendar__month-view__days__day--weekend__b2Eux{color:#d10000}.Calendar_react-calendar__century-view__decades__decade--neighboringCentury__7H6iU,.Calendar_react-calendar__decade-view__years__year--neighboringDecade__xK8IH,.Calendar_react-calendar__month-view__days__day--neighboringMonth__PqU6x{color:#757575}.Calendar_react-calendar__century-view__9bnxl .Calendar_react-calendar__tile__E990-,.Calendar_react-calendar__decade-view__UtHRh .Calendar_react-calendar__tile__E990-,.Calendar_react-calendar__year-view__U51oY .Calendar_react-calendar__tile__E990-{padding:2em .5em}.Calendar_react-calendar__tile__E990-{background:none;line-height:16px;font:inherit;font-size:.833em;max-width:100%;padding:10px 6.6667px;text-align:center}.Calendar_react-calendar__tile__E990-:disabled{background-color:#f0f0f0;color:#ababab}.Calendar_react-calendar__century-view__decades__decade--neighboringCentury__7H6iU:disabled,.Calendar_react-calendar__decade-view__years__year--neighboringDecade__xK8IH:disabled,.Calendar_react-calendar__month-view__days__day--neighboringMonth__PqU6x:disabled{color:#cdcdcd}.Calendar_react-calendar__tile__E990-:enabled:focus,.Calendar_react-calendar__tile__E990-:enabled:hover{background-color:#e6e6e6}.Calendar_react-calendar__tile--now__18Dll{background:#ffff76}.Calendar_react-calendar__tile--now__18Dll:enabled:focus,.Calendar_react-calendar__tile--now__18Dll:enabled:hover{background:#ffffa9}.Calendar_react-calendar__tile--hasActive__uksuk{background:#76baff}.Calendar_react-calendar__tile--hasActive__uksuk:enabled:focus,.Calendar_react-calendar__tile--hasActive__uksuk:enabled:hover{background:#a9d4ff}.Calendar_react-calendar__tile--active__0T5dw{background:#006edc;color:#fff}.Calendar_react-calendar__tile--active__0T5dw:enabled:focus,.Calendar_react-calendar__tile--active__0T5dw:enabled:hover{background:#1087ff}.Calendar_react-calendar--selectRange__Ydd5T .Calendar_react-calendar__tile--hover__rAUKA{background-color:#e6e6e6}