@inbeat/ui 0.13.0 → 0.14.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.14.0](https://github.com/Genoux/ib-toolkit/compare/ui-v0.13.0...ui-v0.14.0) (2026-11-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* enforce the type scale and show avatar stack names ([#70](https://github.com/Genoux/ib-toolkit/issues/70)) ([e6020e6](https://github.com/Genoux/ib-toolkit/commit/e6020e649762503db92358590822d603ebe8d29d))
|
|
9
|
+
* **ui:** set table cells to 13.5px ([#72](https://github.com/Genoux/ib-toolkit/issues/72)) ([3e1b5d5](https://github.com/Genoux/ib-toolkit/commit/3e1b5d5d80c36c99a6c2efd03fe26921110d39eb))
|
|
10
|
+
|
|
3
11
|
## [0.13.0](https://github.com/Genoux/ib-toolkit/compare/ui-v0.12.2...ui-v0.13.0) (2026-11-12)
|
|
4
12
|
|
|
5
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inbeat/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "inBeat design tokens and primitives (Radix + Tailwind v4), shipped as source",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@base-ui/react": "^1.2.0",
|
|
67
67
|
"@fontsource-variable/geist": "^5.3.0",
|
|
68
68
|
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
69
|
-
"@inbeat/config": "^0.
|
|
69
|
+
"@inbeat/config": "^0.14.0",
|
|
70
70
|
"@storybook/addon-a11y": "^10.6.0",
|
|
71
71
|
"@storybook/addon-docs": "^10.6.0",
|
|
72
72
|
"@storybook/addon-themes": "^10.6.0",
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { AvatarGroup, AvatarGroupCount } from "./avatar";
|
|
2
2
|
import { PersonAvatar } from "./person-identity";
|
|
3
|
+
import { Tooltip } from "./tooltip";
|
|
3
4
|
|
|
4
5
|
export type MemberAvatarProfile = {
|
|
5
6
|
id: string;
|
|
6
7
|
name: string | null;
|
|
7
8
|
imageUrl: string | null;
|
|
9
|
+
/** Stands in for a missing name, in the avatar initials and the tooltip. */
|
|
10
|
+
email?: string | null;
|
|
8
11
|
};
|
|
9
12
|
|
|
13
|
+
type NamedMember = Pick<MemberAvatarProfile, "name" | "email">;
|
|
14
|
+
|
|
15
|
+
const SHOWN_AVATARS = 3;
|
|
16
|
+
// Past this many the tooltip gets too tall to read; the rest collapse into "+N more".
|
|
17
|
+
const MAX_NAMES = 10;
|
|
18
|
+
|
|
19
|
+
const displayName = ({ name, email }: NamedMember) => name ?? email ?? null;
|
|
20
|
+
|
|
21
|
+
/** Everyone's name, one per line: the stack's "+N" hides people, the tooltip says who they are. */
|
|
22
|
+
export function memberNames(members: NamedMember[]): string {
|
|
23
|
+
const names = members
|
|
24
|
+
.map(displayName)
|
|
25
|
+
.filter((name) => name !== null)
|
|
26
|
+
.slice(0, MAX_NAMES);
|
|
27
|
+
if (names.length === 0) return "";
|
|
28
|
+
|
|
29
|
+
const hiddenCount = members.length - names.length;
|
|
30
|
+
return [...names, ...(hiddenCount > 0 ? [`+${hiddenCount} more`] : [])].join("\n");
|
|
31
|
+
}
|
|
32
|
+
|
|
10
33
|
export function MemberAvatarStack({ members }: { members?: MemberAvatarProfile[] | null }) {
|
|
11
34
|
const visibleMembers = members ?? [];
|
|
12
35
|
|
|
@@ -19,16 +42,17 @@ export function MemberAvatarStack({ members }: { members?: MemberAvatarProfile[]
|
|
|
19
42
|
</div>
|
|
20
43
|
);
|
|
21
44
|
|
|
22
|
-
const shown = visibleMembers.slice(0,
|
|
45
|
+
const shown = visibleMembers.slice(0, SHOWN_AVATARS);
|
|
23
46
|
const extra = visibleMembers.length - shown.length;
|
|
47
|
+
const names = memberNames(visibleMembers);
|
|
24
48
|
|
|
25
|
-
|
|
49
|
+
const stack = (
|
|
26
50
|
<AvatarGroup className="shrink-0">
|
|
27
51
|
{shown.map((m) => (
|
|
28
52
|
<PersonAvatar
|
|
29
53
|
key={m.id}
|
|
30
54
|
imageUrl={m.imageUrl}
|
|
31
|
-
name={m
|
|
55
|
+
name={displayName(m) ?? ""}
|
|
32
56
|
fallbackClassName="text-[8px]"
|
|
33
57
|
/>
|
|
34
58
|
))}
|
|
@@ -37,4 +61,14 @@ export function MemberAvatarStack({ members }: { members?: MemberAvatarProfile[]
|
|
|
37
61
|
) : null}
|
|
38
62
|
</AvatarGroup>
|
|
39
63
|
);
|
|
64
|
+
|
|
65
|
+
return names ? (
|
|
66
|
+
<Tooltip content={<p className="whitespace-pre-line">{names}</p>}>
|
|
67
|
+
{/* Block-level, not inline: an inline wrapper sits on the text baseline and floats above
|
|
68
|
+
the middle of the row. */}
|
|
69
|
+
<span className="flex w-fit">{stack}</span>
|
|
70
|
+
</Tooltip>
|
|
71
|
+
) : (
|
|
72
|
+
stack
|
|
73
|
+
);
|
|
40
74
|
}
|
|
@@ -32,7 +32,7 @@ export interface PersonNameProps {
|
|
|
32
32
|
|
|
33
33
|
export function PersonName({ name, className }: PersonNameProps) {
|
|
34
34
|
return (
|
|
35
|
-
<p className={cn("w-full whitespace-nowrap text-
|
|
35
|
+
<p className={cn("w-full whitespace-nowrap text-sm text-muted-foreground", className)}>
|
|
36
36
|
{name}
|
|
37
37
|
</p>
|
|
38
38
|
);
|
package/src/components/table.tsx
CHANGED
|
@@ -13,7 +13,7 @@ function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
|
13
13
|
<table
|
|
14
14
|
data-slot="table"
|
|
15
15
|
className={cn(
|
|
16
|
-
"w-full border-separate border-spacing-x-0 border-spacing-y-1.5 text-
|
|
16
|
+
"w-full border-separate border-spacing-x-0 border-spacing-y-1.5 text-[13.5px]",
|
|
17
17
|
"[&_tbody_tr>td:first-child]:rounded-l-lg [&_tbody_tr>td:last-child]:rounded-r-lg",
|
|
18
18
|
"[&_tbody_tr:hover>td]:bg-muted/50 [&_tbody_tr:focus-within>td]:bg-muted/50",
|
|
19
19
|
"[&_tbody_tr[data-state=selected]>td]:bg-muted",
|
|
@@ -68,7 +68,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
68
68
|
<th
|
|
69
69
|
data-slot="table-head"
|
|
70
70
|
className={cn(
|
|
71
|
-
"px-2 pb-2 text-left align-middle text-
|
|
71
|
+
"px-2 pb-2 text-left align-middle text-[13px] font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
72
72
|
className,
|
|
73
73
|
)}
|
|
74
74
|
{...props}
|