digitinary-ui 1.0.6 → 1.0.8

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.
Files changed (80) hide show
  1. package/dist/components/Table/Table.d.ts +1 -1
  2. package/dist/index.js +2 -3
  3. package/dist/types/interfaces.d.ts +4 -0
  4. package/package.json +1 -1
  5. package/dist/components/Accordion/Accordion.js +0 -28
  6. package/dist/components/Accordion/index.js +0 -1
  7. package/dist/components/Alert/Alert.js +0 -58
  8. package/dist/components/Alert/index.js +0 -1
  9. package/dist/components/Button/Button.js +0 -17
  10. package/dist/components/Button/index.js +0 -1
  11. package/dist/components/Card/Card.js +0 -6
  12. package/dist/components/Card/index.js +0 -1
  13. package/dist/components/Checkbox/Checkbox.js +0 -8
  14. package/dist/components/Checkbox/index.js +0 -1
  15. package/dist/components/Chip/Chip.js +0 -18
  16. package/dist/components/Chip/index.js +0 -1
  17. package/dist/components/Date/Date.js +0 -460
  18. package/dist/components/Date/index.js +0 -1
  19. package/dist/components/DateRange/DateRange.js +0 -206
  20. package/dist/components/DateRange/index.js +0 -1
  21. package/dist/components/Dialog/Dialog.js +0 -36
  22. package/dist/components/Dialog/index.js +0 -1
  23. package/dist/components/HelperText/HelperText.js +0 -6
  24. package/dist/components/HelperText/index.js +0 -1
  25. package/dist/components/Input/Input.js +0 -38
  26. package/dist/components/Input/index.js +0 -1
  27. package/dist/components/Label/Label.js +0 -6
  28. package/dist/components/Label/index.js +0 -1
  29. package/dist/components/Overlay/Overlay.js +0 -8
  30. package/dist/components/Overlay/index.js +0 -1
  31. package/dist/components/Pagination/Pagination.js +0 -26
  32. package/dist/components/Pagination/index.js +0 -1
  33. package/dist/components/Radio/Radio.js +0 -8
  34. package/dist/components/Radio/index.js +0 -1
  35. package/dist/components/RadioGroup/RadioGroup.js +0 -14
  36. package/dist/components/RadioGroup/index.js +0 -1
  37. package/dist/components/SelectGroup/SelectGroup.js +0 -251
  38. package/dist/components/SelectGroup/index.js +0 -1
  39. package/dist/components/SideDrawer/SideDrawer.js +0 -54
  40. package/dist/components/SideDrawer/index.js +0 -1
  41. package/dist/components/Switch/Switch.js +0 -6
  42. package/dist/components/Switch/index.js +0 -1
  43. package/dist/components/Table/Table.js +0 -60
  44. package/dist/components/Table/index.js +0 -1
  45. package/dist/components/TextArea/TextArea.js +0 -30
  46. package/dist/components/TextArea/index.js +0 -1
  47. package/dist/components/Tooltip/Tooltip.js +0 -8
  48. package/dist/components/index.js +0 -19
  49. package/dist/constants/index.js +0 -5
  50. package/dist/icons/AlertErrorIcon.js +0 -3
  51. package/dist/icons/AlertInfoIcon.js +0 -3
  52. package/dist/icons/AlertSuccessIcon.js +0 -3
  53. package/dist/icons/AlertWarningIcon.js +0 -3
  54. package/dist/icons/ArrowBottom.js +0 -3
  55. package/dist/icons/ArrowLeft.js +0 -3
  56. package/dist/icons/ArrowRight.js +0 -3
  57. package/dist/icons/ArrowUpIcon.js +0 -3
  58. package/dist/icons/Calendar.js +0 -3
  59. package/dist/icons/CheckMark.js +0 -3
  60. package/dist/icons/ClearField.js +0 -3
  61. package/dist/icons/CloseIcon.js +0 -3
  62. package/dist/icons/DoubleLeftArrow.js +0 -3
  63. package/dist/icons/DoubleRightArrow.js +0 -3
  64. package/dist/icons/ExcelIcon.js +0 -3
  65. package/dist/icons/HidePasswordIcon.js +0 -3
  66. package/dist/icons/InfoIcon.js +0 -3
  67. package/dist/icons/LeftArrowIcon.js +0 -3
  68. package/dist/icons/LoaderIcon.js +0 -3
  69. package/dist/icons/PdfIcon.js +0 -3
  70. package/dist/icons/RightArrowIcon.js +0 -3
  71. package/dist/icons/SearchIcon.js +0 -3
  72. package/dist/icons/SelectFieldDownArrow.js +0 -3
  73. package/dist/icons/SelectFieldUpArrow.js +0 -3
  74. package/dist/icons/ShowPasswordIcon.js +0 -3
  75. package/dist/icons/SortIcon.js +0 -3
  76. package/dist/types/enums.js +0 -25
  77. package/dist/types/index.js +0 -3
  78. package/dist/types/interfaces.js +0 -1
  79. package/dist/types/types.js +0 -1
  80. package/dist/utils/index.js +0 -8
