@opencode/ui 0.0.0-dev-1112 → 0.0.0-dev-1113

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.
@@ -44,5 +44,7 @@ export interface ProjectAvatarProps extends ComponentProps<"div"> {
44
44
  unread?: boolean;
45
45
  /** Seeds the generated default avatar shown when there is no image; see getProjectAvatarGenerated. */
46
46
  generated?: string;
47
+ /** Text stacked over the avatar, hidden until the caller's CSS reveals `[data-slot="project-avatar-label"]`. */
48
+ label?: string;
47
49
  }
48
50
  export declare function ProjectAvatar(props: ProjectAvatarProps): import("solid-js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/ui",
3
- "version": "0.0.0-dev-1112",
3
+ "version": "0.0.0-dev-1113",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -305,7 +305,7 @@
305
305
  "dependencies": {
306
306
  "@kitlangton/solid-motion": "0.2.2",
307
307
  "@kobalte/core": "0.13.13",
308
- "@opencode/util": "0.0.0-dev-1112",
308
+ "@opencode/util": "0.0.0-dev-1113",
309
309
  "@pierre/diffs": "1.6.1",
310
310
  "@pierre/highlights": "0.2.0",
311
311
  "@solid-primitives/event-listener": "2.4.6",
@@ -88,6 +88,19 @@
88
88
  text-shadow: none;
89
89
  }
90
90
 
91
+ [data-slot="project-avatar-surface"] [data-slot="project-avatar-label"] {
92
+ position: absolute;
93
+ inset: 0;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ visibility: hidden;
98
+ }
99
+
100
+ [data-slot="project-avatar-surface"]:is([data-has-image], [data-generated]) [data-slot="project-avatar-label"] {
101
+ background: var(--project-avatar-bg);
102
+ }
103
+
91
104
  [data-slot="project-avatar-surface"][data-generated] {
92
105
  background: none;
93
106
  box-shadow: none;
@@ -147,6 +147,8 @@ export interface ProjectAvatarProps extends ComponentProps<"div"> {
147
147
  unread?: boolean
148
148
  /** Seeds the generated default avatar shown when there is no image; see getProjectAvatarGenerated. */
149
149
  generated?: string
150
+ /** Text stacked over the avatar, hidden until the caller's CSS reveals `[data-slot="project-avatar-label"]`. */
151
+ label?: string
150
152
  }
151
153
 
152
154
  export function ProjectAvatar(props: ProjectAvatarProps) {
@@ -156,6 +158,7 @@ export function ProjectAvatar(props: ProjectAvatarProps) {
156
158
  "variant",
157
159
  "unread",
158
160
  "generated",
161
+ "label",
159
162
  "class",
160
163
  "classList",
161
164
  "style",
@@ -184,13 +187,23 @@ export function ProjectAvatar(props: ProjectAvatarProps) {
184
187
  <Show
185
188
  when={split.src}
186
189
  fallback={
187
- <Show when={generated()} fallback={first(split.fallback)}>
190
+ <Show
191
+ when={generated()}
192
+ fallback={<span data-slot="project-avatar-initial">{first(split.fallback)}</span>}
193
+ >
188
194
  {(key) => <GeneratedAvatar seed={key()} />}
189
195
  </Show>
190
196
  }
191
197
  >
192
198
  {(value) => <img src={value()} draggable={false} data-slot="project-avatar-image" />}
193
199
  </Show>
200
+ <Show when={split.label}>
201
+ {(label) => (
202
+ <span data-slot="project-avatar-label" aria-hidden="true">
203
+ {label()}
204
+ </span>
205
+ )}
206
+ </Show>
194
207
  </div>
195
208
  <Show when={split.unread}>
196
209
  <span data-slot="project-avatar-unread-dot" aria-hidden="true" />