@inf-monkeys-tech/monkeys-design 1.0.104 → 1.0.107

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.
package/dist/index.mjs CHANGED
@@ -22725,8 +22725,8 @@ function DataExplorerActionBar({
22725
22725
  classNames
22726
22726
  }) {
22727
22727
  const theme = resolveDataExplorerAppearance(appearance);
22728
- const hasContent = !!leading || !!trailing || !!children || actions.length > 0;
22729
- const hasRenderableContent = hasContent || !!empty;
22728
+ const hasContent2 = !!leading || !!trailing || !!children || actions.length > 0;
22729
+ const hasRenderableContent = hasContent2 || !!empty;
22730
22730
  if (!hasRenderableContent) {
22731
22731
  return null;
22732
22732
  }
@@ -22747,7 +22747,7 @@ function DataExplorerActionBar({
22747
22747
  actions,
22748
22748
  layout: "action-bar",
22749
22749
  appearance,
22750
- empty: !hasContent ? empty : void 0,
22750
+ empty: !hasContent2 ? empty : void 0,
22751
22751
  classNames: {
22752
22752
  root: classNames?.actions,
22753
22753
  action: classNames?.action
@@ -22854,28 +22854,47 @@ function DataExplorerFilterBar({
22854
22854
  }
22855
22855
  );
22856
22856
  }
22857
+ function hasContent(value) {
22858
+ return value !== null && value !== void 0 && value !== false && value !== "";
22859
+ }
22857
22860
  function DataExplorerDetailField({
22858
22861
  field,
22859
22862
  label = field?.label,
22860
22863
  icon = field?.icon,
22861
22864
  value = field?.value,
22865
+ helperText = field?.helperText,
22866
+ error = field?.error,
22867
+ required = field?.required ?? false,
22868
+ disabled = field?.disabled ?? false,
22862
22869
  children,
22863
22870
  context,
22864
22871
  className,
22865
22872
  valueClassName = field?.valueClassName,
22866
- classNames
22873
+ classNames,
22874
+ dataAttributes = field?.dataAttributes,
22875
+ labelDataAttributes = field?.labelDataAttributes,
22876
+ valueDataAttributes = field?.valueDataAttributes,
22877
+ helperDataAttributes = field?.helperDataAttributes,
22878
+ errorDataAttributes = field?.errorDataAttributes
22867
22879
  }) {
22868
22880
  const resolvedClassNames = {
22869
22881
  ...field?.classNames,
22870
22882
  ...classNames
22871
22883
  };
22872
22884
  const content = children ?? (field?.render ? field.render(context) : value);
22885
+ const hasError = hasContent(error);
22873
22886
  return /* @__PURE__ */ jsxs(
22874
22887
  "div",
22875
22888
  {
22889
+ ...dataAttributes,
22876
22890
  title: field?.title,
22891
+ "aria-disabled": disabled || void 0,
22892
+ "data-disabled": disabled || void 0,
22893
+ "data-invalid": hasError || void 0,
22894
+ "data-required": required || void 0,
22877
22895
  className: cn3(
22878
22896
  "space-y-1",
22897
+ disabled && "opacity-60",
22879
22898
  resolvedClassNames.root,
22880
22899
  field?.className,
22881
22900
  className
@@ -22899,13 +22918,22 @@ function DataExplorerDetailField({
22899
22918
  children: icon
22900
22919
  }
22901
22920
  ) : null,
22902
- /* @__PURE__ */ jsx("span", { children: label })
22921
+ /* @__PURE__ */ jsx("span", { ...labelDataAttributes, children: label }),
22922
+ required ? /* @__PURE__ */ jsx(
22923
+ "span",
22924
+ {
22925
+ "aria-hidden": "true",
22926
+ className: cn3("text-destructive-text", resolvedClassNames.required),
22927
+ children: "*"
22928
+ }
22929
+ ) : null
22903
22930
  ]
22904
22931
  }
22905
22932
  ),
22906
22933
  /* @__PURE__ */ jsx(
22907
22934
  "div",
22908
22935
  {
22936
+ ...valueDataAttributes,
22909
22937
  className: cn3(
22910
22938
  "text-[15px] leading-6 text-foreground",
22911
22939
  resolvedClassNames.value,
@@ -22913,7 +22941,32 @@ function DataExplorerDetailField({
22913
22941
  ),
22914
22942
  children: content
22915
22943
  }
22916
- )
22944
+ ),
22945
+ hasContent(helperText) ? /* @__PURE__ */ jsx(
22946
+ "div",
22947
+ {
22948
+ ...helperDataAttributes,
22949
+ "data-slot": "helper",
22950
+ className: cn3(
22951
+ "text-xs leading-5 text-muted-foreground",
22952
+ resolvedClassNames.helper
22953
+ ),
22954
+ children: helperText
22955
+ }
22956
+ ) : null,
22957
+ hasError ? /* @__PURE__ */ jsx(
22958
+ "div",
22959
+ {
22960
+ ...errorDataAttributes,
22961
+ role: "alert",
22962
+ "data-slot": "error",
22963
+ className: cn3(
22964
+ "text-xs leading-5 text-destructive-text",
22965
+ resolvedClassNames.error
22966
+ ),
22967
+ children: error
22968
+ }
22969
+ ) : null
22917
22970
  ]
22918
22971
  }
22919
22972
  );
@@ -22936,8 +22989,8 @@ function DataExplorerDetailSection({
22936
22989
  (field) => !(resolveDataExplorerValue(field.hidden, context) ?? false)
22937
22990
  );
22938
22991
  const sectionChildren = children ?? (typeof section?.children === "function" ? section.children(context) : section?.children);
22939
- const hasContent = Boolean(sectionChildren) || visibleFields.length > 0;
22940
- if (!hasContent) {
22992
+ const hasContent2 = Boolean(sectionChildren) || visibleFields.length > 0;
22993
+ if (!hasContent2 || resolveDataExplorerValue(section?.hidden, context)) {
22941
22994
  return null;
22942
22995
  }
22943
22996
  return /* @__PURE__ */ jsxs(