pixel-react 1.1.9 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/lib/components/AppHeader/types.d.ts +7 -7
  2. package/lib/components/Drawer/Drawer.stories.d.ts +2 -0
  3. package/lib/components/Drawer/Types.d.ts +11 -0
  4. package/lib/components/Icon/Icon.stories.d.ts +1 -0
  5. package/lib/components/Icon/types.d.ts +1 -0
  6. package/lib/components/InputWithDropdown/types.d.ts +1 -1
  7. package/lib/components/LabelEditTextField/LabelEditTextField.d.ts +5 -0
  8. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +11 -0
  9. package/lib/components/LabelEditTextField/index.d.ts +1 -0
  10. package/lib/components/LabelEditTextField/types.d.ts +38 -0
  11. package/lib/components/Select/Select.d.ts +1 -1
  12. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +1 -1
  13. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +2 -0
  14. package/lib/components/Select/types.d.ts +11 -4
  15. package/lib/components/Table/Table.d.ts +1 -1
  16. package/lib/components/Table/Table.stories.d.ts +2 -0
  17. package/lib/components/Table/Types.d.ts +16 -0
  18. package/lib/index.d.ts +92 -16
  19. package/lib/index.esm.js +399 -152
  20. package/lib/index.esm.js.map +1 -1
  21. package/lib/index.js +399 -151
  22. package/lib/index.js.map +1 -1
  23. package/lib/tsconfig.tsbuildinfo +1 -1
  24. package/lib/utils/getSelectOptionValue/getSelectOptionValue.d.ts +8 -0
  25. package/package.json +1 -1
  26. package/src/assets/Themes/BaseTheme.scss +10 -0
  27. package/src/assets/Themes/DarkTheme.scss +19 -7
  28. package/src/assets/icons/eye_closed.svg +3 -0
  29. package/src/components/AppHeader/AppHeader.scss +14 -3
  30. package/src/components/AppHeader/AppHeader.stories.tsx +28 -28
  31. package/src/components/AppHeader/AppHeader.tsx +11 -11
  32. package/src/components/AppHeader/types.ts +7 -7
  33. package/src/components/Button/Button.scss +1 -0
  34. package/src/components/Checkbox/Checkbox.tsx +1 -1
  35. package/src/components/Drawer/Drawer.scss +13 -10
  36. package/src/components/Drawer/Drawer.stories.tsx +28 -0
  37. package/src/components/Drawer/Drawer.tsx +30 -7
  38. package/src/components/Drawer/Types.ts +11 -0
  39. package/src/components/Icon/Icon.stories.tsx +27 -0
  40. package/src/components/Icon/Icon.tsx +5 -1
  41. package/src/components/Icon/Icons.scss +14 -2
  42. package/src/components/Icon/iconList.ts +2 -0
  43. package/src/components/Icon/types.ts +1 -0
  44. package/src/components/InputWithDropdown/types.ts +1 -1
  45. package/src/components/LabelEditTextField/LabelEditTextField.scss +85 -0
  46. package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +136 -0
  47. package/src/components/LabelEditTextField/LabelEditTextField.tsx +207 -0
  48. package/src/components/LabelEditTextField/index.ts +1 -0
  49. package/src/components/LabelEditTextField/types.ts +38 -0
  50. package/src/components/Modal/Modal.tsx +8 -1
  51. package/src/components/Modal/modal.scss +10 -2
  52. package/src/components/Select/Select.stories.tsx +5 -3
  53. package/src/components/Select/Select.tsx +13 -5
  54. package/src/components/Select/components/Dropdown/Dropdown.tsx +3 -1
  55. package/src/components/Select/components/Dropdown/dropdownTypes.ts +3 -0
  56. package/src/components/Select/types.ts +12 -5
  57. package/src/components/Table/Table.scss +16 -4
  58. package/src/components/Table/Table.stories.tsx +36 -12
  59. package/src/components/Table/Table.tsx +33 -16
  60. package/src/components/Table/Types.ts +121 -105
  61. package/src/index.ts +2 -0
  62. package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +31 -0
@@ -14,17 +14,17 @@ export interface AppHeaderProps {
14
14
  onQuickMenuClick?: (text: any) => void;
15
15
  }
16
16
  export interface appHeaderMenuItemProps {
17
- menuLabel: string;
18
- menuName?: string;
17
+ label: string;
18
+ path?: string;
19
19
  subMenuItems?: appHeaderSubMenuItemProps[];
20
20
  }
