@equinor/cpl-generic-pages-react 0.0.1 → 0.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 CHANGED
@@ -45,7 +45,7 @@ type AuthPageProps = {
45
45
  */
46
46
  description?: string;
47
47
  /**
48
- * E.g. `Sign in`
48
+ * E.g. `Log in`
49
49
  */
50
50
  buttonText: string;
51
51
  isLoading?: boolean;
@@ -64,6 +64,6 @@ type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | '
64
64
  showDefaultSignedOutText?: boolean;
65
65
  };
66
66
  declare const DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
67
- declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, }: LoginPageProps): react_jsx_runtime.JSX.Element;
67
+ declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, isLoading, }: LoginPageProps): react_jsx_runtime.JSX.Element;
68
68
 
69
69
  export { AuthPage, type AuthPageProps, DEFAULT_SIGNED_OUT_TEXT, LoginPage, type LoginPageProps };
package/dist/index.d.ts CHANGED
@@ -45,7 +45,7 @@ type AuthPageProps = {
45
45
  */
46
46
  description?: string;
47
47
  /**
48
- * E.g. `Sign in`
48
+ * E.g. `Log in`
49
49
  */
50
50
  buttonText: string;
51
51
  isLoading?: boolean;
@@ -64,6 +64,6 @@ type LoginPageProps = Partial<AuthPageProps> & Pick<AuthPageProps, 'appName' | '
64
64
  showDefaultSignedOutText?: boolean;
65
65
  };
66
66
  declare const DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
67
- declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, }: LoginPageProps): react_jsx_runtime.JSX.Element;
67
+ declare function LoginPage({ appName, action, buttonText, buttonProps, customLogo, defaultLogoProps, description, showDefaultSignedOutText, isLoading, }: LoginPageProps): react_jsx_runtime.JSX.Element;
68
68
 
69
69
  export { AuthPage, type AuthPageProps, DEFAULT_SIGNED_OUT_TEXT, LoginPage, type LoginPageProps };
package/dist/index.js CHANGED
@@ -82,14 +82,14 @@ function AuthButton(_a) {
82
82
  }, buttonProps), {
83
83
  children: [
84
84
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_eds_core_react.DotProgress, {}) }),
85
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerText, { isLoading, children })
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerText, { $isLoading: isLoading, children })
86
86
  ]
87
87
  })
88
88
  );
89
89
  }
90
90
  var InnerText = import_styled_components.styled.span`
91
91
  all: inherit;
92
- opacity: ${({ isLoading }) => isLoading ? 0 : 1};
92
+ opacity: ${({ $isLoading }) => $isLoading ? 0 : 1};
93
93
  `;
94
94
  var LoadingWrapper = import_styled_components.styled.div`
95
95
  background: inherit;
@@ -154,10 +154,30 @@ function AuthPage({
154
154
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PageWrapper, { children: [
155
155
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(HeaderWrapper, { children: [
156
156
  customLogo != null ? customLogo : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EquinorLogo, __spreadValues({ size: 48 }, defaultLogoProps)),
157
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledHeading, { variant: "h3", as: "h1", children: appName })
157
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
158
+ import_eds_core_react2.Typography,
159
+ {
160
+ variant: "h3",
161
+ as: "h1",
162
+ style: {
163
+ color: import_eds_tokens2.tokens.colors.text.static_icons__default.rgba,
164
+ margin: 0,
165
+ fontWeight: 500
166
+ },
167
+ children: appName
168
+ }
169
+ )
158
170
  ] }),
159
171
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(ContentWrapper, { children: [
160
- description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledDescription, { variant: "h6", as: "p", children: description }),
172
+ description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
173
+ import_eds_core_react2.Typography,
174
+ {
175
+ variant: "h6",
176
+ as: "p",
177
+ style: { color: import_eds_tokens2.tokens.colors.text.static_icons__default.rgba, margin: 0 },
178
+ children: description
179
+ }
180
+ ),
161
181
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AuthButton, __spreadProps(__spreadValues({ action, isLoading }, buttonProps), { children: buttonText }))
162
182
  ] })
163
183
  ] });
@@ -187,15 +207,6 @@ var HeaderWrapper = import_styled_components2.styled.div`
187
207
 
188
208
  gap: 10px;
