@opencode-ai/ui 0.0.0-dev-17913 → 0.0.0-dev-202608221251
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/{data-display/accordion → components}/accordion.d.ts +6 -6
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/card.d.ts +1 -1
- package/dist/{forms/checkbox → components}/checkbox.d.ts +2 -2
- package/dist/components/dialog.d.ts +12 -0
- package/dist/{data-display/diff-changes → components}/diff-changes.d.ts +1 -2
- package/dist/components/dropdown-menu.d.ts +80 -0
- package/dist/components/icon-button.d.ts +10 -0
- package/dist/{icons/icon/additional-icons.d.ts → components/icon.d.ts} +8 -8
- package/dist/components/keybind.d.ts +6 -0
- package/dist/components/list.d.ts +1 -1
- package/dist/{feedback/progress-circle → components}/progress-circle.d.ts +0 -2
- package/dist/components/radio-group.d.ts +16 -0
- package/dist/components/scroll-view.d.ts +3 -3
- package/dist/components/select.d.ts +21 -0
- package/dist/{forms/switch → components}/switch.d.ts +2 -4
- package/dist/{navigation/tabs → components}/tabs.d.ts +8 -15
- package/dist/components/tag.d.ts +5 -0
- package/dist/{typography/text-shimmer → components}/text-shimmer.d.ts +0 -1
- package/dist/components/toast.d.ts +56 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/context/i18n.d.ts +7 -10
- package/dist/i18n/ar.d.ts +2 -0
- package/dist/i18n/bg.d.ts +2 -0
- package/dist/i18n/br.d.ts +2 -0
- package/dist/i18n/bs.d.ts +2 -0
- package/dist/i18n/da.d.ts +2 -0
- package/dist/i18n/de.d.ts +2 -0
- package/dist/i18n/en.d.ts +1 -218
- package/dist/i18n/es.d.ts +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/ja.d.ts +2 -0
- package/dist/i18n/km.d.ts +2 -0
- package/dist/i18n/ko.d.ts +2 -0
- package/dist/i18n/lo.d.ts +2 -0
- package/dist/i18n/mk.d.ts +2 -0
- package/dist/i18n/mn.d.ts +2 -0
- package/dist/i18n/my.d.ts +2 -0
- package/dist/i18n/pl.d.ts +2 -0
- package/dist/i18n/ru.d.ts +2 -0
- package/dist/i18n/sr.d.ts +2 -0
- package/dist/i18n/tg.d.ts +2 -0
- package/dist/i18n/th.d.ts +2 -0
- package/dist/i18n/tr.d.ts +2 -0
- package/dist/i18n/zh.d.ts +2 -0
- package/dist/i18n/zht.d.ts +2 -0
- package/dist/v2/components/accordion-v2.d.ts +26 -0
- package/dist/{data-display/avatar/avatar.d.ts → v2/components/avatar-v2.d.ts} +1 -1
- package/dist/v2/components/badge-v2.d.ts +6 -0
- package/dist/v2/components/button-v2.d.ts +10 -0
- package/dist/v2/components/checkbox-v2.d.ts +10 -0
- package/dist/{overlays/dialog/dialog.d.ts → v2/components/dialog-v2.d.ts} +2 -1
- package/dist/v2/components/diff-changes-v2.d.ts +11 -0
- package/dist/v2/components/divider-v2.d.ts +5 -0
- package/dist/{forms/field/field.d.ts → v2/components/field-v2.d.ts} +10 -4
- package/dist/v2/components/icon-button-v2.d.ts +11 -0
- package/dist/{icons/icon → v2/components}/icon.d.ts +1 -20
- package/dist/v2/components/inline-input-v2.d.ts +21 -0
- package/dist/v2/components/keybind-v2.d.ts +7 -0
- package/dist/{data-display/line-comment/line-comment.d.ts → v2/components/line-comment-v2.d.ts} +9 -9
- package/dist/v2/components/loader-v2.d.ts +3 -0
- package/dist/v2/components/menu-v2.d.ts +52 -0
- package/dist/v2/components/progress-circle-v2.d.ts +8 -0
- package/dist/{data-display/project-avatar/project-avatar.d.ts → v2/components/project-avatar-v2.d.ts} +1 -1
- package/dist/v2/components/radio-v2.d.ts +16 -0
- package/dist/{navigation/segmented-control/segmented-control.d.ts → v2/components/segmented-control-v2.d.ts} +5 -5
- package/dist/{forms/select/select.d.ts → v2/components/select-v2.d.ts} +6 -4
- package/dist/v2/components/split-button-v2.d.ts +5 -0
- package/dist/v2/components/switch-v2.d.ts +7 -0
- package/dist/v2/components/tabs-v2.d.ts +34 -0
- package/dist/{forms/text-input/text-input.d.ts → v2/components/text-input-v2.d.ts} +3 -3
- package/dist/v2/components/text-shimmer-v2.d.ts +9 -0
- package/dist/v2/components/textarea-v2.d.ts +7 -0
- package/dist/v2/components/toast-v2.d.ts +57 -0
- package/dist/v2/components/tooltip-v2.d.ts +13 -0
- package/dist/v2/components/wordmark-v2.d.ts +2 -0
- package/package.json +13 -131
- package/src/{data-display/accordion → components}/accordion.css +26 -1
- package/src/{data-display/accordion → components}/accordion.tsx +14 -14
- package/src/components/animated-number.css +11 -29
- package/src/components/animated-number.tsx +2 -2
- package/src/components/avatar.css +49 -0
- package/src/components/avatar.tsx +55 -0
- package/src/components/button.css +194 -0
- package/src/{actions/button → components}/button.tsx +11 -10
- package/src/components/card.css +23 -2
- package/src/components/card.tsx +4 -4
- package/src/{forms/checkbox → components}/checkbox.css +7 -1
- package/src/{forms/checkbox → components}/checkbox.tsx +13 -13
- package/src/components/collapsible.tsx +2 -2
- package/src/components/dialog.css +181 -0
- package/src/components/dialog.tsx +72 -0
- package/src/{data-display/diff-changes → components}/diff-changes.css +19 -22
- package/src/components/diff-changes.tsx +115 -0
- package/src/components/dock-surface.css +9 -2
- package/src/components/dropdown-menu.css +135 -0
- package/src/components/dropdown-menu.tsx +308 -0
- package/src/components/icon-button.css +181 -0
- package/src/components/icon-button.tsx +29 -0
- package/src/components/icon.css +39 -0
- package/src/{icons/icon/additional-icons.ts → components/icon.tsx} +74 -8
- package/src/components/image-preview.tsx +2 -3
- package/src/components/keybind.css +18 -0
- package/src/components/keybind.tsx +20 -0
- package/src/components/list.css +5 -5
- package/src/components/list.tsx +5 -7
- package/src/components/popover.tsx +2 -3
- package/src/components/progress-circle.css +16 -0
- package/src/components/progress-circle.tsx +64 -0
- package/src/components/provider-icon.tsx +1 -1
- package/src/components/radio-group.css +187 -0
- package/src/components/radio-group.tsx +83 -0
- package/src/components/scroll-view.tsx +20 -5
- package/src/components/select.css +201 -0
- package/src/components/select.tsx +174 -0
- package/src/components/sticky-accordion-header.tsx +1 -1
- package/src/components/switch.css +136 -0
- package/src/components/switch.tsx +29 -0
- package/src/{navigation/tabs → components}/tabs.css +229 -39
- package/src/components/tabs.tsx +126 -0
- package/src/components/tag.css +37 -0
- package/src/components/tag.tsx +22 -0
- package/src/components/text-field.tsx +4 -12
- package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
- package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
- package/src/components/toast.css +236 -0
- package/src/components/toast.tsx +185 -0
- package/src/components/tooltip.css +74 -0
- package/src/components/tooltip.tsx +163 -0
- package/src/context/i18n.tsx +14 -17
- package/src/hooks/create-auto-scroll.tsx +0 -20
- package/src/i18n/am.ts +2 -0
- package/src/i18n/ar.ts +2 -0
- package/src/i18n/az.ts +2 -0
- package/src/i18n/bg.ts +2 -0
- package/src/i18n/bn.ts +2 -0
- package/src/i18n/br.ts +2 -0
- package/src/i18n/bs.ts +2 -0
- package/src/i18n/ca.ts +2 -0
- package/src/i18n/cs.ts +2 -0
- package/src/i18n/da.ts +2 -0
- package/src/i18n/de.ts +2 -0
- package/src/i18n/dv.ts +2 -0
- package/src/i18n/dz.ts +2 -0
- package/src/i18n/el.ts +2 -0
- package/src/i18n/en.ts +4 -27
- package/src/i18n/es.ts +2 -0
- package/src/i18n/et.ts +2 -0
- package/src/i18n/fa.ts +2 -0
- package/src/i18n/fi.ts +2 -0
- package/src/i18n/fo.ts +2 -0
- package/src/i18n/fr.ts +2 -0
- package/src/i18n/hi.ts +2 -0
- package/src/i18n/hr.ts +2 -0
- package/src/i18n/hu.ts +2 -0
- package/src/i18n/hy.ts +2 -0
- package/src/i18n/id.ts +2 -0
- package/src/i18n/is.ts +2 -0
- package/src/i18n/it.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ka.ts +2 -0
- package/src/i18n/km.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/lo.ts +2 -0
- package/src/i18n/lt.ts +2 -0
- package/src/i18n/lv.ts +2 -0
- package/src/i18n/mk.ts +2 -0
- package/src/i18n/mn.ts +2 -0
- package/src/i18n/ms.ts +2 -0
- package/src/i18n/my.ts +2 -0
- package/src/i18n/ne.ts +2 -0
- package/src/i18n/nl.ts +2 -0
- package/src/i18n/no.ts +2 -0
- package/src/i18n/pa.ts +2 -0
- package/src/i18n/pl.ts +2 -0
- package/src/i18n/ro.ts +2 -0
- package/src/i18n/ru.ts +2 -0
- package/src/i18n/si.ts +2 -0
- package/src/i18n/sk.ts +2 -0
- package/src/i18n/sl.ts +2 -0
- package/src/i18n/sq.ts +2 -0
- package/src/i18n/sr.ts +2 -0
- package/src/i18n/sv.ts +2 -0
- package/src/i18n/tg.ts +2 -0
- package/src/i18n/th.ts +2 -0
- package/src/i18n/tk.ts +2 -0
- package/src/i18n/tr.ts +2 -0
- package/src/i18n/uk.ts +2 -0
- package/src/i18n/ur.ts +2 -0
- package/src/i18n/uz.ts +2 -0
- package/src/i18n/vi.ts +2 -0
- package/src/i18n/zh.ts +2 -0
- package/src/i18n/zht.ts +2 -0
- package/src/styles/index.css +20 -4
- package/src/styles/tailwind/colors.css +0 -1
- package/src/styles/tailwind/index.css +1 -15
- package/src/theme/context.tsx +11 -19
- package/src/theme/themes/oc-2.json +1 -3
- package/src/theme/v2/foreground.ts +0 -1
- package/src/v2/components/accordion-v2.css +139 -0
- package/src/v2/components/accordion-v2.tsx +86 -0
- package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
- package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
- package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
- package/src/v2/components/button-v2.tsx +35 -0
- package/src/v2/components/checkbox-v2.css +184 -0
- package/src/v2/components/checkbox-v2.tsx +65 -0
- package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
- package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
- package/src/v2/components/diff-changes-v2.css +26 -0
- package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
- package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
- package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
- package/src/v2/components/icon-button-v2.tsx +37 -0
- package/src/{icons/icon → v2/components}/icon.tsx +9 -46
- package/src/v2/components/inline-input-v2.css +225 -0
- package/src/v2/components/inline-input-v2.tsx +107 -0
- package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
- package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
- package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
- package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
- package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +0 -121
- package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
- package/src/v2/components/progress-circle-v2.css +13 -0
- package/src/v2/components/progress-circle-v2.tsx +52 -0
- package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
- package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
- package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
- package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
- package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -38
- package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
- package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
- package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
- package/src/v2/components/switch-v2.tsx +28 -0
- package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +9 -24
- package/src/v2/components/tabs-v2.tsx +149 -0
- package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
- package/src/v2/components/text-shimmer-v2.css +125 -0
- package/src/v2/components/text-shimmer-v2.tsx +63 -0
- package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
- package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
- package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
- package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +14 -21
- package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
- package/src/{styles/tokens → v2/styles}/theme.css +12 -4
- package/dist/actions/button/button.d.ts +0 -10
- package/dist/actions/icon-button/icon-button.d.ts +0 -11
- package/dist/actions/split-button/split-button.d.ts +0 -5
- package/dist/data-display/badge/badge.d.ts +0 -7
- package/dist/data-display/keybind/keybind.d.ts +0 -7
- package/dist/feedback/loader/loader.d.ts +0 -3
- package/dist/feedback/toast/toast.d.ts +0 -57
- package/dist/forms/radio/radio.d.ts +0 -16
- package/dist/forms/textarea/textarea.d.ts +0 -7
- package/dist/i18n/he.d.ts +0 -197
- package/dist/layout/divider/divider.d.ts +0 -5
- package/dist/navigation/menu/menu.d.ts +0 -59
- package/dist/overlays/tooltip/tooltip.d.ts +0 -15
- package/dist/typography/wordmark/wordmark.d.ts +0 -2
- package/src/actions/icon-button/icon-button.tsx +0 -32
- package/src/feedback/progress-circle/progress-circle.css +0 -28
- package/src/feedback/progress-circle/progress-circle.tsx +0 -64
- package/src/forms/switch/switch.tsx +0 -34
- package/src/i18n/he.ts +0 -199
- package/src/icons/icon/icon.css +0 -3
- package/src/navigation/tabs/tabs.tsx +0 -194
- /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
- /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
- /package/src/{forms/inline-input → components}/inline-input.css +0 -0
- /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
- /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
- /package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -0
- /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
- /package/src/{forms/field/field.css → v2/components/field-v2.css} +0 -0
- /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
- /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
- /package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +0 -0
- /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
- /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
- /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
- /package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +0 -0
- /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
- /package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +0 -0
- /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
- /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
- /package/src/{styles/tokens → v2/styles}/colors.css +0 -0
- /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[data-component="keybind"] {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
height: 20px;
|
|
7
|
+
padding: 0 8px;
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
background: var(--surface-base);
|
|
10
|
+
box-shadow: var(--shadow-xxs-border);
|
|
11
|
+
|
|
12
|
+
/* text-12-regular */
|
|
13
|
+
font-family: var(--font-family-sans);
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
font-weight: var(--font-weight-regular);
|
|
16
|
+
line-height: 1;
|
|
17
|
+
color: var(--text-weak);
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentProps, ParentProps } from "solid-js"
|
|
2
|
+
|
|
3
|
+
export interface KeybindProps extends ParentProps {
|
|
4
|
+
class?: string
|
|
5
|
+
classList?: ComponentProps<"span">["classList"]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function Keybind(props: KeybindProps) {
|
|
9
|
+
return (
|
|
10
|
+
<span
|
|
11
|
+
data-component="keybind"
|
|
12
|
+
classList={{
|
|
13
|
+
...props.classList,
|
|
14
|
+
[props.class ?? ""]: !!props.class,
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
{props.children}
|
|
18
|
+
</span>
|
|
19
|
+
)
|
|
20
|
+
}
|
package/src/components/list.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
align-self: stretch;
|
|
32
32
|
margin-bottom: 4px;
|
|
33
33
|
|
|
34
|
-
> [data-component="icon-button
|
|
34
|
+
> [data-component="icon-button"] {
|
|
35
35
|
width: 24px;
|
|
36
36
|
height: 24px;
|
|
37
37
|
flex-shrink: 0;
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
> [data-component="icon-button
|
|
86
|
+
> [data-component="icon-button"] {
|
|
87
87
|
width: 20px;
|
|
88
88
|
height: 20px;
|
|
89
89
|
background-color: transparent;
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
> [data-component="icon-button
|
|
109
|
+
> [data-component="icon-button"] {
|
|
110
110
|
background-color: transparent;
|
|
111
111
|
|
|
112
112
|
&:hover:not(:disabled),
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
justify-content: center;
|
|
253
253
|
flex-shrink: 0;
|
|
254
254
|
aspect-ratio: 1/1;
|
|
255
|
-
[data-
|
|
255
|
+
[data-component="icon"] {
|
|
256
256
|
color: var(--icon-strong-base);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
justify-content: center;
|
|
263
263
|
flex-shrink: 0;
|
|
264
264
|
aspect-ratio: 1/1;
|
|
265
|
-
[data-
|
|
265
|
+
[data-component="icon"] {
|
|
266
266
|
color: var(--icon-strong-base);
|
|
267
267
|
}
|
|
268
268
|
}
|
package/src/components/list.tsx
CHANGED
|
@@ -3,8 +3,8 @@ import { createEffect, For, type JSX, on, Show } from "solid-js"
|
|
|
3
3
|
import { createStore } from "solid-js/store"
|
|
4
4
|
import { makeEventListener } from "@solid-primitives/event-listener"
|
|
5
5
|
import { useI18n } from "../context/i18n"
|
|
6
|
-
import { Icon, type IconProps } from "
|
|
7
|
-
import { IconButton } from "
|
|
6
|
+
import { Icon, type IconProps } from "./icon"
|
|
7
|
+
import { IconButton } from "./icon-button"
|
|
8
8
|
import { TextField } from "./text-field"
|
|
9
9
|
|
|
10
10
|
function findByKey(container: HTMLElement, key: string) {
|
|
@@ -302,7 +302,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|
|
302
302
|
</div>
|
|
303
303
|
<Show when={internalFilter()}>
|
|
304
304
|
<IconButton
|
|
305
|
-
icon=
|
|
305
|
+
icon="circle-x"
|
|
306
306
|
variant="ghost"
|
|
307
307
|
onClick={() => {
|
|
308
308
|
setInternalFilter("")
|
|
@@ -367,11 +367,9 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|
|
367
367
|
</span>
|
|
368
368
|
)}
|
|
369
369
|
</Show>
|
|
370
|
-
|
|
371
|
-
when={props.divider && (i() !== group.items.length - 1 || (showAdd() && isLastGroup()))}
|
|
372
|
-
>
|
|
370
|
+
{props.divider && (i() !== group.items.length - 1 || (showAdd() && isLastGroup())) && (
|
|
373
371
|
<span data-slot="list-item-divider" />
|
|
374
|
-
|
|
372
|
+
)}
|
|
375
373
|
</button>
|
|
376
374
|
)
|
|
377
375
|
if (props.itemWrapper) return props.itemWrapper(item, node)
|
|
@@ -3,8 +3,7 @@ import { ComponentProps, JSXElement, ParentProps, Show, createEffect, splitProps
|
|
|
3
3
|
import { createStore } from "solid-js/store"
|
|
4
4
|
import { makeEventListener } from "@solid-primitives/event-listener"
|
|
5
5
|
import { useI18n } from "../context/i18n"
|
|
6
|
-
import {
|
|
7
|
-
import { IconButton } from "@opencode-ai/ui/icon-button"
|
|
6
|
+
import { IconButton } from "./icon-button"
|
|
8
7
|
|
|
9
8
|
export interface PopoverProps<T extends ValidComponent = "div">
|
|
10
9
|
extends ParentProps,
|
|
@@ -123,7 +122,7 @@ export function Popover<T extends ValidComponent = "div">(props: PopoverProps<T>
|
|
|
123
122
|
<Kobalte.CloseButton
|
|
124
123
|
data-slot="popover-close-button"
|
|
125
124
|
as={IconButton}
|
|
126
|
-
icon=
|
|
125
|
+
icon="close"
|
|
127
126
|
variant="ghost"
|
|
128
127
|
aria-label={i18n.t("ui.common.close")}
|
|
129
128
|
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[data-component="progress-circle"] {
|
|
2
|
+
transform: rotate(-90deg);
|
|
3
|
+
|
|
4
|
+
[data-slot="progress-circle-background"] {
|
|
5
|
+
stroke: var(--progress-circle-background, var(--border-weak-base));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-slot="progress-circle-background-overlay"] {
|
|
9
|
+
stroke: var(--progress-circle-background-overlay, transparent);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-slot="progress-circle-progress"] {
|
|
13
|
+
stroke: var(--progress-circle-progress, var(--border-active));
|
|
14
|
+
transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ComponentProps, createMemo, splitProps } from "solid-js"
|
|
2
|
+
|
|
3
|
+
export interface ProgressCircleProps extends Pick<ComponentProps<"svg">, "class" | "classList" | "style"> {
|
|
4
|
+
percentage: number
|
|
5
|
+
size?: number
|
|
6
|
+
strokeWidth?: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function ProgressCircle(props: ProgressCircleProps) {
|
|
10
|
+
const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"])
|
|
11
|
+
|
|
12
|
+
const size = () => split.size || 16
|
|
13
|
+
const strokeWidth = () => split.strokeWidth || 3
|
|
14
|
+
|
|
15
|
+
const viewBoxSize = 16
|
|
16
|
+
const center = viewBoxSize / 2
|
|
17
|
+
const radius = () => center - strokeWidth() / 2
|
|
18
|
+
const circumference = createMemo(() => 2 * Math.PI * radius())
|
|
19
|
+
|
|
20
|
+
const offset = createMemo(() => {
|
|
21
|
+
const clampedPercentage = Math.max(0, Math.min(100, split.percentage || 0))
|
|
22
|
+
const progress = clampedPercentage / 100
|
|
23
|
+
return circumference() * (1 - progress)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<svg
|
|
28
|
+
{...rest}
|
|
29
|
+
width={size()}
|
|
30
|
+
height={size()}
|
|
31
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
32
|
+
fill="none"
|
|
33
|
+
data-component="progress-circle"
|
|
34
|
+
classList={{
|
|
35
|
+
...split.classList,
|
|
36
|
+
[split.class ?? ""]: !!split.class,
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<circle
|
|
40
|
+
cx={center}
|
|
41
|
+
cy={center}
|
|
42
|
+
r={radius()}
|
|
43
|
+
data-slot="progress-circle-background"
|
|
44
|
+
stroke-width={strokeWidth()}
|
|
45
|
+
/>
|
|
46
|
+
<circle
|
|
47
|
+
cx={center}
|
|
48
|
+
cy={center}
|
|
49
|
+
r={radius()}
|
|
50
|
+
data-slot="progress-circle-background-overlay"
|
|
51
|
+
stroke-width={strokeWidth()}
|
|
52
|
+
/>
|
|
53
|
+
<circle
|
|
54
|
+
cx={center}
|
|
55
|
+
cy={center}
|
|
56
|
+
r={radius()}
|
|
57
|
+
data-slot="progress-circle-progress"
|
|
58
|
+
stroke-width={strokeWidth()}
|
|
59
|
+
stroke-dasharray={circumference().toString()}
|
|
60
|
+
stroke-dashoffset={offset()}
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -9,7 +9,7 @@ export type ProviderIconProps = JSX.SVGElementTags["svg"] & {
|
|
|
9
9
|
|
|
10
10
|
export const ProviderIcon: Component<ProviderIconProps> = (props) => {
|
|
11
11
|
const [local, rest] = splitProps(props, ["id", "class", "classList"])
|
|
12
|
-
const resolved = createMemo(() => (iconNames.includes(local.id as IconName) ? local.id : "
|
|
12
|
+
const resolved = createMemo(() => (iconNames.includes(local.id as IconName) ? local.id : "synthetic"))
|
|
13
13
|
return (
|
|
14
14
|
<svg
|
|
15
15
|
data-component="provider-icon"
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
[data-component="radio-group"] {
|
|
2
|
+
--radio-group-height: 28px;
|
|
3
|
+
--radio-group-gap: 4px;
|
|
4
|
+
--radio-group-padding: 2px;
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
|
|
8
|
+
[data-slot="radio-group-wrapper"] {
|
|
9
|
+
all: unset;
|
|
10
|
+
background-color: var(--surface-inset-base);
|
|
11
|
+
border-radius: var(--radius-sm);
|
|
12
|
+
box-shadow: var(--shadow-xxs-border);
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
height: var(--radio-group-height);
|
|
15
|
+
margin: 0;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
padding: 0;
|
|
18
|
+
position: relative;
|
|
19
|
+
width: fit-content;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[data-fill] [data-slot="radio-group-wrapper"] {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-slot="radio-group-items"] {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
gap: var(--radio-group-gap);
|
|
30
|
+
height: 100%;
|
|
31
|
+
list-style: none;
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[data-fill] [data-slot="radio-group-items"] {
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-slot="radio-group-indicator"] {
|
|
41
|
+
background: var(--button-secondary-base);
|
|
42
|
+
border-radius: var(--radius-sm);
|
|
43
|
+
box-shadow: var(--shadow-xs-border-base);
|
|
44
|
+
content: "";
|
|
45
|
+
opacity: var(--indicator-opacity, 1);
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
position: absolute;
|
|
48
|
+
transition:
|
|
49
|
+
opacity 200ms ease-out,
|
|
50
|
+
box-shadow 100ms ease-in-out,
|
|
51
|
+
width 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
|
|
52
|
+
height 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
|
|
53
|
+
transform 300ms cubic-bezier(0.22, 1.2, 0.36, 1);
|
|
54
|
+
will-change: transform;
|
|
55
|
+
z-index: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-slot="radio-group-item"] {
|
|
59
|
+
display: flex;
|
|
60
|
+
height: 100%;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[data-fill] [data-slot="radio-group-item"] {
|
|
66
|
+
flex: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-slot="radio-group-item-input"] {
|
|
70
|
+
border-width: 0;
|
|
71
|
+
clip: rect(0 0 0 0);
|
|
72
|
+
height: 1px;
|
|
73
|
+
margin: -1px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
padding: 0;
|
|
76
|
+
position: absolute;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
width: 1px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-slot="radio-group-item-label"] {
|
|
82
|
+
color: var(--text-weak);
|
|
83
|
+
cursor: default;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
font-family: var(--font-family-sans);
|
|
88
|
+
font-size: var(--font-size-small);
|
|
89
|
+
font-weight: var(--font-weight-medium);
|
|
90
|
+
flex: 1;
|
|
91
|
+
height: 100%;
|
|
92
|
+
line-height: 1;
|
|
93
|
+
padding: var(--radio-group-padding);
|
|
94
|
+
position: relative;
|
|
95
|
+
transition:
|
|
96
|
+
color 200ms ease-out,
|
|
97
|
+
opacity 200ms ease-out;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-slot="radio-group-item-control"] {
|
|
102
|
+
align-items: center;
|
|
103
|
+
border-radius: var(--radius-xs);
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
height: 100%;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
padding: var(--radio-group-control-padding, 0 10px);
|
|
109
|
+
transition: background-color 200ms ease-out;
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&[data-pad="none"] {
|
|
114
|
+
--radio-group-control-padding: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&[data-pad="normal"] {
|
|
118
|
+
--radio-group-control-padding: 0 10px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Checked state */
|
|
122
|
+
[data-slot="radio-group-item-input"][data-checked] + [data-slot="radio-group-item-label"] {
|
|
123
|
+
color: var(--text-strong);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Hover state: match the inset background (adds subtle density) */
|
|
127
|
+
[data-slot="radio-group-item-input"]:not([data-checked], [data-disabled])
|
|
128
|
+
+ [data-slot="radio-group-item-label"]:hover
|
|
129
|
+
[data-slot="radio-group-item-control"] {
|
|
130
|
+
background-color: var(--surface-inset-base);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Do not overlay hover on the active segment */
|
|
134
|
+
[data-slot="radio-group-item-input"][data-checked]
|
|
135
|
+
+ [data-slot="radio-group-item-label"]:hover
|
|
136
|
+
[data-slot="radio-group-item-control"] {
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Disabled state */
|
|
141
|
+
[data-slot="radio-group-item-input"][data-disabled] + [data-slot="radio-group-item-label"] {
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
opacity: 0.5;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Focus state */
|
|
147
|
+
[data-slot="radio-group-wrapper"]:has([data-slot="radio-group-item-input"]:focus-visible)
|
|
148
|
+
[data-slot="radio-group-indicator"] {
|
|
149
|
+
box-shadow: var(--shadow-xs-border-focus);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Hide indicator when nothing is checked */
|
|
153
|
+
[data-slot="radio-group-wrapper"]:not(:has([data-slot="radio-group-item-input"][data-checked]))
|
|
154
|
+
[data-slot="radio-group-indicator"] {
|
|
155
|
+
--indicator-opacity: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Vertical orientation */
|
|
159
|
+
&[aria-orientation="vertical"] [data-slot="radio-group-items"] {
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Small size variant */
|
|
164
|
+
&[data-size="small"] {
|
|
165
|
+
--radio-group-height: 24px;
|
|
166
|
+
--radio-group-gap: 3px;
|
|
167
|
+
--radio-group-padding: 2px;
|
|
168
|
+
|
|
169
|
+
[data-slot="radio-group-item-label"] {
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-slot="radio-group-item-control"] {
|
|
174
|
+
padding: var(--radio-group-control-padding, 0 8px);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&[data-size="small"][data-pad="normal"] {
|
|
179
|
+
--radio-group-control-padding: 0 8px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Disabled root state */
|
|
183
|
+
&[data-disabled] {
|
|
184
|
+
opacity: 0.5;
|
|
185
|
+
cursor: not-allowed;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { SegmentedControl as Kobalte } from "@kobalte/core/segmented-control"
|
|
2
|
+
import { For, splitProps } from "solid-js"
|
|
3
|
+
import type { ComponentProps, JSX } from "solid-js"
|
|
4
|
+
|
|
5
|
+
export type RadioGroupProps<T> = Omit<
|
|
6
|
+
ComponentProps<typeof Kobalte>,
|
|
7
|
+
"value" | "defaultValue" | "onChange" | "children"
|
|
8
|
+
> & {
|
|
9
|
+
options: T[]
|
|
10
|
+
current?: T
|
|
11
|
+
defaultValue?: T
|
|
12
|
+
value?: (x: T) => string
|
|
13
|
+
label?: (x: T) => JSX.Element | string
|
|
14
|
+
onSelect?: (value: T | undefined) => void
|
|
15
|
+
class?: ComponentProps<"div">["class"]
|
|
16
|
+
classList?: ComponentProps<"div">["classList"]
|
|
17
|
+
size?: "small" | "medium"
|
|
18
|
+
fill?: boolean
|
|
19
|
+
pad?: "none" | "normal"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function RadioGroup<T>(props: RadioGroupProps<T>) {
|
|
23
|
+
const [local, others] = splitProps(props, [
|
|
24
|
+
"class",
|
|
25
|
+
"classList",
|
|
26
|
+
"options",
|
|
27
|
+
"current",
|
|
28
|
+
"defaultValue",
|
|
29
|
+
"value",
|
|
30
|
+
"label",
|
|
31
|
+
"onSelect",
|
|
32
|
+
"size",
|
|
33
|
+
"fill",
|
|
34
|
+
"pad",
|
|
35
|
+
])
|
|
36
|
+
|
|
37
|
+
const getValue = (item: T): string => {
|
|
38
|
+
if (local.value) return local.value(item)
|
|
39
|
+
return String(item)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const getLabel = (item: T): JSX.Element | string => {
|
|
43
|
+
if (local.label) return local.label(item)
|
|
44
|
+
return String(item)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const findOption = (v: string): T | undefined => {
|
|
48
|
+
return local.options.find((opt) => getValue(opt) === v)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Kobalte
|
|
53
|
+
{...others}
|
|
54
|
+
data-component="radio-group"
|
|
55
|
+
data-size={local.size ?? "medium"}
|
|
56
|
+
data-fill={local.fill ? "" : undefined}
|
|
57
|
+
data-pad={local.pad ?? "normal"}
|
|
58
|
+
classList={{
|
|
59
|
+
...local.classList,
|
|
60
|
+
[local.class ?? ""]: !!local.class,
|
|
61
|
+
}}
|
|
62
|
+
value={local.current ? getValue(local.current) : undefined}
|
|
63
|
+
defaultValue={local.defaultValue ? getValue(local.defaultValue) : undefined}
|
|
64
|
+
onChange={(v) => local.onSelect?.(findOption(v))}
|
|
65
|
+
>
|
|
66
|
+
<div role="presentation" data-slot="radio-group-wrapper">
|
|
67
|
+
<Kobalte.Indicator data-slot="radio-group-indicator" />
|
|
68
|
+
<div role="presentation" data-slot="radio-group-items">
|
|
69
|
+
<For each={local.options}>
|
|
70
|
+
{(option) => (
|
|
71
|
+
<Kobalte.Item value={getValue(option)} data-slot="radio-group-item" data-value={getValue(option)}>
|
|
72
|
+
<Kobalte.ItemInput data-slot="radio-group-item-input" />
|
|
73
|
+
<Kobalte.ItemLabel data-slot="radio-group-item-label">
|
|
74
|
+
<span data-slot="radio-group-item-control">{getLabel(option)}</span>
|
|
75
|
+
</Kobalte.ItemLabel>
|
|
76
|
+
</Kobalte.Item>
|
|
77
|
+
)}
|
|
78
|
+
</For>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</Kobalte>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createEffect,
|
|
3
|
+
createMemo,
|
|
4
|
+
mergeProps,
|
|
5
|
+
onCleanup,
|
|
6
|
+
onMount,
|
|
7
|
+
Show,
|
|
8
|
+
splitProps,
|
|
9
|
+
type Accessor,
|
|
10
|
+
type ComponentProps,
|
|
11
|
+
} from "solid-js"
|
|
2
12
|
import { Portal } from "solid-js/web"
|
|
3
13
|
import { createResizeObserver } from "@solid-primitives/resize-observer"
|
|
4
14
|
import { createStore } from "solid-js/store"
|
|
@@ -17,9 +27,9 @@ export interface ScrollViewProps extends ComponentProps<"div"> {
|
|
|
17
27
|
* */
|
|
18
28
|
thumbVisibility?: ScrollViewThumbVisibility
|
|
19
29
|
/** Mount the thumb into an external track. Scroll metrics still come from this ScrollView. */
|
|
20
|
-
thumbContainer?: HTMLElement
|
|
30
|
+
thumbContainer?: HTMLElement | Accessor<HTMLElement | undefined>
|
|
21
31
|
/** Element whose hover reveals the thumb. Defaults to the ScrollView root when unset. */
|
|
22
|
-
thumbHoverTarget?: HTMLElement
|
|
32
|
+
thumbHoverTarget?: HTMLElement | Accessor<HTMLElement | undefined>
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
export const scrollKey = (event: Pick<KeyboardEvent, "key" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey">) => {
|
|
@@ -118,8 +128,13 @@ export function ScrollView(props: ScrollViewProps) {
|
|
|
118
128
|
let viewportRef!: HTMLDivElement
|
|
119
129
|
let thumbRef!: HTMLDivElement
|
|
120
130
|
|
|
121
|
-
const
|
|
122
|
-
|
|
131
|
+
const resolveEl = (value: HTMLElement | Accessor<HTMLElement | undefined> | undefined) => {
|
|
132
|
+
if (typeof value === "function") return value()
|
|
133
|
+
return value
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const thumbMount = createMemo(() => resolveEl(local.thumbContainer))
|
|
137
|
+
const thumbHover = createMemo(() => resolveEl(local.thumbHoverTarget))
|
|
123
138
|
const hoverRoot = () => !local.thumbHoverTarget && !local.thumbContainer
|
|
124
139
|
|
|
125
140
|
const [state, setState] = createStore({
|