Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Added AnimatedDiv component.
Mike Caoa8a1ccce18ad
diff --git a/src/app/(main)/console/[[...websiteId]]/page.tsx b/src/app/(main)/console/[[...websiteId]]/page.tsxindex 93eafee47..7c3433c5d 100644--- a/src/app/(main)/console/[[...websiteId]]/page.tsx+++ b/src/app/(main)/console/[[...websiteId]]/page.tsx@@ -1,5 +1,5 @@import { Metadata } from 'next';-import ConsolePage from '../ConsolePage';+import { ConsolePage } from '../ConsolePage';async function getEnabled() {return !!process.env.ENABLE_TEST_CONSOLE;diff --git a/src/app/(main)/reports/[reportId]/FieldParameters.tsx b/src/app/(main)/reports/[reportId]/FieldParameters.tsxindex e99bf57da..ff2e3db75 100644--- a/src/app/(main)/reports/[reportId]/FieldParameters.tsx+++ b/src/app/(main)/reports/[reportId]/FieldParameters.tsx@@ -2,9 +2,9 @@ import { useFields, useMessages } from '@/components/hooks';import { Icons } from '@/components/icons';import { useContext } from 'react';import { Button, FormRow, Icon, Popup, PopupTrigger } from 'react-basics';-import FieldSelectForm from '../[reportId]/FieldSelectForm';-import ParameterList from '../[reportId]/ParameterList';-import PopupForm from '../[reportId]/PopupForm';+import { FieldSelectForm } from '../[reportId]/FieldSelectForm';+import { ParameterList } from '../[reportId]/ParameterList';+import { PopupForm } from '../[reportId]/PopupForm';import { ReportContext } from './Report';export function FieldParameters() {diff --git a/src/app/(main)/reports/[reportId]/FilterParameters.tsx b/src/app/(main)/reports/[reportId]/FilterParameters.tsxindex 9fbfc283c..0011e527d 100644--- a/src/app/(main)/reports/[reportId]/FilterParameters.tsx+++ b/src/app/(main)/reports/[reportId]/FilterParameters.tsx@@ -2,11 +2,11 @@ import { useContext } from 'react';import { useMessages, useFormat, useFilters, useFields } from '@/components/hooks';import { Icons } from '@/components/icons';import { Button, FormRow, Icon, Popup, PopupTrigger } from 'react-basics';-import FilterSelectForm from '../[reportId]/FilterSelectForm';-import ParameterList from '../[reportId]/ParameterList';-import PopupForm from '../[reportId]/PopupForm';+import { FilterSelectForm } from '../[reportId]/FilterSelectForm';+import { ParameterList } from '../[reportId]/ParameterList';+import { PopupForm } from '../[reportId]/PopupForm';import { ReportContext } from './Report';-import FieldFilterEditForm from '../[reportId]/FieldFilterEditForm';+import { FieldFilterEditForm } from '../[reportId]/FieldFilterEditForm';import { isSearchOperator } from '@/lib/params';import styles from './FilterParameters.module.css';diff --git a/src/app/(main)/reports/[reportId]/ReportPage.tsx b/src/app/(main)/reports/[reportId]/ReportPage.tsxindex c84ca95d5..82161eaf8 100644--- a/src/app/(main)/reports/[reportId]/ReportPage.tsx+++ b/src/app/(main)/reports/[reportId]/ReportPage.tsx@@ -1,13 +1,13 @@'use client';import { useReport } from '@/components/hooks';-import EventDataReport from '../event-data/EventDataReport';-import FunnelReport from '../funnel/FunnelReport';-import GoalReport from '../goals/GoalsReport';-import InsightsReport from '../insights/InsightsReport';-import JourneyReport from '../journey/JourneyReport';-import RetentionReport from '../retention/RetentionReport';-import UTMReport from '../utm/UTMReport';-import RevenueReport from '../revenue/RevenueReport';+import { EventDataReport } from '../event-data/EventDataReport';+import { FunnelReport } from '../funnel/FunnelReport';+import { GoalsReport } from '../goals/GoalsReport';+import { InsightsReport } from '../insights/InsightsReport';+import { JourneyReport } from '../journey/JourneyReport';+import { RetentionReport } from '../retention/RetentionReport';+import { UTMReport } from '../utm/UTMReport';+import { RevenueReport } from '../revenue/RevenueReport';const reports = {funnel: FunnelReport,@@ -15,7 +15,7 @@ const reports = {insights: InsightsReport,retention: RetentionReport,utm: UTMReport,- goals: GoalReport,+ goals: GoalsReport,journey: JourneyReport,revenue: RevenueReport,};diff --git a/src/app/(main)/reports/event-data/EventDataParameters.tsx b/src/app/(main)/reports/event-data/EventDataParameters.tsxindex 43553b082..751b34942 100644--- a/src/app/(main)/reports/event-data/EventDataParameters.tsx+++ b/src/app/(main)/reports/event-data/EventDataParameters.tsx@@ -5,9 +5,9 @@ import { Icons } from '@/components/icons';import { useApi, useMessages } from '@/components/hooks';import { DATA_TYPES, REPORT_PARAMETERS } from '@/lib/constants';import { ReportContext } from '../[reportId]/Report';-import FieldAddForm from '../[reportId]/FieldAddForm';-import ParameterList from '../[reportId]/ParameterList';-import BaseParameters from '../[reportId]/BaseParameters';+import { FieldAddForm } from '../[reportId]/FieldAddForm';+import { ParameterList } from '../[reportId]/ParameterList';+import { BaseParameters } from '../[reportId]/BaseParameters';import styles from './EventDataParameters.module.css';function useFields(websiteId, startDate, endDate) {diff --git a/src/app/(main)/reports/event-data/EventDataReport.tsx b/src/app/(main)/reports/event-data/EventDataReport.tsxindex 7e9c34df7..7d94ddcfc 100644--- a/src/app/(main)/reports/event-data/EventDataReport.tsx+++ b/src/app/(main)/reports/event-data/EventDataReport.tsx@@ -1,7 +1,7 @@-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import { EventDataParameters } from './EventDataParameters';import { EventDataTable } from './EventDataTable';import Nodes from '@/assets/nodes.svg';diff --git a/src/app/(main)/reports/funnel/FunnelParameters.tsx b/src/app/(main)/reports/funnel/FunnelParameters.tsxindex cc1a5f9e6..9089f7de2 100644--- a/src/app/(main)/reports/funnel/FunnelParameters.tsx+++ b/src/app/(main)/reports/funnel/FunnelParameters.tsx@@ -15,9 +15,9 @@ import {import { Icons } from '@/components/icons';import { FunnelStepAddForm } from './FunnelStepAddForm';import { ReportContext } from '../[reportId]/Report';-import BaseParameters from '../[reportId]/BaseParameters';-import ParameterList from '../[reportId]/ParameterList';-import PopupForm from '../[reportId]/PopupForm';+import { BaseParameters } from '../[reportId]/BaseParameters';+import { ParameterList } from '../[reportId]/ParameterList';+import { PopupForm } from '../[reportId]/PopupForm';import styles from './FunnelParameters.module.css';export function FunnelParameters() {diff --git a/src/app/(main)/reports/funnel/FunnelReport.tsx b/src/app/(main)/reports/funnel/FunnelReport.tsxindex ecdc11e74..5e42c58af 100644--- a/src/app/(main)/reports/funnel/FunnelReport.tsx+++ b/src/app/(main)/reports/funnel/FunnelReport.tsx@@ -1,9 +1,9 @@import { FunnelChart } from './FunnelChart';import { FunnelParameters } from './FunnelParameters';-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import Funnel from '@/assets/funnel.svg';import { REPORT_TYPES } from '@/lib/constants';diff --git a/src/app/(main)/reports/goals/GoalsParameters.tsx b/src/app/(main)/reports/goals/GoalsParameters.tsxindex 8edf5e973..63407d906 100644--- a/src/app/(main)/reports/goals/GoalsParameters.tsx+++ b/src/app/(main)/reports/goals/GoalsParameters.tsx@@ -13,9 +13,9 @@ import {PopupTrigger,SubmitButton,} from 'react-basics';-import BaseParameters from '../[reportId]/BaseParameters';-import ParameterList from '../[reportId]/ParameterList';-import PopupForm from '../[reportId]/PopupForm';+import { BaseParameters } from '../[reportId]/BaseParameters';+import { ParameterList } from '../[reportId]/ParameterList';+import { PopupForm } from '../[reportId]/PopupForm';import { ReportContext } from '../[reportId]/Report';import { GoalsAddForm } from './GoalsAddForm';import styles from './GoalsParameters.module.css';diff --git a/src/app/(main)/reports/goals/GoalsReport.tsx b/src/app/(main)/reports/goals/GoalsReport.tsxindex 1df471745..fc1a7888e 100644--- a/src/app/(main)/reports/goals/GoalsReport.tsx+++ b/src/app/(main)/reports/goals/GoalsReport.tsx@@ -1,9 +1,9 @@import { GoalsChart } from './GoalsChart';import { GoalsParameters } from './GoalsParameters';-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import Target from '@/assets/target.svg';import { REPORT_TYPES } from '@/lib/constants';diff --git a/src/app/(main)/reports/insights/InsightsParameters.tsx b/src/app/(main)/reports/insights/InsightsParameters.tsxindex 809dc435e..8aa6ac57a 100644--- a/src/app/(main)/reports/insights/InsightsParameters.tsx+++ b/src/app/(main)/reports/insights/InsightsParameters.tsx@@ -1,10 +1,10 @@import { useMessages } from '@/components/hooks';import { useContext } from 'react';import { Form, FormButtons, SubmitButton } from 'react-basics';-import BaseParameters from '../[reportId]/BaseParameters';+import { BaseParameters } from '../[reportId]/BaseParameters';import { ReportContext } from '../[reportId]/Report';-import FieldParameters from '../[reportId]/FieldParameters';-import FilterParameters from '../[reportId]/FilterParameters';+import { FieldParameters } from '../[reportId]/FieldParameters';+import { FilterParameters } from '../[reportId]/FilterParameters';export function InsightsParameters() {const { report, runReport, isRunning } = useContext(ReportContext);diff --git a/src/app/(main)/reports/insights/InsightsReport.tsx b/src/app/(main)/reports/insights/InsightsReport.tsxindex 749ab528c..a13d8b84b 100644--- a/src/app/(main)/reports/insights/InsightsReport.tsx+++ b/src/app/(main)/reports/insights/InsightsReport.tsx@@ -1,7 +1,7 @@-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import { InsightsParameters } from './InsightsParameters';import { InsightsTable } from './InsightsTable';import Lightbulb from '@/assets/lightbulb.svg';diff --git a/src/app/(main)/reports/journey/JourneyParameters.tsx b/src/app/(main)/reports/journey/JourneyParameters.tsxindex a89c98577..3118265c8 100644--- a/src/app/(main)/reports/journey/JourneyParameters.tsx+++ b/src/app/(main)/reports/journey/JourneyParameters.tsx@@ -11,7 +11,7 @@ import {TextField,} from 'react-basics';import { ReportContext } from '../[reportId]/Report';-import BaseParameters from '../[reportId]/BaseParameters';+import { BaseParameters } from '../[reportId]/BaseParameters';export function JourneyParameters() {const { report, runReport, isRunning } = useContext(ReportContext);diff --git a/src/app/(main)/reports/journey/JourneyReport.tsx b/src/app/(main)/reports/journey/JourneyReport.tsxindex e59746b5b..2106f7625 100644--- a/src/app/(main)/reports/journey/JourneyReport.tsx+++ b/src/app/(main)/reports/journey/JourneyReport.tsx@@ -1,8 +1,8 @@'use client';-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import { JourneyParameters } from './JourneyParameters';import { JourneyView } from './JourneyView';import Path from '@/assets/path.svg';diff --git a/src/app/(main)/reports/retention/RetentionParameters.tsx b/src/app/(main)/reports/retention/RetentionParameters.tsxindex cc421fb12..42ae179b8 100644--- a/src/app/(main)/reports/retention/RetentionParameters.tsx+++ b/src/app/(main)/reports/retention/RetentionParameters.tsx@@ -3,7 +3,7 @@ import { useMessages } from '@/components/hooks';import { Form, FormButtons, FormRow, SubmitButton } from 'react-basics';import { ReportContext } from '../[reportId]/Report';import { MonthSelect } from '@/components/input/MonthSelect';-import BaseParameters from '../[reportId]/BaseParameters';+import { BaseParameters } from '../[reportId]/BaseParameters';import { parseDateRange } from '@/lib/date';export function RetentionParameters() {diff --git a/src/app/(main)/reports/retention/RetentionReport.tsx b/src/app/(main)/reports/retention/RetentionReport.tsxindex 062055706..dda567108 100644--- a/src/app/(main)/reports/retention/RetentionReport.tsx+++ b/src/app/(main)/reports/retention/RetentionReport.tsx@@ -1,9 +1,9 @@import { RetentionTable } from './RetentionTable';import { RetentionParameters } from './RetentionParameters';-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import Magnet from '@/assets/magnet.svg';import { REPORT_TYPES } from '@/lib/constants';import { parseDateRange } from '@/lib/date';diff --git a/src/app/(main)/reports/revenue/RevenueParameters.tsx b/src/app/(main)/reports/revenue/RevenueParameters.tsxindex 6919bea3e..8451644e1 100644--- a/src/app/(main)/reports/revenue/RevenueParameters.tsx+++ b/src/app/(main)/reports/revenue/RevenueParameters.tsx@@ -2,7 +2,7 @@ import { useMessages } from '@/components/hooks';import { useRevenueValues } from '@/components/hooks/queries/useRevenueValues';import { useContext } from 'react';import { Dropdown, Form, FormButtons, FormInput, FormRow, Item, SubmitButton } from 'react-basics';-import BaseParameters from '../[reportId]/BaseParameters';+import { BaseParameters } from '../[reportId]/BaseParameters';import { ReportContext } from '../[reportId]/Report';export function RevenueParameters() {diff --git a/src/app/(main)/reports/revenue/RevenueReport.tsx b/src/app/(main)/reports/revenue/RevenueReport.tsxindex 2cdd6bb89..9f0ccbb4f 100644--- a/src/app/(main)/reports/revenue/RevenueReport.tsx+++ b/src/app/(main)/reports/revenue/RevenueReport.tsx@@ -1,9 +1,9 @@import Money from '@/assets/money.svg';import { REPORT_TYPES } from '@/lib/constants';-import Report from '../[reportId]/Report';-import ReportBody from '../[reportId]/ReportBody';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';+import { Report } from '../[reportId]/Report';+import { ReportBody } from '../[reportId]/ReportBody';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';import { RevenueParameters } from './RevenueParameters';import { RevenueView } from './RevenueView';diff --git a/src/app/(main)/reports/utm/UTMParameters.tsx b/src/app/(main)/reports/utm/UTMParameters.tsxindex 2447668e3..2a43fc401 100644--- a/src/app/(main)/reports/utm/UTMParameters.tsx+++ b/src/app/(main)/reports/utm/UTMParameters.tsx@@ -2,7 +2,7 @@ import { useContext } from 'react';import { useMessages } from '@/components/hooks';import { Form, FormButtons, SubmitButton } from 'react-basics';import { ReportContext } from '../[reportId]/Report';-import BaseParameters from '../[reportId]/BaseParameters';+import { BaseParameters } from '../[reportId]/BaseParameters';export function UTMParameters() {const { report, runReport, isRunning } = useContext(ReportContext);diff --git a/src/app/(main)/reports/utm/UTMReport.tsx b/src/app/(main)/reports/utm/UTMReport.tsxindex 8898120e7..341747f06 100644--- a/src/app/(main)/reports/utm/UTMReport.tsx+++ b/src/app/(main)/reports/utm/UTMReport.tsx@@ -1,8 +1,8 @@'use client';-import Report from '../[reportId]/Report';-import ReportHeader from '../[reportId]/ReportHeader';-import ReportMenu from '../[reportId]/ReportMenu';-import ReportBody from '../[reportId]/ReportBody';+import { Report } from '../[reportId]/Report';+import { ReportHeader } from '../[reportId]/ReportHeader';+import { ReportMenu } from '../[reportId]/ReportMenu';+import { ReportBody } from '../[reportId]/ReportBody';import { UTMParameters } from './UTMParameters';import { UTMView } from './UTMView';import Tag from '@/assets/tag.svg';diff --git a/src/app/share/[...shareId]/SharePage.tsx b/src/app/share/[...shareId]/SharePage.tsxindex f6f3fd444..0830b8e4a 100644--- a/src/app/share/[...shareId]/SharePage.tsx+++ b/src/app/share/[...shareId]/SharePage.tsx@@ -1,5 +1,5 @@'use client';-import WebsiteDetailsPage from '../../(main)/websites/[websiteId]/WebsiteDetailsPage';+import { WebsiteDetailsPage } from '../../(main)/websites/[websiteId]/WebsiteDetailsPage';import { useShareToken } from '@/components/hooks';import { Page } from '@/components/layout/Page';import { Header } from './Header';diff --git a/src/components/common/AnimatedDiv.tsx b/src/components/common/AnimatedDiv.tsxnew file mode 100644index 000000000..04a28c5bb--- /dev/null+++ b/src/components/common/AnimatedDiv.tsx@@ -0,0 +1,3 @@+import { animated, AnimatedComponent } from '@react-spring/web';++export const AnimatedDiv: AnimatedComponent<any> = animated.div;diff --git a/src/components/input/LanguageButton.tsx b/src/components/input/LanguageButton.tsxindex c4e8a3717..fc65f7c2a 100644--- a/src/components/input/LanguageButton.tsx+++ b/src/components/input/LanguageButton.tsx@@ -26,7 +26,7 @@ export function LanguageButton() {<Button key={value} variant="quiet" onPress={() => handleSelect(value)}><Textweight={value === locale ? 'bold' : 'normal'}- color={value === locale ? 'primary' : 'muted'}+ color={value === locale ? undefined : 'muted'}>{label}</Text>diff --git a/src/components/layout/Page.module.css b/src/components/layout/Page.module.cssindex 3b9a4581b..807893602 100644--- a/src/components/layout/Page.module.css+++ b/src/components/layout/Page.module.css@@ -7,6 +7,4 @@max-width: 1320px;margin: 0 auto;padding: 0 20px;- min-height: calc(100vh - 60px);- min-height: calc(100dvh - 60px);}diff --git a/src/components/metrics/ListTable.tsx b/src/components/metrics/ListTable.tsxindex 64bd49151..3d674ee85 100644--- a/src/components/metrics/ListTable.tsx+++ b/src/components/metrics/ListTable.tsx@@ -1,6 +1,7 @@import { FixedSizeList } from 'react-window';-import { useSpring, animated, config } from '@react-spring/web';+import { useSpring, config } from '@react-spring/web';import classNames from 'classnames';+import { AnimatedDiv } from '@/components/common/AnimatedDiv';import { Empty } from '@/components/common/Empty';import { formatLongNumber } from '@/lib/format';import { useMessages } from '@/components/hooks';@@ -94,14 +95,14 @@ const AnimatedRow = ({ label, value = 0, percent, change, animate, showPercentag<div className={styles.label}>{label}</div><div className={styles.value}>{change}- <animated.div className={styles.value} title={props?.y as any}>+ <AnimatedDiv className={styles.value} title={props?.y as any}>{props.y?.to(formatLongNumber)}- </animated.div>+ </AnimatedDiv></div>{showPercentage && (<div className={styles.percent}>- <animated.div className={styles.bar} style={{ width: props.width.to(n => `${n}%`) }} />- <animated.span>{props.width.to(n => `${n?.toFixed?.(0)}%`)}</animated.span>+ <AnimatedDiv className={styles.bar} style={{ width: props.width.to(n => `${n}%`) }} />+ <AnimatedDiv>{props.width.to(n => `${n?.toFixed?.(0)}%`)}</AnimatedDiv></div>)}</div>diff --git a/src/components/metrics/MetricCard.tsx b/src/components/metrics/MetricCard.tsxindex 2e322db42..5711e35eb 100644--- a/src/components/metrics/MetricCard.tsx+++ b/src/components/metrics/MetricCard.tsx@@ -1,6 +1,7 @@import classNames from 'classnames';-import { useSpring, animated } from '@react-spring/web';+import { useSpring } from '@react-spring/web';import { formatNumber } from '@/lib/format';+import { AnimatedDiv } from '@/components/common/AnimatedDiv';import { ChangeLabel } from '@/components/metrics/ChangeLabel';import styles from './MetricCard.module.css';@@ -37,9 +38,9 @@ export const MetricCard = ({return (<div className={classNames(styles.card, className, showPrevious && styles.compare)}>{showLabel && <div className={styles.label}>{label}</div>}- <animated.div className={styles.value} title={value?.toString()}>+ <AnimatedDiv className={styles.value} title={value?.toString()}>{props?.x?.to(x => formatValue(x))}- </animated.div>+ </AnimatedDiv>{showChange && (<ChangeLabelclassName={styles.change}@@ -47,13 +48,13 @@ export const MetricCard = ({title={formatValue(change)}reverseColors={reverseColors}>- <animated.span>{changeProps?.x?.to(x => `${Math.abs(~~x)}%`)}</animated.span>+ <AnimatedDiv>{changeProps?.x?.to(x => `${Math.abs(~~x)}%`)}</AnimatedDiv></ChangeLabel>)}{showPrevious && (- <animated.div className={classNames(styles.value, styles.prev)} title={diff.toString()}>+ <AnimatedDiv className={classNames(styles.value, styles.prev)} title={diff.toString()}>{prevProps?.x?.to(x => formatValue(x))}- </animated.div>+ </AnimatedDiv>)}</div>);