@symply.io/basic-components 1.0.0-alpha.2 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AlertDialog/index.d.ts +0 -1
- package/AlertDialog/index.js +10 -9
- package/AlertDialog/types.d.ts +3 -1
- package/Autocomplete/index.d.ts +4 -0
- package/Autocomplete/index.js +38 -0
- package/Autocomplete/types.d.ts +15 -0
- package/Autocomplete/types.js +1 -0
- package/Autocomplete/useInteractions.d.ts +5 -0
- package/Autocomplete/useInteractions.js +9 -0
- package/AutocompleteWithFilter/index.d.ts +4 -0
- package/AutocompleteWithFilter/index.js +54 -0
- package/AutocompleteWithFilter/types.d.ts +16 -0
- package/AutocompleteWithFilter/types.js +1 -0
- package/BasicModal/Content.d.ts +0 -1
- package/BasicModal/Content.js +1 -1
- package/BasicModal/index.d.ts +0 -1
- package/BasicModal/index.js +16 -18
- package/BasicModal/types.d.ts +3 -1
- package/BreadCrumbs/index.d.ts +4 -0
- package/BreadCrumbs/index.js +37 -0
- package/BreadCrumbs/types.d.ts +9 -0
- package/BreadCrumbs/types.js +1 -0
- package/CheckBox/CheckBox.d.ts +3 -0
- package/CheckBox/CheckBox.js +36 -0
- package/CheckBox/CheckBoxGroup.d.ts +3 -0
- package/CheckBox/CheckBoxGroup.js +30 -0
- package/CheckBox/index.d.ts +3 -0
- package/CheckBox/index.js +3 -0
- package/CheckBox/types.d.ts +12 -0
- package/CheckBox/types.js +1 -0
- package/Copyright/index.d.ts +4 -0
- package/Copyright/index.js +25 -0
- package/Copyright/types.d.ts +5 -0
- package/Copyright/types.js +1 -0
- package/DigitInput/index.d.ts +1 -4
- package/DigitInput/index.js +7 -4
- package/DigitInput/types.d.ts +5 -1
- package/DynamicHeaderBar/HeaderBar.d.ts +2 -0
- package/DynamicHeaderBar/HeaderBar.js +7 -6
- package/DynamicHeaderBar/HeaderButtons.d.ts +0 -1
- package/DynamicHeaderBar/HeaderButtons.js +20 -19
- package/DynamicHeaderBar/HeaderLine.js +4 -4
- package/DynamicHeaderBar/index.js +2 -2
- package/FeinInput/index.d.ts +6 -0
- package/FeinInput/index.js +73 -0
- package/FeinInput/types.d.ts +9 -0
- package/FeinInput/types.js +1 -0
- package/FeinInput/useInteractions.d.ts +8 -0
- package/FeinInput/useInteractions.js +16 -0
- package/FormRadioGroup/index.d.ts +0 -1
- package/FormRadioGroup/index.js +15 -12
- package/FormRadioGroup/types.d.ts +3 -0
- package/FormSelector/MultipleSelector.d.ts +0 -1
- package/FormSelector/MultipleSelector.js +25 -11
- package/FormSelector/SimpleSelector.d.ts +0 -1
- package/FormSelector/SimpleSelector.js +25 -11
- package/FormSelector/types.d.ts +7 -8
- package/HelpCaption/index.d.ts +3 -1
- package/HelpCaption/index.js +15 -14
- package/LoadingModal/index.d.ts +0 -1
- package/LoadingModal/index.js +8 -5
- package/LoadingModal/types.d.ts +3 -0
- package/MenuButtonGroup/MenuItem.d.ts +1 -3
- package/MenuButtonGroup/MenuItem.js +5 -3
- package/MenuButtonGroup/index.d.ts +3 -1
- package/MenuButtonGroup/index.js +9 -6
- package/NumberInput/index.d.ts +5 -4
- package/NumberInput/index.js +8 -5
- package/PasswordInput/ConfirmPassword.d.ts +5 -4
- package/PasswordInput/ConfirmPassword.js +10 -7
- package/PasswordInput/Password.d.ts +5 -4
- package/PasswordInput/Password.js +18 -10
- package/PhoneNumberInput/index.d.ts +6 -4
- package/PhoneNumberInput/index.js +25 -7
- package/PhoneNumberInput/useInteractions.d.ts +0 -1
- package/PhoneNumberInput/useInteractions.js +1 -14
- package/README.md +261 -45
- package/TabGroup/index.js +26 -20
- package/TabGroup/types.d.ts +3 -0
- package/TablePagination/Actions.d.ts +3 -0
- package/TablePagination/Actions.js +27 -0
- package/TablePagination/index.d.ts +4 -0
- package/TablePagination/index.js +30 -0
- package/TablePagination/types.d.ts +14 -0
- package/TablePagination/types.js +1 -0
- package/TablePagination/useInteractions.d.ts +14 -0
- package/TablePagination/useInteractions.js +23 -0
- package/TextInput/index.d.ts +5 -4
- package/TextInput/index.js +18 -5
- package/ToastPrompt/Presentation.js +28 -27
- package/ToastPrompt/index.js +1 -1
- package/VideoPlayerModal/index.d.ts +1 -3
- package/VideoPlayerModal/index.js +8 -7
- package/VideoPlayerModal/types.d.ts +5 -1
- package/index.d.ts +13 -0
- package/index.js +13 -0
- package/package.json +9 -2
- package/useCustomTheme.d.ts +6 -0
- package/useCustomTheme.js +51 -0
package/README.md
CHANGED
@@ -12,8 +12,15 @@
|
|
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)
|
16
22
|
- [DigitInput](#digitinput)
|
23
|
+
- [FeinInput](#feininput)
|
17
24
|
- [FormRadioGroup](#formradiogroup)
|
18
25
|
- [FormSelector](#formselector)
|
19
26
|
- [HelpCaption](#helpcaption)
|
@@ -23,6 +30,8 @@
|
|
23
30
|
- [PasswordInput](#passwordinput)
|
24
31
|
- [PhoneNumberInput](#phonenumberinput)
|
25
32
|
- [TabGroup](#tabgroup)
|
33
|
+
- [TablePagination](#tablepagination)
|
34
|
+
- [TextInput](#textinput)
|
26
35
|
- [ToastPrompt](#toastprompt)
|
27
36
|
- [VideoPlayerModal](#videoplayermodal)
|
28
37
|
- [Changelog](#changelog)
|
@@ -33,7 +42,7 @@
|
|
33
42
|
|
34
43
|
It is available as an [npm package](https://www.npmjs.com/package/@symply.io/basic-components).
|
35
44
|
|
36
|
-
```
|
45
|
+
```shell
|
37
46
|
// with npm
|
38
47
|
npm install @symply.io/basic-components
|
39
48
|
|
@@ -45,7 +54,18 @@ yarn add @symply.io/basic-components
|
|
45
54
|
|
46
55
|
<h2>License</h2>
|
47
56
|
|
48
|
-
This project is licensed under the terms of the [MIT license](https://github.com/
|
57
|
+
This project is licensed under the terms of the [MIT license](https://github.com/baseline-software/symply-basic-components/blob/main/LICENSE).
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<h2>Common Properties</h2>
|
62
|
+
|
63
|
+
All components include these 2 properties to customize the theme
|
64
|
+
|
65
|
+
| Name | Type | Default | Required | Description |
|
66
|
+
| -------------- | ---------------------- | ------- | -------- | ----------------------------- |
|
67
|
+
| primaryColor | CSSProperties["color"] | | false | Primary color for the theme |
|
68
|
+
| secondaryColor | CSSProperties["color"] | | false | Secondary color for the theme |
|
49
69
|
|
50
70
|
|
51
71
|
|
@@ -58,9 +78,9 @@ Diglog component for alerts or confirmations.
|
|
58
78
|
<h5>Import</h5>
|
59
79
|
|
60
80
|
```typescript
|
61
|
-
import { AlertDialog } from '@symply.io/
|
81
|
+
import { AlertDialog } from '@symply.io/basic-components/';
|
62
82
|
// or
|
63
|
-
import AlertDialog from '@symply.io/
|
83
|
+
import AlertDialog from '@symply.io/basic-components/AlertDialog';
|
64
84
|
```
|
65
85
|
|
66
86
|
<h5>Props</h5>
|
@@ -76,6 +96,71 @@ import AlertDialog from '@symply.io/symply-basic-components/AlertDialog';
|
|
76
96
|
|
77
97
|
|
78
98
|
|
99
|
+
<h3>Autocomplete</h3>
|
100
|
+
|
101
|
+
A normal text input enhanced by a panel of suggested options.
|
102
|
+
|
103
|
+
It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
|
104
|
+
|
105
|
+
<h5>Import</h5>
|
106
|
+
|
107
|
+
```typescript
|
108
|
+
import { Autocomplete } from '@symply.io/basic-components/';
|
109
|
+
// or
|
110
|
+
import Autocomplete from '@symply.io/basic-components/Autocomplete';
|
111
|
+
```
|
112
|
+
|
113
|
+
<h5>Option Props (IOption)</h5>
|
114
|
+
|
115
|
+
| Name | Type | Default | Required | Description |
|
116
|
+
| ------ | ------- | ------- | -------- | -------------------------- |
|
117
|
+
| label | string | | true | Option label. |
|
118
|
+
| [name] | Unknown | | false | Customized option property |
|
119
|
+
|
120
|
+
<h5>Props</h5>
|
121
|
+
|
122
|
+
| Name | Type | Default | Required | Description |
|
123
|
+
| -------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
|
124
|
+
| multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
|
125
|
+
| 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. |
|
126
|
+
| options | Array<IOption\|string> | | true | Array of suggestion options. |
|
127
|
+
| value | string | | true | The value of the `Input` element. |
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<h3>AutocompleteWithFilter</h3>
|
132
|
+
|
133
|
+
A normal text input enhanced by a panel of suggested options and filter.
|
134
|
+
|
135
|
+
It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
|
136
|
+
|
137
|
+
<h5>Import</h5>
|
138
|
+
|
139
|
+
```typescript
|
140
|
+
import { AutocompleteWithFilter } from '@symply.io/basic-components/';
|
141
|
+
// or
|
142
|
+
import AutocompleteWithFilter from '@symply.io/basic-components/AutocompleteWithFilter';
|
143
|
+
```
|
144
|
+
|
145
|
+
<h5>Option Props (IOption)</h5>
|
146
|
+
|
147
|
+
| Name | Type | Default | Required | Description |
|
148
|
+
| ------ | ------- | ------- | -------- | -------------------------- |
|
149
|
+
| label | string | | true | Option label. |
|
150
|
+
| [name] | Unknown | | false | Customized option property |
|
151
|
+
|
152
|
+
<h5>Props</h5>
|
153
|
+
|
154
|
+
| Name | Type | Default | Required | Description |
|
155
|
+
| -------------------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
|
156
|
+
| disableCloseOnSelect | bool | false | false | If `true`, the popup won't close when a value is selected. |
|
157
|
+
| multiple | bool | false | false | If `true`, `value` must be an array and the menu will support multiple selections. |
|
158
|
+
| 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. |
|
159
|
+
| options | Array<IOption\|string> | | true | Array of suggestion options. |
|
160
|
+
| value | string | | true | The value of the `Input` element. |
|
161
|
+
|
162
|
+
|
163
|
+
|
79
164
|
<h3>BasicModal</h3>
|
80
165
|
|
81
166
|
Reusable modal component.
|
@@ -83,9 +168,9 @@ Reusable modal component.
|
|
83
168
|
<h5>Import</h5>
|
84
169
|
|
85
170
|
```typescript
|
86
|
-
import { BasicModal } from '@symply.io/
|
171
|
+
import { BasicModal } from '@symply.io/basic-components/';
|
87
172
|
// or
|
88
|
-
import BasicModal from '@symply.io/
|
173
|
+
import BasicModal from '@symply.io/basic-components/BasicModal';
|
89
174
|
```
|
90
175
|
|
91
176
|
<h5>Props</h5>
|
@@ -110,6 +195,89 @@ import BasicModal from '@symply.io/symply-basic-components/BasicModal';
|
|
110
195
|
|
111
196
|
|
112
197
|
|
198
|
+
<h3>BreadCrumbs</h3>
|
199
|
+
|
200
|
+
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".
|
201
|
+
|
202
|
+
<h5>Import</h5>
|
203
|
+
|
204
|
+
```typescript
|
205
|
+
import { BreadCrumbs } from '@symply.io/basic-components/';
|
206
|
+
// or
|
207
|
+
import BreadCrumbs from '@symply.io/basic-components/BreadCrumbs';
|
208
|
+
```
|
209
|
+
|
210
|
+
<h5>Props</h5>
|
211
|
+
|
212
|
+
| Name | Type | Default | Required | Description |
|
213
|
+
| ------ | --------------------------------------- | ------- | -------- | ------------------------- |
|
214
|
+
| routes | Array<{ href?: string; label: string }> | | true | All routes of "ancestors" |
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
<h3>CheckBox</h3>
|
219
|
+
|
220
|
+
Checkboxes allow the user to select one or more items from a set.
|
221
|
+
|
222
|
+
It is extended from `@mui/material/Checkbox`, so it includes all properties of `@mui/material/Checkbox`.
|
223
|
+
|
224
|
+
<h5>Import</h5>
|
225
|
+
|
226
|
+
```typescript
|
227
|
+
import { CheckBox } from '@symply.io/basic-components/';
|
228
|
+
// or
|
229
|
+
import { CheckBox } from '@symply.io/basic-components/CheckBox';
|
230
|
+
// or
|
231
|
+
import CheckBox from '@symply.io/basic-components/CheckBox/CheckBox';
|
232
|
+
```
|
233
|
+
|
234
|
+
<h5>Props</h5>
|
235
|
+
|
236
|
+
| Name | Type | Default | Required | Description |
|
237
|
+
| -------- | ------------------- | ------- | -------- | ------------------------------------------------------------ |
|
238
|
+
| label | string \| ReactNode | | true | The label of the checkbox. |
|
239
|
+
| 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. |
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<h3>CheckBoxGroup</h3>
|
244
|
+
|
245
|
+
Checkboxes allow the user to select one or more items from a set for a group.
|
246
|
+
|
247
|
+
It is extended from `@mui/material/FormGroup`, so it includes all properties of `@mui/material/FormGroup`.
|
248
|
+
|
249
|
+
<h5>Import</h5>
|
250
|
+
|
251
|
+
```typescript
|
252
|
+
import { CheckBoxGroup } from '@symply.io/basic-components/';
|
253
|
+
// or
|
254
|
+
import { CheckBoxGroup } from '@symply.io/basic-components/CheckBox';
|
255
|
+
// or
|
256
|
+
import CheckBoxGroup from '@symply.io/basic-components/CheckBox/CheckBoxGroup';
|
257
|
+
```
|
258
|
+
|
259
|
+
<h5>Props</h5>
|
260
|
+
|
261
|
+
| Name | Type | Default | Required | Description |
|
262
|
+
| ---------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
|
263
|
+
| Checkboxes | Array\<CheckBoxProps\> | | true | The array of checkboxes.<br />See the property of [CheckBox](#checkbox) |
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<h3>Copyright</h3>
|
268
|
+
|
269
|
+
A common component for rendering the copyright
|
270
|
+
|
271
|
+
<h5>Import</h5>
|
272
|
+
|
273
|
+
```typescript
|
274
|
+
import { Copyright } from '@symply.io/basic-components/';
|
275
|
+
// or
|
276
|
+
import Copyright from '@symply.io/basic-components/Copyright';
|
277
|
+
```
|
278
|
+
|
279
|
+
|
280
|
+
|
113
281
|
<h3>DigitInput</h3>
|
114
282
|
|
115
283
|
Input component for digits.
|
@@ -119,9 +287,9 @@ It is extended from `@mui/material/TextField`, so it includes all properties of
|
|
119
287
|
<h5>Import</h5>
|
120
288
|
|
121
289
|
```typescript
|
122
|
-
import { DigitInput } from '@symply.io/
|
290
|
+
import { DigitInput } from '@symply.io/basic-components/';
|
123
291
|
// or
|
124
|
-
import DigitInput from '@symply.io/
|
292
|
+
import DigitInput from '@symply.io/basic-components/DigitInput';
|
125
293
|
```
|
126
294
|
|
127
295
|
<h5>Props</h5>
|
@@ -137,6 +305,30 @@ import DigitInput from '@symply.io/symply-basic-components/DigitInput';
|
|
137
305
|
|
138
306
|
|
139
307
|
|
308
|
+
<h3>FeinInput</h3>
|
309
|
+
|
310
|
+
Input component for FEIN.
|
311
|
+
|
312
|
+
It is extended from `@mui/material/TextField`, so it includes all properties of `@mui/material/TextField`.
|
313
|
+
|
314
|
+
<h5>Import</h5>
|
315
|
+
|
316
|
+
```typescript
|
317
|
+
import { FeinInput } from '@symply.io/basic-components/';
|
318
|
+
// or
|
319
|
+
import FeinInput from '@symply.io/basic-components/FeinInput';
|
320
|
+
```
|
321
|
+
|
322
|
+
<h5>Props</h5>
|
323
|
+
|
324
|
+
| Name | Type | Default | Required | Description |
|
325
|
+
| -------- | ------ | ------- | -------- | ------------------------------------------------------------ |
|
326
|
+
| 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. |
|
327
|
+
| value | string | | true | The value of the `Input` element. |
|
328
|
+
| verifyFn | func | | false | Customized verification function. |
|
329
|
+
|
330
|
+
|
331
|
+
|
140
332
|
<h3>FormRadioGroup</h3>
|
141
333
|
|
142
334
|
Radio Group allow the user to select one option from a set.
|
@@ -144,9 +336,9 @@ Radio Group allow the user to select one option from a set.
|
|
144
336
|
<h5>Import</h5>
|
145
337
|
|
146
338
|
```typescript
|
147
|
-
import { FormRadioGroup } from '@symply.io/
|
339
|
+
import { FormRadioGroup } from '@symply.io/basic-components/';
|
148
340
|
// or
|
149
|
-
import FormRadioGroup from '@symply.io/
|
341
|
+
import FormRadioGroup from '@symply.io/basic-components/FormRadioGroup';
|
150
342
|
```
|
151
343
|
|
152
344
|
<h5>Radio Option Props</h5>
|
@@ -164,7 +356,7 @@ import FormRadioGroup from '@symply.io/symply-basic-components/FormRadioGroup';
|
|
164
356
|
| color | 'primary' \| 'secondary' \| 'success' \| 'error' \| 'info' \| 'warning' | 'primary' | false | The main color of the component. |
|
165
357
|
| disabled | bool | false | false | If `true`, the component is disabled. |
|
166
358
|
| formLabel | string | | false | The label of the `Radio` element. |
|
167
|
-
| 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. |
|
359
|
+
| 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. |
|
168
360
|
| options | Array\<IRadioOption\> | | true | The radio options. See the **Radio Option Props** above. |
|
169
361
|
| value | string \| number \| bool | | true | The value of the `Radio` element. |
|
170
362
|
| tooltip | string | | false | A tooltip for the `Radio` element. |
|
@@ -179,9 +371,9 @@ Selector components are used for collecting user provided information from a lis
|
|
179
371
|
|
180
372
|
```typescript
|
181
373
|
// Simple Selector
|
182
|
-
import { SimpleSelector } from '@symply.io/
|
374
|
+
import { SimpleSelector } from '@symply.io/basic-components/FormSelector';
|
183
375
|
// Multiple Selector
|
184
|
-
import { MultipleSelector } from '@symply.io/
|
376
|
+
import { MultipleSelector } from '@symply.io/basic-components/FormRadioGroup';
|
185
377
|
```
|
186
378
|
|
187
379
|
<h5>Selector Option Props</h5>
|
@@ -194,18 +386,16 @@ import { MultipleSelector } from '@symply.io/symply-basic-components/FormRadioGr
|
|
194
386
|
|
195
387
|
<h5>Base Props</h5>
|
196
388
|
|
197
|
-
|
198
|
-
|
199
|
-
|
|
200
|
-
|
|
201
|
-
| helperText | string
|
202
|
-
| label | string
|
203
|
-
| multiple | bool
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
| tooltip | string | | false | A tooltip for the `Select` element. |
|
208
|
-
| variant | 'filled' \| 'contained' \| 'outlined' | 'outlined' | false | The variant of the `Select` element. |
|
389
|
+
It is extended from `@mui/material/FormControl`, so it includes all properties of `@mui/material/FormControl`.
|
390
|
+
|
391
|
+
| Name | Type | Default | Required | Description |
|
392
|
+
| -------------- | --------------------- | ------- | -------- | ----------------------------------------------------------- |
|
393
|
+
| helperText | string | | false | The helper text of the `Select` element. |
|
394
|
+
| label | string | | false | The label of `Select` element. |
|
395
|
+
| multiple | bool | false | false | If `true`, you can select more than 1 option. |
|
396
|
+
| options | Array\<IRadioOption\> | | true | The radio options. See the **Selector Option Props** above. |
|
397
|
+
| showHelperText | bool | false | False | If `true`, show the helper text. |
|
398
|
+
| tooltip | string | | false | A tooltip for the `Select` element. |
|
209
399
|
|
210
400
|
<h5>Simple Selector Props</h5> Extended from the Base Props
|
211
401
|
|
@@ -230,9 +420,9 @@ You can use it to add a hint/help paragraph.
|
|
230
420
|
<h5>Import</h5>
|
231
421
|
|
232
422
|
```typescript
|
233
|
-
import { HelpCaption } from '@symply.io/
|
423
|
+
import { HelpCaption } from '@symply.io/basic-components/';
|
234
424
|
// or
|
235
|
-
import HelpCaption from '@symply.io/
|
425
|
+
import HelpCaption from '@symply.io/basic-components/HelpCaption';
|
236
426
|
```
|
237
427
|
|
238
428
|
<h5>Props</h5>
|
@@ -254,9 +444,9 @@ A modal for loading.
|
|
254
444
|
<h5>Import</h5>
|
255
445
|
|
256
446
|
```typescript
|
257
|
-
import { LoadingModal } from '@symply.io/
|
447
|
+
import { LoadingModal } from '@symply.io/basic-components/';
|
258
448
|
// or
|
259
|
-
import LoadingModal from '@symply.io/
|
449
|
+
import LoadingModal from '@symply.io/basic-components/LoadingModal';
|
260
450
|
```
|
261
451
|
|
262
452
|
<h5>Props</h5>
|
@@ -278,9 +468,9 @@ A button with menu options.
|
|
278
468
|
<h5>Import</h5>
|
279
469
|
|
280
470
|
```typescript
|
281
|
-
import { MenuButtonGroup } from '@symply.io/
|
471
|
+
import { MenuButtonGroup } from '@symply.io/basic-components/';
|
282
472
|
// or
|
283
|
-
import MenuButtonGroup from '@symply.io/
|
473
|
+
import MenuButtonGroup from '@symply.io/basic-components/MenuButtonGroup';
|
284
474
|
```
|
285
475
|
|
286
476
|
<h5>Menu Button Props</h5>
|
@@ -315,9 +505,9 @@ It is extended from `@mui/material/TextField`, so it includes all properties of
|
|
315
505
|
<h5>Import</h5>
|
316
506
|
|
317
507
|
```typescript
|
318
|
-
import { NumberInput } from '@symply.io/
|
508
|
+
import { NumberInput } from '@symply.io/basic-components/';
|
319
509
|
// or
|
320
|
-
import NumberInput from '@symply.io/
|
510
|
+
import NumberInput from '@symply.io/basic-components/NumberInput';
|
321
511
|
```
|
322
512
|
|
323
513
|
<h5>Props</h5>
|
@@ -343,9 +533,9 @@ It is extended from `@mui/material/TextField`, so it includes all properties of
|
|
343
533
|
|
344
534
|
```typescript
|
345
535
|
// Password
|
346
|
-
import { Password } from '@symply.io/
|
536
|
+
import { Password } from '@symply.io/basic-components/PasswordInput';
|
347
537
|
// Confirm Password
|
348
|
-
import { ConfirmPassword } from '@symply.io/
|
538
|
+
import { ConfirmPassword } from '@symply.io/basic-components/PasswordInput';
|
349
539
|
```
|
350
540
|
|
351
541
|
<h5>Password Props</h5>
|
@@ -377,9 +567,9 @@ It is extended from `@mui/material/TextField`, so it includes all properties of
|
|
377
567
|
<h5>Import</h5>
|
378
568
|
|
379
569
|
```typescript
|
380
|
-
import { PhoneNumberInput } from '@symply.io/
|
570
|
+
import { PhoneNumberInput } from '@symply.io/basic-components/';
|
381
571
|
// or
|
382
|
-
import PhoneNumberInput from '@symply.io/
|
572
|
+
import PhoneNumberInput from '@symply.io/basic-components/PhoneNumberInput';
|
383
573
|
```
|
384
574
|
|
385
575
|
<h5>Props</h5>
|
@@ -399,9 +589,9 @@ Tabs group.
|
|
399
589
|
<h5>Import</h5>
|
400
590
|
|
401
591
|
```typescript
|
402
|
-
import { TabGroup } from '@symply.io/
|
592
|
+
import { TabGroup } from '@symply.io/basic-components/';
|
403
593
|
// or
|
404
|
-
import TabGroup from '@symply.io/
|
594
|
+
import TabGroup from '@symply.io/basic-components/TabGroup';
|
405
595
|
```
|
406
596
|
|
407
597
|
<h5>Props</h5>
|
@@ -416,6 +606,32 @@ import TabGroup from '@symply.io/symply-basic-components/TabGroup';
|
|
416
606
|
|
417
607
|
|
418
608
|
|
609
|
+
<h3>TablePagination</h3>
|
610
|
+
|
611
|
+
Reusable pagination component for the material table
|
612
|
+
|
613
|
+
<h5>Import</h5>
|
614
|
+
|
615
|
+
```typescript
|
616
|
+
import { TablePagination } from '@symply.io/basic-components/';
|
617
|
+
// or
|
618
|
+
import TablePagination from '@symply.io/basic-components/TablePagination';
|
619
|
+
```
|
620
|
+
|
621
|
+
<h5>Props</h5>
|
622
|
+
|
623
|
+
| Name | Type | Default | Required | Description |
|
624
|
+
| ------------------- | --------------- | ------- | -------- | ------------------------------------------------------------ |
|
625
|
+
| colSpan | number | | true | The number of columns a cell should span. |
|
626
|
+
| count | number | | true | The total count of all data. |
|
627
|
+
| 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` . |
|
628
|
+
| onRowsPerPageChange | func | | true | Callback fired when the `Select` value is changed.<br />**Signature:**<br/>`function(event: ChangeEvent<HTMLInputElement ` |
|
629
|
+
| page | number | | true | The current page index. |
|
630
|
+
| rowsPerPage | number | | true | How many rows per page. |
|
631
|
+
| rowsPerPageOptions | Array\<number\> | | true | The options for setting how many rows per page. |
|
632
|
+
|
633
|
+
|
634
|
+
|
419
635
|
<h3>TextInput</h3>
|
420
636
|
|
421
637
|
Regular Input component.
|
@@ -425,9 +641,9 @@ It is extended from `@mui/material/TextField`, so it includes all properties of
|
|
425
641
|
<h5>Import</h5>
|
426
642
|
|
427
643
|
```typescript
|
428
|
-
import { TextInput } from '@symply.io/
|
644
|
+
import { TextInput } from '@symply.io/basic-components/';
|
429
645
|
// or
|
430
|
-
import TextInput from '@symply.io/
|
646
|
+
import TextInput from '@symply.io/basic-components/TextInput';
|
431
647
|
```
|
432
648
|
|
433
649
|
<h5>Props</h5>
|
@@ -449,7 +665,7 @@ Global prompt component.
|
|
449
665
|
<h5>Import</h5>
|
450
666
|
|
451
667
|
```typescript
|
452
|
-
import { usePrompt } from '@symply.io/
|
668
|
+
import { usePrompt } from '@symply.io/basic-components';
|
453
669
|
```
|
454
670
|
|
455
671
|
<h5>Usage</h5>
|
@@ -474,9 +690,9 @@ A modal for playing videos.
|
|
474
690
|
<h5>Import</h5>
|
475
691
|
|
476
692
|
```typescript
|
477
|
-
import { VideoPlayerModal } from '@symply.io/
|
693
|
+
import { VideoPlayerModal } from '@symply.io/basic-components/';
|
478
694
|
// or
|
479
|
-
import VideoPlayerModal from '@symply.io/
|
695
|
+
import VideoPlayerModal from '@symply.io/basic-components/VideoPlayerModal';
|
480
696
|
```
|
481
697
|
|
482
698
|
<h5>Props</h5>
|
@@ -495,5 +711,5 @@ import VideoPlayerModal from '@symply.io/symply-basic-components/VideoPlayerModa
|
|
495
711
|
|
496
712
|
<h2>Changelog</h2>
|
497
713
|
|
498
|
-
If you have recently updated, please read the [changelog](https://github.com/
|
714
|
+
If you have recently updated, please read the [changelog](https://github.com/baseline-software/symply-basic-components/releases) for details of what has changed.
|
499
715
|
|
package/TabGroup/index.js
CHANGED
@@ -10,37 +10,43 @@ var __assign = (this && this.__assign) || function () {
|
|
10
10
|
return __assign.apply(this, arguments);
|
11
11
|
};
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
-
import { useState, forwardRef, useImperativeHandle } from "react";
|
13
|
+
import { useState, useEffect, forwardRef, useImperativeHandle } from "react";
|
14
14
|
import Tab from "@mui/material/Tab";
|
15
15
|
import Tabs from "@mui/material/Tabs";
|
16
16
|
import Typography from "@mui/material/Typography";
|
17
17
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
18
|
-
import
|
18
|
+
import ThemeProvider from "@mui/material/styles/ThemeProvider";
|
19
|
+
import useCustomTheme from "../useCustomTheme";
|
19
20
|
var TabGroup = forwardRef(function (props, ref) {
|
20
|
-
var
|
21
|
+
var tabs = props.tabs, _a = props.textColor, textColor = _a === void 0 ? "primary" : _a, _b = props.variant, variant = _b === void 0 ? "scrollable" : _b, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onTabChange = props.onTabChange, outerTabIndex = props.currentTabIndex;
|
22
|
+
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
21
23
|
var mobileViewport = useMediaQuery(theme.breakpoints.down("md"));
|
22
|
-
var
|
23
|
-
var _d = useState(outerTabIndex), currentTabIndex = _d[0], setCurrentTabIndex = _d[1];
|
24
|
+
var _c = useState(outerTabIndex || 0), currentTabIndex = _c[0], setCurrentTabIndex = _c[1];
|
24
25
|
var onClick = function (index) {
|
25
26
|
setCurrentTabIndex(index);
|
26
27
|
};
|
27
28
|
useImperativeHandle(ref, function () { return ({
|
28
|
-
tabIndex: currentTabIndex
|
29
|
+
tabIndex: currentTabIndex
|
29
30
|
}); });
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
31
|
+
useEffect(function () {
|
32
|
+
if (outerTabIndex !== undefined && outerTabIndex !== currentTabIndex) {
|
33
|
+
setCurrentTabIndex(outerTabIndex);
|
34
|
+
}
|
35
|
+
}, [outerTabIndex, currentTabIndex]);
|
36
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tabs, __assign({ value: currentTabIndex, TabIndicatorProps: { hidden: true }, variant: mobileViewport ? "scrollable" : variant, textColor: textColor, onChange: function (_, val) {
|
37
|
+
onClick(val);
|
38
|
+
onTabChange(val);
|
39
|
+
} }, { children: tabs.map(function (tab, index) {
|
40
|
+
var text = tab.text, _a = tab.disabled, disabled = _a === void 0 ? false : _a;
|
41
|
+
var active = currentTabIndex === index;
|
42
|
+
return (_jsx(Tab, { disableFocusRipple: true, disableRipple: true, label: _jsx(Typography, __assign({ variant: "body2" }, { children: text })), disabled: disabled, sx: {
|
43
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
44
|
+
margin: theme.spacing(0.75, 0.25),
|
45
|
+
background: active ? "#fff" : undefined,
|
46
|
+
borderRadius: active ? theme.spacing(0.5) : undefined,
|
47
|
+
boxShadow: active ? "0px 4px 6px #acc1c2" : undefined
|
48
|
+
} }, index));
|
49
|
+
}) })) })));
|
44
50
|
});
|
45
51
|
export default TabGroup;
|
46
52
|
export * from "./types";
|
package/TabGroup/types.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CSSProperties } from "react";
|
1
2
|
import { TabsProps } from "@mui/material/Tabs";
|
2
3
|
export interface TabGroupProps {
|
3
4
|
textColor?: TabsProps["textColor"];
|
@@ -7,5 +8,7 @@ export interface TabGroupProps {
|
|
7
8
|
}>;
|
8
9
|
variant?: TabsProps["variant"];
|
9
10
|
currentTabIndex?: number;
|
11
|
+
primaryColor?: CSSProperties["color"];
|
12
|
+
secondaryColor?: CSSProperties["color"];
|
10
13
|
onTabChange: (index: number) => void;
|
11
14
|
}
|
@@ -0,0 +1,27 @@
|
|
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 Box from "@mui/material/Box";
|
14
|
+
import IconButton from "@mui/material/IconButton";
|
15
|
+
import FirstPageIcon from "@mui/icons-material/FirstPage";
|
16
|
+
import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft";
|
17
|
+
import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight";
|
18
|
+
import LastPageIcon from "@mui/icons-material/LastPage";
|
19
|
+
import useInteractions from "./useInteractions";
|
20
|
+
import useCustomTheme from "../useCustomTheme";
|
21
|
+
function TablePaginationActions(props) {
|
22
|
+
var count = props.count, page = props.page, rowsPerPage = props.rowsPerPage, onPageChange = props.onPageChange;
|
23
|
+
var theme = useCustomTheme();
|
24
|
+
var _a = useInteractions({ count: count, page: page, rowsPerPage: rowsPerPage, onPageChange: onPageChange }), onBackButtonClick = _a.onBackButtonClick, onNextButtonClick = _a.onNextButtonClick, onLastPageButtonClick = _a.onLastPageButtonClick, onFirstPageButtonClick = _a.onFirstPageButtonClick;
|
25
|
+
return (_jsxs(Box, __assign({ sx: { flexShrink: 0, ml: 2.5 } }, { children: [_jsx(IconButton, __assign({ onClick: onFirstPageButtonClick, disabled: page === 0, "aria-label": "first page" }, { children: theme.direction === "rtl" ? _jsx(LastPageIcon, {}) : _jsx(FirstPageIcon, {}) })), _jsx(IconButton, __assign({ onClick: onBackButtonClick, disabled: page === 0, "aria-label": "previous page" }, { children: theme.direction === "rtl" ? (_jsx(KeyboardArrowRight, {})) : (_jsx(KeyboardArrowLeft, {})) })), _jsx(IconButton, __assign({ onClick: onNextButtonClick, disabled: page >= Math.ceil(count / rowsPerPage) - 1, "aria-label": "next page" }, { children: theme.direction === "rtl" ? (_jsx(KeyboardArrowLeft, {})) : (_jsx(KeyboardArrowRight, {})) })), _jsx(IconButton, __assign({ onClick: onLastPageButtonClick, disabled: page >= Math.ceil(count / rowsPerPage) - 1, "aria-label": "last page" }, { children: theme.direction === "rtl" ? _jsx(FirstPageIcon, {}) : _jsx(LastPageIcon, {}) }))] })));
|
26
|
+
}
|
27
|
+
export default TablePaginationActions;
|
@@ -0,0 +1,30 @@
|
|
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 } from "react/jsx-runtime";
|
13
|
+
import TableRow from "@mui/material/TableRow";
|
14
|
+
import TableFooter from "@mui/material/TableFooter";
|
15
|
+
import TablePagination from "@mui/material/TablePagination";
|
16
|
+
import ThemeProvider from "@mui/material/styles/ThemeProvider";
|
17
|
+
import TablePaginationActions from "./Actions";
|
18
|
+
import useCustomTheme from "../useCustomTheme";
|
19
|
+
function Pagination(props) {
|
20
|
+
var colSpan = props.colSpan, count = props.count, page = props.page, rowsPerPage = props.rowsPerPage, _a = props.rowsPerPageOptions, rowsPerPageOptions = _a === void 0 ? [5, 10, 20, 30] : _a, onPageChange = props.onPageChange, onRowsPerPageChange = props.onRowsPerPageChange, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor;
|
21
|
+
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
22
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: count && (_jsx(TableFooter, { children: _jsx(TableRow, { children: _jsx(TablePagination, { colSpan: colSpan, count: count, rowsPerPage: rowsPerPage, page: page, SelectProps: {
|
23
|
+
inputProps: {
|
24
|
+
"aria-label": "rows per page",
|
25
|
+
},
|
26
|
+
native: true,
|
27
|
+
}, rowsPerPageOptions: rowsPerPageOptions, onPageChange: onPageChange, onRowsPerPageChange: onRowsPerPageChange, ActionsComponent: TablePaginationActions }) }) })) })));
|
28
|
+
}
|
29
|
+
export default Pagination;
|
30
|
+
export * from "./types";
|