perf(style): codex-skills/cowa-admin-list-ui

This commit is contained in:
zhangheng
2026-04-28 14:36:36 +08:00
parent 2e33b6fd7e
commit 9d9bf4ff7f
20 changed files with 2672 additions and 812 deletions

View File

@@ -1,15 +1,16 @@
.page {
width: 100%;
height: calc(100vh - 56px);
height: calc(100vh - 60px);
padding: 16px;
gap: 16px;
gap: 12px;
background: #f7f8fa;
}
.panel {
border-color: #e6ebf2;
border-radius: 12px;
border-color: #e5e6eb;
border-radius: 4px;
background: #ffffff;
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
box-shadow: none;
}
.filterPanel {
@@ -17,28 +18,40 @@
}
.filterPanel :global(.mantine-InputWrapper-label) {
color: #1f2329;
color: #4e5969;
font-size: 14px;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
line-height: 20px;
margin-bottom: 4px;
}
.filterPanel :global(.mantine-Input-input),
.filterPanel :global(.mantine-Select-input),
.filterPanel :global(.mantine-DateInput-input),
.filterPanel :global(.mantine-NumberInput-input),
.filterPanel :global(.mantine-PillsInput-input),
.filterPanel :global(.mantine-PillsInput-root),
.filterPanel :global(.mantine-Textarea-input) {
min-height: 36px;
border-color: #d0d5dd;
background: #ffffff;
color: #31373d;
min-height: 32px;
border-color: #e5e6eb;
border-radius: 4px;
background: #f7f8fa;
color: #1d2129;
font-size: 14px;
box-shadow: none;
transition:
border-color 0.15s ease,
box-shadow 0.15s ease,
background-color 0.15s ease;
border-color 0.2s ease,
color 0.2s ease,
background-color 0.2s ease;
}
.filterPanel :global(.mantine-PillsInput-root) {
padding-inline: 12px;
}
.filterPanel :global(.mantine-PillsInput-input) {
min-height: 30px;
background: transparent;
color: #1d2129;
}
.filterPanel :global(.mantine-Textarea-input) {
@@ -47,82 +60,246 @@
.filterPanel :global(.mantine-Input-input::placeholder),
.filterPanel :global(.mantine-Select-input::placeholder),
.filterPanel :global(.mantine-DateInput-input::placeholder),
.filterPanel :global(.mantine-NumberInput-input::placeholder),
.filterPanel :global(.mantine-PillsInput-input::placeholder),
.filterPanel :global(.mantine-Textarea-input::placeholder) {
color: #98a2b3;
color: #86909c;
}
.filterPanel :global(.mantine-Input-input:focus),
.filterPanel :global(.mantine-Select-input:focus),
.filterPanel :global(.mantine-DateInput-input:focus),
.filterPanel :global(.mantine-NumberInput-input:focus),
.filterPanel :global(.mantine-PillsInput-input:focus-within),
.filterPanel :global(.mantine-PillsInput-root:focus-within),
.filterPanel :global(.mantine-Textarea-input:focus) {
border-color: #69c0ff;
box-shadow: 0 0 0 3px rgba(105, 192, 255, 0.14);
border-color: #1874ff;
background: #ffffff;
box-shadow: 0 0 0 2px rgba(24, 116, 255, 0.12);
}
.filterPanel :global(.mantine-Button-root[data-variant="transparent"]) {
color: #168de8;
min-height: auto;
height: auto;
padding-inline: 0;
color: #1874ff;
}
.filterPanel :global(.mantine-Button-root:not([data-variant="transparent"])),
.filterPanel :global(.mantine-Button-root),
.headerActions :global(.mantine-Button-root) {
min-height: 36px;
border-radius: 8px;
padding-inline: 14px;
min-height: 32px;
border-radius: 4px;
padding-inline: 12px;
font-size: 14px;
font-weight: 500;
box-shadow: none;
transition:
background-color 0.2s ease,
border-color 0.2s ease,
color 0.2s ease;
}
.filterPanel :global(.mantine-Button-root[data-variant="filled"]),
.headerActions :global(.mantine-Button-root[data-variant="filled"]) {
--button-bg: #1874ff;
--button-hover: #0f6ae8;
--button-color: #ffffff;
--button-bd: transparent;
background: #1874ff !important;
color: #ffffff !important;
}
.filterPanel :global(.mantine-Button-root[data-variant="filled"]:hover),
.headerActions :global(.mantine-Button-root[data-variant="filled"]:hover) {
background: #0f6ae8 !important;
}
.filterPanel :global(.mantine-Button-root[data-variant="default"]),
.headerActions :global(.mantine-Button-root[data-variant="default"]) {
border-color: #e5e6eb;
background: #ffffff;
color: #4e5969;
}
.filterPanel :global(.mantine-ActionIcon-root),
.headerActions :global(.mantine-ActionIcon-root) {
width: 36px;
height: 36px;
border-radius: 8px;
width: 32px;
height: 32px;
border-radius: 4px;
}
.filterPanel :global(.mantine-Pill-root) {
background: #eef7ff;
color: #168de8;
background: #e7efff;
color: #1874ff;
}
.filterPanel :global(.mantine-PillsInput-field),
.filterPanel :global(.mantine-Select-section),
.filterPanel :global(.mantine-DateInput-section) {
color: #86909c;
}
.contentPanel {
border-color: #e6ebf2;
border-color: #e5e6eb;
}
.contentPanel :global(.mantine-datatable-pagination) {
padding: 12px 16px !important;
color: #4e5969;
}
.contentPanel :global(.mantine-datatable-pagination-text),
.contentPanel :global(.mantine-datatable-pagination .mantine-Text-root) {
color: #4e5969;
font-size: 12px;
line-height: 20px;
}
.contentPanel
:global(.mantine-datatable-pagination button[data-variant="default"]),
.contentPanel
:global(.mantine-datatable-pagination button[data-variant="light"]) {
min-height: 28px !important;
height: 28px !important;
padding-inline: 10px !important;
border-radius: 4px !important;
border-color: #e5e6eb;
background: #ffffff;
color: #4e5969;
font-size: 12px;
box-shadow: none;
}
.contentPanel
:global(.mantine-datatable-pagination button[data-variant="default"]:hover),
.contentPanel
:global(.mantine-datatable-pagination button[data-variant="light"]:hover) {
background: #f7f8fa;
color: #1d2129;
}
.contentPanel :global(.mantine-datatable-pagination-pages) {
--pagination-control-size: 28px;
--pagination-control-fz: 12px;
}
.contentPanel :global(.mantine-Pagination-dots) {
color: #86909c;
}
.contentPanel :global(.mantine-Pagination-control),
.contentPanel :global(.mantine-datatable-pagination-pages-control) {
min-width: 28px !important;
height: 28px !important;
border: 0;
border-radius: 4px !important;
background: transparent;
color: #4e5969;
box-shadow: none;
}
.contentPanel :global(.mantine-Pagination-control:hover),
.contentPanel :global(.mantine-datatable-pagination-pages-control:hover) {
background: #f2f3f5;
color: #1d2129;
}
.contentPanel :global(.mantine-Pagination-control[data-active]),
.contentPanel
:global(.mantine-datatable-pagination-pages-control[data-active]) {
background: #e7efff;
border-color: transparent;
color: #1874ff;
}
.contentPanel :global(.mantine-Pagination-control[data-active]:hover),
.contentPanel
:global(.mantine-datatable-pagination-pages-control[data-active]:hover) {
background: #dbe8ff;
border-color: transparent;
color: #1874ff;
}
.contentPanel :global(.mantine-Pagination-control[data-disabled]),
.contentPanel
:global(.mantine-datatable-pagination-pages-control[data-disabled]) {
background: transparent;
color: #c9cdd4;
}
.filterActions,
.headerActions {
gap: 12px;
gap: 8px;
}
.listHeader {
margin-bottom: 16px;
margin-bottom: 12px;
}
.sectionHeader {
padding-bottom: 12px;
border-bottom: 1px solid #eef2f6;
border-bottom: 1px solid #e5e6eb;
}
.sectionEyebrow {
color: #168de8;
color: #1874ff;
font-size: 12px;
font-weight: 700;
font-weight: 500;
line-height: 18px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.sectionTitle {
color: #1f2329;
font-size: 18px;
font-weight: 700;
line-height: 28px;
color: #1d2129;
font-size: 16px;
font-weight: 500;
line-height: 24px;
}
.sectionDescription {
color: #667085;
color: #86909c;
font-size: 13px;
line-height: 20px;
}
.listHeaderTitle {
color: #1d2129;
font-size: 14px;
font-weight: 500;
line-height: 22px;
}
.listHeaderCount {
color: #86909c;
font-size: 12px;
line-height: 20px;
}
.settingTabsList {
padding: 4px;
gap: 8px;
border: 1px solid #eef2f6;
border-radius: 10px;
background: #f8f9fb;
}
.settingTabsTab {
min-height: 36px;
border-radius: 8px;
color: #56606a;
font-weight: 600;
}
.settingTabsTab[data-active] {
background: #ffffff;
color: #1f2329;
box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.settingTabsPanel {
flex: 1;
min-width: 0;
min-height: 0;
padding-top: 16px;
}

View File

@@ -1,7 +1,6 @@
"use client"
import {
Badge,
Group,
Paper,
Stack,
@@ -29,7 +28,7 @@ export function SettingPage({
return (
<Stack
w="100%"
h="calc(100vh - 56px)"
h="calc(100vh - 60px)"
p="md"
gap="md"
className={mergeClassName(classes.page, className)}
@@ -41,9 +40,9 @@ export function SettingPage({
export function SettingPanel({
className,
withBorder = true,
radius = "lg",
radius = "sm",
p = "md",
shadow = "xs",
shadow,
...props
}: PropsWithChildren<PaperProps>) {
return (
@@ -140,11 +139,9 @@ export function SettingListHeader({
gap="sm"
className={mergeClassName(classes.listHeader, className)}>
<Group gap="xs">
<Text fw={700}>{title}</Text>
<Text className={classes.listHeaderTitle}>{title}</Text>
{count !== undefined ? (
<Badge variant="light" color="gray">
{count}
</Badge>
<Text className={classes.listHeaderCount}>{count}</Text>
) : null}
</Group>
{actions}
@@ -188,25 +185,33 @@ export function SettingFilterActions({
const settingDataTableStyles = {
header: {
backgroundColor: "#F8F9FB",
borderBottom: "1px solid #EEF2F6",
color: "#56606A",
backgroundColor: "#F7F8FA",
borderBottom: "1px solid #E5E6EB",
color: "#4E5969",
fontSize: "14px",
fontWeight: 500,
},
root: {
height: "100%",
maxWidth: "100%",
minWidth: 0,
fontSize: "14px",
color: "#31373D",
borderBottom: "1px solid #E8EDF3",
borderRadius: 10,
color: "#1D2129",
borderBottom: "1px solid #E5E6EB",
borderRadius: 4,
overflow: "hidden",
boxSizing: "border-box",
backgroundColor: "#FFFFFF",
},
table: {
backgroundColor: "#FFFFFF",
},
footer: {
backgroundColor: "#FFFFFF",
},
pagination: {
padding: "14px 16px 18px",
padding: "12px 16px",
borderTop: "1px solid #E5E6EB",
},
} as const
@@ -215,7 +220,7 @@ const settingDataTableDefaultColumnProps: DataTableDefaultColumnProps<
> = {
titleStyle: {
whiteSpace: "nowrap",
fontWeight: 600,
fontWeight: 500,
},
}
@@ -270,12 +275,12 @@ export function SettingDataTable<T = Record<string, unknown>>(
const tableProps = {
withTableBorder: withTableBorder ?? true,
withRowBorders: withRowBorders ?? true,
striped: striped ?? true,
highlightOnHover: highlightOnHover ?? true,
striped: striped ?? false,
highlightOnHover: highlightOnHover ?? false,
defaultColumnProps:
defaultColumnProps ??
(settingDataTableDefaultColumnProps as DataTableDefaultColumnProps<T>),
loaderBackgroundBlur: loaderBackgroundBlur ?? 1,
loaderBackgroundBlur: loaderBackgroundBlur ?? 0,
noRecordsText: noRecordsText ?? "暂无数据",
minHeight: minHeight ?? 360,
styles: styles
@@ -301,11 +306,6 @@ export const settingTabsStyles = {
borderRadius: 8,
color: "#56606A",
fontWeight: 600,
"&[data-active]": {
backgroundColor: "#FFFFFF",
color: "#1F2329",
boxShadow: "0 6px 18px rgba(15, 23, 42, 0.08)",
},
},
panel: {
flex: 1,
@@ -314,3 +314,9 @@ export const settingTabsStyles = {
paddingTop: 16,
},
} as const
export const settingTabsClassNames = {
list: classes.settingTabsList,
tab: classes.settingTabsTab,
panel: classes.settingTabsPanel,
} as const