@inceptionbg/iui 2.0.28 → 2.0.31

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 (84) hide show
  1. package/dist/NoAccessPage-BHCAfL2g.js +2 -0
  2. package/dist/{NoAccessPage-DTPU8bP2.js.map → NoAccessPage-BHCAfL2g.js.map} +1 -1
  3. package/dist/NotFoundPage-BD3WL_BG.js +2 -0
  4. package/dist/{NotFoundPage-PZunMooy.js.map → NotFoundPage-BD3WL_BG.js.map} +1 -1
  5. package/dist/index.d.ts +16 -5
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/iui.css +1 -1
  9. package/package.json +8 -12
  10. package/rollup.config.js +5 -29
  11. package/src/components/Accordions/Accordions.tsx +1 -2
  12. package/src/components/Dashboard/DashboardWidget.tsx +1 -1
  13. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +1 -2
  14. package/src/components/Dialog/Dialog.tsx +20 -11
  15. package/src/components/Dialog/components/DialogFooter.tsx +1 -1
  16. package/src/components/Header/Components/EnvBadge.tsx +1 -1
  17. package/src/components/Header/Components/Notifications.tsx +5 -3
  18. package/src/components/Inputs/DateInput/DateInput.tsx +1 -1
  19. package/src/components/Inputs/InputWrapper.tsx +1 -1
  20. package/src/components/Inputs/PasswordInput.tsx +1 -2
  21. package/src/components/Inputs/SearchInput.tsx +1 -1
  22. package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +1 -1
  23. package/src/components/Pullover/Pullover.tsx +2 -2
  24. package/src/components/Sidebar/SidebarItem.tsx +1 -1
  25. package/src/components/Table/components/columns/TableColumnsEdit.tsx +1 -1
  26. package/src/components/Table/components/edit/TableEditRow.tsx +1 -1
  27. package/src/components/Table/components/filters/TableFilters.tsx +1 -1
  28. package/src/components/Table/components/items/TableItemActions.tsx +1 -1
  29. package/src/components/Table/components/print/TablePrint.tsx +1 -1
  30. package/src/components/Table/components/select/TableSelect.tsx +1 -1
  31. package/src/components/Table/components/sort/TableSort.tsx +5 -3
  32. package/src/components/Table/components/templates/TableTemplates.tsx +1 -1
  33. package/src/components/Table/components/templates/TemplatesPullover.tsx +1 -1
  34. package/src/components/Tree/TreeItem.tsx +1 -1
  35. package/src/components/Wrappers/PageLayout.tsx +8 -4
  36. package/src/hooks/useLocalPopoverControl.ts +53 -19
  37. package/src/styles/common/helpers/_base.scss +6 -2
  38. package/src/styles/components/_button.scss +1 -1
  39. package/src/styles/components/_inputCheckbox.scss +0 -57
  40. package/src/styles/components/_pullover.scss +1 -5
  41. package/src/styles/components/_table.scss +13 -0
  42. package/dist/NoAccessPage-DTPU8bP2.js +0 -2
  43. package/dist/NotFoundPage-PZunMooy.js +0 -2
  44. package/dist/icons/index.d.ts +0 -55
  45. package/dist/icons/index.js +0 -1
  46. package/src/assets/icons/index.ts +0 -26
  47. package/src/assets/icons/light/faArrowDownShortWide.ts +0 -15
  48. package/src/assets/icons/light/faArrowDownWideShort.ts +0 -15
  49. package/src/assets/icons/light/faArrowLeft.ts +0 -15
  50. package/src/assets/icons/light/faArrowRight.ts +0 -15
  51. package/src/assets/icons/light/faArrowUpArrowDown.ts +0 -15
  52. package/src/assets/icons/light/faArrowUpRightFromSquare.ts +0 -15
  53. package/src/assets/icons/light/faArrowsToLine.ts +0 -15
  54. package/src/assets/icons/light/faArrowsUpDown.ts +0 -15
  55. package/src/assets/icons/light/faBell.ts +0 -15
  56. package/src/assets/icons/light/faBookmark.ts +0 -15
  57. package/src/assets/icons/light/faBookmarkSlash.ts +0 -15
  58. package/src/assets/icons/light/faCalendarPlus.ts +0 -15
  59. package/src/assets/icons/light/faCheck.ts +0 -15
  60. package/src/assets/icons/light/faChevronDown.ts +0 -15
  61. package/src/assets/icons/light/faChevronRight.ts +0 -15
  62. package/src/assets/icons/light/faCircleCheck.ts +0 -15
  63. package/src/assets/icons/light/faCircleInfo.ts +0 -15
  64. package/src/assets/icons/light/faCircleXmark.ts +0 -15
  65. package/src/assets/icons/light/faClipboardCheck.ts +0 -15
  66. package/src/assets/icons/light/faClockRotateLeft.ts +0 -15
  67. package/src/assets/icons/light/faEllipsisVertical.ts +0 -15
  68. package/src/assets/icons/light/faEnvelope.ts +0 -15
  69. package/src/assets/icons/light/faEye.ts +0 -15
  70. package/src/assets/icons/light/faEyeSlash.ts +0 -15
  71. package/src/assets/icons/light/faFilter.ts +0 -15
  72. package/src/assets/icons/light/faGear.ts +0 -15
  73. package/src/assets/icons/light/faHouse.ts +0 -15
  74. package/src/assets/icons/light/faIdBadge.ts +0 -15
  75. package/src/assets/icons/light/faLineColumns.ts +0 -15
  76. package/src/assets/icons/light/faLink.ts +0 -15
  77. package/src/assets/icons/light/faMagnifyingGlass.ts +0 -15
  78. package/src/assets/icons/light/faPen.ts +0 -15
  79. package/src/assets/icons/light/faPrint.ts +0 -15
  80. package/src/assets/icons/light/faQuestion.ts +0 -15
  81. package/src/assets/icons/light/faRotateRight.ts +0 -15
  82. package/src/assets/icons/light/faTrashCan.ts +0 -15
  83. package/src/assets/icons/light/faTriangleExclamation.ts +0 -15
  84. package/src/assets/icons/light/faXmark.ts +0 -15
