Release
tbtop/admin 0.7.2: eight shadcn styles, responsive images and fixes
The admin takes any of the eight shadcn styles with one line of PHP. Plus responsive webp variants for uploaded images, a placeholder per language, and fixes across forms and validation.
0.7.2 lets the admin take any of the eight shadcn styles with one line of PHP. It also writes responsive webp variants for every uploaded image, gives translatable fields a placeholder per language, and fixes a round of form and validation bugs.
Eight shadcn styles
The client now renders on the upstream shadcn style presets: Vega, Nova, Maia, Lyra, Mira, Luma, Sera and Rhea. A style sets the shapes, such as control heights, spacing, corner radii and shadows. Your theme tokens, such as --primary, --radius and the fonts, stay in your CSS as before.
return $panel->stylePreset('lyra');- The default is
vega, the classic shadcn style. It matches the admin before presets, so an upgrade changes nothing on screen until you pick another style. admin:installwrites the style class onto<html>in the root Blade, so the first paint is already styled. A Blade without that line only costs one unstyled paint.styles.cssships all eight styles. To ship one, importstyles/lyra.cssinstead and keep->stylePreset()on the same name.- Table frames, cards, stat cards, editors and skeletons follow the style's corners, so a sharp style such as Lyra or Sera has no round surfaces left.
- Tabs, toggles, switches, radios and compact inputs take their sizes from the style, so a toggle-buttons field lines up with the inputs beside it.
- Presets sit in the
componentscascade layer, belowutilities: a class inclassNamestill wins, and an unlayered.cn-buttonrule restyles every button.
To apply a full preset from ui.shadcn.com/create, set its style on the panel and paste its :root and .dark blocks into your admin CSS. All eight are shown at the end of this post, on the demo dashboard, and the demo has a style switcher in the bottom-right corner: try them on demo.tbtop.dev.
Responsive images
- The media library now writes webp variants at 640, 1024 and 1600 pixels wide next to the 320×320 thumb, so a front end has a
srcsetto choose from. Nothing is upscaled: an image no wider than a variant gets no copy of it. - A profile with no height bounds the width alone.
php artisan tbtop:media-regeneratebuilds the variants that stored media is missing.--profilelimits it to one profile, and--forcerebuilds existing variants and deletes the files the new set no longer uses. A failing item is reported and the run goes on.
A placeholder per language
placeholder() on text and textarea fields also takes a locale map, such as ['en' => '…', 'uk' => '…']. Each locale tab of a translatable field shows its own entry, so an SEO field can show each language's computed default. A locale missing from the map shows no placeholder.
Fixes you may have hit
- A multiple select or upload with
distinctrejects duplicate values. The rule used to land on the array and always pass. - A regex rule that JavaScript cannot compile no longer breaks blur validation; the server still checks it. The
urlrule is now checked in the browser too. - Boolean and checkbox fields read
1and"true"as on, and table cells no longer show"0"or"false"as checked. - A slug follows its source field while you type there and stays put once focus leaves it, also inside repeater rows. Polish ł and similar letters become Latin instead of a dash.
- Notification bodies keep their line breaks.
- The install docs and
admin:installnow say where the Inertia middleware has to sit, so pages with their ownmiddleware(), such as sign-in, keep validation errors and shared props.
Upgrade
Upgrade tbtop/admin and @tbtop/inertia-admin together to 0.7.2. The default style keeps the admin looking as it did. Run php artisan tbtop:media-regenerate once if you want the new variants for images uploaded before. Every change is in the changelog, and what comes next, up to 1.0 in December, is on the roadmap.
