Skip to content

Commit be15d98

Browse files
panteleymonchukevavirsedamarc2332brancoder
authored
refactor(ui-kit): remove cycle dependencies (#6841)
## Links to any relevant issues Closes #6520 ## Type of change Choose a type of change, and delete any options that are not relevant. - Bug fix (a non-breaking change which fixes an issue) - Enhancement (a non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Documentation Fix ## How the change has been tested Describe the tests that you ran to verify your changes. Make sure to provide instructions for the maintainer as well as any relevant configurations. - [ ] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) ### Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure) - [ ] Synchronization of the indexer from genesis for a network including migration objects. - [ ] Restart of indexer synchronization locally without resetting the database. - [ ] Restart of indexer synchronization on a production-like database. - [ ] Deployment of services using Docker. - [ ] Verification of API backward compatibility. ## Change checklist Tick the boxes that are relevant to your changes, and delete any items that are not. - [ ] I have followed the contribution guidelines for this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes ### Release Notes <!-- Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. --> - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: evavirseda <[email protected]> Co-authored-by: Marc Espin <[email protected]> Co-authored-by: Bran <[email protected]>
1 parent 4b3e602 commit be15d98

File tree

24 files changed

+39
-31
lines changed

24 files changed

+39
-31
lines changed

.changeset/spotty-chicken-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iota/apps-ui-kit': patch
3+
---
4+
5+
Update imports to avoid cycle dependencies

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ module.exports = {
9999
'@typescript-eslint/consistent-type-imports': ['error'],
100100
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
101101
'@typescript-eslint/no-explicit-any': 'off',
102+
'import/no-cycle': ['error'],
102103
},
103104
},
104105
{

apps/ui-kit/src/lib/components/atoms/list-item/ListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { PropsWithChildren } from 'react';
55
import cx from 'classnames';
66
import { ArrowRight } from '@iota/apps-ui-icons';
7-
import { Button, ButtonSize, ButtonType } from '@/components';
7+
import { Button, ButtonSize, ButtonType } from '../button';
88

99
export interface ListItemProps {
1010
/**

apps/ui-kit/src/lib/components/atoms/snackbar/Snackbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
55
import cx from 'classnames';
66
import { Close } from '@iota/apps-ui-icons';
77
import { SnackbarType } from './snackbar.enums';
8-
import { BACKGROUND_COLOR, TEXT_COLOR } from '@/components/atoms/snackbar/snackbar.classes';
8+
import { BACKGROUND_COLOR, TEXT_COLOR } from './snackbar.classes';
99

1010
type Renderable = JSX.Element | string | null;
1111
export interface SnackbarProps {

apps/ui-kit/src/lib/components/molecules/account/Account.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import cx from 'classnames';
5-
import { ButtonUnstyled } from '../../atoms/button';
6-
import type { BadgeType } from '../../atoms';
7-
import { Badge } from '../../atoms';
5+
6+
import type { BadgeType } from '@/components/atoms';
7+
import { Badge, ButtonUnstyled } from '@/components/atoms';
88
import {
99
LockLocked,
1010
LockUnlocked,

apps/ui-kit/src/lib/components/molecules/address/Address.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import cx from 'classnames';
55
import { Copy, ArrowTopRight } from '@iota/apps-ui-icons';
6-
import { ButtonUnstyled } from '../../atoms/button';
6+
import { ButtonUnstyled } from '@/components/atoms/button';
77

88
interface AddressProps {
99
/**

apps/ui-kit/src/lib/components/molecules/card/CardAction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { ArrowRight } from '@iota/apps-ui-icons';
55
import { CardActionType } from './card.enums';
6-
import { Button, ButtonSize, ButtonType } from '../../atoms/button';
6+
import { Button, ButtonSize, ButtonType } from '@/components/atoms/button';
77

88
export type CardActionProps = {
99
title?: string;

apps/ui-kit/src/lib/components/molecules/card/CardBody.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import cx from 'classnames';
44
import type { ReactNode } from 'react';
5-
import { Tooltip } from '../../atoms';
6-
import type { TooltipPosition } from '../../atoms';
5+
import { Tooltip } from '@/components/atoms/tooltip';
6+
import type { TooltipPosition } from '@/components/atoms/tooltip';
77

88
export type CardBodyProps = {
99
title: string;

apps/ui-kit/src/lib/components/molecules/chip/Chip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TEXT_COLOR,
1212
FOCUS_CLASSES,
1313
} from './chip.classes';
14-
import { ButtonUnstyled } from '../../atoms/button';
14+
import { ButtonUnstyled } from '@/components/atoms/button';
1515
import { Close } from '@iota/apps-ui-icons';
1616

1717
interface ChipProps {

apps/ui-kit/src/lib/components/molecules/display-stats/DisplayStats.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import type { ReactNode } from 'react';
5-
import type { TooltipPosition } from '../../atoms';
6-
import { Tooltip } from '../../atoms';
5+
import type { TooltipPosition } from '@/components/atoms';
6+
import { Tooltip } from '@/components/atoms';
77
import { Info } from '@iota/apps-ui-icons';
88
import { DisplayStatsType, DisplayStatsSize } from './displayStats.enums';
99
import cx from 'classnames';

apps/ui-kit/src/lib/components/molecules/input/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
INPUT_PLACEHOLDER_CLASSES,
1414
} from './input.classes';
1515
import { InputType } from './input.enums';
16-
import { SecondaryText } from '../../atoms/secondary-text';
16+
import { SecondaryText } from '@/components/atoms/secondary-text';
1717
import { Close, VisibilityOff, VisibilityOn } from '@iota/apps-ui-icons';
18-
import { ButtonUnstyled } from '../../atoms/button';
18+
import { ButtonUnstyled } from '@/components/atoms/button';
1919
import type { InputPropsByType, NumericFormatInputProps } from './input.types';
2020
import { NumericFormat } from 'react-number-format';
2121

apps/ui-kit/src/lib/components/molecules/input/InputWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import cx from 'classnames';
5-
import { SecondaryText } from '../../atoms/secondary-text';
5+
import { SecondaryText } from '@/components/atoms/secondary-text';
66
import { LABEL_CLASSES } from './input.classes';
77
import { createElement } from 'react';
88

apps/ui-kit/src/lib/components/molecules/input/TextArea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
INPUT_PLACEHOLDER_CLASSES,
1212
} from './input.classes';
1313
import cx from 'classnames';
14-
import { ButtonUnstyled } from '../../atoms/button';
14+
import { ButtonUnstyled } from '@/components/atoms/button';
1515
import { VisibilityOff, VisibilityOn } from '@iota/apps-ui-icons';
1616

1717
type TextAreaProps = Omit<

apps/ui-kit/src/lib/components/molecules/navbar-item/NavbarItemHorizontal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
UNSELECTED_ICON,
1414
UNSELECTED_TEXT,
1515
} from './navbarItem.classes';
16-
import { Badge, BadgeType } from '../../atoms';
16+
import { Badge, BadgeType } from '@/components/atoms';
1717
import type { NavbarItemProps } from './NavbarItem';
1818

1919
export function NavbarItemHorizontal({

apps/ui-kit/src/lib/components/molecules/navbar-item/NavbarItemVertical.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
UNSELECTED_ICON,
1010
UNSELECTED_TEXT,
1111
} from './navbarItem.classes';
12-
import { Badge, BadgeType } from '../../atoms';
12+
import { Badge, BadgeType } from '@/components/atoms';
1313
import type { NavbarItemProps } from './NavbarItem';
1414

1515
export function NavbarItemVertical({

apps/ui-kit/src/lib/components/molecules/search/Search.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import { useEffect, useRef, useState } from 'react';
55
import cx from 'classnames';
66
import { Loader, Search as SearchIcon } from '@iota/apps-ui-icons';
7-
import { Divider, SearchBarType } from '@/components';
7+
import { Divider } from '@/components/atoms';
8+
import { SearchBarType } from './search.enums';
89
import {
910
BACKGROUND_COLORS,
1011
SUGGESTIONS_WRAPPER_STYLE,

apps/ui-kit/src/lib/components/molecules/segmented-button/SegmentedButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { PropsWithChildren } from 'react';
55
import { BACKGROUND_COLORS, OUTLINED_BORDER } from './segmentedButton.classes';
66
import cx from 'classnames';
77
import { SegmentedButtonType } from './segmentedButton.enums';
8-
import { ButtonSegmentType } from '../../atoms';
8+
import { ButtonSegmentType } from '@/components/atoms';
99

1010
interface SegmentedButtonProps {
1111
/**

apps/ui-kit/src/lib/components/molecules/select/Select.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { TriangleDown } from '@iota/apps-ui-icons';
55
import cx from 'classnames';
66
import { forwardRef, useEffect, useState } from 'react';
77
import { Dropdown } from '../dropdown/Dropdown';
8-
import { SecondaryText } from '../../atoms/secondary-text';
8+
import { SecondaryText } from '@/components/atoms/secondary-text';
99
import { InputWrapper, LabelHtmlTag } from '../input/InputWrapper';
10-
import { ButtonUnstyled } from '../../atoms/button';
11-
import { ListItem } from '../../atoms';
10+
import { ListItem, ButtonUnstyled } from '@/components/atoms';
1211
import { DropdownPosition } from '../dropdown';
1312
import { SelectSize } from './select.enums';
1413

apps/ui-kit/src/lib/components/molecules/table-cell/TableCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import type { PropsWithChildren } from 'react';
44
import cx from 'classnames';
5-
import { Placeholder } from '../../atoms';
5+
import { Placeholder } from '@/components/atoms';
66

77
interface TableCellBaseProps {
88
/**

apps/ui-kit/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { SortByDown, SortByUp } from '@iota/apps-ui-icons';
55
import cx from 'classnames';
6-
import { Checkbox } from '@/lib';
6+
import { Checkbox } from '@/components/atoms/checkbox';
77
import { TableHeaderCellSortOrder } from './tableHeaderCell.enums';
88

99
export interface TableHeaderCellProps {

apps/ui-kit/src/lib/components/molecules/title/Title.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2024 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import type { TooltipPosition } from '../../atoms';
5-
import { Tooltip } from '../../atoms';
4+
import type { TooltipPosition } from '@/components/atoms';
5+
import { Tooltip } from '@/components/atoms';
66
import { Info } from '@iota/apps-ui-icons';
77
import { TitleSize } from './titleSize.enums';
88
import cx from 'classnames';

apps/ui-kit/src/lib/components/organisms/accordion/Accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { PropsWithChildren } from 'react';
55
import cx from 'classnames';
66
import { ArrowDown } from '@iota/apps-ui-icons';
7-
import { Button, ButtonType } from '@/lib';
7+
import { Button, ButtonType } from '@/components/atoms';
88
import { ICON_STYLE } from './accordion.classes';
99

1010
export interface AccordionHeaderProps {

apps/ui-kit/src/lib/components/organisms/navbar/NavbarSlideout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
import { ArrowBack } from '@iota/apps-ui-icons';
55
import cx from 'classnames';
6-
import { Button, ButtonType, NavbarItem, NavbarItemType } from '@/components';
6+
import { Button, ButtonType } from '@/components/atoms';
7+
import { NavbarItem, NavbarItemType } from '@/components/molecules';
78
import type { NavbarProps } from './Navbar';
89

910
export function NavbarSlideout({

apps/ui-kit/src/lib/components/organisms/table/Table.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
import type { PropsWithChildren, ReactNode } from 'react';
55
import cx from 'classnames';
66
import { TableProvider, useTableContext } from './TableContext';
7-
import type { ButtonProps } from '@/lib';
8-
import { Button, ButtonSize, ButtonType, Checkbox, TableCellBase, TableHeaderCell } from '@/lib';
7+
import type { ButtonProps } from '@/components/atoms';
8+
import { Button, ButtonSize, ButtonType, Checkbox } from '@/components/atoms';
9+
import { TableCellBase, TableHeaderCell } from '@/components/molecules';
910
import { ArrowLeft, DoubleArrowLeft, ArrowRight, DoubleArrowRight } from '@iota/apps-ui-icons';
1011

1112
export interface TablePaginationOptions {

0 commit comments

Comments
 (0)