@lobehub/ui 5.48.2 → 5.49.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/es/Highlighter/FullFeatured.mjs +1 -1
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/LangSelect.mjs +1 -1
- package/es/Highlighter/LangSelect.mjs.map +1 -1
- package/es/Highlighter/style.mjs +14 -11
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/Mermaid/FullFeatured.mjs +1 -1
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/awesome/AgentSkillCard/AgentSkillCard.d.mts +6 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs +83 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/agents.d.mts +6 -0
- package/es/awesome/AgentSkillCard/agents.mjs +40 -0
- package/es/awesome/AgentSkillCard/agents.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/index.d.mts +4 -0
- package/es/awesome/AgentSkillCard/style.mjs +85 -0
- package/es/awesome/AgentSkillCard/style.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/type.d.mts +41 -0
- package/es/awesome/BentoGrid/BentoCard.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoCard.mjs +39 -0
- package/es/awesome/BentoGrid/BentoCard.mjs.map +1 -0
- package/es/awesome/BentoGrid/BentoGrid.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs +20 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs.map +1 -0
- package/es/awesome/BentoGrid/index.d.mts +4 -0
- package/es/awesome/BentoGrid/style.mjs +102 -0
- package/es/awesome/BentoGrid/style.mjs.map +1 -0
- package/es/awesome/BentoGrid/type.d.mts +40 -0
- package/es/awesome/CodeShowcase/CodeShowcase.d.mts +6 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs +51 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs.map +1 -0
- package/es/awesome/CodeShowcase/index.d.mts +3 -0
- package/es/awesome/CodeShowcase/style.mjs +50 -0
- package/es/awesome/CodeShowcase/style.mjs.map +1 -0
- package/es/awesome/CodeShowcase/type.d.mts +27 -0
- package/es/awesome/FeatureGrid/FeatureGrid.d.mts +6 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs +48 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs.map +1 -0
- package/es/awesome/FeatureGrid/index.d.mts +3 -0
- package/es/awesome/FeatureGrid/style.mjs +75 -0
- package/es/awesome/FeatureGrid/style.mjs.map +1 -0
- package/es/awesome/FeatureGrid/type.d.mts +25 -0
- package/es/awesome/FluidGradient/FluidGradient.d.mts +6 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs +293 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs.map +1 -0
- package/es/awesome/FluidGradient/index.d.mts +3 -0
- package/es/awesome/FluidGradient/style.mjs +52 -0
- package/es/awesome/FluidGradient/style.mjs.map +1 -0
- package/es/awesome/FluidGradient/type.d.mts +22 -0
- package/es/awesome/InstallBanner/InstallBanner.d.mts +6 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs +35 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs.map +1 -0
- package/es/awesome/InstallBanner/index.d.mts +3 -0
- package/es/awesome/InstallBanner/style.mjs +46 -0
- package/es/awesome/InstallBanner/style.mjs.map +1 -0
- package/es/awesome/InstallBanner/type.d.mts +18 -0
- package/es/awesome/LandingHero/LandingHero.d.mts +6 -0
- package/es/awesome/LandingHero/LandingHero.mjs +55 -0
- package/es/awesome/LandingHero/LandingHero.mjs.map +1 -0
- package/es/awesome/LandingHero/index.d.mts +3 -0
- package/es/awesome/LandingHero/style.mjs +155 -0
- package/es/awesome/LandingHero/style.mjs.map +1 -0
- package/es/awesome/LandingHero/type.d.mts +29 -0
- package/es/awesome/LandingSection/LandingSection.d.mts +6 -0
- package/es/awesome/LandingSection/LandingSection.mjs +61 -0
- package/es/awesome/LandingSection/LandingSection.mjs.map +1 -0
- package/es/awesome/LandingSection/index.d.mts +3 -0
- package/es/awesome/LandingSection/style.mjs +88 -0
- package/es/awesome/LandingSection/style.mjs.map +1 -0
- package/es/awesome/LandingSection/type.d.mts +40 -0
- package/es/awesome/LogoMarquee/LogoMarquee.d.mts +6 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs +52 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs.map +1 -0
- package/es/awesome/LogoMarquee/index.d.mts +3 -0
- package/es/awesome/LogoMarquee/style.mjs +70 -0
- package/es/awesome/LogoMarquee/style.mjs.map +1 -0
- package/es/awesome/LogoMarquee/type.d.mts +40 -0
- package/es/awesome/index.d.mts +33 -1
- package/es/awesome/index.mjs +13 -1
- package/es/awesome/landingActions.d.mts +20 -0
- package/es/awesome/landingActions.mjs +123 -0
- package/es/awesome/landingActions.mjs.map +1 -0
- package/es/awesome/landingIcon.mjs +13 -0
- package/es/awesome/landingIcon.mjs.map +1 -0
- package/es/awesome/landingLink.d.mts +12 -0
- package/es/awesome/landingLink.mjs +23 -0
- package/es/awesome/landingLink.mjs.map +1 -0
- package/es/awesome/landingTokens.d.mts +10 -0
- package/es/awesome/landingTokens.mjs +19 -0
- package/es/awesome/landingTokens.mjs.map +1 -0
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/Segmented/atoms.mjs +1 -0
- package/es/base-ui/Segmented/atoms.mjs.map +1 -1
- package/es/base-ui/Segmented/style.mjs +127 -125
- package/es/base-ui/Segmented/style.mjs.map +1 -1
- package/es/base-ui/index.mjs +4 -4
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +9 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs +54 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -0
- package/es/dashboard/AuthLayout/index.d.mts +3 -0
- package/es/dashboard/AuthLayout/style.mjs +120 -0
- package/es/dashboard/AuthLayout/style.mjs.map +1 -0
- package/es/dashboard/AuthLayout/type.d.mts +16 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.d.mts +9 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs +55 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/index.d.mts +3 -0
- package/es/dashboard/Breadcrumb/style.mjs +66 -0
- package/es/dashboard/Breadcrumb/style.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/type.d.mts +25 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.d.mts +9 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +275 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/active.d.mts +7 -0
- package/es/dashboard/ConsoleNav/active.mjs +29 -0
- package/es/dashboard/ConsoleNav/active.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +4 -0
- package/es/dashboard/ConsoleNav/style.mjs +283 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/type.d.mts +71 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs +37 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +149 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/context.d.mts +6 -0
- package/es/dashboard/ConsoleShell/context.mjs +16 -0
- package/es/dashboard/ConsoleShell/context.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/index.d.mts +5 -0
- package/es/dashboard/ConsoleShell/style.mjs +209 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/type.d.mts +67 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.d.mts +17 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +151 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/context.d.mts +7 -0
- package/es/dashboard/FilterSidebar/context.mjs +19 -0
- package/es/dashboard/FilterSidebar/context.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/index.d.mts +4 -0
- package/es/dashboard/FilterSidebar/style.mjs +155 -0
- package/es/dashboard/FilterSidebar/style.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/type.d.mts +44 -0
- package/es/dashboard/FilterSidebar/width.mjs +18 -0
- package/es/dashboard/FilterSidebar/width.mjs.map +1 -0
- package/es/dashboard/PageHeader/PageHeader.d.mts +9 -0
- package/es/dashboard/PageHeader/PageHeader.mjs +37 -0
- package/es/dashboard/PageHeader/PageHeader.mjs.map +1 -0
- package/es/dashboard/PageHeader/index.d.mts +3 -0
- package/es/dashboard/PageHeader/style.mjs +47 -0
- package/es/dashboard/PageHeader/style.mjs.map +1 -0
- package/es/dashboard/PageHeader/type.d.mts +14 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.d.mts +25 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +136 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/style.mjs +122 -0
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/type.d.mts +22 -0
- package/es/dashboard/PageTabs/PageTabs.d.mts +9 -0
- package/es/dashboard/PageTabs/PageTabs.mjs +37 -0
- package/es/dashboard/PageTabs/PageTabs.mjs.map +1 -0
- package/es/dashboard/PageTabs/index.d.mts +3 -0
- package/es/dashboard/PageTabs/style.mjs +57 -0
- package/es/dashboard/PageTabs/style.mjs.map +1 -0
- package/es/dashboard/PageTabs/type.d.mts +17 -0
- package/es/dashboard/RouteProgress/RouteProgress.d.mts +9 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs +44 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs.map +1 -0
- package/es/dashboard/RouteProgress/style.mjs +19 -0
- package/es/dashboard/RouteProgress/style.mjs.map +1 -0
- package/es/dashboard/RouteProgress/type.d.mts +8 -0
- package/es/dashboard/StatCard/StatCard.d.mts +9 -0
- package/es/dashboard/StatCard/StatCard.mjs +84 -0
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -0
- package/es/dashboard/StatCard/index.d.mts +3 -0
- package/es/dashboard/StatCard/style.mjs +135 -0
- package/es/dashboard/StatCard/style.mjs.map +1 -0
- package/es/dashboard/StatCard/type.d.mts +26 -0
- package/es/dashboard/Surface/Surface.d.mts +13 -0
- package/es/dashboard/Surface/Surface.mjs +20 -0
- package/es/dashboard/Surface/Surface.mjs.map +1 -0
- package/es/dashboard/Surface/index.d.mts +4 -0
- package/es/dashboard/Surface/style.d.mts +14 -0
- package/es/dashboard/Surface/style.mjs +22 -0
- package/es/dashboard/Surface/style.mjs.map +1 -0
- package/es/dashboard/Surface/type.d.mts +8 -0
- package/es/dashboard/hooks.mjs +49 -0
- package/es/dashboard/hooks.mjs.map +1 -0
- package/es/dashboard/index.d.mts +37 -0
- package/es/dashboard/index.d.ts +1 -0
- package/es/dashboard/index.js +1 -0
- package/es/dashboard/index.mjs +17 -0
- package/es/static-css/registry.mjs +2 -2
- package/es/static-css/registry.mjs.map +1 -1
- package/es/storybook/StoryBook/index.mjs +4 -0
- package/es/storybook/StoryBook/index.mjs.map +1 -1
- package/es/storybook/StoryBook/style.mjs +7 -2
- package/es/storybook/StoryBook/style.mjs.map +1 -1
- package/es/styles/theme/token/base.mjs +2 -2
- package/es/styles/theme/token/base.mjs.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IconProps } from "../../Icon/type.mjs";
|
|
2
|
+
import "../../Icon/index.mjs";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
//#region src/dashboard/ConsoleNav/type.d.ts
|
|
5
|
+
interface ConsoleNavItem {
|
|
6
|
+
/** Count shown beside the label. Collapses to a dot on the icon rail. */
|
|
7
|
+
badge?: number;
|
|
8
|
+
/** Match only this path, not its descendants. `/` is always exact. */
|
|
9
|
+
end?: boolean;
|
|
10
|
+
/** Opens in a new tab. The default anchor adds `target` and `rel`. */
|
|
11
|
+
external?: boolean;
|
|
12
|
+
href: string;
|
|
13
|
+
/** Omit for a text-only row. Items without an icon are left off the icon rail. */
|
|
14
|
+
icon?: IconProps['icon'];
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
interface ConsoleNavGroup {
|
|
18
|
+
/** Start open or closed, overriding the nav-wide `defaultExpanded` for this group. */
|
|
19
|
+
defaultExpanded?: boolean;
|
|
20
|
+
/** Nested groups, listed after this group's own items. */
|
|
21
|
+
groups?: ConsoleNavGroup[];
|
|
22
|
+
/** Overview page for the group. On the icon rail, a group with an icon links here. */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** Shown before the label. On the icon rail the whole group folds into this icon. */
|
|
25
|
+
icon?: IconProps['icon'];
|
|
26
|
+
items?: ConsoleNavItem[];
|
|
27
|
+
key: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
interface ConsoleNavLinkProps {
|
|
31
|
+
'aria-current'?: 'page';
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
'children': ReactNode;
|
|
34
|
+
'className': string;
|
|
35
|
+
'data-active': boolean;
|
|
36
|
+
'data-collapsed': boolean;
|
|
37
|
+
/** Nesting depth used for inline padding. Spread it onto the rendered link. */
|
|
38
|
+
'data-indent': number;
|
|
39
|
+
'external'?: boolean;
|
|
40
|
+
'href': string;
|
|
41
|
+
'onClick': () => void;
|
|
42
|
+
'title'?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ConsoleNavProps {
|
|
45
|
+
/** Show the icon rail. Defaults to the enclosing `ConsoleShell` state. */
|
|
46
|
+
collapsed?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* `all` opens every group. `active` starts with every group closed and opens
|
|
49
|
+
* the branch holding the current page, including after navigation.
|
|
50
|
+
* @default 'all'
|
|
51
|
+
*/
|
|
52
|
+
defaultExpanded?: 'active' | 'all';
|
|
53
|
+
groups?: ConsoleNavGroup[];
|
|
54
|
+
/** Ungrouped links listed before the groups. */
|
|
55
|
+
items?: ConsoleNavItem[];
|
|
56
|
+
/** Accessible name for the navigation landmark. */
|
|
57
|
+
label?: string;
|
|
58
|
+
/** Called with the item href. Prevents the anchor navigation when set. */
|
|
59
|
+
onNavigate?: (href: string) => void;
|
|
60
|
+
pathname: string;
|
|
61
|
+
/**
|
|
62
|
+
* Renders each item link. Use this to plug in a router `Link`.
|
|
63
|
+
* The default render is an anchor.
|
|
64
|
+
*/
|
|
65
|
+
renderLink?: (props: ConsoleNavLinkProps) => ReactNode;
|
|
66
|
+
/** Persists which groups were opened or closed by hand. */
|
|
67
|
+
storageKey?: string;
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { ConsoleNavGroup, ConsoleNavItem, ConsoleNavLinkProps, ConsoleNavProps };
|
|
71
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConsoleBrandProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/ConsoleShell/ConsoleBrand.d.ts
|
|
3
|
+
declare function ConsoleBrand({ href, label, logo, renderLink, title }: ConsoleBrandProps): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
4
|
+
declare namespace ConsoleBrand {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ConsoleBrand as default };
|
|
9
|
+
//# sourceMappingURL=ConsoleBrand.d.mts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useConsoleShellState } from "./context.mjs";
|
|
3
|
+
import { styles } from "./style.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/dashboard/ConsoleShell/ConsoleBrand.tsx
|
|
6
|
+
function ConsoleBrand({ href = "/", label, logo, renderLink, title }) {
|
|
7
|
+
const shell = useConsoleShellState();
|
|
8
|
+
const collapsed = shell?.collapsed ?? false;
|
|
9
|
+
const lockup = title == null || title === false || title === "" ? logo : /* @__PURE__ */ jsxs("span", {
|
|
10
|
+
className: styles.brandLockup,
|
|
11
|
+
children: [logo, /* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: styles.brandName,
|
|
13
|
+
children: title
|
|
14
|
+
})]
|
|
15
|
+
});
|
|
16
|
+
const content = collapsed ? logo : lockup;
|
|
17
|
+
const linkProps = {
|
|
18
|
+
"aria-label": label ?? (typeof title === "string" ? title : "Home"),
|
|
19
|
+
"children": content,
|
|
20
|
+
"className": styles.brandAnchor,
|
|
21
|
+
href,
|
|
22
|
+
"onClick": () => shell?.closeNavigation()
|
|
23
|
+
};
|
|
24
|
+
if (renderLink) return renderLink(linkProps);
|
|
25
|
+
return /* @__PURE__ */ jsx("a", {
|
|
26
|
+
"aria-label": linkProps["aria-label"],
|
|
27
|
+
className: linkProps.className,
|
|
28
|
+
href,
|
|
29
|
+
onClick: linkProps.onClick,
|
|
30
|
+
children: content
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ConsoleBrand.displayName = "ConsoleBrand";
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ConsoleBrand as default };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=ConsoleBrand.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleBrand.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/ConsoleBrand.tsx"],"sourcesContent":["'use client';\n\nimport { useConsoleShellState } from './context';\nimport { styles } from './style';\nimport type { ConsoleBrandProps } from './type';\n\nfunction ConsoleBrand({ href = '/', label, logo, renderLink, title }: ConsoleBrandProps) {\n const shell = useConsoleShellState();\n const collapsed = shell?.collapsed ?? false;\n const lockup =\n title == null || title === false || title === '' ? (\n logo\n ) : (\n <span className={styles.brandLockup}>\n {logo}\n <span className={styles.brandName}>{title}</span>\n </span>\n );\n const content = collapsed ? logo : lockup;\n const linkProps = {\n 'aria-label': label ?? (typeof title === 'string' ? title : 'Home'),\n 'children': content,\n 'className': styles.brandAnchor,\n href,\n 'onClick': () => shell?.closeNavigation(),\n };\n if (renderLink) return renderLink(linkProps);\n return (\n <a\n aria-label={linkProps['aria-label']}\n className={linkProps.className}\n href={href}\n onClick={linkProps.onClick}\n >\n {content}\n </a>\n );\n}\n\nConsoleBrand.displayName = 'ConsoleBrand';\n\nexport default ConsoleBrand;\n"],"mappings":";;;;;AAMA,SAAS,aAAa,EAAE,OAAO,KAAK,OAAO,MAAM,YAAY,SAA4B;CACvF,MAAM,QAAQ,qBAAqB;CACnC,MAAM,YAAY,OAAO,aAAa;CACtC,MAAM,SACJ,SAAS,QAAQ,UAAU,SAAS,UAAU,KAC5C,OAEA,qBAAC,QAAD;EAAM,WAAW,OAAO;EAAxB,UAAA,CACG,MACD,oBAAC,QAAD;GAAM,WAAW,OAAO;GAAY,UAAA;EAAY,CAAA,CAC5C;;CAEV,MAAM,UAAU,YAAY,OAAO;CACnC,MAAM,YAAY;EAChB,cAAc,UAAU,OAAO,UAAU,WAAW,QAAQ;EAC5D,YAAY;EACZ,aAAa,OAAO;EACpB;EACA,iBAAiB,OAAO,gBAAgB;CAC1C;CACA,IAAI,YAAY,OAAO,WAAW,SAAS;CAC3C,OACE,oBAAC,KAAD;EACE,cAAY,UAAU;EACtB,WAAW,UAAU;EACf;EACN,SAAS,UAAU;EAElB,UAAA;CACA,CAAA;AAEP;AAEA,aAAa,cAAc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConsoleShellProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/ConsoleShell/ConsoleShell.d.ts
|
|
3
|
+
declare function ConsoleShell({ brand, breadcrumb, children, className, collapsed, collapseLabel, defaultCollapsed, expandLabel, footer, hotkey, navigation, onCollapsedChange, openNavigationLabel, skipToContentLabel, storageKey, tools, ...rest }: ConsoleShellProps): import("react").JSX.Element;
|
|
4
|
+
declare namespace ConsoleShell {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ConsoleShell as default };
|
|
9
|
+
//# sourceMappingURL=ConsoleShell.d.mts.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import Button from "../../base-ui/Button/Button.mjs";
|
|
4
|
+
import Drawer from "../../base-ui/Drawer/Drawer.mjs";
|
|
5
|
+
import { ConsoleShellContext } from "./context.mjs";
|
|
6
|
+
import { useIsCompact, useLocalStorage, usePrefersReducedMotion } from "../hooks.mjs";
|
|
7
|
+
import { styles } from "./style.mjs";
|
|
8
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { PanelLeft } from "lucide-react";
|
|
11
|
+
//#region src/dashboard/ConsoleShell/ConsoleShell.tsx
|
|
12
|
+
function isTypingTarget(target) {
|
|
13
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
14
|
+
const tag = target.tagName;
|
|
15
|
+
return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable;
|
|
16
|
+
}
|
|
17
|
+
function ConsoleShell({ brand, breadcrumb, children, className, collapsed, collapseLabel = "Collapse sidebar", defaultCollapsed = false, expandLabel = "Expand sidebar", footer, hotkey = true, navigation, onCollapsedChange, openNavigationLabel = "Open navigation", skipToContentLabel = "Skip to content", storageKey, tools, ...rest }) {
|
|
18
|
+
const mainId = `console-main-${useId().replaceAll(":", "")}`;
|
|
19
|
+
const shellRef = useRef(null);
|
|
20
|
+
const isCompact = useIsCompact();
|
|
21
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
22
|
+
const [storedCollapsed, setStoredCollapsed] = useLocalStorage(storageKey, defaultCollapsed);
|
|
23
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
24
|
+
const isControlled = collapsed !== void 0;
|
|
25
|
+
const railCollapsed = isControlled ? collapsed : storedCollapsed;
|
|
26
|
+
const railed = railCollapsed && !isCompact;
|
|
27
|
+
const setCollapsed = (next) => {
|
|
28
|
+
if (!isControlled) setStoredCollapsed(next);
|
|
29
|
+
onCollapsedChange?.(next);
|
|
30
|
+
};
|
|
31
|
+
const closeNavigation = () => setDrawerOpen(false);
|
|
32
|
+
const toggleNavigation = () => {
|
|
33
|
+
if (isCompact) {
|
|
34
|
+
setDrawerOpen((open) => !open);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setCollapsed(!railCollapsed);
|
|
38
|
+
};
|
|
39
|
+
const toggleRef = useRef(toggleNavigation);
|
|
40
|
+
toggleRef.current = toggleNavigation;
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!hotkey) return;
|
|
43
|
+
const node = shellRef.current;
|
|
44
|
+
if (!node) return;
|
|
45
|
+
const onKeyDown = (event) => {
|
|
46
|
+
if (event.key.toLowerCase() !== "b" || !(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
47
|
+
if (event.repeat || isTypingTarget(event.target)) return;
|
|
48
|
+
if (!node.contains(event.target)) return;
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
toggleRef.current();
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener("keydown", onKeyDown);
|
|
53
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
54
|
+
}, [hotkey]);
|
|
55
|
+
const stateFor = (rail) => ({
|
|
56
|
+
closeNavigation,
|
|
57
|
+
collapsed: rail,
|
|
58
|
+
compact: isCompact
|
|
59
|
+
});
|
|
60
|
+
const sidebar = (rail) => /* @__PURE__ */ jsxs(ConsoleShellContext, {
|
|
61
|
+
value: stateFor(rail),
|
|
62
|
+
children: [
|
|
63
|
+
brand ? /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: styles.brand,
|
|
65
|
+
"data-collapsed": rail,
|
|
66
|
+
children: brand
|
|
67
|
+
}) : null,
|
|
68
|
+
navigation ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: styles.navSlot,
|
|
70
|
+
children: navigation
|
|
71
|
+
}) : null,
|
|
72
|
+
footer ? /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: styles.sidebarBottom,
|
|
74
|
+
children: footer
|
|
75
|
+
}) : null
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
const toggleLabel = isCompact ? openNavigationLabel : railed ? expandLabel : collapseLabel;
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: className ? `${styles.shell} ${className}` : styles.shell,
|
|
81
|
+
"data-console-shell": "",
|
|
82
|
+
ref: shellRef,
|
|
83
|
+
...rest,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("a", {
|
|
86
|
+
className: styles.skipLink,
|
|
87
|
+
href: `#${mainId}`,
|
|
88
|
+
onClick: (event) => {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
document.getElementById(mainId)?.focus();
|
|
91
|
+
},
|
|
92
|
+
children: skipToContentLabel
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("aside", {
|
|
95
|
+
className: styles.sidebar,
|
|
96
|
+
"data-collapsed": railed,
|
|
97
|
+
"data-instant": reducedMotion,
|
|
98
|
+
children: !isCompact && sidebar(railed)
|
|
99
|
+
}),
|
|
100
|
+
isCompact ? /* @__PURE__ */ jsx(Drawer, {
|
|
101
|
+
noHeader: true,
|
|
102
|
+
open: drawerOpen,
|
|
103
|
+
placement: "left",
|
|
104
|
+
width: 272,
|
|
105
|
+
onClose: closeNavigation,
|
|
106
|
+
children: /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
107
|
+
height: "100%",
|
|
108
|
+
children: sidebar(false)
|
|
109
|
+
})
|
|
110
|
+
}) : null,
|
|
111
|
+
/* @__PURE__ */ jsxs("div", {
|
|
112
|
+
className: styles.workspace,
|
|
113
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
114
|
+
className: styles.topbar,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Button, {
|
|
117
|
+
"aria-label": toggleLabel,
|
|
118
|
+
icon: PanelLeft,
|
|
119
|
+
type: "text",
|
|
120
|
+
onClick: toggleNavigation
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsx("span", {
|
|
123
|
+
"aria-hidden": true,
|
|
124
|
+
className: styles.topbarDivider
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsx("div", {
|
|
127
|
+
className: styles.topbarMain,
|
|
128
|
+
children: breadcrumb
|
|
129
|
+
}),
|
|
130
|
+
tools ? /* @__PURE__ */ jsx("div", {
|
|
131
|
+
className: styles.tools,
|
|
132
|
+
children: tools
|
|
133
|
+
}) : null
|
|
134
|
+
]
|
|
135
|
+
}), /* @__PURE__ */ jsx("main", {
|
|
136
|
+
className: styles.main,
|
|
137
|
+
id: mainId,
|
|
138
|
+
tabIndex: -1,
|
|
139
|
+
children
|
|
140
|
+
})]
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
ConsoleShell.displayName = "ConsoleShell";
|
|
146
|
+
//#endregion
|
|
147
|
+
export { ConsoleShell as default };
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=ConsoleShell.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleShell.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/ConsoleShell/ConsoleShell.tsx"],"sourcesContent":["'use client';\n\nimport { PanelLeft } from 'lucide-react';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport Button from '@/base-ui/Button';\nimport { Drawer } from '@/base-ui/Drawer';\nimport { Flexbox } from '@/Flex';\n\nimport { useIsCompact, useLocalStorage, usePrefersReducedMotion } from '../hooks';\nimport { ConsoleShellContext } from './context';\nimport { styles } from './style';\nimport type { ConsoleShellProps, ConsoleShellState } from './type';\n\nfunction isTypingTarget(target: EventTarget | null) {\n if (!(target instanceof HTMLElement)) return false;\n const tag = target.tagName;\n return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target.isContentEditable;\n}\n\nfunction ConsoleShell({\n brand,\n breadcrumb,\n children,\n className,\n collapsed,\n collapseLabel = 'Collapse sidebar',\n defaultCollapsed = false,\n expandLabel = 'Expand sidebar',\n footer,\n hotkey = true,\n navigation,\n onCollapsedChange,\n openNavigationLabel = 'Open navigation',\n skipToContentLabel = 'Skip to content',\n storageKey,\n tools,\n ...rest\n}: ConsoleShellProps) {\n const mainId = `console-main-${useId().replaceAll(':', '')}`;\n const shellRef = useRef<HTMLDivElement>(null);\n const isCompact = useIsCompact();\n const reducedMotion = usePrefersReducedMotion();\n const [storedCollapsed, setStoredCollapsed] = useLocalStorage(storageKey, defaultCollapsed);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const isControlled = collapsed !== undefined;\n const railCollapsed = isControlled ? collapsed : storedCollapsed;\n const railed = railCollapsed && !isCompact;\n\n const setCollapsed = (next: boolean) => {\n if (!isControlled) setStoredCollapsed(next);\n onCollapsedChange?.(next);\n };\n\n const closeNavigation = () => setDrawerOpen(false);\n const toggleNavigation = () => {\n if (isCompact) {\n setDrawerOpen((open) => !open);\n return;\n }\n setCollapsed(!railCollapsed);\n };\n const toggleRef = useRef(toggleNavigation);\n toggleRef.current = toggleNavigation;\n\n useEffect(() => {\n if (!hotkey) return;\n const node = shellRef.current;\n if (!node) return;\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() !== 'b' || !(event.metaKey || event.ctrlKey) || event.altKey) {\n return;\n }\n if (event.repeat || isTypingTarget(event.target)) return;\n if (!node.contains(event.target as Node)) return;\n event.preventDefault();\n toggleRef.current();\n };\n\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [hotkey]);\n\n const stateFor = (rail: boolean): ConsoleShellState => ({\n closeNavigation,\n collapsed: rail,\n compact: isCompact,\n });\n\n const sidebar = (rail: boolean) => (\n <ConsoleShellContext value={stateFor(rail)}>\n {brand ? (\n <div className={styles.brand} data-collapsed={rail}>\n {brand}\n </div>\n ) : null}\n {navigation ? <div className={styles.navSlot}>{navigation}</div> : null}\n {footer ? <div className={styles.sidebarBottom}>{footer}</div> : null}\n </ConsoleShellContext>\n );\n\n const toggleLabel = isCompact ? openNavigationLabel : railed ? expandLabel : collapseLabel;\n\n return (\n <div\n className={className ? `${styles.shell} ${className}` : styles.shell}\n data-console-shell=\"\"\n ref={shellRef}\n {...rest}\n >\n <a\n className={styles.skipLink}\n href={`#${mainId}`}\n onClick={(event) => {\n event.preventDefault();\n document.getElementById(mainId)?.focus();\n }}\n >\n {skipToContentLabel}\n </a>\n <aside className={styles.sidebar} data-collapsed={railed} data-instant={reducedMotion}>\n {!isCompact && sidebar(railed)}\n </aside>\n {isCompact ? (\n <Drawer noHeader open={drawerOpen} placement=\"left\" width={272} onClose={closeNavigation}>\n <Flexbox height=\"100%\">{sidebar(false)}</Flexbox>\n </Drawer>\n ) : null}\n <div className={styles.workspace}>\n <header className={styles.topbar}>\n <Button\n aria-label={toggleLabel}\n icon={PanelLeft}\n type=\"text\"\n onClick={toggleNavigation}\n />\n <span aria-hidden className={styles.topbarDivider} />\n <div className={styles.topbarMain}>{breadcrumb}</div>\n {tools ? <div className={styles.tools}>{tools}</div> : null}\n </header>\n <main className={styles.main} id={mainId} tabIndex={-1}>\n {children}\n </main>\n </div>\n </div>\n );\n}\n\nConsoleShell.displayName = 'ConsoleShell';\n\nexport default ConsoleShell;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/dashboard/ConsoleShell/context.ts
|
|
4
|
+
const ConsoleShellContext = createContext(null);
|
|
5
|
+
function useConsoleShell() {
|
|
6
|
+
const value = use(ConsoleShellContext);
|
|
7
|
+
if (!value) throw new Error("useConsoleShell must be used within ConsoleShell");
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
function useConsoleShellState() {
|
|
11
|
+
return use(ConsoleShellContext);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ConsoleShellContext, useConsoleShell, useConsoleShellState };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\nimport type { ConsoleShellState } from './type';\n\nexport const ConsoleShellContext = createContext<ConsoleShellState | null>(null);\n\nexport function useConsoleShell(): ConsoleShellState {\n const value = use(ConsoleShellContext);\n if (!value) throw new Error('useConsoleShell must be used within ConsoleShell');\n return value;\n}\n\nexport function useConsoleShellState(): ConsoleShellState | null {\n return use(ConsoleShellContext);\n}\n"],"mappings":";;;AAMA,MAAa,sBAAsB,cAAwC,IAAI;AAE/E,SAAgB,kBAAqC;CACnD,MAAM,QAAQ,IAAI,mBAAmB;CACrC,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,kDAAkD;CAC9E,OAAO;AACT;AAEA,SAAgB,uBAAiD;CAC/D,OAAO,IAAI,mBAAmB;AAChC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConsoleBrandLinkProps, ConsoleBrandProps, ConsoleShellProps, ConsoleShellState } from "./type.mjs";
|
|
2
|
+
import ConsoleBrand from "./ConsoleBrand.mjs";
|
|
3
|
+
import ConsoleShell from "./ConsoleShell.mjs";
|
|
4
|
+
import { useConsoleShell } from "./context.mjs";
|
|
5
|
+
export { ConsoleBrand, type ConsoleBrandProps, type ConsoleShellProps, type ConsoleShellState, ConsoleShell as default, useConsoleShell };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/ConsoleShell/style.ts
|
|
3
|
+
const SIDEBAR_INLINE_SIZE = 248;
|
|
4
|
+
const SIDEBAR_RAIL_INLINE_SIZE = 64;
|
|
5
|
+
const WORKSPACE_INSET = 8;
|
|
6
|
+
/**
|
|
7
|
+
* `responsive.laptop`, not `responsive.tablet`. The aliases are named for
|
|
8
|
+
* devices, and only `laptop` (max-width 991px) lines up with `useIsCompact`.
|
|
9
|
+
*/
|
|
10
|
+
const styles = createStaticStyles(({ css, cssVar, responsive }) => ({
|
|
11
|
+
brand: css`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex: none;
|
|
14
|
+
align-items: center;
|
|
15
|
+
|
|
16
|
+
block-size: 56px;
|
|
17
|
+
margin-block-start: ${WORKSPACE_INSET}px;
|
|
18
|
+
padding-inline: 16px;
|
|
19
|
+
|
|
20
|
+
color: ${cssVar.colorText};
|
|
21
|
+
|
|
22
|
+
&[data-collapsed='true'] {
|
|
23
|
+
justify-content: center;
|
|
24
|
+
padding-inline: 0;
|
|
25
|
+
|
|
26
|
+
> * {
|
|
27
|
+
justify-content: center;
|
|
28
|
+
inline-size: auto;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${responsive.laptop} {
|
|
33
|
+
margin-block-start: 0;
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
brandAnchor: css`
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
|
|
40
|
+
inline-size: 100%;
|
|
41
|
+
min-inline-size: 0;
|
|
42
|
+
|
|
43
|
+
color: inherit;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
`,
|
|
46
|
+
brandLockup: css`
|
|
47
|
+
display: flex;
|
|
48
|
+
gap: 10px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
min-inline-size: 0;
|
|
51
|
+
`,
|
|
52
|
+
brandName: css`
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
line-height: 1.3;
|
|
58
|
+
color: ${cssVar.colorText};
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
`,
|
|
62
|
+
main: css`
|
|
63
|
+
overflow: auto;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex: 1;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 20px;
|
|
68
|
+
|
|
69
|
+
min-inline-size: 0;
|
|
70
|
+
min-block-size: 0;
|
|
71
|
+
padding: 24px;
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* A page that owns a full-height split sets data-page-layout="flush" and
|
|
75
|
+
* takes over padding and scrolling, so its sidebar can sit on the card edge.
|
|
76
|
+
*/
|
|
77
|
+
&:has([data-page-layout='flush']) {
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
gap: 0;
|
|
80
|
+
padding: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
${responsive.mobile} {
|
|
84
|
+
gap: 16px;
|
|
85
|
+
padding: 16px;
|
|
86
|
+
}
|
|
87
|
+
`,
|
|
88
|
+
navSlot: css`
|
|
89
|
+
display: flex;
|
|
90
|
+
flex: 1;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
min-block-size: 0;
|
|
93
|
+
`,
|
|
94
|
+
shell: css`
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex: 1;
|
|
98
|
+
|
|
99
|
+
block-size: 100%;
|
|
100
|
+
min-block-size: 0;
|
|
101
|
+
|
|
102
|
+
background: ${cssVar.colorBgLayout};
|
|
103
|
+
`,
|
|
104
|
+
sidebar: css`
|
|
105
|
+
display: flex;
|
|
106
|
+
flex: none;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
|
|
109
|
+
inline-size: ${SIDEBAR_INLINE_SIZE}px;
|
|
110
|
+
block-size: 100%;
|
|
111
|
+
min-block-size: 0;
|
|
112
|
+
|
|
113
|
+
transition: inline-size 200ms ease;
|
|
114
|
+
|
|
115
|
+
&[data-collapsed='true'] {
|
|
116
|
+
inline-size: ${SIDEBAR_RAIL_INLINE_SIZE}px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&[data-instant='true'] {
|
|
120
|
+
transition: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
${responsive.laptop} {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
sidebarBottom: css`
|
|
128
|
+
flex: none;
|
|
129
|
+
padding: 8px;
|
|
130
|
+
`,
|
|
131
|
+
skipLink: css`
|
|
132
|
+
position: fixed;
|
|
133
|
+
z-index: 2000;
|
|
134
|
+
inset-block-start: -100px;
|
|
135
|
+
inset-inline-start: 12px;
|
|
136
|
+
|
|
137
|
+
padding-block: 8px;
|
|
138
|
+
padding-inline: 12px;
|
|
139
|
+
border-radius: ${cssVar.borderRadius};
|
|
140
|
+
|
|
141
|
+
color: ${cssVar.colorText};
|
|
142
|
+
|
|
143
|
+
background: ${cssVar.colorBgElevated};
|
|
144
|
+
|
|
145
|
+
&:focus {
|
|
146
|
+
inset-block-start: 12px;
|
|
147
|
+
}
|
|
148
|
+
`,
|
|
149
|
+
topbar: css`
|
|
150
|
+
display: flex;
|
|
151
|
+
flex: none;
|
|
152
|
+
gap: 8px;
|
|
153
|
+
align-items: center;
|
|
154
|
+
|
|
155
|
+
block-size: 56px;
|
|
156
|
+
padding-inline: 12px;
|
|
157
|
+
border-block-end: 1px solid ${cssVar.colorBorderSecondary};
|
|
158
|
+
`,
|
|
159
|
+
topbarDivider: css`
|
|
160
|
+
flex: none;
|
|
161
|
+
|
|
162
|
+
inline-size: 1px;
|
|
163
|
+
block-size: 18px;
|
|
164
|
+
margin-inline: 2px;
|
|
165
|
+
|
|
166
|
+
background: ${cssVar.colorBorderSecondary};
|
|
167
|
+
`,
|
|
168
|
+
topbarMain: css`
|
|
169
|
+
display: flex;
|
|
170
|
+
flex: 1;
|
|
171
|
+
align-items: center;
|
|
172
|
+
min-inline-size: 0;
|
|
173
|
+
`,
|
|
174
|
+
tools: css`
|
|
175
|
+
display: flex;
|
|
176
|
+
flex: none;
|
|
177
|
+
gap: 6px;
|
|
178
|
+
align-items: center;
|
|
179
|
+
|
|
180
|
+
margin-inline-start: auto;
|
|
181
|
+
`,
|
|
182
|
+
workspace: css`
|
|
183
|
+
overflow: hidden;
|
|
184
|
+
display: flex;
|
|
185
|
+
flex: 1;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
|
|
188
|
+
min-inline-size: 0;
|
|
189
|
+
min-block-size: 0;
|
|
190
|
+
margin-block: ${WORKSPACE_INSET}px;
|
|
191
|
+
margin-inline: 0 ${WORKSPACE_INSET}px;
|
|
192
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
193
|
+
border-radius: ${cssVar.borderRadiusLG};
|
|
194
|
+
|
|
195
|
+
background: ${cssVar.colorBgContainer};
|
|
196
|
+
box-shadow: ${cssVar.boxShadowTertiary};
|
|
197
|
+
|
|
198
|
+
${responsive.laptop} {
|
|
199
|
+
margin: 0;
|
|
200
|
+
border: none;
|
|
201
|
+
border-radius: 0;
|
|
202
|
+
box-shadow: none;
|
|
203
|
+
}
|
|
204
|
+
`
|
|
205
|
+
}));
|
|
206
|
+
//#endregion
|
|
207
|
+
export { styles };
|
|
208
|
+
|
|
209
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nconst SIDEBAR_INLINE_SIZE = 248;\nconst SIDEBAR_RAIL_INLINE_SIZE = 64;\nconst WORKSPACE_INSET = 8;\n\n/**\n * `responsive.laptop`, not `responsive.tablet`. The aliases are named for\n * devices, and only `laptop` (max-width 991px) lines up with `useIsCompact`.\n */\nexport const styles = createStaticStyles(({ css, cssVar, responsive }) => ({\n brand: css`\n display: flex;\n flex: none;\n align-items: center;\n\n block-size: 56px;\n margin-block-start: ${WORKSPACE_INSET}px;\n padding-inline: 16px;\n\n color: ${cssVar.colorText};\n\n &[data-collapsed='true'] {\n justify-content: center;\n padding-inline: 0;\n\n > * {\n justify-content: center;\n inline-size: auto;\n }\n }\n\n ${responsive.laptop} {\n margin-block-start: 0;\n }\n `,\n brandAnchor: css`\n display: flex;\n align-items: center;\n\n inline-size: 100%;\n min-inline-size: 0;\n\n color: inherit;\n text-decoration: none;\n `,\n brandLockup: css`\n display: flex;\n gap: 10px;\n align-items: center;\n min-inline-size: 0;\n `,\n brandName: css`\n overflow: hidden;\n\n font-size: 14px;\n font-weight: 600;\n line-height: 1.3;\n color: ${cssVar.colorText};\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n main: css`\n overflow: auto;\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: 20px;\n\n min-inline-size: 0;\n min-block-size: 0;\n padding: 24px;\n\n /*\n * A page that owns a full-height split sets data-page-layout=\"flush\" and\n * takes over padding and scrolling, so its sidebar can sit on the card edge.\n */\n &:has([data-page-layout='flush']) {\n overflow: hidden;\n gap: 0;\n padding: 0;\n }\n\n ${responsive.mobile} {\n gap: 16px;\n padding: 16px;\n }\n `,\n navSlot: css`\n display: flex;\n flex: 1;\n flex-direction: column;\n min-block-size: 0;\n `,\n shell: css`\n overflow: hidden;\n display: flex;\n flex: 1;\n\n block-size: 100%;\n min-block-size: 0;\n\n background: ${cssVar.colorBgLayout};\n `,\n sidebar: css`\n display: flex;\n flex: none;\n flex-direction: column;\n\n inline-size: ${SIDEBAR_INLINE_SIZE}px;\n block-size: 100%;\n min-block-size: 0;\n\n transition: inline-size 200ms ease;\n\n &[data-collapsed='true'] {\n inline-size: ${SIDEBAR_RAIL_INLINE_SIZE}px;\n }\n\n &[data-instant='true'] {\n transition: none;\n }\n\n ${responsive.laptop} {\n display: none;\n }\n `,\n sidebarBottom: css`\n flex: none;\n padding: 8px;\n `,\n skipLink: css`\n position: fixed;\n z-index: 2000;\n inset-block-start: -100px;\n inset-inline-start: 12px;\n\n padding-block: 8px;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadius};\n\n color: ${cssVar.colorText};\n\n background: ${cssVar.colorBgElevated};\n\n &:focus {\n inset-block-start: 12px;\n }\n `,\n topbar: css`\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n\n block-size: 56px;\n padding-inline: 12px;\n border-block-end: 1px solid ${cssVar.colorBorderSecondary};\n `,\n topbarDivider: css`\n flex: none;\n\n inline-size: 1px;\n block-size: 18px;\n margin-inline: 2px;\n\n background: ${cssVar.colorBorderSecondary};\n `,\n topbarMain: css`\n display: flex;\n flex: 1;\n align-items: center;\n min-inline-size: 0;\n `,\n tools: css`\n display: flex;\n flex: none;\n gap: 6px;\n align-items: center;\n\n margin-inline-start: auto;\n `,\n workspace: css`\n overflow: hidden;\n display: flex;\n flex: 1;\n flex-direction: column;\n\n min-inline-size: 0;\n min-block-size: 0;\n margin-block: ${WORKSPACE_INSET}px;\n margin-inline: 0 ${WORKSPACE_INSET}px;\n border: 1px solid ${cssVar.colorBorderSecondary};\n border-radius: ${cssVar.borderRadiusLG};\n\n background: ${cssVar.colorBgContainer};\n box-shadow: ${cssVar.boxShadowTertiary};\n\n ${responsive.laptop} {\n margin: 0;\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n `,\n}));\n"],"mappings":";;AAEA,MAAM,sBAAsB;AAC5B,MAAM,2BAA2B;AACjC,MAAM,kBAAkB;;;;;AAMxB,MAAa,SAAS,oBAAoB,EAAE,KAAK,QAAQ,kBAAkB;CACzE,OAAO,GAAG;;;;;;0BAMc,gBAAgB;;;aAG7B,OAAO,UAAU;;;;;;;;;;;;MAYxB,WAAW,OAAO;;;;CAItB,aAAa,GAAG;;;;;;;;;;CAUhB,aAAa,GAAG;;;;;;CAMhB,WAAW,GAAG;;;;;;aAMH,OAAO,UAAU;;;;CAI5B,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;MAqBL,WAAW,OAAO;;;;;CAKtB,SAAS,GAAG;;;;;;CAMZ,OAAO,GAAG;;;;;;;;kBAQM,OAAO,cAAc;;CAErC,SAAS,GAAG;;;;;mBAKK,oBAAoB;;;;;;;qBAOlB,yBAAyB;;;;;;;MAOxC,WAAW,OAAO;;;;CAItB,eAAe,GAAG;;;;CAIlB,UAAU,GAAG;;;;;;;;qBAQM,OAAO,aAAa;;aAE5B,OAAO,UAAU;;kBAEZ,OAAO,gBAAgB;;;;;;CAMvC,QAAQ,GAAG;;;;;;;;kCAQqB,OAAO,qBAAqB;;CAE5D,eAAe,GAAG;;;;;;;kBAOF,OAAO,qBAAqB;;CAE5C,YAAY,GAAG;;;;;;CAMf,OAAO,GAAG;;;;;;;;CAQV,WAAW,GAAG;;;;;;;;oBAQI,gBAAgB;uBACb,gBAAgB;wBACf,OAAO,qBAAqB;qBAC/B,OAAO,eAAe;;kBAEzB,OAAO,iBAAiB;kBACxB,OAAO,kBAAkB;;MAErC,WAAW,OAAO;;;;;;;AAOxB,EAAE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/ConsoleShell/type.d.ts
|
|
3
|
+
interface ConsoleShellState {
|
|
4
|
+
/** Closes the compact navigation drawer. */
|
|
5
|
+
closeNavigation: () => void;
|
|
6
|
+
/** Icon rail, only when the sidebar is collapsed on a wide viewport. */
|
|
7
|
+
collapsed: boolean;
|
|
8
|
+
/** Sidebar is a drawer. Matches the laptop breakpoint. */
|
|
9
|
+
compact: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface ConsoleBrandLinkProps {
|
|
12
|
+
'aria-label': string;
|
|
13
|
+
'children': ReactNode;
|
|
14
|
+
'className': string;
|
|
15
|
+
'href': string;
|
|
16
|
+
'onClick': () => void;
|
|
17
|
+
}
|
|
18
|
+
interface ConsoleBrandProps {
|
|
19
|
+
href?: string;
|
|
20
|
+
/** Accessible name for the home link. Defaults to `title`. */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Mark shown on its own when the sidebar is an icon rail. */
|
|
23
|
+
logo: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Renders the home link. Use this to plug in a router `Link`.
|
|
26
|
+
* The default render is an anchor.
|
|
27
|
+
*/
|
|
28
|
+
renderLink?: (props: ConsoleBrandLinkProps) => ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Name beside the mark. Omit when `logo` already includes the wordmark,
|
|
31
|
+
* such as a combine lockup.
|
|
32
|
+
*/
|
|
33
|
+
title?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
interface ConsoleShellProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
36
|
+
/** Home mark. Rendered at the top of the sidebar. */
|
|
37
|
+
brand?: ReactNode;
|
|
38
|
+
/** Location shown in the top bar, usually a `Breadcrumb`. */
|
|
39
|
+
breadcrumb?: ReactNode;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
/** Collapse the sidebar to an icon rail. Ignored while compact. */
|
|
42
|
+
collapsed?: boolean;
|
|
43
|
+
collapseLabel?: string;
|
|
44
|
+
defaultCollapsed?: boolean;
|
|
45
|
+
expandLabel?: string;
|
|
46
|
+
/** Account menu or other content pinned to the bottom of the sidebar. */
|
|
47
|
+
footer?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Collapse and expand with Mod+B while focus is inside the shell.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
hotkey?: boolean;
|
|
53
|
+
/** Grouped navigation. Collapsed state comes from the shell. */
|
|
54
|
+
navigation?: ReactNode;
|
|
55
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
56
|
+
openNavigationLabel?: string;
|
|
57
|
+
skipToContentLabel?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Persists the collapsed rail. Omit to keep the choice in memory only.
|
|
60
|
+
*/
|
|
61
|
+
storageKey?: string;
|
|
62
|
+
/** Actions at the end of the top bar. */
|
|
63
|
+
tools?: ReactNode;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { ConsoleBrandLinkProps, ConsoleBrandProps, ConsoleShellProps, ConsoleShellState };
|
|
67
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FilterOptionProps, FilterRowProps, FilterSidebarProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/FilterSidebar/FilterSidebar.d.ts
|
|
3
|
+
declare function FilterSidebar({ body, children, flush, head, header, label, storageKey, summary, wide }: FilterSidebarProps): import("react").JSX.Element;
|
|
4
|
+
declare namespace FilterSidebar {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
declare function FilterRow({ count, name }: FilterRowProps): import("react").JSX.Element;
|
|
8
|
+
declare namespace FilterRow {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
declare function FilterOption({ count, icon, label, name, onClick, selected, title }: FilterOptionProps): import("react").JSX.Element;
|
|
12
|
+
declare namespace FilterOption {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { FilterOption, FilterRow, FilterSidebar as default };
|
|
17
|
+
//# sourceMappingURL=FilterSidebar.d.mts.map
|