21
21
  export interface appHeaderSubMenuItemProps {
22
- subMenuLabel: string;
23
- subMenuName?: string;
22
+ label: string;
23
+ path?: string;
24
24
  quickMenuItems?: appHeaderQuickMenuItemProps[];
25
25
  }
26
26
  export interface appHeaderQuickMenuItemProps {
27
- quickMenuLabel?: string;
28
- quickMenuName?: string;
29
- quickMenuIconName: string;
27
+ label?: string;
28
+ path?: string;
29
+ iconName: string;
30
30
  }
@@ -7,4 +7,6 @@ export declare const Default: Story;
7
7
  export declare const WithoutHeader: Story;
8
8
  export declare const WithCustomHeader: Story;
9
9
  export declare const WithCustomFooter: Story;
10
+ export declare const WithTertiaryButtons: Story;
11
+ export declare const WithCustomZIndex: Story;
10
12
  export declare const Controlled: Story;
@@ -106,4 +106,15 @@ export interface DrawerProps {
106
106
  * If provided, this will render in place of the default footer.
107
107
  */
108
108
  customFooter?: ReactNode;
109
+ /**
110
+ * Tertiary button properties (optional)
111
+ */
112
+ tertiaryButtonProps?: {
113
+ left?: BtnPropsCommon;
114
+ right?: BtnPropsCommon;
115
+ };
116
+ /**
117
+ * Custom z-index for the drawer
118
+ */
119
+ zIndex?: number;
109
120
  }
@@ -4,4 +4,5 @@ declare const meta: Meta<typeof Icon>;
4
4
  type Story = StoryObj<typeof Icon>;
5
5
  export declare const Icons: Story;
6
6
  export declare const AllIcons: Story;
7
+ export declare const DarkVariantIcons: Story;
7
8
  export default meta;
@@ -7,4 +7,5 @@ export interface IconProps {
7
7
  onClick?: (data?: any) => void;
8
8
  hoverEffect?: boolean;
9
9
  disabled?: boolean;
10
+ variant?: "dark" | "light";
10
11
  }
