tycho-components 0.16.5 → 0.17.1

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.
Files changed (43) hide show
  1. package/dist/AppReplaceAll/AppReplaceAll.d.ts +2 -0
  2. package/dist/{Header/HeaderReplaceAll/HeaderReplaceAll.js → AppReplaceAll/AppReplaceAll.js} +9 -6
  3. package/dist/AppReplaceAll/index.d.ts +2 -0
  4. package/dist/AppReplaceAll/index.js +2 -0
  5. package/dist/AppReplaceAll/style.scss +11 -0
  6. package/dist/Comments/HeaderNotifications/HeaderNotifications.d.ts +2 -1
  7. package/dist/Comments/HeaderNotifications/HeaderNotifications.js +2 -2
  8. package/dist/Header/Header.d.ts +1 -2
  9. package/dist/Header/Header.js +3 -14
  10. package/dist/Header/HeaderApps/HeaderApps.d.ts +14 -1
  11. package/dist/Header/HeaderApps/HeaderApps.js +18 -6
  12. package/dist/Header/HeaderApps/style.scss +65 -56
  13. package/dist/Header/HeaderApps/youtube.png +0 -0
  14. package/dist/Header/HeaderButtons/HeaderButtons.d.ts +16 -0
  15. package/dist/Header/HeaderButtons/HeaderButtons.js +18 -0
  16. package/dist/Header/HeaderButtons/index.d.ts +2 -0
  17. package/dist/Header/HeaderButtons/index.js +2 -0
  18. package/dist/Header/HeaderButtons/styles.scss +0 -0
  19. package/dist/Header/HeaderCorpora/HeaderCorpora.js +0 -2
  20. package/dist/Header/HeaderCorpora/HeaderCorpus.js +1 -1
  21. package/dist/Header/HeaderCorpora/style.scss +30 -6
  22. package/dist/Header/HeaderUser/HeaderUser.d.ts +1 -1
  23. package/dist/Header/HeaderUser/HeaderUser.js +9 -9
  24. package/dist/Header/HeaderUser/style.scss +1 -1
  25. package/dist/Header/HelpButton/HelpButton.d.ts +2 -1
  26. package/dist/Header/HelpButton/HelpButton.js +2 -2
  27. package/dist/Header/styles.scss +42 -14
  28. package/dist/Header/types/App.js +15 -15
  29. package/dist/LanguageSelector/LanguageSelector.d.ts +4 -1
  30. package/dist/LanguageSelector/LanguageSelector.js +3 -3
  31. package/dist/LanguageSelector/styles.scss +19 -0
  32. package/dist/configs/Localization.d.ts +143 -136
  33. package/dist/configs/localization/HeaderAppTexts.d.ts +87 -83
  34. package/dist/configs/localization/HeaderAppTexts.js +87 -83
  35. package/dist/configs/localization/HeaderTexts.d.ts +58 -55
  36. package/dist/configs/localization/HeaderTexts.js +58 -55
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +1 -0
  39. package/package.json +1 -1
  40. package/dist/Header/HeaderReplaceAll/HeaderReplaceAll.d.ts +0 -2
  41. package/dist/Header/HeaderReplaceAll/index.d.ts +0 -2
  42. package/dist/Header/HeaderReplaceAll/index.js +0 -2
  43. package/dist/Header/HeaderReplaceAll/style.scss +0 -24
@@ -0,0 +1,2 @@
1
+ import './style.scss';
2
+ export default function AppReplaceAll(): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button, Popover } from '@mui/material';
2
+ import { Popover } from '@mui/material';
3
3
  import { useState } from 'react';
4
+ import { useForm } from 'react-hook-form';
4
5
  import { useTranslation } from 'react-i18next';
5
- import { IconButton, getCurrentInput, getCurrentOnChange, } from 'tycho-storybook';
6
+ import { Button, IconButton, TextField, getCurrentInput, getCurrentOnChange, } from 'tycho-storybook';
6
7
  import './style.scss';