189
209
  `;
190
- var StyledHeading = (0, import_styled_components2.styled)(import_eds_core_react2.Typography)`
191
- color: ${import_eds_tokens2.tokens.colors.text.static_icons__default.rgba};
192
- margin: 0;
193
- font-weight: 500;
194
- `;
195
- var StyledDescription = (0, import_styled_components2.styled)(import_eds_core_react2.Typography)`
196
- color: ${import_eds_tokens2.tokens.colors.text.static_icons__default.rgba};
197
- margin: 0;
198
- `;
199
210
 
200
211
  // src/auth/LoginPage/LoginPage.tsx
201
212
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -203,12 +214,13 @@ var DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
203
214
  function LoginPage({
204
215
  appName,
205
216
  action,
206
- buttonText = "Sign in",
217
+ buttonText = "Log in",
207
218
  buttonProps,
208
219
  customLogo,
209
220
  defaultLogoProps,
210
221
  description,
211
- showDefaultSignedOutText
222
+ showDefaultSignedOutText,
223
+ isLoading
212
224
  }) {
213
225
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
214
226
  AuthPage,
@@ -219,6 +231,7 @@ function LoginPage({
219
231
  buttonProps,
220
232
  customLogo,
221
233
  defaultLogoProps,
234
+ isLoading,
222
235
  description: typeof description === "string" ? description : showDefaultSignedOutText ? DEFAULT_SIGNED_OUT_TEXT : description
223
236
  }
224
237
  );
package/dist/index.mjs CHANGED
@@ -57,14 +57,14 @@ function AuthButton(_a) {
57
57
  }, buttonProps), {
58
58
  children: [
59
59
  isLoading && /* @__PURE__ */ jsx(LoadingWrapper, { children: /* @__PURE__ */ jsx(DotProgress, {}) }),
60
- /* @__PURE__ */ jsx(InnerText, { isLoading, children })
60
+ /* @__PURE__ */ jsx(InnerText, { $isLoading: isLoading, children })
61
61
  ]
62
62
  })
63
63
  );
64
64
  }
65
65
  var InnerText = styled.span`
66
66
  all: inherit;
67
- opacity: ${({ isLoading }) => isLoading ? 0 : 1};
67
+ opacity: ${({ $isLoading }) => $isLoading ? 0 : 1};
68
68
  `;
69
69
  var LoadingWrapper = styled.div`
70
70
  background: inherit;
@@ -129,10 +129,30 @@ function AuthPage({
129
129
  return /* @__PURE__ */ jsxs2(PageWrapper, { children: [
130
130
  /* @__PURE__ */ jsxs2(HeaderWrapper, { children: [
131
131
  customLogo != null ? customLogo : /* @__PURE__ */ jsx3(EquinorLogo, __spreadValues({ size: 48 }, defaultLogoProps)),
132
- /* @__PURE__ */ jsx3(StyledHeading, { variant: "h3", as: "h1", children: appName })
132
+ /* @__PURE__ */ jsx3(
133
+ Typography,
134
+ {
135
+ variant: "h3",
136
+ as: "h1",
137
+ style: {
138
+ color: tokens2.colors.text.static_icons__default.rgba,
139
+ margin: 0,
140
+ fontWeight: 500
141
+ },
142
+ children: appName
143
+ }
144
+ )
133
145
  ] }),
134
146
  /* @__PURE__ */ jsxs2(ContentWrapper, { children: [
135
- description && /* @__PURE__ */ jsx3(StyledDescription, { variant: "h6", as: "p", children: description }),
147
+ description && /* @__PURE__ */ jsx3(
148
+ Typography,
149
+ {
150
+ variant: "h6",
151
+ as: "p",
152
+ style: { color: tokens2.colors.text.static_icons__default.rgba, margin: 0 },
153
+ children: description
154
+ }
155
+ ),
136
156
  /* @__PURE__ */ jsx3(AuthButton, __spreadProps(__spreadValues({ action, isLoading }, buttonProps), { children: buttonText }))
137
157
  ] })
138
158
  ] });
@@ -162,15 +182,6 @@ var HeaderWrapper = styled2.div`
162
182
 
163
183
  gap: 10px;
164
184
  `;
165
- var StyledHeading = styled2(Typography)`
166
- color: ${tokens2.colors.text.static_icons__default.rgba};
167
- margin: 0;
168
- font-weight: 500;
169
- `;
170
- var StyledDescription = styled2(Typography)`
171
- color: ${tokens2.colors.text.static_icons__default.rgba};
172
- margin: 0;
173
- `;
174
185
 
175
186
  // src/auth/LoginPage/LoginPage.tsx
176
187
  import { jsx as jsx4 } from "react/jsx-runtime";
@@ -178,12 +189,13 @@ var DEFAULT_SIGNED_OUT_TEXT = "You have been logged out";
178
189
  function LoginPage({
179
190
  appName,
180
191
  action,
181
- buttonText = "Sign in",
192
+ buttonText = "Log in",
182
193
  buttonProps,
183
194
  customLogo,
184
195
  defaultLogoProps,
185
196
  description,
186
- showDefaultSignedOutText
197
+ showDefaultSignedOutText,
198
+ isLoading
187
199
  }) {
188
200
  return /* @__PURE__ */ jsx4(
189
201
  AuthPage,
@@ -194,6 +206,7 @@ function LoginPage({
194
206
  buttonProps,
195
207
  customLogo,
196
208
  defaultLogoProps,
209
+ isLoading,
197
210
  description: typeof description === "string" ? description : showDefaultSignedOutText ? DEFAULT_SIGNED_OUT_TEXT : description
198
211
  }
199
212
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/cpl-generic-pages-react",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",