pixel-react 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/lib/assets/utils/functionUtils.d.ts +3 -0
  2. package/lib/components/DatePicker/DatePicker.d.ts +5 -0
  3. package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
  4. package/lib/components/DatePicker/Timepicker.d.ts +4 -0
  5. package/lib/components/DatePicker/index.d.ts +1 -0
  6. package/lib/components/DatePicker/types.d.ts +81 -0
  7. package/lib/components/IconButton/IconButton.d.ts +5 -0
  8. package/lib/components/IconButton/IconButton.stories.d.ts +6 -0
  9. package/lib/components/IconButton/index.d.ts +1 -0
  10. package/lib/components/IconButton/types.d.ts +5 -0
  11. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  12. package/lib/components/InputWithDropdown/types.d.ts +3 -7
  13. package/lib/components/TableTree/TableTree.d.ts +1 -1
  14. package/lib/index.d.ts +65 -14
  15. package/lib/index.esm.js +8536 -227
  16. package/lib/index.esm.js.map +1 -1
  17. package/lib/index.js +8539 -229
  18. package/lib/index.js.map +1 -1
  19. package/lib/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +3 -1
  21. package/src/assets/Themes/BaseTheme.scss +7 -0
  22. package/src/assets/Themes/DarkTheme.scss +7 -1
  23. package/src/assets/icons/add_variable_icon.svg +5 -0
  24. package/src/assets/icons/calendar_icon.svg +9 -0
  25. package/src/assets/icons/clock_icon.svg +11 -0
  26. package/src/assets/icons/info_icon.svg +4 -0
  27. package/src/assets/icons/left_arrow_icon.svg +3 -0
  28. package/src/assets/icons/right_arrow_icon.svg +4 -0
  29. package/src/assets/styles/_mixins.scss +1 -0
  30. package/src/assets/utils/functionUtils.ts +37 -0
  31. package/src/components/DatePicker/DatePicker.scss +387 -0
  32. package/src/components/DatePicker/DatePicker.stories.tsx +161 -0
  33. package/src/components/DatePicker/DatePicker.tsx +438 -0
  34. package/src/components/DatePicker/Timepicker.tsx +372 -0
  35. package/src/components/DatePicker/index.ts +1 -0
  36. package/src/components/DatePicker/types.ts +100 -0
  37. package/src/components/Drawer/Drawer.scss +0 -1
  38. package/src/components/Drawer/Drawer.tsx +10 -14
  39. package/src/components/Icon/iconList.ts +17 -9
  40. package/src/components/{AddButton/AddButton.scss → IconButton/IconButton.scss} +6 -2
  41. package/src/components/IconButton/IconButton.stories.tsx +25 -0
  42. package/src/components/{AddButton/AddButton.tsx → IconButton/IconButton.tsx} +10 -7
  43. package/src/components/IconButton/index.ts +1 -0
  44. package/src/components/{AddButton → IconButton}/types.ts +3 -2
  45. package/src/components/InputWithDropdown/InputWithDropdown.scss +1 -1
  46. package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +10 -13
  47. package/src/components/InputWithDropdown/InputWithDropdown.tsx +10 -8
  48. package/src/components/InputWithDropdown/types.ts +4 -7
  49. package/src/components/RadioButton/RadioButton.scss +3 -3
  50. package/src/components/Select/Select.scss +1 -1
  51. package/src/components/TableTree/TableTree.tsx +4 -0
  52. package/src/index.ts +5 -2
  53. package/src/assets/icons/expired_license_icon.svg +0 -3
  54. package/src/assets/icons/expiringSoon_license_icon.svg +0 -3
  55. package/src/components/AddButton/AddButton.stories.tsx +0 -24
  56. package/src/components/AddButton/index.ts +0 -1
@@ -1 +1,4 @@
1
1
  export declare const isFunction: (functionToCheck: any) => any;
