@opencode-ai/ui 0.0.0-dev-19004 → 0.0.0-dev-19005
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/dist/actions/button/button.d.ts +1 -1
- package/dist/i18n/en.d.ts +4 -0
- package/dist/icons/icon/icon.d.ts +8 -0
- package/package.json +1 -1
- package/src/actions/button/button.css +29 -0
- package/src/actions/button/button.tsx +10 -1
- package/src/forms/text-input/text-input.css +2 -2
- package/src/i18n/en.ts +4 -0
- package/src/icons/icon/icon.tsx +18 -4
|
@@ -4,7 +4,7 @@ import { type IconProps } from "@opencode-ai/ui/icon";
|
|
|
4
4
|
import "./button.css";
|
|
5
5
|
export interface ButtonProps extends ComponentProps<typeof Root>, Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
6
6
|
size?: "small" | "normal" | "large";
|
|
7
|
-
variant?: "neutral" | "danger" | "warning" | "outline" | "contrast" | "ghost" | "ghost-muted" | "loading";
|
|
7
|
+
variant?: "neutral" | "danger" | "warning" | "outline" | "contrast" | "ghost" | "ghost-muted" | "ghost-faint" | "loading";
|
|
8
8
|
icon?: IconProps["name"];
|
|
9
9
|
}
|
|
10
10
|
export declare function Button(props: ButtonProps): import("solid-js").JSX.Element;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ declare const source: {
|
|
|
64
64
|
"ui.sessionTurn.retry.inSeconds": string;
|
|
65
65
|
"ui.sessionTurn.retry.attempt": string;
|
|
66
66
|
"ui.sessionTurn.retry.attemptLine": string;
|
|
67
|
+
"ui.sessionTurn.retry.attemptLabel": string;
|
|
68
|
+
"ui.sessionTurn.retry.attemptRetrying": string;
|
|
67
69
|
"ui.sessionTurn.retry.geminiHot": string;
|
|
68
70
|
"ui.sessionTurn.error.freeUsageExceeded": string;
|
|
69
71
|
"ui.sessionTurn.error.addCredits": string;
|
|
@@ -132,6 +134,7 @@ declare const source: {
|
|
|
132
134
|
"ui.promptInput.chooseVariant": string;
|
|
133
135
|
"ui.promptInput.send": string;
|
|
134
136
|
"ui.promptInput.stop": string;
|
|
137
|
+
"ui.promptInput.exitShell": string;
|
|
135
138
|
"ui.promptInput.steer": string;
|
|
136
139
|
"ui.promptInput.queue": string;
|
|
137
140
|
"ui.promptInput.steerHint": string;
|
|
@@ -204,6 +207,7 @@ declare const source: {
|
|
|
204
207
|
"ui.message.interrupted": string;
|
|
205
208
|
"ui.sessionTimeline.notice.model": string;
|
|
206
209
|
"ui.sessionTimeline.notice.modelSwitched": string;
|
|
210
|
+
"ui.sessionTimeline.notice.agentChanged": string;
|
|
207
211
|
"ui.sessionTimeline.notice.movedTo": string;
|
|
208
212
|
"ui.sessionTimeline.notice.movedTooltip": string;
|
|
209
213
|
"ui.sessionTimeline.notice.failed": string;
|
|
@@ -150,6 +150,14 @@ declare const icons: {
|
|
|
150
150
|
viewBox: string;
|
|
151
151
|
body: string;
|
|
152
152
|
};
|
|
153
|
+
"outline-arrow-to-corner-top-right": {
|
|
154
|
+
viewBox: string;
|
|
155
|
+
body: string;
|
|
156
|
+
};
|
|
157
|
+
"outline-hexagonal-warning": {
|
|
158
|
+
viewBox: string;
|
|
159
|
+
body: string;
|
|
160
|
+
};
|
|
153
161
|
"outline-share": {
|
|
154
162
|
viewBox: string;
|
|
155
163
|
body: string;
|
package/package.json
CHANGED
|
@@ -260,3 +260,32 @@
|
|
|
260
260
|
opacity: 0.5;
|
|
261
261
|
cursor: not-allowed;
|
|
262
262
|
}
|
|
263
|
+
|
|
264
|
+
/* Ghost faint */
|
|
265
|
+
[data-component="button-v2"][data-variant="ghost-faint"] {
|
|
266
|
+
background-color: transparent;
|
|
267
|
+
color: var(--v2-text-text-faint);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
[data-component="button-v2"][data-variant="ghost-faint"] [data-slot="icon-svg"] {
|
|
271
|
+
color: var(--v2-icon-icon-faint);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
[data-component="button-v2"][data-variant="ghost-faint"]:is(:hover, [data-state="hover"]):not(:disabled):not(
|
|
275
|
+
[data-expanded]
|
|
276
|
+
) {
|
|
277
|
+
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
[data-component="button-v2"][data-variant="ghost-faint"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
281
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
[data-component="button-v2"][data-variant="ghost-faint"]:where([data-expanded]):not(:disabled) {
|
|
285
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
[data-component="button-v2"][data-variant="ghost-faint"]:is(:disabled, [data-state="disabled"]) {
|
|
289
|
+
opacity: 0.5;
|
|
290
|
+
cursor: not-allowed;
|
|
291
|
+
}
|
|
@@ -7,7 +7,16 @@ export interface ButtonProps
|
|
|
7
7
|
extends ComponentProps<typeof Root>,
|
|
8
8
|
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
9
9
|
size?: "small" | "normal" | "large"
|
|
10
|
-
variant?:
|
|
10
|
+
variant?:
|
|
11
|
+
| "neutral"
|
|
12
|
+
| "danger"
|
|
13
|
+
| "warning"
|
|
14
|
+
| "outline"
|
|
15
|
+
| "contrast"
|
|
16
|
+
| "ghost"
|
|
17
|
+
| "ghost-muted"
|
|
18
|
+
| "ghost-faint"
|
|
19
|
+
| "loading"
|
|
11
20
|
icon?: IconProps["name"]
|
|
12
21
|
}
|
|
13
22
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
outline: 1px solid transparent;
|
|
14
14
|
outline-offset: 0;
|
|
15
15
|
background:
|
|
16
|
-
linear-gradient(180deg, var(--v2-alpha-light-
|
|
16
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-2) 100%), var(--v2-background-bg-base);
|
|
17
17
|
box-shadow: var(--v2-elevation-button-neutral);
|
|
18
18
|
flex: none;
|
|
19
19
|
align-self: stretch;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
[data-component="text-input-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within) {
|
|
31
31
|
background:
|
|
32
32
|
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
33
|
-
linear-gradient(180deg, var(--v2-alpha-light-
|
|
33
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-2) 100%), var(--v2-background-bg-base);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
[data-component="text-input-v2"]:where(:focus-within):not([data-disabled], [data-invalid]) {
|
package/src/i18n/en.ts
CHANGED
|
@@ -69,6 +69,8 @@ const source = {
|
|
|
69
69
|
"ui.sessionTurn.retry.inSeconds": "in {{seconds}}s",
|
|
70
70
|
"ui.sessionTurn.retry.attempt": "attempt #{{attempt}}",
|
|
71
71
|
"ui.sessionTurn.retry.attemptLine": "{{line}} - attempt #{{attempt}}",
|
|
72
|
+
"ui.sessionTurn.retry.attemptLabel": "Attempt {{attempt}}",
|
|
73
|
+
"ui.sessionTurn.retry.attemptRetrying": "Attempt {{attempt}} - {{line}}",
|
|
72
74
|
"ui.sessionTurn.retry.geminiHot": "gemini is way too hot right now",
|
|
73
75
|
"ui.sessionTurn.error.freeUsageExceeded": "Free usage exceeded",
|
|
74
76
|
"ui.sessionTurn.error.addCredits": "Add credits",
|
|
@@ -146,6 +148,7 @@ const source = {
|
|
|
146
148
|
"ui.promptInput.chooseVariant": "Choose model variant",
|
|
147
149
|
"ui.promptInput.send": "Send",
|
|
148
150
|
"ui.promptInput.stop": "Stop",
|
|
151
|
+
"ui.promptInput.exitShell": "Exit",
|
|
149
152
|
"ui.promptInput.steer": "Steer",
|
|
150
153
|
"ui.promptInput.queue": "Queue",
|
|
151
154
|
"ui.promptInput.steerHint": "Send without interrupting",
|
|
@@ -227,6 +230,7 @@ const source = {
|
|
|
227
230
|
"ui.message.interrupted": "Interrupted",
|
|
228
231
|
"ui.sessionTimeline.notice.model": "Model",
|
|
229
232
|
"ui.sessionTimeline.notice.modelSwitched": "Switched to {{model}}",
|
|
233
|
+
"ui.sessionTimeline.notice.agentChanged": "Agent changed",
|
|
230
234
|
"ui.sessionTimeline.notice.movedTo": "Moved to",
|
|
231
235
|
"ui.sessionTimeline.notice.movedTooltip": "Session working directory changed",
|
|
232
236
|
"ui.sessionTimeline.notice.failed": "{{actor}} failed",
|
package/src/icons/icon/icon.tsx
CHANGED
|
@@ -152,6 +152,14 @@ const icons = {
|
|
|
152
152
|
viewBox: "0 0 16 16",
|
|
153
153
|
body: `<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`,
|
|
154
154
|
},
|
|
155
|
+
"outline-arrow-to-corner-top-right": {
|
|
156
|
+
viewBox: "0 0 16 16",
|
|
157
|
+
body: `<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`,
|
|
158
|
+
},
|
|
159
|
+
"outline-hexagonal-warning": {
|
|
160
|
+
viewBox: "0 0 16 16",
|
|
161
|
+
body: `<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`,
|
|
162
|
+
},
|
|
155
163
|
"outline-share": {
|
|
156
164
|
viewBox: "0 0 16 16",
|
|
157
165
|
body: `<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`,
|
|
@@ -187,10 +195,18 @@ function getIcon(name: IconName) {
|
|
|
187
195
|
return { body, viewBox: additionalIconViewBox(name as keyof typeof additionalIcons) }
|
|
188
196
|
}
|
|
189
197
|
|
|
198
|
+
function spriteContent() {
|
|
199
|
+
return Array.from(new Set<IconName>([...Object.keys(additionalIcons), ...Object.keys(icons)] as IconName[]))
|
|
200
|
+
.map((name) => `<symbol id="${symbol(name)}" viewBox="${getIcon(name).viewBox}">${getIcon(name).body}</symbol>`)
|
|
201
|
+
.join("")
|
|
202
|
+
}
|
|
203
|
+
|
|
190
204
|
function ensureSprite() {
|
|
191
205
|
if (spriteInserted) return
|
|
192
206
|
if (typeof document === "undefined") return
|
|
193
|
-
|
|
207
|
+
const existing = document.getElementById(spriteID)
|
|
208
|
+
if (existing) {
|
|
209
|
+
existing.innerHTML = spriteContent()
|
|
194
210
|
spriteInserted = true
|
|
195
211
|
return
|
|
196
212
|
}
|
|
@@ -202,9 +218,7 @@ function ensureSprite() {
|
|
|
202
218
|
svg.setAttribute("height", "0")
|
|
203
219
|
svg.style.position = "absolute"
|
|
204
220
|
svg.style.overflow = "hidden"
|
|
205
|
-
svg.innerHTML =
|
|
206
|
-
.map((name) => `<symbol id="${symbol(name)}" viewBox="${getIcon(name).viewBox}">${getIcon(name).body}</symbol>`)
|
|
207
|
-
.join("")
|
|
221
|
+
svg.innerHTML = spriteContent()
|
|
208
222
|
document.body.insertBefore(svg, document.body.firstChild)
|
|
209
223
|
spriteInserted = true
|
|
210
224
|
}
|