@upbound/monarch-blocks 0.8.3 → 0.9.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.
@@ -3006,16 +3006,21 @@ var defaultNoFilterFoundConfig = {
3006
3006
  header: "No matching results",
3007
3007
  subheader: "Try adjusting your search or filters."
3008
3008
  };
3009
+ function mergeConfig(defaults, custom) {
3010
+ if (!custom) return defaults;
3011
+ const provided = Object.fromEntries(Object.entries(custom).filter(([, value]) => value !== void 0));
3012
+ return __spreadValues(__spreadValues({}, defaults), provided);
3013
+ }
3009
3014
  function DataTableEmptyView({
3010
3015
  emptyView,
3011
3016
  tableState,
3012
3017
  filterCount,
3013
3018
  resetFilters
3014
3019
  }) {
3015
- var _a, _b, _c, _d, _e, _f, _g;
3020
+ var _a, _b, _c, _d;
3016
3021
  const isFilteredEmpty = tableState === "empty" && filterCount > 0;
3017
- const config = tableState === "error" ? (_a = emptyView == null ? void 0 : emptyView.error) != null ? _a : defaultErrorConfig : tableState === "empty" ? isFilteredEmpty ? (_b = emptyView == null ? void 0 : emptyView.filter) != null ? _b : defaultNoFilterFoundConfig : (_c = emptyView == null ? void 0 : emptyView.empty) != null ? _c : defaultEmptyConfig : null;
3018
- const wrapperClassName = tableState === "error" ? (_f = (_d = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _d.wrapperClassName) != null ? _f : (_e = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _e.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
3022
+ const config = tableState === "error" ? mergeConfig(defaultErrorConfig, emptyView == null ? void 0 : emptyView.error) : tableState === "empty" ? isFilteredEmpty ? mergeConfig(defaultNoFilterFoundConfig, emptyView == null ? void 0 : emptyView.filter) : mergeConfig(defaultEmptyConfig, emptyView == null ? void 0 : emptyView.empty) : null;
3023
+ const wrapperClassName = tableState === "error" ? (_c = (_a = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _a.wrapperClassName) != null ? _c : (_b = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _b.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
3019
3024
  const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs5(Button4, { variant: "outline", size: "sm", onClick: resetFilters, children: [
3020
3025
  /* @__PURE__ */ jsx6(Icon4, { name: "xmark" }),
3021
3026
  "Clear filters"
@@ -3028,7 +3033,7 @@ function DataTableEmptyView({
3028
3033
  ] }),
3029
3034
  (config.details || config.action || defaultAction) && /* @__PURE__ */ jsxs5(EmptyContent, { children: [
3030
3035
  config.details && /* @__PURE__ */ jsx6(Alert, { children: /* @__PURE__ */ jsx6(AlertDescription, { children: config.details }) }),
3031
- (_g = config.action) != null ? _g : defaultAction
3036
+ (_d = config.action) != null ? _d : defaultAction
3032
3037
  ] })
3033
3038
  ] }) });
3034
3039
  }