gantri-components 2.158.2 → 2.158.3-beta.1

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.
@@ -1,3 +1,6 @@
1
- import { FC } from 'react';
1
+ import React from 'react';
2
2
  import { PillProps } from './pill.types';
3
- export declare const Pill: FC<PillProps>;
3
+ export declare const Pill: {
4
+ <Value extends string | number>(props: PillProps<Value>): React.JSX.Element;
5
+ displayName: string;
6
+ };
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
- export interface PillProps {
2
+ export interface PillProps<Value extends string | number> {
3
3
  icon?: JSX.Element;
4
- onSelected?: (value: string | number) => void;
4
+ onSelected?: (value: Value) => void;
5
5
  selected?: boolean;
6
6
  text?: string;
7
7
  tx?: string;
8
8
  txValues?: Record<string, unknown>;
9
- value: string | number;
9
+ value: Value;
10
10
  }
@@ -1,3 +1,3 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import React, { PropsWithChildren } from 'react';
2
2
  import { PillsProps } from './pills.types';
3
- export declare const Pills: FC<PropsWithChildren<PillsProps>>;
3
+ export declare const Pills: <Value extends string | number>(props: React.PropsWithChildren<PillsProps<Value>>) => React.JSX.Element;
@@ -1,11 +1,16 @@
1
1
  import { ChangeEvent, FocusEvent } from 'react';
2
2
  import { BlurChangeEvent } from '../dropdown';
3
- export interface PillsProps {
3
+ import { GridProps } from '../grid/grid.types';
4
+ export interface PillsProps<Value extends string | number> extends Partial<Omit<GridProps, 'onBlur' | 'onChange' | 'onFocus' | 'onSelect'>> {
5
+ className?: string;
6
+ /** If `true`, styles the pills so they are all the same size. */
7
+ equalPills?: boolean;
4
8
  name?: string;
5
9
  onBlur?: (event: BlurChangeEvent) => void;
6
10
  onChange?: (event: PillsChangeEvent) => void;
7
11
  onFocus?: (event: FocusChangeEvent) => void;
8
- value?: string | number | undefined;
12
+ onSelect?: (value: Value) => void;
13
+ value?: Value;
9
14
  }
10
15
  export interface PillsChangeEvent<T = string | number> extends Pick<ChangeEvent<HTMLInputElement>, Exclude<keyof ChangeEvent<HTMLInputElement>, 'target'>> {
11
16
  target: {