@scalio-cloud/ui 0.51.0 → 0.51.1
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/nav.css +2 -0
- package/package.json +1 -1
- package/react/fields.js +1 -1
- package/react/license.js +4 -2
package/nav.css
CHANGED
|
@@ -603,6 +603,8 @@
|
|
|
603
603
|
.scalio-license-bar > div { height: 100%; background: hsl(var(--primary)); }
|
|
604
604
|
.scalio-license-bar > div.is-unlimited { background: #10b981; }
|
|
605
605
|
.scalio-license-bar > div.is-full { background: hsl(var(--destructive)); }
|
|
606
|
+
.scalio-license-bar > div.is-near { background: #d97706; }
|
|
607
|
+
.dark .scalio-license-bar > div.is-near { background: #f59e0b; }
|
|
606
608
|
.scalio-license-addons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
|
|
607
609
|
@media (min-width: 640px) { .scalio-license-addons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
608
610
|
.scalio-license-addon { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: 2px; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"private": false,
|
package/react/fields.js
CHANGED
|
@@ -455,7 +455,7 @@ function Input(props) {
|
|
|
455
455
|
className: error ? `${className} border-destructive` : className,
|
|
456
456
|
"aria-invalid": error ? true : rest["aria-invalid"],
|
|
457
457
|
"aria-describedby": error ? `${id}-error` : rest["aria-describedby"],
|
|
458
|
-
"data-testid": testId,
|
|
458
|
+
"data-testid": testId !== undefined ? testId : rest["data-testid"],
|
|
459
459
|
onChange: change,
|
|
460
460
|
onBlur: blur,
|
|
461
461
|
})),
|
package/react/license.js
CHANGED
|
@@ -93,6 +93,8 @@ function UsageBar({ item }) {
|
|
|
93
93
|
const used = item.used === undefined || item.used === null ? null : item.used;
|
|
94
94
|
const full = !unlimited && used !== null && used >= item.max;
|
|
95
95
|
const pct = unlimited ? 100 : Math.min(100, Math.round(((used || 0) / Math.max(1, item.max)) * 100));
|
|
96
|
+
// Amber from 90 percent: a hint to extend before new people are blocked.
|
|
97
|
+
const near = !unlimited && !full && used !== null && pct >= 90;
|
|
96
98
|
return h(
|
|
97
99
|
"div",
|
|
98
100
|
{ "data-testid": `license-limit-${item.key}` },
|
|
@@ -100,9 +102,9 @@ function UsageBar({ item }) {
|
|
|
100
102
|
"div",
|
|
101
103
|
{ className: "scalio-license-bar-head" },
|
|
102
104
|
h("span", { className: "scalio-license-bar-label" }, item.label),
|
|
103
|
-
h("span", { className: cx("scalio-license-bar-value", full && "is-error") }, used === null ? "-" : used, " / ", unlimited ? "∞" : item.max)
|
|
105
|
+
h("span", { className: cx("scalio-license-bar-value", full && "is-error", near && "is-warn") }, used === null ? "-" : used, " / ", unlimited ? "∞" : item.max)
|
|
104
106
|
),
|
|
105
|
-
h("div", { className: "scalio-license-bar" }, h("div", { className: cx(full && "is-full", unlimited && "is-unlimited"), style: { width: `${pct}%` } })),
|
|
107
|
+
h("div", { className: "scalio-license-bar" }, h("div", { className: cx(full && "is-full", near && "is-near", unlimited && "is-unlimited"), style: { width: `${pct}%` } })),
|
|
106
108
|
item.hint ? h("p", { className: "scalio-license-bar-hint", "data-testid": `license-limit-${item.key}-hint` }, item.hint) : null
|
|
107
109
|
);
|
|
108
110
|
}
|