@almadar/ui 2.1.11 → 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';
@@ -6641,8 +6641,7 @@ function DataTable({
6641
6641
  ] }),
6642
6642
  /* @__PURE__ */ jsx(Box, { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
6643
6643
  /* @__PURE__ */ jsx("thead", { className: "bg-[var(--color-table-header)] border-b-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsxs("tr", { children: [
6644
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6645
- /* @__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(
6646
6645
  Checkbox,
6647
6646
  {
6648
6647
  checked: allSelected,
@@ -6650,176 +6649,156 @@ function DataTable({
6650
6649
  onChange: handleSelectAll
6651
6650
  }
6652
6651
  ) }),
6653
- normalizedColumns.map((col) => (
6654
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6655
- /* @__PURE__ */ jsx(
6656
- "th",
6657
- {
6658
- "data-column": String(col.key),
6659
- className: cn(
6660
- "px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider whitespace-nowrap",
6661
- col.sortable && "cursor-pointer select-none hover:bg-[var(--color-table-row-hover)]"
6662
- ),
6663
- style: { width: col.width },
6664
- onClick: () => col.sortable && handleSort(String(col.key)),
6665
- children: /* @__PURE__ */ jsxs(HStack, { className: "items-center gap-1", children: [
6666
- col.header,
6667
- col.sortable && sortBy === col.key && (sortDirection === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }))
6668
- ] })
6669
- },
6670
- String(col.key)
6671
- )
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)
6672
6668
  )),
6673
6669
  rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
6674
6670
  ] }) }),
6675
- /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? (
6676
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6677
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6678
- "td",
6679
- {
6680
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6681
- className: "px-4 py-12 text-center",
6682
- children: /* @__PURE__ */ jsxs(VStack, { className: "items-center gap-2", children: [
6683
- /* @__PURE__ */ jsx(Spinner, { size: "lg" }),
6684
- /* @__PURE__ */ jsx(
6685
- Typography,
6686
- {
6687
- variant: "small",
6688
- className: "text-[var(--color-muted-foreground)]",
6689
- children: t("common.loading")
6690
- }
6691
- )
6692
- ] })
6693
- }
6694
- ) })
6695
- ) : error ? (
6696
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6697
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
6698
- "td",
6699
- {
6700
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6701
- className: "px-4 py-12 text-center text-[var(--color-error)]",
6702
- children: [
6703
- t("error.generic") + ": ",
6704
- error.message
6705
- ]
6706
- }
6707
- ) })
6708
- ) : items.length === 0 ? (
6709
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6710
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
6711
- "td",
6712
- {
6713
- colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
6714
- className: "px-4 py-12",
6715
- children: /* @__PURE__ */ jsx(
6716
- 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,
6717
6680
  {
6718
- icon: emptyIcon,
6719
- title: resolvedEmptyTitle,
6720
- description: resolvedEmptyDescription,
6721
- actionLabel: emptyAction?.label,
6722
- actionEvent: emptyAction?.event
6681
+ variant: "small",
6682
+ className: "text-[var(--color-muted-foreground)]",
6683
+ children: t("common.loading")
6723
6684
  }
6724
6685
  )
6725
- }
6726
- ) })
6727
- ) : items.map((row, rowIndex) => (
6728
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6729
- /* @__PURE__ */ jsxs(
6730
- "tr",
6731
- {
6732
- "data-entity-row": true,
6733
- className: cn(
6734
- "border-b border-[var(--color-table-border)] last:border-0 hover:bg-[var(--color-table-row-hover)] transition-colors",
6735
- selectedIds.includes(row.id) && "bg-[var(--color-primary)]/10 font-medium",
6736
- isRowClickable && "cursor-pointer"
6737
- ),
6738
- onClick: () => isRowClickable && handleRowClick(row),
6739
- children: [
6740
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6741
- /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
6742
- 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,
6743
6750
  {
6744
- checked: selectedIds.includes(row.id),
6745
- 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)]" })
6746
6760
  }
6747
- ) }),
6748
- normalizedColumns.map((col) => {
6749
- const cellValue = getNestedValue(
6750
- row,
6751
- String(col.key)
6752
- );
6753
- return (
6754
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6755
- /* @__PURE__ */ jsx(
6756
- "td",
6757
- {
6758
- "data-column": String(col.key),
6759
- className: "px-4 py-3 text-sm text-[var(--color-foreground)] whitespace-nowrap sm:whitespace-normal",
6760
- children: col.render ? col.render(cellValue, row, rowIndex) : String(cellValue ?? "")
6761
- },
6762
- String(col.key)
6763
- )
6764
- );
6765
- }),
6766
- rowActions && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
6767
- /* @__PURE__ */ jsxs("td", { className: "px-4 py-3 relative", children: [
6761
+ ),
6762
+ openActionMenu === row.id && /* @__PURE__ */ jsxs(Fragment, { children: [
6768
6763
  /* @__PURE__ */ jsx(
6769
- Button,
6764
+ Box,
6770
6765
  {
6771
- variant: "ghost",
6772
- className: "p-1 rounded hover:bg-[var(--color-muted)]",
6766
+ className: "fixed inset-0 z-40",
6773
6767
  onClick: (e) => {
6774
6768
  e.stopPropagation();
6775
- setOpenActionMenu(
6776
- openActionMenu === row.id ? null : row.id
6777
- );
6778
- },
6779
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 text-[var(--color-muted-foreground)]" })
6769
+ setOpenActionMenu(null);
6770
+ }
6780
6771
  }
6781
6772
  ),
6782
- openActionMenu === row.id && /* @__PURE__ */ jsxs(Fragment, { children: [
6783
- /* @__PURE__ */ jsx(
6784
- Box,
6785
- {
6786
- className: "fixed inset-0 z-40",
6787
- onClick: (e) => {
6788
- e.stopPropagation();
6789
- setOpenActionMenu(null);
6790
- }
6791
- }
6792
- ),
6793
- /* @__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(
6794
- (action) => !action.show || action.show(row)
6795
- ).map((action, idx) => /* @__PURE__ */ jsxs(
6796
- Button,
6797
- {
6798
- variant: "ghost",
6799
- "data-event": action.event,
6800
- "data-testid": action.event ? `action-${action.event}` : void 0,
6801
- className: cn(
6802
- "w-full flex items-center gap-2 px-4 py-2 text-sm",
6803
- action.variant === "danger" ? "text-[var(--color-error)] hover:bg-[var(--color-error)]/10" : "text-[var(--color-foreground)] hover:bg-[var(--color-muted)]"
6804
- ),
6805
- onClick: (e) => {
6806
- e.stopPropagation();
6807
- action.onClick(row);
6808
- setOpenActionMenu(null);
6809
- },
6810
- children: [
6811
- action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
6812
- action.label
6813
- ]
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);
6814
6789
  },
6815
- idx
6816
- )) })
6817
- ] })
6790
+ children: [
6791
+ action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
6792
+ action.label
6793
+ ]
6794
+ },
6795
+ idx
6796
+ )) })
6818
6797
  ] })
