@opencode-ai/ui 0.0.0-dev-202608040510 → 0.0.0-dev-202608040714

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.
Files changed (53) hide show
  1. package/dist/i18n/ar.d.ts +22 -0
  2. package/dist/i18n/br.d.ts +22 -0
  3. package/dist/i18n/bs.d.ts +22 -0
  4. package/dist/i18n/da.d.ts +22 -0
  5. package/dist/i18n/de.d.ts +22 -0
  6. package/dist/i18n/es.d.ts +22 -0
  7. package/dist/i18n/fr.d.ts +22 -0
  8. package/dist/i18n/ja.d.ts +22 -0
  9. package/dist/i18n/ko.d.ts +22 -0
  10. package/dist/i18n/pl.d.ts +22 -0
  11. package/dist/i18n/ru.d.ts +22 -0
  12. package/dist/i18n/th.d.ts +22 -0
  13. package/dist/i18n/tr.d.ts +22 -0
  14. package/dist/i18n/zh.d.ts +22 -0
  15. package/dist/i18n/zht.d.ts +22 -0
  16. package/package.json +1 -1
  17. package/src/i18n/ar.ts +24 -0
  18. package/src/i18n/az.ts +22 -0
  19. package/src/i18n/br.ts +24 -0
  20. package/src/i18n/bs.ts +24 -0
  21. package/src/i18n/da.ts +24 -0
  22. package/src/i18n/de.ts +22 -0
  23. package/src/i18n/en.ts +24 -0
  24. package/src/i18n/es.ts +24 -0
  25. package/src/i18n/fi.ts +22 -0
  26. package/src/i18n/fr.ts +25 -0
  27. package/src/i18n/hi.ts +23 -0
  28. package/src/i18n/id.ts +24 -0
  29. package/src/i18n/it.ts +22 -0
  30. package/src/i18n/ja.ts +24 -0
  31. package/src/i18n/ko.ts +24 -0
  32. package/src/i18n/nl.ts +22 -0
  33. package/src/i18n/no.ts +24 -0
  34. package/src/i18n/pa.ts +22 -0
  35. package/src/i18n/pl.ts +25 -0
  36. package/src/i18n/ru.ts +24 -0
  37. package/src/i18n/sv.ts +22 -0
  38. package/src/i18n/th.ts +24 -0
  39. package/src/i18n/tr.ts +24 -0
  40. package/src/i18n/uk.ts +24 -0
  41. package/src/i18n/ur.ts +22 -0
  42. package/src/i18n/vi.ts +22 -0
  43. package/src/i18n/zh.ts +24 -0
  44. package/src/i18n/zht.ts +24 -0
  45. package/src/v2/components/dialog-v2.css +2 -2
  46. package/src/v2/components/dialog-v2.tsx +3 -1
  47. package/src/v2/components/inline-input-v2.tsx +3 -1
  48. package/src/v2/components/line-comment-v2.css +1 -1
  49. package/src/v2/components/line-comment-v2.tsx +6 -4
  50. package/src/v2/components/tabs-v2.css +4 -4
  51. package/src/v2/components/tabs-v2.tsx +4 -2
  52. package/src/v2/components/text-input-v2.tsx +7 -1
  53. package/src/v2/components/toast-v2.tsx +5 -2
@@ -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={local.showClearButton ? (local.clearLabel ?? "Clear") : (local.copyLabel ?? "Copy")}
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
@@ -2,12 +2,14 @@ import { Toaster, toast, type ToasterProps } from "solid-sonner"
2
2
  import type { ComponentProps, JSX } from "solid-js"
3
3
  import { createContext, onCleanup, onMount, splitProps, useContext } from "solid-js"
4
4
  import { Portal } from "solid-js/web"
5
+ import { useI18n } from "../../context/i18n"
5
6
  import "./button-v2.css"
6
7
  import "./toast-v2.css"
7
8
 
8
9
  export interface ToastV2RegionProps extends ToasterProps {}
9
10
 
10
11
  function ToastV2Region(props: ToastV2RegionProps) {
12
+ const i18n = useI18n()
11
13
  const [local, rest] = splitProps(props, ["class", "className", "style", "toastOptions", "swipeDirections"])
12
14
  onMount(() => {
13
15
  const sync = () => {
@@ -56,7 +58,7 @@ function ToastV2Region(props: ToastV2RegionProps) {
56
58
  ...local.toastOptions,
57
59
  unstyled: true,
58
60
  closeButton: true,
59
- closeButtonAriaLabel: local.toastOptions?.closeButtonAriaLabel ?? "Dismiss",
61
+ closeButtonAriaLabel: local.toastOptions?.closeButtonAriaLabel ?? i18n.t("ui.common.dismiss"),
60
62
  }}
61
63
  {...rest}
62
64
  />
@@ -96,13 +98,14 @@ function ToastV2Actions(props: ComponentProps<"div">) {
96
98
  }
97
99
 
98
100
  function ToastV2CloseButton(props: ComponentProps<"button">) {
101
+ const i18n = useI18n()
99
102
  const toastId = useContext(ToastV2Context)
100
103
  const [local, rest] = splitProps(props, ["children", "onClick"])
101
104
  return (
102
105
  <button
103
106
  type="button"
104
107
  data-slot="toast-v2-close-button"
105
- aria-label="Dismiss"
108
+ aria-label={i18n.t("ui.common.dismiss")}
106
109
  {...rest}
107
110
  onClick={(event) => {
108
111
  if (typeof local.onClick === "function") local.onClick(event)