@almadar/ui 2.1.10 → 2.2.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.
@@ -11,6 +11,8 @@ var DEFAULT_SLOTS = {
11
11
  toast: null,
12
12
  "hud-top": null,
13
13
  "hud-bottom": null,
14
+ "hud-left": null,
15
+ "hud-right": null,
14
16
  floating: null
15
17
  };
16
18
  var idCounter = 0;
@@ -1,5 +1,5 @@
1
1
  import { apiClient } from './chunk-3HJHHULT.js';
2
- import { SelectionContext, entityDataKeys, useEntityList } from './chunk-JLEMVREZ.js';
2
+ import { SelectionContext, entityDataKeys, useEntityList } from './chunk-GOZKH7QW.js';
3
3
  import { useEventBus } from './chunk-YXZM3WCF.js';
4
4
  import { subscribe, getSnapshot, clearEntities, removeEntity, updateSingleton, updateEntity, spawnEntity, getSingleton, getAllEntities, getByType, getEntity } from './chunk-N7MVUW4R.js';
5
5
  import { useCallback, useState, useEffect, useMemo, useContext, useSyncExternalStore } from 'react';
@@ -899,8 +899,8 @@ function useUIEvents(dispatch, validEvents, eventBusInstance) {
899
899
  const validEventsKey = validEvents ? validEvents.slice().sort().join(",") : "";
900
900
  const stableValidEvents = useMemo(
901
901
  () => validEvents,
902
- // eslint-disable-next-line react-hooks/exhaustive-deps
903
902
  [validEventsKey]
903
+ // intentional — validEventsKey is the stable dep, not validEvents array ref
904
904
  );
905
905
  useEffect(() => {
906
906
  const unsubscribes = [];
@@ -1,5 +1,5 @@
1
- import { useTheme, useUISlots } from './chunk-BTXQJGFB.js';
2
- import { useTranslate, useQuerySingleton } from './chunk-JLEMVREZ.js';
1
+ import { useTheme, useUISlots } from './chunk-DKQN5FVU.js';
2
+ import { useTranslate, useQuerySingleton } from './chunk-GOZKH7QW.js';
3
3
  import { useEventBus } from './chunk-YXZM3WCF.js';
4
4
  import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from './chunk-KKCVDUK7.js';
5
5
  import { __publicField } from './chunk-PKBMQBKP.js';
@@ -3587,6 +3587,7 @@ function Card2({
3587
3587
  action
3588
3588
  }) {
3589
3589
  const eventBus = useEventBus();
3590
+ const { t } = useTranslate();
3590
3591
  const isClickable = !!onClick || !!action;
3591
3592
  const handleClick = () => {
3592
3593
  if (action) eventBus.emit(`UI:${action}`, {});
@@ -3611,7 +3612,7 @@ function Card2({
3611
3612
  "img",
3612
3613
  {
3613
3614
  src: image,
3614
- alt: title || "Card image",
3615
+ alt: title || t("card.imageAlt"),
3615
3616
  className: "w-full h-full object-cover"
3616
3617
  }
3617
3618
  ) }),
@@ -6640,8 +6641,7 @@ function DataTable({
6640
6641
  ] }),
6641
6642
  /* @__PURE__ */ jsx(Box, { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
6642
6643
  /* @__PURE__ */ jsx("thead", { className: "bg-[var(--color-table-header)] border-b-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsxs("tr", { children: [
6643
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6644
- /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(
6644
+ selectable && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(
6645
6645
  Checkbox,
6646
6646
  {
6647
6647
  checked: allSelected,
@@ -6649,173 +6649,156 @@ function DataTable({
6649
6649
  onChange: handleSelectAll
6650
6650
  }
6651
6651
  ) }),
6652
- normalizedColumns.map((col) => (
6653
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6654
- /* @__PURE__ */ jsx(
6655
- "th",
6656
- {
6657
- className: cn(
6658
- "px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider whitespace-nowrap",
6659
- col.sortable && "cursor-pointer select-none hover:bg-[var(--color-table-row-hover)]"
6660
- ),
6661
- style: { width: col.width },
6662
- onClick: () => col.sortable && handleSort(String(col.key)),
6663
- children: /* @__PURE__ */ jsxs(HStack, { className: "items-center gap-1", children: [
6664
- col.header,
6665
- col.sortable && sortBy === col.key && (sortDirection === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }))
6666
- ] })
6667
- },
6668
- String(col.key)
6669
- )
6652
+ normalizedColumns.map((col) => /* @__PURE__ */ jsx(
6653
+ "th",
6654
+ {
6655
+ "data-column": String(col.key),
6656
+ className: cn(
6657
+ "px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider whitespace-nowrap",
6658
+ col.sortable && "cursor-pointer select-none hover:bg-[var(--color-table-row-hover)]"
6659
+ ),
6660
+ style: { width: col.width },
6661
+ onClick: () => col.sortable && handleSort(String(col.key)),
6662
+ children: /* @__PURE__ */ jsxs(HStack, { className: "items-center gap-1", children: [
6663
+ col.header,
6664
+ col.sortable && sortBy === col.key && (sortDirection === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }))
6665
+ ] })
6666
+ },
6667
+ String(col.key)
6670
6668
  )),
6671
6669
  rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
6672
6670
  ] }) }),
6673
- /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? (
6674
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6675
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6676
- "td",
6677
- {
6678
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6679
- className: "px-4 py-12 text-center",
6680
- children: /* @__PURE__ */ jsxs(VStack, { className: "items-center gap-2", children: [
6681
- /* @__PURE__ */ jsx(Spinner, { size: "lg" }),
6682
- /* @__PURE__ */ jsx(
6683
- Typography,
6684
- {
6685
- variant: "small",
6686
- className: "text-[var(--color-muted-foreground)]",
6687
- children: t("common.loading")
6688
- }
6689
- )
6690
- ] })
6691
- }
6692
- ) })
6693
- ) : error ? (
6694
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6695
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
6696
- "td",
6697
- {
6698
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6699
- className: "px-4 py-12 text-center text-[var(--color-error)]",
6700
- children: [
6701
- t("error.generic") + ": ",
6702
- error.message
6703
- ]
6704
- }
6705
- ) })
6706
- ) : items.length === 0 ? (
6707
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6708
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6709
- "td",
6710
- {
6711
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6712
- className: "px-4 py-12",
6713
- children: /* @__PURE__ */ jsx(
6714
- EmptyState,
6671
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6672
+ "td",
6673
+ {
6674
+ colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6675
+ className: "px-4 py-12 text-center",
6676
+ children: /* @__PURE__ */ jsxs(VStack, { className: "items-center gap-2", children: [
6677
+ /* @__PURE__ */ jsx(Spinner, { size: "lg" }),
6678
+ /* @__PURE__ */ jsx(
6679
+ Typography,
6715
6680
  {
6716
- icon: emptyIcon,
6717
- title: resolvedEmptyTitle,
6718
- description: resolvedEmptyDescription,
6719
- actionLabel: emptyAction?.label,
6720
- actionEvent: emptyAction?.event
6681
+ variant: "small",
6682
+ className: "text-[var(--color-muted-foreground)]",
6683
+ children: t("common.loading")
6721
6684
  }
6722
6685
  )
6723
- }
6724
- ) })
6725
- ) : items.map((row, rowIndex) => (
6726
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6727
- /* @__PURE__ */ jsxs(
6728
- "tr",
6729
- {
6730
- className: cn(
6731
- "border-b border-[var(--color-table-border)] last:border-0 hover:bg-[var(--color-table-row-hover)] transition-colors",
6732
- selectedIds.includes(row.id) && "bg-[var(--color-primary)]/10 font-medium",
6733
- isRowClickable && "cursor-pointer"
6734
- ),
6735
- onClick: () => isRowClickable && handleRowClick(row),
6736
- children: [
6737
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6738
- /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
6739
- Checkbox,
6686
+ ] })
6687
+ }
6688
+ ) }) : error ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
6689
+ "td",
6690
+ {
6691
+ colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6692
+ className: "px-4 py-12 text-center text-[var(--color-error)]",
6693
+ children: [
6694
+ t("error.generic") + ": ",
6695
+ error.message
6696
+ ]
6697
+ }
6698
+ ) }) : items.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6699
+ "td",
6700
+ {
6701
+ colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6702
+ className: "px-4 py-12",
6703
+ children: /* @__PURE__ */ jsx(
6704
+ EmptyState,
6705
+ {
6706
+ icon: emptyIcon,
6707
+ title: resolvedEmptyTitle,
6708
+ description: resolvedEmptyDescription,
6709
+ actionLabel: emptyAction?.label,
6710
+ actionEvent: emptyAction?.event
6711
+ }
6712
+ )
6713
+ }
6714
+ ) }) : items.map((row, rowIndex) => /* @__PURE__ */ jsxs(
6715
+ "tr",
6716
+ {
6717
+ "data-entity-row": true,
6718
+ className: cn(
6719
+ "border-b border-[var(--color-table-border)] last:border-0 hover:bg-[var(--color-table-row-hover)] transition-colors",
6720
+ selectedIds.includes(row.id) && "bg-[var(--color-primary)]/10 font-medium",
6721
+ isRowClickable && "cursor-pointer"
6722
+ ),
6723
+ onClick: () => isRowClickable && handleRowClick(row),
6724
+ children: [
6725
+ selectable && /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
6726
+ Checkbox,
6727
+ {
6728
+ checked: selectedIds.includes(row.id),
6729
+ onChange: () => handleSelectRow(row.id)
6730
+ }
6731
+ ) }),
6732
+ normalizedColumns.map((col) => {
6733
+ const cellValue = getNestedValue(
6734
+ row,
6735
+ String(col.key)
6736
+ );
6737
+ return /* @__PURE__ */ jsx(
6738
+ "td",
6739
+ {
6740
+ "data-column": String(col.key),
6741
+ className: "px-4 py-3 text-sm text-[var(--color-foreground)] whitespace-nowrap sm:whitespace-normal",
6742
+ children: col.render ? col.render(cellValue, row, rowIndex) : String(cellValue ?? "")
6743
+ },
6744
+ String(col.key)
6745
+ );
6746
+ }),
6747
+ rowActions && /* @__PURE__ */ jsxs("td", { className: "px-4 py-3 relative", children: [
6748
+ /* @__PURE__ */ jsx(
6749
+ Button,
6740
6750
  {
6741
- checked: selectedIds.includes(row.id),
6742
- onChange: () => handleSelectRow(row.id)
6751
+ variant: "ghost",
6752
+ className: "p-1 rounded hover:bg-[var(--color-muted)]",
6753
+ onClick: (e) => {
6754
+ e.stopPropagation();
6755
+ setOpenActionMenu(
6756
+ openActionMenu === row.id ? null : row.id
6757
+ );
6758
+ },
6759
+ children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 text-[var(--color-muted-foreground)]" })
6743
6760
  }
6744
- ) }),
6745
- normalizedColumns.map((col) => {
6746
- const cellValue = getNestedValue(
6747
- row,
6748
- String(col.key)
6749
- );
6750
- return (
6751
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6752
- /* @__PURE__ */ jsx(
6753
- "td",
6754
- {
6755
- className: "px-4 py-3 text-sm text-[var(--color-foreground)] whitespace-nowrap sm:whitespace-normal",
6756
- children: col.render ? col.render(cellValue, row, rowIndex) : String(cellValue ?? "")
6757
- },
6758
- String(col.key)
6759
- )
6760
- );
6761
- }),
6762
- rowActions && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6763
- /* @__PURE__ */ jsxs("td", { className: "px-4 py-3 relative", children: [
6761
+ ),
6762
+ openActionMenu === row.id && /* @__PURE__ */ jsxs(Fragment, { children: [
6764
6763
  /* @__PURE__ */ jsx(
6765
- Button,
6764
+ Box,
6766
6765
  {
6767
- variant: "ghost",
6768
- className: "p-1 rounded hover:bg-[var(--color-muted)]",
6766
+ className: "fixed inset-0 z-40",
6769
6767
  onClick: (e) => {
6770
6768
  e.stopPropagation();
6771
- setOpenActionMenu(
6772
- openActionMenu === row.id ? null : row.id
6773
- );
6774
- },
6775
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 text-[var(--color-muted-foreground)]" })
6769
+ setOpenActionMenu(null);
6770
+ }
6776
6771
  }
6777
6772
  ),
6778
- openActionMenu === row.id && /* @__PURE__ */ jsxs(Fragment, { children: [
6779
- /* @__PURE__ */ jsx(
6780
- Box,
6781
- {
6782
- className: "fixed inset-0 z-40",
6783
- onClick: (e) => {
6784
- e.stopPropagation();
6785
- setOpenActionMenu(null);
6786
- }
6787
- }
6788
- ),
6789
- /* @__PURE__ */ jsx(VStack, { className: "absolute right-0 mt-1 w-48 bg-[var(--color-card)] rounded-[var(--radius-lg)] shadow-[var(--shadow-lg)] border border-[var(--color-border)] py-1 z-50", children: rowActions.filter(
6790
- (action) => !action.show || action.show(row)
6791
- ).map((action, idx) => /* @__PURE__ */ jsxs(
6792
- Button,
6793
- {
6794
- variant: "ghost",
6795
- "data-event": action.event,
6796
- "data-testid": action.event ? `action-${action.event}` : void 0,
6797
- className: cn(
6798
- "w-full flex items-center gap-2 px-4 py-2 text-sm",
6799
- action.variant === "danger" ? "text-[var(--color-error)] hover:bg-[var(--color-error)]/10" : "text-[var(--color-foreground)] hover:bg-[var(--color-muted)]"
6800
- ),
6801
- onClick: (e) => {
6802
- e.stopPropagation();
6803
- action.onClick(row);
6804
- setOpenActionMenu(null);
6805
- },
6806
- children: [
6807
- action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
6808
- action.label
6809
- ]
6773
+ /* @__PURE__ */ jsx(VStack, { className: "absolute right-0 mt-1 w-48 bg-[var(--color-card)] rounded-[var(--radius-lg)] shadow-[var(--shadow-lg)] border border-[var(--color-border)] py-1 z-50", children: (rowActions ?? []).filter(
6774
+ (action) => !action.show || action.show(row)
6775
+ ).map((action, idx) => /* @__PURE__ */ jsxs(
6776
+ Button,
6777
+ {
6778
+ variant: "ghost",
6779
+ "data-event": action.event,
6780
+ "data-testid": action.event ? `action-${action.event}` : void 0,
6781
+ className: cn(
6782
+ "w-full flex items-center gap-2 px-4 py-2 text-sm",
6783
+ action.variant === "danger" ? "text-[var(--color-error)] hover:bg-[var(--color-error)]/10" : "text-[var(--color-foreground)] hover:bg-[var(--color-muted)]"
6784
+ ),
6785
+ onClick: (e) => {
6786
+ e.stopPropagation();
6787
+ action.onClick(row);
6788
+ setOpenActionMenu(null);
6810
6789
  },
6811
- idx
6812
- )) })
6813
- ] })
6790
+ children: [
6791
+ action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
6792
+ action.label
6793
+ ]
6794
+ },
6795
+ idx
6796
+ )) })
6814
6797
  ] })
6815
- ]
6816
- },
6817
- row.id
6818
- )
6798
+ ] })
6799
+ ]
6800
+ },
6801
+ row.id
6819
6802
  )) })
