@opencode/ui 0.0.0-beta-19296 → 0.0.0-beta-19378
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/actions/icon-button/icon-button.d.ts +1 -1
- package/dist/i18n/en.d.ts +2 -1
- package/dist/icons/icon/icon.d.ts +12 -0
- package/package.json +1 -1
- package/src/actions/button/button.css +2 -0
- package/src/actions/button/button.tsx +1 -0
- package/src/actions/icon-button/icon-button.css +2 -55
- package/src/actions/icon-button/icon-button.tsx +1 -1
- package/src/actions/submit.css +74 -0
- package/src/i18n/en.ts +4 -3
- package/src/icons/icon/icon.tsx +12 -0
|
@@ -4,7 +4,7 @@ import { type IconProps } from "@opencode/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" | "ghost-faint" | "loading";
|
|
7
|
+
variant?: "neutral" | "danger" | "warning" | "outline" | "contrast" | "submit" | "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;
|
|
@@ -5,7 +5,7 @@ import "./icon-button.css";
|
|
|
5
5
|
export interface IconButtonProps extends ComponentProps<typeof Root>, Pick<ComponentProps<"button">, "class" | "classList"> {
|
|
6
6
|
icon?: JSX.Element;
|
|
7
7
|
size?: "small" | "normal" | "large";
|
|
8
|
-
variant?: "neutral" | "contrast" | "ghost" | "ghost-muted";
|
|
8
|
+
variant?: "neutral" | "contrast" | "submit" | "ghost" | "ghost-muted";
|
|
9
9
|
state?: "rest" | "hover" | "pressed";
|
|
10
10
|
}
|
|
11
11
|
export declare function IconButton(props: ComponentProps<"button"> & IconButtonProps): JSX.Element;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -108,7 +108,8 @@ declare const source: {
|
|
|
108
108
|
"ui.messagePart.context.thought.other": string;
|
|
109
109
|
"ui.messagePart.context.match.one": string;
|
|
110
110
|
"ui.messagePart.context.match.other": string;
|
|
111
|
-
"ui.messagePart.tools.used": string;
|
|
111
|
+
"ui.messagePart.tools.used.one": string;
|
|
112
|
+
"ui.messagePart.tools.used.other": string;
|
|
112
113
|
"ui.list.loading": string;
|
|
113
114
|
"ui.list.empty": string;
|
|
114
115
|
"ui.list.clearFilter": string;
|
|
@@ -2,6 +2,14 @@ import { type ComponentProps } from "solid-js";
|
|
|
2
2
|
import { additionalIcons } from "./additional-icons";
|
|
3
3
|
import "./icon.css";
|
|
4
4
|
declare const icons: {
|
|
5
|
+
lock: {
|
|
6
|
+
viewBox: string;
|
|
7
|
+
body: string;
|
|
8
|
+
};
|
|
9
|
+
globe: {
|
|
10
|
+
viewBox: string;
|
|
11
|
+
body: string;
|
|
12
|
+
};
|
|
5
13
|
flask: {
|
|
6
14
|
viewBox: string;
|
|
7
15
|
body: string;
|
|
@@ -190,6 +198,10 @@ declare const icons: {
|
|
|
190
198
|
viewBox: string;
|
|
191
199
|
body: string;
|
|
192
200
|
};
|
|
201
|
+
refresh: {
|
|
202
|
+
viewBox: string;
|
|
203
|
+
body: string;
|
|
204
|
+
};
|
|
193
205
|
reset: {
|
|
194
206
|
viewBox: string;
|
|
195
207
|
body: string;
|
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "../submit.css";
|
|
2
|
+
|
|
1
3
|
* {
|
|
2
4
|
-webkit-font-smoothing: antialiased;
|
|
3
5
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -69,61 +71,6 @@
|
|
|
69
71
|
cursor: not-allowed;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
/* Contrast */
|
|
73
|
-
[data-component="icon-button-v2"][data-variant="contrast"] {
|
|
74
|
-
--icon-button-contrast-highlight: var(--v2-alpha-light-20);
|
|
75
|
-
--icon-button-contrast-hover: var(--v2-overlay-simple-overlay-contrast-hover);
|
|
76
|
-
|
|
77
|
-
background-image:
|
|
78
|
-
linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
79
|
-
linear-gradient(
|
|
80
|
-
90deg,
|
|
81
|
-
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
82
|
-
var(--v2-background-bg-icon-button-contrast) 100%
|
|
83
|
-
);
|
|
84
|
-
color: var(--v2-text-text-contrast);
|
|
85
|
-
text-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.3);
|
|
86
|
-
box-shadow: var(--v2-elevation-button-contrast);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[data-color-scheme="dark"] [data-component="icon-button-v2"][data-variant="contrast"] {
|
|
90
|
-
--icon-button-contrast-highlight: var(--v2-alpha-light-60);
|
|
91
|
-
--icon-button-contrast-hover: var(--v2-alpha-dark-8);
|
|
92
|
-
|
|
93
|
-
color: var(--v2-icon-icon-inverse);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[data-component="icon-button-v2"][data-variant="contrast"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
97
|
-
background-image:
|
|
98
|
-
linear-gradient(90deg, var(--icon-button-contrast-hover) 0%, var(--icon-button-contrast-hover) 100%),
|
|
99
|
-
linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
100
|
-
linear-gradient(
|
|
101
|
-
90deg,
|
|
102
|
-
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
103
|
-
var(--v2-background-bg-icon-button-contrast) 100%
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[data-component="icon-button-v2"][data-variant="contrast"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
108
|
-
background-image:
|
|
109
|
-
linear-gradient(
|
|
110
|
-
90deg,
|
|
111
|
-
var(--v2-overlay-simple-overlay-contrast-pressed) 0%,
|
|
112
|
-
var(--v2-overlay-simple-overlay-contrast-pressed) 100%
|
|
113
|
-
),
|
|
114
|
-
linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
115
|
-
linear-gradient(
|
|
116
|
-
90deg,
|
|
117
|
-
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
118
|
-
var(--v2-background-bg-icon-button-contrast) 100%
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[data-component="icon-button-v2"][data-variant="contrast"]:is(:disabled, [data-state="disabled"]) {
|
|
123
|
-
opacity: 0.4;
|
|
124
|
-
cursor: not-allowed;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
74
|
/* Ghost */
|
|
128
75
|
[data-component="icon-button-v2"][data-variant="ghost"] {
|
|
129
76
|
background-color: transparent;
|
|
@@ -8,7 +8,7 @@ export interface IconButtonProps
|
|
|
8
8
|
Pick<ComponentProps<"button">, "class" | "classList"> {
|
|
9
9
|
icon?: JSX.Element
|
|
10
10
|
size?: "small" | "normal" | "large"
|
|
11
|
-
variant?: "neutral" | "contrast" | "ghost" | "ghost-muted"
|
|
11
|
+
variant?: "neutral" | "contrast" | "submit" | "ghost" | "ghost-muted"
|
|
12
12
|
state?: "rest" | "hover" | "pressed"
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* Shared by Composer submit actions and contrast icon buttons. */
|
|
2
|
+
:is(
|
|
3
|
+
[data-component="button-v2"][data-variant="submit"],
|
|
4
|
+
[data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"])
|
|
5
|
+
) {
|
|
6
|
+
--submit-highlight: var(--v2-alpha-light-20);
|
|
7
|
+
--submit-hover: var(--v2-overlay-simple-overlay-contrast-hover);
|
|
8
|
+
|
|
9
|
+
background-image:
|
|
10
|
+
linear-gradient(180deg, var(--submit-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
11
|
+
linear-gradient(
|
|
12
|
+
90deg,
|
|
13
|
+
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
14
|
+
var(--v2-background-bg-icon-button-contrast) 100%
|
|
15
|
+
);
|
|
16
|
+
color: var(--v2-text-text-contrast);
|
|
17
|
+
text-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.3);
|
|
18
|
+
box-shadow: var(--v2-elevation-button-contrast);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-color-scheme="dark"]
|
|
22
|
+
:is(
|
|
23
|
+
[data-component="button-v2"][data-variant="submit"],
|
|
24
|
+
[data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"])
|
|
25
|
+
) {
|
|
26
|
+
--submit-highlight: var(--v2-alpha-light-60);
|
|
27
|
+
--submit-hover: var(--v2-alpha-dark-8);
|
|
28
|
+
|
|
29
|
+
color: var(--v2-text-text-inverse);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-color-scheme="dark"] [data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"]) {
|
|
33
|
+
color: var(--v2-icon-icon-inverse);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:is(
|
|
37
|
+
[data-component="button-v2"][data-variant="submit"],
|
|
38
|
+
[data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"])
|
|
39
|
+
):is(:hover, [data-state="hover"]):not(:disabled) {
|
|
40
|
+
background-image:
|
|
41
|
+
linear-gradient(90deg, var(--submit-hover) 0%, var(--submit-hover) 100%),
|
|
42
|
+
linear-gradient(180deg, var(--submit-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
43
|
+
linear-gradient(
|
|
44
|
+
90deg,
|
|
45
|
+
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
46
|
+
var(--v2-background-bg-icon-button-contrast) 100%
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:is(
|
|
51
|
+
[data-component="button-v2"][data-variant="submit"],
|
|
52
|
+
[data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"])
|
|
53
|
+
):is(:active, [data-state="pressed"]):not(:disabled) {
|
|
54
|
+
background-image:
|
|
55
|
+
linear-gradient(
|
|
56
|
+
90deg,
|
|
57
|
+
var(--v2-overlay-simple-overlay-contrast-pressed) 0%,
|
|
58
|
+
var(--v2-overlay-simple-overlay-contrast-pressed) 100%
|
|
59
|
+
),
|
|
60
|
+
linear-gradient(180deg, var(--submit-highlight) 0%, var(--v2-alpha-light-0) 100%),
|
|
61
|
+
linear-gradient(
|
|
62
|
+
90deg,
|
|
63
|
+
var(--v2-background-bg-icon-button-contrast) 0%,
|
|
64
|
+
var(--v2-background-bg-icon-button-contrast) 100%
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:is(
|
|
69
|
+
[data-component="button-v2"][data-variant="submit"],
|
|
70
|
+
[data-component="icon-button-v2"]:is([data-variant="submit"], [data-variant="contrast"])
|
|
71
|
+
):is(:disabled, [data-state="disabled"]) {
|
|
72
|
+
opacity: 0.4;
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
}
|
package/src/i18n/en.ts
CHANGED
|
@@ -114,11 +114,12 @@ const source = {
|
|
|
114
114
|
"ui.messagePart.context.list.other": "{{count}} lists",
|
|
115
115
|
"ui.messagePart.context.notice.one": "{{count}} Notice",
|
|
116
116
|
"ui.messagePart.context.notice.other": "{{count}} Notices",
|
|
117
|
-
"ui.messagePart.context.thought.one": "
|
|
118
|
-
"ui.messagePart.context.thought.other": "
|
|
117
|
+
"ui.messagePart.context.thought.one": "Thought",
|
|
118
|
+
"ui.messagePart.context.thought.other": "Thoughts",
|
|
119
119
|
"ui.messagePart.context.match.one": "({{count}} match)",
|
|
120
120
|
"ui.messagePart.context.match.other": "({{count}} matches)",
|
|
121
|
-
"ui.messagePart.tools.used": "
|
|
121
|
+
"ui.messagePart.tools.used.one": "{{count}} used {{tools}}",
|
|
122
|
+
"ui.messagePart.tools.used.other": "{{count}} used {{tools}}",
|
|
122
123
|
|
|
123
124
|
"ui.list.loading": "Loading",
|
|
124
125
|
"ui.list.empty": "No results",
|
package/src/icons/icon/icon.tsx
CHANGED
|
@@ -4,6 +4,14 @@ import "./icon.css"
|
|
|
4
4
|
|
|
5
5
|
// Consumers center the SVG viewport, so each icon must center its artwork within its viewBox.
|
|
6
6
|
const icons = {
|
|
7
|
+
lock: {
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
body: `<rect x="3.5" y="7" width="9" height="7" rx="1" stroke="currentColor"/><path d="M5 7V5a3 3 0 0 1 6 0v2M8 10v1" stroke="currentColor" stroke-linecap="round"/>`,
|
|
10
|
+
},
|
|
11
|
+
globe: {
|
|
12
|
+
viewBox: "0 0 16 16",
|
|
13
|
+
body: `<circle cx="8" cy="8" r="6" stroke="currentColor"/><ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor"/><path d="M2 8h12" stroke="currentColor"/>`,
|
|
14
|
+
},
|
|
7
15
|
flask: {
|
|
8
16
|
viewBox: "0 0 16 16",
|
|
9
17
|
body: `<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,
|
|
@@ -192,6 +200,10 @@ const icons = {
|
|
|
192
200
|
viewBox: "0 0 20 20",
|
|
193
201
|
body: `<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/><path d="M3 3 17 17" stroke="currentColor" stroke-linecap="round"/>`,
|
|
194
202
|
},
|
|
203
|
+
refresh: {
|
|
204
|
+
viewBox: "0 0 20 20",
|
|
205
|
+
body: `<path d="M16.25 7.5A6.5 6.5 0 1 0 16.5 11M16.25 3.5v4h-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
206
|
+
},
|
|
195
207
|
reset: {
|
|
196
208
|
viewBox: "0 0 20 20",
|
|
197
209
|
body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
|