@godxjp/ui-mcp 0.4.2 → 0.6.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/dist/index.js +70 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -314,7 +314,7 @@ const columns: ColumnDef<Member>[] = [
|
|
|
314
314
|
{
|
|
315
315
|
name: "Card",
|
|
316
316
|
group: "data-display",
|
|
317
|
-
tagline:
|
|
317
|
+
tagline: 'Surface container with optional accent stripe, variant fill, size, and density. \u26A0\uFE0F The bare <Card> has NO inner padding \u2014 body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className="p-4"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter.',
|
|
318
318
|
props: [
|
|
319
319
|
{ name: "accent", type: '"primary" | "success" | "warning" | "info" | "attention" | "destructive"', description: "3px left-edge semantic accent stripe." },
|
|
320
320
|
{ name: "variant", type: '"default" | "muted" | "outline" | "featured"', defaultValue: '"default"', description: "Surface fill style." },
|
|
@@ -1252,6 +1252,75 @@ function findRule(num) {
|
|
|
1252
1252
|
|
|
1253
1253
|
// src/data/patterns.ts
|
|
1254
1254
|
var PATTERNS = [
|
|
1255
|
+
{
|
|
1256
|
+
name: "common-fixes",
|
|
1257
|
+
tagline: "Fix the most common @godxjp/ui consumer mistakes & visual bugs (CardStat double-border, grey StatusBadge, crushed/empty table headers, washed-out sidebar footer, Inertia layout crash, SSR hydration). Before \u2192 after.",
|
|
1258
|
+
tags: ["fixes", "migration", "bug", "cardstat", "statusbadge", "datatable", "sidebar", "gotcha", "review"],
|
|
1259
|
+
code: `// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1260
|
+
// 0) \u2605 MOST COMMON: <Card> body has NO padding (content is flush against the edges)
|
|
1261
|
+
// Cause: the bare <Card> has ZERO inner padding \u2014 it MUST contain <CardContent>.
|
|
1262
|
+
// Don't hand-roll padding with className="p-4" on the Card either.
|
|
1263
|
+
// \u274C <Card><Stack gap="md">\u2026fields\u2026</Stack></Card> // flush, no padding
|
|
1264
|
+
// \u274C <Card className="p-4">\u2026fields\u2026</Card> // hand-rolled padding
|
|
1265
|
+
// \u2705 <Card><CardContent><Stack gap="md">\u2026fields\u2026</Stack></CardContent></Card>
|
|
1266
|
+
// Titles \u2192 <CardHeader><CardTitle>. Only go flush deliberately for a full-bleed table:
|
|
1267
|
+
// \u2705 <Card><CardContent flush><DataTable/></CardContent></Card>
|
|
1268
|
+
// GENERAL RULE \u2014 compose godx-ui primitives FULLY; never hand-roll what one ships:
|
|
1269
|
+
// padding \u2192 CardContent (not p-4) \xB7 controls \u2192 Input/Select/Button (not raw <input>/<select>/<button>)
|
|
1270
|
+
// empty rows \u2192 DataTable's built-in empty / <EmptyState> (not a custom data.length===0 guard).
|
|
1271
|
+
// If a primitive exists, USE it \u2014 don't reinvent it.
|
|
1272
|
+
|
|
1273
|
+
// 1) CardStat shows a DOUBLE border (too thick)
|
|
1274
|
+
// Cause: CardStat IS already a bordered Card. Don't wrap it.
|
|
1275
|
+
// \u274C <Card><CardContent><CardStat label="x" value="1" /></CardContent></Card>
|
|
1276
|
+
// \u2705 <ResponsiveGrid columns={4}><CardStat label="x" value="1" /></ResponsiveGrid>
|
|
1277
|
+
// Need a section title? Use a heading, NOT a Card:
|
|
1278
|
+
// \u2705 <Stack gap="sm"><div className="text-sm font-medium">KPI</div>
|
|
1279
|
+
// <ResponsiveGrid columns={4}><CardStat .../></ResponsiveGrid></Stack>
|
|
1280
|
+
|
|
1281
|
+
// 2) StatusBadge renders grey with a \u25CB (no colour) for localized/tier labels
|
|
1282
|
+
// Cause: it auto-maps only English lifecycle keys. (@godxjp/ui >= 6.1)
|
|
1283
|
+
// \u274C <StatusBadge status="\u30D7\u30EC\u30DF\u30A2\u30E0" />
|
|
1284
|
+
// \u2705 <StatusBadge status="\u30D7\u30EC\u30DF\u30A2\u30E0" tone="success" icon={null} /> // tier \u2192 pill, no icon
|
|
1285
|
+
// \u2705 <StatusBadge status="active" label="\u516C\u958B\u4E2D" /> // lifecycle \u2192 keep icon
|
|
1286
|
+
|
|
1287
|
+
// 3) Table text collapses to one char per line, or a chip wraps
|
|
1288
|
+
// Cause: pre-6.1.2. (@godxjp/ui >= 6.1.2 \u2192 cells + chips are nowrap)
|
|
1289
|
+
// \u2705 npm i @godxjp/ui@^6.2.0
|
|
1290
|
+
// \u2705 give long columns a width: { key: "name", header: "\u6C0F\u540D", width: "w-64" }
|
|
1291
|
+
|
|
1292
|
+
// 4) Empty (icon/action) column header shows a blank grey block
|
|
1293
|
+
// (@godxjp/ui >= 6.2.0 auto-hides it: [data-slot=table-head][data-empty] \u2192 transparent)
|
|
1294
|
+
// \u2705 npm i @godxjp/ui@^6.2.0 // header: "" now renders a transparent cell
|
|
1295
|
+
|
|
1296
|
+
// 5) DataTable columns are crushed / squeezed
|
|
1297
|
+
// Cause: the table is nested in a narrow grid column.
|
|
1298
|
+
// \u274C <ResponsiveGrid columns={3}><div className="lg:col-span-2"><Card><DataTable/></Card></div></ResponsiveGrid>
|
|
1299
|
+
// \u2705 Table gets its OWN full-width row: <Card><CardContent flush><DataTable/></CardContent></Card>
|
|
1300
|
+
|
|
1301
|
+
// 6) FilterBar has no padding (sticks to the edge)
|
|
1302
|
+
// Cause: it's inside CardContent flush (flush strips padding \u2014 that's for tables).
|
|
1303
|
+
// \u274C <Card><CardContent flush><FilterBar/><DataTable/></CardContent></Card>
|
|
1304
|
+
// \u2705 <FilterBar/> then <Card><CardContent flush><DataTable/></CardContent></Card>
|
|
1305
|
+
|
|
1306
|
+
// 7) Sidebar footer looks washed-out / off-design
|
|
1307
|
+
// Cause: raw opacity-*/text-[11px]. Use semantic tokens.
|
|
1308
|
+
// \u2705 <div className="text-muted-foreground text-xs">
|
|
1309
|
+
// <div className="text-foreground font-medium">{name}</div><div>{role}</div></div>
|
|
1310
|
+
|
|
1311
|
+
// 8) Inertia: "Objects are not valid as a React child {errors, auth, \u2026}"
|
|
1312
|
+
// Cause: persistent layout passed as a render fn. Use the ARRAY form.
|
|
1313
|
+
// \u274C Page.layout = (page) => <Layout>{page}</Layout>
|
|
1314
|
+
// \u2705 Page.layout = [Layout] // Layout is ({children}) => ...
|
|
1315
|
+
|
|
1316
|
+
// 9) Inertia v3 hydration mismatch ("server rendered text didn't match the client")
|
|
1317
|
+
// Cause: Math.random()/argless new Date() during render (SSR \u2260 client).
|
|
1318
|
+
// \u2705 seed deterministically by index, or compute in an event handler.
|
|
1319
|
+
|
|
1320
|
+
// 10) Hide a column on mobile / sign-aware KPI delta (@godxjp/ui >= 6.2.0)
|
|
1321
|
+
// \u2705 columns: [{ key: "email", header: "\u30E1\u30FC\u30EB", hiddenOnMobile: true }]
|
|
1322
|
+
// \u2705 <CardStat label="\u58F2\u4E0A" value="\xA58.2M" delta="+12%" /> // + green / - red; inverse flips`
|
|
1323
|
+
},
|
|
1255
1324
|
{
|
|
1256
1325
|
name: "signup-form",
|
|
1257
1326
|
tagline: "Card-wrapped sign-up form using react-hook-form + zod with FormField/Input and a CardFooter action bar (real @godxjp/ui API).",
|