@columenlabs/lumen-ui 0.1.173 → 0.1.174
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/color-dot.d.ts +4 -1
- package/dist/color-dot.js +3 -3
- package/dist/tag-chips.js +8 -3
- package/package.json +2 -2
package/dist/color-dot.d.ts
CHANGED
|
@@ -14,10 +14,13 @@ export declare function tintedIcon(icon: ComponentType<{
|
|
|
14
14
|
className?: string;
|
|
15
15
|
}>;
|
|
16
16
|
/** A value as a chip in its colour (a label): a tint behind, the colour as text, its icon first. */
|
|
17
|
-
export declare function ColorChip({ color, icon: Icon, children, }: {
|
|
17
|
+
export declare function ColorChip({ color, icon: Icon, children, className, title, }: {
|
|
18
18
|
color?: string;
|
|
19
19
|
icon?: ComponentType<{
|
|
20
20
|
className?: string;
|
|
21
21
|
}>;
|
|
22
22
|
children: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** The full text on hover, for a chip that may end in an ellipsis. */
|
|
25
|
+
title?: string;
|
|
23
26
|
}): import("react").JSX.Element;
|
package/dist/color-dot.js
CHANGED
|
@@ -32,12 +32,12 @@ export function tintedIcon(icon, color) {
|
|
|
32
32
|
return out;
|
|
33
33
|
}
|
|
34
34
|
/** A value as a chip in its colour (a label): a tint behind, the colour as text, its icon first. */
|
|
35
|
-
export function ColorChip({ color, icon: Icon, children, }) {
|
|
36
|
-
return (_jsxs("span", { className:
|
|
35
|
+
export function ColorChip({ color, icon: Icon, children, className, title, }) {
|
|
36
|
+
return (_jsxs("span", { title: title, className: cn('inline-flex h-5 shrink-0 items-center gap-1 rounded-sm bg-secondary px-1.5 text-xs font-medium whitespace-nowrap text-secondary-foreground', className), style: color
|
|
37
37
|
? {
|
|
38
38
|
background: `color-mix(in oklab, ${color} 18%, transparent)`,
|
|
39
39
|
// The colour pulled toward the text colour, so a light hue (yellow, sky) still reads.
|
|
40
40
|
color: `color-mix(in oklab, ${color} 55%, var(--foreground))`,
|
|
41
41
|
}
|
|
42
|
-
: undefined, children: [Icon && _jsx(Icon, { className: "size-3 shrink-0" }), children] }));
|
|
42
|
+
: undefined, children: [Icon && _jsx(Icon, { className: "size-3 shrink-0" }), _jsx("span", { className: "min-w-0 truncate", children: children })] }));
|
|
43
43
|
}
|
package/dist/tag-chips.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Tags (a row's several free-form labels: `ai`, `cybersecurity`, `favorite`) as coloured chips,
|
|
3
3
|
// each with an icon where its words suggest one. The colour comes from the tag's name, so one tag
|
|
4
4
|
// reads the same colour on every row, page and app with nothing stored.
|
|
5
|
-
import { Baby, BookOpen, Bot, Briefcase, Bug, Building2, Car, Check, Clock, Cloud, Code, Cpu, Database, DollarSign, Dumbbell, Factory, Film, Flag, Flame, Gamepad2, Globe, GraduationCap, Heart, HeartPulse, Hourglass, House, Landmark, Leaf, Lock, MapPin, Megaphone, Music, Network, Palette, Plane, Rocket, Server, Shield, ShoppingCart, Smartphone, Sparkles, Star, TriangleAlert, Truck, Users, Utensils, Wrench, Zap, } from 'lucide-react';
|
|
5
|
+
import { Baby, BookOpen, Bot, Briefcase, Bug, Building2, Car, Check, Clock, Cloud, Code, Cpu, Database, DollarSign, Dumbbell, Factory, FileText, Film, Flag, Flame, Gamepad2, Globe, GraduationCap, Handshake, Heart, HeartPulse, Hourglass, House, Landmark, LayoutTemplate, Leaf, Lightbulb, Link, Lock, MapPin, Megaphone, Music, Network, Palette, Plane, Rocket, Server, Shield, ShoppingCart, Smartphone, Sparkles, Star, TriangleAlert, Truck, Users, Utensils, Wrench, Zap, } from 'lucide-react';
|
|
6
6
|
import { ColorChip } from './color-dot.js';
|
|
7
7
|
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip.js';
|
|
8
8
|
// Chart colours that read as a hue in light and dark (not the grey `--chart-8`).
|
|
@@ -46,7 +46,12 @@ const TAG_ICONS = [
|
|
|
46
46
|
[/^(team|people|social|community|hr)$/, Users],
|
|
47
47
|
[/^(jobs?|work|career|hiring)$/, Briefcase],
|
|
48
48
|
[/^(edu|education|learning|school|course|courses|training)$/, GraduationCap],
|
|
49
|
-
[/^(
|
|
49
|
+
[/^(docs?|documents?|guides?|pdf|files?)$/, FileText],
|
|
50
|
+
[/^(templates?|layouts?)$/, LayoutTemplate],
|
|
51
|
+
[/^(how|howto|tips?|ideas?)$/, Lightbulb],
|
|
52
|
+
[/^(partners?|partnership|vendors?)$/, Handshake],
|
|
53
|
+
[/^(links?|urls?|bookmarks?)$/, Link],
|
|
54
|
+
[/^(books?|reading|research)$/, BookOpen],
|
|
50
55
|
[/^(games?|gaming)$/, Gamepad2],
|
|
51
56
|
[/^(music|audio)$/, Music],
|
|
52
57
|
[/^(film|video|movies?|media|streaming)$/, Film],
|
|
@@ -89,7 +94,7 @@ export function TagChips({ tags, max = 3, colorOf, iconOf, empty, }) {
|
|
|
89
94
|
return _jsx("span", { className: "text-muted-foreground", children: empty ?? '—' });
|
|
90
95
|
const shown = tags.slice(0, max);
|
|
91
96
|
const rest = tags.length - shown.length;
|
|
92
|
-
const chips = (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1 overflow-hidden", children: [shown.map((t) => (_jsx(ColorChip, { color: colorOf?.(t) ?? tagColor(t), icon: iconOf?.(t) ?? tagIcon(t), children: t }, t))), rest > 0 && _jsxs(ColorChip, { children: ["+", rest] })] }));
|
|
97
|
+
const chips = (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1 overflow-hidden", children: [shown.map((t) => (_jsx(ColorChip, { color: colorOf?.(t) ?? tagColor(t), icon: iconOf?.(t) ?? tagIcon(t), title: t, className: "max-w-full min-w-9 shrink", children: t }, t))), rest > 0 && _jsxs(ColorChip, { children: ["+", rest] })] }));
|
|
93
98
|
if (!rest)
|
|
94
99
|
return chips;
|
|
95
100
|
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: chips }), _jsx(TooltipContent, { className: "max-w-md whitespace-normal", children: tags.join(', ') })] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.174",
|
|
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.174",
|
|
53
53
|
"@dnd-kit/core": "6.3.1",
|
|
54
54
|
"@dnd-kit/sortable": "10.0.0",
|
|
55
55
|
"@dnd-kit/utilities": "3.2.2",
|