@vantageos/mosaic 0.3.0-alpha.1 → 0.3.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 (97) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/README.md +12 -0
  3. package/dist/{Alert.schema-BQsZGG6P.d.cts → Alert.schema-LPJE5gFP.d.cts} +31 -1
  4. package/dist/{Alert.schema-BQsZGG6P.d.ts → Alert.schema-LPJE5gFP.d.ts} +31 -1
  5. package/dist/MarkdownRenderer.schema-Rx7kIeVA.d.cts +22 -0
  6. package/dist/MarkdownRenderer.schema-Rx7kIeVA.d.ts +22 -0
  7. package/dist/ProgressBar.schema-CdVYx0Wq.d.cts +22 -0
  8. package/dist/ProgressBar.schema-CdVYx0Wq.d.ts +22 -0
  9. package/dist/StatusBadge.schema-1tOjB4Ir.d.cts +22 -0
  10. package/dist/StatusBadge.schema-1tOjB4Ir.d.ts +22 -0
  11. package/dist/artifacts.cjs +126 -2
  12. package/dist/artifacts.cjs.map +1 -1
  13. package/dist/artifacts.d.cts +3 -21
  14. package/dist/artifacts.d.ts +3 -21
  15. package/dist/artifacts.js +126 -2
  16. package/dist/artifacts.js.map +1 -1
  17. package/dist/confirmation.cjs +126 -2
  18. package/dist/confirmation.cjs.map +1 -1
  19. package/dist/confirmation.d.cts +3 -32
  20. package/dist/confirmation.d.ts +3 -32
  21. package/dist/confirmation.js +126 -2
  22. package/dist/confirmation.js.map +1 -1
  23. package/dist/display.cjs +129 -2
  24. package/dist/display.cjs.map +1 -1
  25. package/dist/display.d.cts +132 -2
  26. package/dist/display.d.ts +132 -2
  27. package/dist/display.js +129 -2
  28. package/dist/display.js.map +1 -1
  29. package/dist/forms.cjs +20 -17
  30. package/dist/forms.cjs.map +1 -1
  31. package/dist/forms.js +20 -17
  32. package/dist/forms.js.map +1 -1
  33. package/dist/index.cjs +129 -2
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +9 -7
  36. package/dist/index.d.ts +9 -7
  37. package/dist/index.js +129 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/media.cjs +126 -2
  40. package/dist/media.cjs.map +1 -1
  41. package/dist/media.d.cts +3 -21
  42. package/dist/media.d.ts +3 -21
  43. package/dist/media.js +126 -2
  44. package/dist/media.js.map +1 -1
  45. package/dist/preact/artifacts.d.ts +39 -1
  46. package/dist/preact/artifacts.js +234 -0
  47. package/dist/preact/artifacts.js.map +1 -1
  48. package/dist/preact/confirmation.d.ts +31 -1
  49. package/dist/preact/confirmation.js +245 -5
  50. package/dist/preact/confirmation.js.map +1 -1
  51. package/dist/preact/display.d.ts +127 -1
  52. package/dist/preact/display.js +419 -11
  53. package/dist/preact/display.js.map +1 -1
  54. package/dist/preact/forms.js +22 -19
  55. package/dist/preact/forms.js.map +1 -1
  56. package/dist/preact/input.js +2 -2
  57. package/dist/preact/progress.d.ts +35 -1
  58. package/dist/preact/progress.js +263 -0
  59. package/dist/preact/progress.js.map +1 -1
  60. package/dist/progress.cjs +126 -2
  61. package/dist/progress.cjs.map +1 -1
  62. package/dist/progress.d.cts +3 -21
  63. package/dist/progress.d.ts +3 -21
  64. package/dist/progress.js +126 -2
  65. package/dist/progress.js.map +1 -1
  66. package/dist/react/artifacts.cjs +241 -0
  67. package/dist/react/artifacts.cjs.map +1 -1
  68. package/dist/react/artifacts.d.cts +20 -1
  69. package/dist/react/artifacts.d.ts +20 -1
  70. package/dist/react/artifacts.js +234 -0
  71. package/dist/react/artifacts.js.map +1 -1
  72. package/dist/react/confirmation.cjs +248 -2
  73. package/dist/react/confirmation.cjs.map +1 -1
  74. package/dist/react/confirmation.d.cts +3 -3
  75. package/dist/react/confirmation.d.ts +3 -3
  76. package/dist/react/confirmation.js +244 -4
  77. package/dist/react/confirmation.js.map +1 -1
  78. package/dist/react/display.cjs +418 -2
  79. package/dist/react/display.cjs.map +1 -1
  80. package/dist/react/display.d.cts +20 -3
  81. package/dist/react/display.d.ts +20 -3
  82. package/dist/react/display.js +413 -4
  83. package/dist/react/display.js.map +1 -1
  84. package/dist/react/forms.cjs +20 -17
  85. package/dist/react/forms.cjs.map +1 -1
  86. package/dist/react/forms.js +20 -17
  87. package/dist/react/forms.js.map +1 -1
  88. package/dist/react/progress.cjs +266 -0
  89. package/dist/react/progress.cjs.map +1 -1
  90. package/dist/react/progress.d.cts +17 -1
  91. package/dist/react/progress.d.ts +17 -1
  92. package/dist/react/progress.js +263 -0
  93. package/dist/react/progress.js.map +1 -1
  94. package/package.json +15 -13
  95. package/registry.yaml +34 -21
  96. package/dist/Skeleton.schema-BO0ca2UX.d.cts +0 -135
  97. package/dist/Skeleton.schema-BO0ca2UX.d.ts +0 -135
