@lobehub/ui 5.58.0 → 5.60.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/ActionIcon/style.mjs +8 -2
- package/es/ActionIcon/style.mjs.map +1 -1
- package/es/Grid/style.mjs +8 -8
- package/es/Grid/style.mjs.map +1 -1
- package/es/awesome/Grainient/Grainient.d.mts +11 -0
- package/es/awesome/Grainient/Grainient.mjs +311 -0
- package/es/awesome/Grainient/Grainient.mjs.map +1 -0
- package/es/awesome/Grainient/index.d.mts +3 -0
- package/es/awesome/Grainient/style.mjs +25 -0
- package/es/awesome/Grainient/style.mjs.map +1 -0
- package/es/awesome/Grainient/type.d.mts +122 -0
- package/es/awesome/index.d.mts +4 -1
- package/es/awesome/index.mjs +2 -1
- package/es/base-ui/ActionIcon/style.mjs +8 -2
- package/es/base-ui/ActionIcon/style.mjs.map +1 -1
- package/es/base-ui/Input/style.mjs +8 -2
- package/es/base-ui/Input/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
- package/es/dashboard/AuthLayout/Aside.mjs +30 -0
- package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
- package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
- package/es/dashboard/AuthLayout/index.d.mts +3 -2
- package/es/dashboard/AuthLayout/style.mjs +120 -1
- package/es/dashboard/AuthLayout/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/type.d.mts +39 -3
- package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +32 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/index.d.mts +4 -0
- package/es/dashboard/AuthTools/style.mjs +63 -0
- package/es/dashboard/AuthTools/style.mjs.map +1 -0
- package/es/dashboard/AuthTools/type.d.mts +30 -0
- package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs +18 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
- package/es/dashboard/ChartGrid/index.d.mts +3 -0
- package/es/dashboard/ChartGrid/style.mjs +32 -0
- package/es/dashboard/ChartGrid/style.mjs.map +1 -0
- package/es/dashboard/ChartGrid/type.d.mts +9 -0
- package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs +81 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +3 -2
- package/es/dashboard/ConsoleNav/style.mjs +15 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/type.d.mts +14 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +22 -6
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +21 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +11 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
- package/es/dashboard/FilterStrip/index.d.mts +3 -0
- package/es/dashboard/FilterStrip/style.mjs +94 -0
- package/es/dashboard/FilterStrip/style.mjs.map +1 -0
- package/es/dashboard/FilterStrip/type.d.mts +26 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
- package/es/dashboard/LabelWithKey/index.d.mts +3 -0
- package/es/dashboard/LabelWithKey/type.d.mts +12 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
- package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
- package/es/dashboard/MetricStrip/index.d.mts +3 -0
- package/es/dashboard/MetricStrip/style.mjs +161 -0
- package/es/dashboard/MetricStrip/style.mjs.map +1 -0
- package/es/dashboard/MetricStrip/type.d.mts +37 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
- package/es/dashboard/PageSkeleton/style.mjs +1 -1
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
- package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs +21 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
- package/es/dashboard/PageToolbar/index.d.mts +3 -0
- package/es/dashboard/PageToolbar/style.mjs +34 -0
- package/es/dashboard/PageToolbar/style.mjs.map +1 -0
- package/es/dashboard/PageToolbar/type.d.mts +12 -0
- package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs +39 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
- package/es/dashboard/PanelSurface/index.d.mts +3 -0
- package/es/dashboard/PanelSurface/style.mjs +24 -0
- package/es/dashboard/PanelSurface/style.mjs.map +1 -0
- package/es/dashboard/PanelSurface/type.d.mts +18 -0
- package/es/dashboard/Section/Section.d.mts +10 -0
- package/es/dashboard/Section/Section.mjs +81 -0
- package/es/dashboard/Section/Section.mjs.map +1 -0
- package/es/dashboard/Section/index.d.mts +3 -0
- package/es/dashboard/Section/style.mjs +35 -0
- package/es/dashboard/Section/style.mjs.map +1 -0
- package/es/dashboard/Section/type.d.mts +24 -0
- package/es/dashboard/StatCard/StatCard.d.mts +2 -1
- package/es/dashboard/StatCard/StatCard.mjs +24 -72
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
- package/es/dashboard/StatCard/type.d.mts +16 -5
- package/es/dashboard/Surface/Surface.d.mts +4 -3
- package/es/dashboard/Surface/Surface.mjs +83 -7
- package/es/dashboard/Surface/Surface.mjs.map +1 -1
- package/es/dashboard/Surface/index.d.mts +3 -2
- package/es/dashboard/Surface/link.d.mts +19 -0
- package/es/dashboard/Surface/link.mjs +33 -0
- package/es/dashboard/Surface/link.mjs.map +1 -0
- package/es/dashboard/Surface/style.d.mts +45 -3
- package/es/dashboard/Surface/style.mjs +358 -8
- package/es/dashboard/Surface/style.mjs.map +1 -1
- package/es/dashboard/Surface/type.d.mts +30 -2
- package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
- package/es/dashboard/TableIconActions/index.d.mts +3 -0
- package/es/dashboard/TableIconActions/type.d.mts +18 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
- package/es/dashboard/TitleWithTips/index.d.mts +3 -0
- package/es/dashboard/TitleWithTips/type.d.mts +11 -0
- package/es/dashboard/index.d.mts +38 -4
- package/es/dashboard/index.mjs +17 -3
- package/package.json +1 -1
- package/es/dashboard/StatCard/style.mjs +0 -135
- package/es/dashboard/StatCard/style.mjs.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SurfaceRenderLink } from "../Surface/type.mjs";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
//#region src/dashboard/PanelSurface/type.d.ts
|
|
4
|
+
interface PanelSurfaceProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
extra?: ReactNode;
|
|
9
|
+
href?: string;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
renderLink?: SurfaceRenderLink;
|
|
12
|
+
size?: 'default' | 'small';
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { PanelSurfaceProps };
|
|
18
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SectionProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/Section/Section.d.ts
|
|
3
|
+
/** A titled page section with description, extra and a "more" link, flat or as a card. */
|
|
4
|
+
declare const Section: {
|
|
5
|
+
({ className, variant, fontSize, title, more, moreLink, icon, children, desc, extra, gap, padded, renderLink, ...rest }: SectionProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Section as default };
|
|
10
|
+
//# sourceMappingURL=Section.d.mts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import Icon from "../../Icon/Icon.mjs";
|
|
4
|
+
import { useSurfaceLink } from "../Surface/link.mjs";
|
|
5
|
+
import Surface from "../Surface/Surface.mjs";
|
|
6
|
+
import { styles } from "./style.mjs";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ChevronRight } from "lucide-react";
|
|
9
|
+
//#region src/dashboard/Section/Section.tsx
|
|
10
|
+
/** A titled page section with description, extra and a "more" link, flat or as a card. */
|
|
11
|
+
const Section = ({ className, variant = "default", fontSize, title, more, moreLink, icon, children, desc, extra, gap, padded, renderLink, ...rest }) => {
|
|
12
|
+
const link = useSurfaceLink(renderLink);
|
|
13
|
+
const moreNode = moreLink ? link({
|
|
14
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { children: more }), /* @__PURE__ */ jsx(Icon, { icon: ChevronRight })] }),
|
|
15
|
+
className: styles.more,
|
|
16
|
+
href: moreLink,
|
|
17
|
+
rel: moreLink.startsWith("http") ? "noreferrer" : void 0,
|
|
18
|
+
target: moreLink.startsWith("http") ? "_blank" : void 0
|
|
19
|
+
}) : null;
|
|
20
|
+
const actions = extra || moreNode ? /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
21
|
+
horizontal: true,
|
|
22
|
+
align: "center",
|
|
23
|
+
gap: 8,
|
|
24
|
+
children: [extra, moreNode]
|
|
25
|
+
}) : void 0;
|
|
26
|
+
if (variant === "card") return /* @__PURE__ */ jsx(Surface, {
|
|
27
|
+
description: desc,
|
|
28
|
+
extra: actions,
|
|
29
|
+
padded: padded ?? true,
|
|
30
|
+
title: title ? /* @__PURE__ */ jsxs("span", {
|
|
31
|
+
className: styles.title,
|
|
32
|
+
style: fontSize ? { fontSize } : void 0,
|
|
33
|
+
children: [icon, title]
|
|
34
|
+
}) : void 0,
|
|
35
|
+
children: /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
36
|
+
className,
|
|
37
|
+
gap: gap ?? 12,
|
|
38
|
+
...rest,
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
if (!title) return /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
43
|
+
className,
|
|
44
|
+
gap,
|
|
45
|
+
...rest,
|
|
46
|
+
children
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
49
|
+
className,
|
|
50
|
+
gap: gap ?? 16,
|
|
51
|
+
width: "100%",
|
|
52
|
+
...rest,
|
|
53
|
+
children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
54
|
+
horizontal: true,
|
|
55
|
+
align: "center",
|
|
56
|
+
gap: 12,
|
|
57
|
+
justify: "space-between",
|
|
58
|
+
width: "100%",
|
|
59
|
+
children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
60
|
+
gap: 4,
|
|
61
|
+
children: [
|
|
62
|
+
icon,
|
|
63
|
+
/* @__PURE__ */ jsx("h2", {
|
|
64
|
+
className: styles.title,
|
|
65
|
+
style: fontSize ? { fontSize } : void 0,
|
|
66
|
+
children: title
|
|
67
|
+
}),
|
|
68
|
+
desc ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: styles.desc,
|
|
70
|
+
children: desc
|
|
71
|
+
}) : null
|
|
72
|
+
]
|
|
73
|
+
}), actions ?? null]
|
|
74
|
+
}), children]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
Section.displayName = "Section";
|
|
78
|
+
//#endregion
|
|
79
|
+
export { Section as default };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=Section.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/Section/Section.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronRight } from 'lucide-react';\n\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { useSurfaceLink } from '../Surface/link';\nimport Surface from '../Surface/Surface';\nimport { styles } from './style';\nimport type { SectionProps } from './type';\n\n/** A titled page section with description, extra and a \"more\" link, flat or as a card. */\nconst Section = ({\n className,\n variant = 'default',\n fontSize,\n title,\n more,\n moreLink,\n icon,\n children,\n desc,\n extra,\n gap,\n padded,\n renderLink,\n ...rest\n}: SectionProps) => {\n const link = useSurfaceLink(renderLink);\n const moreNode = moreLink\n ? link({\n children: (\n <>\n <span>{more}</span>\n <Icon icon={ChevronRight} />\n </>\n ),\n className: styles.more,\n href: moreLink,\n rel: moreLink.startsWith('http') ? 'noreferrer' : undefined,\n target: moreLink.startsWith('http') ? '_blank' : undefined,\n })\n : null;\n const actions =\n extra || moreNode ? (\n <Flexbox horizontal align=\"center\" gap={8}>\n {extra}\n {moreNode}\n </Flexbox>\n ) : undefined;\n\n if (variant === 'card') {\n return (\n <Surface\n description={desc}\n extra={actions}\n padded={padded ?? true}\n title={\n title ? (\n <span className={styles.title} style={fontSize ? { fontSize } : undefined}>\n {icon}\n {title}\n </span>\n ) : undefined\n }\n >\n <Flexbox className={className} gap={gap ?? 12} {...rest}>\n {children}\n </Flexbox>\n </Surface>\n );\n }\n\n if (!title) {\n return (\n <Flexbox className={className} gap={gap} {...rest}>\n {children}\n </Flexbox>\n );\n }\n\n return (\n <Flexbox className={className} gap={gap ?? 16} width=\"100%\" {...rest}>\n <Flexbox horizontal align=\"center\" gap={12} justify=\"space-between\" width=\"100%\">\n <Flexbox gap={4}>\n {icon}\n <h2 className={styles.title} style={fontSize ? { fontSize } : undefined}>\n {title}\n </h2>\n {desc ? <div className={styles.desc}>{desc}</div> : null}\n </Flexbox>\n {actions ?? null}\n </Flexbox>\n {children}\n </Flexbox>\n );\n};\n\nSection.displayName = 'Section';\n\nexport default Section;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,WAAW,EACf,WACA,UAAU,WACV,UACA,OACA,MACA,UACA,MACA,UACA,MACA,OACA,KACA,QACA,YACA,GAAG,WACe;CAClB,MAAM,OAAO,eAAe,UAAU;CACtC,MAAM,WAAW,WACb,KAAK;EACH,UACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAA,UAAO,KAAW,CAAA,GAClB,oBAAC,MAAD,EAAM,MAAM,aAAe,CAAA,CAC3B,EAAA,CAAA;EAEJ,WAAW,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,WAAW,MAAM,IAAI,eAAe,KAAA;EAClD,QAAQ,SAAS,WAAW,MAAM,IAAI,WAAW,KAAA;CACnD,CAAC,IACD;CACJ,MAAM,UACJ,SAAS,WACP,qBAACA,mBAAD;EAAS,YAAA;EAAW,OAAM;EAAS,KAAK;EAAxC,UAAA,CACG,OACA,QACM;CACP,CAAA,IAAA,KAAA;CAEN,IAAI,YAAY,QACd,OACE,oBAAC,SAAD;EACE,aAAa;EACb,OAAO;EACP,QAAQ,UAAU;EAClB,OACE,QACE,qBAAC,QAAD;GAAM,WAAW,OAAO;GAAO,OAAO,WAAW,EAAE,SAAS,IAAI,KAAA;GAAhE,UAAA,CACG,MACA,KACG;EACJ,CAAA,IAAA,KAAA;EAGN,UAAA,oBAACA,mBAAD;GAAoB;GAAW,KAAK,OAAO;GAAI,GAAI;GAChD;EACM,CAAA;CACF,CAAA;CAIb,IAAI,CAAC,OACH,OACE,oBAACA,mBAAD;EAAoB;EAAgB;EAAK,GAAI;EAC1C;CACM,CAAA;CAIb,OACE,qBAACA,mBAAD;EAAoB;EAAW,KAAK,OAAO;EAAI,OAAM;EAAO,GAAI;EAAhE,UAAA,CACE,qBAACA,mBAAD;GAAS,YAAA;GAAW,OAAM;GAAS,KAAK;GAAI,SAAQ;GAAgB,OAAM;GAA1E,UAAA,CACE,qBAACA,mBAAD;IAAS,KAAK;IAAd,UAAA;KACG;KACD,oBAAC,MAAD;MAAI,WAAW,OAAO;MAAO,OAAO,WAAW,EAAE,SAAS,IAAI,KAAA;MAC3D,UAAA;KACC,CAAA;KACH,OAAO,oBAAC,OAAD;MAAK,WAAW,OAAO;MAAO,UAAA;KAAU,CAAA,IAAI;IAC7C;GACR,CAAA,GAAA,WAAW,IACL;EACR,CAAA,GAAA,QACM;;AAEb;AAEA,QAAQ,cAAc"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/Section/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
4
|
+
desc: css`
|
|
5
|
+
font-size: 13px;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
line-height: 1.45;
|
|
8
|
+
color: ${cssVar.colorTextSecondary};
|
|
9
|
+
`,
|
|
10
|
+
more: css`
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
gap: 2px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
|
|
15
|
+
font-size: 13px;
|
|
16
|
+
color: ${cssVar.colorTextSecondary};
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
color: ${cssVar.colorText};
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
title: css`
|
|
24
|
+
margin: 0;
|
|
25
|
+
|
|
26
|
+
font-size: 15px;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
line-height: 1.4;
|
|
29
|
+
color: ${cssVar.colorText};
|
|
30
|
+
`
|
|
31
|
+
}));
|
|
32
|
+
//#endregion
|
|
33
|
+
export { styles };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Section/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n desc: css`\n font-size: 13px;\n font-weight: 400;\n line-height: 1.45;\n color: ${cssVar.colorTextSecondary};\n `,\n more: css`\n display: inline-flex;\n gap: 2px;\n align-items: center;\n\n font-size: 13px;\n color: ${cssVar.colorTextSecondary};\n text-decoration: none;\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n title: css`\n margin: 0;\n\n font-size: 15px;\n font-weight: 600;\n line-height: 1.4;\n color: ${cssVar.colorText};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,MAAM,GAAG;;;;aAIE,OAAO,mBAAmB;;CAErC,MAAM,GAAG;;;;;;aAME,OAAO,mBAAmB;;;;eAIxB,OAAO,UAAU;;;CAG9B,OAAO,GAAG;;;;;;aAMC,OAAO,UAAU;;AAE9B,EAAE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FlexboxProps } from "../../Flex/type.mjs";
|
|
2
|
+
import "../../Flex/index.mjs";
|
|
3
|
+
import { SurfaceRenderLink } from "../Surface/type.mjs";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/dashboard/Section/type.d.ts
|
|
6
|
+
interface SectionProps extends Omit<FlexboxProps, 'title'> {
|
|
7
|
+
desc?: ReactNode;
|
|
8
|
+
extra?: ReactNode;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Text of the "more" link. */
|
|
12
|
+
more?: ReactNode;
|
|
13
|
+
/** Target of the "more" link. An `http` URL opens in a new tab. */
|
|
14
|
+
moreLink?: string;
|
|
15
|
+
/** Card body padding (`variant="card"`). Turn off when the children already sit on the card edge. */
|
|
16
|
+
padded?: boolean;
|
|
17
|
+
renderLink?: SurfaceRenderLink;
|
|
18
|
+
title?: ReactNode;
|
|
19
|
+
/** `default` is a titled page section; `card` wraps it in a Surface. */
|
|
20
|
+
variant?: 'default' | 'card';
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SectionProps };
|
|
24
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StatCardProps } from "./type.mjs";
|
|
2
2
|
//#region src/dashboard/StatCard/StatCard.d.ts
|
|
3
|
-
|
|
3
|
+
/** One metric in its own card: the same item as a `split` MetricStrip. */
|
|
4
|
+
declare function StatCard({ action, className, delta, direction, hint, href, label, loading, mark, onClick, renderLink, value, valueTone }: StatCardProps): import("react").JSX.Element;
|
|
4
5
|
declare namespace StatCard {
|
|
5
6
|
var displayName: string;
|
|
6
7
|
}
|
|
@@ -1,79 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
-
import Block from "../../Block/Block.mjs";
|
|
4
|
-
import Icon from "../../Icon/Icon.mjs";
|
|
5
|
-
import Text from "../../base-ui/Text/Text.mjs";
|
|
6
2
|
import { styles } from "../Surface/style.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
3
|
+
import { useSurfaceCardClassName } from "../Surface/link.mjs";
|
|
4
|
+
import { styles as styles$1 } from "../MetricStrip/style.mjs";
|
|
5
|
+
import MetricCell from "../MetricStrip/MetricCell.mjs";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { cx } from "antd-style";
|
|
10
8
|
//#region src/dashboard/StatCard/StatCard.tsx
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
up: TrendingUp
|
|
15
|
-
};
|
|
16
|
-
function StatCard({ action, delta, direction = "flat", hint, label, mark, prominent = false, value, wash }) {
|
|
17
|
-
const deltaClass = {
|
|
18
|
-
down: styles$1.deltaDown,
|
|
19
|
-
flat: styles$1.deltaFlat,
|
|
20
|
-
up: styles$1.deltaUp
|
|
21
|
-
}[direction];
|
|
9
|
+
/** One metric in its own card: the same item as a `split` MetricStrip. */
|
|
10
|
+
function StatCard({ action, className, delta, direction = "flat", hint, href, label, loading, mark, onClick, renderLink, value, valueTone }) {
|
|
11
|
+
const cardClassName = useSurfaceCardClassName();
|
|
22
12
|
return /* @__PURE__ */ jsx("div", {
|
|
23
|
-
className: styles$1.
|
|
24
|
-
children: /* @__PURE__ */ jsx(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
gap: 6,
|
|
40
|
-
children: [/* @__PURE__ */ jsx(Text, {
|
|
41
|
-
ellipsis: true,
|
|
42
|
-
className: prominent ? styles$1.metricLabel : styles$1.label,
|
|
43
|
-
children: label
|
|
44
|
-
}), action]
|
|
45
|
-
}), mark ? /* @__PURE__ */ jsx("span", {
|
|
46
|
-
"aria-hidden": true,
|
|
47
|
-
className: styles$1.badge,
|
|
48
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
49
|
-
icon: mark,
|
|
50
|
-
size: 14
|
|
51
|
-
})
|
|
52
|
-
}) : null]
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ jsx("div", {
|
|
55
|
-
className: prominent ? styles$1.metricValue : styles$1.value,
|
|
56
|
-
children: value
|
|
57
|
-
}),
|
|
58
|
-
delta || hint ? /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
59
|
-
horizontal: true,
|
|
60
|
-
align: "center",
|
|
61
|
-
className: prominent ? styles$1.metricFoot : void 0,
|
|
62
|
-
gap: 8,
|
|
63
|
-
wrap: "wrap",
|
|
64
|
-
children: [delta ? /* @__PURE__ */ jsxs("span", {
|
|
65
|
-
className: `${styles$1.delta} ${deltaClass}`,
|
|
66
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
67
|
-
icon: deltaIcon[direction],
|
|
68
|
-
size: 14
|
|
69
|
-
}), delta]
|
|
70
|
-
}) : null, hint ? /* @__PURE__ */ jsx(Text, {
|
|
71
|
-
className: prominent ? styles$1.metricHint : styles$1.hint,
|
|
72
|
-
children: hint
|
|
73
|
-
}) : null]
|
|
74
|
-
}) : null
|
|
75
|
-
]
|
|
76
|
-
})
|
|
13
|
+
className: cx(styles$1.card, cardClassName, styles.clip, className),
|
|
14
|
+
children: /* @__PURE__ */ jsx(MetricCell, {
|
|
15
|
+
renderLink,
|
|
16
|
+
item: {
|
|
17
|
+
action,
|
|
18
|
+
delta,
|
|
19
|
+
direction,
|
|
20
|
+
hint,
|
|
21
|
+
href,
|
|
22
|
+
label,
|
|
23
|
+
loading,
|
|
24
|
+
mark,
|
|
25
|
+
onClick,
|
|
26
|
+
value,
|
|
27
|
+
valueTone
|
|
28
|
+
}
|
|
77
29
|
})
|
|
78
30
|
});
|
|
79
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatCard.mjs","names":["
|
|
1
|
+
{"version":3,"file":"StatCard.mjs","names":["metricStyles","surfaceStyles"],"sources":["../../../src/dashboard/StatCard/StatCard.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\n\nimport MetricCell from '../MetricStrip/MetricCell';\nimport { styles as metricStyles } from '../MetricStrip/style';\nimport { useSurfaceCardClassName } from '../Surface/link';\nimport { styles as surfaceStyles } from '../Surface/style';\nimport type { StatCardProps } from './type';\n\n/** One metric in its own card: the same item as a `split` MetricStrip. */\nfunction StatCard({\n action,\n className,\n delta,\n direction = 'flat',\n hint,\n href,\n label,\n loading,\n mark,\n onClick,\n renderLink,\n value,\n valueTone,\n}: StatCardProps) {\n const cardClassName = useSurfaceCardClassName();\n\n return (\n <div className={cx(metricStyles.card, cardClassName, surfaceStyles.clip, className)}>\n <MetricCell\n renderLink={renderLink}\n item={{\n action,\n delta,\n direction,\n hint,\n href,\n label,\n loading,\n mark,\n onClick,\n value,\n valueTone,\n }}\n />\n </div>\n );\n}\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n"],"mappings":";;;;;;;;;AAWA,SAAS,SAAS,EAChB,QACA,WACA,OACA,YAAY,QACZ,MACA,MACA,OACA,SACA,MACA,SACA,YACA,OACA,aACgB;CAChB,MAAM,gBAAgB,wBAAwB;CAE9C,OACE,oBAAC,OAAD;EAAK,WAAW,GAAGA,SAAa,MAAM,eAAeC,OAAc,MAAM,SAAS;EAChF,UAAA,oBAAC,YAAD;GACc;GACZ,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACD,CAAA;CACE,CAAA;AAET;AAEA,SAAS,cAAc"}
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { IconProps } from "../../Icon/type.mjs";
|
|
2
2
|
import "../../Icon/index.mjs";
|
|
3
|
+
import { SurfaceRenderLink } from "../Surface/type.mjs";
|
|
3
4
|
import { ReactNode } from "react";
|
|
4
5
|
//#region src/dashboard/StatCard/type.d.ts
|
|
5
6
|
type StatDirection = 'up' | 'down' | 'flat';
|
|
6
|
-
/**
|
|
7
|
+
/** @deprecated StatCard renders as a MetricStrip item and no longer draws a wash. */
|
|
7
8
|
type StatWash = 'gray';
|
|
8
9
|
interface StatCardProps {
|
|
9
10
|
/** Control rendered on the label row, such as a menu. */
|
|
10
11
|
action?: ReactNode;
|
|
12
|
+
className?: string;
|
|
11
13
|
/** Change amount, colored by `direction`. */
|
|
12
|
-
delta?:
|
|
14
|
+
delta?: ReactNode;
|
|
13
15
|
direction?: StatDirection;
|
|
14
|
-
/** Line
|
|
15
|
-
hint?:
|
|
16
|
+
/** Line after the delta. */
|
|
17
|
+
hint?: ReactNode;
|
|
18
|
+
/** Makes the card a link (through `renderLink` / `SurfaceLinkProvider`). */
|
|
19
|
+
href?: string;
|
|
16
20
|
label: ReactNode;
|
|
21
|
+
/** Value placeholder while loading; the label stays. */
|
|
22
|
+
loading?: boolean;
|
|
17
23
|
/** Corner glyph. Hidden from assistive tech so it does not repeat the label. */
|
|
18
24
|
mark?: IconProps['icon'];
|
|
19
|
-
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
/** @deprecated Ignored. StatCard always uses the MetricStrip item scale. */
|
|
20
27
|
prominent?: boolean;
|
|
28
|
+
renderLink?: SurfaceRenderLink;
|
|
21
29
|
value: ReactNode;
|
|
30
|
+
/** Color the figure when the number itself is the thing to act on. */
|
|
31
|
+
valueTone?: 'danger' | 'warning';
|
|
32
|
+
/** @deprecated Ignored. StatCard renders as a MetricStrip item without a wash. */
|
|
22
33
|
wash?: StatWash;
|
|
23
34
|
}
|
|
24
35
|
//#endregion
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SurfaceProps } from "./type.mjs";
|
|
2
2
|
//#region src/dashboard/Surface/Surface.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Elevated card on a workspace canvas.
|
|
5
|
-
*
|
|
4
|
+
* Elevated card on a workspace canvas. Bare, it is a plain frame. With `title`,
|
|
5
|
+
* `description` or `extra` it gets a header and a padded body that lets a
|
|
6
|
+
* trailing table meet the card edges.
|
|
6
7
|
*/
|
|
7
|
-
declare function Surface({ className, ...rest }: SurfaceProps): import("react").JSX.Element;
|
|
8
|
+
declare function Surface({ bleed, chart, children, className, description, extra, href, loading, padded, renderLink, title, ...rest }: SurfaceProps): import("react").JSX.Element;
|
|
8
9
|
declare namespace Surface {
|
|
9
10
|
var displayName: string;
|
|
10
11
|
}
|
|
@@ -1,16 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import Spin from "../../base-ui/Spin/Spin.mjs";
|
|
3
|
+
import Skeleton from "../../base-ui/Skeleton/index.mjs";
|
|
2
4
|
import { styles } from "./style.mjs";
|
|
3
|
-
import {
|
|
5
|
+
import { SurfaceDepthContext, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink } from "./link.mjs";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
import { cx } from "antd-style";
|
|
8
|
+
import { ArrowUpRight } from "lucide-react";
|
|
5
9
|
//#region src/dashboard/Surface/Surface.tsx
|
|
10
|
+
const defined = (node) => node !== null && node !== void 0 && node !== false;
|
|
6
11
|
/**
|
|
7
|
-
* Elevated card on a workspace canvas.
|
|
8
|
-
*
|
|
12
|
+
* Elevated card on a workspace canvas. Bare, it is a plain frame. With `title`,
|
|
13
|
+
* `description` or `extra` it gets a header and a padded body that lets a
|
|
14
|
+
* trailing table meet the card edges.
|
|
9
15
|
*/
|
|
10
|
-
function Surface({ className, ...rest }) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
function Surface({ bleed = false, chart, children, className, description, extra, href, loading, padded, renderLink, title, ...rest }) {
|
|
17
|
+
const depth = useSurfaceDepth();
|
|
18
|
+
const link = useSurfaceLink(renderLink);
|
|
19
|
+
const cardClassName = useSurfaceCardClassName();
|
|
20
|
+
const refreshing = Boolean(loading) && defined(children);
|
|
21
|
+
const placeholder = Boolean(loading) && !defined(children);
|
|
22
|
+
const hasHeader = defined(title) || defined(description) || defined(extra) || refreshing;
|
|
23
|
+
const pad = bleed ? false : padded ?? (hasHeader || placeholder);
|
|
24
|
+
const clip = hasHeader || bleed || pad || defined(chart);
|
|
25
|
+
const heading = /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: styles.heading,
|
|
27
|
+
children: [defined(title) ? /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: styles.title,
|
|
29
|
+
children: title
|
|
30
|
+
}) : null, defined(description) ? /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: styles.desc,
|
|
32
|
+
children: description
|
|
33
|
+
}) : null]
|
|
34
|
+
});
|
|
35
|
+
const body = placeholder ? /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"aria-busy": "true",
|
|
37
|
+
className: styles.loading,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
39
|
+
height: 220,
|
|
40
|
+
radius: 8
|
|
41
|
+
})
|
|
42
|
+
}) : children;
|
|
43
|
+
const trailing = refreshing || defined(extra);
|
|
44
|
+
const arrow = /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
45
|
+
"aria-hidden": true,
|
|
46
|
+
"data-surface-arrow": true,
|
|
47
|
+
className: styles.arrow,
|
|
48
|
+
size: 16
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsx(SurfaceDepthContext, {
|
|
51
|
+
value: depth + 1,
|
|
52
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: cx(cardClassName, styles.content, clip && styles.clip, href && styles.cardLinked, bleed && styles.bleed, className),
|
|
54
|
+
...rest,
|
|
55
|
+
children: [
|
|
56
|
+
hasHeader ? /* @__PURE__ */ jsxs("div", {
|
|
57
|
+
className: styles.header,
|
|
58
|
+
children: [href ? link({
|
|
59
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [heading, trailing ? null : arrow] }),
|
|
60
|
+
className: styles.headingLink,
|
|
61
|
+
href
|
|
62
|
+
}) : heading, trailing ? /* @__PURE__ */ jsxs("div", {
|
|
63
|
+
className: styles.extra,
|
|
64
|
+
children: [
|
|
65
|
+
refreshing ? /* @__PURE__ */ jsx(Spin, {
|
|
66
|
+
size: "small",
|
|
67
|
+
variant: "network"
|
|
68
|
+
}) : null,
|
|
69
|
+
extra,
|
|
70
|
+
href ? link({
|
|
71
|
+
"aria-hidden": true,
|
|
72
|
+
"children": arrow,
|
|
73
|
+
"className": styles.arrowLink,
|
|
74
|
+
href,
|
|
75
|
+
"tabIndex": -1
|
|
76
|
+
}) : null
|
|
77
|
+
]
|
|
78
|
+
}) : null]
|
|
79
|
+
}) : null,
|
|
80
|
+
pad ? /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: cx(styles.body, styles.tableBleed),
|
|
82
|
+
children: body
|
|
83
|
+
}) : body,
|
|
84
|
+
defined(chart) ? /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: styles.chart,
|
|
86
|
+
children: chart
|
|
87
|
+
}) : null
|
|
88
|
+
]
|
|
89
|
+
})
|
|
14
90
|
});
|
|
15
91
|
}
|
|
16
92
|
Surface.displayName = "Surface";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.mjs","names":[],"sources":["../../../src/dashboard/Surface/Surface.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\n\nimport { styles } from './style';\nimport type { SurfaceProps } from './type';\n\n/**\n * Elevated card on a workspace canvas.
|
|
1
|
+
{"version":3,"file":"Surface.mjs","names":[],"sources":["../../../src/dashboard/Surface/Surface.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { ArrowUpRight } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport Skeleton from '@/base-ui/Skeleton';\nimport Spin from '@/base-ui/Spin';\n\nimport {\n SurfaceDepthContext,\n useSurfaceCardClassName,\n useSurfaceDepth,\n useSurfaceLink,\n} from './link';\nimport { styles } from './style';\nimport type { SurfaceProps } from './type';\n\nconst defined = (node: ReactNode) => node !== null && node !== undefined && node !== false;\n\n/**\n * Elevated card on a workspace canvas. Bare, it is a plain frame. With `title`,\n * `description` or `extra` it gets a header and a padded body that lets a\n * trailing table meet the card edges.\n */\nfunction Surface({\n bleed = false,\n chart,\n children,\n className,\n description,\n extra,\n href,\n loading,\n padded,\n renderLink,\n title,\n ...rest\n}: SurfaceProps) {\n const depth = useSurfaceDepth();\n const link = useSurfaceLink(renderLink);\n const cardClassName = useSurfaceCardClassName();\n const refreshing = Boolean(loading) && defined(children);\n const placeholder = Boolean(loading) && !defined(children);\n const hasHeader = defined(title) || defined(description) || defined(extra) || refreshing;\n const pad = bleed ? false : (padded ?? (hasHeader || placeholder));\n const clip = hasHeader || bleed || pad || defined(chart);\n\n const heading = (\n <div className={styles.heading}>\n {defined(title) ? <div className={styles.title}>{title}</div> : null}\n {defined(description) ? <div className={styles.desc}>{description}</div> : null}\n </div>\n );\n\n const body = placeholder ? (\n <div aria-busy=\"true\" className={styles.loading}>\n <Skeleton height={220} radius={8} />\n </div>\n ) : (\n children\n );\n\n // With header actions, the arrow sits after them as the rightmost item.\n const trailing = refreshing || defined(extra);\n const arrow = <ArrowUpRight aria-hidden data-surface-arrow className={styles.arrow} size={16} />;\n\n return (\n <SurfaceDepthContext value={depth + 1}>\n <div\n className={cx(\n cardClassName,\n styles.content,\n clip && styles.clip,\n href && styles.cardLinked,\n bleed && styles.bleed,\n className,\n )}\n {...rest}\n >\n {hasHeader ? (\n <div className={styles.header}>\n {href\n ? link({\n children: (\n <>\n {heading}\n {trailing ? null : arrow}\n </>\n ),\n className: styles.headingLink,\n href,\n })\n : heading}\n {trailing ? (\n <div className={styles.extra}>\n {refreshing ? <Spin size=\"small\" variant=\"network\" /> : null}\n {extra}\n {href\n ? link({\n 'aria-hidden': true,\n 'children': arrow,\n 'className': styles.arrowLink,\n href,\n 'tabIndex': -1,\n } as any)\n : null}\n </div>\n ) : null}\n </div>\n ) : null}\n {pad ? <div className={cx(styles.body, styles.tableBleed)}>{body}</div> : body}\n {defined(chart) ? <div className={styles.chart}>{chart}</div> : null}\n </div>\n </SurfaceDepthContext>\n );\n}\n\nSurface.displayName = 'Surface';\n\nexport default Surface;\n"],"mappings":";;;;;;;;;AAkBA,MAAM,WAAW,SAAoB,SAAS,QAAQ,SAAS,KAAA,KAAa,SAAS;;;;;;AAOrF,SAAS,QAAQ,EACf,QAAQ,OACR,OACA,UACA,WACA,aACA,OACA,MACA,SACA,QACA,YACA,OACA,GAAG,QACY;CACf,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,OAAO,eAAe,UAAU;CACtC,MAAM,gBAAgB,wBAAwB;CAC9C,MAAM,aAAa,QAAQ,OAAO,KAAK,QAAQ,QAAQ;CACvD,MAAM,cAAc,QAAQ,OAAO,KAAK,CAAC,QAAQ,QAAQ;CACzD,MAAM,YAAY,QAAQ,KAAK,KAAK,QAAQ,WAAW,KAAK,QAAQ,KAAK,KAAK;CAC9E,MAAM,MAAM,QAAQ,QAAS,WAAW,aAAa;CACrD,MAAM,OAAO,aAAa,SAAS,OAAO,QAAQ,KAAK;CAEvD,MAAM,UACJ,qBAAC,OAAD;EAAK,WAAW,OAAO;EAAvB,UAAA,CACG,QAAQ,KAAK,IAAI,oBAAC,OAAD;GAAK,WAAW,OAAO;GAAQ,UAAA;EAAW,CAAA,IAAI,MAC/D,QAAQ,WAAW,IAAI,oBAAC,OAAD;GAAK,WAAW,OAAO;GAAO,UAAA;EAAiB,CAAA,IAAI,IACxE;;CAGP,MAAM,OAAO,cACX,oBAAC,OAAD;EAAK,aAAU;EAAO,WAAW,OAAO;EACtC,UAAA,oBAAC,UAAD;GAAU,QAAQ;GAAK,QAAQ;EAAI,CAAA;CAChC,CAAA,IAEL;CAIF,MAAM,WAAW,cAAc,QAAQ,KAAK;CAC5C,MAAM,QAAQ,oBAAC,cAAD;EAAc,eAAA;EAAY,sBAAA;EAAmB,WAAW,OAAO;EAAO,MAAM;CAAK,CAAA;CAE/F,OACE,oBAAC,qBAAD;EAAqB,OAAO,QAAQ;EAClC,UAAA,qBAAC,OAAD;GACE,WAAW,GACT,eACA,OAAO,SACP,QAAQ,OAAO,MACf,QAAQ,OAAO,YACf,SAAS,OAAO,OAChB,SACF;GACA,GAAI;GATN,UAAA;IAWG,YACC,qBAAC,OAAD;KAAK,WAAW,OAAO;KAAvB,UAAA,CACG,OACG,KAAK;MACH,UACE,qBAAA,UAAA,EAAA,UAAA,CACG,SACA,WAAW,OAAO,KACnB,EAAA,CAAA;MAEJ,WAAW,OAAO;MAClB;KACF,CAAC,IACD,SACH,WACC,qBAAC,OAAD;MAAK,WAAW,OAAO;MAAvB,UAAA;OACG,aAAa,oBAAC,MAAD;QAAM,MAAK;QAAQ,SAAQ;OAAW,CAAA,IAAI;OACvD;OACA,OACG,KAAK;QACH,eAAe;QACf,YAAY;QACZ,aAAa,OAAO;QACpB;QACA,YAAY;OACd,CAAQ,IACR;MACD;KACH,CAAA,IAAA,IACD;IACH,CAAA,IAAA;IACH,MAAM,oBAAC,OAAD;KAAK,WAAW,GAAG,OAAO,MAAM,OAAO,UAAU;KAAI,UAAA;IAAU,CAAA,IAAI;IACzE,QAAQ,KAAK,IAAI,oBAAC,OAAD;KAAK,WAAW,OAAO;KAAQ,UAAA;IAAW,CAAA,IAAI;GAC7D;;CACc,CAAA;AAEzB;AAEA,QAAQ,cAAc"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { SurfaceLinkProps, SurfaceProps, SurfaceRenderLink } from "./type.mjs";
|
|
2
|
+
import { SurfaceLinkProvider, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink } from "./link.mjs";
|
|
1
3
|
import { styles } from "./style.mjs";
|
|
2
|
-
import { SurfaceProps } from "./type.mjs";
|
|
3
4
|
import Surface from "./Surface.mjs";
|
|
4
|
-
export { type SurfaceProps, Surface as default, styles as surfaceStyles };
|
|
5
|
+
export { type SurfaceLinkProps, SurfaceLinkProvider, type SurfaceProps, type SurfaceRenderLink, Surface as default, styles as surfaceStyles, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SurfaceRenderLink } from "./type.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/dashboard/Surface/link.d.ts
|
|
4
|
+
/** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */
|
|
5
|
+
declare const SurfaceLinkProvider: ({ children, renderLink }: {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
renderLink: SurfaceRenderLink;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
declare const useSurfaceLink: (override?: SurfaceRenderLink) => SurfaceRenderLink;
|
|
10
|
+
/** How many Surface cards wrap this node. A table can skip its own card when already inside one. */
|
|
11
|
+
declare const useSurfaceDepth: () => number;
|
|
12
|
+
/**
|
|
13
|
+
* Class for a dashboard card: `colorBgContainer` in light, translucent `colorFillTertiary` in
|
|
14
|
+
* dark, and no fill of its own when nested in another Surface.
|
|
15
|
+
*/
|
|
16
|
+
declare const useSurfaceCardClassName: () => string;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SurfaceLinkProvider, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink };
|
|
19
|
+
//# sourceMappingURL=link.d.mts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styles } from "./style.mjs";
|
|
3
|
+
import { createContext, use } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cx, useThemeMode } from "antd-style";
|
|
6
|
+
//#region src/dashboard/Surface/link.tsx
|
|
7
|
+
const defaultRenderLink = ({ children, ...rest }) => /* @__PURE__ */ jsx("a", {
|
|
8
|
+
...rest,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
const SurfaceLinkContext = createContext(defaultRenderLink);
|
|
12
|
+
const SurfaceDepthContext = createContext(0);
|
|
13
|
+
/** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */
|
|
14
|
+
const SurfaceLinkProvider = ({ children, renderLink }) => /* @__PURE__ */ jsx(SurfaceLinkContext, {
|
|
15
|
+
value: renderLink,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
const useSurfaceLink = (override) => override ?? use(SurfaceLinkContext);
|
|
19
|
+
/** How many Surface cards wrap this node. A table can skip its own card when already inside one. */
|
|
20
|
+
const useSurfaceDepth = () => use(SurfaceDepthContext);
|
|
21
|
+
/**
|
|
22
|
+
* Class for a dashboard card: `colorBgContainer` in light, translucent `colorFillTertiary` in
|
|
23
|
+
* dark, and no fill of its own when nested in another Surface.
|
|
24
|
+
*/
|
|
25
|
+
const useSurfaceCardClassName = () => {
|
|
26
|
+
const { isDarkMode } = useThemeMode();
|
|
27
|
+
const depth = useSurfaceDepth();
|
|
28
|
+
return cx(styles.card, isDarkMode && styles.cardDark, depth > 0 && styles.cardNested);
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SurfaceDepthContext, SurfaceLinkProvider, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=link.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.mjs","names":[],"sources":["../../../src/dashboard/Surface/link.tsx"],"sourcesContent":["'use client';\n\nimport { cx, useThemeMode } from 'antd-style';\nimport { createContext, type ReactNode, use } from 'react';\n\nimport { styles } from './style';\nimport type { SurfaceLinkProps, SurfaceRenderLink } from './type';\n\nconst defaultRenderLink: SurfaceRenderLink = ({ children, ...rest }: SurfaceLinkProps) => (\n <a {...rest}>{children}</a>\n);\n\nconst SurfaceLinkContext = createContext<SurfaceRenderLink>(defaultRenderLink);\n\nconst SurfaceDepthContext = createContext(0);\n\n/** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */\nexport const SurfaceLinkProvider = ({\n children,\n renderLink,\n}: {\n children?: ReactNode;\n renderLink: SurfaceRenderLink;\n}) => <SurfaceLinkContext value={renderLink}>{children}</SurfaceLinkContext>;\n\nexport const useSurfaceLink = (override?: SurfaceRenderLink) => override ?? use(SurfaceLinkContext);\n\n/** How many Surface cards wrap this node. A table can skip its own card when already inside one. */\nexport const useSurfaceDepth = () => use(SurfaceDepthContext);\n\nexport { SurfaceDepthContext };\n\n/**\n * Class for a dashboard card: `colorBgContainer` in light, translucent `colorFillTertiary` in\n * dark, and no fill of its own when nested in another Surface.\n */\nexport const useSurfaceCardClassName = () => {\n const { isDarkMode } = useThemeMode();\n const depth = useSurfaceDepth();\n return cx(styles.card, isDarkMode && styles.cardDark, depth > 0 && styles.cardNested);\n};\n"],"mappings":";;;;;;AAQA,MAAM,qBAAwC,EAAE,UAAU,GAAG,WAC3D,oBAAC,KAAD;CAAG,GAAI;CAAO;AAAY,CAAA;AAG5B,MAAM,qBAAqB,cAAiC,iBAAiB;AAE7E,MAAM,sBAAsB,cAAc,CAAC;;AAG3C,MAAa,uBAAuB,EAClC,UACA,iBAII,oBAAC,oBAAD;CAAoB,OAAO;CAAa;AAA6B,CAAA;AAE3E,MAAa,kBAAkB,aAAiC,YAAY,IAAI,kBAAkB;;AAGlG,MAAa,wBAAwB,IAAI,mBAAmB;;;;;AAQ5D,MAAa,gCAAgC;CAC3C,MAAM,EAAE,eAAe,aAAa;CACpC,MAAM,QAAQ,gBAAgB;CAC9B,OAAO,GAAG,OAAO,MAAM,cAAc,OAAO,UAAU,QAAQ,KAAK,OAAO,UAAU;AACtF"}
|
|
@@ -2,12 +2,54 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* A content card sitting on the workspace.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
5
|
+
* Backgrounds: light mode uses `colorBgContainer`. Dark mode uses the translucent
|
|
6
|
+
* `colorFillTertiary` (white 6%): on the #0d0d0d workspace it reads as about #1c1c1c, a subtle
|
|
7
|
+
* raised step. `colorFillQuaternary` (white 2%, about #111) would barely separate from the page.
|
|
8
|
+
*
|
|
9
|
+
* Borders and inner dividers (table, header and cell lines, PageSkeleton) use `colorFillSecondary`
|
|
10
|
+
* (white 10% / black 6%); hover and focus use the stronger `colorFill`. Painted over the dark card
|
|
11
|
+
* the border lands near #2f2f2f against #1c1c1c, and in light near #f0f0f0 against #ffffff.
|
|
12
|
+
*
|
|
13
|
+
* Anything that must hide content scrolled beneath it (table header cells, pinned and sticky
|
|
14
|
+
* cells, their scroll shadows) uses `--lobe-surface-bg-solid`: the same white 6% blended onto
|
|
15
|
+
* `--lobe-surface-canvas` (default `colorBgContainer`, the ConsoleShell workspace). `color-mix`
|
|
16
|
+
* in srgb with an opaque base is plain alpha compositing, so it matches the translucent card.
|
|
17
|
+
* Set `--lobe-surface-canvas` when a card sits on another page color.
|
|
18
|
+
*
|
|
19
|
+
* A Surface inside another Surface (`useSurfaceDepth() > 0`) drops its own fill so fills do not
|
|
20
|
+
* stack. Row hover backgrounds keep their own mix. Layout containers (ConsoleShell, ConsoleNav,
|
|
21
|
+
* FilterSidebar split divider, AuthLayout page canvas) keep their own tokens.
|
|
22
|
+
*
|
|
23
|
+
* Apply the card with `useSurfaceCardClassName()`; plain `surfaceStyles.card` is the light look.
|
|
8
24
|
*/
|
|
9
25
|
declare const styles: {
|
|
10
26
|
card: string;
|
|
27
|
+
cardDark: string;
|
|
28
|
+
cardNested: string;
|
|
29
|
+
chart: string;
|
|
30
|
+
/** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */
|
|
31
|
+
clip: string;
|
|
32
|
+
loading: string;
|
|
33
|
+
arrow: string;
|
|
34
|
+
arrowLink: string;
|
|
35
|
+
bleed: string;
|
|
36
|
+
body: string;
|
|
37
|
+
/** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */
|
|
38
|
+
content: string;
|
|
39
|
+
/** Whole card answers hover when its header drills into another page. */
|
|
40
|
+
cardLinked: string;
|
|
41
|
+
desc: string;
|
|
42
|
+
extra: string;
|
|
43
|
+
header: string;
|
|
44
|
+
heading: string;
|
|
45
|
+
headingLink: string;
|
|
46
|
+
/**
|
|
47
|
+
* A table inside padded card body meets the card's left, right, and bottom
|
|
48
|
+
* edges. A table that is the only body content also meets the header.
|
|
49
|
+
* Padding amounts come from `--surface-pad-*` on the same element.
|
|
50
|
+
*/
|
|
51
|
+
tableBleed: string;
|
|
52
|
+
title: string;
|
|
11
53
|
};
|
|
12
54
|
//#endregion
|
|
13
55
|
export { styles };
|