@oliasoft-open-source/react-ui-library 4.3.2 → 4.4.1

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 (70) hide show
  1. package/README.md +2645 -2
  2. package/dist/404.html +1 -1
  3. package/dist/assets/{index-KHBkFPvW.js → index-vJcZHmMH.js} +2 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.html +1 -1
  6. package/dist/storybook/assets/{Color-6VNJS4EI-N_ztWf-2.js → Color-6VNJS4EI-fNEnxQ05.js} +1 -1
  7. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-n9vPiSxN.js → DocsRenderer-NNNQARDV-KMTyUuTi.js} +1 -1
  8. package/dist/storybook/assets/{WithTooltip-4HIR6TLV-SapwsMVA.js → WithTooltip-4HIR6TLV-29nNQIoq.js} +1 -1
  9. package/dist/storybook/assets/{accordion.stories-1Yd6WIbt.js → accordion.stories-gltYKUzg.js} +1 -1
  10. package/dist/storybook/assets/{actions-ESle7xCw.js → actions-Z9jDWreP.js} +1 -1
  11. package/dist/storybook/assets/actions.stories-Qrio9EMy.js +1 -0
  12. package/dist/storybook/assets/{afe.stories-4IYdV9SC.js → afe.stories-Vnsgz9Oy.js} +1 -1
  13. package/dist/storybook/assets/{blowout.stories-KO5_m0Xn.js → blowout.stories-BXWf5R9h.js} +1 -1
  14. package/dist/storybook/assets/{buttons-and-links-tNxsA8cW.js → buttons-and-links-veHns3Q1.js} +1 -1
  15. package/dist/storybook/assets/{casing-loads.stories-Yonx5Xjy.js → casing-loads.stories-ZzYedx2i.js} +1 -1
  16. package/dist/storybook/assets/{cell.stories-Ai43vY3p.js → cell.stories-AfSTiUk8.js} +1 -1
  17. package/dist/storybook/assets/{chunk-HLWAVYOI-vQmBbPB0.js → chunk-HLWAVYOI-mGXCf4xj.js} +1 -1
  18. package/dist/storybook/assets/{color-vWRh3Qae.js → color-tLDnWSIG.js} +1 -1
  19. package/dist/storybook/assets/{drawer.stories-yRZlQHoV.js → drawer.stories-ezk4vO0w.js} +1 -1
  20. package/dist/storybook/assets/{file-input.stories-wkU6vhN2.js → file-input.stories-UaDciacM.js} +1 -1
  21. package/dist/storybook/assets/{footer.stories-sVnY5dxB.js → footer.stories-bp50SxzB.js} +1 -1
  22. package/dist/storybook/assets/{form.stories-vqEAUdaV.js → form.stories-XCXzg5lT.js} +1 -1
  23. package/dist/storybook/assets/{formation.stories-EZGmfE0B.js → formation.stories-5x0HcI_o.js} +1 -1
  24. package/dist/storybook/assets/{formatter-SWP5E3XI-JiERVZcR.js → formatter-SWP5E3XI-6m6W7NB7.js} +1 -1
  25. package/dist/storybook/assets/{iframe-MASZ_taO.js → iframe-AtjhTGyx.js} +2 -2
  26. package/dist/storybook/assets/{index-VjG8bBMn.js → index-PqLI7NLX.js} +5 -5
  27. package/dist/storybook/assets/{input-group.stories-o6aJnQk-.js → input-group.stories-WljyIQ0a.js} +1 -1
  28. package/dist/storybook/assets/{input-validation-MPaWGcuk.js → input-validation-DXz2wD-a.js} +1 -1
  29. package/dist/storybook/assets/{inputs-Sm5fiswx.js → inputs-XRPZnL3K.js} +1 -1
  30. package/dist/storybook/assets/{layout-forms-VHDoIwjI.js → layout-forms-ZNGJC4ku.js} +1 -1
  31. package/dist/storybook/assets/{layout-general-QHIsmA1E.js → layout-general-ZjVDSo7T.js} +1 -1
  32. package/dist/storybook/assets/{list-AFiJglj_.js → list-8l-RGDgw.js} +1 -1
  33. package/dist/storybook/assets/{list-heading-aUkU7WVX.js → list-heading-Vd3hu5Pf.js} +1 -1
  34. package/dist/storybook/assets/{list.stories-data-diC_-6U8.js → list.stories-data-9RrIjRci.js} +1 -1
  35. package/dist/storybook/assets/{list.stories-W1gjIbW0.js → list.stories-uR6izjvO.js} +1 -1
  36. package/dist/storybook/assets/{menu.stories-5QTqzc0j.js → menu.stories-5G4phywO.js} +1 -1
  37. package/dist/storybook/assets/{modal.stories-0tVFnKsk.js → modal.stories-15sY1c5H.js} +1 -1
  38. package/dist/storybook/assets/{number-input.stories-Y4KCEwyl.js → number-input.stories-BURENIFo.js} +1 -1
  39. package/dist/storybook/assets/{option-dropdown.stories-BZFwP6Yb.js → option-dropdown.stories-M-9T9SPD.js} +1 -1
  40. package/dist/storybook/assets/{padding-and-spacing-8Wu8yRXq.js → padding-and-spacing-jFhAKOb3.js} +1 -1
  41. package/dist/storybook/assets/{page.stories--UKnMSnH.js → page.stories-9XUTUblI.js} +1 -1
  42. package/dist/storybook/assets/{pagination-xSK12Mw6.js → pagination-5n5spTRo.js} +1 -1
  43. package/dist/storybook/assets/{pagination.stories-QCBvGl43.js → pagination.stories-g4a-aSxq.js} +1 -1
  44. package/dist/storybook/assets/{popover.stories-A0yFzv01.js → popover.stories-bWBLR9fB.js} +1 -1
  45. package/dist/storybook/assets/{preview-gGv3xOED.js → preview--FJCNxDW.js} +2 -2
  46. package/dist/storybook/assets/{preview-a0xf0jE3.js → preview-iJSm7cbB.js} +1 -1
  47. package/dist/storybook/assets/{projects.stories-th_1Q6JE.js → projects.stories-84p22lkF.js} +1 -1
  48. package/dist/storybook/assets/{reservoirs.stories-8TqqVc0I.js → reservoirs.stories-lSGho6cn.js} +1 -1
  49. package/dist/storybook/assets/{rich-text-input.stories-GdgPkhki.js → rich-text-input.stories-7UzvJ-A1.js} +1 -1
  50. package/dist/storybook/assets/{row.stories-bgcrzXdg.js → row.stories-PI3ZuTkd.js} +1 -1
  51. package/dist/storybook/assets/{select-5jrVNbFb.js → select-JjEPivho.js} +1 -1
  52. package/dist/storybook/assets/{select.stories-CHb_zXq1.js → select.stories-YmcYKg5S.js} +1 -1
  53. package/dist/storybook/assets/{site.stories-DZWVugCr.js → site.stories-kQfgnXtd.js} +1 -1
  54. package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-sxd_zSAO.js → syntaxhighlighter-NMPM6SWI-_gbIaGwd.js} +1 -1
  55. package/dist/storybook/assets/{table-GUPoXZvd.js → table-KQyoQ8Lr.js} +1 -1
  56. package/dist/storybook/assets/{table.stories--_S1ugBI.js → table.stories-Fm6V6i5a.js} +1 -1
  57. package/dist/storybook/assets/{table.stories-data-I6ced_TS.js → table.stories-data-9XfBJddg.js} +1 -1
  58. package/dist/storybook/assets/{textarea-4DUPP53K.js → textarea-G-2zTY2v.js} +1 -1
  59. package/dist/storybook/assets/{textarea.stories-vQSCjGav.js → textarea.stories-Uc6PIiD1.js} +1 -1
  60. package/dist/storybook/assets/{title.stories-Iv83hSjO.js → title.stories-txOeNeeh.js} +1 -1
  61. package/dist/storybook/assets/{tooltip.test-case.stories-3XN1XAsX.js → tooltip.test-case.stories-3T_tzhJs.js} +1 -1
  62. package/dist/storybook/assets/{top-bar-C1c_2fzK.js → top-bar-3dxv0sp9.js} +1 -1
  63. package/dist/storybook/assets/{top-bar.stories-__ExKqyI.js → top-bar.stories-sMvXnmhR.js} +1 -1
  64. package/dist/storybook/assets/{top-bar.testcase.stories-IBxNcBB7.js → top-bar.testcase.stories-Nb8fdPBS.js} +1 -1
  65. package/dist/storybook/assets/{tree.stories-Qj5XiDg8.js → tree.stories-_5t-Rrls.js} +1 -1
  66. package/dist/storybook/assets/{unit-input.stories-W6qu5wAu.js → unit-input.stories-SeRH17v8.js} +1 -1
  67. package/dist/storybook/iframe.html +1 -1
  68. package/dist/storybook/project.json +1 -1
  69. package/package.json +1 -1
  70. package/dist/storybook/assets/actions.stories-e6y9BT7N.js +0 -1
package/README.md CHANGED
@@ -1,5 +1,2648 @@
1
1
  # React UI Library
2
2
 
3
- React UI Library is a collection of reusable UI components for use in React applications.
3
+ ## Description
4
4
 
