@cosxai/ui 1.0.0-alpha.8 → 1.0.0-alpha.9
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/components/WorkspaceRow.tsx +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 1.0.0-alpha.9 (2026-09-30)
|
|
2
|
+
|
|
3
|
+
- WorkspaceRow: `badge` — what the workspace still needs, as an attention
|
|
4
|
+
badge beside the chevron ("Needs setup"; Metaroom Sign In, Set up your
|
|
5
|
+
workspace).
|
|
6
|
+
|
|
1
7
|
## 1.0.0-alpha.8 (2026-09-30)
|
|
2
8
|
|
|
3
9
|
- ThemeSwitch: `defaultOpen` starts it opened (documentation specimens).
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { ChevronRight } from 'lucide-react';
|
|
|
2
2
|
import { forwardRef, useEffect, useRef, useState, type ComponentProps, type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { cn } from '../lib/cn';
|
|
5
|
+
import { Badge } from './Badge';
|
|
5
6
|
import { Spinner } from './Spinner';
|
|
6
7
|
|
|
7
8
|
export type WorkspaceMarkProps = {
|
|
@@ -39,14 +40,17 @@ export type WorkspaceRowProps = Omit<ComponentProps<'button'>, 'children'> & {
|
|
|
39
40
|
logoUrl?: string | undefined;
|
|
40
41
|
/** Being opened: a spinner in place of the chevron. */
|
|
41
42
|
busy?: boolean | undefined;
|
|
43
|
+
/** A state beside the chevron, as an attention badge: "Needs setup". */
|
|
44
|
+
badge?: ReactNode;
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
/**
|
|
45
|
-
* WorkspaceRow — one workspace in a chooser: mark, name, detail, chevron
|
|
48
|
+
* WorkspaceRow — one workspace in a chooser: mark, name, detail, chevron;
|
|
49
|
+
* `badge` says what it still needs ("Needs setup").
|
|
46
50
|
* The whole row is the button; `busy` shows it opening (disable the others).
|
|
47
51
|
*/
|
|
48
52
|
export const WorkspaceRow = forwardRef<HTMLButtonElement, WorkspaceRowProps>(function WorkspaceRow(
|
|
49
|
-
{ name, detail, logoUrl, busy = false, className, ...rest },
|
|
53
|
+
{ name, detail, logoUrl, busy = false, badge, className, ...rest },
|
|
50
54
|
ref,
|
|
51
55
|
) {
|
|
52
56
|
return (
|
|
@@ -65,6 +69,11 @@ export const WorkspaceRow = forwardRef<HTMLButtonElement, WorkspaceRowProps>(fun
|
|
|
65
69
|
<span className="truncate text-[14px] font-medium">{name}</span>
|
|
66
70
|
{detail && <span className="truncate text-[12px] text-fg-secondary">{detail}</span>}
|
|
67
71
|
</span>
|
|
72
|
+
{badge && (
|
|
73
|
+
<span className="flex shrink-0">
|
|
74
|
+
<Badge status="attention">{badge}</Badge>
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
68
77
|
{busy ? <Spinner size={16} /> : <ChevronRight size={16} aria-hidden className="text-fg-secondary" />}
|
|
69
78
|
</button>
|
|
70
79
|
);
|