@open-mercato/ui 0.6.4-develop.4199.1.86677441c2 → 0.6.4-develop.4217.1.c9aa050183
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/.turbo/turbo-build.log +1 -1
- package/AGENTS.md +14 -0
- package/dist/backend/DataTable.js +28 -62
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/backend/detail/AttachmentMetadataDialog.js +1 -1
- package/dist/backend/detail/AttachmentMetadataDialog.js.map +2 -2
- package/dist/primitives/activity-feed.js +196 -0
- package/dist/primitives/activity-feed.js.map +7 -0
- package/dist/primitives/avatar.js +140 -14
- package/dist/primitives/avatar.js.map +3 -3
- package/dist/primitives/badge.js +94 -5
- package/dist/primitives/badge.js.map +2 -2
- package/dist/primitives/button-group.js +52 -0
- package/dist/primitives/button-group.js.map +7 -0
- package/dist/primitives/color-picker.js +520 -0
- package/dist/primitives/color-picker.js.map +7 -0
- package/dist/primitives/command-menu.js +355 -0
- package/dist/primitives/command-menu.js.map +7 -0
- package/dist/primitives/dialog.js +210 -35
- package/dist/primitives/dialog.js.map +2 -2
- package/dist/primitives/drawer.js +219 -0
- package/dist/primitives/drawer.js.map +7 -0
- package/dist/primitives/notification-feed.js +213 -0
- package/dist/primitives/notification-feed.js.map +7 -0
- package/dist/primitives/notification.js +23 -2
- package/dist/primitives/notification.js.map +2 -2
- package/dist/primitives/pagination.js +245 -0
- package/dist/primitives/pagination.js.map +7 -0
- package/dist/primitives/progress.js +178 -5
- package/dist/primitives/progress.js.map +2 -2
- package/dist/primitives/rating.js +174 -0
- package/dist/primitives/rating.js.map +7 -0
- package/dist/primitives/scroll-area.js +82 -0
- package/dist/primitives/scroll-area.js.map +7 -0
- package/dist/primitives/segmented-control.js +101 -0
- package/dist/primitives/segmented-control.js.map +7 -0
- package/dist/primitives/separator.js +103 -4
- package/dist/primitives/separator.js.map +2 -2
- package/dist/primitives/slider.js +115 -0
- package/dist/primitives/slider.js.map +7 -0
- package/dist/primitives/step-indicator.js +187 -0
- package/dist/primitives/step-indicator.js.map +7 -0
- package/dist/primitives/table.js +102 -10
- package/dist/primitives/table.js.map +2 -2
- package/dist/primitives/tabs.js +122 -14
- package/dist/primitives/tabs.js.map +2 -2
- package/dist/primitives/time-picker.js +9 -11
- package/dist/primitives/time-picker.js.map +2 -2
- package/package.json +8 -4
- package/src/backend/DataTable.tsx +43 -60
- package/src/backend/detail/AttachmentMetadataDialog.tsx +1 -1
- package/src/primitives/__tests__/activity-feed.test.tsx +216 -0
- package/src/primitives/__tests__/avatar.test.tsx +131 -0
- package/src/primitives/__tests__/badge.test.tsx +189 -0
- package/src/primitives/__tests__/button-group.test.tsx +117 -0
- package/src/primitives/__tests__/color-picker.test.tsx +589 -0
- package/src/primitives/__tests__/command-menu.test.tsx +231 -0
- package/src/primitives/__tests__/dialog.test.tsx +290 -0
- package/src/primitives/__tests__/drawer.test.tsx +264 -0
- package/src/primitives/__tests__/notification-feed.test.tsx +303 -0
- package/src/primitives/__tests__/notification.test.tsx +102 -2
- package/src/primitives/__tests__/pagination.test.tsx +268 -0
- package/src/primitives/__tests__/progress.test.tsx +222 -0
- package/src/primitives/__tests__/rating.test.tsx +164 -0
- package/src/primitives/__tests__/scroll-area.test.tsx +109 -0
- package/src/primitives/__tests__/segmented-control.test.tsx +129 -0
- package/src/primitives/__tests__/separator.test.tsx +143 -0
- package/src/primitives/__tests__/slider.test.tsx +86 -0
- package/src/primitives/__tests__/step-indicator.test.tsx +205 -0
- package/src/primitives/__tests__/table.test.tsx +199 -0
- package/src/primitives/__tests__/tabs.test.tsx +139 -0
- package/src/primitives/activity-feed.tsx +326 -0
- package/src/primitives/avatar.tsx +225 -22
- package/src/primitives/badge.tsx +141 -6
- package/src/primitives/button-group.tsx +100 -0
- package/src/primitives/color-picker.tsx +693 -0
- package/src/primitives/command-menu.tsx +503 -0
- package/src/primitives/dialog.tsx +315 -51
- package/src/primitives/drawer.tsx +338 -0
- package/src/primitives/notification-feed.tsx +358 -0
- package/src/primitives/notification.tsx +42 -2
- package/src/primitives/pagination.tsx +376 -0
- package/src/primitives/progress.tsx +267 -6
- package/src/primitives/rating.tsx +245 -0
- package/src/primitives/scroll-area.tsx +169 -0
- package/src/primitives/segmented-control.tsx +162 -0
- package/src/primitives/separator.tsx +163 -3
- package/src/primitives/slider.tsx +160 -0
- package/src/primitives/step-indicator.tsx +287 -0
- package/src/primitives/table.tsx +142 -11
- package/src/primitives/tabs.tsx +174 -12
- package/src/primitives/time-picker.tsx +9 -11
package/.turbo/turbo-build.log
CHANGED
package/AGENTS.md
CHANGED
|
@@ -78,6 +78,20 @@ When you need… use this. Details (variants, sizes, props, MUST rules) live in
|
|
|
78
78
|
| Keyboard shortcut keys | `Kbd`, `KbdShortcut` | `@open-mercato/ui/primitives/kbd` |
|
|
79
79
|
| Entity tag pill | `Tag` (with `TagMap`) | `@open-mercato/ui/primitives/tag` |
|
|
80
80
|
| Breadcrumb navigation (DS-aligned, slash/arrow/dot divider, ARIA correct) | `Breadcrumb` (with `BreadcrumbList` / `BreadcrumbItem` / `BreadcrumbLink` / `BreadcrumbPage` / `BreadcrumbStatic` / `BreadcrumbSeparator` / `BreadcrumbEllipsis`) | `@open-mercato/ui/primitives/breadcrumb` |
|
|
81
|
+
| Scrollable container with DS-styled scrollbars | `ScrollArea` (compound: `ScrollAreaRoot` / `Viewport` / `Scrollbar` / `Thumb` / `Corner`) | `@open-mercato/ui/primitives/scroll-area` |
|
|
82
|
+
| Joined buttons sharing outer border (Save / Save & New / overflow) | `ButtonGroup` (NOT for selection — use `SegmentedControl`) | `@open-mercato/ui/primitives/button-group` |
|
|
83
|
+
| Mutually-exclusive view toggle (All / Active / Archived, 1D / 1W / 1M) | `SegmentedControl` (with `SegmentedControlItem`) | `@open-mercato/ui/primitives/segmented-control` |
|
|
84
|
+
| Continuous numeric selector — single or two-thumb range | `Slider` (`value` MUST be `[number]` or `[number, number]`) | `@open-mercato/ui/primitives/slider` |
|
|
85
|
+
| 1-N star / heart / dot rating (read-only display OR interactive input) | `Rating` (no `onChange` = read-only; `onChange` = interactive) | `@open-mercato/ui/primitives/rating` |
|
|
86
|
+
| Multi-step progress (wizard / onboarding / checkout) | `StepIndicator` (steps[] with `status` per step) | `@open-mercato/ui/primitives/step-indicator` |
|
|
87
|
+
| Color selection (tag color, brand color, category) | `ColorPicker` (swatch popover + optional hex input) | `@open-mercato/ui/primitives/color-picker` |
|
|
88
|
+
| Page navigation for lists outside DataTable | `Pagination` (1-indexed, `total` not `totalPages`) | `@open-mercato/ui/primitives/pagination` |
|
|
89
|
+
| Side sheet / non-blocking overlay (detail pane, secondary form) | `Drawer` (with `DrawerContent` / `DrawerHeader` / `DrawerBody` / `DrawerFooter` / `DrawerClose`) | `@open-mercato/ui/primitives/drawer` |
|
|
90
|
+
| Cmd+K spotlight palette (global navigation / quick actions / universal search) | `CommandMenu` (compound: `CommandMenuContent` / `Input` / `List` / `Group` / `Item` / `Separator` / `Footer`) — auto-filter via `cmdk` | `@open-mercato/ui/primitives/command-menu` |
|
|
91
|
+
| Chronological actor-action timeline (detail panes, audit feeds, customer activity logs) | `ActivityFeed` (compound: `ActivityFeedItem` / `ActivityFeedFileChip` / `ActivityFeedComment` / `ActivityFeedStatusChip`) | `@open-mercato/ui/primitives/activity-feed` |
|
|
92
|
+
| Bell-icon inbox / notification panel (the dropdown that opens from the app shell bell affordance) | `NotificationFeed` (compound: `NotificationFeedHeader` / `NotificationFeedList` / `NotificationFeedItem` / `NotificationFeedFooter` / `NotificationFeedIconBadge`) | `@open-mercato/ui/primitives/notification-feed` |
|
|
93
|
+
| Determinate linear progress bar (job percentage, file upload, onboarding) | `Progress` (`size`: `sm`/`default`/`lg`, `tone`: `accent`/`success`/`warning`/`destructive`/`muted`, optional `label`/`showValue`/`description` slots) | `@open-mercato/ui/primitives/progress` |
|
|
94
|
+
| Determinate circular progress (compact KPI dial, attachment upload thumbnail, sprint completion %) | `CircularProgress` (same `tone`s; `size`: `xs` / `sm` / `default` / `lg`; optional center `showValue` or custom `children`) | `@open-mercato/ui/primitives/progress` |
|
|
81
95
|
| Wrap a `<Link>` as button | `Button asChild` / `IconButton asChild` | — |
|
|
82
96
|
|
|
83
97
|
## Critical Primitive Rules
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SelectTrigger,
|
|
16
16
|
SelectValue
|
|
17
17
|
} from "../primitives/select.js";
|
|
18
|
-
import {
|
|
18
|
+
import { Pagination } from "../primitives/pagination.js";
|
|
19
19
|
import { Spinner } from "../primitives/spinner.js";
|
|
20
20
|
import { EmptyState } from "../primitives/empty-state.js";
|
|
21
21
|
import { TooltipProvider } from "../primitives/tooltip.js";
|
|
@@ -131,6 +131,8 @@ const EXPORT_LABELS = {
|
|
|
131
131
|
};
|
|
132
132
|
const EMPTY_FILTER_DEFS = [];
|
|
133
133
|
const EMPTY_FILTER_VALUES = Object.freeze({});
|
|
134
|
+
const STICKY_RIGHT_SHADOW_CLASS = "before:absolute before:inset-y-0 before:-left-2 before:w-2 before:bg-gradient-to-l before:from-foreground/8 before:to-transparent before:pointer-events-none";
|
|
135
|
+
const STICKY_LEFT_SHADOW_CLASS = "after:absolute after:inset-y-0 after:-right-2 after:w-2 after:bg-gradient-to-r after:from-foreground/8 after:to-transparent after:pointer-events-none";
|
|
134
136
|
function collectUniqueById(entries, warningScope) {
|
|
135
137
|
const byId = /* @__PURE__ */ new Map();
|
|
136
138
|
for (const entry of entries) {
|
|
@@ -1463,7 +1465,7 @@ function DataTable({
|
|
|
1463
1465
|
/* @__PURE__ */ jsx(
|
|
1464
1466
|
Circle,
|
|
1465
1467
|
{
|
|
1466
|
-
className: `h-3.5 w-3.5 ${normalizedCacheStatus === "hit" ? "text-
|
|
1468
|
+
className: `h-3.5 w-3.5 ${normalizedCacheStatus === "hit" ? "text-status-success-icon" : "text-status-warning-icon"}`,
|
|
1467
1469
|
strokeWidth: 3
|
|
1468
1470
|
}
|
|
1469
1471
|
),
|
|
@@ -1473,66 +1475,30 @@ function DataTable({
|
|
|
1473
1475
|
) : null;
|
|
1474
1476
|
const pageSizeOptions = Array.isArray(pagination.pageSizeOptions) ? Array.from(new Set(
|
|
1475
1477
|
[pagination.pageSize, ...pagination.pageSizeOptions].filter((size) => typeof size === "number" && Number.isFinite(size) && size > 0).map((size) => Math.max(1, Math.floor(size)))
|
|
1476
|
-
)).sort((left, right) => left - right) : [];
|
|
1477
|
-
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
|
|
1478
|
+
)).sort((left, right) => left - right) : [10, 25, 50, 100];
|
|
1479
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-3 px-4 py-3 border-t", children: [
|
|
1480
|
+
cacheBadge ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center sm:justify-start gap-2 text-sm text-muted-foreground", children: cacheBadge }) : null,
|
|
1481
|
+
/* @__PURE__ */ jsx(
|
|
1482
|
+
Pagination,
|
|
1480
1483
|
{
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
+
page,
|
|
1485
|
+
pageSize: pagination.pageSize,
|
|
1486
|
+
total: pagination.total,
|
|
1487
|
+
onPageChange: (next) => {
|
|
1488
|
+
onPageChange(next);
|
|
1484
1489
|
scrollTableIntoView();
|
|
1485
1490
|
},
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
/* @__PURE__ */ jsx(SelectContent, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx(SelectItem, { value: String(size), children: size }, size)) })
|
|
1496
|
-
]
|
|
1491
|
+
onPageSizeChange: pagination.onPageSizeChange ? (next) => {
|
|
1492
|
+
pagination.onPageSizeChange(next);
|
|
1493
|
+
scrollTableIntoView();
|
|
1494
|
+
} : void 0,
|
|
1495
|
+
pageSizeOptions,
|
|
1496
|
+
formatPageInfo: () => durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total }),
|
|
1497
|
+
formatPageSizeLabel: (size) => `${size} ${t("ui.dataTable.pagination.perPage", "per page")}`,
|
|
1498
|
+
"aria-label": t("ui.dataTable.pagination.navAriaLabel", "Table pagination"),
|
|
1499
|
+
className: "flex-1"
|
|
1497
1500
|
}
|
|
1498
|
-
)
|
|
1499
|
-
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-muted-foreground", children: t("ui.dataTable.pagination.perPage", "per page") })
|
|
1500
|
-
] }) : null;
|
|
1501
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-4 py-3 border-t", children: [
|
|
1502
|
-
/* @__PURE__ */ jsxs("div", { className: "text-sm text-muted-foreground flex items-center justify-center sm:justify-start gap-2 flex-wrap", children: [
|
|
1503
|
-
/* @__PURE__ */ jsx("span", { children: durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total }) }),
|
|
1504
|
-
cacheBadge,
|
|
1505
|
-
pageSizeSelect
|
|
1506
|
-
] }),
|
|
1507
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center sm:justify-end gap-2", children: [
|
|
1508
|
-
/* @__PURE__ */ jsx(
|
|
1509
|
-
Button,
|
|
1510
|
-
{
|
|
1511
|
-
variant: "outline",
|
|
1512
|
-
size: "sm",
|
|
1513
|
-
onClick: () => {
|
|
1514
|
-
onPageChange(page - 1);
|
|
1515
|
-
scrollTableIntoView();
|
|
1516
|
-
},
|
|
1517
|
-
disabled: page <= 1,
|
|
1518
|
-
children: t("ui.dataTable.pagination.previous", "Previous")
|
|
1519
|
-
}
|
|
1520
|
-
),
|
|
1521
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm whitespace-nowrap", children: t("ui.dataTable.pagination.pageInfo", "Page {page} of {totalPages}", { page, totalPages }) }),
|
|
1522
|
-
/* @__PURE__ */ jsx(
|
|
1523
|
-
Button,
|
|
1524
|
-
{
|
|
1525
|
-
variant: "outline",
|
|
1526
|
-
size: "sm",
|
|
1527
|
-
onClick: () => {
|
|
1528
|
-
onPageChange(page + 1);
|
|
1529
|
-
scrollTableIntoView();
|
|
1530
|
-
},
|
|
1531
|
-
disabled: page >= totalPages,
|
|
1532
|
-
children: t("ui.dataTable.pagination.next", "Next")
|
|
1533
|
-
}
|
|
1534
|
-
)
|
|
1535
|
-
] })
|
|
1501
|
+
)
|
|
1536
1502
|
] });
|
|
1537
1503
|
}, [pagination, measuredDurationMs, scrollTableIntoView, t]);
|
|
1538
1504
|
const resolvedEntityIds = React.useMemo(() => {
|
|
@@ -2076,7 +2042,7 @@ function DataTable({
|
|
|
2076
2042
|
const columnMeta = header.column.columnDef?.meta;
|
|
2077
2043
|
const priority = resolvePriority(header.column);
|
|
2078
2044
|
const isFirstDataColumn = headerIndex === 0;
|
|
2079
|
-
const stickyClass = stickyFirstColumn && isFirstDataColumn ?
|
|
2045
|
+
const stickyClass = stickyFirstColumn && isFirstDataColumn ? ` sticky left-0 z-10 bg-background ${STICKY_LEFT_SHADOW_CLASS}` : "";
|
|
2080
2046
|
const headerCellContent = header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
|
|
2081
2047
|
Button,
|
|
2082
2048
|
{
|
|
@@ -2102,7 +2068,7 @@ function DataTable({
|
|
|
2102
2068
|
{
|
|
2103
2069
|
className: cn(
|
|
2104
2070
|
"w-0 text-right",
|
|
2105
|
-
stickyActionsColumn &&
|
|
2071
|
+
stickyActionsColumn && `sticky right-0 z-20 bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2106
2072
|
),
|
|
2107
2073
|
children: t("ui.dataTable.actionsColumn", "Actions")
|
|
2108
2074
|
}
|
|
@@ -2178,14 +2144,14 @@ function DataTable({
|
|
|
2178
2144
|
tooltipText = cellValue != null ? String(cellValue) : void 0;
|
|
2179
2145
|
}
|
|
2180
2146
|
const wrappedContent = shouldTruncate ? /* @__PURE__ */ jsx(TruncatedCell, { maxWidth, tooltipContent: tooltipText, children: content }) : content;
|
|
2181
|
-
return /* @__PURE__ */ jsx(TableCell, { className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ?
|
|
2147
|
+
return /* @__PURE__ */ jsx(TableCell, { className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? ` sticky left-0 z-10 bg-background ${STICKY_LEFT_SHADOW_CLASS}` : ""), children: wrappedContent }, cell.id);
|
|
2182
2148
|
}),
|
|
2183
2149
|
rowActions || injectedRowActions.length > 0 ? /* @__PURE__ */ jsx(
|
|
2184
2150
|
TableCell,
|
|
2185
2151
|
{
|
|
2186
2152
|
className: cn(
|
|
2187
2153
|
"text-right whitespace-nowrap",
|
|
2188
|
-
stickyActionsColumn &&
|
|
2154
|
+
stickyActionsColumn && `sticky right-0 z-10 bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2189
2155
|
),
|
|
2190
2156
|
"data-actions-cell": true,
|
|
2191
2157
|
children: rowActionsElement
|