@krak-stack/registry 0.1.33 → 0.1.35

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 (43) hide show
  1. package/dist/components/ui/code-block.d.ts +1 -1
  2. package/dist/components/ui/code-block.js +6 -2
  3. package/dist/components/ui/copy-button.d.ts +1 -1
  4. package/dist/components/ui/copy-button.js +3 -1
  5. package/dist/components/ui/data-table.js +21 -12
  6. package/dist/components/ui/editing-locale-switcher.d.ts +1 -1
  7. package/dist/components/ui/editing-locale-switcher.js +8 -2
  8. package/dist/components/ui/effect-form.js +51 -35
  9. package/dist/components/ui/error-component.d.ts +1 -1
  10. package/dist/components/ui/error-component.js +6 -2
  11. package/dist/components/ui/file-picker.d.ts +1 -1
  12. package/dist/components/ui/file-picker.js +3 -1
  13. package/dist/components/ui/form.d.ts +12 -12
  14. package/dist/components/ui/form.js +25 -13
  15. package/dist/components/ui/google-map.d.ts +1 -1
  16. package/dist/components/ui/google-map.js +3 -1
  17. package/dist/components/ui/icon-input.d.ts +1 -1
  18. package/dist/components/ui/icon-input.js +9 -3
  19. package/dist/components/ui/krakstack-provider.d.ts +9 -0
  20. package/dist/components/ui/krakstack-provider.js +28 -0
  21. package/dist/components/ui/loading.d.ts +1 -1
  22. package/dist/components/ui/loading.js +3 -1
  23. package/dist/components/ui/locale-switcher.d.ts +2 -2
  24. package/dist/components/ui/locale-switcher.js +8 -2
  25. package/dist/components/ui/pagination.d.ts +1 -1
  26. package/dist/components/ui/pagination.js +3 -1
  27. package/dist/components/ui/search-menu.d.ts +1 -1
  28. package/dist/components/ui/search-menu.js +3 -1
  29. package/dist/components/ui/theme-switcher.d.ts +1 -1
  30. package/dist/components/ui/theme-switcher.js +3 -1
  31. package/dist/components/ui/virtualized-combobox.js +6 -2
  32. package/dist/lib/docs.js +10 -4
  33. package/dist/lib/docs.server.js +5 -0
  34. package/dist/lib/documentation-toolkit.js +5 -0
  35. package/dist/services/agent/client/index.js +10 -4
  36. package/dist/services/agent/client/widget.d.ts +1 -1
  37. package/dist/services/notification/client/index.js +5 -2
  38. package/dist/services/notification/client/notification-menu.d.ts +2 -2
  39. package/dist/services/notification/public.js +5 -2
  40. package/dist/services/opentelemetry/api.js +11 -2
  41. package/dist/services/opentelemetry/browser.d.ts +15 -7
  42. package/dist/services/opentelemetry/browser.js +62 -13
  43. package/package.json +5 -1
@@ -10,5 +10,5 @@ type CodeBlockProps = {
10
10
  locale?: string;
11
11
  messages?: CodeBlockMessageTranslations;
12
12
  };
13
- export declare function CodeBlock({ code, language, locale, messages, }: CodeBlockProps): import("react").JSX.Element;
13
+ export declare function CodeBlock({ code, language, locale: localeOverride, messages, }: CodeBlockProps): import("react").JSX.Element;
14
14
  export {};