@@ -59,7 +59,7 @@ export interface InputWithDropdownProps {
59
59
  /**
60
60
  * onChange handler for dropdown changes
61
61
  */
62
- onDropdownChangeHandler?: (option: Option) => void;
62
+ onDropdownChangeHandler?: (option: any) => void;
63
63
  /**
64
64
  * onInputBlurHandler action for input field
65
65
  */
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import './LabelEditTextField.scss';
3
+ import { LabelEditTextFieldTypes } from './types';
4
+ declare const LabelEditTextField: FC<LabelEditTextFieldTypes>;
5
+ export default LabelEditTextField;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import LabelEditTextField from './LabelEditTextField';
3
+ import '../../assets/styles/_colors.scss';
4
+ import './LabelEditTextField.scss';
5
+ declare const meta: Meta<typeof LabelEditTextField>;
6
+ type Story = StoryObj<typeof LabelEditTextField>;
7
+ export declare const textField: Story;
8
+ export declare const textFieldWithOutLabel: Story;
9
+ export declare const textFieldWithDropdown: Story;
10
+ export declare const textFieldWithHighlight: Story;
11
+ export default meta;
@@ -0,0 +1 @@
1
+ export { default } from './LabelEditTextField';
@@ -0,0 +1,38 @@
1
+ export interface IconProps {
2
+ /** Name of the icon to be displayed. */
3
+ name: string;
4
+ /** Optional click handler function for the icon. */
5
+ onClick?: () => void;
6
+ }
7
+ export interface DropdownOption {
8
+ /** Unique identifier for the dropdown option. */
9
+ id: number;
10
+ /** Value associated with the dropdown option. */
11
+ value: string;
12
+ /** Label displayed for the dropdown option. */
13
+ label: string;
14
+ }
15
+ export interface LabelEditTextFieldTypes {
16
+ /** Label text displayed above the input field. */
17
+ label?: string;
18
+ /** Initial text displayed in the input field. */
19
+ text: string;
20
+ /** Text to be highlighted within the displayed text, if provided. */
21
+ highlightText?: string;
22
+ /** Custom error message to be displayed, if applicable. */
23
+ customError?: string;
24
+ /** Confirm icon properties including icon name and click handler. */
25
+ confirmIcon?: IconProps;
26
+ /** Cancel icon properties including icon name and click handler. */
27
+ cancelIcon?: IconProps;
28
+ /** Type of input field - standard text field or text field with a dropdown. */
29
+ variant?: 'textFieldWithDropdown' | 'textField';
30
+ /** Array of dropdown options used if the dropdown variant is selected. */
31
+ dropdownData?: DropdownOption[];
32
+ /** Width of the input field component. */
33
+ width?: string;
34
+ /** Height of the input field component. */
35
+ height?: string;
36
+ /** Function called when confirming input changes, with input and dropdown values as arguments. */
37
+ confirmAction?: (inputValue: string, dropdownValue: string) => void;
38
+ }
@@ -1,4 +1,4 @@
1
1
  import { SelectProps } from './types';
2
2
  import './Select.scss';
3
- declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, labelAccessor, valueAccessor, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Select;
@@ -1,4 +1,4 @@
1
1
  import { DropDownListProps } from './dropdownTypes';
2
2
  import './Dropdown.scss';
3
- declare const Dropdown: ({ onSelectBlur, onSelectOptionSelector, dropdownPosition, options, optionZIndex, inputRef, }: DropDownListProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const Dropdown: ({ onSelectBlur, onSelectOptionSelector, dropdownPosition, options, optionZIndex, inputRef, labelAccessor, }: DropDownListProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Dropdown;
@@ -6,6 +6,8 @@ export interface DropDownListProps {
6
6
  options?: Option[];
7
7
  optionZIndex?: number;
8
8
  inputRef?: React.RefObject<HTMLInputElement>;
9
+ labelAccessor?: string;
10
+ valueAccessor?: string;
9
11
  }
10
12
  export declare const dropdownDefaultCSSData: {
11
13
  margin: number;
@@ -1,4 +1,3 @@
1
- import { ReactNode } from 'react';
2
1
  export interface SelectProps {
3
2
  label?: string;
4
3
  showLabel?: boolean;
@@ -20,6 +19,14 @@ export interface SelectProps {
20
19
  * selectedOptionColor prop provides the custom color for the selected option
21
20
  */
22
21
  selectedOptionColor?: string;
22
+ /**
23
+ * Label accessor
24
+ */
25
+ labelAccessor?: string;
26
+ /**
27
+ * Value accessor
28
+ */
29
+ valueAccessor?: string;
23
30
  }
24
31
  export interface DrowdownPosition {
25
32
  positionX: number;
@@ -69,8 +76,8 @@ export type SelectAction = {
69
76
  option: Option['value'];
70
77
  };
71
78
  };
79
+ type OptionValue = any;
72
80
  export interface Option {
73
- label: string | ReactNode;
74
- value: string;
75
- disabled?: boolean;
81
+ [key: string]: OptionValue;
76
82
  }
83
+ export {};
@@ -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, height, className, tableHeadClass, tableBodyRowClass, }: 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 | null;
4
4
  export default Table;
@@ -3,6 +3,8 @@ import Table from './Table';
3
3
  declare const meta: Meta<typeof Table>;
4
4
  type Story = StoryObj<typeof Table>;
5
5
  export declare const Default: Story;
6
+ export declare const PrimaryHeaderTextColor: Story;
7
+ export declare const TableDataTextColor: Story;
6
8
  export declare const PageTable: Story;
7
9
  export declare const PrimaryHeader: Story;
8
10
  export declare const FixedHeaderWithBorder: Story;
@@ -103,4 +103,20 @@ export interface TableProps {
103
103
  * classNames for the table Row container
104
104
  */
105
105
  tableBodyRowClass?: string;
106
+ /**
107
+ * custom color for the column text
108
+ */
109
+ headerTextColor?: 'default' | 'primary';
110
+ /**
111
+ * custom color for the row text
112
+ */
113
+ tableDataTextColor?: string;
114
+ /**
115
+ * icon for the table header, for expand or other purposes
116
+ */
117
+ headerIconName?: string;
118
+ /**
119
+ * handle function for the table header icon
120
+ */
121
+ headerIconOnClick?: () => void;
106
122
  }
package/lib/index.d.ts CHANGED
@@ -179,11 +179,22 @@ interface DrawerProps {
179
179
  * If provided, this will render in place of the default footer.
180
180
  */
181
181
  customFooter?: ReactNode;
182
+ /**
183
+ * Tertiary button properties (optional)
184
+ */
185
+ tertiaryButtonProps?: {
186
+ left?: BtnPropsCommon;
187
+ right?: BtnPropsCommon;
188
+ };
189
+ /**
190
+ * Custom z-index for the drawer
191
+ */
192
+ zIndex?: number;
182
193
  }
183
194
 
184
195
  declare const Drawer: FC<DrawerProps>;
185
196
 
186
- interface IconProps {
197
+ interface IconProps$1 {
187
198
  name: string;
188
199
  className?: string;
189
200
  height?: number;
@@ -192,9 +203,10 @@ interface IconProps {
192
203
  onClick?: (data?: any) => void;
193
204
  hoverEffect?: boolean;
194
205
  disabled?: boolean;
206
+ variant?: "dark" | "light";
195
207
  }
196
208
 
197
- declare const Icon: React$1.ForwardRefExoticComponent<IconProps & React$1.RefAttributes<HTMLSpanElement>>;
209
+ declare const Icon: React$1.ForwardRefExoticComponent<IconProps$1 & React$1.RefAttributes<HTMLSpanElement>>;
198
210
 
199
211
  interface AccordionProps {
200
212
  /**
@@ -610,14 +622,21 @@ interface SelectProps$1 {
610
622
  * selectedOptionColor prop provides the custom color for the selected option
611
623
  */
612
624
  selectedOptionColor?: string;
625
+ /**
626
+ * Label accessor
627
+ */
628
+ labelAccessor?: string;
629
+ /**
630
+ * Value accessor
631
+ */
632
+ valueAccessor?: string;
613
633
  }
634
+ type OptionValue = any;
614
635
  interface Option$2 {
615
- label: string | ReactNode;
616
- value: string;
617
- disabled?: boolean;
636
+ [key: string]: OptionValue;
618
637
  }
619
638
 
620
- declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, }: SelectProps$1) => react_jsx_runtime.JSX.Element;
639
+ declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, labelAccessor, valueAccessor, }: SelectProps$1) => react_jsx_runtime.JSX.Element;
621
640
 
622
641
  interface TextareaProps {
623
642
  /**
@@ -925,9 +944,25 @@ interface TableProps {
925
944
  * classNames for the table Row container
926
945
  */
927
946
  tableBodyRowClass?: string;
947
+ /**
948
+ * custom color for the column text
949
+ */
950
+ headerTextColor?: 'default' | 'primary';
951
+ /**
952
+ * custom color for the row text
953
+ */
954
+ tableDataTextColor?: string;
955
+ /**
956
+ * icon for the table header, for expand or other purposes
957
+ */
958
+ headerIconName?: string;
959
+ /**
960
+ * handle function for the table header icon
961
+ */
962
+ headerIconOnClick?: () => void;
928
963
  }
929
964
 
930
- declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, height, className, tableHeadClass, tableBodyRowClass, }: TableProps) => react_jsx_runtime.JSX.Element | null;
965
+ declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, noDataContent, height, className, tableHeadClass, tableBodyRowClass, headerTextColor, tableDataTextColor, headerIconName, headerIconOnClick, }: TableProps) => react_jsx_runtime.JSX.Element | null;
931
966
 
