@symply.io/basic-components 1.4.0-alpha.5 → 1.4.0-alpha.6

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,4 +1,4 @@
1
- import { AlertDialogProps } from "./types";
1
+ import type { AlertDialogProps } from "./types";
2
2
  declare const AlertDialog: (props: AlertDialogProps) => JSX.Element;
3
3
  export default AlertDialog;
4
- export * from "./types";
4
+ export type { AlertDialogProps };
@@ -45,4 +45,3 @@ var AlertDialog = function (props) {
45
45
  }, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" }, rest, { children: [_jsx(DialogTitle, __assign({ id: "alert-dialog-title" }, { children: title })), _jsx(DialogContent, { children: children }), _jsx(DialogActions, { children: DialogButtons ? (cloneElement(DialogButtons)) : (_jsx(Button, __assign({ onClick: onClose, color: "primary" }, { children: "OK" }))) })] })) })));
46
46
  };
47
47
  export default AlertDialog;
48
- export * from "./types";
@@ -1,6 +1,6 @@
1
- import { ReactElement, CSSProperties } from "react";
2
- import { DialogProps } from "@mui/material/Dialog";
3
- import { DialogContentProps } from "@mui/material/DialogContent";
1
+ import type { ReactElement, CSSProperties } from "react";
2
+ import type { DialogProps } from "@mui/material/Dialog";
3
+ import type { DialogContentProps } from "@mui/material/DialogContent";
4
4
  export interface AlertDialogProps {
5
5
  title?: string;
6
6
  maxWidth?: DialogProps["maxWidth"];
@@ -1,4 +1,4 @@
1
- import { AutocompleteProps } from "./types";
1
+ import type { AutocompleteProps, AutocompleteValueType, AutocompleteOptionType } from "./types";
2
2
  declare function CustomAutocomplete<T, multiple extends boolean | undefined = false>(props: AutocompleteProps<T, multiple>): JSX.Element;
3
3
  export default CustomAutocomplete;
4
- export * from "./types";
4
+ export type { AutocompleteProps, AutocompleteValueType, AutocompleteOptionType };
@@ -49,4 +49,3 @@ function CustomAutocomplete(props) {
49
49
  }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { required: required, size: size, inputProps: __assign(__assign({}, params.inputProps), { required: required && (Array.isArray(value) ? value.length === 0 : !value) }) }))); } }) })));
50
50
  }
51
51
  export default CustomAutocomplete;
52
- export * from "./types";
@@ -1,5 +1,5 @@
1
- import { CSSProperties } from "react";
2
- import { TextFieldProps } from "@mui/material/TextField";
1
+ import type { CSSProperties } from "react";
2
+ import type { TextFieldProps } from "@mui/material/TextField";
3
3
  export declare type AutocompleteOptionType<T = {
4
4
  [name: string]: unknown;
5
5
  }> = T & {
@@ -1,4 +1,4 @@
1
- import { AutocompleteWithFilterProps } from "./types";
1
+ import type { AutocompleteWithFilterProps, AutocompleteWithFilterValueType, AutocompleteWithFilterOptionType } from "./types";
2
2
  declare function AutocompleteWithFilter<T, multiple extends boolean | undefined = false>(props: AutocompleteWithFilterProps<T, multiple>): JSX.Element;
3
3
  export default AutocompleteWithFilter;
4
- export * from "./types";
4
+ export type { AutocompleteWithFilterProps, AutocompleteWithFilterValueType, AutocompleteWithFilterOptionType };
@@ -57,4 +57,3 @@ function AutocompleteWithFilter(props) {
57
57
  }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { variant: "outlined", required: required, inputProps: __assign(__assign({}, params.inputProps), { required: required && (Array.isArray(value) ? value.length === 0 : !value) }) }))); } }) })));
58
58
  }
59
59
  export default AutocompleteWithFilter;
60
- export * from "./types";
@@ -1,12 +1,12 @@
1
- import { CSSProperties } from "react";
2
- import { TextFieldProps } from "@mui/material/TextField";
1
+ import type { CSSProperties } from "react";
2
+ import type { TextFieldProps } from "@mui/material/TextField";
3
3
  export declare type AutocompleteWithFilterOptionType<T> = T & {
4
4
  label: string;
5
5
  value?: string | number;
6
6
  };
7
- export declare type AutocompleteWithFilterlValueType<T, multiple extends boolean | undefined> = multiple extends false | undefined ? AutocompleteWithFilterOptionType<T> | null : Array<AutocompleteWithFilterOptionType<T>>;
7
+ export declare type AutocompleteWithFilterValueType<T, multiple extends boolean | undefined> = multiple extends false | undefined ? AutocompleteWithFilterOptionType<T> | null : Array<AutocompleteWithFilterOptionType<T>>;
8
8
  export interface AutocompleteWithFilterProps<T, multiple extends boolean | undefined> extends Omit<TextFieldProps, "onChange" | "value" | "disabled"> {
9
- value: AutocompleteWithFilterlValueType<T, multiple>;
9
+ value: AutocompleteWithFilterValueType<T, multiple>;
10
10
  options: Array<AutocompleteWithFilterOptionType<T>>;
11
11
  disableCloseOnSelect?: boolean;
12
12
  limitTags?: number;
@@ -15,5 +15,5 @@ export interface AutocompleteWithFilterProps<T, multiple extends boolean | undef
15
15
  loading?: boolean;
16
16
  primaryColor?: CSSProperties["color"];
17
17
  secondaryColor?: CSSProperties["color"];
18
- onChange: (value: AutocompleteWithFilterlValueType<T, multiple>) => void;
18
+ onChange: (value: AutocompleteWithFilterValueType<T, multiple>) => void;
19
19
  }
@@ -1,4 +1,4 @@
1
- import { BasicModalProps } from "./types";
1
+ import type { BasicModalProps } from "./types";
2
2
  declare function BasicModal(props: BasicModalProps): JSX.Element;
3
3
  export default BasicModal;
4
- export * from "./types";
4
+ export type { BasicModalProps };
@@ -49,4 +49,3 @@ function BasicModal(props) {
49
49
  } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit })) })) })) })));
50
50
  }
51
51
  export default BasicModal;
52
- export * from "./types";
@@ -1,5 +1,5 @@
1
- import { ReactNode, CSSProperties } from "react";
2
- import { ButtonProps } from "@mui/material/Button";
1
+ import type { ReactNode, CSSProperties } from "react";
2
+ import type { ButtonProps } from "@mui/material/Button";
3
3
  export interface BasicModalContentProps {
4
4
  children: ReactNode;
5
5
  color?: ButtonProps["color"];
@@ -1,4 +1,4 @@
1
- import { BreadCrumbsProps } from "./types";
1
+ import type { BreadCrumbsProps } from "./types";
2
2
  declare function Crumbs(props: BreadCrumbsProps): JSX.Element;
3
3
  export default Crumbs;
4
- export * from "./types";
4
+ export type { BreadCrumbsProps };
@@ -36,4 +36,3 @@ function Crumbs(props) {
36
36
  })] })) })));
37
37
  }
38
38
  export default Crumbs;
39
- export * from "./types";
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from "react";
1
+ import type { CSSProperties } from "react";
2
2
  export interface BreadCrumbsProps {
3
3
  routes: Array<{
4
4
  href?: string;
@@ -0,0 +1,4 @@
1
+ import { CheckBoxProps } from "./types";
2
+ declare function CheckBox(props: CheckBoxProps): JSX.Element;
3
+ export default CheckBox;
4
+ export type { CheckBoxProps };
@@ -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
+ 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;
@@ -1,12 +1,8 @@
1
- import { CSSProperties, ReactElement } from "react";
2
- import { CheckboxProps } from "@mui/material/Checkbox";
3
- import { FormGroupProps } from "@mui/material/FormGroup";
1
+ import type { CSSProperties, ReactElement } from "react";
2
+ import type { CheckboxProps } from "@mui/material/Checkbox";
4
3
  export interface CheckBoxProps extends Omit<CheckboxProps, "onChange"> {
5
4
  label: string | ReactElement;
6
5
  onChange: (val: boolean) => void;
7
6
  primaryColor?: CSSProperties["color"];
8
7
  secondaryColor?: CSSProperties["color"];
9
8
  }
10
- export interface CheckBoxGroupProps extends FormGroupProps {
11
- checkboxes: Array<CheckBoxProps>;
12
- }
@@ -0,0 +1,4 @@
1
+ import type { CheckBoxGroupProps } from "./types";
2
+ declare function CheckBoxGroup(props: CheckBoxGroupProps): JSX.Element;
3
+ export default CheckBoxGroup;
4
+ export type { CheckBoxGroupProps };
@@ -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
+ 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;
@@ -1,12 +1,5 @@
1
- import { CSSProperties, ReactElement } 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 | ReactElement;
6
- onChange: (val: boolean) => void;
7
- primaryColor?: CSSProperties["color"];
8
- secondaryColor?: CSSProperties["color"];
9
- }
1
+ import type { FormGroupProps } from "@mui/material/FormGroup";
2
+ import type { CheckBoxProps } from "../CheckBox";
10
3
  export interface CheckBoxGroupProps extends FormGroupProps {
11
4
  checkboxes: Array<CheckBoxProps>;
12
5
  }
@@ -1,4 +1,4 @@
1
- import { CopyrightProps } from "./types";
1
+ import type { CopyrightProps } from "./types";
2
2
  declare function Copyright(props: CopyrightProps): JSX.Element;
3
3
  export default Copyright;
4
- export * from "./types";
4
+ export type { CopyrightProps };
@@ -20,4 +20,3 @@ function Copyright(props) {
20
20
  return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Typography, __assign({ sx: { fontSize: 16, fontWeight: 400 }, color: "textSecondary", align: "center" }, { children: ["Copyright © ", _jsx(Link, __assign({ color: "inherit", href: "https://symply.io/" }, { children: "Symply Software Inc" })), "\u00A0", new Date().getFullYear(), "."] })) })));
21
21
  }
22
22
  export default Copyright;
23
- export * from "./types";
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from "react";
1
+ import type { CSSProperties } from "react";
2
2
  export interface CopyrightProps {
3
3
  primaryColor?: CSSProperties["color"];
4
4
  secondaryColor?: CSSProperties["color"];
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from "./AutocompleteWithFilter";
4
4
  export * from "./BasicModal";
5
5
  export * from "./BreadCrumbs";
6
6
  export * from "./CheckBox";
7
+ export * from "./CheckBoxGroup";
7
8
  export * from "./Copyright";
8
9
  export * from "./DataTable";
9
10
  export * from "./DateInput";
@@ -31,6 +32,8 @@ export { default as Autocomplete } from "./Autocomplete";
31
32
  export { default as AutocompleteWithFilter } from "./AutocompleteWithFilter";
32
33
  export { default as BasicModal } from "./BasicModal";
33
34
  export { default as BreadCrumbs } from "./BreadCrumbs";
35
+ export { default as CheckBox } from "./CheckBox";
36
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
34
37
  export { default as Copyright } from "./Copyright";
35
38
  export { default as DataTable } from "./DataTable";
36
39
  export { default as DigitInput } from "./DigitInput";
package/index.js CHANGED
@@ -4,6 +4,7 @@ export * from "./AutocompleteWithFilter";
4
4
  export * from "./BasicModal";
5
5
  export * from "./BreadCrumbs";
6
6
  export * from "./CheckBox";
7
+ export * from "./CheckBoxGroup";
7
8
  export * from "./Copyright";
8
9
  export * from "./DataTable";
9
10
  export * from "./DateInput";
@@ -31,6 +32,8 @@ export { default as Autocomplete } from "./Autocomplete";
31
32
  export { default as AutocompleteWithFilter } from "./AutocompleteWithFilter";
32
33
  export { default as BasicModal } from "./BasicModal";
33
34
  export { default as BreadCrumbs } from "./BreadCrumbs";
35
+ export { default as CheckBox } from "./CheckBox";
36
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
34
37
  export { default as Copyright } from "./Copyright";
35
38
  export { default as DataTable } from "./DataTable";
36
39
  export { default as DigitInput } from "./DigitInput";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.4.0-alpha.5",
3
+ "version": "1.4.0-alpha.6",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",