@fbkworks/adapter-naive-ui 0.0.0-stage → 0.3.0
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/LICENSE +21 -0
- package/README.md +34 -2
- package/dist/dark.css +5 -0
- package/dist/feedback.d.ts +4 -0
- package/dist/feedback.mjs +61 -0
- package/dist/feedback.mjs.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.mjs +80 -0
- package/dist/index.mjs.map +1 -0
- package/dist/locale-context.d.ts +9 -0
- package/dist/locale-context.mjs +7 -0
- package/dist/locale-context.mjs.map +1 -0
- package/dist/primitives/Button.d.ts +53 -0
- package/dist/primitives/Button.mjs +62 -0
- package/dist/primitives/Button.mjs.map +1 -0
- package/dist/primitives/Checkbox.d.ts +26 -0
- package/dist/primitives/Checkbox.mjs +43 -0
- package/dist/primitives/Checkbox.mjs.map +1 -0
- package/dist/primitives/DataGrid.d.ts +93 -0
- package/dist/primitives/DataGrid.mjs +125 -0
- package/dist/primitives/DataGrid.mjs.map +1 -0
- package/dist/primitives/DatePicker.d.ts +66 -0
- package/dist/primitives/DatePicker.mjs +90 -0
- package/dist/primitives/DatePicker.mjs.map +1 -0
- package/dist/primitives/Dialog.d.ts +57 -0
- package/dist/primitives/Dialog.mjs +64 -0
- package/dist/primitives/Dialog.mjs.map +1 -0
- package/dist/primitives/Drawer.d.ts +57 -0
- package/dist/primitives/Drawer.mjs +58 -0
- package/dist/primitives/Drawer.mjs.map +1 -0
- package/dist/primitives/Form.d.ts +95 -0
- package/dist/primitives/Form.mjs +124 -0
- package/dist/primitives/Form.mjs.map +1 -0
- package/dist/primitives/Input.d.ts +57 -0
- package/dist/primitives/Input.mjs +58 -0
- package/dist/primitives/Input.mjs.map +1 -0
- package/dist/primitives/Pagination.d.ts +63 -0
- package/dist/primitives/Pagination.mjs +66 -0
- package/dist/primitives/Pagination.mjs.map +1 -0
- package/dist/primitives/Radio.d.ts +40 -0
- package/dist/primitives/Radio.mjs +60 -0
- package/dist/primitives/Radio.mjs.map +1 -0
- package/dist/primitives/Select.d.ts +61 -0
- package/dist/primitives/Select.mjs +55 -0
- package/dist/primitives/Select.mjs.map +1 -0
- package/dist/primitives/Spin.d.ts +15 -0
- package/dist/primitives/Spin.mjs +28 -0
- package/dist/primitives/Spin.mjs.map +1 -0
- package/dist/primitives/Tag.d.ts +32 -0
- package/dist/primitives/Tag.mjs +48 -0
- package/dist/primitives/Tag.mjs.map +1 -0
- package/dist/root-provider.d.ts +58 -0
- package/dist/root-provider.mjs +103 -0
- package/dist/root-provider.mjs.map +1 -0
- package/dist/style.css +367 -0
- package/dist/theme.d.ts +103 -0
- package/dist/theme.mjs +133 -0
- package/dist/theme.mjs.map +1 -0
- package/package.json +56 -3
package/dist/style.css
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* naive-ui 适配器样式。
|
|
3
|
+
*
|
|
4
|
+
* naive-ui 是 CSS-in-JS:每个组件实例在运行时生成自己的 --n-* 变量,
|
|
5
|
+
* 并以**行内样式**挂在组件元素上。所以:
|
|
6
|
+
* · 能覆盖的:尺寸、圆角、间距这类全局统一的属性(用 !important)
|
|
7
|
+
* · 覆盖不了的:按状态变化的颜色 —— NTag 不输出状态 class,
|
|
8
|
+
* 所有状态的 class 都只是 `n-tag`,颜色只能靠 themeOverrides。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
.fbk-form-item__help {
|
|
12
|
+
margin-top: var(--fbk-form-item-gap);
|
|
13
|
+
color: var(--fbk-form-item-help-fg);
|
|
14
|
+
font-size: var(--fbk-form-item-help-font-size);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* ============================================================
|
|
18
|
+
表单条目的反馈占位
|
|
19
|
+
|
|
20
|
+
naive 的 NFormItem 在控件下面永远渲染一个 n-form-item-feedback-wrapper,
|
|
21
|
+
即使没有错误信息也占 24px(实测 form-item 高 56px,
|
|
22
|
+
而 element-plus 只有 33.5px)。两个适配器的表单高度因此差 22px。
|
|
23
|
+
|
|
24
|
+
它在没有反馈时是空的 —— 空就不该占位。用 :empty 收起。
|
|
25
|
+
注意不要用 display:none 直接砍掉:有错误信息时它需要正常出现,
|
|
26
|
+
:empty 只在真正没有子节点时生效。
|
|
27
|
+
============================================================ */
|
|
28
|
+
.n-form-item-feedback-wrapper:empty {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ============================================================
|
|
33
|
+
表格
|
|
34
|
+
|
|
35
|
+
naive 的 DataTable 同样用 CSS-in-JS,但**表头/单元格的颜色**
|
|
36
|
+
可以通过 themeOverrides 之外的一条路径覆盖:naive 把 --n-th-color 等
|
|
37
|
+
声明在 DataTable 的根元素上,所以选择器命中组件根节点即可。
|
|
38
|
+
尺寸(行高、内边距)naive 也是内联的,同样只能 !important。
|
|
39
|
+
|
|
40
|
+
注意:这里的颜色覆盖与 theme.ts 的 themeOverrides 是**互补**的,
|
|
41
|
+
不是二选一 —— themeOverrides 负责 naive 自己的组件(Button/Tag 等),
|
|
42
|
+
这里负责 DataTable 里由我们渲染的单元格。
|
|
43
|
+
============================================================ */
|
|
44
|
+
.fbk-pro-table .n-data-table {
|
|
45
|
+
--n-th-color: var(--fbk-pro-table-header-bg) !important;
|
|
46
|
+
--n-th-text-color: var(--fbk-pro-table-header-fg) !important;
|
|
47
|
+
--n-td-color: var(--fbk-pro-table-bg) !important;
|
|
48
|
+
--n-td-text-color: var(--fbk-pro-table-cell-fg) !important;
|
|
49
|
+
--n-merged-border-color: var(--fbk-pro-table-border-color) !important;
|
|
50
|
+
--n-td-color-hover: var(--fbk-pro-table-row-hover-bg) !important;
|
|
51
|
+
--n-td-color-modal: var(--fbk-pro-table-row-selected-bg) !important;
|
|
52
|
+
border-radius: var(--fbk-pro-table-radius) !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 行高必须用 border-box + line-height 精确控制。
|
|
56
|
+
naive 的单元格默认上下 12px 内边距 + 1.6 行高,只设 height 时
|
|
57
|
+
内容会把格子撑高(实测设 44px 得到 45.8px)。
|
|
58
|
+
|
|
59
|
+
注意这里用 height 而不是 min-height,并且**不加**边框补偿:
|
|
60
|
+
naive 的 <td> 自带 1px 下边框,border-box 下 height 已含边框,
|
|
61
|
+
而 element-plus 的渲染高度同样含边框(都是 44px)。
|
|
62
|
+
两边一致,不需要 +1px。 */
|
|
63
|
+
.fbk-pro-table .n-data-table-th,
|
|
64
|
+
.fbk-pro-table .n-data-table-td {
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* naive 的内层 wrapper 自带 1px 四周边框,element-plus 没有 ——
|
|
69
|
+
表格高度差 2px、行宽窄 2px,下面分页条的 y 坐标也跟着差。
|
|
70
|
+
外框由组件层 .fbk-pro-table 的 border 负责,内层不再画。
|
|
71
|
+
|
|
72
|
+
选择器要写三层:naive 的 CSS-in-JS 是在运行时注入 <head> 的,
|
|
73
|
+
位置在我们的样式表**之后**。同等特异性下它会赢,
|
|
74
|
+
所以 `.fbk-pro-table .n-data-table-wrapper` 这种两层写法无效(实测过)。 */
|
|
75
|
+
.fbk-pro-table .n-data-table .n-data-table-wrapper {
|
|
76
|
+
border: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.fbk-pro-table .n-data-table-th {
|
|
80
|
+
height: var(--fbk-pro-table-header-height) !important;
|
|
81
|
+
padding: 0 var(--fbk-pro-table-cell-padding-x) !important;
|
|
82
|
+
font-size: var(--fbk-pro-table-header-font-size) !important;
|
|
83
|
+
font-weight: var(--fbk-pro-table-header-font-weight) !important;
|
|
84
|
+
letter-spacing: var(--fbk-pro-table-header-letter-spacing) !important;
|
|
85
|
+
/* line-height 必须比 height 小 1px:单元格自带 1px 下边框,
|
|
86
|
+
border-box 下内容盒 = height - 边框,行盒撑到 height 就会溢出 1px。
|
|
87
|
+
直接写 line-height: 46px 时实测渲染 47px。 */
|
|
88
|
+
line-height: calc(var(--fbk-pro-table-header-height) - 1px) !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.fbk-pro-table .n-data-table-td {
|
|
92
|
+
height: var(--fbk-pro-table-row-height) !important;
|
|
93
|
+
padding: 0 var(--fbk-pro-table-cell-padding-x) !important;
|
|
94
|
+
font-size: var(--fbk-pro-table-cell-font-size) !important;
|
|
95
|
+
line-height: calc(var(--fbk-pro-table-row-height) - 1px) !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* 表头首尾单元格补圆角,和外层容器一致。
|
|
99
|
+
element-plus 用同一套令牌做同样的事,两个适配器的表头圆角才对得上。 */
|
|
100
|
+
.fbk-pro-table .n-data-table-thead .n-data-table-tr:first-child .n-data-table-th:first-child {
|
|
101
|
+
border-top-left-radius: var(--fbk-pro-table-radius);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.fbk-pro-table .n-data-table-thead .n-data-table-tr:first-child .n-data-table-th:last-child {
|
|
105
|
+
border-top-right-radius: var(--fbk-pro-table-radius);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* 数值列等宽数字。类名由 DataGrid 按 column.numeric 加上。 */
|
|
109
|
+
.fbk-pro-table .n-data-table-td.fbk-numeric {
|
|
110
|
+
font-family: var(--fbk-pro-table-numeric-font-family);
|
|
111
|
+
font-variant-numeric: var(--fbk-pro-table-numeric-font-variant);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.fbk-pro-table .n-data-table-tr[tabindex] {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.fbk-pro-table .n-data-table-tr:focus-visible {
|
|
119
|
+
outline: 2px solid var(--fbk-color-focus-ring);
|
|
120
|
+
outline-offset: -2px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ============================================================
|
|
124
|
+
标签
|
|
125
|
+
|
|
126
|
+
颜色在 theme.ts 的 themeOverrides 里(NTag 不输出状态 class)。
|
|
127
|
+
这里只管尺寸与边框。
|
|
128
|
+
|
|
129
|
+
边框:naive 默认给非 bordered 标签加 1px 实线描边,实测
|
|
130
|
+
element-plus 侧是透明的,导致同状态标签宽 2px。
|
|
131
|
+
令牌没有「标签边框」这个概念 —— 语义上标签就是「浅底 + 深字」,
|
|
132
|
+
不需要描边,所以这里统一抹掉。
|
|
133
|
+
============================================================ */
|
|
134
|
+
.n-tag {
|
|
135
|
+
--n-height: var(--fbk-tag-height) !important;
|
|
136
|
+
--n-padding: 0 var(--fbk-tag-padding-x) !important;
|
|
137
|
+
--n-border-radius: var(--fbk-tag-radius) !important;
|
|
138
|
+
--n-font-size: var(--fbk-tag-font-size) !important;
|
|
139
|
+
font-weight: var(--fbk-tag-font-weight);
|
|
140
|
+
border: 1px solid transparent !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* ============================================================
|
|
144
|
+
文字按钮
|
|
145
|
+
|
|
146
|
+
naive 的 text 模式按钮没有 min-height,只剩行高(实测 12px),
|
|
147
|
+
而 element-plus 的 text 按钮仍是 32px。返回按钮这类「文字按钮
|
|
148
|
+
承载点击动作」的位置就会一边是 32px 一边是 12px,头部高度差 20px。
|
|
149
|
+
|
|
150
|
+
这里给文字按钮补回控件高度。用 min-height 而不是 height:
|
|
151
|
+
文字换行时仍能自然长高。
|
|
152
|
+
============================================================ */
|
|
153
|
+
/* 类名由适配器的 Button.tsx 加上:naive 的 text 模式本身不输出类名。
|
|
154
|
+
内边距归零 —— element-plus 的 text 按钮 padding 就是 0,
|
|
155
|
+
naive 默认 12px,两边会差 24px 宽。
|
|
156
|
+
|
|
157
|
+
颜色也在这里定:naive 的默认 text 按钮用 textColor2,
|
|
158
|
+
element-plus 的 text 按钮继承按钮的 type 色(这里是 primary)。
|
|
159
|
+
返回按钮的语义是「一个动作」,不是「一段灰字」,
|
|
160
|
+
所以跟 element-plus 走主色,由组件层用 --fbk-color-* 覆盖。 */
|
|
161
|
+
.n-button.fbk-button--text {
|
|
162
|
+
min-height: var(--fbk-button-height-md);
|
|
163
|
+
padding: 0;
|
|
164
|
+
border-radius: var(--fbk-button-radius);
|
|
165
|
+
color: var(--fbk-color-text-secondary);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.n-button.fbk-button--text:hover,
|
|
169
|
+
.n-button.fbk-button--text:focus {
|
|
170
|
+
color: var(--fbk-color-text);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* 圆角在 naive 的文字按钮上是 0,element-plus 是 6px。
|
|
174
|
+
焦点环会贴着这个圆角,所以必须一致。 */
|
|
175
|
+
.n-button {
|
|
176
|
+
border-radius: var(--fbk-button-radius);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* 按钮宽度对齐。
|
|
180
|
+
element-plus 的按钮有 1px 实体边框(计入 border-box 宽度),
|
|
181
|
+
naive 的边框画在伪元素上、不占布局 —— 同文案同内边距下
|
|
182
|
+
宽度差 2px(实测 60 vs 58)。
|
|
183
|
+
|
|
184
|
+
基准取 theme.ts 里 Button.paddingMedium 的 15px,不是
|
|
185
|
+
--fbk-button-padding-x-md(12px)—— 后者是契约档位,
|
|
186
|
+
naive 实际用的内边距是 15px,按 12px 补会把按钮压窄。 */
|
|
187
|
+
.n-button:not(.fbk-button--text) {
|
|
188
|
+
padding-left: var(--fbk-spacing-lg);
|
|
189
|
+
padding-right: var(--fbk-spacing-lg);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* ============================================================
|
|
193
|
+
分页
|
|
194
|
+
|
|
195
|
+
naive 的 NPagination 与 element-plus 的分页是两套完全不同的 DOM,
|
|
196
|
+
默认外观差异很大 —— 不是「差几个像素」,是能一眼看出来的:
|
|
197
|
+
|
|
198
|
+
┌──────────────┬──────────────────────┬──────────────────────┐
|
|
199
|
+
│ │ element-plus │ naive(默认) │
|
|
200
|
+
├──────────────┼──────────────────────┼──────────────────────┤
|
|
201
|
+
│ 页码描边 │ 无 │ 活动页 1px 主色描边 │
|
|
202
|
+
│ 活动页底色 │ 透明 │ 主色浅底 │
|
|
203
|
+
│ 活动页字重 │ 700 │ 400 │
|
|
204
|
+
│ 页码文字色 │ 正文色 │ 次级色 │
|
|
205
|
+
│ 分组间距 │ 16px │ 8px │
|
|
206
|
+
│ 每页条数/跳页 │ 32px 高 │ 28px 高(small 档) │
|
|
207
|
+
└──────────────┴──────────────────────┴──────────────────────┘
|
|
208
|
+
|
|
209
|
+
下面按这六项逐条对齐。全部走 --n-* 变量,不用 !important 堆选择器。
|
|
210
|
+
============================================================ */
|
|
211
|
+
.fbk-pro-table .n-pagination {
|
|
212
|
+
--n-item-size: var(--fbk-pro-table-pagination-item-height) !important;
|
|
213
|
+
--n-item-font-size: var(--fbk-pro-table-pagination-font-size) !important;
|
|
214
|
+
--n-jumper-font-size: var(--fbk-pro-table-pagination-font-size) !important;
|
|
215
|
+
--n-item-border-radius: var(--fbk-radius-sm) !important;
|
|
216
|
+
|
|
217
|
+
/* 文字色:element-plus 的普通页码用正文色,不是次级色。
|
|
218
|
+
次级色留给「共 N 条」这类说明文字。 */
|
|
219
|
+
--n-item-text-color: var(--fbk-color-text) !important;
|
|
220
|
+
--n-item-text-color-hover: var(--fbk-color-primary-text) !important;
|
|
221
|
+
--n-item-text-color-active: var(--fbk-color-primary-text) !important;
|
|
222
|
+
--n-item-text-color-disabled: var(--fbk-color-text-disabled) !important;
|
|
223
|
+
|
|
224
|
+
/* 活动页:element-plus 只有文字变色 + 加粗,没有底色也没有描边。
|
|
225
|
+
保留 1px 透明边是为了盒模型一致(naive 的 item 是 border-box)。 */
|
|
226
|
+
--n-item-color-active: transparent !important;
|
|
227
|
+
--n-item-color-active-hover: transparent !important;
|
|
228
|
+
--n-item-border-active: 1px solid transparent !important;
|
|
229
|
+
|
|
230
|
+
/* 普通页 / 翻页按钮:同样不能有描边和底色。 */
|
|
231
|
+
--n-item-border: 1px solid transparent !important;
|
|
232
|
+
--n-item-border-hover: 1px solid transparent !important;
|
|
233
|
+
--n-item-border-pressed: 1px solid transparent !important;
|
|
234
|
+
--n-button-border: 1px solid transparent !important;
|
|
235
|
+
--n-button-border-hover: 1px solid transparent !important;
|
|
236
|
+
--n-button-border-pressed: 1px solid transparent !important;
|
|
237
|
+
--n-button-color: transparent !important;
|
|
238
|
+
--n-button-color-hover: transparent !important;
|
|
239
|
+
--n-button-color-pressed: transparent !important;
|
|
240
|
+
--n-button-icon-color: var(--fbk-color-text) !important;
|
|
241
|
+
--n-button-icon-color-hover: var(--fbk-color-primary-text) !important;
|
|
242
|
+
--n-button-icon-color-pressed: var(--fbk-color-primary-text) !important;
|
|
243
|
+
|
|
244
|
+
/* 禁用态:element-plus 只把文字调灰,底色仍是白、无描边。 */
|
|
245
|
+
--n-item-color-disabled: transparent !important;
|
|
246
|
+
--n-item-border-disabled: 1px solid transparent !important;
|
|
247
|
+
|
|
248
|
+
/* 分组间距。element-plus 的规则是「翻页组内部 0,组与组之间 16px」,
|
|
249
|
+
naive 则给每个非首子元素统一 8px。先统一归零,再按组补。 */
|
|
250
|
+
--n-item-margin: 0 !important;
|
|
251
|
+
|
|
252
|
+
/* 跳页输入框宽度:element-plus 是 56px,naive 是 60px。
|
|
253
|
+
4px 的差会一路传导到「共 N 条」的左边缘。 */
|
|
254
|
+
--n-input-width: 56px !important;
|
|
255
|
+
|
|
256
|
+
/* 翻页箭头图标:element-plus 是 12px 的细箭头,naive 是 16px。
|
|
257
|
+
16px 的箭头在 32px 的按钮里显得笨重,也让翻页组看起来更宽。 */
|
|
258
|
+
--n-button-icon-size: 12px !important;
|
|
259
|
+
|
|
260
|
+
font-size: var(--fbk-pro-table-pagination-font-size);
|
|
261
|
+
color: var(--fbk-pro-table-pagination-fg);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* 活动页加粗,和 element-plus 的 `font-weight: bold` 一致。
|
|
265
|
+
只靠颜色区分时,当前页在三个数字里并不显眼。 */
|
|
266
|
+
.fbk-pro-table .n-pagination .n-pagination-item--active {
|
|
267
|
+
font-weight: var(--fbk-pro-table-pagination-active-font-weight);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* 组间间距:每页条数 → 翻页组、翻页组 → 跳页。
|
|
271
|
+
这两条要写在 --n-item-margin 归零之后,特异性也要够
|
|
272
|
+
(naive 的规则是 `.n-pagination > *:not(:first-child)` = 0,2,0)。 */
|
|
273
|
+
.fbk-pro-table .n-pagination > .n-select + .n-pagination-item,
|
|
274
|
+
.fbk-pro-table .n-pagination > .n-pagination-quick-jumper {
|
|
275
|
+
margin-left: var(--fbk-pro-table-pagination-gap);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* 每页条数下拉的宽度。
|
|
279
|
+
element-plus 的 sizes 选择器是固定 128px,naive 的是内容宽(实测 87px)。
|
|
280
|
+
分页块右对齐,宽度差会一路传导到左边,两个适配器的分页起点相差 40px。 */
|
|
281
|
+
.fbk-pro-table .n-pagination .n-select {
|
|
282
|
+
width: 128px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* 每页条数下拉与跳页输入框的高度。
|
|
286
|
+
|
|
287
|
+
naive 把这两个控件降了一档尺寸(`smallerSize(medium)` → small = 28px),
|
|
288
|
+
element-plus 是 32px。分页条里两个控件比页码矮 4px,看着像没对齐。
|
|
289
|
+
|
|
290
|
+
--n-height 是行内变量,样式表里必须 !important 才能赢。
|
|
291
|
+
naive 的内边距由 `calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2)`
|
|
292
|
+
推导,所以改这一个变量,内边距会跟着重算。 */
|
|
293
|
+
.fbk-pro-table .n-pagination .n-select .n-base-selection,
|
|
294
|
+
.fbk-pro-table .n-pagination .n-pagination-quick-jumper .n-input {
|
|
295
|
+
--n-height: var(--fbk-pro-table-pagination-item-height) !important;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* 跳页组尾部的单位字(「页」/「page」)。
|
|
299
|
+
由 Pagination.tsx 通过 NPagination 的 suffix 槽渲染,跟随 locale。
|
|
300
|
+
naive 默认给 suffix 8px 左边距,和 element-plus 的间距一致,
|
|
301
|
+
这里只需要对齐文字样式。 */
|
|
302
|
+
.fbk-pagination__suffix {
|
|
303
|
+
/* element-plus 的单位字离输入框 8px(.el-pagination__classifier 的
|
|
304
|
+
margin-left)。naive 的 suffix 槽默认紧贴,要补回来。 */
|
|
305
|
+
margin-left: var(--fbk-spacing-sm);
|
|
306
|
+
font-size: var(--fbk-pro-table-pagination-font-size);
|
|
307
|
+
color: var(--fbk-pro-table-pagination-fg);
|
|
308
|
+
white-space: nowrap;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* 总数文案由适配器的 Pagination.tsx 补渲染(naive 没有等价能力)。
|
|
312
|
+
和 NPagination 排在同一行,右对齐由外层 .fbk-pro-table__pagination 管。 */
|
|
313
|
+
.fbk-pagination {
|
|
314
|
+
display: flex;
|
|
315
|
+
gap: var(--fbk-pro-table-pagination-gap);
|
|
316
|
+
align-items: center;
|
|
317
|
+
margin-left: auto;
|
|
318
|
+
/* 容器也要声明颜色:element-plus 的分页根元素是 textSecondary,
|
|
319
|
+
naive 的根元素继承正文色。只在 .__total 上设色的话,
|
|
320
|
+
两个容器的计算色不一致,下游做颜色断言或主题覆盖时会踩到。 */
|
|
321
|
+
font-size: var(--fbk-pro-table-pagination-font-size);
|
|
322
|
+
color: var(--fbk-pro-table-pagination-fg);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.fbk-pagination__total {
|
|
326
|
+
font-size: var(--fbk-pro-table-pagination-font-size);
|
|
327
|
+
color: var(--fbk-pro-table-pagination-fg);
|
|
328
|
+
white-space: nowrap;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* ============================================================
|
|
332
|
+
日期选择器:宽度撑满栅格
|
|
333
|
+
============================================================
|
|
334
|
+
naive 的 .n-date-picker 默认按内容定宽(实测 203px),
|
|
335
|
+
而 .n-input 是 width:100%。同一行里两种宽度会参差不齐。
|
|
336
|
+
range 模式还要保证内部两个输入框均分。 */
|
|
337
|
+
.fbk-form-generator .n-date-picker,
|
|
338
|
+
.fbk-query-form .n-date-picker {
|
|
339
|
+
width: 100%;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.fbk-form-generator .n-date-picker .n-input,
|
|
343
|
+
.fbk-query-form .n-date-picker .n-input {
|
|
344
|
+
width: 100%;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* ============================================================
|
|
348
|
+
feedback 确认框:按钮间距对齐 element-plus
|
|
349
|
+
============================================================
|
|
350
|
+
naive 自带 12px(.n-dialog__action 的子按钮有 margin-left),
|
|
351
|
+
而 element-plus 是 0。统一成 8px(--fbk-spacing-sm),
|
|
352
|
+
与 FormModal 底部按钮组、QueryForm 操作区保持同一数值。 */
|
|
353
|
+
.n-dialog__action {
|
|
354
|
+
display: flex;
|
|
355
|
+
gap: var(--fbk-spacing-sm);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* naive 的按钮间距来自 --n-action-space(默认 12px),
|
|
359
|
+
规则是 `.n-dialog .n-dialog__action > :not(:last-child) { margin-right: var(--n-action-space) }`。
|
|
360
|
+
但这个变量是 naive 用 CSS-in-JS 写在 .n-dialog 的**行内样式**上的,
|
|
361
|
+
行内样式优先级高于任何普通选择器 —— 实测普通规则改不动它。
|
|
362
|
+
|
|
363
|
+
这里必须用 !important。理由:这是覆盖第三方库行内变量的唯一手段,
|
|
364
|
+
且作用域限定在 .n-dialog 内的 --n-action-space,不影响消费方其他样式。 */
|
|
365
|
+
.n-dialog {
|
|
366
|
+
--n-action-space: 0 !important;
|
|
367
|
+
}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Size, ThemeBridge, ThemeMode } from '@fbkworks/adapter-core';
|
|
2
|
+
import { FbkTokens } from '@fbkworks/tokens';
|
|
3
|
+
/**
|
|
4
|
+
* size 在 naive 下只能落在这一处:naive-ui 2.45 的 NConfigProvider 没有 size
|
|
5
|
+
* 能力(props 里只有 theme / themeOverrides / componentOptions / locale 等),
|
|
6
|
+
* themeOverrides.common.height* 是唯一的中枢 —— 它会写成每个控件行内的
|
|
7
|
+
* --n-height,控件自身的 CSS 读的就是这个变量。整体缩放而不是只改一档:
|
|
8
|
+
* 业务方在 size="sm" 的 Provider 里写 size="large" 的控件时,两者都要跟着降。
|
|
9
|
+
*/
|
|
10
|
+
export declare function naiveSizeHeights(size?: Size): {
|
|
11
|
+
heightSmall: string;
|
|
12
|
+
heightMedium: string;
|
|
13
|
+
heightLarge: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* naive-ui 没有 CSS 变量,主题必须通过 NConfigProvider 的 theme + themeOverrides。
|
|
17
|
+
* 因此 providerProps 是必需的;只调用 apply() 不会让暗色生效。
|
|
18
|
+
*/
|
|
19
|
+
export declare function naiveProviderProps(mode: ThemeMode, tokens: FbkTokens, size?: Size): {
|
|
20
|
+
theme: string;
|
|
21
|
+
themeOverrides: {
|
|
22
|
+
common: {
|
|
23
|
+
heightSmall: string;
|
|
24
|
+
heightMedium: string;
|
|
25
|
+
heightLarge: string;
|
|
26
|
+
primaryColor: string;
|
|
27
|
+
primaryColorHover: string;
|
|
28
|
+
primaryColorPressed: string;
|
|
29
|
+
successColor: string;
|
|
30
|
+
warningColor: string;
|
|
31
|
+
errorColor: string;
|
|
32
|
+
infoColor: string;
|
|
33
|
+
textColorBase: string;
|
|
34
|
+
textColor2: string;
|
|
35
|
+
textColor3: string;
|
|
36
|
+
bodyColor: string;
|
|
37
|
+
cardColor: string;
|
|
38
|
+
borderColor: string;
|
|
39
|
+
borderRadius: string;
|
|
40
|
+
fontFamily: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 按钮。element-plus 默认是 height 32 / padding 0 15px / font-weight 500,
|
|
44
|
+
* naive 是 height 34 / padding 0 14px / 400。三项都在 themeOverrides
|
|
45
|
+
* 里对齐,不靠 CSS —— naive 的按钮样式是运行时生成的,
|
|
46
|
+
* CSS 要 !important 才能赢,而那会让消费方无法再覆盖。
|
|
47
|
+
*/
|
|
48
|
+
Button: {
|
|
49
|
+
fontWeight: string;
|
|
50
|
+
fontWeightStrong: string;
|
|
51
|
+
paddingMedium: string;
|
|
52
|
+
paddingSmall: string;
|
|
53
|
+
paddingLarge: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 表单标签色。element-plus 用 --el-text-color-regular(次级文字色),
|
|
57
|
+
* naive 默认 textColor1(正文色)。对齐到次级色,标签与值才有层级差。
|
|
58
|
+
*/
|
|
59
|
+
Form: {
|
|
60
|
+
labelTextColor: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Tag 的状态配色必须在这里改,**不能靠 CSS**。
|
|
64
|
+
*
|
|
65
|
+
* naive 的 NTag 不输出状态 class —— 所有状态的 class 都只是 `n-tag`,
|
|
66
|
+
* 颜色完全靠行内的 --n-text-color / --n-color 区分。所以
|
|
67
|
+
* `.n-tag--warning { ... }` 命中不了任何元素,写了也只是看着像修好了。
|
|
68
|
+
*
|
|
69
|
+
* naive 默认是「状态色 + 12~15% 透明」:warning 实测
|
|
70
|
+
* #f0a020 on rgba(240,160,32,.15) = 1.93:1,连大字号标准 3.0 都不到。
|
|
71
|
+
* 根因是它把**填充色**当文字色用,而 tokens 早就把三者分开了。
|
|
72
|
+
*/
|
|
73
|
+
Tag: {
|
|
74
|
+
textColorSuccess: string;
|
|
75
|
+
colorSuccess: string;
|
|
76
|
+
borderSuccess: string;
|
|
77
|
+
textColorWarning: string;
|
|
78
|
+
colorWarning: string;
|
|
79
|
+
borderWarning: string;
|
|
80
|
+
textColorError: string;
|
|
81
|
+
colorError: string;
|
|
82
|
+
borderError: string;
|
|
83
|
+
textColorInfo: string;
|
|
84
|
+
colorInfo: string;
|
|
85
|
+
borderInfo: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* DataTable 走 themeOverrides 而不是 CSS:naive 的单元格颜色是
|
|
89
|
+
* 运行时生成的 --n-* 变量,themeOverrides 是唯一不会在小版本升级
|
|
90
|
+
* 时被内部类名变化打碎的入口。
|
|
91
|
+
*/
|
|
92
|
+
DataTable: {
|
|
93
|
+
thColor: string;
|
|
94
|
+
thTextColor: string;
|
|
95
|
+
tdColor: string;
|
|
96
|
+
tdTextColor: string;
|
|
97
|
+
borderColor: string;
|
|
98
|
+
tdColorHover: string;
|
|
99
|
+
borderRadius: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export declare const naiveTheme: ThemeBridge;
|
package/dist/theme.mjs
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { THEME_IS_DARK } from "@fbkworks/adapter-core";
|
|
2
|
+
import { cyberColorOverrides, darkColorOverrides } from "@fbkworks/tokens";
|
|
3
|
+
function isDark(mode) {
|
|
4
|
+
return mode === "system" ? false : THEME_IS_DARK[mode];
|
|
5
|
+
}
|
|
6
|
+
function resolveTokens(mode, tokens) {
|
|
7
|
+
if (mode === "cyber") {
|
|
8
|
+
return { ...tokens, color: { ...tokens.color, ...cyberColorOverrides } };
|
|
9
|
+
}
|
|
10
|
+
if (!isDark(mode)) return tokens;
|
|
11
|
+
return { ...tokens, color: { ...tokens.color, ...darkColorOverrides } };
|
|
12
|
+
}
|
|
13
|
+
const SIZE_SCALE = { sm: 0.75, md: 1, lg: 1.25 };
|
|
14
|
+
const HEIGHTS_MD = { heightSmall: 28, heightMedium: 32, heightLarge: 40 };
|
|
15
|
+
const toPx = (value) => `${Number.isInteger(value) ? value : Number(value.toFixed(2))}px`;
|
|
16
|
+
function naiveSizeHeights(size = "md") {
|
|
17
|
+
const scale = SIZE_SCALE[size] ?? 1;
|
|
18
|
+
return {
|
|
19
|
+
heightSmall: toPx(HEIGHTS_MD.heightSmall * scale),
|
|
20
|
+
heightMedium: toPx(HEIGHTS_MD.heightMedium * scale),
|
|
21
|
+
heightLarge: toPx(HEIGHTS_MD.heightLarge * scale)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function naiveProviderProps(mode, tokens, size = "md") {
|
|
25
|
+
const t = resolveTokens(mode, tokens);
|
|
26
|
+
return {
|
|
27
|
+
theme: isDark(mode) ? "dark" : "light",
|
|
28
|
+
themeOverrides: {
|
|
29
|
+
common: {
|
|
30
|
+
primaryColor: t.color.primary,
|
|
31
|
+
primaryColorHover: t.color.primaryHover,
|
|
32
|
+
primaryColorPressed: t.color.primaryActive,
|
|
33
|
+
successColor: t.color.success,
|
|
34
|
+
warningColor: t.color.warning,
|
|
35
|
+
errorColor: t.color.danger,
|
|
36
|
+
infoColor: t.color.info,
|
|
37
|
+
textColorBase: t.color.text,
|
|
38
|
+
textColor2: t.color.textSecondary,
|
|
39
|
+
textColor3: t.color.textDisabled,
|
|
40
|
+
bodyColor: t.color.bg,
|
|
41
|
+
cardColor: t.color.bgContainer,
|
|
42
|
+
borderColor: t.color.border,
|
|
43
|
+
borderRadius: t.radius.md,
|
|
44
|
+
fontFamily: t.font.family,
|
|
45
|
+
/* 注意:这里**不设** fontSize。
|
|
46
|
+
naive 的 NConfigProvider 会把 common.fontSize 写成根节点的
|
|
47
|
+
font-size,而 element-plus 不注入字号。设了它,同一个组件在
|
|
48
|
+
两个适配器下就会继承到不同的基准字号(14 vs 16),
|
|
49
|
+
行高、内边距全线错位。字号由组件样式自己声明(见各 style.css)。 */
|
|
50
|
+
/**
|
|
51
|
+
* 控件高度对齐 element-plus,并由 provider 的 size 缩放。
|
|
52
|
+
*
|
|
53
|
+
* naive 默认 heightMedium = 34px,element-plus 默认尺寸是 32px。
|
|
54
|
+
* 同一个 QueryForm 在两个适配器下输入框差 2px,整行跟着错位。
|
|
55
|
+
* md 档保持 28/32/40 —— 与引入 size 之前逐像素一致。
|
|
56
|
+
*/
|
|
57
|
+
...naiveSizeHeights(size)
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* 按钮。element-plus 默认是 height 32 / padding 0 15px / font-weight 500,
|
|
61
|
+
* naive 是 height 34 / padding 0 14px / 400。三项都在 themeOverrides
|
|
62
|
+
* 里对齐,不靠 CSS —— naive 的按钮样式是运行时生成的,
|
|
63
|
+
* CSS 要 !important 才能赢,而那会让消费方无法再覆盖。
|
|
64
|
+
*/
|
|
65
|
+
Button: {
|
|
66
|
+
fontWeight: t.font.weightMedium,
|
|
67
|
+
fontWeightStrong: t.font.weightSemibold,
|
|
68
|
+
paddingMedium: "0 15px",
|
|
69
|
+
paddingSmall: "0 11px",
|
|
70
|
+
paddingLarge: "0 19px"
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* 表单标签色。element-plus 用 --el-text-color-regular(次级文字色),
|
|
74
|
+
* naive 默认 textColor1(正文色)。对齐到次级色,标签与值才有层级差。
|
|
75
|
+
*/
|
|
76
|
+
Form: {
|
|
77
|
+
labelTextColor: t.color.textSecondary
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Tag 的状态配色必须在这里改,**不能靠 CSS**。
|
|
81
|
+
*
|
|
82
|
+
* naive 的 NTag 不输出状态 class —— 所有状态的 class 都只是 `n-tag`,
|
|
83
|
+
* 颜色完全靠行内的 --n-text-color / --n-color 区分。所以
|
|
84
|
+
* `.n-tag--warning { ... }` 命中不了任何元素,写了也只是看着像修好了。
|
|
85
|
+
*
|
|
86
|
+
* naive 默认是「状态色 + 12~15% 透明」:warning 实测
|
|
87
|
+
* #f0a020 on rgba(240,160,32,.15) = 1.93:1,连大字号标准 3.0 都不到。
|
|
88
|
+
* 根因是它把**填充色**当文字色用,而 tokens 早就把三者分开了。
|
|
89
|
+
*/
|
|
90
|
+
Tag: {
|
|
91
|
+
textColorSuccess: t.color.successText,
|
|
92
|
+
colorSuccess: t.color.successBg,
|
|
93
|
+
borderSuccess: "1px solid transparent",
|
|
94
|
+
textColorWarning: t.color.warningText,
|
|
95
|
+
colorWarning: t.color.warningBg,
|
|
96
|
+
borderWarning: "1px solid transparent",
|
|
97
|
+
textColorError: t.color.dangerText,
|
|
98
|
+
colorError: t.color.dangerBg,
|
|
99
|
+
borderError: "1px solid transparent",
|
|
100
|
+
textColorInfo: t.color.infoText,
|
|
101
|
+
colorInfo: t.color.infoBg,
|
|
102
|
+
borderInfo: "1px solid transparent"
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* DataTable 走 themeOverrides 而不是 CSS:naive 的单元格颜色是
|
|
106
|
+
* 运行时生成的 --n-* 变量,themeOverrides 是唯一不会在小版本升级
|
|
107
|
+
* 时被内部类名变化打碎的入口。
|
|
108
|
+
*/
|
|
109
|
+
DataTable: {
|
|
110
|
+
thColor: t.color.bgSunken,
|
|
111
|
+
thTextColor: t.color.text,
|
|
112
|
+
tdColor: t.color.bgContainer,
|
|
113
|
+
tdTextColor: t.color.text,
|
|
114
|
+
borderColor: t.color.borderLight,
|
|
115
|
+
tdColorHover: t.color.primaryBg,
|
|
116
|
+
borderRadius: t.radius.lg
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const naiveTheme = {
|
|
122
|
+
apply(mode) {
|
|
123
|
+
if (typeof document === "undefined") return;
|
|
124
|
+
document.documentElement.setAttribute("data-fbk-theme", mode);
|
|
125
|
+
},
|
|
126
|
+
providerProps: (mode, tokens) => naiveProviderProps(mode, tokens)
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
naiveProviderProps,
|
|
130
|
+
naiveSizeHeights,
|
|
131
|
+
naiveTheme
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=theme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.mjs","sources":["../src/theme.ts"],"sourcesContent":["import type { Size, ThemeBridge, ThemeMode } from '@fbkworks/adapter-core'\nimport { THEME_IS_DARK } from '@fbkworks/adapter-core'\nimport { cyberColorOverrides, darkColorOverrides } from '@fbkworks/tokens'\nimport type { FbkTokens } from '@fbkworks/tokens'\n\n/**\n * 按模式取令牌。naive 的暗色走 theme=\"dark\",但 themeOverrides 里的颜色\n * 必须也跟着换 —— 否则 override 会把 naive 自己的暗色值盖回浅色。\n *\n * cyber 归到 dark 处理:naive 只认识 light / dark 两个 theme,\n * 它没有「风格」这个概念。cyber 的青色主色通过 themeOverrides 里的\n * primaryColor 系列注入,底色则继续由 cyber.css 的 CSS 变量承担\n * (naive 的 DataTable/Tag 走 themeOverrides,其余 fbk-* 元素走 CSS 变量)。\n */\nfunction isDark(mode: ThemeMode): boolean {\n return mode === 'system' ? false : THEME_IS_DARK[mode]\n}\n\nfunction resolveTokens(mode: ThemeMode, tokens: FbkTokens): FbkTokens {\n // cyber 有自己的青色色板;不注入的话 naive 的按钮/表格仍是默认蓝\n if (mode === 'cyber') {\n return { ...tokens, color: { ...tokens.color, ...cyberColorOverrides } }\n }\n if (!isDark(mode)) return tokens\n return { ...tokens, color: { ...tokens.color, ...darkColorOverrides } }\n}\n\n/**\n * provider size 的比例尺。三个适配器共用同一套相对关系:\n * md 是基准,sm 是它的 0.75 倍,lg 是 1.25 倍 ——\n * element-plus 的 small/default/large 正好是 24/32/40px。\n */\nconst SIZE_SCALE: Record<Size, number> = { sm: 0.75, md: 1, lg: 1.25 }\n\n/** 控件高度阶梯的 md 档,与下面 common 里的默认值同源 */\nconst HEIGHTS_MD = { heightSmall: 28, heightMedium: 32, heightLarge: 40 } as const\n\nconst toPx = (value: number) => `${Number.isInteger(value) ? value : Number(value.toFixed(2))}px`\n\n/**\n * size 在 naive 下只能落在这一处:naive-ui 2.45 的 NConfigProvider 没有 size\n * 能力(props 里只有 theme / themeOverrides / componentOptions / locale 等),\n * themeOverrides.common.height* 是唯一的中枢 —— 它会写成每个控件行内的\n * --n-height,控件自身的 CSS 读的就是这个变量。整体缩放而不是只改一档:\n * 业务方在 size=\"sm\" 的 Provider 里写 size=\"large\" 的控件时,两者都要跟着降。\n */\nexport function naiveSizeHeights(size: Size = 'md'): {\n heightSmall: string\n heightMedium: string\n heightLarge: string\n} {\n const scale = SIZE_SCALE[size] ?? 1\n return {\n heightSmall: toPx(HEIGHTS_MD.heightSmall * scale),\n heightMedium: toPx(HEIGHTS_MD.heightMedium * scale),\n heightLarge: toPx(HEIGHTS_MD.heightLarge * scale),\n }\n}\n\n/**\n * naive-ui 没有 CSS 变量,主题必须通过 NConfigProvider 的 theme + themeOverrides。\n * 因此 providerProps 是必需的;只调用 apply() 不会让暗色生效。\n */\nexport function naiveProviderProps(mode: ThemeMode, tokens: FbkTokens, size: Size = 'md') {\n const t = resolveTokens(mode, tokens)\n\n return {\n theme: isDark(mode) ? 'dark' : 'light',\n themeOverrides: {\n common: {\n primaryColor: t.color.primary,\n primaryColorHover: t.color.primaryHover,\n primaryColorPressed: t.color.primaryActive,\n successColor: t.color.success,\n warningColor: t.color.warning,\n errorColor: t.color.danger,\n infoColor: t.color.info,\n textColorBase: t.color.text,\n textColor2: t.color.textSecondary,\n textColor3: t.color.textDisabled,\n bodyColor: t.color.bg,\n cardColor: t.color.bgContainer,\n borderColor: t.color.border,\n borderRadius: t.radius.md,\n fontFamily: t.font.family,\n /* 注意:这里**不设** fontSize。\n naive 的 NConfigProvider 会把 common.fontSize 写成根节点的\n font-size,而 element-plus 不注入字号。设了它,同一个组件在\n 两个适配器下就会继承到不同的基准字号(14 vs 16),\n 行高、内边距全线错位。字号由组件样式自己声明(见各 style.css)。 */\n\n /**\n * 控件高度对齐 element-plus,并由 provider 的 size 缩放。\n *\n * naive 默认 heightMedium = 34px,element-plus 默认尺寸是 32px。\n * 同一个 QueryForm 在两个适配器下输入框差 2px,整行跟着错位。\n * md 档保持 28/32/40 —— 与引入 size 之前逐像素一致。\n */\n ...naiveSizeHeights(size),\n },\n\n /**\n * 按钮。element-plus 默认是 height 32 / padding 0 15px / font-weight 500,\n * naive 是 height 34 / padding 0 14px / 400。三项都在 themeOverrides\n * 里对齐,不靠 CSS —— naive 的按钮样式是运行时生成的,\n * CSS 要 !important 才能赢,而那会让消费方无法再覆盖。\n */\n Button: {\n fontWeight: t.font.weightMedium,\n fontWeightStrong: t.font.weightSemibold,\n paddingMedium: '0 15px',\n paddingSmall: '0 11px',\n paddingLarge: '0 19px',\n },\n\n /**\n * 表单标签色。element-plus 用 --el-text-color-regular(次级文字色),\n * naive 默认 textColor1(正文色)。对齐到次级色,标签与值才有层级差。\n */\n Form: {\n labelTextColor: t.color.textSecondary,\n },\n\n /**\n * Tag 的状态配色必须在这里改,**不能靠 CSS**。\n *\n * naive 的 NTag 不输出状态 class —— 所有状态的 class 都只是 `n-tag`,\n * 颜色完全靠行内的 --n-text-color / --n-color 区分。所以\n * `.n-tag--warning { ... }` 命中不了任何元素,写了也只是看着像修好了。\n *\n * naive 默认是「状态色 + 12~15% 透明」:warning 实测\n * #f0a020 on rgba(240,160,32,.15) = 1.93:1,连大字号标准 3.0 都不到。\n * 根因是它把**填充色**当文字色用,而 tokens 早就把三者分开了。\n */\n Tag: {\n textColorSuccess: t.color.successText,\n colorSuccess: t.color.successBg,\n borderSuccess: '1px solid transparent',\n\n textColorWarning: t.color.warningText,\n colorWarning: t.color.warningBg,\n borderWarning: '1px solid transparent',\n\n textColorError: t.color.dangerText,\n colorError: t.color.dangerBg,\n borderError: '1px solid transparent',\n\n textColorInfo: t.color.infoText,\n colorInfo: t.color.infoBg,\n borderInfo: '1px solid transparent',\n },\n\n /**\n * DataTable 走 themeOverrides 而不是 CSS:naive 的单元格颜色是\n * 运行时生成的 --n-* 变量,themeOverrides 是唯一不会在小版本升级\n * 时被内部类名变化打碎的入口。\n */\n DataTable: {\n thColor: t.color.bgSunken,\n thTextColor: t.color.text,\n tdColor: t.color.bgContainer,\n tdTextColor: t.color.text,\n borderColor: t.color.borderLight,\n tdColorHover: t.color.primaryBg,\n borderRadius: t.radius.lg,\n },\n },\n }\n}\n\nexport const naiveTheme: ThemeBridge = {\n apply(mode) {\n if (typeof document === 'undefined') return\n document.documentElement.setAttribute('data-fbk-theme', mode)\n },\n providerProps: (mode, tokens) => naiveProviderProps(mode, tokens),\n}\n"],"names":[],"mappings":"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"}
|