@burdenoff/microfe-i18n 2026.527.1 → 2026.528.1
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/i18n/pages/LocaleConfigPage.js +101 -94
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ import { Settings as t } from "../../node_modules/lucide-react/dist/esm/icons/se
|
|
|
3
3
|
import { Trash2 as n } from "../../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
4
4
|
import { useState as r } from "react";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { OptionalFields as o } from "@burdenoff/fe-libs/ui";
|
|
6
7
|
//#region src/i18n/pages/LocaleConfigPage.tsx
|
|
7
|
-
var
|
|
8
|
-
let [
|
|
8
|
+
var s = () => {
|
|
9
|
+
let [s, c] = r({
|
|
9
10
|
code: "es-ES",
|
|
10
11
|
name: "Spanish",
|
|
11
12
|
nativeName: "Español",
|
|
@@ -25,13 +26,13 @@ var o = () => {
|
|
|
25
26
|
few: !1,
|
|
26
27
|
many: !1
|
|
27
28
|
}
|
|
28
|
-
}),
|
|
29
|
-
|
|
29
|
+
}), l = (e, t) => {
|
|
30
|
+
c((n) => ({
|
|
30
31
|
...n,
|
|
31
32
|
[e]: t
|
|
32
33
|
}));
|
|
33
|
-
},
|
|
34
|
-
|
|
34
|
+
}, u = (e, t) => {
|
|
35
|
+
c((n) => ({
|
|
35
36
|
...n,
|
|
36
37
|
pluralRules: {
|
|
37
38
|
...n.pluralRules,
|
|
@@ -53,9 +54,9 @@ var o = () => {
|
|
|
53
54
|
}), /* @__PURE__ */ a("p", {
|
|
54
55
|
className: "mt-1 text-sm text-content-secondary",
|
|
55
56
|
children: [
|
|
56
|
-
|
|
57
|
+
s.name,
|
|
57
58
|
" (",
|
|
58
|
-
|
|
59
|
+
s.nativeName,
|
|
59
60
|
")"
|
|
60
61
|
]
|
|
61
62
|
})] })]
|
|
@@ -68,7 +69,7 @@ var o = () => {
|
|
|
68
69
|
}), /* @__PURE__ */ a("button", {
|
|
69
70
|
type: "button",
|
|
70
71
|
onClick: () => {
|
|
71
|
-
console.log("Saving locale config:",
|
|
72
|
+
console.log("Saving locale config:", s);
|
|
72
73
|
},
|
|
73
74
|
className: "flex items-center gap-2 rounded-md bg-accent-primary px-4 py-2 text-sm font-medium text-white hover:bg-accent-primary-hover",
|
|
74
75
|
children: [/* @__PURE__ */ i(e, { className: "size-4" }), "Save Changes"]
|
|
@@ -96,8 +97,8 @@ var o = () => {
|
|
|
96
97
|
id: "locale-language-code",
|
|
97
98
|
type: "text",
|
|
98
99
|
"aria-label": "Language Code",
|
|
99
|
-
value:
|
|
100
|
-
onChange: (e) =>
|
|
100
|
+
value: s.code,
|
|
101
|
+
onChange: (e) => l("code", e.target.value),
|
|
101
102
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
102
103
|
})] }),
|
|
103
104
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
@@ -108,8 +109,8 @@ var o = () => {
|
|
|
108
109
|
id: "locale-name",
|
|
109
110
|
type: "text",
|
|
110
111
|
"aria-label": "Name",
|
|
111
|
-
value:
|
|
112
|
-
onChange: (e) =>
|
|
112
|
+
value: s.name,
|
|
113
|
+
onChange: (e) => l("name", e.target.value),
|
|
113
114
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
114
115
|
})] }),
|
|
115
116
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
@@ -120,8 +121,8 @@ var o = () => {
|
|
|
120
121
|
id: "locale-native-name",
|
|
121
122
|
type: "text",
|
|
122
123
|
"aria-label": "Native Name",
|
|
123
|
-
value:
|
|
124
|
-
onChange: (e) =>
|
|
124
|
+
value: s.nativeName,
|
|
125
|
+
onChange: (e) => l("nativeName", e.target.value),
|
|
125
126
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
126
127
|
})] }),
|
|
127
128
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
@@ -132,8 +133,8 @@ var o = () => {
|
|
|
132
133
|
id: "locale-region",
|
|
133
134
|
type: "text",
|
|
134
135
|
"aria-label": "Region",
|
|
135
|
-
value:
|
|
136
|
-
onChange: (e) =>
|
|
136
|
+
value: s.region,
|
|
137
|
+
onChange: (e) => l("region", e.target.value),
|
|
137
138
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
138
139
|
})] })
|
|
139
140
|
]
|
|
@@ -144,8 +145,8 @@ var o = () => {
|
|
|
144
145
|
type: "checkbox",
|
|
145
146
|
id: "is-default",
|
|
146
147
|
"aria-label": "Set as default language",
|
|
147
|
-
checked:
|
|
148
|
-
onChange: (e) =>
|
|
148
|
+
checked: s.isDefault,
|
|
149
|
+
onChange: (e) => l("isDefault", e.target.checked),
|
|
149
150
|
className: "size-4 rounded border-border text-accent-primary focus:ring-accent-primary"
|
|
150
151
|
}), /* @__PURE__ */ i("label", {
|
|
151
152
|
htmlFor: "is-default",
|
|
@@ -166,8 +167,8 @@ var o = () => {
|
|
|
166
167
|
id: "ltr",
|
|
167
168
|
name: "direction",
|
|
168
169
|
"aria-label": "LTR (Left to Right)",
|
|
169
|
-
checked:
|
|
170
|
-
onChange: () =>
|
|
170
|
+
checked: s.direction === "ltr",
|
|
171
|
+
onChange: () => l("direction", "ltr"),
|
|
171
172
|
className: "size-4 border-border text-accent-primary focus:ring-accent-primary"
|
|
172
173
|
}), /* @__PURE__ */ i("label", {
|
|
173
174
|
htmlFor: "ltr",
|
|
@@ -181,8 +182,8 @@ var o = () => {
|
|
|
181
182
|
id: "rtl",
|
|
182
183
|
name: "direction",
|
|
183
184
|
"aria-label": "RTL (Right to Left)",
|
|
184
|
-
checked:
|
|
185
|
-
onChange: () =>
|
|
185
|
+
checked: s.direction === "rtl",
|
|
186
|
+
onChange: () => l("direction", "rtl"),
|
|
186
187
|
className: "size-4 border-border text-accent-primary focus:ring-accent-primary"
|
|
187
188
|
}), /* @__PURE__ */ i("label", {
|
|
188
189
|
htmlFor: "rtl",
|
|
@@ -191,72 +192,78 @@ var o = () => {
|
|
|
191
192
|
})]
|
|
192
193
|
})]
|
|
193
194
|
})] }),
|
|
194
|
-
/* @__PURE__ */ a(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
195
|
+
/* @__PURE__ */ a(o, {
|
|
196
|
+
title: "Advanced settings",
|
|
197
|
+
description: "ICU plural-form overrides and fallback locale rules.",
|
|
198
|
+
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h2", {
|
|
199
|
+
className: "mb-4 text-lg font-semibold text-content-primary",
|
|
200
|
+
children: "Fallback Chain"
|
|
201
|
+
}), /* @__PURE__ */ a("div", {
|
|
202
|
+
className: "space-y-2",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ i("div", {
|
|
205
|
+
className: "rounded-lg border border-border bg-surface-elevated p-3",
|
|
206
|
+
children: /* @__PURE__ */ a("div", {
|
|
207
|
+
className: "flex items-center justify-between",
|
|
208
|
+
children: [/* @__PURE__ */ i("span", {
|
|
209
|
+
className: "text-sm text-content-primary",
|
|
210
|
+
children: "1. Spanish (es-ES)"
|
|
211
|
+
}), /* @__PURE__ */ i("span", {
|
|
212
|
+
className: "text-xs text-content-tertiary",
|
|
213
|
+
children: "Current"
|
|
214
|
+
})]
|
|
215
|
+
})
|
|
216
|
+
}),
|
|
217
|
+
s.fallbackLanguages.map((e, t) => /* @__PURE__ */ i("div", {
|
|
218
|
+
className: "rounded-lg border border-border bg-surface p-3",
|
|
219
|
+
children: /* @__PURE__ */ a("div", {
|
|
220
|
+
className: "flex items-center justify-between",
|
|
221
|
+
children: [/* @__PURE__ */ a("span", {
|
|
222
|
+
className: "text-sm text-content-primary",
|
|
223
|
+
children: [
|
|
224
|
+
t + 2,
|
|
225
|
+
".",
|
|
226
|
+
" ",
|
|
227
|
+
e === "es" ? "Spanish (es)" : "English (en)"
|
|
228
|
+
]
|
|
229
|
+
}), /* @__PURE__ */ i("button", {
|
|
230
|
+
type: "button",
|
|
231
|
+
className: "text-xs text-error hover:underline",
|
|
232
|
+
children: "Remove"
|
|
233
|
+
})]
|
|
234
|
+
})
|
|
235
|
+
}, e)),
|
|
236
|
+
/* @__PURE__ */ i("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
className: "w-full rounded-lg border-2 border-dashed border-border bg-surface p-3 text-sm text-content-secondary transition-colors hover:border-accent-primary hover:text-accent-primary",
|
|
239
|
+
children: "+ Add Fallback Language"
|
|
211
240
|
})
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
]
|
|
242
|
+
})] }), /* @__PURE__ */ a("div", {
|
|
243
|
+
className: "mt-6",
|
|
244
|
+
children: [/* @__PURE__ */ i("h2", {
|
|
245
|
+
className: "mb-4 text-lg font-semibold text-content-primary",
|
|
246
|
+
children: "Plural Rules (CLDR-based)"
|
|
247
|
+
}), /* @__PURE__ */ i("div", {
|
|
248
|
+
className: "grid grid-cols-3 gap-3",
|
|
249
|
+
children: Object.entries(s.pluralRules).map(([e, t]) => /* @__PURE__ */ a("div", {
|
|
250
|
+
className: "flex items-center gap-2 rounded-lg border border-border bg-surface-elevated p-3",
|
|
251
|
+
children: [/* @__PURE__ */ i("input", {
|
|
252
|
+
type: "checkbox",
|
|
253
|
+
id: `plural-${e}`,
|
|
254
|
+
"aria-label": `Plural form: ${e}`,
|
|
255
|
+
checked: t,
|
|
256
|
+
onChange: (t) => u(e, t.target.checked),
|
|
257
|
+
className: "size-4 rounded border-border text-accent-primary focus:ring-accent-primary"
|
|
258
|
+
}), /* @__PURE__ */ i("label", {
|
|
259
|
+
htmlFor: `plural-${e}`,
|
|
218
260
|
className: "text-sm text-content-primary",
|
|
219
|
-
children:
|
|
220
|
-
t + 2,
|
|
221
|
-
".",
|
|
222
|
-
" ",
|
|
223
|
-
e === "es" ? "Spanish (es)" : "English (en)"
|
|
224
|
-
]
|
|
225
|
-
}), /* @__PURE__ */ i("button", {
|
|
226
|
-
type: "button",
|
|
227
|
-
className: "text-xs text-error hover:underline",
|
|
228
|
-
children: "Remove"
|
|
261
|
+
children: e
|
|
229
262
|
})]
|
|
230
|
-
})
|
|
231
|
-
}, e)),
|
|
232
|
-
/* @__PURE__ */ i("button", {
|
|
233
|
-
type: "button",
|
|
234
|
-
className: "w-full rounded-lg border-2 border-dashed border-border bg-surface p-3 text-sm text-content-secondary transition-colors hover:border-accent-primary hover:text-accent-primary",
|
|
235
|
-
children: "+ Add Fallback Language"
|
|
236
|
-
})
|
|
237
|
-
]
|
|
238
|
-
})] }),
|
|
239
|
-
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h2", {
|
|
240
|
-
className: "mb-4 text-lg font-semibold text-content-primary",
|
|
241
|
-
children: "Plural Rules (CLDR-based)"
|
|
242
|
-
}), /* @__PURE__ */ i("div", {
|
|
243
|
-
className: "grid grid-cols-3 gap-3",
|
|
244
|
-
children: Object.entries(o.pluralRules).map(([e, t]) => /* @__PURE__ */ a("div", {
|
|
245
|
-
className: "flex items-center gap-2 rounded-lg border border-border bg-surface-elevated p-3",
|
|
246
|
-
children: [/* @__PURE__ */ i("input", {
|
|
247
|
-
type: "checkbox",
|
|
248
|
-
id: `plural-${e}`,
|
|
249
|
-
"aria-label": `Plural form: ${e}`,
|
|
250
|
-
checked: t,
|
|
251
|
-
onChange: (t) => l(e, t.target.checked),
|
|
252
|
-
className: "size-4 rounded border-border text-accent-primary focus:ring-accent-primary"
|
|
253
|
-
}), /* @__PURE__ */ i("label", {
|
|
254
|
-
htmlFor: `plural-${e}`,
|
|
255
|
-
className: "text-sm text-content-primary",
|
|
256
|
-
children: e
|
|
263
|
+
}, e))
|
|
257
264
|
})]
|
|
258
|
-
}
|
|
259
|
-
})
|
|
265
|
+
})]
|
|
266
|
+
}),
|
|
260
267
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h2", {
|
|
261
268
|
className: "mb-4 text-lg font-semibold text-content-primary",
|
|
262
269
|
children: "Formatting"
|
|
@@ -273,8 +280,8 @@ var o = () => {
|
|
|
273
280
|
id: "locale-date-format",
|
|
274
281
|
type: "text",
|
|
275
282
|
"aria-label": "Date Format",
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
283
|
+
value: s.dateFormat,
|
|
284
|
+
onChange: (e) => l("dateFormat", e.target.value),
|
|
278
285
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
279
286
|
}),
|
|
280
287
|
/* @__PURE__ */ i("p", {
|
|
@@ -292,8 +299,8 @@ var o = () => {
|
|
|
292
299
|
id: "locale-time-format",
|
|
293
300
|
type: "text",
|
|
294
301
|
"aria-label": "Time Format",
|
|
295
|
-
value:
|
|
296
|
-
onChange: (e) =>
|
|
302
|
+
value: s.timeFormat,
|
|
303
|
+
onChange: (e) => l("timeFormat", e.target.value),
|
|
297
304
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
298
305
|
}),
|
|
299
306
|
/* @__PURE__ */ i("p", {
|
|
@@ -311,8 +318,8 @@ var o = () => {
|
|
|
311
318
|
id: "locale-number-format",
|
|
312
319
|
type: "text",
|
|
313
320
|
"aria-label": "Number Format",
|
|
314
|
-
value:
|
|
315
|
-
onChange: (e) =>
|
|
321
|
+
value: s.numberFormat,
|
|
322
|
+
onChange: (e) => l("numberFormat", e.target.value),
|
|
316
323
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
317
324
|
}),
|
|
318
325
|
/* @__PURE__ */ i("p", {
|
|
@@ -330,8 +337,8 @@ var o = () => {
|
|
|
330
337
|
id: "locale-currency-code",
|
|
331
338
|
type: "text",
|
|
332
339
|
"aria-label": "Currency Code",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
340
|
+
value: s.currencyCode,
|
|
341
|
+
onChange: (e) => l("currencyCode", e.target.value),
|
|
335
342
|
className: "w-full rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
|
|
336
343
|
}),
|
|
337
344
|
/* @__PURE__ */ i("p", {
|
|
@@ -347,4 +354,4 @@ var o = () => {
|
|
|
347
354
|
});
|
|
348
355
|
};
|
|
349
356
|
//#endregion
|
|
350
|
-
export {
|
|
357
|
+
export { s as LocaleConfigPage };
|