subos-frontend 1.0.19 → 1.0.20
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.js +24 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +10 -0
- package/dist/types/components/subscription/SubscriptionInfoGrid.d.ts +2 -0
- package/dist/types/components/subscription/SubscriptionInfoGrid.d.ts.map +1 -1
- package/dist/types/components/subscription/SubscriptionUsageDisplay.d.ts +2 -0
- package/dist/types/components/subscription/SubscriptionUsageDisplay.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2149,7 +2149,9 @@ var SubscriptionInfoGrid = ({
|
|
|
2149
2149
|
fields,
|
|
2150
2150
|
className = "",
|
|
2151
2151
|
gridCols = 3,
|
|
2152
|
-
showDefaultFields = true
|
|
2152
|
+
showDefaultFields = true,
|
|
2153
|
+
labelFontWeight = "normal",
|
|
2154
|
+
valueFontWeight = "medium"
|
|
2153
2155
|
}) => {
|
|
2154
2156
|
const displayFields = fields || (showDefaultFields ? defaultFields : []);
|
|
2155
2157
|
if (!subscription || displayFields.length === 0) {
|
|
@@ -2203,7 +2205,9 @@ var SubscriptionUsageDisplay = ({
|
|
|
2203
2205
|
usageMetrics,
|
|
2204
2206
|
className = "",
|
|
2205
2207
|
gridCols = 3,
|
|
2206
|
-
showProgressBars = false
|
|
2208
|
+
showProgressBars = false,
|
|
2209
|
+
labelFontWeight = "normal",
|
|
2210
|
+
valueFontWeight = "medium"
|
|
2207
2211
|
}) => {
|
|
2208
2212
|
if (!subscription || usageMetrics.length === 0) {
|
|
2209
2213
|
return null;
|
|
@@ -2236,6 +2240,22 @@ var SubscriptionUsageDisplay = ({
|
|
|
2236
2240
|
if (percentage >= 75) return "bg-yellow-500";
|
|
2237
2241
|
return "bg-green-500";
|
|
2238
2242
|
};
|
|
2243
|
+
const getFontWeightClass = (weight) => {
|
|
2244
|
+
switch (weight) {
|
|
2245
|
+
case "light":
|
|
2246
|
+
return "font-light";
|
|
2247
|
+
case "normal":
|
|
2248
|
+
return "font-normal";
|
|
2249
|
+
case "medium":
|
|
2250
|
+
return "font-medium";
|
|
2251
|
+
case "semibold":
|
|
2252
|
+
return "font-semibold";
|
|
2253
|
+
case "bold":
|
|
2254
|
+
return "font-bold";
|
|
2255
|
+
default:
|
|
2256
|
+
return "font-normal";
|
|
2257
|
+
}
|
|
2258
|
+
};
|
|
2239
2259
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${getGridClass()} gap-4 ${className}`, children: usageMetrics.map((metric) => {
|
|
2240
2260
|
var _a, _b;
|
|
2241
2261
|
const used = ((_a = subscription.usage) == null ? void 0 : _a[metric.key]) || 0;
|
|
@@ -2244,8 +2264,8 @@ var SubscriptionUsageDisplay = ({
|
|
|
2244
2264
|
const percentage = getProgressPercentage(used, total);
|
|
2245
2265
|
const shouldShowProgress = showProgressBars || metric.showProgress;
|
|
2246
2266
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border border-gray-200 rounded-lg bg-white space-y-1", children: [
|
|
2247
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
2248
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
2267
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-sm text-gray-500 ${getFontWeightClass(labelFontWeight)}`, children: metric.label }),
|
|
2268
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: getFontWeightClass(valueFontWeight), children: displayValue }),
|
|
2249
2269
|
shouldShowProgress && total > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-gray-200 rounded-full h-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2250
2270
|
"div",
|
|
2251
2271
|
{
|