Skip to content

A local-first personal finance app

:recycle: (common) migrating to specific common component import paths (#1418)

Matiss Janis Aboltins60e5f1ae85b4
diff --git a/packages/desktop-client/src/components/LoggedInUser.js b/packages/desktop-client/src/components/LoggedInUser.js
index 558c291746..30fe66b065 100644
--- a/packages/desktop-client/src/components/LoggedInUser.js
+++ b/packages/desktop-client/src/components/LoggedInUser.js
@@ -4,8 +4,12 @@ import { useSelector } from 'react-redux';
import { useActions } from '../hooks/useActions';
import { colors, styles } from '../style';
-import { View, Text, Button, Tooltip, Menu } from './common';
+import Button from './common/Button';
+import Menu from './common/Menu';
+import Text from './common/Text';
+import View from './common/View';
import { useServerURL } from './ServerContext';
+import { Tooltip } from './tooltips';
export default function LoggedInUser({ hideIfNoServer, style, color }) {
let userData = useSelector(state => state.userData);
diff --git a/packages/desktop-client/src/components/NotesButton.tsx b/packages/desktop-client/src/components/NotesButton.tsx
index bd5d37fe68..3b46eb879d 100644
--- a/packages/desktop-client/src/components/NotesButton.tsx
+++ b/packages/desktop-client/src/components/NotesButton.tsx
@@ -9,7 +9,10 @@ import { send } from 'loot-core/src/platform/client/fetch';
import CustomNotesPaper from '../icons/v2/CustomNotesPaper';
import { colors } from '../style';
-import { View, Button, Tooltip, useTooltip, Text } from './common';
+import Button from './common/Button';
+import Text from './common/Text';
+import View from './common/View';
+import { Tooltip, useTooltip } from './tooltips';
type NotesTooltipProps = {
editable?: boolean;
diff --git a/packages/desktop-client/src/components/SidebarWithData.js b/packages/desktop-client/src/components/SidebarWithData.js
index db6302c25f..867a87a590 100644
--- a/packages/desktop-client/src/components/SidebarWithData.js
+++ b/packages/desktop-client/src/components/SidebarWithData.js
@@ -11,8 +11,13 @@ import { useActions } from '../hooks/useActions';
import ExpandArrow from '../icons/v0/ExpandArrow';
import { styles, colors } from '../style';
-import { Button, Input, InitialFocus, Text, Tooltip, Menu } from './common';
+import Button from './common/Button';
+import InitialFocus from './common/InitialFocus';
+import Input from './common/Input';
+import Menu from './common/Menu';
+import Text from './common/Text';
import { Sidebar } from './sidebar';
+import { Tooltip } from './tooltips';
function EditableBudgetName({ prefs, savePrefs }) {
let dispatch = useDispatch();
diff --git a/packages/desktop-client/src/components/Titlebar.js b/packages/desktop-client/src/components/Titlebar.js
index c0d61d3cdc..df0a73319b 100644
--- a/packages/desktop-client/src/components/Titlebar.js
+++ b/packages/desktop-client/src/components/Titlebar.js
@@ -34,7 +34,6 @@ import {
ButtonLink,
Button,
ButtonWithLoading,
- Tooltip,
ExternalLink,
} from './common';
import Paragraph from './common/Paragraph';
@@ -43,6 +42,7 @@ import LoggedInUser from './LoggedInUser';
import { useServerURL } from './ServerContext';
import useSheetValue from './spreadsheet/useSheetValue';
import { ThemeSelector } from './ThemeSelector';
+import { Tooltip } from './tooltips';
export let TitlebarContext = createContext();
diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
index 17bd824172..03f831b49d 100644
--- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
+++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
@@ -6,7 +6,10 @@ import { authorizeBank } from '../../gocardless';
import { useActions } from '../../hooks/useActions';
import ExclamationOutline from '../../icons/v1/ExclamationOutline';
import { colors } from '../../style';
-import { View, Button, Tooltip, ExternalLink } from '../common';
+import { ExternalLink } from '../common';
+import Button from '../common/Button';
+import View from '../common/View';
+import { Tooltip } from '../tooltips';
function getErrorMessage(type, code) {
switch (type.toUpperCase()) {
diff --git a/packages/desktop-client/src/components/accounts/Header.js b/packages/desktop-client/src/components/accounts/Header.js
index 0a236c3b32..d3f8ef124e 100644
--- a/packages/desktop-client/src/components/accounts/Header.js
+++ b/packages/desktop-client/src/components/accounts/Header.js
@@ -11,17 +11,15 @@ import SvgRemove from '../../icons/v2/Remove';
import SearchAlternate from '../../icons/v2/SearchAlternate';
import { styles, colors } from '../../style';
import AnimatedRefresh from '../AnimatedRefresh';
-import {
- View,
- Button,
- MenuButton,
- MenuTooltip,
- Input,
- InputWithContent,
- InitialFocus,
- Menu,
- Stack,
-} from '../common';
+import Button from '../common/Button';
+import InitialFocus from '../common/InitialFocus';
+import Input from '../common/Input';
+import InputWithContent from '../common/InputWithContent';
+import Menu from '../common/Menu';
+import MenuButton from '../common/MenuButton';
+import MenuTooltip from '../common/MenuTooltip';
+import Stack from '../common/Stack';
+import View from '../common/View';
import { FilterButton } from '../filters/FiltersMenu';
import { FiltersStack } from '../filters/SavedFilters';
import { KeyHandlers } from '../KeyHandlers';
diff --git a/packages/desktop-client/src/components/accounts/MobileAccountDetails.js b/packages/desktop-client/src/components/accounts/MobileAccountDetails.js
index 0cf4741820..4c9ecb5b72 100644
--- a/packages/desktop-client/src/components/accounts/MobileAccountDetails.js
+++ b/packages/desktop-client/src/components/accounts/MobileAccountDetails.js
@@ -5,8 +5,11 @@ import Add from '../../icons/v1/Add';
import CheveronLeft from '../../icons/v1/CheveronLeft';
import SearchAlternate from '../../icons/v2/SearchAlternate';
import { colors, styles } from '../../style';
-import { Button, InputWithContent, Label, View } from '../common';
+import Button from '../common/Button';
+import InputWithContent from '../common/InputWithContent';
+import Label from '../common/Label';
import Text from '../common/Text';
+import View from '../common/View';
import CellValue from '../spreadsheet/CellValue';
import { TransactionList } from '../transactions/MobileTransaction';
diff --git a/packages/desktop-client/src/components/accounts/MobileAccounts.js b/packages/desktop-client/src/components/accounts/MobileAccounts.js
index 7b2ed03e53..7e9c6e792f 100644
--- a/packages/desktop-client/src/components/accounts/MobileAccounts.js
+++ b/packages/desktop-client/src/components/accounts/MobileAccounts.js
@@ -7,7 +7,10 @@ import * as queries from 'loot-core/src/client/queries';
import { useActions } from '../../hooks/useActions';
import { useSetThemeColor } from '../../hooks/useSetThemeColor';
import { colors, styles } from '../../style';
-import { Button, Text, TextOneLine, View } from '../common';
+import Button from '../common/Button';
+import Text from '../common/Text';
+import TextOneLine from '../common/TextOneLine';
+import View from '../common/View';
import { Page } from '../Page';
import CellValue from '../spreadsheet/CellValue';
diff --git a/packages/desktop-client/src/components/accounts/Reconcile.js b/packages/desktop-client/src/components/accounts/Reconcile.js
index 191109f669..f698c9a36e 100644
--- a/packages/desktop-client/src/components/accounts/Reconcile.js
+++ b/packages/desktop-client/src/components/accounts/Reconcile.js
@@ -5,9 +5,10 @@ import { currencyToInteger } from 'loot-core/src/shared/util';
import CheckCircle1 from '../../icons/v2/CheckCircle1';
import { styles, colors } from '../../style';
-import { View, Text, Button, Input, InitialFocus, Tooltip } from '../common';
+import { View, Text, Button, Input, InitialFocus } from '../common';
import format from '../spreadsheet/format';
import useSheetValue from '../spreadsheet/useSheetValue';
+import { Tooltip } from '../tooltips';
export function ReconcilingMessage({
balanceQuery,
diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
index 32845461c3..0772f71d9a 100644
--- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
@@ -15,7 +15,10 @@ import { type CSSProperties, css } from 'glamor';
import Remove from '../../icons/v2/Remove';
import { colors } from '../../style';
-import { View, Input, Tooltip, Button } from '../common';
+import Button from '../common/Button';
+import Input from '../common/Input';
+import View from '../common/View';
+import { Tooltip } from '../tooltips';
const inst: { lastChangeType? } = {};
diff --git a/packages/desktop-client/src/components/budget/misc.js b/packages/desktop-client/src/components/budget/misc.js
index 4c1dacdda2..cfc8c44eca 100644
--- a/packages/desktop-client/src/components/budget/misc.js
+++ b/packages/desktop-client/src/components/budget/misc.js
@@ -13,14 +13,7 @@ import ExpandArrow from '../../icons/v0/ExpandArrow';
import CheveronDown from '../../icons/v1/CheveronDown';
import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import { styles, colors } from '../../style';
-import {
- View,
- Text,
- Button,
- Tooltip,
- Menu,
- IntersectionBoundary,
-} from '../common';
+import { View, Text, Button, Menu } from '../common';
import NotesButton from '../NotesButton';
import {
useDraggable,
@@ -30,6 +23,7 @@ import {
} from '../sort';
import NamespaceContext from '../spreadsheet/NamespaceContext';
import { Row, InputCell, ROW_HEIGHT } from '../table';
+import { Tooltip, IntersectionBoundary } from '../tooltips';
import BudgetSummaries from './BudgetSummaries';
import { INCOME_HEADER_HEIGHT, MONTH_BOX_SHADOW } from './constants';
diff --git a/packages/desktop-client/src/components/budget/report/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/report/BudgetSummary.tsx
index a56afd3e73..6533e11ab7 100644
--- a/packages/desktop-client/src/components/budget/report/BudgetSummary.tsx
+++ b/packages/desktop-client/src/components/budget/report/BudgetSummary.tsx
@@ -16,22 +16,20 @@ import DotsHorizontalTriple from '../../../icons/v1/DotsHorizontalTriple';
import ArrowButtonDown1 from '../../../icons/v2/ArrowButtonDown1';
import ArrowButtonUp1 from '../../../icons/v2/ArrowButtonUp1';
import { colors, styles } from '../../../style';
-import {
- View,
- Text,
- Button,
- Tooltip,
- Menu,
- Stack,
- HoverTarget,
- AlignedText,
-} from '../../common';
+import AlignedText from '../../common/AlignedText';
+import Button from '../../common/Button';
+import HoverTarget from '../../common/HoverTarget';
+import Menu from '../../common/Menu';
+import Stack from '../../common/Stack';
+import Text from '../../common/Text';
+import View from '../../common/View';
import NotesButton from '../../NotesButton';
import PrivacyFilter from '../../PrivacyFilter';
import CellValue from '../../spreadsheet/CellValue';
import format from '../../spreadsheet/format';
import NamespaceContext from '../../spreadsheet/NamespaceContext';
import useSheetValue from '../../spreadsheet/useSheetValue';
+import { Tooltip } from '../../tooltips';
import { MONTH_BOX_SHADOW } from '../constants';
import { makeAmountFullStyle } from '../util';
diff --git a/packages/desktop-client/src/components/budget/report/components.tsx b/packages/desktop-client/src/components/budget/report/components.tsx
index 78496230c1..0f6523c525 100644
--- a/packages/desktop-client/src/components/budget/report/components.tsx
+++ b/packages/desktop-client/src/components/budget/report/components.tsx
@@ -7,11 +7,15 @@ import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util';
import useFeatureFlag from '../../../hooks/useFeatureFlag';
import CheveronDown from '../../../icons/v1/CheveronDown';
import { styles, colors } from '../../../style';
-import { Button, View, Text, Tooltip, Menu, useTooltip } from '../../common';
+import Button from '../../common/Button';
+import Menu from '../../common/Menu';
+import Text from '../../common/Text';
+import View from '../../common/View';
import CellValue from '../../spreadsheet/CellValue';
import format from '../../spreadsheet/format';
import useSheetValue from '../../spreadsheet/useSheetValue';
import { Field, SheetCell } from '../../table';
+import { Tooltip, useTooltip } from '../../tooltips';
import BalanceWithCarryover from '../BalanceWithCarryover';
import { MONTH_RIGHT_PADDING } from '../constants';
import { makeAmountGrey } from '../util';
diff --git a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx
index 97782af227..376679a242 100644
--- a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx
@@ -9,15 +9,12 @@ import DotsHorizontalTriple from '../../../icons/v1/DotsHorizontalTriple';
import ArrowButtonDown1 from '../../../icons/v2/ArrowButtonDown1';
import ArrowButtonUp1 from '../../../icons/v2/ArrowButtonUp1';
import { colors, styles } from '../../../style';
-import {
- View,
- Block,
- Button,
- Tooltip,
- Menu,
- HoverTarget,
- AlignedText,
-} from '../../common';
+import AlignedText from '../../common/AlignedText';
+import Block from '../../common/Block';
+import Button from '../../common/Button';
+import HoverTarget from '../../common/HoverTarget';
+import Menu from '../../common/Menu';
+import View from '../../common/View';
import NotesButton from '../../NotesButton';
import PrivacyFilter from '../../PrivacyFilter';
import CellValue from '../../spreadsheet/CellValue';
@@ -25,6 +22,7 @@ import format from '../../spreadsheet/format';
import NamespaceContext from '../../spreadsheet/NamespaceContext';
import useSheetName from '../../spreadsheet/useSheetName';
import useSheetValue from '../../spreadsheet/useSheetValue';
+import { Tooltip } from '../../tooltips';
import { MONTH_BOX_SHADOW } from '../constants';
import HoldTooltip from './HoldTooltip';
diff --git a/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx
index 68573a38f2..74e1228080 100644
--- a/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx
@@ -9,8 +9,12 @@ import { useSpreadsheet } from 'loot-core/src/client/SpreadsheetProvider';
import evalArithmetic from 'loot-core/src/shared/arithmetic';
import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util';
-import { View, Button, Tooltip, InitialFocus, Input } from '../../common';
+import Button from '../../common/Button';
+import InitialFocus from '../../common/InitialFocus';
+import Input from '../../common/Input';
+import View from '../../common/View';
import NamespaceContext from '../../spreadsheet/NamespaceContext';
+import { Tooltip } from '../../tooltips';
type HoldTooltipProps = {
onSubmit: (amount: number) => void;
diff --git a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
index f5c0014571..97e6f280d5 100644
--- a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
@@ -10,8 +10,12 @@ import evalArithmetic from 'loot-core/src/shared/arithmetic';
import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util';
import CategoryAutocomplete from '../../autocomplete/CategorySelect';
-import { View, Button, Tooltip, InitialFocus, Input } from '../../common';
+import Button from '../../common/Button';
+import InitialFocus from '../../common/InitialFocus';
+import Input from '../../common/Input';
+import View from '../../common/View';
import NamespaceContext from '../../spreadsheet/NamespaceContext';
+import { Tooltip } from '../../tooltips';
import { addToBeBudgetedGroup, CategoryGroupsContext } from '../util';
type TransferTooltipProps = {
diff --git a/packages/desktop-client/src/components/budget/rollover/rollover-components.tsx b/packages/desktop-client/src/components/budget/rollover/rollover-components.tsx
index 7f9c192f9a..9ce5023720 100644
--- a/packages/desktop-client/src/components/budget/rollover/rollover-components.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/rollover-components.tsx
@@ -8,19 +8,16 @@ import useFeatureFlag from '../../../hooks/useFeatureFlag';
import CheveronDown from '../../../icons/v1/CheveronDown';
import { styles, colors } from '../../../style';
import CategoryAutocomplete from '../../autocomplete/CategorySelect';
-import {
- View,
- Text,
- useTooltip,
- InitialFocus,
- Tooltip,
- Button,
- Menu,
-} from '../../common';
+import Button from '../../common/Button';
+import InitialFocus from '../../common/InitialFocus';
+import Menu from '../../common/Menu';
+import Text from '../../common/Text';
+import View from '../../common/View';
import CellValue from '../../spreadsheet/CellValue';
import format from '../../spreadsheet/format';
import useSheetValue from '../../spreadsheet/useSheetValue';
import { Row, Field, SheetCell } from '../../table';
+import { Tooltip, useTooltip } from '../../tooltips';
import BalanceWithCarryover from '../BalanceWithCarryover';
import { MONTH_RIGHT_PADDING } from '../constants';
import {
diff --git a/packages/desktop-client/src/components/common.tsx b/packages/desktop-client/src/components/common.tsx
index 8118eae545..8950da820d 100644
--- a/packages/desktop-client/src/components/common.tsx
+++ b/packages/desktop-client/src/components/common.tsx
@@ -7,27 +7,18 @@ import { colors } from '../style';
import Button from './common/Button';
-export { default as AlignedText } from './common/AlignedText';
export { default as AnchorLink } from './common/AnchorLink';
export { default as Block } from './common/Block';
export { default as Button, ButtonWithLoading } from './common/Button';
export { default as Card } from './common/Card';
export { default as Select } from './common/Select';
-export { default as FormError } from './common/FormError';
-export { default as HoverTarget } from './common/HoverTarget';
export { default as InitialFocus } from './common/InitialFocus';
-export { default as InlineField } from './common/InlineField';
export { default as Input } from './common/Input';
-export { default as InputWithContent } from './common/InputWithContent';
export { default as Label } from './common/Label';
export { default as Menu } from './common/Menu';
-export { default as MenuButton } from './common/MenuButton';
-export { default as MenuTooltip } from './common/MenuTooltip';
export { default as Modal, ModalButtons } from './common/Modal';
-export { default as Search } from './common/Search';
-export { default as Stack } from './Stack';
+export { default as Stack } from './common/Stack';
export { default as Text } from './common/Text';
-export { default as TextOneLine } from './common/TextOneLine';
export { default as View } from './common/View';
export { default as LinkButton } from './common/LinkButton';
@@ -84,6 +75,3 @@ export function ButtonLink({
/>
);
}
-
-export * from './tooltips';
-export { useTooltip } from './tooltips';
diff --git a/packages/desktop-client/src/components/common/MenuTooltip.tsx b/packages/desktop-client/src/components/common/MenuTooltip.tsx
index 7549da2ceb..94b63a0df0 100644
--- a/packages/desktop-client/src/components/common/MenuTooltip.tsx
+++ b/packages/desktop-client/src/components/common/MenuTooltip.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { Tooltip } from '../common';
+import { Tooltip } from '../tooltips';
export default function MenuTooltip({ width, onClose, children }) {
return (
diff --git a/packages/desktop-client/src/components/Stack.tsx b/packages/desktop-client/src/components/common/Stack.tsx
similarity index 96%
rename from packages/desktop-client/src/components/Stack.tsx
rename to packages/desktop-client/src/components/common/Stack.tsx
index 4c54eafcee..cbef33dcf2 100644
--- a/packages/desktop-client/src/components/Stack.tsx
+++ b/packages/desktop-client/src/components/common/Stack.tsx
@@ -7,8 +7,8 @@ import React, {
type ReactNode,
} from 'react';
-import Text from './common/Text';
-import View from './common/View';
+import Text from './Text';
+import View from './View';
function getChildren(key, children) {
return Children.toArray(children).reduce((list, child) => {
diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.js b/packages/desktop-client/src/components/filters/FiltersMenu.js
index 987752f157..3397be89c2 100644
--- a/packages/desktop-client/src/components/filters/FiltersMenu.js
+++ b/packages/desktop-client/src/components/filters/FiltersMenu.js
@@ -26,8 +26,14 @@ import { titleFirst } from 'loot-core/src/shared/util';
import DeleteIcon from '../../icons/v0/Delete';
import SettingsSliderAlternate from '../../icons/v2/SettingsSliderAlternate';
import { colors } from '../../style';
-import { View, Text, Tooltip, Stack, Button, Menu, Select } from '../common';
+import Button from '../common/Button';
+import Menu from '../common/Menu';
+import Select from '../common/Select';
+import Stack from '../common/Stack';
+import Text from '../common/Text';
+import View from '../common/View';
import { Value } from '../ManageRules';
+import { Tooltip } from '../tooltips';
import GenericInput from '../util/GenericInput';
import { CondOpMenu } from './SavedFilters';
diff --git a/packages/desktop-client/src/components/filters/SavedFilters.js b/packages/desktop-client/src/components/filters/SavedFilters.js
index eabf765758..38b16ce506 100644
--- a/packages/desktop-client/src/components/filters/SavedFilters.js
+++ b/packages/desktop-client/src/components/filters/SavedFilters.js
@@ -4,7 +4,12 @@ import { send, sendCatch } from 'loot-core/src/platform/client/fetch';
import ExpandArrow from '../../icons/v0/ExpandArrow';
import { colors } from '../../style';
-import { View, Text, Button, Menu, MenuTooltip, Stack } from '../common';
+import Button from '../common/Button';
+import Menu from '../common/Menu';
+import MenuTooltip from '../common/MenuTooltip';
+import Stack from '../common/Stack';
+import Text from '../common/Text';
+import View from '../common/View';
import { FormField, FormLabel } from '../forms';
import { FieldSelect } from '../modals/EditRule';
import GenericInput from '../util/GenericInput';
diff --git a/packages/desktop-client/src/components/manager/BudgetList.js b/packages/desktop-client/src/components/manager/BudgetList.js
index 6b82f0ae0f..f58ce2ef86 100644
--- a/packages/desktop-client/src/components/manager/BudgetList.js
+++ b/packages/desktop-client/src/components/manager/BudgetList.js
@@ -15,7 +15,8 @@ import Key from '../../icons/v2/Key';
import RefreshArrow from '../../icons/v2/RefreshArrow';
import { styles, colors } from '../../style';
import tokens from '../../tokens';
-import { View, Text, Button, Tooltip, Menu } from '../common';
+import { View, Text, Button, Menu } from '../common';
+import { Tooltip } from '../tooltips';
function getFileDescription(file) {
if (file.state === 'unknown') {
diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccount.js b/packages/desktop-client/src/components/modals/CreateLocalAccount.js
index e03dbd87bb..e037fb369f 100644
--- a/packages/desktop-client/src/components/modals/CreateLocalAccount.js
+++ b/packages/desktop-client/src/components/modals/CreateLocalAccount.js
@@ -4,18 +4,15 @@ import { useNavigate } from 'react-router-dom';
import { toRelaxedNumber } from 'loot-core/src/shared/util';
import { colors } from '../../style';
-import {
- View,
- Modal,
- ModalButtons,
- Button,
- Input,
- InlineField,
- FormError,
- InitialFocus,
- Text,
- ExternalLink,
-} from '../common';
+import { ExternalLink } from '../common';
+import Button from '../common/Button';
+import FormError from '../common/FormError';
+import InitialFocus from '../common/InitialFocus';
+import InlineField from '../common/InlineField';
+import Input from '../common/Input';
+import Modal, { ModalButtons } from '../common/Modal';
+import Text from '../common/Text';
+import View from '../common/View';
function CreateLocalAccount({ modalProps, actions }) {
let navigate = useNavigate();
diff --git a/packages/desktop-client/src/components/modals/EditRule.js b/packages/desktop-client/src/components/modals/EditRule.js
index e2333b96b7..fba46b0c34 100644
--- a/packages/desktop-client/src/components/modals/EditRule.js
+++ b/packages/desktop-client/src/components/modals/EditRule.js
@@ -30,8 +30,14 @@ import AddIcon from '../../icons/v0/Add';
import SubtractIcon from '../../icons/v0/Subtract';
import InformationOutline from '../../icons/v1/InformationOutline';
import { colors } from '../../style';
-import { View, Text, Modal, Button, Stack, Select, Tooltip } from '../common';
+import Button from '../common/Button';
+import Modal from '../common/Modal';
+import Select from '../common/Select';
+import Stack from '../common/Stack';
+import Text from '../common/Text';
+import View from '../common/View';
import { StatusBadge } from '../schedules/StatusBadge';
+import { Tooltip } from '../tooltips';
import SimpleTransactionsTable from '../transactions/SimpleTransactionsTable';
import { BetweenAmountInput } from '../util/AmountInput';
import DisplayId from '../util/DisplayId';
diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
index 910f487b33..7e3dc8f7a2 100644
--- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
+++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
@@ -10,17 +10,15 @@ import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import { colors } from '../../style';
import { Error, Warning } from '../alerts';
import Autocomplete from '../autocomplete/Autocomplete';
-import {
- View,
- Modal,
- Button,
- LinkButton,
- Menu,
- Tooltip,
- ExternalLink,
-} from '../common';
+import { ExternalLink } from '../common';
+import Button from '../common/Button';
+import LinkButton from '../common/LinkButton';
+import Menu from '../common/Menu';
+import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
+import View from '../common/View';
import { FormField, FormLabel } from '../forms';
+import { Tooltip } from '../tooltips';
import { COUNTRY_OPTIONS } from './countries';
diff --git a/packages/desktop-client/src/components/payees/index.js b/packages/desktop-client/src/components/payees/index.js
index 4b31e81e54..7e4cac4cfb 100644
--- a/packages/desktop-client/src/components/payees/index.js
+++ b/packages/desktop-client/src/components/payees/index.js
@@ -25,7 +25,11 @@ import ExpandArrow from '../../icons/v0/ExpandArrow';
import Merge from '../../icons/v0/Merge';
import ArrowThinRight from '../../icons/v1/ArrowThinRight';
import { colors } from '../../style';
-import { View, Text, Input, Button, Tooltip, Menu } from '../common';
+import Button from '../common/Button';
+import Input from '../common/Input';
+import Menu from '../common/Menu';
+import Text from '../common/Text';
+import View from '../common/View';
import {
Table,
TableHeader,
@@ -36,6 +40,7 @@ import {
CellButton,
useTableNavigator,
} from '../table';
+import { Tooltip } from '../tooltips';
let getPayeesById = memoizeOne(payees => groupById(payees));
diff --git a/packages/desktop-client/src/components/reports/CashFlow.js b/packages/desktop-client/src/components/reports/CashFlow.js
index afd58c3083..b2ed9fc035 100644
--- a/packages/desktop-client/src/components/reports/CashFlow.js
+++ b/packages/desktop-client/src/components/reports/CashFlow.js
@@ -8,8 +8,11 @@ import { integerToCurrency } from 'loot-core/src/shared/util';
import useFilters from '../../hooks/useFilters';
import { colors, styles } from '../../style';
-import { View, Text, Block, AlignedText } from '../common';
+import AlignedText from '../common/AlignedText';
+import Block from '../common/Block';
import Paragraph from '../common/Paragraph';
+import Text from '../common/Text';
+import View from '../common/View';
import Change from './Change';
import { cashFlowByDate } from './graphs/cash-flow-spreadsheet';
diff --git a/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.tsx b/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.tsx
index c42734ed73..34502fb48a 100644
--- a/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.tsx
@@ -7,7 +7,7 @@ import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency, integerToAmount } from 'loot-core/src/shared/util';
-import { AlignedText } from '../../common';
+import AlignedText from '../../common/AlignedText';
import { runAll, indexCashFlow } from '../util';
export function simpleCashFlow(start, end) {
diff --git a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.tsx b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.tsx
index dc61bdc317..997dffc4fb 100644
--- a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.tsx
@@ -11,7 +11,7 @@ import {
amountToInteger,
} from 'loot-core/src/shared/util';
-import { AlignedText } from '../../common';
+import AlignedText from '../../common/AlignedText';
import { index } from '../util';
export default function createSpreadsheet(
diff --git a/packages/desktop-client/src/components/schedules/LinkSchedule.js b/packages/desktop-client/src/components/schedules/LinkSchedule.js
index 0ab090f6cd..b336967555 100644
--- a/packages/desktop-client/src/components/schedules/LinkSchedule.js
+++ b/packages/desktop-client/src/components/schedules/LinkSchedule.js
@@ -4,7 +4,9 @@ import { useLocation, useNavigate } from 'react-router-dom';
import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { send } from 'loot-core/src/platform/client/fetch';
-import { Search, Text, View } from '../common';
+import Search from '../common/Search';
+import Text from '../common/Text';
+import View from '../common/View';
import { Page } from '../Page';
import { SchedulesTable } from './SchedulesTable';
diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.js b/packages/desktop-client/src/components/schedules/SchedulesTable.js
index 1852588477..4e7a541001 100644
--- a/packages/desktop-client/src/components/schedules/SchedulesTable.js
+++ b/packages/desktop-client/src/components/schedules/SchedulesTable.js
@@ -10,8 +10,12 @@ import { integerToCurrency } from 'loot-core/src/shared/util';
import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import Check from '../../icons/v2/Check';
import { colors } from '../../style';
-import { View, Text, Button, Tooltip, Menu } from '../common';
+import Button from '../common/Button';
+import Menu from '../common/Menu';
+import Text from '../common/Text';
+import View from '../common/View';
import { Table, TableHeader, Row, Field, Cell } from '../table';
+import { Tooltip } from '../tooltips';
import DisplayId from '../util/DisplayId';
import { StatusBadge } from './StatusBadge';
diff --git a/packages/desktop-client/src/components/schedules/index.js b/packages/desktop-client/src/components/schedules/index.js
index e8f04581f9..45d2d5887e 100644
--- a/packages/desktop-client/src/components/schedules/index.js
+++ b/packages/desktop-client/src/components/schedules/index.js
@@ -4,7 +4,9 @@ import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { send } from 'loot-core/src/platform/client/fetch';
import { usePushModal } from '../../util/router-tools';
-import { View, Button, Search } from '../common';
+import Button from '../common/Button';
+import Search from '../common/Search';
+import View from '../common/View';
import { Page } from '../Page';
import { SchedulesTable, ROW_HEIGHT } from './SchedulesTable';
diff --git a/packages/desktop-client/src/components/select/DateSelect.js b/packages/desktop-client/src/components/select/DateSelect.js
index 2cd6ef0d6a..6b0048edb4 100644
--- a/packages/desktop-client/src/components/select/DateSelect.js
+++ b/packages/desktop-client/src/components/select/DateSelect.js
@@ -23,7 +23,9 @@ import {
import { stringToInteger } from 'loot-core/src/shared/util';
import { colors } from '../../style';
-import { View, Input, Tooltip } from '../common';
+import Input from '../common/Input';
+import View from '../common/View';
+import { Tooltip } from '../tooltips';
import DateSelectLeft from './DateSelect.left.png';
import DateSelectRight from './DateSelect.right.png';
diff --git a/packages/desktop-client/src/components/select/RecurringSchedulePicker.js b/packages/desktop-client/src/components/select/RecurringSchedulePicker.js
index 89dc7439e7..89e9ea370a 100644
--- a/packages/desktop-client/src/components/select/RecurringSchedulePicker.js
+++ b/packages/desktop-client/src/components/select/RecurringSchedulePicker.js
@@ -8,8 +8,13 @@ import { getRecurringDescription } from 'loot-core/src/shared/schedules';
import AddIcon from '../../icons/v0/Add';
import SubtractIcon from '../../icons/v0/Subtract';
import { colors } from '../../style';
-import { Button, Select, Input, Tooltip, View, Text, Stack } from '../common';
-import { useTooltip } from '../tooltips';
+import Button from '../common/Button';
+import Input from '../common/Input';
+import Select from '../common/Select';
+import Stack from '../common/Stack';
+import Text from '../common/Text';
+import View from '../common/View';
+import { useTooltip, Tooltip } from '../tooltips';
import DateSelect from './DateSelect';
diff --git a/packages/desktop-client/src/components/sidebar.js b/packages/desktop-client/src/components/sidebar.js
index 51d5f501f6..50027dccec 100644
--- a/packages/desktop-client/src/components/sidebar.js
+++ b/packages/desktop-client/src/components/sidebar.js
@@ -18,7 +18,11 @@ import ArrowButtonLeft1 from '../icons/v2/ArrowButtonLeft1';
import CalendarIcon from '../icons/v2/Calendar';
import { styles, colors } from '../style';
-import { View, Block, AlignedText, AnchorLink, Button } from './common';
+import AlignedText from './common/AlignedText';
+import AnchorLink from './common/AnchorLink';
+import Block from './common/Block';
+import Button from './common/Button';
+import View from './common/View';
import { useSidebar } from './FloatableSidebar';
import { useDraggable, useDroppable, DropHighlight } from './sort';
import CellValue from './spreadsheet/CellValue';
diff --git a/packages/desktop-client/src/components/table.tsx b/packages/desktop-client/src/components/table.tsx
index d505a2299f..f24f1b6ca0 100644
--- a/packages/desktop-client/src/components/table.tsx
+++ b/packages/desktop-client/src/components/table.tsx
@@ -30,15 +30,11 @@ import ExpandArrow from '../icons/v0/ExpandArrow';
import Checkmark from '../icons/v1/Checkmark';
import { styles, colors } from '../style';
-import {
- View,
- Text,
- Button,
- Input,
- Tooltip,
- IntersectionBoundary,
- Menu,
-} from './common';
+import Button from './common/Button';
+import Input from './common/Input';
+import Menu from './common/Menu';
+import Text from './common/Text';
+import View from './common/View';
import FixedSizeList from './FixedSizeList';
import { KeyHandlers } from './KeyHandlers';
import {
@@ -49,6 +45,7 @@ import {
import { type Binding } from './spreadsheet';
import format from './spreadsheet/format';
import useSheetValue from './spreadsheet/useSheetValue';
+import { Tooltip, IntersectionBoundary } from './tooltips';
export const ROW_HEIGHT = 32;
const TABLE_BACKGROUND_COLOR = colors.n11;
diff --git a/packages/desktop-client/src/components/tooltips.js b/packages/desktop-client/src/components/tooltips.js
index b94e6e581c..83488b45cc 100644
--- a/packages/desktop-client/src/components/tooltips.js
+++ b/packages/desktop-client/src/components/tooltips.js
@@ -1,7 +1,7 @@
import React, { Component, createContext, createRef, useState } from 'react';
import ReactDOM from 'react-dom';
-import { css, before } from 'glamor';
+import { css } from 'glamor';
import { styles } from '../style';
@@ -338,82 +338,3 @@ export class Tooltip extends Component {
);
}
}
-
-export function Pointer({
- pointerDirection = 'up',
- pointerPosition = 'left',
- backgroundColor,
- borderColor = '#c0c0c0',
- border = true,
- color,
- style,
- innerStyle,
- pointerStyle,
- children,
-}) {
- return (
- <div {...css({ position: 'relative' }, style)}>
- <div
- {...css(
- {
- zIndex: 3000,
- backgroundColor: backgroundColor,
- color: color,
- padding: 10,
- boxShadow: '0 2px 6px rgba(0, 0, 0, .25)',
- border: border && '1px solid ' + borderColor,
- borderRadius: 2,
- },
- before({
- position: 'absolute',
- display: 'inline-block',
- backgroundColor,
- border: border && '1px solid ' + borderColor,
- borderLeft: 0,
- borderBottom: 0,
- width: 7,
- height: 7,
- boxShadow: '1px -1px 1px rgba(0, 0, 0, .05)',
- ...(pointerDirection === 'up'
- ? {
- transform: 'rotate(-45deg)',
- top: border ? -4 : -3,
- // eslint-disable-next-line rulesdir/typography
- content: '" "',
- ...(pointerPosition === 'center'
- ? { left: 'calc(50% - 3.5px)' }
- : pointerPosition === 'left'
- ? { left: 40 }
- : { right: 40 }),
- }
- : pointerDirection === 'down'
- ? {
- transform: 'rotate(135deg)',
- bottom: border ? -4 : -3,
- // eslint-disable-next-line rulesdir/typography
- content: '" "',
- ...(pointerPosition === 'center'
- ? { left: 'calc(50% - 3.5px)' }
- : pointerPosition === 'left'
- ? { left: 40 }
- : { right: 40 }),
- }
- : pointerDirection === 'right'
- ? {
- transform: 'rotate(45deg)',
- // eslint-disable-next-line rulesdir/typography
- content: '" "',
- top: 'calc(50% - 3.5px)',
- right: -3,
- }
- : {}),
- ...pointerStyle,
- }),
- innerStyle,
- )}
- >
- {children}
- </div>
- </div>
- );
-}
diff --git a/packages/desktop-client/src/components/transactions/MobileTransaction.js b/packages/desktop-client/src/components/transactions/MobileTransaction.js
index 032870e190..bc7896786b 100644
--- a/packages/desktop-client/src/components/transactions/MobileTransaction.js
+++ b/packages/desktop-client/src/components/transactions/MobileTransaction.js
@@ -25,7 +25,9 @@ import {
import ArrowsSynchronize from '../../icons/v2/ArrowsSynchronize';
import CheckCircle1 from '../../icons/v2/CheckCircle1';
import { styles, colors } from '../../style';
-import { Text, TextOneLine, View } from '../common';
+import Text from '../common/Text';
+import TextOneLine from '../common/TextOneLine';
+import View from '../common/View';
const zIndices = { SECTION_HEADING: 10 };
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.js b/packages/desktop-client/src/components/transactions/TransactionsTable.js
index 23e84f06e3..7c901b5c23 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.js
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.js
@@ -57,7 +57,9 @@ import { styles, colors } from '../../style';
import AccountAutocomplete from '../autocomplete/AccountAutocomplete';
import CategoryAutocomplete from '../autocomplete/CategorySelect';
import PayeeAutocomplete from '../autocomplete/PayeeAutocomplete';
-import { View, Text, Tooltip, Button } from '../common';
+import Button from '../common/Button';
+import Text from '../common/Text';
+import View from '../common/View';
import { getStatusProps } from '../schedules/StatusBadge';
import DateSelect from '../select/DateSelect';
import {
@@ -73,6 +75,7 @@ import {
Table,
UnexposedCellContent,
} from '../table';
+import { Tooltip } from '../tooltips';
function getDisplayValue(obj, name) {
return obj ? obj[name] : '';
diff --git a/packages/desktop-client/src/components/util/AmountInput.js b/packages/desktop-client/src/components/util/AmountInput.js
index 74ea84acbb..5371392dbc 100644
--- a/packages/desktop-client/src/components/util/AmountInput.js
+++ b/packages/desktop-client/src/components/util/AmountInput.js
@@ -7,7 +7,9 @@ import {
import Add from '../../icons/v1/Add';
import Subtract from '../../icons/v1/Subtract';
-import { View, Button, InputWithContent } from '../common';
+import Button from '../common/Button';
+import InputWithContent from '../common/InputWithContent';
+import View from '../common/View';
export function AmountInput({ id, defaultValue = 0, onChange, style }) {
let [negative, setNegative] = useState(defaultValue <= 0);
diff --git a/upcoming-release-notes/1418.md b/upcoming-release-notes/1418.md
new file mode 100644
index 0000000000..ddccbde45a
--- /dev/null
+++ b/upcoming-release-notes/1418.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+Moving away from barell `common` imports to more specific per-component imports (part 1)