@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
|
@@ -1,16 +1,76 @@
|
|
|
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, 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 refreshing = Boolean(loading) && defined(children);
|
|
20
|
+
const placeholder = Boolean(loading) && !defined(children);
|
|
21
|
+
const hasHeader = defined(title) || defined(description) || defined(extra) || refreshing;
|
|
22
|
+
const pad = bleed ? false : padded ?? (hasHeader || placeholder);
|
|
23
|
+
const clip = hasHeader || bleed || pad || defined(chart);
|
|
24
|
+
const heading = /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: styles.heading,
|
|
26
|
+
children: [defined(title) ? /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: styles.title,
|
|
28
|
+
children: title
|
|
29
|
+
}) : null, defined(description) ? /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: styles.desc,
|
|
31
|
+
children: description
|
|
32
|
+
}) : null]
|
|
33
|
+
});
|
|
34
|
+
const body = placeholder ? /* @__PURE__ */ jsx("div", {
|
|
35
|
+
"aria-busy": "true",
|
|
36
|
+
className: styles.loading,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
38
|
+
height: 220,
|
|
39
|
+
radius: 8
|
|
40
|
+
})
|
|
41
|
+
}) : children;
|
|
42
|
+
return /* @__PURE__ */ jsx(SurfaceDepthContext, {
|
|
43
|
+
value: depth + 1,
|
|
44
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: cx(styles.card, styles.content, clip && styles.clip, href && styles.cardLinked, bleed && styles.bleed, className),
|
|
46
|
+
...rest,
|
|
47
|
+
children: [
|
|
48
|
+
hasHeader ? /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: styles.header,
|
|
50
|
+
children: [href ? link({
|
|
51
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [heading, /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
"data-surface-arrow": true,
|
|
54
|
+
className: styles.arrow,
|
|
55
|
+
size: 16
|
|
56
|
+
})] }),
|
|
57
|
+
className: styles.headingLink,
|
|
58
|
+
href
|
|
59
|
+
}) : heading, refreshing || defined(extra) ? /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: styles.extra,
|
|
61
|
+
children: [refreshing ? /* @__PURE__ */ jsx(Spin, { size: "small" }) : null, extra]
|
|
62
|
+
}) : null]
|
|
63
|
+
}) : null,
|
|
64
|
+
pad ? /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: cx(styles.body, styles.tableBleed),
|
|
66
|
+
children: body
|
|
67
|
+
}) : body,
|
|
68
|
+
defined(chart) ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: styles.chart,
|
|
70
|
+
children: chart
|
|
71
|
+
}) : null
|
|
72
|
+
]
|
|
73
|
+
})
|
|
14
74
|
});
|
|
15
75
|
}
|
|
16
76
|
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 { SurfaceDepthContext, useSurfaceDepth, useSurfaceLink } 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 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 return (\n <SurfaceDepthContext value={depth + 1}>\n <div\n className={cx(\n styles.card,\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 <ArrowUpRight\n aria-hidden\n data-surface-arrow\n className={styles.arrow}\n size={16}\n />\n </>\n ),\n className: styles.headingLink,\n href,\n })\n : heading}\n {refreshing || defined(extra) ? (\n <div className={styles.extra}>\n {refreshing ? <Spin size=\"small\" /> : null}\n {extra}\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":";;;;;;;;;AAaA,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,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;CAGF,OACE,oBAAC,qBAAD;EAAqB,OAAO,QAAQ;EAClC,UAAA,qBAAC,OAAD;GACE,WAAW,GACT,OAAO,MACP,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,SACD,oBAAC,cAAD;OACE,eAAA;OACA,sBAAA;OACA,WAAW,OAAO;OAClB,MAAM;MACP,CAAA,CACD,EAAA,CAAA;MAEJ,WAAW,OAAO;MAClB;KACF,CAAC,IACD,SACH,cAAc,QAAQ,KAAK,IAC1B,qBAAC,OAAD;MAAK,WAAW,OAAO;MAAvB,UAAA,CACG,aAAa,oBAAC,MAAD,EAAM,MAAK,QAAS,CAAA,IAAI,MACrC,KACE;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, 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, useSurfaceDepth, useSurfaceLink };
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
//#endregion
|
|
13
|
+
export { SurfaceLinkProvider, useSurfaceDepth, useSurfaceLink };
|
|
14
|
+
//# sourceMappingURL=link.d.mts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/dashboard/Surface/link.tsx
|
|
5
|
+
const defaultRenderLink = ({ children, ...rest }) => /* @__PURE__ */ jsx("a", {
|
|
6
|
+
...rest,
|
|
7
|
+
children
|
|
8
|
+
});
|
|
9
|
+
const SurfaceLinkContext = createContext(defaultRenderLink);
|
|
10
|
+
const SurfaceDepthContext = createContext(0);
|
|
11
|
+
/** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */
|
|
12
|
+
const SurfaceLinkProvider = ({ children, renderLink }) => /* @__PURE__ */ jsx(SurfaceLinkContext, {
|
|
13
|
+
value: renderLink,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
const useSurfaceLink = (override) => override ?? use(SurfaceLinkContext);
|
|
17
|
+
/** How many Surface cards wrap this node. A table can skip its own card when already inside one. */
|
|
18
|
+
const useSurfaceDepth = () => use(SurfaceDepthContext);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { SurfaceDepthContext, SurfaceLinkProvider, useSurfaceDepth, useSurfaceLink };
|
|
21
|
+
|
|
22
|
+
//# 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 { createContext, type ReactNode, use } from 'react';\n\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"],"mappings":";;;;AAMA,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"}
|
|
@@ -8,6 +8,29 @@
|
|
|
8
8
|
*/
|
|
9
9
|
declare const styles: {
|
|
10
10
|
card: string;
|
|
11
|
+
chart: string;
|
|
12
|
+
/** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */
|
|
13
|
+
clip: string;
|
|
14
|
+
loading: string;
|
|
15
|
+
arrow: string;
|
|
16
|
+
bleed: string;
|
|
17
|
+
body: string;
|
|
18
|
+
/** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */
|
|
19
|
+
content: string;
|
|
20
|
+
/** Whole card answers hover when its header drills into another page. */
|
|
21
|
+
cardLinked: string;
|
|
22
|
+
desc: string;
|
|
23
|
+
extra: string;
|
|
24
|
+
header: string;
|
|
25
|
+
heading: string;
|
|
26
|
+
headingLink: string;
|
|
27
|
+
/**
|
|
28
|
+
* A table inside padded card body meets the card's left, right, and bottom
|
|
29
|
+
* edges. A table that is the only body content also meets the header.
|
|
30
|
+
* Padding amounts come from `--surface-pad-*` on the same element.
|
|
31
|
+
*/
|
|
32
|
+
tableBleed: string;
|
|
33
|
+
title: string;
|
|
11
34
|
};
|
|
12
35
|
//#endregion
|
|
13
36
|
export { styles };
|
|
@@ -7,7 +7,8 @@ import { createStaticStyles } from "antd-style";
|
|
|
7
7
|
* The workspace is already that container, so a card inside it steps up to
|
|
8
8
|
* `colorBgElevated` and `colorBorder`.
|
|
9
9
|
*/
|
|
10
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
10
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
11
|
+
card: css`
|
|
11
12
|
&&,
|
|
12
13
|
&&:hover {
|
|
13
14
|
border: 1px solid ${cssVar.colorBorder};
|
|
@@ -15,7 +16,287 @@ const styles = createStaticStyles(({ css, cssVar }) => ({ card: css`
|
|
|
15
16
|
background: ${cssVar.colorBgElevated};
|
|
16
17
|
box-shadow: ${cssVar.boxShadowTertiary};
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
`,
|
|
20
|
+
chart: css`
|
|
21
|
+
min-inline-size: 0;
|
|
22
|
+
`,
|
|
23
|
+
/** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */
|
|
24
|
+
clip: css`
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
`,
|
|
27
|
+
loading: css`
|
|
28
|
+
padding-block: 4px 8px;
|
|
29
|
+
`,
|
|
30
|
+
arrow: css`
|
|
31
|
+
flex: none;
|
|
32
|
+
|
|
33
|
+
margin-block-start: 2px;
|
|
34
|
+
margin-inline-start: auto;
|
|
35
|
+
|
|
36
|
+
color: ${cssVar.colorTextTertiary};
|
|
37
|
+
|
|
38
|
+
transition:
|
|
39
|
+
color 150ms ease-out,
|
|
40
|
+
transform 150ms ease-out;
|
|
41
|
+
`,
|
|
42
|
+
bleed: css`
|
|
43
|
+
&& th,
|
|
44
|
+
&& td {
|
|
45
|
+
padding-inline: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&& th {
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
`,
|
|
52
|
+
body: css`
|
|
53
|
+
--surface-pad-inline: 16px;
|
|
54
|
+
--surface-pad-block: 16px;
|
|
55
|
+
|
|
56
|
+
padding: 16px;
|
|
57
|
+
`,
|
|
58
|
+
/** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */
|
|
59
|
+
content: css`
|
|
60
|
+
min-inline-size: 0;
|
|
61
|
+
|
|
62
|
+
/* Table cells default to colorBgContainer, a step darker than this card.
|
|
63
|
+
Ant Design paints that color on .ant-table itself, so the body stays dark
|
|
64
|
+
even after the cells are cleared. */
|
|
65
|
+
&& .ant-table,
|
|
66
|
+
&& th,
|
|
67
|
+
&& td {
|
|
68
|
+
background: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&& .ant-table-css-var,
|
|
72
|
+
&& .ant-table-wrapper {
|
|
73
|
+
--ant-table-border-color: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);
|
|
74
|
+
--ant-table-row-hover-bg: color-mix(
|
|
75
|
+
in srgb,
|
|
76
|
+
${cssVar.colorText} 6%,
|
|
77
|
+
${cssVar.colorBgElevated}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&& th {
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
color: ${cssVar.colorTextSecondary};
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
|
|
86
|
+
background: ${cssVar.colorBgElevated};
|
|
87
|
+
box-shadow: inset 0 -1px 0 color-mix(in srgb, ${cssVar.colorText} 10%, transparent);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Pinned body cells inherit the transparent body, so a scrolled cell paints
|
|
91
|
+
straight through them. Frost with the card color. Header pins stay the
|
|
92
|
+
same solid fill as the rest of the header — a translucent header reads
|
|
93
|
+
as a lighter strip in dark mode. */
|
|
94
|
+
&& td.ant-table-cell-fix-start,
|
|
95
|
+
&& td.ant-table-cell-fix-end {
|
|
96
|
+
background: color-mix(in srgb, ${cssVar.colorBgElevated} 82%, transparent);
|
|
97
|
+
backdrop-filter: blur(12px);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&& td.ant-table-cell-fix-end-shadow-show::after {
|
|
101
|
+
background: linear-gradient(
|
|
102
|
+
to left,
|
|
103
|
+
color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),
|
|
104
|
+
transparent
|
|
105
|
+
);
|
|
106
|
+
backdrop-filter: blur(8px);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&& td.ant-table-cell-fix-start-shadow-show::after {
|
|
110
|
+
background: linear-gradient(
|
|
111
|
+
to right,
|
|
112
|
+
color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),
|
|
113
|
+
transparent
|
|
114
|
+
);
|
|
115
|
+
backdrop-filter: blur(8px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[dir='rtl'] && td.ant-table-cell-fix-end-shadow-show::after {
|
|
119
|
+
background: linear-gradient(
|
|
120
|
+
to right,
|
|
121
|
+
color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),
|
|
122
|
+
transparent
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[dir='rtl'] && td.ant-table-cell-fix-start-shadow-show::after {
|
|
127
|
+
background: linear-gradient(
|
|
128
|
+
to left,
|
|
129
|
+
color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),
|
|
130
|
+
transparent
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&& td {
|
|
135
|
+
border-block-end-color: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&& tr:hover > td,
|
|
139
|
+
&& .ant-table-tbody > tr.ant-table-row:hover > td {
|
|
140
|
+
background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* base-ui Table pins with inline position:sticky, not .ant-table-cell-fix-*.
|
|
144
|
+
The transparent body rule above would let scrolled text show through. */
|
|
145
|
+
&& td[style*='sticky'] {
|
|
146
|
+
background: ${cssVar.colorBgElevated};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&& tr:hover > td[style*='sticky'] {
|
|
150
|
+
background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});
|
|
151
|
+
}
|
|
152
|
+
`,
|
|
153
|
+
/** Whole card answers hover when its header drills into another page. */
|
|
154
|
+
cardLinked: css`
|
|
155
|
+
&&:hover,
|
|
156
|
+
&&:focus-within {
|
|
157
|
+
border-color: color-mix(in srgb, ${cssVar.colorText} 28%, transparent);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&&:hover [data-surface-arrow] {
|
|
161
|
+
transform: translate(1px, -1px);
|
|
162
|
+
color: ${cssVar.colorText};
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
desc: css`
|
|
166
|
+
margin-block-start: 2px;
|
|
167
|
+
|
|
168
|
+
font-size: 13px;
|
|
169
|
+
font-weight: 400;
|
|
170
|
+
line-height: 1.45;
|
|
171
|
+
color: ${cssVar.colorTextSecondary};
|
|
172
|
+
`,
|
|
173
|
+
extra: css`
|
|
174
|
+
display: flex;
|
|
175
|
+
flex: none;
|
|
176
|
+
gap: 8px;
|
|
177
|
+
align-items: center;
|
|
178
|
+
`,
|
|
179
|
+
header: css`
|
|
180
|
+
display: flex;
|
|
181
|
+
gap: 12px;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
|
|
185
|
+
padding-block: 12px;
|
|
186
|
+
padding-inline: 16px;
|
|
187
|
+
border-block-end: 1px solid ${cssVar.colorBorderSecondary};
|
|
188
|
+
`,
|
|
189
|
+
heading: css`
|
|
190
|
+
min-inline-size: 0;
|
|
191
|
+
`,
|
|
192
|
+
headingLink: css`
|
|
193
|
+
display: flex;
|
|
194
|
+
flex: 1;
|
|
195
|
+
gap: 12px;
|
|
196
|
+
align-items: flex-start;
|
|
197
|
+
|
|
198
|
+
min-inline-size: 0;
|
|
199
|
+
|
|
200
|
+
color: inherit;
|
|
201
|
+
text-decoration: none;
|
|
202
|
+
|
|
203
|
+
&:hover {
|
|
204
|
+
color: inherit;
|
|
205
|
+
}
|
|
206
|
+
`,
|
|
207
|
+
/**
|
|
208
|
+
* A table inside padded card body meets the card's left, right, and bottom
|
|
209
|
+
* edges. A table that is the only body content also meets the header.
|
|
210
|
+
* Padding amounts come from `--surface-pad-*` on the same element.
|
|
211
|
+
*/
|
|
212
|
+
tableBleed: css`
|
|
213
|
+
/* A table nested in a cell keeps the cell's own inset. */
|
|
214
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) {
|
|
215
|
+
width: calc(100% + 2 * var(--surface-pad-inline, 16px));
|
|
216
|
+
margin-inline: calc(-1 * var(--surface-pad-inline, 16px));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):last-child {
|
|
220
|
+
margin-block-end: calc(-1 * var(--surface-pad-block, 16px));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):first-child:last-child {
|
|
224
|
+
margin-block-start: calc(-1 * var(--surface-pad-block, 16px));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* ProTable keeps its search and toolbar in the padding. The table itself
|
|
228
|
+
meets the card's left, right, and bottom edges. Lower-specificity
|
|
229
|
+
selectors stay above the :has(th/td) rules for stylelint. */
|
|
230
|
+
&& .ant-table-css-var,
|
|
231
|
+
&& .ant-table-wrapper {
|
|
232
|
+
--ant-table-cell-padding-inline: var(--surface-pad-inline, 16px);
|
|
233
|
+
--ant-table-cell-padding-inline-md: var(--surface-pad-inline, 16px);
|
|
234
|
+
--ant-table-cell-padding-inline-sm: var(--surface-pad-inline, 16px);
|
|
235
|
+
--ant-table-header-border-radius: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&& .ant-table-wrapper {
|
|
239
|
+
width: calc(100% + 2 * var(--surface-pad-inline, 16px));
|
|
240
|
+
max-width: none;
|
|
241
|
+
margin-inline: calc(-1 * var(--surface-pad-inline, 16px));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* A plain table that is the card body meets the header and the bottom edge.
|
|
245
|
+
Its own corner radius would otherwise float inside the card padding. */
|
|
246
|
+
&& > .lobe-flex:only-child > .ant-table-wrapper:only-child {
|
|
247
|
+
margin-block: calc(-1 * var(--surface-pad-block, 16px));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&& .ant-pro-table:last-child {
|
|
251
|
+
margin-block-end: calc(-1 * var(--surface-pad-block, 16px));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&& .ant-table-wrapper .ant-table,
|
|
255
|
+
&& .ant-table-wrapper .ant-table-container,
|
|
256
|
+
&& .ant-table-thead > tr > th,
|
|
257
|
+
&& .ant-table-thead > tr > th:first-child,
|
|
258
|
+
&& .ant-table-thead > tr > th:last-child {
|
|
259
|
+
border-radius: 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&& .ant-table-wrapper .ant-table-cell {
|
|
263
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&& .ant-table-wrapper .ant-pagination {
|
|
267
|
+
margin-block: 0;
|
|
268
|
+
padding-block: 12px;
|
|
269
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) th,
|
|
273
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) td {
|
|
274
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* The root's negative bottom margin includes this sibling. Without block
|
|
278
|
+
padding the pager sits on the card edge. Same inset as the ant pagination. */
|
|
279
|
+
&&
|
|
280
|
+
:has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper]))
|
|
281
|
+
> :not([data-table-wrapper]) {
|
|
282
|
+
margin-block: 0;
|
|
283
|
+
padding-block: 12px;
|
|
284
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
285
|
+
}
|
|
286
|
+
`,
|
|
287
|
+
title: css`
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
|
|
290
|
+
min-inline-size: 0;
|
|
291
|
+
|
|
292
|
+
font-size: 14px;
|
|
293
|
+
font-weight: 500;
|
|
294
|
+
line-height: 1.4;
|
|
295
|
+
color: ${cssVar.colorText};
|
|
296
|
+
text-overflow: ellipsis;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
`
|
|
299
|
+
}));
|
|
19
300
|
//#endregion
|
|
20
301
|
export { styles };
|
|
21
302
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Surface/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\n/**\n * A content card sitting on the workspace.\n *\n * Outlined `Block` uses `colorBorderSecondary` on `colorBgContainer`.\n * The workspace is already that container, so a card inside it steps up to\n * `colorBgElevated` and `colorBorder`.\n */\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n card: css`\n &&,\n &&:hover {\n border: 1px solid ${cssVar.colorBorder};\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorBgElevated};\n box-shadow: ${cssVar.boxShadowTertiary};\n }\n `,\n}));\n"],"mappings":";;;;;;;;;AASA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc,EAC7D,MAAM,GAAG;;;0BAGe,OAAO,YAAY;uBACtB,OAAO,eAAe;oBACzB,OAAO,gBAAgB;oBACvB,OAAO,kBAAkB;;IAG7C,EAAE"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Surface/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\n/**\n * A content card sitting on the workspace.\n *\n * Outlined `Block` uses `colorBorderSecondary` on `colorBgContainer`.\n * The workspace is already that container, so a card inside it steps up to\n * `colorBgElevated` and `colorBorder`.\n */\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n card: css`\n &&,\n &&:hover {\n border: 1px solid ${cssVar.colorBorder};\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorBgElevated};\n box-shadow: ${cssVar.boxShadowTertiary};\n }\n `,\n chart: css`\n min-inline-size: 0;\n `,\n /** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */\n clip: css`\n overflow: hidden;\n `,\n loading: css`\n padding-block: 4px 8px;\n `,\n arrow: css`\n flex: none;\n\n margin-block-start: 2px;\n margin-inline-start: auto;\n\n color: ${cssVar.colorTextTertiary};\n\n transition:\n color 150ms ease-out,\n transform 150ms ease-out;\n `,\n bleed: css`\n && th,\n && td {\n padding-inline: 16px;\n }\n\n && th {\n white-space: nowrap;\n }\n `,\n body: css`\n --surface-pad-inline: 16px;\n --surface-pad-block: 16px;\n\n padding: 16px;\n `,\n /** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */\n content: css`\n min-inline-size: 0;\n\n /* Table cells default to colorBgContainer, a step darker than this card.\n Ant Design paints that color on .ant-table itself, so the body stays dark\n even after the cells are cleared. */\n && .ant-table,\n && th,\n && td {\n background: transparent;\n }\n\n && .ant-table-css-var,\n && .ant-table-wrapper {\n --ant-table-border-color: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);\n --ant-table-row-hover-bg: color-mix(\n in srgb,\n ${cssVar.colorText} 6%,\n ${cssVar.colorBgElevated}\n );\n }\n\n && th {\n font-weight: 500;\n color: ${cssVar.colorTextSecondary};\n white-space: nowrap;\n\n background: ${cssVar.colorBgElevated};\n box-shadow: inset 0 -1px 0 color-mix(in srgb, ${cssVar.colorText} 10%, transparent);\n }\n\n /* Pinned body cells inherit the transparent body, so a scrolled cell paints\n straight through them. Frost with the card color. Header pins stay the\n same solid fill as the rest of the header — a translucent header reads\n as a lighter strip in dark mode. */\n && td.ant-table-cell-fix-start,\n && td.ant-table-cell-fix-end {\n background: color-mix(in srgb, ${cssVar.colorBgElevated} 82%, transparent);\n backdrop-filter: blur(12px);\n }\n\n && td.ant-table-cell-fix-end-shadow-show::after {\n background: linear-gradient(\n to left,\n color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),\n transparent\n );\n backdrop-filter: blur(8px);\n }\n\n && td.ant-table-cell-fix-start-shadow-show::after {\n background: linear-gradient(\n to right,\n color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),\n transparent\n );\n backdrop-filter: blur(8px);\n }\n\n [dir='rtl'] && td.ant-table-cell-fix-end-shadow-show::after {\n background: linear-gradient(\n to right,\n color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),\n transparent\n );\n }\n\n [dir='rtl'] && td.ant-table-cell-fix-start-shadow-show::after {\n background: linear-gradient(\n to left,\n color-mix(in srgb, ${cssVar.colorBgElevated} 72%, transparent),\n transparent\n );\n }\n\n && td {\n border-block-end-color: color-mix(in srgb, ${cssVar.colorText} 10%, transparent);\n }\n\n && tr:hover > td,\n && .ant-table-tbody > tr.ant-table-row:hover > td {\n background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});\n }\n\n /* base-ui Table pins with inline position:sticky, not .ant-table-cell-fix-*.\n The transparent body rule above would let scrolled text show through. */\n && td[style*='sticky'] {\n background: ${cssVar.colorBgElevated};\n }\n\n && tr:hover > td[style*='sticky'] {\n background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});\n }\n `,\n /** Whole card answers hover when its header drills into another page. */\n cardLinked: css`\n &&:hover,\n &&:focus-within {\n border-color: color-mix(in srgb, ${cssVar.colorText} 28%, transparent);\n }\n\n &&:hover [data-surface-arrow] {\n transform: translate(1px, -1px);\n color: ${cssVar.colorText};\n }\n `,\n desc: css`\n margin-block-start: 2px;\n\n font-size: 13px;\n font-weight: 400;\n line-height: 1.45;\n color: ${cssVar.colorTextSecondary};\n `,\n extra: css`\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n `,\n header: css`\n display: flex;\n gap: 12px;\n align-items: center;\n justify-content: space-between;\n\n padding-block: 12px;\n padding-inline: 16px;\n border-block-end: 1px solid ${cssVar.colorBorderSecondary};\n `,\n heading: css`\n min-inline-size: 0;\n `,\n headingLink: css`\n display: flex;\n flex: 1;\n gap: 12px;\n align-items: flex-start;\n\n min-inline-size: 0;\n\n color: inherit;\n text-decoration: none;\n\n &:hover {\n color: inherit;\n }\n `,\n /**\n * A table inside padded card body meets the card's left, right, and bottom\n * edges. A table that is the only body content also meets the header.\n * Padding amounts come from `--surface-pad-*` on the same element.\n */\n tableBleed: css`\n /* A table nested in a cell keeps the cell's own inset. */\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) {\n width: calc(100% + 2 * var(--surface-pad-inline, 16px));\n margin-inline: calc(-1 * var(--surface-pad-inline, 16px));\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):last-child {\n margin-block-end: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):first-child:last-child {\n margin-block-start: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n /* ProTable keeps its search and toolbar in the padding. The table itself\n meets the card's left, right, and bottom edges. Lower-specificity\n selectors stay above the :has(th/td) rules for stylelint. */\n && .ant-table-css-var,\n && .ant-table-wrapper {\n --ant-table-cell-padding-inline: var(--surface-pad-inline, 16px);\n --ant-table-cell-padding-inline-md: var(--surface-pad-inline, 16px);\n --ant-table-cell-padding-inline-sm: var(--surface-pad-inline, 16px);\n --ant-table-header-border-radius: 0;\n }\n\n && .ant-table-wrapper {\n width: calc(100% + 2 * var(--surface-pad-inline, 16px));\n max-width: none;\n margin-inline: calc(-1 * var(--surface-pad-inline, 16px));\n }\n\n /* A plain table that is the card body meets the header and the bottom edge.\n Its own corner radius would otherwise float inside the card padding. */\n && > .lobe-flex:only-child > .ant-table-wrapper:only-child {\n margin-block: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && .ant-pro-table:last-child {\n margin-block-end: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && .ant-table-wrapper .ant-table,\n && .ant-table-wrapper .ant-table-container,\n && .ant-table-thead > tr > th,\n && .ant-table-thead > tr > th:first-child,\n && .ant-table-thead > tr > th:last-child {\n border-radius: 0;\n }\n\n && .ant-table-wrapper .ant-table-cell {\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n && .ant-table-wrapper .ant-pagination {\n margin-block: 0;\n padding-block: 12px;\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) th,\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) td {\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n /* The root's negative bottom margin includes this sibling. Without block\n padding the pager sits on the card edge. Same inset as the ant pagination. */\n &&\n :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper]))\n > :not([data-table-wrapper]) {\n margin-block: 0;\n padding-block: 12px;\n padding-inline: var(--surface-pad-inline, 16px);\n }\n `,\n title: css`\n overflow: hidden;\n\n min-inline-size: 0;\n\n font-size: 14px;\n font-weight: 500;\n line-height: 1.4;\n color: ${cssVar.colorText};\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n}));\n"],"mappings":";;;;;;;;;AASA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,MAAM,GAAG;;;0BAGe,OAAO,YAAY;uBACtB,OAAO,eAAe;oBACzB,OAAO,gBAAgB;oBACvB,OAAO,kBAAkB;;;CAG3C,OAAO,GAAG;;;;CAIV,MAAM,GAAG;;;CAGT,SAAS,GAAG;;;CAGZ,OAAO,GAAG;;;;;;aAMC,OAAO,kBAAkB;;;;;;CAMpC,OAAO,GAAG;;;;;;;;;;CAUV,MAAM,GAAG;;;;;;;CAOT,SAAS,GAAG;;;;;;;;;;;;;;qDAcuC,OAAO,UAAU;;;UAG5D,OAAO,UAAU;UACjB,OAAO,gBAAgB;;;;;;eAMlB,OAAO,mBAAmB;;;oBAGrB,OAAO,gBAAgB;sDACW,OAAO,UAAU;;;;;;;;;uCAShC,OAAO,gBAAgB;;;;;;;6BAOjC,OAAO,gBAAgB;;;;;;;;;6BASvB,OAAO,gBAAgB;;;;;;;;;6BASvB,OAAO,gBAAgB;;;;;;;;6BAQvB,OAAO,gBAAgB;;;;;;mDAMD,OAAO,UAAU;;;;;uCAK7B,OAAO,UAAU,OAAO,OAAO,gBAAgB;;;;;;oBAMlE,OAAO,gBAAgB;;;;uCAIJ,OAAO,UAAU,OAAO,OAAO,gBAAgB;;;;CAIpF,YAAY,GAAG;;;yCAGwB,OAAO,UAAU;;;;;eAK3C,OAAO,UAAU;;;CAG9B,MAAM,GAAG;;;;;;aAME,OAAO,mBAAmB;;CAErC,OAAO,GAAG;;;;;;CAMV,QAAQ,GAAG;;;;;;;;kCAQqB,OAAO,qBAAqB;;CAE5D,SAAS,GAAG;;;CAGZ,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;CAoBhB,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Ef,OAAO,GAAG;;;;;;;;aAQC,OAAO,UAAU;;;;AAI9B,EAAE"}
|
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
//#region src/dashboard/Surface/type.d.ts
|
|
3
|
-
interface
|
|
3
|
+
interface SurfaceLinkProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
href: string;
|
|
7
|
+
rel?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Renders a link with the app's router. Defaults to a plain `<a>`. */
|
|
11
|
+
type SurfaceRenderLink = (props: SurfaceLinkProps) => ReactNode;
|
|
12
|
+
interface SurfaceProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
13
|
+
/** Drop body padding and widen table cells so a table sits on the card edges. */
|
|
14
|
+
bleed?: boolean;
|
|
15
|
+
/** Full-width slot under the body, for a chart that meets the card edges. */
|
|
16
|
+
chart?: ReactNode;
|
|
4
17
|
children?: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
extra?: ReactNode;
|
|
20
|
+
/** Makes the heading a link to the page this card summarises. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/**
|
|
23
|
+
* First load: with no children the body is a placeholder block.
|
|
24
|
+
* A refresh with children keeps them and shows a small spinner in the header.
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** Pad the body. Defaults to on for a card with a header and off for a bare card. */
|
|
28
|
+
padded?: boolean;
|
|
29
|
+
/** Overrides the link renderer from `SurfaceLinkProvider`. */
|
|
30
|
+
renderLink?: SurfaceRenderLink;
|
|
31
|
+
/** Visible heading. */
|
|
32
|
+
title?: ReactNode;
|
|
5
33
|
}
|
|
6
34
|
//#endregion
|
|
7
|
-
export { SurfaceProps };
|
|
35
|
+
export { SurfaceLinkProps, SurfaceProps, SurfaceRenderLink };
|
|
8
36
|
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TableIconActionProps, TableIconActionsProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/TableIconActions/TableIconActions.d.ts
|
|
3
|
+
/** Column width for a row of `count` small filled action icons. */
|
|
4
|
+
declare const tableActionColumnWidth: (count: number) => number;
|
|
5
|
+
/** Right-aligned row of icon actions for a table's last column. */
|
|
6
|
+
declare const TableIconActions: {
|
|
7
|
+
({ children }: TableIconActionsProps): import("react").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
/** One row action: a small filled icon button whose label is its name and tooltip. */
|
|
11
|
+
declare const TableIconAction: {
|
|
12
|
+
({ danger, disabled, icon, label, loading, onClick }: TableIconActionProps): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TableIconAction, TableIconActions as default, tableActionColumnWidth };
|
|
17
|
+
//# sourceMappingURL=TableIconActions.d.mts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import ActionIcon from "../../base-ui/ActionIcon/ActionIcon.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/dashboard/TableIconActions/TableIconActions.tsx
|
|
6
|
+
/** `ActionIcon` `size="small"` is 24px. */
|
|
7
|
+
const ACTION_ICON_SIZE = 24;
|
|
8
|
+
const ACTION_ICON_GAP = 4;
|
|
9
|
+
/** Table cell horizontal padding, so the icons are not clipped by the column. */
|
|
10
|
+
const ACTION_CELL_PADDING = 32;
|
|
11
|
+
/** Column width for a row of `count` small filled action icons. */
|
|
12
|
+
const tableActionColumnWidth = (count) => count * ACTION_ICON_SIZE + Math.max(0, count - 1) * ACTION_ICON_GAP + ACTION_CELL_PADDING;
|
|
13
|
+
/** Right-aligned row of icon actions for a table's last column. */
|
|
14
|
+
const TableIconActions = ({ children }) => /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
15
|
+
horizontal: true,
|
|
16
|
+
align: "center",
|
|
17
|
+
gap: ACTION_ICON_GAP,
|
|
18
|
+
justify: "flex-end",
|
|
19
|
+
width: "100%",
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
TableIconActions.displayName = "TableIconActions";
|
|
23
|
+
/** One row action: a small filled icon button whose label is its name and tooltip. */
|
|
24
|
+
const TableIconAction = ({ danger, disabled, icon, label, loading, onClick }) => /* @__PURE__ */ jsx(ActionIcon, {
|
|
25
|
+
"aria-label": label,
|
|
26
|
+
danger,
|
|
27
|
+
disabled,
|
|
28
|
+
icon,
|
|
29
|
+
loading,
|
|
30
|
+
size: "small",
|
|
31
|
+
title: label,
|
|
32
|
+
variant: "filled",
|
|
33
|
+
onClick
|
|
34
|
+
});
|
|
35
|
+
TableIconAction.displayName = "TableIconAction";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { TableIconAction, TableIconActions as default, tableActionColumnWidth };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=TableIconActions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableIconActions.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/TableIconActions/TableIconActions.tsx"],"sourcesContent":["'use client';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport { Flexbox } from '@/Flex';\n\nimport type { TableIconActionProps, TableIconActionsProps } from './type';\n\n/** `ActionIcon` `size=\"small\"` is 24px. */\nconst ACTION_ICON_SIZE = 24;\nconst ACTION_ICON_GAP = 4;\n/** Table cell horizontal padding, so the icons are not clipped by the column. */\nconst ACTION_CELL_PADDING = 32;\n\n/** Column width for a row of `count` small filled action icons. */\nexport const tableActionColumnWidth = (count: number) =>\n count * ACTION_ICON_SIZE + Math.max(0, count - 1) * ACTION_ICON_GAP + ACTION_CELL_PADDING;\n\n/** Right-aligned row of icon actions for a table's last column. */\nconst TableIconActions = ({ children }: TableIconActionsProps) => (\n <Flexbox horizontal align={'center'} gap={ACTION_ICON_GAP} justify={'flex-end'} width={'100%'}>\n {children}\n </Flexbox>\n);\n\nTableIconActions.displayName = 'TableIconActions';\n\n/** One row action: a small filled icon button whose label is its name and tooltip. */\nexport const TableIconAction = ({\n danger,\n disabled,\n icon,\n label,\n loading,\n onClick,\n}: TableIconActionProps) => (\n <ActionIcon\n aria-label={label}\n danger={danger}\n disabled={disabled}\n icon={icon}\n loading={loading}\n size={'small'}\n title={label}\n variant={'filled'}\n onClick={onClick}\n />\n);\n\nTableIconAction.displayName = 'TableIconAction';\n\nexport default TableIconActions;\n"],"mappings":";;;;;;AAQA,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;;AAExB,MAAM,sBAAsB;;AAG5B,MAAa,0BAA0B,UACrC,QAAQ,mBAAmB,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI,kBAAkB;;AAGxE,MAAM,oBAAoB,EAAE,eAC1B,oBAACA,mBAAD;CAAS,YAAA;CAAW,OAAO;CAAU,KAAK;CAAiB,SAAS;CAAY,OAAO;CACpF;AACM,CAAA;AAGX,iBAAiB,cAAc;;AAG/B,MAAa,mBAAmB,EAC9B,QACA,UACA,MACA,OACA,SACA,cAEA,oBAAC,YAAD;CACE,cAAY;CACJ;CACE;CACJ;CACG;CACT,MAAM;CACN,OAAO;CACP,SAAS;CACA;AACV,CAAA;AAGH,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TableIconActionProps, TableIconActionsProps } from "./type.mjs";
|
|
2
|
+
import TableIconActions, { TableIconAction, tableActionColumnWidth } from "./TableIconActions.mjs";
|
|
3
|
+
export { TableIconAction, type TableIconActionProps, type TableIconActionsProps, TableIconActions as default, tableActionColumnWidth };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
import { LucideIcon } from "lucide-react";
|
|
3
|
+
//#region src/dashboard/TableIconActions/type.d.ts
|
|
4
|
+
interface TableIconActionsProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface TableIconActionProps {
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon: LucideIcon;
|
|
11
|
+
/** Accessible name and tooltip. Required: the button has no visible text. */
|
|
12
|
+
label: string;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TableIconActionProps, TableIconActionsProps };
|
|
18
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TitleWithTipsProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/TitleWithTips/TitleWithTips.d.ts
|
|
3
|
+
/** A column or field title with an info icon that explains it on hover. */
|
|
4
|
+
declare const TitleWithTips: {
|
|
5
|
+
({ className, tips, title }: TitleWithTipsProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TitleWithTips as default };
|
|
10
|
+
//# sourceMappingURL=TitleWithTips.d.mts.map
|