@equinor/cpl-generic-pages-react 0.0.2 → 0.1.0

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/dist/index.d.mts CHANGED
@@ -1,5 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as styled_components_dist_types from 'styled-components/dist/types';
2
+ import * as styled_components from 'styled-components';
3
+ import * as react from 'react';
2
4
  import { SVGAttributes, ReactNode } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
6
  import { ButtonProps, IconProps } from '@equinor/eds-core-react';
4
7
 
5
8
  interface AuthButtonProps extends Omit<ButtonProps, 'onClick' | 'href'> {
@@ -56,6 +59,9 @@ type AuthPageProps = {
56
59
  * `LogoutPage` components.
57
60
  */
58
61
  declare function AuthPage({ appName, customLogo, action, defaultLogoProps, buttonProps, buttonText, description, isLoading, }: AuthPageProps): react_jsx_runtime.JSX.Element;
62
+ declare const ContentWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
63
+ declare const PageWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
64
+ declare const HeaderWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
59
65
 
60
66
  type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | 'action'> & {
61
67
  /**
@@ -66,4 +72,27 @@ type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | '
66
72
  declare const DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
67
73
  declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, isLoading, }: LoginPageProps): react_jsx_runtime.JSX.Element;
68
74
 
69
- export { AuthPage, type AuthPageProps, DEFAULT_SIGNED_OUT_TEXT, LoginPage, type LoginPageProps };
75
+ type MaintenancePageProps = {
76
+ appName: string;
77
+ /**
78
+ * Information shown to the user about the maintenance.
79
+ * E.g. "The application is currently under maintenance. Please try again later."
80
+ */
81
+ infoText: string;
82
+ /**
83
+ * If omitted, it falls back to Equinor Logo if not defined will be used.
84
+ */
85
+ customLogo?: ReactNode;
86
+ /**
87
+ * Custom props for the default Equinor logo. Overrides the default props.
88
+ *
89
+ * A use case could be to set the `fillColor` when using other color schemes.
90
+ */
91
+ defaultLogoProps?: Partial<EquinorLogoProps>;
92
+ };
93
+ /**
94
+ * Page to display when the application is in maintenance mode.
95
+ */
96
+ declare function MaintenancePage({ appName, infoText, customLogo, defaultLogoProps, }: MaintenancePageProps): react_jsx_runtime.JSX.Element;
97
+
98
+ export { AuthPage, type AuthPageProps, ContentWrapper, DEFAULT_SIGNED_OUT_TEXT, HeaderWrapper, LoginPage, type LoginPageProps, MaintenancePage, type MaintenancePageProps, PageWrapper };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as styled_components_dist_types from 'styled-components/dist/types';
2
+ import * as styled_components from 'styled-components';
3
+ import * as react from 'react';
2
4
  import { SVGAttributes, ReactNode } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
6
  import { ButtonProps, IconProps } from '@equinor/eds-core-react';
4
7
 
5
8
  interface AuthButtonProps extends Omit<ButtonProps, 'onClick' | 'href'> {
@@ -56,6 +59,9 @@ type AuthPageProps = {
56
59
  * `LogoutPage` components.
57
60
  */
58
61
  declare function AuthPage({ appName, customLogo, action, defaultLogoProps, buttonProps, buttonText, description, isLoading, }: AuthPageProps): react_jsx_runtime.JSX.Element;
62
+ declare const ContentWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
63
+ declare const PageWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
64
+ declare const HeaderWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
59
65
 
60
66
  type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | 'action'> & {
61
67
  /**
@@ -66,4 +72,27 @@ type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | '
66
72
  declare const DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
67
73
  declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, isLoading, }: LoginPageProps): react_jsx_runtime.JSX.Element;
68
74
 
69
- export { AuthPage, type AuthPageProps, DEFAULT_SIGNED_OUT_TEXT, LoginPage, type LoginPageProps };
75
+ type MaintenancePageProps = {
76
+ appName: string;
77
+ /**
78
+ * Information shown to the user about the maintenance.
79
+ * E.g. "The application is currently under maintenance. Please try again later."
80
+ */
81
+ infoText: string;
82
+ /**
83
+ * If omitted, it falls back to Equinor Logo if not defined will be used.
84
+ */
85
+ customLogo?: ReactNode;
86
+ /**
87
+ * Custom props for the default Equinor logo. Overrides the default props.
88
+ *
89
+ * A use case could be to set the `fillColor` when using other color schemes.
90
+ */
91
+ defaultLogoProps?: Partial<EquinorLogoProps>;
92
+ };
93
+ /**
94
+ * Page to display when the application is in maintenance mode.
95
+ */
96
+ declare function MaintenancePage({ appName, infoText, customLogo, defaultLogoProps, }: MaintenancePageProps): react_jsx_runtime.JSX.Element;
97
+
98
+ export { AuthPage, type AuthPageProps, ContentWrapper, DEFAULT_SIGNED_OUT_TEXT, HeaderWrapper, LoginPage, type LoginPageProps, MaintenancePage, type MaintenancePageProps, PageWrapper };
package/dist/index.js CHANGED
@@ -50,8 +50,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
50
50
  var index_exports = {};
51
51
  __export(index_exports, {
52
52
  AuthPage: () => AuthPage,
53
+ ContentWrapper: () => ContentWrapper,
53
54
  DEFAULT_SIGNED_OUT_TEXT: () => DEFAULT_SIGNED_OUT_TEXT,
54
- LoginPage: () => LoginPage
55
+ HeaderWrapper: () => HeaderWrapper,
56
+ LoginPage: () => LoginPage,
57
+ MaintenancePage: () => MaintenancePage,
58
+ PageWrapper: () => PageWrapper
55
59
  });
56
60
  module.exports = __toCommonJS(index_exports);
57
61
 
@@ -110,7 +114,7 @@ var StyledButton = (0, import_styled_components.styled)(import_eds_core_react.Bu
110
114
  position: relative;
111
115
  `;
112
116
 
113
- // src/auth/EquinorLogo.tsx
117
+ // src/EquinorLogo.tsx
114
118
  var import_eds_tokens = require("@equinor/eds-tokens");
115
119
  var import_jsx_runtime2 = require("react/jsx-runtime");
116
120
  function EquinorLogo({
@@ -236,9 +240,52 @@ function LoginPage({
236
240
  }
237
241
  );
238
242
  }
243
+
244
+ // src/MaintenancePage/MaintenancePage.tsx
245
+ var import_eds_core_react3 = require("@equinor/eds-core-react");
246
+ var import_eds_tokens3 = require("@equinor/eds-tokens");
247
+ var import_jsx_runtime5 = require("react/jsx-runtime");
248
+ function MaintenancePage({
249
+ appName,
250
+ infoText,
251
+ customLogo,
252
+ defaultLogoProps
253
+ }) {
254
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(PageWrapper, { children: [
255
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(HeaderWrapper, { children: [
256
+ customLogo != null ? customLogo : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(EquinorLogo, __spreadValues({ size: 48 }, defaultLogoProps)),
257
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
258
+ import_eds_core_react3.Typography,
259
+ {
260
+ variant: "h3",
261
+ as: "h1",
262
+ style: {
263
+ color: import_eds_tokens3.tokens.colors.text.static_icons__default.rgba,
264
+ margin: 0,
265
+ fontWeight: 500
266
+ },
267
+ children: appName
268
+ }
269
+ )
270
+ ] }),
271
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ContentWrapper, { style: { width: "400px" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
272
+ import_eds_core_react3.Typography,
273
+ {
274
+ variant: "h6",
275
+ as: "p",
276
+ style: { color: import_eds_tokens3.tokens.colors.text.static_icons__default.rgba, margin: 0, textAlign: "center" },
277
+ children: infoText
278
+ }
279
+ ) })
280
+ ] });
281
+ }
239
282
  // Annotate the CommonJS export names for ESM import in node:
240
283
  0 && (module.exports = {
241
284
  AuthPage,
285
+ ContentWrapper,
242
286
  DEFAULT_SIGNED_OUT_TEXT,
243
- LoginPage
287
+ HeaderWrapper,
288
+ LoginPage,
289
+ MaintenancePage,
290
+ PageWrapper
244
291
  });
package/dist/index.mjs CHANGED
@@ -85,7 +85,7 @@ var StyledButton = styled(Button)`
85
85
  position: relative;
86
86
  `;
87
87
 
88
- // src/auth/EquinorLogo.tsx
88
+ // src/EquinorLogo.tsx
89
89
  import { tokens } from "@equinor/eds-tokens";
90
90
  import { jsx as jsx2 } from "react/jsx-runtime";
91
91
  function EquinorLogo({
@@ -211,8 +211,51 @@ function LoginPage({
211
211
  }
212
212
  );
213
213
  }
214
+
215
+ // src/MaintenancePage/MaintenancePage.tsx
216
+ import { Typography as Typography2 } from "@equinor/eds-core-react";
217
+ import { tokens as tokens3 } from "@equinor/eds-tokens";
218
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
219
+ function MaintenancePage({
220
+ appName,
221
+ infoText,
222
+ customLogo,
223
+ defaultLogoProps
224
+ }) {
225
+ return /* @__PURE__ */ jsxs3(PageWrapper, { children: [
226
+ /* @__PURE__ */ jsxs3(HeaderWrapper, { children: [
227
+ customLogo != null ? customLogo : /* @__PURE__ */ jsx5(EquinorLogo, __spreadValues({ size: 48 }, defaultLogoProps)),
228
+ /* @__PURE__ */ jsx5(
229
+ Typography2,
230
+ {
231
+ variant: "h3",
232
+ as: "h1",
233
+ style: {
234
+ color: tokens3.colors.text.static_icons__default.rgba,
235
+ margin: 0,
236
+ fontWeight: 500
237
+ },
238
+ children: appName
239
+ }
240
+ )
241
+ ] }),
242
+ /* @__PURE__ */ jsx5(ContentWrapper, { style: { width: "400px" }, children: /* @__PURE__ */ jsx5(
243
+ Typography2,
244
+ {
245
+ variant: "h6",
246
+ as: "p",
247
+ style: { color: tokens3.colors.text.static_icons__default.rgba, margin: 0, textAlign: "center" },
248
+ children: infoText
249
+ }
250
+ ) })
251
+ ] });
252
+ }
214
253
  export {
215
254
  AuthPage,
255
+ ContentWrapper,
216
256
  DEFAULT_SIGNED_OUT_TEXT,
217
- LoginPage
257
+ HeaderWrapper,
258
+ LoginPage,
259
+ MaintenancePage,
260
+ PageWrapper
218
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/cpl-generic-pages-react",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -19,12 +19,12 @@
19
19
  "@types/react": "^18.3.18",
20
20
  "@types/react-dom": "^18.3.5",
21
21
  "@types/styled-components": "^5.1.34",
22
- "eslint": "^8.57.1",
22
+ "eslint": "^9.21.0",
23
23
  "react": "^18.2.0",
24
24
  "react-dom": "^18.2.0",
25
25
  "styled-components": "^6.1.14",
26
26
  "tsup": "^8.3.6",
27
- "eslint-config-custom": "0.0.6",
27
+ "eslint-config-custom": "0.0.7",
28
28
  "tsconfig": "0.0.1"
29
29
  },
30
30
  "peerDependencies": {