932
967
  /**
933
968
  * Props for the Add Resource Button component.
@@ -1167,7 +1202,7 @@ interface InputWithDropdownProps {
1167
1202
  /**
1168
1203
  * onChange handler for dropdown changes
1169
1204
  */
1170
- onDropdownChangeHandler?: (option: Option$1) => void;
1205
+ onDropdownChangeHandler?: (option: any) => void;
1171
1206
  /**
1172
1207
  * onInputBlurHandler action for input field
1173
1208
  */
@@ -1610,19 +1645,19 @@ interface AppHeaderProps {
1610
1645
  onQuickMenuClick?: (text: any) => void;
1611
1646
  }
1612
1647
  interface appHeaderMenuItemProps {
1613
- menuLabel: string;
1614
- menuName?: string;
1648
+ label: string;
1649
+ path?: string;
1615
1650
  subMenuItems?: appHeaderSubMenuItemProps[];
1616
1651
  }
1617
1652
  interface appHeaderSubMenuItemProps {
1618
- subMenuLabel: string;
1619
- subMenuName?: string;
1653
+ label: string;
1654
+ path?: string;
1620
1655
  quickMenuItems?: appHeaderQuickMenuItemProps[];
1621
1656
  }
1622
1657
  interface appHeaderQuickMenuItemProps {
1623
- quickMenuLabel?: string;
1624
- quickMenuName?: string;
1625
- quickMenuIconName: string;
1658
+ label?: string;
1659
+ path?: string;
1660
+ iconName: string;
1626
1661
  }
1627
1662
 
1628
1663
  declare const AppHeader: React.FC<AppHeaderProps>;
