@getgreenline/blaze-ui 1.0.51-beta.0 → 1.0.53
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.
|
@@ -14,10 +14,6 @@ declare const AppsConfig: readonly [{
|
|
|
14
14
|
readonly name: "Sites";
|
|
15
15
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
readonly subdomain: "cms";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "Lighthouse";
|
|
19
|
-
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
readonly subdomain: "lighthouse";
|
|
21
17
|
}, {
|
|
22
18
|
readonly name: "Growth";
|
|
23
19
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,11 +22,16 @@ declare const AppsConfig: readonly [{
|
|
|
26
22
|
readonly name: "Billing";
|
|
27
23
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
28
24
|
readonly subdomain: "billing";
|
|
29
|
-
readonly badge: "Soon";
|
|
30
25
|
}, {
|
|
31
26
|
readonly name: "Settings";
|
|
32
27
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
33
28
|
readonly subdomain: "app";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "Lighthouse";
|
|
31
|
+
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
readonly subdomain: "lighthouse";
|
|
33
|
+
readonly disabled: true;
|
|
34
|
+
readonly badge: "Soon";
|
|
34
35
|
}];
|
|
35
36
|
type AppName = (typeof AppsConfig)[number]["name"];
|
|
36
37
|
type AppSubdomain = NonNullable<(typeof AppsConfig)[number]["subdomain"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-app-switcher.d.ts","sourceRoot":"","sources":["../../src/components/header-app-switcher.tsx"],"names":[],"mappings":"AAyBA,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"header-app-switcher.d.ts","sourceRoot":"","sources":["../../src/components/header-app-switcher.tsx"],"names":[],"mappings":"AAyBA,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BN,CAAA;AAEV,KAAK,OAAO,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;AAClD,KAAK,YAAY,GAAG,WAAW,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;AAiGzE,KAAK,sBAAsB,GAAG;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kEAAkE;IAClE,WAAW,CAAC,EAAE,YAAY,EAAE,CAAA;IAC5B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAsBD,iBAAS,iBAAiB,CAAC,EACzB,UAAU,EACV,UAAqB,EACrB,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,sBAAsB,2CA+FxB;AAED,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,CAAA"}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { Badge } from './badge.js';
|
|
4
4
|
import { Button } from './button.js';
|
|
5
5
|
import { Popover, PopoverTrigger, PopoverContent } from './popover.js';
|
|
6
|
-
import { RetailLogo, PosLogo, EcomLogo, SitesLogo,
|
|
6
|
+
import { RetailLogo, PosLogo, EcomLogo, SitesLogo, GrowthLogo, BillingLogo, SettingsLogo, LighthouseLogo, AppsGridIcon } from '../svgs/header-app-switcher-logos.js';
|
|
7
7
|
import { cn } from '../lib/utils.js';
|
|
8
8
|
|
|
9
9
|
const AppsConfig = [
|
|
@@ -11,11 +11,6 @@ const AppsConfig = [
|
|
|
11
11
|
{ name: "POS", logo: jsx(PosLogo, {}), subdomain: "pos" },
|
|
12
12
|
{ name: "Ecom", logo: jsx(EcomLogo, {}), subdomain: "ecom" },
|
|
13
13
|
{ name: "Sites", logo: jsx(SitesLogo, {}), subdomain: "cms" },
|
|
14
|
-
{
|
|
15
|
-
name: "Lighthouse",
|
|
16
|
-
logo: jsx(LighthouseLogo, {}),
|
|
17
|
-
subdomain: "lighthouse",
|
|
18
|
-
},
|
|
19
14
|
{
|
|
20
15
|
name: "Growth",
|
|
21
16
|
logo: jsx(GrowthLogo, {}),
|
|
@@ -25,13 +20,19 @@ const AppsConfig = [
|
|
|
25
20
|
name: "Billing",
|
|
26
21
|
logo: jsx(BillingLogo, {}),
|
|
27
22
|
subdomain: "billing",
|
|
28
|
-
badge: "Soon",
|
|
29
23
|
},
|
|
30
24
|
{
|
|
31
25
|
name: "Settings",
|
|
32
26
|
logo: jsx(SettingsLogo, {}),
|
|
33
27
|
subdomain: "app",
|
|
34
28
|
},
|
|
29
|
+
{
|
|
30
|
+
name: "Lighthouse",
|
|
31
|
+
logo: jsx(LighthouseLogo, {}),
|
|
32
|
+
subdomain: "lighthouse",
|
|
33
|
+
disabled: true,
|
|
34
|
+
badge: "Soon",
|
|
35
|
+
},
|
|
35
36
|
];
|
|
36
37
|
const trimSlashes = (value) => value.trim().replace(/\/+$/, "");
|
|
37
38
|
const toHostInfo = (value) => {
|
|
@@ -119,7 +120,7 @@ const gridColsClass = {
|
|
|
119
120
|
3: "tw:grid-cols-3",
|
|
120
121
|
4: "tw:grid-cols-4",
|
|
121
122
|
};
|
|
122
|
-
const appBadgeClassName = "tw:absolute tw:left-1/2 tw:top-full tw:z-10 tw:-translate-x-1 tw:-translate-y-1/2 tw:!rounded-full tw:!border-border tw:!bg-white tw:!px-1.5 tw:!py-px tw:!text-[9px] tw:!leading-none tw:!text-primary tw:!shadow-sm";
|
|
123
|
+
const appBadgeClassName = "tw:absolute tw:left-1/2 tw:top-full tw:z-10 tw:-translate-x-1 tw:-translate-y-1/2 tw:!rounded-full tw:!border-border tw:!bg-white tw:!px-1.5 tw:!py-px tw:!text-[9px] tw:!leading-none tw:!text-primary tw:!shadow-sm tw:dark:!bg-white tw:dark:!text-primary";
|
|
123
124
|
function HeaderAppSwitcher({ commonHost, currentApp = "Retail", visibleApps, columns, ssoRedirect, }) {
|
|
124
125
|
const apps = React.useMemo(() => {
|
|
125
126
|
const base = resolveHostInfo(commonHost);
|
|
@@ -137,8 +138,8 @@ function HeaderAppSwitcher({ commonHost, currentApp = "Retail", visibleApps, col
|
|
|
137
138
|
const isDisabled = Boolean(app.disabled);
|
|
138
139
|
const isCurrent = Boolean(app.isCurrent);
|
|
139
140
|
const tileClassName = getTileClassName(isCurrent, isDisabled);
|
|
140
|
-
const tileContent = (jsxs(Fragment, { children: [jsxs("span", { className: "tw:relative tw:flex tw:size-9 tw:items-center tw:justify-center tw:[&>svg]:size-9 tw:[&>svg]:shrink-0", children: [app.logo, app.badge ? (jsx(Badge, { variant: "soft", className: appBadgeClassName, children: app.badge })) : null] }), jsx("span", { className: cn("tw:text-center tw:text-xs tw:font-normal tw:leading-
|
|
141
|
-
const baseClassName = `tw:relative tw:flex tw:min-h-14 tw:flex-col tw:items-center tw:gap-2.5 tw:rounded-md tw:p-
|
|
141
|
+
const tileContent = (jsxs(Fragment, { children: [jsxs("span", { className: "tw:relative tw:flex tw:size-9 tw:items-center tw:justify-center tw:[&>svg]:size-9 tw:[&>svg]:shrink-0", children: [app.logo, app.badge ? (jsx(Badge, { variant: "soft", className: appBadgeClassName, children: app.badge })) : null] }), jsx("span", { className: cn("tw:text-center tw:text-xs tw:font-normal tw:leading-none tw:text-popover-foreground", isDisabled && "tw:text-muted-foreground"), children: app.name })] }));
|
|
142
|
+
const baseClassName = `tw:relative tw:flex tw:min-h-14 tw:flex-col tw:items-center tw:gap-2.5 tw:rounded-md tw:p-2 tw:transition-colors ${tileClassName}`;
|
|
142
143
|
const Wrapper = isDisabled || isCurrent ? "div" : "a";
|
|
143
144
|
const wrapperProps = isDisabled || isCurrent
|
|
144
145
|
? isCurrent
|