@nadicodeai/ui 10.0.1 → 10.0.2
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.
|
@@ -101,6 +101,6 @@ function ModelMark({ author, name, size = MODEL_MARK_SIZE, label, className, ...
|
|
|
101
101
|
: label?.trim()
|
|
102
102
|
? { role: "img", "aria-label": label }
|
|
103
103
|
: {};
|
|
104
|
-
return (_jsxs("span", { "data-slot": "model-mark", "data-author": author, "data-resolved-author": slug, className: cn("inline-flex min-w-0 items-center gap-1.5", className), ...props, ...labelling, children: [_jsx("span", { "data-slot": "model-mark-tile", "data-mark": Mark ? "brand" : "monogram", "data-mark-source": definition?.source, "aria-hidden": "true", className: "inline-flex shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground", style: { width: size, height: size }, children: Mark ? (_jsx(Mark, { size: Math.round(size * MODEL_MARK_GLYPH_RATIO) })) : (_jsx("span", { "aria-hidden": "true", className: "font-semibold leading-none text-muted-foreground", "data-slot": "model-author-monogram", style: { fontSize: Math.max(8, Math.round(size * 0.32)) }, children: authorInitials(slug) })) }), name ? (_jsxs("span", { className: "min-w-0 truncate", children: [_jsx("span", { className: "font-medium", children: name }), " ", _jsx("span", { className: "text-xs text-muted-foreground", children: author })] })) : null] }));
|
|
104
|
+
return (_jsxs("span", { "data-slot": "model-mark", "data-author": author, "data-resolved-author": slug, className: cn("inline-flex min-w-0 max-w-full items-center gap-1.5", className), ...props, ...labelling, children: [_jsx("span", { "data-slot": "model-mark-tile", "data-mark": Mark ? "brand" : "monogram", "data-mark-source": definition?.source, "aria-hidden": "true", className: "inline-flex shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground", style: { width: size, height: size }, children: Mark ? (_jsx(Mark, { size: Math.round(size * MODEL_MARK_GLYPH_RATIO) })) : (_jsx("span", { "aria-hidden": "true", className: "font-semibold leading-none text-muted-foreground", "data-slot": "model-author-monogram", style: { fontSize: Math.max(8, Math.round(size * 0.32)) }, children: authorInitials(slug) })) }), name ? (_jsxs("span", { className: "min-w-0 truncate", children: [_jsx("span", { className: "font-medium", children: name }), " ", _jsx("span", { className: "text-xs text-muted-foreground", children: author })] })) : null] }));
|
|
105
105
|
}
|
|
106
106
|
export { ModelMark };
|
package/dist/components/table.js
CHANGED
|
@@ -27,7 +27,7 @@ function TableCell({ className, ...props }) {
|
|
|
27
27
|
return (_jsx("td", { "data-slot": "table-cell", className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
28
28
|
}
|
|
29
29
|
function TableDetailRow({ colSpan, facts, layout = "standard", }) {
|
|
30
|
-
return (_jsx(TableRow, { "data-slot": "table-detail-row", className: tableCompactLayouts[layout].details, children: _jsx(TableCell, { colSpan: colSpan, className: "px-2 pt-0 pb-3 whitespace-normal", children: _jsx("dl", { className: cn("grid min-w-0 grid-cols-
|
|
30
|
+
return (_jsx(TableRow, { "data-slot": "table-detail-row", className: tableCompactLayouts[layout].details, children: _jsx(TableCell, { colSpan: colSpan, className: "px-2 pt-0 pb-3 whitespace-normal", children: _jsx("dl", { className: cn("grid min-w-0 grid-cols-1 gap-x-4 gap-y-2 @sm/table:grid-cols-2", facts.length > 2 && "@lg/table:grid-cols-3"), children: facts.map((fact) => (_jsxs("div", { className: cn("min-w-0 @sm/table:last:odd:col-span-2", facts.length > 2 && "@lg/table:last:odd:col-span-1"), children: [_jsx("dt", { className: "text-xs text-muted-foreground", children: fact.label }), _jsx("dd", { className: cn("min-w-0", fact.numeric ? "tabular-nums wrap-normal" : "wrap-anywhere"), children: fact.value })] }, fact.id))) }) }) }));
|
|
31
31
|
}
|
|
32
32
|
function TableCaption({ className, ...props }) {
|
|
33
33
|
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
@@ -11,8 +11,8 @@ copy, and behavior.
|
|
|
11
11
|
|
|
12
12
|
| Removed API | Registry source to use instead | Reason |
|
|
13
13
|
| --- | --- | --- |
|
|
14
|
-
| `DataTable`, `DataTableColumnControls`, `DataTableEmptyState`, `DataTableState` |
|
|
15
|
-
| `CommandPalette`, `ModelPickerCommand`, `SessionPickerCommand` | `@shadcn/command
|
|
14
|
+
| Package-level `DataTable`, `DataTableColumnControls`, `DataTableEmptyState`, `DataTableState` | [shadcn Data Table guide](https://ui.shadcn.com/docs/components/base/data-table), `@shadcn/table`, and the table in `@shadcn/dashboard-01` | These are first-party composition sources for sorting, visibility, filtering, and pagination. Portal retains its app-owned `DataTable` adapter for registry and URL behavior. |
|
|
15
|
+
| `CommandPalette`, `ModelPickerCommand`, `SessionPickerCommand` | `@shadcn/command` and its `CommandDialog` export ([Command guide](https://ui.shadcn.com/docs/components/base/command)) | The command primitive and dialog composition are already supplied; model/session execution is app behavior. |
|
|
16
16
|
| `ChartCard`, `MetricChart`, `semanticChartColors` | The package chart kit, owned by [`contract.md`](contract.md) | shadcn already ships the chart primitives and blocks the kit is pulled from; metric aggregation and chart choice are app behavior. |
|
|
17
17
|
|
|
18
18
|
## Retained Package Compositions
|
package/docs/contract.md
CHANGED
|
@@ -205,6 +205,8 @@ content, and a chart names a model through the label in its `ChartConfig`. A
|
|
|
205
205
|
model's row in a table or a ranked list is where `ModelMark` belongs. A mark is
|
|
206
206
|
decoration beside the label that already names it; one standing alone takes
|
|
207
207
|
`label` (`role="img"` with an accessible name) or stays hidden.
|
|
208
|
+
Named marks stay within their containing cell, shortening the visible text when
|
|
209
|
+
space is tight; callers with long model IDs provide the full ID in `title`.
|
|
208
210
|
|
|
209
211
|
The package owns the reviewed author-to-mark mapping and its generated artwork;
|
|
210
212
|
the live catalog remains the source of which authors exist. The consuming app
|
|
@@ -298,7 +300,8 @@ highlights one record. A consumer does not render the two rows as independent
|
|
|
298
300
|
siblings. Portal `DataTable` chooses a layout from its column count by default;
|
|
299
301
|
a comparison whose columns remain readable longer may select one of these
|
|
300
302
|
shared layouts instead of adding route-owned width rules.
|
|
301
|
-
|
|
303
|
+
Supporting facts stack below 384px of table width, use two columns when they
|
|
304
|
+
fit, and use three for additional facts at the larger container breakpoint.
|
|
302
305
|
The cell renderer supplies the value, leaving the label to the detail row.
|
|
303
306
|
|
|
304
307
|
### Missing table values
|
|
@@ -25,6 +25,22 @@ Fixtures live in:
|
|
|
25
25
|
| `SettingsSection` / `SettingsField` | Header, divided save footer, field layout, labels, descriptions, errors, and control associations. | Form state, validation, submission, persistence, settings taxonomy, and save/cancel behavior. |
|
|
26
26
|
| `FeedbackState` | Shared empty, loading, saving, error, permission, offline, no-results, and fatal state presentation. | Recovery actions, retry behavior, permission escalation, app-specific state language. |
|
|
27
27
|
|
|
28
|
+
## Collection and command recipes
|
|
29
|
+
|
|
30
|
+
Portal's [`DataTable`](../../../apps/portal/src/components/kit/data-table.tsx) is
|
|
31
|
+
the existing app owner for collection interaction, URL state, and registry
|
|
32
|
+
behavior. It composes the shared `Table` and `TableDetailRow` with TanStack
|
|
33
|
+
Table, following the [shadcn Data Table guide](https://ui.shadcn.com/docs/components/base/data-table)
|
|
34
|
+
and the `@shadcn/dashboard-01` table block. The shared row owns compact fact
|
|
35
|
+
geometry; a caller supplies its labels and values. Keep Portal's adapter for
|
|
36
|
+
its existing consumers instead of introducing a second package table API.
|
|
37
|
+
|
|
38
|
+
The shared [`command`](../src/components/command.tsx) component includes
|
|
39
|
+
`CommandDialog`, as the [shadcn Command guide](https://ui.shadcn.com/docs/components/base/command)
|
|
40
|
+
documents. A product composes its commands there and owns search data,
|
|
41
|
+
selection effects, shortcuts, routing, and permission checks. The Portal
|
|
42
|
+
command dialog is the current app owner for Portal navigation commands.
|
|
43
|
+
|
|
28
44
|
## SettingsSection
|
|
29
45
|
|
|
30
46
|
Use `SettingsSection` and `SettingsField` for horizontal settings rows that need consistent label, description, error, and control alignment.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@assistant-ui/react": "0.15.21",
|
|
73
73
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
74
74
|
"@base-ui/react": "^1.8.0",
|
|
75
|
-
"@nadicodeai/design-system": "10.0.
|
|
75
|
+
"@nadicodeai/design-system": "10.0.2",
|
|
76
76
|
"class-variance-authority": "^0.7.1",
|
|
77
77
|
"clsx": "^2.1.1",
|
|
78
78
|
"cmdk": "^1.1.1",
|