gantri-components 2.118.0-beta.3 → 2.118.0-beta.5

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.
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CheckboxListProps } from './checkbox-list.types';
3
+ export declare const CheckboxList: {
4
+ <Value extends string | Record<any, any>>(props: CheckboxListProps<Value>): React.JSX.Element;
5
+ defaultProps: import("./checkbox-list.types").CheckboxListDefaultProps<string | Record<any, any>>;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { CheckboxListDefaultProps } from './checkbox-list.types';
2
+ export declare const checkboxListDefaultProps: CheckboxListDefaultProps<string | Record<any, any>>;
@@ -0,0 +1,24 @@
1
+ import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
2
+ import { CellProps } from '../cell/cell.types';
3
+ import { CheckboxProps } from '../checkbox/checkbox.types';
4
+ import { GridProps } from '../grid/grid.types';
5
+ export interface CheckboxListProps<Value extends string | Record<any, any>> extends Partial<CheckboxListDefaultProps<Value>>, Partial<CheckboxProps> {
6
+ cellProps?: Partial<CellProps>;
7
+ getIsDisabled?: (optionName: Value) => boolean;
8
+ gridProps?: Partial<Omit<GridProps, 'columns'>> & {
9
+ columns: ResolutionAwareProp<number>;
10
+ };
11
+ items: (Value extends string ? Value : CheckboxItem<Value>)[];
12
+ onValueChange: OnCheckboxListValueChange<Value>;
13
+ values: string[];
14
+ }
15
+ export interface CheckboxListDefaultProps<Value extends string | Record<any, any>> {
16
+ idProperty: Value extends string ? string : keyof Value;
17
+ labelProperty: Value extends string ? string : keyof Value;
18
+ }
19
+ export type CheckboxItem<Value extends string | Record<any, any>> = {
20
+ disabled?: boolean;
21
+ } & (Value extends string ? Record<any, any> : Value);
22
+ export type OnCheckboxListValueChange<Value extends string | Record<any, any>> = (selectedValues: string[], lastInteractedItem: CheckboxItem<Value> & {
23
+ isChecked: boolean;
24
+ }) => void | Promise<void>;
@@ -0,0 +1,13 @@
1
+ import { Dispatch, MouseEventHandler, SetStateAction } from 'react';
2
+ import { CheckboxItem, OnCheckboxListValueChange } from '../../checkbox-list.types';
3
+ export declare const getOnCheckboxClick: <Value extends string | Record<any, any>>(props: {
4
+ formattedItems: CheckboxItem<Value>[];
5
+ idProperty: (Value extends string ? string : keyof Value) | undefined;
6
+ index: number;
7
+ lastSelectedIndex: number | undefined;
8
+ onValueChange: OnCheckboxListValueChange<Value>;
9
+ setLastSelectedIndex: Dispatch<SetStateAction<number | undefined>>;
10
+ value: string;
11
+ values: string[];
12
+ wasChecked: boolean;
13
+ }) => MouseEventHandler<HTMLDivElement>;
@@ -0,0 +1 @@
1
+ export * from './get-on-checkbox-click';
@@ -0,0 +1,2 @@
1
+ export * from './checkbox-list';
2
+ export * from './checkbox-list.types';
@@ -2,16 +2,17 @@ export * from './aspect-ratio';
2
2
  export * from './badge';
3
3
  export * from './box';
4
4
  export * from './breadcrumbs';
5
- export * from './button';
6
5
  export * from './button-menu';
6
+ export * from './button';
7
7
  export * from './cell';
8
+ export * from './checkbox-list';
8
9
  export * from './checkbox';
9
10
  export * from './circular-progress';
10
- export * from './conditional';
11
11
  export * from './color-picker';
12
+ export * from './conditional';
12
13
  export * from './confirmation-modal';
13
- export * from './dropdown';
14
14
  export * from './dropdown-menu';
15
+ export * from './dropdown';
15
16
  export * from './filter-button';
16
17
  export * from './flex';
17
18
  export * from './formik-input';
@@ -19,6 +20,7 @@ export * from './grid';
19
20
  export * from './icon';
20
21
  export * from './image';
21
22
  export * from './in-view';
23
+ export * from './input-group';
22
24
  export * from './line';
23
25
  export * from './linear-progress';
24
26
  export * from './max-width';
@@ -27,6 +29,7 @@ export * from './multi-select-list';
27
29
  export * from './overlay';
28
30
  export * from './pills';
29
31
  export * from './quantity';
32
+ export * from './radio-list';
30
33
  export * from './radio';
31
34
  export * from './search-field';
32
35
  export * from './slider';
@@ -38,4 +41,3 @@ export * from './text-field';
38
41
  export * from './toggle';
39
42
  export * from './tooltip';
40
43
  export * from './typography';
41
- export * from './input-group';
@@ -0,0 +1,2 @@
1
+ export * from './radio-list';
2
+ export * from './radio-list.types';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { RadioListProps } from './radio-list.types';
3
+ export declare const RadioList: {
4
+ <Value extends string>(props: RadioListProps<Value>): React.JSX.Element;
5
+ defaultProps: import("./radio-list.types").RadioListDefaultProps<string | Record<any, any>>;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { RadioListDefaultProps } from './radio-list.types';
2
+ export declare const radioListDefaultProps: RadioListDefaultProps<string | Record<any, any>>;
@@ -0,0 +1,21 @@
1
+ import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
2
+ import { CellProps } from '../cell/cell.types';
3
+ import { GridProps } from '../grid/grid.types';
4
+ import { RadioProps } from '../radio/radio.types';
5
+ export interface RadioListProps<Value extends string> extends Partial<RadioListDefaultProps<Value>>, Partial<Omit<RadioProps, 'onSelected'>> {
6
+ cellProps?: Partial<CellProps>;
7
+ getIsDisabled?: (optionName: Value) => boolean;
8
+ gridProps?: Partial<Omit<GridProps, 'columns'>> & {
9
+ columns: ResolutionAwareProp<number>;
10
+ };
11
+ items: (Value | RadioItem)[];
12
+ onSelected: (value: Value) => void | Promise<void>;
13
+ value: Value;
14
+ }
15
+ export interface RadioListDefaultProps<Value extends string | Record<any, any>> {
16
+ idProperty: Value extends string ? string : keyof Value;
17
+ labelProperty: Value extends string ? string : keyof Value;
18
+ }
19
+ export type RadioItem = {
20
+ disabled?: boolean;
21
+ } & Record<any, any>;
@@ -0,0 +1,4 @@
1
+ import { ResolutionAwareProp } from '../../../types/resolution-aware-prop.type';
2
+ export declare const useMediaLarge: () => boolean;
3
+ export declare const useMediaSmall: () => boolean;
4
+ export declare const useGetValueForSize: <Prop>(prop: ResolutionAwareProp<Prop>) => Prop;
@@ -0,0 +1 @@
1
+ export * from './get-value-for-size';
@@ -3,3 +3,4 @@ export { useId } from './useId';
3
3
  export { useIntersectionObserver } from './useIntersectionObserver';
4
4
  export { useParseDataAttributes } from './useParseDataAttributes';
5
5
  export { useViewportMeasures } from './useViewportMeasures';
6
+ export * from './get-value-for-size';