@robert-stackflow/oneui 0.6.26 → 0.6.28
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 +8 -0
- package/README.md +5 -0
- package/components/Dialog.module.css +153 -143
- package/components/Drawer.d.ts +3 -1
- package/components/Drawer.js +2 -1
- package/components/Drawer.module.css +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.6.28
|
|
2
|
+
|
|
3
|
+
- Keep Dialog headers and footer actions visible while long content scrolls inside the body, including narrow viewports and nested modals.
|
|
4
|
+
|
|
5
|
+
## 0.6.27
|
|
6
|
+
|
|
7
|
+
- Add Drawer headerDivider for tabbed panels that already own their navigation separator.
|
|
8
|
+
|
|
1
9
|
## 0.6.26
|
|
2
10
|
|
|
3
11
|
- Add content-sized Popover width for compact contextual action bars, clamped to the viewport.
|
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
React 组件、应用外壳和两套可互换的主题。无 Electron、React Router、账户 API 或持久化存储依赖。
|
|
4
4
|
|
|
5
|
+
## 长表单弹窗(0.6.28)
|
|
6
|
+
|
|
7
|
+
`Dialog` 的标题、关闭按钮和 `footer` 操作保持可见,超高内容在正文内部滚动。将主操作放入 `footer`,不要在应用侧为弹窗叠加高度、固定定位或滚动样式。闭合的原生弹窗仍保持隐藏,嵌套弹窗沿用统一焦点与进退场规则。
|
|
8
|
+
|
|
5
9
|
## 紧凑操作栏与切换按钮(0.6.26)
|
|
6
10
|
|
|
7
11
|
`Popover width="content" arrow scrollable={false}` 按内容确定宽度,并限制在视口边距内,适合文本和表格的上下文操作栏。关闭时保持组件挂载并传入 `open={false}`,由 OneUI 完成箭头、进退场和减少动态效果处理。
|
|
@@ -114,6 +118,7 @@ item 的 `trailing` 可放数字、圆点、Spinner 或自定义组件,布局
|
|
|
114
118
|
```
|
|
115
119
|
|
|
116
120
|
横向 `FormField` 内包含 `Textarea` 时,标签自动靠上排列;手机仍使用纵向布局。`Drawer.onAfterClose` 可在关闭动画与焦点恢复完成后执行后续操作。
|
|
121
|
+
带下划线导航的抽屉可传 `headerDivider={false}`,仅去掉抽屉标题区的分割线,保留页签与正文中的分组线。
|
|
117
122
|
|
|
118
123
|
## 嵌套侧栏(0.6.0)
|
|
119
124
|
|
|
@@ -1,143 +1,153 @@
|
|
|
1
|
-
.dialog {
|
|
2
|
-
width: min(var(--dialog-width), calc(100vw - 32px));
|
|
3
|
-
max-height: calc(100dvh - var(--dialog-inset));
|
|
4
|
-
padding: 0;
|
|
5
|
-
color: var(--fg);
|
|
6
|
-
background: var(--surface);
|
|
7
|
-
border: 1px solid var(--line);
|
|
8
|
-
border-radius: calc(var(--radius) + 3px);
|
|
9
|
-
box-shadow: var(--shadow-dialog);
|
|
10
|
-
overflow:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.dialog
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.dialog
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
gap:
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
.dialogHeading
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
.dialog[data-tone="
|
|
69
|
-
--dialog-tone: var(--
|
|
70
|
-
}
|
|
71
|
-
.dialog[data-tone="
|
|
72
|
-
--dialog-tone: var(--
|
|
73
|
-
}
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
1
|
+
.dialog {
|
|
2
|
+
width: min(var(--dialog-width), calc(100vw - 32px));
|
|
3
|
+
max-height: calc(100dvh - var(--dialog-inset));
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: var(--fg);
|
|
6
|
+
background: var(--surface);
|
|
7
|
+
border: 1px solid var(--line);
|
|
8
|
+
border-radius: calc(var(--radius) + 3px);
|
|
9
|
+
box-shadow: var(--shadow-dialog);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dialog[open] {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dialog::backdrop {
|
|
19
|
+
background: var(--overlay);
|
|
20
|
+
backdrop-filter: blur(3px);
|
|
21
|
+
animation: fade-in var(--popup-enter);
|
|
22
|
+
}
|
|
23
|
+
.dialog[data-placement="top"] {
|
|
24
|
+
margin-top: min(10dvh, 96px);
|
|
25
|
+
margin-bottom: auto;
|
|
26
|
+
}
|
|
27
|
+
.dialogHeader {
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
gap: 16px;
|
|
33
|
+
padding: 24px 24px 20px;
|
|
34
|
+
}
|
|
35
|
+
.dialogHeading {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: 14px;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
}
|
|
41
|
+
.dialogHeading h2 {
|
|
42
|
+
min-width: 0;
|
|
43
|
+
overflow-wrap: anywhere;
|
|
44
|
+
font-size: 18px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
line-height: 1.5;
|
|
47
|
+
}
|
|
48
|
+
.dialogHeader > button {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
margin-top: -3px;
|
|
51
|
+
margin-right: -6px;
|
|
52
|
+
color: var(--muted);
|
|
53
|
+
}
|
|
54
|
+
.dialogIcon {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
flex: 0 0 21px;
|
|
59
|
+
width: 21px;
|
|
60
|
+
height: 25px;
|
|
61
|
+
color: var(--dialog-tone, var(--accent-ink, var(--accent)));
|
|
62
|
+
}
|
|
63
|
+
.dialogIcon > svg {
|
|
64
|
+
width: 21px;
|
|
65
|
+
height: 21px;
|
|
66
|
+
stroke-width: 1.7;
|
|
67
|
+
}
|
|
68
|
+
.dialog[data-tone="info"] {
|
|
69
|
+
--dialog-tone: var(--accent-ink, var(--accent));
|
|
70
|
+
}
|
|
71
|
+
.dialog[data-tone="success"] {
|
|
72
|
+
--dialog-tone: var(--success);
|
|
73
|
+
}
|
|
74
|
+
.dialog[data-tone="warning"] {
|
|
75
|
+
--dialog-tone: var(--warning);
|
|
76
|
+
}
|
|
77
|
+
.dialog[data-tone="danger"] {
|
|
78
|
+
--dialog-tone: var(--danger);
|
|
79
|
+
}
|
|
80
|
+
.dialogBody {
|
|
81
|
+
min-height: 0;
|
|
82
|
+
overflow: auto;
|
|
83
|
+
overscroll-behavior: contain;
|
|
84
|
+
padding: 0 24px 24px;
|
|
85
|
+
}
|
|
86
|
+
.dialogBody > p {
|
|
87
|
+
color: var(--muted);
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
line-height: 1.8;
|
|
90
|
+
}
|
|
91
|
+
.dialogFooter {
|
|
92
|
+
flex-shrink: 0;
|
|
93
|
+
flex-wrap: wrap;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: flex-end;
|
|
96
|
+
gap: 8px;
|
|
97
|
+
padding: 14px 24px;
|
|
98
|
+
border-top: var(--separator-width) var(--separator-style)
|
|
99
|
+
var(--separator-color);
|
|
100
|
+
background: var(--canvas);
|
|
101
|
+
}
|
|
102
|
+
.wide {
|
|
103
|
+
width: min(var(--dialog-wide-width), calc(100vw - 32px));
|
|
104
|
+
}
|
|
105
|
+
.small {
|
|
106
|
+
width: min(420px, calc(100vw - 32px));
|
|
107
|
+
}
|
|
108
|
+
.dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeader {
|
|
109
|
+
padding: 22px 24px 12px;
|
|
110
|
+
}
|
|
111
|
+
.dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeading {
|
|
112
|
+
gap: 10px;
|
|
113
|
+
}
|
|
114
|
+
.dialog:is([data-variant="message"], [data-variant="confirm"])
|
|
115
|
+
.dialogHeader
|
|
116
|
+
h2 {
|
|
117
|
+
font-size: 17px;
|
|
118
|
+
}
|
|
119
|
+
.dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogBody {
|
|
120
|
+
padding: 0 24px 24px;
|
|
121
|
+
}
|
|
122
|
+
.closing {
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
|
+
.dialog.closing::backdrop {
|
|
126
|
+
background: transparent;
|
|
127
|
+
backdrop-filter: blur(0);
|
|
128
|
+
transition:
|
|
129
|
+
background var(--popup-exit),
|
|
130
|
+
backdrop-filter var(--popup-exit);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@media (max-width: 600px) {
|
|
134
|
+
.dialog {
|
|
135
|
+
max-height: calc(100dvh - 24px);
|
|
136
|
+
}
|
|
137
|
+
.dialogBody {
|
|
138
|
+
padding: 0 20px 20px;
|
|
139
|
+
}
|
|
140
|
+
.dialogHeader,
|
|
141
|
+
.dialogFooter {
|
|
142
|
+
padding: 18px 20px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes fade-in {
|
|
147
|
+
from {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
}
|
|
150
|
+
to {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
153
|
+
}
|
package/components/Drawer.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type DrawerProps = {
|
|
|
6
6
|
onAfterClose?(): void;
|
|
7
7
|
title: ReactNode;
|
|
8
8
|
description?: ReactNode;
|
|
9
|
+
/** Hide the header divider when embedded navigation already provides one. */
|
|
10
|
+
headerDivider?: boolean;
|
|
9
11
|
children: ReactNode;
|
|
10
12
|
footer?: ReactNode;
|
|
11
13
|
placement?: DrawerPlacement;
|
|
@@ -20,4 +22,4 @@ export type DrawerProps = {
|
|
|
20
22
|
portalContainer?: HTMLElement | null;
|
|
21
23
|
className?: string;
|
|
22
24
|
};
|
|
23
|
-
export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, description, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
|
|
25
|
+
export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, description, headerDivider, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
|
package/components/Drawer.js
CHANGED
|
@@ -33,6 +33,7 @@ function Drawer({
|
|
|
33
33
|
onAfterClose,
|
|
34
34
|
title,
|
|
35
35
|
description,
|
|
36
|
+
headerDivider = true,
|
|
36
37
|
children,
|
|
37
38
|
footer,
|
|
38
39
|
placement = "right",
|
|
@@ -141,7 +142,7 @@ function Drawer({
|
|
|
141
142
|
backdropDown.current = false;
|
|
142
143
|
},
|
|
143
144
|
children: [
|
|
144
|
-
/* @__PURE__ */ jsxs("header", { className: s.header, children: [
|
|
145
|
+
/* @__PURE__ */ jsxs("header", { className: s.header, "data-divider": headerDivider, children: [
|
|
145
146
|
/* @__PURE__ */ jsxs("div", { className: s.heading, children: [
|
|
146
147
|
/* @__PURE__ */ jsx("h2", { id: titleId, children: title }),
|
|
147
148
|
description != null && /* @__PURE__ */ jsx("div", { id: descriptionId, className: s.description, children: description })
|