@godxjp/ui-mcp 0.17.1 → 0.18.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 CHANGED
@@ -950,6 +950,99 @@ export default function InvoiceList({
950
950
  storyPath: "data-display/DataTable.stories.tsx",
951
951
  rules: [24, 31, 35, 37]
952
952
  },
953
+ {
954
+ name: "DataGrid",
955
+ group: "data-display",
956
+ tagline: "Full-feature data grid \u2014 the TanStack Table adapter on `@godxjp/ui/data-grid` (NOT the data-display barrel). Adds column sort, global search, column visibility ('set view'), per-page + numbered pagination, row selection + bulk actions, and density over the styled Table* primitives. Defaults to SERVER/manual mode: wire sorting/columnFilters/globalFilter/pagination to your AJAX query (pass rowCount). Use DataTable instead for a lean server-driven list that must NOT pull TanStack. Requires the `@tanstack/react-table` peer dependency.",
957
+ props: [
958
+ {
959
+ name: "columns",
960
+ type: "ColumnDef<T, unknown>[]",
961
+ required: true,
962
+ description: "TanStack column definitions ({ accessorKey, header, cell, enableSorting, enableHiding, meta:{label} }). Set enableHiding:false to keep a column out of the ViewOptions menu; meta.label gives a human label there when header is JSX."
963
+ },
964
+ {
965
+ name: "data",
966
+ type: "T[]",
967
+ required: true,
968
+ description: "Row data. Empty + loading=false renders a built-in EmptyState in the body."
969
+ },
970
+ {
971
+ name: "getRowId",
972
+ type: "(row: T) => string",
973
+ description: "Stable row id (defaults to row[rowIdKey], rowIdKey defaults to 'id')."
974
+ },
975
+ {
976
+ name: "enableRowSelection",
977
+ type: "boolean",
978
+ defaultValue: "false",
979
+ description: "Adds a checkbox column + header select-all; pair with DataGrid.BulkActions."
980
+ },
981
+ {
982
+ name: "sorting / onSortingChange",
983
+ type: "SortingState / OnChangeFn<SortingState>",
984
+ description: "Server sort: pass both and sort in your query (manualSorting defaults true). Omit both for client sort."
985
+ },
986
+ {
987
+ name: "globalFilter / onGlobalFilterChange",
988
+ type: "string / OnChangeFn<string>",
989
+ description: "Global search term, surfaced by DataGrid.Search. Server or client like sorting."
990
+ },
991
+ {
992
+ name: "pagination / onPaginationChange / rowCount",
993
+ type: "PaginationState / OnChangeFn / number",
994
+ description: "Server pagination: pass pagination + onPaginationChange + rowCount (total). Omit for client pagination."
995
+ },
996
+ {
997
+ name: "columnVisibility / onColumnVisibilityChange",
998
+ type: "VisibilityState / OnChangeFn<VisibilityState>",
999
+ description: "Column show/hide state surfaced by DataGrid.ViewOptions ('set view'). Internal if omitted."
1000
+ },
1001
+ {
1002
+ name: "manualSorting / manualFiltering / manualPagination",
1003
+ type: "boolean",
1004
+ defaultValue: "true",
1005
+ description: "Default true (server/AJAX). Set false to let TanStack sort/filter/paginate in-browser."
1006
+ },
1007
+ {
1008
+ name: "loading / density / onRowClick / empty",
1009
+ type: "boolean / 'compact'|'comfortable' / (row:T)=>void / ReactNode",
1010
+ description: "Loading row, controlled density, clickable rows, custom empty content."
1011
+ }
1012
+ ],
1013
+ usage: [
1014
+ "Import from `@godxjp/ui/data-grid` \u2014 it lives on its own subpath because it pulls @tanstack/react-table; it is NOT in the runtime-neutral root or the data-display barrel.",
1015
+ "Compose the compound parts as children: <DataGrid.Toolbar> (holds <DataGrid.BulkActions>, <DataGrid.Search>, <DataGrid.ViewOptions>, <DataGrid.DensityToggle>), then <DataGrid.Content> (auto-included if omitted) and <DataGrid.Pagination pageSizeOptions=[...]>.",
1016
+ "Server mode (default): drive sorting/globalFilter/pagination from useQuery and pass rowCount. Client mode: set manualSorting/manualFiltering/manualPagination={false} and the grid handles it on the data array."
1017
+ ],
1018
+ related: ["DataTable", "Table", "DataState", "Select", "DropdownMenu"],
1019
+ example: `import { DataGrid, type ColumnDef } from "@godxjp/ui/data-grid";
1020
+ import { Flex } from "@godxjp/ui/layout";
1021
+
1022
+ type Row = { id: string; name: string; amount: number };
1023
+ const columns: ColumnDef<Row, unknown>[] = [
1024
+ { accessorKey: "name", header: "Name", meta: { label: "Name" } },
1025
+ { accessorKey: "amount", header: "Amount", meta: { label: "Amount" } },
1026
+ ];
1027
+
1028
+ export function Grid({ rows }: { rows: Row[] }) {
1029
+ return (
1030
+ <DataGrid columns={columns} data={rows} getRowId={(r) => r.id} enableRowSelection manualSorting={false} manualFiltering={false} manualPagination={false}>
1031
+ <DataGrid.Toolbar>
1032
+ <Flex direction="row" align="center" gap="sm" className="ms-auto">
1033
+ <DataGrid.Search />
1034
+ <DataGrid.ViewOptions />
1035
+ <DataGrid.DensityToggle />
1036
+ </Flex>
1037
+ </DataGrid.Toolbar>
1038
+ <DataGrid.Content />
1039
+ <DataGrid.Pagination pageSizeOptions={[10, 20, 50]} />
1040
+ </DataGrid>
1041
+ );
1042
+ }`,
1043
+ storyPath: "data-display/DataGrid.stories.tsx",
1044
+ rules: [24, 31, 35, 37]
1045
+ },
953
1046
  {
954
1047
  name: "Card",
955
1048
  group: "data-display",
@@ -6508,6 +6601,11 @@ var CARDINAL_RULES = [
6508
6601
  number: 40,
6509
6602
  title: "Pages are mobile-first",
6510
6603
  body: "Author and verify every page at 320\u2013390px FIRST. Spacing comes only from `Stack` / `Inline` `gap` + `ResponsiveGrid columns={2|3|4}` (which collapse to a single column on narrow screens) \u2014 never raw `p-*` / `gap-*` / `space-*` utilities for page layout. Wide tables scroll horizontally on small screens (don't force-fit them); dialogs and sheets are full-height on mobile. Touch targets \u2265 44\xD744px."
6604
+ },
6605
+ {
6606
+ number: 41,
6607
+ title: "Drawer & dialog footer layout",
6608
+ body: 'Sheet/Dialog/AlertDialog footers are a pinned action bar (Ant Design Drawer footer): the footer sticks to the bottom, SheetFooter draws a full-bleed top border, and actions are RIGHT-aligned with the PRIMARY button rightmost (Cancel/secondary to its left). A destructive / clear / reset action goes far-LEFT \u2014 give that button `className="mr-auto"`. NEVER stack footer buttons full-width or center them.'
6511
6609
  }
6512
6610
  ];
6513
6611
  function findRule(num) {
@@ -9299,7 +9397,7 @@ ${c.example}
9299
9397
  // package.json
9300
9398
  var package_default = {
9301
9399
  name: "@godxjp/ui-mcp",
9302
- version: "0.17.1",
9400
+ version: "0.18.0",
9303
9401
  description: "Model Context Protocol server for @godxjp/ui \u2014 gives Claude Code / Codex CLI / Cursor / any MCP-aware agent live access to the component catalog, prop vocabulary, design tokens, 34 cardinal rules, copy-paste-ready patterns, 12 design / taste skills synthesised from Leonxlnx/taste-skill, 20+ anti-AI-tell patterns, and a 50-check redesign audit \u2014 token-efficient (list \u2192 drill-down).",
9304
9402
  type: "module",
9305
9403
  main: "./dist/index.js",