Skip to content

Commit

Permalink
feat(Pill): add new variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajit-p44 committed Aug 28, 2024
1 parent 1ae33ed commit 471ba6a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-plants-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@project44-manifest/react': major
---

Add a new pill variant
11 changes: 11 additions & 0 deletions packages/react/src/components/Pill/Pill.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ export const useStyles = css({
backgroundColor: '$palette-red-600',
},
},
yellow: {
$$backgroundColor: '$colors$palette-yellow-100',

'.manifest-pill__text': {
color: '#BF7000',
},

'.manifest-pill__icon': {
backgroundColor: '#BF7000',
},
},
},
isCollapsible: {
true: {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Pill/Pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface PillOptions<T extends As = PillElement> extends Options<T>, Sty
*
* @default 'indigo'
*/
colorScheme?: 'indigo' | 'red';
colorScheme?: 'indigo' | 'red' | 'yellow';
/**
* The icon to render in the pill.
*/
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/components/Pill/story/Pill.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AirplaneFilled, Clock } from '@project44-manifest/react-icons';
import { AirplaneFilled, Boat, Clock } from '@project44-manifest/react-icons';
import type { StoryFn } from '@storybook/react';
import { Flex, Pill } from '../../..';

Expand All @@ -23,6 +23,7 @@ ColorScheme.decorators = [
<Flex align="center" css={{ gap: '$small' }}>
<Pill colorScheme="indigo" icon={<AirplaneFilled />} label="In Transit" />
<Pill colorScheme="red" icon={<Clock />} label="On Hold" />
<Pill colorScheme="yellow" icon={<Boat />} label="Held" />
</Flex>
),
];
Expand All @@ -34,6 +35,7 @@ Collapsible.decorators = [
<Flex align="center" css={{ gap: '$small' }}>
<Pill isCollapsible colorScheme="indigo" icon={<AirplaneFilled />} label="In Transit" />
<Pill isCollapsible colorScheme="red" icon={<Clock />} label="On Hold" />
<Pill isCollapsible colorScheme="yellow" icon={<Boat />} label="Held" />
</Flex>
),
];
Expand Down

0 comments on commit 471ba6a

Please sign in to comment.