@symply.io/basic-components 1.0.0-alpha.8 → 1.0.0-beta.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 (123) 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 +15 -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 +54 -0
  11. package/AutocompleteWithFilter/types.d.ts +16 -0
  12. package/AutocompleteWithFilter/types.js +1 -0
  13. package/BasicModal/Content.d.ts +0 -1
  14. package/BasicModal/Content.js +1 -1
  15. package/BasicModal/index.d.ts +0 -1
  16. package/BasicModal/index.js +3 -6
  17. package/BreadCrumbs/index.d.ts +4 -0
  18. package/BreadCrumbs/index.js +37 -0
  19. package/BreadCrumbs/types.d.ts +9 -0
  20. package/BreadCrumbs/types.js +1 -0
  21. package/CheckBox/CheckBox.d.ts +3 -0
  22. package/CheckBox/CheckBox.js +36 -0
  23. package/CheckBox/CheckBoxGroup.d.ts +3 -0
  24. package/CheckBox/CheckBoxGroup.js +30 -0
  25. package/CheckBox/index.d.ts +3 -0
  26. package/CheckBox/index.js +3 -0
  27. package/CheckBox/types.d.ts +12 -0
  28. package/CheckBox/types.js +1 -0
  29. package/Copyright/index.d.ts +4 -0
  30. package/Copyright/index.js +25 -0
  31. package/Copyright/types.d.ts +5 -0
  32. package/Copyright/types.js +1 -0
  33. package/DateInput/FullDateInput/index.d.ts +5 -0
  34. package/DateInput/FullDateInput/index.js +66 -0
  35. package/DateInput/FullDateInput/types.d.ts +14 -0
  36. package/DateInput/FullDateInput/types.js +1 -0
  37. package/DateInput/FullDateInput/useInteractions.d.ts +8 -0
  38. package/DateInput/FullDateInput/useInteractions.js +20 -0
  39. package/DateInput/MonthDayInput/index.d.ts +5 -0
  40. package/DateInput/MonthDayInput/index.js +54 -0
  41. package/DateInput/MonthDayInput/types.d.ts +14 -0
  42. package/DateInput/MonthDayInput/types.js +1 -0
  43. package/DateInput/MonthDayInput/useInteractions.d.ts +8 -0
  44. package/DateInput/MonthDayInput/useInteractions.js +19 -0
  45. package/DateInput/MonthYearInput/index.d.ts +5 -0
  46. package/DateInput/MonthYearInput/index.js +55 -0
  47. package/DateInput/MonthYearInput/types.d.ts +14 -0
  48. package/DateInput/MonthYearInput/types.js +1 -0
  49. package/DateInput/MonthYearInput/useInteractions.d.ts +8 -0
  50. package/DateInput/MonthYearInput/useInteractions.js +19 -0
  51. package/DateInput/index.d.ts +6 -0
  52. package/DateInput/index.js +6 -0
  53. package/DigitInput/index.d.ts +1 -4
  54. package/DigitInput/index.js +3 -3
  55. package/DigitInput/types.d.ts +2 -1
  56. package/DynamicHeaderBar/HeaderBar.js +1 -1
  57. package/DynamicHeaderBar/HeaderButtons.d.ts +0 -1
  58. package/DynamicHeaderBar/HeaderButtons.js +5 -5
  59. package/DynamicHeaderBar/HeaderLine.js +1 -1
  60. package/DynamicHeaderBar/index.js +2 -2
  61. package/FeinInput/index.d.ts +6 -0
  62. package/FeinInput/index.js +73 -0
  63. package/FeinInput/types.d.ts +9 -0
  64. package/FeinInput/types.js +1 -0
  65. package/FeinInput/useInteractions.d.ts +8 -0
  66. package/FeinInput/useInteractions.js +16 -0
  67. package/FormRadioGroup/index.d.ts +0 -1
  68. package/FormRadioGroup/index.js +3 -3
  69. package/FormSelector/MultipleSelector.d.ts +0 -1
  70. package/FormSelector/MultipleSelector.js +14 -3
  71. package/FormSelector/SimpleSelector.d.ts +0 -1
  72. package/FormSelector/SimpleSelector.js +3 -3
  73. package/FormSelector/types.d.ts +2 -7
  74. package/HelpCaption/index.js +2 -2
  75. package/LoadingModal/index.d.ts +0 -1
  76. package/LoadingModal/index.js +1 -1
  77. package/MenuButtonGroup/MenuItem.d.ts +0 -1
  78. package/MenuButtonGroup/MenuItem.js +1 -1
  79. package/MenuButtonGroup/index.js +2 -2
  80. package/NumberInput/index.d.ts +2 -3
  81. package/NumberInput/index.js +1 -1
  82. package/PasswordInput/ConfirmPassword.d.ts +2 -3
  83. package/PasswordInput/ConfirmPassword.js +1 -1
  84. package/PasswordInput/Password.d.ts +3 -4
  85. package/PasswordInput/Password.js +2 -2
  86. package/PhoneNumberInput/index.d.ts +2 -3
  87. package/PhoneNumberInput/index.js +2 -2
  88. package/README.md +380 -14
  89. package/Sidebar/SidebarItem.d.ts +3 -0
  90. package/Sidebar/SidebarItem.js +62 -0
  91. package/Sidebar/SidebarItemsGroup.d.ts +5 -0
  92. package/Sidebar/SidebarItemsGroup.js +38 -0
  93. package/Sidebar/SidebarLink.d.ts +3 -0
  94. package/Sidebar/SidebarLink.js +37 -0
  95. package/Sidebar/index.d.ts +7 -0
  96. package/Sidebar/index.js +30 -0
  97. package/Sidebar/types.d.ts +31 -0
  98. package/Sidebar/types.js +1 -0
  99. package/SocialInput/index.d.ts +6 -0
  100. package/SocialInput/index.js +76 -0
  101. package/SocialInput/types.d.ts +9 -0
  102. package/SocialInput/types.js +1 -0
  103. package/SocialInput/useInteractions.d.ts +10 -0
  104. package/SocialInput/useInteractions.js +26 -0
  105. package/TabGroup/index.js +10 -5
  106. package/TablePagination/Actions.d.ts +3 -0
  107. package/TablePagination/Actions.js +27 -0
  108. package/TablePagination/index.d.ts +4 -0
  109. package/TablePagination/index.js +30 -0
  110. package/TablePagination/types.d.ts +14 -0
  111. package/TablePagination/types.js +1 -0
  112. package/TablePagination/useInteractions.d.ts +14 -0
  113. package/TablePagination/useInteractions.js +23 -0
  114. package/TextInput/index.d.ts +2 -3
  115. package/TextInput/index.js +13 -3
  116. package/ToastPrompt/Presentation.js +3 -3
  117. package/ToastPrompt/index.js +1 -1
  118. package/VideoPlayerModal/index.d.ts +1 -3
  119. package/VideoPlayerModal/index.js +2 -2
  120. package/VideoPlayerModal/types.d.ts +2 -1
  121. package/index.d.ts +18 -0
  122. package/index.js +18 -0
  123. package/package.json +8 -2
