Skip to content

Commit

Permalink
fix: set nowrap in chip (#1590)
Browse files Browse the repository at this point in the history
* fix: set nowrap in chip

* Create early-garlics-deliver.md
  • Loading branch information
jguddas authored Sep 10, 2023
1 parent 8606fbe commit 5c30e04
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/early-garlics-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

fix: set nowrap in chip
14 changes: 14 additions & 0 deletions packages/components/chip/stories/chip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,17 @@ export const WithAvatar = {
avatar: <Avatar name="JW" src="https://i.pravatar.cc/300?u=a042581f4e29026709d" />,
},
};

const HiddenOverflowTemplate = (args: ChipProps) => (
<div className="w-20 border-danger-500 border-2">
<Chip {...args} />
</div>
);

export const HiddenOverflow = {
render: HiddenOverflowTemplate,
args: {
...defaultProps,
children: "Hello World!",
},
};
10 changes: 9 additions & 1 deletion packages/core/theme/src/components/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ import {ringClasses, colorVariants} from "../utils";
*/
const chip = tv({
slots: {
base: ["relative", "max-w-fit", "inline-flex", "items-center", "justify-between", "box-border"],
base: [
"relative",
"max-w-fit",
"inline-flex",
"items-center",
"justify-between",
"box-border",
"whitespace-nowrap",
],
content: "flex-1 text-inherit font-normal",
dot: ["w-2", "h-2", "ml-1", "rounded-full"],
avatar: "flex-shrink-0",
Expand Down

2 comments on commit 5c30e04

@vercel
Copy link

@vercel vercel bot commented on 5c30e04 Sep 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5c30e04 Sep 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.