@lobehub/ui 5.58.0 → 5.59.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/Grid/style.mjs +8 -8
- package/es/Grid/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/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/ConsoleShell/ConsoleShell.d.mts +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +12 -4
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +15 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +2 -0
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs +51 -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 +93 -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/MetricStrip.d.mts +10 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs +76 -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 +116 -0
- package/es/dashboard/MetricStrip/style.mjs.map +1 -0
- package/es/dashboard/MetricStrip/type.d.mts +25 -0
- 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 +36 -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/Surface/Surface.d.mts +4 -3
- package/es/dashboard/Surface/Surface.mjs +67 -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 +14 -0
- package/es/dashboard/Surface/link.mjs +22 -0
- package/es/dashboard/Surface/link.mjs.map +1 -0
- package/es/dashboard/Surface/style.d.mts +23 -0
- package/es/dashboard/Surface/style.mjs +283 -2
- 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 +30 -2
- package/es/dashboard/index.mjs +12 -2
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MetricStripProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/MetricStrip/MetricStrip.d.ts
|
|
3
|
+
/** One card, divided into metrics. Peer numbers share a surface instead of a row of equal cards. */
|
|
4
|
+
declare const MetricStrip: {
|
|
5
|
+
({ items, loading, renderLink }: MetricStripProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { MetricStrip as default };
|
|
10
|
+
//# sourceMappingURL=MetricStrip.d.mts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Skeleton from "../../base-ui/Skeleton/index.mjs";
|
|
3
|
+
import { useSurfaceLink } from "../Surface/link.mjs";
|
|
4
|
+
import Surface from "../Surface/Surface.mjs";
|
|
5
|
+
import { styles } from "./style.mjs";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { cx } from "antd-style";
|
|
8
|
+
//#region src/dashboard/MetricStrip/MetricStrip.tsx
|
|
9
|
+
const deltaClass = {
|
|
10
|
+
down: styles.deltaDown,
|
|
11
|
+
flat: styles.deltaFlat,
|
|
12
|
+
up: styles.deltaUp
|
|
13
|
+
};
|
|
14
|
+
const MetricBody = ({ item, loading }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: styles.label,
|
|
17
|
+
children: item.label
|
|
18
|
+
}),
|
|
19
|
+
loading ? /* @__PURE__ */ jsx(Skeleton, {
|
|
20
|
+
height: 28,
|
|
21
|
+
radius: 6,
|
|
22
|
+
width: 88
|
|
23
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: cx(styles.value, item.valueTone === "danger" && styles.valueDanger, item.valueTone === "warning" && styles.valueWarning),
|
|
25
|
+
children: item.value
|
|
26
|
+
}),
|
|
27
|
+
!loading && (item.delta || item.hint) ? /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: styles.foot,
|
|
29
|
+
children: [item.delta ? /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: cx(styles.delta, deltaClass[item.direction ?? "flat"]),
|
|
31
|
+
children: item.delta
|
|
32
|
+
}) : null, item.hint ? /* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: styles.hint,
|
|
34
|
+
children: item.hint
|
|
35
|
+
}) : null]
|
|
36
|
+
}) : null
|
|
37
|
+
] });
|
|
38
|
+
/** One card, divided into metrics. Peer numbers share a surface instead of a row of equal cards. */
|
|
39
|
+
const MetricStrip = ({ items, loading, renderLink }) => {
|
|
40
|
+
const link = useSurfaceLink(renderLink);
|
|
41
|
+
return /* @__PURE__ */ jsx(Surface, { children: /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: styles.frame,
|
|
43
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: styles.grid,
|
|
45
|
+
children: items.map((item, index) => {
|
|
46
|
+
const body = /* @__PURE__ */ jsx(MetricBody, {
|
|
47
|
+
item,
|
|
48
|
+
loading: item.loading ?? loading
|
|
49
|
+
});
|
|
50
|
+
if (item.href) return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: styles.slot,
|
|
52
|
+
children: link({
|
|
53
|
+
children: body,
|
|
54
|
+
className: cx(styles.cell, styles.link),
|
|
55
|
+
href: item.href
|
|
56
|
+
})
|
|
57
|
+
}, `${index}:${item.href}`);
|
|
58
|
+
if (item.onClick) return /* @__PURE__ */ jsx("button", {
|
|
59
|
+
className: cx(styles.cell, styles.press),
|
|
60
|
+
type: "button",
|
|
61
|
+
onClick: item.onClick,
|
|
62
|
+
children: body
|
|
63
|
+
}, index);
|
|
64
|
+
return /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: styles.cell,
|
|
66
|
+
children: body
|
|
67
|
+
}, index);
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}) });
|
|
71
|
+
};
|
|
72
|
+
MetricStrip.displayName = "MetricStrip";
|
|
73
|
+
//#endregion
|
|
74
|
+
export { MetricStrip as default };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=MetricStrip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricStrip.mjs","names":[],"sources":["../../../src/dashboard/MetricStrip/MetricStrip.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\n\nimport Skeleton from '@/base-ui/Skeleton';\n\nimport { useSurfaceLink } from '../Surface/link';\nimport Surface from '../Surface/Surface';\nimport { styles } from './style';\nimport type { MetricItem, MetricStripProps } from './type';\n\nconst deltaClass = {\n down: styles.deltaDown,\n flat: styles.deltaFlat,\n up: styles.deltaUp,\n} as const;\n\nconst MetricBody = ({ item, loading }: { item: MetricItem; loading?: boolean }) => (\n <>\n <div className={styles.label}>{item.label}</div>\n {loading ? (\n <Skeleton height={28} radius={6} width={88} />\n ) : (\n <div\n className={cx(\n styles.value,\n item.valueTone === 'danger' && styles.valueDanger,\n item.valueTone === 'warning' && styles.valueWarning,\n )}\n >\n {item.value}\n </div>\n )}\n {!loading && (item.delta || item.hint) ? (\n <div className={styles.foot}>\n {item.delta ? (\n <span className={cx(styles.delta, deltaClass[item.direction ?? 'flat'])}>\n {item.delta}\n </span>\n ) : null}\n {item.hint ? <span className={styles.hint}>{item.hint}</span> : null}\n </div>\n ) : null}\n </>\n);\n\n/** One card, divided into metrics. Peer numbers share a surface instead of a row of equal cards. */\nconst MetricStrip = ({ items, loading, renderLink }: MetricStripProps) => {\n const link = useSurfaceLink(renderLink);\n\n return (\n <Surface>\n <div className={styles.frame}>\n <div className={styles.grid}>\n {items.map((item, index) => {\n const body = <MetricBody item={item} loading={item.loading ?? loading} />;\n if (item.href) {\n return (\n <div className={styles.slot} key={`${index}:${item.href}`}>\n {link({\n children: body,\n className: cx(styles.cell, styles.link),\n href: item.href,\n })}\n </div>\n );\n }\n if (item.onClick) {\n return (\n <button\n className={cx(styles.cell, styles.press)}\n key={index}\n type=\"button\"\n onClick={item.onClick}\n >\n {body}\n </button>\n );\n }\n return (\n <div className={styles.cell} key={index}>\n {body}\n </div>\n );\n })}\n </div>\n </div>\n </Surface>\n );\n};\n\nMetricStrip.displayName = 'MetricStrip';\n\nexport default MetricStrip;\n"],"mappings":";;;;;;;;AAWA,MAAM,aAAa;CACjB,MAAM,OAAO;CACb,MAAM,OAAO;CACb,IAAI,OAAO;AACb;AAEA,MAAM,cAAc,EAAE,MAAM,cAC1B,qBAAA,UAAA,EAAA,UAAA;CACE,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAQ,UAAA,KAAK;CAAW,CAAA;CAC9C,UACC,oBAAC,UAAD;EAAU,QAAQ;EAAI,QAAQ;EAAG,OAAO;CAAK,CAAA,IAE7C,oBAAC,OAAD;EACE,WAAW,GACT,OAAO,OACP,KAAK,cAAc,YAAY,OAAO,aACtC,KAAK,cAAc,aAAa,OAAO,YACzC;EAEC,UAAA,KAAK;CACH,CAAA;CAEN,CAAC,YAAY,KAAK,SAAS,KAAK,QAC/B,qBAAC,OAAD;EAAK,WAAW,OAAO;EAAvB,UAAA,CACG,KAAK,QACJ,oBAAC,QAAD;GAAM,WAAW,GAAG,OAAO,OAAO,WAAW,KAAK,aAAa,OAAO;GACnE,UAAA,KAAK;EACF,CAAA,IACJ,MACH,KAAK,OAAO,oBAAC,QAAD;GAAM,WAAW,OAAO;GAAO,UAAA,KAAK;EAAW,CAAA,IAAI,IAC7D;CACH,CAAA,IAAA;AACJ,EAAA,CAAA;;AAIJ,MAAM,eAAe,EAAE,OAAO,SAAS,iBAAmC;CACxE,MAAM,OAAO,eAAe,UAAU;CAEtC,OACE,oBAAC,SAAD,EAAA,UACE,oBAAC,OAAD;EAAK,WAAW,OAAO;EACrB,UAAA,oBAAC,OAAD;GAAK,WAAW,OAAO;GACpB,UAAA,MAAM,KAAK,MAAM,UAAU;IAC1B,MAAM,OAAO,oBAAC,YAAD;KAAkB;KAAM,SAAS,KAAK,WAAW;IAAU,CAAA;IACxE,IAAI,KAAK,MACP,OACE,oBAAC,OAAD;KAAK,WAAW,OAAO;KACpB,UAAA,KAAK;MACJ,UAAU;MACV,WAAW,GAAG,OAAO,MAAM,OAAO,IAAI;MACtC,MAAM,KAAK;KACb,CAAC;IACE,GAN6B,GAAG,MAAM,GAAG,KAAK,MAM9C;IAGT,IAAI,KAAK,SACP,OACE,oBAAC,UAAD;KACE,WAAW,GAAG,OAAO,MAAM,OAAO,KAAK;KAEvC,MAAK;KACL,SAAS,KAAK;KAEb,UAAA;IACK,GALD,KAKC;IAGZ,OACE,oBAAC,OAAD;KAAK,WAAW,OAAO;KACpB,UAAA;IACE,GAF6B,KAE7B;GAET,CAAC;EACE,CAAA;CACF,CAAA,EACE,CAAA;AAEb;AAEA,YAAY,cAAc"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/MetricStrip/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
4
|
+
cell: css`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 6px;
|
|
8
|
+
|
|
9
|
+
min-inline-size: 0;
|
|
10
|
+
padding-block: 16px;
|
|
11
|
+
padding-inline: 20px;
|
|
12
|
+
|
|
13
|
+
background: ${cssVar.colorBgElevated};
|
|
14
|
+
box-shadow:
|
|
15
|
+
inset -1px 0 0 var(--metric-seam),
|
|
16
|
+
inset 0 -1px 0 var(--metric-seam);
|
|
17
|
+
`,
|
|
18
|
+
delta: css`
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
font-variant-numeric: tabular-nums;
|
|
21
|
+
line-height: 1.4;
|
|
22
|
+
`,
|
|
23
|
+
deltaDown: css`
|
|
24
|
+
color: ${cssVar.colorError};
|
|
25
|
+
`,
|
|
26
|
+
deltaFlat: css`
|
|
27
|
+
color: ${cssVar.colorTextSecondary};
|
|
28
|
+
`,
|
|
29
|
+
deltaUp: css`
|
|
30
|
+
color: ${cssVar.colorSuccess};
|
|
31
|
+
`,
|
|
32
|
+
foot: css`
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
align-items: baseline;
|
|
37
|
+
`,
|
|
38
|
+
/**
|
|
39
|
+
* Clips the seam that would otherwise sit on the card's trailing and bottom
|
|
40
|
+
* edges. A short last row used to show the seam color across the empty
|
|
41
|
+
* track, which reads louder than the cells.
|
|
42
|
+
*/
|
|
43
|
+
frame: css`
|
|
44
|
+
--metric-seam: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);
|
|
45
|
+
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
background: ${cssVar.colorBgElevated};
|
|
48
|
+
`,
|
|
49
|
+
grid: css`
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
52
|
+
|
|
53
|
+
inline-size: calc(100% + 1px);
|
|
54
|
+
margin-block-end: -1px;
|
|
55
|
+
|
|
56
|
+
background: ${cssVar.colorBgElevated};
|
|
57
|
+
`,
|
|
58
|
+
hint: css`
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
line-height: 1.4;
|
|
61
|
+
color: ${cssVar.colorTextSecondary};
|
|
62
|
+
`,
|
|
63
|
+
label: css`
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
line-height: 1.4;
|
|
67
|
+
color: ${cssVar.colorTextSecondary};
|
|
68
|
+
`,
|
|
69
|
+
link: css`
|
|
70
|
+
color: inherit;
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
background: ${cssVar.colorFillQuaternary};
|
|
75
|
+
}
|
|
76
|
+
`,
|
|
77
|
+
press: css`
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
|
|
80
|
+
border: none;
|
|
81
|
+
|
|
82
|
+
font: inherit;
|
|
83
|
+
color: inherit;
|
|
84
|
+
text-align: start;
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
background: ${cssVar.colorFillQuaternary};
|
|
88
|
+
}
|
|
89
|
+
`,
|
|
90
|
+
/** Grid cell around a rendered link, so the link fills it. */
|
|
91
|
+
slot: css`
|
|
92
|
+
display: grid;
|
|
93
|
+
min-inline-size: 0;
|
|
94
|
+
`,
|
|
95
|
+
value: css`
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
|
|
98
|
+
font-size: ${cssVar.fontSizeHeading3};
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
font-variant-numeric: tabular-nums;
|
|
101
|
+
line-height: 1.15;
|
|
102
|
+
color: ${cssVar.colorText};
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
`,
|
|
106
|
+
valueDanger: css`
|
|
107
|
+
color: ${cssVar.colorError};
|
|
108
|
+
`,
|
|
109
|
+
valueWarning: css`
|
|
110
|
+
color: ${cssVar.colorWarning};
|
|
111
|
+
`
|
|
112
|
+
}));
|
|
113
|
+
//#endregion
|
|
114
|
+
export { styles };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/MetricStrip/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n cell: css`\n display: flex;\n flex-direction: column;\n gap: 6px;\n\n min-inline-size: 0;\n padding-block: 16px;\n padding-inline: 20px;\n\n background: ${cssVar.colorBgElevated};\n box-shadow:\n inset -1px 0 0 var(--metric-seam),\n inset 0 -1px 0 var(--metric-seam);\n `,\n delta: css`\n font-size: 13px;\n font-variant-numeric: tabular-nums;\n line-height: 1.4;\n `,\n deltaDown: css`\n color: ${cssVar.colorError};\n `,\n deltaFlat: css`\n color: ${cssVar.colorTextSecondary};\n `,\n deltaUp: css`\n color: ${cssVar.colorSuccess};\n `,\n foot: css`\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: baseline;\n `,\n /**\n * Clips the seam that would otherwise sit on the card's trailing and bottom\n * edges. A short last row used to show the seam color across the empty\n * track, which reads louder than the cells.\n */\n frame: css`\n --metric-seam: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);\n\n overflow: hidden;\n background: ${cssVar.colorBgElevated};\n `,\n grid: css`\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));\n\n inline-size: calc(100% + 1px);\n margin-block-end: -1px;\n\n background: ${cssVar.colorBgElevated};\n `,\n hint: css`\n font-size: 13px;\n line-height: 1.4;\n color: ${cssVar.colorTextSecondary};\n `,\n label: css`\n font-size: 13px;\n font-weight: 500;\n line-height: 1.4;\n color: ${cssVar.colorTextSecondary};\n `,\n link: css`\n color: inherit;\n text-decoration: none;\n\n &:hover {\n background: ${cssVar.colorFillQuaternary};\n }\n `,\n press: css`\n cursor: pointer;\n\n border: none;\n\n font: inherit;\n color: inherit;\n text-align: start;\n\n &:hover {\n background: ${cssVar.colorFillQuaternary};\n }\n `,\n /** Grid cell around a rendered link, so the link fills it. */\n slot: css`\n display: grid;\n min-inline-size: 0;\n `,\n value: css`\n overflow: hidden;\n\n font-size: ${cssVar.fontSizeHeading3};\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n line-height: 1.15;\n color: ${cssVar.colorText};\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n valueDanger: css`\n color: ${cssVar.colorError};\n `,\n valueWarning: css`\n color: ${cssVar.colorWarning};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,MAAM,GAAG;;;;;;;;;kBASO,OAAO,gBAAgB;;;;;CAKvC,OAAO,GAAG;;;;;CAKV,WAAW,GAAG;aACH,OAAO,WAAW;;CAE7B,WAAW,GAAG;aACH,OAAO,mBAAmB;;CAErC,SAAS,GAAG;aACD,OAAO,aAAa;;CAE/B,MAAM,GAAG;;;;;;;;;;;CAWT,OAAO,GAAG;wCAC4B,OAAO,UAAU;;;kBAGvC,OAAO,gBAAgB;;CAEvC,MAAM,GAAG;;;;;;;kBAOO,OAAO,gBAAgB;;CAEvC,MAAM,GAAG;;;aAGE,OAAO,mBAAmB;;CAErC,OAAO,GAAG;;;;aAIC,OAAO,mBAAmB;;CAErC,MAAM,GAAG;;;;;oBAKS,OAAO,oBAAoB;;;CAG7C,OAAO,GAAG;;;;;;;;;;oBAUQ,OAAO,oBAAoB;;;;CAI7C,MAAM,GAAG;;;;CAIT,OAAO,GAAG;;;iBAGK,OAAO,iBAAiB;;;;aAI5B,OAAO,UAAU;;;;CAI5B,aAAa,GAAG;aACL,OAAO,WAAW;;CAE7B,cAAc,GAAG;aACN,OAAO,aAAa;;AAEjC,EAAE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SurfaceRenderLink } from "../Surface/type.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/dashboard/MetricStrip/type.d.ts
|
|
4
|
+
interface MetricItem {
|
|
5
|
+
delta?: ReactNode;
|
|
6
|
+
direction?: 'up' | 'down' | 'flat';
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
href?: string;
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** This cell only. Cells fed by different queries arrive at different times. */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
value: ReactNode;
|
|
14
|
+
/** Color the figure when the number itself is the thing to act on. */
|
|
15
|
+
valueTone?: 'danger' | 'warning';
|
|
16
|
+
}
|
|
17
|
+
interface MetricStripProps {
|
|
18
|
+
items: MetricItem[];
|
|
19
|
+
/** First load only: values become placeholders, labels stay. */
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
renderLink?: SurfaceRenderLink;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MetricItem, MetricStripProps };
|
|
25
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PageToolbarProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/PageToolbar/PageToolbar.d.ts
|
|
3
|
+
/** Filters start at the left edge; actions hold the right edge, also after wrapping. */
|
|
4
|
+
declare const PageToolbar: {
|
|
5
|
+
({ actions, children, className }: PageToolbarProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PageToolbar as default };
|
|
10
|
+
//# sourceMappingURL=PageToolbar.d.mts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styles } from "./style.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cx } from "antd-style";
|
|
5
|
+
//#region src/dashboard/PageToolbar/PageToolbar.tsx
|
|
6
|
+
/** Filters start at the left edge; actions hold the right edge, also after wrapping. */
|
|
7
|
+
const PageToolbar = ({ actions, children, className }) => /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
className: cx(styles.root, className),
|
|
9
|
+
children: [children ? /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: styles.filters,
|
|
11
|
+
children
|
|
12
|
+
}) : null, actions ? /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: styles.actions,
|
|
14
|
+
children: actions
|
|
15
|
+
}) : null]
|
|
16
|
+
});
|
|
17
|
+
PageToolbar.displayName = "PageToolbar";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { PageToolbar as default };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=PageToolbar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageToolbar.mjs","names":[],"sources":["../../../src/dashboard/PageToolbar/PageToolbar.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\n\nimport { styles } from './style';\nimport type { PageToolbarProps } from './type';\n\n/** Filters start at the left edge; actions hold the right edge, also after wrapping. */\nconst PageToolbar = ({ actions, children, className }: PageToolbarProps) => (\n <div className={cx(styles.root, className)}>\n {children ? <div className={styles.filters}>{children}</div> : null}\n {actions ? <div className={styles.actions}>{actions}</div> : null}\n </div>\n);\n\nPageToolbar.displayName = 'PageToolbar';\n\nexport default PageToolbar;\n"],"mappings":";;;;;;AAQA,MAAM,eAAe,EAAE,SAAS,UAAU,gBACxC,qBAAC,OAAD;CAAK,WAAW,GAAG,OAAO,MAAM,SAAS;CAAzC,UAAA,CACG,WAAW,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAU;CAAc,CAAA,IAAI,MAC9D,UAAU,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAU,UAAA;CAAa,CAAA,IAAI,IAC1D;;AAGP,YAAY,cAAc"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/PageToolbar/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
4
|
+
actions: css`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: none;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
margin-inline-start: auto;
|
|
12
|
+
`,
|
|
13
|
+
filters: css`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 0 1 auto;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
min-inline-size: 0;
|
|
21
|
+
`,
|
|
22
|
+
root: css`
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
gap: 8px 12px;
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
`
|
|
30
|
+
}));
|
|
31
|
+
//#endregion
|
|
32
|
+
export { styles };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/PageToolbar/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css }) => ({\n actions: css`\n display: flex;\n flex: none;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n\n margin-inline-start: auto;\n `,\n filters: css`\n display: flex;\n flex: 0 1 auto;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n\n min-inline-size: 0;\n `,\n root: css`\n display: flex;\n flex-wrap: wrap;\n gap: 8px 12px;\n align-items: center;\n\n min-inline-size: 0;\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,WAAW;CACrD,SAAS,GAAG;;;;;;;;;CASZ,SAAS,GAAG;;;;;;;;;CASZ,MAAM,GAAG;;;;;;;;AAQX,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/PageToolbar/type.d.ts
|
|
3
|
+
interface PageToolbarProps {
|
|
4
|
+
/** Right side: refresh, export, the page's own buttons. */
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
/** Left side: range, scope, search, whatever narrows the page. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { PageToolbarProps };
|
|
12
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PanelSurfaceProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/PanelSurface/PanelSurface.d.ts
|
|
3
|
+
/** Titled console panel. Body padding stays inside so a trailing table can bleed to the edges. */
|
|
4
|
+
declare const PanelSurface: {
|
|
5
|
+
({ title, description, extra, href, loading, renderLink, size, className, style, children }: PanelSurfaceProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PanelSurface as default };
|
|
10
|
+
//# sourceMappingURL=PanelSurface.d.mts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Spin from "../../base-ui/Spin/Spin.mjs";
|
|
3
|
+
import Skeleton from "../../base-ui/Skeleton/index.mjs";
|
|
4
|
+
import { styles } from "../Surface/style.mjs";
|
|
5
|
+
import Surface from "../Surface/Surface.mjs";
|
|
6
|
+
import { styles as styles$1 } from "./style.mjs";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { cx } from "antd-style";
|
|
9
|
+
//#region src/dashboard/PanelSurface/PanelSurface.tsx
|
|
10
|
+
/** Titled console panel. Body padding stays inside so a trailing table can bleed to the edges. */
|
|
11
|
+
const PanelSurface = ({ title, description, extra, href, loading, renderLink, size = "default", className, style, children }) => /* @__PURE__ */ jsx(Surface, {
|
|
12
|
+
className,
|
|
13
|
+
description,
|
|
14
|
+
extra: loading && children ? /* @__PURE__ */ jsx(Spin, { size: "small" }) : extra,
|
|
15
|
+
href,
|
|
16
|
+
padded: false,
|
|
17
|
+
renderLink,
|
|
18
|
+
style,
|
|
19
|
+
title,
|
|
20
|
+
children: loading && !children ? /* @__PURE__ */ jsx("div", {
|
|
21
|
+
"aria-busy": "true",
|
|
22
|
+
className: styles$1.loadingBody,
|
|
23
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
24
|
+
height: 220,
|
|
25
|
+
radius: 8
|
|
26
|
+
})
|
|
27
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: cx(size === "small" ? styles$1.bodySmall : styles$1.body, styles.tableBleed),
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
PanelSurface.displayName = "PanelSurface";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { PanelSurface as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=PanelSurface.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelSurface.mjs","names":["styles","surfaceStyles"],"sources":["../../../src/dashboard/PanelSurface/PanelSurface.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\n\nimport Skeleton from '@/base-ui/Skeleton';\nimport Spin from '@/base-ui/Spin';\n\nimport { styles as surfaceStyles } from '../Surface/style';\nimport Surface from '../Surface/Surface';\nimport { styles } from './style';\nimport type { PanelSurfaceProps } from './type';\n\n/** Titled console panel. Body padding stays inside so a trailing table can bleed to the edges. */\nconst PanelSurface = ({\n title,\n description,\n extra,\n href,\n loading,\n renderLink,\n size = 'default',\n className,\n style,\n children,\n}: PanelSurfaceProps) => (\n <Surface\n className={className}\n description={description}\n extra={loading && children ? <Spin size=\"small\" /> : extra}\n href={href}\n padded={false}\n renderLink={renderLink}\n style={style}\n title={title}\n >\n {loading && !children ? (\n <div aria-busy=\"true\" className={styles.loadingBody}>\n <Skeleton height={220} radius={8} />\n </div>\n ) : (\n <div\n className={cx(size === 'small' ? styles.bodySmall : styles.body, surfaceStyles.tableBleed)}\n >\n {children}\n </div>\n )}\n </Surface>\n);\n\nPanelSurface.displayName = 'PanelSurface';\n\nexport default PanelSurface;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,gBAAgB,EACpB,OACA,aACA,OACA,MACA,SACA,YACA,OAAO,WACP,WACA,OACA,eAEA,oBAAC,SAAD;CACa;CACE;CACb,OAAO,WAAW,WAAW,oBAAC,MAAD,EAAM,MAAK,QAAS,CAAA,IAAI;CAC/C;CACN,QAAQ;CACI;CACL;CACA;CAEN,UAAA,WAAW,CAAC,WACX,oBAAC,OAAD;EAAK,aAAU;EAAO,WAAWA,SAAO;EACtC,UAAA,oBAAC,UAAD;GAAU,QAAQ;GAAK,QAAQ;EAAI,CAAA;CAChC,CAAA,IAEL,oBAAC,OAAD;EACE,WAAW,GAAG,SAAS,UAAUA,SAAO,YAAYA,SAAO,MAAMC,OAAc,UAAU;EAExF;CACE,CAAA;AAEA,CAAA;AAGX,aAAa,cAAc"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/PanelSurface/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
4
|
+
body: css`
|
|
5
|
+
--surface-pad-inline: 16px;
|
|
6
|
+
--surface-pad-block: 16px;
|
|
7
|
+
|
|
8
|
+
padding: 16px;
|
|
9
|
+
`,
|
|
10
|
+
bodySmall: css`
|
|
11
|
+
--surface-pad-inline: 16px;
|
|
12
|
+
--surface-pad-block: 12px;
|
|
13
|
+
|
|
14
|
+
padding-block: 12px;
|
|
15
|
+
padding-inline: 16px;
|
|
16
|
+
`,
|
|
17
|
+
loadingBody: css`
|
|
18
|
+
padding-block: 4px 8px;
|
|
19
|
+
`
|
|
20
|
+
}));
|
|
21
|
+
//#endregion
|
|
22
|
+
export { styles };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/PanelSurface/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css }) => ({\n body: css`\n --surface-pad-inline: 16px;\n --surface-pad-block: 16px;\n\n padding: 16px;\n `,\n bodySmall: css`\n --surface-pad-inline: 16px;\n --surface-pad-block: 12px;\n\n padding-block: 12px;\n padding-inline: 16px;\n `,\n loadingBody: css`\n padding-block: 4px 8px;\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,WAAW;CACrD,MAAM,GAAG;;;;;;CAMT,WAAW,GAAG;;;;;;;CAOd,aAAa,GAAG;;;AAGlB,EAAE"}
|
|
@@ -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,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
|
}
|