@opencode-ai/ui 0.0.0-dev-202607010703 → 0.0.0-dev-202607010816

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.
@@ -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" | "outline";
7
+ variant?: "neutral" | "danger" | "outline" | "contrast" | "ghost" | "ghost-muted" | "loading";
8
8
  icon?: IconProps["name"];
9
9
  }
10
10
  export declare function ButtonV2(props: ButtonV2Props): import("solid-js").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type ComponentProps } from "solid-js";
2
+ import "./loader-v2.css";
3
+ export declare function LoaderV2(props: ComponentProps<"svg">): import("solid-js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode-ai/ui",
3
- "version": "0.0.0-dev-202607010703",
3
+ "version": "0.0.0-dev-202607010816",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  outline: none;
29
29
  }
30
30
 
31
- [data-component="button-v2"]:is(:focus-visible, [data-state="focus"]):not(:disabled) {
31
+ [data-component="button-v2"]:is(:focus-visible, [data-state="focus"]):not(:disabled):not([data-variant="loading"]) {
32
32
  outline: 2px solid var(--v2-border-border-focus);
33
33
  outline-offset: 2.5px;
34
34
  }
@@ -170,6 +170,15 @@
170
170
  cursor: not-allowed;
171
171
  }
172
172
 
173
+ /* Loading */
174
+ [data-component="button-v2"][data-variant="loading"] {
175
+ background: #f2f2f2;
176
+ color: var(--v2-text-text-base);
177
+ box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
178
+ cursor: default;
179
+ pointer-events: none;
180
+ }
181
+
173
182
  /* Ghost */
174
183
  [data-component="button-v2"][data-variant="ghost"] {
175
184
  background-color: transparent;
@@ -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" | "outline"
10
+ variant?: "neutral" | "danger" | "outline" | "contrast" | "ghost" | "ghost-muted" | "loading"
11
11
  icon?: IconProps["name"]
12
12
  }
13
13
 
@@ -0,0 +1,32 @@
1
+ [data-component="loader-v2"] {
2
+ --_duration: 900ms;
3
+ display: block;
4
+ flex-shrink: 0;
5
+ color: var(--v2-icon-icon-muted, #808080);
6
+ animation: loader-v2-spin var(--_duration) linear infinite;
7
+ transform-origin: center;
8
+ }
9
+
10
+ [data-component="loader-v2"] [data-slot="loader-v2-background"] {
11
+ stroke: currentColor;
12
+ opacity: 0.2;
13
+ }
14
+
15
+ [data-component="loader-v2"] [data-slot="loader-v2-progress"] {
16
+ stroke: currentColor;
17
+ stroke-linecap: round;
18
+ transform: rotate(-90deg);
19
+ transform-origin: center;
20
+ }
21
+
22
+ @keyframes loader-v2-spin {
23
+ to {
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+
28
+ @media (prefers-reduced-motion: reduce) {
29
+ [data-component="loader-v2"] {
30
+ animation: none;
31
+ }
32
+ }
@@ -0,0 +1,31 @@
1
+ import { splitProps, type ComponentProps } from "solid-js"
2
+ import "./loader-v2.css"
3
+
4
+ export function LoaderV2(props: ComponentProps<"svg">) {
5
+ const [local, rest] = splitProps(props, ["class", "classList", "width", "height"])
6
+ return (
7
+ <svg
8
+ {...rest}
9
+ class={local.class}
10
+ classList={local.classList}
11
+ width={local.width ?? 16}
12
+ height={local.height ?? 16}
13
+ viewBox="0 0 16 16"
14
+ fill="none"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ data-component="loader-v2"
17
+ aria-hidden={rest["aria-hidden"] ?? "true"}
18
+ >
19
+ <circle cx="8" cy="8" r="6" data-slot="loader-v2-background" stroke-width="2" />
20
+ <circle
21
+ cx="8"
22
+ cy="8"
23
+ r="6"
24
+ data-slot="loader-v2-progress"
25
+ pathLength="100"
26
+ stroke-width="2"
27
+ stroke-dasharray="33 67"
28
+ />
29
+ </svg>
30
+ )
31
+ }
@@ -45,6 +45,7 @@
45
45
  }
46
46
 
47
47
  [data-slot="radio-v2-item"] {
48
+ position: relative;
48
49
  display: flex;
49
50
  flex-direction: row;
50
51
  align-items: flex-start;
@@ -131,10 +132,6 @@
131
132
  linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-accent);
132
133
  }
133
134
 
134
- &:where([data-checked][data-disabled]) [data-slot="radio-v2-item-control"] {
135
- opacity: 0.5;
136
- }
137
-
138
135
  &:where([data-invalid]):where(:not([data-checked])) [data-slot="radio-v2-item-control"] {
139
136
  background: var(--v2-state-bg-danger);
140
137
  box-shadow: inset 0 0 0 0.5px var(--v2-state-border-danger);
@@ -195,8 +192,11 @@
195
192
  user-select: none;
196
193
  }
197
194
 
198
- &:where([data-disabled]) [data-slot="radio-v2-item-label"],
195
+ &:where([data-disabled]) [data-slot="radio-v2-item-label-text"] {
196
+ color: var(--v2-text-text-muted);
197
+ }
198
+
199
199
  &:where([data-disabled]) [data-slot="radio-v2-item-description"] {
200
- opacity: 0.5;
200
+ color: var(--v2-text-text-faint);
201
201
  }
202
202
  }