@opencode-ai/ui 1.18.11 → 1.18.13
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/context/i18n.d.ts +10 -1
- package/dist/context/marked-parser.d.ts +2 -0
- package/dist/context/marked-theme-register.d.ts +1 -0
- package/dist/context/marked-theme.d.ts +2 -0
- package/dist/context/marked.d.ts +2 -9
- package/dist/i18n/ar.d.ts +38 -0
- package/dist/i18n/az.d.ts +1 -0
- package/dist/i18n/br.d.ts +26 -0
- package/dist/i18n/bs.d.ts +26 -0
- package/dist/i18n/da.d.ts +22 -0
- package/dist/i18n/de.d.ts +22 -0
- package/dist/i18n/es.d.ts +26 -0
- package/dist/i18n/fi.d.ts +1 -0
- package/dist/i18n/fr.d.ts +26 -0
- package/dist/i18n/hi.d.ts +1 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n/it.d.ts +1 -0
- package/dist/i18n/ja.d.ts +22 -0
- package/dist/i18n/ko.d.ts +22 -0
- package/dist/i18n/nl.d.ts +1 -0
- package/dist/i18n/pa.d.ts +1 -0
- package/dist/i18n/pl.d.ts +30 -0
- package/dist/i18n/ru.d.ts +30 -0
- package/dist/i18n/sv.d.ts +1 -0
- package/dist/i18n/th.d.ts +22 -0
- package/dist/i18n/tr.d.ts +22 -0
- package/dist/i18n/ur.d.ts +1 -0
- package/dist/i18n/vi.d.ts +1 -0
- package/dist/i18n/zh.d.ts +22 -0
- package/dist/i18n/zht.d.ts +22 -0
- package/package.json +2 -3
- package/src/components/diff-changes.css +2 -0
- package/src/components/dropdown-menu.css +2 -2
- package/src/components/icon.css +5 -0
- package/src/components/icon.tsx +12 -1
- package/src/components/provider-icons/sprite.svg +2 -27
- package/src/components/resize-handle.css +14 -2
- package/src/components/resize-handle.tsx +5 -1
- package/src/components/scroll-view.css +1 -1
- package/src/components/select.css +5 -3
- package/src/components/switch.css +4 -0
- package/src/components/tabs.css +54 -26
- package/src/components/tabs.tsx +1 -0
- package/src/components/text-field.css +2 -2
- package/src/components/toast.css +1 -1
- package/src/context/i18n.tsx +38 -2
- package/src/context/marked-parser.tsx +68 -0
- package/src/context/marked-theme-register.tsx +10 -0
- package/src/context/marked-theme.tsx +372 -0
- package/src/context/marked.tsx +20 -562
- package/src/i18n/ar.ts +62 -22
- package/src/i18n/az.ts +197 -0
- package/src/i18n/br.ts +34 -6
- package/src/i18n/bs.ts +51 -23
- package/src/i18n/da.ts +36 -12
- package/src/i18n/de.ts +58 -36
- package/src/i18n/en.ts +24 -0
- package/src/i18n/es.ts +45 -17
- package/src/i18n/fi.ts +197 -0
- package/src/i18n/fr.ts +51 -21
- package/src/i18n/hi.ts +199 -0
- package/src/i18n/id.ts +219 -0
- package/src/i18n/it.ts +202 -0
- package/src/i18n/ja.ts +29 -5
- package/src/i18n/ko.ts +36 -12
- package/src/i18n/nl.ts +197 -0
- package/src/i18n/no.ts +47 -23
- package/src/i18n/pa.ts +198 -0
- package/src/i18n/pl.ts +57 -24
- package/src/i18n/ru.ts +55 -23
- package/src/i18n/sv.ts +197 -0
- package/src/i18n/th.ts +44 -21
- package/src/i18n/tr.ts +49 -25
- package/src/i18n/uk.ts +47 -15
- package/src/i18n/ur.ts +198 -0
- package/src/i18n/vi.ts +197 -0
- package/src/i18n/zh.ts +52 -29
- package/src/i18n/zht.ts +45 -22
- package/src/theme/themes/oc-2.json +4 -2
- package/src/v2/components/dialog-v2.css +2 -2
- package/src/v2/components/dialog-v2.tsx +3 -1
- package/src/v2/components/diff-changes-v2.css +2 -0
- package/src/v2/components/file-tree-v2.css +6 -2
- package/src/v2/components/inline-input-v2.tsx +3 -1
- package/src/v2/components/line-comment-v2.css +1 -1
- package/src/v2/components/line-comment-v2.tsx +6 -4
- package/src/v2/components/select-v2.css +16 -5
- package/src/v2/components/switch-v2.css +8 -0
- package/src/v2/components/tabs-v2.css +4 -4
- package/src/v2/components/tabs-v2.tsx +4 -2
- package/src/v2/components/text-input-v2.css +7 -5
- package/src/v2/components/text-input-v2.tsx +7 -1
- package/src/v2/components/toast-v2.tsx +8 -4
- package/dist/context/marked-code-span.d.ts +0 -10
- package/src/context/marked-code-span.ts +0 -17
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Tabs as Kobalte } from "@kobalte/core/tabs"
|
|
2
2
|
import { Show, splitProps, type JSX } from "solid-js"
|
|
3
3
|
import type { ComponentProps, ParentProps, Component } from "solid-js"
|
|
4
|
+
import { useI18n } from "../../context/i18n"
|
|
4
5
|
import "./tabs-v2.css"
|
|
5
6
|
|
|
6
7
|
export interface TabsV2Props extends ComponentProps<typeof Kobalte> {
|
|
@@ -74,7 +75,7 @@ function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
|
|
|
74
75
|
{split.children}
|
|
75
76
|
<Show when={split.subtext}>
|
|
76
77
|
{(subtext) => (
|
|
77
|
-
<span data-slot="tabs-v2-subtext" class="
|
|
78
|
+
<span data-slot="tabs-v2-subtext" class="ms-2 text-xs text-text-weak">
|
|
78
79
|
{subtext()}
|
|
79
80
|
</span>
|
|
80
81
|
)}
|
|
@@ -86,12 +87,13 @@ function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
function TabsV2CloseButton(props: TabsV2CloseButtonProps) {
|
|
90
|
+
const i18n = useI18n()
|
|
89
91
|
const [split, rest] = splitProps(props, ["class", "classList", "onClick"])
|
|
90
92
|
return (
|
|
91
93
|
<div
|
|
92
94
|
role="button"
|
|
93
95
|
tabindex={0}
|
|
94
|
-
aria-label="
|
|
96
|
+
aria-label={i18n.t("ui.tabs.close")}
|
|
95
97
|
data-slot="tabs-v2-close-button"
|
|
96
98
|
{...rest}
|
|
97
99
|
classList={{
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
align-items: stretch;
|
|
6
|
-
padding: 0
|
|
6
|
+
padding-block: 0;
|
|
7
|
+
padding-inline: 0 8px;
|
|
7
8
|
gap: 8px;
|
|
8
9
|
width: 280px;
|
|
9
10
|
height: 28px;
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
flex: none;
|
|
65
66
|
align-items: center;
|
|
66
67
|
justify-content: center;
|
|
67
|
-
padding-
|
|
68
|
+
padding-inline-start: 8px;
|
|
68
69
|
color: var(--v2-icon-icon-muted);
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
[data-component="text-input-v2"][data-leading-icon] [data-slot="text-input-v2-input"] {
|
|
77
|
-
padding-
|
|
78
|
+
padding-inline-start: 0;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
[data-component="text-input-v2"] [data-slot="text-input-v2-input"] {
|
|
@@ -82,7 +83,8 @@
|
|
|
82
83
|
width: 100%;
|
|
83
84
|
min-width: 0;
|
|
84
85
|
height: 100%;
|
|
85
|
-
padding: 0
|
|
86
|
+
padding-block: 0;
|
|
87
|
+
padding-inline: 8px 0;
|
|
86
88
|
margin: 0;
|
|
87
89
|
border: 0;
|
|
88
90
|
background: transparent;
|
|
@@ -165,7 +167,7 @@
|
|
|
165
167
|
height: 28px;
|
|
166
168
|
padding: 0;
|
|
167
169
|
border-radius: 6px;
|
|
168
|
-
margin-
|
|
170
|
+
margin-inline-end: -8px;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
[data-component="text-input-v2"][data-invalid]:not([data-disabled]) [data-slot="text-input-v2-input"] {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
|
|
2
2
|
import { Icon } from "./icon"
|
|
3
|
+
import { useI18n } from "../../context/i18n"
|
|
3
4
|
import "./text-input-v2.css"
|
|
4
5
|
|
|
5
6
|
export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type"> {
|
|
@@ -25,6 +26,7 @@ export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type">
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export function TextInputV2(props: TextInputV2Props) {
|
|
29
|
+
const i18n = useI18n()
|
|
28
30
|
const [local, inputProps] = splitProps(props, [
|
|
29
31
|
"class",
|
|
30
32
|
"classList",
|
|
@@ -71,7 +73,11 @@ export function TextInputV2(props: TextInputV2Props) {
|
|
|
71
73
|
type="button"
|
|
72
74
|
data-slot="text-input-v2-icon-button"
|
|
73
75
|
data-variant={local.showClearButton ? "clear" : "copy"}
|
|
74
|
-
aria-label={
|
|
76
|
+
aria-label={
|
|
77
|
+
local.showClearButton
|
|
78
|
+
? (local.clearLabel ?? i18n.t("ui.common.clear"))
|
|
79
|
+
: (local.copyLabel ?? i18n.t("ui.message.copy"))
|
|
80
|
+
}
|
|
75
81
|
disabled={local.disabled}
|
|
76
82
|
onMouseDown={(event) => {
|
|
77
83
|
if (!local.showClearButton) return
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Toaster, toast, type ToasterProps } from "solid-sonner"
|
|
2
|
+
import { isRTL } from "@kobalte/core/i18n"
|
|
2
3
|
import type { ComponentProps, JSX } from "solid-js"
|
|
3
4
|
import { createContext, onCleanup, onMount, splitProps, useContext } from "solid-js"
|
|
4
5
|
import { Portal } from "solid-js/web"
|
|
6
|
+
import { useI18n } from "../../context/i18n"
|
|
5
7
|
import "./button-v2.css"
|
|
6
8
|
import "./toast-v2.css"
|
|
7
9
|
|
|
8
10
|
export interface ToastV2RegionProps extends ToasterProps {}
|
|
9
11
|
|
|
10
12
|
function ToastV2Region(props: ToastV2RegionProps) {
|
|
13
|
+
const i18n = useI18n()
|
|
11
14
|
const [local, rest] = splitProps(props, ["class", "className", "style", "toastOptions", "swipeDirections"])
|
|
12
15
|
onMount(() => {
|
|
13
16
|
const sync = () => {
|
|
@@ -44,8 +47,8 @@ function ToastV2Region(props: ToastV2RegionProps) {
|
|
|
44
47
|
return (
|
|
45
48
|
<Portal>
|
|
46
49
|
<Toaster
|
|
47
|
-
position="bottom-right"
|
|
48
|
-
offset={{ right: 32, bottom: 48 }}
|
|
50
|
+
position={isRTL(i18n.locale()) ? "bottom-left" : "bottom-right"}
|
|
51
|
+
offset={isRTL(i18n.locale()) ? { left: 32, bottom: 48 } : { right: 32, bottom: 48 }}
|
|
49
52
|
mobileOffset={16}
|
|
50
53
|
gap={12}
|
|
51
54
|
duration={5000}
|
|
@@ -56,7 +59,7 @@ function ToastV2Region(props: ToastV2RegionProps) {
|
|
|
56
59
|
...local.toastOptions,
|
|
57
60
|
unstyled: true,
|
|
58
61
|
closeButton: true,
|
|
59
|
-
closeButtonAriaLabel: local.toastOptions?.closeButtonAriaLabel ?? "
|
|
62
|
+
closeButtonAriaLabel: local.toastOptions?.closeButtonAriaLabel ?? i18n.t("ui.common.dismiss"),
|
|
60
63
|
}}
|
|
61
64
|
{...rest}
|
|
62
65
|
/>
|
|
@@ -96,13 +99,14 @@ function ToastV2Actions(props: ComponentProps<"div">) {
|
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
function ToastV2CloseButton(props: ComponentProps<"button">) {
|
|
102
|
+
const i18n = useI18n()
|
|
99
103
|
const toastId = useContext(ToastV2Context)
|
|
100
104
|
const [local, rest] = splitProps(props, ["children", "onClick"])
|
|
101
105
|
return (
|
|
102
106
|
<button
|
|
103
107
|
type="button"
|
|
104
108
|
data-slot="toast-v2-close-button"
|
|
105
|
-
aria-label="
|
|
109
|
+
aria-label={i18n.t("ui.common.dismiss")}
|
|
106
110
|
{...rest}
|
|
107
111
|
onClick={(event) => {
|
|
108
112
|
if (typeof local.onClick === "function") local.onClick(event)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { MarkedExtension } from "marked"
|
|
2
|
-
|
|
3
|
-
// Keep adjacent tilde and backtick runs separate until markedjs/marked#4011 is released.
|
|
4
|
-
export const markedCodeSpanBoundary = {
|
|
5
|
-
tokenizer: {
|
|
6
|
-
inlineText(src) {
|
|
7
|
-
const match = /^(`+(?=~)|~+(?=`))/.exec(src)
|
|
8
|
-
if (!match) return false
|
|
9
|
-
return {
|
|
10
|
-
type: "text",
|
|
11
|
-
raw: match[0],
|
|
12
|
-
text: match[0],
|
|
13
|
-
escaped: this.lexer.state.inRawBlock,
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
} satisfies MarkedExtension
|