tycho-components 0.4.13 → 0.4.14

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 './style.scss';
1
+ import "./style.scss";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
4
  title: string;
@@ -18,7 +18,8 @@ type Props = {
18
18
  title: string;
19
19
  action: () => void;
20
20
  };
21
+ alternativeOptions?: React.ReactNode;
21
22
  hideBackdrop?: boolean;
22
23
  };
23
- export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, }: Props): import("react/jsx-runtime").JSX.Element;
24
+ export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, alternativeOptions, }: Props): import("react/jsx-runtime").JSX.Element;
24
25
  export {};
@@ -1,22 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Fade, Modal } from '@mui/material';
3
- import cx from 'classnames';
4
- import { useTranslation } from 'react-i18next';
5
- import { Button, Icon } from 'tycho-storybook';
6
- import './style.scss';
7
- export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, }) {
8
- const { t } = useTranslation('common');
9
- const getClassNames = cx('modal-container', className);
10
- return (_jsx(Modal, { open: true, disableEnforceFocus: true, disableAutoFocus: true, disableRestoreFocus: true, hideBackdrop: hideBackdrop, children: _jsx(Fade, { in: true, onEntered: () => onEntered && onEntered(), children: _jsxs(Box, { className: getClassNames, sx: style, children: [_jsxs("div", { className: "header", children: [_jsxs("div", { className: "titles", children: [_jsx("span", { className: "title", children: title }), subtitle && _jsx("span", { className: "subtitle", children: subtitle })] }), !disableClose && (_jsx(Icon, { name: "close", onClick: close, className: "pointer" }))] }), _jsx("div", { className: "body", children: children }), !hideFooter ? (_jsxs("div", { className: "footer", children: [alternativeButton && (_jsx(Button, { className: "alternative", color: "white", onClick: alternativeButton.action, text: alternativeButton.title })), !disableCancel && (_jsx(Button, { onClick: cancel || close, text: closeLabel || t('button.cancel'), color: "danger" })), confirm && (_jsx(Button, { onClick: confirm, disabled: disableConfirm, text: confirmLabel || t('button.confirm') }))] })) : null] }) }) }));
2
+ import { Box, Fade, Modal } from "@mui/material";
3
+ import cx from "classnames";
4
+ import { useTranslation } from "react-i18next";
5
+ import { Button, Icon } from "tycho-storybook";
6
+ import "./style.scss";
7
+ export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, alternativeOptions, }) {
8
+ const { t } = useTranslation("common");
9
+ const getClassNames = cx("modal-container", className);
10
+ return (_jsx(Modal, { open: true, disableEnforceFocus: true, disableAutoFocus: true, disableRestoreFocus: true, hideBackdrop: hideBackdrop, children: _jsx(Fade, { in: true, onEntered: () => onEntered && onEntered(), children: _jsxs(Box, { className: getClassNames, sx: style, children: [_jsxs("div", { className: "header", children: [_jsxs("div", { className: "titles", children: [_jsx("span", { className: "title", children: title }), subtitle && _jsx("span", { className: "subtitle", children: subtitle })] }), !disableClose && (_jsx(Icon, { name: "close", onClick: close, className: "pointer" }))] }), _jsx("div", { className: "body", children: children }), !hideFooter ? (_jsxs("div", { className: "footer", children: [alternativeButton && alternativeOptions, alternativeButton && (_jsx(Button, { className: "alternative", color: "white", onClick: alternativeButton.action, text: alternativeButton.title })), !disableCancel && (_jsx(Button, { onClick: cancel || close, text: closeLabel || t("button.cancel"), color: "danger" })), confirm && (_jsx(Button, { onClick: confirm, disabled: disableConfirm, text: confirmLabel || t("button.confirm") }))] })) : null] }) }) }));
11
11
  }
12
12
  const style = {
13
- position: 'absolute',
14
- top: '40%',
15
- left: '50%',
16
- transform: 'translate(-50%, -50%)',
17
- width: '50%',
18
- maxWidth: '1080px',
19
- borderRadius: 'var(--radius-200)',
13
+ position: "absolute",
14
+ top: "40%",
15
+ left: "50%",
16
+ transform: "translate(-50%, -50%)",
17
+ width: "50%",
18
+ maxWidth: "1080px",
19
+ borderRadius: "var(--radius-200)",
20
20
  boxShadow: 24,
21
- bgcolor: 'var(--background-default)',
21
+ bgcolor: "var(--background-default)",
22
22
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.4.13",
4
+ "version": "0.4.14",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {