@upbound/monarch-blocks 0.14.0 → 0.15.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/dist/chat-interface.js.map +1 -1
- package/dist/data-table.d.ts +2 -2
- package/dist/data-table.js +46 -20
- package/dist/data-table.js.map +1 -1
- package/dist/{empty-view-DQt8-Ho8.d.ts → empty-view-DHTvKsil.d.ts} +3 -0
- package/dist/graph.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53 -21
- package/dist/index.js.map +1 -1
- package/dist/page-header.js +7 -1
- package/dist/page-header.js.map +1 -1
- package/dist/relative-time.d.ts +2 -2
- package/dist/relative-time.js +4 -4
- package/dist/relative-time.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { IconName } from '@upbound/monarch-core';
|
|
3
4
|
import { RowData, Cell, columnFilteringFeature, globalFilteringFeature, columnFacetingFeature, rowSortingFeature, rowPaginationFeature, rowExpandingFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnVisibilityFeature, columnSizingFeature, columnResizingFeature, createFilteredRowModel, createFacetedRowModel, createFacetedUniqueValues, createSortedRowModel, createPaginatedRowModel, createGroupedRowModel, createExpandedRowModel, filterFns, sortFns, Column, TableOptions, Row, ColumnDef, HeaderGroup, Header, ReactTable, TableFeatures } from '@tanstack/react-table';
|
|
4
5
|
|
|
@@ -177,6 +178,8 @@ declare module '@tanstack/react-table' {
|
|
|
177
178
|
interface ColumnMeta<TFeatures extends TableFeatures, TData extends RowData, TValue> {
|
|
178
179
|
/** Pins the column to the inline start or end edge. Pinned columns are excluded from column reordering. */
|
|
179
180
|
pinning?: 'start' | 'end';
|
|
181
|
+
/** Explains the column's data in a tooltip on the header label. Without it, the header label has no tooltip. */
|
|
182
|
+
headerTooltip?: ReactNode;
|
|
180
183
|
/** Marks an actions column — hides its header label and excludes it from contextual filtering. */
|
|
181
184
|
actions?: boolean;
|
|
182
185
|
/**
|
package/dist/graph.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Node, NodeProps, Edge, EdgeProps, NodeTypes, EdgeTypes } from 'reactflo
|
|
|
2
2
|
export { Edge, Node } from 'reactflow';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ColumnFiltersState } from '@tanstack/react-table';
|
|
5
|
-
import { T as TableDataState } from './empty-view-
|
|
5
|
+
import { T as TableDataState } from './empty-view-DHTvKsil.js';
|
|
6
6
|
import { DataTableColumnDef, DataTableEmptyConfig } from './data-table.js';
|
|
7
7
|
import '@upbound/monarch-core';
|
|
8
8
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { ChartAction, ChartConfig, ChartContainer, ChartDescription, ChartFooter
|
|
|
4
4
|
export { ChatInput, ChatInputProps, ChatInterface, ChatInterfaceProps, ChatMessage, ChatMessageBubble, ChatRoutine, ChatSession, ChatSessionList, ChatSessionListProps, ChatThread, ChatThreadProps, ChatToolCall } from './chat-interface.js';
|
|
5
5
|
export { CodeBlock, CodeBlockBody, CodeBlockCode, CodeBlockCopyButton, CodeBlockDownloadButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLanguage } from './code-block.js';
|
|
6
6
|
export { CellContextualFilter, CellContextualFilterProps, ColumnOptions, ColumnOptionsProps, ContextualMenuAction, DataTable, DataTableBody, DataTableCelFilterConfig, DataTableCell, DataTableExpandedRow, DataTableFilterVisibilityConfig, DataTableGroupRow, DataTableHeader, DataTablePagination, DataTablePaginationConfig, DataTablePaginationProps, DataTableProps, DataTableRow, DataTableRowProps, DataTableSearchConfig, DataTableSkeletonBody, DataTableValueCell, DataTableValueCellProps, ExpandButton, RowActionItem, RowActions, RowCountRelation, StickyHeaderConfig, TableHookOptions, TableLayout, TimestampCell, ViewFilter, ViewFilterProps, getActionsColumnDefinition, getExpandColumnDefinition, normalizePageSizeOptions } from './data-table.js';
|
|
7
|
-
export { D as DataTableCellInstance, a as DataTableColumnDef, b as DataTableColumnInstance, c as DataTableEmptyConfig, d as DataTableEmptyView, e as DataTableFeatures, f as DataTableHeaderGroupInstance, g as DataTableHeaderInstance, h as DataTableInstance, i as DataTableOptions, j as DataTableRowInstance, k as dataTableFeatures, l as defaultEmptyConfig, m as defaultErrorConfig, n as defaultNoFilterFoundConfig } from './empty-view-
|
|
7
|
+
export { D as DataTableCellInstance, a as DataTableColumnDef, b as DataTableColumnInstance, c as DataTableEmptyConfig, d as DataTableEmptyView, e as DataTableFeatures, f as DataTableHeaderGroupInstance, g as DataTableHeaderInstance, h as DataTableInstance, i as DataTableOptions, j as DataTableRowInstance, k as dataTableFeatures, l as defaultEmptyConfig, m as defaultErrorConfig, n as defaultNoFilterFoundConfig } from './empty-view-DHTvKsil.js';
|
|
8
8
|
export { ColumnFilter, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ColumnSort, ColumnVisibilityState, ExpandedState, PaginationState, SortingState, createColumnHelper } from '@tanstack/react-table';
|
|
9
9
|
export { ActiveFilter, CheckboxFilterDefinition, CheckboxFilterValue, DateFilterDefinition, DateFilterValue, FilterBar, FilterBarProps, FilterChip, FilterDefinition, FilterOption, FilterType, FilterValue, MultiTextFilterDefinition, MultiTextFilterValue, RadioFilterDefinition, RadioFilterValue, TextFilterDefinition, TextFilterValue } from './filter-bar.js';
|
|
10
10
|
export { FloatingWidget, FloatingWidgetProvider, useFloatingWidget } from './floating-widget.js';
|
package/dist/index.js
CHANGED
|
@@ -2186,7 +2186,7 @@ function formatRelativeDefault(date, locale) {
|
|
|
2186
2186
|
if (hrs2 < 24) return `in ${hrs2} hour${hrs2 === 1 ? "" : "s"}`;
|
|
2187
2187
|
if (days2 < 7) return `in ${days2} day${days2 === 1 ? "" : "s"}`;
|
|
2188
2188
|
if (days2 < 30) return `in ${Math.floor(days2 / 7)} week${Math.floor(days2 / 7) === 1 ? "" : "s"}`;
|
|
2189
|
-
return
|
|
2189
|
+
return `${date.toLocaleDateString(locale, __spreadValues({
|
|
2190
2190
|
month: "short",
|
|
2191
2191
|
day: "numeric"
|
|
2192
2192
|
}, date.getFullYear() !== now.getFullYear() ? { year: "numeric" } : {}))}`;
|
|
@@ -2202,7 +2202,7 @@ function formatRelativeDefault(date, locale) {
|
|
|
2202
2202
|
if (days < 7) return `${days} days ago`;
|
|
2203
2203
|
if (days < 14) return "last week";
|
|
2204
2204
|
if (days < 30) return `${Math.floor(days / 7)} weeks ago`;
|
|
2205
|
-
return
|
|
2205
|
+
return `${date.toLocaleDateString(locale, __spreadValues({
|
|
2206
2206
|
month: "short",
|
|
2207
2207
|
day: "numeric"
|
|
2208
2208
|
}, date.getFullYear() !== now.getFullYear() ? { year: "numeric" } : {}))}`;
|
|
@@ -2220,7 +2220,7 @@ function formatRelativeCompact(date, locale) {
|
|
|
2220
2220
|
if (hrs2 < 24) return `in ${hrs2}h`;
|
|
2221
2221
|
if (days2 < 7) return `in ${days2}d`;
|
|
2222
2222
|
if (days2 < 30) return `in ${Math.floor(days2 / 7)}w`;
|
|
2223
|
-
return
|
|
2223
|
+
return `${date.toLocaleDateString(locale, __spreadValues({
|
|
2224
2224
|
month: "short",
|
|
2225
2225
|
day: "numeric"
|
|
2226
2226
|
}, date.getFullYear() !== now.getFullYear() ? { year: "numeric" } : {}))}`;
|
|
@@ -2234,7 +2234,7 @@ function formatRelativeCompact(date, locale) {
|
|
|
2234
2234
|
if (hrs < 24) return `${hrs}h ago`;
|
|
2235
2235
|
if (days < 7) return `${days}d ago`;
|
|
2236
2236
|
if (days < 30) return `${Math.floor(days / 7)}w ago`;
|
|
2237
|
-
return
|
|
2237
|
+
return `${date.toLocaleDateString(locale, __spreadValues({
|
|
2238
2238
|
month: "short",
|
|
2239
2239
|
day: "numeric"
|
|
2240
2240
|
}, date.getFullYear() !== now.getFullYear() ? { year: "numeric" } : {}))}`;
|
|
@@ -4922,6 +4922,34 @@ function ColumnActionsMenuItems({
|
|
|
4922
4922
|
] })
|
|
4923
4923
|
] });
|
|
4924
4924
|
}
|
|
4925
|
+
function HeaderTooltip({ content, children }) {
|
|
4926
|
+
if (!content) return children;
|
|
4927
|
+
return /* @__PURE__ */ jsxs13(Tooltip7, { children: [
|
|
4928
|
+
/* @__PURE__ */ jsx14(TooltipTrigger6, { asChild: true, children }),
|
|
4929
|
+
/* @__PURE__ */ jsx14(TooltipContent6, { children: content })
|
|
4930
|
+
] });
|
|
4931
|
+
}
|
|
4932
|
+
function ColumnActionsMenu({
|
|
4933
|
+
header,
|
|
4934
|
+
tooltip,
|
|
4935
|
+
onAutosizeAll,
|
|
4936
|
+
onAutosizeColumn,
|
|
4937
|
+
layout,
|
|
4938
|
+
children
|
|
4939
|
+
}) {
|
|
4940
|
+
return /* @__PURE__ */ jsxs13(DropdownMenu4, { children: [
|
|
4941
|
+
/* @__PURE__ */ jsx14(HeaderTooltip, { content: tooltip, children: /* @__PURE__ */ jsx14(DropdownMenuTrigger4, { asChild: true, children }) }),
|
|
4942
|
+
/* @__PURE__ */ jsx14(
|
|
4943
|
+
ColumnActionsMenuItems,
|
|
4944
|
+
{
|
|
4945
|
+
header,
|
|
4946
|
+
onAutosizeAll,
|
|
4947
|
+
onAutosizeColumn,
|
|
4948
|
+
layout
|
|
4949
|
+
}
|
|
4950
|
+
)
|
|
4951
|
+
] });
|
|
4952
|
+
}
|
|
4925
4953
|
function HeaderCellContent({
|
|
4926
4954
|
header,
|
|
4927
4955
|
canResize,
|
|
@@ -4933,8 +4961,10 @@ function HeaderCellContent({
|
|
|
4933
4961
|
onResetColumnSize,
|
|
4934
4962
|
layout = "auto"
|
|
4935
4963
|
}) {
|
|
4964
|
+
var _a;
|
|
4936
4965
|
const resizeHandler = header.getResizeHandler();
|
|
4937
4966
|
const headerTitle = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "";
|
|
4967
|
+
const headerTooltip = (_a = header.column.columnDef.meta) == null ? void 0 : _a.headerTooltip;
|
|
4938
4968
|
const sorted = header.column.getIsSorted();
|
|
4939
4969
|
const labelButton = /* @__PURE__ */ jsxs13(
|
|
4940
4970
|
"button",
|
|
@@ -4960,23 +4990,19 @@ function HeaderCellContent({
|
|
|
4960
4990
|
]
|
|
4961
4991
|
}
|
|
4962
4992
|
);
|
|
4963
|
-
const label = shouldShowActionsMenu ? /* @__PURE__ */
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
] }) : labelButton;
|
|
4993
|
+
const label = shouldShowActionsMenu ? /* @__PURE__ */ jsx14(
|
|
4994
|
+
ColumnActionsMenu,
|
|
4995
|
+
{
|
|
4996
|
+
header,
|
|
4997
|
+
tooltip: headerTooltip,
|
|
4998
|
+
onAutosizeAll,
|
|
4999
|
+
onAutosizeColumn,
|
|
5000
|
+
layout,
|
|
5001
|
+
children: labelButton
|
|
5002
|
+
}
|
|
5003
|
+
) : /* @__PURE__ */ jsx14(HeaderTooltip, { content: headerTooltip, children: labelButton });
|
|
4975
5004
|
return /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
4976
|
-
/* @__PURE__ */ jsx14("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: /* @__PURE__ */ jsx14("div", { className: "min-w-0 flex-1", children: !isActionColumn && !isGroupedColumn &&
|
|
4977
|
-
/* @__PURE__ */ jsx14(TooltipTrigger6, { asChild: true, children: label }),
|
|
4978
|
-
/* @__PURE__ */ jsx14(TooltipContent6, { children: headerTitle })
|
|
4979
|
-
] }) : label) }) }),
|
|
5005
|
+
/* @__PURE__ */ jsx14("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: /* @__PURE__ */ jsx14("div", { className: "min-w-0 flex-1", children: !isActionColumn && !isGroupedColumn && label }) }),
|
|
4980
5006
|
canResize && /* @__PURE__ */ jsx14(
|
|
4981
5007
|
"button",
|
|
4982
5008
|
{
|
|
@@ -7549,7 +7575,13 @@ function PageHeaderTitle(_a) {
|
|
|
7549
7575
|
}
|
|
7550
7576
|
function PageHeaderDescription(_a) {
|
|
7551
7577
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7552
|
-
return /* @__PURE__ */ jsx25(
|
|
7578
|
+
return /* @__PURE__ */ jsx25(
|
|
7579
|
+
"p",
|
|
7580
|
+
__spreadValues({
|
|
7581
|
+
"data-slot": "page-header-description",
|
|
7582
|
+
className: cn("text-body text-muted-foreground max-w-160", className)
|
|
7583
|
+
}, props)
|
|
7584
|
+
);
|
|
7553
7585
|
}
|
|
7554
7586
|
function PageHeaderMeta(_a) {
|
|
7555
7587
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|