Skip to content

Commit ad5d802

Browse files
committed
fix: icon names conflicting with component exports on main lib package
1 parent 131264a commit ad5d802

File tree

16 files changed

+56
-56
lines changed

16 files changed

+56
-56
lines changed

packages/components/_provisional/src/breadcrumbs/Breadcrumbs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useMemo } from "react";
22
import styles from "./styles/index.module.scss";
33
import classNames from "classnames";
4-
import { ChevronRight, Icon } from "@react-ck/icon";
4+
import { IconChevronRight, Icon } from "@react-ck/icon";
55
import { BreadcrumbItem } from "./BreadcrumbItem";
66

77
interface BreadcrumbsProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
@@ -14,7 +14,7 @@ const Breadcrumbs = ({
1414
...otherProps
1515
}: Readonly<BreadcrumbsProps>): React.ReactElement => {
1616
const computedItems = useMemo(
17-
() => items.flatMap((i, k) => (k === 0 ? i : [<Icon key="_" Icon={ChevronRight} />, i])),
17+
() => items.flatMap((i, k) => (k === 0 ? i : [<Icon key="_" Icon={IconChevronRight} />, i])),
1818
[items],
1919
);
2020

packages/components/alert/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from "classnames";
33
import styles from "./styles/index.module.scss";
44
import { Text } from "@react-ck/text";
55
import { Button } from "@react-ck/button";
6-
import { Close, Icon } from "@react-ck/icon";
6+
import { IconClose, Icon } from "@react-ck/icon";
77

88
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
99
/** Main title of the alert */
@@ -60,7 +60,7 @@ export const Alert = ({
6060

6161
{dismissable ? (
6262
<Button
63-
icon={<Icon Icon={Close} />}
63+
icon={<Icon Icon={IconClose} />}
6464
size="s"
6565
skin="ghost"
6666
onClick={() => {

packages/components/data-table/src/TableHead.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import classNames from "classnames";
33
import { type SortMode } from "./types";
4-
import { ChevronDown, ChevronUp, Icon } from "@react-ck/icon";
4+
import { IconChevronDown, IconChevronUp, Icon } from "@react-ck/icon";
55
import styles from "./styles/index.module.scss";
66

77
export interface TableHeadProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
@@ -22,8 +22,8 @@ export const TableHead = ({
2222
})}>
2323
{children}
2424

25-
{sorting === "asc" && <Icon Icon={ChevronUp} className={styles.sortable_header_icon} />}
25+
{sorting === "asc" && <Icon Icon={IconChevronUp} className={styles.sortable_header_icon} />}
2626

27-
{sorting === "desc" && <Icon Icon={ChevronDown} className={styles.sortable_header_icon} />}
27+
{sorting === "desc" && <Icon Icon={IconChevronDown} className={styles.sortable_header_icon} />}
2828
</th>
2929
);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from "react";
2-
import { Icon, BellFill } from "../src/index";
2+
import { Icon, IconBellFill } from "../src/index";
33
import renderer from "react-test-renderer";
44

55
describe("snapshot Icon", () => {
66
it("renders correctly", () => {
7-
const tree = renderer.create(<Icon Icon={BellFill} />).toJSON();
7+
const tree = renderer.create(<Icon Icon={IconBellFill} />).toJSON();
88
expect(tree).toMatchSnapshot();
99
});
1010
});

packages/components/icon/specs/index.unit.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react";
2-
import { Icon, BellFill } from "../src/index";
2+
import { Icon, IconBellFill } from "../src/index";
33
import { render, screen } from "@testing-library/react";
44
import "@testing-library/jest-dom";
55

66
describe("unit Icon", () => {
77
it("renders correctly", async () => {
8-
render(<Icon Icon={BellFill} data-testid="icon" />);
8+
render(<Icon Icon={IconBellFill} data-testid="icon" />);
99
const find = await screen.findByTestId("icon");
1010
expect(find).toBeInTheDocument();
1111
});

packages/components/icon/src/icons.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@ import {
1414
} from "react-icons/cg";
1515
import { FaRegCircleUser } from "react-icons/fa6";
1616

17-
export const Bell = BsBell;
17+
export const IconBell = BsBell;
1818

19-
export const BellFill = BsBellFill;
19+
export const IconBellFill = BsBellFill;
2020

21-
export const Close = GrClose;
21+
export const IconClose = GrClose;
2222

23-
export const Linkedin = SiLinkedin;
23+
export const IconLinkedin = SiLinkedin;
2424

25-
export const CodersRank = SiCodersrank;
25+
export const IconCodersRank = SiCodersrank;
2626

27-
export const Npm = SiNpm;
27+
export const IconNpm = SiNpm;
2828

29-
export const Codepen = SiCodepen;
29+
export const IconCodepen = SiCodepen;
3030

31-
export const GitHub = SiGithub;
31+
export const IconGitHub = SiGithub;
3232

33-
export const Spinner = CgSpinnerTwoAlt;
33+
export const IconSpinner = CgSpinnerTwoAlt;
3434

35-
export const ChevronLeft = CgChevronLeft;
35+
export const IconChevronLeft = CgChevronLeft;
3636

37-
export const ChevronRight = CgChevronRight;
37+
export const IconChevronRight = CgChevronRight;
3838

39-
export const ChevronUp = CgChevronUp;
39+
export const IconChevronUp = CgChevronUp;
4040

41-
export const ChevronDown = CgChevronDown;
41+
export const IconChevronDown = CgChevronDown;
4242

43-
export const Trash = CgTrash;
43+
export const IconTrash = CgTrash;
4444

45-
export const Home = CgHome;
45+
export const IconHome = CgHome;
4646

47-
export const Cog = TbSettings;
47+
export const IconCog = TbSettings;
4848

49-
export const Folder = TbFolder;
49+
export const IconFolder = TbFolder;
5050

51-
export const UserCircle = FaRegCircleUser;
51+
export const IconUserCircle = FaRegCircleUser;

packages/components/modal/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";
44
import { ModalContext, type ModalContextProps, type ModalContextValue } from "./context";
55
import { Card } from "@react-ck/card";
66
import { Overlay } from "@react-ck/overlay";
7-
import { Close, Icon } from "@react-ck/icon";
7+
import { IconClose, Icon } from "@react-ck/icon";
88
import { Button } from "@react-ck/button";
99
import { Text } from "@react-ck/text";
1010
import { Layer } from "@react-ck/layers";
@@ -113,7 +113,7 @@ const Modal = ({
113113
</Text>
114114

115115
{dismissable ? (
116-
<Button skin="ghost" icon={<Icon Icon={Close} />} onClick={handleClose} />
116+
<Button skin="ghost" icon={<Icon Icon={IconClose} />} onClick={handleClose} />
117117
) : null}
118118
</header>
119119
) : null}

packages/components/spinner/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import classNames from "classnames";
22
import styles from "./styles/index.module.scss";
33
import React from "react";
4-
import { Icon, type IconProps, Spinner as SpinnerIcon } from "@react-ck/icon";
4+
import { Icon, type IconProps, IconSpinner } from "@react-ck/icon";
55

66
export interface SpinnerProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
77
size?: IconProps["size"];
@@ -22,6 +22,6 @@ export const Spinner = ({
2222
...otherProps
2323
}: Readonly<SpinnerProps>): React.ReactElement => (
2424
<span {...otherProps} className={classNames(styles.root, styles[skin], className)}>
25-
<Icon Icon={SpinnerIcon} size={size} />
25+
<Icon Icon={IconSpinner} size={size} />
2626
</span>
2727
);

packages/docs/pages/src/icons.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ return (
2727
<IconGallery>
2828
{filteredIcons.map((icon) => (
2929
<IconItem key={icon} name={icon}>
30-
<Icon Icon={icons[icon]} />
30+
<Icon Icon={Iconicons[icon]} />
3131
</IconItem>
3232
))}
3333

packages/docs/stories/src/banner.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Text } from "@react-ck/text/src";
77
import { Button } from "@react-ck/button/src";
88
import { configureStory } from "@react-ck/story-config";
99
import { Banner } from "@react-ck/banner/src";
10-
import { Icon, Linkedin } from "@react-ck/icon";
10+
import { Icon, IconLinkedin } from "@react-ck/icon";
1111

1212
type Story = StoryObj<typeof Banner>;
1313

@@ -38,7 +38,7 @@ export const Component: Story = {
3838

3939
<Text>{faker.lorem.sentence()}</Text>
4040

41-
<Icon Icon={Linkedin} />
41+
<Icon Icon={IconLinkedin} />
4242
</>
4343
),
4444
actions: [

0 commit comments

Comments
 (0)