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

[TM-1535] add icon expand in polygons review #728

Merged
merged 3 commits into from
Dec 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,17 @@ const Polygons = (props: IPolygonProps) => {
Add Polygon <Icon name={IconNames.PLUS_CIRCLE} className="h-4 w-4" />
</Text>
</Button>
<Button variant="white-border" onClick={() => setOpenCollapseAll(!openCollapseAll)} className="mb-2">
{openCollapseAll ? "SHRINK" : "EXPAND"}
<Button
variant="white-border"
onClick={() => setOpenCollapseAll(!openCollapseAll)}
className="mb-2 flex gap-1 !rounded-lg !capitalize"
>
{openCollapseAll ? (
<Icon name={IconNames.IC_SHINK} className="mr-1 h-[0.8rem] w-[0.8rem]" />
) : (
<Icon name={IconNames.IC_EXPAND} className="mr-1 h-[0.8rem] w-[0.8rem]" />
)}
{openCollapseAll ? "Shrink " : "Expand"}
</Button>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/assets/icons/ic_expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/assets/icons/ic_shrink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions src/components/elements/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const Button: FC<IButtonProps> = props => {
const variantClasses = useMemo(() => {
const nonTextClasses =
"rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10";
const nonTextSpanClasses = "flex items-center text-bold-caption-200";
const nonTextSpanClasses = "flex items-center text-bold-caption-200 !leading-[normal]";
const newText =
"flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary";
"flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary !leading-[normal]";

switch (variant) {
case "primary":
Expand Down Expand Up @@ -85,7 +85,7 @@ const Button: FC<IButtonProps> = props => {
return {
container:
"group bg-white border border-primary-500 uppercase leading-[normal] px-4 py-[10.5px] rounded-lg hover:bg-grey-900 disabled:border-transparent disabled:bg-grey-750",
span: "text-primary-500 text-12-bold group-disabled:text-grey-730"
span: "text-primary-500 text-12-bold group-disabled:text-grey-730 !leading-[normal]"
};
case "white":
return {
Expand All @@ -95,7 +95,7 @@ const Button: FC<IButtonProps> = props => {
case "white-page-admin":
return {
container: "py-2 px-3 bg-white rounded-lg text-darkCustom-100 border border-grey-750 hover:bg-grey-900",
span: "flex items-center text-bold-caption-200 text-inherit uppercase"
span: "flex items-center text-bold-caption-200 text-inherit uppercase !leading-[normal]"
};
case "sky":
return {
Expand All @@ -106,7 +106,7 @@ const Button: FC<IButtonProps> = props => {
return {
container:
"group py-2 px-3 bg-primary-200 rounded-lg text-darkCustom-100 border border-grey-750 hover:text-primary-500",
span: "flex items-center text-bold-caption-200 text-inherit uppercase"
span: "flex items-center text-bold-caption-200 text-inherit uppercase !leading-[normal]"
};
case "text":
return { container: "", span: "text-12-bold" };
Expand All @@ -129,14 +129,14 @@ const Button: FC<IButtonProps> = props => {
return {
container:
"group bg-white border-[3px] border-grey-500 hover:border-primary-500 disabled:border-neutral-1000 px-4 py-2 rounded-lg",
span: "uppercase text-14-bold text-grey-500 group-hover:text-primary-500"
span: "uppercase text-14-bold text-grey-500 group-hover:text-primary-500 !leading-[normal]"
};

case "orange":
return {
container:
"group bg-tertiary-600 py-1.5 px-5 rounded-lg hover:opacity-90 disabled:bg-tertiary-600 disabled:opacity-70",
span: "normal-case text-10-bold text-white h-min"
span: "normal-case text-10-bold text-white h-min !leading-[normal]"
};

case "semi-red":
Expand All @@ -148,28 +148,28 @@ const Button: FC<IButtonProps> = props => {
case "white-toggle":
return {
container: "group bg-white py-1 px-3 rounded",
span: "text-14-semibold text-darkCustom"
span: "text-14-semibold text-darkCustom !leading-[normal]"
};
case "transparent-toggle":
return {
container: "group bg-transparent px-3 py-1 rounded",
span: "text-14-light text-darkCustom-100"
span: "text-14-light text-darkCustom-100 !leading-[normal]"
};
case "white-button-map":
return {
container: "h-fit rounded-lg bg-white px-4 py-2 shadow hover:bg-neutral-200",
span: "flex items-center gap-2"
span: "flex items-center gap-2 !leading-[normal]"
};
case "purple":
return {
container:
"h-fit rounded-lg px-4 py-1 hover:bg-purpleCustom-60 text-purpleCustom-500 bg-purpleCustom-50 border border-purpleCustom-60",
span: "flex items-center gap-2 text-purpleCustom-500 text-14"
span: "flex items-center gap-2 text-purpleCustom-500 text-14 !leading-[normal]"
};
case "about-us":
return {
container: "h-fit rounded-lg bg-green-200 px-5 py-[18px] hover:bg-green-60 text-white",
span: "flex items-center text-16-bold"
span: "flex items-center text-16-bold !leading-[normal]"
};
default:
return { container: "", span: "" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Storyshots Components/Elements/Buttons Disabled Link 1`] = `
href="/"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Disabled Link
</span>
Expand All @@ -19,7 +19,7 @@ exports[`Storyshots Components/Elements/Buttons Primary 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Primary
</span>
Expand All @@ -32,7 +32,7 @@ exports[`Storyshots Components/Elements/Buttons Primary Disabled 1`] = `
disabled={true}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Primary
</span>
Expand All @@ -52,7 +52,7 @@ exports[`Storyshots Components/Elements/Buttons Primary Icon 1`] = `
}
/>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Primary
</span>
Expand All @@ -65,7 +65,7 @@ exports[`Storyshots Components/Elements/Buttons Primary Link 1`] = `
href="/"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Primary Link
</span>
Expand All @@ -77,7 +77,7 @@ exports[`Storyshots Components/Elements/Buttons Secondary 1`] = `
className="bg-white border border-neutral-1000 hover:border-primary-500 disabled:border-neutral-1000 py-[10.5px] rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Secondary
</span>
Expand All @@ -90,7 +90,7 @@ exports[`Storyshots Components/Elements/Buttons Secondary Disabled 1`] = `
disabled={true}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Secondary
</span>
Expand All @@ -110,7 +110,7 @@ exports[`Storyshots Components/Elements/Buttons Secondary Icon 1`] = `
}
/>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Secondary
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ exports[`Storyshots Components/Elements/Cards/FundingCard Default 1`] = `
target="_blank"
>
<span
className="flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary"
className="flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary !leading-[normal]"
>
Read More
</span>
Expand All @@ -80,7 +80,7 @@ exports[`Storyshots Components/Elements/Cards/FundingCard Default 1`] = `
onTouchStart={[Function]}
>
<span
className="flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary"
className="flex items-center font-inter font-bold text-16 leading-snug tracking-tighter uppercase text-primary !leading-[normal]"
>
Apply Now
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exports[`Storyshots Components/Elements/Cards/GenericCard Default 1`] = `
className="bg-white border border-neutral-1000 hover:border-primary-500 disabled:border-neutral-1000 py-[10.5px] rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center gap-1.5 tracking-wide w-full justify-center"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
View
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`Storyshots Components/Elements/Cards/UpcomingOpportunitiesCard Primary
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Find out more
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports[`Storyshots Components/Elements/Drawer Primary 1`] = `
onClick={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`Storyshots Components/Elements/Fields/ButtonField Default 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
View
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ exports[`Storyshots Components/Elements/Fields/FieldsExpander Default 1`] = `
onClick={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Download
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports[`Storyshots Components/Elements/Inputs/DataTable Default 1`] = `
}
/>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Add funding source
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ exports[`Storyshots Components/Elements/Inputs/TreeSpeciesInput Default 1`] = `
}
/>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Add Another undefined
</span>
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`Storyshots Components/Elements/Inputs/TreeSpeciesInput With Number 1`]
}
/>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Add Another undefined
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`Storyshots Components/Elements/LandingPage/AlternatingSection Left 1`]
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Learn more
</span>
Expand Down Expand Up @@ -111,7 +111,7 @@ exports[`Storyshots Components/Elements/LandingPage/AlternatingSection Right 1`]
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Learn more
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`Storyshots Components/Elements/LandingPage/TwoByOneSection Primary 1`]
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Launch Resource Library
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports[`Storyshots Components/Elements/LandingPage/UpcomingOpportunities Defaul
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Find out more
</span>
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`Storyshots Components/Elements/LandingPage/UpcomingOpportunities Defaul
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Find out more
</span>
Expand Down Expand Up @@ -98,7 +98,7 @@ exports[`Storyshots Components/Elements/LandingPage/UpcomingOpportunities Defaul
onTouchStart={[Function]}
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Find out more
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Storyshots Components/Elements/Menu Placement Bottom Left 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down Expand Up @@ -60,7 +60,7 @@ exports[`Storyshots Components/Elements/Menu Placement Bottom Right 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down Expand Up @@ -111,7 +111,7 @@ exports[`Storyshots Components/Elements/Menu Placement Left Bottom 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down Expand Up @@ -162,7 +162,7 @@ exports[`Storyshots Components/Elements/Menu Placement Right Top 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down Expand Up @@ -213,7 +213,7 @@ exports[`Storyshots Components/Elements/Menu Primary 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down Expand Up @@ -264,7 +264,7 @@ exports[`Storyshots Components/Elements/Menu Secondary 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
Open/Close
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`Storyshots Components/Elements/Section/Header Default 1`] = `
className="bg-primary-500 hover:bg-primary-400 py-2 !text-white rounded-md px-4 uppercase disabled:bg-neutral-300 disabled:text-neutral-800 transition whitespace-nowrap text-black min-h-10 flex items-center justify-center gap-1.5 tracking-wide w-fit-content"
>
<span
className="flex items-center text-bold-caption-200"
className="flex items-center text-bold-caption-200 !leading-[normal]"
>
View more
</span>
Expand Down
Loading
Loading