From 79b240eff2ce90a4047fbf0f30b5a7880c63bafa Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Tue, 11 Feb 2025 20:13:02 +0000 Subject: [PATCH] :recycle: (imports) updating some common component import paths to the component lib --- .../src/components/AppBackground.tsx | 8 ++++---- .../src/components/FatalError.tsx | 8 ++++---- .../envelope/budgetsummary/ToBudgetAmount.tsx | 9 +++++---- .../envelope/budgetsummary/TotalsList.tsx | 11 ++++++----- .../budget/tracking/budgetsummary/Saved.tsx | 11 ++++++----- .../src/components/common/AlignedText.ts | 4 ---- .../src/components/common/Block.ts | 4 ---- .../modals/ConfirmCategoryDeleteModal.tsx | 11 ++++++----- .../modals/ConfirmTransactionEditModal.tsx | 9 +++++---- .../src/components/modals/LoadBackupModal.tsx | 11 ++++++----- .../modals/manager/ImportActualModal.tsx | 12 +++++++----- .../components/modals/manager/ImportModal.tsx | 12 +++++++----- .../modals/manager/ImportYNAB4Modal.tsx | 12 +++++++----- .../modals/manager/ImportYNAB5Modal.tsx | 12 +++++++----- .../src/components/reports/Change.tsx | 8 ++++---- .../src/components/reports/DateRange.tsx | 9 ++++----- .../components/reports/LoadingIndicator.tsx | 9 +++++---- .../src/components/reports/ReportCardName.tsx | 7 ++++--- .../components/reports/graphs/AreaGraph.tsx | 4 ++-- .../components/reports/graphs/BarGraph.tsx | 4 ++-- .../reports/graphs/BarLineGraph.tsx | 4 ++-- .../reports/graphs/CashFlowGraph.tsx | 4 ++-- .../components/reports/graphs/LineGraph.tsx | 4 ++-- .../reports/graphs/NetWorthGraph.tsx | 5 +++-- .../reports/graphs/SpendingGraph.tsx | 4 ++-- .../reports/graphs/StackedBarGraph.tsx | 4 ++-- .../reports/graphs/tableGraph/ReportTable.tsx | 8 ++++---- .../reports/reports/CalendarCard.tsx | 11 ++++++----- .../components/reports/reports/CashFlow.tsx | 14 +++++++------- .../reports/reports/CustomReport.tsx | 11 ++++++----- .../reports/reports/NetWorthCard.tsx | 7 ++++--- .../components/reports/reports/Spending.tsx | 19 ++++++++++--------- .../reports/reports/SpendingCard.tsx | 9 +++++---- .../spreadsheets/cash-flow-spreadsheet.tsx | 2 +- .../src/components/settings/Export.tsx | 8 ++++---- .../src/components/sidebar/Account.tsx | 17 +++++++++-------- .../src/components/sidebar/Item.tsx | 7 ++++--- .../src/components/sidebar/SecondaryItem.tsx | 6 +++--- .../src/components/util/LoadComponent.tsx | 10 +++++----- upcoming-release-notes/4358.md | 6 ++++++ 40 files changed, 178 insertions(+), 157 deletions(-) delete mode 100644 packages/desktop-client/src/components/common/AlignedText.ts delete mode 100644 packages/desktop-client/src/components/common/Block.ts create mode 100644 upcoming-release-notes/4358.md diff --git a/packages/desktop-client/src/components/AppBackground.tsx b/packages/desktop-client/src/components/AppBackground.tsx index 423412e31e4..d599a3b78fd 100644 --- a/packages/desktop-client/src/components/AppBackground.tsx +++ b/packages/desktop-client/src/components/AppBackground.tsx @@ -1,15 +1,15 @@ import React from 'react'; import { useTransition, animated } from 'react-spring'; +import { Block } from '@actual-app/components/block'; +import { AnimatedLoading } from '@actual-app/components/icons/AnimatedLoading'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import { css } from '@emotion/css'; -import { AnimatedLoading } from '../icons/AnimatedLoading'; import { useSelector } from '../redux'; -import { theme } from '../style'; import { Background } from './Background'; -import { Block } from './common/Block'; -import { View } from './common/View'; type AppBackgroundProps = { isLoading?: boolean; diff --git a/packages/desktop-client/src/components/FatalError.tsx b/packages/desktop-client/src/components/FatalError.tsx index 92664bc9a6d..0f80a80847e 100644 --- a/packages/desktop-client/src/components/FatalError.tsx +++ b/packages/desktop-client/src/components/FatalError.tsx @@ -1,17 +1,17 @@ import React, { useState, type ReactNode } from 'react'; import { useTranslation, Trans } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; import { Button } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { Stack } from '@actual-app/components/stack'; +import { Text } from '@actual-app/components/text'; import { View } from '@actual-app/components/view'; import { LazyLoadFailedError } from 'loot-core/shared/errors'; -import { Block } from './common/Block'; import { Link } from './common/Link'; import { Modal, ModalHeader } from './common/Modal'; -import { Paragraph } from './common/Paragraph'; -import { Stack } from './common/Stack'; -import { Text } from './common/Text'; import { Checkbox } from './forms'; type AppError = Error & { diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx index f329d9e3339..c642801ca2e 100644 --- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx +++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx @@ -1,13 +1,14 @@ import React, { type CSSProperties, type MouseEventHandler } from 'react'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; import { css } from '@emotion/css'; import { envelopeBudget } from 'loot-core/client/queries'; -import { theme, styles } from '../../../../style'; -import { Block } from '../../../common/Block'; -import { Tooltip } from '../../../common/Tooltip'; -import { View } from '../../../common/View'; import { PrivacyFilter } from '../../../PrivacyFilter'; import { useFormat } from '../../../spreadsheet/useFormat'; import { diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx index 33e5fd006df..eae77e5eedc 100644 --- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx +++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx @@ -1,12 +1,13 @@ import React, { type CSSProperties } from 'react'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; + import { envelopeBudget } from 'loot-core/client/queries'; -import { styles } from '../../../../style'; -import { AlignedText } from '../../../common/AlignedText'; -import { Block } from '../../../common/Block'; -import { Tooltip } from '../../../common/Tooltip'; -import { View } from '../../../common/View'; import { CellValueText } from '../../../spreadsheet/CellValue'; import { useFormat } from '../../../spreadsheet/useFormat'; import { EnvelopeCellValue } from '../EnvelopeBudgetComponents'; diff --git a/packages/desktop-client/src/components/budget/tracking/budgetsummary/Saved.tsx b/packages/desktop-client/src/components/budget/tracking/budgetsummary/Saved.tsx index e4fc3d52103..07869d7181c 100644 --- a/packages/desktop-client/src/components/budget/tracking/budgetsummary/Saved.tsx +++ b/packages/desktop-client/src/components/budget/tracking/budgetsummary/Saved.tsx @@ -1,15 +1,16 @@ import React, { type CSSProperties } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; import { css } from '@emotion/css'; import { trackingBudget } from 'loot-core/client/queries'; -import { theme, styles } from '../../../../style'; -import { AlignedText } from '../../../common/AlignedText'; -import { Text } from '../../../common/Text'; -import { Tooltip } from '../../../common/Tooltip'; -import { View } from '../../../common/View'; import { PrivacyFilter } from '../../../PrivacyFilter'; import { useFormat } from '../../../spreadsheet/useFormat'; import { makeAmountFullStyle } from '../../util'; diff --git a/packages/desktop-client/src/components/common/AlignedText.ts b/packages/desktop-client/src/components/common/AlignedText.ts deleted file mode 100644 index 1871f01745a..00000000000 --- a/packages/desktop-client/src/components/common/AlignedText.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { AlignedText as ActualComponentAlignedText } from '@actual-app/components/aligned-text'; - -/** @deprecated please import AlignedText from '@actual-app/components/aligned-text' */ -export const AlignedText = ActualComponentAlignedText; diff --git a/packages/desktop-client/src/components/common/Block.ts b/packages/desktop-client/src/components/common/Block.ts deleted file mode 100644 index a9c0e98f717..00000000000 --- a/packages/desktop-client/src/components/common/Block.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Block as ActualComponentBlock } from '@actual-app/components/block'; - -/** @deprecated please import Block from '@actual-app/components/block' */ -export const Block = ActualComponentBlock; diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx b/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx index 5c2a9d723cd..145366f6265 100644 --- a/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx +++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx @@ -2,14 +2,15 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; // Import useTranslation +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { useCategories } from '../../hooks/useCategories'; -import { theme } from '../../style'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; -import { Block } from '../common/Block'; -import { Button } from '../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal'; -import { Text } from '../common/Text'; -import { View } from '../common/View'; type ConfirmCategoryDeleteProps = { category: string; diff --git a/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx b/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx index 20e068cbb30..72af36bca5b 100644 --- a/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx +++ b/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx @@ -2,11 +2,12 @@ import React from 'react'; import { useTranslation, Trans } from 'react-i18next'; -import { Block } from '../common/Block'; -import { Button } from '../common/Button2'; -import { InitialFocus } from '../common/InitialFocus'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { InitialFocus } from '@actual-app/components/initial-focus'; +import { View } from '@actual-app/components/view'; + import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal'; -import { View } from '../common/View'; type ConfirmTransactionEditProps = { onCancel?: () => void; diff --git a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx index 7f21f8602cc..8df643e4e91 100644 --- a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx +++ b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx @@ -1,18 +1,19 @@ import React, { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { loadBackup, makeBackup } from 'loot-core/client/actions'; import { send, listen, unlisten } from 'loot-core/platform/client/fetch'; import { type Backup } from 'loot-core/server/backups'; import { useMetadataPref } from '../../hooks/useMetadataPref'; import { useDispatch } from '../../redux'; -import { theme } from '../../style'; -import { Block } from '../common/Block'; -import { Button } from '../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal'; -import { Text } from '../common/Text'; -import { View } from '../common/View'; import { Row, Cell } from '../table'; type BackupTableProps = { diff --git a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx index e68bbbcb096..83469d57a70 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx @@ -2,16 +2,18 @@ import React, { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { ButtonWithLoading } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { importBudget } from 'loot-core/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; import { useDispatch } from '../../../redux'; -import { styles, theme } from '../../../style'; -import { Block } from '../../common/Block'; -import { ButtonWithLoading } from '../../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; -import { Paragraph } from '../../common/Paragraph'; -import { View } from '../../common/View'; function getErrorMessage(error: string): string { switch (error) { diff --git a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx index e38c1990ca1..13c1a6321b7 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx @@ -1,15 +1,17 @@ import React, { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { pushModal } from 'loot-core/client/actions'; import { useDispatch } from '../../../redux'; -import { styles, theme } from '../../../style'; -import { Block } from '../../common/Block'; -import { Button } from '../../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; -import { Text } from '../../common/Text'; -import { View } from '../../common/View'; function getErrorMessage(error: 'not-ynab4' | boolean) { switch (error) { diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx index 267ce02bd53..8e0a76db5eb 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx @@ -2,16 +2,18 @@ import React, { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { ButtonWithLoading } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { importBudget } from 'loot-core/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; import { useDispatch } from '../../../redux'; -import { styles, theme } from '../../../style'; -import { Block } from '../../common/Block'; -import { ButtonWithLoading } from '../../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; -import { Paragraph } from '../../common/Paragraph'; -import { View } from '../../common/View'; function getErrorMessage(error: string): string { switch (error) { diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx index 577d7fd25be..e55e072f870 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx @@ -2,17 +2,19 @@ import React, { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { ButtonWithLoading } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import { importBudget } from 'loot-core/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; import { useDispatch } from '../../../redux'; -import { styles, theme } from '../../../style'; -import { Block } from '../../common/Block'; -import { ButtonWithLoading } from '../../common/Button2'; import { Link } from '../../common/Link'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; -import { Paragraph } from '../../common/Paragraph'; -import { View } from '../../common/View'; function getErrorMessage(error: string): string { switch (error) { diff --git a/packages/desktop-client/src/components/reports/Change.tsx b/packages/desktop-client/src/components/reports/Change.tsx index 2bfc51918a9..0face74c2b0 100644 --- a/packages/desktop-client/src/components/reports/Change.tsx +++ b/packages/desktop-client/src/components/reports/Change.tsx @@ -1,10 +1,10 @@ import React, { type CSSProperties } from 'react'; -import { integerToCurrency } from 'loot-core/shared/util'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; -import { styles } from '../../style/styles'; -import { theme } from '../../style/theme'; -import { Block } from '../common/Block'; +import { integerToCurrency } from 'loot-core/shared/util'; export function Change({ amount, diff --git a/packages/desktop-client/src/components/reports/DateRange.tsx b/packages/desktop-client/src/components/reports/DateRange.tsx index 561fa307bc3..f7d61a250b6 100644 --- a/packages/desktop-client/src/components/reports/DateRange.tsx +++ b/packages/desktop-client/src/components/reports/DateRange.tsx @@ -1,15 +1,14 @@ import React, { type ReactElement } from 'react'; import { Trans } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; import * as d from 'date-fns'; import * as monthUtils from 'loot-core/shared/months'; -import { theme } from '../../style'; -import { styles } from '../../style/styles'; -import { Block } from '../common/Block'; -import { Text } from '../common/Text'; - type DateRangeProps = { start: string; end: string; diff --git a/packages/desktop-client/src/components/reports/LoadingIndicator.tsx b/packages/desktop-client/src/components/reports/LoadingIndicator.tsx index e70bc0d7505..96e1e4fbd8b 100644 --- a/packages/desktop-client/src/components/reports/LoadingIndicator.tsx +++ b/packages/desktop-client/src/components/reports/LoadingIndicator.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { AnimatedLoading } from '../../icons/AnimatedLoading'; -import { theme, styles } from '../../style'; -import { Block } from '../common/Block'; -import { View } from '../common/View'; +import { Block } from '@actual-app/components/block'; +import { AnimatedLoading } from '@actual-app/components/icons/AnimatedLoading'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; type LoadingIndicatorProps = { message?: string; diff --git a/packages/desktop-client/src/components/reports/ReportCardName.tsx b/packages/desktop-client/src/components/reports/ReportCardName.tsx index 670ac0a9987..c4e52c67cac 100644 --- a/packages/desktop-client/src/components/reports/ReportCardName.tsx +++ b/packages/desktop-client/src/components/reports/ReportCardName.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { styles } from '../../style'; -import { Block } from '../common/Block'; -import { InitialFocus } from '../common/InitialFocus'; +import { Block } from '@actual-app/components/block'; +import { InitialFocus } from '@actual-app/components/initial-focus'; +import { styles } from '@actual-app/components/styles'; + import { Input } from '../common/Input'; import { NON_DRAGGABLE_AREA_CLASS_NAME } from './constants'; diff --git a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx index c7d8ba73f31..43953784d0d 100644 --- a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx @@ -1,6 +1,8 @@ import React, { type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { AreaChart, @@ -23,8 +25,6 @@ import { } from 'loot-core/types/models/reports'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { adjustTextSize } from './adjustTextSize'; diff --git a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx index c8ce53fe05b..408c435c53c 100644 --- a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx @@ -2,6 +2,8 @@ import React, { useState, type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { BarChart, @@ -30,8 +32,6 @@ import { useAccounts } from '../../../hooks/useAccounts'; import { useCategories } from '../../../hooks/useCategories'; import { useNavigate } from '../../../hooks/useNavigate'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { getCustomTick } from '../getCustomTick'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx index 9984c2d80c3..cf3e45c74bb 100644 --- a/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx @@ -2,6 +2,8 @@ import React, { type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { ComposedChart, @@ -16,8 +18,6 @@ import { import { amountToCurrencyNoDecimal } from 'loot-core/shared/util'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { PrivacyFilter } from '../../PrivacyFilter'; import { Container } from '../Container'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx index 20bce5177b3..a90c4752e1e 100644 --- a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx @@ -1,6 +1,8 @@ import React, { useState, type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import * as d from 'date-fns'; import { @@ -22,8 +24,6 @@ import { } from 'loot-core/shared/util'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { chartTheme } from '../chart-theme'; import { Container } from '../Container'; diff --git a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx index 415b5a9f5f2..608426e4a9f 100644 --- a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx @@ -2,6 +2,8 @@ import React, { useState, type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { LineChart, @@ -27,8 +29,6 @@ import { useAccounts } from '../../../hooks/useAccounts'; import { useCategories } from '../../../hooks/useCategories'; import { useNavigate } from '../../../hooks/useNavigate'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { getCustomTick } from '../getCustomTick'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx index 7eba9550d57..114340a1064 100644 --- a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx @@ -2,6 +2,9 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { type CSSProperties } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { AreaChart, @@ -16,8 +19,6 @@ import { import { amountToCurrencyNoDecimal } from 'loot-core/shared/util'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { type CSSProperties, theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx index 149c1954d98..fc781b77d94 100644 --- a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx @@ -2,6 +2,8 @@ import React, { type ComponentProps, type CSSProperties } from 'react'; import { useTranslation, Trans } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { AreaChart, @@ -20,8 +22,6 @@ import { import { type SpendingEntity } from 'loot-core/types/models/reports'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx index d2896d7513b..2baad742d3a 100644 --- a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx @@ -2,6 +2,8 @@ import React, { useState, type CSSProperties } from 'react'; import { useTranslation } from 'react-i18next'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { theme } from '@actual-app/components/theme'; import { css } from '@emotion/css'; import { BarChart, @@ -28,8 +30,6 @@ import { useAccounts } from '../../../hooks/useAccounts'; import { useCategories } from '../../../hooks/useCategories'; import { useNavigate } from '../../../hooks/useNavigate'; import { usePrivacyMode } from '../../../hooks/usePrivacyMode'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; import { Container } from '../Container'; import { getCustomTick } from '../getCustomTick'; import { numberFormatterTooltip } from '../numberFormatter'; diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx index 99f606e9ba9..ad8b88c9102 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx @@ -6,6 +6,10 @@ import React, { type UIEventHandler, } from 'react'; +import { Block } from '@actual-app/components/block'; +import { type CSSProperties } from '@actual-app/components/styles'; +import { View } from '@actual-app/components/view'; + import { type GroupedEntity, type DataEntity, @@ -13,10 +17,6 @@ import { } from 'loot-core/types/models/reports'; import { type RuleConditionEntity } from 'loot-core/types/models/rule'; -import { type CSSProperties } from '../../../../style'; -import { Block } from '../../../common/Block'; -import { View } from '../../../common/View'; - import { ReportTableHeader } from './ReportTableHeader'; import { ReportTableList } from './ReportTableList'; import { ReportTableRow } from './ReportTableRow'; diff --git a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx index 4506e3011e3..04d8304f116 100644 --- a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx @@ -10,6 +10,12 @@ import React, { } from 'react'; import { Trans, useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; import { format } from 'date-fns'; import { debounce } from 'debounce'; @@ -22,11 +28,6 @@ import { useMergedRefs } from '../../../hooks/useMergedRefs'; import { useNavigate } from '../../../hooks/useNavigate'; import { useResizeObserver } from '../../../hooks/useResizeObserver'; import { SvgArrowThickDown, SvgArrowThickUp } from '../../../icons/v1'; -import { styles, theme } from '../../../style'; -import { Block } from '../../common/Block'; -import { Button } from '../../common/Button2'; -import { Tooltip } from '../../common/Tooltip'; -import { View } from '../../common/View'; import { PrivacyFilter } from '../../PrivacyFilter'; import { useResponsive } from '../../responsive/ResponsiveProvider'; import { chartTheme } from '../chart-theme'; diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx index 9075e384aa5..f9df45f7b61 100644 --- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx +++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx @@ -2,6 +2,13 @@ import React, { useState, useEffect, useMemo } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import * as d from 'date-fns'; import { addNotification } from 'loot-core/client/actions'; @@ -19,13 +26,6 @@ import { useFilters } from '../../../hooks/useFilters'; import { useNavigate } from '../../../hooks/useNavigate'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { useDispatch } from '../../../redux'; -import { theme } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; -import { Block } from '../../common/Block'; -import { Button } from '../../common/Button2'; -import { Paragraph } from '../../common/Paragraph'; -import { Text } from '../../common/Text'; -import { View } from '../../common/View'; import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle'; import { MobileBackButton } from '../../mobile/MobileBackButton'; import { MobilePageHeader, Page, PageHeader } from '../../Page'; diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx index 7518b7391c6..bf422b899c3 100644 --- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx +++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx @@ -2,6 +2,12 @@ import React, { useState, useEffect, useMemo } from 'react'; import { useTranslation, Trans } from 'react-i18next'; import { useLocation, useParams } from 'react-router-dom'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import * as d from 'date-fns'; import { useReport as useCustomReport } from 'loot-core/client/data-hooks/reports'; @@ -26,12 +32,7 @@ import { useLocalPref } from '../../../hooks/useLocalPref'; import { useNavigate } from '../../../hooks/useNavigate'; import { usePayees } from '../../../hooks/usePayees'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; -import { theme, styles } from '../../../style'; import { Warning } from '../../alerts'; -import { AlignedText } from '../../common/AlignedText'; -import { Block } from '../../common/Block'; -import { Text } from '../../common/Text'; -import { View } from '../../common/View'; import { AppliedFilters } from '../../filters/AppliedFilters'; import { MobileBackButton } from '../../mobile/MobileBackButton'; import { MobilePageHeader, Page, PageHeader } from '../../Page'; diff --git a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx index 55f3982958c..29361f23237 100644 --- a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx @@ -1,15 +1,16 @@ import React, { useState, useMemo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { View } from '@actual-app/components/view'; + import { integerToCurrency } from 'loot-core/shared/util'; import { type AccountEntity, type NetWorthWidget, } from 'loot-core/types/models'; -import { styles } from '../../../style'; -import { Block } from '../../common/Block'; -import { View } from '../../common/View'; import { PrivacyFilter } from '../../PrivacyFilter'; import { useResponsive } from '../../responsive/ResponsiveProvider'; import { Change } from '../Change'; diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsx index c109d361383..37e12483a59 100644 --- a/packages/desktop-client/src/components/reports/reports/Spending.tsx +++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx @@ -2,6 +2,16 @@ import React, { useState, useMemo, useEffect } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { Block } from '@actual-app/components/block'; +import { Button } from '@actual-app/components/button'; +import { Paragraph } from '@actual-app/components/paragraph'; +import { SpaceBetween } from '@actual-app/components/space-between'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; import * as d from 'date-fns'; import { addNotification } from 'loot-core/client/actions'; @@ -15,16 +25,7 @@ import { type RuleConditionEntity } from 'loot-core/types/models/rule'; import { useFilters } from '../../../hooks/useFilters'; import { useNavigate } from '../../../hooks/useNavigate'; import { useDispatch } from '../../../redux'; -import { theme, styles } from '../../../style'; -import { AlignedText } from '../../common/AlignedText'; -import { Block } from '../../common/Block'; -import { Button } from '../../common/Button2'; -import { Paragraph } from '../../common/Paragraph'; import { Select } from '../../common/Select'; -import { SpaceBetween } from '../../common/SpaceBetween'; -import { Text } from '../../common/Text'; -import { Tooltip } from '../../common/Tooltip'; -import { View } from '../../common/View'; import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle'; import { AppliedFilters } from '../../filters/AppliedFilters'; import { FilterButton } from '../../filters/FiltersMenu'; diff --git a/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx b/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx index b3bc530dd0f..79a64f44969 100644 --- a/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx @@ -1,14 +1,15 @@ import React, { useState, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; + import * as monthUtils from 'loot-core/shared/months'; import { amountToCurrency } from 'loot-core/shared/util'; import { type SpendingWidget } from 'loot-core/types/models'; -import { styles } from '../../../style/styles'; -import { theme } from '../../../style/theme'; -import { Block } from '../../common/Block'; -import { View } from '../../common/View'; import { PrivacyFilter } from '../../PrivacyFilter'; import { DateRange } from '../DateRange'; import { SpendingGraph } from '../graphs/SpendingGraph'; diff --git a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx index 4f0810045ac..c291b4ba487 100644 --- a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx +++ b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { AlignedText } from '@actual-app/components/aligned-text'; import * as d from 'date-fns'; import { t } from 'i18next'; @@ -10,7 +11,6 @@ import { q } from 'loot-core/shared/query'; import { integerToCurrency, integerToAmount } from 'loot-core/shared/util'; import { type RuleConditionEntity } from 'loot-core/types/models'; -import { AlignedText } from '../../common/AlignedText'; import { runAll, indexCashFlow } from '../util'; export function simpleCashFlow( diff --git a/packages/desktop-client/src/components/settings/Export.tsx b/packages/desktop-client/src/components/settings/Export.tsx index 34fba10de76..9198b4c7154 100644 --- a/packages/desktop-client/src/components/settings/Export.tsx +++ b/packages/desktop-client/src/components/settings/Export.tsx @@ -1,15 +1,15 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { Block } from '@actual-app/components/block'; +import { ButtonWithLoading } from '@actual-app/components/button'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; import { format } from 'date-fns'; import { send } from 'loot-core/platform/client/fetch'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { theme } from '../../style'; -import { Block } from '../common/Block'; -import { ButtonWithLoading } from '../common/Button2'; -import { Text } from '../common/Text'; import { Setting } from './UI'; diff --git a/packages/desktop-client/src/components/sidebar/Account.tsx b/packages/desktop-client/src/components/sidebar/Account.tsx index 68d93abbbd9..95cb911f60a 100644 --- a/packages/desktop-client/src/components/sidebar/Account.tsx +++ b/packages/desktop-client/src/components/sidebar/Account.tsx @@ -1,6 +1,15 @@ // @ts-strict-ignore import React, { type CSSProperties, useRef, useState } from 'react'; +import { AlignedText } from '@actual-app/components/aligned-text'; +import { InitialFocus } from '@actual-app/components/initial-focus'; +import { Menu } from '@actual-app/components/menu'; +import { Popover } from '@actual-app/components/popover'; +import { styles } from '@actual-app/components/styles'; +import { Text } from '@actual-app/components/text'; +import { theme } from '@actual-app/components/theme'; +import { Tooltip } from '@actual-app/components/tooltip'; +import { View } from '@actual-app/components/view'; import { css, cx } from '@emotion/css'; import { openAccountCloseModal } from 'loot-core/client/actions'; @@ -14,16 +23,8 @@ import { type AccountEntity } from 'loot-core/types/models'; import { useContextMenu } from '../../hooks/useContextMenu'; import { useNotes } from '../../hooks/useNotes'; import { useDispatch } from '../../redux'; -import { styles, theme } from '../../style'; -import { AlignedText } from '../common/AlignedText'; -import { InitialFocus } from '../common/InitialFocus'; import { Input } from '../common/Input'; import { Link } from '../common/Link'; -import { Menu } from '../common/Menu'; -import { Popover } from '../common/Popover'; -import { Text } from '../common/Text'; -import { Tooltip } from '../common/Tooltip'; -import { View } from '../common/View'; import { Notes } from '../Notes'; import { useDraggable, diff --git a/packages/desktop-client/src/components/sidebar/Item.tsx b/packages/desktop-client/src/components/sidebar/Item.tsx index 85b2d11fb32..d91f8d14d74 100644 --- a/packages/desktop-client/src/components/sidebar/Item.tsx +++ b/packages/desktop-client/src/components/sidebar/Item.tsx @@ -7,9 +7,10 @@ import React, { type CSSProperties, } from 'react'; -import { styles, theme } from '../../style'; -import { Block } from '../common/Block'; -import { View } from '../common/View'; +import { Block } from '@actual-app/components/block'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import { ItemContent } from './ItemContent'; diff --git a/packages/desktop-client/src/components/sidebar/SecondaryItem.tsx b/packages/desktop-client/src/components/sidebar/SecondaryItem.tsx index d7700372139..60dcc27220e 100644 --- a/packages/desktop-client/src/components/sidebar/SecondaryItem.tsx +++ b/packages/desktop-client/src/components/sidebar/SecondaryItem.tsx @@ -6,9 +6,9 @@ import React, { type CSSProperties, } from 'react'; -import { theme } from '../../style'; -import { Block } from '../common/Block'; -import { View } from '../common/View'; +import { Block } from '@actual-app/components/block'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import { accountNameStyle } from './Account'; import { ItemContent } from './ItemContent'; diff --git a/packages/desktop-client/src/components/util/LoadComponent.tsx b/packages/desktop-client/src/components/util/LoadComponent.tsx index f4fc3d24b42..3f19b27ffdd 100644 --- a/packages/desktop-client/src/components/util/LoadComponent.tsx +++ b/packages/desktop-client/src/components/util/LoadComponent.tsx @@ -1,14 +1,14 @@ import { type ComponentType, useEffect, useState } from 'react'; +import { Block } from '@actual-app/components/block'; +import { AnimatedLoading } from '@actual-app/components/icons/AnimatedLoading'; +import { styles } from '@actual-app/components/styles'; +import { theme } from '@actual-app/components/theme'; +import { View } from '@actual-app/components/view'; import promiseRetry from 'promise-retry'; import { LazyLoadFailedError } from 'loot-core/shared/errors'; -import { AnimatedLoading } from '../../icons/AnimatedLoading'; -import { theme, styles } from '../../style'; -import { Block } from '../common/Block'; -import { View } from '../common/View'; - type ProplessComponent = ComponentType>; type LoadComponentProps = { name: K; diff --git a/upcoming-release-notes/4358.md b/upcoming-release-notes/4358.md new file mode 100644 index 00000000000..35f19843567 --- /dev/null +++ b/upcoming-release-notes/4358.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Updating some common component imports to the new component-lib path.