@godxjp/ui 14.0.1 → 15.0.1

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.
@@ -4,12 +4,12 @@ export type { TopbarProp, TopbarProp as TopbarProps } from "../../props/componen
4
4
  * Topbar — a PURE SLOT bar. It positions three clusters (`start` / `center` / `end`) and owns the
5
5
  * bar's flex layout; it does NOT bake any chrome. There is no built-in product switcher, search
6
6
  * box, notification bell, or language picker — the CONSUMER composes those from real primitives
7
- * (brand `Logo`, a `Button` search trigger, `AppSettingPicker` for locale/theme, a `DropdownMenu`
8
- * user menu) and drops them into a slot. Whether a control is icon-only, labelled, bordered, etc.
9
- * is that control's OWN configuration — never the shell's to dictate.
7
+ * (a brand mark `Avatar`, a `Button` search trigger, `AppSettingPicker` for locale/theme, a
8
+ * `DropdownMenu` user menu) and drops them into a slot. Whether a control is icon-only, labelled,
9
+ * bordered, etc. is that control's OWN configuration — never the shell's to dictate.
10
10
  *
11
11
  * <Topbar
12
- * start={<><SidebarToggle /><Logo label="" /></>}
12
+ * start={<><SidebarToggle /><Avatar className="rounded-md"><AvatarFallback>C</AvatarFallback></Avatar></>}
13
13
  * center={<Button variant="outline" onClick={openSearch}><Search />検索</Button>}
14
14
  * end={<><AppSettingPicker kind="locale" /><UserMenu /></>}
15
15
  * />
@@ -164,7 +164,7 @@ function Pagination({
164
164
  /* @__PURE__ */ jsx(
165
165
  SelectTrigger,
166
166
  {
167
- className: "ui-pagination-size-trigger",
167
+ className: "ui-pagination-size-trigger w-[var(--pagination-size-width)]",
168
168
  "aria-label": t("navigation.pagination.pageSize"),
169
169
  children: /* @__PURE__ */ jsx(SelectValue, {})
170
170
  }
@@ -105,13 +105,13 @@ export type SidebarProp = {
105
105
  };
106
106
  /**
107
107
  * @see Topbar — a PURE SLOT bar (no baked chrome). The library only positions three clusters; the
108
- * CONSUMER decides what goes in each (brand `Logo`, sidebar toggle, nav, a search trigger, settings
108
+ * CONSUMER decides what goes in each (a brand mark `Avatar`, sidebar toggle, nav, a search trigger, settings
109
109
  * pickers like `AppSettingPicker`, a notification button, a user menu). The shell never forces a
110
110
  * product switcher, a search box, or a language picker — those are the consumer's components,
111
111
  * configured via THEIR own props and dropped into a slot.
112
112
  */
113
113
  export type TopbarProp = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
114
- /** Inline-start cluster — typically the sidebar toggle + brand `Logo` + primary nav. */
114
+ /** Inline-start cluster — typically the sidebar toggle + a brand mark (`Avatar`) + primary nav. */
115
115
  start?: ReactNode;
116
116
  /** Center cluster — optional (e.g. a search trigger or a page/entity switcher). */
117
117
  center?: ReactNode;
@@ -18,6 +18,12 @@ export type ColumnDefProp<T> = {
18
18
  width?: string;
19
19
  align?: ColumnAlignProp;
20
20
  hiddenOnMobile?: boolean;
21
+ /**
22
+ * List this column in DataTable.ViewOptions (the column show/hide "set view"
23
+ * menu). Defaults to true; set false to keep a column always visible (e.g. a
24
+ * primary key or a pinned actions column).
25
+ */
26
+ enableHiding?: boolean;
21
27
  /**
22
28
  * Pin the column to the inline-end edge so it stays visible while the rest of
23
29
  * the table scrolls horizontally — the standard home for a row-actions column.
@@ -84,8 +84,14 @@
84
84
  justify-content: space-evenly;
85
85
  }
86
86
 
87
- .ui-flex-gap-xs,
87
+ .ui-flex-gap-xs {
88
+ gap: var(--space-stack-xs);
89
+ }
90
+ /* Match the other `.ui-stack-*` sizes: a stack is a vertical column, not a row.
91
+ * Without this, `gap="xs"` stacks (e.g. ToolbarGroup label + control) laid out
92
+ * as a row and squeezed CJK labels into a vertical wrap. */
88
93
  .ui-stack-xs {
94
+ flex-direction: column;
89
95
  gap: var(--space-stack-xs);
90
96
  }
91
97
  .ui-flex-gap-sm {
@@ -591,8 +597,7 @@
591
597
  font-variant-numeric: tabular-nums;
592
598
  }
593
599
 
594
- .ui-toolbar,
595
- .ui-filter-bar {
600
+ .ui-toolbar {
596
601
  display: flex;
597
602
  flex-direction: column;
598
603
  gap: var(--filter-bar-gap);
@@ -600,41 +605,35 @@
600
605
  }
601
606
 
602
607
  @media (min-width: 640px) {
603
- .ui-toolbar,
604
- .ui-filter-bar {
608
+ .ui-toolbar {
605
609
  flex-flow: row wrap;
606
610
  align-items: flex-end;
607
611
  }
608
612
  }
609
613
 
610
- .ui-toolbar-clear,
611
- .ui-filter-clear {
614
+ .ui-toolbar-clear {
612
615
  width: 100%;
613
616
  }
614
617
 
615
618
  @media (min-width: 640px) {
616
- .ui-toolbar-clear,
617
- .ui-filter-clear {
619
+ .ui-toolbar-clear {
618
620
  width: auto;
619
621
  margin-inline-start: auto;
620
622
  }
621
623
  }
622
624
 
623
- .ui-toolbar-group,
624
- .ui-filter-group {
625
+ .ui-toolbar-group {
625
626
  min-width: 0;
626
627
  width: 100%;
627
628
  }
628
629
 
629
630
  @media (min-width: 640px) {
630
- .ui-toolbar-group,
631
- .ui-filter-group {
631
+ .ui-toolbar-group {
632
632
  width: auto;
633
633
  }
634
634
  }
635
635
 
636
- .ui-toolbar-label,
637
- .ui-filter-label {
636
+ .ui-toolbar-label {
638
637
  display: flex;
639
638
  align-items: center;
640
639
  color: hsl(var(--muted-foreground));
@@ -15,6 +15,5 @@
15
15
  @import "./components/navigation.css";
16
16
  @import "./components/data-display.css";
17
17
  @import "./components/list-row.css";
18
- @import "./components/logo.css";
19
18
  @import "./components/data-entry.css";
20
19
  @import "./components/shell.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@godxjp/ui",
3
- "version": "14.0.1",
3
+ "version": "15.0.1",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@10.29.1",
6
6
  "sideEffects": false,
@@ -54,10 +54,6 @@
54
54
  "types": "./dist/components/query/index.d.ts",
55
55
  "import": "./dist/components/query/index.js"
56
56
  },
57
- "./data-grid": {
58
- "types": "./dist/components/data-grid/index.d.ts",
59
- "import": "./dist/components/data-grid/index.js"
60
- },
61
57
  "./charts": {
62
58
  "types": "./dist/components/charts/index.d.ts",
63
59
  "import": "./dist/components/charts/index.js"
@@ -269,6 +265,7 @@
269
265
  },
270
266
  "scripts": {
271
267
  "typecheck": "tsc --noEmit -p tsconfig.json",
268
+ "typecheck:docs": "tsc --noEmit -p tsconfig.docs.json",
272
269
  "lint": "eslint .",
273
270
  "lint:fix": "eslint . --fix",
274
271
  "format": "prettier --check .",
@@ -278,7 +275,7 @@
278
275
  "test:coverage": "vitest run --coverage",
279
276
  "check:example-imports": "node scripts/check-example-imports.mjs",
280
277
  "verify": "pnpm typecheck && pnpm lint && pnpm format && pnpm build && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-token-sync && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm check:audit-sync && pnpm test",
281
- "verify:release": "pnpm typecheck && pnpm lint && pnpm build && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-token-sync && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm check:audit-sync && pnpm check:mcp-prop-sync && pnpm test",
278
+ "verify:release": "pnpm typecheck && pnpm typecheck:docs && pnpm lint && pnpm build && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-token-sync && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm check:audit-sync && pnpm check:mcp-prop-sync && pnpm test",
282
279
  "check:mcp-sync": "node scripts/check-mcp-sync.mjs",
283
280
  "check:mcp-orphans": "node scripts/check-mcp-orphans.mjs",
284
281
  "check:mcp-prop-sync": "node scripts/check-mcp-prop-sync.mjs",
@@ -307,7 +304,6 @@
307
304
  "peerDependencies": {
308
305
  "@hookform/resolvers": "^5.2.0",
309
306
  "@tanstack/react-query": ">=5.0.0",
310
- "@tanstack/react-table": ">=8.0.0",
311
307
  "react": ">=19.0.0",
312
308
  "react-dom": ">=19.0.0",
313
309
  "react-hook-form": "^7.76.0",
@@ -320,9 +316,6 @@
320
316
  "axe-core": "*"
321
317
  },
322
318
  "peerDependenciesMeta": {
323
- "@tanstack/react-table": {
324
- "optional": true
325
- },
326
319
  "recharts": {
327
320
  "optional": true
328
321
  },
@@ -338,6 +331,7 @@
338
331
  },
339
332
  "dependencies": {
340
333
  "@date-fns/tz": "^1.5.0",
334
+ "@tanstack/react-table": "^8.21.3",
341
335
  "@fontsource/m-plus-2": "^5.2.9",
342
336
  "@radix-ui/react-accordion": "^1.2.12",
343
337
  "@radix-ui/react-alert-dialog": "^1.1.15",
@@ -385,7 +379,6 @@
385
379
  "@hookform/resolvers": "^5.2.2",
386
380
  "@tailwindcss/vite": "^4.2.4",
387
381
  "@tanstack/react-query": "^5.100.9",
388
- "@tanstack/react-table": "^8.21.3",
389
382
  "@testing-library/jest-dom": "^6.9.1",
390
383
  "@testing-library/react": "^16.3.2",
391
384
  "@testing-library/user-event": "^14.6.1",
@@ -387,8 +387,13 @@ function walk(dir, acc = []) {
387
387
  const full = join(dir, name);
388
388
  const st = statSync(full);
389
389
  if (st.isDirectory()) {
390
+ // Test/story dirs are not product UI — never hold them to the UI-standardization rules.
391
+ if (name === "__tests__" || name === "node_modules") continue;
390
392
  walk(full, acc);
391
- } else if (name.endsWith(".tsx") || name.endsWith(".ts")) {
393
+ } else if (
394
+ (name.endsWith(".tsx") || name.endsWith(".ts")) &&
395
+ !/\.(test|spec|stories)\.tsx?$/.test(name)
396
+ ) {
392
397
  acc.push(full);
393
398
  }
394
399
  }
@@ -1,67 +0,0 @@
1
- import * as React from "react";
2
- import { type ColumnDef, type ColumnFiltersState, type OnChangeFn, type PaginationState, type RowSelectionState, type RowData, type SortingState, type VisibilityState } from "@tanstack/react-table";
3
- import type { TableDensityProp } from "../../props/vocabulary";
4
- export type DataGridDensity = TableDensityProp;
5
- export type { ColumnDef } from "@tanstack/react-table";
6
- declare module "@tanstack/react-table" {
7
- interface ColumnMeta<TData extends RowData, TValue> {
8
- label?: React.ReactNode;
9
- }
10
- }
11
- export interface DataGridProps<T> {
12
- columns: ColumnDef<T, unknown>[];
13
- data: T[];
14
- getRowId?: (row: T) => string;
15
- /** Stable id key when getRowId is omitted (defaults to "id"). */
16
- rowIdKey?: keyof T & string;
17
- sorting?: SortingState;
18
- onSortingChange?: OnChangeFn<SortingState>;
19
- columnFilters?: ColumnFiltersState;
20
- onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
21
- globalFilter?: string;
22
- onGlobalFilterChange?: OnChangeFn<string>;
23
- pagination?: PaginationState;
24
- onPaginationChange?: OnChangeFn<PaginationState>;
25
- /** Total server row count (manual pagination) — drives the page count. */
26
- rowCount?: number;
27
- rowSelection?: RowSelectionState;
28
- onRowSelectionChange?: OnChangeFn<RowSelectionState>;
29
- enableRowSelection?: boolean;
30
- columnVisibility?: VisibilityState;
31
- onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
32
- manualSorting?: boolean;
33
- manualFiltering?: boolean;
34
- manualPagination?: boolean;
35
- density?: DataGridDensity;
36
- onDensityChange?: (d: DataGridDensity) => void;
37
- loading?: boolean;
38
- empty?: React.ReactNode;
39
- onRowClick?: (row: T) => void;
40
- className?: string;
41
- children?: React.ReactNode;
42
- }
43
- interface DataGridComponent {
44
- <T>(props: DataGridProps<T>): React.ReactElement;
45
- Toolbar: React.FC<{
46
- children?: React.ReactNode;
47
- className?: string;
48
- }>;
49
- Search: React.FC<{
50
- placeholder?: string;
51
- className?: string;
52
- }>;
53
- ViewOptions: React.FC<{
54
- className?: string;
55
- }>;
56
- BulkActions: React.FC<{
57
- children: (count: number) => React.ReactNode;
58
- }>;
59
- DensityToggle: React.FC;
60
- Content: React.FC;
61
- Pagination: React.FC<{
62
- pageSizeOptions?: number[];
63
- className?: string;
64
- }>;
65
- displayName?: string;
66
- }
67
- export declare const DataGrid: DataGridComponent;