Skip to content

Commit

Permalink
Merge branch 'main' into feat/callout-visual
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti authored Oct 13, 2023
2 parents 24d3255 + 9ce0dd4 commit eb7bcb9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-cars-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": minor
---

feat(fuselage): change `SidebarItem` focus color
5 changes: 5 additions & 0 deletions .changeset/selfish-plants-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": minor
---

feat(fuselage): option to use `Tag` as link
5 changes: 5 additions & 0 deletions .changeset/selfish-scissors-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": patch
---

fix(fuselage): Remove underline prevention on anchor elements
2 changes: 0 additions & 2 deletions packages/fuselage/src/components/Field/Field.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
@include typography.use-font-scale(p2);
margin-block: lengths.margin(2);

text-decoration: none;

color: colors.font(info);
@extend %--with-inline-elements;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $sidebar-color-stroke-default: theme(

$sidebar-color-stroke-focus: theme(
'sidebar-color-stroke-focus',
colors.stroke(medium)
colors.stroke(highlight)
);

$sidebar-item-color: theme('sidebar-item-color', colors.font(secondary-info));
Expand Down
2 changes: 0 additions & 2 deletions packages/fuselage/src/components/States/States.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ $variants: (
@include typography.use-font-scale(p2);
margin-block: lengths.margin(16);

text-decoration: none;

color: colors.font(info);
@extend %--with-inline-elements;
}
Expand Down
5 changes: 5 additions & 0 deletions packages/fuselage/src/components/Tag/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ export const Large = Template.bind({});
Large.args = {
large: true,
};

export const AsLink = Template.bind({});
AsLink.args = {
href: '#',
};
11 changes: 8 additions & 3 deletions packages/fuselage/src/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { AllHTMLAttributes, ReactNode } from 'react';
import React from 'react';

import { prependClassName } from '../../helpers/prependClassName';
import Box from '../Box/Box';

type TagProps = {
medium?: boolean;
Expand All @@ -15,7 +16,7 @@ type TagProps = {
| 'featured';
disabled?: boolean;
icon?: ReactNode;
} & AllHTMLAttributes<HTMLSpanElement>;
} & Omit<AllHTMLAttributes<HTMLSpanElement | HTMLAnchorElement>, 'is'>;

export const Tag = ({
large,
Expand All @@ -26,6 +27,7 @@ export const Tag = ({
variant,
children,
icon,
href,
...props
}: TagProps) => {
const modifiers = [
Expand All @@ -34,19 +36,22 @@ export const Tag = ({
large && 'large',
disabled && 'disabled',
onClick && 'clickable',
href && 'clickable',
]
.filter(Boolean)
.map((modifier) => `rcx-tag--${modifier}`)
.join(' ');

return (
<span
<Box
is={href ? 'a' : 'span'}
className={prependClassName(className as string, `rcx-tag ${modifiers}`)}
onClick={onClick}
href={href}
{...props}
>
{icon}
<span className='rcx-tag__inner'>{children}</span>
</span>
</Box>
);
};
2 changes: 0 additions & 2 deletions packages/fuselage/src/styles/primitives/traits/rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

a {
&:link {
text-decoration: none;

color: colors.font(info);
}

Expand Down

0 comments on commit eb7bcb9

Please sign in to comment.