pixel-react 1.4.2 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/AddResourceButton/type.d.ts +1 -1
  3. package/lib/components/Drawer/Types.d.ts +4 -0
  4. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +13 -0
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +0 -13
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +29 -1
  7. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +3 -9
  8. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +2 -10
  9. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +0 -1
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +27 -2
  11. package/lib/components/Form/Forms.d.ts +4 -2
  12. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  13. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  14. package/lib/components/MenuOption/types.d.ts +49 -15
  15. package/lib/components/MiniModal/types.d.ts +1 -1
  16. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  17. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +4 -5
  18. package/lib/components/MultiSelect/dropdownTypes.d.ts +2 -0
  19. package/lib/components/RadioButton/RadioButton.d.ts +1 -0
  20. package/lib/components/RadioButton/radioButtonTypes.d.ts +3 -1
  21. package/lib/components/Select/components/types.d.ts +4 -2
  22. package/lib/components/Table/Table.d.ts +1 -1
  23. package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +10 -0
  24. package/lib/components/ToggleSwitch/index.d.ts +1 -0
  25. package/lib/index.d.ts +110 -24
  26. package/lib/index.esm.js +5732 -648
  27. package/lib/index.esm.js.map +1 -1
  28. package/lib/index.js +5728 -642
  29. package/lib/index.js.map +1 -1
  30. package/lib/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +11 -11
  32. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  33. package/src/assets/Themes/BaseTheme.scss +17 -23
  34. package/src/assets/Themes/DarkTheme.scss +25 -38
  35. package/src/assets/icons/apk_file_type.svg +4 -0
  36. package/src/assets/icons/compressed_file_type.svg +4 -0
  37. package/src/assets/icons/csv_file_type.svg +4 -0
  38. package/src/assets/icons/excel_corner_menu.svg +3 -0
  39. package/src/assets/icons/formula_icon.svg +3 -0
  40. package/src/assets/icons/gif_file_type.svg +4 -0
  41. package/src/assets/icons/html_file_type.svg +4 -0
  42. package/src/assets/icons/ipk_file_type.svg +4 -0
  43. package/src/assets/icons/jpg_file_type.svg +4 -0
  44. package/src/assets/icons/json_file_type.svg +4 -0
  45. package/src/assets/icons/pdf_file_type.svg +4 -0
  46. package/src/assets/icons/png_file_type.svg +4 -0
  47. package/src/assets/icons/quick_run_setting_icon.svg +5 -0
  48. package/src/assets/icons/run_automation_scripts_icon.svg +33 -0
  49. package/src/assets/icons/run_manual_testcase_icon.svg +4 -0
  50. package/src/assets/icons/search.svg +2 -2
  51. package/src/assets/icons/txt_file_type.svg +4 -0
  52. package/src/assets/icons/xls_file_type.svg +4 -0
  53. package/src/assets/icons/xlsx_file_type.svg +4 -0
  54. package/src/assets/icons/xml_file_type.svg +4 -0
  55. package/src/assets/styles/_fonts.scss +32 -2
  56. package/src/components/AddResourceButton/AddButton.tsx +7 -7
  57. package/src/components/AddResourceButton/type.ts +1 -1
  58. package/src/components/AttachmentButton/AttachmentButton.scss +1 -1
  59. package/src/components/AttachmentButton/AttachmentButton.stories.tsx +1 -0
  60. package/src/components/Button/Button.scss +22 -20
  61. package/src/components/Button/Button.tsx +8 -1
  62. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
  63. package/src/components/Drawer/Drawer.scss +4 -3
  64. package/src/components/Drawer/Drawer.tsx +14 -18
  65. package/src/components/Drawer/Types.ts +4 -0
  66. package/src/components/Editor/Editor.tsx +9 -11
  67. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +39 -0
  68. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +51 -0
  69. package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -8
  70. package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +35 -0
  71. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +44 -7
  72. package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -1
  73. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +45 -6
  74. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +37 -2
  75. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +69 -24
  76. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +59 -0
  77. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.ts +18 -65
  78. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.ts +5 -110
  79. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.ts +0 -2
  80. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +105 -1
  81. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +670 -673
  82. package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +38 -2
  83. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +0 -4
  84. package/src/components/FileDropzone/FileDropzone.scss +4 -2
  85. package/src/components/FileDropzone/FileDropzone.tsx +1 -1
  86. package/src/components/FileDropzone/FilePreview.tsx +3 -1
  87. package/src/components/Form/Form.scss +2 -0
  88. package/src/components/Form/Form.stories.tsx +195 -6
  89. package/src/components/Form/Forms.tsx +15 -8
  90. package/src/components/Icon/iconList.ts +46 -0
  91. package/src/components/IconRadioGroup/IconRadioGroup.scss +3 -0
  92. package/src/components/IconRadioGroup/IconRadioGroup.tsx +20 -17
  93. package/src/components/Input/Input.scss +14 -15
  94. package/src/components/Input/Input.stories.tsx +2 -1
  95. package/src/components/InputWithDropdown/InputWithDropdown.scss +12 -13
  96. package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +3 -2
  97. package/src/components/InputWithDropdown/InputWithDropdown.tsx +22 -19
  98. package/src/components/MenuOption/MenuOption.scss +11 -10
  99. package/src/components/MenuOption/MenuOption.stories.tsx +51 -232
  100. package/src/components/MenuOption/MenuOption.tsx +131 -52
  101. package/src/components/MenuOption/types.ts +55 -14
  102. package/src/components/MiniModal/MiniModal.stories.tsx +7 -6
  103. package/src/components/MiniModal/MiniModal.tsx +29 -23
  104. package/src/components/MiniModal/types.ts +1 -1
  105. package/src/components/MultiSelect/Dropdown.tsx +11 -12
  106. package/src/components/MultiSelect/MultiSelect.scss +1 -0
  107. package/src/components/MultiSelect/MultiSelect.stories.tsx +45 -10
  108. package/src/components/MultiSelect/MultiSelect.tsx +29 -13
  109. package/src/components/MultiSelect/MultiSelectTypes.ts +7 -5
  110. package/src/components/MultiSelect/dropdownTypes.ts +2 -0
  111. package/src/components/RadioButton/RadioButton.scss +3 -1
  112. package/src/components/RadioButton/RadioButton.tsx +3 -1
  113. package/src/components/RadioButton/radioButtonTypes.tsx +5 -1
  114. package/src/components/Search/Search.scss +25 -6
  115. package/src/components/Search/Search.tsx +45 -24
  116. package/src/components/Select/Select.scss +12 -12
  117. package/src/components/Select/Select.stories.tsx +2 -0
  118. package/src/components/Select/Select.tsx +11 -5
  119. package/src/components/Select/components/Dropdown.scss +2 -0
  120. package/src/components/Select/components/Dropdown.tsx +19 -4
  121. package/src/components/Select/components/types.ts +4 -2
  122. package/src/components/StatusButton/StatusButton.tsx +26 -20
  123. package/src/components/Table/Table.scss +1 -3
  124. package/src/components/Table/Table.stories.tsx +1 -0
  125. package/src/components/Table/Table.tsx +7 -3
  126. package/src/components/ToggleSwitch/ToggleSwitch.scss +59 -0
  127. package/src/components/ToggleSwitch/ToggleSwitch.stories.tsx +52 -0
  128. package/src/components/ToggleSwitch/ToggleSwitch.tsx +30 -0
  129. package/src/components/ToggleSwitch/index.ts +1 -0
  130. package/src/components/Typography/Typography.scss +32 -2
  131. package/src/hooks/useFileDropzone.tsx +1 -0
  132. package/src/index.ts +4 -2
  133. package/src/components/Excel/ContextMenu/ContextMenu.scss +0 -99
  134. package/src/components/Excel/ContextMenu/ContextMenu.tsx +0 -103
