@lobehub/ui 5.48.2 → 5.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Highlighter/FullFeatured.mjs +1 -1
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/LangSelect.mjs +1 -1
- package/es/Highlighter/LangSelect.mjs.map +1 -1
- package/es/Highlighter/style.mjs +14 -11
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/Mermaid/FullFeatured.mjs +1 -1
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/awesome/AgentSkillCard/AgentSkillCard.d.mts +6 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs +83 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/agents.d.mts +6 -0
- package/es/awesome/AgentSkillCard/agents.mjs +40 -0
- package/es/awesome/AgentSkillCard/agents.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/index.d.mts +4 -0
- package/es/awesome/AgentSkillCard/style.mjs +85 -0
- package/es/awesome/AgentSkillCard/style.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/type.d.mts +41 -0
- package/es/awesome/BentoGrid/BentoCard.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoCard.mjs +39 -0
- package/es/awesome/BentoGrid/BentoCard.mjs.map +1 -0
- package/es/awesome/BentoGrid/BentoGrid.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs +20 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs.map +1 -0
- package/es/awesome/BentoGrid/index.d.mts +4 -0
- package/es/awesome/BentoGrid/style.mjs +102 -0
- package/es/awesome/BentoGrid/style.mjs.map +1 -0
- package/es/awesome/BentoGrid/type.d.mts +40 -0
- package/es/awesome/CodeShowcase/CodeShowcase.d.mts +6 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs +51 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs.map +1 -0
- package/es/awesome/CodeShowcase/index.d.mts +3 -0
- package/es/awesome/CodeShowcase/style.mjs +50 -0
- package/es/awesome/CodeShowcase/style.mjs.map +1 -0
- package/es/awesome/CodeShowcase/type.d.mts +27 -0
- package/es/awesome/FeatureGrid/FeatureGrid.d.mts +6 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs +48 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs.map +1 -0
- package/es/awesome/FeatureGrid/index.d.mts +3 -0
- package/es/awesome/FeatureGrid/style.mjs +75 -0
- package/es/awesome/FeatureGrid/style.mjs.map +1 -0
- package/es/awesome/FeatureGrid/type.d.mts +25 -0
- package/es/awesome/FluidGradient/FluidGradient.d.mts +6 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs +293 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs.map +1 -0
- package/es/awesome/FluidGradient/index.d.mts +3 -0
- package/es/awesome/FluidGradient/style.mjs +52 -0
- package/es/awesome/FluidGradient/style.mjs.map +1 -0
- package/es/awesome/FluidGradient/type.d.mts +22 -0
- package/es/awesome/InstallBanner/InstallBanner.d.mts +6 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs +35 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs.map +1 -0
- package/es/awesome/InstallBanner/index.d.mts +3 -0
- package/es/awesome/InstallBanner/style.mjs +46 -0
- package/es/awesome/InstallBanner/style.mjs.map +1 -0
- package/es/awesome/InstallBanner/type.d.mts +18 -0
- package/es/awesome/LandingHero/LandingHero.d.mts +6 -0
- package/es/awesome/LandingHero/LandingHero.mjs +55 -0
- package/es/awesome/LandingHero/LandingHero.mjs.map +1 -0
- package/es/awesome/LandingHero/index.d.mts +3 -0
- package/es/awesome/LandingHero/style.mjs +155 -0
- package/es/awesome/LandingHero/style.mjs.map +1 -0
- package/es/awesome/LandingHero/type.d.mts +29 -0
- package/es/awesome/LandingSection/LandingSection.d.mts +6 -0
- package/es/awesome/LandingSection/LandingSection.mjs +61 -0
- package/es/awesome/LandingSection/LandingSection.mjs.map +1 -0
- package/es/awesome/LandingSection/index.d.mts +3 -0
- package/es/awesome/LandingSection/style.mjs +88 -0
- package/es/awesome/LandingSection/style.mjs.map +1 -0
- package/es/awesome/LandingSection/type.d.mts +40 -0
- package/es/awesome/LogoMarquee/LogoMarquee.d.mts +6 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs +52 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs.map +1 -0
- package/es/awesome/LogoMarquee/index.d.mts +3 -0
- package/es/awesome/LogoMarquee/style.mjs +70 -0
- package/es/awesome/LogoMarquee/style.mjs.map +1 -0
- package/es/awesome/LogoMarquee/type.d.mts +40 -0
- package/es/awesome/index.d.mts +33 -1
- package/es/awesome/index.mjs +13 -1
- package/es/awesome/landingActions.d.mts +20 -0
- package/es/awesome/landingActions.mjs +123 -0
- package/es/awesome/landingActions.mjs.map +1 -0
- package/es/awesome/landingIcon.mjs +13 -0
- package/es/awesome/landingIcon.mjs.map +1 -0
- package/es/awesome/landingLink.d.mts +12 -0
- package/es/awesome/landingLink.mjs +23 -0
- package/es/awesome/landingLink.mjs.map +1 -0
- package/es/awesome/landingTokens.d.mts +10 -0
- package/es/awesome/landingTokens.mjs +19 -0
- package/es/awesome/landingTokens.mjs.map +1 -0
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/Segmented/atoms.mjs +1 -0
- package/es/base-ui/Segmented/atoms.mjs.map +1 -1
- package/es/base-ui/Segmented/style.mjs +127 -125
- package/es/base-ui/Segmented/style.mjs.map +1 -1
- package/es/base-ui/index.mjs +4 -4
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +9 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs +54 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -0
- package/es/dashboard/AuthLayout/index.d.mts +3 -0
- package/es/dashboard/AuthLayout/style.mjs +120 -0
- package/es/dashboard/AuthLayout/style.mjs.map +1 -0
- package/es/dashboard/AuthLayout/type.d.mts +16 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.d.mts +9 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs +55 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/index.d.mts +3 -0
- package/es/dashboard/Breadcrumb/style.mjs +66 -0
- package/es/dashboard/Breadcrumb/style.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/type.d.mts +25 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.d.mts +9 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +275 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/active.d.mts +7 -0
- package/es/dashboard/ConsoleNav/active.mjs +29 -0
- package/es/dashboard/ConsoleNav/active.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +4 -0
- package/es/dashboard/ConsoleNav/style.mjs +283 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/type.d.mts +71 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs +37 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +149 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/context.d.mts +6 -0
- package/es/dashboard/ConsoleShell/context.mjs +16 -0
- package/es/dashboard/ConsoleShell/context.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/index.d.mts +5 -0
- package/es/dashboard/ConsoleShell/style.mjs +209 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/type.d.mts +67 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.d.mts +17 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +151 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/context.d.mts +7 -0
- package/es/dashboard/FilterSidebar/context.mjs +19 -0
- package/es/dashboard/FilterSidebar/context.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/index.d.mts +4 -0
- package/es/dashboard/FilterSidebar/style.mjs +155 -0
- package/es/dashboard/FilterSidebar/style.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/type.d.mts +44 -0
- package/es/dashboard/FilterSidebar/width.mjs +18 -0
- package/es/dashboard/FilterSidebar/width.mjs.map +1 -0
- package/es/dashboard/PageHeader/PageHeader.d.mts +9 -0
- package/es/dashboard/PageHeader/PageHeader.mjs +37 -0
- package/es/dashboard/PageHeader/PageHeader.mjs.map +1 -0
- package/es/dashboard/PageHeader/index.d.mts +3 -0
- package/es/dashboard/PageHeader/style.mjs +47 -0
- package/es/dashboard/PageHeader/style.mjs.map +1 -0
- package/es/dashboard/PageHeader/type.d.mts +14 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.d.mts +25 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +136 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/style.mjs +122 -0
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/type.d.mts +22 -0
- package/es/dashboard/PageTabs/PageTabs.d.mts +9 -0
- package/es/dashboard/PageTabs/PageTabs.mjs +37 -0
- package/es/dashboard/PageTabs/PageTabs.mjs.map +1 -0
- package/es/dashboard/PageTabs/index.d.mts +3 -0
- package/es/dashboard/PageTabs/style.mjs +57 -0
- package/es/dashboard/PageTabs/style.mjs.map +1 -0
- package/es/dashboard/PageTabs/type.d.mts +17 -0
- package/es/dashboard/RouteProgress/RouteProgress.d.mts +9 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs +44 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs.map +1 -0
- package/es/dashboard/RouteProgress/style.mjs +19 -0
- package/es/dashboard/RouteProgress/style.mjs.map +1 -0
- package/es/dashboard/RouteProgress/type.d.mts +8 -0
- package/es/dashboard/StatCard/StatCard.d.mts +9 -0
- package/es/dashboard/StatCard/StatCard.mjs +84 -0
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -0
- package/es/dashboard/StatCard/index.d.mts +3 -0
- package/es/dashboard/StatCard/style.mjs +135 -0
- package/es/dashboard/StatCard/style.mjs.map +1 -0
- package/es/dashboard/StatCard/type.d.mts +26 -0
- package/es/dashboard/Surface/Surface.d.mts +13 -0
- package/es/dashboard/Surface/Surface.mjs +20 -0
- package/es/dashboard/Surface/Surface.mjs.map +1 -0
- package/es/dashboard/Surface/index.d.mts +4 -0
- package/es/dashboard/Surface/style.d.mts +14 -0
- package/es/dashboard/Surface/style.mjs +22 -0
- package/es/dashboard/Surface/style.mjs.map +1 -0
- package/es/dashboard/Surface/type.d.mts +8 -0
- package/es/dashboard/hooks.mjs +49 -0
- package/es/dashboard/hooks.mjs.map +1 -0
- package/es/dashboard/index.d.mts +37 -0
- package/es/dashboard/index.d.ts +1 -0
- package/es/dashboard/index.js +1 -0
- package/es/dashboard/index.mjs +17 -0
- package/es/static-css/registry.mjs +2 -2
- package/es/static-css/registry.mjs.map +1 -1
- package/es/storybook/StoryBook/index.mjs +4 -0
- package/es/storybook/StoryBook/index.mjs.map +1 -1
- package/es/storybook/StoryBook/style.mjs +7 -2
- package/es/storybook/StoryBook/style.mjs.map +1 -1
- package/es/styles/theme/token/base.mjs +2 -2
- package/es/styles/theme/token/base.mjs.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Button from "../../base-ui/Button/Button.mjs";
|
|
3
|
+
import DraggablePanel from "../../base-ui/DraggablePanel/DraggablePanel.mjs";
|
|
4
|
+
import Drawer from "../../base-ui/Drawer/Drawer.mjs";
|
|
5
|
+
import { styles } from "../Surface/style.mjs";
|
|
6
|
+
import { useIsCompact, useLocalStorage } from "../hooks.mjs";
|
|
7
|
+
import { FilterSplitProvider } from "./context.mjs";
|
|
8
|
+
import { styles as styles$1 } from "./style.mjs";
|
|
9
|
+
import { clampSidebarWidth, sidebarWidth } from "./width.mjs";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Filter } from "lucide-react";
|
|
13
|
+
//#region src/dashboard/FilterSidebar/FilterSidebar.tsx
|
|
14
|
+
function usePageSidebar(wide, storageKey) {
|
|
15
|
+
const fallback = wide ? sidebarWidth.wide : sidebarWidth.narrow;
|
|
16
|
+
const [prefs, setPrefs] = useLocalStorage(storageKey, {
|
|
17
|
+
expand: true,
|
|
18
|
+
width: fallback
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
expand: prefs.expand !== false,
|
|
22
|
+
onExpandChange: (expand) => setPrefs((current) => ({
|
|
23
|
+
...current,
|
|
24
|
+
expand
|
|
25
|
+
})),
|
|
26
|
+
onSizeChange: (size) => {
|
|
27
|
+
const next = typeof size.width === "number" ? size.width : fallback;
|
|
28
|
+
setPrefs((current) => ({
|
|
29
|
+
...current,
|
|
30
|
+
width: clampSidebarWidth(next, fallback)
|
|
31
|
+
}));
|
|
32
|
+
},
|
|
33
|
+
width: clampSidebarWidth(Number(prefs.width), fallback)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function FilterSidebar({ body, children, flush, head, header, label, storageKey, summary, wide }) {
|
|
37
|
+
const isCompact = useIsCompact();
|
|
38
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
39
|
+
const sidebar = usePageSidebar(wide, storageKey);
|
|
40
|
+
const close = () => setDrawerOpen(false);
|
|
41
|
+
if (isCompact) return /* @__PURE__ */ jsx(FilterSplitProvider, {
|
|
42
|
+
active: !flush,
|
|
43
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: styles$1.layout,
|
|
45
|
+
children: [
|
|
46
|
+
header,
|
|
47
|
+
/* @__PURE__ */ jsx(Button, {
|
|
48
|
+
block: true,
|
|
49
|
+
icon: Filter,
|
|
50
|
+
onClick: () => setDrawerOpen(true),
|
|
51
|
+
children: summary
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx(Drawer, {
|
|
54
|
+
open: drawerOpen,
|
|
55
|
+
placement: "left",
|
|
56
|
+
title: label,
|
|
57
|
+
width: 300,
|
|
58
|
+
onClose: close,
|
|
59
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: styles$1.drawerPanel,
|
|
61
|
+
children: [head?.(close), body(close)]
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: styles$1.content,
|
|
66
|
+
children
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ jsx(FilterSplitProvider, {
|
|
72
|
+
active: !flush,
|
|
73
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: flush ? styles$1.layout : `${styles$1.layout} ${styles.card}`,
|
|
75
|
+
"data-flush": flush ? true : void 0,
|
|
76
|
+
"data-page-layout": flush ? "flush" : void 0,
|
|
77
|
+
"data-split-card": flush ? void 0 : true,
|
|
78
|
+
children: [/* @__PURE__ */ jsxs(DraggablePanel, {
|
|
79
|
+
expandable: true,
|
|
80
|
+
showHandleWhenCollapsed: true,
|
|
81
|
+
"aria-label": label,
|
|
82
|
+
className: styles$1.sidebar,
|
|
83
|
+
classNames: { content: styles$1.panel },
|
|
84
|
+
collapseThreshold: sidebarWidth.collapse,
|
|
85
|
+
"data-flush": flush ? true : void 0,
|
|
86
|
+
defaultSize: { width: wide ? sidebarWidth.wide : sidebarWidth.narrow },
|
|
87
|
+
expand: sidebar.expand,
|
|
88
|
+
maxWidth: sidebarWidth.max,
|
|
89
|
+
minWidth: sidebarWidth.min,
|
|
90
|
+
mode: "fixed",
|
|
91
|
+
placement: "left",
|
|
92
|
+
showBorder: false,
|
|
93
|
+
size: { width: sidebar.width },
|
|
94
|
+
onExpandChange: sidebar.onExpandChange,
|
|
95
|
+
onSizeChange: (_delta, size) => sidebar.onSizeChange(size),
|
|
96
|
+
children: [head ? /* @__PURE__ */ jsx("div", {
|
|
97
|
+
className: styles$1.head,
|
|
98
|
+
children: head(close)
|
|
99
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: styles$1.body,
|
|
101
|
+
"data-flush": flush ? true : void 0,
|
|
102
|
+
children: body(close)
|
|
103
|
+
})]
|
|
104
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: styles$1.content,
|
|
106
|
+
"data-flush": flush ? true : void 0,
|
|
107
|
+
children: [header, children]
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
FilterSidebar.displayName = "FilterSidebar";
|
|
113
|
+
function FilterRow({ count, name }) {
|
|
114
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
115
|
+
className: styles$1.row,
|
|
116
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: styles$1.name,
|
|
118
|
+
children: name
|
|
119
|
+
}), count !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
120
|
+
className: styles$1.count,
|
|
121
|
+
children: count
|
|
122
|
+
}) : null]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
FilterRow.displayName = "FilterRow";
|
|
126
|
+
function FilterOption({ count, icon, label, name, onClick, selected, title }) {
|
|
127
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
128
|
+
"aria-label": label,
|
|
129
|
+
"aria-pressed": selected,
|
|
130
|
+
className: styles$1.option,
|
|
131
|
+
title,
|
|
132
|
+
type: "button",
|
|
133
|
+
onClick,
|
|
134
|
+
children: [
|
|
135
|
+
icon,
|
|
136
|
+
/* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: styles$1.name,
|
|
138
|
+
children: name
|
|
139
|
+
}),
|
|
140
|
+
count !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
141
|
+
className: styles$1.count,
|
|
142
|
+
children: count
|
|
143
|
+
}) : null
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
FilterOption.displayName = "FilterOption";
|
|
148
|
+
//#endregion
|
|
149
|
+
export { FilterOption, FilterRow, FilterSidebar as default };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=FilterSidebar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSidebar.mjs","names":["styles","surfaceStyles"],"sources":["../../../src/dashboard/FilterSidebar/FilterSidebar.tsx"],"sourcesContent":["'use client';\n\nimport { Filter } from 'lucide-react';\nimport { useState } from 'react';\n\nimport Button from '@/base-ui/Button';\nimport { DraggablePanel } from '@/base-ui/DraggablePanel';\nimport { Drawer } from '@/base-ui/Drawer';\n\nimport { useIsCompact, useLocalStorage } from '../hooks';\nimport { styles as surfaceStyles } from '../Surface/style';\nimport { FilterSplitProvider } from './context';\nimport { styles } from './style';\nimport type { FilterOptionProps, FilterRowProps, FilterSidebarProps } from './type';\nimport { clampSidebarWidth, sidebarWidth } from './width';\n\nfunction usePageSidebar(wide: boolean | undefined, storageKey: string | undefined) {\n const fallback = wide ? sidebarWidth.wide : sidebarWidth.narrow;\n const [prefs, setPrefs] = useLocalStorage<{ expand?: boolean; width?: number }>(storageKey, {\n expand: true,\n width: fallback,\n });\n return {\n expand: prefs.expand !== false,\n onExpandChange: (expand: boolean) => setPrefs((current) => ({ ...current, expand })),\n onSizeChange: (size: { width?: number | string }) => {\n const next = typeof size.width === 'number' ? size.width : fallback;\n setPrefs((current) => ({ ...current, width: clampSidebarWidth(next, fallback) }));\n },\n width: clampSidebarWidth(Number(prefs.width), fallback),\n };\n}\n\nfunction FilterSidebar({\n body,\n children,\n flush,\n head,\n header,\n label,\n storageKey,\n summary,\n wide,\n}: FilterSidebarProps) {\n const isCompact = useIsCompact();\n const [drawerOpen, setDrawerOpen] = useState(false);\n const sidebar = usePageSidebar(wide, storageKey);\n const close = () => setDrawerOpen(false);\n\n if (isCompact) {\n return (\n <FilterSplitProvider active={!flush}>\n <div className={styles.layout}>\n {header}\n <Button block icon={Filter} onClick={() => setDrawerOpen(true)}>\n {summary}\n </Button>\n <Drawer open={drawerOpen} placement=\"left\" title={label} width={300} onClose={close}>\n <div className={styles.drawerPanel}>\n {head?.(close)}\n {body(close)}\n </div>\n </Drawer>\n <div className={styles.content}>{children}</div>\n </div>\n </FilterSplitProvider>\n );\n }\n\n return (\n <FilterSplitProvider active={!flush}>\n <div\n className={flush ? styles.layout : `${styles.layout} ${surfaceStyles.card}`}\n data-flush={flush ? true : undefined}\n data-page-layout={flush ? 'flush' : undefined}\n data-split-card={flush ? undefined : true}\n >\n <DraggablePanel\n expandable\n showHandleWhenCollapsed\n aria-label={label}\n className={styles.sidebar}\n classNames={{ content: styles.panel }}\n collapseThreshold={sidebarWidth.collapse}\n data-flush={flush ? true : undefined}\n defaultSize={{ width: wide ? sidebarWidth.wide : sidebarWidth.narrow }}\n expand={sidebar.expand}\n maxWidth={sidebarWidth.max}\n minWidth={sidebarWidth.min}\n mode=\"fixed\"\n placement=\"left\"\n showBorder={false}\n size={{ width: sidebar.width }}\n onExpandChange={sidebar.onExpandChange}\n onSizeChange={(_delta, size) => sidebar.onSizeChange(size)}\n >\n {head ? <div className={styles.head}>{head(close)}</div> : null}\n <div className={styles.body} data-flush={flush ? true : undefined}>\n {body(close)}\n </div>\n </DraggablePanel>\n <div className={styles.content} data-flush={flush ? true : undefined}>\n {header}\n {children}\n </div>\n </div>\n </FilterSplitProvider>\n );\n}\n\nFilterSidebar.displayName = 'FilterSidebar';\n\nfunction FilterRow({ count, name }: FilterRowProps) {\n return (\n <span className={styles.row}>\n <span className={styles.name}>{name}</span>\n {count !== undefined ? <span className={styles.count}>{count}</span> : null}\n </span>\n );\n}\n\nFilterRow.displayName = 'FilterRow';\n\nfunction FilterOption({ count, icon, label, name, onClick, selected, title }: FilterOptionProps) {\n return (\n <button\n aria-label={label}\n aria-pressed={selected}\n className={styles.option}\n title={title}\n type=\"button\"\n onClick={onClick}\n >\n {icon}\n <span className={styles.name}>{name}</span>\n {count !== undefined ? <span className={styles.count}>{count}</span> : null}\n </button>\n );\n}\n\nFilterOption.displayName = 'FilterOption';\n\nexport { FilterOption, FilterRow };\nexport default FilterSidebar;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/FilterSidebar/context.d.ts
|
|
3
|
+
/** True when this content sits in a filter split that is itself the card. */
|
|
4
|
+
declare function useInFilterSplit(): boolean;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { useInFilterSplit };
|
|
7
|
+
//# sourceMappingURL=context.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/dashboard/FilterSidebar/context.tsx
|
|
5
|
+
const FilterSplitContext = createContext(false);
|
|
6
|
+
function FilterSplitProvider({ active, children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(FilterSplitContext, {
|
|
8
|
+
value: active,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** True when this content sits in a filter split that is itself the card. */
|
|
13
|
+
function useInFilterSplit() {
|
|
14
|
+
return use(FilterSplitContext);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FilterSplitProvider, useInFilterSplit };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/dashboard/FilterSidebar/context.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext, use } from 'react';\n\nconst FilterSplitContext = createContext(false);\n\nexport function FilterSplitProvider({\n active,\n children,\n}: {\n active: boolean;\n children: ReactNode;\n}) {\n return <FilterSplitContext value={active}>{children}</FilterSplitContext>;\n}\n\n/** True when this content sits in a filter split that is itself the card. */\nexport function useInFilterSplit() {\n return use(FilterSplitContext);\n}\n"],"mappings":";;;;AAKA,MAAM,qBAAqB,cAAc,KAAK;AAE9C,SAAgB,oBAAoB,EAClC,QACA,YAIC;CACD,OAAO,oBAAC,oBAAD;EAAoB,OAAO;EAAS;CAA6B,CAAA;AAC1E;;AAGA,SAAgB,mBAAmB;CACjC,OAAO,IAAI,kBAAkB;AAC/B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { useInFilterSplit } from "./context.mjs";
|
|
2
|
+
import { FilterOptionProps, FilterRowProps, FilterSidebarProps } from "./type.mjs";
|
|
3
|
+
import FilterSidebar, { FilterOption, FilterRow } from "./FilterSidebar.mjs";
|
|
4
|
+
export { FilterOption, type FilterOptionProps, FilterRow, type FilterRowProps, type FilterSidebarProps, FilterSidebar as default, useInFilterSplit };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/FilterSidebar/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar, responsive }) => ({
|
|
4
|
+
body: css`
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
max-block-size: 360px;
|
|
7
|
+
padding-block-end: 16px;
|
|
8
|
+
padding-inline: 12px;
|
|
9
|
+
|
|
10
|
+
&[data-flush='true'] {
|
|
11
|
+
flex: 1;
|
|
12
|
+
min-block-size: 0;
|
|
13
|
+
max-block-size: none;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
content: css`
|
|
17
|
+
display: flex;
|
|
18
|
+
flex: 1;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 16px;
|
|
21
|
+
|
|
22
|
+
min-inline-size: 0;
|
|
23
|
+
padding-inline-start: 20px;
|
|
24
|
+
|
|
25
|
+
&[data-flush='true'] {
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
padding: 24px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[data-split-card='true'] & {
|
|
31
|
+
padding-block: 16px 0;
|
|
32
|
+
padding-inline: 16px;
|
|
33
|
+
|
|
34
|
+
> :last-child {
|
|
35
|
+
margin-inline: -16px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
${responsive.laptop} {
|
|
40
|
+
overflow: visible;
|
|
41
|
+
padding: 0;
|
|
42
|
+
|
|
43
|
+
> :last-child {
|
|
44
|
+
margin-inline: 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
count: css`
|
|
49
|
+
flex: none;
|
|
50
|
+
font-size: ${cssVar.fontSizeSM};
|
|
51
|
+
font-variant-numeric: tabular-nums;
|
|
52
|
+
color: ${cssVar.colorTextTertiary};
|
|
53
|
+
`,
|
|
54
|
+
drawerPanel: css`
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
`,
|
|
59
|
+
head: css`
|
|
60
|
+
display: flex;
|
|
61
|
+
flex: none;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
|
|
65
|
+
padding: 12px;
|
|
66
|
+
`,
|
|
67
|
+
layout: css`
|
|
68
|
+
display: flex;
|
|
69
|
+
|
|
70
|
+
&[data-flush='true'] {
|
|
71
|
+
flex: 1;
|
|
72
|
+
min-block-size: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[data-split-card='true'] {
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
align-items: stretch;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
${responsive.laptop} {
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: 12px;
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
name: css`
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
flex: 1;
|
|
88
|
+
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
|
|
91
|
+
text-align: start;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
`,
|
|
95
|
+
option: css`
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
|
|
98
|
+
display: flex;
|
|
99
|
+
gap: 6px;
|
|
100
|
+
align-items: center;
|
|
101
|
+
|
|
102
|
+
inline-size: 100%;
|
|
103
|
+
min-block-size: 36px;
|
|
104
|
+
padding-inline: 8px;
|
|
105
|
+
border: none;
|
|
106
|
+
border-radius: ${cssVar.borderRadius};
|
|
107
|
+
|
|
108
|
+
font: inherit;
|
|
109
|
+
color: ${cssVar.colorText};
|
|
110
|
+
|
|
111
|
+
background: none;
|
|
112
|
+
|
|
113
|
+
&:hover {
|
|
114
|
+
background: ${cssVar.colorFillTertiary};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&[aria-pressed='true'] {
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
background: ${cssVar.controlItemBgActive};
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
row: css`
|
|
123
|
+
display: flex;
|
|
124
|
+
flex: 1;
|
|
125
|
+
gap: 6px;
|
|
126
|
+
align-items: center;
|
|
127
|
+
|
|
128
|
+
min-inline-size: 0;
|
|
129
|
+
`,
|
|
130
|
+
panel: css`
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
|
|
135
|
+
min-block-size: 0;
|
|
136
|
+
border-inline-end: 1px solid ${cssVar.colorBorderSecondary};
|
|
137
|
+
|
|
138
|
+
[data-split-card='true'] & {
|
|
139
|
+
block-size: 100%;
|
|
140
|
+
border-inline-end-color: ${cssVar.colorBorder};
|
|
141
|
+
}
|
|
142
|
+
`,
|
|
143
|
+
sidebar: css`
|
|
144
|
+
align-self: stretch;
|
|
145
|
+
min-block-size: 0;
|
|
146
|
+
|
|
147
|
+
&[data-flush='true'] {
|
|
148
|
+
block-size: 100%;
|
|
149
|
+
}
|
|
150
|
+
`
|
|
151
|
+
}));
|
|
152
|
+
//#endregion
|
|
153
|
+
export { styles };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/FilterSidebar/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar, responsive }) => ({\n body: css`\n overflow-y: auto;\n max-block-size: 360px;\n padding-block-end: 16px;\n padding-inline: 12px;\n\n &[data-flush='true'] {\n flex: 1;\n min-block-size: 0;\n max-block-size: none;\n }\n `,\n content: css`\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: 16px;\n\n min-inline-size: 0;\n padding-inline-start: 20px;\n\n &[data-flush='true'] {\n overflow-y: auto;\n padding: 24px;\n }\n\n [data-split-card='true'] & {\n padding-block: 16px 0;\n padding-inline: 16px;\n\n > :last-child {\n margin-inline: -16px;\n }\n }\n\n ${responsive.laptop} {\n overflow: visible;\n padding: 0;\n\n > :last-child {\n margin-inline: 0;\n }\n }\n `,\n count: css`\n flex: none;\n font-size: ${cssVar.fontSizeSM};\n font-variant-numeric: tabular-nums;\n color: ${cssVar.colorTextTertiary};\n `,\n drawerPanel: css`\n display: flex;\n flex-direction: column;\n gap: 8px;\n `,\n head: css`\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 8px;\n\n padding: 12px;\n `,\n layout: css`\n display: flex;\n\n &[data-flush='true'] {\n flex: 1;\n min-block-size: 0;\n }\n\n &[data-split-card='true'] {\n overflow: hidden;\n align-items: stretch;\n }\n\n ${responsive.laptop} {\n flex-direction: column;\n gap: 12px;\n }\n `,\n name: css`\n overflow: hidden;\n flex: 1;\n\n min-inline-size: 0;\n\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n option: css`\n cursor: pointer;\n\n display: flex;\n gap: 6px;\n align-items: center;\n\n inline-size: 100%;\n min-block-size: 36px;\n padding-inline: 8px;\n border: none;\n border-radius: ${cssVar.borderRadius};\n\n font: inherit;\n color: ${cssVar.colorText};\n\n background: none;\n\n &:hover {\n background: ${cssVar.colorFillTertiary};\n }\n\n &[aria-pressed='true'] {\n font-weight: 500;\n background: ${cssVar.controlItemBgActive};\n }\n `,\n row: css`\n display: flex;\n flex: 1;\n gap: 6px;\n align-items: center;\n\n min-inline-size: 0;\n `,\n panel: css`\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n min-block-size: 0;\n border-inline-end: 1px solid ${cssVar.colorBorderSecondary};\n\n [data-split-card='true'] & {\n block-size: 100%;\n border-inline-end-color: ${cssVar.colorBorder};\n }\n `,\n sidebar: css`\n align-self: stretch;\n min-block-size: 0;\n\n &[data-flush='true'] {\n block-size: 100%;\n }\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,QAAQ,kBAAkB;CACzE,MAAM,GAAG;;;;;;;;;;;;CAYT,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;MAuBR,WAAW,OAAO;;;;;;;;;CAStB,OAAO,GAAG;;iBAEK,OAAO,WAAW;;aAEtB,OAAO,kBAAkB;;CAEpC,aAAa,GAAG;;;;;CAKhB,MAAM,GAAG;;;;;;;;CAQT,QAAQ,GAAG;;;;;;;;;;;;;MAaP,WAAW,OAAO;;;;;CAKtB,MAAM,GAAG;;;;;;;;;;CAUT,QAAQ,GAAG;;;;;;;;;;;qBAWQ,OAAO,aAAa;;;aAG5B,OAAO,UAAU;;;;;oBAKV,OAAO,kBAAkB;;;;;oBAKzB,OAAO,oBAAoB;;;CAG7C,KAAK,GAAG;;;;;;;;CAQR,OAAO,GAAG;;;;;;mCAMuB,OAAO,qBAAqB;;;;iCAI9B,OAAO,YAAY;;;CAGlD,SAAS,GAAG;;;;;;;;AAQd,EAAE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/FilterSidebar/type.d.ts
|
|
3
|
+
interface FilterSidebarProps {
|
|
4
|
+
/** Scrolling choices. `dismiss` closes the compact drawer. */
|
|
5
|
+
body: (dismiss: () => void) => ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Fill the parent and scroll the two panes separately.
|
|
9
|
+
* Leave this off when a header or tabs sit above the split.
|
|
10
|
+
*/
|
|
11
|
+
flush?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Fixed controls, such as search. They stay put while `body` scrolls.
|
|
14
|
+
* `dismiss` closes the compact drawer.
|
|
15
|
+
*/
|
|
16
|
+
head?: (dismiss: () => void) => ReactNode;
|
|
17
|
+
/** Title block rendered in the content pane, above the compact trigger. */
|
|
18
|
+
header?: ReactNode;
|
|
19
|
+
/** Names the sidebar, and titles the drawer on compact screens. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Persists width and collapsed state. */
|
|
22
|
+
storageKey?: string;
|
|
23
|
+
/** Current filter, shown on the compact trigger. */
|
|
24
|
+
summary: string;
|
|
25
|
+
/** Wider rail. Default width is 264px; wide is 300px. */
|
|
26
|
+
wide?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface FilterRowProps {
|
|
29
|
+
count?: ReactNode;
|
|
30
|
+
name: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
interface FilterOptionProps {
|
|
33
|
+
count?: ReactNode;
|
|
34
|
+
icon?: ReactNode;
|
|
35
|
+
/** Overrides the accessible name when the visible one lacks context. */
|
|
36
|
+
label?: string;
|
|
37
|
+
name: ReactNode;
|
|
38
|
+
onClick: () => void;
|
|
39
|
+
selected: boolean;
|
|
40
|
+
title?: string;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { FilterOptionProps, FilterRowProps, FilterSidebarProps };
|
|
44
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/dashboard/FilterSidebar/width.ts
|
|
2
|
+
const MIN_WIDTH = 200;
|
|
3
|
+
const MAX_WIDTH = 480;
|
|
4
|
+
function clampSidebarWidth(width, fallback) {
|
|
5
|
+
if (!Number.isFinite(width)) return fallback;
|
|
6
|
+
return Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, Math.round(width)));
|
|
7
|
+
}
|
|
8
|
+
const sidebarWidth = {
|
|
9
|
+
collapse: 80,
|
|
10
|
+
max: MAX_WIDTH,
|
|
11
|
+
min: MIN_WIDTH,
|
|
12
|
+
narrow: 264,
|
|
13
|
+
wide: 300
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { clampSidebarWidth, sidebarWidth };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=width.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"width.mjs","names":[],"sources":["../../../src/dashboard/FilterSidebar/width.ts"],"sourcesContent":["const MIN_WIDTH = 200;\nconst MAX_WIDTH = 480;\n\nexport function clampSidebarWidth(width: number, fallback: number) {\n if (!Number.isFinite(width)) return fallback;\n return Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, Math.round(width)));\n}\n\nexport const sidebarWidth = {\n collapse: 80,\n max: MAX_WIDTH,\n min: MIN_WIDTH,\n narrow: 264,\n wide: 300,\n};\n"],"mappings":";AAAA,MAAM,YAAY;AAClB,MAAM,YAAY;AAElB,SAAgB,kBAAkB,OAAe,UAAkB;CACjE,IAAI,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACpC,OAAO,KAAK,IAAI,WAAW,KAAK,IAAI,WAAW,KAAK,MAAM,KAAK,CAAC,CAAC;AACnE;AAEA,MAAa,eAAe;CAC1B,UAAU;CACV,KAAK;CACL,KAAK;CACL,QAAQ;CACR,MAAM;AACR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PageHeaderProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/PageHeader/PageHeader.d.ts
|
|
3
|
+
declare function PageHeader({ action, children, description, mark, title }: PageHeaderProps): import("react").JSX.Element;
|
|
4
|
+
declare namespace PageHeader {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { PageHeader as default };
|
|
9
|
+
//# sourceMappingURL=PageHeader.d.mts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import Text from "../../base-ui/Text/Text.mjs";
|
|
4
|
+
import { styles } from "./style.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/dashboard/PageHeader/PageHeader.tsx
|
|
7
|
+
function PageHeader({ action, children, description, mark, title }) {
|
|
8
|
+
const extra = action ?? children;
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: styles.root,
|
|
11
|
+
children: [/* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
12
|
+
align: mark ? "flex-start" : void 0,
|
|
13
|
+
gap: 12,
|
|
14
|
+
horizontal: Boolean(mark),
|
|
15
|
+
children: [mark, /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
16
|
+
gap: 8,
|
|
17
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
18
|
+
as: "h1",
|
|
19
|
+
className: styles.title,
|
|
20
|
+
weight: "bold",
|
|
21
|
+
children: title
|
|
22
|
+
}), description ? /* @__PURE__ */ jsx(Text, {
|
|
23
|
+
className: styles.description,
|
|
24
|
+
children: description
|
|
25
|
+
}) : null]
|
|
26
|
+
})]
|
|
27
|
+
}), extra ? /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: styles.actions,
|
|
29
|
+
children: extra
|
|
30
|
+
}) : null]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
PageHeader.displayName = "PageHeader";
|
|
34
|
+
//#endregion
|
|
35
|
+
export { PageHeader as default };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=PageHeader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeader.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/PageHeader/PageHeader.tsx"],"sourcesContent":["'use client';\n\nimport Text from '@/base-ui/Text';\nimport { Flexbox } from '@/Flex';\n\nimport { styles } from './style';\nimport type { PageHeaderProps } from './type';\n\nfunction PageHeader({ action, children, description, mark, title }: PageHeaderProps) {\n const extra = action ?? children;\n return (\n <div className={styles.root}>\n <Flexbox align={mark ? 'flex-start' : undefined} gap={12} horizontal={Boolean(mark)}>\n {mark}\n <Flexbox gap={8}>\n <Text as=\"h1\" className={styles.title} weight=\"bold\">\n {title}\n </Text>\n {description ? <Text className={styles.description}>{description}</Text> : null}\n </Flexbox>\n </Flexbox>\n {extra ? <div className={styles.actions}>{extra}</div> : null}\n </div>\n );\n}\n\nPageHeader.displayName = 'PageHeader';\n\nexport default PageHeader;\n"],"mappings":";;;;;;AAQA,SAAS,WAAW,EAAE,QAAQ,UAAU,aAAa,MAAM,SAA0B;CACnF,MAAM,QAAQ,UAAU;CACxB,OACE,qBAAC,OAAD;EAAK,WAAW,OAAO;EAAvB,UAAA,CACE,qBAACA,mBAAD;GAAS,OAAO,OAAO,eAAe,KAAA;GAAW,KAAK;GAAI,YAAY,QAAQ,IAAI;GAAlF,UAAA,CACG,MACD,qBAACA,mBAAD;IAAS,KAAK;IAAd,UAAA,CACE,oBAAC,MAAD;KAAM,IAAG;KAAK,WAAW,OAAO;KAAO,QAAO;KAC3C,UAAA;IACG,CAAA,GACL,cAAc,oBAAC,MAAD;KAAM,WAAW,OAAO;KAAc,UAAA;IAAkB,CAAA,IAAI,IACpE;GACF,CAAA,CAAA;EACR,CAAA,GAAA,QAAQ,oBAAC,OAAD;GAAK,WAAW,OAAO;GAAU,UAAA;EAAW,CAAA,IAAI,IACtD;;AAET;AAEA,WAAW,cAAc"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/dashboard/PageHeader/style.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar, responsive }) => ({
|
|
4
|
+
actions: css`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: none;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
${responsive.mobile} {
|
|
11
|
+
inline-size: 100%;
|
|
12
|
+
|
|
13
|
+
button,
|
|
14
|
+
a {
|
|
15
|
+
min-block-size: 44px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
description: css`
|
|
20
|
+
max-inline-size: 68ch;
|
|
21
|
+
line-height: 1.6;
|
|
22
|
+
color: ${cssVar.colorTextSecondary};
|
|
23
|
+
`,
|
|
24
|
+
root: css`
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 16px;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
|
|
30
|
+
inline-size: 100%;
|
|
31
|
+
min-inline-size: 0;
|
|
32
|
+
|
|
33
|
+
${responsive.mobile} {
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
align-items: stretch;
|
|
36
|
+
}
|
|
37
|
+
`,
|
|
38
|
+
title: css`
|
|
39
|
+
margin: 0;
|
|
40
|
+
font-size: ${cssVar.fontSizeHeading3};
|
|
41
|
+
line-height: ${cssVar.lineHeightHeading3};
|
|
42
|
+
`
|
|
43
|
+
}));
|
|
44
|
+
//#endregion
|
|
45
|
+
export { styles };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/PageHeader/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar, responsive }) => ({\n actions: css`\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n\n ${responsive.mobile} {\n inline-size: 100%;\n\n button,\n a {\n min-block-size: 44px;\n }\n }\n `,\n description: css`\n max-inline-size: 68ch;\n line-height: 1.6;\n color: ${cssVar.colorTextSecondary};\n `,\n root: css`\n display: flex;\n gap: 16px;\n align-items: flex-start;\n justify-content: space-between;\n\n inline-size: 100%;\n min-inline-size: 0;\n\n ${responsive.mobile} {\n flex-direction: column;\n align-items: stretch;\n }\n `,\n title: css`\n margin: 0;\n font-size: ${cssVar.fontSizeHeading3};\n line-height: ${cssVar.lineHeightHeading3};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,QAAQ,kBAAkB;CACzE,SAAS,GAAG;;;;;;MAMR,WAAW,OAAO;;;;;;;;;CAStB,aAAa,GAAG;;;aAGL,OAAO,mBAAmB;;CAErC,MAAM,GAAG;;;;;;;;;MASL,WAAW,OAAO;;;;;CAKtB,OAAO,GAAG;;iBAEK,OAAO,iBAAiB;mBACtB,OAAO,mBAAmB;;AAE7C,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/PageHeader/type.d.ts
|
|
3
|
+
interface PageHeaderProps {
|
|
4
|
+
/** Actions at the end of the header. Falls back to `children`. */
|
|
5
|
+
action?: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Mark beside the title, such as an avatar. */
|
|
9
|
+
mark?: ReactNode;
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { PageHeaderProps };
|
|
14
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LoadingAnnouncerProps, PageHeaderSkeletonProps, PageLoadingProps, TableSkeletonProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/PageSkeleton/PageSkeleton.d.ts
|
|
3
|
+
declare function LoadingAnnouncer({ label }: LoadingAnnouncerProps): import("react").JSX.Element;
|
|
4
|
+
declare namespace LoadingAnnouncer {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
declare function PageHeaderSkeleton({ action }: PageHeaderSkeletonProps): import("react").JSX.Element;
|
|
8
|
+
declare namespace PageHeaderSkeleton {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
declare function TableSkeleton({ framed, leading, rows }: TableSkeletonProps): import("react").JSX.Element;
|
|
12
|
+
declare namespace TableSkeleton {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
declare function StatCardSkeleton(): import("react").JSX.Element;
|
|
16
|
+
declare namespace StatCardSkeleton {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
declare function PageLoading({ header, label, stats }: PageLoadingProps): import("react").JSX.Element;
|
|
20
|
+
declare namespace PageLoading {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { LoadingAnnouncer, PageHeaderSkeleton, StatCardSkeleton, TableSkeleton, PageLoading as default };
|
|
25
|
+
//# sourceMappingURL=PageSkeleton.d.mts.map
|