@robert-stackflow/oneui 0.6.6 → 0.6.8
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 +9 -0
- package/components/Tab.module.css +148 -148
- package/components/UptimeChart.d.ts +9 -0
- package/components/UptimeChart.js +12 -0
- package/components/UptimeChart.module.css +15 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +2 -0
- package/package.json +8 -2
- package/styles/minimal.css +3 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.8
|
|
4
|
+
|
|
5
|
+
- Use theme-specific selected text and indicator colors for UnderlinedTab, including hover and dark mode.
|
|
6
|
+
- Apply minimal-theme palette changes atomically to avoid low-contrast intermediate gray frames; preserve control and navigation movement.
|
|
7
|
+
|
|
8
|
+
## 0.6.7
|
|
9
|
+
|
|
10
|
+
- Add UptimeChart with shared status colors, staggered entrance, hover/focus inspection, native tooltips and reduced-motion support.
|
|
11
|
+
|
|
3
12
|
## 0.6.6
|
|
4
13
|
|
|
5
14
|
- Add Segmented fullWidth to align evenly distributed options with navigation or form containers.
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
.viewport {
|
|
2
|
-
overflow-x: auto;
|
|
3
|
-
overflow-y: hidden;
|
|
4
|
-
scrollbar-width: none;
|
|
5
|
-
padding-bottom: 1px;
|
|
6
|
-
min-width: 0;
|
|
7
|
-
max-width: 100%;
|
|
8
|
-
}
|
|
9
|
-
.tabs {
|
|
10
|
-
position: relative;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: stretch;
|
|
13
|
-
gap: 4px;
|
|
14
|
-
width: max-content;
|
|
15
|
-
min-width: 100%;
|
|
16
|
-
isolation: isolate;
|
|
17
|
-
}
|
|
18
|
-
.tabs button {
|
|
19
|
-
position: relative;
|
|
20
|
-
z-index: 1;
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
gap: 7px;
|
|
25
|
-
white-space: nowrap;
|
|
26
|
-
border: 0;
|
|
27
|
-
background: transparent;
|
|
28
|
-
min-height: 34px;
|
|
29
|
-
padding: 7px 12px;
|
|
30
|
-
font-size: 12px;
|
|
31
|
-
color: var(--muted);
|
|
32
|
-
border-radius: 6px;
|
|
33
|
-
transition:
|
|
34
|
-
color var(--motion-hover),
|
|
35
|
-
background var(--motion-hover);
|
|
36
|
-
}
|
|
37
|
-
.tabs button:hover:not(:disabled) {
|
|
38
|
-
color: var(--fg);
|
|
39
|
-
}
|
|
40
|
-
.tabs button[aria-selected="true"] {
|
|
41
|
-
color: var(--fg);
|
|
42
|
-
}
|
|
43
|
-
.tabs button:focus-visible {
|
|
44
|
-
outline-offset: -2px;
|
|
45
|
-
}
|
|
46
|
-
.indicator {
|
|
47
|
-
position: absolute;
|
|
48
|
-
z-index: 0;
|
|
49
|
-
pointer-events: none;
|
|
50
|
-
opacity: var(--tab-opacity, 0);
|
|
51
|
-
left: 0;
|
|
52
|
-
top: 0;
|
|
53
|
-
transform: translate(var(--tab-x, 0px), var(--tab-y, 0px));
|
|
54
|
-
width: var(--tab-width, 0px);
|
|
55
|
-
height: var(--tab-height, 0px);
|
|
56
|
-
background: var(--selected);
|
|
57
|
-
border-radius: 6px;
|
|
58
|
-
}
|
|
59
|
-
.tabs[data-ready="true"] .indicator {
|
|
60
|
-
transition:
|
|
61
|
-
transform var(--motion-segment) var(--ease),
|
|
62
|
-
width var(--motion-segment) var(--ease),
|
|
63
|
-
height var(--motion-segment) var(--ease),
|
|
64
|
-
opacity var(--motion-hover);
|
|
65
|
-
}
|
|
66
|
-
.viewport[data-orientation="vertical"] {
|
|
67
|
-
width: 112px;
|
|
68
|
-
flex: 0 0 112px;
|
|
69
|
-
}
|
|
70
|
-
.viewport[data-orientation="vertical"] .tabs {
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
width: 100%;
|
|
73
|
-
min-width: 0;
|
|
74
|
-
}
|
|
75
|
-
.viewport[data-orientation="vertical"] button {
|
|
76
|
-
justify-content: flex-start;
|
|
77
|
-
padding: 7px 9px;
|
|
78
|
-
min-height: 34px;
|
|
79
|
-
}
|
|
80
|
-
.underlined {
|
|
81
|
-
gap: 16px;
|
|
82
|
-
border-bottom: var(--separator-width) var(--separator-style)
|
|
83
|
-
var(--separator-color);
|
|
84
|
-
}
|
|
85
|
-
.underlined button {
|
|
86
|
-
padding: 9px 2px;
|
|
87
|
-
border-radius: 0;
|
|
88
|
-
}
|
|
89
|
-
.underlined .indicator {
|
|
90
|
-
top: auto;
|
|
91
|
-
bottom: -1px;
|
|
92
|
-
height: 2px;
|
|
93
|
-
transform: translateX(var(--tab-x, 0px));
|
|
94
|
-
background: var(--
|
|
95
|
-
border-radius: 2px;
|
|
96
|
-
}
|
|
97
|
-
.underlined button[aria-selected="true"] {
|
|
98
|
-
color: var(--
|
|
99
|
-
}
|
|
100
|
-
@media (max-width: 450px) {
|
|
101
|
-
.viewport[data-orientation="vertical"] {
|
|
102
|
-
width: 94px;
|
|
103
|
-
flex-basis: 94px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.blocked button:hover:not(:disabled) {
|
|
108
|
-
background: color-mix(in srgb, var(--hover) 55%, transparent);
|
|
109
|
-
}
|
|
110
|
-
.underlined button:hover:not(:disabled) {
|
|
111
|
-
background: transparent;
|
|
112
|
-
color: var(--
|
|
113
|
-
}
|
|
114
|
-
.tabs button {
|
|
115
|
-
min-height: var(--tab-height-min);
|
|
116
|
-
font-size: var(--field-font-size);
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
}
|
|
119
|
-
.blocked {
|
|
120
|
-
width: var(--blocked-width);
|
|
121
|
-
min-width: var(--blocked-min-width);
|
|
122
|
-
padding: var(--blocked-padding);
|
|
123
|
-
border: var(--blocked-border);
|
|
124
|
-
background: var(--blocked-background);
|
|
125
|
-
border-radius: var(--blocked-radius);
|
|
126
|
-
}
|
|
127
|
-
.blocked .indicator {
|
|
128
|
-
background: var(--blocked-selected);
|
|
129
|
-
box-shadow: var(--blocked-shadow);
|
|
130
|
-
}
|
|
131
|
-
.blocked button {
|
|
132
|
-
min-height: var(--blocked-height);
|
|
133
|
-
padding: var(--blocked-button-padding);
|
|
134
|
-
}
|
|
135
|
-
.blocked button[aria-selected="true"] {
|
|
136
|
-
color: var(--tab-selected-color);
|
|
137
|
-
}
|
|
138
|
-
.tabs button:disabled {
|
|
139
|
-
opacity: 0.45;
|
|
140
|
-
cursor: not-allowed;
|
|
141
|
-
}
|
|
142
|
-
.viewport[data-orientation="vertical"] {
|
|
143
|
-
width: var(--vertical-tab-width);
|
|
144
|
-
flex-basis: var(--vertical-tab-width);
|
|
145
|
-
}
|
|
146
|
-
.viewport[data-orientation="vertical"] .blocked {
|
|
147
|
-
width: 100%;
|
|
148
|
-
}
|
|
1
|
+
.viewport {
|
|
2
|
+
overflow-x: auto;
|
|
3
|
+
overflow-y: hidden;
|
|
4
|
+
scrollbar-width: none;
|
|
5
|
+
padding-bottom: 1px;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
}
|
|
9
|
+
.tabs {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: stretch;
|
|
13
|
+
gap: 4px;
|
|
14
|
+
width: max-content;
|
|
15
|
+
min-width: 100%;
|
|
16
|
+
isolation: isolate;
|
|
17
|
+
}
|
|
18
|
+
.tabs button {
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
gap: 7px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
border: 0;
|
|
27
|
+
background: transparent;
|
|
28
|
+
min-height: 34px;
|
|
29
|
+
padding: 7px 12px;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
color: var(--muted);
|
|
32
|
+
border-radius: 6px;
|
|
33
|
+
transition:
|
|
34
|
+
color var(--motion-hover),
|
|
35
|
+
background var(--motion-hover);
|
|
36
|
+
}
|
|
37
|
+
.tabs button:hover:not(:disabled) {
|
|
38
|
+
color: var(--fg);
|
|
39
|
+
}
|
|
40
|
+
.tabs button[aria-selected="true"] {
|
|
41
|
+
color: var(--fg);
|
|
42
|
+
}
|
|
43
|
+
.tabs button:focus-visible {
|
|
44
|
+
outline-offset: -2px;
|
|
45
|
+
}
|
|
46
|
+
.indicator {
|
|
47
|
+
position: absolute;
|
|
48
|
+
z-index: 0;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
opacity: var(--tab-opacity, 0);
|
|
51
|
+
left: 0;
|
|
52
|
+
top: 0;
|
|
53
|
+
transform: translate(var(--tab-x, 0px), var(--tab-y, 0px));
|
|
54
|
+
width: var(--tab-width, 0px);
|
|
55
|
+
height: var(--tab-height, 0px);
|
|
56
|
+
background: var(--selected);
|
|
57
|
+
border-radius: 6px;
|
|
58
|
+
}
|
|
59
|
+
.tabs[data-ready="true"] .indicator {
|
|
60
|
+
transition:
|
|
61
|
+
transform var(--motion-segment) var(--ease),
|
|
62
|
+
width var(--motion-segment) var(--ease),
|
|
63
|
+
height var(--motion-segment) var(--ease),
|
|
64
|
+
opacity var(--motion-hover);
|
|
65
|
+
}
|
|
66
|
+
.viewport[data-orientation="vertical"] {
|
|
67
|
+
width: 112px;
|
|
68
|
+
flex: 0 0 112px;
|
|
69
|
+
}
|
|
70
|
+
.viewport[data-orientation="vertical"] .tabs {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
width: 100%;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
}
|
|
75
|
+
.viewport[data-orientation="vertical"] button {
|
|
76
|
+
justify-content: flex-start;
|
|
77
|
+
padding: 7px 9px;
|
|
78
|
+
min-height: 34px;
|
|
79
|
+
}
|
|
80
|
+
.underlined {
|
|
81
|
+
gap: 16px;
|
|
82
|
+
border-bottom: var(--separator-width) var(--separator-style)
|
|
83
|
+
var(--separator-color);
|
|
84
|
+
}
|
|
85
|
+
.underlined button {
|
|
86
|
+
padding: 9px 2px;
|
|
87
|
+
border-radius: 0;
|
|
88
|
+
}
|
|
89
|
+
.underlined .indicator {
|
|
90
|
+
top: auto;
|
|
91
|
+
bottom: -1px;
|
|
92
|
+
height: 2px;
|
|
93
|
+
transform: translateX(var(--tab-x, 0px));
|
|
94
|
+
background: var(--tab-selected-color);
|
|
95
|
+
border-radius: 2px;
|
|
96
|
+
}
|
|
97
|
+
.underlined button[aria-selected="true"] {
|
|
98
|
+
color: var(--tab-selected-color);
|
|
99
|
+
}
|
|
100
|
+
@media (max-width: 450px) {
|
|
101
|
+
.viewport[data-orientation="vertical"] {
|
|
102
|
+
width: 94px;
|
|
103
|
+
flex-basis: 94px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.blocked button:hover:not(:disabled) {
|
|
108
|
+
background: color-mix(in srgb, var(--hover) 55%, transparent);
|
|
109
|
+
}
|
|
110
|
+
.underlined button:hover:not(:disabled) {
|
|
111
|
+
background: transparent;
|
|
112
|
+
color: var(--tab-selected-color);
|
|
113
|
+
}
|
|
114
|
+
.tabs button {
|
|
115
|
+
min-height: var(--tab-height-min);
|
|
116
|
+
font-size: var(--field-font-size);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
.blocked {
|
|
120
|
+
width: var(--blocked-width);
|
|
121
|
+
min-width: var(--blocked-min-width);
|
|
122
|
+
padding: var(--blocked-padding);
|
|
123
|
+
border: var(--blocked-border);
|
|
124
|
+
background: var(--blocked-background);
|
|
125
|
+
border-radius: var(--blocked-radius);
|
|
126
|
+
}
|
|
127
|
+
.blocked .indicator {
|
|
128
|
+
background: var(--blocked-selected);
|
|
129
|
+
box-shadow: var(--blocked-shadow);
|
|
130
|
+
}
|
|
131
|
+
.blocked button {
|
|
132
|
+
min-height: var(--blocked-height);
|
|
133
|
+
padding: var(--blocked-button-padding);
|
|
134
|
+
}
|
|
135
|
+
.blocked button[aria-selected="true"] {
|
|
136
|
+
color: var(--tab-selected-color);
|
|
137
|
+
}
|
|
138
|
+
.tabs button:disabled {
|
|
139
|
+
opacity: 0.45;
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
}
|
|
142
|
+
.viewport[data-orientation="vertical"] {
|
|
143
|
+
width: var(--vertical-tab-width);
|
|
144
|
+
flex-basis: var(--vertical-tab-width);
|
|
145
|
+
}
|
|
146
|
+
.viewport[data-orientation="vertical"] .blocked {
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
@@ -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.8",
|
|
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",
|
package/styles/minimal.css
CHANGED
|
@@ -193,31 +193,9 @@
|
|
|
193
193
|
inherits: true;
|
|
194
194
|
initial-value: #a47628;
|
|
195
195
|
}
|
|
196
|
-
:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
--fg 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
200
|
-
--soft 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
201
|
-
--muted 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
202
|
-
--line 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
203
|
-
--hover 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
204
|
-
--selected 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
205
|
-
--accent 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
206
|
-
--on-accent 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
207
|
-
--navigation 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
208
|
-
--canvas 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
209
|
-
--field 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
210
|
-
--disabled 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
211
|
-
--success 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
212
|
-
--danger 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
213
|
-
--warning 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
214
|
-
--shadow-soft 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
215
|
-
--shadow-detail 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
216
|
-
--shadow-float 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
217
|
-
--shadow-edge 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
218
|
-
--shadow-modal 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
|
|
219
|
-
--overlay 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
|
|
220
|
-
}
|
|
196
|
+
/* Palette changes are atomic: interpolating foreground and background together
|
|
197
|
+
makes their intermediate colors converge and washes out the whole interface.
|
|
198
|
+
Component movement and hover transitions remain independent. */
|
|
221
199
|
:root[data-ui-theme="minimal"][data-theme-changing="true"] * {
|
|
222
200
|
transition-property: transform, translate, opacity, width, height,
|
|
223
201
|
grid-template-rows, box-shadow, visibility !important;
|