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.d.mts CHANGED
@@ -150,7 +150,7 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
150
150
  state?: CheckboxListState;
151
151
  /** Additional CSS classes */
152
152
  className?: string;
153
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
153
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
154
154
 
155
155
  /**
156
156
  * Notification store state interface
package/dist/index.d.ts CHANGED
@@ -150,7 +150,7 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
150
150
  state?: CheckboxListState;
151
151
  /** Additional CSS classes */
152
152
  className?: string;
153
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
153
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
154
154
 
155
155
  /**
156
156
  * Notification store state interface
package/dist/index.js CHANGED
@@ -8170,7 +8170,7 @@ var VALUE_TEXT_COLORS = {
8170
8170
  low: "text-error-700",
8171
8171
  total: "text-info-700"
8172
8172
  };
8173
- var StatCard = ({ item }) => {
8173
+ var StatCard = ({ item, showPlaceholder = false }) => {
8174
8174
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
8175
8175
  "div",
8176
8176
  {
@@ -8182,7 +8182,7 @@ var StatCard = ({ item }) => {
8182
8182
  size: "4xl",
8183
8183
  weight: "bold",
8184
8184
  className: `${VALUE_TEXT_COLORS[item.variant]} leading-[42px] tracking-[0.2px] self-stretch`,
8185
- children: item.value
8185
+ children: showPlaceholder ? "-" : item.value
8186
8186
  }
8187
8187
  ),
8188
8188
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
@@ -8198,9 +8198,16 @@ var StatCard = ({ item }) => {
8198
8198
  }
8199
8199
  );
8200
8200
  };
8201
+ var getGridColumnsClass = (itemCount) => {
8202
+ if (itemCount === 4) return "lg:grid-cols-4";
8203
+ if (itemCount === 3) return "lg:grid-cols-3";
8204
+ if (itemCount === 2) return "lg:grid-cols-2";
8205
+ return "lg:grid-cols-1";
8206
+ };
8201
8207
  var StatisticsCard = ({
8202
8208
  title,
8203
8209
  data,
8210
+ showPlaceholder = false,
8204
8211
  emptyStateMessage,
8205
8212
  emptyStateButtonText,
8206
8213
  onEmptyStateButtonClick,
@@ -8212,6 +8219,7 @@ var StatisticsCard = ({
8212
8219
  className = ""
8213
8220
  }) => {
8214
8221
  const hasData = data && data.length > 0;
8222
+ const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
8215
8223
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
8216
8224
  "div",
8217
8225
  {
@@ -8239,13 +8247,20 @@ var StatisticsCard = ({
8239
8247
  }
8240
8248
  ) })
8241
8249
  ] }),
8242
- hasData ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[13px]", children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8243
- StatCard,
8250
+ hasData ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8251
+ "div",
8244
8252
  {
8245
- item
8246
- },
8247
- `${item.variant}-${item.label}-${index}`
8248
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("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: [
8253
+ className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
8254
+ children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8255
+ StatCard,
8256
+ {
8257
+ item,
8258
+ showPlaceholder
8259
+ },
8260
+ `${item.variant}-${item.label}-${index}`
8261
+ ))
8262
+ }
8263
+ ) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("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: [
8249
8264
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8250
8265
  Text_default,
8251
8266
  {