@@ -1,8 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ITableColumn, ITableDataItem } from '../../../../types/ITable';
3
3
  import { useEffect, useRef } from 'react';
4
+ import { faCheck, faXmark } from '@inceptionbg/icons';
4
5
  import clsx from 'clsx';
5
- import { faCheck, faXmark } from '../../../../assets/icons';
6
6
  import { useGetFocusableElements } from '../../../../hooks/useGetFocusableElements';
7
7
  import { IconButton } from '../../../Button/IconButton';
8
8
  import { useTableContext } from '../../contexts/TableContext';
@@ -1,8 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ITableFilterItem } from '../../../../types/ITable';
3
3
  import { useMemo, useState } from 'react';
4
+ import { faFilter } from '@inceptionbg/icons';
4
5
  import { useTranslation } from 'react-i18next';
5
- import { faFilter } from '../../../../assets/icons/light/faFilter';
6
6
  import { faFilterCircleXmark } from '../../../../assets/icons/regular/faFilterCircleXmark';
7
7
  import { usePopupControl } from '../../../../hooks/usePopupControl';
8
8
  import {
@@ -1,6 +1,6 @@
1
1
  import type { ITableDataItem } from '../../../../types/ITable';
2
2
  import { type FC } from 'react';
3
- import { faEllipsisVertical, faPen, faTrashCan } from '../../../../assets/icons';
3
+ import { faEllipsisVertical, faPen, faTrashCan } from '@inceptionbg/icons';
4
4
  import { useIsMenuOpen } from '../../../../hooks/useIsMenuOpen';
5
5
  import { IconButton } from '../../../Button/IconButton';
6
6
  import { Menu } from '../../../Menu/Menu';
@@ -1,9 +1,9 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IPrintData } from '../../../../types/ITable';
3
3
  import { useEffect, useMemo } from 'react';
4
+ import { faPrint } from '@inceptionbg/icons';
4
5
  import clsx from 'clsx';
5
6
  import { useTranslation } from 'react-i18next';
6
- import { faPrint } from '../../../../assets/icons';
7
7
  import { faFileArrowDown } from '../../../../assets/icons/regular/faFileArrowDown';
8
8
  import { useHideZendesk } from '../../../../hooks/useZendesk';
