@symply.io/basic-components 1.0.0-alpha.16 → 1.0.0-alpha.17

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.
@@ -1,6 +1,4 @@
1
- import { TextFieldProps } from "@mui/material/TextField";
2
1
  import { CustomAutocompleteProps } from "./types";
3
- declare type textFieldProps = Omit<TextFieldProps, "onChange">;
4
- declare function CustomAutocomplete(props: CustomAutocompleteProps & textFieldProps): JSX.Element;
2
+ declare function CustomAutocomplete(props: CustomAutocompleteProps): JSX.Element;
5
3
  export default CustomAutocomplete;
6
4
  export * from "./types";
@@ -32,7 +32,7 @@ function CustomAutocomplete(props) {
32
32
  var _a = useInteractions(), inputValue = _a.inputValue, onInputChange = _a.onInputChange;
33
33
  return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Autocomplete, { size: size, fullWidth: true, options: options, multiple: multiple, onChange: function (_, value) {
34
34
  onChange(value);
35
- }, inputValue: inputValue, onInputChange: onInputChange, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { size: size }))); } }) })));
35
+ }, inputValue: inputValue, onInputChange: onInputChange, renderInput: function (params) { return _jsx(TextField, __assign({}, params, rest, { size: size })); } }) })));
36
36
  }
37
37
  export default CustomAutocomplete;
38
38
  export * from "./types";
@@ -1,10 +1,11 @@
1
1
  import { CSSProperties } from "react";
2
+ import { TextFieldProps } from "@mui/material/TextField";
2
3
  export interface IAutocompleteOption {
3
4
  label: string;
4
5
  [name: string]: unknown;
5
6
  }
6
7
  export declare type AutocompleteOptionType = IAutocompleteOption | string;