7
- export default function HeaderReplaceAll() {
8
+ export default function AppReplaceAll() {
8
9
  const { t } = useTranslation('header');
9
- const [findValue, setFindValue] = useState('');
10
- const [replaceValue, setReplaceValue] = useState('');
10
+ const replaceForm = useForm({
11
+ defaultValues: { find: '', replace: '' },
12
+ });
11
13
  const [anchorEl, setAnchorEl] = useState(null);
12
14
  const replaceAll = (str, find, replace) => {
13
15
  // Escape special regex characters in 'find'
@@ -16,6 +18,7 @@ export default function HeaderReplaceAll() {
16
18
  return str.replace(regex, replace);
17
19
  };
18
20
  const handleReplaceAll = () => {
21
+ const { find: findValue, replace: replaceValue } = replaceForm.getValues();
19
22
  const input = getCurrentInput();
20
23
  const onChange = getCurrentOnChange();
21
24
  if (input && onChange) {
@@ -39,5 +42,5 @@ export default function HeaderReplaceAll() {
39
42
  }, transformOrigin: {
40
43
  vertical: 'top',
41
44
  horizontal: 'left',
42
- }, className: "popover-replace", children: _jsxs("div", { className: "popover-body", children: [_jsx("input", { type: "text", placeholder: t('replace.find.placeholder'), value: findValue, onChange: (e) => setFindValue(e.target.value) }), _jsx("input", { type: "text", placeholder: t('replace.placeholder'), value: replaceValue, onChange: (e) => setReplaceValue(e.target.value) }), _jsx(Button, { size: "small", onClick: handleReplaceAll, children: "confirm" })] }) })] }));
45
+ }, className: "popover-replace", children: _jsxs("div", { className: "popover-body", children: [_jsx(TextField, { label: t('replace.find.placeholder'), attr: "find", createdForm: replaceForm, showEndAdornment: false, placeholder: t('replace.find.placeholder'), width: "12vw" }), _jsx(TextField, { label: t('replace.placeholder'), attr: "replace", createdForm: replaceForm, showEndAdornment: false, placeholder: t('replace.placeholder'), width: "12vw" }), _jsx(Button, { text: t('common:button.confirm'), size: "small", onClick: handleReplaceAll })] }) })] }));
43
46
  }
@@ -0,0 +1,2 @@
1
+ import AppReplaceAll from './AppReplaceAll';
2
+ export default AppReplaceAll;
@@ -0,0 +1,2 @@
1
+ import AppReplaceAll from './AppReplaceAll';
2
+ export default AppReplaceAll;
@@ -0,0 +1,11 @@
1
+ .popover-replace {
2
+ width: 16vw !important;
3
+
4
+ .popover-body {
5
+ display: flex;
6
+ flex-direction: column;
7
+ justify-content: center;
8
+ gap: 8px;
9
+ padding: 8px;
10
+ }
11
+ }
@@ -2,6 +2,7 @@ import './style.scss';
2
2
  type Props = {
3
3
  uid: string;
4
4
  mode: 'lexicon' | 'corpus' | 'parser';
5
+ mobile?: boolean;
5
6
  };
