Skip to content

Commit e3d24fb

Browse files
committed
fix: show, create and edit forms drop the Field/Value header and filled group bands, rows get light dividers, labels sit on the first line of the value, show labels are muted and core inputs no longer stretch over the whole row AdminForth/2005
1 parent c8966a1 commit e3d24fb

9 files changed

Lines changed: 146 additions & 132 deletions

File tree

‎adminforth/design/system-concepts.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ A page gets less than the screen: the sidebar and the agent panel squeeze it on
5050

5151
The header of the list page is a container named `header`. Below 896px (`@4xl/header`) components from `beforeActionButtons` take a full row under the title and the buttons, from 896px all share one row. Below 512px (`@lg/header`) Home and Filter keep only their icons. Such a component fills its row and takes a fixed width from `@4xl/header:`, like the fields of quick-filters. Bulk actions of checked rows take a row of their own above the table, so the buttons next to the title never move.
5252

53+
## Field tables
54+
55+
The show, create and edit views list fields as a two-column table on a card: a 224px label column and the value next to it. Lines follow one order of weight: the card border (`FormBorder`), lighter dividers between rows (`ShowTableBodyBorder`, in forms too), the stronger border of an input. There is no "Field / Value" header row and no filled band behind a group name, a group name is a plain semibold title inside its card.
56+
57+
- Labels sit on the first line of the value, not in the middle of a tall row: 13px medium in forms, 13px `InputIconColor` in the show view, where values take `ShowTableBodyText`.
58+
- Core inputs don't stretch over the whole row: text up to 576px (`max-w-xl`), selects 320px (`max-w-xs`), text areas 672px (`max-w-2xl`), numbers 160px. A custom field component sets its own width.
59+
- A `showRow` component renders the whole `<tr>` content (`<td colspan="2">`), so the table stays a `<table>`.
60+
5361
## Lucide icons
5462

5563
- Use Lucide: `@iconify-prerendered/vue-lucide` in components (`IconPencil`, `IconTrash2`), `lucide:<name>` in config (`icon: 'lucide:download'`).