Binary file
@@ -49,7 +49,7 @@ export interface AddResourceButtonProps {
49
49
  * @property {boolean} isActive - Specifies if the button is in an active state (highlighted when selected).
50
50
  */
51
51
  export interface DirectionalArrowButtonProps {
52
- direction: string | 'top' | 'right' | 'down';
52
+ direction: 'top' | 'right' | 'down';
53
53
  menuOptions: {
54
54
  label: string;
55
55
  value: string | string[];
@@ -133,4 +133,8 @@ export interface DrawerProps {
133
133
  * Custom z-index for the secondary drawer
134
134
  */
135
135
  secondLayerZIndex?: boolean;
136
+ /**
137
+ * Custom top for the drawer
138
+ */
139
+ top?: string;
136
140
  }
@@ -0,0 +1,13 @@
1
+ import './ExcelContextMenu.scss';
2
+ import * as Matrix from '../ExcelFile/ExcelFileComponents/matrix';
3
+ import { CellBase, ContextMenuState } from '../ExcelFile/ExcelFileComponents/types';
4
+ type ExcelContextMenuProps = {
5
+ data: Matrix.Matrix<CellBase>;
6
+ contextMenu: ContextMenuState;
7
+ addRowTop: (data: Matrix.Matrix<CellBase>) => void;
8
+ addColumnLeft: (data: Matrix.Matrix<CellBase>) => void;
9
+ deleteRow: (data: Matrix.Matrix<CellBase>) => void;
10
+ deleteColumn: (data: Matrix.Matrix<CellBase>) => void;
11
+ };
12
+ declare const ExcelContextMenu: React.FC<ExcelContextMenuProps>;
13
+ export default ExcelContextMenu;
@@ -10,19 +10,6 @@ export type Props<CellType extends Types.CellBase> = {
10
10
  data: Matrix.Matrix<CellType>;
11
11
  /** Class name to be added to the spreadsheet's root element */
12
12
  className?: string;
13
- /**
14
- * Use dark colors that complement dark mode
15
- * @defaultValue `false`
16
- */
17
- /**
18
- * Function used to create the formula parser (instance of
19
- * "fast-formula-parser") used by the Spreadsheet by getting the spreadsheet's
20
- * data.
21
- * @defaultValue function which creates a formula parser bound to the
22
- * Spreadsheet's data.
23
- * @see `createFormulaParser`
24
- * @see https://www.npmjs.com/package/fast-formula-parser
25
- */
26
13
  createFormulaParser?: Types.CreateFormulaParser;
27
14
  /**
28
15
  * Labels to use in column indicators.
@@ -34,6 +34,10 @@ export declare const BORDER_TYPE = "BORDER_TYPE";
34
34
  export declare const COLOR = "COLOR";
35
35
  export declare const BACKGROUND_COLOR = "BACKGROUND_COLOR";
36
36
  export declare const FORMATE_PAINTER = "FORMATE_PAINTER";
37
+ export declare const ADD_ROW_TOP = "ADD_ROW_TOP";
38
+ export declare const ADD_COLUMN_LEFT = "ADD_COLUMN_LEFT";
39
+ export declare const DELETE_ROW = "DELETE_ROW";
40
+ export declare const DELETE_COLUMN = "DELETE_COLUMN";
37
41
  export type BaseAction<T extends string> = {
38
42
  type: T;
39
43
  };
@@ -106,6 +110,30 @@ export type FormatePainterStyle = BaseAction<typeof FORMATE_PAINTER> & {
106
110
  };
107
111
  };
108
112
  export declare function formatePainter(data: Matrix<CellBase>): FormatePainterStyle;
113
+ export type AddRowTop = BaseAction<typeof ADD_ROW_TOP> & {
114
+ payload: {
115
+ data: Matrix<CellBase>;
116
+ };
117
+ };
118
+ export declare function addRowTop(data: Matrix<CellBase>): AddRowTop;
119
+ export type AddColumnLeft = BaseAction<typeof ADD_COLUMN_LEFT> & {
120
+ payload: {
121
+ data: Matrix<CellBase>;
122
+ };
123
+ };
124
+ export declare function addColumnLeft(data: Matrix<CellBase>): AddColumnLeft;
125
+ export type DeleteRow = BaseAction<typeof DELETE_ROW> & {
126
+ payload: {
127
+ data: Matrix<CellBase>;
128
+ };
129
+ };
130
+ export declare function deleteRow(data: Matrix<CellBase>): DeleteRow;
131
+ export type DeleteColumn = BaseAction<typeof DELETE_COLUMN> & {
132
+ payload: {
133
+ data: Matrix<CellBase>;
134
+ };
135
+ };
136
+ export declare function deleteColumn(data: Matrix<CellBase>): DeleteColumn;
109
137
  export type SetDataAction = BaseAction<typeof SET_DATA> & {
110
138
  payload: {
111
139
  data: Matrix<CellBase>;
@@ -200,4 +228,4 @@ export type ClearAction = BaseAction<typeof CLEAR>;
200
228
  export declare function clear(): ClearAction;
201
229
  export type BlurAction = BaseAction<typeof BLUR>;
202
230
  export declare function blur(): BlurAction;
203
- export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction | UnderlineTypeStyle | FontSize | FontFamily | TextAlignType | BorderType | ItalicStyle | BoldStyle | ColorStyle | BackgroundStyle | FormatePainterStyle | BlurAction;
231
+ export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction | UnderlineTypeStyle | FontSize | FontFamily | TextAlignType | BorderType | ItalicStyle | BoldStyle | ColorStyle | BackgroundStyle | FormatePainterStyle | AddRowTop | AddColumnLeft | DeleteRow | DeleteColumn | BlurAction;
@@ -1,4 +1,3 @@
1
- import FormulaParser, { Value } from 'fast-formula-parser';
2
1
  import * as Matrix from '../matrix';
3
2
  import { Point } from '../point';
4
3
  import { CellBase, CreateFormulaParser } from '../types';
@@ -11,12 +10,7 @@ export declare class Model<Cell extends CellBase> {
11
10
  constructor(createFormulaParser: CreateFormulaParser, data: Matrix.Matrix<Cell>, referenceGraph?: PointGraph, evaluatedData?: Matrix.Matrix<Cell>);
12
11
  }
13
12
  export declare function updateCellValue<Cell extends CellBase>(model: Model<Cell>, point: Point, cell: Cell): Model<Cell>;
14
- /**
15
- *
16
- * @param data - the spreadsheet data
17
- * @returns the spreadsheet reference graph
18
- */
19
- export declare function createReferenceGraph(data: Matrix.Matrix<CellBase>): PointGraph;
20
- export declare function createEvaluatedData<Cell extends CellBase>(data: Matrix.Matrix<Cell>, referenceGraph: PointGraph, createFormulaParser: CreateFormulaParser): Matrix.Matrix<Cell>;
13
+ export declare function createReferenceGraph(): PointGraph;
14
+ export declare function createEvaluatedData<Cell extends CellBase>(data: Matrix.Matrix<Cell>, referenceGraph: PointGraph): Matrix.Matrix<Cell>;
21
15
  /** Get the computed value of a formula cell */
22
- export declare function getFormulaComputedValue(value: string, point: Point, formulaParser: FormulaParser): Value;
16
+ export declare function getFormulaComputedValue(): string;
@@ -1,17 +1,9 @@
1
- import FormulaParser, { FormulaParserConfig, Value } from 'fast-formula-parser';
2
- import { Point } from '../point';
3
1
  import * as Matrix from '../matrix';
4
2
  import { CellBase } from '../types';
5
- import { PointSet } from './point-set';
6
3
  export declare const FORMULA_VALUE_PREFIX = "=";
7
4
  /** Returns whether given value is a formula */
8
5
  export declare function isFormulaValue(value: unknown): value is string;
9
6
  /** Extracts formula from value */
10
7
  export declare function extractFormula(value: string): string;
11
- export declare function createFormulaParser(data: Matrix.Matrix<CellBase>, config?: Omit<FormulaParserConfig, 'onCell' | 'onRange'>): FormulaParser;
12
- /**
13
- * For given formula returns the cell references
14
- * @param formula - formula to get references for
15
- */
16
- export declare function getReferences(formula: string, point: Point, data: Matrix.Matrix<CellBase>): PointSet;
17
- export declare function evaluate(formula: string, point: Point, formulaParser: FormulaParser): Value;
8
+ export declare function createFormulaParser(data: Matrix.Matrix<CellBase>): Matrix.Matrix<CellBase>;
9
+ export declare function evaluate(): string;
@@ -13,7 +13,6 @@ export declare class PointGraph {
13
13
  get(node: Point): PointSet;
14
14
  getBackwards(node: Point): PointSet;
15
15
  getBackwardsRecursive(node: Point, visited?: PointSet): PointSet;
16
- /** Determine whether the graph has a circular dependency, starting from given start point */
17
16
  hasCircularDependency(startPoint: Point): boolean;
18
17
  [Symbol.iterator](): Iterator<[Point, PointSet]>;
19
18
  /** Get the points in the graph in a breadth-first order */
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import FormulaParser from 'fast-formula-parser';
3
2
  import { Point } from './point';
4
3
  import { Selection } from './selection';
5
4
  import { Model } from './engine';
6
5
  import { PointRange } from './point-range';
7
6
  import { Matrix } from './matrix';
7
+ import * as MatrixValue from './matrix';
8
8
  /** The base type of cell data in Spreadsheet */
9
9
  export type CellBase<Value = any> = {
10
10
  /** Whether the cell should not be editable */
@@ -54,6 +54,8 @@ export type StoreState<Cell extends CellBase = CellBase> = {
54
54
  dragging: boolean;
55
55
  lastChanged: Point | null;
56
56
  lastCommit: null | CellChange<Cell>[];
57
+ selectedRow: null | number;
58
+ selectedColumn: null | number;
57
59
  };
58
60
  export type CellChange<Cell extends CellBase = CellBase> = {
59
61
  prevCell: Cell | null;
@@ -89,6 +91,7 @@ export type CellComponentProps<Cell extends CellBase = CellBase> = {
89
91
  setCellDimensions: (point: Point, dimensions: Dimensions) => void;
90
92
  /** Set data of the cell */
91
93
  setCellData: (cell: Cell) => void;
94
+ setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
92
95
  };
93
96
  /** Type of the Spreadsheet Cell component */
94
97
  export type CellComponent<Cell extends CellBase = CellBase> = React.ComponentType<CellComponentProps<Cell>>;
@@ -143,6 +146,24 @@ export type RowIndicatorProps = {
143
146
  selected: boolean;
144
147
  /** Callback to be called when the row is selected */
145
148
  onSelect: (row: number, extend: boolean) => void;
149
+ setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
150
+ deleteRow: (data: MatrixValue.Matrix<CellBase>) => void;
151
+ addRowTop: (data: MatrixValue.Matrix<CellBase>) => void;
152
+ data: MatrixValue.Matrix<CellBase>;
153
+ };
154
+ export type ContextMenuState = {
155
+ open: boolean;
156
+ position: {
157
+ x: number;
158
+ y: number;
159
+ };
160
+ options: optionsType[];
161
+ };
162
+ type optionsType = {
163
+ label: string;
164
+ value: string;
165
+ iconName: string;
166
+ action: () => void;
146
167
  };
147
168
  /** Type of the RowIndicator component */
148
169
  export type RowIndicatorComponent = React.ComponentType<RowIndicatorProps>;
@@ -158,6 +179,10 @@ export type ColumnIndicatorProps = {
158
179
  fixed?: boolean;
159
180
  /** Callback to be called when the column is selected */
160
181
  onSelect: (column: number, extend: boolean) => void;
182
+ setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
183
+ deleteColumn: (data: MatrixValue.Matrix<CellBase>) => void;
184
+ addColumnLeft: (data: MatrixValue.Matrix<CellBase>) => void;
185
+ data: MatrixValue.Matrix<CellBase>;
161
186
  };
162
187
  /** Type of the ColumnIndicator component */
163
188
  export type ColumnIndicatorComponent = React.ComponentType<ColumnIndicatorProps>;
@@ -174,5 +199,5 @@ export type CommitChanges<Cell extends CellBase = CellBase> = Array<{
174
199
  prevCell: Cell | null;
175
200
  nextCell: Cell | null;
176
201
  }>;
177
- export type CreateFormulaParser = (data: Matrix<CellBase>) => FormulaParser;
202
+ export type CreateFormulaParser = (data: Matrix<CellBase>) => void;
178
203
  export {};
@@ -5,5 +5,7 @@ interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
5
5
  onSubmit: Form.SubmitHandler<T>;
6
6
  children: (methods: ReturnType<typeof Form.useForm<T>>) => React.ReactNode;
7
7
  }
8
- declare const Forms: <T extends Form.FieldValues>({ onSubmit, children, id, ...rest }: FormProps<T>) => import("react/jsx-runtime").JSX.Element;
9
- export default Forms;
8
+ declare const ForwardedForms: <T extends Form.FieldValues>(props: FormProps<T> & {
9
+ ref?: React.Ref<any>;
10
+ }) => JSX.Element;
11
+ export default ForwardedForms;
@@ -1,4 +1,4 @@
1
1
  import './InputWithDropdown.scss';
2
2
  import { InputWithDropdownProps } from './types';
3
- declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, autoComplete, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default InputWithDropdown;
@@ -1,4 +1,4 @@
1
1
  import './MenuOption.scss';
2
2
  import { MenuOptionProps } from './types';
3
- declare const MenuOption: ({ labelName, iconName, tooltipTitle, tooltipPlacement, options, dropdownPlacement, onClick, onOptionClick, iconButtonSize, iconButtonBorderRadius, iconSize, variant, zIndex, }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const MenuOption: ({ labelName, iconName, tooltipTitle, tooltipPlacement, options, onClick, onOptionClick, iconButtonSize, iconButtonBorderRadius, iconSize, variant, zIndex, dropdownPlacement, }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default MenuOption;
@@ -10,15 +10,17 @@ interface OptionClick {
10
10
  * @type {Array<string> | string}
11
11
  * @required
12
12
  */
13
- value: Array<string> | string;
13
+ value: any;
14
14
  }
15
15
  interface OptionType extends OptionClick {
16
16
  /**
17
17
  * The name of the icon associated with the option.
18
18
  * @type {string}
19
- * @required
19
+ * @optional
20
20
  */
21
21
  icon?: string;
22
+ iconColor?: string;
23
+ name?: string;
22
24
  /**
23
25
  * Indicates whether the option is disabled.
24
26
  * @type {boolean}
@@ -35,17 +37,47 @@ interface OptionCardProps {
35
37
  options: Array<OptionType>;
36
38
  /**
37
39
  * Callback function triggered when an option is clicked.
38
- * @param {any} data - The data associated with the clicked option.
40
+ * @param {OptionClick} data - The data associated with the clicked option.
39
41
  * @type {function}
40
42
  * @required
41
43
  */
42
- onClick: (data?: any) => void;
44
+ onClick: (data: OptionClick) => void;
43
45
  /**
44
46
  * Optional styles applied to the card.
45
47
  * @type {React.CSSProperties}
46
48
  * @optional
47
49
  */
48
50
  styles?: React.CSSProperties;
51
+ /**
52
+ * The z-index of the option card.
53
+ * @type {number}
54
+ * @optional
55
+ */
56
+ zIndex?: number;
57
+ /**
58
+ * The position of the menu relative to the triggering element.
59
+ * @type {dropdownPosition}
60
+ * @required
61
+ */
62
+ menuPosition: any;
63
+ /**
64
+ * Reference to the menu DOM element.
65
+ * @type {React.RefObject<HTMLElement>}
66
+ * @required
67
+ */
68
+ menuRef: React.RefObject<HTMLElement>;
69
+ /**
70
+ * Callback function to close the dropdown.
71
+ * @type {() => void}
72
+ * @required
73
+ */
74
+ closeDropdown: () => void;
75
+ /**
76
+ * Placement of the dropdown menu relative to the icon.
77
+ * @type {dropdownPosition}
78
+ * @optional
79
+ */
80
+ dropdownPosition?: 'top' | 'down' | 'left' | 'right';
49
81
  }
50
82
  interface MenuOptionProps {
51
83
  /**
@@ -80,27 +112,27 @@ interface MenuOptionProps {
80
112
  tooltipPlacement?: 'bottom' | 'left' | 'right' | 'top' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
81
113
  /**
82
114
  * The placement of the dropdown menu relative to the icon.
83
- * @type {'top' | 'left' | 'right' | 'bottom'}
115
+ * @type {dropdownPosition}
84
116
  * @optional
85
117
  */
86
- dropdownPlacement?: string | 'top' | 'left' | 'right' | 'down';
118
+ dropdownPlacement?: 'top' | 'down' | 'left' | 'right';
87
119
  /**
88
- * The variant of the menu option, either 'dark' or 'light'.
89
- * @type {'dark' | 'light'}
90
- * @default 'light'
91
- * @optional
92
- */
120
+ * The variant of the menu option, either 'dark' or 'light'.
121
+ * @type {'dark' | 'light'}
122
+ * @default 'light'
123
+ * @optional
124
+ */
93
125
  variant?: 'dark' | 'light';
94
126
  /**
95
127
  * Callback function triggered when the icon is clicked.
96
- * @type {function}
128
+ * @type {() => void}
97
129
  * @optional
98
130
  */
99
131
  onClick?: () => void;
100
132
  /**
101
133
  * Callback function triggered when an option is clicked.
102
134
  * @param {OptionClick} option - The option that was clicked.
103
- * @type {function}
135
+ * @type {(option: OptionClick) => void}
104
136
  * @optional
105
137
  */
106
138
  onOptionClick?: (option: OptionClick) => void;
@@ -117,13 +149,15 @@ interface MenuOptionProps {
117
149
  */
118
150
  iconSize?: number;
119
151
  /**
120
- * The border radius of the icon.
152
+ * The border radius of the icon button.
121
153
  * @type {number}
122
154
  * @default 7
123
155
  */
124
156
  iconButtonBorderRadius?: number;
125
157
  /**
126
158
  * Providing z-index for the options card.
159
+ * @type {number}
160
+ * @optional
127
161
  */
128
162
  zIndex?: number;
129
163
  }
@@ -137,7 +171,7 @@ interface OptionProps {
137
171
  /**
138
172
  * Callback function triggered when the option is clicked.
139
173
  * @param {OptionClick} option - The clicked option.
140
- * @type {function}
174
+ * @type {(option: OptionClick) => void}
141
175
  * @required
142
176
  */
143
177
  onClick: (option: OptionClick) => void;
@@ -9,7 +9,7 @@ export interface MiniEditModalProps {
9
9
  /**
10
10
  * A reference to the button element that triggers the modal.
11
11
  */
12
- anchorRef: RefObject<HTMLButtonElement>;
12
+ anchorRef: RefObject<HTMLButtonElement> | string;
13
13
  /**
14
14
  * Optional properties for configuring the modal header.
15
15
  */
@@ -1,4 +1,4 @@
1
1
  import './MultiSelect.scss';
2
2
  import { MultiSelectProps } from './MultiSelectTypes';
3
- declare const MultiSelect: ({ options, type, selectedOptions, onChange, acceptNewOption, zIndex, label, onSearch, required, disabled, errorMessage, displayCount, placeholderForSearching, variant, onLabelPlusIconClick, onManageLabelsClick, className, highlightedMachine, onSelectButtonClick, withSelectButton, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const MultiSelect: ({ options, type, selectedOptions, onChange, acceptNewOption, zIndex, label, onSearch, required, disabled, errorMessage, displayCount, placeholderForSearching, variant, onLabelPlusIconClick, onManageLabelsClick, className, highlightedMachine, onSelectButtonClick, labelAccessor, valueAccessor, withSelectButton, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default MultiSelect;
@@ -1,10 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
+ type OptionValue = any;
2
3
  interface Option {
3
- label?: string;
4
- value?: string;
5
- accessor?: string;
6
- isChecked?: boolean;
7
- isDisabled?: boolean;
4
+ [key: string]: OptionValue;
8
5
  }
9
6
  interface MultiSelectProps {
10
7
  options: Option[];
@@ -32,5 +29,7 @@ interface MultiSelectProps {
32
29
  className?: string;
33
30
  /** Machine Name to be displayed */
34
31
  highlightedMachine?: string | ReactElement;
32
+ labelAccessor?: string;
33
+ valueAccessor?: string;
35
34
  }
36
35
  export { Option, MultiSelectProps };
@@ -14,4 +14,6 @@ export interface DropdownProps {
14
14
  zIndex: number;
15
15
  withSelectButton?: boolean;
16
16
  onSelect?: () => void;
17
+ labelAccessor?: string;
18
+ valueAccessor?: string;
17
19
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import './RadioButton.scss';
3
+ import RadioButtonProps from './radioButtonTypes';
3
4
  declare const RadioButton: React.FC<RadioButtonProps>;
4
5
  export default RadioButton;
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  /**
2
3
  * Props for the RadioButton component.
3
4
  */
@@ -6,7 +7,7 @@ interface RadioButtonProps {
6
7
  * The display label for the radio button.
7
8
  * Optional.
8
9
  */
9
- label?: string;
10
+ label?: string | ReactElement;
10
11
  /**
11
12
  * The name attribute for the radio button, used for grouping.
12
13
  */
@@ -48,3 +49,4 @@ interface RadioButtonProps {
48
49
  */
49
50
  tooltipTitle?: React.ReactNode;
50
51
  }
52
+ export default RadioButtonProps;
@@ -1,4 +1,5 @@
1
1
  import { DrowdownPosition, Option } from '../types';
2
+ import { RefObject } from 'react';
2
3
  export interface DropdownProps {
3
4
  options: Option[];
4
5
  dropdownPosition: DrowdownPosition;
@@ -7,9 +8,10 @@ export interface DropdownProps {
7
8
  valueAccessor?: string;
8
9
  onSelectBlur: () => void;
9
10
  onSelectOptionSelector: (option: Option) => void;
10
- inputRef?: React.RefObject<HTMLInputElement>;
11
- selectArrowRef?: React.RefObject<HTMLDivElement>;
11
+ inputRef?: RefObject<HTMLInputElement>;
12
+ selectArrowRef?: RefObject<HTMLDivElement>;
12
13
  heightFromTop: number;
14
+ selectedOption?: Option;
13
15
  }
14
16
  export declare const dropdownDefaultCSSData: {
15
17
  margin: number;
@@ -1,4 +1,4 @@
1
1
  import './Table.scss';
2
2
  import { TableProps } from './Types';
3
- declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, noDataContent, height, className, tableHeadClass, tableBodyRowClass, headerTextColor, tableDataTextColor, headerIconName, headerIconOnClick, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, noDataContent, height, className, tableHeadClass, tableBodyRowClass, headerTextColor, tableDataTextColor, headerIconName, headerIconOnClick, }: TableProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Table;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./ToggleSwitch.scss";
3
+ interface ToggleSwitchProps {
4
+ firstButton: string;
5
+ secondButton: string;
6
+ handleClick: (selected: string) => void;
7
+ selected: string;
8
+ }
9
+ declare const ToggleSwitch: React.FC<ToggleSwitchProps>;
10
+ export default ToggleSwitch;
@@ -0,0 +1 @@
1
+ export { default } from './ToggleSwitch';