tycho-components 0.14.4 → 0.14.5

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
  title: string;
4
4
  subtitle: string | React.ReactNode;
@@ -8,6 +8,7 @@ type Props = {
8
8
  confirmLabel?: string;
9
9
  disableClose?: boolean;
10
10
  disableEscapeClose?: boolean;
11
+ confirmDisabled?: boolean;
11
12
  };
12
- export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, closeLabel, confirmLabel, disableClose, disableEscapeClose, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, closeLabel, confirmLabel, confirmDisabled, disableClose, disableEscapeClose, }: Props): import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Modal } from '@mui/material';
3
- import { useEffect } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
- import { Button, Icon } from 'tycho-storybook';
6
- import './style.scss';
7
- import { attachCloseToEscape, stopEventPropagation } from './AppModalUtils';
8
- export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, closeLabel, confirmLabel, disableClose, disableEscapeClose, }) {
9
- const { t } = useTranslation('common');
2
+ import { Box, Modal } from "@mui/material";
3
+ import { useEffect } from "react";
4
+ import { useTranslation } from "react-i18next";
5
+ import { Button, Icon } from "tycho-storybook";
6
+ import "./style.scss";
7
+ import { attachCloseToEscape, stopEventPropagation } from "./AppModalUtils";
8
+ export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, closeLabel, confirmLabel, confirmDisabled, disableClose, disableEscapeClose, }) {
9
+ const { t } = useTranslation("common");
10
10
  useEffect(() => {
11
11
  if (disableEscapeClose)
12
12
  return;
@@ -20,16 +20,16 @@ export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, c
20
20
  }, children: _jsxs(Box, { className: "modal-container modal-confirm", sx: style, children: [_jsxs("div", { className: "body", children: [_jsx(Icon, { name: "warning", size: "large", filled: true }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { className: "subtitle", children: subtitle })] })] }), _jsxs("div", { className: "footer", children: [_jsx(Button, { onClick: (e) => {
21
21
  stopEventPropagation(e);
22
22
  onClose();
23
- }, text: closeLabel || t('button.cancel'), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: confirmLabel || t('button.confirm') })] })] }) }));
23
+ }, text: closeLabel || t("button.cancel"), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: confirmLabel || t("button.confirm"), disabled: confirmDisabled })] })] }) }));
24
24
  }
25
25
  const style = {
26
- position: 'absolute',
27
- top: '40%',
28
- left: '50%',
29
- transform: 'translate(-50%, -50%)',
30
- width: '30%',
31
- maxWidth: '580px',
32
- borderRadius: 'var(--radius-200)',
26
+ position: "absolute",
27
+ top: "40%",
28
+ left: "50%",
29
+ transform: "translate(-50%, -50%)",
30
+ width: "30%",
31
+ maxWidth: "580px",
32
+ borderRadius: "var(--radius-200)",
33
33
  boxShadow: 24,
34
- bgcolor: 'var(--background-default)',
34
+ bgcolor: "var(--background-default)",
35
35
  };
@@ -1,10 +1,11 @@
1
- import './style.scss';
1
+ import "./style.scss";
2
2
  type Props = {
3
3
  icon?: string;
4
4
  text?: string;
5
5
  desc?: string;
6
6
  children?: React.ReactNode;
7
+ useMarginTop?: boolean;
7
8
  onClick?: () => void;
8
9
  };
9
- export default function AppPlaceholder({ text, desc, children, icon, onClick, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export default function AppPlaceholder({ text, desc, children, icon, useMarginTop, onClick, }: Props): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Icon } from 'tycho-storybook';
3
- import './style.scss';
4
- export default function AppPlaceholder({ text, desc, children, icon = 'contract_delete', onClick, }) {
5
- return (_jsxs("div", { className: "ds-placeholder", onClick: () => onClick && onClick(), onKeyDown: () => onClick && onClick(), children: [_jsx(Icon, { name: icon, weight: "heavy", size: "x-large", filled: true }), text && _jsx("span", { className: "title", children: text }), desc && _jsx("span", { className: "desc", children: desc }), children && children] }));
2
+ import { Icon } from "tycho-storybook";
3
+ import "./style.scss";
4
+ export default function AppPlaceholder({ text, desc, children, icon = "contract_delete", useMarginTop = false, onClick, }) {
5
+ return (_jsxs("div", { className: `ds-placeholder ${useMarginTop ? "with-margin-top" : ""}`, onClick: () => onClick && onClick(), onKeyDown: () => onClick && onClick(), children: [_jsx(Icon, { name: icon, weight: "heavy", size: "x-large", filled: true }), text && _jsx("span", { className: "title", children: text }), desc && _jsx("span", { className: "desc", children: desc }), children && children] }));
6
6
  }
@@ -3,6 +3,10 @@
3
3
  flex-direction: column;
4
4
  text-align: center;
5
5
 
6
+ &.use-margin-top {
7
+ margin-top: 5%;
8
+ }
9
+
6
10
  > .ds-icon {
7
11
  color: var(--icon-on-disabled);
8
12
  margin-bottom: 8px;
@@ -8,6 +8,7 @@ export type AppPage<Type> = {
8
8
  executionTime?: number;
9
9
  totalHits?: number;
10
10
  uid?: string;
11
+ empty?: boolean;
11
12
  };
12
13
  export declare const EMPTY_PAGE: {
13
14
  content: never[];
@@ -1,4 +1,4 @@
1
- import { EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE } from './AppPageable';
1
+ import { EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE } from "./AppPageable";
2
2
  export const EMPTY_PAGE = {
3
3
  content: [],
4
4
  totalElements: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.14.4",
4
+ "version": "0.14.5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {