Skip to content

Commit

Permalink
reorganize phosphor icons and use correct icons in MyTheme page
Browse files Browse the repository at this point in the history
  • Loading branch information
veej committed Aug 25, 2023
1 parent aabf8bb commit d930079
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion packages/configuration-builder/src/ColorEditor/Palette.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box } from "@buildo/bento-design-system";
import { LightnessInterpolation } from "./ColorEditor";
import { useState } from "react";
import { IconEyedropper } from "../Icons/IconEyedropper";
import { IconEyedropper } from "../PhosphorIcons";
import { HSLToHex, HexColor } from "../utils/colorUtils";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Feedback, Inline, Stack } from "@buildo/bento-design-system";
import { useTranslation } from "react-i18next";
import { IconConfetti } from "../Icons/IconConfetti";
import { IconConfetti } from "../PhosphorIcons";
import { useNavigate } from "react-router-dom";

export function SectionCompleted() {
Expand Down
4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/FigmaLogo.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/IconCaretRight.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/IconCheckCircle.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/IconConfetti.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/IconEyedropper.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/IconSwatches.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/configuration-builder/src/Icons/ReactLogo.ts

This file was deleted.

26 changes: 17 additions & 9 deletions packages/configuration-builder/src/MyTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
} from "@buildo/bento-design-system";
import { useTranslation } from "react-i18next";
import { SectionCard } from "./SectionCard/SectionCard";
import { IconSwatches } from "./Icons/IconSwatches";
import { useConfiguratorStatusContext } from "./ConfiguratorStatusContext";
import { useNavigate } from "react-router-dom";
import foundationsImg from "./assets/Foundations.png";
Expand All @@ -22,8 +21,17 @@ import exportImg from "./assets/Export.png";
import image1 from "./assets/1.svg";
import image2 from "./assets/2.svg";
import image3 from "./assets/3.svg";
import { IconFigmaLogo } from "./Icons/FigmaLogo";
import { IconAtom } from "./Icons/ReactLogo";
import {
IconFigmaLogo,
IconAtom,
IconTextAa,
IconSubtract,
IconCards,
IconLayout,
IconDiamond,
IconDiamondsFour,
IconSwatches,
} from "./PhosphorIcons";

const numberImages = [image1, image2, image3];

Expand Down Expand Up @@ -107,19 +115,19 @@ export function MyTheme() {
<SectionCard
name={t("Theme.Foundations.Typography.title")}
description={t("Theme.Foundations.Typography.description")}
icon={IconSwatches}
icon={IconTextAa}
disabled
/>
<SectionCard
name={t("Theme.Foundations.Elevations.title")}
description={t("Theme.Foundations.Elevations.description")}
icon={IconSwatches}
icon={IconSubtract}
disabled
/>
<SectionCard
name={t("Theme.Foundations.Tokens.title")}
description={t("Theme.Foundations.Tokens.description")}
icon={IconSwatches}
icon={IconCards}
disabled
/>
</Stack>
Expand All @@ -135,19 +143,19 @@ export function MyTheme() {
<SectionCard
name={t("Theme.Configuration.General.title")}
description={t("Theme.Configuration.General.description")}
icon={IconSwatches}
icon={IconLayout}
disabled
/>
<SectionCard
name={t("Theme.Configuration.Components.title")}
description={t("Theme.Configuration.Components.description")}
icon={IconSwatches}
icon={IconDiamond}
disabled
/>
<SectionCard
name={t("Theme.Configuration.Patterns.title")}
description={t("Theme.Configuration.Patterns.description")}
icon={IconSwatches}
icon={IconDiamondsFour}
disabled
/>
</Stack>
Expand Down
38 changes: 38 additions & 0 deletions packages/configuration-builder/src/PhosphorIcons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { IconProps, svgIconProps } from "@buildo/bento-design-system";
import {
Atom,
Cards,
FigmaLogo,
Subtract,
type Icon as PhosphorIcon,
TextAa,
CaretRight,
CheckCircle,
Confetti,
Diamond,
DiamondsFour,
Layout,
Eyedropper,
Swatches,
} from "@phosphor-icons/react";

function phosphorToBento(Icon: PhosphorIcon) {
return (props: IconProps) => {
const { viewBox, ...svgProps } = svgIconProps(props);
return <Icon width={undefined} height={undefined} {...svgProps} />;
};
}

export const IconFigmaLogo = phosphorToBento(FigmaLogo);
export const IconAtom = phosphorToBento(Atom);
export const IconCards = phosphorToBento(Cards);
export const IconCaretRight = phosphorToBento(CaretRight);
export const IconCheckCircle = phosphorToBento(CheckCircle);
export const IconConfetti = phosphorToBento(Confetti);
export const IconDiamond = phosphorToBento(Diamond);
export const IconDiamondsFour = phosphorToBento(DiamondsFour);
export const IconEyedropper = phosphorToBento(Eyedropper);
export const IconLayout = phosphorToBento(Layout);
export const IconSubtract = phosphorToBento(Subtract);
export const IconSwatches = phosphorToBento(Swatches);
export const IconTextAa = phosphorToBento(TextAa);
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import {
Stack,
Title,
} from "@buildo/bento-design-system";
import { IconCaretRight } from "../Icons/IconCaretRight";
import { IconCaretRight, IconCheckCircle } from "../PhosphorIcons";
import { match } from "ts-pattern";
import { IconCheckCircle } from "../Icons/IconCheckCircle";
import { useTranslation } from "react-i18next";

type Props = {
Expand Down

This file was deleted.

0 comments on commit d930079

Please sign in to comment.