Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix padding on Tag in RTL #4434

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/orbit-components/src/Tag/Tag.ct-story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export function DefaultTestStory() {
<Tag selected onRemove={() => {}} onClick={() => {}}>
Selected Removable
</Tag>
<Tag onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Removable with icon
</Tag>
</div>
<h2>Colored</h2>
<div className="gap-sm flex flex-wrap">
Expand All @@ -47,6 +50,9 @@ export function DefaultTestStory() {
<Tag type="colored" selected onRemove={() => {}} onClick={() => {}}>
Selected Removable
</Tag>
<Tag type="colored" onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Removable with icon
</Tag>
</div>
<h2>dateTag</h2>
<div className="gap-sm flex flex-wrap">
Expand Down Expand Up @@ -76,6 +82,9 @@ export function DefaultTestStory() {
<Tag size="small" onRemove={() => {}}>
Small removable
</Tag>
<Tag size="small" onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Small removable with icon
</Tag>
</div>
</div>
);
Expand Down
11 changes: 11 additions & 0 deletions packages/orbit-components/src/Tag/Tag.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react";
import { test, expect } from "@playwright/experimental-ct-react";

import { TestTag, DefaultTestStory } from "./Tag.ct-story";
import RenderInRtl from "../utils/rtl/RenderInRtl";

const NON_INTERACTABLE_TAGS = [
{
Expand Down Expand Up @@ -87,4 +88,14 @@ test.describe("visual Tag", () => {
await expect(component).toHaveScreenshot();
});
});

test("screenshot rtl general", async ({ mount }) => {
const component = await mount(
<RenderInRtl>
<DefaultTestStory />
</RenderInRtl>,
);

await expect(component).toHaveScreenshot();
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const Tag = React.forwardRef<HTMLDivElement, Props>(
onKeyDown={ev => buttonClickEmulation(ev, onClick)}
>
{iconLeft && (
<div className="pr-xs [&_svg]:size-icon-small flex flex-row items-center justify-center">
<div className="pe-xs [&_svg]:size-icon-small flex flex-row items-center justify-center">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

{iconLeft}
</div>
)}
Expand Down
Loading