‎adminforth/design/system.html‎

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,17 @@
440440
:where(#create) a:hover{color:inherit}
441441
:where(#create) .frow{display:flex;flex-wrap:wrap;border-bottom:1px solid var(--divider)}
442442
:where(#create) .frow:last-child{border-bottom:0}
443-
:where(#create) .flbl{flex:0 0 232px;max-width:100%;padding:19px 20px 0}
443+
:where(#create) .flbl{flex:0 0 224px;max-width:100%;padding:20px 20px 0}
444444
:where(#create) .fv{flex:1 1 360px;min-width:0;padding:12px 20px}
445445
:where(#create) .fval{max-width:640px;display:flex;flex-direction:column;gap:6px}
446-
:where(#create) .fhead{display:flex;flex-wrap:wrap;background:var(--bg);border-bottom:1px solid var(--border);font-size:12px;font-weight:500;color:var(--muted)}
446+
:where(#create, #show) .gtitle{padding:16px 20px 4px;font-size:14px;line-height:20px;font-weight:600;color:var(--text)}
447+
448+
:where(#show) a{color:inherit}
449+
:where(#show) a:hover{color:inherit}
450+
:where(#show) .srow{display:flex;flex-wrap:wrap;align-items:baseline;border-top:1px solid var(--divider)}
451+
:where(#show) .gtitle + .srow{border-top:0}
452+
:where(#show) .sk{flex:0 0 224px;max-width:100%;padding:10px 20px;font-size:13px;line-height:20px;color:var(--muted)}
453+
:where(#show) .sv{flex:1 1 360px;min-width:0;padding:10px 20px;color:var(--text)}
447454

448455
:where(#user-menu) a{color:inherit}
449456
:where(#user-menu) a:hover{color:inherit}
@@ -553,7 +560,7 @@
553560
<body>
554561
<header class="ds-top">
555562
<div class="ds-brand"><b>AdminForth Design System</b><span>Hairline theme · tokens, screens and AFCL components</span></div>
556-
<nav class="ds-nav" aria-label="Sections"><div class="ds-nav-group"><a href="#foundations">Foundations</a></div><div class="ds-nav-group"><span>Screens</span><a href="#list">List view</a><a href="#create">Create view</a><a href="#user-menu">User menu</a></div><div class="ds-nav-group"><span>Components</span><a href="#afcl-actions">Actions</a><a href="#afcl-inputs">Inputs</a><a href="#afcl-data">Data display</a><a href="#afcl-feedback">Overlays &amp; feedback</a><a href="#afcl-charts">Charts</a></div></nav>
563+
<nav class="ds-nav" aria-label="Sections"><div class="ds-nav-group"><a href="#foundations">Foundations</a></div><div class="ds-nav-group"><span>Screens</span><a href="#list">List view</a><a href="#create">Create view</a><a href="#show">Show view</a><a href="#user-menu">User menu</a></div><div class="ds-nav-group"><span>Components</span><a href="#afcl-actions">Actions</a><a href="#afcl-inputs">Inputs</a><a href="#afcl-data">Data display</a><a href="#afcl-feedback">Overlays &amp; feedback</a><a href="#afcl-charts">Charts</a></div></nav>
557564
<div class="ds-controls">
558565
<span>Accent</span>
559566
<button class="ds-swatch" type="button" aria-label="Accent #1a56db" aria-pressed="false" data-accent="#1a56db" style="background:#1a56db"></button>
@@ -699,8 +706,9 @@ <h1 style="font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing:
699706
<div class="map"><div><code>surface-2</code></div><div><code>lightSidebarItemHover · lightListTableRowHover · lightDropdownOptionsHoverBackground · lightSecondaryDarken · lightInputBackgroundHover</code></div></div>
700707
<div class="map"><div><code>surface-3</code></div><div><code>lightSidebarItemActive · lightVerticalTabsBackgroundActive · lightButtonGroupActiveBackground · lightSkeletonBackgroundColor · lightProgressBarUnfilledColor</code></div></div>
701708
<div class="map"><div><code>border</code></div><div><code>lightSidebarBorder · lightNavbarBorder · lightListBorder · lightFormBorder · lightTableBorder · lightDialogBreakLine · lightSidebarDevider</code></div></div>
709+
<div class="map"><div><code>divider</code></div><div><code>lightShowTableBodyBorder (rows of the show, create and edit tables)</code></div></div>
702710
<div class="map"><div><code>border-strong</code></div><div><code>lightInputBorder · lightDropownButtonsBorder · lightCheckboxBorderColor · lightButtonGroupBorder · lightDropzoneBorder</code></div></div>
703-
<div class="map"><div><code>text</code></div><div><code>lightSidebarTextActive · lightFormFieldTextColor · lightInputText · lightDialogHeaderText · lightTextLabel</code></div></div>
711+
<div class="map"><div><code>text</code></div><div><code>lightSidebarTextActive · lightFormFieldTextColor · lightInputText · lightDialogHeaderText · lightTextLabel · lightShowTableHeadingText · lightShowTableBodyText</code></div></div>
704712
<div class="map"><div><code>text-2</code></div><div><code>lightSidebarText · lightListTableHeadingText · lightListTableText · lightTableText</code></div></div>
705713
<div class="map"><div><code>muted</code></div><div><code>lightSidebarIcons · lightNavbarIcons · lightSidebarHeading · lightInputIconColor · lightBreadcrumbsHomepageText · lightListTablePaginationHelpText</code></div></div>
706714
<div class="map"><div><code>faint</code></div><div><code>lightInputPlaceholderText · lightDropdownButtonsPlaceholderText · lightDatePickerPlaceHolder</code></div></div>
@@ -1326,10 +1334,6 @@ <h1 class="t-title">Create</h1>
13261334

13271335

13281336
<div class="card" role="table" aria-label="Create car" style="overflow: hidden">
1329-
<div class="fhead" role="row">
1330-
<div role="columnheader" style="flex: 0 0 232px; padding: 10px 20px">Field</div>
1331-
<div role="columnheader" style="flex: 1 1 360px; padding: 10px 20px">Value</div>
1332-
</div>
13331337
<div>
13341338
<div class="frow" role="row">
13351339
<div class="flbl" role="rowheader"><span class="label">Model <span class="req" aria-label="required">*</span></span></div>
@@ -1520,6 +1524,57 @@ <h1 class="t-title">Create</h1>
15201524
</div>
15211525
</section>
15221526

1527+
<section class="ds-board" id="show" aria-label="Show view">
1528+
<h2 class="ds-board-title"><span>Screens</span>Show view</h2>
1529+
<div class="ds-frame">
1530+
<div class="af " style="--accent: #16537E; width: 1280px; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 16px">
1531+
<div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px">
1532+
<nav aria-label="Breadcrumb" style="display: flex; align-items: center; gap: 8px">
1533+
<a class="link-muted t-sm" href="#" style="display: inline-flex; align-items: center; gap: 6px">
1534+
<svg class="i i-sm" viewBox="0 0 24 24" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"></path><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path></svg>
1535+
Home
1536+
</a>
1537+
<span style="color: var(--faint)">/</span>
1538+
<a class="link-muted t-sm" href="#list">Car - SQLite</a>
1539+
<span style="color: var(--faint)">/</span>
1540+
<h1 class="t-title">Show</h1>
1541+
</nav>
1542+
<div style="display: flex; align-items: center; gap: 8px">
1543+
<a class="btn btn-secondary af-edit-button" href="#create">
1544+
<svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"></path><path d="m15 5 4 4"></path></svg>
1545+
Edit
1546+
</a>
1547+
<button class="btn btn-secondary af-delete-button" type="button" style="color: var(--danger-fg)">
1548+
<svg class="i" viewBox="0 0 24 24" aria-hidden="true" style="color: var(--danger-fg)"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>
1549+
Delete
1550+
</button>
1551+
<button class="btn btn-secondary btn-icon" type="button" aria-label="More actions">
1552+
<svg class="i" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>
1553+
</button>
1554+
</div>
1555+
</div>
1556+
<div class="card" role="table" aria-label="General" style="overflow: hidden">
1557+
<div class="gtitle">General</div>
1558+
<div class="srow" role="row"><div class="sk" role="rowheader">Identifier</div><div class="sv" role="cell"><span class="mono">8f2c1a7e</span></div></div>
1559+
<div class="srow" role="row"><div class="sk" role="rowheader">Model</div><div class="sv" role="cell">Aether Nimbus S</div></div>
1560+
<div class="srow" role="row"><div class="sk" role="rowheader">Price</div><div class="sv" role="cell">7180.00 USD</div></div>
1561+
<div class="srow" role="row"><div class="sk" role="rowheader">Engine Type</div><div class="sv" role="cell">Gasoline</div></div>
1562+
<div class="srow" role="row"><div class="sk" role="rowheader">Engine Power</div><div class="sv" role="cell">184 HP</div></div>
1563+
<div class="srow" role="row"><div class="sk" role="rowheader">Production Year</div><div class="sv" role="cell">2019</div></div>
1564+
<div class="srow" role="row"><div class="sk" role="rowheader">Created At</div><div class="sv" role="cell">18 Oct 2026, 14:32</div></div>
1565+
</div>
1566+
<div class="card" role="table" aria-label="Listing" style="overflow: hidden">
1567+
<div class="gtitle">Listing</div>
1568+
<div class="srow" role="row"><div class="sk" role="rowheader">Description</div><div class="sv" role="cell">Low-mileage hatchback with a full dealer service history. One owner, garage kept.</div></div>
1569+
<div class="srow" role="row"><div class="sk" role="rowheader">Listed</div><div class="sv" role="cell"><span class="badge badge-success"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>Yes</span></div></div>
1570+
<div class="srow" role="row"><div class="sk" role="rowheader">Body Type</div><div class="sv" role="cell">Hatchback</div></div>
1571+
<div class="srow" role="row"><div class="sk" role="rowheader">Color</div><div class="sv" role="cell">Graphite</div></div>
1572+
<div class="srow" role="row"><div class="sk" role="rowheader">Seller</div><div class="sv" role="cell"><a class="link" href="#">Northway Motors</a></div></div>
1573+
</div>
1574+
</div>
1575+
</div>
1576+
</section>
1577+
15231578
<section class="ds-board" id="user-menu" aria-label="User menu">
15241579
<h2 class="ds-board-title"><span>Screens</span>User menu</h2>
15251580
<div class="ds-frame">

‎adminforth/modules/styles.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ export const styles = () => ({
9191
/* Show View Table */
9292
/*----------------------------------------*/
9393
lightShowTableHeadingBackground: "#FAFAFA",
94-
lightShowTableHeadingText: "#3F3F46",
94+
lightShowTableHeadingText: "#18181B",
9595
lightShowTableUnderHeadingBackground: "#FAFAFA",
9696
lightShowTableUnderHeadingText: "#696973",
9797
lightShowTablesBodyBackground: "alias:lightForm",
98-
lightShowTableBodyText: "#3F3F46",
98+
lightShowTableBodyText: "#18181B",
9999
lightShowTableBodyBorder: "#F0F0F2",
100100

101101

@@ -460,11 +460,11 @@ export const styles = () => ({
460460
/* Show View Table */
461461
/*----------------------------------------*/
462462
darkShowTableHeadingBackground: "alias:darkFormHeading",
463-
darkShowTableHeadingText: "#D4D4D8",
463+
darkShowTableHeadingText: "#F4F4F5",
464464
darkShowTableUnderHeadingBackground: "alias:darkFormHeading",
465465
darkShowTableUnderHeadingText: "#A1A1AA",
466466
darkShowTablesBodyBackground: "alias:darkForm",
467-
darkShowTableBodyText: "#D4D4D8",
467+
darkShowTableBodyText: "#F4F4F5",
468468
darkShowTableBodyBorder: "#202024",
469469

470470
/* Show View buttons*/

‎adminforth/spa/src/components/ColumnValueInput.vue‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
v-else-if="column.foreignResource"
2020
ref="input"
2121
:key="`select-${column.name}-${source}-${column.foreignResource?.name || column.foreignResource?.table || ''}`"
22-
class="w-full min-w-24"
22+
class="w-full min-w-24 max-w-xs"
2323
:options="formatSelectOptions(columnOptions[column.name] || [], column)"
2424
:searchDisabled="!column.foreignResource.searchableFields"
2525
@scroll-near-end="loadMoreOptions && loadMoreOptions(column.name)"
@@ -45,7 +45,7 @@
4545
<Select
4646
v-else-if="column.enum"
4747
ref="input"
48-
class="w-full min-w-24"
48+
class="w-full min-w-24 max-w-xs"
4949
:options="formatSelectOptions(column.enum, column)"
5050
teleportToBody
5151
:modelValue="value"
@@ -56,7 +56,7 @@
5656
<Select
5757
v-else-if="(type || column.type) === 'boolean'"
5858
ref="input"
59-
class="w-full min-w-24"
59+
class="w-full min-w-24 max-w-xs"
6060
:options="getBooleanOptions(column)"
6161
teleportToBody
6262
:modelValue="value"
@@ -120,13 +120,15 @@
120120
/>
121121
<Textarea
122122
v-else-if="['text', 'richtext'].includes(type || column.type)"
123+
class="max-w-2xl"
123124
:placeholder="$t('Text')"
124125
:modelValue="value"
125126
@update:modelValue="$emit('update:modelValue', $event)"
126127
:readonly="(column.editReadonly && source === 'edit') || readonly"
127128
/>
128129
<Textarea
129130
v-else-if="['json'].includes(type || column.type)"
131+
class="max-w-2xl"
130132
:placeholder="$t('Text')"
131133
:modelValue="value"
132134
@update:modelValue="$emit('update:modelValue', $event)"
@@ -135,7 +137,7 @@
135137
v-else
136138
ref="input"
137139
:type="!column.masked || unmasked[column.name] ? 'text' : 'password'"
138-
class="w-full"
140+
class="w-full max-w-xl"
139141
:fullWidth="true"
140142
:placeholder="$t('Text')"
141143
:prefix="column.inputPrefix"

‎adminforth/spa/src/components/ColumnValueInputWrapper.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
/>
5757
<div v-if="columnsWithErrors && columnsWithErrors[column.name] && validatingMode && !isValidating" class="af-invalid-field-message mt-1 text-xs text-lightInputErrorColor dark:text-darkInputErrorColor">{{ columnsWithErrors[column.name] }}</div>
5858
<Spinner v-if="shouldWeShowSpinner" class="w-4 mt-1"/>
59-
<div v-if="column.editingNote && column.editingNote[mode]" class="mt-1 text-xs text-lightFormFieldTextColor dark:text-darkFormFieldTextColor">{{ column.editingNote[mode] }}</div>
59+
<div v-if="column.editingNote && column.editingNote[mode]" class="mt-1 text-xs text-lightInputIconColor dark:text-darkInputIconColor">{{ column.editingNote[mode] }}</div>
6060
</template>
6161

6262
<script setup lang="ts">

0 commit comments

Comments
 (0)