@inbeat/ui 0.12.2 → 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,25 @@
|
|
|
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
|
+
|
|
11
|
+
## [0.13.0](https://github.com/Genoux/ib-toolkit/compare/ui-v0.12.2...ui-v0.13.0) (2026-11-12)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **ui:** add opt-in fieldtrip brand layer ([#68](https://github.com/Genoux/ib-toolkit/issues/68)) ([1e8f629](https://github.com/Genoux/ib-toolkit/commit/1e8f6296336e8e76c69787f374ba6b782c690abe))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **standards:** keep markdown out of biome in new apps ([1e8f629](https://github.com/Genoux/ib-toolkit/commit/1e8f6296336e8e76c69787f374ba6b782c690abe))
|
|
22
|
+
|
|
3
23
|
## [0.12.2](https://github.com/Genoux/ib-toolkit/compare/ui-v0.12.1...ui-v0.12.2) (2026-10-19)
|
|
4
24
|
|
|
5
25
|
|
package/fieldtrip.css
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Opt-in Fieldtrip brand layer. Import after theme.css in the app's globals.css:
|
|
3
|
+
* @import "@inbeat/ui/theme.css";
|
|
4
|
+
* @import "@inbeat/ui/fieldtrip.css";
|
|
5
|
+
* The licensed font files stay in the app (this package is public): load SwissNow and Diplomat
|
|
6
|
+
* with next/font/local and put the --font-swiss-now and --font-diplomat variables on <html>.
|
|
7
|
+
*/
|
|
8
|
+
@theme inline {
|
|
9
|
+
--font-sans: var(--font-swiss-now);
|
|
10
|
+
--font-serif: var(--font-diplomat);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* static: apps read these through var(--color-fieldtrip-<name>), which Tailwind cannot see, so unused ones would be dropped. */
|
|
14
|
+
/* Base/light pairs from the "Fieldtrip - Brand" Figma palette; ink has no light pair there, so it takes grey-3. */
|
|
15
|
+
@theme static {
|
|
16
|
+
--color-fieldtrip-ink: #191910;
|
|
17
|
+
--color-fieldtrip-ink-light: #e4e4df;
|
|
18
|
+
--color-fieldtrip-olive: #8e8003;
|
|
19
|
+
--color-fieldtrip-olive-light: #d2cc9a;
|
|
20
|
+
--color-fieldtrip-orange: #ea4112;
|
|
21
|
+
--color-fieldtrip-orange-light: #f6b3a0;
|
|
22
|
+
--color-fieldtrip-mauve: #b398ad;
|
|
23
|
+
--color-fieldtrip-mauve-light: #e1d6de;
|
|
24
|
+
--color-fieldtrip-brown: #ad7b53;
|
|
25
|
+
--color-fieldtrip-brown-light: #decaba;
|
|
26
|
+
--color-fieldtrip-green: #157428;
|
|
27
|
+
--color-fieldtrip-green-light: #a1c8a9;
|
|
28
|
+
--color-fieldtrip-spring: #46b832;
|
|
29
|
+
--color-fieldtrip-spring-light: #b5e3ad;
|
|
30
|
+
--color-fieldtrip-yellow: #f9d317;
|
|
31
|
+
--color-fieldtrip-yellow-light: #fdeda2;
|
|
32
|
+
--color-fieldtrip-sky: #46bdf0;
|
|
33
|
+
--color-fieldtrip-sky-light: #b5e5f9;
|
|
34
|
+
--color-fieldtrip-pink: #ff97ab;
|
|
35
|
+
--color-fieldtrip-pink-light: #ffd5dd;
|
|
36
|
+
--color-fieldtrip-powder: #bccfef;
|
|
37
|
+
--color-fieldtrip-powder-light: #e4ecf9;
|
|
38
|
+
}
|
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": [
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
],
|
|
9
9
|
"files": [
|
|
10
10
|
"CHANGELOG.md",
|
|
11
|
+
"fieldtrip.css",
|
|
11
12
|
"src",
|
|
12
13
|
"theme.css"
|
|
13
14
|
],
|
|
14
15
|
"exports": {
|
|
15
16
|
"./theme.css": "./theme.css",
|
|
17
|
+
"./fieldtrip.css": "./fieldtrip.css",
|
|
16
18
|
"./components/*": "./src/components/*.tsx",
|
|
17
19
|
"./hooks/*": "./src/hooks/*.ts",
|
|
18
20
|
"./lib/*": "./src/lib/*.ts"
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"@base-ui/react": "^1.2.0",
|
|
65
67
|
"@fontsource-variable/geist": "^5.3.0",
|
|
66
68
|
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
67
|
-
"@inbeat/config": "^0.
|
|
69
|
+
"@inbeat/config": "^0.14.0",
|
|
68
70
|
"@storybook/addon-a11y": "^10.6.0",
|
|
69
71
|
"@storybook/addon-docs": "^10.6.0",
|
|
70
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}
|