Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

match tooltip with figma design #10690

Merged
merged 16 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ export default function ProjectTable(props: { search: string }) {
{row.name}
</a>
{!!row.needsRebuild && (
<Tooltip title={t('admin:components.project.outdatedBuild')} position="right center">
<Tooltip content={t('admin:components.project.outdatedBuild')} position="right center">
<HiOutlineExclamationCircle className="text-orange-400" size={22} />
</Tooltip>
)}
{!!row.hasLocalChanges && (
<Tooltip title={t('admin:components.project.hasLocalChanges')} position="right center">
<Tooltip content={t('admin:components.project.hasLocalChanges')} position="right center">
<HiOutlineExclamationCircle className="text-yellow-400" size={22} />
</Tooltip>
)}
Expand All @@ -237,7 +237,7 @@ export default function ProjectTable(props: { search: string }) {
),
commitSHA: (
<span className="flex items-center justify-between">
<Tooltip title={row.commitSHA || ''}>
<Tooltip content={row.commitSHA || ''}>
<>{row.commitSHA?.slice(0, 8)}</>
</Tooltip>{' '}
<CopyText text={row.commitSHA || ''} className="ml-1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ServerStatus({ serverPodInfo }: { serverPodInfo: ServerPodInfoType }) {
)}
<div className="flex gap-1">
{serverPodInfo.containers.map((container) => (
<Tooltip key={container.name} title={`${t('admin:components.server.name')}: ${container.name}`}>
<Tooltip key={container.name} content={`${t('admin:components.server.name')}: ${container.name}`}>
<div className={`${containerColor[container.status]} h-3.5 w-3.5 rounded-full`} />
</Tooltip>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const ProjectTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableRe
endComponent={
setting.userId && (
<Tooltip
title={t('admin:components.setting.project.lastUpdatedBy', { userId: setting.userId })}
content={t('admin:components.setting.project.lastUpdatedBy', { userId: setting.userId })}
position="left center"
>
<HiUser className="mr-2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,47 +53,47 @@ export default function AccountIdentifiers({ user }: { user: UserType }) {
return (
<div className="flex items-center gap-2">
{appleIp ? (
<Tooltip title={appleIp.accountIdentifier!}>
<Tooltip content={appleIp.accountIdentifier!}>
<RiAppleFill className="h-6 w-6" />
</Tooltip>
) : null}
{discordIp ? (
<Tooltip title={discordIp.accountIdentifier!}>
<Tooltip content={discordIp.accountIdentifier!}>
<RiDiscordFill className="h-6 w-6" />
</Tooltip>
) : null}
{googleIp ? (
<Tooltip title={googleIp.accountIdentifier!}>
<Tooltip content={googleIp.accountIdentifier!}>
<RiGoogleFill className="h-6 w-6" />
</Tooltip>
) : null}
{facebookIp ? (
<Tooltip title={facebookIp.accountIdentifier!}>
<Tooltip content={facebookIp.accountIdentifier!}>
<RiMetaFill className="h-6 w-6" />
</Tooltip>
) : null}
{twitterIp ? (
<Tooltip title={twitterIp.accountIdentifier!}>
<Tooltip content={twitterIp.accountIdentifier!}>
<RiTwitterXFill className="h-6 w-6" />
</Tooltip>
) : null}
{linkedinIp ? (
<Tooltip title={linkedinIp.accountIdentifier!}>
<Tooltip content={linkedinIp.accountIdentifier!}>
<RiLinkedinFill className="h-6 w-6" />
</Tooltip>
) : null}
{githubIp ? (
<Tooltip title={githubIp.accountIdentifier!}>
<Tooltip content={githubIp.accountIdentifier!}>
<RiGithubFill className="h-6 w-6" />
</Tooltip>
) : null}
{smsIp ? (
<Tooltip title={smsIp.accountIdentifier!}>
<Tooltip content={smsIp.accountIdentifier!}>
<RiMessage2Line className="h-6 w-6" />
</Tooltip>
) : null}
{emailIp ? (
<Tooltip title={emailIp.accountIdentifier!}>
<Tooltip content={emailIp.accountIdentifier!}>
<MdEmail className="h-6 w-6" />
</Tooltip>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.flipY.set}
label={t('editor:properties.model.transform.flipY')}
/>
<Tooltip title={t('editor:properties.model.transform.flipYTooltip')}>
<Tooltip content={t('editor:properties.model.transform.flipYTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -88,7 +88,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.srgb.set}
label={t('editor:properties.model.transform.srgb')}
/>
<Tooltip title={t('editor:properties.model.transform.srgbTooltip')}>
<Tooltip content={t('editor:properties.model.transform.srgbTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -98,7 +98,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.mipmaps.set}
label={t('editor:properties.model.transform.mipmaps')}
/>
<Tooltip title={t('editor:properties.model.transform.mipmapsTooltip')}>
<Tooltip content={t('editor:properties.model.transform.mipmapsTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -108,7 +108,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.normalMap.set}
label={t('editor:properties.model.transform.normalMap')}
/>
<Tooltip title={t('editor:properties.model.transform.normalMapTooltip')}>
<Tooltip content={t('editor:properties.model.transform.normalMapTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand Down
18 changes: 1 addition & 17 deletions packages/ui/src/components/editor/input/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MdOutlineHelpOutline } from 'react-icons/md'
import { twMerge } from 'tailwind-merge'
import Label from '../../../../primitives/tailwind/Label'
import Tooltip from '../../../../primitives/tailwind/Tooltip'
import { InfoTooltip } from '../../layout/Tooltip'

/**
* Used to provide styles for InputGroupContainer div.
Expand Down Expand Up @@ -98,21 +97,6 @@ export const InputGroupInfoIcon = ({ onClick = () => {} }) => (
/>
)

interface InputGroupInfoProp {
info: string | JSX.Element
}

/**
* Used to render InfoTooltip component.
*/
export function InputGroupInfo({ info }: InputGroupInfoProp) {
return (
<InfoTooltip title={info}>
<InputGroupInfoIcon />
</InfoTooltip>
)
}

export interface InputGroupProps {
name?: string
label: string
Expand Down Expand Up @@ -142,7 +126,7 @@ export function InputGroup({
<div className="mr-2 flex">
<Label className={twMerge('mr-2.5 text-wrap text-end text-xs text-[#A0A1A2]', labelClassName)}>{label}</Label>
{info && (
<Tooltip title={info}>
<Tooltip content={info}>
<LuInfo className={twMerge('h-5 w-5 text-[#A0A1A2]', infoClassName)} />
</Tooltip>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { FaChevronLeft, FaChevronRight } from 'react-icons/fa'
import { t } from 'i18next'
import { twMerge } from 'tailwind-merge'
import NumericInput, { NumericInputProp } from '..'
import { InfoTooltip } from '../../../layout/Tooltip'
import Tooltip from '../../../../../primitives/tailwind/Tooltip'

export function NumericStepperInput({
style,
Expand All @@ -54,23 +54,23 @@ export function NumericStepperInput({

return (
<div className={twMerge('flex h-6 w-full flex-1', className)}>
<InfoTooltip title={decrementTooltip}>
<Tooltip content={decrementTooltip}>
<button
className={twMerge('m-0 flex w-5 justify-center p-0 align-middle', 'rounded-bl rounded-tl')}
onClick={onDecrement}
>
<FaChevronLeft fontSize="small" />
</button>
</InfoTooltip>
</Tooltip>
<NumericInput {...rest} onChange={onChange} value={value} mediumStep={mediumStep} />
<InfoTooltip title={incrementTooltip}>
<Tooltip content={incrementTooltip}>
<button
className={twMerge('m-0 flex w-5 justify-center p-0 align-middle', 'rounded-br rounded-tr')}
onClick={onIncrement}
>
<FaChevronRight fontSize="small" />
</button>
</InfoTooltip>
</Tooltip>
</div>
)
}
Expand Down
41 changes: 0 additions & 41 deletions packages/ui/src/components/editor/layout/Tooltip.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const ResourceFile = (props: {
<FileIcon thumbnailURL={resource.thumbnailURL} type={assetType} />
</span>

<Tooltip title={name}>
<Tooltip content={name}>
<span className="line-clamp-1 w-full text-wrap break-all text-sm text-white">{name}</span>
</Tooltip>

Expand Down Expand Up @@ -500,13 +500,13 @@ const AssetPanel = () => {
<div className="mb-1 flex h-8 items-center bg-theme-surface-main">
<div className="mr-20 flex gap-2">
<div className="pointer-events-auto flex items-center">
<Tooltip title={t('editor:layout.filebrowser.back')} className="left-1">
<Tooltip content={t('editor:layout.filebrowser.back')} className="left-1">
<Button variant="transparent" startIcon={<HiMiniArrowLeft />} className="p-0" onClick={handleBack} />
</Tooltip>
</div>

<div className="flex items-center">
<Tooltip title={t('editor:layout.filebrowser.refresh')}>
<Tooltip content={t('editor:layout.filebrowser.refresh')}>
<Button variant="transparent" startIcon={<HiMiniArrowPath />} className="p-0" onClick={handleRefresh} />
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const FileGridItem: React.FC<FileGridItemProps> = (props) => {
/>
</div>

<Tooltip title={t(props.item.fullName)}>
<Tooltip content={t(props.item.fullName)}>
<div className="text-secondary line-clamp-1 w-full text-wrap break-all text-sm">{props.item.fullName}</div>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
contentStyle={{ background: '#15171b', border: 'solid', borderColor: '#5d646c' }}
position={'bottom left'}
trigger={
<Tooltip title={t('editor:layout.filebrowser.view-mode.settings.name')}>
<Tooltip content={t('editor:layout.filebrowser.view-mode.settings.name')}>
<Button variant="transparent" startIcon={<IoSettingsSharp />} className="p-0" />
</Tooltip>
}
Expand Down Expand Up @@ -710,13 +710,13 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
showBackButton ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'
}`}
>
<Tooltip title={t('editor:layout.filebrowser.back')} className="left-1">
<Tooltip content={t('editor:layout.filebrowser.back')} className="left-1">
<Button variant="transparent" startIcon={<IoArrowBack />} className={`p-0`} onClick={onBackDirectory} />
</Tooltip>
</div>

<div id="refreshDir" className="flex items-center">
<Tooltip title={t('editor:layout.filebrowser.refresh')}>
<Tooltip content={t('editor:layout.filebrowser.refresh')}>
<Button variant="transparent" startIcon={<FiRefreshCcw />} className="p-0" onClick={refreshDirectory} />
</Tooltip>
</div>
Expand Down Expand Up @@ -753,7 +753,7 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
</div>

<div id="downloadProject" className="flex items-center">
<Tooltip title={t('editor:layout.filebrowser.downloadProject')}>
<Tooltip content={t('editor:layout.filebrowser.downloadProject')}>
<Button
variant="transparent"
startIcon={<FiDownload />}
Expand All @@ -765,7 +765,7 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
</div>

<div id="newFolder" className="flex items-center">
<Tooltip title={t('editor:layout.filebrowser.addNewFolder')}>
<Tooltip content={t('editor:layout.filebrowser.addNewFolder')}>
<Button variant="transparent" startIcon={<PiFolderPlusBold />} className="p-0" onClick={createNewFolder} />
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ Ethereal Engine. All Rights Reserved.
import { TabData } from 'rc-dock'
import React from 'react'
import { useTranslation } from 'react-i18next'
import Tooltip from '../../../../primitives/tailwind/Tooltip'
import { PanelDragContainer, PanelTitle } from '../../layout/Panel'
import { InfoTooltip } from '../../layout/Tooltip'
//import styles from '../styles.module.scss'
import PropertiesPanelContainer from './container'

export const PropertiesPanelTitle = () => {
Expand All @@ -38,9 +37,7 @@ export const PropertiesPanelTitle = () => {
<div>
<PanelDragContainer>
<PanelTitle>
<InfoTooltip title={t('editor:properties.info')}>
<span>{t('editor:properties.title')}</span>
</InfoTooltip>
<Tooltip content={t('editor:properties.info')}>{t('editor:properties.title')}</Tooltip>
</PanelTitle>
</PanelDragContainer>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ import {
} from '@etherealengine/spatial/src/renderer/materials/MaterialComponent'
import { formatMaterialArgs, getMaterial } from '@etherealengine/spatial/src/renderer/materials/materialFunctions'
import Button from '../../../../../primitives/tailwind/Button'
import Tooltip from '../../../../../primitives/tailwind/Tooltip'
import InputGroup from '../../../input/Group'
import SelectInput from '../../../input/Select'
import StringInput from '../../../input/String'
import { PanelDragContainer, PanelTitle } from '../../../layout/Panel'
import { InfoTooltip } from '../../../layout/Tooltip'
import ParameterInput from '../../../properties/parameter'

type ThumbnailData = {
Expand Down Expand Up @@ -312,9 +312,9 @@ export const MaterialPropertyTitle = () => {
<div className={styles.dockableTab}>
<PanelDragContainer>
<PanelTitle>
<InfoTooltip title={t('editor:properties.mesh.materialProperties.info')}>
<span>{t('editor:properties.mesh.materialProperties.title')}</span>
</InfoTooltip>
<Tooltip content={t('editor:properties.mesh.materialProperties.info')}>
{t('editor:properties.mesh.materialProperties.title')}
</Tooltip>
</PanelTitle>
</PanelDragContainer>
</div>
Expand Down
Loading
Loading