@@ -97,6 +97,9 @@ export interface PaginationProps extends BaseProps {
97
97
  to: string;
98
98
  };
99
99
  }
100
+ export interface TablePaginationProps extends PaginationProps {
101
+ show: boolean;
102
+ }
100
103
  export interface TableProps extends BaseProps {
101
104
  headCells: HeadCellProps[];
102
105
  data: Record<string, any>[];
@@ -110,6 +113,7 @@ export interface TableProps extends BaseProps {
110
113
  selectableRow?: boolean;
111
114
  selectedRowId?: string;
112
115
  rowDataId?: string;
116
+ paginationOptions?: TablePaginationProps;
113
117
  }
114
118
  export interface SwitchProps {
115
119
  checked: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "digitinary-ui",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Digitinary UI Library",
5
5
  "author": "Digitinary Company",
6
6
  "repository": {
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import style from './accordion.module.scss';
4
- import SelectFieldDownArrow from '../../icons/SelectFieldDownArrow';
5
- const Accordion = ({ defaultExpanded = false, expanded, disabled = false, onChange, summary, children, className, }) => {
6
- const [isExpanded, setIsExpanded] = useState(defaultExpanded);
7
- const isControlled = expanded !== undefined;
8
- const toggleAccordion = () => {
9
- if (disabled)
10
- return;
11
- if (isControlled && onChange) {
12
- onChange();
13
- }
14
- else {
15
- setIsExpanded(!isExpanded);
16
- }
17
- };
18
- const handleKeyDown = (event) => {
19
- if (disabled)
20
- return;
21
- if (event.key === 'Enter' || event.key === ' ') {
22
- toggleAccordion();
23
- }
24
- };
25
- const shouldExpand = isControlled ? expanded && !disabled : isExpanded && !disabled;
26
- return (_jsxs("div", { className: `${style.accordion} ${shouldExpand ? style.expanded : ''} ${disabled ? style.disabled : ''} ${className}`, children: [_jsxs("div", { className: style.summary, onClick: toggleAccordion, onKeyDown: handleKeyDown, "aria-expanded": shouldExpand, role: "button", tabIndex: 0, children: [summary, _jsx("div", { className: style.iconContainer, children: _jsx(SelectFieldDownArrow, { "data-id": "ACCORDION_DROPDOWN_ARROW_ICON", className: `${style.dropdownIcon} ${shouldExpand ? style.rotateFlip : ''} ${disabled ? style.disabled : ''}`, width: "1.5rem", height: "1.5rem" }) })] }), _jsx("div", { className: `${style.details} ${shouldExpand ? style.show : ''}`, children: children })] }));
27
- };
28
- export default Accordion;
@@ -1 +0,0 @@
1
- export { default } from './Accordion';
@@ -1,58 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef } from 'react';
3
- import style from './alert.module.scss';
4
- import ErrorAlert from '../../icons/AlertErrorIcon';
5
- import WarningAlert from '../../icons/AlertWarningIcon';
6
- import InfoAlert from '../../icons/AlertInfoIcon';
7
- import NaturalAlert from '../../icons/InfoIcon';
8
- import SuccessAlert from '../../icons/AlertSuccessIcon';
9
- import CloseIcon from '../../icons/CloseIcon';
10
- const severityMap = {
11
- info: InfoAlert,
12
- success: SuccessAlert,
13
- error: ErrorAlert,
14
- warning: WarningAlert,
15
- natural: NaturalAlert,
16
- };
17
- const Alert = ({ severity = 'info', color = severity, variant = 'default', onClose, action, className, icon = true, // Default to true, showing the icon based on severity
18
- customStyle, children, }) => {
19
- const IconComponent = severityMap[severity];
20
- const [visible, setVisible] = useState(true);
21
- const [exitTransition, setExitTransition] = useState(false);
22
- const actionBtnRef = useRef(null);
23
- const alertContentRef = useRef(null);
24
- const handleClose = () => {
25
- setExitTransition(true);
26
- if (typeof onClose === 'function')
27
- onClose();
28
- setTimeout(() => {
29
- setVisible(false);
30
- }, 500);
31
- };
32
- useEffect(() => {
33
- let offsetWidth = 0;
34
- if (actionBtnRef.current) {
35
- const actionBtnWidth = actionBtnRef.current.offsetWidth / 16;
36
- offsetWidth += actionBtnWidth;
37
- }
38
- if (onClose) {
39
- offsetWidth += 1.5;
40
- }
41
- if (actionBtnRef.current || onClose) {
42
- offsetWidth += 1;
43
- }
44
- if (alertContentRef.current) {
45
- alertContentRef.current.style.marginRight = `${offsetWidth}rem`;
46
- }
47
- }, []);
48
- if (!visible)
49
- return null;
50
- return (_jsxs("div", { className: `${className} ${style.alertContainer} ${style[color]} ${style[variant]} ${exitTransition ? style.exit : ''}`, style: customStyle, role: "alert", "data-id": `ALERT${severity ? `_${severity?.toUpperCase()}_ID` : ''}`, children: [icon === true ? (
51
- // Default icon based on severity
52
- _jsx(IconComponent, { className: `${style.alertIcon} ${style[color]} ${style[variant]}`, width: "1.25rem", height: "1.25rem", "data-id": "ALERT-ICON" })) : icon ? ( // Render custom icon if icon is JSX.Element
53
- icon) : null, _jsx("div", { className: style.alertContent, ref: alertContentRef, children: children }), _jsxs("div", { className: style.actionContainer, children: [action && (_jsx("div", { className: style.actionButton, ref: actionBtnRef, children: action })), onClose && (_jsx(CloseIcon, { className: style.closeIcon, width: "1.25rem", height: "1.25rem", "data-id": "CLOSE-ICON", tabIndex: 0, onKeyDown: (e) => {
54
- if (e.key === 'Enter' || e.key === ' ')
55
- handleClose();
56
- }, onClick: handleClose, "aria-label": "Close alert" }))] })] }));
57
- };
58
- export default Alert;
@@ -1 +0,0 @@
1
- export { default } from './Alert';
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styles from './button.module.scss';
3
- import LoaderIcon from '../../icons/LoaderIcon';
4
- import { Size } from '../../types';
5
- const Button = ({ children, className = '', variant = 'contained', color = 'primary', size = Size.Medium, type = 'button', disabled, loading, startIcon, endIcon, fullWidth, onKeyDown, onClick, active, ...props }) => {
6
- return (_jsxs("button", { className: `${styles.customBtn}
7
- ${styles[variant]}
8
- ${styles[size]}
9
- ${styles[color]}
10
- ${disabled ? styles.disabled : ''}
11
- ${loading ? styles.loading : ''}
12
- ${active ? styles.active : ''}
13
- ${fullWidth ? styles.fullWidth : ''}
14
- ${className || ''}`, disabled: disabled || loading, type: type, onKeyDown: onKeyDown, onClick: onClick, "data-id": `${String(children).toUpperCase().replaceAll(' ', '_')}_BUTTON_ID`, ...props, children: [_jsxs("div", { className: styles.btnContentWrapper, children: [startIcon && _jsx("div", { className: styles.startBtnIcon, children: startIcon }), _jsx("div", { className: styles.btnContent, children: children }), endIcon && _jsx("div", { className: styles.endBtnIcon, children: endIcon })] }), loading && (_jsx("div", { className: styles.btnLoaderContainer, children: _jsx("div", { className: styles.btnLoaderIconContainer, children: _jsx(LoaderIcon, { className: styles.btnLoaderIcon, width: '1.5rem', height: '1.5rem' }) }) }))] }));
15
- };
16
- Button.displayName = 'Button';
17
- export default Button;
@@ -1 +0,0 @@
1
- export { default } from './Button';
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styles from './card.module.scss';
3
- const Card = ({ header, children, footer, className = '', rounded = true }) => {
4
- return (_jsxs("div", { className: `${styles.cardContainer} ${className} ${rounded ? styles.roundedCorners : ''}`, children: [header && _jsx("section", { className: styles.cardHeader, children: header }), children && _jsx("section", { className: styles.cardBody, children: children }), _jsx("section", { className: styles.cardFooter, children: footer })] }));
5
- };
6
- export default Card;
@@ -1 +0,0 @@
1
- export { default } from './Card';
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import CheckMark from '../../icons/CheckMark';
3
- import styles from './checkbox.module.scss';
4
- import { Position, Size } from '../../types';
5
- const Checkbox = ({ label, labelPlacement = Position.Start, handleCheckboxChange, className = '', checked = false, size = Size.Medium, disabled = false, }) => {
6
- return (_jsx("div", { className: `${styles.checkBox} ${className}`, children: _jsx("div", { className: styles.checkBoxItemsContainer, children: _jsxs("div", { className: `${styles.checkBoxItemContainer} ${styles[labelPlacement]}`, onClick: !disabled ? handleCheckboxChange : undefined, tabIndex: 0, children: [_jsx("div", { className: `${styles.itemCheckbox} ${disabled ? styles.disabledCheckbox : checked ? styles.checked : ''}`, children: checked && (_jsx(CheckMark, { width: size === 'small' ? '1.5rem' : size === 'large' ? '1rem' : '0.875rem', height: size === 'small' ? '1.5rem' : size === 'large' ? '1rem' : '0.875rem' })) }), _jsx("label", { className: `${styles.checkBoxItemLabel} ${styles[size] || styles.medium} ${disabled ? styles.disabledLabel : ''}`, children: label })] }) }) }));
7
- };
8
- export default Checkbox;
@@ -1 +0,0 @@
1
- export { default } from './Checkbox';
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styles from './chip.module.scss';
3
- import CloseIcon from '../../icons/CloseIcon';
4
- import { Size } from '../../types';
5
- const Chip = ({ className = '', color = 'primary', children, variant = 'filled', clickable, onClick, onDelete, size = Size.Small, id, }) => {
6
- return (_jsxs("span", { className: `${styles.singleChip} ${styles[size]} ${variant === 'filled' ? styles[`chip-${color}`] : ''} ${className} ${clickable ? styles.clickable : ''}
7
- ${variant === 'outlined'
8
- ? styles[`outlinedChip-${color}`]
9
- : clickable
10
- ? styles[`clickable-${color}`]
11
- : ''} `, onClick: onClick, children: [children, onDelete && (_jsx("div", { className: styles.deleteContainer, children: _jsx(CloseIcon, { onClick: (e) => {
12
- e.stopPropagation();
13
- if (id)
14
- onDelete(id);
15
- }, className: styles.chipCloseIcon, width: '0.875rem', height: '0.875rem', "data-id": "CHIPS_CLOSE_ICON" }) }))] }));
16
- };
17
- Chip.displayName = 'Chip';
18
- export default Chip;
@@ -1 +0,0 @@
1
- export { default } from './Chip';