@indico-data/design-system 3.20.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ export { SingleInputDatePicker } from './forms/date/inputDatePicker';
20
20
  export { InputDateRangePicker } from './forms/date/inputDateRangePicker';
21
21
  export { Modal, ConfirmationModal } from './modal';
22
22
  export { Badge } from './badge';
23
+ export { Pill } from './pill';
23
24
  export { Pagination } from './pagination';
24
25
  export { TanstackTable } from './tanstackTable';
25
26
  export { Tooltip } from './tooltip';
@@ -1,2 +1,2 @@
1
1
  import { type PillProps } from './types';
2
- export declare const Pill: ({ children, className, color, size, shade, ...rest }: PillProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Pill: ({ children, color, size, variant, type, iconLeft, iconRight, dot, onClose, closeAriaLabel, className, ...rest }: PillProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,19 @@
1
1
  import { type Meta, type StoryObj } from '@storybook/react';
2
2
  import { Pill } from './Pill';
3
- declare const meta: Meta;
3
+ declare const meta: Meta<typeof Pill>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Pill>;
6
6
  export declare const Default: Story;
7
7
  export declare const AllSizes: Story;
8
- export declare const AllDefaultColors: Story;
9
- export declare const AllShades: Story;
8
+ export declare const SolidColors: Story;
9
+ export declare const OutlineColors: Story;
10
+ export declare const BadgeVsPill: Story;
11
+ export declare const WithIconLeft: Story;
12
+ export declare const WithIconRight: Story;
13
+ export declare const WithDot: Story;
14
+ export declare const IconOnly: Story;
15
+ export declare const Closeable: Story;
16
+ export declare const Combined: Story;
17
+ export declare const FullMatrix: Story;
18
+ export declare const CloseableMatrix: Story;
19
+ export declare const FigmaMatrix: Story;
@@ -1,16 +1,29 @@
1
1
  import { type ChromaticColor } from '../../types';
2
+ import { type IconName } from '../icons/types';
2
3
  import type React from 'react';
3
4
  export type PillSize = 'sm' | 'md' | 'lg';
4
- export type PillColor = ChromaticColor;
5
- export type PillShade = 1 | 2 | 3 | 4 | 5;
6
- export interface PillProps {
5
+ export type PillColor = ChromaticColor | 'soft';
6
+ export type PillVariant = 'solid' | 'outline';
7
+ export type PillType = 'pill' | 'badge';
8
+ export interface PillProps extends React.HTMLAttributes<HTMLDivElement> {
7
9
  /** The content displayed inside the pill */
8
- children: React.ReactNode | React.ReactNode[];
9
- /** Applies a CSS class to change the style of the pill */
10
+ children?: React.ReactNode;
11
+ /** The color scheme, maps to component token color groups */
10
12
  color?: PillColor;
11
- /** Applies a CSS class to change the size of the pill */
13
+ /** Controls the overall size (padding + font size) */
12
14
  size?: PillSize;
13
- /** Applies a CSS class to change the shade of the pill */
14
- shade?: PillShade;
15
- className?: string;
15
+ /** Solid (filled) or outline (bordered) appearance */
16
+ variant?: PillVariant;
17
+ /** Badge has a small border-radius; pill is fully rounded */
18
+ type?: PillType;
19
+ /** Optional left icon (pass an IconName string, sizing is automatic) */
20
+ iconLeft?: IconName;
21
+ /** Optional right icon (pass an IconName string, sizing is automatic) */
22
+ iconRight?: IconName;
23
+ /** When true, renders a small colored dot indicator before the content */
24
+ dot?: boolean;
25
+ /** When provided, renders a close button that calls this handler */
26
+ onClose?: () => void;
27
+ /** Accessible label for the close button (for i18n) */
28
+ closeAriaLabel?: string;
16
29
  }