7
- export interface CustomAutocompleteProps {
8
+ export interface CustomAutocompleteProps extends Omit<TextFieldProps, "onChange"> {
8
9
  multiple?: boolean;
9
10
  options: Array<AutocompleteOptionType>;
10
11
  value: Array<AutocompleteOptionType> | AutocompleteOptionType | null;
@@ -1,6 +1,4 @@
1
- import { TextFieldProps } from "@mui/material/TextField";
2
1
  import { AutoCompleteWithFilterProps } from "./types";
3
- declare type textFieldProps = Omit<TextFieldProps, "onChange">;
4
- declare function AutocompleteWithFilter(props: AutoCompleteWithFilterProps & textFieldProps): JSX.Element;
2
+ declare function AutocompleteWithFilter(props: AutoCompleteWithFilterProps): JSX.Element;
5
3
  export default AutocompleteWithFilter;
6
4
  export * from "./types";
@@ -1,10 +1,11 @@
1
1
  import { CSSProperties } from "react";
2
+ import { TextFieldProps } from "@mui/material/TextField";
2
3
  export interface IAutoCompleteWithFilterOption {
3
4
  label: string;
4
5
  [name: string]: unknown;
5
6
  }
6
7
  export declare type AutoCompleteWithFilterOptionType = IAutoCompleteWithFilterOption | string;
7
- export interface AutoCompleteWithFilterProps {
8
+ export interface AutoCompleteWithFilterProps extends Omit<TextFieldProps, "onChange"> {
8
9
  multiple?: boolean;
9
10
  value: Array<AutoCompleteWithFilterOptionType> | AutoCompleteWithFilterOptionType | null;
10
11
  options: Array<AutoCompleteWithFilterOptionType>;
@@ -0,0 +1,3 @@
1
+ import { CheckBoxProps } from "./types";
2
+ export declare function CheckBox(props: CheckBoxProps): JSX.Element;
3
+ export default CheckBox;
@@ -0,0 +1,36 @@
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 Checkbox from "@mui/material/Checkbox";
25
+ import FormControlLabel from "@mui/material/FormControlLabel";
26
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
27
+ import useCustomTheme from "../useCustomTheme";
28
+ export function CheckBox(props) {
29
+ var label = props.label, onChange = props.onChange, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["label", "onChange", "primaryColor", "secondaryColor"]);
30
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
31
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, __assign({ onChange: function (event) {
32
+ event.stopPropagation();
33
+ onChange(event.target.checked);
34
+ } }, rest)), label: label }) })));
35
+ }
36
+ export default CheckBox;
@@ -0,0 +1,3 @@
1
+ import { CheckBoxGroupProps } from "./types";
2
+ export declare function CheckBoxGroup(props: CheckBoxGroupProps): JSX.Element;
3
+ export default CheckBoxGroup;
@@ -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
+ 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 FormGroup from "@mui/material/FormGroup";
25
+ import CheckBox from "./CheckBox";
26
+ export function CheckBoxGroup(props) {
27
+ var checkboxes = props.checkboxes, rest = __rest(props, ["checkboxes"]);
28
+ return (_jsx(FormGroup, __assign({}, rest, { children: checkboxes.map(function (checkbox, index) { return (_jsx(CheckBox, __assign({}, checkbox), index)); }) })));
29
+ }
30
+ export default CheckBoxGroup;
@@ -0,0 +1,3 @@
1
+ export { default as CheckBox } from "./CheckBox";
2
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ export { default as CheckBox } from "./CheckBox";
2
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
+ export * from "./types";
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from "react";
2
+ import { CheckboxProps } from "@mui/material/Checkbox";
3
+ import { FormGroupProps } from "@mui/material/FormGroup";
4
+ export interface CheckBoxProps extends Omit<CheckboxProps, "onChange"> {
5
+ label: string;
6
+ onChange: (val: boolean) => void;
7
+ primaryColor?: CSSProperties["color"];
8
+ secondaryColor?: CSSProperties["color"];
9
+ }
10
+ export interface CheckBoxGroupProps extends FormGroupProps {
11
+ checkboxes: Array<CheckBoxProps>;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,4 @@
1
- import { TextFieldProps } from "@mui/material/TextField";
2
1
  import { DigitInputProps } from "./types";
3
- declare type TextProps = Omit<TextFieldProps, "onChange">;
4
- declare function DigitInput(props: DigitInputProps & TextProps): JSX.Element;
2
+ declare function DigitInput(props: DigitInputProps): JSX.Element;
5
3
  export default DigitInput;
6
4
  export * from "./types";
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { InputProps } from "@mui/material/Input";
3
- export interface DigitInputProps {
3
+ import { TextFieldProps } from "@mui/material/TextField";
4
+ export interface DigitInputProps extends Omit<TextFieldProps, "onChange"> {
4
5
  onChange: (value: string) => void;
5
6
  value: string;
6
7
  tooltip?: string;
@@ -1,4 +1,3 @@
1
- import { FormControlProps } from "@mui/material/FormControl";
2
1
  import { MultipleSelectorProps } from "./types";
3
- declare function MultipleSelector(props: MultipleSelectorProps & FormControlProps): JSX.Element;
2
+ declare function MultipleSelector(props: MultipleSelectorProps): JSX.Element;
4
3
  export default MultipleSelector;
@@ -1,4 +1,3 @@
1
- import { FormControlProps } from "@mui/material/FormControl";
2
1
  import { SimpleSelectorProps } from "./types";
3
- declare function SimpleSelector(props: SimpleSelectorProps & FormControlProps): JSX.Element;
2
+ declare function SimpleSelector(props: SimpleSelectorProps): JSX.Element;
4
3
  export default SimpleSelector;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode, CSSProperties } from "react";
2
2
  import { SelectProps } from "@mui/material/Select";
3
- interface SelectorBaseProps {
3
+ import { FormControlProps } from "@mui/material/FormControl";
4
+ interface SelectorBaseProps extends Omit<FormControlProps, "onChange"> {
4
5
  label?: string;
5
6
  tooltip?: ReactNode;
6
7
  showHelperText?: boolean;
@@ -1,7 +1,6 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { TextFieldProps } from "@mui/material/TextField";
3
- declare type TextProps = Omit<TextFieldProps, "onChange">;
4
- export interface NumberInputProps {
3
+ export interface NumberInputProps extends Omit<TextFieldProps, "onChange"> {
5
4
  onChange: (value: string) => void;
6
5
  value: string;
7
6
  integerOnly?: boolean;
@@ -11,5 +10,5 @@ export interface NumberInputProps {
11
10
  primaryColor?: CSSProperties["color"];
12
11
  secondaryColor?: CSSProperties["color"];
13
12
  }
14
- declare function NumberInput(props: NumberInputProps & TextProps): JSX.Element;
13
+ declare function NumberInput(props: NumberInputProps): JSX.Element;
15
14
  export default NumberInput;
@@ -1,12 +1,11 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { TextFieldProps } from "@mui/material/TextField";
3
- declare type TextInputProps = Omit<TextFieldProps, "onChange">;
4
- export interface ConfirmPasswordProps {
3
+ export interface ConfirmPasswordProps extends Omit<TextFieldProps, "onChange"> {
5
4
  password: string;
6
5
  value: string;
7
6
  primaryColor?: CSSProperties["color"];
8
7
  secondaryColor?: CSSProperties["color"];
9
8
  onChange: (value: string) => void;
10
9
  }
11
- declare function ConfirmPassword(props: ConfirmPasswordProps & TextInputProps): JSX.Element;
10
+ declare function ConfirmPassword(props: ConfirmPasswordProps): JSX.Element;
12
11
  export default ConfirmPassword;
@@ -1,13 +1,12 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { TextFieldProps } from "@mui/material/TextField";
3
- declare type TextInputProps = Omit<TextFieldProps, "onChange">;
4
3
  export interface PasswordStrategyProps {
5
4
  [key: string]: {
6
5
  label: string;
7
6
  regex: RegExp;
8
7
  };
9
8
  }
10
- export interface PasswordProps {
9
+ export interface PasswordProps extends Omit<TextFieldProps, "onChange"> {
11
10
  strategies: PasswordStrategyProps;
12
11
  value: string;
13
12
  successColor?: CSSProperties["color"];
@@ -16,5 +15,5 @@ export interface PasswordProps {
16
15
  onChange: (value: string) => void;
17
16
  onVerify?: (value: string) => boolean;
18
17
  }
19
- declare function Password(props: PasswordProps & TextInputProps): JSX.Element;
18
+ declare function Password(props: PasswordProps): JSX.Element;
20
19
  export default Password;
@@ -1,8 +1,7 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { InputProps } from "@mui/material/Input";
3
3
  import { TextFieldProps } from "@mui/material/TextField";
4
- declare type TextInputProps = Omit<TextFieldProps, "onChange">;
5
- export interface PhoneInputProps {
4
+ export interface PhoneInputProps extends Omit<TextFieldProps, "onChange"> {
6
5
  value: string;
7
6
  endAdornment?: InputProps["endAdornment"];
8
7
  primaryColor?: CSSProperties["color"];
@@ -10,5 +9,5 @@ export interface PhoneInputProps {
10
9
  onChange: (val: string) => void;
11
10
  }
12
11
  export declare function phoneFormat(str: string): string;
13
- declare function PhoneInput(props: TextInputProps & PhoneInputProps): JSX.Element;
12
+ declare function PhoneInput(props: PhoneInputProps): JSX.Element;
14
13
  export default PhoneInput;
package/README.md CHANGED
@@ -16,6 +16,8 @@
16
16
  - [AutocompleteWithFilter](#autocompletewithfilter)
17
17
  - [BasicModal](#basicmodal)
18
18
  - [BreadCrumbs](#breadcrumbs)
19
+ - [CheckBox](#checkbox)
20
+ - [CheckBoxGroup](#checkboxgroup)
19
21
  - [Copyright](#copyright)
20
22
  - [DigitInput](#digitinput)
21
23
  - [FormRadioGroup](#formradiogroup)
@@ -27,6 +29,7 @@
27
29
  - [PasswordInput](#passwordinput)
28
30
  - [PhoneNumberInput](#phonenumberinput)
29
31
  - [TabGroup](#tabgroup)
32
+ - [TablePagination](#tablepagination)
30
33
  - [TextInput](#textinput)
31
34
  - [ToastPrompt](#toastprompt)
32
35
  - [VideoPlayerModal](#videoplayermodal)
@@ -211,6 +214,53 @@ import BreadCrumbs from '@symply.io/basic-components/BreadCrumbs';
211
214
 
212
215
 
213
216
 
217
+ <h3>CheckBox</h3>
218
+
219
+ Checkboxes allow the user to select one or more items from a set.
220
+
221
+ It is extended from `@mui/material/Checkbox`, so it includes all properties of `@mui/material/Checkbox`.
222
+
223
+ <h5>Import</h5>
224
+
225
+ ```typescript
226
+ import { CheckBox } from '@symply.io/basic-components/';
227
+ // or
228
+ import { CheckBox } from '@symply.io/basic-components/CheckBox';
229
+ ```
230
+
231
+ <h5>Props</h5>
232
+
233
+ | Name | Type | Default | Required | Description |
234
+ | -------- | ------ | ------- | -------- | ------------------------------------------------------------ |
235
+ | label | string | | true | The label of the checkbox. |
236
+ | 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. |
237
+
238
+
239
+
240
+
241
+
242
+ <h3>CheckBoxGroup</h3>
243
+
244
+ Checkboxes allow the user to select one or more items from a set for a group.
245
+
246
+ It is extended from `@mui/material/FormGroup`, so it includes all properties of `@mui/material/FormGroup`.
247
+
248
+ <h5>Import</h5>
249
+
250
+ ```typescript
251
+ import { CheckBoxGroup } from '@symply.io/basic-components/';
252
+ // or
253
+ import { CheckBoxGroup } from '@symply.io/basic-components/CheckBox';
254
+ ```
255
+
256
+ <h5>Props</h5>
257
+
258
+ | Name | Type | Default | Required | Description |
259
+ | ---------- | ---------------------- | ------- | -------- | ------------------------------------------------------------ |
260
+ | Checkboxes | Array\<CheckBoxProps\> | | true | The array of checkboxes.<br />See the property of [CheckBox](#checkbox) |
261
+
262
+
263
+
214
264
  <h3>Copyright</h3>
215
265
 
216
266
  A common component for rendering the copyright
@@ -279,7 +329,7 @@ import FormRadioGroup from '@symply.io/basic-components/FormRadioGroup';
279
329
  | color | 'primary' \| 'secondary' \| 'success' \| 'error' \| 'info' \| 'warning' | 'primary' | false | The main color of the component. |
280
330
  | disabled | bool | false | false | If `true`, the component is disabled. |
281
331
  | formLabel | string | | false | The label of the `Radio` element. |
282
- | 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. |
332
+ | 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. |
283
333
  | options | Array\<IRadioOption\> | | true | The radio options. See the **Radio Option Props** above. |
284
334
  | value | string \| number \| bool | | true | The value of the `Radio` element. |
285
335
  | tooltip | string | | false | A tooltip for the `Radio` element. |
@@ -1,7 +1,6 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { TextFieldProps } from "@mui/material/TextField";
3
- declare type TextProps = Omit<TextFieldProps, "onChange">;
4
- export interface TextInputProps {
3
+ export interface TextInputProps extends Omit<TextFieldProps, "onChange"> {
5
4
  onChange: (value: string) => void;
6
5
  value: string;
7
6
  tooltip?: TextFieldProps;
@@ -10,5 +9,5 @@ export interface TextInputProps {
10
9
  primaryColor?: CSSProperties["color"];
11
10
  secondaryColor?: CSSProperties["color"];
12
11
  }
13
- declare const TextInput: (props: TextInputProps & TextProps) => JSX.Element;
12
+ declare const TextInput: (props: TextInputProps) => JSX.Element;
14
13
  export default TextInput;
@@ -1,5 +1,4 @@
1
- import { ReactPlayerProps } from "react-player";
2
1
  import { VideoPlayerModalProps } from "./types";
3
- declare function VideoPlayerModal(props: VideoPlayerModalProps & ReactPlayerProps): JSX.Element;
2
+ declare function VideoPlayerModal(props: VideoPlayerModalProps): JSX.Element;
4
3
  export default VideoPlayerModal;
5
4
  export * from "./types";
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { ButtonProps } from "@mui/material/Button";
3
- export interface VideoPlayerModalProps {
3
+ import { ReactPlayerProps } from "react-player";
4
+ export interface VideoPlayerModalProps extends ReactPlayerProps {
4
5
  title?: string;
5
6
  open: boolean;
6
7
  pip?: boolean;
package/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./Autocomplete";
3
3
  export * from "./AutocompleteWithFilter";
4
4
  export * from "./BasicModal";
5
5
  export * from "./BreadCrumbs";
6
+ export * from "./CheckBox";
6
7
  export * from "./Copyright";
7
8
  export * from "./DigitInput";
8
9
  export * from "./DynamicHeaderBar";
package/index.js CHANGED
@@ -3,6 +3,7 @@ export * from "./Autocomplete";
3
3
  export * from "./AutocompleteWithFilter";
4
4
  export * from "./BasicModal";
5
5
  export * from "./BreadCrumbs";
6
+ export * from "./CheckBox";
6
7
  export * from "./Copyright";
7
8
  export * from "./DigitInput";
8
9
  export * from "./DynamicHeaderBar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",