@@ -49,6 +49,7 @@ function Button({
49
49
  // ../../src/components/ui/copy-button.tsx
50
50
  import { Check, Copy, TriangleAlert } from "lucide-react";
51
51
  import { useEffect, useRef, useState } from "react";
52
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
52
53
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
53
54
  var messages = {
54
55
  en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
@@ -63,7 +64,7 @@ function CopyButton({
63
64
  value,
64
65
  valueDescription,
65
66
  copyVariant = "default",
66
- locale = "en",
67
+ locale: localeOverride,
67
68
  messages: messages2,
68
69
  onCopied,
69
70
  onCopyError,
@@ -73,6 +74,7 @@ function CopyButton({
73
74
  "aria-label": ariaLabel,
74
75
  ...props
75
76
  }) {
77
+ const locale = useKrakstackLocale(localeOverride);
76
78
  const [copyState, setCopyState] = useState("idle");
77
79
  const copyTimeout = useRef(undefined);
78
80
  const labels = copyButtonMessages(locale, messages2);
@@ -136,6 +138,7 @@ import { highlight } from "@tanstack/highlight";
136
138
  import { createThemeCss } from "@tanstack/highlight/theme";
137
139
  import { githubDarkTheme } from "@tanstack/highlight/themes/github-dark";
138
140
  import { githubLightTheme } from "@tanstack/highlight/themes/github-light";
141
+ import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
139
142
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
140
143
  var themeCss = `${createThemeCss({
141
144
  light: githubLightTheme,
@@ -175,9 +178,10 @@ var codeBlockMessages = (locale = "en", translations) => ({
175
178
  function CodeBlock({
176
179
  code,
177
180
  language = "text",
178
- locale = "en",
181
+ locale: localeOverride,
179
182
  messages: messages3
180
183
  }) {
184
+ const locale = useKrakstackLocale2(localeOverride);
181
185
  const normalizedLanguage = language.toLowerCase() || "text";
182
186
  const highlighted = highlight(code, { lang: normalizedLanguage });
183
187
  const labels = codeBlockMessages(locale, messages3);
@@ -17,5 +17,5 @@ type CopyButtonProps = Omit<ComponentProps<typeof Button>, "children" | "onClick
17
17
  onCopyError?: (error: Error) => void;
18
18
  resetDelay?: number;
19
19
  };
20
- export declare function CopyButton({ value, valueDescription, copyVariant, locale, messages, onCopied, onCopyError, resetDelay, disabled, size, "aria-label": ariaLabel, ...props }: CopyButtonProps): import("react").JSX.Element;
20
+ export declare function CopyButton({ value, valueDescription, copyVariant, locale: localeOverride, messages, onCopied, onCopyError, resetDelay, disabled, size, "aria-label": ariaLabel, ...props }: CopyButtonProps): import("react").JSX.Element;
21
21
  export {};
@@ -49,6 +49,7 @@ function Button({
49
49
  // ../../src/components/ui/copy-button.tsx
50
50
  import { Check, Copy, TriangleAlert } from "lucide-react";
51
51
  import { useEffect, useRef, useState } from "react";
52
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
52
53
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
53
54
  var messages = {
54
55
  en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
@@ -63,7 +64,7 @@ function CopyButton({
63
64
  value,
64
65
  valueDescription,
65
66
  copyVariant = "default",
66
- locale = "en",
67
+ locale: localeOverride,
67
68
  messages: messages2,
68
69
  onCopied,
69
70
  onCopyError,
@@ -73,6 +74,7 @@ function CopyButton({
73
74
  "aria-label": ariaLabel,
74
75
  ...props
75
76
  }) {
77
+ const locale = useKrakstackLocale(localeOverride);
76
78
  const [copyState, setCopyState] = useState("idle");
77
79
  const copyTimeout = useRef(undefined);
78
80
  const labels = copyButtonMessages(locale, messages2);
@@ -314,6 +314,7 @@ function Input({ className, type, ...props }) {
314
314
 
315
315
  // ../../src/components/ui/loading.tsx
316
316
  import { Loader2 } from "lucide-react";
317
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
317
318
  import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
318
319
  var labels = {
319
320
  en: {
@@ -327,10 +328,11 @@ var loadingLabel = (locale, messages) => messages?.[locale]?.loading ?? messages
327
328
  function Loading({
328
329
  className,
329
330
  label,
330
- locale = "en",
331
+ locale: localeOverride,
331
332
  messages,
332
333
  variant = "inline"
333
334
  }) {
335
+ const locale = useKrakstackLocale(localeOverride);
334
336
  return /* @__PURE__ */ jsxs2("div", {
335
337
  className: cn("text-muted-foreground flex items-center justify-center gap-2 text-sm", variant === "centered" && "min-h-[50svh] w-full", className),
336
338
  children: [
@@ -653,6 +655,7 @@ function SelectScrollDownButton({
653
655
  }
654
656
 
655
657
  // ../../src/components/ui/pagination.tsx
658
+ import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
656
659
  import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
657
660
  var messages = {
658
661
  en: {
@@ -683,7 +686,7 @@ var paginationMessages = (locale = "en", translations) => ({
683
686
  });
684
687
  function Pagination({
685
688
  compact = false,
686
- locale = "en",
689
+ locale: localeOverride,
687
690
  messages: messageOverrides,
688
691
  onPageChange,
689
692
  onPageSizeChange,
@@ -695,6 +698,7 @@ function Pagination({
695
698
  showResults = true,
696
699
  totalRows
697
700
  }) {
701
+ const locale = useKrakstackLocale2(localeOverride);
698
702
  const labels2 = paginationMessages(locale, messageOverrides);
699
703
  const pageSizeId = useId();
700
704
  const canGoBack = page > 0;
@@ -970,6 +974,7 @@ function TooltipContent({
970
974
  }
971
975
 
972
976
  // ../../src/components/ui/data-table.tsx
977
+ import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
973
978
  import { jsx as jsx14, jsxs as jsxs8, Fragment } from "react/jsx-runtime";
974
979
  var DataTablePersistedUiStateSchema = Schema.Struct({
975
980
  columnVisibility: Schema.Record(Schema.String, Schema.Boolean),
@@ -2880,6 +2885,7 @@ var HydratedDataTable = ({
2880
2885
  });
2881
2886
  };
2882
2887
  var DataTable = (props) => {
2888
+ const locale = useKrakstackLocale3(props.locale);
2883
2889
  const persistedUiAtomRef = useRef(null);
2884
2890
  if (!persistedUiAtomRef.current) {
2885
2891
  const pathname = globalThis.window?.location.pathname ?? "/";
@@ -2903,6 +2909,7 @@ var DataTable = (props) => {
2903
2909
  }
2904
2910
  return /* @__PURE__ */ jsx14(HydratedDataTable, {
2905
2911
  ...props,
2912
+ locale,
2906
2913
  persistedUiState: persistedUiResult.value,
2907
2914
  setPersistedUiState
2908
2915
  });
@@ -2940,15 +2947,17 @@ var DataTableContent = ({
2940
2947
  });
2941
2948
  };
2942
2949
  var DataTableListCell = (props) => {
2943
- if (props.options && (props.onAdd || props.onRemove)) {
2950
+ const locale = useKrakstackLocale3(props.locale);
2951
+ const resolvedProps = { ...props, locale };
2952
+ if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
2944
2953
  return /* @__PURE__ */ jsx14(EditableDataTableListCell, {
2945
- ...props
2954
+ ...resolvedProps
2946
2955
  });
2947
2956
  }
2948
- const { actionsLabel, itemActions, ...summaryProps } = props;
2949
- const labels2 = dataTableMessages(props.locale, props.messages);
2950
- const totalCount = props.totalCount ?? props.items.length;
2951
- const overflow = totalCount > Math.min(props.items.length, props.visibleCount ?? 3);
2957
+ const { actionsLabel, itemActions, ...summaryProps } = resolvedProps;
2958
+ const labels2 = dataTableMessages(locale, resolvedProps.messages);
2959
+ const totalCount = resolvedProps.totalCount ?? resolvedProps.items.length;
2960
+ const overflow = totalCount > Math.min(resolvedProps.items.length, resolvedProps.visibleCount ?? 3);
2952
2961
  if (!itemActions?.length && !overflow) {
2953
2962
  return /* @__PURE__ */ jsx14(DataTableListSummary, {
2954
2963
  ...summaryProps
@@ -2962,12 +2971,12 @@ var DataTableListCell = (props) => {
2962
2971
  onPointerDown: (event) => event.stopPropagation(),
2963
2972
  children: /* @__PURE__ */ jsx14(DataTableListMenu, {
2964
2973
  actions: itemActions ?? [],
2965
- display: props.display,
2974
+ display: resolvedProps.display,
2966
2975
  force: overflow,
2967
2976
  label: menuLabel,
2968
- items: props.items,
2969
- locale: props.locale,
2970
- messages: props.messages,
2977
+ items: resolvedProps.items,
2978
+ locale,
2979
+ messages: resolvedProps.messages,
2971
2980
  trigger: /* @__PURE__ */ jsxs8(Button, {
2972
2981
  "aria-label": menuLabel,
2973
2982
  className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
@@ -2,7 +2,7 @@ export type EditingLocale = string;
2
2
  export declare const editingLocales: readonly ["en", "fr"];
3
3
  export type EditingLocaleSwitcherMessages = Partial<Record<string, string>>;
4
4
  export type EditingLocaleSwitcherMessageTranslations = Partial<Record<string, EditingLocaleSwitcherMessages>>;
5
- export declare function EditingLocaleSwitcher({ locale, locales, messages, value, onValueChange, }: {
5
+ export declare function EditingLocaleSwitcher({ locale: localeOverride, locales: localeOverrides, messages, value, onValueChange, }: {
6
6
  locale?: string;
7
7
  locales?: readonly string[];
8
8
  messages?: EditingLocaleSwitcherMessageTranslations;
@@ -132,6 +132,10 @@ function SelectScrollDownButton({
132
132
  }
133
133
 
134
134
  // ../../src/components/ui/editing-locale-switcher.tsx
135
+ import {
136
+ useKrakstackLocale,
137
+ useKrakstackLocales
138
+ } from "@krak-stack/registry/krakstack-provider";
135
139
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
136
140
  var editingLocales = ["en", "fr"];
137
141
  var messages = {
@@ -148,12 +152,14 @@ var editingLocaleMessages = (locale, translations) => {
148
152
  };
149
153
  };
150
154
  function EditingLocaleSwitcher({
151
- locale = "en",
152
- locales = editingLocales,
155
+ locale: localeOverride,
156
+ locales: localeOverrides,
153
157
  messages: messages2,
154
158
  value,
155
159
  onValueChange
156
160
  }) {
161
+ const locale = useKrakstackLocale(localeOverride);
162
+ const locales = useKrakstackLocales(localeOverrides);
157
163
  const labels = editingLocaleMessages(locale, messages2);
158
164
  const localeOptions = locales.map((value2) => ({
159
165
  value: value2,
@@ -305,6 +305,7 @@ function Input({ className, type, ...props }) {
305
305
  }
306
306
 
307
307
  // ../../src/components/ui/file-picker.tsx
308
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
308
309
  import { jsx as jsx5, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
309
310
  "use client";
310
311
  var messages = {
@@ -360,7 +361,7 @@ var FilePicker = ({
360
361
  id,
361
362
  image,
362
363
  invalid = false,
363
- locale = "en",
364
+ locale: localeOverride,
364
365
  messages: messages2,
365
366
  multiple = false,
366
367
  name,
@@ -371,6 +372,7 @@ var FilePicker = ({
371
372
  required,
372
373
  title
373
374
  }) => {
375
+ const locale = useKrakstackLocale(localeOverride);
374
376
  const labels = filePickerMessages(locale, messages2);
375
377
  const inputRef = useRef(null);
376
378
  const dragDepthRef = useRef(0);
@@ -946,6 +948,7 @@ function InputGroupInput({
946
948
  }
947
949
 
948
950
  // ../../src/components/ui/virtualized-combobox.tsx
951
+ import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
949
952
  import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
950
953
  "use client";
951
954
  var messages2 = {
@@ -1250,14 +1253,18 @@ var VirtualizedComboboxMultiple = (props) => {
1250
1253
  });
1251
1254
  };
1252
1255
  function VirtualizedCombobox(props) {
1256
+ const locale = useKrakstackLocale2(props.locale);
1253
1257
  return props.multiple ? /* @__PURE__ */ jsx12(VirtualizedComboboxMultiple, {
1254
- ...props
1258
+ ...props,
1259
+ locale
1255
1260
  }) : /* @__PURE__ */ jsx12(VirtualizedComboboxSingle, {
1256
- ...props
1261
+ ...props,
1262
+ locale
1257
1263
  });
1258
1264
  }
1259
1265
 
1260
1266
  // ../../src/components/ui/effect-form.tsx
1267
+ import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
1261
1268
  import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
1262
1269
  var messages3 = {
1263
1270
  en: {
@@ -1300,6 +1307,7 @@ var effectFormMessages = (locale = "en", translations) => ({
1300
1307
  ...translations?.[locale.split("-")[0] ?? locale],
1301
1308
  ...translations?.[locale]
1302
1309
  });
1310
+ var useEffectFormMessages = (locale, translations) => effectFormMessages(useKrakstackLocale3(locale), translations);
1303
1311
  var getCauseErrorMessage = (cause) => {
1304
1312
  const error = Cause.squash(cause);
1305
1313
  return error instanceof Error ? error.message : String(error);
@@ -1350,7 +1358,7 @@ var SubmitError = ({
1350
1358
  var SubmitButton = ({
1351
1359
  children,
1352
1360
  form,
1353
- locale = "en",
1361
+ locale,
1354
1362
  messages: messages4,
1355
1363
  onSubmit
1356
1364
  }) => {
@@ -1359,6 +1367,7 @@ var SubmitButton = ({
1359
1367
  const isDirty = useAtomValue(form.isDirty);
1360
1368
  const hasChangedSinceSubmit = useAtomValue(form.hasChangedSinceSubmit);
1361
1369
  const lastSubmittedValues = useAtomValue(form.lastSubmittedValues);
1370
+ const labels = useEffectFormMessages(locale, messages4);
1362
1371
  const hasPendingChanges = Option.isNone(lastSubmittedValues) ? isDirty : hasChangedSinceSubmit;
1363
1372
  return /* @__PURE__ */ jsxs6(Button, {
1364
1373
  type: "button",
@@ -1373,7 +1382,7 @@ var SubmitButton = ({
1373
1382
  "data-icon": "inline-start",
1374
1383
  className: "animate-spin"
1375
1384
  }),
1376
- children ?? effectFormMessages(locale, messages4).submit
1385
+ children ?? labels.submit
1377
1386
  ]
1378
1387
  });
1379
1388
  };
@@ -1427,8 +1436,8 @@ var NameField = ({
1427
1436
  field,
1428
1437
  props
1429
1438
  }) => {
1430
- const { locale = "en", messages: messages4, ...fieldProps } = props;
1431
- const labels = effectFormMessages(locale, messages4);
1439
+ const { locale, messages: messages4, ...fieldProps } = props;
1440
+ const labels = useEffectFormMessages(locale, messages4);
1432
1441
  return /* @__PURE__ */ jsx13(TextField, {
1433
1442
  field,
1434
1443
  props: {
@@ -1474,12 +1483,13 @@ var TextAreaField = ({ field, props }) => {
1474
1483
  });
1475
1484
  };
1476
1485
  var DescriptionField = ({ field, props }) => {
1477
- const { locale = "en", messages: messages4, ...fieldProps } = props;
1486
+ const { locale, messages: messages4, ...fieldProps } = props;
1487
+ const labels = useEffectFormMessages(locale, messages4);
1478
1488
  return /* @__PURE__ */ jsx13(TextAreaField, {
1479
1489
  field,
1480
1490
  props: {
1481
1491
  ...fieldProps,
1482
- label: effectFormMessages(locale, messages4).description
1492
+ label: labels.description
1483
1493
  }
1484
1494
  });
1485
1495
  };
@@ -1635,13 +1645,13 @@ var SelectField = ({
1635
1645
  var FolderField = ({
1636
1646
  field,
1637
1647
  props
1638
- }) => /* @__PURE__ */ jsx13(SelectField, {
1639
- field,
1640
- props: {
1641
- ...props,
1642
- label: effectFormMessages(props.locale, props.messages).folder
1643
- }
1644
- });
1648
+ }) => {
1649
+ const labels = useEffectFormMessages(props.locale, props.messages);
1650
+ return /* @__PURE__ */ jsx13(SelectField, {
1651
+ field,
1652
+ props: { ...props, label: labels.folder }
1653
+ });
1654
+ };
1645
1655
  var MultiSelectField = ({
1646
1656
  field,
1647
1657
  props
@@ -1742,9 +1752,10 @@ var SearchableSelectField = ({
1742
1752
  field,
1743
1753
  props
1744
1754
  }) => {
1755
+ const locale = useKrakstackLocale3(props.locale);
1745
1756
  const { selectedItems, mergedItems } = getSearchableSelectItems(field.value, props.initialItems ?? [], props.items);
1746
1757
  const invalid = Option.isSome(field.error);
1747
- const labels = virtualizedComboboxMessages(props.locale ?? "en", props.messages);
1758
+ const labels = virtualizedComboboxMessages(locale, props.messages);
1748
1759
  const ariaLabel = Schema2.is(Schema2.String)(props.label) ? props.label : labels.search;
1749
1760
  return /* @__PURE__ */ jsxs6(Field, {
1750
1761
  className: "min-w-0",
@@ -1759,7 +1770,7 @@ var SearchableSelectField = ({
1759
1770
  ariaLabel,
1760
1771
  emptyLabel: props.emptyLabel,
1761
1772
  items: mergedItems,
1762
- locale: props.locale,
1773
+ locale,
1763
1774
  ...props.messages ? { messages: props.messages } : {},
1764
1775
  multiple: true,
1765
1776
  ...props.onSearchValueChange ? { onSearchValueChange: props.onSearchValueChange } : {},
@@ -1783,9 +1794,10 @@ var SingleSearchableSelectField = ({
1783
1794
  field,
1784
1795
  props
1785
1796
  }) => {
1797
+ const locale = useKrakstackLocale3(props.locale);
1786
1798
  const { selectedItems, mergedItems } = getSearchableSelectItems(field.value ? [field.value] : [], props.initialItems ?? [], props.items);
1787
1799
  const invalid = Option.isSome(field.error);
1788
- const labels = virtualizedComboboxMessages(props.locale ?? "en", props.messages);
1800
+ const labels = virtualizedComboboxMessages(locale, props.messages);
1789
1801
  const ariaLabel = Schema2.is(Schema2.String)(props.label) ? props.label : labels.search;
1790
1802
  return /* @__PURE__ */ jsxs6(Field, {
1791
1803
  className: "min-w-0",
@@ -1800,7 +1812,7 @@ var SingleSearchableSelectField = ({
1800
1812
  ariaLabel,
1801
1813
  emptyLabel: props.emptyLabel,
1802
1814
  items: mergedItems,
1803
- locale: props.locale,
1815
+ locale,
1804
1816
  ...props.messages ? { messages: props.messages } : {},
1805
1817
  ...props.onSearchValueChange ? { onSearchValueChange: props.onSearchValueChange } : {},
1806
1818
  onValueChange: (option) => field.onChange(option?.value ?? ""),
@@ -1823,7 +1835,7 @@ var NullableKeyValueField = ({
1823
1835
  field,
1824
1836
  props
1825
1837
  }) => {
1826
- const labels = effectFormMessages(props.locale, props.messages);
1838
+ const labels = useEffectFormMessages(props.locale, props.messages);
1827
1839
  const entries = Object.entries(field.value ?? {});
1828
1840
  const updateEntry = (index, key, value) => Object.fromEntries(entries.map(([currentKey, currentValue], currentIndex) => currentIndex === index ? [key, value] : [currentKey, currentValue]));
1829
1841
  return /* @__PURE__ */ jsxs6(Field, {
@@ -1895,7 +1907,7 @@ var KeyValueField = ({
1895
1907
  field,
1896
1908
  props
1897
1909
  }) => {
1898
- const labels = effectFormMessages(props.locale, props.messages);
1910
+ const labels = useEffectFormMessages(props.locale, props.messages);
1899
1911
  const entries = Object.entries(field.value);
1900
1912
  const updateEntry = (index, key, value) => Object.fromEntries(entries.map(([currentKey, currentValue], currentIndex) => currentIndex === index ? [key, value] : [currentKey, currentValue]));
1901
1913
  return /* @__PURE__ */ jsxs6(Field, {
@@ -1966,17 +1978,21 @@ var KeyValueField = ({
1966
1978
  var RevertButton = ({
1967
1979
  field,
1968
1980
  props
1969
- }) => field.value === props.original ? null : /* @__PURE__ */ jsx13("div", {
1970
- className: "flex flex-1 justify-end",
1971
- children: /* @__PURE__ */ jsx13(Button, {
1972
- type: "button",
1973
- variant: "link",
1974
- className: "-mr-4 h-auto py-0",
1975
- onClick: () => field.onChange(props.original),
1976
- children: effectFormMessages(props.locale, props.messages).revert
1977
- })
1978
- });
1981
+ }) => {
1982
+ const labels = useEffectFormMessages(props.locale, props.messages);
1983
+ return field.value === props.original ? null : /* @__PURE__ */ jsx13("div", {
1984
+ className: "flex flex-1 justify-end",
1985
+ children: /* @__PURE__ */ jsx13(Button, {
1986
+ type: "button",
1987
+ variant: "link",
1988
+ className: "-mr-4 h-auto py-0",
1989
+ onClick: () => field.onChange(props.original),
1990
+ children: labels.revert
1991
+ })
1992
+ });
1993
+ };
1979
1994
  var ImageField = ({ field, props }) => {
1995
+ const labels = useEffectFormMessages(props.locale, props.messages);
1980
1996
  const imageUrl = Schema2.is(Schema2.String)(field.value) ? field.value : undefined;
1981
1997
  const invalid = Option.isSome(field.error);
1982
1998
  return /* @__PURE__ */ jsxs6(Field, {
@@ -2009,7 +2025,7 @@ var ImageField = ({ field, props }) => {
2009
2025
  title: field.value instanceof File ? field.value.name : props.label
2010
2026
  }),
2011
2027
  props.size.suggestedWidth && props.size.suggestedHeight ? /* @__PURE__ */ jsx13(FieldDescription, {
2012
- children: effectFormMessages(props.locale, props.messages).suggestedImageSize(String(props.size.suggestedWidth), String(props.size.suggestedHeight))
2028
+ children: labels.suggestedImageSize(String(props.size.suggestedWidth), String(props.size.suggestedHeight))
2013
2029
  }) : null,
2014
2030
  /* @__PURE__ */ jsx13(FieldError, {
2015
2031
  error: field.error
@@ -2018,11 +2034,11 @@ var ImageField = ({ field, props }) => {
2018
2034
  });
2019
2035
  };
2020
2036
  var NavigationBlock = ({
2021
- locale = "en",
2037
+ locale,
2022
2038
  messages: messages4,
2023
2039
  shouldBlock
2024
2040
  }) => {
2025
- const labels = effectFormMessages(locale, messages4);
2041
+ const labels = useEffectFormMessages(locale, messages4);
2026
2042
  return /* @__PURE__ */ jsx13(Block, {
2027
2043
  enableBeforeUnload: () => shouldBlock,
2028
2044
  shouldBlockFn: () => shouldBlock,
@@ -29,4 +29,4 @@ export type ErrorComponentProps = RouterErrorComponentProps & {
29
29
  reference?: string;
30
30
  };
31
31
  };
32
- export declare const ErrorComponent: ({ error, locale, messages, retryable, className, diagnostics, }: ErrorComponentProps) => import("react").JSX.Element;
32
+ export declare const ErrorComponent: ({ error, locale: localeOverride, messages, retryable, className, diagnostics, }: ErrorComponentProps) => import("react").JSX.Element;
@@ -59,6 +59,7 @@ function Button({
59
59
  // ../../src/components/ui/copy-button.tsx
60
60
  import { Check, Copy, TriangleAlert } from "lucide-react";
61
61
  import { useEffect, useRef, useState } from "react";
62
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
62
63
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
63
64
  var messages = {
64
65
  en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
@@ -73,7 +74,7 @@ function CopyButton({
73
74
  value,
74
75
  valueDescription,
75
76
  copyVariant = "default",
76
- locale = "en",
77
+ locale: localeOverride,
77
78
  messages: messages2,
78
79
  onCopied,
79
80
  onCopyError,
@@ -83,6 +84,7 @@ function CopyButton({
83
84
  "aria-label": ariaLabel,
84
85
  ...props
85
86
  }) {
87
+ const locale = useKrakstackLocale(localeOverride);
86
88
  const [copyState, setCopyState] = useState("idle");
87
89
  const copyTimeout = useRef(undefined);
88
90
  const labels = copyButtonMessages(locale, messages2);
@@ -214,6 +216,7 @@ function EmptyContent({ className, ...props }) {
214
216
  }
215
217
 
216
218
  // ../../src/components/ui/error-component.tsx
219
+ import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
217
220
  import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
218
221
  var TraceId = Schema.String.check(Schema.isPattern(/^(?!0+$)(?:[a-f0-9]{16}|[a-f0-9]{32})$/i)).annotate({ identifier: "ErrorTraceId" });
219
222
  var decodeTraceId = Schema.decodeUnknownOption(TraceId);
@@ -271,12 +274,13 @@ var defaultMessages = {
271
274
  };
272
275
  var ErrorComponent = ({
273
276
  error,
274
- locale = "en",
277
+ locale: localeOverride,
275
278
  messages: messages2,
276
279
  retryable = true,
277
280
  className,
278
281
  diagnostics
279
282
  }) => {
283
+ const locale = useKrakstackLocale2(localeOverride);
280
284
  const pathname = useRouterState({
281
285
  select: (state) => state.location.pathname
282
286
  });
@@ -34,4 +34,4 @@ export type FilePickerProps = {
34
34
  required?: boolean;
35
35
  title: ReactNode;
36
36
  };
37
- export declare const FilePicker: ({ accept, canClear, file, files, id, image, invalid, locale, messages, multiple, name, onBlur, onChange, onClear, onFilesChange, required, title, }: FilePickerProps) => import("react").JSX.Element;
37
+ export declare const FilePicker: ({ accept, canClear, file, files, id, image, invalid, locale: localeOverride, messages, multiple, name, onBlur, onChange, onClear, onFilesChange, required, title, }: FilePickerProps) => import("react").JSX.Element;
@@ -188,6 +188,7 @@ function Input({ className, type, ...props }) {
188
188
  }
189
189
 
190
190
  // ../../src/components/ui/file-picker.tsx
191
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
191
192
  import { jsx as jsx4, jsxs, Fragment } from "react/jsx-runtime";
192
193
  "use client";
193
194
  var messages = {
@@ -243,7 +244,7 @@ var FilePicker = ({
243
244
  id,
244
245
  image,
245
246
  invalid = false,
246
- locale = "en",
247
+ locale: localeOverride,
247
248
  messages: messages2,
248
249
  multiple = false,
249
250
  name,
@@ -254,6 +255,7 @@ var FilePicker = ({
254
255
  required,
255
256
  title
256
257
  }) => {
258
+ const locale = useKrakstackLocale(localeOverride);
257
259
  const labels = filePickerMessages(locale, messages2);
258
260
  const inputRef = useRef(null);
259
261
  const dragDepthRef = useRef(0);