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

Fix tag text ellipsing #1274

Merged
merged 1 commit into from
Dec 18, 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 @@ -41,7 +41,7 @@ export const CategoryTagCloud = (props: Props) => {
onClick={() => setSearchValue("")}
csSize="medium"
>
{`"${searchValue}"`}
<span>{`"${searchValue}"`}</span>
<NewIcon csMode="inline" noWrapper>
<FontAwesomeIcon icon={faXmark} className={styles.icon} />
</NewIcon>
Expand All @@ -63,7 +63,7 @@ export const CategoryTagCloud = (props: Props) => {
<FontAwesomeIcon icon={faBan} />
</NewIcon>
) : undefined}
{c.name}
<span>{c.name}</span>
<NewIcon csMode="inline" noWrapper rootClasses={styles.icon}>
<FontAwesomeIcon icon={faXmark} />
</NewIcon>
Expand All @@ -76,7 +76,7 @@ export const CategoryTagCloud = (props: Props) => {
csModifiers={["ghost"]}
rootClasses={styles.clearButton}
>
Clear all
<span>Clear all</span>
<NewIcon csMode="inline" noWrapper>
<FontAwesomeIcon icon={faXmark} className={styles.icon} />
</NewIcon>
Expand Down
16 changes: 12 additions & 4 deletions apps/cyberstorm-storybook/stories/newComponents/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const Template: StoryFn<typeof NewTag> = () => {
csSize={size}
csModifiers={[modifier]}
>
{size}-{variant}-{modifier}
<span>
{size}-{variant}-{modifier}
</span>
<NewIcon csMode={"inline"} noWrapper>
<FontAwesomeIcon icon={faChevronDown} />
</NewIcon>
Expand All @@ -40,7 +42,9 @@ const Template: StoryFn<typeof NewTag> = () => {
csSize={size}
csModifiers={[modifier, "hoverable"]}
>
{size}-{variant}-{modifier}-hoverable
<span>
{size}-{variant}-{modifier}-hoverable
</span>
<NewIcon csMode={"inline"} noWrapper>
<FontAwesomeIcon icon={faChevronDown} />
</NewIcon>
Expand All @@ -56,7 +60,9 @@ const Template: StoryFn<typeof NewTag> = () => {
csSize={size}
csModifiers={[modifier]}
>
{size}-{variant}-{modifier}
<span>
{size}-{variant}-{modifier}
</span>
<NewIcon csMode={"inline"} noWrapper>
<FontAwesomeIcon icon={faChevronDown} />
</NewIcon>
Expand All @@ -77,7 +83,9 @@ const Template: StoryFn<typeof NewTag> = () => {
csVariant={variant}
csSize={size}
>
{size}-{variant}-noModifier
<span>
{size}-{variant}-noModifier
</span>
<NewIcon csMode={"inline"} noWrapper>
<FontAwesomeIcon icon={faChevronDown} />
</NewIcon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function CardPackage(props: Props) {
csSize="xsmall"
csModifiers={["dark", "hoverable"]}
>
{c.name}
<span>{c.name}</span>
</NewTag>
))
: null}
Expand Down
6 changes: 1 addition & 5 deletions packages/cyberstorm/src/newComponents/Tag/Tag.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
padding-inline: var(--tag-padding-inline);
}

.ts-tag__content {
display: flex;
gap: var(--tag-gap);
align-items: center;
justify-content: center;
.ts-tag > span {
min-width: 0;
overflow-x: clip;
white-space: nowrap;
Expand Down
6 changes: 3 additions & 3 deletions packages/cyberstorm/src/newComponents/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Tag = React.forwardRef<
)}
ref={fRef}
>
<div className="ts-tag__content">{children}</div>
{children}
</Actionable>
);
}
Expand All @@ -72,7 +72,7 @@ export const Tag = React.forwardRef<
)}
ref={fRef}
>
<div className="ts-tag__content">{children}</div>
{children}
</Actionable>
);
}
Expand All @@ -89,7 +89,7 @@ export const Tag = React.forwardRef<
)}
ref={forwardedRef}
>
<div className="ts-tag__content">{children}</div>
{children}
</Frame>
);
});
Expand Down
Loading