analytica-frontend-lib 1.1.95 → 1.1.96

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
@@ -8088,7 +8088,7 @@ var VALUE_TEXT_COLORS = {
8088
8088
  low: "text-error-700",
8089
8089
  total: "text-info-700"
8090
8090
  };
8091
- var StatCard = ({ item }) => {
8091
+ var StatCard = ({ item, showPlaceholder = false }) => {
8092
8092
  return /* @__PURE__ */ jsxs30(
8093
8093
  "div",
8094
8094
  {
@@ -8100,7 +8100,7 @@ var StatCard = ({ item }) => {
8100
8100
  size: "4xl",
8101
8101
  weight: "bold",
8102
8102
  className: `${VALUE_TEXT_COLORS[item.variant]} leading-[42px] tracking-[0.2px] self-stretch`,
8103
- children: item.value
8103
+ children: showPlaceholder ? "-" : item.value
8104
8104
  }
8105
8105
  ),
8106
8106
  /* @__PURE__ */ jsx42(
@@ -8116,9 +8116,16 @@ var StatCard = ({ item }) => {
8116
8116
  }
8117
8117
  );
8118
8118
  };
8119
+ var getGridColumnsClass = (itemCount) => {
8120
+ if (itemCount === 4) return "lg:grid-cols-4";
8121
+ if (itemCount === 3) return "lg:grid-cols-3";
8122
+ if (itemCount === 2) return "lg:grid-cols-2";
8123
+ return "lg:grid-cols-1";
8124
+ };
8119
8125
  var StatisticsCard = ({
8120
8126
  title,
8121
8127
  data,
8128
+ showPlaceholder = false,
8122
8129
  emptyStateMessage,
8123
8130
  emptyStateButtonText,
8124
8131
  onEmptyStateButtonClick,
@@ -8130,6 +8137,7 @@ var StatisticsCard = ({
8130
8137
  className = ""
8131
8138
  }) => {
8132
8139
  const hasData = data && data.length > 0;
8140
+ const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
8133
8141
  return /* @__PURE__ */ jsxs30(
8134
8142
  "div",
8135
8143
  {
@@ -8157,13 +8165,20 @@ var StatisticsCard = ({
8157
8165
  }
8158
8166
  ) })
8159
8167
  ] }),
8160
- hasData ? /* @__PURE__ */ jsx42("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[13px]", children: data.map((item, index) => /* @__PURE__ */ jsx42(
8161
- StatCard,
8168
+ hasData ? /* @__PURE__ */ jsx42(
8169
+ "div",
8162
8170
  {
8163
- item
8164
- },
8165
- `${item.variant}-${item.label}-${index}`
8166
- )) }) : /* @__PURE__ */ jsxs30("div", { className: "border border-dashed border-border-300 rounded-lg p-6 min-h-[105px] flex flex-col items-center justify-center gap-2", children: [
8171
+ className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
8172
+ children: data.map((item, index) => /* @__PURE__ */ jsx42(
8173
+ StatCard,
8174
+ {
8175
+ item,
8176
+ showPlaceholder
8177
+ },
8178
+ `${item.variant}-${item.label}-${index}`
8179
+ ))
8180
+ }
8181
+ ) : /* @__PURE__ */ jsxs30("div", { className: "border border-dashed border-border-300 rounded-lg p-6 min-h-[105px] flex flex-col items-center justify-center gap-2", children: [
8167
8182
  /* @__PURE__ */ jsx42(
8168
8183
  Text_default,
8169
8184
  {