-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[project-base] [SSP-2454] Storefront color system implementation (#3311)
- Loading branch information
Showing
337 changed files
with
1,341 additions
and
1,331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { ExtendedNextLink } from 'components/Basic/ExtendedNextLink/ExtendedNextLink'; | ||
import { ReactElement } from 'react'; | ||
import { PageType } from 'store/slices/createPageLoadingStateSlice'; | ||
import { twJoin } from 'tailwind-merge'; | ||
|
||
type LabelLinkProps = { | ||
isDisabled?: boolean; | ||
isActive?: boolean; | ||
onClick?: () => void; | ||
} & ( | ||
| { | ||
href: string; | ||
type: PageType | undefined; | ||
render?: never; | ||
} | ||
| ({ | ||
href?: never; | ||
type?: never; | ||
} & ( | ||
| { | ||
render: (input: JSX.Element) => ReactElement<any, any> | null; | ||
} | ||
| { | ||
render?: never; | ||
} | ||
)) | ||
); | ||
|
||
export const LabelLink: FC<LabelLinkProps> = ({ | ||
href, | ||
type, | ||
children, | ||
isDisabled, | ||
isActive, | ||
className, | ||
render, | ||
onClick, | ||
}) => { | ||
const labelLinkTwClassName = twJoin( | ||
'px-4 py-1 rounded-full no-underline transition-all flex justify-center items-center', | ||
'bg-labelLinkBackground text-labelLinkText border-labelLinkBorder', | ||
'hover:bg-labelLinkBackgroundHovered hover:text-labelLinkTextHovered hover:border-labelLinkBorderHovered hover:no-underline hover:cursor-pointer', | ||
isDisabled && 'bg-labelLinkBackgroundDisabled text-labelLinkTextDisabled border-labelLinkBorderDisabled', | ||
isActive && 'bg-labelLinkBackgroundActive text-labelLinkTextActive border-labelLinkBorderActive', | ||
className, | ||
); | ||
|
||
if (href) { | ||
return ( | ||
<ExtendedNextLink className={labelLinkTwClassName} href={href} type={type}> | ||
{children} | ||
</ExtendedNextLink> | ||
); | ||
} | ||
|
||
const content = ( | ||
<div className={labelLinkTwClassName} onClick={onClick}> | ||
{children} | ||
</div> | ||
); | ||
|
||
if (render) { | ||
return render(content); | ||
} | ||
|
||
return content; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.