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

Updated reusable pill component #329

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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const BuildModal: React.FC<BuildModalProps> = React.memo(
aria-labelledby="build-modal-title"
aria-describedby="build-modal-message"
dialogClassName="build-modal"
size="sm"
>
<Modal.Header>
<Modal.Title id="build-modal-title">
Expand Down
15 changes: 12 additions & 3 deletions forms-flow-components/src/components/CustomComponents/Pills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { DeleteIcon } from "../SvgIcons/index";

interface CustomPillProps {
label: string;
icon?: boolean;
secondaryLabel: string;
icon?: React.ReactNode;
bg: string;
dataTestid?: string;
ariaLabel?: string;
onClick?: () => void;
onClick?: () => void;
}

export const CustomPill: React.FC<CustomPillProps> = ({
Expand All @@ -17,12 +18,20 @@ export const CustomPill: React.FC<CustomPillProps> = ({
bg,
dataTestid = "",
ariaLabel = "",
secondaryLabel="",
onClick,
}) => {
return (
<div>
<Badge pill variant={bg} data-testid={dataTestid} aria-label={ariaLabel}>
{label} {icon && <DeleteIcon color="#253DF4" onClick={onClick} />}
<span className="primary-label">{label}</span>
{ secondaryLabel && (<span className="secondary-label" >{secondaryLabel}</span>)}
{icon &&
<button
className="button-as-div"
aria-label="click icon"
data-testid="click-icon"
onClick={onClick}>{icon}</button>}
</Badge>{" "}
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions forms-flow-theme/scss/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,17 @@ select option:hover {
display: inline-flex !important;
padding-block: var(--spacer-050) !important;
padding-inline: var(--spacer-100) !important;
color: var(--ff-black) !important;
color: var(--ff-gray-800) !important;
gap: var(--spacer-050) !important;
border-radius: var(--ff-border-radius-xl) !important;
background-color: var(--ff-base-100) !important;
border: none !important;
align-items: center !important;
font-size: var(--font-size-sm) !important;
font-weight: var(--ff-badge-font-md) !important;
border-radius: var(--radius-0150) !important;
.secondary-label{
color: var(--ff-gray-500);
}
}

/* ------------------------- Tabs Style ------------------------ */
Expand Down
12 changes: 9 additions & 3 deletions forms-flow-theme/scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,12 @@
align-self: stretch;
}
.build-modal{
width: 60.318% !important;
max-width: 60.318% !important;
.modal-body{
padding: 0px !important;
}
.modal-content{
overflow: hidden;
}
.modal-header{
border-bottom: 1px solid var(--ff-gray-000);
}
Expand All @@ -574,16 +578,18 @@
}
.content-body{
@extend .content-style;
text-align: left;
color: var(--ff-gray-800);
font-weight: var(--font-weight-sm);
}
.build-contents{
display: flex;
flex-direction: column;
border-right: 1px solid var(--ff-gray-000) !important;
padding-left: var(--spacer-250) !important;
padding: var(--spacer-200);
cursor: pointer;
background: none;
border: none;
}
}
}
Loading