@symply.io/basic-components 1.0.0-alpha.9 → 1.0.0-bata.7

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 (140) hide show
  1. package/AlertDialog/index.d.ts +0 -1
  2. package/AlertDialog/index.js +2 -2
  3. package/Autocomplete/index.d.ts +4 -0
  4. package/Autocomplete/index.js +38 -0
  5. package/Autocomplete/types.d.ts +14 -0
  6. package/Autocomplete/types.js +1 -0
  7. package/Autocomplete/useInteractions.d.ts +5 -0
  8. package/Autocomplete/useInteractions.js +9 -0
  9. package/AutocompleteWithFilter/index.d.ts +4 -0
  10. package/AutocompleteWithFilter/index.js +52 -0
  11. package/AutocompleteWithFilter/types.d.ts +15 -0
  12. package/AutocompleteWithFilter/types.js +1 -0
  13. package/BasicModal/Content.d.ts +0 -1
  14. package/BasicModal/Content.js +6 -6
  15. package/BasicModal/index.d.ts +0 -1
  16. package/BasicModal/index.js +3 -6
  17. package/BasicTable/TableBody.d.ts +4 -0
  18. package/BasicTable/TableBody.js +51 -0
  19. package/BasicTable/TableBodyRow.d.ts +3 -0
  20. package/BasicTable/TableBodyRow.js +42 -0
  21. package/BasicTable/TableFooter.d.ts +3 -0
  22. package/BasicTable/TableFooter.js +44 -0
  23. package/BasicTable/TableHeader.d.ts +3 -0
  24. package/BasicTable/TableHeader.js +47 -0
  25. package/BasicTable/index.d.ts +5 -0
  26. package/BasicTable/index.js +88 -0
  27. package/BasicTable/types.d.ts +70 -0
  28. package/BasicTable/types.js +1 -0
  29. package/BasicTable/useScroll.d.ts +9 -0
  30. package/BasicTable/useScroll.js +76 -0
  31. package/BasicTable/useTable.d.ts +38 -0
  32. package/BasicTable/useTable.js +94 -0
  33. package/BreadCrumbs/index.d.ts +4 -0
  34. package/BreadCrumbs/index.js +37 -0
  35. package/BreadCrumbs/types.d.ts +9 -0
  36. package/BreadCrumbs/types.js +1 -0
  37. package/CheckBox/CheckBox.d.ts +3 -0
  38. package/CheckBox/CheckBox.js +36 -0
  39. package/CheckBox/CheckBoxGroup.d.ts +3 -0
  40. package/CheckBox/CheckBoxGroup.js +30 -0
  41. package/CheckBox/index.d.ts +3 -0
  42. package/CheckBox/index.js +3 -0
  43. package/CheckBox/types.d.ts +12 -0
  44. package/CheckBox/types.js +1 -0
  45. package/Copyright/index.d.ts +4 -0
  46. package/Copyright/index.js +25 -0
  47. package/Copyright/types.d.ts +5 -0
  48. package/Copyright/types.js +1 -0
  49. package/DateInput/FullDateInput/index.d.ts +5 -0
  50. package/DateInput/FullDateInput/index.js +79 -0
  51. package/DateInput/FullDateInput/types.d.ts +9 -0
  52. package/DateInput/FullDateInput/types.js +1 -0
  53. package/DateInput/FullDateInput/useInteractions.d.ts +8 -0
  54. package/DateInput/FullDateInput/useInteractions.js +20 -0
  55. package/DateInput/MonthDayInput/index.d.ts +5 -0
  56. package/DateInput/MonthDayInput/index.js +65 -0
  57. package/DateInput/MonthDayInput/types.d.ts +9 -0
  58. package/DateInput/MonthDayInput/types.js +1 -0
  59. package/DateInput/MonthDayInput/useInteractions.d.ts +8 -0
  60. package/DateInput/MonthDayInput/useInteractions.js +19 -0
  61. package/DateInput/MonthYearInput/index.d.ts +5 -0
  62. package/DateInput/MonthYearInput/index.js +66 -0
  63. package/DateInput/MonthYearInput/types.d.ts +9 -0
  64. package/DateInput/MonthYearInput/types.js +1 -0
  65. package/DateInput/MonthYearInput/useInteractions.d.ts +8 -0
  66. package/DateInput/MonthYearInput/useInteractions.js +19 -0
  67. package/DateInput/index.d.ts +6 -0
  68. package/DateInput/index.js +6 -0
  69. package/DigitInput/index.d.ts +1 -4
  70. package/DigitInput/index.js +3 -3
  71. package/DigitInput/types.d.ts +2 -1
  72. package/DynamicHeaderBar/HeaderBar.js +1 -1
  73. package/DynamicHeaderBar/HeaderButtons.d.ts +0 -1
  74. package/DynamicHeaderBar/HeaderButtons.js +6 -6
  75. package/DynamicHeaderBar/HeaderLine.js +1 -1
  76. package/DynamicHeaderBar/index.js +2 -2
  77. package/DynamicHeaderBar/types.d.ts +3 -0
  78. package/FeinInput/index.d.ts +6 -0
  79. package/FeinInput/index.js +75 -0
  80. package/FeinInput/types.d.ts +9 -0
  81. package/FeinInput/types.js +1 -0
  82. package/FeinInput/useInteractions.d.ts +8 -0
  83. package/FeinInput/useInteractions.js +16 -0
  84. package/FormRadioGroup/index.d.ts +0 -1
  85. package/FormRadioGroup/index.js +3 -3
  86. package/FormSelector/MultipleSelector.d.ts +1 -3
  87. package/FormSelector/MultipleSelector.js +2 -2
  88. package/FormSelector/SimpleSelector.d.ts +1 -3
  89. package/FormSelector/SimpleSelector.js +2 -2
  90. package/FormSelector/types.d.ts +2 -1
  91. package/HelpCaption/index.js +2 -2
  92. package/LoadingModal/index.d.ts +0 -1
  93. package/LoadingModal/index.js +1 -1
  94. package/MenuButtonGroup/MenuItem.d.ts +0 -1
  95. package/MenuButtonGroup/MenuItem.js +1 -1
  96. package/MenuButtonGroup/index.js +2 -2
  97. package/NumberInput/index.d.ts +2 -3
  98. package/NumberInput/index.js +1 -1
  99. package/PasswordInput/ConfirmPassword.d.ts +2 -3
  100. package/PasswordInput/ConfirmPassword.js +1 -1
  101. package/PasswordInput/Password.d.ts +5 -5
  102. package/PasswordInput/Password.js +9 -8
  103. package/PhoneNumberInput/index.d.ts +4 -3
  104. package/PhoneNumberInput/index.js +15 -4
  105. package/README.md +428 -3
  106. package/Sidebar/SidebarItem.d.ts +3 -0
  107. package/Sidebar/SidebarItem.js +62 -0
  108. package/Sidebar/SidebarItemsGroup.d.ts +5 -0
  109. package/Sidebar/SidebarItemsGroup.js +38 -0
  110. package/Sidebar/SidebarLink.d.ts +3 -0
  111. package/Sidebar/SidebarLink.js +37 -0
  112. package/Sidebar/index.d.ts +7 -0
  113. package/Sidebar/index.js +30 -0
  114. package/Sidebar/types.d.ts +31 -0
  115. package/Sidebar/types.js +1 -0
  116. package/SocialInput/index.d.ts +6 -0
  117. package/SocialInput/index.js +77 -0
  118. package/SocialInput/types.d.ts +9 -0
  119. package/SocialInput/types.js +1 -0
  120. package/SocialInput/useInteractions.d.ts +10 -0
  121. package/SocialInput/useInteractions.js +26 -0
  122. package/TabGroup/index.js +10 -5
  123. package/TablePagination/Actions.d.ts +3 -0
  124. package/TablePagination/Actions.js +27 -0
  125. package/TablePagination/index.d.ts +4 -0
  126. package/TablePagination/index.js +30 -0
  127. package/TablePagination/types.d.ts +14 -0
  128. package/TablePagination/types.js +1 -0
  129. package/TablePagination/useInteractions.d.ts +14 -0
  130. package/TablePagination/useInteractions.js +23 -0
  131. package/TextInput/index.d.ts +2 -3
  132. package/TextInput/index.js +13 -3
  133. package/ToastPrompt/Presentation.js +3 -3
  134. package/ToastPrompt/index.js +1 -1
  135. package/VideoPlayerModal/index.d.ts +1 -3
  136. package/VideoPlayerModal/index.js +2 -2
  137. package/VideoPlayerModal/types.d.ts +2 -1
  138. package/index.d.ts +20 -0
  139. package/index.js +20 -0
  140. package/package.json +8 -2
