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

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-1126",
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-1126",
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" />
@@ -106,7 +106,8 @@ export const additionalIcons = {
106
106
  notifications: `<path d="M14.8889 6.77778V9.11112C14.8889 10.093 14.8889 10.8889 14.8889 10.8889H11.3334M5.55558 10.8889H2C2 10.8889 2.00001 10.093 2.00001 9.11112V3.77778C2.00001 2.79594 2.00009 2 2.00009 2H9.44531M5.55558 10.8889V13.1111H8.44447H11.3334V10.8889M5.55558 10.8889H11.3334" stroke="currentColor"/><path d="M13 5C14.1046 5 15 4.10457 15 3C15 1.89543 14.1046 1 13 1C11.8954 1 11 1.89543 11 3C11 4.10457 11.8954 5 13 5Z" stroke="currentColor"/>`,
107
107
  extensions: `<path d="M8 6.75047V9.25047M10.668 6.75047V9.25047M5.33398 6.75047V9.25047M1.33398 2.44531V13.5553H14.6673V2.44531H1.33398Z" stroke="currentColor" stroke-linecap="square"/>`,
108
108
  cube: `<path d="M10 2.5L16.5 6.25V13.75L10 17.5L3.5 13.75V6.25L10 2.5Z" stroke="currentColor"/><path d="M10 10L16.5 6.25M10 10V17.5M10 10L3.5 6.25" stroke="currentColor"/>`,
109
- "post-skill": `<rect x="2.5" y="3.5" width="15" height="13" rx="1.5" stroke="currentColor"/><path d="M5.5 7.5H10.5M5.5 10.5H14.5" stroke="currentColor"/>`,
109
+ // The open book OpenCode Console draws for a skill, so a skill looks the same in both.
110
+ "post-skill": `<path d="M8 4.5c-1.5-1-3.5-1.5-5.5-1.5v9c2 0 4 .5 5.5 1.5 1.5-1 3.5-1.5 5.5-1.5V3c-2 0-4 .5-5.5 1.5zM8 4.5v9" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,
110
111
  "arrow-undo-down": `<path d="M4.08333 11.0859L1.75 8.7526L4.08333 6.41927M2.33333 8.7526L12.5417 8.7526L12.5417 3.21094L7 3.21094" stroke="currentColor" stroke-width="1" stroke-linecap="square"/>`,
111
112
  }
112
113
 
@@ -118,7 +119,8 @@ export function additionalIconViewBox(name: keyof typeof additionalIcons) {
118
119
  name === "extensions" ||
119
120
  name === "sliders" ||
120
121
  name === "providers" ||
121
- name === "models"
122
+ name === "models" ||
123
+ name === "post-skill"
122
124
  ? "0 0 16 16"
123
125
  : "0 0 20 20"
124
126
  }
@@ -89,7 +89,6 @@ const replacements: Partial<Record<IconName, { name: NewIconName; rotate?: numbe
89
89
  "outline-browser-annotate": { name: "annotate" },
90
90
  "select-element": { name: "annotate" },
91
91
  download: { name: "download" },
92
- "post-skill": { name: "skill" },
93
92
  "graduation-cap": { name: "skill" },
94
93
  eye: { name: "eye-open" },
95
94
  "outline-eye": { name: "eye-open" },