@equinor/cpl-generic-pages-react 1.0.0 → 1.0.2
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -47
- package/dist/index.mjs +18 -50
- package/package.json +22 -15
package/dist/index.d.mts
CHANGED
|
@@ -75,9 +75,9 @@ declare function LoginPage({ appName, action, buttonText, buttonProps, customLog
|
|
|
75
75
|
type MaintenancePageProps = {
|
|
76
76
|
appName: string;
|
|
77
77
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
* Information shown to the user about the maintenance.
|
|
79
|
+
* E.g. "The application is currently under maintenance. Please try again later."
|
|
80
|
+
*/
|
|
81
81
|
infoText: string;
|
|
82
82
|
/**
|
|
83
83
|
* If omitted, it falls back to Equinor Logo if not defined will be used.
|
package/dist/index.d.ts
CHANGED
|
@@ -75,9 +75,9 @@ declare function LoginPage({ appName, action, buttonText, buttonProps, customLog
|
|
|
75
75
|
type MaintenancePageProps = {
|
|
76
76
|
appName: string;
|
|
77
77
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
* Information shown to the user about the maintenance.
|
|
79
|
+
* E.g. "The application is currently under maintenance. Please try again later."
|
|
80
|
+
*/
|
|
81
81
|
infoText: string;
|
|
82
82
|
/**
|
|
83
83
|
* If omitted, it falls back to Equinor Logo if not defined will be used.
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
var __objRest = (source, exclude) => {
|
|
24
|
-
var target = {};
|
|
25
|
-
for (var prop in source)
|
|
26
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
-
target[prop] = source[prop];
|
|
28
|
-
if (source != null && __getOwnPropSymbols)
|
|
29
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
-
target[prop] = source[prop];
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
6
|
var __export = (target, all) => {
|
|
36
7
|
for (var name in all)
|
|
37
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -68,27 +39,23 @@ var import_styled_components2 = require("styled-components");
|
|
|
68
39
|
var import_eds_core_react = require("@equinor/eds-core-react");
|
|
69
40
|
var import_styled_components = require("styled-components");
|
|
70
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
71
|
-
function AuthButton(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"action",
|
|
78
|
-
"isLoading",
|
|
79
|
-
"children"
|
|
80
|
-
]);
|
|
42
|
+
function AuthButton({
|
|
43
|
+
action,
|
|
44
|
+
isLoading = false,
|
|
45
|
+
children,
|
|
46
|
+
...buttonProps
|
|
47
|
+
}) {
|
|
81
48
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
82
49
|
StyledButton,
|
|
83
|
-
|
|
50
|
+
{
|
|
84
51
|
onClick: typeof action === "function" ? action : void 0,
|
|
85
|
-
href: typeof action === "function" ? void 0 : action.toString()
|
|
86
|
-
|
|
52
|
+
href: typeof action === "function" ? void 0 : action.toString(),
|
|
53
|
+
...buttonProps,
|
|
87
54
|
children: [
|
|
88
55
|
isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_eds_core_react.DotProgress, {}) }),
|
|
89
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerText, { $isLoading: isLoading, children })
|
|
90
57
|
]
|
|
91
|
-
}
|
|
58
|
+
}
|
|
92
59
|
);
|
|
93
60
|
}
|
|
94
61
|
var InnerText = import_styled_components.styled.span`
|
|
@@ -157,7 +124,7 @@ function AuthPage({
|
|
|
157
124
|
}
|
|
158
125
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PageWrapper, { children: [
|
|
159
126
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(HeaderWrapper, { children: [
|
|
160
|
-
customLogo
|
|
127
|
+
customLogo ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EquinorLogo, { size: 48, ...defaultLogoProps }),
|
|
161
128
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
162
129
|
import_eds_core_react2.Typography,
|
|
163
130
|
{
|
|
@@ -182,7 +149,7 @@ function AuthPage({
|
|
|
182
149
|
children: description
|
|
183
150
|
}
|
|
184
151
|
),
|
|
185
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AuthButton,
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AuthButton, { action, isLoading, ...buttonProps, children: buttonText })
|
|
186
153
|
] })
|
|
187
154
|
] });
|
|
188
155
|
}
|
|
@@ -253,7 +220,7 @@ function MaintenancePage({
|
|
|
253
220
|
}) {
|
|
254
221
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(PageWrapper, { children: [
|
|
255
222
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(HeaderWrapper, { children: [
|
|
256
|
-
customLogo
|
|
223
|
+
customLogo ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(EquinorLogo, { size: 48, ...defaultLogoProps }),
|
|
257
224
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
258
225
|
import_eds_core_react3.Typography,
|
|
259
226
|
{
|
|
@@ -273,7 +240,11 @@ function MaintenancePage({
|
|
|
273
240
|
{
|
|
274
241
|
variant: "h6",
|
|
275
242
|
as: "p",
|
|
276
|
-
style: {
|
|
243
|
+
style: {
|
|
244
|
+
color: import_eds_tokens3.tokens.colors.text.static_icons__default.rgba,
|
|
245
|
+
margin: 0,
|
|
246
|
+
textAlign: "center"
|
|
247
|
+
},
|
|
277
248
|
children: infoText
|
|
278
249
|
}
|
|
279
250
|
) })
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
1
|
// src/auth/AuthPage/AuthPage.tsx
|
|
34
2
|
import { Typography } from "@equinor/eds-core-react";
|
|
35
3
|
import { tokens as tokens2 } from "@equinor/eds-tokens";
|
|
@@ -39,27 +7,23 @@ import { styled as styled2 } from "styled-components";
|
|
|
39
7
|
import { Button, DotProgress } from "@equinor/eds-core-react";
|
|
40
8
|
import { styled } from "styled-components";
|
|
41
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
42
|
-
function AuthButton(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"action",
|
|
49
|
-
"isLoading",
|
|
50
|
-
"children"
|
|
51
|
-
]);
|
|
10
|
+
function AuthButton({
|
|
11
|
+
action,
|
|
12
|
+
isLoading = false,
|
|
13
|
+
children,
|
|
14
|
+
...buttonProps
|
|
15
|
+
}) {
|
|
52
16
|
return /* @__PURE__ */ jsxs(
|
|
53
17
|
StyledButton,
|
|
54
|
-
|
|
18
|
+
{
|
|
55
19
|
onClick: typeof action === "function" ? action : void 0,
|
|
56
|
-
href: typeof action === "function" ? void 0 : action.toString()
|
|
57
|
-
|
|
20
|
+
href: typeof action === "function" ? void 0 : action.toString(),
|
|
21
|
+
...buttonProps,
|
|
58
22
|
children: [
|
|
59
23
|
isLoading && /* @__PURE__ */ jsx(LoadingWrapper, { children: /* @__PURE__ */ jsx(DotProgress, {}) }),
|
|
60
24
|
/* @__PURE__ */ jsx(InnerText, { $isLoading: isLoading, children })
|
|
61
25
|
]
|
|
62
|
-
}
|
|
26
|
+
}
|
|
63
27
|
);
|
|
64
28
|
}
|
|
65
29
|
var InnerText = styled.span`
|
|
@@ -128,7 +92,7 @@ function AuthPage({
|
|
|
128
92
|
}
|
|
129
93
|
return /* @__PURE__ */ jsxs2(PageWrapper, { children: [
|
|
130
94
|
/* @__PURE__ */ jsxs2(HeaderWrapper, { children: [
|
|
131
|
-
customLogo
|
|
95
|
+
customLogo ?? /* @__PURE__ */ jsx3(EquinorLogo, { size: 48, ...defaultLogoProps }),
|
|
132
96
|
/* @__PURE__ */ jsx3(
|
|
133
97
|
Typography,
|
|
134
98
|
{
|
|
@@ -153,7 +117,7 @@ function AuthPage({
|
|
|
153
117
|
children: description
|
|
154
118
|
}
|
|
155
119
|
),
|
|
156
|
-
/* @__PURE__ */ jsx3(AuthButton,
|
|
120
|
+
/* @__PURE__ */ jsx3(AuthButton, { action, isLoading, ...buttonProps, children: buttonText })
|
|
157
121
|
] })
|
|
158
122
|
] });
|
|
159
123
|
}
|
|
@@ -224,7 +188,7 @@ function MaintenancePage({
|
|
|
224
188
|
}) {
|
|
225
189
|
return /* @__PURE__ */ jsxs3(PageWrapper, { children: [
|
|
226
190
|
/* @__PURE__ */ jsxs3(HeaderWrapper, { children: [
|
|
227
|
-
customLogo
|
|
191
|
+
customLogo ?? /* @__PURE__ */ jsx5(EquinorLogo, { size: 48, ...defaultLogoProps }),
|
|
228
192
|
/* @__PURE__ */ jsx5(
|
|
229
193
|
Typography2,
|
|
230
194
|
{
|
|
@@ -244,7 +208,11 @@ function MaintenancePage({
|
|
|
244
208
|
{
|
|
245
209
|
variant: "h6",
|
|
246
210
|
as: "p",
|
|
247
|
-
style: {
|
|
211
|
+
style: {
|
|
212
|
+
color: tokens3.colors.text.static_icons__default.rgba,
|
|
213
|
+
margin: 0,
|
|
214
|
+
textAlign: "center"
|
|
215
|
+
},
|
|
248
216
|
children: infoText
|
|
249
217
|
}
|
|
250
218
|
) })
|
package/package.json
CHANGED
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/cpl-generic-pages-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
8
15
|
"files": [
|
|
9
16
|
"dist/**"
|
|
10
17
|
],
|
|
11
18
|
"dependencies": {
|
|
12
|
-
"@equinor/eds-icons": "
|
|
13
|
-
"@equinor/eds-tokens": "
|
|
19
|
+
"@equinor/eds-icons": "1.2.1",
|
|
20
|
+
"@equinor/eds-tokens": "2.1.1"
|
|
14
21
|
},
|
|
15
22
|
"devDependencies": {
|
|
16
|
-
"@equinor/eds-core-react": "
|
|
17
|
-
"@storybook/react": "
|
|
18
|
-
"@types/react": "
|
|
19
|
-
"@types/react-dom": "
|
|
20
|
-
"@types/styled-components": "
|
|
21
|
-
"eslint": "
|
|
22
|
-
"react": "
|
|
23
|
-
"react-dom": "
|
|
24
|
-
"styled-components": "
|
|
25
|
-
"tsup": "
|
|
26
|
-
"@equinor/cpl-eslint-config": "1.0.
|
|
27
|
-
"@equinor/cpl-typescript-config": "0.0.
|
|
23
|
+
"@equinor/eds-core-react": "2.3.4",
|
|
24
|
+
"@storybook/react-vite": "10.2.8",
|
|
25
|
+
"@types/react": "19.2.13",
|
|
26
|
+
"@types/react-dom": "19.2.3",
|
|
27
|
+
"@types/styled-components": "5.1.36",
|
|
28
|
+
"eslint": "10.0.0",
|
|
29
|
+
"react": "19.2.4",
|
|
30
|
+
"react-dom": "19.2.4",
|
|
31
|
+
"styled-components": "6.3.9",
|
|
32
|
+
"tsup": "8.5.1",
|
|
33
|
+
"@equinor/cpl-eslint-config": "1.0.1",
|
|
34
|
+
"@equinor/cpl-typescript-config": "0.0.3"
|
|
28
35
|
},
|
|
29
36
|
"peerDependencies": {
|
|
30
37
|
"@equinor/eds-core-react": ">=2.2.0",
|