package/README.md CHANGED
@@ -12,8 +12,20 @@
12
12
  - [License](#license)
13
13
  - [Components](#components)
14
14
  - [AlertDialog](#alertdialog)
15
+ - [Autocomplete](#autocomplete)
16
+ - [AutocompleteWithFilter](#autocompletewithfilter)
15
17
  - [BasicModal](#basicmodal)
18
+ - [BasicTable](#basictable)
19
+ - [BreadCrumbs](#breadcrumbs)
20
+ - [CheckBox](#checkbox)
21
+ - [CheckBoxGroup](#checkboxgroup)
22
+ - [Copyright](#copyright)
23
+ - [DateInput](#dateinput)
24
+ - [FullDateInput](#fulldateinput)
25
+ - [MonthDayInput](#monthdayinput)
26
+ - [MonthYearInput](#monthyearinput)
16
27
  - [DigitInput](#digitinput)
28
+ - [FeinInput](#feininput)
17
29
  - [FormRadioGroup](#formradiogroup)
18
30
  - [FormSelector](#formselector)
19
31
  - [HelpCaption](#helpcaption)
@@ -22,7 +34,10 @@
22
34
  - [NumberInput](#numberinput)
23
35
  - [PasswordInput](#passwordinput)
24
36
  - [PhoneNumberInput](#phonenumberinput)
37
+ - [Sidebar](#sidebar)
38
+ - [SocialInput](#socialinput)
25
39
  - [TabGroup](#tabgroup)
40
+ - [TablePagination](#tablepagination)
26
41
  - [TextInput](#textinput)
27
42
  - [ToastPrompt](#toastprompt)
28
43
  - [VideoPlayerModal](#videoplayermodal)
@@ -46,7 +61,18 @@ yarn add @symply.io/basic-components
46
61
 
47
62
  <h2>License</h2>
48
63
 
49
- This project is licensed under the terms of the [MIT license](https://github.com/rinxun/symply-basic-components/blob/main/LICENSE).
64
+ This project is licensed under the terms of the [MIT license](https://github.com/baseline-software/symply-basic-components/blob/main/LICENSE).
65
+
66
+
67
+
68
+ <h2>Common Properties</h2>
69
+
70
+ All components include these 2 properties to customize the theme
71
+
72
+ | Name | Type | Default | Required | Description |
73
+ | -------------- | ---------------------- | ------- | -------- | ----------------------------- |
74
+ | primaryColor | CSSProperties["color"] | | false | Primary color for the theme |
75
+ | secondaryColor | CSSProperties["color"] | | false | Secondary color for the theme |
50
76
 
51
77
 
52
78
 
@@ -77,6 +103,71 @@ import AlertDialog from '@symply.io/basic-components/AlertDialog';
77
103
 
78
104
 
79
105
 
106
+ <h3>Autocomplete</h3>
107
+
108
+ A normal text input enhanced by a panel of suggested options.
109
+
110
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
111
+
112
+ <h5>Import</h5>
113
+
114
+ ```typescript
115
+ import { Autocomplete } from '@symply.io/basic-components/';
116
+ // or
117
+ import Autocomplete from '@symply.io/basic-components/Autocomplete';
118
+ ```
119
+
120
+ <h5>Option Props (IOption)</h5>
121
+
122
+ | Name | Type | Default | Required | Description |
123
+ | ------ | ------- | ------- | -------- | -------------------------- |
124
+ | label | string | | true | Option label. |
125
+ | [name] | Unknown | | false | Customized option property |
126
+
127
+ <h5>Props</h5>
128
+
129
+ | Name | Type | Default | Required | Description |
130
+ | -------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
131
+ | multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
132
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: Array<IOption|string>|IOption|string|null) => void`<br/>*value:* The value of the `Input` element. |
133
+ | options | Array<IOption\|string> | | true | Array of suggestion options. |
134
+ | value | string | | true | The value of the `Input` element. |
135
+
136
+
137
+
138
+ <h3>AutocompleteWithFilter</h3>
139
+
140
+ A normal text input enhanced by a panel of suggested options and filter.
141
+
142
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
143
+
144
+ <h5>Import</h5>
145
+
146
+ ```typescript
147
+ import { AutocompleteWithFilter } from '@symply.io/basic-components/';
148
+ // or
149
+ import AutocompleteWithFilter from '@symply.io/basic-components/AutocompleteWithFilter';
150
+ ```
151
+
152
+ <h5>Option Props (IOption)</h5>
153
+
154
+ | Name | Type | Default | Required | Description |
155
+ | ------ | ------- | ------- | -------- | -------------------------- |
156
+ | label | string | | true | Option label. |
157
+ | [name] | Unknown | | false | Customized option property |
158
+
159
+ <h5>Props</h5>
160
+
161
+ | Name | Type | Default | Required | Description |
162
+ | -------------------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
163
+ | disableCloseOnSelect | bool | false | false | If `true`, the popup won't close when a value is selected. |
164
+ | multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
165
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: Array<IOption|string>|IOption|string|null) => void`<br/>*value:* The value of the `Input` element. |
166
+ | options | Array<IOption\|string> | | true | Array of suggestion options. |
167
+ | value | string | | true | The value of the `Input` element. |
168
+
169
+
170
+
80
171
  <h3>BasicModal</h3>
81
172
 
82
173
  Reusable modal component.
@@ -111,6 +202,232 @@ import BasicModal from '@symply.io/basic-components/BasicModal';
111
202
 
112
203
 
113
204
 
205
+ <h3>BasicTable</h3>
206
+
207
+ Reusable table component
208
+
209
+ <h5>Import</h5>
210
+
211
+ ```tsx
212
+ import { BasicTable, useTable } from '@symply.io/basic-components';
213
+ // or
214
+ import BasicTable, { useTable } from '@symply.io/basic-components/BreadCrumbs/BasicTable';
215
+ ```
216
+
217
+ <h5>Column Props (IColumn)</h5>
218
+
219
+ | Name | Type | Default | Required | Description |
220
+ | ----------- | --------------------------- | ------- | -------- | ----------------------------------------------- |
221
+ | Body | ReactElement | | true | The component to render the column body cell. |
222
+ | Header | ReactElement | | true | The component to render the column header cell. |
223
+ | Footer | ReactElement | | false | The component to render the column footer cell. |
224
+ | accessor | string | | true | The key of the column, it should be unique. |
225
+ | align | "left" \|"center" \|"right" | | false | The alignment of the column. |
226
+ | canBeFrozen | bool | | false | If true, the column can be frozen |
227
+ | canSort | bool | | false | If true, the column can be sortable. |
228
+
229
+ <h5>Hook Props</h5>
230
+
231
+ | Name | Type | Default | Required | Description |
232
+ | ------------- | -------------------------- | ------- | -------- | ------------------------------------------- |
233
+ | columns | Array\<IColumn\> | | true | table columns |
234
+ | data | Array<{ [name]: unknown }> | | true | table data/rows |
235
+ | disableSortBy | bool | | false | If true, the whole table can't be sortable. |
236
+ | initialState | { sortBy?: SortByProps } | | false | Set the initial states |
237
+ | onSort | func | | false | The function for sorting rows. |
238
+
239
+ <h5>Hook Returns</h5>
240
+
241
+ | Name | Type | Description |
242
+ | ------- | -------------------- | ------------------------- |
243
+ | headers | Array\<IHeader\> | The cells for the header. |
244
+ | columns | Array\<IBodyColumn\> | The cells for the body. |
245
+ | footers | Array\<IFooter> | The cells for the footer. |
246
+ | rows | Array<IRow\> | The rows for the table. |
247
+
248
+ <h5>Component Props</h5>
249
+
250
+ | Name | Type | Default | Required | Description |
251
+ | ---------- | -------------------- | ---------- | -------- | ----------------------------------------- |
252
+ | headers | Array\<IHeader\> | | true | The cells for the header. (from the hook) |
253
+ | columns | Array\<IBodyColumn\> | | true | The cells for the body. (from the hook) |
254
+ | footers | Array\<IFooter> | [] | false | The cells for the footer. (from the hook) |
255
+ | noDataText | string | 'No Data!' | false | The text when no data rendered. |
256
+ | rows | Array<IRow\> | | true | The rows for the table. (from the hook) |
257
+
258
+
259
+
260
+ <h3>BreadCrumbs</h3>
261
+
262
+ A list of links that help a user visualize a page's location within the hierarchical structure of a website, and allow navigation up to any of its "ancestors".
263
+
264
+ <h5>Import</h5>
265
+
266
+ ```typescript
267
+ import { BreadCrumbs } from '@symply.io/basic-components/';
268
+ // or
269
+ import BreadCrumbs from '@symply.io/basic-components/BreadCrumbs';
270
+ ```
271
+
272
+ <h5>Props</h5>
273
+
274
+ | Name | Type | Default | Required | Description |
275
+ | ------ | --------------------------------------- | ------- | -------- | ------------------------- |
276
+ | routes | Array<{ href?: string; label: string }> | | true | All routes of "ancestors" |
277
+
278
+
279
+
280
+ <h3>CheckBox</h3>
281
+
282
+ Checkboxes allow the user to select one or more items from a set.
283
+
284
+ It is extended from `@mui/material/Checkbox`, so it includes all properties of `@mui/material/Checkbox`.
285
+
286
+ <h5>Import</h5>
287
+
288
+ ```typescript
289
+ import { CheckBox } from '@symply.io/basic-components/';
290
+ // or
291
+ import { CheckBox } from '@symply.io/basic-components/CheckBox';
292
+ // or
293
+ import CheckBox from '@symply.io/basic-components/CheckBox/CheckBox';
294
+ ```
295
+
296
+ <h5>Props</h5>
297
+
298
+ | Name | Type | Default | Required | Description |
299
+ | -------- | ------------------- | ------- | -------- | ------------------------------------------------------------ |
300
+ | label | string \| ReactNode | | true | The label of the checkbox. |
301
+ | onChange | func | | true | Callback fired when the `checkbox` value is changed.<br />**Signature:**<br/>`function(value: boolean) => void`<br/>*value:* The value of the `checkbox` element. |
302
+
303
+
304
+
305
+ <h3>CheckBoxGroup</h3>
306
+
307
+ Checkboxes allow the user to select one or more items from a set for a group.
308
+
309
+ It is extended from `@mui/material/FormGroup`, so it includes all properties of `@mui/material/FormGroup`.
310
+
311
+ <h5>Import</h5>
312
+
313
+ ```typescript
314
+ import { CheckBoxGroup } from '@symply.io/basic-components/';
315
+ // or
316
+ import { CheckBoxGroup } from '@symply.io/basic-components/CheckBox';
317
+ // or
318
+ import CheckBoxGroup from '@symply.io/basic-components/CheckBox/CheckBoxGroup';
319
+ ```
320
+
321
+ <h5>Props</h5>
322
+
323
+ | Name | Type | Default | Required | Description |
324
+ | ---------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
325
+ | Checkboxes | Array\<CheckBoxProps\> | | true | The array of checkboxes.<br />See the property of [CheckBox](#checkbox) |
326
+
327
+
328
+
329
+ <h3>Copyright</h3>
330
+
331
+ A common component for rendering the copyright
332
+
333
+ <h5>Import</h5>
334
+
335
+ ```typescript
336
+ import { Copyright } from '@symply.io/basic-components/';
337
+ // or
338
+ import Copyright from '@symply.io/basic-components/Copyright';
339
+ ```
340
+
341
+
342
+
343
+ <h3>DateInput</h3>
344
+
345
+ <h4>FullDateInput</h4>
346
+
347
+ Input component for full date (MM/DD/YYYY)
348
+
349
+ <h5>Import</h5>
350
+
351
+ ```typescript
352
+ import { FullDateInput } from '@symply.io/basic-components/';
353
+ // or
354
+ import { FullDateInput } from '@symply.io/basic-components/DateInput';
355
+ // or
356
+ import FullDateInput from '@symply.io/basic-components/DateInput/FullDateInput';
357
+ ```
358
+
359
+ <h5>Props</h5>
360
+
361
+ | Name | Type | Default | Required | Description |
362
+ | ---------- | ----------------------------- | ------- | -------- | ------------------------------------------------------------ |
363
+ | error | boolean | | false | If `true`, the label is displayed in an error state. |
364
+ | helperText | string | | false | The helper text content. |
365
+ | margin | 'dense' \| 'none' \| 'normal' | 'none' | false | If `dense` or `normal`, will adjust vertical spacing of this and contained components. |
366
+ | name | string | | false | Name attribute of the `input` element. |
367
+ | onBlur | func | | false | Callback fired when the `input` is blurred. Notice that the first argument (event) might be undefined. |
368
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
369
+ | onFocus | func | | false | Callback fired when the `input` is focused. |
370
+ | onValidate | func | | false | Customized validation function. |
371
+ | value | string | | true | The value of the `Input` element. |
372
+
373
+ <h4>MonthDayInput</h4>
374
+
375
+ Input component for month day (MM/DD)
376
+
377
+ <h5>Import</h5>
378
+
379
+ ```typescript
380
+ import { MonthDayInput } from '@symply.io/basic-components/';
381
+ // or
382
+ import { MonthDayInput } from '@symply.io/basic-components/DateInput';
383
+ // or
384
+ import MonthDayInput from '@symply.io/basic-components/DateInput/MonthDayInput';
385
+ ```
386
+
387
+ <h5>Props</h5>
388
+
389
+ | Name | Type | Default | Required | Description |
390
+ | ---------- | ----------------------------- | ------- | -------- | ------------------------------------------------------------ |
391
+ | error | boolean | | false | If `true`, the label is displayed in an error state. |
392
+ | helperText | string | | false | The helper text content. |
393
+ | margin | 'dense' \| 'none' \| 'normal' | 'none' | false | If `dense` or `normal`, will adjust vertical spacing of this and contained components. |
394
+ | name | string | | false | Name attribute of the `input` element. |
395
+ | onBlur | func | | false | Callback fired when the `input` is blurred. Notice that the first argument (event) might be undefined. |
396
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
397
+ | onFocus | func | | false | Callback fired when the `input` is focused. |
398
+ | onValidate | func | | false | Customized validation function. |
399
+ | value | string | | true | The value of the `Input` element. |
400
+
401
+ <h4>MonthYearInput</h4>
402
+
403
+ Input component for month year (MM/YYYY)
404
+
405
+ <h5>Import</h5>
406
+
407
+ ```typescript
408
+ import { MonthYearInput } from '@symply.io/basic-components/';
409
+ // or
410
+ import { MonthYearInput } from '@symply.io/basic-components/DateInput';
411
+ // or
412
+ import MonthYearInput from '@symply.io/basic-components/DateInput/MonthYearInput';
413
+ ```
414
+
415
+ <h5>Props</h5>
416
+
417
+ | Name | Type | Default | Required | Description |
418
+ | ---------- | ----------------------------- | ------- | -------- | ------------------------------------------------------------ |
419
+ | error | boolean | | false | If `true`, the label is displayed in an error state. |
420
+ | helperText | string | | false | The helper text content. |
421
+ | margin | 'dense' \| 'none' \| 'normal' | 'none' | false | If `dense` or `normal`, will adjust vertical spacing of this and contained components. |
422
+ | name | string | | false | Name attribute of the `input` element. |
423
+ | onBlur | func | | false | Callback fired when the `input` is blurred. Notice that the first argument (event) might be undefined. |
424
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
425
+ | onFocus | func | | false | Callback fired when the `input` is focused. |
426
+ | onValidate | func | | false | Customized validation function. |
427
+ | value | string | | true | The value of the `Input` element. |
428
+
429
+
430
+
114
431
  <h3>DigitInput</h3>
115
432
 
116
433
  Input component for digits.
@@ -138,6 +455,30 @@ import DigitInput from '@symply.io/basic-components/DigitInput';
138
455
 
139
456
 
140
457
 
458
+ <h3>FeinInput</h3>
459
+
460
+ Input component for FEIN.
461
+
462
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
463
+
464
+ <h5>Import</h5>
465
+
466
+ ```typescript
467
+ import { FeinInput } from '@symply.io/basic-components/';
468
+ // or
469
+ import FeinInput from '@symply.io/basic-components/FeinInput';
470
+ ```
471
+
472
+ <h5>Props</h5>
473
+
474
+ | Name | Type | Default | Required | Description |
475
+ | ---------- | ------ | ------- | -------- | ------------------------------------------------------------ |
476
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
477
+ | onValidate | func | | false | Customized validation function. |
478
+ | value | string | | true | The value of the `Input` element. |
479
+
480
+
481
+
141
482
  <h3>FormRadioGroup</h3>
142
483
 
143
484
  Radio Group allow the user to select one option from a set.
@@ -165,7 +506,7 @@ import FormRadioGroup from '@symply.io/basic-components/FormRadioGroup';
165
506
  | color | 'primary' \| 'secondary' \| 'success' \| 'error' \| 'info' \| 'warning' | 'primary' | false | The main color of the component. |
166
507
  | disabled | bool | false | false | If `true`, the component is disabled. |
167
508
  | formLabel | string | | false | The label of the `Radio` element. |
168
- | onChange | func | | true | Callback fired when the `Radio` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Radio` element. |
509
+ | onChange | func | | true | Callback fired when the `Radio` value is changed.<br />**Signature:**<br/>`function(value: string|number|boolean) => void`<br/>*value:* The value of the `Radio` element. |
169
510
  | options | Array\<IRadioOption\> | | true | The radio options. See the **Radio Option Props** above. |
170
511
  | value | string \| number \| bool | | true | The value of the `Radio` element. |
171
512
  | tooltip | string | | false | A tooltip for the `Radio` element. |
@@ -352,7 +693,7 @@ import { ConfirmPassword } from '@symply.io/basic-components/PasswordInput';
352
693
  | Name | Type | Default | Required | Description |
353
694
  | ------------ | -------------------------------------------------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
354
695
  | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
355
- | onVerify | func | | false | Customized verify function when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
696
+ | onValidate | func | | false | Customized verify function when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
356
697
  | strategies | { [key: string]: { label: string, regex: RegExp }} | {<br />uppercaseLetter: { label: "1 Uppercase Letter", regex: /[A-Z]+/ },<br />lowercaseLetter: { label: "1 Lowercase Letter", regex: /[a-z]+/ },<br />specialCharacter: { label: "1 Special Character", regex: /[!"#$%&'()*+,-./:;<=>?@[\]^_`{}~]/ },<br />number: { label: "1 Number", regex: /\d+/ },<br />minimum8: { label: "Minimum 8 characters", regex: /.{8,}/ }<br />} | false | The strategies of the password |
357
698
  | successColor | Color | 'green' | false | The color of component when success. |
358
699
  | value | string | | true | The password value. |
@@ -387,10 +728,68 @@ import PhoneNumberInput from '@symply.io/basic-components/PhoneNumberInput';
387
728
  | ------------ | ------ | ------- | -------- | ------------------------------------------------------------ |
388
729
  | endAdornment | node | | false | An end adornment element for the `Input` element. |
389
730
  | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
731
+ | onValidate | func | | false | Customized validation function. |
390
732
  | value | string | | true | The value of the `Input` element. |
391
733
 
392
734
 
393
735
 
736
+ <h3>Sidebar</h3>
737
+
738
+ Sidebars for navigation.
739
+
740
+ <h5>Import</h5>
741
+
742
+ ```typescript
743
+ import { Sidebar } from '@symply.io/basic-components/';
744
+ // or
745
+ import Sidebar from '@symply.io/basic-components/Sidebar';
746
+ ```
747
+
748
+ <h5>Sidebar Item Props</h5>
749
+
750
+ | Name | Type | Default | Required | Description |
751
+ | ------------ | ------------------------- | ------------------------------------- | -------- | ------------------------------------------------------------ |
752
+ | beta | boolean | | false | If `true` the beta tag will be rendered. |
753
+ | betaTagColor | CSSProperties["color"] | \#00A2A9 | false | The value of the `Input` element. |
754
+ | children | Array\<SidebarItemProps\> | | false | If not undefined the sub sidebar items would be rendered. |
755
+ | icon | Element | | true | The icon adornment. |
756
+ | lock | boolean | | false | If `true` the lock icon will be rendered, and the sidebar item would be disabled. |
757
+ | name | string | | true | The sidebar item label. |
758
+ | path | string | | true | The link path of the sidebar item. |
759
+ | titleForLock | string | "Feature is unavailable on Free plan" | false | The tip when the lock is `true` |
760
+
761
+ <h5>Props</h5>
762
+
763
+ | Name | Type | Default | Required | Description |
764
+ | ----- | ------------------------- | ------- | -------- | -------------- |
765
+ | items | Array\<SidebarItemProps\> | | true | Sidebar items. |
766
+
767
+
768
+
769
+ <h3>SocialInput</h3>
770
+
771
+ Input component for Social Security Number (SSN).
772
+
773
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
774
+
775
+ <h5>Import</h5>
776
+
777
+ ```typescript
778
+ import { SocialInput } from '@symply.io/basic-components/';
779
+ // or
780
+ import SocialInput from '@symply.io/basic-components/SocialInput';
781
+ ```
782
+
783
+ <h5>Props</h5>
784
+
785
+ | Name | Type | Default | Required | Description |
786
+ | ---------- | ------ | ------- | -------- | ------------------------------------------------------------ |
787
+ | onChange | func | | true | Callback fired when the `Input` value is changed.<br />**Signature:**<br/>`function(value: string) => void`<br/>*value:* The value of the `Input` element. |
788
+ | onValidate | func | | false | Customized validation function. |
789
+ | value | string | | true | The value of the `Input` element. |
790
+
791
+
792
+
394
793
  <h3>TabGroup</h3>
395
794
 
396
795
  Tabs group.
@@ -415,6 +814,32 @@ import TabGroup from '@symply.io/basic-components/TabGroup';
415
814
 
416
815
 
417
816
 
817
+ <h3>TablePagination</h3>
818
+
819
+ Reusable pagination component for the material table
820
+
821
+ <h5>Import</h5>
822
+
823
+ ```typescript
824
+ import { TablePagination } from '@symply.io/basic-components/';
825
+ // or
826
+ import TablePagination from '@symply.io/basic-components/TablePagination';
827
+ ```
828
+
829
+ <h5>Props</h5>
830
+
831
+ | Name | Type | Default | Required | Description |
832
+ | ------------------- | --------------- | ------- | -------- | ------------------------------------------------------------ |
833
+ | colSpan | number | | true | The number of columns a cell should span. |
834
+ | count | number | | true | The total count of all data. |
835
+ | onPageChange | func | | true | Callback fired when the `page` value is changed.<br />**Signature:**<br/>`function(event: MouseEvent<HTMLButtonElement> ) => void,value: number`<br/>*value:* The value of the `page` . |
836
+ | onRowsPerPageChange | func | | true | Callback fired when the `Select` value is changed.<br />**Signature:**<br/>`function(event: ChangeEvent<HTMLInputElement ` |
837
+ | page | number | | true | The current page index. |
838
+ | rowsPerPage | number | | true | How many rows per page. |
839
+ | rowsPerPageOptions | Array\<number\> | | true | The options for setting how many rows per page. |
840
+
841
+
842
+
418
843
  <h3>TextInput</h3>
419
844
 
420
845
  Regular Input component.
@@ -0,0 +1,3 @@
1
+ import { SidebarItemProps } from "./types";
2
+ declare function SidebarItem(props: SidebarItemProps): JSX.Element;
3
+ export default SidebarItem;
@@ -0,0 +1,62 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import colorAlpha from "color-alpha";
14
+ import Chip from "@mui/material/Chip";
15
+ import ListItem from "@mui/material/ListItem";
16
+ import ListItemText from "@mui/material/ListItemText";
17
+ import ListItemIcon from "@mui/material/ListItemIcon";
18
+ import LockIcon from "@mui/icons-material/LockRounded";
19
+ import ChevronRightIcon from "@mui/icons-material/ChevronRight";
20
+ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
21
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
22
+ import useCustomTheme from "../useCustomTheme";
23
+ function SidebarItem(props) {
24
+ var icon = props.icon, name = props.name, active = props.active, expand = props.expand, lock = props.lock, beta = props.beta, isSub = props.isSub, hasChildren = props.hasChildren, _a = props.betaTagColor, betaTagColor = _a === void 0 ? "#00A2A9" : _a, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onClick = props.onClick;
25
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
26
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(ListItem, __assign({ button: true, onClick: onClick, disabled: lock, sx: {
27
+ paddingLeft: isSub ? theme.spacing(4) : undefined,
28
+ display: "flex",
29
+ width: "100%",
30
+ "&:hover": {
31
+ backgroundColor: colorAlpha(theme.palette.primary.main, 0.3)
32
+ },
33
+ backgroundColor: active
34
+ ? colorAlpha(theme.palette.primary.main, 0.2)
35
+ : undefined
36
+ } }, { children: [_jsx(ListItemIcon, __assign({ sx: {
37
+ color: active ? theme.palette.primary.main : undefined,
38
+ borderRadius: active ? "5px" : undefined,
39
+ opacity: active ? "1" : undefined,
40
+ fontWeight: active ? 600 : undefined
41
+ } }, { children: icon })), _jsx(ListItemText, { primaryTypographyProps: {
42
+ color: active ? theme.palette.primary.main : "textPrimary",
43
+ sx: {
44
+ overflow: "hidden",
45
+ textOverflow: "ellipsis",
46
+ whiteSpace: "nowrap",
47
+ borderRadius: active ? "5px" : undefined,
48
+ opacity: active ? "1" : undefined,
49
+ fontWeight: active ? 600 : undefined
50
+ }
51
+ }, primary: name }), lock && (_jsx(LockIcon, { fontSize: "small", color: "error", sx: {
52
+ fontSize: "1rem"
53
+ }, "data-nw": "".concat(name, "_lock") })), beta && (_jsx(Chip, { label: "BETA", color: "primary", size: "small", sx: {
54
+ borderRadius: theme.spacing(0.5),
55
+ backgroundColor: betaTagColor,
56
+ color: "white",
57
+ height: theme.spacing(2.5),
58
+ fontSize: theme.spacing(1.25),
59
+ padding: theme.spacing(0, 0.75)
60
+ } })), hasChildren && (expand ? _jsx(ExpandMoreIcon, {}) : _jsx(ChevronRightIcon, {}))] })) })));
61
+ }
62
+ export default SidebarItem;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { SidebarItemsGroupProps } from "./types";
3
+ declare function SidebarItemsGroup(props: SidebarItemsGroupProps): JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof SidebarItemsGroup>;
5
+ export default _default;
@@ -0,0 +1,38 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useState, memo, useMemo, useEffect, useCallback } from "react";
14
+ import { Match, useLocation } from "@reach/router";
15
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
16
+ import Collapse from "@mui/material/Collapse";
17
+ import List from "@mui/material/List";
18
+ import useCustomTheme from "../useCustomTheme";
19
+ import SidebarItem from "./SidebarItem";
20
+ import SidebarLink from "./SidebarLink";
21
+ function SidebarItemsGroup(props) {
22
+ var item = props.item;
23
+ var name = item.name, path = item.path, icon = item.icon, children = item.children, lock = item.lock, beta = item.beta, titleForLock = item.titleForLock, betaTagColor = item.betaTagColor, primaryColor = item.primaryColor, secondaryColor = item.secondaryColor;
24
+ var pathname = useLocation().pathname;
25
+ var match = useMemo(function () {
26
+ return pathname.includes(path);
27
+ }, [path, pathname]);
28
+ var _a = useState(match), expand = _a[0], setExpand = _a[1];
29
+ var onToggleExpand = useCallback(function () {
30
+ setExpand(function (v) { return !v; });
31
+ }, []);
32
+ useEffect(function () {
33
+ setExpand(match);
34
+ }, [match]);
35
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
36
+ return (_jsxs(ThemeProvider, __assign({ theme: theme }, { children: [_jsx(List, __assign({ component: "div", disablePadding: true }, { children: _jsx(SidebarItem, { active: false, name: name, icon: icon, lock: lock, beta: beta, expand: expand, hasChildren: true, betaTagColor: betaTagColor, primaryColor: primaryColor, secondaryColor: secondaryColor, onClick: onToggleExpand }) })), children && (_jsx(Collapse, __assign({ in: expand, timeout: "auto" }, { children: _jsx(List, __assign({ component: "div", disablePadding: true }, { children: children.map(function (c) { return (_jsx(Match, __assign({ path: c.path }, { children: function (prop) { return (_jsx(SidebarLink, { name: c.name, path: c.path, icon: c.icon, lock: c.lock, beta: c.beta, titleForLock: titleForLock, active: prop.match !== null, betaTagColor: c.betaTagColor, primaryColor: c.primaryColor, secondaryColor: c.secondaryColor, isSub: true })); } }), c.name)); }) })) })))] })));
37
+ }
38
+ export default memo(SidebarItemsGroup);
@@ -0,0 +1,3 @@
1
+ import { SidebarLinkProps } from "./types";
2
+ declare function SidebarLink(props: SidebarLinkProps): JSX.Element;
3
+ export default SidebarLink;