gantri-components 2.98.1 → 2.99.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.
@@ -9,7 +9,7 @@ export type ButtonWidth = 'sm' | 'md' | 'lg' | string;
9
9
  * large = desktop on figma design
10
10
  * small = mobile on figma design
11
11
  * */
12
- export type ButtonSize = 'large' | 'small' | string;
12
+ export type ButtonSize = 'small' | 'medium' | 'large' | 'extraLarge' | string;
13
13
  export interface ButtonProps extends Pick<BaseProps, Exclude<keyof BaseProps, 'color'>> {
14
14
  alignSelf?: ResolutionAwareProp<Property.AlignSelf>;
15
15
  borderRadius?: ResolutionAwareProp<Property.BorderRadius>;
@@ -1,9 +1,10 @@
1
1
  import { ChangeEvent, CSSProperties, FocusEvent, ReactElement } from 'react';
2
2
  import { Property } from 'csstype';
3
3
  import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
4
- import { ErrorMessageType, TextFieldSize } from '../text-field';
4
+ import { ErrorMessageType, LabelPosition, TextFieldSize, TextFieldVariant } from '../text-field';
5
5
  import { Maybe } from '../../global';
6
6
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
7
+ import { TextVariant } from '../typography';
7
8
  export type DropdownVariant = 'inline' | 'external';
8
9
  export interface DropdownProps<T> extends Omit<DropdownMenuProps<T>, 'items'> {
9
10
  borderless?: boolean;
@@ -17,9 +18,10 @@ export interface DropdownProps<T> extends Omit<DropdownMenuProps<T>, 'items'> {
17
18
  items?: T[];
18
19
  keepOpenAfterSelection?: boolean;
19
20
  keyProperty?: (option?: T) => string;
20
- labelPosition?: 'top' | 'left';
21
+ labelPosition?: LabelPosition;
21
22
  labelText?: string;
22
23
  labelTx?: string;
24
+ labelVariant?: ResolutionAwareProp<TextVariant>;
23
25
  name?: string;
24
26
  onBlur?: (event: BlurChangeEvent) => void;
25
27
  onChange?: (event: DropdownChangeEvent<T>) => void;
@@ -35,7 +37,7 @@ export interface DropdownProps<T> extends Omit<DropdownMenuProps<T>, 'items'> {
35
37
  resetSelectionOnDisabled?: boolean;
36
38
  size?: ResolutionAwareProp<TextFieldSize>;
37
39
  style?: CSSProperties;
38
- variant?: 'line' | 'filled';
40
+ variant?: TextFieldVariant;
39
41
  }
40
42
  export interface DefaultOptionProps {
41
43
  label?: string;
@@ -5,6 +5,7 @@ import { ErrorMessageType, TextFieldSize } from '../text-field';
5
5
  import { BlurChangeEvent, DropdownChangeEvent } from '../dropdown';
6
6
  import { Maybe } from '../../global';
7
7
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
8
+ import { TextVariant } from '../typography';
8
9
  export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<DropdownMenuProps<T>, 'items'> {
9
10
  borderless?: boolean;
10
11
  className?: string;
@@ -22,6 +23,7 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
22
23
  labelPosition?: 'top' | 'left';
23
24
  labelText?: string;
24
25
  labelTx?: string;
26
+ labelVariant?: ResolutionAwareProp<TextVariant>;
25
27
  /**
26
28
  * System will start searching after user has input n digits
27
29
  * There will be no dropdown shown initially, until user enters the n digits and systems begins search.
@@ -1,3 +1,2 @@
1
1
  import { TextFieldSize } from './text-field.types';
2
2
  export declare const textFieldSizeHeights: Record<TextFieldSize, string>;
3
- export declare const textFieldIconsTop: Record<TextFieldSize, string>;
@@ -1,13 +1,16 @@
1
1
  import { ChangeEvent, CSSProperties, FocusEvent, HTMLInputTypeAttribute, KeyboardEventHandler, MouseEvent, ReactElement } from 'react';
2
2
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
3
3
  import { BoxDimension } from '../box/box.types';
4
+ import { TextVariant } from '../typography';
4
5
  export type ErrorMessageType = string | {
5
6
  tx: string;
6
7
  values?: {
7
8
  [key: string]: string;
8
9
  };
9
10
  };
10
- export type TextFieldSize = 'small' | 'large';
11
+ export type TextFieldSize = 'small' | 'medium' | 'large';
12
+ export type TextFieldVariant = 'line' | 'filled';
13
+ export type LabelPosition = 'top' | 'left';
11
14
  export interface TextFieldProps {
12
15
  ariaLabel?: string;
13
16
  ariaLabelTx?: string;
@@ -25,10 +28,11 @@ export interface TextFieldProps {
25
28
  hideErrors?: boolean;
26
29
  horizontalMargin?: ResolutionAwareProp<BoxDimension>;
27
30
  id?: string;
28
- labelPosition?: 'top' | 'left';
31
+ labelPosition?: LabelPosition;
29
32
  labelText?: string;
30
33
  labelTx?: string;
31
34
  labelTxValues?: Record<string, unknown>;
35
+ labelVariant?: ResolutionAwareProp<TextVariant>;
32
36
  leftIcon?: ReactElement;
33
37
  margin?: ResolutionAwareProp<BoxDimension>;
34
38
  marginBottom?: ResolutionAwareProp<BoxDimension>;
@@ -61,7 +65,7 @@ export interface TextFieldProps {
61
65
  throttle?: number;
62
66
  type?: HTMLInputTypeAttribute | undefined;
63
67
  value?: string;
64
- variant?: 'line' | 'filled';
68
+ variant?: TextFieldVariant;
65
69
  verticalMargin?: ResolutionAwareProp<BoxDimension>;
66
70
  }
67
71
  export interface FieldChangeEvent<T = boolean> extends Pick<ChangeEvent<Partial<HTMLInputElement>>, Exclude<keyof ChangeEvent<HTMLInputElement>, 'target'>> {
@@ -77,6 +81,7 @@ export interface StyledInputContainerProps extends Pick<TextFieldProps, 'variant
77
81
  }
78
82
  export interface StyledParentContainerProps extends Pick<TextFieldProps, 'labelPosition' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'horizontalMargin' | 'verticalMargin' | 'margin'> {
79
83
  $disabled?: boolean;
84
+ variant?: TextFieldVariant;
80
85
  }
81
86
  export interface ErrorMessageProps {
82
87
  errorMessage?: ErrorMessageType;