@opencode-ai/ui 0.0.0-dev-202606261234 → 0.0.0-dev-202606261324
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 +14 -3
- package/dist/v2/components/divider-v2.d.ts +5 -0
- package/package.json +1 -1
- package/src/v2/components/button-v2.css +24 -0
- package/src/v2/components/button-v2.tsx +1 -1
- package/src/v2/components/dialog-v2.css +31 -7
- package/src/v2/components/dialog-v2.tsx +66 -47
- package/src/v2/components/divider-v2.css +11 -0
- package/src/v2/components/divider-v2.tsx +20 -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" | "contrast" | "ghost" | "ghost-muted";
|
|
7
|
+
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted";
|
|
8
8
|
icon?: IconProps["name"];
|
|
9
9
|
}
|
|
10
10
|
export declare function ButtonV2(props: ButtonV2Props): import("solid-js").JSX.Element;
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { type ComponentProps, type JSXElement, type ParentProps } from "solid-js";
|
|
2
2
|
import "./dialog-v2.css";
|
|
3
3
|
export interface DialogProps extends ParentProps {
|
|
4
|
-
title?: JSXElement;
|
|
5
|
-
description?: JSXElement;
|
|
6
|
-
action?: JSXElement;
|
|
7
4
|
size?: "normal" | "large" | "x-large";
|
|
8
5
|
variant?: "default" | "settings";
|
|
9
6
|
class?: ComponentProps<"div">["class"];
|
|
10
7
|
classList?: ComponentProps<"div">["classList"];
|
|
11
8
|
fit?: boolean;
|
|
12
9
|
}
|
|
10
|
+
export interface DialogHeaderProps extends ParentProps {
|
|
11
|
+
closeLabel?: string;
|
|
12
|
+
hideClose?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DialogTitleGroupProps {
|
|
15
|
+
title?: JSXElement;
|
|
16
|
+
description: JSXElement;
|
|
17
|
+
}
|
|
13
18
|
export declare function DialogFooter(props: ParentProps): import("solid-js").JSX.Element;
|
|
19
|
+
export declare function DialogBody(props: ParentProps & {
|
|
20
|
+
class?: ComponentProps<"div">["class"];
|
|
21
|
+
}): import("solid-js").JSX.Element;
|
|
22
|
+
export declare function DialogTitle(props: ParentProps): import("solid-js").JSX.Element;
|
|
23
|
+
export declare function DialogTitleGroup(props: DialogTitleGroupProps): import("solid-js").JSX.Element;
|
|
24
|
+
export declare function DialogHeader(props: DialogHeaderProps): import("solid-js").JSX.Element;
|
|
14
25
|
export declare function Dialog(props: DialogProps): import("solid-js").JSX.Element;
|
package/package.json
CHANGED
|
@@ -89,6 +89,30 @@
|
|
|
89
89
|
cursor: not-allowed;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/* Danger */
|
|
93
|
+
[data-component="button-v2"][data-variant="danger"] {
|
|
94
|
+
background-color: var(--v2-background-bg-button-neutral);
|
|
95
|
+
color: var(--v2-state-fg-danger);
|
|
96
|
+
box-shadow: var(--v2-elevation-button-neutral);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-component="button-v2"][data-variant="danger"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
100
|
+
background-image:
|
|
101
|
+
linear-gradient(90deg, var(--v2-overlay-simple-overlay-hover) 0%, var(--v2-overlay-simple-overlay-hover) 100%),
|
|
102
|
+
linear-gradient(90deg, var(--v2-background-bg-button-neutral) 0%, var(--v2-background-bg-button-neutral) 100%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-component="button-v2"][data-variant="danger"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
106
|
+
background-image:
|
|
107
|
+
linear-gradient(90deg, var(--v2-overlay-simple-overlay-pressed) 0%, var(--v2-overlay-simple-overlay-pressed) 100%),
|
|
108
|
+
linear-gradient(90deg, var(--v2-background-bg-button-neutral) 0%, var(--v2-background-bg-button-neutral) 100%);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[data-component="button-v2"][data-variant="danger"]:is(:disabled, [data-state="disabled"]) {
|
|
112
|
+
opacity: 0.5;
|
|
113
|
+
cursor: not-allowed;
|
|
114
|
+
}
|
|
115
|
+
|
|
92
116
|
/* Contrast */
|
|
93
117
|
[data-component="button-v2"][data-variant="contrast"] {
|
|
94
118
|
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" | "contrast" | "ghost" | "ghost-muted"
|
|
10
|
+
variant?: "neutral" | "danger" | "contrast" | "ghost" | "ghost-muted"
|
|
11
11
|
icon?: IconProps["name"]
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -49,34 +49,51 @@
|
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-direction: row;
|
|
51
51
|
align-items: flex-start;
|
|
52
|
+
align-self: stretch;
|
|
53
|
+
width: 100%;
|
|
54
|
+
gap: 0;
|
|
52
55
|
padding: 16px;
|
|
53
|
-
gap: 8px;
|
|
54
56
|
flex-shrink: 0;
|
|
55
|
-
|
|
57
|
+
|
|
58
|
+
[data-slot="dialog-header-title"] {
|
|
59
|
+
margin: 0;
|
|
60
|
+
flex: 1;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
font-weight: 530;
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
line-height: 16px;
|
|
65
|
+
letter-spacing: -0.04px;
|
|
66
|
+
color: var(--v2-text-text-base);
|
|
67
|
+
font-variation-settings: "slnt" 0;
|
|
68
|
+
}
|
|
56
69
|
|
|
57
70
|
[data-slot="dialog-title-group"] {
|
|
58
71
|
display: flex;
|
|
59
72
|
flex-direction: column;
|
|
60
73
|
align-items: flex-start;
|
|
61
|
-
gap:
|
|
74
|
+
gap: 4px;
|
|
62
75
|
flex: 1;
|
|
63
76
|
min-width: 0;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
[data-slot="dialog-title"] {
|
|
67
80
|
margin: 0;
|
|
81
|
+
flex: none;
|
|
82
|
+
flex-grow: 0;
|
|
68
83
|
font-weight: 530;
|
|
69
84
|
font-size: 15px;
|
|
70
|
-
line-height:
|
|
85
|
+
line-height: 20px;
|
|
71
86
|
letter-spacing: -0.13px;
|
|
72
87
|
color: var(--v2-text-text-base);
|
|
73
88
|
font-variation-settings: "slnt" 0;
|
|
74
89
|
}
|
|
75
90
|
|
|
76
91
|
[data-slot="dialog-description"] {
|
|
92
|
+
flex: none;
|
|
93
|
+
flex-grow: 0;
|
|
77
94
|
font-weight: 440;
|
|
78
95
|
font-size: 13px;
|
|
79
|
-
line-height:
|
|
96
|
+
line-height: 20px;
|
|
80
97
|
letter-spacing: -0.04px;
|
|
81
98
|
color: var(--v2-text-text-muted);
|
|
82
99
|
font-variation-settings: "slnt" 0;
|
|
@@ -86,8 +103,11 @@
|
|
|
86
103
|
display: flex;
|
|
87
104
|
justify-content: center;
|
|
88
105
|
align-items: center;
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
106
|
+
width: 20px;
|
|
107
|
+
height: 20px;
|
|
108
|
+
margin-top: -2px;
|
|
109
|
+
margin-right: -2px;
|
|
110
|
+
margin-left: auto;
|
|
91
111
|
border-radius: 4px;
|
|
92
112
|
flex-shrink: 0;
|
|
93
113
|
cursor: pointer;
|
|
@@ -97,6 +117,10 @@
|
|
|
97
117
|
background: var(--v2-overlay-simple-overlay-hover);
|
|
98
118
|
}
|
|
99
119
|
}
|
|
120
|
+
|
|
121
|
+
&[data-hide-close] [data-slot="dialog-close-button"] {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
100
124
|
}
|
|
101
125
|
|
|
102
126
|
[data-slot="dialog-footer"] {
|
|
@@ -3,9 +3,6 @@ import { type ComponentProps, type JSXElement, type ParentProps, Show, children,
|
|
|
3
3
|
import "./dialog-v2.css"
|
|
4
4
|
|
|
5
5
|
export interface DialogProps extends ParentProps {
|
|
6
|
-
title?: JSXElement
|
|
7
|
-
description?: JSXElement
|
|
8
|
-
action?: JSXElement
|
|
9
6
|
size?: "normal" | "large" | "x-large"
|
|
10
7
|
variant?: "default" | "settings"
|
|
11
8
|
class?: ComponentProps<"div">["class"]
|
|
@@ -13,26 +10,76 @@ export interface DialogProps extends ParentProps {
|
|
|
13
10
|
fit?: boolean
|
|
14
11
|
}
|
|
15
12
|
|
|
13
|
+
export interface DialogHeaderProps extends ParentProps {
|
|
14
|
+
closeLabel?: string
|
|
15
|
+
hideClose?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DialogTitleGroupProps {
|
|
19
|
+
title?: JSXElement
|
|
20
|
+
description: JSXElement
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
export function DialogFooter(props: ParentProps) {
|
|
17
24
|
return <div data-slot="dialog-footer">{props.children}</div>
|
|
18
25
|
}
|
|
19
26
|
|
|
27
|
+
export function DialogBody(props: ParentProps & { class?: ComponentProps<"div">["class"] }) {
|
|
28
|
+
const [local] = splitProps(props, ["class", "children"])
|
|
29
|
+
return (
|
|
30
|
+
<div data-slot="dialog-body" class={local.class}>
|
|
31
|
+
{local.children}
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function DialogTitle(props: ParentProps) {
|
|
37
|
+
return <Kobalte.Title data-slot="dialog-header-title">{props.children}</Kobalte.Title>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function DialogTitleGroup(props: DialogTitleGroupProps) {
|
|
41
|
+
const title = children(() => props.title)
|
|
42
|
+
const description = children(() => props.description)
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div data-slot="dialog-title-group">
|
|
46
|
+
<Show when={title()}>{(t) => <Kobalte.Title data-slot="dialog-title">{t()}</Kobalte.Title>}</Show>
|
|
47
|
+
<Kobalte.Description data-slot="dialog-description">{description()}</Kobalte.Description>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function DialogHeader(props: DialogHeaderProps) {
|
|
53
|
+
const [local] = splitProps(props, ["closeLabel", "hideClose", "children"])
|
|
54
|
+
const hideClose = () => local.hideClose === true
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div data-slot="dialog-header" data-hide-close={hideClose() ? "" : undefined}>
|
|
58
|
+
{local.children}
|
|
59
|
+
{!hideClose() && (
|
|
60
|
+
<Kobalte.CloseButton data-slot="dialog-close-button" aria-label={local.closeLabel ?? "Close"}>
|
|
61
|
+
<svg
|
|
62
|
+
width="16"
|
|
63
|
+
height="16"
|
|
64
|
+
viewBox="0 0 16 16"
|
|
65
|
+
fill="none"
|
|
66
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
67
|
+
aria-hidden="true"
|
|
68
|
+
>
|
|
69
|
+
<path
|
|
70
|
+
d="M12.4446 3.55469L3.55566 12.4436M3.55566 3.55469L12.4446 12.4436"
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
stroke-linejoin="round"
|
|
73
|
+
/>
|
|
74
|
+
</svg>
|
|
75
|
+
</Kobalte.CloseButton>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
20
81
|
export function Dialog(props: DialogProps) {
|
|
21
|
-
const [local] = splitProps(props, [
|
|
22
|
-
"title",
|
|
23
|
-
"description",
|
|
24
|
-
"action",
|
|
25
|
-
"size",
|
|
26
|
-
"variant",
|
|
27
|
-
"class",
|
|
28
|
-
"classList",
|
|
29
|
-
"fit",
|
|
30
|
-
"children",
|
|
31
|
-
])
|
|
32
|
-
const title = children(() => local.title)
|
|
33
|
-
const description = children(() => local.description)
|
|
34
|
-
const action = children(() => local.action)
|
|
35
|
-
const hasHeader = () => title() || action()
|
|
82
|
+
const [local] = splitProps(props, ["size", "variant", "class", "classList", "fit", "children"])
|
|
36
83
|
|
|
37
84
|
return (
|
|
38
85
|
<div
|
|
@@ -44,7 +91,6 @@ export function Dialog(props: DialogProps) {
|
|
|
44
91
|
<div data-slot="dialog-container">
|
|
45
92
|
<Kobalte.Content
|
|
46
93
|
data-slot="dialog-content"
|
|
47
|
-
data-no-header={!hasHeader() ? "" : undefined}
|
|
48
94
|
classList={{
|
|
49
95
|
...local.classList,
|
|
50
96
|
[local.class ?? ""]: !!local.class,
|
|
@@ -58,34 +104,7 @@ export function Dialog(props: DialogProps) {
|
|
|
58
104
|
}
|
|
59
105
|
}}
|
|
60
106
|
>
|
|
61
|
-
|
|
62
|
-
<div data-slot="dialog-header">
|
|
63
|
-
<div data-slot="dialog-title-group">
|
|
64
|
-
<Show when={title()}>{(t) => <Kobalte.Title data-slot="dialog-title">{t()}</Kobalte.Title>}</Show>
|
|
65
|
-
<Show when={description()}>
|
|
66
|
-
{(d) => <Kobalte.Description data-slot="dialog-description">{d()}</Kobalte.Description>}
|
|
67
|
-
</Show>
|
|
68
|
-
</div>
|
|
69
|
-
<Show when={action()}>{(a) => a()}</Show>
|
|
70
|
-
<Kobalte.CloseButton data-slot="dialog-close-button" aria-label="Close">
|
|
71
|
-
<svg
|
|
72
|
-
width="16"
|
|
73
|
-
height="16"
|
|
74
|
-
viewBox="0 0 16 16"
|
|
75
|
-
fill="none"
|
|
76
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
-
aria-hidden="true"
|
|
78
|
-
>
|
|
79
|
-
<path
|
|
80
|
-
d="M12.4446 3.55469L3.55566 12.4436M3.55566 3.55469L12.4446 12.4436"
|
|
81
|
-
stroke="currentColor"
|
|
82
|
-
stroke-linejoin="round"
|
|
83
|
-
/>
|
|
84
|
-
</svg>
|
|
85
|
-
</Kobalte.CloseButton>
|
|
86
|
-
</div>
|
|
87
|
-
</Show>
|
|
88
|
-
<div data-slot="dialog-body">{local.children}</div>
|
|
107
|
+
{local.children}
|
|
89
108
|
</Kobalte.Content>
|
|
90
109
|
</div>
|
|
91
110
|
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentProps, splitProps } from "solid-js"
|
|
2
|
+
import "./divider-v2.css"
|
|
3
|
+
|
|
4
|
+
export interface DividerV2Props extends ComponentProps<"div"> {}
|
|
5
|
+
|
|
6
|
+
export function DividerV2(props: DividerV2Props) {
|
|
7
|
+
const [local, rest] = splitProps(props, ["class", "classList"])
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
{...rest}
|
|
11
|
+
role="separator"
|
|
12
|
+
aria-orientation="horizontal"
|
|
13
|
+
data-component="divider-v2"
|
|
14
|
+
classList={{
|
|
15
|
+
...local.classList,
|
|
16
|
+
[local.class ?? ""]: !!local.class,
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|