@lobehub/ui 6.0.0-beta.5 → 6.0.0-beta.7

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.
Files changed (172) hide show
  1. package/es/ActionIcon/style.mjs +1 -1
  2. package/es/ActionIcon/style.mjs.map +1 -1
  3. package/es/ColorSwatches/ColorSwatches.mjs +17 -22
  4. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  5. package/es/ColorSwatches/CustomPicker.mjs +101 -0
  6. package/es/ColorSwatches/CustomPicker.mjs.map +1 -0
  7. package/es/ColorSwatches/index.d.mts +2 -2
  8. package/es/ColorSwatches/marker.stylex.mjs +9 -0
  9. package/es/ColorSwatches/marker.stylex.mjs.map +1 -0
  10. package/es/ColorSwatches/style.mjs +36 -0
  11. package/es/ColorSwatches/style.mjs.map +1 -1
  12. package/es/ColorSwatches/type.d.mts +11 -2
  13. package/es/EditableText/EditableText.mjs +1 -1
  14. package/es/Grid/style.mjs +1 -1
  15. package/es/Grid/style.mjs.map +1 -1
  16. package/es/Image/type.d.mts +1 -0
  17. package/es/Image/viewer/ImageViewer.mjs +1 -0
  18. package/es/Image/viewer/ImageViewer.mjs.map +1 -1
  19. package/es/Image/viewer/Toolbar.mjs +19 -6
  20. package/es/Image/viewer/Toolbar.mjs.map +1 -1
  21. package/es/Image/viewer/ViewerChrome.mjs.map +1 -1
  22. package/es/Input/style.mjs +3 -3
  23. package/es/Input/style.mjs.map +1 -1
  24. package/es/Text/style.d.mts +3 -3
  25. package/es/awesome/Grainient/Grainient.d.mts +11 -0
  26. package/es/awesome/Grainient/Grainient.mjs +314 -0
  27. package/es/awesome/Grainient/Grainient.mjs.map +1 -0
  28. package/es/awesome/Grainient/index.d.mts +3 -0
  29. package/es/awesome/Grainient/style.mjs +23 -0
  30. package/es/awesome/Grainient/style.mjs.map +1 -0
  31. package/es/awesome/Grainient/type.d.mts +121 -0
  32. package/es/awesome/index.d.mts +4 -1
  33. package/es/awesome/index.mjs +2 -1
  34. package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
  35. package/es/dashboard/AuthLayout/Aside.mjs +31 -0
  36. package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
  37. package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
  38. package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
  39. package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
  40. package/es/dashboard/AuthLayout/index.d.mts +3 -2
  41. package/es/dashboard/AuthLayout/style.mjs +98 -1
  42. package/es/dashboard/AuthLayout/style.mjs.map +1 -1
  43. package/es/dashboard/AuthLayout/type.d.mts +38 -2
  44. package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
  45. package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +33 -0
  46. package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
  47. package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
  48. package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
  49. package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
  50. package/es/dashboard/AuthTools/index.d.mts +4 -0
  51. package/es/dashboard/AuthTools/style.mjs +27 -0
  52. package/es/dashboard/AuthTools/style.mjs.map +1 -0
  53. package/es/dashboard/AuthTools/type.d.mts +29 -0
  54. package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
  55. package/es/dashboard/ChartGrid/ChartGrid.mjs +19 -0
  56. package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
  57. package/es/dashboard/ChartGrid/index.d.mts +3 -0
  58. package/es/dashboard/ChartGrid/style.mjs +18 -0
  59. package/es/dashboard/ChartGrid/style.mjs.map +1 -0
  60. package/es/dashboard/ChartGrid/type.d.mts +8 -0
  61. package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
  62. package/es/dashboard/ConsoleNav/Skeleton.mjs +82 -0
  63. package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
  64. package/es/dashboard/ConsoleNav/index.d.mts +3 -2
  65. package/es/dashboard/ConsoleNav/style.mjs +18 -0
  66. package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
  67. package/es/dashboard/ConsoleNav/type.d.mts +13 -0
  68. package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
  69. package/es/dashboard/ConsoleShell/ConsoleShell.mjs +26 -6
  70. package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
  71. package/es/dashboard/ConsoleShell/style.mjs +10 -0
  72. package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
  73. package/es/dashboard/ConsoleShell/type.d.mts +11 -0
  74. package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
  75. package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
  76. package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
  77. package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
  78. package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
  79. package/es/dashboard/FilterStrip/index.d.mts +3 -0
  80. package/es/dashboard/FilterStrip/style.mjs +78 -0
  81. package/es/dashboard/FilterStrip/style.mjs.map +1 -0
  82. package/es/dashboard/FilterStrip/type.d.mts +25 -0
  83. package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
  84. package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
  85. package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
  86. package/es/dashboard/LabelWithKey/index.d.mts +3 -0
  87. package/es/dashboard/LabelWithKey/type.d.mts +11 -0
  88. package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
  89. package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
  90. package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
  91. package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
  92. package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
  93. package/es/dashboard/MetricStrip/index.d.mts +3 -0
  94. package/es/dashboard/MetricStrip/style.mjs +156 -0
  95. package/es/dashboard/MetricStrip/style.mjs.map +1 -0
  96. package/es/dashboard/MetricStrip/type.d.mts +36 -0
  97. package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
  98. package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
  99. package/es/dashboard/PageSkeleton/style.mjs +1 -1
  100. package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
  101. package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
  102. package/es/dashboard/PageToolbar/PageToolbar.mjs +22 -0
  103. package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
  104. package/es/dashboard/PageToolbar/index.d.mts +3 -0
  105. package/es/dashboard/PageToolbar/style.mjs +36 -0
  106. package/es/dashboard/PageToolbar/style.mjs.map +1 -0
  107. package/es/dashboard/PageToolbar/type.d.mts +11 -0
  108. package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
  109. package/es/dashboard/PanelSurface/PanelSurface.mjs +40 -0
  110. package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
  111. package/es/dashboard/PanelSurface/index.d.mts +3 -0
  112. package/es/dashboard/PanelSurface/style.mjs +25 -0
  113. package/es/dashboard/PanelSurface/style.mjs.map +1 -0
  114. package/es/dashboard/PanelSurface/type.d.mts +17 -0
  115. package/es/dashboard/Section/Section.d.mts +10 -0
  116. package/es/dashboard/Section/Section.mjs +81 -0
  117. package/es/dashboard/Section/Section.mjs.map +1 -0
  118. package/es/dashboard/Section/index.d.mts +3 -0
  119. package/es/dashboard/Section/style.mjs +31 -0
  120. package/es/dashboard/Section/style.mjs.map +1 -0
  121. package/es/dashboard/Section/type.d.mts +23 -0
  122. package/es/dashboard/StatCard/StatCard.d.mts +2 -1
  123. package/es/dashboard/StatCard/StatCard.mjs +28 -91
  124. package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
  125. package/es/dashboard/StatCard/type.d.mts +16 -5
  126. package/es/dashboard/Surface/Surface.d.mts +4 -3
  127. package/es/dashboard/Surface/Surface.mjs +91 -8
  128. package/es/dashboard/Surface/Surface.mjs.map +1 -1
  129. package/es/dashboard/Surface/index.d.mts +3 -2
  130. package/es/dashboard/Surface/link.d.mts +16 -0
  131. package/es/dashboard/Surface/link.mjs +40 -0
  132. package/es/dashboard/Surface/link.mjs.map +1 -0
  133. package/es/dashboard/Surface/marker.stylex.mjs +9 -0
  134. package/es/dashboard/Surface/marker.stylex.mjs.map +1 -0
  135. package/es/dashboard/Surface/style.d.mts +2 -0
  136. package/es/dashboard/Surface/style.mjs +155 -14
  137. package/es/dashboard/Surface/style.mjs.map +1 -1
  138. package/es/dashboard/Surface/type.d.mts +29 -1
  139. package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
  140. package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
  141. package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
  142. package/es/dashboard/TableIconActions/index.d.mts +3 -0
  143. package/es/dashboard/TableIconActions/type.d.mts +17 -0
  144. package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
  145. package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
  146. package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
  147. package/es/dashboard/TitleWithTips/index.d.mts +3 -0
  148. package/es/dashboard/TitleWithTips/type.d.mts +10 -0
  149. package/es/dashboard/index.d.mts +38 -4
  150. package/es/dashboard/index.mjs +17 -3
  151. package/es/index.d.mts +3 -2
  152. package/es/index.mjs +5 -4
  153. package/es/style.css +339 -32
  154. package/es/styles/createGlobalStyle.mjs +1 -1
  155. package/es/styles/index.d.mts +3 -2
  156. package/es/styles/index.mjs +5 -4
  157. package/es/styles/theme/createLobeToken.d.mts +3 -2
  158. package/es/styles/theme/createLobeToken.mjs.map +1 -1
  159. package/es/styles/theme/customPrimary.d.mts +7 -0
  160. package/es/styles/theme/customPrimary.mjs +66 -0
  161. package/es/styles/theme/customPrimary.mjs.map +1 -0
  162. package/es/styles/theme/scope.d.mts +4 -3
  163. package/es/styles/theme/scope.mjs +30 -8
  164. package/es/styles/theme/scope.mjs.map +1 -1
  165. package/es/styles/theme/themeCss.d.mts +2 -0
  166. package/es/styles/theme/themeCss.mjs +9 -2
  167. package/es/styles/theme/themeCss.mjs.map +1 -1
  168. package/es/styles/theme/token/primary.mjs +6 -2
  169. package/es/styles/theme/token/primary.mjs.map +1 -1
  170. package/package.json +1 -1
  171. package/es/dashboard/StatCard/style.mjs +0 -105
  172. package/es/dashboard/StatCard/style.mjs.map +0 -1
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { styleProps } from "../../styles/stylex/props.mjs";
3
+ import Icon from "../../Icon/Icon.mjs";
4
+ import FlexBasic_default from "../../Flex/FlexBasic.mjs";
5
+ import { useSurfaceLink } from "../Surface/link.mjs";
6
+ import Surface from "../Surface/Surface.mjs";
7
+ import { styles } from "./style.mjs";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import * as stylex from "@stylexjs/stylex";
10
+ import { ChevronRight } from "lucide-react";
11
+ //#region src/dashboard/Section/Section.tsx
12
+ /** A titled page section with description, extra and a "more" link, flat or as a card. */
13
+ const Section = ({ className, variant = "default", fontSize, title, more, moreLink, icon, children, desc, extra, gap, padded, renderLink, ...rest }) => {
14
+ const link = useSurfaceLink(renderLink);
15
+ const moreNode = moreLink ? link({
16
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { children: more }), /* @__PURE__ */ jsx(Icon, { icon: ChevronRight })] }),
17
+ className: stylex.props(styles.more).className,
18
+ href: moreLink,
19
+ rel: moreLink.startsWith("http") ? "noreferrer" : void 0,
20
+ target: moreLink.startsWith("http") ? "_blank" : void 0
21
+ }) : null;
22
+ const actions = extra || moreNode ? /* @__PURE__ */ jsxs(FlexBasic_default, {
23
+ horizontal: true,
24
+ align: "center",
25
+ gap: 8,
26
+ children: [extra, moreNode]
27
+ }) : void 0;
28
+ if (variant === "card") return /* @__PURE__ */ jsx(Surface, {
29
+ description: desc,
30
+ extra: actions,
31
+ padded: padded ?? true,
32
+ title: title ? /* @__PURE__ */ jsxs("span", {
33
+ ...styleProps(styles.title, void 0, fontSize ? { fontSize } : void 0),
34
+ children: [icon, title]
35
+ }) : void 0,
36
+ children: /* @__PURE__ */ jsx(FlexBasic_default, {
37
+ className,
38
+ gap: gap ?? 12,
39
+ ...rest,
40
+ children
41
+ })
42
+ });
43
+ if (!title) return /* @__PURE__ */ jsx(FlexBasic_default, {
44
+ className,
45
+ gap,
46
+ ...rest,
47
+ children
48
+ });
49
+ return /* @__PURE__ */ jsxs(FlexBasic_default, {
50
+ className,
51
+ gap: gap ?? 16,
52
+ width: "100%",
53
+ ...rest,
54
+ children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
55
+ horizontal: true,
56
+ align: "center",
57
+ gap: 12,
58
+ justify: "space-between",
59
+ width: "100%",
60
+ children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
61
+ gap: 4,
62
+ children: [
63
+ icon,
64
+ /* @__PURE__ */ jsx("h2", {
65
+ ...styleProps(styles.title, void 0, fontSize ? { fontSize } : void 0),
66
+ children: title
67
+ }),
68
+ desc ? /* @__PURE__ */ jsx("div", {
69
+ ...stylex.props(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 * as stylex from '@stylexjs/stylex';\nimport { ChevronRight } from 'lucide-react';\n\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport { styleProps } from '@/styles/stylex/props';\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: stylex.props(styles.more).className,\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 {...styleProps(styles.title, undefined, 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 {...styleProps(styles.title, undefined, fontSize ? { fontSize } : undefined)}>\n {title}\n </h2>\n {desc ? <div {...stylex.props(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,MAC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,WAAW,OAAO,OAAO,KAAA,GAAW,WAAW,EACvD,SACF,IAAI,KAAA,CAAS;MACR,UAAA;KACC,CAAA;KACH,OAAO,oBAAC,OAAD;MAAK,GAAI,OAAO,MAAM,OAAO,IAAI;MAAI,UAAA;KAAU,CAAA,IAAI;IACpD;GACR,CAAA,GAAA,WAAW,IACL;EACR,CAAA,GAAA,QACM;;AACb;AACA,QAAQ,cAAc"}
@@ -0,0 +1,3 @@
1
+ import { SectionProps } from "./type.mjs";
2
+ import Section from "./Section.mjs";
3
+ export { type SectionProps, Section as default };
@@ -0,0 +1,31 @@
1
+ //#region src/dashboard/Section/style.ts
2
+ const styles = {
3
+ desc: {
4
+ kMwMTN: "lbc77et8",
5
+ kGuDYH: "lb4z9k3i",
6
+ k63SB2: "lbo1l8bm",
7
+ kLWn49: "lbfrs9s4",
8
+ $$css: true
9
+ },
10
+ more: {
11
+ kOIVth: "lb195vfkc",
12
+ kybGjl: "lb1hl2dhg",
13
+ kGNEyG: "lb6s0dn4",
14
+ kMwMTN: "lbc77et8 lb1bxu9lh",
15
+ k1xSpc: "lb3nfvp2",
16
+ kGuDYH: "lb4z9k3i",
17
+ $$css: true
18
+ },
19
+ title: {
20
+ kogj98: "lb1ghz6dp",
21
+ kMwMTN: "lb66ogz0",
22
+ kGuDYH: "lb1jvydc1",
23
+ k63SB2: "lb1s688f",
24
+ kLWn49: "lb37zpob",
25
+ $$css: true
26
+ }
27
+ };
28
+ //#endregion
29
+ export { styles };
30
+
31
+ //# sourceMappingURL=style.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Section/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nexport const styles = stylex.create({\n desc: {\n color: cssVar.colorTextSecondary,\n fontSize: 13,\n fontWeight: 400,\n lineHeight: 1.45,\n },\n more: {\n gap: 2,\n textDecoration: 'none',\n alignItems: 'center',\n color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },\n display: 'inline-flex',\n fontSize: 13,\n },\n title: {\n margin: 0,\n color: cssVar.colorText,\n fontSize: 15,\n fontWeight: 600,\n lineHeight: 1.4,\n },\n});\n"],"mappings":";AAGA,MAAa,SAAS;CACpB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
@@ -0,0 +1,23 @@
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
+ export 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
+ //# 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
- declare function StatCard({ action, delta, direction, hint, label, mark, prominent, value, wash }: StatCardProps): import("react").JSX.Element;
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,98 +1,35 @@
1
1
  "use client";
2
- import { cssVar } from "../../styles/stylex/cssVar.stylex.mjs";
3
- import Icon from "../../Icon/Icon.mjs";
4
- import FlexBasic_default from "../../Flex/FlexBasic.mjs";
5
- import Text from "../../Text/Text.mjs";
2
+ import { styleProps } from "../../styles/stylex/props.mjs";
6
3
  import { styles } from "../Surface/style.mjs";
7
- import { styles as styles$1 } from "./style.mjs";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import * as stylex from "@stylexjs/stylex";
10
- import { Minus, TrendingDown, TrendingUp } from "lucide-react";
4
+ import { useSurfaceCardStyles } from "../Surface/link.mjs";
5
+ import { styles as styles$1 } from "../MetricStrip/style.mjs";
6
+ import MetricCell from "../MetricStrip/MetricCell.mjs";
7
+ import { jsx } from "react/jsx-runtime";
11
8
  //#region src/dashboard/StatCard/StatCard.tsx
12
- const deltaIcon = {
13
- down: TrendingDown,
14
- flat: Minus,
15
- up: TrendingUp
16
- };
17
- const deltaStyles = {
18
- down: styles$1.deltaDown,
19
- flat: styles$1.deltaFlat,
20
- up: styles$1.deltaUp
21
- };
22
- const textStyles = {
23
- hint: {
24
- color: cssVar.colorTextTertiary,
25
- fontSize: cssVar.fontSizeSM
26
- },
27
- label: {
28
- color: cssVar.colorTextSecondary,
29
- fontSize: cssVar.fontSizeSM
30
- },
31
- metricHint: {
32
- color: cssVar.colorText,
33
- fontSize: cssVar.fontSize
34
- },
35
- metricLabel: {
36
- color: cssVar.colorText,
37
- fontSize: cssVar.fontSize,
38
- fontWeight: 500
39
- }
40
- };
41
- function StatCard({ action, delta, direction = "flat", hint, label, mark, prominent = false, value, wash }) {
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 cardStyles = useSurfaceCardStyles();
42
12
  return /* @__PURE__ */ jsx("div", {
43
- ...stylex.props(styles$1.lift),
44
- children: /* @__PURE__ */ jsx(FlexBasic_default, {
45
- ...stylex.props(styles$1.root, styles.card, wash && [styles$1.wash, styles$1[wash]], styles$1.frame),
46
- children: /* @__PURE__ */ jsxs(FlexBasic_default, {
47
- gap: prominent ? 0 : 8,
48
- ...stylex.props(styles$1.body),
49
- children: [
50
- /* @__PURE__ */ jsxs(FlexBasic_default, {
51
- horizontal: true,
52
- align: "center",
53
- justify: "space-between",
54
- children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
55
- horizontal: true,
56
- align: "center",
57
- gap: 6,
58
- ...stylex.props(styles$1.copy),
59
- children: [/* @__PURE__ */ jsx(Text, {
60
- ellipsis: true,
61
- style: prominent ? textStyles.metricLabel : textStyles.label,
62
- children: label
63
- }), action]
64
- }), mark ? /* @__PURE__ */ jsx("span", {
65
- "aria-hidden": true,
66
- ...stylex.props(styles$1.badge),
67
- children: /* @__PURE__ */ jsx(Icon, {
68
- icon: mark,
69
- size: 14
70
- })
71
- }) : null]
72
- }),
73
- /* @__PURE__ */ jsx("div", {
74
- ...stylex.props(prominent ? styles$1.metricValue : styles$1.value),
75
- children: value
76
- }),
77
- delta || hint ? /* @__PURE__ */ jsxs(FlexBasic_default, {
78
- horizontal: true,
79
- align: "center",
80
- gap: 8,
81
- wrap: "wrap",
82
- ...stylex.props(prominent && styles$1.metricFoot),
83
- children: [delta ? /* @__PURE__ */ jsxs("span", {
84
- ...stylex.props(styles$1.delta, deltaStyles[direction]),
85
- children: [/* @__PURE__ */ jsx(Icon, {
86
- icon: deltaIcon[direction],
87
- size: 14
88
- }), delta]
89
- }) : null, hint ? /* @__PURE__ */ jsx(Text, {
90
- style: prominent ? textStyles.metricHint : textStyles.hint,
91
- children: hint
92
- }) : null]
93
- }) : null
94
- ]
95
- })
13
+ ...styleProps([
14
+ styles$1.card,
15
+ cardStyles,
16
+ styles.clip
17
+ ], className),
18
+ children: /* @__PURE__ */ jsx(MetricCell, {
19
+ renderLink,
20
+ item: {
21
+ action,
22
+ delta,
23
+ direction,
24
+ hint,
25
+ href,
26
+ label,
27
+ loading,
28
+ mark,
29
+ onClick,
30
+ value,
31
+ valueTone
32
+ }
96
33
  })
97
34
  });
98
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StatCard.mjs","names":["styles","Flexbox","surfaceStyles"],"sources":["../../../src/dashboard/StatCard/StatCard.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { Minus, TrendingDown, TrendingUp } from 'lucide-react';\n\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport Text from '@/Text';\n\nimport { styles as surfaceStyles } from '../Surface/style';\nimport { styles } from './style';\nimport type { StatCardProps, StatDirection } from './type';\n\nconst deltaIcon = {\n down: TrendingDown,\n flat: Minus,\n up: TrendingUp,\n} satisfies Record<StatDirection, typeof Minus>;\n\nconst deltaStyles = {\n down: styles.deltaDown,\n flat: styles.deltaFlat,\n up: styles.deltaUp,\n};\n\nconst textStyles = {\n hint: { color: cssVar.colorTextTertiary, fontSize: cssVar.fontSizeSM },\n label: { color: cssVar.colorTextSecondary, fontSize: cssVar.fontSizeSM },\n metricHint: { color: cssVar.colorText, fontSize: cssVar.fontSize },\n metricLabel: { color: cssVar.colorText, fontSize: cssVar.fontSize, fontWeight: 500 },\n};\n\nfunction StatCard({\n action,\n delta,\n direction = 'flat',\n hint,\n label,\n mark,\n prominent = false,\n value,\n wash,\n}: StatCardProps) {\n return (\n <div {...stylex.props(styles.lift)}>\n <Flexbox\n {...stylex.props(\n styles.root,\n surfaceStyles.card,\n wash && [styles.wash, styles[wash]],\n styles.frame,\n )}\n >\n <Flexbox gap={prominent ? 0 : 8} {...stylex.props(styles.body)}>\n <Flexbox horizontal align=\"center\" justify=\"space-between\">\n <Flexbox horizontal align=\"center\" gap={6} {...stylex.props(styles.copy)}>\n <Text ellipsis style={prominent ? textStyles.metricLabel : textStyles.label}>\n {label}\n </Text>\n {action}\n </Flexbox>\n {mark ? (\n <span aria-hidden {...stylex.props(styles.badge)}>\n <Icon icon={mark} size={14} />\n </span>\n ) : null}\n </Flexbox>\n <div {...stylex.props(prominent ? styles.metricValue : styles.value)}>{value}</div>\n {delta || hint ? (\n <Flexbox\n horizontal\n align=\"center\"\n gap={8}\n wrap=\"wrap\"\n {...stylex.props(prominent && styles.metricFoot)}\n >\n {delta ? (\n <span {...stylex.props(styles.delta, deltaStyles[direction])}>\n <Icon icon={deltaIcon[direction]} size={14} />\n {delta}\n </span>\n ) : null}\n {hint ? (\n <Text style={prominent ? textStyles.metricHint : textStyles.hint}>{hint}</Text>\n ) : null}\n </Flexbox>\n ) : null}\n </Flexbox>\n </Flexbox>\n </div>\n );\n}\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,YAAY;CAChB,MAAM;CACN,MAAM;CACN,IAAI;AACN;AACA,MAAM,cAAc;CAClB,MAAMA,SAAO;CACb,MAAMA,SAAO;CACb,IAAIA,SAAO;AACb;AACA,MAAM,aAAa;CACjB,MAAM;EACJ,OAAO,OAAO;EACd,UAAU,OAAO;CACnB;CACA,OAAO;EACL,OAAO,OAAO;EACd,UAAU,OAAO;CACnB;CACA,YAAY;EACV,OAAO,OAAO;EACd,UAAU,OAAO;CACnB;CACA,aAAa;EACX,OAAO,OAAO;EACd,UAAU,OAAO;EACjB,YAAY;CACd;AACF;AACA,SAAS,SAAS,EAChB,QACA,OACA,YAAY,QACZ,MACA,OACA,MACA,YAAY,OACZ,OACA,QACgB;CAChB,OAAO,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAMA,SAAO,IAAI;EACpC,UAAA,oBAACC,mBAAD;GAAS,GAAI,OAAO,MAAMD,SAAO,MAAME,OAAc,MAAM,QAAQ,CAACF,SAAO,MAAMA,SAAO,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.tsx"],"sourcesContent":["'use client';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport MetricCell from '../MetricStrip/MetricCell';\nimport { styles as metricStyles } from '../MetricStrip/style';\nimport { useSurfaceCardStyles } 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 cardStyles = useSurfaceCardStyles();\n\n return (\n <div {...styleProps([metricStyles.card, cardStyles, 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,aAAa,qBAAqB;CAExC,OACE,oBAAC,OAAD;EAAK,GAAI,WAAW;GAACA,SAAa;GAAM;GAAYC,OAAc;EAAI,GAAG,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
  export type StatDirection = 'up' | 'down' | 'flat';
6
- /** Top-to-bottom gray wash. Decorative color fields stay in the app. */
7
+ /** @deprecated StatCard renders as a MetricStrip item and no longer draws a wash. */
7
8
  export type StatWash = 'gray';
8
9
  export 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?: string;
14
+ delta?: ReactNode;
13
15
  direction?: StatDirection;
14
- /** Line under the figure. */
15
- hint?: string;
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
- /** Overview scale: label, then a large figure, then the note. */
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. Use it for panels that should read
5
- * above the page background without inventing a new surface color.
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, style, ...rest }: SurfaceProps): import("react").JSX.Element;
8
+ declare function Surface({ bleed, chart, children, className, description, extra, href, loading, padded, renderLink, style, title, ...rest }: SurfaceProps): import("react").JSX.Element;
8
9
  declare namespace Surface {
9
10
  var displayName: string;
10
11
  }
@@ -1,16 +1,99 @@
1
1
  "use client";
2
2
  import { styleProps } from "../../styles/stylex/props.mjs";
3
- import { styles } from "./style.mjs";
4
- import { jsx } from "react/jsx-runtime";
3
+ import Spin from "../../Spin/Spin.mjs";
4
+ import Skeleton from "../../Skeleton/index.mjs";
5
+ import { surfaceMarker } from "./marker.stylex.mjs";
6
+ import { styles, surfaceClassNames } from "./style.mjs";
7
+ import { SurfaceDepthContext, useSurfaceCardStyles, useSurfaceDepth, useSurfaceLink } from "./link.mjs";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import clsx from "clsx";
10
+ import * as stylex from "@stylexjs/stylex";
11
+ import { ArrowUpRight } from "lucide-react";
5
12
  //#region src/dashboard/Surface/Surface.tsx
13
+ const defined = (node) => node !== null && node !== void 0 && node !== false;
6
14
  /**
7
- * Elevated card on a workspace canvas. Use it for panels that should read
8
- * above the page background without inventing a new surface color.
15
+ * Elevated card on a workspace canvas. Bare, it is a plain frame. With `title`,
16
+ * `description` or `extra` it gets a header and a padded body that lets a
17
+ * trailing table meet the card edges.
9
18
  */
10
- function Surface({ className, style, ...rest }) {
11
- return /* @__PURE__ */ jsx("div", {
12
- ...styleProps(styles.card, className, style),
13
- ...rest
19
+ function Surface({ bleed = false, chart, children, className, description, extra, href, loading, padded, renderLink, style, title, ...rest }) {
20
+ const depth = useSurfaceDepth();
21
+ const link = useSurfaceLink(renderLink);
22
+ const cardStyles = useSurfaceCardStyles();
23
+ const refreshing = Boolean(loading) && defined(children);
24
+ const placeholder = Boolean(loading) && !defined(children);
25
+ const hasHeader = defined(title) || defined(description) || defined(extra) || refreshing;
26
+ const pad = bleed ? false : padded ?? (hasHeader || placeholder);
27
+ const clip = hasHeader || bleed || pad || defined(chart);
28
+ const heading = /* @__PURE__ */ jsxs("div", {
29
+ ...stylex.props(styles.heading),
30
+ children: [defined(title) ? /* @__PURE__ */ jsx("div", {
31
+ ...stylex.props(styles.title),
32
+ children: title
33
+ }) : null, defined(description) ? /* @__PURE__ */ jsx("div", {
34
+ ...stylex.props(styles.desc),
35
+ children: description
36
+ }) : null]
37
+ });
38
+ const body = placeholder ? /* @__PURE__ */ jsx("div", {
39
+ "aria-busy": "true",
40
+ ...stylex.props(styles.loading),
41
+ children: /* @__PURE__ */ jsx(Skeleton, {
42
+ height: 220,
43
+ radius: 8
44
+ })
45
+ }) : children;
46
+ const trailing = refreshing || defined(extra);
47
+ const arrow = /* @__PURE__ */ jsx(ArrowUpRight, {
48
+ "aria-hidden": true,
49
+ size: 16,
50
+ ...stylex.props(styles.arrow, trailing && styles.arrowInLink)
51
+ });
52
+ return /* @__PURE__ */ jsx(SurfaceDepthContext, {
53
+ value: depth + 1,
54
+ children: /* @__PURE__ */ jsxs("div", {
55
+ ...styleProps([
56
+ cardStyles,
57
+ styles.content,
58
+ clip && styles.clip,
59
+ Boolean(href) && [styles.cardLinked, surfaceMarker]
60
+ ], clsx(surfaceClassNames.root, bleed && surfaceClassNames.bleed, className), style),
61
+ ...rest,
62
+ children: [
63
+ hasHeader ? /* @__PURE__ */ jsxs("div", {
64
+ ...stylex.props(styles.header),
65
+ children: [href ? link({
66
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [heading, trailing ? null : arrow] }),
67
+ className: stylex.props(styles.headingLink).className,
68
+ href
69
+ }) : heading, trailing ? /* @__PURE__ */ jsxs("div", {
70
+ ...stylex.props(styles.extra),
71
+ children: [
72
+ refreshing ? /* @__PURE__ */ jsx(Spin, {
73
+ size: "small",
74
+ variant: "network"
75
+ }) : null,
76
+ extra,
77
+ href ? link({
78
+ "aria-hidden": true,
79
+ "children": arrow,
80
+ "className": stylex.props(styles.arrowLink).className,
81
+ href,
82
+ "tabIndex": -1
83
+ }) : null
84
+ ]
85
+ }) : null]
86
+ }) : null,
87
+ pad ? /* @__PURE__ */ jsx("div", {
88
+ ...styleProps(styles.body, surfaceClassNames.tableBleed),
89
+ children: body
90
+ }) : body,
91
+ defined(chart) ? /* @__PURE__ */ jsx("div", {
92
+ ...stylex.props(styles.chart),
93
+ children: chart
94
+ }) : null
95
+ ]
96
+ })
14
97
  });
15
98
  }
16
99
  Surface.displayName = "Surface";
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.mjs","names":[],"sources":["../../../src/dashboard/Surface/Surface.tsx"],"sourcesContent":["'use client';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { styles } from './style';\nimport type { SurfaceProps } from './type';\n\n/**\n * Elevated card on a workspace canvas. Use it for panels that should read\n * above the page background without inventing a new surface color.\n */\nfunction Surface({ className, style, ...rest }: SurfaceProps) {\n return <div {...styleProps(styles.card, className, style)} {...rest} />;\n}\n\nSurface.displayName = 'Surface';\n\nexport default Surface;\n"],"mappings":";;;;;;;;;AAWA,SAAS,QAAQ,EAAE,WAAW,OAAO,GAAG,QAAsB;CAC5D,OAAO,oBAAC,OAAD;EAAK,GAAI,WAAW,OAAO,MAAM,WAAW,KAAK;EAAG,GAAI;CAAO,CAAA;AACxE;AAEA,QAAQ,cAAc"}
1
+ {"version":3,"file":"Surface.mjs","names":[],"sources":["../../../src/dashboard/Surface/Surface.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { ArrowUpRight } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport Skeleton from '@/Skeleton';\nimport Spin from '@/Spin';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { SurfaceDepthContext, useSurfaceCardStyles, useSurfaceDepth, useSurfaceLink } from './link';\nimport { surfaceMarker } from './marker.stylex';\nimport { styles, surfaceClassNames } 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 style,\n title,\n ...rest\n}: SurfaceProps) {\n const depth = useSurfaceDepth();\n const link = useSurfaceLink(renderLink);\n const cardStyles = useSurfaceCardStyles();\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 {...stylex.props(styles.heading)}>\n {defined(title) ? <div {...stylex.props(styles.title)}>{title}</div> : null}\n {defined(description) ? <div {...stylex.props(styles.desc)}>{description}</div> : null}\n </div>\n );\n\n const body = placeholder ? (\n <div aria-busy=\"true\" {...stylex.props(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 = (\n <ArrowUpRight\n aria-hidden\n size={16}\n {...stylex.props(styles.arrow, trailing && styles.arrowInLink)}\n />\n );\n\n return (\n <SurfaceDepthContext value={depth + 1}>\n <div\n {...styleProps(\n [\n cardStyles,\n styles.content,\n clip && styles.clip,\n Boolean(href) && [styles.cardLinked, surfaceMarker],\n ],\n clsx(surfaceClassNames.root, bleed && surfaceClassNames.bleed, className),\n style,\n )}\n {...rest}\n >\n {hasHeader ? (\n <div {...stylex.props(styles.header)}>\n {href\n ? link({\n children: (\n <>\n {heading}\n {trailing ? null : arrow}\n </>\n ),\n className: stylex.props(styles.headingLink).className,\n href,\n })\n : heading}\n {trailing ? (\n <div {...stylex.props(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': stylex.props(styles.arrowLink).className,\n href,\n 'tabIndex': -1,\n } as any)\n : null}\n </div>\n ) : null}\n </div>\n ) : null}\n {pad ? <div {...styleProps(styles.body, surfaceClassNames.tableBleed)}>{body}</div> : body}\n {defined(chart) ? <div {...stylex.props(styles.chart)}>{chart}</div> : null}\n </div>\n </SurfaceDepthContext>\n );\n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,oBAAC,qBAAD;EAAqB,OAAO,QAAQ;EACvC,UAAA,qBAAC,OAAD;GAAK,GAAI,WAAW;IAAC;IAAY,OAAO;IAAS,QAAQ,OAAO;IAAM,QAAQ,IAAI,KAAK,CAAC,OAAO,YAAY,aAAa;GAAC,GAAG,KAAK,kBAAkB,MAAM,SAAS,kBAAkB,OAAO,SAAS,GAAG,KAAK;GAAG,GAAI;GAAnN,UAAA;IACG,YAAY,qBAAC,OAAD;KAAK,GAAI,OAAO,MAAM,OAAO,MAAM;KAAnC,UAAA,CACR,OAAO,KAAK;MACf,UAAU,qBAAA,UAAA,EAAA,UAAA,CACG,SACA,WAAW,OAAO,KACnB,EAAA,CAAA;MACZ,WAAW,OAAO,MAAM,OAAO,WAAW,CAAC,CAAC;MAC5C;KACF,CAAC,IAAI,SACA,WAAW,qBAAC,OAAD;MAAK,GAAI,OAAO,MAAM,OAAO,KAAK;MAAlC,UAAA;OACP,aAAa,oBAAC,MAAD;QAAM,MAAK;QAAQ,SAAQ;OAAW,CAAA,IAAI;OACvD;OACA,OAAO,KAAK;QACjB,eAAe;QACf,YAAY;QACZ,aAAa,OAAO,MAAM,OAAO,SAAS,CAAC,CAAC;QAC5C;QACA,YAAY;OACd,CAAQ,IAAI;MACH;KAAI,CAAA,IAAA,IACR;IAAI,CAAA,IAAA;IACV,MAAM,oBAAC,OAAD;KAAK,GAAI,WAAW,OAAO,MAAM,kBAAkB,UAAU;KAAI,UAAA;IAAU,CAAA,IAAI;IACrF,QAAQ,KAAK,IAAI,oBAAC,OAAD;KAAK,GAAI,OAAO,MAAM,OAAO,KAAK;KAAI,UAAA;IAAW,CAAA,IAAI;GACpE;;CACc,CAAA;AACzB;AACA,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 { surfaceStyles } from "./style.mjs";
2
- import { SurfaceProps } from "./type.mjs";
3
4
  import Surface from "./Surface.mjs";
4
- export { type SurfaceProps, Surface as default, surfaceStyles };
5
+ export { type SurfaceLinkProps, SurfaceLinkProvider, type SurfaceProps, type SurfaceRenderLink, Surface as default, surfaceStyles, useSurfaceCardClassName, useSurfaceDepth, useSurfaceLink };
@@ -0,0 +1,16 @@
1
+ import { SurfaceRenderLink } from "./type.mjs";
2
+ import { ReactNode } from "react";
3
+ import "@stylexjs/stylex";
4
+ //#region src/dashboard/Surface/link.d.ts
5
+ /** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */
6
+ export declare const SurfaceLinkProvider: ({ children, renderLink }: {
7
+ children?: ReactNode;
8
+ renderLink: SurfaceRenderLink;
9
+ }) => import("react").JSX.Element;
10
+ export declare const useSurfaceLink: (override?: SurfaceRenderLink) => SurfaceRenderLink;
11
+ /** How many Surface cards wrap this node. A table can skip its own card when already inside one. */
12
+ export declare const useSurfaceDepth: () => number;
13
+ /** Class name form of `useSurfaceCardStyles`, for markup that is not styled with StyleX. */
14
+ export declare const useSurfaceCardClassName: () => string;
15
+ //#endregion
16
+ //# sourceMappingURL=link.d.mts.map
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { useThemeMode } from "../../styles/theme/scope.mjs";
3
+ import { styles } from "./style.mjs";
4
+ import { createContext, use } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import * as stylex from "@stylexjs/stylex";
7
+ //#region src/dashboard/Surface/link.tsx
8
+ const defaultRenderLink = ({ children, ...rest }) => /* @__PURE__ */ jsx("a", {
9
+ ...rest,
10
+ children
11
+ });
12
+ const SurfaceLinkContext = createContext(defaultRenderLink);
13
+ const SurfaceDepthContext = createContext(0);
14
+ /** Plugs the app router into every dashboard card link (Surface, MetricStrip, Section). */
15
+ const SurfaceLinkProvider = ({ children, renderLink }) => /* @__PURE__ */ jsx(SurfaceLinkContext, {
16
+ value: renderLink,
17
+ children
18
+ });
19
+ const useSurfaceLink = (override) => override ?? use(SurfaceLinkContext);
20
+ /** How many Surface cards wrap this node. A table can skip its own card when already inside one. */
21
+ const useSurfaceDepth = () => use(SurfaceDepthContext);
22
+ /**
23
+ * StyleX styles for a dashboard card: `colorBgContainer` in light, translucent
24
+ * `colorFillTertiary` in dark, and no fill of its own when nested in another Surface.
25
+ */
26
+ const useSurfaceCardStyles = () => {
27
+ const { isDarkMode } = useThemeMode();
28
+ const depth = useSurfaceDepth();
29
+ return [
30
+ styles.card,
31
+ isDarkMode && styles.cardDark,
32
+ depth > 0 && styles.cardNested
33
+ ];
34
+ };
35
+ /** Class name form of `useSurfaceCardStyles`, for markup that is not styled with StyleX. */
36
+ const useSurfaceCardClassName = () => stylex.props(useSurfaceCardStyles()).className ?? "";
37
+ //#endregion
38
+ export { SurfaceDepthContext, SurfaceLinkProvider, useSurfaceCardClassName, useSurfaceCardStyles, useSurfaceDepth, useSurfaceLink };
39
+
40
+ //# 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 * as stylex from '@stylexjs/stylex';\nimport { createContext, type ReactNode, use } from 'react';\n\nimport { useThemeMode } from '@/styles/theme/scope';\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 * StyleX styles for a dashboard card: `colorBgContainer` in light, translucent\n * `colorFillTertiary` in dark, and no fill of its own when nested in another Surface.\n */\nexport const useSurfaceCardStyles = () => {\n const { isDarkMode } = useThemeMode();\n const depth = useSurfaceDepth();\n return [styles.card, isDarkMode && styles.cardDark, depth > 0 && styles.cardNested] as const;\n};\n\n/** Class name form of `useSurfaceCardStyles`, for markup that is not styled with StyleX. */\nexport const useSurfaceCardClassName = () => stylex.props(useSurfaceCardStyles()).className ?? '';\n"],"mappings":";;;;;;;AAOA,MAAM,qBAAwC,EAC5C,UACA,GAAG,WACmB,oBAAC,KAAD;CAAG,GAAI;CAAO;AAAY,CAAA;AAClD,MAAM,qBAAqB,cAAiC,iBAAiB;AAC7E,MAAM,sBAAsB,cAAc,CAAC;;AAG3C,MAAa,uBAAuB,EAClC,UACA,iBAII,oBAAC,oBAAD;CAAoB,OAAO;CAAa;AAA6B,CAAA;AAC3E,MAAa,kBAAkB,aAAiC,YAAY,IAAI,kBAAkB;;AAGlG,MAAa,wBAAwB,IAAI,mBAAmB;;;;;AAO5D,MAAa,6BAA6B;CACxC,MAAM,EACJ,eACE,aAAa;CACjB,MAAM,QAAQ,gBAAgB;CAC9B,OAAO;EAAC,OAAO;EAAM,cAAc,OAAO;EAAU,QAAQ,KAAK,OAAO;CAAU;AACpF;;AAGA,MAAa,gCAAgC,OAAO,MAAM,qBAAqB,CAAC,CAAC,CAAC,aAAa"}
@@ -0,0 +1,9 @@
1
+ //#region src/dashboard/Surface/marker.stylex.ts
2
+ const surfaceMarker = {
3
+ lbbfx20b: "lbbfx20b",
4
+ $$css: true
5
+ };
6
+ //#endregion
7
+ export { surfaceMarker };
8
+
9
+ //# sourceMappingURL=marker.stylex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker.stylex.mjs","names":[],"sources":["../../../src/dashboard/Surface/marker.stylex.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nexport const surfaceMarker = stylex.defineMarker();\n"],"mappings":";AACA,MAAa,gBAAgB;CAC3B,UAAU;CACV,OAAO;AACT"}
@@ -2,6 +2,8 @@ import "@stylexjs/stylex";
2
2
  //#region src/dashboard/Surface/style.d.ts
3
3
  export declare const surfaceStyles: {
4
4
  card: string;
5
+ clip: string;
6
+ tableBleed: string;
5
7
  };
6
8
  //#endregion
7
9
  //# sourceMappingURL=style.d.mts.map