From 12e916fd0de7806ed04722ddda29e72b89c7cdbd Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 19 Nov 2025 02:47:24 -0800 Subject: [PATCH] add PillLink component --- src/shared/components/pill/pill.module.css | 20 +++++++ src/shared/components/pill/pill.tsx | 66 +++++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/shared/components/pill/pill.module.css b/src/shared/components/pill/pill.module.css index b8ed27438..d89d62b48 100644 --- a/src/shared/components/pill/pill.module.css +++ b/src/shared/components/pill/pill.module.css @@ -41,3 +41,23 @@ color: var(--theme-colors-foreground-muted); } } + +.group.sm { + --pg-gap: var(--theme-spacing-sm) !important; +} + +.group.md { + --pg-gap: var(--theme-spacing-md) !important; +} + +.group.lg { + --pg-gap: var(--theme-spacing-lg) !important; +} + +.group.xl { + --pg-gap: var(--theme-spacing-xl) !important; +} + +.group.xs { + --pg-gap: var(--theme-spacing-xs) !important; +} diff --git a/src/shared/components/pill/pill.tsx b/src/shared/components/pill/pill.tsx index cc29fe9b3..a947cff15 100644 --- a/src/shared/components/pill/pill.tsx +++ b/src/shared/components/pill/pill.tsx @@ -1,5 +1,11 @@ -import { Pill as MantinePill, PillProps as MantinePillProps } from '@mantine/core'; +import { + Pill as MantinePill, + PillGroupProps as MantinePillGroupProps, + PillProps as MantinePillProps, +} from '@mantine/core'; import clsx from 'clsx'; +import { forwardRef } from 'react'; +import { Link } from 'react-router'; import styles from './pill.module.css'; @@ -30,4 +36,60 @@ export const Pill = ({ children, classNames, radius = 'md', size = 'md', ...prop ); }; -Pill.Group = MantinePill.Group; +interface PillGroupProps extends MantinePillGroupProps {} + +const PillGroup = ({ children, classNames, gap = 'sm', ...props }: PillGroupProps) => { + return ( + + {children} + + ); +}; + +Pill.Group = PillGroup; + +interface PillLinkProps + extends Omit, keyof PillProps>, + PillProps {} + +export const PillLink = forwardRef(({ children, ...props }, ref) => { + const { classNames, radius = 'md', size = 'md', ...rest } = props; + + return ( + + {children} + + ); +});