@godxjp/ui-mcp 14.0.1 → 15.0.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 +50 -206
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -275,7 +275,7 @@ import { StatCard } from "@godxjp/ui/data-display";
|
|
|
275
275
|
{
|
|
276
276
|
name: "logo",
|
|
277
277
|
type: "ReactNode",
|
|
278
|
-
description: "
|
|
278
|
+
description: "Brand mark at the far-left of the auto-built topbar rail (e.g. an Avatar)."
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
name: "sidebarCollapsed",
|
|
@@ -488,7 +488,7 @@ export default function Shell() {
|
|
|
488
488
|
name: "start",
|
|
489
489
|
type: "ReactNode",
|
|
490
490
|
defaultValue: "undefined",
|
|
491
|
-
description: "Inline-start cluster \u2014 typically the sidebar toggle (a `Button` with a `PanelLeftClose` icon), the brand `
|
|
491
|
+
description: "Inline-start cluster \u2014 typically the sidebar toggle (a `Button` with a `PanelLeftClose` icon), the brand mark (an `Avatar`), and primary nav."
|
|
492
492
|
},
|
|
493
493
|
{
|
|
494
494
|
name: "center",
|
|
@@ -515,25 +515,26 @@ export default function Shell() {
|
|
|
515
515
|
}
|
|
516
516
|
],
|
|
517
517
|
usage: [
|
|
518
|
-
"DO compose the bar yourself: brand `
|
|
518
|
+
"DO compose the bar yourself: a brand mark (an `Avatar`) + sidebar toggle in `start`, a search trigger in `center`, settings pickers + notifications + user menu in `end`. The shell only positions; it never decides WHICH controls exist.",
|
|
519
519
|
'DO build the sidebar toggle as a `Button variant="ghost" size="icon-sm"` with a `PanelLeftClose`/`PanelLeftOpen` icon and your own `t()` aria-label, wired to AppShell\'s `sidebarCollapsed`. There is no baked toggle.',
|
|
520
520
|
"DO put a locale/theme switcher in `end` using `AppSettingPicker` (or your own control) \u2014 icon-only vs labelled, bordered vs not, is THAT component's prop, not Topbar's. Topbar does not ship or force a language picker.",
|
|
521
521
|
"DON'T look for `product`/`project`/`onSearchOpen`/`onNotificationsOpen`/`collapsed` props \u2014 they were removed. A chrome control only exists if YOU put it in a slot, so there is never a dead dropdown / empty search with nothing behind it.",
|
|
522
522
|
"DO render Topbar inside `AppShell`'s `topbar` slot (or any `<header>`). For a non-three-cluster layout, pass `children` and lay it out yourself."
|
|
523
523
|
],
|
|
524
524
|
useCases: [
|
|
525
|
-
"Admin shell: `start` = sidebar toggle +
|
|
526
|
-
"Minimal shell (no search, no notifications): pass only `start` (
|
|
525
|
+
"Admin shell: `start` = sidebar toggle + brand mark (`Avatar`) + an entity switcher (`DropdownMenu` around a `Button`); `center` = a `Button` search trigger; `end` = `AppSettingPicker` (locale) + a notifications `Button` + a user `DropdownMenu`.",
|
|
526
|
+
"Minimal shell (no search, no notifications): pass only `start` (brand mark) and `end` (user menu). Nothing else renders \u2014 no empty chrome.",
|
|
527
527
|
"Marketing / docs header: pass `children` with a fully custom flex layout when the three-cluster model doesn't fit."
|
|
528
528
|
],
|
|
529
529
|
related: [
|
|
530
530
|
"AppShell \u2014 place Topbar in its `topbar` slot. AppShell also exposes its own `logo`/`topbarLeft`/`topbarRight` slots if you don't want a separate Topbar at all.",
|
|
531
|
-
|
|
531
|
+
'Avatar \u2014 the brand mark for the `start` slot (use `className="rounded-md"` for a square-ish product glyph).',
|
|
532
532
|
"AppSettingPicker \u2014 locale/theme/timezone/currency picker; the consumer drops it into `end`. Its appearance (icon-only, labelled, bordered) is configured on IT, not on Topbar.",
|
|
533
533
|
"DropdownMenu \u2014 wrap a `Button` to build an entity switcher or user menu yourself, then place it in a slot."
|
|
534
534
|
],
|
|
535
535
|
example: `import { Topbar, AppShell } from "@godxjp/ui/layout";
|
|
536
|
-
import {
|
|
536
|
+
import { Button } from "@godxjp/ui/general";
|
|
537
|
+
import { Avatar, AvatarFallback } from "@godxjp/ui/data-display";
|
|
537
538
|
import { AppSettingPicker } from "@godxjp/ui/navigation";
|
|
538
539
|
import { PanelLeftClose, Search } from "lucide-react";
|
|
539
540
|
|
|
@@ -547,7 +548,9 @@ import { PanelLeftClose, Search } from "lucide-react";
|
|
|
547
548
|
<Button variant="ghost" size="icon-sm" aria-label={t("toggleSidebar")} onClick={toggle}>
|
|
548
549
|
<PanelLeftClose />
|
|
549
550
|
</Button>
|
|
550
|
-
<
|
|
551
|
+
<Avatar className="rounded-md">
|
|
552
|
+
<AvatarFallback className="bg-primary text-primary-foreground font-bold">C</AvatarFallback>
|
|
553
|
+
</Avatar>
|
|
551
554
|
</>
|
|
552
555
|
}
|
|
553
556
|
center={
|
|
@@ -864,68 +867,11 @@ import { Trash2 } from "lucide-react";
|
|
|
864
867
|
<Heading level={2}>\u8ACB\u6C42\u66F8\u4E00\u89A7</Heading>
|
|
865
868
|
<Heading level={3} tone="muted">\u88DC\u8DB3\u30BB\u30AF\u30B7\u30E7\u30F3</Heading>`
|
|
866
869
|
},
|
|
867
|
-
{
|
|
868
|
-
name: "Logo",
|
|
869
|
-
group: "general",
|
|
870
|
-
tagline: 'Product brand-mark \u2014 the lettermark (or custom SVG) in a tokenized box. Use instead of a hand-rolled `<span className="flex size-8 rounded-md bg-primary font-bold">g</span>` (typography-on-span, literal size/radius).',
|
|
871
|
-
props: [
|
|
872
|
-
{
|
|
873
|
-
name: "glyph",
|
|
874
|
-
type: "ReactNode",
|
|
875
|
-
defaultValue: '"G"',
|
|
876
|
-
description: "The mark \u2014 a short lettermark string or a custom SVG/image node."
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
name: "label",
|
|
880
|
-
type: "string",
|
|
881
|
-
description: 'Accessible product name. When set the mark exposes `role="img"` + `aria-label` (use when the Logo IS the accessible name, e.g. a home link). Omitted \u2192 the mark is `aria-hidden` (decorative; an adjacent wordmark names it).'
|
|
882
|
-
},
|
|
883
|
-
{
|
|
884
|
-
name: "size",
|
|
885
|
-
type: '"xs" | "sm" | "md" | "lg"',
|
|
886
|
-
defaultValue: '"md"',
|
|
887
|
-
description: "Square box size (24 / 28 / 32 / 40). Size comes from the prop, never a literal."
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
name: "shape",
|
|
891
|
-
type: '"default" | "pill" | "sharp"',
|
|
892
|
-
defaultValue: '"default"',
|
|
893
|
-
description: "Corner shape \u2014 `default` (--logo-radius, a service knob), `pill` (fully rounded), `sharp` (square)."
|
|
894
|
-
}
|
|
895
|
-
],
|
|
896
|
-
usage: [
|
|
897
|
-
"DO use Logo for the product glyph in a topbar, sidebar header, or auth shell instead of hand-rolling a styled `<span>`/`<div>` with a literal size + radius + bg (cardinal rules #42/#46).",
|
|
898
|
-
"DO pass `label` when the mark is the only branding AND acts as the accessible name (e.g. wrapped in a home link); omit it when a wordmark sits beside it (then the mark is decorative `aria-hidden`).",
|
|
899
|
-
"DO retheme via tokens \u2014 brand fill follows `--primary`; a service squares/rounds the corner globally via `--logo-radius`. DON'T override size/radius with a raw className.",
|
|
900
|
-
"DON'T put body copy in Logo \u2014 it is a brand mark (bold lettermark / SVG), not a Text/Heading substitute."
|
|
901
|
-
],
|
|
902
|
-
useCases: [
|
|
903
|
-
'Topbar / sidebar header brand mark next to a wordmark: `<Logo /> <Text weight="bold">GoDX</Text>`.',
|
|
904
|
-
'Auth shell (sign-in card) centered product mark with an accessible name: `<Logo size="lg" label="GoDX" />`.',
|
|
905
|
-
'A home link in an app shell where the logo IS the link label: `<a href="/"><Logo label="GoDX \u30DB\u30FC\u30E0" /></a>`.'
|
|
906
|
-
],
|
|
907
|
-
related: [
|
|
908
|
-
"Avatar \u2014 for a USER/person image or initials; Logo is for the PRODUCT/brand mark.",
|
|
909
|
-
"Text / Heading \u2014 for the wordmark or any real copy beside the mark; Logo never holds prose."
|
|
910
|
-
],
|
|
911
|
-
example: `import { Logo, Text } from "@godxjp/ui/general";
|
|
912
|
-
|
|
913
|
-
// Topbar lettermark + wordmark
|
|
914
|
-
<span className="inline-flex items-center gap-2">
|
|
915
|
-
<Logo />
|
|
916
|
-
<Text weight="bold">GoDX</Text>
|
|
917
|
-
</span>
|
|
918
|
-
|
|
919
|
-
// Auth shell, the mark is the accessible name
|
|
920
|
-
<Logo size="lg" label="GoDX" />`,
|
|
921
|
-
storyPath: "general/Logo.stories.tsx",
|
|
922
|
-
rules: [42, 46]
|
|
923
|
-
},
|
|
924
870
|
// ─── data-display ───────────────────────────────────────────────────────
|
|
925
871
|
{
|
|
926
872
|
name: "DataTable",
|
|
927
873
|
group: "data-display",
|
|
928
|
-
tagline: "
|
|
874
|
+
tagline: "The one TanStack-powered compound admin list \u2014 sticky header, sorting, global search, column visibility ('set view'), bulk selection, BOTH cursor and numbered pagination, density, and built-in empty/loading states. Keep the SIMPLE `data` + lean `columns` (ColumnDef) API for the common case; opt into the full grid chrome via the compound parts. Internally driven by @tanstack/react-table (a real dependency). Lives on @godxjp/ui/data-display only (it is NOT on the runtime-neutral root/admin barrel because it pulls TanStack). This is the single table component \u2014 the former DataGrid has been merged in and removed. Never hand-roll a data.length===0 guard around it.",
|
|
929
875
|
props: [
|
|
930
876
|
{
|
|
931
877
|
name: "data",
|
|
@@ -937,7 +883,7 @@ import { Trash2 } from "lucide-react";
|
|
|
937
883
|
name: "columns",
|
|
938
884
|
type: "ColumnDef<T>[]",
|
|
939
885
|
required: true,
|
|
940
|
-
description: "
|
|
886
|
+
description: "Lean column definitions (adapted to TanStack internally). Each column: { key: string; header: ReactNode; render?: (row: T) => ReactNode; sortable?: boolean; width?: string; align?: 'left'|'center'|'right'; hiddenOnMobile?: boolean; enableHiding?: boolean; pin?: 'end' }. If render is omitted, the raw value at row[key] is rendered as a string. sortable opts the column into the sort cycle (client-side by default, or server-side via sort+onSortChange). enableHiding (default true) lists the column in DataTable.ViewOptions; set false to keep a key/actions column always visible. pin:'end' sticks the column (typically row actions) to the inline-end edge on horizontal scroll with a separating shadow \u2014 pin at most one column."
|
|
941
887
|
},
|
|
942
888
|
{
|
|
943
889
|
name: "getRowId",
|
|
@@ -997,13 +943,34 @@ import { Trash2 } from "lucide-react";
|
|
|
997
943
|
},
|
|
998
944
|
{
|
|
999
945
|
name: "sort",
|
|
1000
|
-
type: "{
|
|
1001
|
-
description: "Active sort state. When provided alongside onSortChange, sortable columns show directional arrow icons and
|
|
946
|
+
type: "{ key: string; direction: 'asc' | 'desc' }",
|
|
947
|
+
description: "Active sort state (controlled/server surface). When provided alongside onSortChange, sortable columns show directional arrow icons and clicking the active column twice clears sort (calls onSortChange(undefined)). Omit both sort and onSortChange to sort client-side via TanStack."
|
|
1002
948
|
},
|
|
1003
949
|
{
|
|
1004
950
|
name: "onSortChange",
|
|
1005
|
-
type: "(sort: {
|
|
1006
|
-
description: "Called when a sortable column header is clicked. Receives undefined when sort is cleared (third click on same column)."
|
|
951
|
+
type: "(sort: { key: string; direction: 'asc' | 'desc' } | undefined) => void",
|
|
952
|
+
description: "Called when a sortable column header is clicked. Receives undefined when sort is cleared (third click on same column). Providing sort or onSortChange opts into the controlled (server) sort surface; omit both and the table sorts client-side via TanStack."
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
name: "globalFilter / onGlobalFilterChange",
|
|
956
|
+
type: "string / (next: string) => void",
|
|
957
|
+
description: "Global search term surfaced by DataTable.Search. Omit both for client-side filtering; pass them to drive a server query (with manualFiltering)."
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
name: "pagination / onPaginationChange / rowCount",
|
|
961
|
+
type: "{ pageIndex: number; pageSize: number } / OnChangeFn / number",
|
|
962
|
+
description: "Numbered-pagination state surfaced by DataTable.Pagination (page-size form). For server pagination pass all three (rowCount = total) with manualPagination; omit for client pagination."
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: "columnVisibility / onColumnVisibilityChange",
|
|
966
|
+
type: "VisibilityState / OnChangeFn<VisibilityState>",
|
|
967
|
+
description: "Column show/hide state surfaced by DataTable.ViewOptions ('set view'). Internal if omitted."
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
name: "manualSorting / manualFiltering / manualPagination",
|
|
971
|
+
type: "boolean",
|
|
972
|
+
defaultValue: "false",
|
|
973
|
+
description: "Default false so the simple data+columns case sorts/filters/paginates in-browser. Set the relevant flag true and drive the matching state from your query for server-side behaviour."
|
|
1007
974
|
},
|
|
1008
975
|
{
|
|
1009
976
|
name: "loading",
|
|
@@ -1024,14 +991,15 @@ import { Trash2 } from "lucide-react";
|
|
|
1024
991
|
{
|
|
1025
992
|
name: "children",
|
|
1026
993
|
type: "ReactNode",
|
|
1027
|
-
description: "Compound sub-parts: DataTable.Toolbar, DataTable.BulkActions, DataTable.DensityToggle, DataTable.Pagination, DataTable.Content. If no DataTable.Content is present in children, one is auto-rendered."
|
|
994
|
+
description: "Compound sub-parts: DataTable.Toolbar, DataTable.Search (global filter), DataTable.ViewOptions (column show/hide), DataTable.SelectAll, DataTable.BulkActions (ReactNode children OR a (count)=>node render-prop), DataTable.DensityToggle, DataTable.Pagination (cursor first/next when given cursor+hasMore+onChange, else numbered page-size form), DataTable.RowActions (kebab trigger), DataTable.Content. If no DataTable.Content is present in children, one is auto-rendered."
|
|
1028
995
|
}
|
|
1029
996
|
],
|
|
1030
997
|
usage: [
|
|
1031
998
|
"DO pass loading={isFetching} during data fetches \u2014 it renders a loading row in the table body and suppresses the empty state. Never show a spinner outside DataTable while the table is visible.",
|
|
1032
999
|
"DO NOT add a data.length===0 conditional around DataTable. When data is empty and loading is false, the built-in EmptyState renders automatically. Pass empty={<EmptyState title='...'/>} only when you need a custom message.",
|
|
1033
1000
|
"DO provide getRowId when selectable is true or when rows do not have a string/number 'id' field \u2014 the default falls back to row.id and silently returns '' for missing IDs, which breaks selection.",
|
|
1034
|
-
"DO use DataTable.Toolbar as the immediate child that wraps search/filter controls on the left and DataTable.DensityToggle/action buttons on the right. DataTable.BulkActions inside the toolbar auto-hides when selection count is 0.",
|
|
1001
|
+
"DO use DataTable.Toolbar as the immediate child that wraps search/filter controls on the left and DataTable.DensityToggle/action buttons on the right. DataTable.BulkActions inside the toolbar auto-hides when selection count is 0; it accepts either plain ReactNode children (built-in 'N selected' status bar) or a (count)=>node render-prop (you own the whole bar).",
|
|
1002
|
+
"DO reach for the grid chrome (DataTable.Search, DataTable.ViewOptions, DataTable.Pagination pageSizeOptions) when you need global search, a column 'set view' picker, or numbered pagination \u2014 these are the merged former-DataGrid features, now on the one DataTable. Drive them client-side by default; pass the matching state + manual* flag for a server query.",
|
|
1035
1003
|
"DO use ColumnDef.render for custom cell content (Badge, Link, RowActions). For plain string/number fields render can be omitted \u2014 DataTable falls back to String(row[key]).",
|
|
1036
1004
|
"DO NOT nest DataTable.Content in a conditional \u2014 it is already guarded internally. If you need to override the table body slot, drop exactly one <DataTable.Content /> in children; DataTable auto-detects it by displayName and skips the default."
|
|
1037
1005
|
],
|
|
@@ -1039,7 +1007,8 @@ import { Trash2 } from "lucide-react";
|
|
|
1039
1007
|
"Admin list pages (invoices, customers, orders, accounts) where rows are clickable for detail navigation via onRowClick.",
|
|
1040
1008
|
"Bulk-action workflows (e.g. mark invoices paid, export selected rows) \u2014 use selectable + DataTable.BulkActions to show contextual action buttons only when something is selected.",
|
|
1041
1009
|
"Server-side sorted tables: pass sort + onSortChange and update the data prop after the API call; DataTable renders asc/desc/neutral icons on the header automatically.",
|
|
1042
|
-
"Cursor-paginated lists: add DataTable.Pagination with cursor + hasMore + onChange inside children to get First/Next navigation without offset arithmetic.",
|
|
1010
|
+
"Cursor-paginated lists: add DataTable.Pagination with cursor + hasMore + onChange inside children to get First/Next navigation without offset arithmetic. For page-size + numbered prev/next instead, use DataTable.Pagination with pageSizeOptions (no cursor/onChange) driven by the internal TanStack pagination.",
|
|
1011
|
+
"Full grid screens (global search + column 'set view' + numbered pagination): compose DataTable.Search, DataTable.ViewOptions, DataTable.DensityToggle in the toolbar and DataTable.Pagination pageSizeOptions={[\u2026]} \u2014 client-side by default, or server-side by passing globalFilter/pagination/sort state with the matching manual* flag.",
|
|
1043
1012
|
"Responsive admin tables where lower-priority columns (e.g. internal IDs, dates) should collapse below mobile breakpoints \u2014 set hiddenOnMobile: true on those ColumnDef entries.",
|
|
1044
1013
|
"Loading skeletons during initial page load or filter change: set loading={true} alongside an empty data={[]} to show the loading row without flashing an empty state."
|
|
1045
1014
|
],
|
|
@@ -1062,10 +1031,10 @@ type Invoice = {
|
|
|
1062
1031
|
};
|
|
1063
1032
|
|
|
1064
1033
|
const columns: ColumnDef<Invoice>[] = [
|
|
1065
|
-
{
|
|
1066
|
-
{
|
|
1034
|
+
{ key: "id", header: "Invoice #", width: "w-32" },
|
|
1035
|
+
{ key: "customer", header: "Customer" },
|
|
1067
1036
|
{
|
|
1068
|
-
|
|
1037
|
+
key: "status",
|
|
1069
1038
|
header: "Status",
|
|
1070
1039
|
render: (row) => (
|
|
1071
1040
|
<Badge
|
|
@@ -1077,7 +1046,7 @@ const columns: ColumnDef<Invoice>[] = [
|
|
|
1077
1046
|
</Badge>
|
|
1078
1047
|
),
|
|
1079
1048
|
},
|
|
1080
|
-
{
|
|
1049
|
+
{ key: "amount", header: "Amount", align: "right", sortable: true },
|
|
1081
1050
|
];
|
|
1082
1051
|
|
|
1083
1052
|
export default function InvoiceList({
|
|
@@ -1088,7 +1057,7 @@ export default function InvoiceList({
|
|
|
1088
1057
|
loading: boolean;
|
|
1089
1058
|
}) {
|
|
1090
1059
|
const [selected, setSelected] = useState<Set<string>>(new Set());
|
|
1091
|
-
const [sort, setSort] = useState<{
|
|
1060
|
+
const [sort, setSort] = useState<{ key: string; direction: "asc" | "desc" } | undefined>();
|
|
1092
1061
|
|
|
1093
1062
|
return (
|
|
1094
1063
|
<DataTable
|
|
@@ -1122,106 +1091,6 @@ export default function InvoiceList({
|
|
|
1122
1091
|
storyPath: "data-display/DataTable.stories.tsx",
|
|
1123
1092
|
rules: [24, 31, 35, 37]
|
|
1124
1093
|
},
|
|
1125
|
-
{
|
|
1126
|
-
name: "DataGrid",
|
|
1127
|
-
group: "data-display",
|
|
1128
|
-
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.",
|
|
1129
|
-
props: [
|
|
1130
|
-
{
|
|
1131
|
-
name: "columns",
|
|
1132
|
-
type: "ColumnDef<T, unknown>[]",
|
|
1133
|
-
required: true,
|
|
1134
|
-
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."
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
name: "data",
|
|
1138
|
-
type: "T[]",
|
|
1139
|
-
required: true,
|
|
1140
|
-
description: "Row data. Empty + loading=false renders a built-in EmptyState in the body."
|
|
1141
|
-
},
|
|
1142
|
-
{
|
|
1143
|
-
name: "getRowId",
|
|
1144
|
-
type: "(row: T) => string",
|
|
1145
|
-
description: "Stable row id (defaults to row[rowIdKey], rowIdKey defaults to 'id')."
|
|
1146
|
-
},
|
|
1147
|
-
{
|
|
1148
|
-
name: "enableRowSelection",
|
|
1149
|
-
type: "boolean",
|
|
1150
|
-
defaultValue: "false",
|
|
1151
|
-
description: "Adds a checkbox column + header select-all; pair with DataGrid.BulkActions."
|
|
1152
|
-
},
|
|
1153
|
-
{
|
|
1154
|
-
name: "sorting / onSortingChange",
|
|
1155
|
-
type: "SortingState / OnChangeFn<SortingState>",
|
|
1156
|
-
description: "Server sort: pass both and sort in your query (manualSorting defaults true). Omit both for client sort."
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
name: "globalFilter / onGlobalFilterChange",
|
|
1160
|
-
type: "string / OnChangeFn<string>",
|
|
1161
|
-
description: "Global search term, surfaced by DataGrid.Search. Server or client like sorting."
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
name: "pagination / onPaginationChange / rowCount",
|
|
1165
|
-
type: "PaginationState / OnChangeFn / number",
|
|
1166
|
-
description: "Server pagination: pass pagination + onPaginationChange + rowCount (total). Omit for client pagination."
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
name: "columnVisibility / onColumnVisibilityChange",
|
|
1170
|
-
type: "VisibilityState / OnChangeFn<VisibilityState>",
|
|
1171
|
-
description: "Column show/hide state surfaced by DataGrid.ViewOptions ('set view'). Internal if omitted."
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
name: "manualSorting / manualFiltering / manualPagination",
|
|
1175
|
-
type: "boolean",
|
|
1176
|
-
defaultValue: "true",
|
|
1177
|
-
description: "Default true (server/AJAX). Set false to let TanStack sort/filter/paginate in-browser."
|
|
1178
|
-
},
|
|
1179
|
-
{
|
|
1180
|
-
name: "loading / density / onRowClick / empty",
|
|
1181
|
-
type: "boolean / 'compact'|'comfortable' / (row:T)=>void / ReactNode",
|
|
1182
|
-
description: "Loading row, controlled density, clickable rows, custom empty content."
|
|
1183
|
-
}
|
|
1184
|
-
],
|
|
1185
|
-
usage: [
|
|
1186
|
-
"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.",
|
|
1187
|
-
"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=[...]>.",
|
|
1188
|
-
"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."
|
|
1189
|
-
],
|
|
1190
|
-
useCases: [
|
|
1191
|
-
"Server-paginated \u4ED5\u8A33 (journal entry) or \u8ACB\u6C42 (invoice) admin list backed by an AJAX/useQuery endpoint: drive sorting + globalFilter + pagination from the query and pass rowCount \u2014 the grid never loads the whole table into the browser. (Prefer DataTable here if the screen must NOT pull @tanstack/react-table.)",
|
|
1192
|
-
"Member / employee directory with a user-toggled 'set view' column picker (DataGrid.ViewOptions) \u2014 let admins hide columns like \u5165\u793E\u65E5 or \u90E8\u7F72 they don't need, persisting the columnVisibility state per user.",
|
|
1193
|
-
"Bulk-operation worklist (e.g. approve/export selected \u7D4C\u8CBB\u7CBE\u7B97 rows): enableRowSelection + DataGrid.BulkActions to show a 'N\u4EF6\u9078\u629E\u4E2D' action bar with \u4E00\u62EC\u627F\u8A8D / CSV\u51FA\u529B buttons only when rows are checked.",
|
|
1194
|
-
"Dense reconciliation or ledger table where operators flip between compact and comfortable row height via DataGrid.DensityToggle to fit more rows on screen during data-entry-heavy sessions.",
|
|
1195
|
-
"Client-side grid for a fully-loaded small dataset (e.g. a fixed master list of \u52D8\u5B9A\u79D1\u76EE): set manualSorting/manualFiltering/manualPagination={false} so TanStack sorts, searches, and paginates in-browser without any server round-trip."
|
|
1196
|
-
],
|
|
1197
|
-
related: ["DataTable", "Table", "DataState", "Select", "DropdownMenu"],
|
|
1198
|
-
example: `import { DataGrid, type ColumnDef } from "@godxjp/ui/data-grid";
|
|
1199
|
-
import { Flex } from "@godxjp/ui/layout";
|
|
1200
|
-
|
|
1201
|
-
type Row = { id: string; name: string; amount: number };
|
|
1202
|
-
const columns: ColumnDef<Row, unknown>[] = [
|
|
1203
|
-
{ accessorKey: "name", header: "Name", meta: { label: "Name" } },
|
|
1204
|
-
{ accessorKey: "amount", header: "Amount", meta: { label: "Amount" } },
|
|
1205
|
-
];
|
|
1206
|
-
|
|
1207
|
-
export function Grid({ rows }: { rows: Row[] }) {
|
|
1208
|
-
return (
|
|
1209
|
-
<DataGrid columns={columns} data={rows} getRowId={(r) => r.id} enableRowSelection manualSorting={false} manualFiltering={false} manualPagination={false}>
|
|
1210
|
-
<DataGrid.Toolbar>
|
|
1211
|
-
<Flex direction="row" align="center" gap="sm" className="ms-auto">
|
|
1212
|
-
<DataGrid.Search />
|
|
1213
|
-
<DataGrid.ViewOptions />
|
|
1214
|
-
<DataGrid.DensityToggle />
|
|
1215
|
-
</Flex>
|
|
1216
|
-
</DataGrid.Toolbar>
|
|
1217
|
-
<DataGrid.Content />
|
|
1218
|
-
<DataGrid.Pagination pageSizeOptions={[10, 20, 50]} />
|
|
1219
|
-
</DataGrid>
|
|
1220
|
-
);
|
|
1221
|
-
}`,
|
|
1222
|
-
storyPath: "data-display/DataGrid.stories.tsx",
|
|
1223
|
-
rules: [24, 31, 35, 37]
|
|
1224
|
-
},
|
|
1225
1094
|
{
|
|
1226
1095
|
name: "Card",
|
|
1227
1096
|
group: "data-display",
|
|
@@ -6857,7 +6726,7 @@ export default function PasswordBlock() {
|
|
|
6857
6726
|
"DON'T hand-roll a positioned `<div>` + `onContextMenu={e => e.preventDefault()}` \u2014 the primitive already gives you keyboard navigation, focus trapping, typeahead, and WAI-ARIA menu semantics for free."
|
|
6858
6727
|
],
|
|
6859
6728
|
useCases: [
|
|
6860
|
-
"Right-click actions on a DataTable
|
|
6729
|
+
"Right-click actions on a DataTable row (\u8A73\u7D30 / \u8907\u88FD / \u524A\u9664) as a power-user accelerator alongside the visible row action button.",
|
|
6861
6730
|
"Contextual menu on a file or document tile in an upload/asset manager (\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9 / \u540D\u524D\u5909\u66F4 / \u524A\u9664).",
|
|
6862
6731
|
"Nested action menu with submenus and shortcuts (e.g. '\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 \u25B8 CSV / PDF') on a report card.",
|
|
6863
6732
|
"Stateful toggles on a board/kanban card via ContextMenuCheckboxItem (e.g. \u30D4\u30F3\u7559\u3081, \u5B8C\u4E86\u3068\u3057\u3066\u30DE\u30FC\u30AF)."
|
|
@@ -8442,31 +8311,6 @@ var COMPONENT_TOKENS = [
|
|
|
8442
8311
|
"value": "1px solid hsl(var(--border))",
|
|
8443
8312
|
"description": "ListRow component tokens \u2014 a single-line entity row for short lists inside a Card * (sessions / API tokens / linked accounts / passkeys \u2026). Sits in a flush CardContent; * rows separate with a quiet divider (#44 \u2014 chrome defaults to the calm semantic border)."
|
|
8444
8313
|
},
|
|
8445
|
-
{
|
|
8446
|
-
"name": "--logo-size",
|
|
8447
|
-
"value": "2rem",
|
|
8448
|
-
"description": "Logo (brand mark) component tokens. Box size and corner radius are knobs (#45) so a service can * match its own grid without forking the mark; brand fill follows --primary. The `size` prop picks * the step; a service retunes the steps globally here. (Not a --control-height tier \u2014 the mark is * decorative, not a density-aware interactive control.)"
|
|
8449
|
-
},
|
|
8450
|
-
{
|
|
8451
|
-
"name": "--logo-size-xs",
|
|
8452
|
-
"value": "1.5rem",
|
|
8453
|
-
"description": "md"
|
|
8454
|
-
},
|
|
8455
|
-
{
|
|
8456
|
-
"name": "--logo-size-sm",
|
|
8457
|
-
"value": "1.75rem",
|
|
8458
|
-
"description": "md"
|
|
8459
|
-
},
|
|
8460
|
-
{
|
|
8461
|
-
"name": "--logo-size-lg",
|
|
8462
|
-
"value": "2.5rem",
|
|
8463
|
-
"description": "md"
|
|
8464
|
-
},
|
|
8465
|
-
{
|
|
8466
|
-
"name": "--logo-radius",
|
|
8467
|
-
"value": "var(--radius)",
|
|
8468
|
-
"description": "md"
|
|
8469
|
-
},
|
|
8470
8314
|
{
|
|
8471
8315
|
"name": "--pagination-gap",
|
|
8472
8316
|
"value": "var(--space-inline-sm)",
|
|
@@ -12674,7 +12518,7 @@ ${c.example}
|
|
|
12674
12518
|
// package.json
|
|
12675
12519
|
var package_default = {
|
|
12676
12520
|
name: "@godxjp/ui-mcp",
|
|
12677
|
-
version: "
|
|
12521
|
+
version: "15.0.0",
|
|
12678
12522
|
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, 45 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).",
|
|
12679
12523
|
type: "module",
|
|
12680
12524
|
main: "./dist/index.js",
|