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

Pill large dismiss #4003

Merged
merged 5 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 6 additions & 0 deletions .changeset/small-turkeys-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/form-pill-group": patch
"@twilio-paste/core": patch
---

[Form Pill Group]: Fix position of dismiss button for large pill size
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const FormPillButton = React.forwardRef<HTMLElement, FormPillStylesProps>
fontWeight="fontWeightMedium"
outline="none"
paddingLeft="space30"
paddingRight={isDismissable ? "space80" : "space30"}
paddingRight={isDismissable ? (size === "large" ? "space90" : "space80") : "space30"}
transition="background-color 150ms ease-in, border-color 150ms ease-in, box-shadow 150ms ease-in, color 150ms ease-in"
{...computedStyles}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
selectedCloseColorStyles,
} from "./FormPill.styles";
import type { PillVariant } from "./types";
import { FormPillGroupContext } from "./useFormPillState";

interface PillCloseIconProps {
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
Expand All @@ -29,6 +30,8 @@ export const PillCloseIcon: React.FC<React.PropsWithChildren<PillCloseIconProps>
variant = "default",
pillIsHoverable = false,
}) => {
const { size } = React.useContext(FormPillGroupContext);

const baseStyles = selected ? selectedBaseCloseStyles[variant] : baseCloseStyles[variant];
let colorStyles = selected ? selectedCloseColorStyles[variant] : closeColorStyles[variant];

Expand All @@ -49,8 +52,8 @@ export const PillCloseIcon: React.FC<React.PropsWithChildren<PillCloseIconProps>
display="flex"
alignItems="center"
justifyContent="center"
height="sizeIcon40"
width="sizeIcon40"
height={size === "large" ? "sizeIcon50" : "sizeIcon40"}
width={size === "large" ? "sizeIcon50" : "sizeIcon40"}
Copy link
Contributor

@roxanagomez roxanagomez Jul 26, 2024

Choose a reason for hiding this comment

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

issue: PillCloseIcon for the large variant should be slightly bigger. Currently, both variants seem to be the same size.
Figma screenshot
Screenshot 2024-07-26 at 2 29 51 PM

Design sizes:

Default (PillCloseIcon): size-icon-10
Large (PillCloseIcon): size-icon-20

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Not sure why the sizes are different in the code :'( is that expected? or am I checking in the wrong place?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's on line 63 of this file 🤓 I'll bump it up to sizeIcon20

borderRadius="borderRadiusCircle"
borderWidth="borderWidth10"
borderStyle="solid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export const Large = (): JSX.Element => <Basic size="large" ariaLabel="Large pil
export const Disabled = (): JSX.Element => <Basic disabled ariaLabel="Disabled pills:" />;
export const Selected = (): JSX.Element => <Basic selected ariaLabel="Selected pills:" />;
export const Dismissable = (): JSX.Element => <Basic dismissable ariaLabel="Dismissable pills:" />;
export const LargeAndDismissable = (): JSX.Element => (
<Basic size="large" dismissable ariaLabel="Large and dismissable pills:" />
);

export const OverflowWrapping = (): JSX.Element => (
<Box maxWidth="size40">
Expand Down
Loading