6
- export default function HeaderNotifications({ uid, mode }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export default function HeaderNotifications({ uid, mode, mobile }: Props): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -6,7 +6,7 @@ import { Avatar, IconButton } from 'tycho-storybook';
6
6
  import DateUtils from '../../functions/DateUtils';
7
7
  import CommentService from '../types/CommentService';
8
8
  import './style.scss';
9
- export default function HeaderNotifications({ uid, mode }) {
9
+ export default function HeaderNotifications({ uid, mode, mobile }) {
10
10
  const navigate = useNavigate();
11
11
  const { t } = useTranslation('comments');
12
12
  const [open, setOpen] = useState(false);
@@ -31,7 +31,7 @@ export default function HeaderNotifications({ uid, mode }) {
31
31
  useEffect(() => {
32
32
  load();
33
33
  }, [uid, tab]);
34
- return (_jsxs("div", { className: "ds-dropdown-container notifications-container", children: [_jsx(IconButton, { name: "notifications_active", className: comments && comments.length > 0 ? 'shake' : '', size: "medium", onClick: () => setOpen(!open) }), open && (_jsx("div", { className: "ds-dropdown-list", children: _jsxs("div", { className: "notifications-panel", children: [_jsxs("div", { className: "header", children: [_jsx("span", { children: t('notification.title') }), _jsx(IconButton, { name: "close", size: "small", mode: "ghost", onClick: () => setOpen(false) })] }), _jsxs("div", { className: "tabs", children: [_jsxs("button", { className: tab === 'unread' ? 'active-tab' : '', onClick: () => setTab('unread'), children: [t('notification.unread'), " (", comments?.length || 0, ")"] }), _jsx("button", { className: tab === 'read' ? 'active-tab' : '', onClick: () => setTab('read'), children: t('notification.all') })] }), _jsxs("div", { className: "content", children: [notifications &&
34
+ return (_jsxs("div", { className: "ds-dropdown-container notifications-container", children: [_jsx(IconButton, { name: "notifications_active", className: comments && comments.length > 0 ? 'shake' : '', size: "medium", onClick: () => setOpen(!open), mode: mobile ? 'outlined' : 'filled' }), open && (_jsx("div", { className: "ds-dropdown-list", children: _jsxs("div", { className: "notifications-panel", children: [_jsxs("div", { className: "header", children: [_jsx("span", { children: t('notification.title') }), _jsx(IconButton, { name: "close", size: "small", mode: "ghost", onClick: () => setOpen(false) })] }), _jsxs("div", { className: "tabs", children: [_jsxs("button", { className: tab === 'unread' ? 'active-tab' : '', onClick: () => setTab('unread'), children: [t('notification.unread'), " (", comments?.length || 0, ")"] }), _jsx("button", { className: tab === 'read' ? 'active-tab' : '', onClick: () => setTab('read'), children: t('notification.all') })] }), _jsxs("div", { className: "content", children: [notifications &&
35
35
  notifications.map((not, idx) => (_jsxs("div", { className: "item", onClick: () => handleOpen(not), children: [_jsx(Avatar, { src: not.picture, size: "small" }), _jsxs("div", { className: "message", children: [_jsx("span", { className: "text", children: _jsx(Trans, { t: t, i18nKey: "notification.text", values: {
36
36
  user: not.name,
37
37
  entry: not.keywords ? not.keywords['entry'] : '',
@@ -5,7 +5,6 @@ type Props = {
5
5
  redirect?: string;
6
6
  autoload?: boolean;
7
7
  hideKeyboard?: boolean;
8
- hideReplaceAll?: boolean;
9
8
  parser?: boolean;
10
9
  customHeader?: React.ReactNode;
11
10
  notifications?: {
@@ -20,5 +19,5 @@ type Props = {
20
19
  helpActions?: HelpAction[];
21
20
  useOpenCorpora?: boolean;
22
21
  };
23
- export default function Header({ tool, redirect, autoload, hideKeyboard, hideReplaceAll, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged, helpActions, useOpenCorpora, }: Props): import("react/jsx-runtime").JSX.Element;
22
+ export default function Header({ tool, redirect, autoload, hideKeyboard, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged, helpActions, useOpenCorpora, }: Props): import("react/jsx-runtime").JSX.Element;
24
23
  export {};
@@ -1,28 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
- import { useState } from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
- import { IconButton } from 'tycho-storybook';
6
- import HeaderNotifications from '../Comments/HeaderNotifications';
7
- import LanguageSelector from '../LanguageSelector';
8
- import VirtualKeyboard from '../VirtualKeyboard';
9
- import { useCorpusUtils } from '../configs/useCorpusUtils';
10
- import { useLoggedUtils } from '../configs/useLoggedUtils';
11
4
  import HeaderApps from './HeaderApps';
5
+ import HeaderButtons from './HeaderButtons';
12
6
  import HeaderCorpora from './HeaderCorpora/HeaderCorpora';
13
- import HeaderReplaceAll from './HeaderReplaceAll';
14
7
  import HeaderUser from './HeaderUser';
15
- import HelpButton from './HelpButton';
16
8
  import './styles.scss';
17
- export default function Header({ tool, redirect, autoload, hideKeyboard, hideReplaceAll, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged = () => {
9
+ export default function Header({ tool, redirect, autoload, hideKeyboard, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged = () => {
18
10
  location.href = '/auth';
19
11
  }, helpActions, useOpenCorpora = true, }) {
20
12
  const { t } = useTranslation('header');
21
- const { getCorpus } = useCorpusUtils();
22
- const { isLogged } = useLoggedUtils();
23
- const [openKeyboard, setOpenKeyboard] = useState(false);
24
13
  const homeTextsClass = cx('app-title', {
25
14
  pointer: navigateHome !== undefined,
26
15
  });
27
- return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, {}), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] })] }), _jsx("div", { className: "header-center", children: customHeader ? (customHeader) : (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, navigateCorpora: navigateCorpora, useOpenCorpora: useOpenCorpora })) }), _jsxs("div", { className: "header-right", children: [!hideReplaceAll && _jsx(HeaderReplaceAll, {}), !hideKeyboard && (_jsx(IconButton, { onClick: () => setOpenKeyboard(!openKeyboard), name: "keyboard", size: "medium", title: t('tooltip.keyboard') })), _jsx(HelpButton, { helpActions: helpActions }), notifications && isLogged() && (_jsx(HeaderNotifications, { uid: notifications.ref, mode: notifications.mode })), _jsx(LanguageSelector, {}), _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged })] }), openKeyboard && (_jsx(VirtualKeyboard, { onClose: () => setOpenKeyboard(false), closeLabel: t('button.close'), defaultLayout: keyboardLayout || getCorpus().keyboardLayout || 'english' }))] }));
16
+ return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged, hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions }), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] }), _jsx("div", { className: "header-corpus", children: customHeader ? (customHeader) : (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, navigateCorpora: navigateCorpora, useOpenCorpora: useOpenCorpora })) })] }), _jsxs("div", { className: "header-right", children: [_jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions }), _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged })] })] }));
28
17
  }
@@ -1,2 +1,15 @@
1
+ import { HelpAction } from '../HelpButton/HelpButton';
1
2
  import './style.scss';
2
- export default function HeaderApps(): import("react/jsx-runtime").JSX.Element;
3
+ type Props = {
4
+ navigateLogout?: () => void;
5
+ navigateNotLogged: () => void;
6
+ hideKeyboard?: boolean;
7
+ notifications?: {
8
+ mode: 'corpus' | 'parser' | 'lexicon';
9
+ ref: string;
10
+ };
11
+ keyboardLayout?: string;
12
+ helpActions?: HelpAction[];
13
+ };
14
+ export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, }: Props): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -1,14 +1,17 @@
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 { Icon, IconButton, Tag } from 'tycho-storybook';
6
6
  import { useCorpusUtils } from '../../configs/useCorpusUtils';
7
7
  import { useLoggedUtils } from '../../configs/useLoggedUtils';
8
+ import HeaderButtons from '../HeaderButtons';
9
+ import HeaderUser from '../HeaderUser';
8
10
  import { AvailableApps } from '../types/App';
9
11
  import logo from './logo.png';
12
+ import youtube from './youtube.png';
10
13
  import './style.scss';
11
- export default function HeaderApps() {
14
+ export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, }) {
12
15
  const { t } = useTranslation('header-app');
13
16
  const { getCorpus, hasCorpus } = useCorpusUtils();
14
17
  const { hasLexiconAccess, hasParserAccess, isAdminOfAnyCorpus, isLogged } = useLoggedUtils();
@@ -34,15 +37,24 @@ export default function HeaderApps() {
34
37
  return null;
35
38
  if (item.parser && !hasParserAccess())
36
39
  return null;
37
- 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()));
40
+ return (_jsxs("div", { className: "item", title: t(`${item.code}.desc`), onClick: () => goto(item, item.external ? true : false), children: [item.icon && _jsx(Icon, { name: item.icon, size: "medium" }), item.image && _jsx("img", { src: item.image }), _jsx("span", { className: "title-app", children: t(`${item.code}.name`) }), _jsxs("div", { className: "options", children: [item.visibility && (_jsx(Tag, { text: t(`common:label.${item.visibility}`), size: "small", color: "green", className: "d-none" })), _jsx(IconButton, { name: "open_in_new", size: "x-small", className: "icon-open", mode: "ghost", onClick: (e) => {
41
+ e.stopPropagation();
42
+ goto(item, true);
43
+ }, title: t('label.open.tab') })] })] }, idx.valueOf()));
38
44
  };
39
- 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') }), AvailableApps.map((item, idx) => renderItem(item, idx))] }), _jsxs("div", { className: "footer", children: [_jsx("div", { className: "title", children: t('label.quick') }), quickAccess.map((item, idx) => renderItem(item, idx))] })] }))] }));
45
+ 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(IconButton, { name: "close", size: "medium", mode: "ghost", iconSize: "medium", onClick: () => setOpen(false) }), _jsx("span", { className: "header-apps-title", children: t('header:label.platform.complete') }), _jsx("div", { className: "header-profile-apps", children: _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged }) })] }), _jsxs("div", { className: "body", children: [_jsx("div", { className: "title", children: t('label.tools') }), AvailableApps.map((item, idx) => renderItem(item, idx)), _jsx("div", { className: "title", children: t('label.quick') }), resources.map((item, idx) => renderItem(item, idx))] }), _jsx("div", { className: "footer", children: _jsx("div", { className: "header-apps-buttons", children: _jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, mobile: true }) }) })] }))] }));
40
46
  }
