@arqel-dev/ui 0.15.0 → 0.16.0

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 (100) hide show
  1. package/README.md +1 -1
  2. package/dist/{AreaChart-NMQ2RQGA.js → AreaChart-JAZ6LUYG.js} +8 -4
  3. package/dist/AreaChart-JAZ6LUYG.js.map +1 -0
  4. package/dist/ArqelCreatePage-UZAHV4DK.js +8 -0
  5. package/dist/{ArqelCreatePage-MV4JN2MO.js.map → ArqelCreatePage-UZAHV4DK.js.map} +1 -1
  6. package/dist/ArqelDashboardPage-Z5R4XSH4.js +6 -0
  7. package/dist/{ArqelDashboardPage-QK3BYVK3.js.map → ArqelDashboardPage-Z5R4XSH4.js.map} +1 -1
  8. package/dist/ArqelEditPage-RRYFYOTC.js +8 -0
  9. package/dist/{ArqelShowPage-5WWUSYC7.js.map → ArqelEditPage-RRYFYOTC.js.map} +1 -1
  10. package/dist/ArqelIndexPage-J2EUV2PI.js +12 -0
  11. package/dist/{ArqelIndexPage-R6JL5KOH.js.map → ArqelIndexPage-J2EUV2PI.js.map} +1 -1
  12. package/dist/ArqelShowPage-TVCJAV2F.js +6 -0
  13. package/dist/{ArqelEditPage-7J3IS2BR.js.map → ArqelShowPage-TVCJAV2F.js.map} +1 -1
  14. package/dist/{BarChart-KLHKTLO2.js → BarChart-E52NJSJE.js} +8 -4
  15. package/dist/BarChart-E52NJSJE.js.map +1 -0
  16. package/dist/{DonutChart-L56R4QF2.js → DonutChart-IGSF4LEB.js} +3 -3
  17. package/dist/{DonutChart-L56R4QF2.js.map → DonutChart-IGSF4LEB.js.map} +1 -1
  18. package/dist/{FormRenderer-BJBRIkfH.d.ts → FormRenderer-By8fZp4t.d.ts} +2 -0
  19. package/dist/{LineChart-GHMPHFZZ.js → LineChart-RRPGAZON.js} +8 -4
  20. package/dist/LineChart-RRPGAZON.js.map +1 -0
  21. package/dist/PieChart-SGN7V5LQ.js +4 -0
  22. package/dist/{PieChart-T2VQOFPP.js.map → PieChart-SGN7V5LQ.js.map} +1 -1
  23. package/dist/{RadarChart-CSWR5AO7.js → RadarChart-3AOM736J.js} +8 -4
  24. package/dist/RadarChart-3AOM736J.js.map +1 -0
  25. package/dist/{Topbar-DffcNdcJ.d.ts → UserMenu-B5XbC_Gy.d.ts} +24 -4
  26. package/dist/action.js +3 -3
  27. package/dist/{chunk-BJER6TOI.js → chunk-3VSDQCFO.js} +3 -3
  28. package/dist/{chunk-BJER6TOI.js.map → chunk-3VSDQCFO.js.map} +1 -1
  29. package/dist/{chunk-ZAM5TUPP.js → chunk-CMNZLA32.js} +60 -25
  30. package/dist/chunk-CMNZLA32.js.map +1 -0
  31. package/dist/{chunk-CVAMCRLL.js → chunk-EG2DASKR.js} +8 -4
  32. package/dist/chunk-EG2DASKR.js.map +1 -0
  33. package/dist/{chunk-DSULVRB6.js → chunk-GJ2FKAOM.js} +5 -3
  34. package/dist/chunk-GJ2FKAOM.js.map +1 -0
  35. package/dist/{chunk-FV7RESKL.js → chunk-HNUUZEOL.js} +28 -16
  36. package/dist/chunk-HNUUZEOL.js.map +1 -0
  37. package/dist/{chunk-37FLEB4N.js → chunk-IO6RMVUF.js} +8 -4
  38. package/dist/chunk-IO6RMVUF.js.map +1 -0
  39. package/dist/{chunk-N6WLCHQE.js → chunk-Q7WGPKUN.js} +6 -4
  40. package/dist/chunk-Q7WGPKUN.js.map +1 -0
  41. package/dist/{chunk-AZICSFBA.js → chunk-S5UNPCMQ.js} +112 -38
  42. package/dist/chunk-S5UNPCMQ.js.map +1 -0
  43. package/dist/{chunk-MTNFFSVA.js → chunk-SK6H7ARE.js} +5 -3
  44. package/dist/chunk-SK6H7ARE.js.map +1 -0
  45. package/dist/{chunk-FP5R6WED.js → chunk-SLLTFOOS.js} +22 -14
  46. package/dist/chunk-SLLTFOOS.js.map +1 -0
  47. package/dist/{chunk-3HN4ARGG.js → chunk-VKZY6J6G.js} +34 -3
  48. package/dist/chunk-VKZY6J6G.js.map +1 -0
  49. package/dist/{chunk-PSPJA5U6.js → chunk-WMOBLT3Z.js} +10 -5
  50. package/dist/chunk-WMOBLT3Z.js.map +1 -0
  51. package/dist/{chunk-C5H44NSP.js → chunk-WZRPGPLH.js} +10 -5
  52. package/dist/chunk-WZRPGPLH.js.map +1 -0
  53. package/dist/{chunk-N5U2BB6T.js → chunk-X2X6YDOX.js} +102 -28
  54. package/dist/chunk-X2X6YDOX.js.map +1 -0
  55. package/dist/{chunk-4I5S6MH3.js → chunk-X4ZFKOPX.js} +4 -4
  56. package/dist/{chunk-4I5S6MH3.js.map → chunk-X4ZFKOPX.js.map} +1 -1
  57. package/dist/{chunk-UXN67E5L.js → chunk-YQ6KXR3U.js} +8 -10
  58. package/dist/chunk-YQ6KXR3U.js.map +1 -0
  59. package/dist/{chunk-HSDZM4AM.js → chunk-YYQ45W25.js} +37 -24
  60. package/dist/chunk-YYQ45W25.js.map +1 -0
  61. package/dist/flash.js +1 -1
  62. package/dist/form.d.ts +3 -1
  63. package/dist/form.js +1 -1
  64. package/dist/index.d.ts +2 -2
  65. package/dist/index.js +10 -10
  66. package/dist/pages.js +17 -17
  67. package/dist/palette.js +1 -1
  68. package/dist/resource.js +2 -2
  69. package/dist/shell.d.ts +1 -1
  70. package/dist/shell.js +9 -5
  71. package/dist/shell.js.map +1 -1
  72. package/dist/table.js +1 -1
  73. package/dist/utility.js +1 -1
  74. package/dist/widgets.js +2 -2
  75. package/package.json +6 -6
  76. package/dist/AreaChart-NMQ2RQGA.js.map +0 -1
  77. package/dist/ArqelCreatePage-MV4JN2MO.js +0 -8
  78. package/dist/ArqelDashboardPage-QK3BYVK3.js +0 -6
  79. package/dist/ArqelEditPage-7J3IS2BR.js +0 -8
  80. package/dist/ArqelIndexPage-R6JL5KOH.js +0 -12
  81. package/dist/ArqelShowPage-5WWUSYC7.js +0 -6
  82. package/dist/BarChart-KLHKTLO2.js.map +0 -1
  83. package/dist/LineChart-GHMPHFZZ.js.map +0 -1
  84. package/dist/PieChart-T2VQOFPP.js +0 -4
  85. package/dist/RadarChart-CSWR5AO7.js.map +0 -1
  86. package/dist/chunk-37FLEB4N.js.map +0 -1
  87. package/dist/chunk-3HN4ARGG.js.map +0 -1
  88. package/dist/chunk-AZICSFBA.js.map +0 -1
  89. package/dist/chunk-C5H44NSP.js.map +0 -1
  90. package/dist/chunk-CVAMCRLL.js.map +0 -1
  91. package/dist/chunk-DSULVRB6.js.map +0 -1
  92. package/dist/chunk-FP5R6WED.js.map +0 -1
  93. package/dist/chunk-FV7RESKL.js.map +0 -1
  94. package/dist/chunk-HSDZM4AM.js.map +0 -1
  95. package/dist/chunk-MTNFFSVA.js.map +0 -1
  96. package/dist/chunk-N5U2BB6T.js.map +0 -1
  97. package/dist/chunk-N6WLCHQE.js.map +0 -1
  98. package/dist/chunk-PSPJA5U6.js.map +0 -1
  99. package/dist/chunk-UXN67E5L.js.map +0 -1
  100. package/dist/chunk-ZAM5TUPP.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { cn } from './chunk-B7ULUJVO.js';
2
+ import { useArqelTranslations } from '@arqel-dev/react/utils';
2
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
4
  import { useId, useState, useRef } from 'react';
4
5
  import { isFieldEntry, isLayoutEntry } from '@arqel-dev/types/forms';
@@ -63,6 +64,7 @@ function NativeFieldInput(props) {
63
64
  }
64
65
  }