@@ -25,6 +25,7 @@ function validateEmptyStateProps(raw) {
25
25
 
26
26
  // src/i18n/strings.ts
27
27
  var EN = {
28
+ // ─── Non-forms components ──────────────────────────────────────────────────
28
29
  "ProgressBar.aria.label": "Progress",
29
30
  "ProgressBar.error.invalidProps": "ProgressBar: invalid props",
30
31
  "ConfirmDialog.button.confirm": "Confirm",
@@ -52,9 +53,71 @@ var EN = {
52
53
  "VirtualList.empty.message": "No items to display",
53
54
  "VirtualList.error.invalidProps": "VirtualList: invalid props",
54
55
  "Skeleton.aria.label": "Loading",
55
- "Skeleton.error.invalidProps": "Skeleton: invalid props"
56
+ "Skeleton.error.invalidProps": "Skeleton: invalid props",
57
+ // ─── Forms — useMosaicForm ─────────────────────────────────────────────────
58
+ "useMosaicForm.error.invalidProps": "useMosaicForm: invalid options",
59
+ // ─── Forms — FormProvider ──────────────────────────────────────────────────
60
+ "FormProvider.error.invalidProps": "FormProvider: invalid props",
61
+ // ─── Forms — FormField ────────────────────────────────────────────────────
62
+ "FormField.error.invalidProps": "FormField: invalid props",
63
+ // ─── Forms — ErrorDisplay ─────────────────────────────────────────────────
64
+ "ErrorDisplay.error.required": "This field is required",
65
+ "ErrorDisplay.error.min": "Value is below the minimum",
66
+ "ErrorDisplay.error.max": "Value exceeds the maximum",
67
+ "ErrorDisplay.error.minLength": "Input is too short",
68
+ "ErrorDisplay.error.maxLength": "Input is too long",
69
+ "ErrorDisplay.error.pattern": "Invalid format",
70
+ "ErrorDisplay.error.email": "Enter a valid email address",
71
+ "ErrorDisplay.error.url": "Enter a valid URL",
72
+ "ErrorDisplay.error.generic": "Invalid value",
73
+ // ─── Forms — SubmitButton ─────────────────────────────────────────────────
74
+ "SubmitButton.aria.submit": "Submit form",
75
+ "SubmitButton.state.loading": "Submitting\u2026",
76
+ "SubmitButton.error.invalidProps": "SubmitButton: invalid props",
77
+ // ─── Forms — Input ────────────────────────────────────────────────────────
78
+ "Input.aria.label": "Input field",
79
+ "Input.error.required": "This field is required",
80
+ "Input.error.invalid": "Invalid value",
81
+ "Input.error.tooLong": "Input is too long",
82
+ "Input.error.tooShort": "Input is too short",
83
+ "Input.error.invalidProps": "Input: invalid props",
84
+ // ─── Forms — Textarea ─────────────────────────────────────────────────────
85
+ "Textarea.aria.label": "Text area",
86
+ "Textarea.error.required": "This field is required",
87
+ "Textarea.error.tooLong": "Text is too long",
88
+ "Textarea.counter.remaining": "characters remaining",
89
+ "Textarea.error.invalidProps": "Textarea: invalid props",
90
+ // ─── Forms — FieldArray ───────────────────────────────────────────────────
91
+ "FieldArray.aria.list": "List of items",
92
+ "FieldArray.aria.addItem": "Add item",
93
+ "FieldArray.aria.removeItem": "Remove item",
94
+ "FieldArray.error.invalidProps": "FieldArray: invalid props",
95
+ // ─── Forms — Checkbox ─────────────────────────────────────────────────────
96
+ "Checkbox.aria.label": "Checkbox",
97
+ "Checkbox.error.required": "This field must be checked",
98
+ "Checkbox.error.invalidProps": "Checkbox: invalid props",
99
+ // ─── Forms — MultiSelect ──────────────────────────────────────────────────
100
+ "MultiSelect.aria.label": "Multi-select field",
101
+ "MultiSelect.aria.removeChip": "Remove",
102
+ "MultiSelect.error.required": "Select at least one option",
103
+ "MultiSelect.error.maxItems": "Maximum number of selections reached",
104
+ "MultiSelect.placeholder": "Select options\u2026",
105
+ "MultiSelect.search.placeholder": "Search\u2026",
106
+ "MultiSelect.empty": "No options available",
107
+ "MultiSelect.error.invalidProps": "MultiSelect: invalid props",
108
+ // ─── Forms — RadioGroup ───────────────────────────────────────────────────
109
+ "RadioGroup.aria.label": "Radio group",
110
+ "RadioGroup.error.required": "Select one option",
111
+ "RadioGroup.error.invalidProps": "RadioGroup: invalid props",
112
+ // ─── Forms — Select ───────────────────────────────────────────────────────
113
+ "Select.placeholder": "Select an option\u2026",
114
+ "Select.search.placeholder": "Search\u2026",
115
+ "Select.empty": "No options available",
116
+ "Select.error.required": "Select an option",
117
+ "Select.error.invalidProps": "Select: invalid props"
56
118
  };
57
119
  var FR = {
120
+ // ─── Non-forms components ──────────────────────────────────────────────────
58
121
  "ProgressBar.aria.label": "Progression",
59
122
  "ProgressBar.error.invalidProps": "ProgressBar : propri\xE9t\xE9s invalides",
60
123
  "ConfirmDialog.button.confirm": "Confirmer",
@@ -82,7 +145,68 @@ var FR = {
82
145
  "VirtualList.empty.message": "Aucun \xE9l\xE9ment \xE0 afficher",
83
146
  "VirtualList.error.invalidProps": "VirtualList : propri\xE9t\xE9s invalides",
84
147
  "Skeleton.aria.label": "Chargement",
85
- "Skeleton.error.invalidProps": "Skeleton : propri\xE9t\xE9s invalides"
148
+ "Skeleton.error.invalidProps": "Skeleton : propri\xE9t\xE9s invalides",
149
+ // ─── Forms — useMosaicForm ─────────────────────────────────────────────────
150
+ "useMosaicForm.error.invalidProps": "useMosaicForm : options invalides",
151
+ // ─── Forms — FormProvider ──────────────────────────────────────────────────
152
+ "FormProvider.error.invalidProps": "FormProvider : propri\xE9t\xE9s invalides",
153
+ // ─── Forms — FormField ────────────────────────────────────────────────────
154
+ "FormField.error.invalidProps": "FormField : propri\xE9t\xE9s invalides",
155
+ // ─── Forms — ErrorDisplay ─────────────────────────────────────────────────
156
+ "ErrorDisplay.error.required": "Ce champ est obligatoire",
157
+ "ErrorDisplay.error.min": "La valeur est inf\xE9rieure au minimum",
158
+ "ErrorDisplay.error.max": "La valeur d\xE9passe le maximum",
159
+ "ErrorDisplay.error.minLength": "La saisie est trop courte",
160
+ "ErrorDisplay.error.maxLength": "La saisie est trop longue",
161
+ "ErrorDisplay.error.pattern": "Format invalide",
162
+ "ErrorDisplay.error.email": "Saisissez une adresse e-mail valide",
163
+ "ErrorDisplay.error.url": "Saisissez une URL valide",
164
+ "ErrorDisplay.error.generic": "Valeur invalide",
165
+ // ─── Forms — SubmitButton ─────────────────────────────────────────────────
166
+ "SubmitButton.aria.submit": "Soumettre le formulaire",
167
+ "SubmitButton.state.loading": "Envoi en cours\u2026",
168
+ "SubmitButton.error.invalidProps": "SubmitButton : propri\xE9t\xE9s invalides",
169
+ // ─── Forms — Input ────────────────────────────────────────────────────────
170
+ "Input.aria.label": "Champ de saisie",
171
+ "Input.error.required": "Ce champ est obligatoire",
172
+ "Input.error.invalid": "Valeur invalide",
173
+ "Input.error.tooLong": "La saisie est trop longue",
174
+ "Input.error.tooShort": "La saisie est trop courte",
175
+ "Input.error.invalidProps": "Input : propri\xE9t\xE9s invalides",
176
+ // ─── Forms — Textarea ─────────────────────────────────────────────────────
177
+ "Textarea.aria.label": "Zone de texte",
178
+ "Textarea.error.required": "Ce champ est obligatoire",
179
+ "Textarea.error.tooLong": "Le texte est trop long",
180
+ "Textarea.counter.remaining": "caract\xE8res restants",
181
+ "Textarea.error.invalidProps": "Textarea : propri\xE9t\xE9s invalides",
182
+ // ─── Forms — FieldArray ───────────────────────────────────────────────────
183
+ "FieldArray.aria.list": "Liste d'\xE9l\xE9ments",
184
+ "FieldArray.aria.addItem": "Ajouter un \xE9l\xE9ment",
185
+ "FieldArray.aria.removeItem": "Supprimer l'\xE9l\xE9ment",
186
+ "FieldArray.error.invalidProps": "FieldArray : propri\xE9t\xE9s invalides",
187
+ // ─── Forms — Checkbox ─────────────────────────────────────────────────────
188
+ "Checkbox.aria.label": "Case \xE0 cocher",
189
+ "Checkbox.error.required": "Ce champ doit \xEAtre coch\xE9",
190
+ "Checkbox.error.invalidProps": "Checkbox : propri\xE9t\xE9s invalides",
191
+ // ─── Forms — MultiSelect ──────────────────────────────────────────────────
192
+ "MultiSelect.aria.label": "Champ de s\xE9lection multiple",
193
+ "MultiSelect.aria.removeChip": "Retirer",
194
+ "MultiSelect.error.required": "S\xE9lectionnez au moins une option",
195
+ "MultiSelect.error.maxItems": "Nombre maximum de s\xE9lections atteint",
196
+ "MultiSelect.placeholder": "S\xE9lectionner des options\u2026",
197
+ "MultiSelect.search.placeholder": "Rechercher\u2026",
198
+ "MultiSelect.empty": "Aucune option disponible",
199
+ "MultiSelect.error.invalidProps": "MultiSelect : propri\xE9t\xE9s invalides",
200
+ // ─── Forms — RadioGroup ───────────────────────────────────────────────────
201
+ "RadioGroup.aria.label": "Groupe de boutons radio",
202
+ "RadioGroup.error.required": "S\xE9lectionnez une option",
203
+ "RadioGroup.error.invalidProps": "RadioGroup : propri\xE9t\xE9s invalides",
204
+ // ─── Forms — Select ───────────────────────────────────────────────────────
205
+ "Select.placeholder": "S\xE9lectionner une option\u2026",
206
+ "Select.search.placeholder": "Rechercher\u2026",
207
+ "Select.empty": "Aucune option disponible",
208
+ "Select.error.required": "S\xE9lectionnez une option",
209
+ "Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides"
86
210
  };
87
211
  var TABLE = {
88
212
  en: EN,
@@ -361,16 +485,308 @@ function VirtualListInner({
361
485
  }
362
486
  );
363
487
  }
488
+ var StatusBadgePropsSchema = zod.z.object({
489
+ status: zod.z.string(),
490
+ variant: zod.z.enum(["success", "warning", "danger", "info", "neutral"]).default("neutral"),
491
+ label: zod.z.string().optional(),
492
+ locale: zod.z.enum(["en", "fr"])
493
+ });
494
+ function validateProps(raw) {
495
+ return StatusBadgePropsSchema.parse(raw);
496
+ }
497
+ var variantClasses = {
498
+ success: "bg-green-100 text-green-800 ring-1 ring-green-300",
499
+ warning: "bg-amber-100 text-amber-800 ring-1 ring-amber-300",
500
+ danger: "bg-red-100 text-red-800 ring-1 ring-red-300",
501
+ info: "bg-blue-100 text-blue-800 ring-1 ring-blue-300",
502
+ neutral: "bg-slate-100 text-slate-800 ring-1 ring-slate-300"
503
+ };
504
+ function StatusBadgeInner({ status, variant, label, locale }) {
505
+ const ariaLabel = label ?? status;
506
+ return /* @__PURE__ */ jsxRuntime.jsx(
507
+ "output",
508
+ {
509
+ "aria-label": ariaLabel,
510
+ lang: locale,
511
+ className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${variantClasses[variant]}`,
512
+ children: label ?? status
513
+ }
514
+ );
515
+ }
516
+ function StatusBadge(raw) {
517
+ try {
518
+ const props = validateProps(raw);
519
+ return /* @__PURE__ */ jsxRuntime.jsx(StatusBadgeInner, { ...props });
520
+ } catch {
521
+ const locale = raw.locale === "fr" ? "fr" : "en";
522
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", children: t("StatusBadge.error.invalidProps", locale) });
523
+ }
524
+ }
525
+ var ColumnDefSchema = zod.z.object({
526
+ key: zod.z.string().min(1),
527
+ header: zod.z.string().min(1)
528
+ // render is a runtime function — excluded from Zod, typed separately
529
+ });
530
+ var TableViewPropsSchema = zod.z.object({
531
+ columns: zod.z.array(ColumnDefSchema).min(1, "TableView requires at least one column"),
532
+ virtualizeThreshold: zod.z.number().int().positive().default(100),
533
+ ariaLabel: zod.z.string().min(1),
534
+ locale: zod.z.enum(["en", "fr"]).default("en")
535
+ });
536
+ function validateTableViewProps(raw) {
537
+ return TableViewPropsSchema.parse(raw);
538
+ }
539
+ var OVERSCAN = 5;
540
+ function TableView(props) {
541
+ let validatedThreshold = 100;
542
+ try {
543
+ const validated = validateTableViewProps({
544
+ columns: props.columns.map(({ key, header }) => ({ key, header })),
545
+ virtualizeThreshold: props.virtualizeThreshold,
546
+ ariaLabel: props.ariaLabel,
547
+ locale: props.locale
548
+ });
549
+ validatedThreshold = validated.virtualizeThreshold;
550
+ } catch {
551
+ const locale = props.locale === "fr" ? "fr" : "en";
552
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", children: t("TableView.error.invalidProps", locale) });
553
+ }
554
+ const isVirtual = props.rows.length > validatedThreshold;
555
+ const resolvedLocale = props.locale === "fr" ? "fr" : "en";
556
+ if (isVirtual) {
557
+ return /* @__PURE__ */ jsxRuntime.jsx(
558
+ VirtualTable,
559
+ {
560
+ rows: props.rows,
561
+ columns: props.columns,
562
+ ariaLabel: props.ariaLabel,
563
+ locale: resolvedLocale,
564
+ onRowClick: props.onRowClick
565
+ }
566
+ );
567
+ }
568
+ return /* @__PURE__ */ jsxRuntime.jsx(
569
+ StaticTable,
570
+ {
571
+ rows: props.rows,
572
+ columns: props.columns,
573
+ ariaLabel: props.ariaLabel,
574
+ locale: resolvedLocale,
575
+ onRowClick: props.onRowClick
576
+ }
577
+ );
578
+ }
579
+ function StreamingTableView(props) {
580
+ let validatedThreshold = 100;
581
+ try {
582
+ const validated = validateTableViewProps({
583
+ columns: props.columns.map(({ key, header }) => ({ key, header })),
584
+ virtualizeThreshold: props.virtualizeThreshold,
585
+ ariaLabel: props.ariaLabel,
586
+ locale: props.locale
587
+ });
588
+ validatedThreshold = validated.virtualizeThreshold;
589
+ } catch {
590
+ const locale = props.locale === "fr" ? "fr" : "en";
591
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", children: t("TableView.error.invalidProps", locale) });
592
+ }
593
+ return /* @__PURE__ */ jsxRuntime.jsx(
594
+ StreamingTableViewInner,
595
+ {
596
+ ...props,
597
+ virtualizeThreshold: validatedThreshold,
598
+ onRowClick: props.onRowClick
599
+ }
600
+ );
601
+ }
602
+ function StreamingTableViewInner({
603
+ columns,
604
+ rows$,
605
+ virtualizeThreshold = 100,
606
+ ariaLabel,
607
+ locale,
608
+ onRowClick
609
+ }) {
610
+ const resolvedLocale = locale === "fr" ? "fr" : "en";
611
+ const [rows, setRows] = react.useState([]);
612
+ react.useEffect(() => {
613
+ setRows([]);
614
+ const sub = rows$.subscribe((chunk) => {
615
+ setRows((prev) => [...prev, ...chunk]);
616
+ });
617
+ return () => {
618
+ sub.unsubscribe();
619
+ };
620
+ }, [rows$]);
621
+ const isVirtual = rows.length > virtualizeThreshold;
622
+ if (isVirtual) {
623
+ return /* @__PURE__ */ jsxRuntime.jsx(
624
+ VirtualTable,
625
+ {
626
+ rows,
627
+ columns,
628
+ ariaLabel,
629
+ locale: resolvedLocale,
630
+ onRowClick
631
+ }
632
+ );
633
+ }
634
+ return /* @__PURE__ */ jsxRuntime.jsx(
635
+ StaticTable,
636
+ {
637
+ rows,
638
+ columns,
639
+ ariaLabel,
640
+ locale: resolvedLocale,
641
+ onRowClick
642
+ }
643
+ );
644
+ }
645
+ function renderCell(col, row) {
646
+ if (col.render) {
647
+ return col.render(row);
648
+ }
649
+ return String(row[col.key] ?? "");
650
+ }
651
+ function StaticTable({
652
+ rows,
653
+ columns,
654
+ ariaLabel,
655
+ locale,
656
+ onRowClick
657
+ }) {
658
+ const emptyMsg = t("TableView.empty.message", locale);
659
+ return /* @__PURE__ */ jsxRuntime.jsxs(
660
+ "table",
661
+ {
662
+ "aria-label": ariaLabel,
663
+ "aria-rowcount": rows.length,
664
+ style: { width: "100%", borderCollapse: "collapse" },
665
+ children: [
666
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: col.header }, col.key)) }) }),
667
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns.length, "aria-label": emptyMsg, children: emptyMsg }) }) : rows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(
668
+ "tr",
669
+ {
670
+ "aria-rowindex": rowIndex + 2,
671
+ ...onRowClick ? {
672
+ role: "button",
673
+ tabIndex: 0,
674
+ style: { cursor: "pointer" },
675
+ onClick: () => onRowClick(row, rowIndex),
676
+ onKeyDown: (e) => {
677
+ if (e.key === "Enter" || e.key === " ") {
678
+ e.preventDefault();
679
+ onRowClick(row, rowIndex);
680
+ }
681
+ }
682
+ } : {},
683
+ children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { children: renderCell(col, row) }, col.key))
684
+ },
685
+ row.id != null ? String(row.id) : `row-${rowIndex}`
686
+ )) })
687
+ ]
688
+ }
689
+ );
690
+ }
691
+ function VirtualTable({
692
+ rows,
693
+ columns,
694
+ ariaLabel,
695
+ // locale reserved for future virtual-mode empty/pagination strings
696
+ locale: _locale,
697
+ onRowClick
698
+ }) {
699
+ const scrollRef = react.useRef(null);
700
+ const rowVirtualizer = reactVirtual.useVirtualizer({
701
+ count: rows.length,
702
+ /* v8 ignore next 1 */
703
+ getScrollElement: () => scrollRef.current,
704
+ estimateSize: react.useCallback(() => 40, []),
705
+ overscan: OVERSCAN
706
+ });
707
+ const virtualItems = rowVirtualizer.getVirtualItems();
708
+ const totalSize = rowVirtualizer.getTotalSize();
709
+ return /* @__PURE__ */ jsxRuntime.jsx(
710
+ "div",
711
+ {
712
+ "data-virtual": "true",
713
+ ref: scrollRef,
714
+ tabIndex: 0,
715
+ role: "region",
716
+ "aria-label": ariaLabel,
717
+ style: { height: 400, overflow: "auto", position: "relative" },
718
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
719
+ "table",
720
+ {
721
+ "aria-label": ariaLabel,
722
+ "aria-rowcount": rows.length,
723
+ style: { width: "100%", borderCollapse: "collapse" },
724
+ children: [
725
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: col.header }, col.key)) }) }),
726
+ /* @__PURE__ */ jsxRuntime.jsx(
727
+ "tbody",
728
+ {
729
+ style: {
730
+ height: `${totalSize}px`,
731
+ position: "relative",
732
+ display: "block"
733
+ },
734
+ children: virtualItems.map((virtualRow) => {
735
+ const row = rows[virtualRow.index] ?? {};
736
+ return /* @__PURE__ */ jsxRuntime.jsx(
737
+ "tr",
738
+ {
739
+ "aria-rowindex": virtualRow.index + 2,
740
+ style: {
741
+ position: "absolute",
742
+ top: 0,
743
+ left: 0,
744
+ width: "100%",
745
+ transform: `translateY(${virtualRow.start}px)`,
746
+ display: "flex",
747
+ ...onRowClick ? { cursor: "pointer" } : {}
748
+ },
749
+ ...onRowClick ? {
750
+ role: "button",
751
+ tabIndex: 0,
752
+ onClick: () => onRowClick(row, virtualRow.index),
753
+ onKeyDown: (e) => {
754
+ if (e.key === "Enter" || e.key === " ") {
755
+ e.preventDefault();
756
+ onRowClick(row, virtualRow.index);
757
+ }
758
+ }
759
+ } : {},
760
+ children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { style: { flex: 1 }, children: renderCell(col, row) }, col.key))
761
+ },
762
+ row.id != null ? String(row.id) : `vrow-${virtualRow.index}`
763
+ );
764
+ })
765
+ }
766
+ )
767
+ ]
768
+ }
769
+ )
770
+ }
771
+ );
772
+ }
364
773
 
365
774
  exports.EmptyState = EmptyState;
366
775
  exports.EmptyStatePropsSchema = EmptyStatePropsSchema;
367
776
  exports.Skeleton = Skeleton;
368
777
  exports.SkeletonPropsSchema = SkeletonPropsSchema;
778
+ exports.StatusBadge = StatusBadge;
779
+ exports.StatusBadgePropsSchema = StatusBadgePropsSchema;
780
+ exports.StreamingTableView = StreamingTableView;
781
+ exports.TableView = TableView;
782
+ exports.TableViewPropsSchema = TableViewPropsSchema;
369
783
  exports.VirtualList = VirtualList;
370
784
  exports.VirtualListPropsSchema = VirtualListPropsSchema;
371
785
  exports.resolveSkeletonDimensions = resolveSkeletonDimensions;
372
786
  exports.validateEmptyStateProps = validateEmptyStateProps;
373
787
  exports.validateSkeletonProps = validateSkeletonProps;
788
+ exports.validateStatusBadgeProps = validateProps;
789
+ exports.validateTableViewProps = validateTableViewProps;
374
790
  exports.validateVirtualListProps = validateVirtualListProps;
375
791
  //# sourceMappingURL=display.cjs.map
376
792
  //# sourceMappingURL=display.cjs.map