@columenlabs/lumen-ui 0.1.104 → 0.1.106
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/details-table.js +4 -1
- package/dist/tile.js +3 -1
- package/dist/ui/sidebar.js +1 -1
- package/package.json +2 -2
package/dist/details-table.js
CHANGED
|
@@ -4,7 +4,10 @@ import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, Table
|
|
|
4
4
|
export function DetailsTable({ head, rows, foot, selected, onSelect }) {
|
|
5
5
|
const marked = head.findIndex((h) => h.grow);
|
|
6
6
|
const grow = marked >= 0 ? marked : head.length - 1;
|
|
7
|
-
const cell = (i) => cn(head[i]?.right && 'num text-right', i !== grow && 'w-px',
|
|
7
|
+
const cell = (i) => cn(head[i]?.right && 'num text-right', i !== grow && 'w-px',
|
|
8
|
+
// A marked `grow` column (a name) takes the spare width and no more: a long name ends in an
|
|
9
|
+
// ellipsis instead of pushing the other columns out of the card.
|
|
10
|
+
i === marked && 'w-full max-w-0 truncate [&>*]:max-w-full', head[i]?.hideOnPhone && 'max-md:hidden');
|
|
8
11
|
return (_jsx("div", { className: "-mx-1 overflow-x-auto overflow-y-hidden rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsx(TableRow, { children: head.map((h, i) => (_jsx(TableHead, { className: cn(h.right && 'text-right', i !== grow && 'w-px', h.hideOnPhone && 'max-md:hidden'), children: h.label }, h.label))) }) }), _jsx(TableBody, { children: rows.map((r) => (_jsx(TableRow, { "data-state": r.key === selected ? 'selected' : undefined, "aria-current": r.key === selected || undefined, tabIndex: onSelect ? 0 : undefined, className: cn(onSelect &&
|
|
9
12
|
'cursor-pointer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring'), onClick: onSelect && (() => onSelect(r.key)), onKeyDown: onSelect &&
|
|
10
13
|
((e) => {
|
package/dist/tile.js
CHANGED
|
@@ -15,8 +15,10 @@ export function TileSpark({ values, color = 'var(--chart-1)', className, }) {
|
|
|
15
15
|
// Inline size: a parent's `[&_svg]:size-4` (toggle items, buttons) must not shrink it.
|
|
16
16
|
style: { width: '100%', height: '1.5rem' }, className: cn('overflow-visible', className), children: [_jsx("polygon", { points: `0,24 ${pts.join(' ')} 100,24`, fill: color, fillOpacity: 0.15 }), _jsx("polyline", { points: pts.join(' '), fill: "none", stroke: color, strokeWidth: 1.5, strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" })] }));
|
|
17
17
|
}
|
|
18
|
+
/** A value with no digit in it ("Workers Paid", "Healthy") is a word, not a number. */
|
|
19
|
+
const isWord = (v) => typeof v === 'string' && !/\d/.test(v);
|
|
18
20
|
function TileBody({ label, value, caption, lines, valueClassName, spark, sparkColor, }) {
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "w-full truncate text-xs text-muted-foreground", children: label }), _jsx("span", { className: cn('num truncate text-xl leading-7 font-semibold', valueClassName), children: value }), caption ? (_jsx("span", { className: "
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "w-full truncate text-xs text-muted-foreground", children: label }), _jsx("span", { className: cn(!isWord(value) && 'num', 'truncate text-xl leading-7 font-semibold', valueClassName), children: value }), caption ? (_jsx("span", { className: "line-clamp-2 text-xs text-muted-foreground tabular-nums", children: caption })) : null, lines?.map((l, i) => (_jsx("span", { className: "num line-clamp-2 text-xs text-muted-foreground", children: l }, i))), spark ? _jsx(TileSpark, { values: spark, color: sparkColor, className: "mt-1 self-stretch" }) : null] }));
|
|
20
22
|
}
|
|
21
23
|
export function Tile({ label, value, caption, lines, className, valueClassName, spark, sparkColor, }) {
|
|
22
24
|
return (_jsx(Card, { size: "sm", className: cn('min-w-0 flex-1 basis-2/5 gap-0.5 px-3 lg:basis-auto', TILE_WIDTH, className), children: _jsx(TileBody, { label: label, value: value, caption: caption, lines: lines, valueClassName: valueClassName, spark: spark, sparkColor: sparkColor }) }));
|
package/dist/ui/sidebar.js
CHANGED
|
@@ -82,7 +82,7 @@ function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas'
|
|
|
82
82
|
return (_jsx("div", { "data-slot": "sidebar", className: cn('flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground', className), ...props, children: children }));
|
|
83
83
|
}
|
|
84
84
|
if (isMobile) {
|
|
85
|
-
return (_jsxs(_Fragment, { children: [!openMobile && _jsx("div", { hidden: true, children: children }), _jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsxs(SheetContent, { dir: dir, "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [
|
|
85
|
+
return (_jsxs(_Fragment, { children: [!openMobile && _jsx("div", { hidden: true, children: children }), _jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsxs(SheetContent, { dir: dir, "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&_[data-sidebar=header]]:pr-11", style: {
|
|
86
86
|
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
87
87
|
}, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) })] }));
|
|
88
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.106",
|
|
4
4
|
"description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@codemirror/lang-javascript": "6.2.5",
|
|
50
50
|
"@codemirror/lang-json": "6.0.2",
|
|
51
51
|
"@codemirror/lang-sql": "6.10.0",
|
|
52
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
52
|
+
"@columenlabs/lumen-ui-types": "0.1.106",
|
|
53
53
|
"@dnd-kit/core": "6.3.1",
|
|
54
54
|
"@dnd-kit/sortable": "10.0.0",
|
|
55
55
|
"@dnd-kit/utilities": "3.2.2",
|