@robert-stackflow/oneui 0.6.6 → 0.6.7
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.7
|
|
4
|
+
|
|
5
|
+
- Add UptimeChart with shared status colors, staggered entrance, hover/focus inspection, native tooltips and reduced-motion support.
|
|
6
|
+
|
|
3
7
|
## 0.6.6
|
|
4
8
|
|
|
5
9
|
- Add Segmented fullWidth to align evenly distributed options with navigation or form containers.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from "./Tooltip.js";
|
|
3
|
+
import s from "./UptimeChart.module.css";
|
|
4
|
+
function UptimeChart({ data, label }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: s.chart, role: "list", "aria-label": label, children: data.map((point, index) => {
|
|
6
|
+
const value = point.value === null || !Number.isFinite(point.value) ? null : Math.max(0, Math.min(100, point.value));
|
|
7
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: point.label, children: /* @__PURE__ */ jsx("span", { role: "listitem", tabIndex: 0, "aria-label": point.label, className: s.cell, "data-state": value === null ? "empty" : value >= 99.9 ? "up" : value > 0 ? "partial" : "down", style: { "--bar-index": Math.min(index, 60) }, children: /* @__PURE__ */ jsx("span", { className: s.bar }) }) }, point.key ?? index);
|
|
8
|
+
}) });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
UptimeChart
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.chart { display: flex; align-items: center; gap: 3px; width: 100%; min-width: 0; height: 36px; }
|
|
2
|
+
.cell { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; height: 32px; outline: none; transform-origin: center bottom; animation: enter 520ms var(--ease) both; animation-delay: calc(var(--bar-index) * 9ms); }
|
|
3
|
+
.bar { width: 100%; height: 22px; border-radius: 3px; background: var(--line); color: var(--line); transform-origin: center bottom; transition: transform 170ms var(--ease), opacity 170ms var(--ease), box-shadow 170ms var(--ease); }
|
|
4
|
+
.cell[data-state="empty"] .bar { height: 15px; }
|
|
5
|
+
.cell[data-state="up"] .bar { background: var(--success); color: var(--success); }
|
|
6
|
+
.cell[data-state="partial"] .bar { background: var(--warning); color: var(--warning); }
|
|
7
|
+
.cell[data-state="down"] .bar { background: var(--danger); color: var(--danger); }
|
|
8
|
+
.chart:hover .cell:not(:hover):not(:focus-visible) .bar { opacity: .55; }
|
|
9
|
+
.cell:hover, .cell:focus-visible { z-index: 1; }
|
|
10
|
+
.cell:hover .bar, .cell:focus-visible .bar { transform: translateY(-3px) scale(1.25, 1.12); box-shadow: 0 4px 10px color-mix(in srgb, currentColor 22%, transparent); }
|
|
11
|
+
.cell:focus-visible .bar { outline: 2px solid var(--fg); outline-offset: 2px; }
|
|
12
|
+
@keyframes enter { from { opacity: 0; transform: translateY(7px) scaleY(.35); } 62% { opacity: 1; transform: translateY(-2px) scaleY(1.06); } to { opacity: 1; transform: none; } }
|
|
13
|
+
@media (prefers-reduced-motion: reduce) { .cell { animation: none; } .bar { transition: none; } .cell:hover .bar, .cell:focus-visible .bar { transform: none; } }
|
|
14
|
+
|
|
15
|
+
.chart > span { flex: 1; min-width: 0; }
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -136,6 +136,7 @@ import { AuthLayout } from "./AuthLayout.js";
|
|
|
136
136
|
import { BarChart } from "./BarChart.js";
|
|
137
137
|
import { Mark } from "./Layout.js";
|
|
138
138
|
import { ResourceCard } from "./ResourceCard.js";
|
|
139
|
+
import { UptimeChart } from "./UptimeChart.js";
|
|
139
140
|
export {
|
|
140
141
|
Accordion,
|
|
141
142
|
AccountItem,
|
|
@@ -268,6 +269,7 @@ export {
|
|
|
268
269
|
UnderlinedTab,
|
|
269
270
|
Upload,
|
|
270
271
|
UploadList,
|
|
272
|
+
UptimeChart,
|
|
271
273
|
VirtualPickerList,
|
|
272
274
|
appearanceDefaults,
|
|
273
275
|
createToaster,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robert-stackflow/oneui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "OneUI React components, application shell and portable visual themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -861,7 +861,13 @@
|
|
|
861
861
|
"import": "./components/ResourceCard.js",
|
|
862
862
|
"default": "./components/ResourceCard.js"
|
|
863
863
|
},
|
|
864
|
-
"./ResourceCard.module.css": "./components/ResourceCard.module.css"
|
|
864
|
+
"./ResourceCard.module.css": "./components/ResourceCard.module.css",
|
|
865
|
+
"./UptimeChart": {
|
|
866
|
+
"types": "./components/UptimeChart.d.ts",
|
|
867
|
+
"import": "./components/UptimeChart.js",
|
|
868
|
+
"default": "./components/UptimeChart.js"
|
|
869
|
+
},
|
|
870
|
+
"./UptimeChart.module.css": "./components/UptimeChart.module.css"
|
|
865
871
|
},
|
|
866
872
|
"files": [
|
|
867
873
|
"components",
|