6820
6803
  ] }) }),
6821
6804
  totalCount !== void 0 && totalPages > 1 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 border-t-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsx(
@@ -7053,16 +7036,13 @@ var PageHeader = ({
7053
7036
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
7054
7037
  breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React41__default.Fragment, { children: [
7055
7038
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
7056
- crumb.href ? (
7057
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
7058
- /* @__PURE__ */ jsx(
7059
- "a",
7060
- {
7061
- href: crumb.href,
7062
- className: "text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)]",
7063
- children: crumb.label
7064
- }
7065
- )
7039
+ crumb.href ? /* @__PURE__ */ jsx(
7040
+ "a",
7041
+ {
7042
+ href: crumb.href,
7043
+ className: "text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)]",
7044
+ children: crumb.label
7045
+ }
7066
7046
  ) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[var(--color-foreground)] font-medium", children: crumb.label })
7067
7047
  ] }, idx)) }) }),
7068
7048
  /* @__PURE__ */ jsxs(Box, { className: "flex items-start justify-between gap-4", children: [
@@ -7443,8 +7423,9 @@ var DetailPanel = ({
7443
7423
  /* @__PURE__ */ jsx(Typography, { variant: "h4", weight: "semibold", children: section.title }),
7444
7424
  /* @__PURE__ */ jsx(Divider, {}),
7445
7425
  /* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "250px", maxCols: 2, gap: "lg", children: section.fields.map((field, fieldIdx) => {
7426
+ const fieldKey = typeof field === "string" ? field : void 0;
7446
7427
  const resolved = typeof field === "string" ? { label: formatFieldLabel(field), value: normalizedData ? formatFieldValue(getNestedValue(normalizedData, field), field) : "\u2014", icon: getFieldIcon(field) } : field;
7447
- return /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
7428
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", "data-field": fieldKey, children: [
7448
7429
  resolved.icon && /* @__PURE__ */ jsx(
7449
7430
  Icon,
7450
7431
  {
@@ -7597,11 +7578,12 @@ var Form = ({
7597
7578
  const resolvedSubmitLabel = submitLabel ?? t("common.save");
7598
7579
  const resolvedCancelLabel = cancelLabel ?? t("common.cancel");
7599
7580
  const normalizedInitialData = initialData ?? {};
7600
- const entityName = typeof entity === "string" ? entity : entity?.name;
7581
+ const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
7582
+ const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
7601
7583
  const entityDerivedFields = React41__default.useMemo(() => {
7602
7584
  if (fields && fields.length > 0) return void 0;
7603
- if (!entity || typeof entity === "string") return void 0;
7604
- return entity.fields.map(
7585
+ if (!resolvedEntity) return void 0;
7586
+ return resolvedEntity.fields.map(
7605
7587
  (f) => ({
7606
7588
  name: f.name,
7607
7589
  type: f.type,
@@ -7751,7 +7733,7 @@ var Form = ({
7751
7733
  const inputType = determineInputType(field);
7752
7734
  const label = field.label || fieldName.charAt(0).toUpperCase() + fieldName.slice(1).replace(/([A-Z])/g, " $1");
7753
7735
  const currentValue = formData[fieldName] ?? field.defaultValue ?? "";
7754
- return /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
7736
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", "data-field": fieldName, children: [
7755
7737
  inputType !== "checkbox" && /* @__PURE__ */ jsxs(Typography, { as: "label", variant: "label", weight: "bold", children: [
7756
7738
  label,
7757
7739
  field.required && /* @__PURE__ */ jsx(Typography, { as: "span", color: "error", className: "ml-1", children: "*" })
@@ -7958,47 +7940,44 @@ var Form = ({
7958
7940
  );
7959
7941
  }
7960
7942
  }
7961
- return (
7962
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native <form> needed for onSubmit semantics
7963
- /* @__PURE__ */ jsxs(
7964
- "form",
7965
- {
7966
- className: cn(layoutStyles[layout], gapStyles5[gap], className),
7967
- onSubmit: handleSubmit,
7968
- ...props,
7969
- children: [
7970
- error && /* @__PURE__ */ jsx(Alert, { variant: "error", className: "mb-4", children: error.message || t("error.occurred") }),
7971
- sectionElements && sectionElements.length > 0 && /* @__PURE__ */ jsx(VStack, { gap: gap === "sm" ? "sm" : gap === "lg" ? "lg" : "md", children: sectionElements }),
7972
- schemaFields,
7973
- children,
7974
- (schemaFields && schemaFields.length > 0 || sectionElements && sectionElements.length > 0) && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "pt-4", children: [
7975
- /* @__PURE__ */ jsx(
7976
- Button,
7977
- {
7978
- type: "submit",
7979
- variant: "primary",
7980
- disabled: isLoading,
7981
- "data-event": submitEvent,
7982
- "data-testid": `action-${submitEvent}`,
7983
- children: isLoading ? t("form.saving") : resolvedSubmitLabel
7984
- }
7985
- ),
7986
- shouldShowCancel && /* @__PURE__ */ jsx(
7987
- Button,
7988
- {
7989
- type: "button",
7990
- variant: "secondary",
7991
- onClick: handleCancel,
7992
- disabled: isLoading,
7993
- "data-event": cancelEvent,
7994
- "data-testid": `action-${cancelEvent}`,
7995
- children: resolvedCancelLabel
7996
- }
7997
- )
7998
- ] })
7999
- ]
8000
- }
8001
- )
7943
+ return /* @__PURE__ */ jsxs(
7944
+ "form",
7945
+ {
7946
+ className: cn(layoutStyles[layout], gapStyles5[gap], className),
7947
+ onSubmit: handleSubmit,
7948
+ ...props,
7949
+ children: [
7950
+ error && /* @__PURE__ */ jsx(Alert, { variant: "error", className: "mb-4", children: error.message || t("error.occurred") }),
7951
+ sectionElements && sectionElements.length > 0 && /* @__PURE__ */ jsx(VStack, { gap: gap === "sm" ? "sm" : gap === "lg" ? "lg" : "md", children: sectionElements }),
7952
+ schemaFields,
7953
+ children,
7954
+ (schemaFields && schemaFields.length > 0 || sectionElements && sectionElements.length > 0) && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "pt-4", children: [
7955
+ /* @__PURE__ */ jsx(
7956
+ Button,
7957
+ {
7958
+ type: "submit",
7959
+ variant: "primary",
7960
+ disabled: isLoading,
7961
+ "data-event": submitEvent,
7962
+ "data-testid": `action-${submitEvent}`,
7963
+ children: isLoading ? t("form.saving") : resolvedSubmitLabel
7964
+ }
7965
+ ),
7966
+ shouldShowCancel && /* @__PURE__ */ jsx(
7967
+ Button,
7968
+ {
7969
+ type: "button",
7970
+ variant: "secondary",
7971
+ onClick: handleCancel,
7972
+ disabled: isLoading,
7973
+ "data-event": cancelEvent,
7974
+ "data-testid": `action-${cancelEvent}`,
7975
+ children: resolvedCancelLabel
7976
+ }
7977
+ )
7978
+ ] })
7979
+ ]
7980
+ }
8002
7981
  );
8003
7982
  };
8004
7983
  function formatDateValue(value) {
@@ -8118,6 +8097,7 @@ var CardGrid = ({
8118
8097
  return /* @__PURE__ */ jsxs(
8119
8098
  Box,
8120
8099
  {
8100
+ "data-entity-row": true,
8121
8101
  className: cn(
8122
8102
  "bg-[var(--color-card)] rounded-[var(--radius-lg)] border border-[var(--color-border)] p-4 shadow-[var(--shadow-sm)]",
8123
8103
  "cursor-pointer hover:border-[var(--color-primary)] transition-colors"
@@ -8402,19 +8382,16 @@ function LinkPattern({
8402
8382
  emit(`UI:${onClick}`, { href });
8403
8383
  }
8404
8384
  };
8405
- return (
8406
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
8407
- /* @__PURE__ */ jsx(
8408
- "a",
8409
- {
8410
- href: href ?? "#",
8411
- target: external ? "_blank" : void 0,
8412
- rel: external ? "noopener noreferrer" : void 0,
8413
- onClick: onClick ? handleClick : void 0,
8414
- className,
8415
- children: label
8416
- }
8417
- )
8385
+ return /* @__PURE__ */ jsx(
8386
+ "a",
8387
+ {
8388
+ href: href ?? "#",
8389
+ target: external ? "_blank" : void 0,
8390
+ rel: external ? "noopener noreferrer" : void 0,
8391
+ onClick: onClick ? handleClick : void 0,
8392
+ className,
8393
+ children: label
8394
+ }
8418
8395
  );
8419
8396
  }
8420
8397
  LinkPattern.displayName = "LinkPattern";
@@ -8485,19 +8462,16 @@ function ImagePattern({
8485
8462
  objectFit = "cover",
8486
8463
  className
8487
8464
  }) {
8488
- return (
8489
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
8490
- /* @__PURE__ */ jsx(
8491
- "img",
8492
- {
8493
- src,
8494
- alt,
8495
- width,
8496
- height,
8497
- className,
8498
- style: { objectFit }
8499
- }
8500
- )
8465
+ return /* @__PURE__ */ jsx(
8466
+ "img",
8467
+ {
8468
+ src,
8469
+ alt,
8470
+ width,
8471
+ height,
8472
+ className,
8473
+ style: { objectFit }
8474
+ }
8501
8475
  );
8502
8476
  }
8503
8477
  ImagePattern.displayName = "ImagePattern";
@@ -8955,30 +8929,24 @@ function CustomPattern({
8955
8929
  }
8956
8930
  );
8957
8931
  case "a":
8958
- return (
8959
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
8960
- /* @__PURE__ */ jsx(
8961
- "a",
8962
- {
8963
- href: href ?? "#",
8964
- target: external ? "_blank" : void 0,
8965
- rel: external ? "noopener noreferrer" : void 0,
8966
- ...commonProps,
8967
- children: renderContent
8968
- }
8969
- )
8932
+ return /* @__PURE__ */ jsx(
8933
+ "a",
8934
+ {
8935
+ href: href ?? "#",
8936
+ target: external ? "_blank" : void 0,
8937
+ rel: external ? "noopener noreferrer" : void 0,
8938
+ ...commonProps,
8939
+ children: renderContent
8940
+ }
8970
8941
  );
8971
8942
  case "img":
8972
- return (
8973
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
8974
- /* @__PURE__ */ jsx(
8975
- "img",
8976
- {
8977
- src,
8978
- alt: alt ?? "",
8979
- ...commonProps
8980
- }
8981
- )
8943
+ return /* @__PURE__ */ jsx(
8944
+ "img",
8945
+ {
8946
+ src,
8947
+ alt: alt ?? "",
8948
+ ...commonProps
8949
+ }
8982
8950
  );
8983
8951
  case "input":
8984
8952
  return /* @__PURE__ */ jsx(
@@ -1,4 +1,4 @@
1
- import { useUISlotManager } from './chunk-7NEWMNNU.js';
1
+ import { useUISlotManager } from './chunk-3JGAROCW.js';
2
2
  import { createContext, useMemo, useState, useEffect, useCallback, useContext } from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4