@godxjp/ui 14.0.0 → 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/README.md +30 -27
- package/dist/components/admin/index.d.ts +0 -2
- package/dist/components/admin/index.js +0 -2
- package/dist/components/data-display/data-table.d.ts +58 -5
- package/dist/components/data-display/data-table.js +332 -78
- package/dist/components/data-display/index.d.ts +1 -1
- package/dist/components/data-display/index.js +2 -1
- package/dist/components/data-entry/search-input.d.ts +2 -1
- package/dist/components/data-entry/search-input.js +1 -1
- package/dist/components/general/index.d.ts +0 -2
- package/dist/components/general/index.js +1 -4
- package/dist/components/layout/topbar.d.ts +4 -4
- package/dist/props/components/layout.prop.d.ts +2 -2
- package/dist/props/vocabulary/data.prop.d.ts +6 -0
- package/dist/styles/density.css +62 -0
- package/dist/tokens/base.css +0 -1
- package/package.json +5 -11
- package/scripts/ui-audit.mjs +6 -1
- package/dist/components/data-grid/data-grid.d.ts +0 -67
- package/dist/components/data-grid/data-grid.js +0 -402
- package/dist/components/data-grid/index.d.ts +0 -2
- package/dist/components/data-grid/index.js +0 -4
- package/dist/components/general/logo.d.ts +0 -28
- package/dist/components/general/logo.js +0 -45
- package/dist/tokens/components/logo.css +0 -11
|
@@ -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 `
|
|
8
|
-
* user menu) and drops them into a slot. Whether a control is icon-only, labelled,
|
|
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 /><
|
|
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
|
* />
|
|
@@ -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 `
|
|
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 `
|
|
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.
|
package/dist/styles/density.css
CHANGED
|
@@ -29,3 +29,65 @@
|
|
|
29
29
|
:root[data-density="comfortable"] {
|
|
30
30
|
--scaling: 1.08;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* A DESCENDANT density scope (`.ui-density-*` from `<PageContainer density>`) must
|
|
35
|
+
* RE-DERIVE every --scaling-tied token, not just flip --scaling. CSS substitutes
|
|
36
|
+
* `var(--scaling)` at the element that DECLARES a token, so the size tokens declared
|
|
37
|
+
* at `:root` (foundation/control/table) are baked with the ROOT --scaling and inherit
|
|
38
|
+
* as fixed values — a subtree that only sets a new --scaling can't retune them. (Same
|
|
39
|
+
* reason `.ui-scale-fixed` re-declares the whole list.) Mirror that list here, scaled
|
|
40
|
+
* by the LOCAL --scaling, so controls/spacing in the subtree actually resize. The
|
|
41
|
+
* `:root[data-density]` selectors above need ONLY --scaling: they re-declare on the
|
|
42
|
+
* same element as the :root token formulas, so those re-resolve there.
|
|
43
|
+
*
|
|
44
|
+
* density.css is a registered tier-definition file (check-control-sizing), so the
|
|
45
|
+
* `calc(var(--control-height) ± …)` tier offsets are permitted here.
|
|
46
|
+
*/
|
|
47
|
+
.ui-density-compact,
|
|
48
|
+
.ui-density-default,
|
|
49
|
+
.ui-density-comfortable {
|
|
50
|
+
--space-1: calc(0.25rem * var(--scaling));
|
|
51
|
+
--space-2: calc(0.5rem * var(--scaling));
|
|
52
|
+
--space-3: calc(0.75rem * var(--scaling));
|
|
53
|
+
--space-4: calc(1rem * var(--scaling));
|
|
54
|
+
--space-5: calc(1.25rem * var(--scaling));
|
|
55
|
+
--space-6: calc(1.5rem * var(--scaling));
|
|
56
|
+
--space-8: calc(2rem * var(--scaling));
|
|
57
|
+
--space-10: calc(2.5rem * var(--scaling));
|
|
58
|
+
--space-12: calc(3rem * var(--scaling));
|
|
59
|
+
--radius: calc(0.375rem * var(--scaling));
|
|
60
|
+
--control-height: calc(var(--control-height-default) * var(--scaling));
|
|
61
|
+
--control-height-sm: calc(var(--control-height) - calc(0.25rem * var(--scaling)));
|
|
62
|
+
--control-height-lg: calc(var(--control-height) + calc(0.25rem * var(--scaling)));
|
|
63
|
+
--control-height-xs: calc(var(--control-height) - calc(0.5rem * var(--scaling)));
|
|
64
|
+
--control-icon-size: calc(1rem * var(--scaling));
|
|
65
|
+
--control-icon-size-sm: calc(0.875rem * var(--scaling));
|
|
66
|
+
--control-padding-x: var(--space-3);
|
|
67
|
+
--control-gap: var(--space-2);
|
|
68
|
+
--control-gap-sm: var(--space-1);
|
|
69
|
+
--checkbox-size: calc(1rem * var(--scaling));
|
|
70
|
+
--switch-width: calc(2.25rem * var(--scaling));
|
|
71
|
+
--switch-height: calc(1.25rem * var(--scaling));
|
|
72
|
+
--switch-thumb-size: calc(1rem * var(--scaling));
|
|
73
|
+
--switch-thumb-translate: calc(1rem * var(--scaling));
|
|
74
|
+
--table-row-height: calc(var(--table-row-height-default) * var(--scaling));
|
|
75
|
+
--table-cell-padding-y: var(--space-2);
|
|
76
|
+
--phi-unit: var(--space-4);
|
|
77
|
+
--space-page-x: var(--space-6);
|
|
78
|
+
--space-page-y: var(--space-6);
|
|
79
|
+
--space-section: var(--space-4);
|
|
80
|
+
--space-stack-xs: var(--space-1);
|
|
81
|
+
--space-stack-sm: var(--space-2);
|
|
82
|
+
--space-stack-md: var(--space-4);
|
|
83
|
+
--space-stack-lg: var(--space-6);
|
|
84
|
+
--space-stack-xl: var(--space-10);
|
|
85
|
+
--space-inline-xs: var(--space-1);
|
|
86
|
+
--space-inline-sm: var(--space-2);
|
|
87
|
+
--space-inline-md: var(--space-3);
|
|
88
|
+
--space-inline-lg: var(--space-4);
|
|
89
|
+
--space-chrome-x: var(--space-6);
|
|
90
|
+
--space-chrome-y: var(--space-4);
|
|
91
|
+
--space-chrome-gap: var(--space-2);
|
|
92
|
+
--field-label-gap: var(--space-2);
|
|
93
|
+
}
|
package/dist/tokens/base.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
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",
|
|
@@ -295,6 +292,7 @@
|
|
|
295
292
|
"preview:build": "vite build --config preview/vite.config.ts",
|
|
296
293
|
"docs:sync-primitives": "node preview/scripts/sync-primitive-docs.mjs && prettier --write \"docs/primitives/**/*.tsx\"",
|
|
297
294
|
"audit": "node scripts/ui-audit.mjs",
|
|
295
|
+
"audit:examples": "node scripts/ui-audit.mjs docs",
|
|
298
296
|
"build": "tsup && tsc -p tsconfig.build.json && node scripts/copy-styles.mjs",
|
|
299
297
|
"dev": "node scripts/dev.mjs",
|
|
300
298
|
"prepublishOnly": "pnpm run build",
|
|
@@ -306,7 +304,6 @@
|
|
|
306
304
|
"peerDependencies": {
|
|
307
305
|
"@hookform/resolvers": "^5.2.0",
|
|
308
306
|
"@tanstack/react-query": ">=5.0.0",
|
|
309
|
-
"@tanstack/react-table": ">=8.0.0",
|
|
310
307
|
"react": ">=19.0.0",
|
|
311
308
|
"react-dom": ">=19.0.0",
|
|
312
309
|
"react-hook-form": "^7.76.0",
|
|
@@ -319,9 +316,6 @@
|
|
|
319
316
|
"axe-core": "*"
|
|
320
317
|
},
|
|
321
318
|
"peerDependenciesMeta": {
|
|
322
|
-
"@tanstack/react-table": {
|
|
323
|
-
"optional": true
|
|
324
|
-
},
|
|
325
319
|
"recharts": {
|
|
326
320
|
"optional": true
|
|
327
321
|
},
|
|
@@ -337,6 +331,7 @@
|
|
|
337
331
|
},
|
|
338
332
|
"dependencies": {
|
|
339
333
|
"@date-fns/tz": "^1.5.0",
|
|
334
|
+
"@tanstack/react-table": "^8.21.3",
|
|
340
335
|
"@fontsource/m-plus-2": "^5.2.9",
|
|
341
336
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
342
337
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
@@ -384,7 +379,6 @@
|
|
|
384
379
|
"@hookform/resolvers": "^5.2.2",
|
|
385
380
|
"@tailwindcss/vite": "^4.2.4",
|
|
386
381
|
"@tanstack/react-query": "^5.100.9",
|
|
387
|
-
"@tanstack/react-table": "^8.21.3",
|
|
388
382
|
"@testing-library/jest-dom": "^6.9.1",
|
|
389
383
|
"@testing-library/react": "^16.3.2",
|
|
390
384
|
"@testing-library/user-event": "^14.6.1",
|
package/scripts/ui-audit.mjs
CHANGED
|
@@ -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 (
|
|
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;
|