@opencode-ai/ui 0.0.0-dev-202608040656 → 0.0.0-dev-202608040739
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 +2 -1
- package/package.json +1 -1
- package/src/components/icon.css +5 -0
- package/src/components/icon.tsx +5 -1
- package/src/components/toast.css +1 -1
- package/src/context/i18n.tsx +9 -2
- package/src/i18n/fr.ts +2 -1
- package/src/i18n/pl.ts +2 -1
- package/src/v2/components/toast-v2.tsx +3 -2
package/dist/context/i18n.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export type UiI18n = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function pluralCategory(locale: string, count: number): UiPluralCategory;
|
|
15
15
|
export declare function pluralKey(key: UiI18nPluralKey, category: UiPluralCategory): UiI18nPluralLookupKey;
|
|
16
|
-
|
|
16
|
+
declare function UiI18nProvider(props: ParentProps<{
|
|
17
17
|
value: UiI18n;
|
|
18
18
|
}>): import("solid-js").JSX.Element;
|
|
19
|
+
export { UiI18nProvider as I18nProvider };
|
|
19
20
|
export declare function useI18n(): UiI18n;
|
package/package.json
CHANGED
package/src/components/icon.css
CHANGED
package/src/components/icon.tsx
CHANGED
|
@@ -151,7 +151,11 @@ export function Icon(props: IconProps) {
|
|
|
151
151
|
onMount(ensureSprite)
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
|
-
<div
|
|
154
|
+
<div
|
|
155
|
+
data-component="icon"
|
|
156
|
+
data-size={local.size || "normal"}
|
|
157
|
+
data-directional={local.name === "chevron-left" || local.name === "chevron-right" ? true : undefined}
|
|
158
|
+
>
|
|
155
159
|
<svg
|
|
156
160
|
data-slot="icon-svg"
|
|
157
161
|
classList={{
|
package/src/components/toast.css
CHANGED
package/src/context/i18n.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, type Accessor, type ParentProps } from "solid-js"
|
|
2
|
+
import { I18nProvider } from "@kobalte/core/i18n"
|
|
2
3
|
import { dict as en } from "../i18n/en"
|
|
3
4
|
|
|
4
5
|
export type UiI18nKey = keyof typeof en
|
|
@@ -57,10 +58,16 @@ const fallback: UiI18n = {
|
|
|
57
58
|
|
|
58
59
|
const Context = createContext<UiI18n>(fallback)
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
return
|
|
61
|
+
function UiI18nProvider(props: ParentProps<{ value: UiI18n }>) {
|
|
62
|
+
return (
|
|
63
|
+
<I18nProvider locale={props.value.locale()}>
|
|
64
|
+
<Context.Provider value={props.value}>{props.children}</Context.Provider>
|
|
65
|
+
</I18nProvider>
|
|
66
|
+
)
|
|
62
67
|
}
|
|
63
68
|
|
|
69
|
+
export { UiI18nProvider as I18nProvider }
|
|
70
|
+
|
|
64
71
|
export function useI18n() {
|
|
65
72
|
return useContext(Context)
|
|
66
73
|
}
|
package/src/i18n/fr.ts
CHANGED
|
@@ -126,7 +126,8 @@ export const dict = {
|
|
|
126
126
|
"ui.promptInput.removeAttachment": "Supprimer la pièce jointe",
|
|
127
127
|
"ui.promptInput.label": "Invite",
|
|
128
128
|
"ui.promptInput.placeholder.shell": "Entrez une commande shell...",
|
|
129
|
-
"ui.promptInput.placeholder.normal":
|
|
129
|
+
"ui.promptInput.placeholder.normal":
|
|
130
|
+
"Demandez n'importe quoi, {{slash}} pour les commandes, {{at}} pour le contexte...",
|
|
130
131
|
"ui.promptInput.add": "Ajouter des images et des fichiers",
|
|
131
132
|
"ui.promptInput.attachments": "Images et fichiers",
|
|
132
133
|
"ui.promptInput.context": "Contexte",
|
package/src/i18n/pl.ts
CHANGED
|
@@ -128,7 +128,8 @@ export const dict = {
|
|
|
128
128
|
"ui.promptInput.removeAttachment": "Usuń załącznik",
|
|
129
129
|
"ui.promptInput.label": "Prompt",
|
|
130
130
|
"ui.promptInput.placeholder.shell": "Wpisz polecenie powłoki...",
|
|
131
|
-
"ui.promptInput.placeholder.normal":
|
|
131
|
+
"ui.promptInput.placeholder.normal":
|
|
132
|
+
"Zapytaj o cokolwiek, {{slash}} aby wyświetlić polecenia, {{at}} aby wyświetlić kontekst...",
|
|
132
133
|
"ui.promptInput.add": "Dodaj obrazy i pliki",
|
|
133
134
|
"ui.promptInput.attachments": "Obrazy i pliki",
|
|
134
135
|
"ui.promptInput.context": "Kontekst",
|
|
@@ -1,4 +1,5 @@
|
|
|
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"
|
|
@@ -46,8 +47,8 @@ function ToastV2Region(props: ToastV2RegionProps) {
|
|
|
46
47
|
return (
|
|
47
48
|
<Portal>
|
|
48
49
|
<Toaster
|
|
49
|
-
position="bottom-right"
|
|
50
|
-
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 }}
|
|
51
52
|
mobileOffset={16}
|
|
52
53
|
gap={12}
|
|
53
54
|
duration={5000}
|