2
+ export declare const convertTo24Hour: (time12h: string) => string;
3
+ export declare const convertTo12Hour: (time24: string) => string;
4
+ export declare const isValid12HourTime: (timeString: string) => boolean;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './DatePicker.scss';
3
+ import { DatePickerProps } from './types';
4
+ declare const CustomDatePicker: React.FC<DatePickerProps>;
5
+ export default CustomDatePicker;
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import CustomDatePicker from './DatePicker';
3
+ declare const meta: Meta<typeof CustomDatePicker>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CustomDatePicker>;
6
+ export declare const Default: Story;
7
+ export declare const StartDateFilter: Story;
8
+ export declare const EndDateInput: Story;
9
+ export declare const ScheduleDateInput: Story;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TimePickerProps } from './types';
3
+ declare const TimePicker: React.FC<TimePickerProps>;
4
+ export default TimePicker;
@@ -0,0 +1 @@
1
+ export { default } from './DatePicker';
@@ -0,0 +1,81 @@
1
+ export interface DatePickerProps {
2
+ /**
3
+ * The minimum selectable date.
4
+ */
5
+ minDate?: DateValue;
6
+ /**
7
+ * The maximum selectable date.
8
+ */
9
+ maxDate?: DateValue;
10
+ /**
11
+ * Selected date value.
12
+ */
13
+ value?: DateValue;
14
+ /**
15
+ * Function to handle date selection.
16
+ */
17
+ onChange: (value: DateValue) => void;
18
+ /**
19
+ * Placeholder text for the input field.
20
+ */
21
+ placeholder?: string;
22
+ /**
23
+ * Disables the date picker.
24
+ */
25
+ disabled?: boolean;
26
+ /**
27
+ * Format for displaying the selected date. Default is 'EEEE, dd MMM yyyy'.
28
+ */
29
+ dateFormat?: string;
30
+ /**
31
+ * Format for displaying the selected time. Default is 'hh:mm a'.
32
+ */
33
+ timeFormat?: string;
34
+ /**
35
+ * Timezone for the date picker.
36
+ */
37
+ timezone?: string;
38
+ /**
39
+ * Custom width for the calendar. This will override the default width of the calendar.
40
+ */
41
+ calendarWidth?: number;
42
+ /**
43
+ * When true, displays the input field error.
44
+ */
45
+ error?: boolean;
46
+ /**
47
+ * Helper text to display below the input field, used for error messages or instructions.
48
+ */
49
+ helperText?: string | undefined;
50
+ }
51
+ export type DateValue = Date | undefined;
52
+ export interface CustomCaptionProps {
53
+ children?: React.ReactNode;
54
+ }
55
+ export interface CustomCalenderButtonProps {
56
+ className?: string;
57
+ disabled?: boolean | undefined;
58
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
59
+ }
60
+ export interface TimePickerProps {
61
+ /**
62
+ * The current time value, in string format (e.g., '14:30').
63
+ */
64
+ value: string;
65
+ /**
66
+ * Function to handle time selection changes, receiving the selected time as a string.
67
+ */
68
+ onChange: (time: string) => void;
69
+ /**
70
+ * The minimum selectable time, used to restrict the earliest selectable time.
71
+ */
72
+ minTime?: string;
73
+ /**
74
+ * The maximum selectable time, used to restrict the latest selectable time.
75
+ */
76
+ maxTime?: string;
77
+ /**
78
+ * Function to handle error state changes, receiving a boolean indicating the presence of an error.
79
+ */
80
+ onErrorChange: (error: boolean) => void;
81
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './IconButton.scss';
3
+ import { IconButtonProps } from './types';
4
+ declare const IconButton: React.FC<IconButtonProps>;
5
+ export default IconButton;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import IconButton from './IconButton';
3
+ declare const meta: Meta<typeof IconButton>;
4
+ type Story = StoryObj<typeof IconButton>;
5
+ export declare const PrimaryIconButton: Story;
6
+ export default meta;
@@ -0,0 +1 @@
1
+ export { default } from './IconButton';
@@ -0,0 +1,5 @@
1
+ export interface IconButtonProps {
2
+ label: string;
3
+ iconName: string;
4
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
5
+ }
@@ -1,4 +1,4 @@
1
1
  import './InputWithDropdown.scss';
2
2
  import { InputWithDropdownProps } from './types';
3
- declare const InputWithDropdown: ({ name, label, value, type, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, optionsRequired, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default InputWithDropdown;
@@ -15,15 +15,11 @@ export interface InputWithDropdownProps {
15
15
  /**
16
16
  * value | input field value
17
17
  */
18
- value: string | number;
18
+ value?: number;
19
19
  /**
20
20
  * variants to set color/style of the input field
21
21
  */
22
22
  variant?: 'default' | 'primary';
23
- /**
24
- * type to set the input field type
25
- */
26
- type: 'text' | 'password' | 'number' | 'time';
27
23
  /**
28
24
  * error | If true, error message will be displayed
29
25
  */
@@ -65,9 +61,9 @@ export interface InputWithDropdownProps {
65
61
  */
66
62
  onDropdownChangeHandler?: (option: Option) => void;
67
63
  /**
68
- * onFocus action for input field
64
+ * onInputBlurHandler action for input field
69
65
  */
70
- onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
66
+ onInputBlurHandler?: (event: React.FocusEvent<HTMLInputElement>) => void;
71
67
  /**
72
68
  * id to select the input field uniquely
73
69
  */
@@ -17,5 +17,5 @@ interface TableTreeProps {
17
17
  treeData: Array<ObjectProps>;
18
18
  onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: any) => void;
19
19
  }
20
- declare const TableTree: ({ columnsData, treeData, onClick, }: TableTreeProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const TableTree: ({ columnsData, treeData, withCheckBox, onClick, }: TableTreeProps) => import("react/jsx-runtime").JSX.Element;
21
21
  export default TableTree;
package/lib/index.d.ts CHANGED
@@ -884,7 +884,7 @@ interface AddResourceButtonProps {
884
884
  zIndex?: number;
885
885
  }
886
886
 
887
- declare const AddButton$1: ({ id, variant, directionalArrow, zIndex, }: AddResourceButtonProps) => react_jsx_runtime.JSX.Element;
887
+ declare const AddButton: ({ id, variant, directionalArrow, zIndex, }: AddResourceButtonProps) => react_jsx_runtime.JSX.Element;
888
888
 
889
889
  type Status = 'passed' | 'failed' | 'warning' | 'skipped' | 'Passed' | 'Failed' | 'Skipped' | 'Warning';
890
890
  type StatusValue = {
@@ -1052,15 +1052,11 @@ interface InputWithDropdownProps {
1052
1052
  /**
1053
1053
  * value | input field value
1054
1054
  */
1055
- value: string | number;
1055
+ value?: number;
1056
1056
  /**
1057
1057
  * variants to set color/style of the input field
1058
1058
  */
1059
1059
  variant?: 'default' | 'primary';
1060
- /**
1061
- * type to set the input field type
1062
- */
1063
- type: 'text' | 'password' | 'number' | 'time';
1064
1060
  /**
1065
1061
  * error | If true, error message will be displayed
1066
1062
  */
@@ -1102,9 +1098,9 @@ interface InputWithDropdownProps {
1102
1098
  */
1103
1099
  onDropdownChangeHandler?: (option: Option) => void;
1104
1100
  /**
1105
- * onFocus action for input field
1101
+ * onInputBlurHandler action for input field
1106
1102
  */
1107
- onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
1103
+ onInputBlurHandler?: (event: React.FocusEvent<HTMLInputElement>) => void;
1108
1104
  /**
1109
1105
  * id to select the input field uniquely
1110
1106
  */
@@ -1128,7 +1124,7 @@ interface InputWithDropdownProps {
1128
1124
  optionsRequired?: boolean;
1129
1125
  }
1130
1126
 
1131
- declare const InputWithDropdown: ({ name, label, value, type, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, optionsRequired, }: InputWithDropdownProps) => react_jsx_runtime.JSX.Element;
1127
+ declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, }: InputWithDropdownProps) => react_jsx_runtime.JSX.Element;
1132
1128
 
1133
1129
  declare const RadioButton: React__default.FC<RadioButtonProps>;
1134
1130
 
@@ -1241,7 +1237,7 @@ interface TableTreeProps {
1241
1237
  treeData: Array<ObjectProps>;
1242
1238
  onClick?: (event: React__default.MouseEvent<HTMLDivElement, MouseEvent>, data: any) => void;
1243
1239
  }
1244
- declare const TableTree: ({ columnsData, treeData, onClick, }: TableTreeProps) => react_jsx_runtime.JSX.Element;
1240
+ declare const TableTree: ({ columnsData, treeData, withCheckBox, onClick, }: TableTreeProps) => react_jsx_runtime.JSX.Element;
1245
1241
 
1246
1242
  interface TabsProps {
1247
1243
  /**
@@ -1330,6 +1326,60 @@ interface SearchProps {
1330
1326
 
1331
1327
  declare const Search: ({ placeholder, onSearch, disabled, width, }: SearchProps) => react_jsx_runtime.JSX.Element;
1332
1328
 
1329
+ interface DatePickerProps {
1330
+ /**
1331
+ * The minimum selectable date.
1332
+ */
1333
+ minDate?: DateValue;
1334
+ /**
1335
+ * The maximum selectable date.
1336
+ */
1337
+ maxDate?: DateValue;
1338
+ /**
1339
+ * Selected date value.
1340
+ */
1341
+ value?: DateValue;
1342
+ /**
1343
+ * Function to handle date selection.
1344
+ */
1345
+ onChange: (value: DateValue) => void;
1346
+ /**
1347
+ * Placeholder text for the input field.
1348
+ */
1349
+ placeholder?: string;
1350
+ /**
1351
+ * Disables the date picker.
1352
+ */
1353
+ disabled?: boolean;
1354
+ /**
1355
+ * Format for displaying the selected date. Default is 'EEEE, dd MMM yyyy'.
1356
+ */
1357
+ dateFormat?: string;
1358
+ /**
1359
+ * Format for displaying the selected time. Default is 'hh:mm a'.
1360
+ */
1361
+ timeFormat?: string;
1362
+ /**
1363
+ * Timezone for the date picker.
1364
+ */
1365
+ timezone?: string;
1366
+ /**
1367
+ * Custom width for the calendar. This will override the default width of the calendar.
1368
+ */
1369
+ calendarWidth?: number;
1370
+ /**
1371
+ * When true, displays the input field error.
1372
+ */
1373
+ error?: boolean;
1374
+ /**
1375
+ * Helper text to display below the input field, used for error messages or instructions.
1376
+ */
1377
+ helperText?: string | undefined;
1378
+ }
1379
+ type DateValue = Date | undefined;
1380
+
1381
+ declare const CustomDatePicker: React__default.FC<DatePickerProps>;
1382
+
1333
1383
  interface StateDropdownProps {
1334
1384
  value: string;
1335
1385
  nodeObj: {};
@@ -1344,12 +1394,13 @@ interface StateDropdownProps {
1344
1394
 
1345
1395
  declare const StateDropdown: ({ value, nodeObj, isReviewer, isApprovePage, handleStateValueClick, handleDropdownOptionsClick, disabled, isOnlyReviewer, userHasOnlyViewAccess, }: StateDropdownProps) => react_jsx_runtime.JSX.Element;
1346
1396
 
1347
- interface AddButtonProps {
1348
- name: string;
1397
+ interface IconButtonProps {
1398
+ label: string;
1399
+ iconName: string;
1349
1400
  onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
1350
1401
  }
1351
1402
 
1352
- declare const AddButton: React__default.FC<AddButtonProps>;
1403
+ declare const IconButton: React__default.FC<IconButtonProps>;
1353
1404
 
1354
1405
  type valueType$1 = any;
1355
1406
  declare const checkEmpty: (value: valueType$1) => boolean;
@@ -1358,4 +1409,4 @@ type valueType = File | string;
1358
1409
  declare const getExtension: (value: valueType) => string | undefined;
1359
1410
  declare const getExtensionWithPeriod: (value: valueType) => string;
1360
1411
 
1361
- export { Accordion, AddButton, AddButton$1 as AddResourceButton, Button, Checkbox, Chip, Col, Container, DonutChart, Drawer, ExpandableMenu, FileDropzone, Form, HighlightText, Icon, Input, InputWithDropdown, MenuOption, MiniModal, MultiSelect, RadialChart, RadioButton, RadioGroup, Row, Search, Select, StateDropdown, StatusButton, Table, TableTree, Tabs, Textarea as TextArea, ThemeProvider, Toaster, Toggle, Tooltip, Typography, checkEmpty, getExtension, getExtensionWithPeriod, useTheme };
1412
+ export { Accordion, AddButton as AddResourceButton, Button, Checkbox, Chip, Col, Container, CustomDatePicker as DatePicker, DonutChart, Drawer, ExpandableMenu, FileDropzone, Form, HighlightText, Icon, IconButton, Input, InputWithDropdown, MenuOption, MiniModal, MultiSelect, RadialChart, RadioButton, RadioGroup, Row, Search, Select, StateDropdown, StatusButton, Table, TableTree, Tabs, Textarea as TextArea, ThemeProvider, Toaster, Toggle, Tooltip, Typography, checkEmpty, getExtension, getExtensionWithPeriod, useTheme };