@opencode-ai/ui 0.0.0-beta-202606290808 → 0.0.0-beta-202606291048
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/v2/components/button-v2.d.ts +1 -1
- package/dist/v2/components/dialog-v2.d.ts +1 -0
- package/dist/v2/components/icon.d.ts +8 -0
- package/dist/v2/components/progress-circle-v2.d.ts +8 -0
- package/package.json +1 -1
- package/src/v2/components/button-v2.css +20 -0
- package/src/v2/components/button-v2.tsx +1 -1
- package/src/v2/components/dialog-v2.css +3 -0
- package/src/v2/components/dialog-v2.tsx +2 -0
- package/src/v2/components/icon.tsx +8 -0
- package/src/v2/components/progress-circle-v2.css +13 -0
- package/src/v2/components/progress-circle-v2.tsx +52 -0
|
@@ -4,7 +4,7 @@ import { type IconProps } from "./icon";
|
|
|
4
4
|
import "./button-v2.css";
|
|
5
5
|
export interface ButtonV2Props extends ComponentProps<typeof Kobalte>, Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
6
6
|
size?: "small" | "normal" | "large";
|
|
7
|
-
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted";
|
|
7
|
+
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted" | "outline";
|
|
8
8
|
icon?: IconProps["name"];
|
|
9
9
|
}
|
|
10
10
|
export declare function ButtonV2(props: ButtonV2Props): import("solid-js").JSX.Element;
|
|
@@ -23,3 +23,4 @@ export declare function DialogTitle(props: ParentProps): import("solid-js").JSX.
|
|
|
23
23
|
export declare function DialogTitleGroup(props: DialogTitleGroupProps): import("solid-js").JSX.Element;
|
|
24
24
|
export declare function DialogHeader(props: DialogHeaderProps): import("solid-js").JSX.Element;
|
|
25
25
|
export declare function Dialog(props: DialogProps): import("solid-js").JSX.Element;
|
|
26
|
+
export declare const DialogV2: typeof Dialog;
|
|
@@ -84,6 +84,14 @@ declare const icons: {
|
|
|
84
84
|
viewBox: string;
|
|
85
85
|
body: string;
|
|
86
86
|
};
|
|
87
|
+
"outline-copy": {
|
|
88
|
+
viewBox: string;
|
|
89
|
+
body: string;
|
|
90
|
+
};
|
|
91
|
+
"outline-square-arrow": {
|
|
92
|
+
viewBox: string;
|
|
93
|
+
body: string;
|
|
94
|
+
};
|
|
87
95
|
archive: {
|
|
88
96
|
viewBox: string;
|
|
89
97
|
body: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentProps } from "solid-js";
|
|
2
|
+
import "./progress-circle-v2.css";
|
|
3
|
+
export interface ProgressCircleV2Props extends Pick<ComponentProps<"svg">, "class" | "classList"> {
|
|
4
|
+
percentage: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProgressCircleV2(props: ProgressCircleV2Props): import("solid-js").JSX.Element;
|
package/package.json
CHANGED
|
@@ -113,6 +113,26 @@
|
|
|
113
113
|
cursor: not-allowed;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/* Outline */
|
|
117
|
+
[data-component="button-v2"][data-variant="outline"] {
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
color: var(--v2-text-text-base);
|
|
120
|
+
box-shadow: inset 0 0 0 1px var(--v2-border-border-muted);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[data-component="button-v2"][data-variant="outline"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
124
|
+
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-component="button-v2"][data-variant="outline"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
128
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-component="button-v2"][data-variant="outline"]:is(:disabled, [data-state="disabled"]) {
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
}
|
|
135
|
+
|
|
116
136
|
/* Contrast */
|
|
117
137
|
[data-component="button-v2"][data-variant="contrast"] {
|
|
118
138
|
background-image:
|
|
@@ -7,7 +7,7 @@ export interface ButtonV2Props
|
|
|
7
7
|
extends ComponentProps<typeof Kobalte>,
|
|
8
8
|
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
9
9
|
size?: "small" | "normal" | "large"
|
|
10
|
-
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted"
|
|
10
|
+
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted" | "outline"
|
|
11
11
|
icon?: IconProps["name"]
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
margin: 0;
|
|
60
60
|
flex: 1;
|
|
61
61
|
min-width: 0;
|
|
62
|
+
user-select: none;
|
|
62
63
|
font-weight: 530;
|
|
63
64
|
font-size: 13px;
|
|
64
65
|
line-height: 16px;
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
margin: 0;
|
|
81
82
|
flex: none;
|
|
82
83
|
flex-grow: 0;
|
|
84
|
+
user-select: none;
|
|
83
85
|
font-weight: 530;
|
|
84
86
|
font-size: 15px;
|
|
85
87
|
line-height: 20px;
|
|
@@ -91,6 +93,7 @@
|
|
|
91
93
|
[data-slot="dialog-description"] {
|
|
92
94
|
flex: none;
|
|
93
95
|
flex-grow: 0;
|
|
96
|
+
user-select: none;
|
|
94
97
|
font-weight: 440;
|
|
95
98
|
font-size: 13px;
|
|
96
99
|
line-height: 20px;
|
|
@@ -85,6 +85,14 @@ const icons = {
|
|
|
85
85
|
viewBox: "0 0 16 16",
|
|
86
86
|
body: `<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`,
|
|
87
87
|
},
|
|
88
|
+
"outline-copy": {
|
|
89
|
+
viewBox: "0 0 16 16",
|
|
90
|
+
body: `<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`,
|
|
91
|
+
},
|
|
92
|
+
"outline-square-arrow": {
|
|
93
|
+
viewBox: "0 0 16 16",
|
|
94
|
+
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"/>`,
|
|
95
|
+
},
|
|
88
96
|
archive: {
|
|
89
97
|
viewBox: "0 0 16 16",
|
|
90
98
|
body: `<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[data-component="progress-circle-v2"] {
|
|
2
|
+
display: block;
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-component="progress-circle-v2"] [data-slot="progress-circle-v2-background"] {
|
|
7
|
+
stroke: var(--v2-background-bg-layer-04);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="progress-circle-v2"] [data-slot="progress-circle-v2-progress"] {
|
|
11
|
+
stroke: var(--v2-icon-icon-muted);
|
|
12
|
+
transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1);
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ComponentProps, createMemo, splitProps } from "solid-js"
|
|
2
|
+
import "./progress-circle-v2.css"
|
|
3
|
+
|
|
4
|
+
export interface ProgressCircleV2Props extends Pick<ComponentProps<"svg">, "class" | "classList"> {
|
|
5
|
+
percentage: number
|
|
6
|
+
size?: number
|
|
7
|
+
strokeWidth?: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ProgressCircleV2(props: ProgressCircleV2Props) {
|
|
11
|
+
const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"])
|
|
12
|
+
|
|
13
|
+
const size = () => split.size ?? 14
|
|
14
|
+
const strokeWidth = () => split.strokeWidth ?? 1.5
|
|
15
|
+
const viewBoxSize = 14
|
|
16
|
+
const center = viewBoxSize / 2
|
|
17
|
+
const radius = () => center - strokeWidth() / 2
|
|
18
|
+
const circumference = createMemo(() => 2 * Math.PI * radius())
|
|
19
|
+
const offset = createMemo(() => circumference() * (1 - Math.max(0, Math.min(100, split.percentage || 0)) / 100))
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<svg
|
|
23
|
+
{...rest}
|
|
24
|
+
width={size()}
|
|
25
|
+
height={size()}
|
|
26
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
27
|
+
fill="none"
|
|
28
|
+
data-component="progress-circle-v2"
|
|
29
|
+
classList={{
|
|
30
|
+
...split.classList,
|
|
31
|
+
[split.class ?? ""]: !!split.class,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<circle
|
|
35
|
+
cx={center}
|
|
36
|
+
cy={center}
|
|
37
|
+
r={radius()}
|
|
38
|
+
data-slot="progress-circle-v2-background"
|
|
39
|
+
stroke-width={strokeWidth()}
|
|
40
|
+
/>
|
|
41
|
+
<circle
|
|
42
|
+
cx={center}
|
|
43
|
+
cy={center}
|
|
44
|
+
r={radius()}
|
|
45
|
+
data-slot="progress-circle-v2-progress"
|
|
46
|
+
stroke-width={strokeWidth()}
|
|
47
|
+
stroke-dasharray={circumference().toString()}
|
|
48
|
+
stroke-dashoffset={offset()}
|
|
49
|
+
/>
|
|
50
|
+
</svg>
|
|
51
|
+
)
|
|
52
|
+
}
|