diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_forms/BigQueryForm.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_forms/BigQueryForm.tsx index 71a5d2694..5924fac0b 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_forms/BigQueryForm.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_forms/BigQueryForm.tsx @@ -64,7 +64,7 @@ export const BigQueryForm: React.FC<{ - +
) : null }> - +
{children}
diff --git a/web/src/components/features/list/FavoriteStar.tsx b/web/src/components/features/list/FavoriteStar.tsx index 8245bfe4c..81b7dd8fe 100644 --- a/web/src/components/features/list/FavoriteStar.tsx +++ b/web/src/components/features/list/FavoriteStar.tsx @@ -63,7 +63,7 @@ export const FavoriteStar: React.FC<{ const tooltipText = isFavorited ? 'Remove from favorites' : 'Add to favorites'; return ( - + - - - -
- ]} - onCancel={onClose} - width={730} - title="Create theme"> - - It is recommended to choose a color pallete with a wide range of colors as it will be used - for charts. - - -
- {theme?.map((color, index) => { - return ( - { - const newTheme = [...theme]; - newTheme[index] = v.toHexString(); - setTheme(newTheme); - }}> -
{}} - className="h-full min-h-[118px] w-full cursor-pointer transition first:rounded-l last:rounded-r hover:z-10 hover:scale-105 hover:shadow-lg" - style={{ backgroundColor: color }}>
-
- ); - })} -
- - ); -}; - -export default NewColorThemeModal; diff --git a/web/src/components/ui/text/Text.tsx b/web/src/components/ui/text/Text.tsx index fe4141d11..530574825 100644 --- a/web/src/components/ui/text/Text.tsx +++ b/web/src/components/ui/text/Text.tsx @@ -68,13 +68,7 @@ const TextWrapper: React.FC< const title = tooltip ? (typeof tooltip === 'string' ? tooltip : (children as string)) : ''; - return tooltip ? ( - - {children} - - ) : ( - <>{children} - ); + return tooltip ? {children} : <>{children}; }); TextWrapper.displayName = 'TextWrapper'; diff --git a/web/src/components/ui/tooltip/AppPopoverOptions.tsx b/web/src/components/ui/tooltip/AppPopoverOptions.tsx index eefacf720..f75628604 100644 --- a/web/src/components/ui/tooltip/AppPopoverOptions.tsx +++ b/web/src/components/ui/tooltip/AppPopoverOptions.tsx @@ -1,10 +1,9 @@ -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { AppPopover } from './AppPopover'; -import { useClickAway, useMemoizedFn } from 'ahooks'; +import { useMemoizedFn } from 'ahooks'; import isString from 'lodash/isString'; import { AppMaterialIcons } from '../icons'; -import { Button, PopoverProps } from 'antd'; -import { ButtonProps } from 'antd/lib'; +import { PopoverProps } from 'antd'; import { createStyles } from 'antd-style'; import { useAntToken } from '@/styles/useAntToken'; @@ -109,7 +108,7 @@ export const AppPopoverOptions: React.FC<{ styles.item, rowClass, `${option.selected ? selectedClass : ''}`, - `flex select-none items-center justify-between space-x-2 rounded-sm p-1` + `flex items-center justify-between space-x-2 rounded-sm p-1 select-none` )} onClick={() => { option.onClick(); @@ -126,9 +125,9 @@ export const AppPopoverOptions: React.FC<{
-
{option.label}
+
{option.label}
{option.description && ( -
{option.description}
+
{option.description}
)}
@@ -142,7 +141,7 @@ export const AppPopoverOptions: React.FC<{ ))} - {footer &&
{footer}
} + {footer &&
{footer}
} }>
>( - ({ children, ...props }) => { - const [isHovering, setIsHovering] = useState(false); - const { title, shortcuts = [], forceShow, performant } = props; - - if (!title && !shortcuts.length && !forceShow) { - return <>{children}; - } - - if (performant && !isHovering) { - return {children}; - } - - return {children}; - } -); -AppTooltip.displayName = 'AppTooltip'; - -const PerformanceTooltip: React.FC< - PropsWithChildren<{ - setIsHovering: (v: boolean) => void; - }> -> = React.memo(({ children, setIsHovering }) => { - return ( -
{ - setIsHovering(true); - }}> - {children} -
- ); -}); -PerformanceTooltip.displayName = 'PerformanceTooltip'; - -const BusterTooltip: React.FC> = ({ - children, - mouseEnterDelay = 0.75, - mouseLeaveDelay = 0.15, - destroyTooltipOnHide = true, - trigger = 'hover', - arrow = false, - title = '', - forceShow = false, - performant = false, - shortcuts = [], //⌘ - align, - ...props -}) => { - const memoizedTitle = useMemo(() => { - if (title) { - return ( -
- {title} - -
- ); - } - return null; - }, [title, shortcuts]); - - return ( - - {children} - - ); -}; -BusterTooltip.displayName = 'BusterTooltip'; diff --git a/web/src/components/ui/tooltip/Tooltip.stories.tsx b/web/src/components/ui/tooltip/Tooltip.stories.tsx index 0aa2ef432..62ac9d868 100644 --- a/web/src/components/ui/tooltip/Tooltip.stories.tsx +++ b/web/src/components/ui/tooltip/Tooltip.stories.tsx @@ -25,9 +25,9 @@ const meta = { control: 'text', description: 'The text content of the tooltip' }, - shortcut: { + shortcuts: { control: 'object', - description: 'Array of keyboard shortcuts to display' + description: 'Array of keyboard shortcutss to display' }, children: { control: 'object', @@ -68,20 +68,20 @@ export const Basic: Story = { } }; -// With keyboard shortcuts +// With keyboard shortcutss export const WithShortcut: Story = { args: { title: 'Save file', - shortcut: ['S'], + shortcuts: ['S'], children: } }; -// Multiple shortcuts +// Multiple shortcutss export const MultipleShortcuts: Story = { args: { title: 'Undo action', - shortcut: ['⌘', 'Z'], + shortcuts: ['⌘', 'Z'], children: } }; diff --git a/web/src/components/ui/tooltip/Tooltip.tsx b/web/src/components/ui/tooltip/Tooltip.tsx index 7fbad165d..ec41b5317 100644 --- a/web/src/components/ui/tooltip/Tooltip.tsx +++ b/web/src/components/ui/tooltip/Tooltip.tsx @@ -12,8 +12,8 @@ export interface TooltipProps extends Pick, 'align' | 'side' | 'sideOffset'>, Pick, 'delayDuration' | 'skipDelayDuration'> { children: React.ReactNode; - title: string; - shortcut?: string[]; + title: string | undefined; + shortcuts?: string[]; open?: boolean; } @@ -22,21 +22,21 @@ export const Tooltip = React.memo( children, title, sideOffset, - shortcut, + shortcuts, delayDuration = 0, skipDelayDuration, align, side, open }) => { - if (!title && !shortcut?.length) return children; + if (!title || (!title && !shortcuts?.length)) return children; return ( {children} - + diff --git a/web/src/components/ui/tooltip/index.ts b/web/src/components/ui/tooltip/index.ts index 879d56979..43ec514f9 100644 --- a/web/src/components/ui/tooltip/index.ts +++ b/web/src/components/ui/tooltip/index.ts @@ -1,4 +1,7 @@ -export * from './AppTooltip'; export * from './AppPopover'; export * from './AppPopoverMenu'; export * from './Tooltip'; + +import { Tooltip } from './Tooltip'; + +export { Tooltip as AppTooltip }; diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppStyling/EditPieShowInnerLabel.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppStyling/EditPieShowInnerLabel.tsx index 37de63002..62e19d215 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppStyling/EditPieShowInnerLabel.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppStyling/EditPieShowInnerLabel.tsx @@ -15,12 +15,10 @@ export const EditPieShowInnerLabel = React.memo( return (
- - onUpdateChartConfig({ pieShowInnerLabel: value })} - /> - + onUpdateChartConfig({ pieShowInnerLabel: value })} + />
); diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppVisualize/SelectChartType/SelectChartType.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppVisualize/SelectChartType/SelectChartType.tsx index 34adfde02..302ddc82b 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppVisualize/SelectChartType/SelectChartType.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricEditController/MetricStylingApp/StylingAppVisualize/SelectChartType/SelectChartType.tsx @@ -147,7 +147,7 @@ const ChartButton: React.FC<{ const { styles, cx } = useStyles(); return ( - +
!disabled && onSelectChartType(id)} diff --git a/web/src/controllers/TermIndividualController/TermDatasetSelect.tsx b/web/src/controllers/TermIndividualController/TermDatasetSelect.tsx index 350241f2f..80f60c56d 100644 --- a/web/src/controllers/TermIndividualController/TermDatasetSelect.tsx +++ b/web/src/controllers/TermIndividualController/TermDatasetSelect.tsx @@ -50,7 +50,7 @@ export const DatasetList: React.FC<{ ))} - + {selectedDatasets.length === 0 ? ( ) : ( diff --git a/web/src/controllers/TermIndividualController/TermIndividualHeaderSider.tsx b/web/src/controllers/TermIndividualController/TermIndividualHeaderSider.tsx index e11e8d54a..1d41fae4b 100644 --- a/web/src/controllers/TermIndividualController/TermIndividualHeaderSider.tsx +++ b/web/src/controllers/TermIndividualController/TermIndividualHeaderSider.tsx @@ -1,18 +1,16 @@ import React from 'react'; - -import { AppMaterialIcons, AppTooltip, AppTooltipProps } from '@/components/ui'; -import { Text } from '@/components/ui'; - -const memoizedTrigger: AppTooltipProps['trigger'] = ['click']; +import { AppTooltip } from '@/components/ui/tooltip'; +import { CircleQuestion } from '@/components/ui/icons'; +import { Text } from '@/components/ui/typography'; export const TermIndividualHeaderSider: React.FC = () => { return (
Details
- - - + + +
diff --git a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/SubmitButton.tsx b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/SubmitButton.tsx index 9ba856f2d..66e02d274 100644 --- a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/SubmitButton.tsx +++ b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/SubmitButton.tsx @@ -34,8 +34,8 @@ export const SubmitButton: React.FC = React.memo( + delayDuration={1.5} + skipDelayDuration={0}>