9
9
  import { formatDate, getCurrentDateFormatted } from '../../../../utils/dateUtils';
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import { useState } from 'react';
3
+ import { faClipboardCheck } from '@inceptionbg/icons';
3
4
  import { useTranslation } from 'react-i18next';
4
- import { faClipboardCheck } from '../../../../assets/icons/light/faClipboardCheck';
5
5
  import { NotificationBadge } from '../../../Badge/NotificationBadge';
6
6
  import { IconButton } from '../../../Button/IconButton';
7
7
  import { Menu } from '../../../Menu/Menu';
@@ -1,9 +1,11 @@
1
1
  import type { FC } from 'react';
2
2
  import { useEffect, useState } from 'react';
3
+ import {
4
+ faArrowDownShortWide,
5
+ faArrowDownWideShort,
6
+ faArrowUpArrowDown,
7
+ } from '@inceptionbg/icons';
3
8
  import { useTranslation } from 'react-i18next';
4
- import { faArrowDownShortWide } from '../../../../assets/icons/light/faArrowDownShortWide';
5
- import { faArrowDownWideShort } from '../../../../assets/icons/light/faArrowDownWideShort';
6
- import { faArrowUpArrowDown } from '../../../../assets/icons/light/faArrowUpArrowDown';
7
9
  import { IconButton } from '../../../Button/IconButton';
8
10
  import { Menu } from '../../../Menu/Menu';
9
11
  import { Tooltip } from '../../../Tooltip/Tooltip';
@@ -1,8 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IReportTemplate } from '../../../../types/ITable';
3
3
  import { useEffect } from 'react';
4
+ import { faBookmark } from '@inceptionbg/icons';
4
5
  import { useTranslation } from 'react-i18next';
5
- import { faBookmark } from '../../../../assets/icons';
6
6
  import { setTemplateData } from '../../../../utils/tableUtils';
7
7
  import { IconButton } from '../../../Button/IconButton';
8
8
  import { useTableContext } from '../../contexts/TableContext';
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IReportTemplate, ITableTemplateData } from '../../../../types/ITable';
3
+ import { faBookmark, faBookmarkSlash, faTrashCan } from '@inceptionbg/icons';
3
4
  import { useTranslation } from 'react-i18next';
4
- import { faBookmark, faBookmarkSlash, faTrashCan } from '../../../../assets/icons';
5
5
  import { usePopupControl } from '../../../../hooks/usePopupControl';
6
6
  import { List } from '../../../List/List';
7
7
  import { Pullover } from '../../../Pullover/Pullover';
@@ -1,8 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ITreeItem } from '../../types/ITree';
3
3
  import { useState } from 'react';
4
+ import { faChevronRight } from '@inceptionbg/icons';
4
5
  import clsx from 'clsx';
5
- import { faChevronRight } from '../../assets/icons';
6
6
  import { IconButton } from '../Button/IconButton';
7
7
  import { Collapse } from '../Helper/Collapse';
8
8
 
@@ -2,10 +2,10 @@ import type { FC, ReactNode } from 'react';
2
2
  import type { IHeaderAction } from '../../types/IHeader';
3
3
  import type { IMenuItem } from '../../types/IMenu';
4
4
  import { useLayoutEffect, useState } from 'react';
5
+ import { faArrowLeft, faEllipsisVertical, faQuestion } from '@inceptionbg/icons';
6
+ import clsx from 'clsx';
5
7
  import { Trans } from 'react-i18next';
6
8
  import { Link, useNavigate } from 'react-router';
7
- import { faEllipsisVertical, faQuestion } from '../../assets/icons';
8
- import { faArrowLeft } from '../../assets/icons/regular/faArrowLeft';
9
9
  import { usePopupControl } from '../../hooks/usePopupControl';
10
10
  import { Button } from '../Button/Button';
11
11
  import { IconButton } from '../Button/IconButton';
@@ -139,7 +139,7 @@ export const PageLayout: FC<IPageLayoutProps> = ({
139
139
  condition={!!action.to}
140
140
  wrapper={children => <Link to={action.to!}>{children}</Link>}
141
141
  >
142
- <Button key={action.label} {...action} className="ml-2" />
142
+ <Button key={action.label} {...action} />
143
143
  </ConditionalWrapper>
144
144
  )
145
145
  )}
@@ -148,7 +148,11 @@ export const PageLayout: FC<IPageLayoutProps> = ({
148
148
  )}
