tycho-components 0.7.11 → 0.7.13

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.
@@ -10,5 +10,5 @@ type Props = {
10
10
  hiddenColumns?: string[];
11
11
  filter?: [string, string];
12
12
  };
13
- export default function AppListTable({ columns, data, className, onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export default function AppTableList({ columns, data, className, onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }: Props): import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -1,11 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Paper, TableBody, TableCell, TableContainer, TableHead, TableRow, } from '@mui/material';
2
+ import cx from 'classnames';
3
+ import { ThemeProvider } from '@emotion/react';
4
+ import Table from '@mui/material/Table';
5
+ import TableBody from '@mui/material/TableBody';
6
+ import TableCell from '@mui/material/TableCell';
7
+ import TableContainer from '@mui/material/TableContainer';
8
+ import TableHead from '@mui/material/TableHead';
9
+ import TableRow from '@mui/material/TableRow';
3
10
  import { flexRender, getCoreRowModel, getFilteredRowModel, useReactTable, } from '@tanstack/react-table';
4
- import { Table, ThemeProvider } from 'react-bootstrap';
5
11
  import { tableTheme } from './AppTableTheme';
6
12
  import './styles.scss';
7
13
  import { useEffect } from 'react';
8
- export default function AppListTable({ columns, data, className = '', onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }) {
14
+ export default function AppTableList({ columns, data, className = '', onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }) {
9
15
  const columnVisibility = hiddenColumns?.reduce((acc, key) => {
10
16
  acc[key] = false;
11
17
  return acc;
@@ -33,7 +39,10 @@ export default function AppListTable({ columns, data, className = '', onClickRow
33
39
  table.getColumn(filter[0])?.setFilterValue(undefined);
34
40
  }
35
41
  }, [filter]);
36
- return (_jsx(ThemeProvider, { theme: tableTheme, children: _jsx(Paper, { className: `ds-table ${className}`, children: _jsx(TableContainer, { children: _jsxs(Table, { children: [_jsx(TableHead, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableCell, { style: { width: header.getSize() }, children: header.isPlaceholder
42
+ const tableClass = cx('ds-table', {
43
+ [className || '']: className || '',
44
+ });
45
+ return (_jsx(ThemeProvider, { theme: tableTheme, children: _jsx("div", { className: tableClass, children: _jsx(TableContainer, { children: _jsxs(Table, { children: [_jsx(TableHead, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableCell, { style: { width: header.getSize() }, children: header.isPlaceholder
37
46
  ? null
38
47
  : flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows.map((row) => (_jsx(TableRow, { onClick: () => handleClickRow(row), onMouseEnter: () => onMouseEnter?.(row), onMouseLeave: () => onMouseLeave?.(row), children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id))) })] }) }) }) }));
39
48
  }
@@ -1,6 +1,2 @@
1
1
  import './style.scss';
2
- type Props = {
3
- freeAccess?: boolean;
4
- };
5
- export default function HeaderAppsDesktop({ freeAccess }: Props): import("react/jsx-runtime").JSX.Element;
6
- export {};
2
+ export default function HeaderAppsDesktop(): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Drawer } from '@mui/material';
3
3
  import { useState } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { Button, Icon, IconButton, Tag } from 'tycho-storybook';
5
+ import { Button, Icon, IconButton } from 'tycho-storybook';
6
6
  import { useCorpusUtils } from '../../configs/useCorpusUtils';
7
7
  import { AvailableAppsDesktop } from '../types/App';
8
8
  import './style.scss';
9
- export default function HeaderAppsDesktop({ freeAccess }) {
9
+ export default function HeaderAppsDesktop() {
10
10
  const { t } = useTranslation('header-app');
11
11
  const { getCorpus, hasCorpus } = useCorpusUtils();
12
12
  const [open, setOpen] = useState(false);
@@ -23,7 +23,7 @@ export default function HeaderAppsDesktop({ freeAccess }) {
23
23
  }
24
24
  };
25
25
  const renderItem = (item, idx) => {
26
- return (_jsxs("div", { className: "item", title: t(`${item.code}.desc`), children: [item.icon && (_jsx("div", { className: "icon", children: _jsx(Icon, { name: item.icon }) })), item.image && _jsx("img", { src: item.image }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "label", children: t(`${item.code}.name`) }), _jsx("span", { className: "sublabel", children: t(`${item.code}.desc`) })] }), _jsxs("div", { className: "options", children: [item.visibility && (_jsx(Tag, { text: t(`common:label.${item.visibility}`), size: "small", color: "green" })), item.external ? (_jsx(Button, { text: t('common:button.open'), size: "x-small", mode: "tonal", icon: "open_in_new", onClick: () => window.open(item.external, '_blank') })) : (_jsxs(_Fragment, { children: [_jsx(Button, { text: t('common:button.open'), size: "x-small", mode: "tonal", onClick: () => goto(item, false) }), _jsx(IconButton, { name: "open_in_new", size: "x-small", className: "icon-open", mode: "tonal", onClick: () => goto(item, true) })] }))] })] }, idx.valueOf()));
26
+ return (_jsxs("div", { className: "item", title: t(`${item.code}.desc`), onClick: () => goto(item, false), children: [item.icon && (_jsx("div", { className: "icon", children: _jsx(Icon, { name: item.icon }) })), item.image && _jsx("img", { src: item.image }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "label", children: t(`${item.code}.name`) }), _jsx("span", { className: "sublabel", style: { maxWidth: '16vw' }, children: t(`${item.code}.desc`) })] }), _jsx("div", { className: "options", children: _jsx(Button, { text: t('common:button.open'), size: "x-small", mode: "tonal" }) })] }, idx.valueOf()));
27
27
  };
28
28
  return (_jsxs("div", { className: "header-apps-container", children: [_jsx(IconButton, { name: "apps", className: "icon-apps", size: "large", onClick: () => setOpen(!open), filledIcon: true }), open && (_jsxs(Drawer, { anchor: "left", open: true, onClose: () => setOpen(false), className: "offcanvas-apps", children: [_jsxs("div", { className: "header", children: [_jsx("span", { className: "label", children: t('header:label.platform') }), _jsx(IconButton, { name: "close", size: "x-small", mode: "ghost", onClick: () => setOpen(false) })] }), _jsxs("div", { className: "body", children: [_jsx("div", { className: "title", children: t('label.tools') }), AvailableAppsDesktop.map((item, idx) => renderItem(item, idx))] })] }))] }));
29
29
  }
@@ -5,8 +5,9 @@
5
5
  cursor: pointer;
6
6
  margin-left: auto;
7
7
  margin-right: auto;
8
+ width: 50%;
8
9
 
9
- > span {
10
+ >span {
10
11
  margin-right: var(--spacing-200);
11
12
  margin-left: var(--spacing-200);
12
13
  @include label-large-1;
@@ -21,14 +22,14 @@
21
22
  }
22
23
 
23
24
  .modal-corpora {
24
- > .body {
25
+ >.body {
25
26
  display: flex;
26
27
  flex-wrap: wrap;
27
28
  gap: 12px;
28
29
  max-height: 40vh;
29
30
  overflow-y: auto;
30
31
 
31
- > .item {
32
+ >.item {
32
33
  display: flex;
33
34
  flex-direction: column;
34
35
  justify-content: center;
@@ -47,9 +48,9 @@
47
48
  height: 48px;
48
49
  }
49
50
 
50
- > span {
51
+ >span {
51
52
  text-align: center;
52
53
  }
53
54
  }
54
55
  }
55
- }
56
+ }
@@ -29,7 +29,7 @@ export const HeaderAppTexts = {
29
29
  'platform.name': 'Tycho Brahe Platform',
30
30
  'platform.desc': "Access the project's public website.",
31
31
  'settings.name': 'Settings',
32
- 'settings.desc': 'Manage your account settings and preferences.',
32
+ 'settings.desc': 'Manage account settings and preferences for you and your corpora.',
33
33
  },
34
34
  'pt-BR': {
35
35
  'label.tools': 'Ferramentas',
@@ -61,7 +61,7 @@ export const HeaderAppTexts = {
61
61
  'platform.name': 'Platforma Tycho Brahe',
62
62
  'platform.desc': 'Acesse o site público do projeto.',
63
63
  'settings.name': 'Configurações',
64
- 'settings.desc': 'Gerencie suas configurações e preferências.',
64
+ 'settings.desc': 'Gerencie configurações e preferências da sua conta e dos seus corpora.',
65
65
  },
66
66
  it: {
67
67
  'label.tools': 'Strumenti',
@@ -93,6 +93,6 @@ export const HeaderAppTexts = {
93
93
  'platform.name': 'Piattaforma Tycho Brahe',
94
94
  'platform.desc': 'Accedi al sito pubblico del progetto.',
95
95
  'settings.name': 'Impostazioni',
96
- 'settings.desc': 'Gestisci le tue impostazioni e preferenze.',
96
+ 'settings.desc': 'Gestisci le impostazioni e le preferenze della tua conta e dei tuoi corpora.',
97
97
  },
98
98
  };
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export { default as AppPicture } from "./AppPicture";
22
22
  export { default as AppPlaceholder } from "./AppPlaceholder";
23
23
  export { default as AppSelect } from "./AppSelect";
24
24
  export { default as AppTable } from "./AppTable";
25
- export { default as AppListTable } from "./AppTable/AppListTable";
25
+ export { default as AppTableList } from "./AppTable/AppTableList";
26
26
  export { EMPTY_GRID_PAGE, EMPTY_PAGE } from "./AppTable/types/AppPage";
27
27
  export type { AppPage } from "./AppTable/types/AppPage";
28
28
  export { convertPageable, EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE, } from "./AppTable/types/AppPageable";
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ export { default as AppPicture } from "./AppPicture";
17
17
  export { default as AppPlaceholder } from "./AppPlaceholder";
18
18
  export { default as AppSelect } from "./AppSelect";
19
19
  export { default as AppTable } from "./AppTable";
20
- export { default as AppListTable } from "./AppTable/AppListTable";
20
+ export { default as AppTableList } from "./AppTable/AppTableList";
21
21
  export { EMPTY_GRID_PAGE, EMPTY_PAGE } from "./AppTable/types/AppPage";
22
22
  export { convertPageable, EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE, } from "./AppTable/types/AppPageable";
23
23
  export { default as AppToast } from "./AppToast";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.7.11",
4
+ "version": "0.7.13",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {