Skip to content

Commit

Permalink
chore: restore dist
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Mar 19, 2024
1 parent 4ca1d18 commit 3a129c8
Show file tree
Hide file tree
Showing 22 changed files with 274 additions and 7 deletions.
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { hello_python } from "./other/fullscreen/test";
console.log(hello_python());
10 changes: 5 additions & 5 deletions dist/mui/components/accordion/Accordion.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
export interface AccordionProps {
hideExpandIcon?: boolean;
children?: React.ReactNode;
hideExpandIcon: boolean;
children: React.ReactNode;
isExpanded: boolean;
header?: React.ReactNode;
renderSummary?: React.ReactNode;
header: React.ReactNode;
alternativeComponent: React.ReactNode;
}
export default function Accordion({ hideExpandIcon, children, isExpanded, header, renderSummary, ...restProps }: AccordionProps): React.JSX.Element;
export default function Accordion({ hideExpandIcon, children, isExpanded, header, alternativeComponent, ...restProps }: AccordionProps): React.JSX.Element;
6 changes: 4 additions & 2 deletions dist/mui/components/accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const AccordionSummary = withStyles({
},
expanded: {},
})(MuiAccordionSummary);
export default function Accordion({ hideExpandIcon, children, isExpanded, header, renderSummary, ...restProps }) {
export default function Accordion({ hideExpandIcon, children, isExpanded, header, alternativeComponent, ...restProps }) {
const [isExpanded_, setIsExpanded] = useState(isExpanded);
useEffect(() => {
setIsExpanded(isExpanded);
Expand All @@ -51,7 +51,9 @@ export default function Accordion({ hideExpandIcon, children, isExpanded, header
}
};
return (React.createElement(StyledAccordion, { defaultExpanded: isExpanded, expanded: isExpanded_, ...restProps },
React.createElement(AccordionSummary, { onClick: handleToggleExpanded, "aria-controls": "panel2a-content", expandIcon: !hideExpandIcon && React.createElement(IconByName, { name: "actions.expand" }) }, renderSummary || React.createElement(Typography, { variant: "overline" }, header)),
React.createElement(AccordionSummary, { onClick: handleToggleExpanded, "aria-controls": "panel2a-content", expandIcon: !hideExpandIcon && React.createElement(IconByName, { name: "actions.expand" }) },
React.createElement(Typography, { variant: "overline" }, header),
alternativeComponent),
React.createElement(Divider, null),
React.createElement(AccordionDetails, null, children)));
}
15 changes: 15 additions & 0 deletions dist/mui/components/custom/alert/AlertContextProvider.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { AlertProps } from "@mui/material/Alert";
import { SnackbarProps } from "@mui/material/Snackbar";
import React from "react";
export type ExtendedAlertProps = AlertProps & {
content: string;
};
export declare const AlertContext: React.Context<{
show: (alertProps: ExtendedAlertProps, snackbarProps?: SnackbarProps) => void;
} | null>;
export interface AlertProvider {
children: React.ReactNode;
}
declare function AlertProvider({ children }: AlertProvider): React.JSX.Element;
export declare const AlertContextProvider: React.MemoExoticComponent<typeof AlertProvider>;
export {};
45 changes: 45 additions & 0 deletions dist/mui/components/custom/alert/AlertContextProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* eslint-disable no-shadow */
/* eslint-disable react/jsx-props-no-spreading */
import Alert from "@mui/material/Alert";
import AlertTitle from "@mui/material/AlertTitle";
import Snackbar from "@mui/material/Snackbar";
import React, { createContext, memo, useCallback, useState } from "react";
export const AlertContext = createContext(null);
const defaultSnackbarProps = {
anchorOrigin: {
vertical: "bottom",
horizontal: "right",
},
autoHideDuration: 3000,
};
const defaultAlertProps = {
content: "Success Alert",
severity: "success",
variant: "filled",
};
// eslint-disable-next-line react/prop-types
function AlertProvider({ children }) {
const [isAlertShown, setShownAlert] = useState(false);
const [snackbarProps, setSnackbarProps] = useState(defaultSnackbarProps);
const [alertProps, setAlertProps] = useState(defaultAlertProps);
const showAlert = useCallback((alertProps, snackbarProps) => {
if (alertProps)
setAlertProps((prev) => ({ ...prev, ...alertProps }));
if (snackbarProps)
setSnackbarProps((prev) => ({ ...prev, ...snackbarProps }));
setShownAlert(true);
}, []);
const closeAlert = useCallback(() => {
setShownAlert(false);
}, []);
const { content, severity, variant, ...restAlertProps } = alertProps;
/* eslint-disable react/jsx-no-constructed-context-values */
return (React.createElement(AlertContext.Provider, { value: { show: showAlert } },
children,
React.createElement(Snackbar, { ...snackbarProps, open: isAlertShown, onClose: closeAlert },
React.createElement(Alert, { onClose: closeAlert, variant: variant, severity: severity, ...restAlertProps },
React.createElement(AlertTitle, null, severity),
content))));
/* eslint-enable react/jsx-no-constructed-context-values */
}
export const AlertContextProvider = memo(AlertProvider);
3 changes: 3 additions & 0 deletions dist/mui/components/custom/alert/hooks/useAlert.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const useAlert: () => {
show: (alertProps: import("../AlertContextProvider").ExtendedAlertProps, snackbarProps?: import("@mui/material").SnackbarProps | undefined) => void;
} | null;
5 changes: 5 additions & 0 deletions dist/mui/components/custom/alert/hooks/useAlert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { useContext } from "react";
import { AlertContext } from "../AlertContextProvider";
export const useAlert = () => {
return useContext(AlertContext);
};
1 change: 1 addition & 0 deletions dist/mui/components/custom/alert/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./hooks/useAlert";
1 change: 1 addition & 0 deletions dist/mui/components/custom/alert/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./hooks/useAlert";
7 changes: 7 additions & 0 deletions dist/mui/components/stepper/StepIcon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
export interface StepIconProps {
active: boolean;
icon: React.ReactNode;
}
declare function StepIcon(props: StepIconProps): React.JSX.Element;
export default StepIcon;
56 changes: 56 additions & 0 deletions dist/mui/components/stepper/StepIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { styled } from "@mui/material/styles";
import classNames from "classnames";
import React from "react";
const StyledStepIcon = styled("div")(({ theme }) => ({
display: "flex",
justifyContent: "center",
alignItems: "center",
width: 50,
height: 50,
border: `1px solid ${theme.palette.primary.dark}`,
borderRadius: "50%",
color: theme.palette.common.white,
".internal-circle": {
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
width: 44,
height: 44,
background: "transparent",
borderRadius: "50%",
border: `1px solid ${theme.palette.primary.dark}`,
lineHeight: 1.2,
".step-number": {
fontSize: 13,
color: theme.palette.primary.dark,
},
".step-label": {
fontSize: 10,
color: theme.palette.primary.dark,
},
},
"&.active": {
border: `1px solid ${theme.palette.primary.dark}`,
color: theme.palette.common.white,
".internal-circle": {
background: theme.palette.primary.dark,
".step-number": {
fontSize: 13,
color: theme.palette.common.white,
},
".step-label": {
fontSize: 10,
color: theme.palette.common.white,
},
},
},
}));
function StepIcon(props) {
const { active, icon } = props;
return (React.createElement(StyledStepIcon, { className: classNames({ active }) },
React.createElement("div", { className: "internal-circle" },
React.createElement("span", { className: "step-number" }, icon),
React.createElement("span", { className: "step-label" }, "STEP"))));
}
export default StepIcon;
2 changes: 2 additions & 0 deletions dist/mui/components/stepper/Stepper.styled.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const StyledConnector: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
export declare const StepMsg: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
45 changes: 45 additions & 0 deletions dist/mui/components/stepper/Stepper.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import StepConnector, { stepConnectorClasses } from "@mui/material/StepConnector";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
export const StyledConnector = styled(StepConnector)(({ theme }) => ({
[`&.${stepConnectorClasses.alternativeLabel}`]: {
top: 24,
left: "calc(-50% + 25px)",
right: "calc(50% + 25px)",
},
[`&.${stepConnectorClasses.active}`]: {
[`& .${stepConnectorClasses.line}`]: {
backgroundColor: theme.palette.primary.dark,
"&::after": {
backgroundColor: theme.palette.primary.dark,
},
},
},
[`&.${stepConnectorClasses.completed}`]: {
[`& .${stepConnectorClasses.line}`]: {
backgroundColor: theme.palette.primary.dark,
"&::after": {
backgroundColor: theme.palette.primary.dark,
},
},
},
[`& .${stepConnectorClasses.line}`]: {
height: 2,
border: 0,
backgroundColor: theme.palette.border.dark,
"&::after": {
position: "absolute",
right: "-3px",
top: "-2px",
display: "block",
content: '""',
width: "6px",
height: "6px",
backgroundColor: theme.palette.border.dark,
borderRadius: "50%",
},
},
}));
export const StepMsg = styled(Typography)(() => ({
marginTop: "15px",
}));
19 changes: 19 additions & 0 deletions dist/mui/components/textField/BasicTextField.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SxProps } from "@mui/material";
import React, { HTMLInputTypeAttribute } from "react";
type BasicTextFieldProps = {
label: string;
value?: string | number;
defaultValue?: string | number;
onChange?: (newValue: string | number) => void;
disabled?: boolean;
fullWidth?: boolean;
size?: "small" | "medium";
labelAsPlaceholder?: boolean;
sx?: SxProps;
type?: HTMLInputTypeAttribute;
variant?: "standard" | "filled" | "outlined";
required?: boolean;
};
declare function BasicTextField({ label, value, defaultValue, onChange, // eslint-disable-line @typescript-eslint/no-empty-function
disabled, fullWidth, size, labelAsPlaceholder, sx, type, variant, required, }: BasicTextFieldProps): React.JSX.Element;
export default BasicTextField;
8 changes: 8 additions & 0 deletions dist/mui/components/textField/BasicTextField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import TextField from "@mui/material/TextField";
import React from "react";
function BasicTextField({ label, value, defaultValue, onChange = () => { }, // eslint-disable-line @typescript-eslint/no-empty-function
disabled = false, fullWidth = true, size = "medium", labelAsPlaceholder = true, sx = {}, type = "text", variant = "outlined", required = false, }) {
const inputLabelProps = labelAsPlaceholder ? {} : { shrink: true };
return (React.createElement(TextField, { type: type, sx: sx, label: label, value: value, defaultValue: defaultValue, fullWidth: fullWidth, disabled: disabled, variant: variant, size: size, required: required, InputLabelProps: inputLabelProps, onChange: (e) => onChange(e.target.value) }));
}
export default BasicTextField;
2 changes: 2 additions & 0 deletions dist/mui/components/textField/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import BasicTextField from "./BasicTextField";
export { BasicTextField };
2 changes: 2 additions & 0 deletions dist/mui/components/textField/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import BasicTextField from "./BasicTextField";
export { BasicTextField };
1 change: 1 addition & 0 deletions dist/other/fullscreen/test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function hello_python(): Promise<void>;
8 changes: 8 additions & 0 deletions dist/other/fullscreen/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// import { loadPyodide } from "pyodide";
// const { loadPyodide } = require("pyodide");
export async function hello_python() {
// const pyodide = await loadPyodide({
// indexURL: "<pyodide artifacts folder>",
// });
// return pyodide.runPythonAsync("1+1");
}
10 changes: 10 additions & 0 deletions dist/other/rjsf/CustomObjectFieldTemplate.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FormContextType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from "@rjsf/utils";
import React from "react";
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
* the properties.
*
* @param props - The `ObjectFieldTemplateProps` for this component
*/
declare function ObjectFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ description, title, properties, required, disabled, readonly, uiSchema, idSchema, schema, formData, onAddClick, registry, }: ObjectFieldTemplateProps<T, S, F>): React.JSX.Element;
export default ObjectFieldTemplate;
32 changes: 32 additions & 0 deletions dist/other/rjsf/CustomObjectFieldTemplate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-disable react/no-array-index-key */
/* eslint-disable @typescript-eslint/no-explicit-any */
import Grid from "@mui/material/Grid";
import { useTheme } from "@mui/material/styles";
import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, } from "@rjsf/utils";
import React from "react";
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
* the properties.
*
* @param props - The `ObjectFieldTemplateProps` for this component
*/
function ObjectFieldTemplate({ description, title, properties, required, disabled, readonly, uiSchema, idSchema, schema, formData, onAddClick, registry, }) {
const theme = useTheme();
const uiOptions = getUiOptions(uiSchema);
const TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions);
const DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
// Button templates are not overridden in the uiSchema
const { ButtonTemplates: { AddButton }, } = registry.templates;
return (React.createElement(React.Fragment, null,
title && (React.createElement(TitleFieldTemplate, { id: titleId(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })),
description && (React.createElement(DescriptionFieldTemplate, { id: descriptionId(idSchema), description: description, schema: schema, uiSchema: uiSchema, registry: registry })),
React.createElement(Grid, { container: true, spacing: 2 },
properties.map((element, index) =>
// Remove the <Grid> if the inner element is hidden as the <Grid>
// itself would otherwise still take up space.
element.hidden ? (element.content) : (React.createElement(Grid, { item: true, xs: 12, sm: 6, md: 4, lg: 3, xl: 2, key: index, rowSpacing: theme.spacing(1.25) }, element.content))),
canExpand(schema, uiSchema, formData) && (React.createElement(Grid, { container: true, justifyContent: "flex-end" },
React.createElement(Grid, { item: true },
React.createElement(AddButton, { className: "object-property-expand", onClick: onAddClick(schema), disabled: disabled || readonly, uiSchema: uiSchema, registry: registry })))))));
}
export default ObjectFieldTemplate;

0 comments on commit 3a129c8

Please sign in to comment.