@@ -1812,6 +1847,47 @@ interface AttachmentUploaderProps {
1812
1847
 
1813
1848
  declare const AttachmentButton: React__default.FC<AttachmentUploaderProps>;
1814
1849
 
1850
+ interface IconProps {
1851
+ /** Name of the icon to be displayed. */
1852
+ name: string;
1853
+ /** Optional click handler function for the icon. */
1854
+ onClick?: () => void;
1855
+ }
1856
+ interface DropdownOption {
1857
+ /** Unique identifier for the dropdown option. */
1858
+ id: number;
1859
+ /** Value associated with the dropdown option. */
1860
+ value: string;
1861
+ /** Label displayed for the dropdown option. */
1862
+ label: string;
1863
+ }
1864
+ interface LabelEditTextFieldTypes {
1865
+ /** Label text displayed above the input field. */
1866
+ label?: string;
1867
+ /** Initial text displayed in the input field. */
1868
+ text: string;
1869
+ /** Text to be highlighted within the displayed text, if provided. */
1870
+ highlightText?: string;
1871
+ /** Custom error message to be displayed, if applicable. */
1872
+ customError?: string;
1873
+ /** Confirm icon properties including icon name and click handler. */
1874
+ confirmIcon?: IconProps;
1875
+ /** Cancel icon properties including icon name and click handler. */
1876
+ cancelIcon?: IconProps;
1877
+ /** Type of input field - standard text field or text field with a dropdown. */
1878
+ variant?: 'textFieldWithDropdown' | 'textField';
1879
+ /** Array of dropdown options used if the dropdown variant is selected. */
1880
+ dropdownData?: DropdownOption[];
1881
+ /** Width of the input field component. */
1882
+ width?: string;
1883
+ /** Height of the input field component. */
1884
+ height?: string;
1885
+ /** Function called when confirming input changes, with input and dropdown values as arguments. */
1886
+ confirmAction?: (inputValue: string, dropdownValue: string) => void;
1887
+ }
1888
+
1889
+ declare const LabelEditTextField: FC<LabelEditTextFieldTypes>;
1890
+
1815
1891
  type valueType$1 = any;
1816
1892
  declare const checkEmpty: (value: valueType$1) => boolean;
1817
1893
 
@@ -1859,4 +1935,4 @@ declare const throttle: (func: Callback, limit: number) => ThrottledFunction;
1859
1935
 
1860
1936
  declare const truncateText: (text: string, maxLength: number) => string;
1861
1937
 
1862
- export { Accordion, AddButton as AddResourceButton, AllProjectsDropdown, AppHeader, AttachmentButton, Button, Checkbox, Chip, Col, Container, DashboardDonutChart, CustomDatePicker as DatePicker, DonutChart, DragAndDrop, Drawer, ExpandableMenu, FileDropzone, Form, HighlightText, Icon, IconButton, IconRadioGroup, Input, InputWithDropdown, MachineInputField, MenuOption, MiniModal, Modal, MultiSelect, NlpInput as NLPInput, Paper, PieChart, RadialChart, RadioButton, RadioGroup, Recaptcha, Row, Search, Select, SequentialConnectingBranch, StateDropdown, StatusButton, Table, TableTree, Tabs, Textarea as TextArea, ThemeProvider, Toaster, Toggle, Tooltip, Typography, VariableInput, checkEmpty, compareArrays, compareObjects, debounce, ffid, findAndInsert, getEncryptedData, getExtension, getExtensionWithPeriod, throttle, truncateText, useTheme };
1938
+ export { Accordion, AddButton as AddResourceButton, AllProjectsDropdown, AppHeader, AttachmentButton, Button, Checkbox, Chip, Col, Container, DashboardDonutChart, CustomDatePicker as DatePicker, DonutChart, DragAndDrop, Drawer, ExpandableMenu, FileDropzone, Form, HighlightText, Icon, IconButton, IconRadioGroup, Input, InputWithDropdown, LabelEditTextField, MachineInputField, MenuOption, MiniModal, Modal, MultiSelect, NlpInput as NLPInput, Paper, PieChart, RadialChart, RadioButton, RadioGroup, Recaptcha, Row, Search, Select, SequentialConnectingBranch, StateDropdown, StatusButton, Table, TableTree, Tabs, Textarea as TextArea, ThemeProvider, Toaster, Toggle, Tooltip, Typography, VariableInput, checkEmpty, compareArrays, compareObjects, debounce, ffid, findAndInsert, getEncryptedData, getExtension, getExtensionWithPeriod, throttle, truncateText, useTheme };