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

LinkButton: show icons in Cambio #353

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/poor-maps-yawn.md
@@ -0,0 +1,5 @@
---
"@cambly/syntax-core": minor
---

LinkButton: show icons in Cambio
3 changes: 1 addition & 2 deletions packages/syntax-core/src/Button/Button.tsx
Expand Up @@ -181,8 +181,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
themeName === "classic" ? styles[size] : styles[`${size}Cambio`],
{
[styles.fullWidth]: fullWidth,
[styles.buttonGap]:
themeName === "classic" && (size === "lg" || size === "md"),
[styles.buttonGap]: size === "lg" || size === "md",
[styles.secondaryBorder]:
themeName === "classic" && color === "secondary",
[styles.secondaryDestructiveBorder]:
Expand Down
7 changes: 3 additions & 4 deletions packages/syntax-core/src/LinkButton/LinkButton.tsx
Expand Up @@ -165,8 +165,7 @@ const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(
{
[buttonStyles.fullWidth]: fullWidth,
[styles.fitContent]: !fullWidth,
[buttonStyles.buttonGap]:
themeName === "classic" && (size === "lg" || size === "md"),
[buttonStyles.buttonGap]: size === "lg" || size === "md",
[buttonStyles.secondaryBorder]:
themeName === "classic" && color === "secondary",
[buttonStyles.secondaryDestructiveBorder]:
Expand All @@ -175,7 +174,7 @@ const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(
)}
onClick={onClick}
>
{StartIcon && themeName === "classic" && (
{StartIcon && (
<StartIcon
className={classNames(
buttonStyles.icon,
Expand All @@ -195,7 +194,7 @@ const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(
{text}
</span>
</Typography>
{EndIcon && themeName === "classic" && (
{EndIcon && (
<EndIcon
className={classNames(
buttonStyles.icon,
Expand Down
8 changes: 2 additions & 6 deletions packages/syntax-core/src/RichSelect/RichSelectList.tsx
Expand Up @@ -178,25 +178,21 @@ function RichSelectList(props: RichSelectListProps): ReactElement {
<div
className={classNames(styles.selectContainer, {
[styles.opacityOverlay]: disabled,
[styles.selectContainerCambio]: themeName === "cambio",
})}
onClick={onClick}
>
{label && (
<>
<ReactAriaLabel
data-testid={[dataTestId, "label"].filter(Boolean).join("-")}
className={classNames(
themeName === "cambio" && styles.labelCambio,
)}
{...labelProps}
onClick={() => {
if (disabled) return;
fieldRef.current?.focus();
setInteractionModality("keyboard"); // Show the focus ring so the user knows where focus went
}}
>
<Box paddingX={themeName === "classic" ? 1 : 3}>
<Box paddingX={1}>
<Typography size={100} color="gray700">
{label}
</Typography>
Expand Down Expand Up @@ -279,7 +275,7 @@ function RichSelectList(props: RichSelectListProps): ReactElement {
</TapArea>
</Popover>
{(helperText || errorText) && (
<Box paddingX={themeName === "classic" ? 1 : 0}>
<Box paddingX={1}>
<Typography
size={100}
color={errorText ? "destructive-primary" : "gray700"}
Expand Down
4 changes: 0 additions & 4 deletions packages/syntax-core/src/SelectList/SelectList.module.css
Expand Up @@ -4,10 +4,6 @@
gap: 8px;
}

.selectContainerCambio {
position: relative;
}

.opacityOverlay {
opacity: 0.5;
}
Expand Down
1 change: 0 additions & 1 deletion packages/syntax-core/src/SelectList/SelectList.tsx
Expand Up @@ -109,7 +109,6 @@ export default function SelectList({
<div
className={classNames(styles.selectContainer, {
[styles.opacityOverlay]: disabled,
[styles.selectContainerCambio]: themeName === "cambio",
})}
>
{label && (
Expand Down