@homebound/beam 3.31.1 → 3.32.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.cjs +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6205,11 +6205,20 @@ type ImpersonatedUser = {
|
|
|
6205
6205
|
type EnvironmentBannerProps = {
|
|
6206
6206
|
env: AppEnvironment;
|
|
6207
6207
|
impersonating?: ImpersonatedUser;
|
|
6208
|
+
/**
|
|
6209
|
+
* Shows the production warning banner; typically set to `true` only for developers in the consuming app.
|
|
6210
|
+
* Its styling takes precedence over impersonation (red fill + prod warning copy, with impersonation still
|
|
6211
|
+
* shown on the right).
|
|
6212
|
+
*/
|
|
6213
|
+
showProdWarning?: boolean;
|
|
6208
6214
|
};
|
|
6209
6215
|
/** Environment banner; horizontal/vertical pinning is owned by {@link EnvironmentBannerLayout}. */
|
|
6210
6216
|
declare function EnvironmentBanner(props: EnvironmentBannerProps): JSX.Element | null;
|
|
6211
|
-
/**
|
|
6212
|
-
|
|
6217
|
+
/**
|
|
6218
|
+
* True when {@link EnvironmentBanner} should display: `dev`, `qa`, `local-prod`, or `prod` while impersonating
|
|
6219
|
+
* or when `showProdWarning` is set (typically only for developers in the consuming app).
|
|
6220
|
+
*/
|
|
6221
|
+
declare function shouldShowEnvironmentBanner(env: AppEnvironment, impersonating: ImpersonatedUser | undefined, showProdWarning: boolean): boolean;
|
|
6213
6222
|
/** Fixed banner height (px); {@link EnvironmentBannerLayout} reads this for spacer/CSS var offsets. */
|
|
6214
6223
|
declare const environmentBannerSizePx = 34;
|
|
6215
6224
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6205,11 +6205,20 @@ type ImpersonatedUser = {
|
|
|
6205
6205
|
type EnvironmentBannerProps = {
|
|
6206
6206
|
env: AppEnvironment;
|
|
6207
6207
|
impersonating?: ImpersonatedUser;
|
|
6208
|
+
/**
|
|
6209
|
+
* Shows the production warning banner; typically set to `true` only for developers in the consuming app.
|
|
6210
|
+
* Its styling takes precedence over impersonation (red fill + prod warning copy, with impersonation still
|
|
6211
|
+
* shown on the right).
|
|
6212
|
+
*/
|
|
6213
|
+
showProdWarning?: boolean;
|
|
6208
6214
|
};
|
|
6209
6215
|
/** Environment banner; horizontal/vertical pinning is owned by {@link EnvironmentBannerLayout}. */
|
|
6210
6216
|
declare function EnvironmentBanner(props: EnvironmentBannerProps): JSX.Element | null;
|
|
6211
|
-
/**
|
|
6212
|
-
|
|
6217
|
+
/**
|
|
6218
|
+
* True when {@link EnvironmentBanner} should display: `dev`, `qa`, `local-prod`, or `prod` while impersonating
|
|
6219
|
+
* or when `showProdWarning` is set (typically only for developers in the consuming app).
|
|
6220
|
+
*/
|
|
6221
|
+
declare function shouldShowEnvironmentBanner(env: AppEnvironment, impersonating: ImpersonatedUser | undefined, showProdWarning: boolean): boolean;
|
|
6213
6222
|
/** Fixed banner height (px); {@link EnvironmentBannerLayout} reads this for spacer/CSS var offsets. */
|
|
6214
6223
|
declare const environmentBannerSizePx = 34;
|
|
6215
6224
|
|
package/dist/index.js
CHANGED
|
@@ -4434,7 +4434,14 @@ var Icons = {
|
|
|
4434
4434
|
/* @__PURE__ */ jsx3("path", { d: "M12 4.929L11.293 5.636L12.707 7.05L13.414 6.343C14.583 5.176 16.486 5.174 17.657 6.343C18.826 7.513 18.826 9.416 17.657 10.586L15.535 12.707C14.402 13.84 12.426 13.84 11.293 12.707L10.586 12L9.172 13.414L9.879 14.121C10.822 15.065 12.078 15.586 13.414 15.586C14.75 15.586 16.006 15.065 16.949 14.121L19.071 12C21.019 10.051 21.019 6.878 19.071 4.929C17.121 2.979 13.948 2.98 12 4.929Z" })
|
|
4435
4435
|
] }),
|
|
4436
4436
|
// FIXME: This is not an "official" design approved icon. It should be replaced
|
|
4437
|
-
unlink: /* @__PURE__ */
|
|
4437
|
+
unlink: /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
4438
|
+
/* @__PURE__ */ jsx3("path", { d: "M8.465 11.293C9.598 10.16 11.574 10.16 12.707 11.293L13.414 12L14.828 10.586L14.121 9.879C13.178 8.935 11.922 8.414 10.586 8.414C9.25 8.414 7.994 8.935 7.051 9.879L4.929 12C2.981 13.949 2.981 17.122 4.929 19.071C5.904 20.046 7.184 20.533 8.464 20.533C9.745 20.533 11.026 20.046 12 19.071L12.707 18.364L11.293 16.95L10.586 17.657C9.416 18.824 7.513 18.826 6.343 17.657C5.174 16.487 5.174 14.584 6.343 13.414L8.465 11.293Z" }),
|
|
4439
|
+
/* @__PURE__ */ jsx3("path", { d: "M12 4.92898L11.293 5.63598L12.707 7.04998L13.414 6.34298C14.583 5.17598 16.486 5.17398 17.657 6.34298C18.826 7.51298 18.826 9.41598 17.657 10.586L15.535 12.707C14.402 13.84 12.426 13.84 11.293 12.707L10.586 12L9.172 13.414L9.879 14.121C10.822 15.065 12.078 15.586 13.414 15.586C14.75 15.586 16.006 15.065 16.949 14.121L19.071 12C21.019 10.051 21.019 6.87798 19.071 4.92898C17.121 2.97898 13.948 2.97998 12 4.92898Z" }),
|
|
4440
|
+
/* @__PURE__ */ jsx3("path", { d: "M1 7L5 7V9L1 9L1 7Z" }),
|
|
4441
|
+
/* @__PURE__ */ jsx3("path", { d: "M23.5 17H19.5V15H23.5V17Z" }),
|
|
4442
|
+
/* @__PURE__ */ jsx3("path", { d: "M15 23V19H17V23H15Z" }),
|
|
4443
|
+
/* @__PURE__ */ jsx3("path", { d: "M9 1V5H7V1H9Z" })
|
|
4444
|
+
] }),
|
|
4438
4445
|
linkExternal: /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
4439
4446
|
/* @__PURE__ */ jsx3("path", { d: "M13 3L16.293 6.293L9.29297 13.293L10.707 14.707L17.707 7.707L21 11V3H13Z" }),
|
|
4440
4447
|
/* @__PURE__ */ jsx3("path", { d: "M19 19H5V5H12L10 3H5C3.897 3 3 3.897 3 5V19C3 20.103 3.897 21 5 21H19C20.103 21 21 20.103 21 19V14L19 12V19Z" })
|
|
@@ -21838,10 +21845,11 @@ function EnvironmentBanner(props) {
|
|
|
21838
21845
|
const {
|
|
21839
21846
|
env,
|
|
21840
21847
|
impersonating,
|
|
21848
|
+
showProdWarning = false,
|
|
21841
21849
|
...others
|
|
21842
21850
|
} = props;
|
|
21843
21851
|
const tid = useTestIds(others, "environmentBanner");
|
|
21844
|
-
if (!shouldShowEnvironmentBanner(env, impersonating)) {
|
|
21852
|
+
if (!shouldShowEnvironmentBanner(env, impersonating, showProdWarning)) {
|
|
21845
21853
|
return null;
|
|
21846
21854
|
}
|
|
21847
21855
|
const {
|
|
@@ -21849,7 +21857,7 @@ function EnvironmentBanner(props) {
|
|
|
21849
21857
|
badgeLabel,
|
|
21850
21858
|
message,
|
|
21851
21859
|
tooltip
|
|
21852
|
-
} = getEnvironmentBannerConfig(env, impersonating);
|
|
21860
|
+
} = getEnvironmentBannerConfig(env, impersonating, showProdWarning);
|
|
21853
21861
|
const bgColorVar = maybeCssVar(bgColor);
|
|
21854
21862
|
return /* @__PURE__ */ jsxs84("div", { ...trussProps83({
|
|
21855
21863
|
flexShrink: "fs0",
|
|
@@ -21892,7 +21900,7 @@ function EnvironmentBanner(props) {
|
|
|
21892
21900
|
] })
|
|
21893
21901
|
] }),
|
|
21894
21902
|
impersonating != null && /* @__PURE__ */ jsxs84("span", { className: "df aic gap2 fw6 fz_12px lh_16px white fs0", ...tid.impersonating, children: [
|
|
21895
|
-
env !== "prod" && /* @__PURE__ */ jsxs84("span", { children: [
|
|
21903
|
+
(env !== "prod" || showProdWarning) && /* @__PURE__ */ jsxs84("span", { children: [
|
|
21896
21904
|
/* @__PURE__ */ jsx166("span", { className: "dn mdandup_dib", children: "Impersonating \xA0" }),
|
|
21897
21905
|
impersonating.name
|
|
21898
21906
|
] }),
|
|
@@ -21901,10 +21909,10 @@ function EnvironmentBanner(props) {
|
|
|
21901
21909
|
] })
|
|
21902
21910
|
] });
|
|
21903
21911
|
}
|
|
21904
|
-
function shouldShowEnvironmentBanner(env, impersonating) {
|
|
21905
|
-
return env === "dev" || env === "qa" || env === "local-prod" || env === "prod" && isDefined(impersonating);
|
|
21912
|
+
function shouldShowEnvironmentBanner(env, impersonating, showProdWarning) {
|
|
21913
|
+
return env === "dev" || env === "qa" || env === "local-prod" || env === "prod" && (isDefined(impersonating) || showProdWarning);
|
|
21906
21914
|
}
|
|
21907
|
-
function getEnvironmentBannerConfig(env, impersonating) {
|
|
21915
|
+
function getEnvironmentBannerConfig(env, impersonating, showProdWarning) {
|
|
21908
21916
|
switch (env) {
|
|
21909
21917
|
case "dev":
|
|
21910
21918
|
return {
|
|
@@ -21920,9 +21928,16 @@ function getEnvironmentBannerConfig(env, impersonating) {
|
|
|
21920
21928
|
message: "You are in the QA Environment",
|
|
21921
21929
|
tooltip: "You are in the QA Environment. Any changes here will not be reflected in live production data."
|
|
21922
21930
|
};
|
|
21923
|
-
// Prod
|
|
21931
|
+
// Prod banner shows when impersonating or when `showProdWarning` is set. The prod warning takes precedence:
|
|
21932
|
+
// it reuses the red local-prod fill for "live prod data" urgency, while impersonation (if any) still shows
|
|
21933
|
+
// on the right. Impersonation alone keeps its own prod fill and copy.
|
|
21924
21934
|
case "prod":
|
|
21925
|
-
return {
|
|
21935
|
+
return showProdWarning ? {
|
|
21936
|
+
bgColor: "--b-env-brand-local-prod" /* EnvBrandLocalProd */,
|
|
21937
|
+
badgeLabel: "PROD",
|
|
21938
|
+
message: "You are in the Production Environment",
|
|
21939
|
+
tooltip: "You are in the Production Environment. Any changes here WILL be reflected in live production data."
|
|
21940
|
+
} : {
|
|
21926
21941
|
bgColor: "--b-env-brand-prod" /* EnvBrandProd */,
|
|
21927
21942
|
badgeLabel: "PROD",
|
|
21928
21943
|
message: `You are impersonating ${impersonating?.name}`,
|
|
@@ -24153,7 +24168,7 @@ function EnvironmentBannerLayout(props) {
|
|
|
24153
24168
|
children
|
|
24154
24169
|
} = props;
|
|
24155
24170
|
const tid = useTestIds(props, "environmentBannerLayout");
|
|
24156
|
-
const showBanner = environmentBanner != null && shouldShowEnvironmentBanner(environmentBanner.env, environmentBanner.impersonating);
|
|
24171
|
+
const showBanner = environmentBanner != null && shouldShowEnvironmentBanner(environmentBanner.env, environmentBanner.impersonating, environmentBanner.showProdWarning ?? false);
|
|
24157
24172
|
const bannerHeightPx = showBanner ? environmentBannerSizePx : 0;
|
|
24158
24173
|
const style = {
|
|
24159
24174
|
[beamEnvironmentBannerLayoutHeightVar]: `${bannerHeightPx}px`
|