@innovaccer/design-system 4.18.0 → 4.19.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.
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import { BaseProps } from "../../../utils/types";
3
+ import { SegmentedControlValue, SegmentedControlSize } from "./SegmentedControlContext";
4
+ import { SegmentedControlItemProps } from "./SegmentedControlItem";
5
+ export type { SegmentedControlValue, SegmentedControlSize };
6
+ export interface SegmentedControlProps extends BaseProps {
7
+ activeIndex?: number;
8
+ onChange?: (index: number, value?: SegmentedControlValue) => void;
9
+ size?: SegmentedControlSize;
10
+ expanded?: boolean;
11
+ maxWidth?: string | number;
12
+ isEqualWidth?: boolean;
13
+ disabled?: boolean;
14
+ children: React.ReactElement<SegmentedControlItemProps> | React.ReactElement<SegmentedControlItemProps>[];
15
+ }
16
+ export declare const SegmentedControl: {
17
+ (props: SegmentedControlProps): React.JSX.Element | null;
18
+ displayName: string;
19
+ defaultProps: {
20
+ size: string;
21
+ expanded: boolean;
22
+ maxWidth: string;
23
+ isEqualWidth: boolean;
24
+ disabled: boolean;
25
+ };
26
+ Item: {
27
+ (props: SegmentedControlItemProps): React.JSX.Element | null;
28
+ defaultProps: {
29
+ disabled: boolean;
30
+ };
31
+ };
32
+ };
33
+ export default SegmentedControl;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export declare type SegmentedControlValue = React.ReactText;
3
+ export declare type SegmentedControlSize = 'small' | 'regular' | 'large';
4
+ export interface SegmentedControlContextValue {
5
+ size: SegmentedControlSize;
6
+ selectedIndex: number;
7
+ onSelect: (index: number, value?: SegmentedControlValue) => void;
8
+ index: number;
9
+ registerButtonRef?: (index: number, node: HTMLButtonElement | null) => void;
10
+ expanded?: boolean;
11
+ isEqualWidth?: boolean;
12
+ disabled?: boolean;
13
+ isTwoSegments?: boolean;
14
+ isConstrained?: boolean;
15
+ }
16
+ export declare const SegmentedControlContext: React.Context<SegmentedControlContextValue | null>;
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import { IconProps } from "../../../index.type";
3
+ import { IconType } from "../../../common.type";
4
+ import { BaseProps } from "../../../utils/types";
5
+ import { SegmentedControlValue } from "./SegmentedControlContext";
6
+ export interface SegmentedControlItemProps extends BaseProps {
7
+ children?: React.ReactNode;
8
+ label?: SegmentedControlValue;
9
+ icon?: IconProps['name'] | React.ReactNode;
10
+ iconType?: IconType;
11
+ tooltip?: string;
12
+ disabled?: boolean;
13
+ value?: SegmentedControlValue;
14
+ }
15
+ export declare const SegmentedControlItem: {
16
+ (props: SegmentedControlItemProps): React.JSX.Element | null;
17
+ defaultProps: {
18
+ disabled: boolean;
19
+ };
20
+ };
21
+ export default SegmentedControlItem;
@@ -0,0 +1,4 @@
1
+ export { default } from "./SegmentedControl";
2
+ export * from "./SegmentedControl";
3
+ export * from "./SegmentedControlItem";
4
+ export * from "./SegmentedControlContext";
@@ -0,0 +1,23 @@
1
+ export interface IndicatorDimensions {
2
+ left: number;
3
+ width: number;
4
+ top: number;
5
+ height: number;
6
+ }
7
+ export interface CalculateIndicatorPositionParams {
8
+ selectedButton: HTMLButtonElement;
9
+ container: HTMLDivElement;
10
+ selectedIndex: number;
11
+ totalChildren: number;
12
+ dividerRefs: Array<HTMLSpanElement | null>;
13
+ }
14
+ export declare const calculateIndicatorPosition: (params: CalculateIndicatorPositionParams) => IndicatorDimensions;
15
+ export interface MeasureButtonWidthsParams {
16
+ buttons: HTMLButtonElement[];
17
+ maxWidth?: string | number;
18
+ }
19
+ export interface MeasureButtonWidthsResult {
20
+ equalWidth: number | null;
21
+ isConstrained: boolean;
22
+ }
23
+ export declare const measureButtonWidths: (params: MeasureButtonWidthsParams) => MeasureButtonWidthsResult;
@@ -57,6 +57,12 @@ export declare type ColumnSchema = {
57
57
  hidden?: boolean;
58
58
  filters?: DropdownProps['options'];
59
59
  filterType?: 'singleSelect' | 'multiSelect';
60
+ filterOptions?: {
61
+ selectionType?: 'singleSelect' | 'multiSelect';
62
+ minWidth?: number | string;
63
+ maxWidth?: number | string;
64
+ maxVisibleSelection?: number;
65
+ };
60
66
  onFilterChange?: onFilterChangeFunction;
61
67
  translate?: (data: RowData) => RowData;
62
68
  cellType?: CellType;
@@ -12,6 +12,8 @@ export interface SelectTriggerProps extends BaseProps {
12
12
  withClearButton?: boolean;
13
13
  onClear?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
14
14
  setLabel?: (count: number) => string | undefined;
15
+ minWidth?: number | string;
16
+ maxWidth?: number | string;
15
17
  }
16
18
  declare const SelectTrigger: {
17
19
  (props: SelectTriggerProps): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import { OptionType } from "../../../common.type";
3
+ import { ColumnSchema } from "../grid/Grid";
4
+ export interface FilterSelectProps {
5
+ name: ColumnSchema['name'];
6
+ displayName: string;
7
+ filters: OptionType[];
8
+ filterList: Record<string, any[]>;
9
+ onChange: (name: string, selected: any[]) => void;
10
+ filterOptions?: {
11
+ selectionType?: 'singleSelect' | 'multiSelect';
12
+ minWidth?: number | string;
13
+ maxWidth?: number | string;
14
+ maxVisibleSelection?: number;
15
+ };
16
+ filterType?: 'singleSelect' | 'multiSelect';
17
+ className?: string;
18
+ customTrigger?: React.ReactElement;
19
+ }
20
+ export declare const FilterSelect: React.FC<FilterSelectProps>;
21
+ export default FilterSelect;
@@ -97,6 +97,7 @@ export { Menu } from "./components/organisms/menu";
97
97
  export { KeyValuePair } from "./components/molecules/keyValuePair";
98
98
  export { Chat } from "./components/molecules/chat";
99
99
  export { Meter } from "./components/atoms/meter";
100
+ export { SegmentedControl } from "./components/atoms/segmentedControl";
100
101
  export { AIButton } from "./ai-components/AIButton";
101
102
  export { SaraSparkle } from "./ai-components/SaraSparkle";
102
103
  export { Sara } from "./ai-components/Sara";
@@ -102,6 +102,7 @@ export { UnreadMessageProps } from "./components/molecules/chat/unreadMessage";
102
102
  export { NewMessageProps } from "./components/molecules/chat/newMessage";
103
103
  export { TypingIndicatorProps } from "./components/molecules/chat/typingIndicator";
104
104
  export { MeterProps } from "./components/atoms/meter";
105
+ export { SegmentedControlProps, SegmentedControlItemProps } from "./components/atoms/segmentedControl";
105
106
  export { SaraSparkleProps } from "./ai-components/SaraSparkle";
106
107
  export { AIButtonProps } from "./ai-components/AIButton";
107
108
  export { SaraProps } from "./ai-components/Sara";