package/README.md CHANGED
@@ -12,8 +12,19 @@
12
12
  - [License](#license)
13
13
  - [Components](#components)
14
14
  - [AlertDialog](#alertdialog)
15
+ - [Autocomplete](#autocomplete)
16
+ - [AutocompleteWithFilter](#autocompletewithfilter)
15
17
  - [BasicModal](#basicmodal)
18
+ - [BreadCrumbs](#breadcrumbs)
19
+ - [CheckBox](#checkbox)
20
+ - [CheckBoxGroup](#checkboxgroup)
21
+ - [Copyright](#copyright)
22
+ - [DateInput](#dateinput)
23
+ - [FullDateInput](#fulldateinput)
24
+ - [MonthDayInput](#monthdayinput)
25
+ - [MonthYearInput](#monthyearinput)
16
26
  - [DigitInput](#digitinput)
27
+ - [FeinInput](#feininput)
17
28
  - [FormRadioGroup](#formradiogroup)
18
29
  - [FormSelector](#formselector)
19
30
  - [HelpCaption](#helpcaption)
@@ -22,7 +33,10 @@
22
33
  - [NumberInput](#numberinput)
23
34
  - [PasswordInput](#passwordinput)
24
35
  - [PhoneNumberInput](#phonenumberinput)
36
+ - [Sidebar](#sidebar)
37
+ - [SocialInput](#socialinput)
25
38
  - [TabGroup](#tabgroup)
39
+ - [TablePagination](#tablepagination)
26
40
  - [TextInput](#textinput)
27
41
  - [ToastPrompt](#toastprompt)
28
42
  - [VideoPlayerModal](#videoplayermodal)
@@ -46,7 +60,18 @@ yarn add @symply.io/basic-components
46
60
 
47
61
  <h2>License</h2>
48
62
 
49
- This project is licensed under the terms of the [MIT license](https://github.com/rinxun/symply-basic-components/blob/main/LICENSE).
63
+ This project is licensed under the terms of the [MIT license](https://github.com/baseline-software/symply-basic-components/blob/main/LICENSE).
64
+
65
+
66
+
67
+ <h2>Common Properties</h2>
68
+
69
+ All components include these 2 properties to customize the theme
70
+
71
+ | Name | Type | Default | Required | Description |
72
+ | -------------- | ---------------------- | ------- | -------- | ----------------------------- |
73
+ | primaryColor | CSSProperties["color"] | | false | Primary color for the theme |
74
+ | secondaryColor | CSSProperties["color"] | | false | Secondary color for the theme |
50
75
 
51
76
 
52
77
 
@@ -77,6 +102,71 @@ import AlertDialog from '@symply.io/basic-components/AlertDialog';
77
102
 
78
103
 
79
104
 
105
+ <h3>Autocomplete</h3>
106
+
107
+ A normal text input enhanced by a panel of suggested options.
108
+
109
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
110
+
111
+ <h5>Import</h5>
112
+
113
+ ```typescript
114
+ import { Autocomplete } from '@symply.io/basic-components/';
115
+ // or
116
+ import Autocomplete from '@symply.io/basic-components/Autocomplete';
117
+ ```
118
+
119
+ <h5>Option Props (IOption)</h5>
120
+
121
+ | Name | Type | Default | Required | Description |
122
+ | ------ | ------- | ------- | -------- | -------------------------- |
123
+ | label | string | | true | Option label. |
124
+ | [name] | Unknown | | false | Customized option property |
125
+
126
+ <h5>Props</h5>
127
+
128
+ | Name | Type | Default | Required | Description |
129
+ | -------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
130
+ | multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
131
+ | 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. |
132
+ | options | Array<IOption\|string> | | true | Array of suggestion options. |
133
+ | value | string | | true | The value of the `Input` element. |
134
+
135
+
136
+
137
+ <h3>AutocompleteWithFilter</h3>
138
+
139
+ A normal text input enhanced by a panel of suggested options and filter.
140
+
141
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
142
+
143
+ <h5>Import</h5>
144
+
145
+ ```typescript
146
+ import { AutocompleteWithFilter } from '@symply.io/basic-components/';
147
+ // or
148
+ import AutocompleteWithFilter from '@symply.io/basic-components/AutocompleteWithFilter';
149
+ ```
150
+
151
+ <h5>Option Props (IOption)</h5>
152
+
153
+ | Name | Type | Default | Required | Description |
154
+ | ------ | ------- | ------- | -------- | -------------------------- |
155
+ | label | string | | true | Option label. |
156
+ | [name] | Unknown | | false | Customized option property |
157
+
158
+ <h5>Props</h5>
159
+
160
+ | Name | Type | Default | Required | Description |
161
+ | -------------------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
162
+ | disableCloseOnSelect | bool | false | false | If `true`, the popup won't close when a value is selected. |
163
+ | multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
164
+ | 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. |
165
+ | options | Array<IOption\|string> | | true | Array of suggestion options. |
166
+ | value | string | | true | The value of the `Input` element. |
167
+
168
+
169
+
80
170
  <h3>BasicModal</h3>
81
171
 
82
172
  Reusable modal component.
@@ -111,6 +201,177 @@ import BasicModal from '@symply.io/basic-components/BasicModal';
111
201
 
112
202
 
113
203
 
204
+ <h3>BreadCrumbs</h3>
205
+
206
+ 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".
207
+
208
+ <h5>Import</h5>
209
+
210
+ ```typescript
211
+ import { BreadCrumbs } from '@symply.io/basic-components/';
212
+ // or
213
+ import BreadCrumbs from '@symply.io/basic-components/BreadCrumbs';
214
+ ```
215
+
216
+ <h5>Props</h5>
217
+
218
+ | Name | Type | Default | Required | Description |
219
+ | ------ | --------------------------------------- | ------- | -------- | ------------------------- |
220
+ | routes | Array<{ href?: string; label: string }> | | true | All routes of "ancestors" |
221
+
222
+
223
+
224
+ <h3>CheckBox</h3>
225
+
226
+ Checkboxes allow the user to select one or more items from a set.
227
+
228
+ It is extended from `@mui/material/Checkbox`, so it includes all properties of `@mui/material/Checkbox`.
229
+
230
+ <h5>Import</h5>
231
+
232
+ ```typescript
233
+ import { CheckBox } from '@symply.io/basic-components/';
234
+ // or
235
+ import { CheckBox } from '@symply.io/basic-components/CheckBox';
236
+ // or
237
+ import CheckBox from '@symply.io/basic-components/CheckBox/CheckBox';
238
+ ```
239
+
240
+ <h5>Props</h5>
241
+
242
+ | Name | Type | Default | Required | Description |
243
+ | -------- | ------------------- | ------- | -------- | ------------------------------------------------------------ |
244
+ | label | string \| ReactNode | | true | The label of the checkbox. |
245
+ | 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. |
246
+
247
+
248
+
249
+ <h3>CheckBoxGroup</h3>
250
+
251
+ Checkboxes allow the user to select one or more items from a set for a group.
252
+
253
+ It is extended from `@mui/material/FormGroup`, so it includes all properties of `@mui/material/FormGroup`.
254
+
255
+ <h5>Import</h5>
256
+
257
+ ```typescript
258
+ import { CheckBoxGroup } from '@symply.io/basic-components/';
259
+ // or
260
+ import { CheckBoxGroup } from '@symply.io/basic-components/CheckBox';
261
+ // or
262
+ import CheckBoxGroup from '@symply.io/basic-components/CheckBox/CheckBoxGroup';
263
+ ```
264
+
265
+ <h5>Props</h5>
266
+
267
+ | Name | Type | Default | Required | Description |
268
+ | ---------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
269
+ | Checkboxes | Array\<CheckBoxProps\> | | true | The array of checkboxes.<br />See the property of [CheckBox](#checkbox) |
270
+
271
+
272
+
273
+ <h3>Copyright</h3>
274
+
275
+ A common component for rendering the copyright
276
+
277
+ <h5>Import</h5>
278
+
279
+ ```typescript
280
+ import { Copyright } from '@symply.io/basic-components/';
281
+ // or
282
+ import Copyright from '@symply.io/basic-components/Copyright';
283
+ ```
284
+
285
+
286
+
287
+ <h3>DateInput</h3>
288
+
289
+ <h4>FullDateInput</h4>
290
+
291
+ Input component for full date (MM/DD/YYYY)
292
+
293
+ <h5>Import</h5>
294
+
295
+ ```typescript
296
+ import { FullDateInput } from '@symply.io/basic-components/';
297
+ // or
298
+ import { FullDateInput } from '@symply.io/basic-components/DateInput';
299
+ // or
300
+ import FullDateInput from '@symply.io/basic-components/DateInput/FullDateInput';
301
+ ```
302
+
303
+ <h5>Props</h5>
304
+
305
+ | Name | Type | Default | Required | Description |
306
+ | ---------- | ----------------------------- | ------- | -------- | ------------------------------------------------------------ |
307
+ | error | boolean | | false | If `true`, the label is displayed in an error state. |
308
+ | helperText | string | | false | The helper text content. |
309
+ | margin | 'dense' \| 'none' \| 'normal' | 'none' | false | If `dense` or `normal`, will adjust vertical spacing of this and contained components. |
310
+ | name | string | | false | Name attribute of the `input` element. |
311
+ | onBlur | func | | false | Callback fired when the `input` is blurred. Notice that the first argument (event) might be undefined. |
312
+ | 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. |
313
+ | onFocus | func | | false | Callback fired when the `input` is focused. |
314
+ | value | string | | true | The value of the `Input` element. |
315
+ | verifyFn | func | | false | Customized verification function. |
316
+
317
+ <h4>MonthDayInput</h4>
318
+
319
+ Input component for month day (MM/DD)
320
+
321
+ <h5>Import</h5>
322
+
323
+ ```typescript
324
+ import { MonthDayInput } from '@symply.io/basic-components/';
325
+ // or
326
+ import { MonthDayInput } from '@symply.io/basic-components/DateInput';
327
+ // or
328
+ import MonthDayInput from '@symply.io/basic-components/DateInput/MonthDayInput';
329
+ ```
330
+
331
+ <h5>Props</h5>
332
+
333
+ | Name | Type | Default | Required | Description |
334
+ | ---------- | ----------------------------- | ------- | -------- | ------------------------------------------------------------ |
335
+ | error | boolean | | false | If `true`, the label is displayed in an error state. |
336
+ | helperText | string | | false | The helper text content. |
337
+ | margin | 'dense' \| 'none' \| 'normal' | 'none' | false | If `dense` or `normal`, will adjust vertical spacing of this and contained components. |
338
+ | name | string | | false | Name attribute of the `input` element. |
339
+ | onBlur | func | | false | Callback fired when the `input` is blurred. Notice that the first argument (event) might be undefined. |
340
+ | 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. |
341
+ | onFocus | func | | false | Callback fired when the `input` is focused. |
342
+ | value | string | | true | The value of the `Input` element. |
343
+ | verifyFn | func | | false | Customized verification function. |
344
+
345
+ <h4>MonthYearInput</h4>
346
+
347
+ Input component for month year (MM/YYYY)
348
+
349
+ <h5>Import</h5>
350
+
351
+ ```typescript
352
+ import { MonthYearInput } from '@symply.io/basic-components/';
353
+ // or
354
+ import { MonthYearInput } from '@symply.io/basic-components/DateInput';
355
+ // or
356
+ import MonthYearInput from '@symply.io/basic-components/DateInput/MonthYearInput';
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
+ | value | string | | true | The value of the `Input` element. |
371
+ | verifyFn | func | | false | Customized verification function. |
372
+
373
+
374
+
114
375
  <h3>DigitInput</h3>
115
376
 
116
377
  Input component for digits.
@@ -138,6 +399,30 @@ import DigitInput from '@symply.io/basic-components/DigitInput';
138
399
 
139
400
 
140
401
 
402
+ <h3>FeinInput</h3>
403
+
404
+ Input component for FEIN.
405
+
406
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
407
+
408
+ <h5>Import</h5>
409
+
410
+ ```typescript
411
+ import { FeinInput } from '@symply.io/basic-components/';
412
+ // or
413
+ import FeinInput from '@symply.io/basic-components/FeinInput';
414
+ ```
415
+
416
+ <h5>Props</h5>
417
+
418
+ | Name | Type | Default | Required | Description |
419
+ | -------- | ------ | ------- | -------- | ------------------------------------------------------------ |
420
+ | 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. |
421
+ | value | string | | true | The value of the `Input` element. |
422
+ | verifyFn | func | | false | Customized verification function. |
423
+
424
+
425
+
141
426
  <h3>FormRadioGroup</h3>
142
427
 
143
428
  Radio Group allow the user to select one option from a set.
@@ -165,7 +450,7 @@ import FormRadioGroup from '@symply.io/basic-components/FormRadioGroup';
165
450
  | color | 'primary' \| 'secondary' \| 'success' \| 'error' \| 'info' \| 'warning' | 'primary' | false | The main color of the component. |
166
451
  | disabled | bool | false | false | If `true`, the component is disabled. |
167
452
  | 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. |
453
+ | 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
454
  | options | Array\<IRadioOption\> | | true | The radio options. See the **Radio Option Props** above. |
170
455
  | value | string \| number \| bool | | true | The value of the `Radio` element. |
171
456
  | tooltip | string | | false | A tooltip for the `Radio` element. |
@@ -195,18 +480,16 @@ import { MultipleSelector } from '@symply.io/basic-components/FormRadioGroup';
195
480
 
196
481
  <h5>Base Props</h5>
197
482
 
198
- | Name | Type | Default | Required | Description |
199
- | -------------- | ------------------------------------- | ---------- | -------- | ----------------------------------------------------------- |
200
- | disabled | bool | false | false | If `true`, the component is disabled. |
201
- | error | bool | false | false | If `true`, the component would be shown with red color. |
202
- | helperText | string | | false | The helper text of the `Select` element. |
203
- | label | string | | false | The label of `Select` element. |
204
- | multiple | bool | false | false | If `true`, you can select more than 1 option. |
205
- | name | string | | false | The name of the `Select` element. |
206
- | options | Array\<IRadioOption\> | | true | The radio options. See the **Selector Option Props** above. |
207
- | showHelperText | bool | false | False | If `true`, show the helper text. |
208
- | tooltip | string | | false | A tooltip for the `Select` element. |
209
- | variant | 'filled' \| 'contained' \| 'outlined' | 'outlined' | false | The variant of the `Select` element. |
483
+ It is extended from `@mui/material/FormControl`, so it includes all properties of `@mui/material/FormControl`.
484
+
485
+ | Name | Type | Default | Required | Description |
486
+ | -------------- | --------------------- | ------- | -------- | ----------------------------------------------------------- |
487
+ | helperText | string | | false | The helper text of the `Select` element. |
488
+ | label | string | | false | The label of `Select` element. |
489
+ | multiple | bool | false | false | If `true`, you can select more than 1 option. |
490
+ | options | Array\<IRadioOption\> | | true | The radio options. See the **Selector Option Props** above. |
491
+ | showHelperText | bool | false | False | If `true`, show the helper text. |
492
+ | tooltip | string | | false | A tooltip for the `Select` element. |
210
493
 
211
494
  <h5>Simple Selector Props</h5> Extended from the Base Props
212
495
 
@@ -393,6 +676,63 @@ import PhoneNumberInput from '@symply.io/basic-components/PhoneNumberInput';
393
676
 
394
677
 
395
678
 
679
+ <h3>Sidebar</h3>
680
+
681
+ Sidebars for navigation.
682
+
683
+ <h5>Import</h5>
684
+
685
+ ```typescript
686
+ import { Sidebar } from '@symply.io/basic-components/';
687
+ // or
688
+ import Sidebar from '@symply.io/basic-components/Sidebar';
689
+ ```
690
+
691
+ <h5>Sidebar Item Props</h5>
692
+
693
+ | Name | Type | Default | Required | Description |
694
+ | ------------ | ------------------------- | ------------------------------------- | -------- | ------------------------------------------------------------ |
695
+ | beta | boolean | | false | If `true` the beta tag will be rendered. |
696
+ | betaTagColor | CSSProperties["color"] | \#00A2A9 | false | The value of the `Input` element. |
697
+ | children | Array\<SidebarItemProps\> | | false | If not undefined the sub sidebar items would be rendered. |
698
+ | icon | Element | | true | The icon adornment. |
699
+ | lock | boolean | | false | If `true` the lock icon will be rendered, and the sidebar item would be disabled. |
700
+ | name | string | | true | The sidebar item label. |
701
+ | path | string | | true | The link path of the sidebar item. |
702
+ | titleForLock | string | "Feature is unavailable on Free plan" | false | The tip when the lock is `true` |
703
+
704
+ <h5>Props</h5>
705
+
706
+ | Name | Type | Default | Required | Description |
707
+ | ----- | ------------------------- | ------- | -------- | -------------- |
708
+ | items | Array\<SidebarItemProps\> | | true | Sidebar items. |
709
+
710
+
711
+
712
+ <h3>SocialInput</h3>
713
+
714
+ Input component for Social Security Number (SSN).
715
+
716
+ It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
717
+
718
+ <h5>Import</h5>
719
+
720
+ ```typescript
721
+ import { SocialInput } from '@symply.io/basic-components/';
722
+ // or
723
+ import SocialInput from '@symply.io/basic-components/SocialInput';
724
+ ```
725
+
726
+ <h5>Props</h5>
727
+
728
+ | Name | Type | Default | Required | Description |
729
+ | -------- | ------ | ------- | -------- | ------------------------------------------------------------ |
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
+ | value | string | | true | The value of the `Input` element. |
732
+ | verifyFn | func | | false | Customized verification function. |
733
+
734
+
735
+
396
736
  <h3>TabGroup</h3>
397
737
 
398
738
  Tabs group.
@@ -417,6 +757,32 @@ import TabGroup from '@symply.io/basic-components/TabGroup';
417
757
 
418
758
 
419
759
 
760
+ <h3>TablePagination</h3>
761
+
762
+ Reusable pagination component for the material table
763
+
764
+ <h5>Import</h5>
765
+
766
+ ```typescript
767
+ import { TablePagination } from '@symply.io/basic-components/';
768
+ // or
769
+ import TablePagination from '@symply.io/basic-components/TablePagination';
770
+ ```
771
+
772
+ <h5>Props</h5>
773
+
774
+ | Name | Type | Default | Required | Description |
775
+ | ------------------- | --------------- | ------- | -------- | ------------------------------------------------------------ |
776
+ | colSpan | number | | true | The number of columns a cell should span. |
777
+ | count | number | | true | The total count of all data. |
778
+ | 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` . |
779
+ | onRowsPerPageChange | func | | true | Callback fired when the `Select` value is changed.<br />**Signature:**<br/>`function(event: ChangeEvent<HTMLInputElement ` |
780
+ | page | number | | true | The current page index. |
781
+ | rowsPerPage | number | | true | How many rows per page. |
782
+ | rowsPerPageOptions | Array\<number\> | | true | The options for setting how many rows per page. |
783
+
784
+
785
+
420
786
  <h3>TextInput</h3>
421
787
 
422
788
  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;
@@ -0,0 +1,37 @@
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { Link, useLocation } from "@reach/router";
25
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
26
+ import useCustomTheme from "../useCustomTheme";
27
+ import SidebarItem from "./SidebarItem";
28
+ function SidebarLink(props) {
29
+ var pathname = useLocation().pathname;
30
+ var name = props.name, path = props.path, icon = props.icon, lock = props.lock, beta = props.beta, active = props.active, titleForLock = props.titleForLock, betaTagColor = props.betaTagColor, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["name", "path", "icon", "lock", "beta", "active", "titleForLock", "betaTagColor", "primaryColor", "secondaryColor"]);
31
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
32
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Link, __assign({ to: lock ? pathname : path, title: lock ? titleForLock || "Feature is unavailable on Free plan" : name, style: {
33
+ color: primaryColor || theme.palette.primary.main,
34
+ textDecoration: "none"
35
+ } }, { children: _jsx(SidebarItem, __assign({ name: name, icon: icon, lock: lock, beta: beta, active: active, betaTagColor: betaTagColor, primaryColor: primaryColor, secondaryColor: secondaryColor }, rest), name) })) })));
36
+ }
37
+ export default SidebarLink;
@@ -0,0 +1,7 @@
1
+ import SidebarItem from "./SidebarItem";
2
+ import SidebarItemsGroup from "./SidebarItemsGroup";
3
+ import { SidebarProps } from "./types";
4
+ declare function Sidebar(props: SidebarProps): JSX.Element;
5
+ export default Sidebar;
6
+ export { SidebarItem, SidebarItemsGroup };
7
+ export * from "./types";