5
- For usage instructions and technical documentation, see the [Wiki](https://gitlab.com/oliasoft-open-source/react-ui-library/wikis/home).
5
+ The React UI Library by Oliasoft is a versatile set of React UI components designed for building modern web applications. It offers a comprehensive suite of layout, navigation, and control components that are flexible and configurable. With detailed examples available in Storybook, developers can easily understand how to implement and customize components for their needs. This library is open-source and can be freely used and modified under the MIT License.
6
+
7
+ ## Installation
8
+
9
+ To install the React UI Library, you can use either npm or yarn as follows:
10
+
11
+ Using npm:
12
+ ```bash
13
+ npm install @oliasoft-open-source/react-ui-library
14
+ ```
15
+
16
+ Using yarn:
17
+ ```bash
18
+ yarn add @oliasoft-open-source/react-ui-library
19
+ ```
20
+
21
+ ## Quick Start: React and Vite
22
+
23
+ To quickly start a new project using the React UI Library with Vite, you can use the `create-vite` tool, which sets up everything for you in a few simple steps:
24
+
25
+ 1. **Create a New Vite Project:** Use the `create-vite` command to scaffold a new React project. Run:
26
+ ```bash
27
+ npm create vite@latest my-new-project -- --template react
28
+ ```
29
+ Or with yarn
30
+
31
+ ```bash
32
+ yarn create vite my-new-project --template react
33
+ ```
34
+
35
+ 2. **Navigate into the Project Directory:**
36
+
37
+ ```bash
38
+ cd my-new-project
39
+ ```
40
+
41
+ 3. **Install React UI Library: Add the React UI Library to your project:**
42
+
43
+ ```bash
44
+ npm install @oliasoft-open-source/react-ui-library
45
+ ```
46
+ Or with yarn
47
+
48
+ ```bash
49
+ yarn add @oliasoft-open-source/react-ui-library
50
+ ```
51
+
52
+ 4. **Modify the Sample Page:** Open the src/App.jsx file and import a component from the React UI Library to use it:
53
+
54
+ ```bash
55
+ import React from 'react';
56
+ import { Text } from '@oliasoft-open-source/react-ui-library';
57
+
58
+ function App() {
59
+ return (
60
+ <div className="App">
61
+ <Text>Hello World!</Text>
62
+ </div>
63
+ );
64
+ }
65
+
66
+ export default App;
67
+ ```
68
+
69
+ 5. **Start the Development Server: Begin development by starting the Vite server:**
70
+
71
+ ```bash
72
+ npm run dev
73
+ ```
74
+ Or with yarn
75
+
76
+ ```bash
77
+ yarn dev
78
+ ```
79
+
80
+ # Components
81
+
82
+ - [Accordion](#accordion)
83
+ - [AccordionWithDefaultToggle](#accordionwithdefaulttoggle)
84
+ - [Actions](#actions)
85
+ - [Badge](#badge)
86
+ - [Breadcrumb](#breadcrumb)
87
+ - [Button](#button)
88
+ - [ButtonGroup](#buttongroup)
89
+ - [Card](#card)
90
+ - [CheckBox](#checkbox)
91
+ - [Column](#column)
92
+ - [Divider](#divider)
93
+ - [Dialog](#dialog)
94
+ - [Drawer](#drawer)
95
+ - [Empty](#empty)
96
+ - [FileInput & readFile](#fileinput--readfile)
97
+ - [Field](#field)
98
+ - [Flex](#flex)
99
+ - [FormRow](#formrow)
100
+ - [Grid](#grid)
101
+ - [Icon](#icon)
102
+ - [InputGroup](#inputgroup)
103
+ - [InputGroupAddon](#inputgroupaddon)
104
+ - [HelpIcon](#helpicon)
105
+ - [Heading](#heading)
106
+ - [Input](#input)
107
+ - [Label](#label)
108
+ - [List](#list)
109
+ - [ListHeading](#listheading)
110
+ - [ListSubheading](#listsubheading)
111
+ - [Loader](#loader)
112
+ - [Menu](#menu)
113
+ - [Message](#message)
114
+ - [Modal](#modal)
115
+ - [OptionDropdown](#optiondropdown)
116
+ - [Page](#page)
117
+ - [Pagination](#pagination)
118
+ - [Popover](#popover)
119
+ - [Portal](#portal)
120
+ - [PrintHeader](#printheader)
121
+ - [ProgressBar](#progressbar)
122
+ - [RadioButton](#radiobutton)
123
+ - [RichTextInput](#richtextinput)
124
+ - [NativeSelect](#nativeselect)
125
+ - [Row](#row)
126
+ - [Select](#select)
127
+ - [SideBar](#sidebar)
128
+ - [Slider](#slider)
129
+ - [Spacer](#spacer)
130
+ - [Spinner](#spinner)
131
+ - [Table](#table)
132
+ - [Tabs](#tabs)
133
+ - [Text](#text)
134
+ - [TextLink](#textlink)
135
+ - [TextArea](#textarea)
136
+ - [toast](#toast)
137
+ - [Toggle](#toggle)
138
+ - [Tooltip](#tooltip)
139
+ - [TopBar](#topbar)
140
+ - [PopConfirm](#popconfirm)
141
+ - [Tree](#tree)
142
+ - [NumberInput](#numberinput)
143
+ - [UnitInput](#unitinput)
144
+
145
+ ## Storybook
146
+
147
+ To see live examples and demos of the components, please visit our [Storybook](https://oliasoft-open-source.gitlab.io/react-ui-library/storybook/?path=/docs/buttons-links--docs).
148
+
149
+ ## License
150
+
151
+ This project is open-source and available under the [MIT License](LICENSE).
152
+
153
+ ## Questions or Issues?
154
+
155
+ If you have any questions or encounter any issues, please open an issue on the [issues page](https://gitlab.com/oliasoft-open-source/react-ui-library/issues) of the repository.
156
+
157
+ # Components Details
158
+
159
+ ## Accordion Component <a id="accordion"></a>
160
+
161
+ The `Accordion` component provides a versatile way to toggle visibility of content. It can be expanded to show content or collapsed to hide content, with additional options for styling and behavior customization.
162
+
163
+ ## Properties
164
+
165
+ | Prop Name | Description | Default Value |
166
+ |----------------|-----------------------------------------------------------------------------|---------------|
167
+ | `heading` | The content displayed in the accordion header. | None (required) |
168
+ | `expanded` | If true, the accordion will be initially expanded. | `false` |
169
+ | `managed` | Determines if the accordion's expansion state is controlled externally. | `false` |
170
+ | `bordered` | If true, adds a border to the accordion. | `false` |
171
+ | `padding` | If true, adds padding inside the accordion content area. | `true` |
172
+ | `children` | The content to be displayed within the accordion when it is expanded. | None (optional) |
173
+ | `onClick` | Function to handle click events on the accordion header. | None (optional) |
174
+ | `squareBottom` | If true, the bottom of the accordion will be square instead of rounded. | `false` |
175
+ | `testId` | An optional identifier used for testing. | None (optional) |
176
+
177
+ ## Usage Example
178
+
179
+ ```jsx
180
+ <Accordion
181
+ heading="Section 1"
182
+ expanded
183
+ bordered
184
+ onClick={() => console.log("Accordion clicked")}
185
+ >
186
+ Content goes here
187
+ </Accordion>
188
+ ```
189
+
190
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
191
+
192
+ ## AccordionWithDefaultToggle <a id="accordionwithdefaulttoggle"></a>
193
+
194
+ An enhanced accordion component that includes a default toggle feature, allowing for more interactive and user-driven content display. It extends the basic functionality of an accordion by offering a built-in toggle option with customizable label and behavior.
195
+
196
+ ### Props
197
+
198
+ | Prop Name | Description | Default Value |
199
+ |----------------------|------------------------------------------------------------------------------------------------------|----------------|
200
+ | `heading` | The content to be displayed in the accordion header. | None (required)|
201
+ | `toggleLabel` | Label for the default toggle switch. | None (required)|
202
+ | `expanded` | Controls if the accordion is expanded or collapsed by default. | `false` |
203
+ | `defaultEnabled` | Determines if the default toggle is enabled. | `true` |
204
+ | `onClickDefaultToggle`| Function called when the default toggle is clicked. Receives the change event as an argument. | None (optional) |
205
+ | `padding` | If `true`, adds padding to the accordion content for better spacing. | `true` |
206
+ | `children` | The content to be displayed inside the accordion when it is expanded. | None (optional) |
207
+
208
+ ### Usage Example
209
+
210
+ ```jsx
211
+ <AccordionWithDefaultToggle
212
+ heading="Section 1"
213
+ toggleLabel="Enable Section"
214
+ onClickDefaultToggle={(evt) => console.log(evt.target.checked)}
215
+ expanded
216
+ defaultEnabled
217
+ padding
218
+ >
219
+ {/* Content here */}
220
+ </AccordionWithDefaultToggle>
221
+ ```
222
+
223
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
224
+
225
+ ## Actions <a id="actions"></a>
226
+
227
+ The `Actions` component is designed to display a set of actions or options. It supports primary actions, subactions, icons, tooltips, and can conditionally hide or disable actions. Ideal for implementing interactive lists, toolbars, or context menus within your application.
228
+
229
+ ### Properties
230
+
231
+ | Prop Name | Description | Type | Default Value (optional) |
232
+ |----------------|-----------------------------------------------------------|------------------------------------------------------------|---------------------------|
233
+ | `actions` | Array of action items to display. | `IAction[]` | |
234
+ | `closeLayer` | Function to close the action layer. Optional. | `TEmpty` (Function with no arguments and no return value) | None |
235
+
236
+ ### `IAction` Properties
237
+
238
+ | Prop Name | Description | Type | Default Value (optional) |
239
+ |--------------------|-----------------------------------------------------|---------------------------------------------------------------|---------------------------|
240
+ | `label` | Text label for the action. | `TStringNumberNull` (String, number, or null) | None |
241
+ | `childComponent` | Component to render as a child. | `ReactNode` \| `(() => ReactNode)` | None |
242
+ | `subActions` | Array of subaction items. | `ISubAction[]` | None |
243
+ | `primary` | Marks the action as primary. | `boolean` | False |
244
+ | `icon` | Icon to display alongside the label. | `ReactNode` | None |
245
+ | `testId` | Identifier for testing purposes. | `string` | None |
246
+ | `hidden` | Whether the action is hidden. | `boolean` | False |
247
+ | `disabled` | Whether the action is disabled. | `boolean` | False |
248
+ | `onClick` | Function to call when the action is clicked. | `(evt: React.MouseEvent, id?: TStringOrNumber) => void` | None |
249
+ | `tooltip` | Tooltip to display on hover. | `ReactNode` \| `string` | None |
250
+
251
+ ### Usage Example
252
+
253
+ ```jsx
254
+ <Actions
255
+ actions={[
256
+ {
257
+ label: 'Action 1',
258
+ onClick: () => console.log('Action 1 clicked'),
259
+ primary: true,
260
+ },
261
+ {
262
+ label: 'Action 2',
263
+ onClick: () => console.log('Action 2 clicked'),
264
+ disabled: true,
265
+ },
266
+ {
267
+ label: 'Action 3',
268
+ onClick: () => console.log('Action 3 clicked'),
269
+ tooltip: 'This is a tooltip for Action 3',
270
+ },
271
+ ]}
272
+ />
273
+ ```
274
+
275
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
276
+
277
+ ## Badge <a id="badge"></a>
278
+
279
+ The `Badge` component is used to display a small badge, often used to show a count or to label an item with a short piece of text. This component can be customized with color, size, and optional dot mode for notifications or status indicators.
280
+
281
+ ### Properties
282
+
283
+ | Prop Name | Description | Default Value |
284
+ |-----------|-------------------------------------------------------|---------------|
285
+ | children | The content inside the badge. | None (optional) |
286
+ | color | The color of the badge. | '' (empty string) |
287
+ | title | The title or text displayed inside the badge. | None (optional) |
288
+ | dot | If true, displays a dot instead of the children. | false |
289
+ | margin | Margin around the badge. | None (optional) |
290
+ | small | If true, displays a smaller version of the badge. | false |
291
+
292
+ ### Usage Example
293
+
294
+ ```jsx
295
+ <Badge
296
+ color="red"
297
+ title="New"
298
+ dot
299
+ margin="0 8px"
300
+ small
301
+ >
302
+ {/* Children here, if any */}
303
+ </Badge>
304
+ ```
305
+
306
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
307
+
308
+ ## Breadcrumb Component <a id="breadcrumb"></a>
309
+
310
+ The `Breadcrumb` component displays a navigation path, typically used to show the user's location within a hierarchical structure.
311
+
312
+ **Props:**
313
+
314
+ | Prop Name | Description | Default Value |
315
+ |---|---|---|
316
+ | links | An array of objects representing the breadcrumb links. (See `ILinkProps` for details) | Required |
317
+ | small | If `true`, displays a smaller version of the breadcrumb. | `false` |
318
+
319
+ **ILinkProps Interface:**
320
+
321
+ This interface defines the properties for each breadcrumb link.
322
+
323
+ | Prop Name | Description |
324
+ |---|---|
325
+ | type | The type of the link (implementation-specific). | Optional |
326
+ | label | The text displayed for the link. | Optional |
327
+ | url | The URL the link points to. | Optional |
328
+ | onClick | A function to be called when the link is clicked. | Optional |
329
+ | active | If `true`, indicates the link is the current location. | Optional |
330
+ | disabled | If `true`, the link is disabled and cannot be clicked. | Optional |
331
+ | element | A React node to render instead of the default link behavior. | Optional |
332
+
333
+ **Usage Example:**
334
+
335
+ ```jsx
336
+ <Breadcrumb
337
+ links={[
338
+ { label: 'Home', url: '/' },
339
+ { label: 'Products', url: '/products' },
340
+ { label: 'Current Product', active: true },
341
+ ]}
342
+ />
343
+ ```
344
+
345
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
346
+
347
+ ## Button <a id="button"></a>
348
+
349
+ The `Button` component is a versatile interface element that supports various styles and states, including active, basic, colored, disabled, and loading states. It's suitable for a wide range of actions within an application, from form submissions to interactive commands.
350
+
351
+ ### Props
352
+
353
+ | Prop | Description | Default Value |
354
+ |---------------|------------------------------------------------------------|----------------|
355
+ | `active` | Shows the button in an active state. | `false` |
356
+ | `basic` | Applies a link-style appearance to the button. | `false` |
357
+ | `colored` | Applies color styling. Can be boolean or string (color code or name). | `false` |
358
+ | `disabled` | If true, disables the button. | `false` |
359
+ | `groupOrder` | Specifies the button's position in a group (e.g., start, middle, end). | None (optional) |
360
+ | `icon` | An icon to be displayed on the button. Deprecated in favor of using `label`. | None (optional) |
361
+ | `label` | The content of the button, which can be text or a ReactNode. | None (optional) |
362
+ | `loading` | Shows an activity indicator, suggesting that an action is in progress. | `false` |
363
+ | `name` | The name of the button, which can be used in forms. | None (optional) |
364
+ | `onClick` | Function to call when the button is clicked. | None (optional) |
365
+ | `pill` | Deprecated. Use `round` for rounded corners instead. | `false` |
366
+ | `round` | If true, applies rounded corners to the button. | `false` |
367
+ | `small` | If true, displays the button in a smaller size. | `false` |
368
+ | `styles` | Custom styles to be applied to the button. | None (optional) |
369
+ | `width` | The width of the button, can be a number or string. | None (optional) |
370
+ | `title` | Tooltip text for the button. | None (optional) |
371
+ | `type` | The button type (e.g., "button", "submit"). | `button` |
372
+ | `error` | Displays an error state or message. | None (optional) |
373
+ | `warning` | Displays a warning state or message. | None (optional) |
374
+ | `testId` | A test identifier for the button. | None (optional) |
375
+ | `tooltip` | Tooltip content. Can be text or a ReactNode. | None (optional) |
376
+ | `inverted` | Deprecated. | `false` |
377
+
378
+ ### Usage Example
379
+
380
+ ```jsx
381
+ <Button
382
+ label="Click Me"
383
+ onClick={() => console.log('Button clicked')}
384
+ colored="blue"
385
+ small
386
+ />
387
+ ```
388
+
389
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
390
+
391
+ ## ButtonGroup <a id="buttongroup"></a>
392
+
393
+ The `ButtonGroup` component allows for the grouping of button-like elements, making it useful for presenting a selection of options or actions together. This component supports customization in terms of appearance, selection handling, and more, making it versatile for various UI scenarios.
394
+
395
+ ### IButtonGroupProps
396
+
397
+ | Prop | Description | Default Value |
398
+ |---------------|----------------------------------------------------------------|----------------|
399
+ | `disabled` | If true, disables all buttons in the group. | None (optional) |
400
+ | `basic` | If true, applies a basic style to the button group. | `false` |
401
+ | `items` | An array of items (strings or `IBtnGroupItemProps`) in the group. | `[]` |
402
+ | `header` | An optional header for the group. | `''` |
403
+ | `onSelected` | Callback function triggered when an item is selected. | `() => {}` |
404
+ | `small` | If true, applies a smaller size to the buttons in the group. | `false` |
405
+ | `value` | The currently selected value. | None (optional) |
406
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
407
+
408
+ ### IBtnGroupItemProps
409
+
410
+ | Prop | Description | Default Value |
411
+ |--------------------|--------------------------------------------------|----------------|
412
+ | `label` | The label for the item. | None (optional) |
413
+ | `value` | The value associated with the item. | None (required) |
414
+ | `key` | A unique key for the item. | None (required) |
415
+ | `hidden` | If true, the item is hidden. | `false` |
416
+ | `icon` | An icon displayed next to the item label. | None (optional) |
417
+ | `error` | Displays an error state for the item. | None (optional) |
418
+ | `maxTooltipWidth` | The maximum width of the item's tooltip. | None (optional) |
419
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
420
+ | `tooltip` | Tooltip text or component for the item. | None (optional) |
421
+ | `warning` | Displays a warning state for the item. | None (optional) |
422
+ | `disabled` | If true, the item is disabled. | `false` |
423
+
424
+ ### Usage Example
425
+
426
+ ```jsx
427
+ <ButtonGroup
428
+ items={[
429
+ { label: 'Button 1', value: '1' },
430
+ { label: 'Button 2', value: '2', disabled: true },
431
+ { label: 'Button 3', value: '3' }
432
+ ]}
433
+ onSelected={(selectedValue) => console.log(selectedValue)}
434
+ />
435
+ ```
436
+
437
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
438
+
439
+ ## Card <a id="card"></a>
440
+
441
+ ### Props
442
+
443
+ | Prop | Description | Default Value |
444
+ |------------|------------------------------------------------------------------|----------------|
445
+ | `bordered` | If true, displays a border around the card. | `true` |
446
+ | `heading` | Optional heading content for the card. | None (optional) |
447
+ | `margin` | The margin around the card, specified as a CSS value. | `'0'` |
448
+ | `padding` | If true, applies padding inside the card. | `true` |
449
+ | `raised` | If true, applies a box-shadow to give the card a "raised" effect. | `false` |
450
+ | `children` | The content within the card. | None (optional) |
451
+
452
+ ### Usage Example
453
+
454
+ ```jsx
455
+ <Card heading="Card Title" raised>
456
+ <p>This is some content within a card.</p>
457
+ </Card>
458
+ ```
459
+
460
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
461
+
462
+ ## CheckBox <a id="checkbox"></a>
463
+
464
+ The `CheckBox` component is used to create a checkbox input field, often utilized for options that can be toggled between two states, such as true/false or yes/no. This component supports various customizations including label display, size adjustments, and integrated help text.
465
+
466
+ ### Props
467
+
468
+ | Prop | Description | Default Value |
469
+ |---------------|------------------------------------------------------------------|-----------------|
470
+ | `checked` | Determines whether the checkbox is checked. | `false` |
471
+ | `isInTable` | If true, optimizes the checkbox for use within a table. | `false` |
472
+ | `label` | The text label associated with the checkbox. | None (optional) |
473
+ | `name` | The name of the checkbox input, useful for form submission. | None (required) |
474
+ | `noMargin` | If true, removes the margin around the checkbox for tighter UI integration. | `false` |
475
+ | `onChange` | A callback function that is called when the checkbox state changes. | None (required) |
476
+ | `tabIndex` | The tab index of the checkbox. | `0` |
477
+ | `disabled` | If true, disables the checkbox preventing user interaction. | `false` |
478
+ | `small` | If true, renders a smaller version of the checkbox. | `false` |
479
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
480
+ | `key` | A unique key for rendering the component in lists. | `''` |
481
+ | `dataix` | Custom data index attribute for the component. | `0` |
482
+ | `value` | The value of the checkbox. | None (optional) |
483
+ | `helpText` | Optional help text displayed near the checkbox. | None (optional) |
484
+ | `onClickHelp` | A callback function triggered when the help text is clicked. | None (optional) |
485
+
486
+ ### Usage Example
487
+
488
+ ```jsx
489
+ <CheckBox
490
+ label="Accept Terms"
491
+ name="termsAccepted"
492
+ checked={this.state.accepted}
493
+ onChange={e => this.setState({ accepted: e.target.checked })}
494
+ />
495
+ ```
496
+
497
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
498
+
499
+ ## Column <a id="column"></a>
500
+
501
+ The `Column` component is a layout tool designed for creating structured, flexible column-based layouts within your application. It supports a wide range of customization options, including background color, border control, padding, and responsive width adjustments, making it an essential element for responsive design.
502
+
503
+ ### Props
504
+
505
+ | Prop | Description | Default Value |
506
+ |-----------------|------------------------------------------------------------------|-----------------------|
507
+ | `background` | The background color of the column. | `'transparent'` |
508
+ | `borderLeft` | Controls the presence and style of the left border. | None (optional) |
509
+ | `borderRight` | Controls the presence and style of the right border. | None (optional) |
510
+ | `children` | The content to be displayed inside the column. | None (optional) |
511
+ | `flex` | If `true`, enables flex layout for the column contents. | `true` |
512
+ | `flexbox` | If `true`, the column will use flexbox layout. | `false` |
513
+ | `padding` | Controls padding inside the column. Can be boolean or string. | `false` |
514
+ | `scroll` | If `true`, enables scrolling within the column. | `false` |
515
+ | `showScrollbar` | Controls the visibility of the scrollbar. | `true` |
516
+ | `spacing` | Controls the spacing around items inside the column. | `'var(--padding)'` |
517
+ | `width` | The width of the column, responsive on all devices. | None (optional) |
518
+ | `widthMobile` | The column's width specifically for mobile devices. | None (optional) |
519
+ | `widthTablet` | The column's width specifically for tablet devices. | None (optional) |
520
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
521
+
522
+ ### Usage Example
523
+
524
+ ```jsx
525
+ <Column
526
+ background="lightgrey"
527
+ borderLeft="1px solid black"
528
+ padding="20px"
529
+ width={100}
530
+ widthMobile={50}
531
+ >
532
+ {/* Column Content Here */}
533
+ </Column>
534
+ ```
535
+
536
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
537
+
538
+ ## Divider <a id="divider"></a>
539
+
540
+ The `Divider` component visually separates content within your layout. It's customizable with respect to margin, color, and alignment, making it versatile for various design needs. It can be particularly useful in forms, lists, or between sections of content to provide a clear visual distinction.
541
+
542
+ ### Props
543
+
544
+ | Prop | Description | Default Value |
545
+ |------------|---------------------------------------------------|----------------------|
546
+ | `margin` | Margin around the divider, specified as a string or number. | `'var(--padding)'` |
547
+ | `color` | The color of the divider line. | `'var(--color-border)'` |
548
+ | `align` | The alignment of the divider within its container. Options are `left`, `center`, or `right`. | `Align.CENTER` |
549
+ | `children` | The content to display within the divider. This can be used to place text or icons in the divider line. | None (optional) |
550
+
551
+ ### Usage Example
552
+
553
+ ```jsx
554
+ <Divider align="center" color="grey" margin="20px">
555
+ <Text>OR</Text>
556
+ </Divider>
557
+ ```
558
+
559
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
560
+
561
+ ## Dialog <a id="dialog"></a>
562
+
563
+ The `Dialog` component encapsulates a dialog box or modal's structure and behavior, providing a flexible way to display content in a floating layer above the app's main UI. This component supports a variety of content and layouts, including headers, footers, and customizable padding, making it ideal for confirmations, information dialogs, and more complex interactions.
564
+
565
+ ### Props
566
+
567
+ | Prop | Description | Default Value |
568
+ |--------------------|-------------------------------------------------------|-------------------|
569
+ | `heading` | The title or heading of the dialog. | None (optional) |
570
+ | `content` | The main content of the dialog, can be a node or an array of strings. | None (optional) |
571
+ | `contentPadding` | Padding inside the dialog, around the content. | `'var(--padding)'`|
572
+ | `footer` | Footer content, typically used for actions. | None (optional) |
573
+ | `width` | Width of the dialog. | None (optional) |
574
+ | `height` | Height of the dialog. | None (optional) |
575
+ | `bordered` | If true, the dialog will have a border. | None (optional) |
576
+ | `onClose` | Function to call when the dialog is requested to close. | None (optional) |
577
+ | `scroll` | Enables scrolling within the dialog. | None (optional) |
578
+ | `testId` | A test identifier for the component. | None (optional) |
579
+
580
+ ### Usage Example
581
+
582
+ ```jsx
583
+ <Dialog
584
+ dialog={{
585
+ heading: "Dialog Title",
586
+ content: "This is the content of the dialog.",
587
+ footer: <button onClick={() => console.log('Closing dialog')}>Close</button>,
588
+ width: 400,
589
+ scroll: true,
590
+ onClose: () => console.log('Dialog closed'),
591
+ }}
592
+ />
593
+ ```
594
+
595
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
596
+
597
+ ## Drawer <a id="drawer"></a>
598
+
599
+ The `Drawer` component is a flexible and customizable sidebar or navigation drawer that slides in from the side of your application. It supports both left and right placement, fixed positioning, and the inclusion of tabs for additional organization. The drawer can be triggered to open or close programmatically, making it adaptable for various user interactions.
600
+
601
+ ### Props
602
+
603
+ | Prop | Description | Default Value |
604
+ |--------------------|---------------------------------------------------------------------|---------------------------------|
605
+ | `background` | The background color of the drawer. | `'var(--color-background-raised)'` |
606
+ | `children` | The content displayed inside the drawer. | None (optional) |
607
+ | `fixed` | If true, the drawer is fixed in position. | `false` |
608
+ | `open` | Controls the open state of the drawer. | `false` |
609
+ | `setOpen` | Function to set the open state of the drawer. | None (optional) |
610
+ | `right` | If true, the drawer slides in from the right. | `false` |
611
+ | `shadow` | If true, the drawer casts a shadow. | `false` |
612
+ | `top` | The distance of the drawer from the top of the viewport. | `0` |
613
+ | `width` | The width of the drawer when opened. Can be a single value or an array for responsive design. | `400` |
614
+ | `closedWidth` | The width of the drawer when closed. | `0` |
615
+ | `button` | Optional button to toggle the drawer. Can be boolean or a ReactNode for custom button. | None (optional) |
616
+ | `buttonAnimate` | If true, the toggle button animates on state change. | `true` |
617
+ | `buttonPosition` | Position of the toggle button. | `ButtonPosition.BOTTOM` |
618
+ | `border` | If true, adds a border to the drawer. Can be a boolean or a string for custom border styles. | `false` |
619
+ | `tabs` | Array of tabs for organizing content within the drawer. | None (optional) |
620
+ | `defaultTabIndex` | The index of the tab to be selected by default. | `0` |
621
+ | `activeTab` | Controls the active tab state. | None (optional) |
622
+ | `setActiveTab` | Function to set the active tab. | None (optional) |
623
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
624
+ | `onResize` | Callback function that is called when the drawer is resized. | None (optional) |
625
+ | `getActiveTab` | Function that receives the active tab information. | None (optional) |
626
+ | `onClose` | Callback function that is called when the drawer is closed. | None (optional) |
627
+ | `onOpen` | Callback function that is called when the drawer is opened. | None (optional) |
628
+
629
+ ### Usage Example
630
+
631
+ ```jsx
632
+ <Drawer
633
+ open={true}
634
+ right
635
+ width="250px"
636
+ onClose={() => console.log("Drawer closed")}
637
+ >
638
+ {/* Content here */}
639
+ </Drawer>
640
+ ```
641
+
642
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
643
+
644
+ ## Empty <a id="empty"></a>
645
+
646
+ The `Empty` component is a useful UI element for displaying a state where there is no data or content available. It can be customized with specific dimensions and text, making it adaptable to various scenarios where you might need to inform users that a section or area is intentionally empty.
647
+
648
+ ### Props
649
+
650
+ | Prop | Description | Default Value |
651
+ |------------|--------------------------------------------------|---------------|
652
+ | `width` | The width of the empty state container. | `'auto'` |
653
+ | `height` | The height of the empty state container. | `'auto'` |
654
+ | `text` | The text or ReactNode displayed in the empty state. | `'No data'` |
655
+ | `children` | Children elements to be rendered inside the empty state container. | None (optional) |
656
+ | `testId` | A unique identifier for testing purposes. | None (optional) |
657
+
658
+ ### Usage Example
659
+
660
+ ```jsx
661
+ <Empty
662
+ width={300}
663
+ height={200}
664
+ text="No items found."
665
+ >
666
+ <Button>Refresh</Button>
667
+ </Empty>
668
+ ```
669
+
670
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
671
+
672
+ ## FileInput <a id="fileinput"></a>
673
+
674
+ The `FileInput` component allows users to select files from their device storage. It supports single and multiple file selections, customizable via props. This component is ideal for forms requiring file uploads, offering options for file type acceptance, loading states, and accessibility features.
675
+
676
+ ### Props
677
+
678
+ | Prop | Description | Default Value |
679
+ |----------------|-----------------------------------------------------------|---------------------|
680
+ | `label` | The label displayed on the file input. | `'Select'` |
681
+ | `loading` | Displays a loading state if set to true. | `false` |
682
+ | `placeholder` | Text displayed when no file is selected. | `'No file selected'`|
683
+ | `disabled` | If true, disables the file input. | `false` |
684
+ | `file` | The currently selected file. | None (optional) |
685
+ | `accept` | Defines the file types the file input should accept. | None (optional) |
686
+ | `multi` | Allows multiple files to be selected if set to true. | None (optional) |
687
+ | `name` | The name attribute of the input element. | None (optional) |
688
+ | `width` | The width of the file input. | None (optional) |
689
+ | `onChange` | Callback function called when the selected file changes. | None (optional) |
690
+ | `testId` | A test identifier for the component. | None (optional) |
691
+
692
+ ### Usage Example
693
+
694
+ ```jsx
695
+ <FileInput
696
+ label="Upload Document"
697
+ accept=".pdf"
698
+ multi
699
+ onChange={(evt) => console.log(evt.target.files)}
700
+ />
701
+ ```
702
+
703
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
704
+
705
+ ## Field <a id="field"></a>
706
+
707
+ The `Field` component serves as a container for form elements, providing a structured layout for labels, input fields, help text, and additional features like lock icons or information tooltips.
708
+
709
+ ### Props
710
+
711
+ | Prop | Description | Default Value |
712
+ |------------------|--------------------------------------------------------------|------------------------------|
713
+ | `label` | The label for the field. | None |
714
+ | `labelLeft` | If true, aligns the label to the left. | `false` |
715
+ | `labelWidth` | The width of the label. | `'auto'` |
716
+ | `children` | The content of the field, typically an input component. | None (required) |
717
+ | `helpText` | Additional text to assist users with the field. | None |
718
+ | `helpTextMaxWidth` | The maximum width of the help text. | `'300px'` |
719
+ | `onClickHelp` | A callback function triggered when the help text is clicked. | `() => {}` |
720
+ | `lock` | Configuration for a lock icon. | `{ visible: false, active: false, onClick: () => {}, tooltip: '', testId: undefined }` |
721
+ | `info` | Additional information displayed alongside the field. | `''` |
722
+ | `libraryIcon` | Configuration for an icon from a library. | None |
723
+ | `testId` | A unique identifier for testing purposes. | - |
724
+
725
+ ### Usage Example
726
+
727
+ ```jsx
728
+ <Field
729
+ label="Username"
730
+ helpText="Choose a unique username"
731
+ info="Your username must be at least 6 characters long."
732
+ >
733
+ <Input placeholder="Enter your username" />
734
+ </Field>
735
+ ```
736
+
737
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
738
+
739
+ ## Flex <a id="flex"></a>
740
+
741
+ The `Flex` component enables flexible layout arrangements by providing properties to control the alignment, direction, and spacing of its children elements.
742
+
743
+ ### Props
744
+
745
+ | Prop | Description | Default Value |
746
+ |-------------------|-----------------------------------------------------------|---------------|
747
+ | `alignItems` | The alignment of flex items along the cross axis. | `'initial'` |
748
+ | `justifyContent` | The alignment of flex items along the main axis. | `'initial'` |
749
+ | `direction` | The direction of the flex container's main axis. | `'initial'` |
750
+ | `height` | The height of the flex container. | `'initial'` |
751
+ | `children` | The child elements of the flex container. | `null` |
752
+ | `wrap` | If true, allows flex items to wrap onto multiple lines. | `true` |
753
+ | `gap` | The gap between flex items. | `false` |
754
+
755
+ ### Usage Example
756
+
757
+ ```jsx
758
+ <Flex alignItems="center" justifyContent="space-between" direction="row" gap={10}>
759
+ <div>Item 1</div>
760
+ <div>Item 2</div>
761
+ <div>Item 3</div>
762
+ </Flex>
763
+ ```
764
+
765
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
766
+
767
+ ## FormRow <a id="formrow"></a>
768
+
769
+ The `FormRow` component is used to group form elements together in a row layout.
770
+
771
+ ### Props
772
+
773
+ | Prop | Description | Default Value |
774
+ |------------|----------------------------------------|---------------|
775
+ | `children` | The child elements of the form row. | `null` |
776
+
777
+ ### Usage Example
778
+
779
+ ```jsx
780
+ <FormRow>
781
+ <Input label="Username" />
782
+ <Button label="Submit" onClick={handleSubmit} />
783
+ </FormRow>
784
+ ```
785
+
786
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
787
+
788
+ ## Grid <a id="grid"></a>
789
+
790
+ The `Grid` component allows you to create a grid layout with specified rows and columns.
791
+
792
+ ### Props
793
+
794
+ | Prop | Description | Default Value |
795
+ |-----------------|-----------------------------------------------------|---------------|
796
+ | `rows` | The CSS value for defining the grid rows | `'initial'` |
797
+ | `columns` | The CSS value for defining the grid columns | `'initial'` |
798
+ | `columnsTablet` | The CSS value for defining grid columns on tablets | `null` |
799
+ | `columnsMobile` | The CSS value for defining grid columns on mobiles | `null` |
800
+ | `gap` | Whether to include gap between grid items | `false` |
801
+ | `height` | The CSS value for defining the grid height | `'initial'` |
802
+ | `children` | The child elements of the grid | `null` |
803
+
804
+ ### Usage Example
805
+
806
+ ```jsx
807
+ <Grid rows="auto" columns="repeat(3, 1fr)" gap={20}>
808
+ <GridItem>Item 1</GridItem>
809
+ <GridItem>Item 2</GridItem>
810
+ <GridItem>Item 3</GridItem>
811
+ </Grid>
812
+ ```
813
+
814
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
815
+
816
+ ## Icon <a id="icon"></a>
817
+
818
+ The `Icon` component is a wrapper used to render various types of icons within your application.
819
+
820
+ ### Props
821
+
822
+ | Prop | Description | Default Value |
823
+ |-------------|--------------------------------------------------------|---------------|
824
+ | `icon` | The icon to be rendered. This can be a ReactNode, string name, or SVG. | |
825
+ | `onClick` | The callback function triggered when the icon is clicked. | - |
826
+ | `clickable` | Determines whether the icon is clickable or not. | `false` |
827
+ | `color` | The color of the icon. | - |
828
+ | `size` | The size of the icon. | - |
829
+ | `testId` | A test id for identification in automated tests. | - |
830
+
831
+ ### Usage Example
832
+
833
+ ```jsx
834
+ <Icon icon="search" color="blue" size={24} />
835
+ ```
836
+
837
+ In this example, the `Icon` component renders an icon with the name "search", colored blue, and sized at 24 pixels.
838
+
839
+ - The `icon` prop accepts various formats such as string names, React components, or SVG elements.
840
+ - If using a string name, it's recommended to use icon libraries like Font Awesome or Material Icons.
841
+ - When providing a custom SVG, ensure it's properly formatted and compatible with React's rendering.
842
+ - Setting the `clickable` prop to `true` adds cursor pointer and hover effects to the icon.
843
+
844
+ ```jsx
845
+ <Icon icon={<CustomIcon />} clickable onClick={handleIconClick} />
846
+ ```
847
+
848
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
849
+
850
+ ## InputGroup <a id="inputgroup"></a>
851
+
852
+ The `InputGroup` component is used to group together multiple input elements or components.
853
+
854
+ ### Props
855
+
856
+ | Prop | Description | Default Value |
857
+ |------------|-------------------------------------------------------|---------------|
858
+ | `children` | The input elements or components to be grouped. | |
859
+ | `small` | Determines whether the input group is small or not. | `false` |
860
+ | `width` | The width of the input group. | `'100%'` |
861
+
862
+ ### Usage Example
863
+
864
+ ```jsx
865
+ <InputGroup>
866
+ <Input placeholder="Username" />
867
+ <Button>Search</Button>
868
+ </InputGroup>
869
+ ```
870
+
871
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
872
+
873
+ ## InputGroupAddon <a id="inputgroupaddon"></a>
874
+
875
+ The `InputGroupAddon` component is used to add additional content or components to an `InputGroup`.
876
+
877
+ ### Props
878
+
879
+ | Prop | Description | Default Value |
880
+ |---------------|------------------------------------------------------------|---------------|
881
+ | `children` | The content or components to be added to the input group. | |
882
+ | `groupOrder` | The order of the addon within the input group. | `null` |
883
+ | `small` | Determines whether the addon is small or not. | `false` |
884
+
885
+ ### Usage Example
886
+
887
+ ```jsx
888
+ <InputGroup>
889
+ <InputGroupAddon>$</InputGroupAddon>
890
+ <Input placeholder="Amount" />
891
+ </InputGroup>
892
+ ```
893
+
894
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
895
+
896
+ ## HelpIcon <a id="helpicon"></a>
897
+
898
+ The `HelpIcon` component provides an icon with optional tooltip text to offer assistance or additional information.
899
+
900
+ ### Props
901
+
902
+ | Prop | Description | Default Value |
903
+ |-------------|-----------------------------------------------------------------------------------------------------|---------------|
904
+ | `text` | The text or content to display in the tooltip. | |
905
+ | `onClick` | A function to be called when the icon is clicked. | |
906
+ | `icon` | The icon to display. It can be a ReactNode or a string representing an icon (e.g., "help", "info"). | `'help'` |
907
+ | `active` | Determines whether the icon is in an active state. | `false` |
908
+ | `maxWidth` | The maximum width of the tooltip. | `'300px'` |
909
+ | `testId` | The test ID for identifying the component in tests. | |
910
+
911
+ ### Usage Example
912
+
913
+ ```jsx
914
+ <HelpIcon text="Click here for more information" />
915
+ ```
916
+
917
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
918
+
919
+ ## Heading <a id="heading"></a>
920
+
921
+ The `Heading` component renders a heading element with optional features such as help text and an icon.
922
+
923
+ ### Props
924
+
925
+ | Prop | Description | Default Value |
926
+ |----------------|----------------------------------------------------------------------------------------------------------------------|---------------|
927
+ | `children` | The content to be rendered within the heading element. | |
928
+ | `helpText` | Additional text or content to provide assistance or information about the heading. | |
929
+ | `onClick` | A function to be called when the heading is clicked. | |
930
+ | `onClickHelp` | A function to be called when the help text is clicked. | |
931
+ | `onIconClick` | A function to be called when the icon is clicked. | |
932
+ | `icon` | The icon element to be displayed alongside the heading. | |
933
+ | `libraryIcon` | Configuration for the library icon, containing an `onClick` function and an optional `tooltip` text. | |
934
+ | `marginBottom` | The margin at the bottom of the heading. | |
935
+ | `top` | Determines whether the heading is displayed at the top of the container. | `false` |
936
+ | `testId` | The test ID for identifying the component in tests. | |
937
+
938
+ ### Usage Example
939
+
940
+ ```jsx
941
+ <Heading>Page Title</Heading>
942
+ ```
943
+
944
+ ```jsx
945
+ <Heading
946
+ top={true}
947
+ onClick={() => console.log('Heading clicked')}
948
+ helpText="This is the main title of the page"
949
+ onClickHelp={() => console.log('Help text clicked')}
950
+ icon={<QuestionCircleOutlined />}
951
+ libraryIcon={{ onClick: () => console.log('Library icon clicked'), tooltip: 'More info' }}
952
+ marginBottom="10px"
953
+ >
954
+ Page Title
955
+ </Heading>
956
+ ```
957
+
958
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
959
+
960
+ ## Input <a id="input"></a>
961
+
962
+ The `Input` component provides an input field for users to enter data. It supports various features such as error and warning messages, tooltips, and custom event handlers.
963
+
964
+ ### Props
965
+
966
+ | Prop | Description | Default Value |
967
+ |-----------------|---------------------------------------------------------------------------------------------------------------------|---------------|
968
+ | `error` | Error message or content to indicate validation errors. | `null` |
969
+ | `warning` | Warning message or content to indicate potential issues. | `null` |
970
+ | `tooltip` | Additional information or context provided as a tooltip. | `null` |
971
+ | `name` | The name attribute of the input field. | - |
972
+ | `type` | The type of input field (e.g., text, number, email). | `'text'` |
973
+ | `onChange` | Event handler called when the input value changes. | `() => {}` |
974
+ | `onKeyPress` | Event handler called when a key is pressed while the input is focused. | `() => {}` |
975
+ | `onFocus` | Event handler called when the input is focused. | `() => {}` |
976
+ | `onBlur` | Event handler called when the input loses focus. | `() => {}` |
977
+ | `onPaste` | Event handler called when content is pasted into the input field. | `() => {}` |
978
+ | `small` | Determines whether to render a smaller-sized input field. | `false` |
979
+ | `placeholder` | Placeholder text displayed when the input is empty. | `''` |
980
+ | `tabIndex` | The tab index of the input field. | `0` |
981
+ | `value` | The value of the input field. | `''` |
982
+ | `disabled` | Determines whether the input field is disabled. | `false` |
983
+ | `right` | Determines whether to align content to the right of the input field. | `false` |
984
+ | `groupOrder` | Position of the input field within a group or sequence. | `null` |
985
+ | `maxTooltipWidth` | The maximum width of the tooltip. | - |
986
+ | `testId` | Test ID for identifying the component in tests. | - |
987
+ | `size` | *Deprecated.* Use `width` instead to define the size of the input field. | `null` |
988
+ | `isInTable` | Specifies whether the input is used within a table. | `false` |
989
+ | `width` | Width of the input field. | - |
990
+
991
+ ### Usage Example
992
+
993
+ ```jsx
994
+ <Input
995
+ type="text"
996
+ placeholder="Enter your name"
997
+ value={name}
998
+ onChange={(e) => setName(e.target.value)}
999
+ error={nameError}
1000
+ tooltip="Please enter your full name"
1001
+ disabled={isDisabled}
1002
+ />
1003
+ ```
1004
+
1005
+ ```jsx
1006
+ <Input
1007
+ type="number"
1008
+ placeholder="Enter your age"
1009
+ value={age}
1010
+ onChange={(e) => setAge(e.target.value)}
1011
+ warning={ageWarning}
1012
+ />
1013
+ ```
1014
+
1015
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1016
+
1017
+ ## Label <a id="label"></a>
1018
+
1019
+ The `Label` component represents a label or caption associated with an input field or other form elements. It can include optional elements such as help text, lock icons, and library icons.
1020
+
1021
+ ### Props
1022
+
1023
+ | Prop | Description | Default Value |
1024
+ |--------------------|--------------------------------------------------------------------------------------------------------------------|---------------|
1025
+ | `label` | The text or content of the label. | `null` |
1026
+ | `width` | The width of the label. | `'auto'` |
1027
+ | `helpText` | Help text or additional information associated with the label. | `''` |
1028
+ | `helpTextMaxWidth` | The maximum width of the help text. | `'300px'` |
1029
+ | `onClickHelp` | Event handler called when the help icon or text is clicked. | - |
1030
+ | `lock` | Configuration for the lock icon displayed with the label. | See below |
1031
+ | `libraryIcon` | Configuration for the library icon displayed with the label. | - |
1032
+ | `labelLeft` | Determines whether to align the label to the left side. | `false` |
1033
+ | `info` | Additional information or tooltip associated with the label. | - |
1034
+
1035
+ **Lock Props:**
1036
+
1037
+ | Prop | Description | Default Value |
1038
+ |------------|-------------------------------------------------------|---------------|
1039
+ | `visible` | Determines whether the lock icon is visible. | `false` |
1040
+ | `active` | Determines whether the lock icon is active. | `false` |
1041
+ | `onClick` | Event handler called when the lock icon is clicked. | `() => {}` |
1042
+ | `tooltip` | Tooltip text displayed when hovering over the icon. | `''` |
1043
+ | `testId` | Test ID for identifying the lock icon in tests. | - |
1044
+
1045
+ ### Usage Example
1046
+
1047
+ ```jsx
1048
+ <Label
1049
+ label="Username"
1050
+ helpText="Enter your username"
1051
+ onClickHelp={() => console.log('Help clicked')}
1052
+ lock={{
1053
+ visible: true,
1054
+ active: false,
1055
+ onClick: () => console.log('Lock clicked'),
1056
+ tooltip: 'Locked',
1057
+ }}
1058
+ libraryIcon={{
1059
+ onClick: () => console.log('Library icon clicked'),
1060
+ tooltip: 'Open library',
1061
+ }}
1062
+ />
1063
+ ```
1064
+
1065
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1066
+
1067
+ ## List <a id="list"></a>
1068
+
1069
+ The `List` component renders a list of data items with various customization options such as borders, expanding items, and draggable rows.
1070
+
1071
+ ### Props
1072
+
1073
+ | Prop | Description | Default Value |
1074
+ |------------------------|-----------------------------------------------------------------------------------------------------------------|--------------------------|
1075
+ | `drawer` | Specifies whether the list is rendered as a drawer. | `false` |
1076
+ | `list` | The data to be displayed in the list. | **Required** |
1077
+ | `bordered` | Determines whether the list items have borders. | `false` |
1078
+ | `expanding` | Specifies whether the list items can be expanded to show additional content. | `false` |
1079
+ | `narrow` | Determines whether the list items have a narrower layout. | `false` |
1080
+ | `toggleNarrow` | Specifies whether to enable toggling the narrow mode. | `false` |
1081
+ | `onToggleNarrow` | Callback function called when toggling the narrow mode. | `() => {}` |
1082
+ | `invokeEditOnRowClick` | Determines whether clicking on a row invokes editing mode. | `true` |
1083
+ | `noHeader` | Specifies whether to hide the header of the list. | `false` |
1084
+ | `stickyHeader` | Determines whether the list header sticks to the top when scrolling. | - |
1085
+ | `draggable` | Specifies whether the list items can be dragged to reorder. | `false` |
1086
+ | `onListReorder` | Callback function called when reordering the list items. | `() => {}` |
1087
+ | `marginBottom` | The margin bottom applied to the list. | `0` |
1088
+ | `height` | The height of the list. | - |
1089
+ | `testId` | Test ID for identifying the list component. | - |
1090
+ | `scrollDetails` | Configuration for scrolling behavior and infinite scroll functionality. See details below. | See details below |
1091
+
1092
+ **Scroll Details:**
1093
+
1094
+ | Prop | Description | Default Value |
1095
+ |-----------------------------|-----------------------------------------------------------------------------------------------------------------|--------------------------|
1096
+ | `scrollable` | Determines whether the list is scrollable. | `false` |
1097
+ | `hideScrollbar` | Determines whether to hide the scrollbar when scrolling. | `false` |
1098
+ | `triggerScrollToActiveItem` | Specifies whether scrolling should be triggered to display the active item. | `false` |
1099
+ | `infiniteScroll` | Specifies whether to enable infinite scroll functionality. | `false` |
1100
+ | `limit` | The limit of items to load per page when using infinite scroll. | `10` |
1101
+ | `infiniteScrollTarget` | The target element for infinite scroll (e.g., the list container). | - |
1102
+
1103
+ ### Usage Example
1104
+
1105
+ ```jsx
1106
+ <List
1107
+ list={myData}
1108
+ bordered
1109
+ expanding
1110
+ draggable
1111
+ stickyHeader
1112
+ marginBottom={20}
1113
+ height={300}
1114
+ testId="my-list"
1115
+ scrollDetails={{
1116
+ scrollable: true,
1117
+ hideScrollbar: true,
1118
+ triggerScrollToActiveItem: true,
1119
+ infiniteScroll: true,
1120
+ limit: 10,
1121
+ infiniteScrollTarget: document.getElementById('list-container'),
1122
+ }}
1123
+ />
1124
+ ```
1125
+
1126
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1127
+
1128
+ ## ListHeading <a id="listheading"></a>
1129
+
1130
+ The `ListHeading` component represents the header of a list. It typically includes the name or title of the list and optional actions.
1131
+
1132
+ ### Props
1133
+
1134
+ | Prop | Description | Default Value |
1135
+ |------------------|-----------------------------------------------------------------------------------------------------------------|--------------------------|
1136
+ | `name` | The name or title of the list. | **Required** |
1137
+ | `actions` | An array of action items to be displayed in the header. | `[]` |
1138
+ | `toggleNarrow` | Specifies whether to enable toggling the narrow mode for the list. | `false` |
1139
+ | `onToggleNarrow` | Callback function called when toggling the narrow mode. | `() => {}` |
1140
+ | `stickyHeader` | Determines whether the list header sticks to the top when scrolling. | - |
1141
+
1142
+ ### Usage Example
1143
+
1144
+ ```jsx
1145
+ <ListHeading
1146
+ name="My List"
1147
+ actions={[{ label: 'Add', onClick: handleAdd }, { label: 'Edit', onClick: handleEdit }]}
1148
+ toggleNarrow
1149
+ onToggleNarrow={handleToggleNarrow}
1150
+ stickyHeader
1151
+ />
1152
+ ```
1153
+
1154
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1155
+
1156
+ ## ListSubheading <a id="listsubheading"></a>
1157
+
1158
+ The `ListSubheading` component represents a subheading within a list. It is typically used to provide additional information or context for a group of items within the list.
1159
+
1160
+ ### Props
1161
+
1162
+ | Prop | Description | Default Value |
1163
+ |---------|--------------------------------------------------------------------|---------------|
1164
+ | `item` | An object containing data for the subheading item. | **Required** |
1165
+ | `index` | The index of the subheading item within the list. | - |
1166
+
1167
+ ### Usage Example
1168
+
1169
+ ```jsx
1170
+ <ListSubheading item={{ label: 'Group A', count: 5 }} index={0} />
1171
+ ```
1172
+
1173
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1174
+
1175
+ ## Loader <a id="loader"></a>
1176
+
1177
+ The `Loader` component renders a loading indicator, typically used to indicate that content is being fetched or processed.
1178
+
1179
+ ### Props
1180
+
1181
+ | Prop | Description | Default Value |
1182
+ |--------------------|------------------------------------------------------------------------------------------------------|----------------|
1183
+ | `width` | The width of the loader. | |
1184
+ | `height` | The height of the loader. | |
1185
+ | `text` | The text to display alongside the loader. | `''` (empty) |
1186
+ | `details` | Additional details or information to display below the loader. | `''` (empty) |
1187
+ | `fullViewPortSize` | A boolean indicating whether the loader should cover the entire viewport. | `false` |
1188
+ | `cover` | A boolean indicating whether the loader should cover its parent element. | `false` |
1189
+ | `children` | Additional React elements to render alongside the loader. | `null` |
1190
+ | `theme` | The theme of the loader. This can be either `Theme.DARK` or `Theme.LIGHT`. | `Theme.DARK` |
1191
+ | `testId` | A string value representing the test ID for testing purposes. | `null` |
1192
+
1193
+ ### Usage Example
1194
+
1195
+ ```jsx
1196
+ <Loader text="Loading..." cover />
1197
+ ```
1198
+
1199
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1200
+
1201
+ ## Menu <a id="menu"></a>
1202
+
1203
+ The `Menu` component is used to render a menu with various options or sections.
1204
+
1205
+ ### Props
1206
+
1207
+ | Prop | Description | Default Value |
1208
+ |-----------------------------|-----------------------------------------------------------------------------------------------------------|---------------|
1209
+ | `menu` | An object containing properties for configuring the menu. | `{}` |
1210
+ | `contextMenu` | A boolean indicating whether the menu is a context menu. | `false` |
1211
+ | `width` | The width of the menu. | - |
1212
+ | `disabled` | A boolean indicating whether the menu is disabled. | `false` |
1213
+ | `badgeTitle` | The title text for a badge, if applicable. | `''` (empty) |
1214
+ | `badgeDot` | A boolean indicating whether to display a dot badge. | `false` |
1215
+ | `loading` | A boolean indicating whether the menu is in a loading state. | `false` |
1216
+ | `fullHeightTrigger` | A boolean indicating whether the trigger should have full height. | `false` |
1217
+ | `closeOnOptionClick` | A boolean indicating whether the menu should close when an option is clicked. | `false` |
1218
+ | `groupOrder` | The order of the menu group. | `null` |
1219
+ | `overflowContainer` | A boolean indicating whether the menu should have an overflow container. | `false` |
1220
+ | `maxHeight` | The maximum height of the menu. | - |
1221
+ | `testId` | A string representing the test ID for testing purposes. | - |
1222
+ | `open` | A boolean indicating whether the menu is open. | `false` |
1223
+ | `setOpen` | A function to set the open state of the menu. | - |
1224
+ | `closeParent` | A function to close the parent menu. | - |
1225
+ | `tree` | The tree structure of the menu. | `null` |
1226
+ | `path` | The path of the menu. | `null` |
1227
+ | `isNested` | A boolean indicating whether the menu is nested. | `false` |
1228
+ | `tooltip` | The tooltip for the menu. | `null` |
1229
+ | `error` | The error message for the menu. | `null` |
1230
+ | `warning` | The warning message for the menu. | `null` |
1231
+ | `title` | The title text for the menu. | `''` (empty) |
1232
+
1233
+ ### Menu Properties
1234
+
1235
+ The `menu` prop accepts an object with the following properties:
1236
+
1237
+ - `trigger`: The trigger type or string.
1238
+ - `title`: The title of the menu.
1239
+ - `colored`: A boolean indicating whether the menu is colored or a string representing the color.
1240
+ - `small`: A boolean indicating whether the menu is small.
1241
+ - `label`: The label for the menu.
1242
+ - `component`: The component to render inside the menu.
1243
+ - `sections`: The sections of the menu.
1244
+ - `placement`: The placement of the menu.
1245
+ - `possiblePlacements`: The possible placements of the menu.
1246
+ - `showAllButton`: The configuration for the "show all" button.
1247
+ - `testId`: The test ID for the menu.
1248
+ - `fullHeightTrigger`: A boolean indicating whether the trigger should have full height.
1249
+
1250
+ ### Usage Example
1251
+
1252
+ ```jsx
1253
+ <Menu
1254
+ menu={{
1255
+ trigger: 'click',
1256
+ title: 'Options',
1257
+ colored: true,
1258
+ small: true,
1259
+ label: 'Menu Label',
1260
+ sections: [<MenuItem key="1" label="Item 1" />, <MenuItem key="2" label="Item 2" />],
1261
+ placement: 'bottom-end',
1262
+ testId: 'menu-test-id',
1263
+ fullHeightTrigger: true,
1264
+ }}
1265
+ open={true}
1266
+ setOpen={(state) => setOpen(state)}
1267
+ />
1268
+ ```
1269
+
1270
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1271
+
1272
+ ## Message <a id="message"></a>
1273
+
1274
+ The `Message` component is used to display informative messages to users.
1275
+
1276
+ ### Props
1277
+
1278
+ | Prop | Description | Default Value |
1279
+ |----------------|-------------------------------------------------------|----------------|
1280
+ | `message` | An object containing properties for the message. | `{}` |
1281
+
1282
+ ### Message Properties
1283
+
1284
+ The `message` prop accepts an object with the following properties:
1285
+
1286
+ - `visible`: A boolean indicating whether the message is visible.
1287
+ - `type`: The type of the message, such as info, success, warning, or error.
1288
+ - `icon`: A boolean indicating whether to display an icon with the message.
1289
+ - `heading`: The heading or title of the message.
1290
+ - `content`: The main content of the message.
1291
+ - `details`: Additional details or information related to the message.
1292
+ - `footer`: The footer content of the message.
1293
+ - `withDismiss`: A boolean indicating whether the message can be dismissed.
1294
+ - `onClose`: A function to handle the close event of the message.
1295
+ - `width`: The width of the message.
1296
+ - `maxHeight`: The maximum height of the message.
1297
+
1298
+ ### Usage Example
1299
+
1300
+ ```jsx
1301
+ <Message
1302
+ message={{
1303
+ visible: true,
1304
+ type: MessageType.INFO,
1305
+ icon: true,
1306
+ heading: 'Information',
1307
+ content: 'This is an informative message.',
1308
+ details: 'Additional details can be provided here.',
1309
+ footer: <Button label="Close" onClick={handleClose} />,
1310
+ withDismiss: true,
1311
+ onClose: handleClose,
1312
+ width: '400px',
1313
+ maxHeight: '200px',
1314
+ }}
1315
+ />
1316
+ ```
1317
+
1318
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1319
+
1320
+ ## Modal <a id="modal"></a>
1321
+
1322
+ The `Modal` component is used to display content in a modal dialog box.
1323
+
1324
+ ### Props
1325
+
1326
+ | Prop | Description | Default Value |
1327
+ |-------------|--------------------------------------------------|---------------|
1328
+ | `children` | The content to be displayed within the modal. | - |
1329
+ | `visible` | A boolean indicating whether the modal is visible.| `false` |
1330
+ | `centered` | A boolean indicating whether the modal is centered vertically and horizontally. | `false` |
1331
+ | `width` | The width of the modal. | `'100%'` |
1332
+ | `onEnter` | A function called when the modal is opened. | - |
1333
+ | `onEscape` | A function called when the escape key is pressed to close the modal. | - |
1334
+
1335
+ ### Usage Example
1336
+
1337
+ ```jsx
1338
+ <Modal
1339
+ visible={isModalVisible}
1340
+ centered
1341
+ width="500px"
1342
+ onEnter={handleModalEnter}
1343
+ onEscape={handleModalEscape}
1344
+ >
1345
+ {/* Content of the modal */}
1346
+ </Modal>
1347
+ ```
1348
+
1349
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1350
+
1351
+ ## Option Dropdown <a id="optiondropdown"></a>
1352
+
1353
+ The `OptionDropdown` component is used to display a dropdown menu with selectable options.
1354
+
1355
+ ### Props
1356
+
1357
+ | Prop | Description | Default Value |
1358
+ |---------------|-----------------------------------------------------------------------------------------------|---------------|
1359
+ | `name` | The name attribute for the dropdown input element. | - |
1360
+ | `label` | The label for the dropdown. | - |
1361
+ | `options` | An array of options to be displayed in the dropdown. Each option should have a `label` and `value` property. | - |
1362
+ | `onChange` | A function to be called when the selected options change. | - |
1363
+ | `showHeader` | A boolean indicating whether to display a header above the dropdown options. | `true` |
1364
+ | `maxHeight` | The maximum height of the dropdown menu. | `'40vh'` |
1365
+
1366
+ ### Usage Example
1367
+
1368
+ ```jsx
1369
+ <OptionDropdown
1370
+ name="myDropdown"
1371
+ label="Select an option"
1372
+ options={[
1373
+ { label: 'Option 1', value: 'option1' },
1374
+ { label: 'Option 2', value: 'option2' },
1375
+ { label: 'Option 3', value: 'option3' },
1376
+ ]}
1377
+ onChange={handleDropdownChange}
1378
+ showHeader={true}
1379
+ maxHeight="300px"
1380
+ />
1381
+ ```
1382
+
1383
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1384
+
1385
+ ## Page <a id="page"></a>
1386
+
1387
+ The `Page` component is used to create a page layout with optional padding and scrolling.
1388
+
1389
+ ### Props
1390
+
1391
+ | Prop | Description | Default Value |
1392
+ |-------------|-------------------------------------------------------------------------------------------------------|--------------------------|
1393
+ | `children` | The content to be rendered within the page layout. | - |
1394
+ | `left` | The width of the left margin of the page. | `var(--size-sidebar)` |
1395
+ | `padding` | Determines whether padding should be applied to the page content. | `true` |
1396
+ | `scroll` | A boolean indicating whether the page should be scrollable if its content overflows. | `true` |
1397
+ | `top` | The height of the top margin of the page. | `var(--size-topbar)` |
1398
+
1399
+ ### Usage Example
1400
+
1401
+ ```jsx
1402
+ <Page
1403
+ left="20%"
1404
+ padding={true}
1405
+ scroll={true}
1406
+ top="50px"
1407
+ >
1408
+ {/* Page content goes here */}
1409
+ </Page>
1410
+ ```
1411
+
1412
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1413
+
1414
+ ## Pagination <a id="pagination"></a>
1415
+
1416
+ The `Pagination` component provides navigation controls for navigating through a large set of data, allowing users to move between pages.
1417
+
1418
+ ### Props
1419
+
1420
+ | Prop | Description | Default Value |
1421
+ |------------------------|----------------------------------------------------------------------------------------------------------------------|---------------|
1422
+ | `pagination` | An object containing pagination configuration options. | - |
1423
+ | `rowCount` | The total number of rows/items to be paginated. | - |
1424
+ | `selectedPage` | The currently selected page number. | - |
1425
+ | `onSelectPage` | A function to handle page selection. It takes the selected page number as an argument. | - |
1426
+ | `rowsPerPage` | Configuration options for selecting the number of rows/items per page. | - |
1427
+ | `small` | A boolean indicating whether to render a smaller version of the pagination controls. | `false` |
1428
+ | `errorMessageTemplate`| A template string used to display an error message if pagination fails. | - |
1429
+ | `testIds` | An object containing test IDs for specific elements within the pagination component. | - |
1430
+
1431
+ ### Usage Example
1432
+
1433
+ ```jsx
1434
+ <Pagination
1435
+ pagination={{
1436
+ rowCount: 1000,
1437
+ selectedPage: 1,
1438
+ onSelectPage: handlePageSelection,
1439
+ rowsPerPage: {
1440
+ options: [10, 20, 50],
1441
+ selected: 10,
1442
+ onChange: handleRowsPerPageChange,
1443
+ },
1444
+ small: false,
1445
+ errorMessageTemplate: "Pagination failed: {error}",
1446
+ testIds: {
1447
+ doubleRightBtn: "pagination-double-right-btn",
1448
+ },
1449
+ }}
1450
+ />
1451
+ ```
1452
+
1453
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1454
+
1455
+ ## Popover <a id="popover"></a>
1456
+
1457
+ The `Popover` component displays additional content or options related to a specific element when triggered.
1458
+
1459
+ ### Props
1460
+
1461
+ | Prop | Description | Default Value |
1462
+ |------------------------|----------------------------------------------------------------------------------------------------------------------|---------------|
1463
+ | `children` | The element that triggers the display of the popover content. | - |
1464
+ | `content` | The content to be displayed inside the popover. | - |
1465
+ | `placement` | The placement of the popover relative to its trigger element. | `'top-center'`|
1466
+ | `closeOnOutsideClick` | A boolean indicating whether the popover should close when clicking outside of it. | `true` |
1467
+ | `fullWidth` | A boolean indicating whether the popover should take up the full width of its container. | `false` |
1468
+ | `showCloseButton` | A boolean indicating whether to display a close button within the popover. | `false` |
1469
+ | `testId` | A test ID for the popover component, used for testing purposes. | - |
1470
+ | `disabled` | A boolean indicating whether the popover is disabled and should not be triggered. | `false` |
1471
+ | `overflowContainer` | A boolean indicating whether the popover content should be constrained within its container if it overflows. | `false` |
1472
+
1473
+ ### Usage Example
1474
+
1475
+ ```jsx
1476
+ <Popover
1477
+ content={<div>Popover Content</div>}
1478
+ placement="bottom-right"
1479
+ closeOnOutsideClick={false}
1480
+ fullWidth
1481
+ showCloseButton
1482
+ disabled={false}
1483
+ >
1484
+ <Button>Open Popover</Button>
1485
+ </Popover>
1486
+ ```
1487
+
1488
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1489
+
1490
+ ## Portal <a id="portal"></a>
1491
+
1492
+ The `Portal` component facilitates rendering React elements at a different location in the DOM tree.
1493
+
1494
+ ### Props
1495
+
1496
+ | Prop | Description | Default Value |
1497
+ |------------|---------------------------------------------------|---------------|
1498
+ | `id` | The id of the target DOM node where children will be rendered. | - |
1499
+ | `children` | The React elements to be rendered inside the portal. | - |
1500
+
1501
+ ### Usage Example
1502
+
1503
+ ```jsx
1504
+ <Portal id="portal-container">
1505
+ <div>This content will be rendered in a different location in the DOM tree.</div>
1506
+ </Portal>
1507
+ ```
1508
+
1509
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1510
+
1511
+ ## PrintHeader <a id="printheader"></a>
1512
+
1513
+ The `PrintHeader` component is used to display a header with a logo when printing.
1514
+
1515
+ ### Props
1516
+
1517
+ | Prop | Description | Default Value |
1518
+ |-------------|-------------------------------------------------------|---------------|
1519
+ | `logo` | The URL or path to the logo image. | - |
1520
+ | `alt` | The alternative text for the logo image. | - |
1521
+ | `logoWidth` | The width of the logo. | `'100px'` |
1522
+
1523
+ ### Usage Example
1524
+
1525
+ ```jsx
1526
+ <PrintHeader
1527
+ logo="/path/to/logo.png"
1528
+ alt="Company Logo"
1529
+ logoWidth="150px"
1530
+ />
1531
+ ```
1532
+
1533
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1534
+
1535
+ ## ProgressBar <a id="progressbar"></a>
1536
+
1537
+ The `ProgressBar` component is used to display a visual progress bar indicating the completion percentage of a task.
1538
+
1539
+ ### Props
1540
+
1541
+ | Prop | Description | Default Value |
1542
+ |----------------------|------------------------------------------------------------------------------------------------------------------|---------------|
1543
+ | `width` | The width of the progress bar. | `'auto'` |
1544
+ | `inverted` | Determines whether the progress bar is inverted (i.e., progress from right to left). | `false` |
1545
+ | `colored` | Determines whether the progress bar is colored. | `true` |
1546
+ | `showProgressColors` | Determines whether the progress bar shows different colors based on progress (if `colored` is `true`). | `false` |
1547
+ | `percentage` | The completion percentage of the task (a value between 0 and 100). | `0` |
1548
+ | `noLabel` | Determines whether to hide the label displaying the percentage value. | `false` |
1549
+
1550
+ ### Usage Example
1551
+
1552
+ ```jsx
1553
+ <ProgressBar
1554
+ width="300px"
1555
+ inverted={false}
1556
+ colored={true}
1557
+ showProgressColors={false}
1558
+ percentage={75}
1559
+ noLabel={false}
1560
+ />
1561
+ ```
1562
+
1563
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1564
+
1565
+ ## RadioButton <a id="radiobutton"></a>
1566
+
1567
+ The `RadioButton` component provides a set of radio buttons for selecting options within a group.
1568
+
1569
+ ### Props
1570
+
1571
+ | Prop | Description | Default Value |
1572
+ |---------------------|-----------------------------------------------------------------------------------------------|---------------------|
1573
+ | `name` | The name attribute of the radio button group. | - |
1574
+ | `label` | The label for the radio button group. | `null` |
1575
+ | `options` | An array of objects representing each radio button option. | - |
1576
+ | `value` | The currently selected value or option object. | - |
1577
+ | `inline` | (Deprecated) Determines whether the radio buttons should be displayed inline. | `false` |
1578
+ | `disabled` | Determines whether the radio buttons are disabled. | `false` |
1579
+ | `small` | Determines whether to use a smaller size for the radio buttons. | `false` |
1580
+ | `onChange` | A function called when the selected value changes. | - |
1581
+ | `noMargin` | Determines whether to remove margins around the radio buttons. | `false` |
1582
+ | `onClick` | (Deprecated) A function called when a radio button is clicked. | `() => {}` |
1583
+ | `mainLabel` | (Deprecated) The main label for the radio button group. | `''` |
1584
+ | `radioButtonsData` | (Deprecated) An array of objects representing each radio button option. | - |
1585
+ | `classForContainer` | (Deprecated) A class name for the container element. | `'grouped fields'` |
1586
+ | `testId` | A string used to define a test ID for testing purposes. | - |
1587
+
1588
+ ### Usage Example
1589
+
1590
+ ```jsx
1591
+ <RadioButton
1592
+ name="gender"
1593
+ label="Gender"
1594
+ options={[
1595
+ { label: 'Male', value: 'male' },
1596
+ { label: 'Female', value: 'female' },
1597
+ { label: 'Other', value: 'other' },
1598
+ ]}
1599
+ value="male"
1600
+ onChange={(e) => console.log('Selected value:', e.target.value)}
1601
+ disabled={false}
1602
+ small={true}
1603
+ noMargin={false}
1604
+ />
1605
+ ```
1606
+
1607
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1608
+
1609
+ ## RichTextInput <a id="richtextinput"></a>
1610
+
1611
+ The `RichTextInput` component provides a text input field with rich text editing capabilities.
1612
+
1613
+ ### Props
1614
+
1615
+ | Prop | Description | Default Value |
1616
+ |-------------------|--------------------------------------------------------------------------|---------------|
1617
+ | `disabled` | Determines whether the text input is disabled. | `false` |
1618
+ | `onChange` | A function called when the content of the text input changes. | - |
1619
+ | `placeholder` | The placeholder text displayed when the text input is empty. | - |
1620
+ | `value` | The current value of the text input. | - |
1621
+ | `toolbarComponent`| A custom toolbar component for additional editing options. | - |
1622
+
1623
+ ### Usage Example
1624
+
1625
+ ```jsx
1626
+ <RichTextInput
1627
+ placeholder="Enter your text here..."
1628
+ onChange={(markdown) => console.log('Markdown:', markdown)}
1629
+ value=""
1630
+ disabled={false}
1631
+ />
1632
+ ```
1633
+
1634
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1635
+
1636
+ ## NativeSelect <a id="nativeselect"></a>
1637
+
1638
+ The `NativeSelect` component renders a native HTML select element with various customization options.
1639
+
1640
+ ### Props
1641
+
1642
+ | Prop | Description | Default Value |
1643
+ |------------------------|-------------------------------------------------------------------------------------------------|---------------|
1644
+ | `borderRadius` | The border radius of the select element. | - |
1645
+ | `disabled` | Determines whether the select element is disabled. | `false` |
1646
+ | `error` | Error message to display. | - |
1647
+ | `warning` | Warning message to display. | - |
1648
+ | `tooltip` | Tooltip message to display. | - |
1649
+ | `options` | An array of options to populate the select element. | - |
1650
+ | `onChange` | A function called when the selected option changes. | - |
1651
+ | `onFocus` | A function called when the select element receives focus. | - |
1652
+ | `onBlur` | A function called when the select element loses focus. | - |
1653
+ | `right` | Determines whether the select arrow is positioned on the right side. | `false` |
1654
+ | `small` | Determines whether to render a smaller version of the select element. | `false` |
1655
+ | `tabIndex` | Specifies the tab order of the select element. | `0` |
1656
+ | `selectedOption` | The currently selected option. | - |
1657
+ | `width` | The width of the select element. | `null` |
1658
+ | `groupOrder` | The order of the option groups. | `null` |
1659
+ | `testId` | A string used to identify the select element for testing purposes. | - |
1660
+ | `isInTable` | Determines whether the select element is rendered within a table. | `false` |
1661
+ | `clearable` | Determines whether the select element allows clearing the selected option. | `false` |
1662
+ | `placeholder` | Placeholder text displayed when no option is selected. | `null` |
1663
+ | `hasNonExistentValue` | Determines whether the select element includes a non-existent value option. | `false` |
1664
+ | `maxTooltipWidth` | The maximum width of the tooltip. | - |
1665
+
1666
+ ### Usage Example
1667
+
1668
+ ```jsx
1669
+ <NativeSelect
1670
+ disabled={false}
1671
+ options={[
1672
+ { label: 'Option 1', value: 'option1' },
1673
+ { label: 'Option 2', value: 'option2' },
1674
+ { label: 'Option 3', value: 'option3' },
1675
+ ]}
1676
+ onChange={(evt, option) => console.log('Selected option:', option)}
1677
+ onFocus={() => console.log('Select element focused')}
1678
+ onBlur={() => console.log('Select element blurred')}
1679
+ right={false}
1680
+ small={false}
1681
+ tabIndex={0}
1682
+ selectedOption={{ label: 'Option 1', value: 'option1' }}
1683
+ width="200px"
1684
+ groupOrder={null}
1685
+ testId="select-element"
1686
+ isInTable={false}
1687
+ clearable={true}
1688
+ placeholder="Select an option"
1689
+ hasNonExistentValue={false}
1690
+ maxTooltipWidth="200px"
1691
+ borderRadius="5px"
1692
+ />
1693
+ ```
1694
+
1695
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1696
+
1697
+ ## Row Component <a id="row"></a>
1698
+
1699
+ The `Row` component is used to create a horizontal layout with flexible alignment and spacing options.
1700
+
1701
+ ### Props
1702
+
1703
+ | Prop | Description | Default Value |
1704
+ |------------------|---------------------------------------------------------------------------------------------------------------------|---------------|
1705
+ | `alignItems` | Specifies the alignment of the children along the cross-axis (vertical alignment). | `initial` |
1706
+ | `justifyContent` | Defines the alignment of the children along the main axis (horizontal alignment). | `initial` |
1707
+ | `children` | The content to be rendered within the row. | `null` |
1708
+ | `flex` | Determines whether the row should be flexible (able to grow and shrink based on available space). | `false` |
1709
+ | `height` | The height of the row. | `'auto'` |
1710
+ | `marginBottom` | The margin bottom of the row. | `'0'` |
1711
+ | `marginTop` | The margin top of the row. | `'0'` |
1712
+ | `spacing` | The spacing between child elements in the row. | `'var(--padding)'` |
1713
+ | `wrap` | Determines whether the children should wrap onto multiple lines if they exceed the row's width. | `false` |
1714
+ | `testId` | A string used to identify the row for testing purposes. | `null` |
1715
+
1716
+ ### Usage Example
1717
+
1718
+ ```jsx
1719
+ <Row
1720
+ alignItems="center"
1721
+ justifyContent="space-between"
1722
+ flex={true}
1723
+ height="100px"
1724
+ marginBottom="20px"
1725
+ marginTop="10px"
1726
+ spacing="10px"
1727
+ wrap={false}
1728
+ testId="row-component"
1729
+ >
1730
+ <div>Child 1</div>
1731
+ <div>Child 2</div>
1732
+ <div>Child 3</div>
1733
+ </Row>
1734
+ ```
1735
+
1736
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1737
+
1738
+ ## Select Component <a id="select"></a>
1739
+
1740
+ The `Select` component is used to render a dropdown menu for selecting options from a list.
1741
+
1742
+ ### Props
1743
+
1744
+ | Prop | Description | Default Value |
1745
+ |-----------------------------|-----------------------------------------------------------------------------------------------------|---------------|
1746
+ | `name` | The name attribute of the select element. | `''` |
1747
+ | `multi` | Determines whether multiple options can be selected. | `false` |
1748
+ | `options` | An array of options to be rendered in the dropdown menu. | `[]` |
1749
+ | `value` | The currently selected option(s). | - |
1750
+ | `native` | Determines whether to use the native HTML `<select>` element. | `false` |
1751
+ | `onChange` | A callback function invoked when the selection changes. | `() => {}` |
1752
+ | `deprecatedEventHandler` | Determines whether to use deprecated event handlers. | `false` |
1753
+ | `autoScroll` | Determines whether the dropdown menu should auto-scroll. | `true` |
1754
+ | `warning` | Warning message to be displayed. | - |
1755
+ | `error` | Error message to be displayed. | - |
1756
+ | `checkNonExistentValues` | Determines whether to check for non-existent values. | `true` |
1757
+ | `closeOnOptionActionClick` | Determines whether to close the select dropdown on option action click. | `true` |
1758
+ | `testId` | A string used to identify the select component for testing purposes. | - |
1759
+ | `disabled` | Determines whether the select component is disabled. | `false` |
1760
+
1761
+ The `ISelectSelectedOption` interface represents the structure of an option in the dropdown menu.
1762
+
1763
+ | Property | Description |
1764
+ |------------|-------------------------------------------------------------------------------------------|
1765
+ | `value` | The value of the option. |
1766
+ | `label` | The display label of the option. |
1767
+ | `details` | Additional details or description of the option. |
1768
+ | `actions` | Actions associated with the option. |
1769
+ | `icon` | Icon to be displayed next to the option. |
1770
+ | `type` | Type of the option. |
1771
+ | `disabled` | Determines whether the option is disabled. |
1772
+ | `testId` | A string used to identify the option for testing purposes. |
1773
+
1774
+ ### Usage Example
1775
+
1776
+ ```jsx
1777
+ <Select
1778
+ name="exampleSelect"
1779
+ options={[
1780
+ { value: 'option1', label: 'Option 1' },
1781
+ { value: 'option2', label: 'Option 2' },
1782
+ { value: 'option3', label: 'Option 3' }
1783
+ ]}
1784
+ value="option2"
1785
+ onChange={(value) => console.log('Selected value:', value)}
1786
+ placeholder="Select an option"
1787
+ disabled={false}
1788
+ />
1789
+ ```
1790
+
1791
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1792
+
1793
+ ## SideBar Component <a id="sidebar"></a>
1794
+
1795
+ The `SideBar` component represents a sidebar navigation menu with collapsible sections and items.
1796
+
1797
+ ### Props
1798
+
1799
+ | Prop | Description | Default Value |
1800
+ |-----------------------------|-----------------------------------------------------------------------------------------------------------------|---------------|
1801
+ | `options` | An object containing the title of the sidebar and its sections. | `{}` |
1802
+ | `startOpen` | Determines whether the sidebar sections should start open or collapsed. | `false` |
1803
+ | `onShiftClickToggleOpen` | A callback function invoked when the user shift-clicks to toggle the sidebar open or closed. | `() => {}` |
1804
+ | `top` | The top position of the sidebar. | - |
1805
+
1806
+ The `IOptionItem` interface represents an individual item within a sidebar section.
1807
+
1808
+ | Property | Description |
1809
+ |------------------|---------------------------------------------------------------------------------------------------|
1810
+ | `label` | The label or display text of the item. |
1811
+ | `value` | The value associated with the item. |
1812
+ | `icon` | The icon displayed alongside the item label. |
1813
+ | `onClick` | A callback function invoked when the item is clicked. |
1814
+ | `isActive` | Determines whether the item is currently active. |
1815
+ | `isExperimental` | Indicates whether the item is experimental or not. |
1816
+ | `invalid` | Indicates whether the item is invalid. |
1817
+ | `testId` | A string used to identify the item for testing purposes. |
1818
+
1819
+ The `IOptionSection` interface represents a section within the sidebar, containing a heading and a list of items.
1820
+
1821
+ | Property | Description |
1822
+ |------------|-------------------------------------------------|
1823
+ | `heading` | The heading or title of the section. |
1824
+ | `items` | An array of items within the section. |
1825
+
1826
+ ### Usage Example
1827
+
1828
+ ```jsx
1829
+ <SideBar
1830
+ options={{
1831
+ title: 'Navigation',
1832
+ sections: [
1833
+ {
1834
+ heading: 'Section 1',
1835
+ items: [
1836
+ { label: 'Item 1', value: 'item1', icon: <Icon />, onClick: handleItemClick },
1837
+ { label: 'Item 2', value: 'item2', icon: <Icon />, onClick: handleItemClick },
1838
+ ]
1839
+ },
1840
+ {
1841
+ heading: 'Section 2',
1842
+ items: [
1843
+ { label: 'Item 3', value: 'item3', icon: <Icon />, onClick: handleItemClick },
1844
+ { label: 'Item 4', value: 'item4', icon: <Icon />, onClick: handleItemClick },
1845
+ ]
1846
+ }
1847
+ ]
1848
+ }}
1849
+ startOpen={true}
1850
+ onShiftClickToggleOpen={handleShiftClickToggle}
1851
+ top="50px"
1852
+ />
1853
+ ```
1854
+
1855
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1856
+
1857
+ ## Slider Component <a id="slider"></a>
1858
+
1859
+ The `Slider` component allows users to select a value or a range of values by dragging a handle along a track.
1860
+
1861
+ ### Props
1862
+
1863
+ | Prop | Description | Default Value |
1864
+ |-------------------|-----------------------------------------------------------------------------------------------------|--------------------|
1865
+ | `name` | The name attribute of the slider input. | |
1866
+ | `label` | The label displayed above the slider. | |
1867
+ | `width` | The width of the slider. | `'100%'` |
1868
+ | `labelWidth` | The width of the label. | `'auto'` |
1869
+ | `value` | The current value or range of values selected by the slider. | |
1870
+ | `min` | The minimum value of the slider. | |
1871
+ | `max` | The maximum value of the slider. | |
1872
+ | `step` | The step value for the slider. | `1` |
1873
+ | `marks` | An array of marks to display on the slider track. | `[]` |
1874
+ | `showArrows` | Determines whether arrow buttons for incremental adjustments should be displayed. | `false` |
1875
+ | `showTooltip` | Determines whether tooltips should be displayed when hovering over the slider handles. | `false` |
1876
+ | `tooltipFormatter`| A function to format the tooltip content. | `v => v` |
1877
+ | `disabled` | Determines whether the slider is disabled. | `false` |
1878
+ | `range` | Determines whether the slider allows selecting a range of values. | `false` |
1879
+ | `small` | Determines whether to use a small-sized slider. | `false` |
1880
+ | `vertical` | An object containing configuration options for a vertical slider variant. | `{ enabled: false, width: '100px', height: '400px' }` |
1881
+ | `onChange` | A callback function invoked when the slider value changes. | |
1882
+
1883
+ The `TSliderMark` type represents a mark on the slider track.
1884
+
1885
+ | Property | Description |
1886
+ |-------------|-------------------------------------------------|
1887
+ | `value` | The value of the mark. |
1888
+ | `label` | The label displayed for the mark. |
1889
+ | `tooltip` | The tooltip content displayed for the mark. |
1890
+
1891
+ The `THandleProps` type represents the props for the slider handle component.
1892
+
1893
+ | Property | Description |
1894
+ |-------------|-----------------------------------------|
1895
+ | `index` | The index of the handle. |
1896
+ | `value` | The value of the handle. |
1897
+ | `dragging` | Indicates whether the handle is being dragged. |
1898
+
1899
+ ### Usage Example
1900
+
1901
+ ```jsx
1902
+ <Slider
1903
+ label="Slider Label"
1904
+ value={50}
1905
+ min={0}
1906
+ max={100}
1907
+ step={1}
1908
+ marks={[
1909
+ { value: 0, label: '0' },
1910
+ { value: 50, label: '50' },
1911
+ { value: 100, label: '100' }
1912
+ ]}
1913
+ onChange={({ target: { value } }) => console.log(value)}
1914
+ />
1915
+ ```
1916
+
1917
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1918
+
1919
+ ## Spacer Component <a id="spacer"></a>
1920
+
1921
+ The `Spacer` component is used to add space between elements within a layout.
1922
+
1923
+ ### Props
1924
+
1925
+ | Prop | Description | Default Value |
1926
+ |-----------|---------------------------------------------------|-----------------|
1927
+ | `height` | The height of the spacer. | `'var(--padding)'` |
1928
+ | `width` | The width of the spacer. | `null` |
1929
+ | `flex` | Determines whether the spacer should use flexbox. | `false` |
1930
+
1931
+ ### Usage Example
1932
+
1933
+ ```jsx
1934
+ <Spacer height="20px" />
1935
+ ```
1936
+
1937
+ This will create a vertical space of 20 pixels.
1938
+
1939
+ ```jsx
1940
+ <Spacer width="20px" />
1941
+ ```
1942
+
1943
+ This will create a horizontal space of 20 pixels.
1944
+
1945
+ ```jsx
1946
+ <Spacer flex />
1947
+ ```
1948
+
1949
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1950
+
1951
+ ## Spinner Component <a id="spinner"></a>
1952
+
1953
+ The `Spinner` component displays a spinning animation, indicating that content is loading or processing.
1954
+
1955
+ ### Props
1956
+
1957
+ | Prop | Description | Default Value |
1958
+ |-----------|------------------------------------------------------------|---------------|
1959
+ | `small` | Determines if the spinner should be small. | `false` |
1960
+ | `colored` | Determines if the spinner should be colored. | `false` |
1961
+ | `dark` | Determines if the spinner should have a dark background. | `false` |
1962
+ | `tiny` | Determines if the spinner should be tiny. | `false` |
1963
+
1964
+ ### Usage Example
1965
+
1966
+ ```jsx
1967
+ <Spinner />
1968
+ ```
1969
+
1970
+ This will render a default-sized spinner with a light background.
1971
+
1972
+ ```jsx
1973
+ <Spinner small colored dark />
1974
+ ```
1975
+
1976
+ This will render a small-sized spinner with colored animation on a dark background.
1977
+
1978
+ ```jsx
1979
+ <Spinner tiny />
1980
+ ```
1981
+
1982
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
1983
+
1984
+ ## Table Component <a id="table"></a>
1985
+
1986
+ The `Table` component renders tabular data with various customization options.
1987
+
1988
+ ### Props
1989
+
1990
+ | Prop | Description | Default Value |
1991
+ |-----------------------|--------------------------------------------------------------------------------------------------|---------------|
1992
+ | `onListReorder` | Function called when rows are reordered. | `() => {}` |
1993
+ | `table` | An object containing table configuration. | |
1994
+ | `table.name` | Name or title of the table. | |
1995
+ | `table.actionsRight` | Determines if actions should be displayed on the right side of the table. | `false` |
1996
+ | `table.fixedWidth` | Fixed width of the table. | |
1997
+ | `table.maxHeight` | Maximum height of the table. | |
1998
+ | `table.columnWidths` | Widths of individual columns. | |
1999
+ | `table.className` | Custom class name for the table. | |
2000
+ | `table.columnHeaderAlignments` | Alignment of column headers. | |
2001
+ | `table.columnAlignment` | Alignment of table columns. | |
2002
+ | `table.infiniteScroll`| Determines if infinite scrolling is enabled. | `false` |
2003
+ | `table.headers` | Array containing table header data. | |
2004
+ | `table.rows` | Data for table rows. | |
2005
+ | `table.footer` | Footer configuration for the table. | |
2006
+ | `table.draggable` | Determines if rows are draggable. | |
2007
+ | `table.bordered` | Determines if the table should have borders. | `true` |
2008
+ | `table.striped` | Determines if the table rows should be striped. | `true` |
2009
+ | `table.testId` | Test ID for the table. | |
2010
+ | `table.onAddRow` | Function called when adding a new row to the table. | `null` |
2011
+ | `table.defaultEmptyRow` | Default empty row data for the table. | `null` |
2012
+ | `table.stickyHeaders` | Determines if table headers should be sticky. | `false` |
2013
+ | `table.actions` | Additional actions for the table. | |
2014
+
2015
+ ### Row Type
2016
+
2017
+ | Property | Description |
2018
+ |----------------------|------------------------------------------------------|
2019
+ | `cells` | Array of cell data for the row. |
2020
+ | `actions` | Additional actions for the row. |
2021
+ | `testId` | Test ID for the row. |
2022
+ | `noDrag` | Determines if row dragging is disabled. |
2023
+ | `onRowMouseEnter` | Function called when the mouse enters the row. |
2024
+ | `onRowMouseLeave` | Function called when the mouse leaves the row. |
2025
+
2026
+ ### Footer Props
2027
+
2028
+ | Property | Description |
2029
+ |-------------------|----------------------------------------------|
2030
+ | `colSpan` | Number of columns spanned by the footer. |
2031
+ | `pagination` | Pagination configuration for the footer. |
2032
+ | `actions` | Additional actions for the footer. |
2033
+ | `content` | Custom content for the footer. |
2034
+
2035
+ ### Usage Example
2036
+
2037
+ ```jsx
2038
+ <Table
2039
+ onListReorder={(obj) => console.log('Reordered: ', obj)}
2040
+ table={{
2041
+ name: 'Sample Table',
2042
+ headers: ['Name', 'Age', 'Location'],
2043
+ rows: [
2044
+ { cells: ['John', 25, 'New York'], testId: 'row1' },
2045
+ { cells: ['Alice', 30, 'Los Angeles'], testId: 'row2' },
2046
+ { cells: ['Bob', 28, 'Chicago'], testId: 'row3' },
2047
+ ],
2048
+ footer: {
2049
+ pagination: {
2050
+ rowCount: 50,
2051
+ selectedPage: 1,
2052
+ onSelectPage: (value) => console.log('Selected page: ', value),
2053
+ },
2054
+ },
2055
+ actions: [<Button key="addBtn" label="Add Row" onClick={() => console.log('Row added')} />],
2056
+ }}
2057
+ />
2058
+ ```
2059
+
2060
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2061
+
2062
+ ## Tabs Component <a id="tabs"></a>
2063
+
2064
+ The `Tabs` component creates a tabbed interface for organizing content.
2065
+
2066
+ ### Props
2067
+
2068
+ | Prop | Description | Default Value |
2069
+ |-------------------|----------------------------------------------------------------------|---------------|
2070
+ | `name` | Name of the tabs (optional). | - |
2071
+ | `options` | Array of tab options. | `null` |
2072
+ | `children` | Content of the tabs. | `null` |
2073
+ | `value` | Currently selected tab option. | - |
2074
+ | `onChange` | Function called when a tab is selected. | `() => {}` |
2075
+ | `padding` | Determines if padding should be applied to the tabs container. | `false` |
2076
+ | `margin` | Determines if margin should be applied to the tabs container. | `true` |
2077
+ | `contentPadding` | Determines if padding should be applied to the tab content. | `true` |
2078
+ | `testId` | Test ID for the tabs component. | - |
2079
+ | `activeTabIndex` | **(Deprecated)** Index of the active tab. | - |
2080
+ | `tabs` | **(Deprecated)** Array of tab options (use `options` prop instead). | - |
2081
+ | `onChangeTab` | **(Deprecated)** Function called when a tab is changed. | `() => {}` |
2082
+
2083
+ ### Tab Option
2084
+
2085
+ | Property | Description |
2086
+ |----------------|--------------------------------------------------|
2087
+ | `key` | Unique identifier for the tab. |
2088
+ | `label` | Label or title of the tab. |
2089
+ | `value` | Value associated with the tab. |
2090
+ | `url` | URL associated with the tab. |
2091
+ | `hidden` | Determines if the tab is hidden. |
2092
+ | `disabled` | Determines if the tab is disabled. |
2093
+ | `invalid` | Determines if the tab is invalid. |
2094
+ | `badge` | Badge content displayed on the tab. |
2095
+ | `right` | Determines if the badge should be on the right. |
2096
+ | `testId` | Test ID for the tab. |
2097
+
2098
+ ### Usage Example
2099
+
2100
+ ```jsx
2101
+ <Tabs
2102
+ name="example-tabs"
2103
+ options={[
2104
+ { label: 'Tab 1', value: 'tab1' },
2105
+ { label: 'Tab 2', value: 'tab2' },
2106
+ { label: 'Tab 3', value: 'tab3', disabled: true },
2107
+ ]}
2108
+ value={{ label: 'Tab 1', value: 'tab1' }}
2109
+ onChange={(evt) => console.log('Selected tab: ', evt.target.value)}
2110
+ padding={true}
2111
+ margin={false}
2112
+ contentPadding={false}
2113
+ testId="example-tabs"
2114
+ >
2115
+ <div>Content for Tab 1</div>
2116
+ <div>Content for Tab 2</div>
2117
+ <div>Content for Tab 3</div>
2118
+ </Tabs>
2119
+ ```
2120
+
2121
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2122
+
2123
+ ## Text Component <a id="text"></a>
2124
+
2125
+ The `Text` component renders text with customizable styles.
2126
+
2127
+ ### Props
2128
+
2129
+ | Prop | Description | Default Value |
2130
+ |-------------|---------------------------------------------------------|---------------|
2131
+ | `bold` | Determines if the text should be displayed in bold. | `false` |
2132
+ | `center` | Determines if the text should be centered. | `false` |
2133
+ | `error` | Determines if the text should represent an error state. | `false` |
2134
+ | `faint` | Determines if the text should have a faint appearance. | `false` |
2135
+ | `link` | Determines if the text should appear as a link. | `false` |
2136
+ | `muted` | Determines if the text should have a muted appearance. | `false` |
2137
+ | `onClick` | Function called when the text is clicked. | - |
2138
+ | `small` | Determines if the text should be displayed in a small size. | `false` |
2139
+ | `success` | Determines if the text should represent a success state. | `false` |
2140
+ | `warning` | Determines if the text should represent a warning state. | `false` |
2141
+ | `children` | The content to be rendered as text. | - |
2142
+
2143
+ ### Usage Example
2144
+
2145
+ ```jsx
2146
+ <Text bold center error onClick={() => console.log('Text clicked')}>
2147
+ Error Message
2148
+ </Text>
2149
+ ```
2150
+
2151
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2152
+
2153
+ ## TextLink Component <a id="textlink"></a>
2154
+
2155
+ The `TextLink` component renders text as a clickable link.
2156
+
2157
+ ### Props
2158
+
2159
+ | Prop | Description | Default Value |
2160
+ |------------|---------------------------------------------------------|---------------|
2161
+ | `href` | The URL that the link should navigate to. | - |
2162
+ | `target` | Specifies where to open the linked document. | - |
2163
+ | `testId` | A unique identifier used for testing purposes. | - |
2164
+ | `onClick` | Function called when the link is clicked. | - |
2165
+ | `children` | The content to be rendered as a clickable link. | - |
2166
+
2167
+ ### Usage Example
2168
+
2169
+ ```jsx
2170
+ <TextLink href="https://example.com" target="_blank" onClick={() => console.log('Link clicked')}>
2171
+ Visit Example
2172
+ </TextLink>
2173
+ ```
2174
+
2175
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2176
+
2177
+ ## TextArea Component <a id="textarea"></a>
2178
+
2179
+ The `TextArea` component renders a multi-line text input field.
2180
+
2181
+ ### Props
2182
+
2183
+ | Prop | Description | Default Value |
2184
+ |-----------------|-----------------------------------------------------------------------------|---------------|
2185
+ | `name` | The name of the text area field. | - |
2186
+ | `value` | The current value of the text area. | `''` |
2187
+ | `placeholder` | The placeholder text displayed when the text area is empty. | `''` |
2188
+ | `cols` | The visible width of the text area (in average character widths). | - |
2189
+ | `rows` | The number of visible text lines in the text area. | - |
2190
+ | `disabled` | If `true`, the text area is disabled and cannot be edited. | `false` |
2191
+ | `onChange` | Function called when the text area value changes. | `() => {}` |
2192
+ | `onKeyPress` | Function called when a key is pressed while the text area is focused. | `() => {}` |
2193
+ | `onFocus` | Function called when the text area receives focus. | `() => {}` |
2194
+ | `onBlur` | Function called when the text area loses focus. | `() => {}` |
2195
+ | `tabIndex` | Specifies the tab order of the text area. | `0` |
2196
+ | `error` | Error message to display below the text area if there is an error. | `null` |
2197
+ | `warning` | Warning message to display below the text area if there is a warning. | `null` |
2198
+ | `tooltip` | Tooltip message to display when hovering over the text area. | `null` |
2199
+ | `maxTooltipWidth` | The maximum width of the tooltip. | - |
2200
+ | `resize` | Specifies whether the text area is resizable or not. | - |
2201
+ | `monospace` | If `true`, the text area uses a monospaced font. | `false` |
2202
+ | `testId` | A unique identifier used for testing purposes. | - |
2203
+
2204
+ ### Usage Example
2205
+
2206
+ ```jsx
2207
+ <TextArea
2208
+ name="example"
2209
+ value={textareaValue}
2210
+ placeholder="Enter your text here"
2211
+ rows={4}
2212
+ cols={50}
2213
+ disabled={false}
2214
+ onChange={(e) => setTextareaValue(e.target.value)}
2215
+ error={textareaError}
2216
+ warning={textareaWarning}
2217
+ tooltip="This is a tooltip message"
2218
+ resize="vertical"
2219
+ monospace={false}
2220
+ testId="textarea-test-id"
2221
+ />
2222
+ ```
2223
+
2224
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2225
+
2226
+ ## Toggle Component <a id="toggle"></a>
2227
+
2228
+ The `Toggle` component represents a toggle switch that allows users to change between two states, typically "on" and "off".
2229
+
2230
+ ### Props
2231
+
2232
+ | Prop | Description | Default Value |
2233
+ |---------------|-----------------------------------------------------------------------------------------------|---------------|
2234
+ | `name` | The name of the toggle input field. | - |
2235
+ | `label` | The label displayed next to the toggle switch. | `null` |
2236
+ | `checked` | If `true`, the toggle switch is turned on; if `false`, it's turned off. | `false` |
2237
+ | `disabled` | If `true`, the toggle switch is disabled and cannot be interacted with. | `false` |
2238
+ | `display` | The display style of the toggle switch. | - |
2239
+ | `small` | If `true`, a smaller version of the toggle switch is rendered. | `false` |
2240
+ | `onChange` | Function called when the state of the toggle switch changes. | `() => {}` |
2241
+ | `noMargin` | If `true`, no margin is applied to the toggle switch. | `false` |
2242
+ | `testId` | A unique identifier used for testing purposes. | - |
2243
+ | `helpText` | Help text associated with the toggle switch. | - |
2244
+ | `onClickHelp` | Function called when the help icon associated with the toggle switch is clicked. | - |
2245
+
2246
+ ### Usage Example
2247
+
2248
+ ```jsx
2249
+ <Toggle
2250
+ name="toggle-switch"
2251
+ label="Enable Notifications"
2252
+ checked={toggleState}
2253
+ disabled={false}
2254
+ onChange={(e) => setToggleState(e.target.checked)}
2255
+ small={false}
2256
+ noMargin={false}
2257
+ testId="toggle-test-id"
2258
+ helpText="Enable this toggle to receive notifications."
2259
+ onClickHelp={(e) => console.log('Help icon clicked')}
2260
+ />
2261
+ ```
2262
+
2263
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2264
+
2265
+ ## Toast Component <a id="toast"></a>
2266
+
2267
+ The `toast` function generates a toast notification with the provided message content.
2268
+
2269
+ ### Props
2270
+
2271
+ | Prop | Description | Default Value |
2272
+ |-------------|-----------------------------------------------------------------------------------------------|---------------|
2273
+ | `id` | The unique identifier for the toast notification. | - |
2274
+ | `message` | The content and configuration of the toast message. | `{ type: MessageType.INFO, content: '' }` |
2275
+ | `autoClose` | The duration in milliseconds after which the toast should automatically close. Set to `false` to disable auto-closing. | `6000` (6 seconds) |
2276
+ | `onClose` | Function called when the toast is closed. | `() => {}` |
2277
+
2278
+ ### Message Type
2279
+
2280
+ The `IMessageType` type defines the structure of the message content for the toast notification.
2281
+
2282
+ | Property | Description | Default Value |
2283
+ |------------|---------------------------------------------------------------------------------------|---------------|
2284
+ | `type` | The type of the message, such as `info`, `success`, `warning`, or `error`. | `MessageType.INFO` |
2285
+ | `icon` | If `true`, an icon corresponding to the message type will be displayed. | `false` |
2286
+ | `heading` | The heading or title of the message. | - |
2287
+ | `content` | The main content of the message. | `''` |
2288
+ | `details` | Additional details or supplementary information related to the message content. | `null` |
2289
+
2290
+ ### Usage Example
2291
+
2292
+ ```jsx
2293
+ <>
2294
+ <Button label="Info" onClick={() => toast({
2295
+ message: messageInfo,
2296
+ onClose: () => console.log('toast closed')
2297
+ })} />
2298
+ <Spacer />
2299
+ <Button label="Error" onClick={() => toast({
2300
+ message: messageError,
2301
+ onClose: () => console.log('toast closed')
2302
+ })} />
2303
+ <Spacer />
2304
+ <Button label="Warning" onClick={() => toast({
2305
+ message: messageWarning,
2306
+ onClose: () => console.log('toast closed')
2307
+ })} />
2308
+ <Spacer />
2309
+ <Button label="Success" onClick={() => toast({
2310
+ message: messageSuccess,
2311
+ onClose: () => console.log('toast closed')
2312
+ })} />
2313
+ </>;
2314
+ ```
2315
+
2316
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2317
+
2318
+ ## Tooltip Component <a id="tooltip"></a>
2319
+
2320
+ The `Tooltip` component creates a tooltip that appears when hovering over its children.
2321
+
2322
+ ### Props
2323
+
2324
+ | Prop | Description | Default Value |
2325
+ |--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
2326
+ | `children` | The content over which the tooltip will be triggered. | - |
2327
+ | `text` | The text or content to display within the tooltip. | `''` |
2328
+ | `error` | If `true`, the tooltip will be styled as an error tooltip. | `false` |
2329
+ | `warning` | If `true`, the tooltip will be styled as a warning tooltip. | `false` |
2330
+ | `placement` | The initial placement of the tooltip relative to its children. | `'top-center'` |
2331
+ | `possiblePlacements` | An array of possible placements for the tooltip. | `['top-center', 'left-center', 'bottom-center', 'right-center']` |
2332
+ | `enabled` | If `true`, the tooltip will be enabled and shown on hover. | `true` |
2333
+ | `maxWidth` | The maximum width of the tooltip. | `'none'` |
2334
+ | `triggerOffset` | The offset in pixels between the tooltip and its trigger element. | `12` |
2335
+ | `fontSize` | The font size of the tooltip text. | `'inherit'` |
2336
+ | `padding` | The padding of the tooltip content. | `'var(--padding-xxs) var(--padding-xs)'` |
2337
+ | `display` | The display property of the tooltip container. | `'inline'` |
2338
+ | `flex` | The flex property of the tooltip container. | `'none'` |
2339
+ | `forceOpen` | If `true`, the tooltip will always be open and displayed, regardless of hover or focus events. | `false` |
2340
+
2341
+ ### Usage Example
2342
+
2343
+ ```jsx
2344
+ // Basic Tooltip
2345
+ <Tooltip text="Hello, World!">
2346
+ <button>Hover Me</button>
2347
+ </Tooltip>
2348
+
2349
+ // Tooltip with Error Styling
2350
+ <Tooltip text="Invalid input" error>
2351
+ <input type="text" placeholder="Enter text" />
2352
+ </Tooltip>
2353
+
2354
+ // Tooltip with Custom Placement and Styling
2355
+ <Tooltip text="Click here to submit" placement="bottom-center" warning maxWidth="200px" fontSize="14px">
2356
+ <button>Submit</button>
2357
+ </Tooltip>
2358
+ ```
2359
+
2360
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2361
+
2362
+ ## TopBar Component <a id="topbar"></a>
2363
+
2364
+ The `TopBar` component represents the top bar of the application, typically used for displaying titles, navigation options, and other important information.
2365
+
2366
+ ### Props
2367
+
2368
+ | Prop | Description | Default Value |
2369
+ |-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
2370
+ | `title` | The configuration for the title displayed in the top bar. | `{}` |
2371
+ | `appSwitcher` | The configuration for the app switcher displayed in the top bar. | `{}` |
2372
+ | `content` | An array of content items to be displayed in the top bar, typically on the left side. | `[]` |
2373
+ | `contentRight` | An array of content items to be displayed in the top bar, typically on the right side. | `[]` |
2374
+ | `warning` | A warning message to be displayed in the top bar. | `''` |
2375
+ | `height` | The height of the top bar. | `'var(--size-topbar)'` |
2376
+ | `fixedPosition` | If `true`, the top bar will have a fixed position at the top of the viewport. | `true` |
2377
+
2378
+ ### Usage Example
2379
+
2380
+ ```jsx
2381
+ // Basic TopBar with Title and App Switcher
2382
+ <TopBar
2383
+ title={{ text: 'My App', onClick: handleTitleClick }}
2384
+ appSwitcher={{ onClick: handleAppSwitcherClick }}
2385
+ />
2386
+
2387
+ // TopBar with Content and Warning Message
2388
+ <TopBar
2389
+ content={[
2390
+ { text: 'Home', onClick: handleHomeClick },
2391
+ { text: 'About', onClick: handleAboutClick },
2392
+ ]}
2393
+ contentRight={[
2394
+ { text: 'Profile', onClick: handleProfileClick },
2395
+ { text: 'Settings', onClick: handleSettingsClick },
2396
+ ]}
2397
+ warning="You have unsaved changes."
2398
+ />
2399
+
2400
+ // TopBar with Fixed Position and Custom Height
2401
+ <TopBar
2402
+ title={{ text: 'Dashboard' }}
2403
+ height="60px"
2404
+ fixedPosition
2405
+ />
2406
+ ```
2407
+
2408
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2409
+
2410
+ ## PopConfirm Component <a id="popconfirm"></a>
2411
+
2412
+ The `PopConfirm` component creates a popover with confirmation buttons, typically used to confirm or cancel an action.
2413
+
2414
+ ### Props
2415
+
2416
+ | Prop | Description | Default Value |
2417
+ |----------------------|-----------------------------------------------------------------------------------------------|------------------------|
2418
+ | `children` | The content that triggers the popover when clicked. | - |
2419
+ | `placement` | The placement of the popover relative to the trigger element. | `'top-center'` |
2420
+ | `closeOnOutsideClick`| If `true`, the popover closes when clicked outside of it. | `true` |
2421
+ | `fullWidth` | If `true`, the popover will take the full width of its container. | `false` |
2422
+ | `title` | The title displayed in the popover. | `''` |
2423
+ | `cancelText` | The text for the cancel button. | `'Cancel'` |
2424
+ | `onClickCancel` | The function called when the cancel button is clicked. | Closes the popover |
2425
+ | `okText` | The text for the OK button. | `'Ok'` |
2426
+ | `onClickOk` | The function called when the OK button is clicked. | `() => {}` |
2427
+ | `overflowContainer` | If `true`, the popover will overflow its container if necessary. | `false` |
2428
+ | `testId` | Optional test id for testing purposes. | - |
2429
+
2430
+ ### Usage Example
2431
+
2432
+ ```jsx
2433
+ <PopConfirm
2434
+ title="Are you sure you want to delete this item?"
2435
+ onClickOk={() => handleDelete()}
2436
+ >
2437
+ <Button>Delete</Button>
2438
+ </PopConfirm>
2439
+
2440
+ <PopConfirm
2441
+ placement="bottom-right"
2442
+ title="Save changes before leaving?"
2443
+ okText="Save"
2444
+ cancelText="Don't Save"
2445
+ onClickOk={() => handleSave()}
2446
+ onClickCancel={() => handleCancel()}
2447
+ >
2448
+ <Button>Leave</Button>
2449
+ </PopConfirm>
2450
+ ```
2451
+
2452
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2453
+
2454
+ ## Tree Component <a id="tree"></a>
2455
+
2456
+ The `Tree` component represents a hierarchical structure of items in a tree format. It allows users to navigate through the hierarchy and interact with the items.
2457
+
2458
+ ### Props
2459
+
2460
+ #### ITreeProps
2461
+
2462
+ | Prop | Description | Default Value |
2463
+ |----------------------|-----------------------------------------------------------------------------------------------|------------------------|
2464
+ | `list` | The list of items to be displayed in the tree. | - |
2465
+ | `draggable` | If `true`, allows dragging and dropping of tree nodes to reorder them. | `false` |
2466
+ | `onListReorder` | Callback function invoked when the order of items in the tree is changed through dragging. | - |
2467
+ | `onChangeOpen` | Callback function invoked when the open/close state of tree nodes changes. | - |
2468
+ | `testId` | Optional test id for testing purposes. | - |
2469
+ | `isInitialOpen` | Determines which nodes should be initially open. | `false` |
2470
+ | `treeRef` | Reference to the tree component. | - |
2471
+ | `itemHasChild` | Function to determine if a tree node has child nodes. | - |
2472
+ | `onItemToggle` | Callback function invoked when a tree node is toggled (opened/closed). | - |
2473
+ | `icons` | Custom icons for expand and collapse actions. | - |
2474
+
2475
+ #### ITreeListProps
2476
+
2477
+ | Prop | Description | Default Value |
2478
+ |----------------------|-----------------------------------------------------------------------------------------------|------------------------|
2479
+ | `name` | The name of the tree list. | - |
2480
+ | `noHeader` | If `true`, hides the header of the tree list. | `false` |
2481
+ | `items` | The array of tree items to be displayed. | - |
2482
+ | `onClick` | Callback function invoked when a tree node is clicked. | - |
2483
+ | `actions` | Additional actions associated with the tree list. | - |
2484
+
2485
+ ### Usage Example
2486
+
2487
+ ```jsx
2488
+ const treeItems = [
2489
+ {
2490
+ id: '1',
2491
+ name: 'Item 1',
2492
+ parent: '',
2493
+ droppable: true,
2494
+ details: 'Details of Item 1',
2495
+ active: true,
2496
+ testId: 'item-1',
2497
+ icon: {
2498
+ icon: <IconComponent />,
2499
+ color: 'blue',
2500
+ tooltip: {
2501
+ text: 'Tooltip for Item 1',
2502
+ error: false,
2503
+ warning: true,
2504
+ placement: 'right',
2505
+ enabled: true,
2506
+ maxWidth: '200px',
2507
+ triggerOffset: '20px',
2508
+ possiblePlacements: ['top', 'bottom', 'left', 'right'],
2509
+ fontSize: '14px',
2510
+ padding: '8px',
2511
+ },
2512
+ },
2513
+ },
2514
+ ];
2515
+
2516
+ <Tree
2517
+ list={{ items: treeItems }}
2518
+ draggable={true}
2519
+ onListReorder={handleListReorder}
2520
+ onChangeOpen={(ids) => console.log(ids)}
2521
+ testId="my-tree"
2522
+ isInitialOpen={['1']}
2523
+ treeRef={treeRef}
2524
+ itemHasChild={(node) => node.children.length > 0}
2525
+ onItemToggle={handleNodeToggle}
2526
+ />
2527
+ ```
2528
+
2529
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2530
+
2531
+ ## NumberInput Component <a id="numberinput"></a>
2532
+
2533
+ The `NumberInput` component provides an input field for entering numeric values. It allows users to input numerical data and provides options for customization and error handling.
2534
+
2535
+ ### Props
2536
+
2537
+ #### INumberInputProps
2538
+
2539
+ | Prop | Description | Default Value |
2540
+ |--------------------|-----------------------------------------------------------------------------------------------|------------------------|
2541
+ | `name` | The name of the input field. | - |
2542
+ | `placeholder` | The placeholder text displayed when the input is empty. | `''` |
2543
+ | `disabled` | If `true`, disables the input field. | `false` |
2544
+ | `error` | Error message to display, or `true` if there is an error. | `false` |
2545
+ | `left` | If `true`, aligns the content to the left. | `false` |
2546
+ | `small` | If `true`, reduces the size of the input field. | `false` |
2547
+ | `width` | The width of the input field. | `'100%'` |
2548
+ | `value` | The value of the input field. | `''` |
2549
+ | `onChange` | Callback function invoked when the value of the input changes. | `() => {}` |
2550
+ | `onFocus` | Callback function invoked when the input field is focused. | `() => {}` |
2551
+ | `tabIndex` | Specifies the tab order of the input field. | `0` |
2552
+ | `testId` | Optional test id for testing purposes. | - |
2553
+ | `tooltip` | Tooltip text or component to display. | `null` |
2554
+ | `warning` | Warning message to display, or `true` if there is a warning. | `false` |
2555
+ | `validationCallback` | Callback function invoked for validation. | `() => {}` |
2556
+ | `allowEmpty` | If `true`, allows the input field to be empty. | `false` |
2557
+ | `isInTable` | If `true`, indicates that the input field is within a table. | `false` |
2558
+ | `groupOrder` | Specifies the order of input fields within a group. | - |
2559
+
2560
+ ### Usage Example
2561
+
2562
+ ```jsx
2563
+ <NumberInput
2564
+ name="quantity"
2565
+ placeholder="Enter quantity"
2566
+ value={10}
2567
+ onChange={handleInputChange}
2568
+ onFocus={handleInputFocus}
2569
+ tabIndex={1}
2570
+ testId="quantity-input"
2571
+ error="Invalid quantity"
2572
+ warning="Low quantity"
2573
+ validationCallback={handleValidation}
2574
+ isInTable={false}
2575
+ groupOrder={null}
2576
+ />
2577
+ ```
2578
+
2579
+ <hr style="border: none; border-right: 2px solid black; width: 100%; height: 1px;">
2580
+
2581
+ ## UnitInput Component <a id="unitinput"></a>
2582
+
2583
+ The `UnitInput` component allows users to input values with associated units. It provides options for customization, including predefined options, error handling, and validation callbacks.
2584
+
2585
+ ### Props
2586
+
2587
+ #### IUnitInputProps
2588
+
2589
+ | Prop | Description | Default Value |
2590
+ |---------------------------|----------------------------------------------------------------------------------------------------------|---------------|
2591
+ | `name` | The name of the input field. | `''` |
2592
+ | `placeholder` | The placeholder text displayed when the input is empty. | `''` |
2593
+ | `disabled` | If `true`, disables the input field. | `false` |
2594
+ | `disabledUnit` | If `true`, disables the unit selection. | `false` |
2595
+ | `error` | Error message to display, or `true` if there is an error. | `null` |
2596
+ | `left` | If `true`, aligns the content to the left. | `false` |
2597
+ | `small` | If `true`, reduces the size of the input field. | `false` |
2598
+ | `width` | The width of the input field. | `'100%'` |
2599
+ | `value` | The value of the input field. | `''` |
2600
+ | `unitkey` | The key associated with the unit value. | `''` |
2601
+ | `initUnit` | The initial unit value. | `''` |
2602
+ | `noConversion` | If `true`, disables automatic unit conversion. | `false` |
2603
+ | `onChange` | Callback function invoked when the value of the input changes. | `() => {}` |
2604
+ | `onClick` | Callback function invoked when the input field is clicked. | `() => {}` |
2605
+ | `onFocus` | Callback function invoked when the input field is focused. | `() => {}` |
2606
+ | `onSwitchUnit` | Callback function invoked when the unit is switched. | `() => {}` |
2607
+ | `unitTemplate` | Template for rendering units. | `{}` |
2608
+ | `doNotConvertValue` | If `true`, disables value conversion. | `false` |
2609
+ | `testId` | Test id for testing purposes. | - |
2610
+ | `warning` | Warning message to display, or `true` if there is a warning. | `null` |
2611
+ | `predefinedOptions` | An array of predefined options. | - |
2612
+ | `initialPredefinedOption` | If `true`, selects the initial predefined option. | `false` |
2613
+ | `shouldLinkAutomaticly` | If `true`, automatically links the predefined option and the value. | `true` |
2614
+ | `selectedPredefinedOptionKey` | The key of the selected predefined option. | - |
2615
+ | `validationCallback` | Callback function for validation. | `() => {}` |
2616
+ | `disabledValidation` | If `true`, disables validation. | `false` |
2617
+ | `allowEmpty` | If `true`, allows the input field to be empty. | `false` |
2618
+ | `autoValue` | Automatic value to set. | - |
2619
+
2620
+ ### Usage Example
2621
+
2622
+ ```jsx
2623
+ <UnitInput
2624
+ name="weight"
2625
+ placeholder="Enter weight"
2626
+ value="10"
2627
+ unitkey="kg"
2628
+ initUnit="kg"
2629
+ onChange={handleInputChange}
2630
+ onFocus={handleInputFocus}
2631
+ onSwitchUnit={handleSwitchUnit}
2632
+ testId="weight-input"
2633
+ error="Invalid weight"
2634
+ warning="Low weight"
2635
+ predefinedOptions={[
2636
+ { value: 'kg', label: 'Kilogram' },
2637
+ { value: 'g', label: 'Gram' },
2638
+ { value: 'lb', label: 'Pound' },
2639
+ ]}
2640
+ initialPredefinedOption={true}
2641
+ shouldLinkAutomaticly={true}
2642
+ selectedPredefinedOptionKey="kg"
2643
+ validationCallback={handleValidation}
2644
+ disabledValidation={false}
2645
+ allowEmpty={false}
2646
+ autoValue="20"
2647
+ />
2648
+ ```