6819
- ]
6820
- },
6821
- row.id
6822
- )
6798
+ ] })
6799
+ ]
6800
+ },
6801
+ row.id
6823
6802
  )) })
6824
6803
  ] }) }),
6825
6804
  totalCount !== void 0 && totalPages > 1 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 border-t-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsx(
@@ -7057,16 +7036,13 @@ var PageHeader = ({
7057
7036
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
7058
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: [
7059
7038
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
7060
- crumb.href ? (
7061
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
7062
- /* @__PURE__ */ jsx(
7063
- "a",
7064
- {
7065
- href: crumb.href,
7066
- className: "text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)]",
7067
- children: crumb.label
7068
- }
7069
- )
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
+ }
7070
7046
  ) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[var(--color-foreground)] font-medium", children: crumb.label })
7071
7047
  ] }, idx)) }) }),
7072
7048
  /* @__PURE__ */ jsxs(Box, { className: "flex items-start justify-between gap-4", children: [
@@ -7602,11 +7578,12 @@ var Form = ({
7602
7578
  const resolvedSubmitLabel = submitLabel ?? t("common.save");
7603
7579
  const resolvedCancelLabel = cancelLabel ?? t("common.cancel");
7604
7580
  const normalizedInitialData = initialData ?? {};
7605
- 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;
7606
7583
  const entityDerivedFields = React41__default.useMemo(() => {
7607
7584
  if (fields && fields.length > 0) return void 0;
7608
- if (!entity || typeof entity === "string") return void 0;
7609
- return entity.fields.map(
7585
+ if (!resolvedEntity) return void 0;
7586
+ return resolvedEntity.fields.map(
7610
7587
  (f) => ({
7611
7588
  name: f.name,
7612
7589
  type: f.type,
@@ -7963,47 +7940,44 @@ var Form = ({
7963
7940
  );
7964
7941
  }
7965
7942
  }
7966
- return (
7967
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native <form> needed for onSubmit semantics
7968
- /* @__PURE__ */ jsxs(
7969
- "form",
7970
- {
7971
- className: cn(layoutStyles[layout], gapStyles5[gap], className),
7972
- onSubmit: handleSubmit,
7973
- ...props,
7974
- children: [
7975
- error && /* @__PURE__ */ jsx(Alert, { variant: "error", className: "mb-4", children: error.message || t("error.occurred") }),
7976
- sectionElements && sectionElements.length > 0 && /* @__PURE__ */ jsx(VStack, { gap: gap === "sm" ? "sm" : gap === "lg" ? "lg" : "md", children: sectionElements }),
7977
- schemaFields,
7978
- children,
7979
- (schemaFields && schemaFields.length > 0 || sectionElements && sectionElements.length > 0) && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "pt-4", children: [
7980
- /* @__PURE__ */ jsx(
7981
- Button,
7982
- {
7983
- type: "submit",
7984
- variant: "primary",
7985
- disabled: isLoading,
7986
- "data-event": submitEvent,
7987
- "data-testid": `action-${submitEvent}`,
7988
- children: isLoading ? t("form.saving") : resolvedSubmitLabel
7989
- }
7990
- ),
7991
- shouldShowCancel && /* @__PURE__ */ jsx(
7992
- Button,
7993
- {
7994
- type: "button",
7995
- variant: "secondary",
7996
- onClick: handleCancel,
7997
- disabled: isLoading,
7998
- "data-event": cancelEvent,
7999
- "data-testid": `action-${cancelEvent}`,
8000
- children: resolvedCancelLabel
8001
- }
8002
- )
8003
- ] })
8004
- ]
8005
- }
8006
- )
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
+ }
8007
7981
  );
8008
7982
  };
8009
7983
  function formatDateValue(value) {
@@ -8408,19 +8382,16 @@ function LinkPattern({
8408
8382
  emit(`UI:${onClick}`, { href });
8409
8383
  }
8410
8384
  };
8411
- return (
8412
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
8413
- /* @__PURE__ */ jsx(
8414
- "a",
8415
- {
8416
- href: href ?? "#",
8417
- target: external ? "_blank" : void 0,
8418
- rel: external ? "noopener noreferrer" : void 0,
8419
- onClick: onClick ? handleClick : void 0,
8420
- className,
8421
- children: label
8422
- }
8423
- )
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
+ }
8424
8395
  );
8425
8396
  }
8426
8397
  LinkPattern.displayName = "LinkPattern";
@@ -8491,19 +8462,16 @@ function ImagePattern({
8491
8462
  objectFit = "cover",
8492
8463
  className
8493
8464
  }) {
8494
- return (
8495
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
8496
- /* @__PURE__ */ jsx(
8497
- "img",
8498
- {
8499
- src,
8500
- alt,
8501
- width,
8502
- height,
8503
- className,
8504
- style: { objectFit }
8505
- }
8506
- )
8465
+ return /* @__PURE__ */ jsx(
8466
+ "img",
8467
+ {
8468
+ src,
8469
+ alt,
8470
+ width,
8471
+ height,
8472
+ className,
8473
+ style: { objectFit }
8474
+ }
8507
8475
  );
8508
8476
  }
8509
8477
  ImagePattern.displayName = "ImagePattern";
@@ -8961,30 +8929,24 @@ function CustomPattern({
8961
8929
  }
8962
8930
  );
8963
8931
  case "a":
8964
- return (
8965
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic anchor with href
8966
- /* @__PURE__ */ jsx(
8967
- "a",
8968
- {
8969
- href: href ?? "#",
8970
- target: external ? "_blank" : void 0,
8971
- rel: external ? "noopener noreferrer" : void 0,
8972
- ...commonProps,
8973
- children: renderContent
8974
- }
8975
- )
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
+ }
8976
8941
  );
8977
8942
  case "img":
8978
- return (
8979
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
8980
- /* @__PURE__ */ jsx(
8981
- "img",
8982
- {
8983
- src,
8984
- alt: alt ?? "",
8985
- ...commonProps
8986
- }
8987
- )
8943
+ return /* @__PURE__ */ jsx(
8944
+ "img",
8945
+ {
8946
+ src,
8947
+ alt: alt ?? "",
8948
+ ...commonProps
8949
+ }
8988
8950
  );
8989
8951
  case "input":
8990
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
 
@@ -1,12 +1,15 @@
1
1
  import { useEventBus } from './chunk-YXZM3WCF.js';
2
+ import { en_default } from './chunk-TSETXL2E.js';
2
3
  import React2, { createContext, useContext, useState, useMemo, useCallback, useEffect } from 'react';
3
4
  import { jsx } from 'react/jsx-runtime';
4
5
 
6
+ var { $meta: _meta, ...coreMessages } = en_default;
7
+ var coreLocale = coreMessages;
5
8
  var I18nContext = createContext({
6
9
  locale: "en",
7
10
  direction: "ltr",
8
- t: (key) => key
9
- // passthrough fallback
11
+ t: (key) => coreLocale[key] ?? key
12
+ // core locale fallback
10
13
  });
11
14
  I18nContext.displayName = "I18nContext";
12
15
  var I18nProvider = I18nContext.Provider;
@@ -15,7 +18,7 @@ function useTranslate() {
15
18
  }
16
19
  function createTranslate(messages) {
17
20
  return (key, params) => {
18
- let msg = messages[key] ?? key;
21
+ let msg = messages[key] ?? coreLocale[key] ?? key;
19
22
  if (params) {
20
23
  for (const [k, v] of Object.entries(params)) {
21
24
  msg = msg.split(`{{${k}}}`).join(String(v));