From 94f6265dfc074969f2f141a19f2fc33a6ab96af1 Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:30:25 +0100 Subject: [PATCH] fix(ui,icons,ui-preset): Fix CodeBlock and Command components (#10369) --- .changeset/strange-trainers-watch.md | 6 + .../src/components/__tests__/amazon.spec.tsx | 17 + .../__tests__/arrow-right-down.spec.tsx | 17 + .../__tests__/bell-alert-done.spec.tsx | 23 +- .../__tests__/broom-sparkle.spec.tsx | 17 + .../src/components/__tests__/button.spec.tsx | 17 + .../caret-maximize-diagonal.spec.tsx | 17 + .../caret-minimize-diagonal.spec.tsx | 17 + .../__tests__/circle-sliders.spec.tsx | 17 + .../__tests__/clone-dashed.spec.tsx | 17 + .../__tests__/decision-process.spec.tsx | 17 + .../components/__tests__/directions.spec.tsx | 17 + .../__tests__/featured-badge.spec.tsx | 17 + .../components/__tests__/hand-truck.spec.tsx | 17 + .../__tests__/heart-broken.spec.tsx | 17 + .../src/components/__tests__/house.spec.tsx | 17 + .../src/components/__tests__/levels.spec.tsx | 17 + .../components/__tests__/media-play.spec.tsx | 17 + .../components/__tests__/scroll-text.spec.tsx | 17 + .../components/__tests__/sendgrid.spec.tsx | 17 + .../src/components/__tests__/shipbob.spec.tsx | 17 + .../src/components/__tests__/target.spec.tsx | 17 + .../__tests__/tax-exclusive.spec.tsx | 17 + .../__tests__/tax-inclusive.spec.tsx | 17 + .../__tests__/text-highlight.spec.tsx | 17 + .../components/__tests__/webshipper.spec.tsx | 17 + .../icons/src/components/amazon.tsx | 23 ++ .../icons/src/components/arrow-right-down.tsx | 33 ++ .../icons/src/components/bars-three.tsx | 26 +- .../icons/src/components/bell-alert-done.tsx | 25 +- .../icons/src/components/broom-sparkle.tsx | 29 ++ .../icons/src/components/button.tsx | 33 ++ .../components/caret-maximize-diagonal.tsx | 23 ++ .../components/caret-minimize-diagonal.tsx | 23 ++ .../icons/src/components/circle-sliders.tsx | 26 ++ .../icons/src/components/clone-dashed.tsx | 26 ++ .../icons/src/components/decision-process.tsx | 26 ++ .../icons/src/components/directions.tsx | 26 ++ .../icons/src/components/ellipse-solid.tsx | 5 +- .../icons/src/components/featured-badge.tsx | 111 ++++++ .../icons/src/components/hand-truck.tsx | 56 +-- .../icons/src/components/heart-broken.tsx | 36 +- .../icons/src/components/house.tsx | 26 ++ .../icons/src/components/index.ts | 188 +++++----- .../icons/src/components/levels.tsx | 26 ++ .../icons/src/components/media-play.tsx | 26 ++ .../icons/src/components/scroll-text.tsx | 33 ++ .../icons/src/components/sendgrid.tsx | 23 ++ .../icons/src/components/shipbob.tsx | 23 ++ .../icons/src/components/target.tsx | 40 +++ .../icons/src/components/tax-exclusive.tsx | 29 ++ .../icons/src/components/tax-inclusive.tsx | 29 ++ .../icons/src/components/text-highlight.tsx | 33 ++ .../icons/src/components/webshipper.tsx | 23 ++ .../toolbox/src/commands/tokens/command.ts | 2 +- .../ui-preset/src/theme/extension/theme.ts | 66 ++-- .../ui-preset/src/theme/tokens/colors.ts | 6 +- .../ui-preset/src/theme/tokens/effects.ts | 4 +- .../ui-preset/src/theme/tokens/typography.ts | 132 +++---- .../code-block/code-block.stories.tsx | 95 +++-- .../src/components/code-block/code-block.tsx | 338 +++++++++++------- .../components/command/command.stories.tsx | 21 +- .../ui/src/components/command/command.tsx | 6 +- .../ui/src/components/copy/copy.tsx | 5 +- 64 files changed, 1659 insertions(+), 479 deletions(-) create mode 100644 .changeset/strange-trainers-watch.md create mode 100644 packages/design-system/icons/src/components/__tests__/amazon.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/arrow-right-down.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/broom-sparkle.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/button.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/caret-maximize-diagonal.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/caret-minimize-diagonal.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/circle-sliders.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/clone-dashed.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/decision-process.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/directions.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/featured-badge.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/hand-truck.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/heart-broken.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/house.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/levels.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/media-play.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/scroll-text.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/sendgrid.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/shipbob.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/target.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/tax-exclusive.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/tax-inclusive.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/text-highlight.spec.tsx create mode 100644 packages/design-system/icons/src/components/__tests__/webshipper.spec.tsx create mode 100644 packages/design-system/icons/src/components/amazon.tsx create mode 100644 packages/design-system/icons/src/components/arrow-right-down.tsx create mode 100644 packages/design-system/icons/src/components/broom-sparkle.tsx create mode 100644 packages/design-system/icons/src/components/button.tsx create mode 100644 packages/design-system/icons/src/components/caret-maximize-diagonal.tsx create mode 100644 packages/design-system/icons/src/components/caret-minimize-diagonal.tsx create mode 100644 packages/design-system/icons/src/components/circle-sliders.tsx create mode 100644 packages/design-system/icons/src/components/clone-dashed.tsx create mode 100644 packages/design-system/icons/src/components/decision-process.tsx create mode 100644 packages/design-system/icons/src/components/directions.tsx create mode 100644 packages/design-system/icons/src/components/featured-badge.tsx create mode 100644 packages/design-system/icons/src/components/house.tsx create mode 100644 packages/design-system/icons/src/components/levels.tsx create mode 100644 packages/design-system/icons/src/components/media-play.tsx create mode 100644 packages/design-system/icons/src/components/scroll-text.tsx create mode 100644 packages/design-system/icons/src/components/sendgrid.tsx create mode 100644 packages/design-system/icons/src/components/shipbob.tsx create mode 100644 packages/design-system/icons/src/components/target.tsx create mode 100644 packages/design-system/icons/src/components/tax-exclusive.tsx create mode 100644 packages/design-system/icons/src/components/tax-inclusive.tsx create mode 100644 packages/design-system/icons/src/components/text-highlight.tsx create mode 100644 packages/design-system/icons/src/components/webshipper.tsx diff --git a/.changeset/strange-trainers-watch.md b/.changeset/strange-trainers-watch.md new file mode 100644 index 0000000000000..25605aacd4cca --- /dev/null +++ b/.changeset/strange-trainers-watch.md @@ -0,0 +1,6 @@ +--- +"@medusajs/ui-preset": patch +"@medusajs/icons": patch +--- + +feat(ui,icons,ui-preset): Sync with latest changes from Figma, and fix Code components diff --git a/packages/design-system/icons/src/components/__tests__/amazon.spec.tsx b/packages/design-system/icons/src/components/__tests__/amazon.spec.tsx new file mode 100644 index 0000000000000..4e79ec2c8c805 --- /dev/null +++ b/packages/design-system/icons/src/components/__tests__/amazon.spec.tsx @@ -0,0 +1,17 @@ + import * as React from "react" + import { cleanup, render, screen } from "@testing-library/react" + + import Amazon from "../amazon" + + describe("Amazon", () => { + it("should render the icon without errors", async () => { + render() + + + const svgElement = screen.getByTestId("icon") + + expect(svgElement).toBeInTheDocument() + + cleanup() + }) + }) \ No newline at end of file diff --git a/packages/design-system/icons/src/components/__tests__/arrow-right-down.spec.tsx b/packages/design-system/icons/src/components/__tests__/arrow-right-down.spec.tsx new file mode 100644 index 0000000000000..a62f3e6e7a124 --- /dev/null +++ b/packages/design-system/icons/src/components/__tests__/arrow-right-down.spec.tsx @@ -0,0 +1,17 @@ + import * as React from "react" + import { cleanup, render, screen } from "@testing-library/react" + + import ArrowRightDown from "../arrow-right-down" + + describe("ArrowRightDown", () => { + it("should render the icon without errors", async () => { + render() + + + const svgElement = screen.getByTestId("icon") + + expect(svgElement).toBeInTheDocument() + + cleanup() + }) + }) \ No newline at end of file diff --git a/packages/design-system/icons/src/components/__tests__/bell-alert-done.spec.tsx b/packages/design-system/icons/src/components/__tests__/bell-alert-done.spec.tsx index 290bf9f3d69c0..ef218b01282f3 100644 --- a/packages/design-system/icons/src/components/__tests__/bell-alert-done.spec.tsx +++ b/packages/design-system/icons/src/components/__tests__/bell-alert-done.spec.tsx @@ -1,16 +1,17 @@ -import * as React from "react" -import { cleanup, render, screen } from "@testing-library/react" + import * as React from "react" + import { cleanup, render, screen } from "@testing-library/react" -import BellAlertDone from "../bell-alert-done" + import BellAlertDone from "../bell-alert-done" -describe("BellAlertDone", () => { - it("should render the icon without errors", async () => { - render() + describe("BellAlertDone", () => { + it("should render the icon without errors", async () => { + render() - const svgElement = screen.getByTestId("icon") - expect(svgElement).toBeInTheDocument() + const svgElement = screen.getByTestId("icon") - cleanup() - }) -}) + expect(svgElement).toBeInTheDocument() + + cleanup() + }) + }) \ No newline at end of file diff --git a/packages/design-system/icons/src/components/__tests__/broom-sparkle.spec.tsx b/packages/design-system/icons/src/components/__tests__/broom-sparkle.spec.tsx new file mode 100644 index 0000000000000..ea01e96e8c19d --- /dev/null +++ b/packages/design-system/icons/src/components/__tests__/broom-sparkle.spec.tsx @@ -0,0 +1,17 @@ + import * as React from "react" + import { cleanup, render, screen } from "@testing-library/react" + + import BroomSparkle from "../broom-sparkle" + + describe("BroomSparkle", () => { + it("should render the icon without errors", async () => { + render() + + + const svgElement = screen.getByTestId("icon") + + expect(svgElement).toBeInTheDocument() + + cleanup() + }) + }) \ No newline at end of file diff --git a/packages/design-system/icons/src/components/__tests__/button.spec.tsx b/packages/design-system/icons/src/components/__tests__/button.spec.tsx new file mode 100644 index 0000000000000..b53fe0941a0ed --- /dev/null +++ b/packages/design-system/icons/src/components/__tests__/button.spec.tsx @@ -0,0 +1,17 @@ + import * as React from "react" + import { cleanup, render, screen } from "@testing-library/react" + + import Button from "../button" + + describe("Button", () => { + it("should render the icon without errors", async () => { + render(