149
149
  <div className="page-content">{children}</div>
150
150
  {footer && (
151
- <footer className="page-footer">
151
+ <footer
152
+ className={clsx('page-footer', {
153
+ 'm-0': footer?.default || footer?.text,
154
+ })}
155
+ >
152
156
  {footer.custom ? (
153
157
  footer.custom
154
158
  ) : (
@@ -1,32 +1,66 @@
1
- import type { ILocalPopupControl } from '../types/IPopup';
2
- import { useCallback, useImperativeHandle, useRef } from 'react';
1
+ import type {
2
+ DeclarativeDialogProps,
3
+ ImperativeDialogProps,
4
+ } from '../components/Dialog/Dialog';
5
+ import { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
3
6
 
4
- interface Props {
5
- control: ILocalPopupControl;
6
- onCloseCallback?: () => void;
7
- }
7
+ type Props = ImperativeDialogProps | DeclarativeDialogProps;
8
8
 
9
- export const useLocalPopoverControl = ({ control, onCloseCallback }: Props) => {
9
+ export const useLocalPopoverControl = (props: Props) => {
10
+ const { control, onCloseCallback, isOpen: propsIsOpen, onClose } = props;
10
11
  const elementRef = useRef<HTMLDivElement>(null);
12
+ const timeoutRef = useRef<NodeJS.Timeout | null>(null);
11
13
 
12
- const handleOpen = useCallback(() => control.setIsOpen(true), [control]);
14
+ // Determine the operation mode
15
+ const isImperative = !!control;
16
+ const shouldBeOpen = isImperative ? control.isOpen : propsIsOpen;
13
17
 
14
- const handleClose = useCallback(() => {
15
- elementRef.current?.classList.add('closing');
16
- setTimeout(() => {
17
- onCloseCallback?.();
18
+ const [isMounted, setIsMounted] = useState(shouldBeOpen);
19
+
20
+ // 3. Handle State Synchronization and Animation
21
+ useEffect(() => {
22
+ if (shouldBeOpen && !isMounted) {
23
+ console.log('Opening');
24
+ timeoutRef.current && clearTimeout(timeoutRef.current);
25
+ elementRef.current?.classList.remove('closing');
26
+ setIsMounted(true);
27
+ } else if (!shouldBeOpen && isMounted) {
28
+ console.log('Closing');
29
+ elementRef.current?.classList.add('closing');
30
+ timeoutRef.current = setTimeout(() => {
31
+ setIsMounted(false);
32
+ onCloseCallback?.();
33
+ onClose?.();
34
+ }, 200);
35
+ }
36
+
37
+ console.log('Render');
38
+
39
+ return () => {
40
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
41
+ };
42
+ }, [shouldBeOpen, isMounted, onClose, onCloseCallback]);
43
+
44
+ const handleCloseRequest = useCallback(() => {
45
+ if (isImperative) {
18
46
  control.setIsOpen(false);
19
- }, 200);
20
- }, [control, onCloseCallback]);
47
+ } else {
48
+ onClose();
49
+ }
50
+ }, [isImperative, control, onClose]);
51
+
52
+ const handleOpenRequest = useCallback(() => {
53
+ if (isImperative) control.setIsOpen(true);
54
+ }, [isImperative, control]);
21
55
 
22
56
  useImperativeHandle(control?.controlRef, () => ({
23
- onOpen: handleOpen,
24
- onClose: handleClose,
57
+ onOpen: handleOpenRequest,
58
+ onClose: handleCloseRequest,
25
59
  }));
26
60
 
27
61
  return {
28
- isOpen: control?.isOpen,
29
- onClose: handleClose,
30
- elementRef: elementRef,
62
+ isOpen: isMounted,
63
+ onClose: handleCloseRequest,
64
+ elementRef,
31
65
  };
32
66
  };
@@ -26,12 +26,16 @@ a {
26
26
  }
27
27
 
28
28
  .clickable {
29
- cursor: pointer;
30
29
  transition: background-color 250ms;
30
+ &:not(.disabled):not(:disabled) {
31
+ cursor: pointer;
32
+ &.neutral:hover {
33
+ background-color: var(--neutral-hover);
34
+ }
35
+ }
31
36
  &:disabled,
32
37
  &.disabled {
33
38
  opacity: 0.4;
34
- cursor: default;
35
39
  pointer-events: none;
36
40
  user-select: none;
37
41
  }
@@ -83,7 +83,7 @@ $btn-colors: (primary, neutral, danger);
83
83
 
84
84
  ///// Icon Button /////
85
85
 
86
- .iui-icon-btn {
86
+ .iui-btn.iui-icon-btn {
87
87
  @each $size, $vars in buttonMaps.$icon-button-sizes {
88
88
  &.#{$size} {
89
89
  min-height: map.get($vars, size);
@@ -46,60 +46,3 @@
46
46
  }
47
47
  }
48
48
  }
49
-
50
- // Radio group
51
- .radio-group {
52
- display: flex;
53
- width: fit-content;
54
- &.column {
55
- flex-direction: column;
56
- }
57
- &.row {
58
- align-items: center;
59
- flex-direction: row;
60
- }
61
- }
62
-
63
- // Radio
64
- .iui-radio {
65
- display: inline-flex;
66
- user-select: none;
67
- padding: 8px;
68
- font-size: var(--fs-m);
69
- width: fit-content;
70
- gap: 8px;
71
- .icon {
72
- position: relative;
73
- height: 20px;
74
- width: 20px;
75
- border-radius: 20px;
76
- border: 2px solid #d0d5dd;
77
- min-width: 20px;
78
- display: flex;
79
- align-items: center;
80
- justify-content: center;
81
- .dot {
82
- height: 8px;
83
- width: 8px;
84
- border-radius: 8px;
85
- background-color: var(--background);
86
- transform: scale(0);
87
- transition: transform 150ms cubic-bezier(0.4, 0, 1, 1) 0ms;
88
- }
89
- &.selected {
90
- background-color: var(--primary);
91
- border-color: var(--primary);
92
- .dot {
93
- transform: scale(1);
94
- }
95
- }
96
- }
97
- .radio-content {
98
- p {
99
- line-height: 20px;
100
- }
101
- .label {
102
- font-weight: 500;
103
- }
104
- }
105
- }
@@ -67,7 +67,7 @@ $fixedWidth: (500, 600);
67
67
  display: flex;
68
68
  align-items: center;
69
69
  justify-content: flex-end;
70
- gap: 16px;
70
+ gap: 8px;
71
71
  padding: 16px 24px;
72
72
  box-shadow: var(--container-shadow);
73
73
  z-index: 2;
@@ -90,10 +90,6 @@ $fixedWidth: (500, 600);
90
90
  .pullover-content,
91
91
  .pullover-footer {
92
92
  padding: 8px 16px;
93
- gap: 8px;
94
- }
95
- .pullover-footer .main-actions {
96
- gap: 8px;
97
93
  }
98
94
  }
99
95
  }
@@ -1,5 +1,18 @@
1
1
  @use '../variables/bp';
2
2
 
3
+ // Scrollable table container
4
+
5
+ // .iui-table {
6
+ // display: flex;
7
+ // flex-direction: column;
8
+ // flex: 1;
9
+ // overflow: auto;
10
+ // thead {
11
+ // position: sticky;
12
+ // top: 0;
13
+ // }
14
+ // }
15
+
3
16
  table {
4
17
  border-spacing: 0px;
5
18
  // border-collapse: collapse;
@@ -1,2 +0,0 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useTranslation as r}from"react-i18next";import{Link as a}from"react-router";import{Button as c}from"./index.js";import"@fortawesome/react-fontawesome";import"@hello-pangea/dnd";import"clsx";import"dayjs";import"react-toastify";import"react";import"react-dom";import"react-calendar";import"react-select";import"react-select-async-paginate";import"react-select/async-creatable";const o=()=>{const{t:o}=r();return e("div",{className:"full-screen-page",children:[e("div",{id:"content",children:[t("h1",{children:o("NoAccessPage")}),t("p",{className:"subtitle",children:o("NoAccessPageInfo")})]}),t("p",{id:"img",className:"img-403",children:"403"}),t("div",{id:"actions",children:t(a,{to:"/",children:t(c,{label:o("ReturnToHomepage")})})})]})};export{o as default};
2
- //# sourceMappingURL=NoAccessPage-DTPU8bP2.js.map