tycho-components 0.2.8 → 0.2.10

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.
@@ -7,6 +7,7 @@ export type AppPage<Type> = {
7
7
  seed: number;
8
8
  executionTime?: number;
9
9
  totalHits?: number;
10
+ uid?: string;
10
11
  };
11
12
  export declare const EMPTY_PAGE: {
12
13
  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,
@@ -5,6 +5,6 @@ import { IconButton } from 'tycho-storybook';
5
5
  import HelpModal from './HelpModal';
6
6
  export default function HelpButton({ helpActions }) {
7
7
  const { t } = useTranslation('header');
8
- const [isModalOpen, setIsModalOpen] = useState(false);
9
- return (_jsxs(_Fragment, { children: [_jsx(IconButton, { name: "live_help", size: "medium", title: t('tooltip.tutorials'), onClick: () => setIsModalOpen(true) }), isModalOpen && (_jsx(HelpModal, { onClose: () => setIsModalOpen(false), helpActions: helpActions }))] }));
8
+ const [open, setOpen] = useState(false);
9
+ return (_jsxs(_Fragment, { children: [_jsx(IconButton, { name: "live_help", size: "medium", title: t('tooltip.tutorials'), onClick: () => setOpen(true) }), open && (_jsx(HelpModal, { onClose: () => setOpen(false), helpActions: helpActions }))] }));
10
10
  }
@@ -23,8 +23,12 @@ export default function HelpModal({ onClose, helpActions = [] }) {
23
23
  }
24
24
  onClose();
25
25
  };
26
+ const handleCustomAction = (item) => {
27
+ item.action();
28
+ onClose();
29
+ };
26
30
  const handleAutoOpenToggle = (event) => {
27
31
  Storage.setTourAutoOpen(event.target.checked);
28
32
  };
29
- return (_jsxs(AppModal, { title: t('modal.title') || 'Help Center', close: onClose, hideFooter: true, className: "help-modal", children: [_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: t('title.tutorials') }), _jsx("div", { className: "desc", children: t('description.tutorials') }), _jsx(Button, { text: t('button.open', { title: t('title.tutorials') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTutorials })] }), _jsxs("div", { className: "item d-none", children: [_jsx("div", { className: "title", children: t('title.tour') }), _jsx("div", { className: "desc", children: t('description.tour') }), _jsxs("label", { className: "help-checkbox-label", children: [_jsx("input", { type: "checkbox", checked: isAutoOpenEnabled, onChange: handleAutoOpenToggle, className: "help-checkbox" }), _jsx("span", { children: t('checkbox.autoOpen') })] }), _jsx(Button, { text: t('button.open', { title: t('title.tour') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTourToggle })] }), helpActions.map((item, idx) => (_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: item.title }), _jsx("div", { className: "desc", children: item.desc }), _jsx(Button, { text: t('button.open', { title: item.title }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: item.action })] }, idx)))] }));
33
+ return (_jsxs(AppModal, { title: t('modal.title') || 'Help Center', close: onClose, hideFooter: true, className: "help-modal", children: [_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: t('title.tutorials') }), _jsx("div", { className: "desc", children: t('description.tutorials') }), _jsx(Button, { text: t('button.open', { title: t('title.tutorials') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTutorials })] }), _jsxs("div", { className: "item d-none", children: [_jsx("div", { className: "title", children: t('title.tour') }), _jsx("div", { className: "desc", children: t('description.tour') }), _jsxs("label", { className: "help-checkbox-label", children: [_jsx("input", { type: "checkbox", checked: isAutoOpenEnabled, onChange: handleAutoOpenToggle, className: "help-checkbox" }), _jsx("span", { children: t('checkbox.autoOpen') })] }), _jsx(Button, { text: t('button.open', { title: t('title.tour') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTourToggle })] }), helpActions.map((item, idx) => (_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: item.title }), _jsx("div", { className: "desc", children: item.desc }), _jsx(Button, { text: t('button.open', { title: item.title }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: () => handleCustomAction(item) })] }, idx)))] }));
30
34
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.2.8",
4
+ "version": "0.2.10",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {