@robert-stackflow/oneui 0.6.40 → 0.6.41
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 +6 -0
- package/README.md +6 -0
- package/components/AccountItem.module.css +103 -103
- package/components/AppShell.module.css +223 -223
- package/components/Badge.module.css +30 -30
- package/components/BarChart.module.css +35 -35
- package/components/Breadcrumb.module.css +97 -97
- package/components/Button.module.css +120 -120
- package/components/Checkbox.module.css +95 -95
- package/components/Control.module.css +86 -86
- package/components/DataTable.module.css +75 -75
- package/components/Form.d.ts +5 -1
- package/components/Form.js +5 -1
- package/components/FormField.js +1 -0
- package/components/HierarchyPicker.module.css +185 -185
- package/components/Indicator.module.css +83 -83
- package/components/Layout.module.css +82 -82
- package/components/Markdown.module.css +227 -227
- package/components/NativeForm.d.ts +10 -0
- package/components/NativeForm.js +155 -0
- package/components/NavBar.module.css +130 -130
- package/components/Progress.module.css +33 -33
- package/components/RadioGroup.module.css +87 -87
- package/components/RangeSlider.module.css +141 -141
- package/components/ResizablePanel.module.css +101 -101
- package/components/ResourceCard.module.css +98 -98
- package/components/Slider.module.css +19 -19
- package/components/Steps.module.css +176 -176
- package/components/Tab.module.css +148 -148
- package/components/ThemePicker.module.css +178 -178
- package/components/TimeColumns.module.css +47 -47
- package/components/Timeline.module.css +202 -202
- package/components/TreeTable.module.css +57 -57
- package/components/UptimeChart.module.css +15 -15
- package/components/field.d.ts +1 -1
- package/components/field.js +2 -1
- package/components/form-validation.d.ts +4 -0
- package/components/form-validation.js +22 -0
- package/components/index.d.ts +4 -2
- package/components/index.js +9 -3
- package/package.json +1 -1
- package/styles/blue.css +270 -270
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
.timeline {
|
|
2
|
-
container-type: inline-size;
|
|
3
|
-
margin: 0;
|
|
4
|
-
padding: 0;
|
|
5
|
-
list-style: none;
|
|
6
|
-
}
|
|
7
|
-
.item {
|
|
8
|
-
display: grid;
|
|
9
|
-
grid-template-columns: 24px minmax(0, 1fr);
|
|
10
|
-
gap: 14px;
|
|
11
|
-
min-width: 0;
|
|
12
|
-
animation: timelineIn 140ms var(--ease);
|
|
13
|
-
}
|
|
14
|
-
.marker {
|
|
15
|
-
position: relative;
|
|
16
|
-
grid-column: 1;
|
|
17
|
-
grid-row: 1;
|
|
18
|
-
min-height: 22px;
|
|
19
|
-
color: var(--timeline-color, var(--accent-ink, var(--accent)));
|
|
20
|
-
}
|
|
21
|
-
.item:not(:last-child) .marker::after {
|
|
22
|
-
content: "";
|
|
23
|
-
position: absolute;
|
|
24
|
-
width: var(--separator-width);
|
|
25
|
-
background: var(--separator-color);
|
|
26
|
-
top: 23px;
|
|
27
|
-
bottom: 0;
|
|
28
|
-
left: 50%;
|
|
29
|
-
transform: translateX(-50%);
|
|
30
|
-
}
|
|
31
|
-
.dot {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 1px;
|
|
34
|
-
left: 50%;
|
|
35
|
-
transform: translateX(-50%);
|
|
36
|
-
display: grid;
|
|
37
|
-
place-items: center;
|
|
38
|
-
width: 20px;
|
|
39
|
-
height: 20px;
|
|
40
|
-
}
|
|
41
|
-
.dot > i {
|
|
42
|
-
display: block;
|
|
43
|
-
width: 7px;
|
|
44
|
-
height: 7px;
|
|
45
|
-
border-radius: 50%;
|
|
46
|
-
background: currentColor;
|
|
47
|
-
}
|
|
48
|
-
.dot > svg {
|
|
49
|
-
width: 16px;
|
|
50
|
-
height: 16px;
|
|
51
|
-
}
|
|
52
|
-
.item[data-status="success"] .marker {
|
|
53
|
-
color: var(--timeline-color, var(--success));
|
|
54
|
-
}
|
|
55
|
-
.item[data-status="error"] .marker {
|
|
56
|
-
color: var(--timeline-color, var(--danger));
|
|
57
|
-
}
|
|
58
|
-
.item[data-status="warning"] .marker {
|
|
59
|
-
color: var(--timeline-color, var(--warning));
|
|
60
|
-
}
|
|
61
|
-
.body {
|
|
62
|
-
grid-column: 2;
|
|
63
|
-
grid-row: 1;
|
|
64
|
-
padding-bottom: 28px;
|
|
65
|
-
min-width: 0;
|
|
66
|
-
font-size: 12px;
|
|
67
|
-
line-height: 22px;
|
|
68
|
-
}
|
|
69
|
-
.item:last-child .body {
|
|
70
|
-
padding-bottom: 0;
|
|
71
|
-
}
|
|
72
|
-
.heading {
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
gap: 8px;
|
|
76
|
-
min-height: 22px;
|
|
77
|
-
}
|
|
78
|
-
.title {
|
|
79
|
-
font-weight: 500;
|
|
80
|
-
overflow-wrap: anywhere;
|
|
81
|
-
}
|
|
82
|
-
.time {
|
|
83
|
-
display: block;
|
|
84
|
-
color: var(--muted);
|
|
85
|
-
font-size: 11px;
|
|
86
|
-
line-height: 20px;
|
|
87
|
-
margin-top: 2px;
|
|
88
|
-
}
|
|
89
|
-
.description {
|
|
90
|
-
margin-top: 5px;
|
|
91
|
-
color: var(--muted);
|
|
92
|
-
overflow-wrap: anywhere;
|
|
93
|
-
}
|
|
94
|
-
.toggle {
|
|
95
|
-
display: inline-flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
width: 24px;
|
|
99
|
-
height: 24px;
|
|
100
|
-
padding: 0;
|
|
101
|
-
border: 0;
|
|
102
|
-
border-radius: 5px;
|
|
103
|
-
background: transparent;
|
|
104
|
-
color: var(--muted);
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
flex-shrink: 0;
|
|
107
|
-
}
|
|
108
|
-
.toggle:hover {
|
|
109
|
-
background: var(--hover);
|
|
110
|
-
}
|
|
111
|
-
.toggle svg {
|
|
112
|
-
width: 14px;
|
|
113
|
-
height: 14px;
|
|
114
|
-
}
|
|
115
|
-
.details {
|
|
116
|
-
display: grid;
|
|
117
|
-
grid-template-rows: 0fr;
|
|
118
|
-
opacity: 0;
|
|
119
|
-
transition:
|
|
120
|
-
grid-template-rows var(--motion-segment) var(--ease),
|
|
121
|
-
opacity var(--motion-hover);
|
|
122
|
-
}
|
|
123
|
-
.details[data-open="true"] {
|
|
124
|
-
grid-template-rows: 1fr;
|
|
125
|
-
opacity: 1;
|
|
126
|
-
}
|
|
127
|
-
.clip {
|
|
128
|
-
min-height: 0;
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
}
|
|
131
|
-
.content {
|
|
132
|
-
padding-top: 10px;
|
|
133
|
-
overflow-wrap: anywhere;
|
|
134
|
-
text-align: start;
|
|
135
|
-
}
|
|
136
|
-
.timeline[data-mode="alternate"] .item {
|
|
137
|
-
grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
|
|
138
|
-
}
|
|
139
|
-
.timeline[data-mode="alternate"] .marker {
|
|
140
|
-
grid-column: 2;
|
|
141
|
-
}
|
|
142
|
-
.timeline[data-mode="alternate"] .item[data-side="left"] .body {
|
|
143
|
-
grid-column: 1;
|
|
144
|
-
text-align: right;
|
|
145
|
-
}
|
|
146
|
-
.timeline[data-mode="alternate"] .item[data-side="left"] .heading {
|
|
147
|
-
justify-content: flex-end;
|
|
148
|
-
}
|
|
149
|
-
.timeline[data-mode="alternate"] .item[data-side="right"] .body {
|
|
150
|
-
grid-column: 3;
|
|
151
|
-
}
|
|
152
|
-
.skeleton {
|
|
153
|
-
margin-top: 10px;
|
|
154
|
-
}
|
|
155
|
-
.empty {
|
|
156
|
-
font-size: 12px;
|
|
157
|
-
color: var(--muted);
|
|
158
|
-
padding: 24px;
|
|
159
|
-
text-align: center;
|
|
160
|
-
}
|
|
161
|
-
@container (max-width:600px) {
|
|
162
|
-
.timeline[data-mode="alternate"] .item {
|
|
163
|
-
grid-template-columns: 24px minmax(0, 1fr);
|
|
164
|
-
}
|
|
165
|
-
.timeline[data-mode="alternate"] .marker {
|
|
166
|
-
grid-column: 1;
|
|
167
|
-
}
|
|
168
|
-
.timeline[data-mode="alternate"]
|
|
169
|
-
.item:is([data-side="left"], [data-side="right"])
|
|
170
|
-
.body {
|
|
171
|
-
grid-column: 2;
|
|
172
|
-
text-align: start;
|
|
173
|
-
}
|
|
174
|
-
.timeline[data-mode="alternate"] .item[data-side="left"] .heading {
|
|
175
|
-
justify-content: flex-start;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
@media (prefers-reduced-motion: reduce) {
|
|
179
|
-
.details {
|
|
180
|
-
transition: none;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.sr {
|
|
185
|
-
composes: visuallyHidden from "./Accessibility.module.css";
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@keyframes timelineIn {
|
|
189
|
-
from {
|
|
190
|
-
opacity: 0;
|
|
191
|
-
transform: translateY(4px);
|
|
192
|
-
}
|
|
193
|
-
to {
|
|
194
|
-
opacity: 1;
|
|
195
|
-
transform: none;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
@media (prefers-reduced-motion: reduce) {
|
|
199
|
-
.item {
|
|
200
|
-
animation: none;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
1
|
+
.timeline {
|
|
2
|
+
container-type: inline-size;
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
list-style: none;
|
|
6
|
+
}
|
|
7
|
+
.item {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: 24px minmax(0, 1fr);
|
|
10
|
+
gap: 14px;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
animation: timelineIn 140ms var(--ease);
|
|
13
|
+
}
|
|
14
|
+
.marker {
|
|
15
|
+
position: relative;
|
|
16
|
+
grid-column: 1;
|
|
17
|
+
grid-row: 1;
|
|
18
|
+
min-height: 22px;
|
|
19
|
+
color: var(--timeline-color, var(--accent-ink, var(--accent)));
|
|
20
|
+
}
|
|
21
|
+
.item:not(:last-child) .marker::after {
|
|
22
|
+
content: "";
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: var(--separator-width);
|
|
25
|
+
background: var(--separator-color);
|
|
26
|
+
top: 23px;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
}
|
|
31
|
+
.dot {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 1px;
|
|
34
|
+
left: 50%;
|
|
35
|
+
transform: translateX(-50%);
|
|
36
|
+
display: grid;
|
|
37
|
+
place-items: center;
|
|
38
|
+
width: 20px;
|
|
39
|
+
height: 20px;
|
|
40
|
+
}
|
|
41
|
+
.dot > i {
|
|
42
|
+
display: block;
|
|
43
|
+
width: 7px;
|
|
44
|
+
height: 7px;
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
background: currentColor;
|
|
47
|
+
}
|
|
48
|
+
.dot > svg {
|
|
49
|
+
width: 16px;
|
|
50
|
+
height: 16px;
|
|
51
|
+
}
|
|
52
|
+
.item[data-status="success"] .marker {
|
|
53
|
+
color: var(--timeline-color, var(--success));
|
|
54
|
+
}
|
|
55
|
+
.item[data-status="error"] .marker {
|
|
56
|
+
color: var(--timeline-color, var(--danger));
|
|
57
|
+
}
|
|
58
|
+
.item[data-status="warning"] .marker {
|
|
59
|
+
color: var(--timeline-color, var(--warning));
|
|
60
|
+
}
|
|
61
|
+
.body {
|
|
62
|
+
grid-column: 2;
|
|
63
|
+
grid-row: 1;
|
|
64
|
+
padding-bottom: 28px;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
line-height: 22px;
|
|
68
|
+
}
|
|
69
|
+
.item:last-child .body {
|
|
70
|
+
padding-bottom: 0;
|
|
71
|
+
}
|
|
72
|
+
.heading {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
min-height: 22px;
|
|
77
|
+
}
|
|
78
|
+
.title {
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
overflow-wrap: anywhere;
|
|
81
|
+
}
|
|
82
|
+
.time {
|
|
83
|
+
display: block;
|
|
84
|
+
color: var(--muted);
|
|
85
|
+
font-size: 11px;
|
|
86
|
+
line-height: 20px;
|
|
87
|
+
margin-top: 2px;
|
|
88
|
+
}
|
|
89
|
+
.description {
|
|
90
|
+
margin-top: 5px;
|
|
91
|
+
color: var(--muted);
|
|
92
|
+
overflow-wrap: anywhere;
|
|
93
|
+
}
|
|
94
|
+
.toggle {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
width: 24px;
|
|
99
|
+
height: 24px;
|
|
100
|
+
padding: 0;
|
|
101
|
+
border: 0;
|
|
102
|
+
border-radius: 5px;
|
|
103
|
+
background: transparent;
|
|
104
|
+
color: var(--muted);
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
.toggle:hover {
|
|
109
|
+
background: var(--hover);
|
|
110
|
+
}
|
|
111
|
+
.toggle svg {
|
|
112
|
+
width: 14px;
|
|
113
|
+
height: 14px;
|
|
114
|
+
}
|
|
115
|
+
.details {
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-rows: 0fr;
|
|
118
|
+
opacity: 0;
|
|
119
|
+
transition:
|
|
120
|
+
grid-template-rows var(--motion-segment) var(--ease),
|
|
121
|
+
opacity var(--motion-hover);
|
|
122
|
+
}
|
|
123
|
+
.details[data-open="true"] {
|
|
124
|
+
grid-template-rows: 1fr;
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
.clip {
|
|
128
|
+
min-height: 0;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
}
|
|
131
|
+
.content {
|
|
132
|
+
padding-top: 10px;
|
|
133
|
+
overflow-wrap: anywhere;
|
|
134
|
+
text-align: start;
|
|
135
|
+
}
|
|
136
|
+
.timeline[data-mode="alternate"] .item {
|
|
137
|
+
grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
|
|
138
|
+
}
|
|
139
|
+
.timeline[data-mode="alternate"] .marker {
|
|
140
|
+
grid-column: 2;
|
|
141
|
+
}
|
|
142
|
+
.timeline[data-mode="alternate"] .item[data-side="left"] .body {
|
|
143
|
+
grid-column: 1;
|
|
144
|
+
text-align: right;
|
|
145
|
+
}
|
|
146
|
+
.timeline[data-mode="alternate"] .item[data-side="left"] .heading {
|
|
147
|
+
justify-content: flex-end;
|
|
148
|
+
}
|
|
149
|
+
.timeline[data-mode="alternate"] .item[data-side="right"] .body {
|
|
150
|
+
grid-column: 3;
|
|
151
|
+
}
|
|
152
|
+
.skeleton {
|
|
153
|
+
margin-top: 10px;
|
|
154
|
+
}
|
|
155
|
+
.empty {
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
color: var(--muted);
|
|
158
|
+
padding: 24px;
|
|
159
|
+
text-align: center;
|
|
160
|
+
}
|
|
161
|
+
@container (max-width:600px) {
|
|
162
|
+
.timeline[data-mode="alternate"] .item {
|
|
163
|
+
grid-template-columns: 24px minmax(0, 1fr);
|
|
164
|
+
}
|
|
165
|
+
.timeline[data-mode="alternate"] .marker {
|
|
166
|
+
grid-column: 1;
|
|
167
|
+
}
|
|
168
|
+
.timeline[data-mode="alternate"]
|
|
169
|
+
.item:is([data-side="left"], [data-side="right"])
|
|
170
|
+
.body {
|
|
171
|
+
grid-column: 2;
|
|
172
|
+
text-align: start;
|
|
173
|
+
}
|
|
174
|
+
.timeline[data-mode="alternate"] .item[data-side="left"] .heading {
|
|
175
|
+
justify-content: flex-start;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
@media (prefers-reduced-motion: reduce) {
|
|
179
|
+
.details {
|
|
180
|
+
transition: none;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.sr {
|
|
185
|
+
composes: visuallyHidden from "./Accessibility.module.css";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@keyframes timelineIn {
|
|
189
|
+
from {
|
|
190
|
+
opacity: 0;
|
|
191
|
+
transform: translateY(4px);
|
|
192
|
+
}
|
|
193
|
+
to {
|
|
194
|
+
opacity: 1;
|
|
195
|
+
transform: none;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
@media (prefers-reduced-motion: reduce) {
|
|
199
|
+
.item {
|
|
200
|
+
animation: none;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
--table-radius: var(--card-radius);
|
|
3
|
-
border-radius: var(--card-radius);
|
|
4
|
-
background: var(--surface);
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
box-shadow: var(--card-shadow, none);
|
|
7
|
-
}
|
|
8
|
-
.root table td {
|
|
9
|
-
padding: 0 18px;
|
|
10
|
-
border-bottom: 0;
|
|
11
|
-
}
|
|
12
|
-
.root table th {
|
|
13
|
-
padding: 14px 18px;
|
|
14
|
-
}
|
|
15
|
-
.root[data-density="compact"] .cell {
|
|
16
|
-
min-height: 48px;
|
|
17
|
-
padding-block: 8px;
|
|
18
|
-
}
|
|
19
|
-
.root tr:focus-visible {
|
|
20
|
-
outline: 1px solid var(--accent-ink, var(--accent));
|
|
21
|
-
outline-offset: -1px;
|
|
22
|
-
}
|
|
23
|
-
.root table tr[data-tree-root="true"]:not(:first-child) td {
|
|
24
|
-
border-top: 1px solid var(--line);
|
|
25
|
-
}
|
|
26
|
-
.cell {
|
|
27
|
-
--tree-elbow-gap: 8px;
|
|
28
|
-
position: relative;
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
gap: 8px;
|
|
32
|
-
min-height: 72px;
|
|
33
|
-
padding-block: 14px;
|
|
34
|
-
min-width: 260px;
|
|
35
|
-
white-space: normal;
|
|
36
|
-
}
|
|
37
|
-
.expander,
|
|
38
|
-
.spacer {
|
|
39
|
-
flex: 0 0 24px;
|
|
40
|
-
width: 24px;
|
|
41
|
-
height: 26px;
|
|
42
|
-
}
|
|
43
|
-
.content {
|
|
44
|
-
position: relative;
|
|
45
|
-
flex: 1;
|
|
46
|
-
min-width: 0;
|
|
47
|
-
}
|
|
48
|
-
.expander svg {
|
|
49
|
-
width: 14px;
|
|
50
|
-
height: 14px;
|
|
51
|
-
}
|
|
52
|
-
.expander[aria-expanded="false"] svg {
|
|
53
|
-
rotate: -90deg;
|
|
54
|
-
}
|
|
55
|
-
.expander[aria-expanded="true"] svg {
|
|
56
|
-
rotate: 0deg;
|
|
57
|
-
}
|
|
1
|
+
.root {
|
|
2
|
+
--table-radius: var(--card-radius);
|
|
3
|
+
border-radius: var(--card-radius);
|
|
4
|
+
background: var(--surface);
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
box-shadow: var(--card-shadow, none);
|
|
7
|
+
}
|
|
8
|
+
.root table td {
|
|
9
|
+
padding: 0 18px;
|
|
10
|
+
border-bottom: 0;
|
|
11
|
+
}
|
|
12
|
+
.root table th {
|
|
13
|
+
padding: 14px 18px;
|
|
14
|
+
}
|
|
15
|
+
.root[data-density="compact"] .cell {
|
|
16
|
+
min-height: 48px;
|
|
17
|
+
padding-block: 8px;
|
|
18
|
+
}
|
|
19
|
+
.root tr:focus-visible {
|
|
20
|
+
outline: 1px solid var(--accent-ink, var(--accent));
|
|
21
|
+
outline-offset: -1px;
|
|
22
|
+
}
|
|
23
|
+
.root table tr[data-tree-root="true"]:not(:first-child) td {
|
|
24
|
+
border-top: 1px solid var(--line);
|
|
25
|
+
}
|
|
26
|
+
.cell {
|
|
27
|
+
--tree-elbow-gap: 8px;
|
|
28
|
+
position: relative;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
min-height: 72px;
|
|
33
|
+
padding-block: 14px;
|
|
34
|
+
min-width: 260px;
|
|
35
|
+
white-space: normal;
|
|
36
|
+
}
|
|
37
|
+
.expander,
|
|
38
|
+
.spacer {
|
|
39
|
+
flex: 0 0 24px;
|
|
40
|
+
width: 24px;
|
|
41
|
+
height: 26px;
|
|
42
|
+
}
|
|
43
|
+
.content {
|
|
44
|
+
position: relative;
|
|
45
|
+
flex: 1;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
}
|
|
48
|
+
.expander svg {
|
|
49
|
+
width: 14px;
|
|
50
|
+
height: 14px;
|
|
51
|
+
}
|
|
52
|
+
.expander[aria-expanded="false"] svg {
|
|
53
|
+
rotate: -90deg;
|
|
54
|
+
}
|
|
55
|
+
.expander[aria-expanded="true"] svg {
|
|
56
|
+
rotate: 0deg;
|
|
57
|
+
}
|
|
@@ -1,15 +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; }
|
|
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/field.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare function useFieldControl(options: FieldOptions): {
|
|
|
50
50
|
required: boolean;
|
|
51
51
|
disabled: boolean;
|
|
52
52
|
readOnly: boolean;
|
|
53
|
-
error: ReactNode
|
|
53
|
+
error: string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
54
54
|
hint: ReactNode;
|
|
55
55
|
descriptionId: string | undefined;
|
|
56
56
|
invalid: "false" | "grammar" | "spelling" | "true" | boolean;
|
package/components/field.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useContext, useId } from "react";
|
|
3
|
+
import { FormValidationContext } from "./form-validation.js";
|
|
3
4
|
const FieldContext = createContext(null);
|
|
4
5
|
function fieldInputProps(field) {
|
|
5
6
|
return {
|
|
@@ -29,7 +30,7 @@ const joinIds = (...values) => [
|
|
|
29
30
|
)
|
|
30
31
|
].join(" ") || void 0;
|
|
31
32
|
function useFieldControl(options) {
|
|
32
|
-
const inherited = useContext(FieldContext), generated = useId(), id = options.id || inherited?.id || generated, error = options.error ?? inherited?.error, hint = options.hint ?? inherited?.hint;
|
|
33
|
+
const inherited = useContext(FieldContext), validation = useContext(FormValidationContext), generated = useId(), id = options.id || inherited?.id || generated, error = options.error ?? validation[id] ?? inherited?.error, hint = options.hint ?? inherited?.hint;
|
|
33
34
|
return {
|
|
34
35
|
id,
|
|
35
36
|
name: options.name ?? inherited?.name,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const FormValidationContext: import("react").Context<Record<string, string>>;
|
|
2
|
+
export type ValidatableControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
3
|
+
export declare function formControls(form: HTMLFormElement): ValidatableControl[];
|
|
4
|
+
export declare function validateForm(form: HTMLFormElement | null, focus?: boolean): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
const FormValidationContext = createContext({});
|
|
4
|
+
function formControls(form) {
|
|
5
|
+
return Array.from(form.elements).filter(
|
|
6
|
+
(item) => item instanceof HTMLInputElement || item instanceof HTMLSelectElement || item instanceof HTMLTextAreaElement
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function validateForm(form, focus = true) {
|
|
10
|
+
if (!form) return false;
|
|
11
|
+
const valid = form.checkValidity();
|
|
12
|
+
if (!valid && focus)
|
|
13
|
+
requestAnimationFrame(
|
|
14
|
+
() => formControls(form).find((field) => field.willValidate && !field.validity.valid)?.focus()
|
|
15
|
+
);
|
|
16
|
+
return valid;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
FormValidationContext,
|
|
20
|
+
formControls,
|
|
21
|
+
validateForm
|
|
22
|
+
};
|
package/components/index.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ export type { ContextMenuItem, MenuAction } from "./menuTypes";
|
|
|
82
82
|
export { MenuItem } from "./MenuItem";
|
|
83
83
|
export type { MenuItemProps } from "./MenuItem";
|
|
84
84
|
export { Form } from "./Form";
|
|
85
|
+
export type { NativeFormProps } from "./Form";
|
|
86
|
+
export { validateForm } from "./form-validation";
|
|
85
87
|
export { AccountItem } from "./AccountItem";
|
|
86
88
|
export type { AccountItemProps, AccountItemMetadata } from "./AccountItem";
|
|
87
89
|
export { PasskeyItem } from "./PasskeyItem";
|
|
@@ -191,5 +193,5 @@ export { EditableHeading } from "./EditableHeading";
|
|
|
191
193
|
export type { EditableHeadingProps } from "./EditableHeading";
|
|
192
194
|
export type { TableOfContentsProps, TableOfContentsItem, } from "./TableOfContents";
|
|
193
195
|
export type { MarkdownCodeTheme } from "./Markdown";
|
|
194
|
-
export { Lightbox, type LightboxProps, type LightboxItem, type LightboxLabels } from "./Lightbox";
|
|
195
|
-
export { FloatingActionBar, type FloatingActionBarProps } from "./FloatingActionBar";
|
|
196
|
+
export { Lightbox, type LightboxProps, type LightboxItem, type LightboxLabels, } from "./Lightbox";
|
|
197
|
+
export { FloatingActionBar, type FloatingActionBarProps, } from "./FloatingActionBar";
|
package/components/index.js
CHANGED
|
@@ -79,6 +79,7 @@ import { ContextMenuPanel } from "./ContextMenuPanel.js";
|
|
|
79
79
|
import { SelectOptionContent } from "./SelectOptionContent.js";
|
|
80
80
|
import { MenuItem } from "./MenuItem.js";
|
|
81
81
|
import { Form } from "./Form.js";
|
|
82
|
+
import { validateForm } from "./form-validation.js";
|
|
82
83
|
import { AccountItem } from "./AccountItem.js";
|
|
83
84
|
import { PasskeyItem } from "./PasskeyItem.js";
|
|
84
85
|
import { SessionItem } from "./SessionItem.js";
|
|
@@ -156,8 +157,12 @@ import { Markdown } from "./Markdown.js";
|
|
|
156
157
|
import { Banner } from "./Banner.js";
|
|
157
158
|
import { TableOfContents } from "./TableOfContents.js";
|
|
158
159
|
import { EditableHeading } from "./EditableHeading.js";
|
|
159
|
-
import {
|
|
160
|
-
|
|
160
|
+
import {
|
|
161
|
+
Lightbox
|
|
162
|
+
} from "./Lightbox.js";
|
|
163
|
+
import {
|
|
164
|
+
FloatingActionBar
|
|
165
|
+
} from "./FloatingActionBar.js";
|
|
161
166
|
export {
|
|
162
167
|
Accordion,
|
|
163
168
|
AccountItem,
|
|
@@ -313,5 +318,6 @@ export {
|
|
|
313
318
|
useFormState,
|
|
314
319
|
useToast,
|
|
315
320
|
useUIConfig,
|
|
316
|
-
validateFiles
|
|
321
|
+
validateFiles,
|
|
322
|
+
validateForm
|
|
317
323
|
};
|