@almadar/ui 1.0.26 → 1.0.28

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.
@@ -2558,8 +2558,8 @@ interface DetailPanelProps {
2558
2558
  onClose?: () => void;
2559
2559
  className?: string;
2560
2560
  entity?: string;
2561
- /** Fields to display - accepts string[] or {key, header}[] for unified interface */
2562
- fields?: readonly FieldDef$2[] | readonly DetailField[];
2561
+ /** Fields to display - accepts string[], {key, header}[], or DetailField[] */
2562
+ fields?: readonly (FieldDef$2 | DetailField)[];
2563
2563
  /** Alias for fields - backwards compatibility */
2564
2564
  fieldNames?: readonly string[];
2565
2565
  data?: Record<string, unknown> | unknown;
@@ -1,9 +1,9 @@
1
1
  import { useUISlots } from '../chunk-W5YTXLXL.js';
2
+ import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from '../chunk-KKCVDUK7.js';
3
+ export { cn } from '../chunk-KKCVDUK7.js';
2
4
  import { useQuerySingleton, useSelectedEntity, useAuthContext } from '../chunk-7IYF4RUG.js';
3
5
  export { ENTITY_EVENTS, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-7IYF4RUG.js';
4
6
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
5
- import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from '../chunk-KKCVDUK7.js';
6
- export { cn } from '../chunk-KKCVDUK7.js';
7
7
  import '../chunk-XSEDIUM6.js';
8
8
  import { useTheme } from '../chunk-4UFNDD6B.js';
9
9
  import { useEventBus, usePaginatedEntityList, useEntityList, useEntityDetail } from '../chunk-HY5EFCOK.js';
@@ -6814,6 +6814,22 @@ var DetailPanel = ({
6814
6814
  let title = propTitle;
6815
6815
  let sections = propSections ? [...propSections] : void 0;
6816
6816
  const normalizedData = data && typeof data === "object" && !Array.isArray(data) ? data : void 0;
6817
+ if (sections && normalizedData) {
6818
+ sections = sections.map((section) => ({
6819
+ ...section,
6820
+ fields: section.fields.map((field) => {
6821
+ if (typeof field === "string") {
6822
+ const value = getNestedValue(normalizedData, field);
6823
+ return {
6824
+ label: formatFieldLabel(field),
6825
+ value: formatFieldValue(value, field),
6826
+ icon: getFieldIcon(field)
6827
+ };
6828
+ }
6829
+ return field;
6830
+ })
6831
+ }));
6832
+ }
6817
6833
  if (normalizedData && effectiveFieldNames) {
6818
6834
  const primaryField = effectiveFieldNames[0];
6819
6835
  if (!title && primaryField && normalizedData[primaryField]) {
@@ -6992,28 +7008,31 @@ var DetailPanel = ({
6992
7008
  sections && sections.map((section, sectionIdx) => /* @__PURE__ */ jsx(Card, { variant: "bordered", children: /* @__PURE__ */ jsxs(VStack, { gap: "md", className: "p-6", children: [
6993
7009
  /* @__PURE__ */ jsx(Typography, { variant: "h4", weight: "semibold", children: section.title }),
6994
7010
  /* @__PURE__ */ jsx(Divider, {}),
6995
- /* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "250px", maxCols: 2, gap: "lg", children: section.fields.map((field, fieldIdx) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
6996
- field.icon && /* @__PURE__ */ jsx(
6997
- Icon,
6998
- {
6999
- icon: field.icon,
7000
- size: "md",
7001
- className: "text-[var(--color-muted-foreground)] mt-1"
7002
- }
7003
- ),
7004
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", flex: true, className: "min-w-0", children: [
7005
- /* @__PURE__ */ jsx(
7006
- Typography,
7011
+ /* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "250px", maxCols: 2, gap: "lg", children: section.fields.map((field, fieldIdx) => {
7012
+ const resolved = typeof field === "string" ? { label: formatFieldLabel(field), value: normalizedData ? formatFieldValue(getNestedValue(normalizedData, field), field) : "\u2014", icon: getFieldIcon(field) } : field;
7013
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
7014
+ resolved.icon && /* @__PURE__ */ jsx(
7015
+ Icon,
7007
7016
  {
7008
- variant: "small",
7009
- color: "secondary",
7010
- weight: "medium",
7011
- children: field.label
7017
+ icon: resolved.icon,
7018
+ size: "md",
7019
+ className: "text-[var(--color-muted-foreground)] mt-1"
7012
7020
  }
7013
7021
  ),
7014
- /* @__PURE__ */ jsx(Typography, { variant: "body", className: "break-words", children: field.value || "\u2014" })
7015
- ] })
7016
- ] }, fieldIdx)) })
7022
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", flex: true, className: "min-w-0", children: [
7023
+ /* @__PURE__ */ jsx(
7024
+ Typography,
7025
+ {
7026
+ variant: "small",
7027
+ color: "secondary",
7028
+ weight: "medium",
7029
+ children: resolved.label
7030
+ }
7031
+ ),
7032
+ /* @__PURE__ */ jsx(Typography, { variant: "body", className: "break-words", children: resolved.value || "\u2014" })
7033
+ ] })
7034
+ ] }, fieldIdx);
7035
+ }) })
7017
7036
  ] }) }, sectionIdx)),
7018
7037
  footer && /* @__PURE__ */ jsx(Card, { variant: "bordered", children: footer })
7019
7038
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",
@@ -65,8 +65,8 @@
65
65
  "remark-math": "^6.0.0",
66
66
  "react-force-graph-2d": "^1.28.0",
67
67
  "@almadar/core": "1.0.17",
68
- "@almadar/patterns": "1.1.1",
69
- "@almadar/evaluator": "1.0.14"
68
+ "@almadar/evaluator": "1.0.14",
69
+ "@almadar/patterns": "1.1.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^18.0.0",