raft-ui 0.0.1

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.
Files changed (134) hide show
  1. package/README.md +24 -0
  2. package/dist/cn.d.mts +2 -0
  3. package/dist/cn.mjs +2 -0
  4. package/dist/index.d.mts +2710 -0
  5. package/dist/index.mjs +4821 -0
  6. package/dist/label-DWq4ia5I.mjs +115 -0
  7. package/dist/styled-props-B3SNekJg.d.mts +16 -0
  8. package/dist/wip.d.mts +1238 -0
  9. package/dist/wip.mjs +1416 -0
  10. package/package.json +70 -0
  11. package/src/components/avatar/avatar.tsx +375 -0
  12. package/src/components/avatar/index.ts +17 -0
  13. package/src/components/badge/badge.tsx +393 -0
  14. package/src/components/badge/index.ts +2 -0
  15. package/src/components/banner/banner.tsx +269 -0
  16. package/src/components/banner/index.ts +8 -0
  17. package/src/components/bottom-sheet/bottom-sheet.tsx +152 -0
  18. package/src/components/bottom-sheet/index.ts +22 -0
  19. package/src/components/button/button.tsx +497 -0
  20. package/src/components/button/index.ts +2 -0
  21. package/src/components/checkbox/checkbox-indicator.tsx +128 -0
  22. package/src/components/checkbox/checkbox.tsx +350 -0
  23. package/src/components/checkbox/index.ts +2 -0
  24. package/src/components/combobox/combobox.tsx +603 -0
  25. package/src/components/combobox/index.ts +52 -0
  26. package/src/components/context-menu/context-menu.tsx +380 -0
  27. package/src/components/context-menu/index.ts +34 -0
  28. package/src/components/conversation-preview-card/conversation-preview-card.tsx +336 -0
  29. package/src/components/conversation-preview-card/index.ts +32 -0
  30. package/src/components/description-list/description-list.tsx +116 -0
  31. package/src/components/description-list/index.ts +14 -0
  32. package/src/components/dropdown-menu/dropdown-menu.tsx +405 -0
  33. package/src/components/dropdown-menu/index.ts +38 -0
  34. package/src/components/empty-state/empty-state.tsx +177 -0
  35. package/src/components/empty-state/index.ts +16 -0
  36. package/src/components/field/field.tsx +125 -0
  37. package/src/components/field/index.ts +18 -0
  38. package/src/components/inline-code/index.ts +2 -0
  39. package/src/components/inline-code/inline-code.tsx +33 -0
  40. package/src/components/input/index.ts +2 -0
  41. package/src/components/input/input.tsx +76 -0
  42. package/src/components/input-group/index.ts +7 -0
  43. package/src/components/input-group/input-group.tsx +215 -0
  44. package/src/components/kbd/index.ts +2 -0
  45. package/src/components/kbd/kbd.tsx +43 -0
  46. package/src/components/label/index.ts +7 -0
  47. package/src/components/label/label.tsx +99 -0
  48. package/src/components/lightbox/index.ts +24 -0
  49. package/src/components/lightbox/lightbox.tsx +245 -0
  50. package/src/components/list-item/index.ts +20 -0
  51. package/src/components/list-item/list-item.tsx +263 -0
  52. package/src/components/media-list-item/index.ts +20 -0
  53. package/src/components/media-list-item/media-list-item.tsx +169 -0
  54. package/src/components/notification-center/index.ts +39 -0
  55. package/src/components/notification-center/notification-center.tsx +558 -0
  56. package/src/components/panel-header/index.ts +22 -0
  57. package/src/components/panel-header/panel-header.tsx +199 -0
  58. package/src/components/popover/index.ts +30 -0
  59. package/src/components/popover/popover.tsx +248 -0
  60. package/src/components/preview-shell/index.ts +2 -0
  61. package/src/components/preview-shell/preview-shell.tsx +51 -0
  62. package/src/components/quoted-message-card/index.ts +36 -0
  63. package/src/components/quoted-message-card/quoted-message-card.tsx +391 -0
  64. package/src/components/radio-group/index.ts +6 -0
  65. package/src/components/radio-group/radio-group.tsx +119 -0
  66. package/src/components/section-header/index.ts +16 -0
  67. package/src/components/section-header/section-header.tsx +117 -0
  68. package/src/components/section-label/index.ts +2 -0
  69. package/src/components/section-label/section-label.tsx +38 -0
  70. package/src/components/segmented-control/index.ts +12 -0
  71. package/src/components/segmented-control/segmented-control.tsx +129 -0
  72. package/src/components/select/index.ts +40 -0
  73. package/src/components/select/select.tsx +382 -0
  74. package/src/components/spinner/index.ts +2 -0
  75. package/src/components/spinner/spinner.tsx +228 -0
  76. package/src/components/status/index.ts +2 -0
  77. package/src/components/status/status.tsx +152 -0
  78. package/src/components/tabs/index.ts +24 -0
  79. package/src/components/tabs/tabs.tsx +417 -0
  80. package/src/components/text/index.ts +2 -0
  81. package/src/components/text/text.tsx +130 -0
  82. package/src/components/textarea/index.ts +2 -0
  83. package/src/components/textarea/textarea.tsx +136 -0
  84. package/src/components/toggle-group/index.ts +12 -0
  85. package/src/components/toggle-group/toggle-group.tsx +111 -0
  86. package/src/components/tooltip/index.ts +14 -0
  87. package/src/components/tooltip/tooltip.tsx +186 -0
  88. package/src/fonts/brutal.css +2 -0
  89. package/src/index.ts +404 -0
  90. package/src/legacy/AttentionDot.tsx +28 -0
  91. package/src/legacy/AvatarListRow.tsx +87 -0
  92. package/src/legacy/AvatarSlot.tsx +157 -0
  93. package/src/legacy/Badge.tsx +95 -0
  94. package/src/legacy/Banner.tsx +74 -0
  95. package/src/legacy/BottomSheet.tsx +76 -0
  96. package/src/legacy/CheckMarker.tsx +72 -0
  97. package/src/legacy/Checkbox.tsx +81 -0
  98. package/src/legacy/ConversationPreviewCard.tsx +169 -0
  99. package/src/legacy/DismissBackdrop.tsx +68 -0
  100. package/src/legacy/EmptyState.tsx +63 -0
  101. package/src/legacy/ExperimentalBadge.tsx +19 -0
  102. package/src/legacy/FormField.tsx +106 -0
  103. package/src/legacy/KeyValueRow.tsx +67 -0
  104. package/src/legacy/Lightbox.tsx +119 -0
  105. package/src/legacy/NotificationCenter.tsx +217 -0
  106. package/src/legacy/PanelHeader.tsx +94 -0
  107. package/src/legacy/PreviewShell.tsx +40 -0
  108. package/src/legacy/QuotedMessageCard.tsx +181 -0
  109. package/src/legacy/ReorderablePanelTabs.tsx +151 -0
  110. package/src/legacy/SandboxedPreviewFrame.tsx +59 -0
  111. package/src/legacy/SearchInput.tsx +23 -0
  112. package/src/legacy/SectionEyebrow.tsx +60 -0
  113. package/src/legacy/SectionHeader.tsx +68 -0
  114. package/src/legacy/SegmentedControl.tsx +74 -0
  115. package/src/legacy/SlugInput.tsx +29 -0
  116. package/src/legacy/Spinner.tsx +89 -0
  117. package/src/legacy/StatusDot.tsx +51 -0
  118. package/src/legacy/SurfaceListItem.tsx +32 -0
  119. package/src/legacy/Textarea.tsx +137 -0
  120. package/src/legacy/button.tsx +100 -0
  121. package/src/legacy/context-menu-divider.tsx +12 -0
  122. package/src/legacy/menu-item.tsx +66 -0
  123. package/src/legacy/selection-popover.tsx +212 -0
  124. package/src/legacy/server-switcher-menu.tsx +203 -0
  125. package/src/legacy/source.css +240 -0
  126. package/src/lib/cn.ts +1 -0
  127. package/src/lib/styled-props.ts +11 -0
  128. package/src/lib/theme/theme-context.ts +28 -0
  129. package/src/lib/theme/theme-provider.tsx +181 -0
  130. package/src/lib/theme/use-theme.ts +12 -0
  131. package/src/lib/tv.ts +29 -0
  132. package/src/lib/without-children.ts +6 -0
  133. package/src/styles.css +467 -0
  134. package/src/wip.ts +255 -0
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "raft-ui",
3
+ "version": "0.0.1",
4
+ "description": "React UI components for Raft.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/botiverse/rui.git",
9
+ "directory": "packages/ui"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "src"
14
+ ],
15
+ "type": "module",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./src/index.ts",
19
+ "development": "./src/index.ts",
20
+ "default": "./dist/index.mjs"
21
+ },
22
+ "./cn": {
23
+ "types": "./src/lib/cn.ts",
24
+ "development": "./src/lib/cn.ts",
25
+ "default": "./dist/cn.mjs"
26
+ },
27
+ "./wip": {
28
+ "types": "./src/wip.ts",
29
+ "development": "./src/wip.ts",
30
+ "default": "./dist/wip.mjs"
31
+ },
32
+ "./styles.css": "./src/styles.css",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "@base-ui/react": "^1.6.0",
40
+ "@dnd-kit/core": "^6.3.1",
41
+ "@dnd-kit/sortable": "^10.0.0",
42
+ "@dnd-kit/utilities": "^3.2.2",
43
+ "@fontsource-variable/geist-mono": "^5.2.8",
44
+ "@fontsource-variable/space-grotesk": "^5.2.10",
45
+ "@tanstack/react-hotkeys": "^0.10.0",
46
+ "cnfast": "^0.0.7",
47
+ "lucide-react": "^1.21.0",
48
+ "tailwind-variants": "^3.2.2"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^26.0.0",
52
+ "@types/react": "^19.2.17",
53
+ "@types/react-dom": "^19.2.3",
54
+ "@typescript/native-preview": "7.0.0-dev.20260620.1",
55
+ "react": "^19.2.7",
56
+ "react-dom": "^19.2.7",
57
+ "tailwindcss": "^4.3.1",
58
+ "typescript": "^6.0.3",
59
+ "vite-plus": "^0.2.1"
60
+ },
61
+ "peerDependencies": {
62
+ "react": "^19",
63
+ "react-dom": "^19"
64
+ },
65
+ "scripts": {
66
+ "build": "vp pack",
67
+ "dev": "vp pack --watch",
68
+ "check": "vp check"
69
+ }
70
+ }
@@ -0,0 +1,375 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import { Avatar as AvatarPrimitive } from "@base-ui/react";
3
+ import { tv, type VariantProps } from "../../lib/tv.ts";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme.ts";
5
+ import type { StyledProps } from "../../lib/styled-props.ts";
6
+
7
+ // Avatar family built on Base UI's Avatar primitive. Compose `<AvatarImage>`,
8
+ // `<AvatarFallback>`, and `<AvatarBadge>` as children; with no children a
9
+ // default `<AvatarFallback>` renders the placeholder. All parts share one
10
+ // `tv()` slots config so theme / type / size styling lives in a single place.
11
+ //
12
+ // The original's avatar fetching (`AgentAvatar` / `GravatarAvatar`, app domain)
13
+ // is dropped: pass a URL via `<AvatarImage src>` and a custom fallback node via
14
+ // `<AvatarFallback>`.
15
+ //
16
+ // `size` is a compact t-shirt scale distilled from the original call-site
17
+ // contexts: xl profile/detail (64), lg mention/large identity (48), md panel
18
+ // header (36), sm list rows (32), xs compact/sidebar rows (20), and 2xs inline
19
+ // preview chips (14). One-off source contexts such as account-tile, members-row,
20
+ // and creator-link no longer get public size names.
21
+ // Brutal border weight follows size: >=32px frames use `border-2`, smaller ones
22
+ // `border`; elegant uses a pseudo-element hairline. `AvatarFallback` /
23
+ // `AvatarBadge` auto-scale to the parent via its `data-size` + `group/avatar`
24
+ // hook; keep their per-step selectors in sync with the `size` scale.
25
+ const avatar = tv({
26
+ slots: {
27
+ root: ["group/avatar relative flex shrink-0 items-center justify-center select-none"],
28
+ image: ["size-full object-cover"],
29
+ fallback: [
30
+ "flex size-full items-center justify-center",
31
+ "[&>svg]:size-4",
32
+ "group-data-[size=xl]/avatar:[&>svg]:size-6",
33
+ "group-data-[size=lg]/avatar:[&>svg]:size-6",
34
+ "group-data-[size=md]/avatar:[&>svg]:size-[18px]",
35
+ "group-data-[size=sm]/avatar:[&>svg]:size-4",
36
+ "group-data-[size=xs]/avatar:[&>svg]:size-3",
37
+ "group-data-[size=2xs]/avatar:[&>svg]:size-2.5",
38
+ ],
39
+ badge: [
40
+ "absolute right-0 bottom-0 z-10 translate-x-1/4 translate-y-1/4 select-none",
41
+ "inline-flex items-center justify-center rounded-full outline-2 outline-white",
42
+ "size-2 [&>svg]:hidden",
43
+ "group-data-[size=xl]/avatar:size-3.5 group-data-[size=xl]/avatar:[&>svg]:size-2 group-data-[size=xl]/avatar:[&>svg]:block",
44
+ "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2 group-data-[size=lg]/avatar:[&>svg]:block",
45
+ "group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-1.5 group-data-[size=md]/avatar:[&>svg]:block",
46
+ "group-data-[size=sm]/avatar:size-2",
47
+ "group-data-[size=xs]/avatar:size-1.5 group-data-[size=xs]/avatar:outline",
48
+ "group-data-[size=2xs]/avatar:size-1.5 group-data-[size=2xs]/avatar:outline",
49
+ ],
50
+ group: ["group/avatar-group flex items-center"],
51
+ },
52
+ variants: {
53
+ theme: {
54
+ brutal: {
55
+ root: "border-line-strong",
56
+ fallback: "text-black",
57
+ badge: ["bg-success-base text-foreground-strong"],
58
+ group: [
59
+ "-space-x-1.5",
60
+ "*:data-[slot=avatar]:outline *:data-[slot=avatar]:outline-2 *:data-[slot=avatar]:outline-primary-50",
61
+ "*:data-[slot=avatar-group-count]:outline *:data-[slot=avatar-group-count]:outline-2 *:data-[slot=avatar-group-count]:outline-primary-50",
62
+ ],
63
+ },
64
+ elegant: {
65
+ root: ["bg-layer-muted"],
66
+ image: ["rounded-full"],
67
+ fallback: [
68
+ "overflow-hidden bg-layer-muted text-foreground-placeholder/70 text-sm",
69
+ "rounded-full",
70
+ "group-data-[size=xs]/avatar:text-xs",
71
+ "group-data-[size=2xs]/avatar:text-[10px]",
72
+ ],
73
+ badge: [
74
+ "translate-x-0 translate-y-0 bg-success-base text-foreground-inverse",
75
+ "right-0.5 bottom-0.5",
76
+ "group-data-[size=xl]/avatar:right-1 group-data-[size=xl]/avatar:bottom-1",
77
+ "group-data-[size=lg]/avatar:right-0.75 group-data-[size=lg]/avatar:bottom-0.75",
78
+ ],
79
+ group: [
80
+ "-space-x-2",
81
+ "*:data-[slot=avatar]:outline *:data-[slot=avatar]:outline-2 *:data-[slot=avatar]:outline-background",
82
+ "*:data-[slot=avatar-group-count]:outline *:data-[slot=avatar-group-count]:outline-2 *:data-[slot=avatar-group-count]:outline-background",
83
+ ],
84
+ },
85
+ },
86
+ type: {
87
+ agent: {},
88
+ human: {},
89
+ },
90
+ size: {
91
+ xl: { root: "size-16" },
92
+ lg: { root: "size-12" },
93
+ md: { root: "size-9" },
94
+ sm: { root: "size-8" },
95
+ xs: { root: "size-5" },
96
+ "2xs": { root: "size-[14px]" },
97
+ },
98
+ },
99
+ compoundVariants: [
100
+ {
101
+ theme: "brutal",
102
+ size: ["xl", "lg", "md", "sm"],
103
+ class: { root: "border-2" },
104
+ },
105
+ {
106
+ theme: "brutal",
107
+ size: ["xs", "2xs"],
108
+ class: { root: "border" },
109
+ },
110
+ {
111
+ theme: "brutal",
112
+ type: "agent",
113
+ class: { root: "bg-info-base" },
114
+ },
115
+ {
116
+ theme: "brutal",
117
+ type: "human",
118
+ class: { root: "bg-brutal-purple text-foreground-strong" },
119
+ },
120
+ {
121
+ theme: "elegant",
122
+ size: "xl",
123
+ class: {
124
+ root: "rounded-full",
125
+ },
126
+ },
127
+ {
128
+ theme: "elegant",
129
+ size: "lg",
130
+ class: {
131
+ root: "rounded-full",
132
+ },
133
+ },
134
+ {
135
+ theme: "elegant",
136
+ size: ["md", "sm"],
137
+ class: {
138
+ root: "rounded-full",
139
+ },
140
+ },
141
+ {
142
+ theme: "elegant",
143
+ size: "xs",
144
+ class: {
145
+ root: "rounded-full",
146
+ },
147
+ },
148
+ {
149
+ theme: "elegant",
150
+ size: "2xs",
151
+ class: {
152
+ root: "rounded-full",
153
+ },
154
+ },
155
+ {
156
+ theme: "elegant",
157
+ type: "agent",
158
+ class: { root: "text-foreground-muted" },
159
+ },
160
+ {
161
+ theme: "elegant",
162
+ type: "human",
163
+ class: { root: "text-foreground-muted" },
164
+ },
165
+ ],
166
+ });
167
+
168
+ export type AvatarSize = NonNullable<VariantProps<typeof avatar>["size"]>;
169
+
170
+ export type AvatarProps = StyledProps<AvatarPrimitive.Root.Props> &
171
+ Required<Pick<VariantProps<typeof avatar>, "size" | "type">>;
172
+
173
+ export function Avatar({ size, type, className, children, ...props }: AvatarProps) {
174
+ const theme = useThemeFamily();
175
+ const { root } = avatar({ theme, type, size });
176
+ return (
177
+ <AvatarPrimitive.Root
178
+ data-slot="avatar"
179
+ data-size={size}
180
+ className={root({ className })}
181
+ {...props}
182
+ >
183
+ {children ?? <AvatarFallback />}
184
+ </AvatarPrimitive.Root>
185
+ );
186
+ }
187
+
188
+ export type AvatarImageProps = StyledProps<AvatarPrimitive.Image.Props>;
189
+
190
+ // Managed avatar image. Base UI tracks its load state and hides it (revealing the
191
+ // fallback) while loading or on error. Fills the frame edge-to-edge.
192
+ export function AvatarImage({ className, ...props }: AvatarImageProps) {
193
+ const theme = useThemeFamily();
194
+ const { image } = avatar({ theme });
195
+ return (
196
+ <AvatarPrimitive.Image data-slot="avatar-image" className={image({ className })} {...props} />
197
+ );
198
+ }
199
+
200
+ export type AvatarFallbackProps = StyledProps<AvatarPrimitive.Fallback.Props>;
201
+
202
+ function AvatarFallbackIcon() {
203
+ return (
204
+ <svg
205
+ xmlns="http://www.w3.org/2000/svg"
206
+ width="18"
207
+ height="18"
208
+ viewBox="0 0 18 18"
209
+ aria-hidden="true"
210
+ focusable="false"
211
+ >
212
+ <g
213
+ fill="none"
214
+ strokeLinecap="round"
215
+ strokeLinejoin="round"
216
+ strokeWidth="1"
217
+ stroke="currentColor"
218
+ >
219
+ <circle cx="9" cy="7.75" r="2" />
220
+ <path d="M9,16.25c1.407,0,2.716-.407,3.827-1.101-.481-1.67-2.003-2.899-3.827-2.899s-3.347,1.229-3.827,2.899c1.112,.694,2.42,1.101,3.827,1.101Z" />
221
+ <circle
222
+ cx="1.889"
223
+ cy="10.414"
224
+ r=".75"
225
+ fill="currentColor"
226
+ data-stroke="none"
227
+ stroke="none"
228
+ />
229
+ <circle
230
+ cx="2.971"
231
+ cy="4.972"
232
+ r=".75"
233
+ fill="currentColor"
234
+ data-stroke="none"
235
+ stroke="none"
236
+ />
237
+ <circle
238
+ cx="2.972"
239
+ cy="13.027"
240
+ r=".75"
241
+ fill="currentColor"
242
+ data-stroke="none"
243
+ stroke="none"
244
+ />
245
+ <circle cx="1.89" cy="7.586" r=".75" fill="currentColor" data-stroke="none" stroke="none" />
246
+ <circle
247
+ cx="4.973"
248
+ cy="2.972"
249
+ r=".75"
250
+ fill="currentColor"
251
+ data-stroke="none"
252
+ stroke="none"
253
+ />
254
+ <circle
255
+ cx="7.586"
256
+ cy="1.889"
257
+ r=".75"
258
+ fill="currentColor"
259
+ data-stroke="none"
260
+ stroke="none"
261
+ />
262
+ <circle
263
+ cx="15.029"
264
+ cy="13.028"
265
+ r=".75"
266
+ fill="currentColor"
267
+ data-stroke="none"
268
+ stroke="none"
269
+ />
270
+ <circle
271
+ cx="16.111"
272
+ cy="7.586"
273
+ r=".75"
274
+ fill="currentColor"
275
+ data-stroke="none"
276
+ stroke="none"
277
+ />
278
+ <circle
279
+ cx="13.028"
280
+ cy="2.971"
281
+ r=".75"
282
+ fill="currentColor"
283
+ data-stroke="none"
284
+ stroke="none"
285
+ />
286
+ <circle
287
+ cx="16.11"
288
+ cy="10.414"
289
+ r=".75"
290
+ fill="currentColor"
291
+ data-stroke="none"
292
+ stroke="none"
293
+ />
294
+ <circle
295
+ cx="15.028"
296
+ cy="4.973"
297
+ r=".75"
298
+ fill="currentColor"
299
+ data-stroke="none"
300
+ stroke="none"
301
+ />
302
+ <circle
303
+ cx="10.414"
304
+ cy="1.89"
305
+ r=".75"
306
+ fill="currentColor"
307
+ data-stroke="none"
308
+ stroke="none"
309
+ />
310
+ </g>
311
+ </svg>
312
+ );
313
+ }
314
+
315
+ // Shown when no AvatarImage has loaded. With no children it renders the
316
+ // placeholder user icon, auto-scaled via the parent's `data-size` hook.
317
+ export function AvatarFallback({ className, children, ...props }: AvatarFallbackProps) {
318
+ const theme = useThemeFamily();
319
+ const { fallback } = avatar({ theme });
320
+ return (
321
+ <AvatarPrimitive.Fallback
322
+ data-slot="avatar-fallback"
323
+ className={fallback({ className })}
324
+ {...props}
325
+ >
326
+ {children ?? <AvatarFallbackIcon />}
327
+ </AvatarPrimitive.Fallback>
328
+ );
329
+ }
330
+
331
+ export type AvatarBadgeProps = ComponentPropsWithRef<"span">;
332
+
333
+ // Presence/status badge overlaid in the avatar's bottom-right corner. The root
334
+ // stays overflow-visible so the badge can sit on the frame edge. Default fill is
335
+ // lime; override with a `bg-*` class via className. Optionally wraps a small icon.
336
+ export function AvatarBadge({ className, ...props }: AvatarBadgeProps) {
337
+ const theme = useThemeFamily();
338
+ const { badge } = avatar({ theme });
339
+ return <span data-slot="avatar-badge" className={badge({ className })} {...props} />;
340
+ }
341
+
342
+ export type AvatarGroupProps = ComponentPropsWithRef<"div">;
343
+
344
+ // Overlapping stack of avatars (and an optional trailing AvatarGroupCount). The
345
+ // ring color follows the active theme's surface assumptions.
346
+ export function AvatarGroup({ className, ...props }: AvatarGroupProps) {
347
+ const theme = useThemeFamily();
348
+ const { group } = avatar({ theme });
349
+ return <div data-slot="avatar-group" className={group({ className })} {...props} />;
350
+ }
351
+
352
+ export type AvatarGroupCountProps = ComponentPropsWithRef<"span"> & {
353
+ /** Matches the frame scale of the sibling avatars. */
354
+ size: AvatarSize;
355
+ };
356
+
357
+ // Trailing "+N" overflow chip for an AvatarGroup. Reuses the Avatar frame but
358
+ // omits `type`, swapping the role fill for a neutral count chip.
359
+ export function AvatarGroupCount({ size, className, ...props }: AvatarGroupCountProps) {
360
+ const theme = useThemeFamily();
361
+ const { root } = avatar({ theme, size });
362
+ const countClassName =
363
+ theme === "elegant"
364
+ ? "bg-layer-muted font-medium text-xs leading-none tabular-nums text-foreground-muted"
365
+ : "bg-secondary-400 font-bold text-xs leading-none tabular-nums text-foreground-strong";
366
+ return (
367
+ <span
368
+ data-slot="avatar-group-count"
369
+ className={root({
370
+ class: [countClassName, className],
371
+ })}
372
+ {...props}
373
+ />
374
+ );
375
+ }
@@ -0,0 +1,17 @@
1
+ export {
2
+ Avatar,
3
+ type AvatarSize,
4
+ AvatarImage,
5
+ AvatarFallback,
6
+ AvatarBadge,
7
+ AvatarGroup,
8
+ AvatarGroupCount,
9
+ } from "./avatar.tsx";
10
+ export type {
11
+ AvatarProps,
12
+ AvatarImageProps,
13
+ AvatarFallbackProps,
14
+ AvatarBadgeProps,
15
+ AvatarGroupProps,
16
+ AvatarGroupCountProps,
17
+ } from "./avatar.tsx";