@inceptionbg/iui 1.0.0 → 1.0.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inceptionbg/iui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "UI components, elements & utils for Inception ecosystem",
5
5
  "files": [
6
6
  "src"
@@ -1,10 +1,9 @@
1
1
  import { FC, useState } from "react";
2
2
  import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
3
  import clsx from "clsx";
4
- import { ITab } from "types/ITab";
5
- import { faArrowsToLine } from "icons/light/faArrowsToLine";
6
- import { faArrowsUpDown } from "icons/light/faArrowsUpDown";
7
- import { Collapse } from "Elements/Helper/Collapse";
4
+ import { ITab } from "../../types/ITab";
5
+ import { Collapse } from "../Helper/Collapse";
6
+ import { faArrowsToLine, faArrowsUpDown } from "../../icons/light";
8
7
 
9
8
  interface Props {
10
9
  tabs: ITab[];
@@ -2,7 +2,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
2
2
  import clsx from "clsx";
3
3
  import { FC, ReactNode } from "react";
4
4
  import "./alert.scss";
5
- import { infoIcons } from "utils/icons";
5
+ import { infoIcons } from "../../utils/icons";
6
6
 
7
7
  interface Props {
8
8
  text?: string;
@@ -3,10 +3,10 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
3
  import clsx from "clsx";
4
4
  import { FC, ReactNode, useCallback, useEffect, useRef } from "react";
5
5
  import { createPortal } from "react-dom";
6
- import { faTriangleExclamation } from "icons/regular/faTriangleExclamation";
7
- import { ConditionalWrapper } from "Elements/Wrappers/ConditionalWrapper";
8
- import { faCircleInfo } from "icons/regular/faCircleInfo";
9
- import { Button } from "Elements/Button/Button";
6
+ import { faCircleInfo } from "../../icons/regular/faCircleInfo";
7
+ import { faTriangleExclamation } from "../../icons/regular/faTriangleExclamation";
8
+ import { ConditionalWrapper } from "../Wrappers/ConditionalWrapper";
9
+ import { Button } from "../Button/Button";
10
10
 
11
11
  interface Props {
12
12
  title?: string;
@@ -1,6 +1,6 @@
1
- import { Button } from "Elements/Button/Button";
2
1
  import clsx from "clsx";
3
2
  import { FC, FormEvent, ReactNode } from "react";
3
+ import { Button } from "../Button/Button";
4
4
 
5
5
  export interface IFormWrapper {
6
6
  isLoading: boolean;
package/src/index.ts CHANGED
@@ -86,9 +86,9 @@ import { NoAccessInfo } from "./Elements/Helper/NoAccessInfo";
86
86
  // import { TableFooter } from "./Elements/Table/Components/TableFooter";
87
87
  // import { Tabs } from "./Elements/Tabs/Tabs";
88
88
  import { Tooltip } from "./Elements/Tooltip/Tooltip";
89
- // import { ConditionalWrapper } from "./Elements/Wrappers/ConditionalWrapper";
90
- // import { FullPageWrapper } from "./Elements/Wrappers/FullPageWrapper";
91
- // import { FormWrapper } from "./Elements/Wrappers/FormWrapper";
89
+ import { ConditionalWrapper } from "./Elements/Wrappers/ConditionalWrapper";
90
+ import { FullPageWrapper } from "./Elements/Wrappers/FullPageWrapper";
91
+ import { FormWrapper } from "./Elements/Wrappers/FormWrapper";
92
92
  // import { PageWrapper } from "./Elements/Wrappers/PageWrapper";
93
93
  // import { ItemActionsMenu } from "./Elements/Table/Components/Edit/ItemActionsMenu";
94
94
  // import { ItemEditOptionsButtons } from "./Elements/Table/Components/Edit/ItemEditOptionsButtons";
@@ -130,9 +130,9 @@ export {
130
130
  // TableFooter,
131
131
  // Tabs,
132
132
  Tooltip,
133
- // ConditionalWrapper,
134
- // FullPageWrapper,
135
- // FormWrapper,
133
+ ConditionalWrapper,
134
+ FullPageWrapper,
135
+ FormWrapper,
136
136
  // PageWrapper,
137
137
  };
138
138
  export {
@@ -1,148 +0,0 @@
1
- import { FC, ReactElement, ReactNode, useState } from "react";
2
- import { useNavigate } from "react-router-dom";
3
- import { faArrowLeft } from "../../icons/solid/faArrowLeft";
4
- import { faEllipsisVertical } from "../../icons/solid/faEllipsisVertical";
5
- import { IHeaderAction } from "../../types/IHeaderAction";
6
- import { Button } from "../Button/Button";
7
- import { Menu } from "../Menu/Menu";
8
- import { MenuItem } from "../Menu/MenuItem";
9
- import { NoAccessInfo } from "../Helper/NoAccessInfo";
10
- import { Loader } from "../Loader/Loader";
11
- import { ConditionalWrapper } from "./ConditionalWrapper";
12
- import { Link } from "react-router-dom";
13
- import { IconButton } from "../Button/IconButton";
14
-
15
- export interface IPageWrapper {
16
- breadcrumbs: string[];
17
- actions?: IHeaderAction[];
18
- moreActions?: IHeaderAction[];
19
- showBackButton?: boolean;
20
- noAccess?: boolean;
21
- isLoading?: boolean;
22
- loaderLogo?: string;
23
- footer?: ReactElement;
24
- translations?: {
25
- NoAccessTitle?: string;
26
- ReturnToHomepage?: string;
27
- };
28
- children?: ReactNode;
29
- }
30
- export const PageWrapper: FC<IPageWrapper> = ({
31
- breadcrumbs,
32
- actions,
33
- moreActions,
34
- showBackButton,
35
- noAccess,
36
- isLoading,
37
- loaderLogo,
38
- footer,
39
- translations,
40
- children,
41
- }) => {
42
- const [isMoreActionsOpen, setIsMoreActionsOpen] = useState(false);
43
- const navigate = useNavigate();
44
-
45
- return (
46
- <ConditionalWrapper
47
- condition={!!isLoading}
48
- wrapper={(children) => (
49
- <Loader isLoading logo={loaderLogo} fullWidth>
50
- {children}
51
- </Loader>
52
- )}
53
- >
54
- <div className="page-container">
55
- <div className="page-header">
56
- <div className="flex align-center gap-3">
57
- {showBackButton && (
58
- <IconButton
59
- icon={faArrowLeft}
60
- className="c-primary"
61
- onClick={() => navigate(-1)}
62
- />
63
- )}
64
- {/* ////// BREADCRUMBS ////// */}
65
- <div className="breadcrumbs">
66
- {breadcrumbs.map(
67
- (e, i) =>
68
- e && (
69
- <h1 key={e}>{i + 1 < breadcrumbs.length ? `${e} /` : e}</h1>
70
- )
71
- )}
72
- </div>
73
- </div>
74
- {/* ////// ACTIONS ////// */}
75
- {!noAccess && (
76
- <div className="flex align-center">
77
- {actions?.map(
78
- (action) =>
79
- !action.hidden && (
80
- <ConditionalWrapper
81
- key={action.label}
82
- condition={!!action.to}
83
- wrapper={(children) => (
84
- <Link to={action.to!}>{children}</Link>
85
- )}
86
- >
87
- <Button key={action.label} {...action} className="ml-2" />
88
- </ConditionalWrapper>
89
- )
90
- )}
91
- {!!moreActions?.length && (
92
- <Menu
93
- isOpen={isMoreActionsOpen}
94
- onClose={() => setIsMoreActionsOpen(false)}
95
- placementX="right"
96
- renderButton={(ref) => (
97
- <IconButton
98
- ref={ref}
99
- icon={faEllipsisVertical}
100
- active={isMoreActionsOpen}
101
- onClick={() => setIsMoreActionsOpen(!isMoreActionsOpen)}
102
- />
103
- )}
104
- >
105
- {moreActions.map(
106
- (action) =>
107
- !action.hidden && (
108
- <MenuItem
109
- key={action.label}
110
- label={action.label}
111
- icon={action.icon}
112
- iconRotation={action.iconRotation}
113
- disabled={action.disabled}
114
- withDevider
115
- to={action.to}
116
- onClick={
117
- action.onClick
118
- ? () => {
119
- action.onClick!();
120
- setIsMoreActionsOpen(false);
121
- }
122
- : undefined
123
- }
124
- />
125
- )
126
- )}
127
- </Menu>
128
- )}
129
- </div>
130
- )}
131
- </div>
132
- <div className="page-content">
133
- <div className="flex-grow">
134
- {!noAccess ? (
135
- children
136
- ) : (
137
- <NoAccessInfo
138
- title={translations?.NoAccessTitle}
139
- buttonLabel={translations?.ReturnToHomepage}
140
- />
141
- )}
142
- </div>
143
- {footer}
144
- </div>
145
- </div>
146
- </ConditionalWrapper>
147
- );
148
- };