UI improvements

This commit is contained in:
IRBorisov 2023-12-18 20:45:33 +03:00
parent db1d5077c7
commit d038682793
20 changed files with 66 additions and 77 deletions

View File

@ -9,9 +9,9 @@ Styling conventions
<pre> <pre>
- layer: z-position - layer: z-position
- outer layout: fixed bottom-1/2 left-0 -translate-x-1/2 - outer layout: fixed bottom-1/2 left-0 -translate-x-1/2
- rectangle: mt-3 w-full min-w-10 h-fit flex-grow - rectangle: mt-3 min-w-fit min-w-10 flex-grow
- inner layout: px-3 py-2 flex flex-col gap-3 justify-start items-center - inner layout: px-3 py-2 flex flex-col gap-3 justify-start items-center
- overflow behavior: overflow-auto - overflow behavior: overflow-scroll
- border: borer-2 outline-none shadow-md - border: borer-2 outline-none shadow-md
- colors: clr-controls - colors: clr-controls
- text: text-start text-sm font-semibold whitespace-nowrap - text: text-start text-sm font-semibold whitespace-nowrap

View File

@ -11,7 +11,7 @@ function ConceptTab({ label, className, ...otherProps }: ConceptTabProps) {
return ( return (
<Tab <Tab
className={clsx( className={clsx(
'h-full min-w-[6rem]', 'min-w-[6rem]',
'px-2 py-1 flex justify-center', 'px-2 py-1 flex justify-center',
'clr-tab', 'clr-tab',
'text-sm whitespace-nowrap small-caps font-semibold', 'text-sm whitespace-nowrap small-caps font-semibold',

View File

@ -10,8 +10,8 @@ function Divider({ vertical, margins = 'mx-2' }: DividerProps) {
<div className={clsx( <div className={clsx(
margins, margins,
{ {
'border-x h-full': vertical, 'border-x': vertical,
'border-y w-full': !vertical 'border-y': !vertical
} }
)}/>); )}/>);
} }

View File

@ -36,7 +36,7 @@ function PDFViewer({ file }: PDFViewerProps) {
<Document <Document
file={file} file={file}
onLoadSuccess={onDocumentLoadSuccess} onLoadSuccess={onDocumentLoadSuccess}
className='px-3 w-fit' className='px-3'
loading='Загрузка PDF файла...' loading='Загрузка PDF файла...'
error='Не удалось загрузить файл.' error='Не удалось загрузить файл.'
> >

View File

@ -26,20 +26,18 @@ function PaginationTools<TData>({ table, paginationOptions, onChangePaginationOp
return ( return (
<div className={clsx( <div className={clsx(
'flex justify-end items-center', 'flex justify-end items-center',
'w-full my-2', 'my-2',
'text-sm', 'text-sm',
'clr-text-controls', 'clr-text-controls',
'select-none' 'select-none'
)}> )}>
<div className='flex items-center gap-1 mr-3'> <span className='mr-3'>
<div className=''> {`${table.getState().pagination.pageIndex * table.getState().pagination.pageSize + 1}
{table.getState().pagination.pageIndex * table.getState().pagination.pageSize + 1}
- -
{Math.min(table.getFilteredRowModel().rows.length, (table.getState().pagination.pageIndex + 1) * table.getState().pagination.pageSize)} ${Math.min(table.getFilteredRowModel().rows.length, (table.getState().pagination.pageIndex + 1) * table.getState().pagination.pageSize)}
</div> из
<span>из</span> ${table.getFilteredRowModel().rows.length}`}
<div className=''>{table.getFilteredRowModel().rows.length}</div> </span>
</div>
<div className='flex'> <div className='flex'>
<button type='button' <button type='button'
className='clr-hover clr-text-controls' className='clr-hover clr-text-controls'

View File

@ -15,13 +15,11 @@ extends CProps.Styling {
function HelpButton({ topic, ...restProps }: HelpButtonProps) { function HelpButton({ topic, ...restProps }: HelpButtonProps) {
return ( return (
<>
<div <div
id={`help-${topic}`} id={`help-${topic}`}
className='p-1' className='p-1'
> >
<BiInfoCircle size='1.25rem' className='clr-text-primary' /> <BiInfoCircle size='1.25rem' className='clr-text-primary' />
</div>
<ConceptTooltip clickable <ConceptTooltip clickable
anchorSelect={`#help-${topic}`} anchorSelect={`#help-${topic}`}
layer='z-modal-tooltip' layer='z-modal-tooltip'
@ -34,7 +32,7 @@ function HelpButton({ topic, ...restProps }: HelpButtonProps) {
</div> </div>
<InfoTopic topic={topic} /> <InfoTopic topic={topic} />
</ConceptTooltip> </ConceptTooltip>
</>); </div>);
} }
export default HelpButton; export default HelpButton;

View File

@ -3,7 +3,7 @@ import { FiBell } from 'react-icons/fi';
function HelpLibrary() { function HelpLibrary() {
return ( return (
<div className='w-full'> <div>
<h1>Библиотека концептуальных схем</h1> <h1>Библиотека концептуальных схем</h1>
<p>В библиотеки собраны различные концептуальные схемы.</p> <p>В библиотеки собраны различные концептуальные схемы.</p>
<p>Группировка и классификации схем на данный момент не проводится.</p> <p>Группировка и классификации схем на данный момент не проводится.</p>

View File

@ -3,7 +3,7 @@ import { urls } from '@/utils/constants';
function HelpMain() { function HelpMain() {
return ( return (
<div className='flex flex-col w-full text-left'> <div>
<h1>Портал</h1> <h1>Портал</h1>
<p className=''>Портал позволяет анализировать предметные области, формально записывать системы определений (концептуальные схемы) и синтезировать их с помощью математического аппарата родов структур.</p> <p className=''>Портал позволяет анализировать предметные области, формально записывать системы определений (концептуальные схемы) и синтезировать их с помощью математического аппарата родов структур.</p>
<p className='mt-4 mb-1 text-center'><b>Основные разделы</b></p> <p className='mt-4 mb-1 text-center'><b>Основные разделы</b></p>

View File

@ -17,7 +17,7 @@ function HelpRSLang() {
}, [windowSize]); }, [windowSize]);
return ( return (
<div className='flex flex-col w-full gap-4'> <div className='flex flex-col gap-4'>
<div> <div>
<h1>Родоструктурная экспликация концептуальных схем</h1> <h1>Родоструктурная экспликация концептуальных схем</h1>
<p>Формальная запись (<i>экспликация</i>) концептуальных схем осуществляется с помощью языка родов структур.</p> <p>Формальная запись (<i>экспликация</i>) концептуальных схем осуществляется с помощью языка родов структур.</p>
@ -29,7 +29,7 @@ function HelpRSLang() {
<li>3. <a className='underline' href={urls.full_course}>Видео: лекции для 4 курса (второй семестр 2022-23 год)</a></li> <li>3. <a className='underline' href={urls.full_course}>Видео: лекции для 4 курса (второй семестр 2022-23 год)</a></li>
</ul> </ul>
</div> </div>
<div className='justify-center hidden w-full md:flex fleex-col'> <div className='justify-center hidden w-full md:flex'>
<EmbedYoutube <EmbedYoutube
videoID={youtube.intro} videoID={youtube.intro}
pxHeight={videoHeight} pxHeight={videoHeight}

View File

@ -1,6 +1,6 @@
function HelpRSTemplates() { function HelpRSTemplates() {
return ( return (
<div className='flex flex-col w-full gap-2 pb-2'> <div className='flex flex-col gap-2 pb-2'>
<h1>Банк выражений</h1> <h1>Банк выражений</h1>
<p>Портал предоставляет быстрый доступ к часто используемым выражениям с помощью функции создания конституенты из шаблона.</p> <p>Портал предоставляет быстрый доступ к часто используемым выражениям с помощью функции создания конституенты из шаблона.</p>
<p>Источником шаблонов является <b>Банк выражений</b>, содержащий параметризованные понятия и утверждения, сгруппированные по разделам.</p> <p>Источником шаблонов является <b>Банк выражений</b>, содержащий параметризованные понятия и утверждения, сгруппированные по разделам.</p>

View File

@ -16,7 +16,6 @@ function UserMenu() {
const navigateLogin = () => router.push('/login'); const navigateLogin = () => router.push('/login');
return ( return (
<div ref={menu.ref} className='h-full'> <div ref={menu.ref} className='h-full'>
<div className='flex items-center justify-end h-full w-fit'>
{!user ? {!user ?
<NavigationButton <NavigationButton
description='Перейти на страницу логина' description='Перейти на страницу логина'
@ -29,7 +28,6 @@ function UserMenu() {
icon={<FaCircleUser size='1.5rem' />} icon={<FaCircleUser size='1.5rem' />}
onClick={menu.toggle} onClick={menu.toggle}
/> : null} /> : null}
</div>
{(user && menu.isActive) ? {(user && menu.isActive) ?
<UserDropdown <UserDropdown
hideDropdown={() => menu.hide()} hideDropdown={() => menu.hide()}

View File

@ -178,7 +178,6 @@ function RefsInput({
onSave={handleInputReference} onSave={handleInputReference}
/> : null} /> : null}
<div className={clsx( <div className={clsx(
'w-full',
'flex flex-col gap-2', 'flex flex-col gap-2',
cursor cursor
)}> )}>

View File

@ -16,7 +16,6 @@ interface ConstituentaBadgeProps {
function ConstituentaBadge({ value, prefixID, shortTooltip, theme }: ConstituentaBadgeProps) { function ConstituentaBadge({ value, prefixID, shortTooltip, theme }: ConstituentaBadgeProps) {
return ( return (
<div className='w-fit'>
<div <div
id={`${prefixID}${value.alias}`} id={`${prefixID}${value.alias}`}
className={clsx( className={clsx(
@ -32,7 +31,6 @@ function ConstituentaBadge({ value, prefixID, shortTooltip, theme }: Constituent
}} }}
> >
{value.alias} {value.alias}
</div>
{!shortTooltip ? {!shortTooltip ?
<ConstituentaTooltip <ConstituentaTooltip
anchor={`#${prefixID}${value.alias}`} anchor={`#${prefixID}${value.alias}`}

View File

@ -14,7 +14,7 @@ function InfoCstStatus({ title }: InfoCstStatusProps) {
const { colors } = useConceptTheme(); const { colors } = useConceptTheme();
return ( return (
<div className='flex flex-col gap-1 mb-2 h-fit'> <div className='flex flex-col gap-1 mb-2'>
{title ? <h1>{title}</h1> : null} {title ? <h1>{title}</h1> : null}
{Object.values(ExpressionStatus) {Object.values(ExpressionStatus)
.filter(status => status !== ExpressionStatus.UNDEFINED) .filter(status => status !== ExpressionStatus.UNDEFINED)

View File

@ -97,7 +97,7 @@ function ArgumentsTab({ state, schema, partialUpdate }: ArgumentsTabProps) {
minSize: 40, minSize: 40,
maxSize: 40, maxSize: 40,
cell: props => cell: props =>
<div className='w-full text-center'> <div className='text-center'>
{props.getValue()} {props.getValue()}
</div> </div>
}), }),
@ -162,7 +162,7 @@ function ArgumentsTab({ state, schema, partialUpdate }: ArgumentsTabProps) {
conditionalRowStyles={conditionalRowStyles} conditionalRowStyles={conditionalRowStyles}
noDataComponent={ noDataComponent={
<p className={clsx( <p className={clsx(
'min-h-[3.6rem] w-full', 'min-h-[3.6rem]',
'p-2', 'p-2',
'text-center' 'text-center'
)}> )}>

View File

@ -21,7 +21,7 @@ function ManualsPage() {
return ( return (
<div <div
className='flex items-start justify-start w-full gap-2' className='flex items-start justify-start w-full max-w-[90rem] gap-2'
style={{minHeight: mainHeight}} style={{minHeight: mainHeight}}
> >
<TopicsList <TopicsList

View File

@ -19,7 +19,7 @@ function TopicsList({ activeTopic, onChangeTopic }: TopicsListProps) {
'small-caps', 'small-caps',
'select-none' 'select-none'
)}> )}>
<h1 className='mt-2 mb-1'>Справка</h1> <h1 className='my-1'>Справка</h1>
{Object.values(HelpTopic).map( {Object.values(HelpTopic).map(
(topic, index) => (topic, index) =>
<div key={`${prefixes.topic_list}${index}`} <div key={`${prefixes.topic_list}${index}`}

View File

@ -38,7 +38,7 @@ function RSListToolbar({
const nothingSelected = useMemo(() => selectedCount === 0, [selectedCount]); const nothingSelected = useMemo(() => selectedCount === 0, [selectedCount]);
return ( return (
<Overlay position='top-1 right-1/2 translate-x-1/2' className='flex'> <Overlay position='top-1 right-1/2 translate-x-1/2' className='flex items-start'>
<MiniButton <MiniButton
title='Переместить вверх [Alt + вверх]' title='Переместить вверх [Alt + вверх]'
icon={<BiUpvote size='1.25rem' className={isMutable && !nothingSelected ? 'clr-text-primary': ''}/>} icon={<BiUpvote size='1.25rem' className={isMutable && !nothingSelected ? 'clr-text-primary': ''}/>}
@ -63,8 +63,7 @@ function RSListToolbar({
disabled={!isMutable} disabled={!isMutable}
onClick={() => onCreate()} onClick={() => onCreate()}
/> />
<div ref={insertMenu.ref} className='flex justify-center'> <div ref={insertMenu.ref}>
<div>
<MiniButton <MiniButton
title='Добавить пустую конституенту' title='Добавить пустую конституенту'
icon={<BiDownArrowCircle size='1.25rem' className={isMutable ? 'clr-text-success': ''} />} icon={<BiDownArrowCircle size='1.25rem' className={isMutable ? 'clr-text-success': ''} />}
@ -84,7 +83,6 @@ function RSListToolbar({
)} )}
</Dropdown> : null} </Dropdown> : null}
</div> </div>
</div>
<MiniButton <MiniButton
title='Удалить выбранные [Delete]' title='Удалить выбранные [Delete]'
icon={<BiTrash size='1.25rem' className={isMutable && !nothingSelected ? 'clr-text-warning' : ''} />} icon={<BiTrash size='1.25rem' className={isMutable && !nothingSelected ? 'clr-text-warning' : ''} />}

View File

@ -54,7 +54,7 @@ function ViewHidden({
return ( return (
<div key={`wrap-${id}`}> <div key={`wrap-${id}`}>
<div key={id} id={id} <div key={id} id={id}
className='w-fit min-w-[3rem] rounded-md text-center cursor-pointer select-none' className='min-w-[3rem] rounded-md text-center cursor-pointer select-none'
style={{ style={{
backgroundColor: colorbgGraphNode(cst, adjustedColoring, colors), backgroundColor: colorbgGraphNode(cst, adjustedColoring, colors),
...dismissedStyle(cstID) ...dismissedStyle(cstID)

View File

@ -45,7 +45,7 @@ function UserTabs() {
/> />
</Overlay> </Overlay>
<h1 className='mb-4'>Учетные данные пользователя</h1> <h1 className='mb-4'>Учетные данные пользователя</h1>
<div className='flex py-2 max-w-fit'> <div className='flex py-2'>
<EditorProfile /> <EditorProfile />
<EditorPassword /> <EditorPassword />
</div> </div>