@nadicodeai/ui 12.1.167 → 12.1.168
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/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +6 -3
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +23 -22
- package/dist/components/table-layouts.d.ts +8 -0
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +8 -0
- package/dist/internal/table-compact-line.d.ts +23 -5
- package/dist/internal/table-compact-line.d.ts.map +1 -1
- package/dist/internal/table-compact-line.js +28 -7
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EAGnB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,WAAW,EAIX,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,SAAS,EAGd,KAAK,OAAO,EAGb,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAU9E,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EACtB,mB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AC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;CACzC,CAAC;AAEF,6GAA6G;AAC7G,KAAK,gBAAgB,CAAC,KAAK,SAAS,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG;IACrE,SAAS,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,sFAAsF;IACtF,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,UAAU,GAAG,IAAI,CAAC;IAC5C,8GAA8G;IAC9G,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;CAChD,CAAC;AA4EF,wBAAgB,eAAe,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,SAAS,QAAQ,GAAG,QAAQ,EACvF,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG;IACnD,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;CACxE,GACA,MAAM,CAGR;AAoJD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,qBAE5E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,qBAEhF"}
|
|
@@ -13,7 +13,7 @@ import { EmptyState } from "./empty-state.js";
|
|
|
13
13
|
import { MiddleTruncate } from "./middle-truncate.js";
|
|
14
14
|
import { Table, TableCell, TableCol, TableColgroup, TableDetailRow, TableHead, TableHeader, TableRecordGroup, TableRow, } from "./table.js";
|
|
15
15
|
import { TableCard } from "./table-card.js";
|
|
16
|
-
import { TableCompactLine,
|
|
16
|
+
import { TableCompactLayoutOf, TableCompactLine, } from "../internal/table-compact-line.js";
|
|
17
17
|
import { compactLayoutFor, tableCompactLayouts, } from "./table-layouts.js";
|
|
18
18
|
import { titleWhenCut } from "../internal/title-when-cut.js";
|
|
19
19
|
const dataTableFeatures = tableFeatures({
|
|
@@ -129,11 +129,14 @@ function useShownLayout() {
|
|
|
129
129
|
const [shownLayout, setShownLayout] = React.useState("both");
|
|
130
130
|
const probeRef = React.useCallback((probe) => {
|
|
131
131
|
const container = probe?.closest('[data-slot="table-container"]');
|
|
132
|
-
if (!probe || !container
|
|
132
|
+
if (!probe || !container)
|
|
133
133
|
return;
|
|
134
134
|
const read = () => getComputedStyle(probe).display === "none" ? "columns" : "details";
|
|
135
135
|
let shown = read();
|
|
136
136
|
setShownLayout(shown);
|
|
137
|
+
// Without a ResizeObserver to follow the card, the first measurement stands.
|
|
138
|
+
if (typeof ResizeObserver === "undefined")
|
|
139
|
+
return;
|
|
137
140
|
const show = (next) => {
|
|
138
141
|
if (next === shown)
|
|
139
142
|
return;
|
|
@@ -346,7 +349,7 @@ function RecordsTable({ kind, columns, data, getRowId, filterColumnId, filterPla
|
|
|
346
349
|
},
|
|
347
350
|
}
|
|
348
351
|
: empty) }));
|
|
349
|
-
const tableNode = (_jsxs(_Fragment, { children: [_jsx("div", { "aria-live": "polite", "data-slot": "data-table-absence", children: absence }), rows.length === 0 ? null : (_jsx(
|
|
352
|
+
const tableNode = (_jsxs(_Fragment, { children: [_jsx("div", { "aria-live": "polite", "data-slot": "data-table-absence", children: absence }), rows.length === 0 ? null : (_jsx(TableCompactLayoutOf, { layout: tableLayout, shown: shownLayout, children: _jsxs(Table, { "aria-label": tableLabel, className: "table-fixed text-body-sm", compactDetails: tableLayout, density: entities ? "comfortable" : "default", children: [_jsx(TableColgroup, { children: table.getVisibleLeafColumns().map((column) => {
|
|
350
353
|
const size = sizeOf.get(column.id);
|
|
351
354
|
return (_jsx(TableCol, { className: cn(collapseTrackClass(column, primaryColumns, compactLayout)), style: size === undefined ? undefined : { width: size } }, column.id));
|
|
352
355
|
}) }), _jsx(TableHeader, { className: entities ? "sr-only" : undefined, children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableHead, { "aria-sort": sortOrder(header.column.getIsSorted()), "data-identity": header.column.id === identityColumnId ? "" : undefined, className: cn(isNumericColumn(header.column) && "text-right tabular-nums", header.column.columnDef.meta?.wraps === true && "last:text-left", header.column.columnDef.meta?.centered === true &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-list.d.ts","sourceRoot":"","sources":["../../src/components/record-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAiB,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAIjG,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,wBAAwB,CAAC;AAG5F,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,MAAM,UAAU,GAAG;IACvB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAA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;GA0BG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,sCAwClF"}
|
|
@@ -16,7 +16,7 @@ import { TableCard } from "./table-card.js";
|
|
|
16
16
|
import { TableValue } from "./table-value.js";
|
|
17
17
|
import { soleMenuButton } from "../internal/record-menu-items.js";
|
|
18
18
|
import { RowMessageActions, RowMessageLine } from "../internal/row-message.js";
|
|
19
|
-
import {
|
|
19
|
+
import { CompactOnly, WideOnly } from "../internal/table-compact-line.js";
|
|
20
20
|
const CELL_START = 8;
|
|
21
21
|
const CELL_END_AT_CARD_EDGE = 20;
|
|
22
22
|
const COMMANDS_GAP = 8;
|
|
@@ -30,21 +30,23 @@ const BUTTON_ICON_GAP = 3;
|
|
|
30
30
|
const EXTERNAL_ARROW = 14;
|
|
31
31
|
const CHEVRON = 16;
|
|
32
32
|
const WIDEST_LABEL_CHARACTER = 8;
|
|
33
|
-
function shownCommands(list, record
|
|
33
|
+
function shownCommands(list, record) {
|
|
34
34
|
const menu = list.menu?.(record);
|
|
35
35
|
const commands = menu?.commands ?? [];
|
|
36
36
|
const own = list.command?.(record);
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const ownButtons = own ? [own].flat() : [];
|
|
38
|
+
// A sole menu command is the row's button on a wide card and stays in the dots on a compact one.
|
|
39
|
+
const menuButton = own || list.layout === "line" ? undefined : soleMenuButton(commands);
|
|
39
40
|
const state = list.state?.(record) ?? null;
|
|
40
|
-
const dots = menu && commands.length > 0
|
|
41
|
-
const
|
|
41
|
+
const dots = menu && commands.length > 0 ? menu : undefined;
|
|
42
|
+
const opens = Boolean(list.open?.href(record)) && !state;
|
|
42
43
|
return {
|
|
43
|
-
besideDots:
|
|
44
|
-
underName:
|
|
44
|
+
besideDots: menuButton ? [menuButton] : ownButtons,
|
|
45
|
+
underName: ownButtons,
|
|
46
|
+
menuButton,
|
|
45
47
|
state,
|
|
46
48
|
dots,
|
|
47
|
-
|
|
49
|
+
opens,
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
function buttonRoom(command, size) {
|
|
@@ -55,14 +57,16 @@ function buttonRoom(command, size) {
|
|
|
55
57
|
longerLabel * WIDEST_LABEL_CHARACTER);
|
|
56
58
|
}
|
|
57
59
|
function commandsRoom(list, record) {
|
|
58
|
-
const { besideDots, state, dots,
|
|
60
|
+
const { besideDots, menuButton, state, dots, opens } = shownCommands(list, record);
|
|
61
|
+
const wideDots = dots && !menuButton;
|
|
62
|
+
const chevron = opens && !wideDots;
|
|
59
63
|
const widths = [
|
|
60
64
|
...besideDots.map((command) => buttonRoom(command, "sm")),
|
|
61
65
|
...(state?.message.actions ?? []).map((action) => buttonRoom(action, "default")),
|
|
62
66
|
];
|
|
63
67
|
if (widths.length === 0)
|
|
64
68
|
return DOTS_ALONE_SIZE;
|
|
65
|
-
if (
|
|
69
|
+
if (wideDots)
|
|
66
70
|
widths.push(TOUCH_TARGET);
|
|
67
71
|
if (chevron)
|
|
68
72
|
widths.push(CHEVRON);
|
|
@@ -98,13 +102,12 @@ function NameCell({ row }) {
|
|
|
98
102
|
}
|
|
99
103
|
function UnderName({ record }) {
|
|
100
104
|
const list = useShownList();
|
|
101
|
-
const compact = useTableLaidOutCompact();
|
|
102
105
|
const state = list.state?.(record);
|
|
103
|
-
const nextSteps =
|
|
104
|
-
const { underName } = shownCommands(list, record
|
|
106
|
+
const nextSteps = state?.message.actions.length ? state : null;
|
|
107
|
+
const { underName } = shownCommands(list, record);
|
|
105
108
|
if (!nextSteps && underName.length === 0)
|
|
106
109
|
return null;
|
|
107
|
-
return (_jsxs("span", { className: "flex flex-wrap gap-2 pt-2 pl-12 whitespace-normal", "data-slot": "record-under-name", children: [nextSteps ? _jsx(RowMessageActions, { state: nextSteps }) : null, underName.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label)))] }));
|
|
110
|
+
return (_jsx(CompactOnly, { children: _jsxs("span", { className: "flex flex-wrap gap-2 pt-2 pl-12 whitespace-normal", "data-slot": "record-under-name", children: [nextSteps ? _jsx(RowMessageActions, { state: nextSteps }) : null, underName.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label)))] }) }));
|
|
108
111
|
}
|
|
109
112
|
function SelectCell({ row }) {
|
|
110
113
|
const select = useShownList().select;
|
|
@@ -152,14 +155,12 @@ function ChecklistCell({ row }) {
|
|
|
152
155
|
function CommandsCell({ row }) {
|
|
153
156
|
const list = useShownList();
|
|
154
157
|
const record = row.original;
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const end = dots ? (_jsx(ActionMenu, { commands: dots.commands, label: dots.label, record: list.name(record).name })) : chevron ? (_jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 text-muted-foreground" })) : null;
|
|
160
|
-
if (besideDots.length === 0 && !state && !end)
|
|
158
|
+
const { besideDots, menuButton, state, dots, opens } = shownCommands(list, record);
|
|
159
|
+
const menu = dots ? (_jsx(ActionMenu, { commands: dots.commands, label: dots.label, record: list.name(record).name })) : null;
|
|
160
|
+
const chevron = opens ? (_jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 text-muted-foreground" })) : null;
|
|
161
|
+
if (besideDots.length === 0 && !state && !menu && !chevron)
|
|
161
162
|
return null;
|
|
162
|
-
return (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [besideDots.length > 0 ? (_jsx("div", { className: "flex min-w-0 justify-end gap-2 *:max-w-full *:min-w-0 *:shrink [&>*>span:not([data-icon])]:truncate", children: besideDots.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label))) })) : null, state
|
|
163
|
+
return (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsxs(WideOnly, { children: [besideDots.length > 0 ? (_jsx("div", { className: "flex min-w-0 justify-end gap-2 *:max-w-full *:min-w-0 *:shrink [&>*>span:not([data-icon])]:truncate", children: besideDots.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label))) })) : null, state ? _jsx(RowMessageActions, { state: state }) : null] }), menu && menuButton ? _jsx(CompactOnly, { children: menu }) : menu, chevron && menu && menuButton ? _jsx(WideOnly, { children: chevron }) : null, chevron && !menu ? chevron : null] }));
|
|
163
164
|
}
|
|
164
165
|
function LoadingRecords({ label }) {
|
|
165
166
|
return (_jsx("div", { "aria-busy": "true", "aria-label": label, className: "divide-y divide-border", role: "status", children: Array.from({ length: 3 }, (_, index) => (_jsxs("div", { className: "flex items-center gap-4 px-2 py-4", children: [_jsx(Skeleton, { className: "shrink-0", height: 32, width: 32 }), _jsxs("div", { className: "grid min-w-0 gap-2", children: [_jsx(Skeleton, { className: "max-w-full", height: 16, width: 160 }), _jsx(Skeleton, { className: "max-w-full", height: 16, width: 224 })] }), _jsx(Skeleton, { className: "ml-auto", height: 16, width: 92 })] }, index))) }));
|
|
@@ -5,6 +5,7 @@ export declare const tableCompactLayouts: {
|
|
|
5
5
|
readonly track: "hidden @xl/table:table-column";
|
|
6
6
|
readonly row: "@max-xl/table:[&>td]:border-b-0 @max-xl/table:[&>td]:after:hidden @max-xl/table:h-auto! @max-xl/table:[&>td]:pb-1!";
|
|
7
7
|
readonly details: "@xl/table:hidden";
|
|
8
|
+
readonly wideOnly: "hidden @xl/table:contents";
|
|
8
9
|
readonly table: "@max-xl/table:table-auto @max-xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
9
10
|
};
|
|
10
11
|
readonly standard: {
|
|
@@ -13,6 +14,7 @@ export declare const tableCompactLayouts: {
|
|
|
13
14
|
readonly track: "hidden @3xl/table:table-column";
|
|
14
15
|
readonly row: "@max-3xl/table:[&>td]:border-b-0 @max-3xl/table:[&>td]:after:hidden @max-3xl/table:h-auto! @max-3xl/table:[&>td]:pb-1!";
|
|
15
16
|
readonly details: "@3xl/table:hidden";
|
|
17
|
+
readonly wideOnly: "hidden @3xl/table:contents";
|
|
16
18
|
readonly table: "@max-3xl/table:table-auto @max-3xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-3xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
17
19
|
};
|
|
18
20
|
readonly wide: {
|
|
@@ -21,6 +23,7 @@ export declare const tableCompactLayouts: {
|
|
|
21
23
|
readonly track: "hidden @5xl/table:table-column";
|
|
22
24
|
readonly row: "@max-5xl/table:[&>td]:border-b-0 @max-5xl/table:[&>td]:after:hidden @max-5xl/table:h-auto! @max-5xl/table:[&>td]:pb-1!";
|
|
23
25
|
readonly details: "@5xl/table:hidden";
|
|
26
|
+
readonly wideOnly: "hidden @5xl/table:contents";
|
|
24
27
|
readonly table: "@max-5xl/table:table-auto @max-5xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-5xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
25
28
|
};
|
|
26
29
|
readonly roomy: {
|
|
@@ -29,6 +32,7 @@ export declare const tableCompactLayouts: {
|
|
|
29
32
|
readonly track: "hidden @min-[68rem]/table:table-column";
|
|
30
33
|
readonly row: "@max-[68rem]/table:[&>td]:border-b-0 @max-[68rem]/table:[&>td]:after:hidden @max-[68rem]/table:h-auto! @max-[68rem]/table:[&>td]:pb-1!";
|
|
31
34
|
readonly details: "@min-[68rem]/table:hidden";
|
|
35
|
+
readonly wideOnly: "hidden @min-[68rem]/table:contents";
|
|
32
36
|
readonly table: "@max-[68rem]/table:table-auto @max-[68rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-[68rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-[68rem]/table:[&_td]:whitespace-normal @max-[68rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
33
37
|
};
|
|
34
38
|
readonly spacious: {
|
|
@@ -37,6 +41,7 @@ export declare const tableCompactLayouts: {
|
|
|
37
41
|
readonly track: "hidden @6xl/table:table-column";
|
|
38
42
|
readonly row: "@max-6xl/table:[&>td]:border-b-0 @max-6xl/table:[&>td]:after:hidden @max-6xl/table:h-auto! @max-6xl/table:[&>td]:pb-1!";
|
|
39
43
|
readonly details: "@6xl/table:hidden";
|
|
44
|
+
readonly wideOnly: "hidden @6xl/table:contents";
|
|
40
45
|
readonly table: "@max-6xl/table:table-auto @max-6xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-6xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
41
46
|
};
|
|
42
47
|
readonly broad: {
|
|
@@ -45,6 +50,7 @@ export declare const tableCompactLayouts: {
|
|
|
45
50
|
readonly track: "hidden @7xl/table:table-column";
|
|
46
51
|
readonly row: "@max-7xl/table:[&>td]:border-b-0 @max-7xl/table:[&>td]:after:hidden @max-7xl/table:h-auto! @max-7xl/table:[&>td]:pb-1!";
|
|
47
52
|
readonly details: "@7xl/table:hidden";
|
|
53
|
+
readonly wideOnly: "hidden @7xl/table:contents";
|
|
48
54
|
readonly table: "@max-7xl/table:table-auto @max-7xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-7xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-7xl/table:[&_td]:whitespace-normal @max-7xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
49
55
|
};
|
|
50
56
|
readonly vast: {
|
|
@@ -53,6 +59,7 @@ export declare const tableCompactLayouts: {
|
|
|
53
59
|
readonly track: "hidden @min-[96rem]/table:table-column";
|
|
54
60
|
readonly row: "@max-[96rem]/table:[&>td]:border-b-0 @max-[96rem]/table:[&>td]:after:hidden @max-[96rem]/table:h-auto! @max-[96rem]/table:[&>td]:pb-1!";
|
|
55
61
|
readonly details: "@min-[96rem]/table:hidden";
|
|
62
|
+
readonly wideOnly: "hidden @min-[96rem]/table:contents";
|
|
56
63
|
readonly table: "@max-[96rem]/table:table-auto @max-[96rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-[96rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-[96rem]/table:[&_td]:whitespace-normal @max-[96rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
57
64
|
};
|
|
58
65
|
readonly always: {
|
|
@@ -61,6 +68,7 @@ export declare const tableCompactLayouts: {
|
|
|
61
68
|
readonly track: "hidden";
|
|
62
69
|
readonly row: "[&>td]:border-b-0 [&>td]:after:hidden h-auto! [&>td]:pb-1!";
|
|
63
70
|
readonly details: "";
|
|
71
|
+
readonly wideOnly: "hidden";
|
|
64
72
|
readonly table: "table-auto [&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal [&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words [&_td]:whitespace-normal [&_th:not(:first-child):not([data-identity])]:w-px";
|
|
65
73
|
};
|
|
66
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAelE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,kBAAkB,CAG3F"}
|
|
@@ -5,6 +5,7 @@ export const tableCompactLayouts = {
|
|
|
5
5
|
track: "hidden @xl/table:table-column",
|
|
6
6
|
row: "@max-xl/table:[&>td]:border-b-0 @max-xl/table:[&>td]:after:hidden @max-xl/table:h-auto! @max-xl/table:[&>td]:pb-1!",
|
|
7
7
|
details: "@xl/table:hidden",
|
|
8
|
+
wideOnly: "hidden @xl/table:contents",
|
|
8
9
|
table: "@max-xl/table:table-auto @max-xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
9
10
|
},
|
|
10
11
|
standard: {
|
|
@@ -13,6 +14,7 @@ export const tableCompactLayouts = {
|
|
|
13
14
|
track: "hidden @3xl/table:table-column",
|
|
14
15
|
row: "@max-3xl/table:[&>td]:border-b-0 @max-3xl/table:[&>td]:after:hidden @max-3xl/table:h-auto! @max-3xl/table:[&>td]:pb-1!",
|
|
15
16
|
details: "@3xl/table:hidden",
|
|
17
|
+
wideOnly: "hidden @3xl/table:contents",
|
|
16
18
|
table: "@max-3xl/table:table-auto @max-3xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-3xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
17
19
|
},
|
|
18
20
|
wide: {
|
|
@@ -21,6 +23,7 @@ export const tableCompactLayouts = {
|
|
|
21
23
|
track: "hidden @5xl/table:table-column",
|
|
22
24
|
row: "@max-5xl/table:[&>td]:border-b-0 @max-5xl/table:[&>td]:after:hidden @max-5xl/table:h-auto! @max-5xl/table:[&>td]:pb-1!",
|
|
23
25
|
details: "@5xl/table:hidden",
|
|
26
|
+
wideOnly: "hidden @5xl/table:contents",
|
|
24
27
|
table: "@max-5xl/table:table-auto @max-5xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-5xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
25
28
|
},
|
|
26
29
|
roomy: {
|
|
@@ -29,6 +32,7 @@ export const tableCompactLayouts = {
|
|
|
29
32
|
track: "hidden @min-[68rem]/table:table-column",
|
|
30
33
|
row: "@max-[68rem]/table:[&>td]:border-b-0 @max-[68rem]/table:[&>td]:after:hidden @max-[68rem]/table:h-auto! @max-[68rem]/table:[&>td]:pb-1!",
|
|
31
34
|
details: "@min-[68rem]/table:hidden",
|
|
35
|
+
wideOnly: "hidden @min-[68rem]/table:contents",
|
|
32
36
|
table: "@max-[68rem]/table:table-auto @max-[68rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-[68rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-[68rem]/table:[&_td]:whitespace-normal @max-[68rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
33
37
|
},
|
|
34
38
|
spacious: {
|
|
@@ -37,6 +41,7 @@ export const tableCompactLayouts = {
|
|
|
37
41
|
track: "hidden @6xl/table:table-column",
|
|
38
42
|
row: "@max-6xl/table:[&>td]:border-b-0 @max-6xl/table:[&>td]:after:hidden @max-6xl/table:h-auto! @max-6xl/table:[&>td]:pb-1!",
|
|
39
43
|
details: "@6xl/table:hidden",
|
|
44
|
+
wideOnly: "hidden @6xl/table:contents",
|
|
40
45
|
table: "@max-6xl/table:table-auto @max-6xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-6xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
41
46
|
},
|
|
42
47
|
broad: {
|
|
@@ -45,6 +50,7 @@ export const tableCompactLayouts = {
|
|
|
45
50
|
track: "hidden @7xl/table:table-column",
|
|
46
51
|
row: "@max-7xl/table:[&>td]:border-b-0 @max-7xl/table:[&>td]:after:hidden @max-7xl/table:h-auto! @max-7xl/table:[&>td]:pb-1!",
|
|
47
52
|
details: "@7xl/table:hidden",
|
|
53
|
+
wideOnly: "hidden @7xl/table:contents",
|
|
48
54
|
table: "@max-7xl/table:table-auto @max-7xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-7xl/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-7xl/table:[&_td]:whitespace-normal @max-7xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
49
55
|
},
|
|
50
56
|
vast: {
|
|
@@ -53,6 +59,7 @@ export const tableCompactLayouts = {
|
|
|
53
59
|
track: "hidden @min-[96rem]/table:table-column",
|
|
54
60
|
row: "@max-[96rem]/table:[&>td]:border-b-0 @max-[96rem]/table:[&>td]:after:hidden @max-[96rem]/table:h-auto! @max-[96rem]/table:[&>td]:pb-1!",
|
|
55
61
|
details: "@min-[96rem]/table:hidden",
|
|
62
|
+
wideOnly: "hidden @min-[96rem]/table:contents",
|
|
56
63
|
table: "@max-[96rem]/table:table-auto @max-[96rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal @max-[96rem]/table:[&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words @max-[96rem]/table:[&_td]:whitespace-normal @max-[96rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
57
64
|
},
|
|
58
65
|
always: {
|
|
@@ -61,6 +68,7 @@ export const tableCompactLayouts = {
|
|
|
61
68
|
track: "hidden",
|
|
62
69
|
row: "[&>td]:border-b-0 [&>td]:after:hidden h-auto! [&>td]:pb-1!",
|
|
63
70
|
details: "",
|
|
71
|
+
wideOnly: "hidden",
|
|
64
72
|
table: "table-auto [&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:whitespace-normal [&_[data-slot=record-identity-detail]:has([data-slot=table-detail-line])]:break-words [&_td]:whitespace-normal [&_th:not(:first-child):not([data-identity])]:w-px",
|
|
65
73
|
},
|
|
66
74
|
};
|
|
@@ -28,13 +28,31 @@ export declare function TableCompactFacts(): React.JSX.Element | null;
|
|
|
28
28
|
/** The compact facts that stand beside the name of the row this stands in, which no ellipsis cuts; nothing outside such a row or on a card wide enough for the columns. */
|
|
29
29
|
export declare function TableCompactNameFacts(): React.JSX.Element | null;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* The layout the table last measured its card at: `both` until it has measured, `columns` for a
|
|
32
|
+
* card wide enough for the row's columns, `details` for a compact one.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
35
|
-
|
|
34
|
+
export type ShownLayout = "both" | "columns" | "details";
|
|
35
|
+
type TableCompactLayoutValue = {
|
|
36
|
+
layout: TableCompactLayout;
|
|
37
|
+
shown: ShownLayout;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The layout the entity rows around it fold by. Until the table has measured its card, a row draws
|
|
41
|
+
* what goes beside its name on a wide card and under it on a compact one both, and this layout's
|
|
42
|
+
* container query shows the one that fits, so the server's first draw is already the browser's and
|
|
43
|
+
* nothing moves when it hydrates. Once measured, only the placement that fits stands, so the page
|
|
44
|
+
* holds one copy of each command, and a menu opened on a compact card goes when the card widens.
|
|
45
|
+
*/
|
|
46
|
+
export declare function TableCompactLayoutOf({ layout, shown, children, }: TableCompactLayoutValue & {
|
|
36
47
|
children: React.ReactNode;
|
|
37
48
|
}): React.JSX.Element;
|
|
38
|
-
|
|
49
|
+
/** What stands only on a card wide enough for the row's columns. */
|
|
50
|
+
export declare function WideOnly({ children }: {
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
}): React.JSX.Element | null;
|
|
53
|
+
/** What stands only once the row is compact. */
|
|
54
|
+
export declare function CompactOnly({ children }: {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
}): React.JSX.Element | null;
|
|
39
57
|
export {};
|
|
40
58
|
//# sourceMappingURL=table-compact-line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-compact-line.d.ts","sourceRoot":"","sources":["../../src/internal/table-compact-line.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4HAA4H;IAC5H,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wGAAwG;IACxG,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,eAAe,8EACiD,CAAC;AAE9E,eAAO,MAAM,eAAe,+EACkD,CAAC;AAE/E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,gBAAwB,GACzB,EAAE;IACD,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,uBAQA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,kBAAk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,SAAS,CAAA;CAAE,qBAEvD;AAED,4IAA4I;AAC5I,wBAAgB,iBAAiB,6BAahC;AAED,2KAA2K;AAC3K,wBAAgB,qBAAqB,6BAkBpC;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD,KAAK,uBAAuB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAMlF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE,uBAAuB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAGzD;AAQD,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAQnE;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAQtE"}
|
|
@@ -33,14 +33,35 @@ export function TableCompactNameFacts() {
|
|
|
33
33
|
return null;
|
|
34
34
|
return (_jsx("span", { className: cn("flex shrink-0 items-center gap-2", tableCompactLayouts[line.layout].details), "data-slot": "table-name-facts", children: facts.map((fact) => (_jsxs("span", { className: "flex items-center", children: [_jsxs("span", { className: "sr-only", children: [fact.label, ": "] }), fact.value] }, fact.id))) }));
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const TableCompactLayoutContext = React.createContext(undefined);
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* The layout the entity rows around it fold by. Until the table has measured its card, a row draws
|
|
39
|
+
* what goes beside its name on a wide card and under it on a compact one both, and this layout's
|
|
40
|
+
* container query shows the one that fits, so the server's first draw is already the browser's and
|
|
41
|
+
* nothing moves when it hydrates. Once measured, only the placement that fits stands, so the page
|
|
42
|
+
* holds one copy of each command, and a menu opened on a compact card goes when the card widens.
|
|
40
43
|
*/
|
|
41
|
-
export function
|
|
42
|
-
|
|
44
|
+
export function TableCompactLayoutOf({ layout, shown, children, }) {
|
|
45
|
+
const value = React.useMemo(() => ({ layout, shown }), [layout, shown]);
|
|
46
|
+
return _jsx(TableCompactLayoutContext, { value: value, children: children });
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
function useCompactLayout() {
|
|
49
|
+
const value = React.useContext(TableCompactLayoutContext);
|
|
50
|
+
if (!value)
|
|
51
|
+
throw new Error("A row's placements stand only inside a table's compact layout");
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
/** What stands only on a card wide enough for the row's columns. */
|
|
55
|
+
export function WideOnly({ children }) {
|
|
56
|
+
const { layout, shown } = useCompactLayout();
|
|
57
|
+
if (shown === "details")
|
|
58
|
+
return null;
|
|
59
|
+
return (_jsx("span", { className: tableCompactLayouts[layout].wideOnly, "data-slot": "wide-only", children: children }));
|
|
60
|
+
}
|
|
61
|
+
/** What stands only once the row is compact. */
|
|
62
|
+
export function CompactOnly({ children }) {
|
|
63
|
+
const { layout, shown } = useCompactLayout();
|
|
64
|
+
if (shown === "columns")
|
|
65
|
+
return null;
|
|
66
|
+
return (_jsx("span", { className: cn("contents", tableCompactLayouts[layout].details), "data-slot": "compact-only", children: children }));
|
|
46
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.168",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#jsx": "./src/jsx/index.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@base-ui/react": "^1.9.0",
|
|
73
73
|
"@iconify-icons/logos": "^2.0.3",
|
|
74
74
|
"@iconify/react": "^6.0.2",
|
|
75
|
-
"@nadicodeai/design-system": "12.1.
|
|
75
|
+
"@nadicodeai/design-system": "12.1.168",
|
|
76
76
|
"@tanstack/react-table": "^9.3.1",
|
|
77
77
|
"@vgpu/wgsl": "0.6.0",
|
|
78
78
|
"class-variance-authority": "^0.7.1",
|