65
66
  function UnregisteredField({ field }) {
67
+ const t = useArqelTranslations();
66
68
  if (field.component) {
67
69
  console.warn(
68
70
  `[arqel] field "${field.name}" uses unregistered component "${field.component}" \u2014 did you import its /register module?`
@@ -71,19 +73,16 @@ function UnregisteredField({ field }) {
71
73
  console.warn(`[arqel] field "${field.name}" has no native input for type "${field.type}".`);
72
74
  }
73
75
  const detail = field.component ? `unregistered component "${field.component}"` : `unsupported type "${field.type}"`;
74
- return /* @__PURE__ */ jsxs(
76
+ return /* @__PURE__ */ jsx(
75
77
  "p",
76
78
  {
77
79
  "data-testid": "arqel-unregistered-field",
78
80
  role: "alert",
79
81
  className: "rounded-sm border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",
80
- children: [
81
- 'Field "',
82
- field.name,
83
- '" could not render: ',
84
- detail,
85
- "."
86
- ]
82
+ children: t("form.unregistered_field", `Field "${field.name}" could not render: ${detail}.`, {
83
+ name: field.name,
84
+ detail
85
+ })
87
86
  }
88
87
  );
89
88
  }
@@ -93,7 +92,8 @@ function TextLike({
93
92
  onChange,
94
93
  disabled,
95
94
  inputId,
96
- describedBy
95
+ describedBy,
96
+ invalid
97
97
  }) {
98
98
  const htmlType = field.type === "email" ? "email" : field.type === "password" ? "password" : field.type === "url" ? "url" : "text";
99
99
  const isDisabled = disabled || field.disabled || field.readonly;
@@ -109,6 +109,7 @@ function TextLike({
109
109
  readOnly: field.readonly === true,
110
110
  required: field.required === true,
111
111
  "aria-describedby": describedBy,
112
+ "aria-invalid": invalid || void 0,
112
113
  onChange: (e) => onChange(e.target.value)
113
114
  }
114
115
  );
@@ -119,7 +120,8 @@ function Textarea({
119
120
  onChange,
120
121
  disabled,
121
122
  inputId,
122
- describedBy
123
+ describedBy,
124
+ invalid
123
125
  }) {
124
126
  return /* @__PURE__ */ jsx(
125
127
  "textarea",
@@ -133,6 +135,7 @@ function Textarea({
133
135
  required: field.required === true,
134
136
  rows: 4,
135
137
  "aria-describedby": describedBy,
138
+ "aria-invalid": invalid || void 0,
136
139
  onChange: (e) => onChange(e.target.value)
137
140
  }
138
141
  );
@@ -143,7 +146,8 @@ function NumericInput({
143
146
  onChange,
144
147
  disabled,
145
148
  inputId,
146
- describedBy
149
+ describedBy,
150
+ invalid
147
151
  }) {
148
152
  return /* @__PURE__ */ jsx(
149
153
  "input",
@@ -157,6 +161,7 @@ function NumericInput({
157
161
  readOnly: field.readonly === true,
158
162
  required: field.required === true,
159
163
  "aria-describedby": describedBy,
164
+ "aria-invalid": invalid || void 0,
160
165
  onChange: (e) => {
161
166
  const raw = e.target.value;
162
167
  if (raw === "") {
@@ -175,7 +180,8 @@ function Checkbox({
175
180
  onChange,
176
181
  disabled,
177
182
  inputId,
178
- describedBy
183
+ describedBy,
184
+ invalid
179
185
  }) {
180
186
  return /* @__PURE__ */ jsx(
181
187
  "input",
@@ -186,6 +192,7 @@ function Checkbox({
186
192
  checked: value === true,
187
193
  disabled: disabled || field.disabled || field.readonly,
188
194
  "aria-describedby": describedBy,
195
+ "aria-invalid": invalid || void 0,
189
196
  onChange: (e) => onChange(e.target.checked)
190
197
  }
191
198
  );
@@ -201,7 +208,8 @@ function SelectInput({
201
208
  onChange,
202
209
  disabled,
203
210
  inputId,
204
- describedBy
211
+ describedBy,
212
+ invalid
205
213
  }) {
206
214
  const options = normaliseOptions(field.props.options);
207
215
  return /* @__PURE__ */ jsxs(
@@ -213,6 +221,7 @@ function SelectInput({
213
221
  disabled: disabled || field.disabled || field.readonly,
214
222
  required: field.required === true,
215
223
  "aria-describedby": describedBy,
224
+ "aria-invalid": invalid || void 0,
216
225
  onChange: (e) => onChange(e.target.value === "" ? null : e.target.value),
217
226
  children: [
218
227
  field.placeholder && /* @__PURE__ */ jsx("option", { value: "", children: field.placeholder }),
@@ -227,7 +236,8 @@ function MultiSelectInput({
227
236
  onChange,
228
237
  disabled,
229
238
  inputId,
230
- describedBy
239
+ describedBy,
240
+ invalid
231
241
  }) {
232
242
  const arr = Array.isArray(value) ? value : [];
233
243
  const options = field.type === "multiSelect" ? normaliseOptions(field.props.options) : [];
@@ -240,6 +250,7 @@ function MultiSelectInput({
240
250
  value: arr.map(String),
241
251
  disabled: disabled || field.disabled || field.readonly,
242
252
  "aria-describedby": describedBy,
253
+ "aria-invalid": invalid || void 0,
243
254
  onChange: (e) => {
244
255
  const next = Array.from(e.target.selectedOptions, (o) => o.value);
245
256
  onChange(next);
@@ -254,7 +265,8 @@ function RadioGroup({
254
265
  onChange,
255
266
  disabled,
256
267
  inputId,
257
- describedBy
268
+ describedBy,
269
+ invalid
258
270
  }) {
259
271
  return /* @__PURE__ */ jsx(
260
272
  "div",
@@ -262,6 +274,7 @@ function RadioGroup({
262
274
  id: inputId,
263
275
  className: "flex flex-col gap-1",
264
276
  "aria-describedby": describedBy,
277
+ "aria-invalid": invalid || void 0,
265
278
  role: "radiogroup",
266
279
  children: (field.props.options ?? []).map((opt) => /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2 text-sm", children: [
267
280
  /* @__PURE__ */ jsx(
@@ -286,8 +299,10 @@ function BelongsToInput({
286
299
  onChange,
287
300
  disabled,
288
301
  inputId,
289
- describedBy
302
+ describedBy,
303
+ invalid
290
304
  }) {
305
+ const t = useArqelTranslations();
291
306
  return /* @__PURE__ */ jsx(
292
307
  "input",
293
308
  {
@@ -295,10 +310,13 @@ function BelongsToInput({
295
310
  type: "text",
296
311
  className: inputClasses,
297
312
  value: value === null || value === void 0 ? "" : String(value),
298
- placeholder: field.placeholder ?? `Search ${field.props.relatedResource}\u2026`,
313
+ placeholder: field.placeholder ?? t("form.placeholder.search_relation", `Search ${field.props.relatedResource}\u2026`, {
314
+ resource: field.props.relatedResource
315
+ }),
299
316
  disabled: disabled || field.disabled || field.readonly,
300
317
  readOnly: field.readonly === true,
301
318
  "aria-describedby": describedBy,
319
+ "aria-invalid": invalid || void 0,
302
320
  onChange: (e) => onChange(e.target.value === "" ? null : e.target.value)
303
321
  }
304
322
  );
@@ -309,7 +327,8 @@ function DateInput({
309
327
  onChange,
310
328
  disabled,
311
329
  inputId,
312
- describedBy
330
+ describedBy,
331
+ invalid
313
332
  }) {
314
333
  return /* @__PURE__ */ jsx(
315
334
  "input",
@@ -322,6 +341,7 @@ function DateInput({
322
341
  readOnly: field.readonly === true,
323
342
  required: field.required === true,
324
343
  "aria-describedby": describedBy,
344
+ "aria-invalid": invalid || void 0,
325
345
  onChange: (e) => onChange(e.target.value === "" ? null : e.target.value)
326
346
  }
327
347
  );
@@ -331,7 +351,8 @@ function FileInput({
331
351
  onChange,
332
352
  disabled,
333
353
  inputId,
334
- describedBy
354
+ describedBy,
355
+ invalid
335
356
  }) {
336
357
  return /* @__PURE__ */ jsx(
337
358
  "input",
@@ -341,16 +362,18 @@ function FileInput({
341
362
  className: "text-sm",
342
363
  disabled: disabled || field.disabled || field.readonly,
343
364
  "aria-describedby": describedBy,
365
+ "aria-invalid": invalid || void 0,
344
366
  onChange: (e) => onChange(e.target.files?.[0] ?? null)
345
367
  }
346
368
  );
347
369
  }
348
370
  function FieldRenderer(props) {
349
371
  const { field, errors, className } = props;
372
+ const t = useArqelTranslations();
350
373
  const id = useId();
351
374
  const errorId = `${id}-error`;
352
375
  const helperId = `${id}-helper`;
353
- const hasError = errors && errors.length > 0;
376
+ const hasError = errors !== void 0 && errors.length > 0;
354
377
  const Custom = field.component ? getFieldComponent(field.component) : void 0;
355
378
  const Input = Custom ?? NativeFieldInput;
356
379
  const describedBy = [field.helperText ? helperId : null, hasError ? errorId : null].filter(Boolean).join(" ");
@@ -363,9 +386,20 @@ function FieldRenderer(props) {
363
386
  children: [
364
387
  field.label !== null && field.label !== "" && /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "text-sm font-medium", children: [
365
388
  field.label,
366
- field.required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-0.5 text-destructive", children: "*" })
389
+ field.required && /* @__PURE__ */ jsxs(Fragment, { children: [
390
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-0.5 text-destructive", children: "*" }),
391
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: ` (${t("form.required", "Required")})` })
392
+ ] })
367
393
  ] }),
368
- /* @__PURE__ */ jsx(Input, { ...props, inputId: id, describedBy: describedBy || void 0 }),
394
+ /* @__PURE__ */ jsx(
395
+ Input,
396
+ {
397
+ ...props,
398
+ inputId: id,
399
+ describedBy: describedBy || void 0,
400
+ invalid: hasError || void 0
401
+ }
402
+ ),
369
403
  field.helperText && !hasError && /* @__PURE__ */ jsx("p", { id: helperId, className: "text-xs text-muted-foreground", children: field.helperText }),
370
404
  hasError && /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "text-xs text-destructive", children: errors[0] })
371
405
  ]
@@ -416,6 +450,7 @@ function gridColsClass(columns) {
416
450
  return parts.join(" ");
417
451
  }
418
452
  function FormSection({ config, children, className }) {
453
+ const t = useArqelTranslations();
419
454
  const [open, setOpen] = useState(!config.collapsed);
420
455
  const collapsible = config.collapsible === true;
421
456
  const heading = /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
@@ -430,7 +465,7 @@ function FormSection({ config, children, className }) {
430
465
  "aria-expanded": open,
431
466
  onClick: () => setOpen((v) => !v),
432
467
  className: "text-sm text-muted-foreground hover:underline",
433
- children: open ? "Hide" : "Show"
468
+ children: open ? t("form.section.hide", "Hide") : t("form.section.show", "Show")
434
469
  }
435
470
  )
436
471
  ] });
@@ -640,5 +675,5 @@ function FormRenderer({
640
675
  }
641
676
 
642
677
  export { FieldRenderer, FormFieldset, FormGrid, FormRenderer, FormSection, FormTabs, NativeFieldInput, clearFieldRegistry, getFieldComponent, getRegisteredFields, registerField, unregisterField };
643
- //# sourceMappingURL=chunk-ZAM5TUPP.js.map
644
- //# sourceMappingURL=chunk-ZAM5TUPP.js.map
678
+ //# sourceMappingURL=chunk-CMNZLA32.js.map
679
+ //# sourceMappingURL=chunk-CMNZLA32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/form/FieldRegistry.tsx","../src/form/nativeFields.tsx","../src/form/FieldRenderer.tsx","../src/form/FormFieldset.tsx","../src/form/FormGrid.tsx","../src/form/FormSection.tsx","../src/form/FormTabs.tsx","../src/form/FormRenderer.tsx"],"names":["useArqelTranslations","jsxs","jsx","Fragment","useState","useId"],"mappings":";;;;;;;AAeA,IAAM,QAAA,uBAAe,GAAA,EAA4B;AAE1C,SAAS,aAAA,CAAc,MAAc,SAAA,EAAiC;AAC3E,EAAA,QAAA,CAAS,GAAA,CAAI,MAAM,SAAS,CAAA;AAC9B;AAEO,SAAS,kBAAkB,IAAA,EAA0C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,KAAA,EAAO,IAAI,KAAA,CAAM,KAAA;AAAA,UACjB,OAAA,EAAS,cAAA,CAAe,GAAA,CAAI,MAAM,CAAA,oBAAKA,GAAAA,CAAC,MAAA,EAAA,EAAA,EAAU,CAAA,IAAA,EAAO,GAAA,CAAI,KAAA,CAAM,EAAE,CAAA,MAAA,CAAU;AAAA,SACjF,CAAE,CAAA;AACJ,QAAA,uBAAOA,GAAAA,CAAC,QAAA,EAAA,EAAmB,QAAQ,KAAA,CAAM,KAAA,EAAO,QAA1B,GAAsC,CAAA;AAAA,MAC9D;AAAA,MACA,KAAK,KAAA;AAGH,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAA;AAEA,EAAA,MAAM,OAAA,GAAU,OAAO,OAAA,IAAW,CAAA;AAElC,EAAA,uBACEA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAgB,EAAA;AAAA,MAChB,SAAA,EAAW,EAAA,CAAG,YAAA,EAAc,SAAS,CAAA;AAAA,MACrC,KAAA,EACE,UAAU,CAAA,GAAI,EAAE,qBAAqB,CAAA,OAAA,EAAU,OAAO,qBAAoB,GAAI,MAAA;AAAA,MAG/E,QAAA,EAAA,MAAA,CAAO,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,EAAO,CAAA,KAAM,WAAA,CAAY,KAAA,EAAO,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC;AAAA;AAAA,GAC7D;AAEJ","file":"chunk-CMNZLA32.js","sourcesContent":["/**\n * `FieldRegistry` — name → React component mapping for FieldRenderer.\n *\n * `@arqel-dev/fields` (FIELDS-JS-*) calls `registerField` at module init to\n * plug rich inputs in; until then FieldRenderer falls back to the\n * native HTML primitives in `nativeFields.tsx`. Registration is global\n * by design — apps can override Arqel defaults by re-registering with\n * the same name.\n */\n\nimport type { ComponentType } from 'react';\nimport type { FieldRendererProps } from './FieldRenderer.js';\n\nexport type FieldComponent = ComponentType<FieldRendererProps>;\n\nconst registry = new Map<string, FieldComponent>();\n\nexport function registerField(name: string, component: FieldComponent): void {\n registry.set(name, component);\n}\n\nexport function getFieldComponent(name: string): FieldComponent | undefined {\n return registry.get(name);\n}\n\nexport function unregisterField(name: string): void {\n registry.delete(name);\n}\n\nexport function getRegisteredFields(): string[] {\n return Array.from(registry.keys()).sort();\n}\n\n/** Test-only helper. */\nexport function clearFieldRegistry(): void {\n registry.clear();\n}\n","/**\n * Native HTML fallback inputs — used until `@arqel-dev/fields` registers\n * richer impls. One renderer per FieldSchema discriminant.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type {\n BelongsToFieldSchema,\n BooleanFieldSchema,\n CurrencyFieldSchema,\n DateFieldSchema,\n DateTimeFieldSchema,\n EmailFieldSchema,\n FieldSchema,\n HasManyFieldSchema,\n MultiSelectFieldSchema,\n NumberFieldSchema,\n PasswordFieldSchema,\n RadioFieldSchema,\n SelectFieldSchema,\n SlugFieldSchema,\n TextareaFieldSchema,\n TextFieldSchema,\n ToggleFieldSchema,\n UrlFieldSchema,\n} from '@arqel-dev/types/fields';\nimport { cn } from '../utils/cn.js';\n\nexport interface NativeProps {\n field: FieldSchema;\n value: unknown;\n onChange: (value: unknown) => void;\n disabled?: boolean | undefined;\n errors?: string[] | undefined;\n className?: string | undefined;\n inputId?: string | undefined;\n describedBy?: string | undefined;\n /** When true, the control is in an error state — sets `aria-invalid`. */\n invalid?: boolean | undefined;\n}\n\nconst inputClasses = cn(\n 'h-9 rounded-sm border border-[var(--input)]',\n 'bg-background px-3 text-sm',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n);\n\nexport function NativeFieldInput(props: NativeProps) {\n const { field } = props;\n\n switch (field.type) {\n case 'text':\n case 'email':\n case 'url':\n case 'password':\n case 'slug':\n return <TextLike {...props} field={field} />;\n case 'textarea':\n return <Textarea {...props} field={field} />;\n case 'number':\n case 'currency':\n return <NumericInput {...props} field={field} />;\n case 'boolean':\n case 'toggle':\n return <Checkbox {...props} field={field} />;\n case 'select':\n return <SelectInput {...props} field={field} />;\n case 'multiSelect':\n case 'hasMany':\n return <MultiSelectInput {...props} field={field} />;\n case 'radio':\n return <RadioGroup {...props} field={field} />;\n case 'belongsTo':\n return <BelongsToInput {...props} field={field} />;\n case 'date':\n case 'dateTime':\n return <DateInput {...props} field={field} />;\n case 'file':\n case 'image':\n return <FileInput {...props} />;\n default:\n return <UnregisteredField field={field} />;\n }\n}\n\n/**\n * Visible fallback when a field's `type` has no native input. This usually\n * means the field declared a custom `component` whose `/register` module was\n * never imported, so `getFieldComponent` returned undefined and we fell\n * through here. Instead of rendering nothing (a bare label, no control, no\n * diagnostic — #233), surface an inline notice and warn in the console.\n */\nfunction UnregisteredField({ field }: { field: FieldSchema }) {\n const t = useArqelTranslations();\n if (field.component) {\n console.warn(\n `[arqel] field \"${field.name}\" uses unregistered component \"${field.component}\" — ` +\n 'did you import its /register module?',\n );\n } else {\n console.warn(`[arqel] field \"${field.name}\" has no native input for type \"${field.type}\".`);\n }\n const detail = field.component\n ? `unregistered component \"${field.component}\"`\n : `unsupported type \"${field.type}\"`;\n return (\n <p\n data-testid=\"arqel-unregistered-field\"\n role=\"alert\"\n className=\"rounded-sm border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n {t('form.unregistered_field', `Field \"${field.name}\" could not render: ${detail}.`, {\n name: field.name,\n detail,\n })}\n </p>\n );\n}\n\n/* ─── primitives ─────────────────────────────────────────────────── */\n\ntype TextLikeField =\n | TextFieldSchema\n | EmailFieldSchema\n | UrlFieldSchema\n | PasswordFieldSchema\n | SlugFieldSchema;\n\nfunction TextLike({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: TextLikeField }) {\n const htmlType =\n field.type === 'email'\n ? 'email'\n : field.type === 'password'\n ? 'password'\n : field.type === 'url'\n ? 'url'\n : 'text';\n const isDisabled = disabled || field.disabled || field.readonly;\n return (\n <input\n id={inputId}\n type={htmlType}\n className={inputClasses}\n value={typeof value === 'string' ? value : ((value ?? '')?.toString() ?? '')}\n placeholder={field.placeholder ?? undefined}\n disabled={isDisabled}\n readOnly={field.readonly === true}\n required={field.required === true}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.value)}\n />\n );\n}\n\nfunction Textarea({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: TextareaFieldSchema }) {\n return (\n <textarea\n id={inputId}\n className={cn(inputClasses, 'h-auto min-h-[5rem] py-2')}\n value={typeof value === 'string' ? value : ''}\n placeholder={field.placeholder ?? undefined}\n disabled={disabled || field.disabled || field.readonly}\n readOnly={field.readonly === true}\n required={field.required === true}\n rows={4}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.value)}\n />\n );\n}\n\nfunction NumericInput({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: NumberFieldSchema | CurrencyFieldSchema }) {\n return (\n <input\n id={inputId}\n type=\"number\"\n className={inputClasses}\n value={value === null || value === undefined ? '' : String(value)}\n placeholder={field.placeholder ?? undefined}\n disabled={disabled || field.disabled || field.readonly}\n readOnly={field.readonly === true}\n required={field.required === true}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => {\n const raw = e.target.value;\n if (raw === '') {\n onChange(null);\n return;\n }\n const num = Number(raw);\n onChange(Number.isNaN(num) ? null : num);\n }}\n />\n );\n}\n\nfunction Checkbox({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: BooleanFieldSchema | ToggleFieldSchema }) {\n return (\n <input\n id={inputId}\n type=\"checkbox\"\n className=\"h-4 w-4 rounded border-[var(--input)]\"\n checked={value === true}\n disabled={disabled || field.disabled || field.readonly}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.checked)}\n />\n );\n}\n\nfunction normaliseOptions(\n options: SelectFieldSchema['props']['options'] | undefined,\n): Array<{ value: string | number; label: string }> {\n if (!options) return [];\n if (Array.isArray(options)) return options;\n return Object.entries(options).map(([value, label]) => ({ value, label }));\n}\n\nfunction SelectInput({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: SelectFieldSchema }) {\n const options = normaliseOptions(field.props.options);\n return (\n <select\n id={inputId}\n className={inputClasses}\n value={value === null || value === undefined ? '' : String(value)}\n disabled={disabled || field.disabled || field.readonly}\n required={field.required === true}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.value === '' ? null : e.target.value)}\n >\n {field.placeholder && <option value=\"\">{field.placeholder}</option>}\n {options.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n );\n}\n\nfunction MultiSelectInput({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: MultiSelectFieldSchema | HasManyFieldSchema }) {\n const arr = Array.isArray(value) ? (value as Array<string | number>) : [];\n const options = field.type === 'multiSelect' ? normaliseOptions(field.props.options) : [];\n return (\n <select\n id={inputId}\n multiple\n className={cn(inputClasses, 'h-auto min-h-[6rem] py-1')}\n value={arr.map(String)}\n disabled={disabled || field.disabled || field.readonly}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => {\n const next = Array.from(e.target.selectedOptions, (o) => o.value);\n onChange(next);\n }}\n >\n {options.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n );\n}\n\nfunction RadioGroup({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: RadioFieldSchema }) {\n return (\n <div\n id={inputId}\n className=\"flex flex-col gap-1\"\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n role=\"radiogroup\"\n >\n {(field.props.options ?? []).map((opt) => (\n <label key={opt.value} className=\"inline-flex items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name={field.name}\n value={String(opt.value)}\n checked={String(value ?? '') === String(opt.value)}\n disabled={disabled || field.disabled || field.readonly}\n onChange={() => onChange(opt.value)}\n />\n {opt.label}\n </label>\n ))}\n </div>\n );\n}\n\nfunction BelongsToInput({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: BelongsToFieldSchema }) {\n const t = useArqelTranslations();\n // Phase 1 fallback: native text input. The full async-search picker\n // ships in `@arqel-dev/fields/BelongsToField` and registers via FieldRegistry.\n return (\n <input\n id={inputId}\n type=\"text\"\n className={inputClasses}\n value={value === null || value === undefined ? '' : String(value)}\n placeholder={\n field.placeholder ??\n t('form.placeholder.search_relation', `Search ${field.props.relatedResource}…`, {\n resource: field.props.relatedResource,\n })\n }\n disabled={disabled || field.disabled || field.readonly}\n readOnly={field.readonly === true}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.value === '' ? null : e.target.value)}\n />\n );\n}\n\nfunction DateInput({\n field,\n value,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: DateFieldSchema | DateTimeFieldSchema }) {\n return (\n <input\n id={inputId}\n type={field.type === 'dateTime' ? 'datetime-local' : 'date'}\n className={inputClasses}\n value={typeof value === 'string' ? value : ''}\n disabled={disabled || field.disabled || field.readonly}\n readOnly={field.readonly === true}\n required={field.required === true}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.value === '' ? null : e.target.value)}\n />\n );\n}\n\nfunction FileInput({\n field,\n onChange,\n disabled,\n inputId,\n describedBy,\n invalid,\n}: NativeProps & { field: FieldSchema }) {\n return (\n <input\n id={inputId}\n type=\"file\"\n className=\"text-sm\"\n disabled={disabled || field.disabled || field.readonly}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n onChange={(e) => onChange(e.target.files?.[0] ?? null)}\n />\n );\n}\n","/**\n * `<FieldRenderer>` — renders a single field.\n *\n * Resolution order:\n * 1. Component registered via `registerField(field.component)` (rich\n * inputs from `@arqel-dev/fields`)\n * 2. Native fallback dispatched by `field.type` (text/number/boolean/...)\n *\n * Errors come from `errors[name]` (Inertia or client). The component\n * also honours `disabled` / `readonly` / `required` from the schema.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type { FieldSchema } from '@arqel-dev/types/fields';\nimport { type ChangeEvent, type ReactNode, useId } from 'react';\nimport { cn } from '../utils/cn.js';\nimport { getFieldComponent } from './FieldRegistry.js';\nimport { NativeFieldInput } from './nativeFields.js';\n\nexport interface FieldRendererProps {\n field: FieldSchema;\n value: unknown;\n onChange: (value: unknown) => void;\n errors?: string[] | undefined;\n disabled?: boolean | undefined;\n className?: string | undefined;\n inputId?: string | undefined;\n describedBy?: string | undefined;\n /** Whether the field is in an error state (sets `aria-invalid` on the input). */\n invalid?: boolean | undefined;\n}\n\nexport function FieldRenderer(props: FieldRendererProps): ReactNode {\n const { field, errors, className } = props;\n const t = useArqelTranslations();\n const id = useId();\n const errorId = `${id}-error`;\n const helperId = `${id}-helper`;\n const hasError = errors !== undefined && errors.length > 0;\n\n const Custom = field.component ? getFieldComponent(field.component) : undefined;\n const Input = Custom ?? (NativeFieldInput as typeof NativeFieldInput);\n\n const describedBy = [field.helperText ? helperId : null, hasError ? errorId : null]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div\n data-arqel-field={field.name}\n data-field-type={field.type}\n className={cn('flex flex-col gap-1', className)}\n >\n {field.label !== null && field.label !== '' && (\n <label htmlFor={id} className=\"text-sm font-medium\">\n {field.label}\n {field.required && (\n <>\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n <span className=\"sr-only\">{` (${t('form.required', 'Required')})`}</span>\n </>\n )}\n </label>\n )}\n <Input\n {...props}\n inputId={id}\n describedBy={describedBy || undefined}\n invalid={hasError || undefined}\n />\n {field.helperText && !hasError && (\n <p id={helperId} className=\"text-xs text-muted-foreground\">\n {field.helperText}\n </p>\n )}\n {hasError && (\n <p id={errorId} role=\"alert\" className=\"text-xs text-destructive\">\n {errors[0]}\n </p>\n )}\n </div>\n );\n}\n\n/* ─── helpers ────────────────────────────────────────────────────── */\n\nexport function asInputChange<T>(\n cast: (raw: string) => T,\n): (event: ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => T {\n return (event) => cast(event.target.value);\n}\n","/**\n * `<FormFieldset>` — semantic `<fieldset>` with grid body.\n */\n\nimport type { FieldsetProps } from '@arqel-dev/types/forms';\nimport type { ReactNode } from 'react';\nimport { cn } from '../utils/cn.js';\n\nexport interface FormFieldsetProps {\n config: FieldsetProps;\n children: ReactNode;\n className?: string;\n}\n\nexport function FormFieldset({ config, children, className }: FormFieldsetProps) {\n return (\n <fieldset className={cn('rounded-md border border-border p-4', className)}>\n <legend className=\"px-1 text-sm font-medium\">{config.legend}</legend>\n <div\n className=\"grid gap-4\"\n style={{ gridTemplateColumns: `repeat(${config.columns ?? 1}, minmax(0, 1fr))` }}\n >\n {children}\n </div>\n </fieldset>\n );\n}\n","/**\n * `<FormGrid>` — responsive CSS-grid container.\n */\n\nimport type { GridProps } from '@arqel-dev/types/forms';\nimport type { ReactNode } from 'react';\nimport { cn } from '../utils/cn.js';\n\nexport interface FormGridProps {\n config: GridProps;\n children: ReactNode;\n className?: string;\n}\n\nconst BREAKPOINT_PREFIX: Record<string, string> = {\n sm: 'sm:',\n md: 'md:',\n lg: 'lg:',\n xl: 'xl:',\n '2xl': '2xl:',\n};\n\nexport function FormGrid({ config, children, className }: FormGridProps) {\n return (\n <div\n className={cn('grid', gridColsClass(config.columns), className)}\n style={{ gap: config.gap ?? '1rem' }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Emit responsive Tailwind column classes from a flat int or a\n * `{sm,md,lg,xl,2xl}` map. Mirrors `<DashboardGrid>`'s generator so a\n * `{sm:1, md:2, lg:3}` map genuinely reflows (1 col on mobile → multi-col on\n * desktop) instead of locking to a single inline `grid-template-columns` value.\n */\nfunction gridColsClass(columns: GridProps['columns']): string {\n if (typeof columns === 'number') {\n return `grid-cols-${Math.max(1, Math.min(12, columns))}`;\n }\n // Base fallback = 1 column on the smallest screens.\n const parts: string[] = ['grid-cols-1'];\n for (const bp of ['sm', 'md', 'lg', 'xl', '2xl'] as const) {\n const value = columns[bp];\n if (typeof value === 'number') {\n parts.push(`${BREAKPOINT_PREFIX[bp]}grid-cols-${Math.max(1, Math.min(12, value))}`);\n }\n }\n return parts.join(' ');\n}\n","/**\n * `<FormSection>` — heading + optional description + collapsible body.\n *\n * Renders a SectionEntry. Aside layout (heading on the left, body on the\n * right) ships behind the `aside` prop so wide forms can read like docs.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type { SectionProps } from '@arqel-dev/types/forms';\nimport { type ReactNode, useState } from 'react';\nimport { cn } from '../utils/cn.js';\n\nexport interface FormSectionProps {\n config: SectionProps;\n children: ReactNode;\n className?: string;\n}\n\nexport function FormSection({ config, children, className }: FormSectionProps) {\n const t = useArqelTranslations();\n const [open, setOpen] = useState(!config.collapsed);\n const collapsible = config.collapsible === true;\n\n const heading = (\n <div className=\"flex items-start gap-2\">\n <div className=\"flex-1\">\n <h3 className=\"text-sm font-semibold\">{config.heading}</h3>\n {config.description && (\n <p className=\"text-xs text-muted-foreground\">{config.description}</p>\n )}\n </div>\n {collapsible && (\n <button\n type=\"button\"\n aria-expanded={open}\n onClick={() => setOpen((v) => !v)}\n className=\"text-sm text-muted-foreground hover:underline\"\n >\n {open ? t('form.section.hide', 'Hide') : t('form.section.show', 'Show')}\n </button>\n )}\n </div>\n );\n\n const body = open && (\n <div\n className=\"grid gap-4\"\n style={{ gridTemplateColumns: `repeat(${config.columns ?? 1}, minmax(0, 1fr))` }}\n >\n {children}\n </div>\n );\n\n return (\n <section\n data-arqel-section=\"\"\n className={cn(\n 'rounded-md border border-border bg-background',\n config.compact ? 'p-3' : 'p-4',\n className,\n )}\n >\n {config.aside ? (\n <div className=\"grid gap-4 md:grid-cols-[16rem_1fr]\">\n <div>{heading}</div>\n <div>{body}</div>\n </div>\n ) : (\n <>\n <div className=\"mb-3\">{heading}</div>\n {body}\n </>\n )}\n </section>\n );\n}\n","/**\n * `<FormTabs>` — minimal tabs implementation (Phase 1).\n *\n * UI-002+ wires Base UI Tabs primitive properly; this Phase 1 version\n * is keyboard-accessible (Arrow keys + Home/End) but doesn't yet support\n * lazy mounting or controlled mode.\n */\n\nimport type { TabsProps } from '@arqel-dev/types/forms';\nimport { type ReactElement, type ReactNode, useId, useRef, useState } from 'react';\nimport { cn } from '../utils/cn.js';\n\nexport interface FormTabConfig {\n id: string;\n label: string;\n badge?: number | undefined;\n content: ReactNode;\n}\n\nexport interface FormTabsProps {\n config: TabsProps;\n tabs: FormTabConfig[];\n className?: string;\n}\n\nexport function FormTabs({ config, tabs, className }: FormTabsProps): ReactElement | null {\n const [active, setActive] = useState(config.defaultTab ?? tabs[0]?.id ?? null);\n const baseId = useId();\n const refs = useRef<(HTMLButtonElement | null)[]>([]);\n\n if (tabs.length === 0 || active === null) return null;\n const activeIndex = Math.max(\n 0,\n tabs.findIndex((t) => t.id === active),\n );\n const activeTab = tabs[activeIndex];\n if (!activeTab) return null;\n\n const focus = (i: number) => {\n const target = tabs[i];\n if (!target) return;\n setActive(target.id);\n refs.current[i]?.focus();\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n focus((activeIndex + 1) % tabs.length);\n } else if (e.key === 'ArrowLeft') {\n e.preventDefault();\n focus((activeIndex - 1 + tabs.length) % tabs.length);\n } else if (e.key === 'Home') {\n e.preventDefault();\n focus(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n focus(tabs.length - 1);\n }\n };\n\n return (\n <div className={className}>\n <div\n role=\"tablist\"\n aria-orientation={config.orientation}\n className=\"flex gap-1 border-b border-border\"\n >\n {tabs.map((tab, i) => {\n const selected = tab.id === active;\n return (\n <button\n key={tab.id}\n ref={(el) => {\n refs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={`${baseId}-tab-${tab.id}`}\n aria-controls={`${baseId}-panel-${tab.id}`}\n aria-selected={selected}\n tabIndex={selected ? 0 : -1}\n onClick={() => setActive(tab.id)}\n onKeyDown={onKeyDown}\n className={cn(\n '-mb-px inline-flex min-h-11 items-center border-b-2 px-3 py-2 text-sm transition-colors',\n selected\n ? 'border-primary font-medium text-foreground'\n : 'border-transparent text-muted-foreground hover:text-foreground',\n )}\n >\n {tab.label}\n {tab.badge !== undefined && tab.badge !== null && (\n <span className=\"ml-1 rounded-full bg-muted px-1.5 text-xs\">{tab.badge}</span>\n )}\n </button>\n );\n })}\n </div>\n <div\n role=\"tabpanel\"\n id={`${baseId}-panel-${activeTab.id}`}\n aria-labelledby={`${baseId}-tab-${activeTab.id}`}\n className=\"pt-4\"\n >\n {activeTab.content}\n </div>\n </div>\n );\n}\n","/**\n * `<FormRenderer>` — recursive walker over `FormSchema`.\n *\n * Each `SchemaEntry` dispatches to the matching layout component\n * (`Section`, `Fieldset`, `Grid`, `Tabs`, …) or to `<FieldRenderer>`\n * when it's a leaf. `Tabs` collects child `Tab` entries so the\n * keyboard-accessible `<FormTabs>` can render them as panels.\n *\n * The renderer is *presentational*: state lives in the caller (typically\n * `useArqelForm`). `value(name)` and `setValue(name, value)` resolve\n * field state, while `errors[name]` carries server/client validation\n * messages.\n */\n\nimport type { FieldSchema } from '@arqel-dev/types/fields';\nimport {\n type FieldEntry,\n type FormSchema,\n isFieldEntry,\n isLayoutEntry,\n type LayoutEntry,\n type SchemaEntry,\n type TabEntry,\n} from '@arqel-dev/types/forms';\nimport type { ReactNode } from 'react';\nimport { cn } from '../utils/cn.js';\nimport { FieldRenderer } from './FieldRenderer.js';\nimport { FormFieldset } from './FormFieldset.js';\nimport { FormGrid } from './FormGrid.js';\nimport { FormSection } from './FormSection.js';\nimport { type FormTabConfig, FormTabs } from './FormTabs.js';\n\nexport interface FormRendererProps {\n schema: FormSchema;\n fields: FieldSchema[];\n values: Record<string, unknown>;\n errors?: Record<string, string[]>;\n onChange: (name: string, value: unknown) => void;\n disabled?: boolean;\n className?: string;\n}\n\nexport function FormRenderer({\n schema,\n fields,\n values,\n errors = {},\n onChange,\n disabled = false,\n className,\n}: FormRendererProps) {\n // Resolve each schema entry to its OWN field object. A name-keyed Map\n // would silently collapse two fields sharing a `name` (e.g. a `status`\n // text + a `status` select) onto the last one, dropping a control. We\n // instead consume matching fields positionally — preferring an exact\n // (name, type) match and never reusing an already-claimed field — so\n // duplicate-named entries each render their distinct schema (#233).\n const remaining = [...fields];\n\n const claimField = (entry: FieldEntry): FieldSchema | undefined => {\n let idx = remaining.findIndex((f) => f.name === entry.name && f.type === entry.type);\n if (idx === -1) idx = remaining.findIndex((f) => f.name === entry.name);\n if (idx === -1) return undefined;\n return remaining.splice(idx, 1)[0];\n };\n\n const renderEntry = (entry: SchemaEntry, key: string): ReactNode => {\n if (isFieldEntry(entry)) {\n return renderFieldEntry(entry, key);\n }\n if (isLayoutEntry(entry)) {\n return renderLayoutEntry(entry, key);\n }\n return null;\n };\n\n const renderFieldEntry = (entry: FieldEntry, key: string): ReactNode => {\n const field = claimField(entry);\n if (!field) return null;\n return (\n <FieldRenderer\n key={key}\n field={field}\n value={values[entry.name]}\n errors={errors[entry.name]}\n disabled={disabled || schema.disabled === true}\n onChange={(value) => onChange(entry.name, value)}\n />\n );\n };\n\n const renderChildren = (entries: SchemaEntry[] | undefined): ReactNode => {\n if (!entries) return null;\n return entries.map((child, i) => renderEntry(child, `${i}`));\n };\n\n const renderLayoutEntry = (entry: LayoutEntry, key: string): ReactNode => {\n switch (entry.type) {\n case 'section':\n return (\n <FormSection key={key} config={entry.props}>\n {renderChildren(entry.schema)}\n </FormSection>\n );\n case 'fieldset':\n return (\n <FormFieldset key={key} config={entry.props}>\n {renderChildren(entry.schema)}\n </FormFieldset>\n );\n case 'grid':\n case 'columns':\n return (\n <FormGrid\n key={key}\n config={entry.type === 'columns' ? { columns: entry.props.columns } : entry.props}\n >\n {renderChildren(entry.schema)}\n </FormGrid>\n );\n case 'group':\n return (\n <div\n key={key}\n className={cn(\n 'flex gap-4',\n entry.props.orientation === 'vertical' ? 'flex-col' : 'flex-row',\n )}\n >\n {renderChildren(entry.schema)}\n </div>\n );\n case 'tabs': {\n const tabs: FormTabConfig[] = (entry.schema ?? [])\n .filter((c): c is TabEntry => isLayoutEntry(c) && c.type === 'tab')\n .map((tab) => ({\n id: tab.props.id,\n label: tab.props.label,\n badge: tab.props.badge,\n content: renderChildren(tab.schema) ?? <span key={`tab-${tab.props.id}-empty`} />,\n }));\n return <FormTabs key={key} config={entry.props} tabs={tabs} />;\n }\n case 'tab':\n // Tabs collect their children directly; lone Tab entries are\n // a no-op to avoid rendering the same content twice.\n return null;\n }\n };\n\n const columns = schema.columns ?? 1;\n\n return (\n <div\n data-arqel-form=\"\"\n className={cn('grid gap-4', className)}\n style={\n columns > 1 ? { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` } : undefined\n }\n >\n {schema.schema.map((entry, i) => renderEntry(entry, `${i}`))}\n </div>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { TableToolbar, TableFilters, DataTable, TablePagination } from './chunk-AZICSFBA.js';
1
+ import { TableToolbar, TableFilters, DataTable, TablePagination } from './chunk-S5UNPCMQ.js';
2
2
  import { cn } from './chunk-B7ULUJVO.js';
3
3
  import { useArqelTranslations } from '@arqel-dev/react/utils';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -39,7 +39,11 @@ function ResourceIndex({
39
39
  "input",
40
40
  {
41
41
  type: "search",
42
- placeholder: `Search ${resource.pluralLabel.toLowerCase()}\u2026`,
42
+ placeholder: t(
43
+ "table.search.placeholder_for",
44
+ `Search ${resource.pluralLabel.toLowerCase()}\u2026`,
45
+ { resource: resource.pluralLabel.toLowerCase() }
46
+ ),
43
47
  className: "h-11 w-64 rounded-sm border border-[var(--input)] bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:h-9",
44
48
  value: search ?? "",
45
49
  onChange: (e) => onSearchChange(e.target.value)
@@ -111,5 +115,5 @@ function ResourceIndex({
111
115
  }
112
116
 
113
117
  export { ResourceIndex };
114
- //# sourceMappingURL=chunk-CVAMCRLL.js.map
115
- //# sourceMappingURL=chunk-CVAMCRLL.js.map
118
+ //# sourceMappingURL=chunk-EG2DASKR.js.map
119
+ //# sourceMappingURL=chunk-EG2DASKR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/ResourceIndex.tsx"],"names":[],"mappings":";;;;;AAiDO,SAAS,aAAA,CAAuD;AAAA,EACrE,QAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,cAAc,EAAC;AAAA,EACf,eAAe,EAAC;AAAA,EAChB,iBAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV;AACF,CAAA,EAAkC;AAChC,EAAA,MAAM,IAAI,oBAAA,EAAqB;AAC/B,EAAA,MAAM,eAAA,GAAkB,QAAQ,iBAAiB,CAAA;AAEjD,EAAA,MAAM,eAAe,MAAiB;AACpC,IAAA,IAAI,YAAY,OAAO,UAAA;AACvB,IAAA,IAAI,CAAC,gBAAgB,OAAO,IAAA;AAC5B,IAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAU,mDAAA,EACd,QAAA,EAAA;AAAA,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;AAAA,YACC,QAAQ,YAAA,EAAa;AAAA,YACrB,OAAA,EACE,OAAA,CAAQ,MAAA,GAAS,CAAA,mBACf,GAAA;AAAA,cAAC,YAAA;AAAA,cAAA;AAAA,gBACC,OAAA;AAAA,gBACA,MAAA,EAAQ,YAAA;AAAA,gBACR,UAAU,CAAC,IAAA,EAAM,KAAA,KAAU,cAAA,GAAiB,MAAM,KAAK,CAAA;AAAA,gBACvD,UAAA,EAAY;AAAA;AAAA,aACd,GACE,IAAA;AAAA,YAEN,eAAe,WAAA,CAAY,MAAA;AAAA,YAC3B,WAAA;AAAA,YACA,kBAAkB,iBAAA,GAAoB,MAAM,iBAAA,CAAkB,EAAE,CAAA,GAAI;AAAA;AAAA,SACtE;AAAA,wBAEA,GAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YACC,OAAA;AAAA,YACA,OAAA;AAAA,YACA,eAAA;AAAA,YACA,WAAA;AAAA,YACA,iBAAA;AAAA,YACA,IAAA,EAAM,cAAA;AAAA,YACN,YAAA;AAAA,YACA,YAAY,UAAA,GAAa,CAAC,MAAA,KAAW,UAAA,CAAW,MAAiB,CAAA,GAAI,MAAA;AAAA,YACrE,OAAA;AAAA,YACA;AAAA;AAAA,SACF;AAAA,QAEC,UAAA,oBACC,GAAA;AAAA,UAAC,eAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAM,UAAA;AAAA,YACN,YAAA,EAAc,CAAC,IAAA,KAAS,YAAA,GAAe,IAAI,CAAA;AAAA,YAC3C;AAAA;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-EG2DASKR.js","sourcesContent":["/**\n * `<ResourceIndex>` — page-level wrapper for index/listing routes.\n *\n * Wires `ResourceIndexProps` (server payload) into the table stack:\n * header (title + toolbar actions + create button)\n * → TableToolbar (search + filters + bulk bar)\n * → DataTable (with selection, sorting, row actions)\n * → TablePagination\n *\n * The component is presentational — selection / sort / page transitions\n * are lifted to props so the same shell can be reused by ResourceIndex\n * (Inertia-driven) and dashboard widgets (memory-driven).\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type { RecordType, ResourceIndexProps as ServerProps } from '@arqel-dev/types/resources';\nimport type { SortDirection, TableSort } from '@arqel-dev/types/tables';\nimport type { ReactNode } from 'react';\nimport { DataTable } from '../table/DataTable.js';\nimport { TableFilters } from '../table/TableFilters.js';\nimport { TablePagination } from '../table/TablePagination.js';\nimport { TableToolbar } from '../table/TableToolbar.js';\nimport { cn } from '../utils/cn.js';\n\ntype RowId = string | number;\n\nexport interface ResourceIndexUIProps<TRecord extends RecordType = RecordType>\n extends ServerProps<TRecord> {\n selectedIds?: ReadonlyArray<RowId>;\n onSelectionChange?: (ids: RowId[]) => void;\n onSortChange?: (column: string, direction: SortDirection) => void;\n onPageChange?: (page: number) => void;\n onPerPageChange?: (perPage: number) => void;\n onSearchChange?: (search: string) => void;\n onFilterChange?: (name: string, value: unknown) => void;\n onClearFilters?: () => void;\n\n filterValues?: Record<string, unknown>;\n\n searchSlot?: ReactNode;\n toolbarActions?: ReactNode;\n rowActions?: (record: TRecord) => ReactNode;\n bulkActions?: ReactNode;\n emptyState?: ReactNode;\n\n loading?: boolean;\n className?: string;\n}\n\nexport function ResourceIndex<TRecord extends RecordType = RecordType>({\n resource,\n records,\n pagination,\n columns,\n filters,\n search,\n sort,\n selectedIds = [],\n filterValues = {},\n onSelectionChange,\n onSortChange,\n onPageChange,\n onPerPageChange,\n onSearchChange,\n onFilterChange,\n onClearFilters,\n searchSlot,\n toolbarActions,\n rowActions,\n bulkActions,\n emptyState,\n loading = false,\n className,\n}: ResourceIndexUIProps<TRecord>) {\n const t = useArqelTranslations();\n const enableSelection = Boolean(onSelectionChange);\n\n const renderSearch = (): ReactNode => {\n if (searchSlot) return searchSlot;\n if (!onSearchChange) return null;\n return (\n <label className=\"flex flex-col gap-1 text-xs text-muted-foreground\">\n {t('table.search.label', 'Search')}\n <input\n type=\"search\"\n placeholder={t(\n 'table.search.placeholder_for',\n `Search ${resource.pluralLabel.toLowerCase()}…`,\n { resource: resource.pluralLabel.toLowerCase() },\n )}\n // 44px touch target on mobile (WCAG 2.5.5); dense 36px on >=md.\n className=\"h-11 w-64 rounded-sm border border-[var(--input)] bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:h-9\"\n value={search ?? ''}\n onChange={(e) => onSearchChange(e.target.value)}\n />\n </label>\n );\n };\n\n const normalisedSort: TableSort | null = sort?.column\n ? {\n column: sort.column,\n direction: sort.direction === 'desc' ? 'desc' : 'asc',\n }\n : null;\n\n return (\n <section\n className={cn(\n 'flex min-w-0 flex-col rounded-md border border-border bg-background',\n className,\n )}\n aria-label={resource.pluralLabel}\n >\n <header className=\"flex flex-wrap items-center gap-3 border-b border-border px-4 py-3\">\n <h1 className=\"text-lg font-semibold\">{resource.pluralLabel}</h1>\n <div className=\"ml-auto flex flex-wrap items-center gap-2\">{toolbarActions}</div>\n </header>\n\n <TableToolbar\n search={renderSearch()}\n filters={\n filters.length > 0 ? (\n <TableFilters\n filters={filters}\n values={filterValues}\n onChange={(name, value) => onFilterChange?.(name, value)}\n onClearAll={onClearFilters}\n />\n ) : null\n }\n selectedCount={selectedIds.length}\n bulkActions={bulkActions}\n onClearSelection={onSelectionChange ? () => onSelectionChange([]) : undefined}\n />\n\n <DataTable\n columns={columns}\n records={records as unknown as Array<{ id: RowId } & TRecord>}\n enableSelection={enableSelection}\n selectedIds={selectedIds}\n onSelectionChange={onSelectionChange}\n sort={normalisedSort}\n onSortChange={onSortChange}\n rowActions={rowActions ? (record) => rowActions(record as TRecord) : undefined}\n loading={loading}\n emptyState={emptyState}\n />\n\n {pagination && (\n <TablePagination\n meta={pagination}\n onPageChange={(page) => onPageChange?.(page)}\n onPerPageChange={onPerPageChange}\n />\n )}\n </section>\n );\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { cn } from './chunk-B7ULUJVO.js';
2
+ import { useArqelTranslations } from '@arqel-dev/react/utils';
2
3
  import { useEffect, useState, useCallback } from 'react';
3
4
  import { jsxs, jsx } from 'react/jsx-runtime';
4
5
  import { useFlash } from '@arqel-dev/hooks';
@@ -22,6 +23,7 @@ function FlashToast({
22
23
  durationMs = 5e3,
23
24
  className
24
25
  }) {
26
+ const t = useArqelTranslations();
25
27
  useEffect(() => {
26
28
  if (durationMs <= 0) return void 0;
27
29
  const id = window.setTimeout(onDismiss, durationMs);
@@ -45,7 +47,7 @@ function FlashToast({
45
47
  "button",
46
48
  {
47
49
  type: "button",
48
- "aria-label": "Dismiss",
50
+ "aria-label": t("arqel.aria.flash_dismiss", "Dismiss"),
49
51
  onClick: onDismiss,
50
52
  className: "text-muted-foreground hover:text-foreground",
51
53
  children: "\u2715"
@@ -97,5 +99,5 @@ function FlashContainer({
97
99
  }
98
100
 
99
101
  export { FlashContainer, FlashToast };
100
- //# sourceMappingURL=chunk-DSULVRB6.js.map
101
- //# sourceMappingURL=chunk-DSULVRB6.js.map
102
+ //# sourceMappingURL=chunk-GJ2FKAOM.js.map
103
+ //# sourceMappingURL=chunk-GJ2FKAOM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flash/FlashToast.tsx","../src/flash/FlashContainer.tsx"],"names":["jsx"],"mappings":";;;;;;AAsBA,IAAM,YAAA,GAA0C;AAAA,EAC9C,OAAA,EAAS,mEAAA;AAAA,EACT,KAAA,EAAO,yDAAA;AAAA,EACP,OAAA,EAAS,mEAAA;AAAA,EACT,IAAA,EAAM;AACR,CAAA;AAEA,IAAM,UAAA,GAAwC;AAAA,EAC5C,OAAA,EAAS,QAAA;AAAA,EACT,KAAA,EAAO,QAAA;AAAA,EACP,OAAA,EAAS,GAAA;AAAA,EACT,IAAA,EAAM;AACR,CAAA;AAEO,SAAS,UAAA,CAAW;AAAA,EACzB,IAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA,GAAa,GAAA;AAAA,EACb;AACF,CAAA,EAAoB;AAClB,EAAA,MAAM,IAAI,oBAA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,GACH;AAEJ","file":"chunk-GJ2FKAOM.js","sourcesContent":["/**\n * `<FlashToast>` — single auto-dismissing toast.\n *\n * Self-rendered (no `sonner` dep) so apps with strict bundle budgets\n * stay lean. Replaceable via FlashContainer's `renderToast` prop when\n * a richer library is preferred.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport { useEffect } from 'react';\nimport { cn } from '../utils/cn.js';\n\nexport type FlashKind = 'success' | 'error' | 'info' | 'warning';\n\nexport interface FlashToastProps {\n kind: FlashKind;\n message: string;\n onDismiss: () => void;\n durationMs?: number;\n className?: string;\n}\n\nconst KIND_CLASSES: Record<FlashKind, string> = {\n success: 'border-[var(--chart-2)]/60 bg-[var(--chart-2)]/15 text-foreground',\n error: 'border-destructive/60 bg-destructive/15 text-foreground',\n warning: 'border-[var(--chart-4)]/60 bg-[var(--chart-4)]/15 text-foreground',\n info: 'border-border bg-muted text-foreground',\n};\n\nconst KIND_GLYPH: Record<FlashKind, string> = {\n success: '✓',\n error: '✗',\n warning: '!',\n info: 'i',\n};\n\nexport function FlashToast({\n kind,\n message,\n onDismiss,\n durationMs = 5000,\n className,\n}: FlashToastProps) {\n const t = useArqelTranslations();\n useEffect(() => {\n if (durationMs <= 0) return undefined;\n const id = window.setTimeout(onDismiss, durationMs);\n return () => window.clearTimeout(id);\n }, [durationMs, onDismiss]);\n\n return (\n <div\n role={kind === 'error' ? 'alert' : 'status'}\n aria-live={kind === 'error' ? 'assertive' : 'polite'}\n className={cn(\n 'pointer-events-auto flex items-start gap-3 rounded-md border px-4 py-3 shadow-md',\n 'min-w-[18rem] max-w-md text-sm',\n KIND_CLASSES[kind],\n className,\n )}\n >\n <span aria-hidden=\"true\" className=\"font-bold leading-5\">\n {KIND_GLYPH[kind]}\n </span>\n <span className=\"flex-1\">{message}</span>\n <button\n type=\"button\"\n aria-label={t('arqel.aria.flash_dismiss', 'Dismiss')}\n onClick={onDismiss}\n className=\"text-muted-foreground hover:text-foreground\"\n >\n ✕\n </button>\n </div>\n );\n}\n","/**\n * `<FlashContainer>` — bridges `useFlash()` to a stack of toasts.\n *\n * Subscribes to Inertia shared `flash` and pushes a toast each time a\n * new message of any kind arrives. Toast key is the (kind, message)\n * pair; identical repeats inside the same shared-props snapshot don't\n * duplicate. Defaults to fixed-positioning at top-right; pass `position`\n * to relocate.\n */\n\nimport { type FlashKind, useFlash } from '@arqel-dev/hooks';\nimport { useCallback, useState } from 'react';\nimport { cn } from '../utils/cn.js';\nimport { FlashToast } from './FlashToast.js';\n\ninterface ToastEntry {\n id: number;\n kind: FlashKind;\n message: string;\n}\n\nexport type FlashPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';\n\nexport interface FlashContainerProps {\n position?: FlashPosition;\n durationMs?: number;\n className?: string;\n}\n\nconst POSITION_CLASSES: Record<FlashPosition, string> = {\n 'top-right': 'top-4 right-4 items-end',\n 'top-left': 'top-4 left-4 items-start',\n 'bottom-right': 'bottom-4 right-4 items-end',\n 'bottom-left': 'bottom-4 left-4 items-start',\n};\n\nlet nextId = 0;\n\nexport function FlashContainer({\n position = 'top-right',\n durationMs = 5000,\n className,\n}: FlashContainerProps) {\n const [toasts, setToasts] = useState<ToastEntry[]>([]);\n\n const handleMessage = useCallback((kind: FlashKind, message: string) => {\n setToasts((prev) => [...prev, { id: ++nextId, kind, message }]);\n }, []);\n\n useFlash({ onMessage: handleMessage });\n\n const dismiss = (id: number) => setToasts((prev) => prev.filter((t) => t.id !== id));\n\n return (\n <div\n data-arqel-flash=\"\"\n className={cn(\n 'pointer-events-none fixed z-50 flex flex-col gap-2',\n POSITION_CLASSES[position],\n className,\n )}\n >\n {toasts.map((toast) => (\n <FlashToast\n key={toast.id}\n kind={toast.kind}\n message={toast.message}\n durationMs={durationMs}\n onDismiss={() => dismiss(toast.id)}\n />\n ))}\n </div>\n );\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { useArqelTranslations } from '@arqel-dev/react/utils';
1
2
  import { useRef, useState, useId, useEffect, useCallback } from 'react';
2
3
  import { jsx, jsxs } from 'react/jsx-runtime';
3
4
 
@@ -49,11 +50,13 @@ function recordUsage(command) {
49
50
  function topRecents() {
50
51
  return readRecents().slice().sort((a, b) => b.count === a.count ? b.lastUsed - a.lastUsed : b.count - a.count).slice(0, RECENT_LIMIT).map((e) => e.command);
51
52
  }
53
+ var GENERAL_CATEGORY = "__general";
54
+ var RECENT_CATEGORY = "__recent";
52
55
  function groupByCategory(commands) {
53
56
  const order = [];
54
57
  const buckets = /* @__PURE__ */ new Map();
55
58
  for (const cmd of commands) {
56
- const key = cmd.category ?? "General";
59
+ const key = cmd.category ?? GENERAL_CATEGORY;
57
60
  if (!buckets.has(key)) {
58
61
  buckets.set(key, []);
59
62
  order.push(key);
@@ -75,6 +78,7 @@ var dialogStyle = {
75
78
  color: "var(--foreground, #111)"
76
79
  };
77
80
  function CommandPalette({ endpoint = "/admin/commands" }) {
81
+ const t = useArqelTranslations();
78
82
  const dialogRef = useRef(null);
79
83
  const inputRef = useRef(null);
80
84
  const debounceTimer = useRef(null);
@@ -88,7 +92,16 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
88
92
  const listId = useId();
89
93
  const optBaseId = useId();
90
94
  const visibleCommands = query.trim().length === 0 ? recents : results;
91
- const groups = query.trim().length === 0 && recents.length > 0 ? [{ category: "Recent", commands: recents }] : groupByCategory(visibleCommands);
95
+ const groups = query.trim().length === 0 && recents.length > 0 ? [{ category: RECENT_CATEGORY, commands: recents }] : groupByCategory(visibleCommands);
96
+ const categoryLabel = (category) => {
97
+ if (category === GENERAL_CATEGORY) {
98
+ return t("arqel.command_palette.category_general", "General");
99
+ }
100
+ if (category === RECENT_CATEGORY) {
101
+ return t("arqel.command_palette.category_recent", "Recent");
102
+ }
103
+ return category;
104
+ };
92
105
  const flat = flattenGroups(groups);
93
106
  useEffect(() => {
94
107
  function onKey(event) {
@@ -191,7 +204,7 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
191
204
  className: "backdrop:bg-black/40",
192
205
  "data-arqel-cmdpal": "",
193
206
  children: /* @__PURE__ */ jsxs("div", { onKeyDown, className: "flex flex-col", children: [
194
- /* @__PURE__ */ jsx("h2", { id: titleId, className: "sr-only", children: "Command palette" }),
207
+ /* @__PURE__ */ jsx("h2", { id: titleId, className: "sr-only", children: t("arqel.aria.palette_title", "Command palette") }),
195
208
  /* @__PURE__ */ jsx(
196
209
  "input",
197
210
  {
@@ -202,25 +215,24 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
202
215
  "aria-controls": listId,
203
216
  "aria-autocomplete": "list",
204
217
  ...activeOptionId ? { "aria-activedescendant": activeOptionId } : {},
205
- placeholder: "Type a command\u2026",
218
+ placeholder: t("palette.placeholder", "Type a command\u2026"),
206
219
  value: query,
207
220
  onChange: (e) => setQuery(e.target.value),
208
221
  className: "w-full border-b border-[var(--border,#e5e7eb)] bg-transparent px-4 py-3 text-base outline-none"
209
222
  }
210
223
  ),
211
- /* @__PURE__ */ jsxs("div", { role: "status", "aria-live": "polite", className: "sr-only", children: [
212
- flat.length,
213
- " commands"
214
- ] }),
224
+ /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: t("arqel.aria.palette_results", "{one} :count command|{other} :count commands", {
225
+ count: flat.length
226
+ }) }),
215
227
  /* @__PURE__ */ jsxs(
216
228
  "ul",
217
229
  {
218
230
  id: listId,
219
231
  role: "listbox",
220
- "aria-label": "Commands",
232
+ "aria-label": t("arqel.aria.palette_list", "Commands"),
221
233
  className: "max-h-[50vh] overflow-y-auto py-2",
222
234
  children: [
223
- groups.length === 0 && /* @__PURE__ */ jsx("li", { role: "presentation", className: "px-4 py-3 text-sm opacity-60", children: "No commands found" }),
235
+ groups.length === 0 && /* @__PURE__ */ jsx("li", { role: "presentation", className: "px-4 py-3 text-sm opacity-60", children: t("arqel.palette.no_results", "No commands found") }),
224
236
  groups.map((group) => {
225
237
  const startIdx = flat.indexOf(group.commands[0] ?? {});
226
238
  return /* @__PURE__ */ jsxs("li", { role: "presentation", children: [
@@ -229,7 +241,7 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
229
241
  {
230
242
  role: "presentation",
231
243
  className: "px-4 pt-2 pb-1 text-xs font-semibold uppercase tracking-wide opacity-60",
232
- children: group.category
244
+ children: categoryLabel(group.category)
233
245
  }
234
246
  ),
235
247
  /* @__PURE__ */ jsx("ul", { role: "presentation", className: "m-0 list-none p-0", children: group.commands.map((cmd, j) => {
@@ -268,9 +280,9 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
268
280
  id: hintId,
269
281
  className: "flex items-center gap-3 border-t border-[var(--border,#e5e7eb)] px-4 py-2 text-xs opacity-70",
270
282
  children: [
271
- /* @__PURE__ */ jsx("span", { children: "\u2191\u2193 navigate" }),
272
- /* @__PURE__ */ jsx("span", { children: "\u21B5 select" }),
273
- /* @__PURE__ */ jsx("span", { children: "esc close" })
283
+ /* @__PURE__ */ jsx("span", { children: t("arqel.palette.hint_navigate", "\u2191\u2193 navigate") }),
284
+ /* @__PURE__ */ jsx("span", { children: t("arqel.palette.hint_select", "\u21B5 select") }),
285
+ /* @__PURE__ */ jsx("span", { children: t("arqel.palette.hint_close", "esc close") })
274
286
  ]
275
287
  }
276
288
  )
@@ -281,5 +293,5 @@ function CommandPalette({ endpoint = "/admin/commands" }) {
281
293
  }
282
294
 
283
295
  export { CommandPalette };
284
- //# sourceMappingURL=chunk-FV7RESKL.js.map
285
- //# sourceMappingURL=chunk-FV7RESKL.js.map
296
+ //# sourceMappingURL=chunk-HNUUZEOL.js.map
297
+ //# sourceMappingURL=chunk-HNUUZEOL.js.map