41
- const quickAccess = [
47
+ const resources = [
42
48
  {
43
49
  code: 'platform',
44
50
  image: logo,
45
51
  visibility: 'public',
46
52
  external: 'https://www.tycho.iel.unicamp.br',
47
53
  },
54
+ {
55
+ code: 'youtube',
56
+ image: youtube,
57
+ visibility: 'public',
58
+ external: 'https://www.youtube.com/@tychoplatform',
59
+ },
48
60
  ];
@@ -1,42 +1,44 @@
1
1
  .offcanvas-apps {
2
2
  border: 1px solid var(--border-subtle-1);
3
3
  background-color: var(--background-default);
4
- width: 26vw;
4
+ width: 16vw;
5
5
 
6
6
  > .MuiPaper-root {
7
- width: 26vw;
7
+ width: 16vw;
8
8
 
9
9
  > .header {
10
10
  display: flex;
11
11
  align-items: center;
12
- border-bottom: 1px solid var(--border-subtle-1);
13
- padding: 16px;
12
+ padding: 8px 16px;
13
+ gap: 16px;
14
14
 
15
- > .label {
15
+ > .header-apps-title {
16
16
  @include label-large-1;
17
17
  color: var(--text-primary);
18
18
  }
19
19
 
20
- > .ds-icon-button {
21
- margin-left: auto;
20
+ .header-profile-apps {
21
+ display: none;
22
22
  }
23
23
  }
24
24
 
25
- > .body,
26
- .footer {
27
- padding: var(--spacing-250) 0;
25
+ > .body {
26
+ > .header-apps-buttons {
27
+ display: none;
28
+ }
28
29
 
29
30
  > .title {
30
31
  @include tag-medium-1;
31
32
  color: var(--text-tertiary);
32
- padding: 0px var(--spacing-250) var(--spacing-150);
33
+ padding: 16px;
34
+ border-top: 1px solid var(--border-subtle-1);
33
35
  }
34
36
 
35
37
  > .item {
36
38
  display: flex;
37
39
  align-items: center;
38
- gap: 8px;
39
- padding: var(--spacing-100) var(--spacing-250);
40
+ gap: 24px;
41
+ padding: 8px 20px;
40
42
  cursor: pointer;
41
43
 
42
44
  &:hover {
@@ -57,30 +59,13 @@
57
59
  }
58
60
 
59
61
  > img {
60
- width: 40px;
61
- height: 40px;
62
+ width: 32px;
63
+ height: 32px;
62
64
  }
63
65
 
64
- > .texts {
65
- display: flex;
66
- flex-direction: column;
67
- gap: 4px;
68
-
69
- > .label {
70
- @include label-medium-2;
71
- color: var(--text-primary);
72
- }
73
-
74
- > .sublabel {
75
- @include helper-medium-1;
76
- color: var(--text-secondary);
77
- white-space: nowrap;
78
- overflow: hidden;
79
- text-overflow: ellipsis;
80
- display: inline-block;
81
- max-width: 12vw;
82
- line-height: 1.2;
83
- }
66
+ > .title-app {
67
+ @include label-medium-1;
68
+ color: var(--text-primary);
84
69
  }
85
70
 
86
71
  > .options {
@@ -99,51 +84,75 @@
99
84
 
100
85
  > .footer {
101
86
  border-top: 1px solid var(--border-subtle-1);
87
+ display: none;
102
88
  }
103
89
  }
104
90
  }
105
91
 
106
- @media (max-width: 1200px) {
107
- .offcanvas-apps {
108
- width: 30vw;
109
- }
110
- }
111
-
112
- @media (max-width: 960px) {
113
- .offcanvas-apps {
114
- width: 35vw;
92
+ @media (max-width: 1366px) {
93
+ .offcanvas-apps,
94
+ .offcanvas-apps > .MuiPaper-root {
95
+ width: 26vw;
115
96
  }
116
97
  }
117
98
 
118
- @media (max-width: 1400px) {
99
+ @media (max-width: 1024px) {
119
100
  .offcanvas-apps,
120
101
  .offcanvas-apps > .MuiPaper-root {
121
- width: 40vw;
102
+ width: 30%;
122
103
 
123
- .sublabel {
124
- max-width: 20vw !important;
104
+ .body {
105
+ .icon-open {
106
+ display: none;
107
+ }
125
108
  }
126
109
  }
127
110
  }
128
111
 
129
- @media (max-width: 1024px) {
112
+ @media (max-width: 768px) {
130
113
  .offcanvas-apps,
131
114
  .offcanvas-apps > .MuiPaper-root {
132
- width: 50vw;
115
+ width: 40%;
133
116
 
134
- .sublabel {
135
- max-width: 25vw !important;
117
+ .body {
118
+ .icon-open {
119
+ display: none;
120
+ }
136
121
  }
137
122
  }
138
123
  }
139
124
 
140
- @media (max-width: 768px) {
125
+ @media (max-width: 767px) {
141
126
  .offcanvas-apps,
142
127
  .offcanvas-apps > .MuiPaper-root {
143
- width: 100%;
128
+ width: 80%;
129
+
130
+ .header {
131
+ padding: 4px 8px;
132
+
133
+ .header-profile-apps {
134
+ display: block;
135
+ margin-left: auto;
136
+ }
137
+ }
144
138
 
145
- .sublabel {
146
- max-width: 65vw !important;
139
+ .body {
140
+ .icon-open {
141
+ display: none;
142
+ }
143
+ }
144
+
145
+ .footer {
146
+ margin-top: auto;
147
+ display: block;
148
+
149
+ > .header-apps-buttons {
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ gap: 16px;
154
+ padding: 8px 16px;
155
+ }
147
156
  }
148
157
  }
149
158
  }
@@ -0,0 +1,16 @@
1
+ import { HelpAction } from '../HelpButton/HelpButton';
2
+ import './styles.scss';
3
+ type Props = {
4
+ hideKeyboard?: boolean;
5
+ notifications?: {
6
+ mode: 'corpus' | 'parser' | 'lexicon';
7
+ ref: string;
8
+ };
9
+ keyboardLayout?: string;
10
+ navigateHome?: () => void;
11
+ navigateCorpora?: (uid: string) => void;
12
+ helpActions?: HelpAction[];
13
+ mobile?: boolean;
14
+ };
15
+ export default function HeaderButtons({ hideKeyboard, notifications, keyboardLayout, helpActions, mobile, }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { IconButton } from 'tycho-storybook';
5
+ import HeaderNotifications from '../../Comments/HeaderNotifications';
6
+ import LanguageSelector from '../../LanguageSelector';
7
+ import VirtualKeyboard from '../../VirtualKeyboard';
8
+ import { useCorpusUtils } from '../../configs/useCorpusUtils';
9
+ import { useLoggedUtils } from '../../configs/useLoggedUtils';
10
+ import HelpButton from '../HelpButton';
11
+ import './styles.scss';
12
+ export default function HeaderButtons({ hideKeyboard, notifications, keyboardLayout, helpActions, mobile, }) {
13
+ const { t } = useTranslation('header');
14
+ const { getCorpus } = useCorpusUtils();
15
+ const { isLogged } = useLoggedUtils();
16
+ const [openKeyboard, setOpenKeyboard] = useState(false);
17
+ return (_jsxs(_Fragment, { children: [!hideKeyboard && (_jsx(IconButton, { onClick: () => setOpenKeyboard(!openKeyboard), name: "keyboard", size: "medium", title: t('tooltip.keyboard'), mode: mobile ? 'outlined' : 'filled' })), _jsx(HelpButton, { helpActions: helpActions, mobile: mobile }), notifications && isLogged() && (_jsx(HeaderNotifications, { uid: notifications.ref, mode: notifications.mode, mobile: mobile })), _jsx(LanguageSelector, { openToTop: mobile ? true : false, mobile: mobile }), openKeyboard && (_jsx(VirtualKeyboard, { onClose: () => setOpenKeyboard(false), closeLabel: t('button.close'), defaultLayout: keyboardLayout || getCorpus().keyboardLayout || 'english' }))] }));
18
+ }
@@ -0,0 +1,2 @@
1
+ import HeaderButtons from './HeaderButtons';
2
+ export default HeaderButtons;
@@ -0,0 +1,2 @@
1
+ import HeaderButtons from './HeaderButtons';
2
+ export default HeaderButtons;
File without changes
@@ -5,14 +5,12 @@ import { useParams } from 'react-router-dom';
5
5
  import AppModal from '../../AppModal';
6
6
  import AppPicture from '../../AppPicture';
7
7
  import { useCorpusUtils } from '../../configs/useCorpusUtils';
8
- import { useLoggedUtils } from '../../configs/useLoggedUtils';
9
8
  import CorpusService from '../types/CorpusService';
10
9
  import HeaderCorpus from './HeaderCorpus';
11
10
  import './style.scss';
12
11
  export default function HeaderCorpora({ navigateCorpora, redirect, autoload, useOpenCorpora, }) {
13
12
  const { t } = useTranslation('header');
14
13
  const { setCorpus, getCorpus, hasCorpus } = useCorpusUtils();
15
- const { isLogged } = useLoggedUtils();
16
14
  const { uid } = useParams();
17
15
  const [corpora, setCorpora] = useState([]);
18
16
  const [openCorpora, setOpenCorpora] = useState(false);
@@ -4,5 +4,5 @@ import { useCorpusUtils } from '../../configs/useCorpusUtils';
4
4
  import './style.scss';
5
5
  export default function HeaderCorpus({ onClick }) {
6
6
  const { getCorpus, hasCorpus } = useCorpusUtils();
7
- return (_jsx(_Fragment, { children: hasCorpus() && (_jsxs("div", { className: "header-corpus-container", onClick: onClick, children: [_jsx(AppPicture, { src: getCorpus().picture, title: getCorpus().name, className: "header-corpus-image" }), _jsx("span", { children: getCorpus().name })] })) }));
7
+ return (_jsx(_Fragment, { children: hasCorpus() && (_jsxs("div", { className: "header-corpus-container", onClick: onClick, children: [_jsx(AppPicture, { src: getCorpus().picture, title: getCorpus().name, className: "header-corpus-image" }), _jsx("span", { className: "header-corpus-name", children: getCorpus().name })] })) }));
8
8
  }
@@ -2,19 +2,25 @@
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
5
+ gap: 16px;
6
+ margin-left: 24px;
7
+ border: 1px solid var(--border-subtle-4);
8
+ border-radius: var(--radius-100);
9
+ padding: 6px 16px;
5
10
  cursor: pointer;
6
11
 
7
- > span {
8
- margin-right: var(--spacing-200);
9
- margin-left: var(--spacing-200);
10
- @include label-large-1;
12
+ .header-corpus-name {
13
+ @include label-medium-1;
11
14
  color: var(--text-light-fixed);
12
15
  }
13
16
 
14
17
  .header-corpus-image {
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
15
21
  border-radius: 50%;
16
- width: 32px;
17
- height: 32px;
22
+ width: 24px;
23
+ height: 24px;
18
24
  }
19
25
  }
20
26
 
@@ -51,3 +57,21 @@
51
57
  }
52
58
  }
53
59
  }
60
+
61
+ @media (max-width: 768px) {
62
+ .header-corpus-container .header-corpus-name {
63
+ max-width: 180px;
64
+ overflow: hidden;
65
+ text-overflow: ellipsis;
66
+ white-space: nowrap;
67
+ }
68
+ }
69
+
70
+ @media (max-width: 767px) {
71
+ .header-corpus-container {
72
+ margin-left: 12px;
73
+ .header-corpus-name {
74
+ max-width: 160px;
75
+ }
76
+ }
77
+ }
@@ -1,4 +1,4 @@
1
- import "./style.scss";
1
+ import './style.scss';
2
2
  type Props = {
3
3
  navigateLogout?: () => void;
4
4
  navigateNotLogged: () => void;
@@ -1,19 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import { Button, Icon, ProfileDropdown } from "tycho-storybook";
5
- import { useLoggedUtils } from "../../configs/useLoggedUtils";
6
- import "./style.scss";
2
+ import { useState } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { Button, Icon, ProfileDropdown } from 'tycho-storybook';
5
+ import { useLoggedUtils } from '../../configs/useLoggedUtils';
6
+ import './style.scss';
7
7
  export default function HeaderUser({ navigateLogout, navigateNotLogged, }) {
8
- const { t } = useTranslation("header");
8
+ const { t } = useTranslation('header');
9
9
  const { isLogged, getLogged } = useLoggedUtils();
10
10
  const [open, setOpen] = useState(false);
11
11
  const handleProfile = () => {
12
12
  setOpen(false);
13
- window.open(import.meta.env.VITE_APP_RESERVED_URL, "_blank");
13
+ window.open(import.meta.env.VITE_APP_RESERVED_URL, '_blank');
14
14
  };
15
- return (_jsxs("div", { className: "header-user-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub, onClick: (b) => setOpen(b) })) : (_jsx(Button, { text: t("button.sign.in"), size: "small", onClick: navigateNotLogged })), open && isLogged() && (_jsxs("div", { className: "ds-dropdown-list", children: [_jsx("div", { className: "ds-dropdown-itemlist", children: _jsx("span", { className: "label", children: `${t("profile.label.hello")} ${getLogged()?.name || getLogged()?.sub}` }) }), _jsxs("div", { className: "ds-dropdown-itemlist d-none", children: [_jsx(Icon, { name: "colors", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.theme") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: handleProfile, children: [_jsx(Icon, { name: "person", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.home") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", children: [_jsx(Icon, { name: "live_help", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.help") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => {
15
+ return (_jsxs("div", { className: "profile-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub, onClick: (b) => setOpen(b) })) : (_jsx(Button, { text: t('button.sign.in'), size: "small", onClick: navigateNotLogged })), open && isLogged() && (_jsxs("div", { className: "ds-dropdown-list", children: [_jsx("div", { className: "ds-dropdown-itemlist", children: _jsx("span", { className: "label", children: `${t('profile.label.hello')} ${getLogged()?.name || getLogged()?.sub}` }) }), _jsxs("div", { className: "ds-dropdown-itemlist d-none", children: [_jsx(Icon, { name: "colors", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.theme') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: handleProfile, children: [_jsx(Icon, { name: "person", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.home') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", children: [_jsx(Icon, { name: "live_help", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.help') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => {
16
16
  setOpen(false);
17
17
  navigateLogout && navigateLogout();
18
- }, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.logout") })] })] }))] }));
18
+ }, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.logout') })] })] }))] }));
19
19
  }
@@ -1,4 +1,4 @@
1
- .header-user-container {
1
+ .profile-container {
2
2
  display: flex;
3
3
  cursor: pointer;
4
4
  position: relative;
@@ -5,6 +5,7 @@ export type HelpAction = {
5
5
  };
6
6
  type Props = {
7
7
  helpActions?: HelpAction[];
8
+ mobile?: boolean;
8
9
  };
9
- export default function HelpButton({ helpActions }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export default function HelpButton({ helpActions, mobile }: Props): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -3,8 +3,8 @@ import { useState } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { IconButton } from 'tycho-storybook';
5
5
  import HelpModal from './HelpModal';
6
- export default function HelpButton({ helpActions }) {
6
+ export default function HelpButton({ helpActions, mobile }) {
7
7
  const { t } = useTranslation('header');
8
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 }))] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx(IconButton, { name: "live_help", size: "medium", title: t('tooltip.tutorials'), onClick: () => setOpen(true), mode: mobile ? 'outlined' : 'filled' }), open && (_jsx(HelpModal, { onClose: () => setOpen(false), helpActions: helpActions }))] }));
10
10
  }