@dsh-plugin/dsh-ui-components 0.0.1 → 0.1.0-dev.43616582648
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 -21
- package/NOTICE +21 -21
- package/README.md +136 -136
- package/README.zh_CN.md +136 -136
- package/docs/tokens.md +67 -67
- package/lib/basic/form.js +49 -49
- package/lib/basic/styles.js +391 -391
- package/lib/composites/styles.js +427 -427
- package/lib/data/styles.js +257 -257
- package/lib/display/styles.js +310 -310
- package/lib/feedback/styles.js +228 -228
- package/lib/foundation/bridge.js +203 -203
- package/lib/navigation/styles.js +417 -417
- package/package.json +104 -104
- package/scripts/check-size.mjs +69 -69
- package/scripts/dump-npm-latest.mjs +59 -59
- package/scripts/gen-host-tokens.mjs +61 -61
- package/scripts/gen-icons.mjs +188 -178
- package/scripts/verify-no-literal-colors.mjs +63 -63
- package/scripts/verify-tokens.mjs +135 -135
- package/src/basic/button.tsx +76 -76
- package/src/basic/form.tsx +187 -187
- package/src/basic/icon-button.tsx +66 -66
- package/src/basic/index.ts +38 -38
- package/src/basic/input.tsx +140 -140
- package/src/basic/select.tsx +120 -120
- package/src/basic/styles.ts +412 -412
- package/src/basic/toggle.tsx +116 -116
- package/src/composites/data-view.tsx +189 -189
- package/src/composites/index.ts +11 -11
- package/src/composites/indicator.tsx +90 -90
- package/src/composites/menu-select.tsx +230 -230
- package/src/composites/panel.tsx +72 -72
- package/src/composites/settings.tsx +80 -80
- package/src/composites/styles.ts +450 -450
- package/src/data/collection.tsx +71 -71
- package/src/data/index.ts +39 -39
- package/src/data/info.tsx +89 -89
- package/src/data/picker.tsx +113 -113
- package/src/data/styles.ts +278 -278
- package/src/display/container.tsx +67 -67
- package/src/display/feedback.tsx +92 -92
- package/src/display/index.ts +44 -44
- package/src/display/label.tsx +165 -165
- package/src/display/overlay.tsx +103 -103
- package/src/display/styles.ts +332 -332
- package/src/feedback/global.tsx +110 -110
- package/src/feedback/index.ts +19 -19
- package/src/feedback/inline.tsx +50 -50
- package/src/feedback/panel.tsx +93 -93
- package/src/feedback/styles.ts +250 -250
- package/src/foundation/bridge.ts +318 -318
- package/src/foundation/icons.tsx +315 -315
- package/src/foundation/index.ts +33 -33
- package/src/foundation/palette.ts +153 -153
- package/src/foundation/provider.tsx +62 -62
- package/src/foundation/style.ts +63 -63
- package/src/foundation/tokens.ts +62 -62
- package/src/index.ts +18 -18
- package/src/navigation/hierarchy.tsx +82 -82
- package/src/navigation/index.ts +21 -21
- package/src/navigation/indicator.tsx +125 -125
- package/src/navigation/menu.tsx +94 -94
- package/src/navigation/segmented.tsx +136 -136
- package/src/navigation/styles.ts +438 -438
package/src/composites/styles.ts
CHANGED
|
@@ -1,450 +1,450 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DSH 专属组合件样式。
|
|
3
|
-
*
|
|
4
|
-
* 这一层是相对直接用 Arco 的主要增量:设置页卡片、弹出层外壳、与宿主一致
|
|
5
|
-
* 的下拉选择器、JSON 树与文件类型徽标。全部由前几批的原子组件与令牌组合,
|
|
6
|
-
* 不引入新依赖。
|
|
7
|
-
*
|
|
8
|
-
* @module @dsh-plugin/dsh-ui-components/composites/styles
|
|
9
|
-
*/
|
|
10
|
-
import { injectUiStyle } from '../foundation/style.js'
|
|
11
|
-
import { G } from '../foundation/tokens.js'
|
|
12
|
-
|
|
13
|
-
/** DSH 专属组合件样式表。 */
|
|
14
|
-
export const COMPOSITES_CSS = `
|
|
15
|
-
/* ── 设置页卡片 ─────────────────────────────────────────────────── */
|
|
16
|
-
.dsh-settings-card {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 16px;
|
|
20
|
-
padding: 16px;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
border-radius: var(--dsw-radius-xl, 20px);
|
|
23
|
-
background-color: var(--dsw-alias-settings-card-fill, var(--dsw-alias-bg-layer-2));
|
|
24
|
-
border: 0.5px solid var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l4));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.dsh-settings-card__title {
|
|
28
|
-
margin: 0;
|
|
29
|
-
font-size: 15px;
|
|
30
|
-
line-height: 22px;
|
|
31
|
-
font-weight: 500;
|
|
32
|
-
color: var(--dsw-alias-label-primary);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.dsh-settings-card__desc {
|
|
36
|
-
font-size: 13px;
|
|
37
|
-
line-height: 20px;
|
|
38
|
-
color: var(--dsw-alias-label-tertiary);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.dsh-settings-card__body {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
min-width: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.dsh-settings-card__footer {
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: 8px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* ── 设置行 ─────────────────────────────────────────────────────── */
|
|
55
|
-
.dsh-settings-row {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: space-between;
|
|
59
|
-
gap: 16px;
|
|
60
|
-
min-width: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.dsh-settings-row--stack {
|
|
64
|
-
flex-direction: column;
|
|
65
|
-
align-items: stretch;
|
|
66
|
-
gap: 6px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.dsh-settings-row__text {
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
gap: 2px;
|
|
73
|
-
min-width: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.dsh-settings-row__label {
|
|
77
|
-
font-size: 13px;
|
|
78
|
-
line-height: 20px;
|
|
79
|
-
font-weight: 500;
|
|
80
|
-
color: var(--dsw-alias-label-secondary);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.dsh-settings-row__desc {
|
|
84
|
-
font-size: 12px;
|
|
85
|
-
line-height: 18px;
|
|
86
|
-
color: var(--dsw-alias-label-tertiary);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.dsh-settings-row__control {
|
|
90
|
-
flex: none;
|
|
91
|
-
min-width: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.dsh-settings-row--stack .dsh-settings-row__control {
|
|
95
|
-
flex: 1 1 auto;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* ── 弹出层外壳 ─────────────────────────────────────────────────── */
|
|
99
|
-
.dsh-panel-shell {
|
|
100
|
-
position: fixed;
|
|
101
|
-
inset: 0;
|
|
102
|
-
z-index: 1000;
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
padding: ${G.overlayMargin}px 24px;
|
|
107
|
-
box-sizing: border-box;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.dsh-panel-shell__mask {
|
|
111
|
-
position: absolute;
|
|
112
|
-
inset: 0;
|
|
113
|
-
background-color: var(--dsw-alias-bg-mask-1);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.dsh-panel-shell__card {
|
|
117
|
-
position: relative;
|
|
118
|
-
z-index: 1;
|
|
119
|
-
display: flex;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
width: min(560px, 100%);
|
|
122
|
-
max-height: calc(100dvh - ${G.overlayMargin * 2}px);
|
|
123
|
-
border-radius: var(--dsw-radius-panel, 28px);
|
|
124
|
-
border: 0;
|
|
125
|
-
background-color: var(--dsw-alias-bg-layer-2);
|
|
126
|
-
box-shadow: var(--dsw-elevation-prominent);
|
|
127
|
-
overflow: hidden;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.dsh-panel-shell__header {
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
justify-content: space-between;
|
|
134
|
-
gap: 12px;
|
|
135
|
-
flex: none;
|
|
136
|
-
padding: 20px 24px 14px;
|
|
137
|
-
border-bottom: 0.5px solid var(--dsw-alias-border-l1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.dsh-panel-shell__title {
|
|
141
|
-
margin: 0;
|
|
142
|
-
font-size: 16px;
|
|
143
|
-
line-height: 24px;
|
|
144
|
-
font-weight: 500;
|
|
145
|
-
color: var(--dsw-alias-label-primary);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.dsh-panel-shell__body {
|
|
149
|
-
flex: 1 1 auto;
|
|
150
|
-
min-height: 0;
|
|
151
|
-
padding: 16px 24px;
|
|
152
|
-
overflow: hidden;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.dsh-panel-shell__footer {
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
justify-content: flex-end;
|
|
159
|
-
gap: 8px;
|
|
160
|
-
flex: none;
|
|
161
|
-
padding: 14px 24px;
|
|
162
|
-
border-top: 0.5px solid var(--dsw-alias-border-l1);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* ── 宿主风格下拉 ───────────────────────────────────────────────── */
|
|
166
|
-
.dsh-menu-select {
|
|
167
|
-
position: relative;
|
|
168
|
-
width: 100%;
|
|
169
|
-
min-width: 0;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.dsh-menu-select__trigger {
|
|
173
|
-
display: flex;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: space-between;
|
|
176
|
-
gap: 8px;
|
|
177
|
-
width: 100%;
|
|
178
|
-
box-sizing: border-box;
|
|
179
|
-
min-height: 32px;
|
|
180
|
-
padding: 5px 11px;
|
|
181
|
-
font-family: inherit;
|
|
182
|
-
font-size: 14px;
|
|
183
|
-
line-height: 20px;
|
|
184
|
-
text-align: left;
|
|
185
|
-
color: var(--dsw-alias-label-primary);
|
|
186
|
-
background-color: var(--dsw-alias-bg-layer-1);
|
|
187
|
-
border: 0.5px solid var(--dsw-alias-border-l4);
|
|
188
|
-
border-radius: var(--dsw-radius-md, 12px);
|
|
189
|
-
cursor: pointer;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.dsh-menu-select__trigger:disabled {
|
|
193
|
-
opacity: 0.45;
|
|
194
|
-
cursor: not-allowed;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.dsh-menu-select__trigger:focus-visible {
|
|
198
|
-
outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-alias-state-business-primary);
|
|
199
|
-
outline-offset: 2px;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.dsh-menu-select__text {
|
|
203
|
-
min-width: 0;
|
|
204
|
-
overflow: hidden;
|
|
205
|
-
text-overflow: ellipsis;
|
|
206
|
-
white-space: nowrap;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.dsh-menu-select__text--placeholder {
|
|
210
|
-
color: var(--dsw-alias-label-dimmed);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.dsh-menu-select__caret {
|
|
214
|
-
display: inline-flex;
|
|
215
|
-
flex: none;
|
|
216
|
-
align-items: center;
|
|
217
|
-
color: var(--dsw-alias-label-tertiary);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.dsh-menu-select__popup {
|
|
221
|
-
position: absolute;
|
|
222
|
-
left: 0;
|
|
223
|
-
right: 0;
|
|
224
|
-
z-index: 1050;
|
|
225
|
-
margin-top: 4px;
|
|
226
|
-
max-height: 264px;
|
|
227
|
-
overflow: auto;
|
|
228
|
-
padding: 4px;
|
|
229
|
-
border-radius: var(--dsw-radius-lg, 16px);
|
|
230
|
-
background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));
|
|
231
|
-
backdrop-filter: var(--dsw-menu-backdrop-filter, none);
|
|
232
|
-
box-shadow: var(--dsw-elevation-panel);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.dsh-menu-select__popup--above {
|
|
236
|
-
margin-top: 0;
|
|
237
|
-
margin-bottom: 4px;
|
|
238
|
-
bottom: 100%;
|
|
239
|
-
top: auto;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.dsh-menu-select__option {
|
|
243
|
-
display: flex;
|
|
244
|
-
align-items: center;
|
|
245
|
-
gap: 8px;
|
|
246
|
-
width: 100%;
|
|
247
|
-
box-sizing: border-box;
|
|
248
|
-
min-height: 32px;
|
|
249
|
-
padding: 5px 10px;
|
|
250
|
-
border: 0;
|
|
251
|
-
border-radius: var(--dsw-radius-sm, 8px);
|
|
252
|
-
background: none;
|
|
253
|
-
font-family: inherit;
|
|
254
|
-
font-size: 14px;
|
|
255
|
-
line-height: 22px;
|
|
256
|
-
text-align: left;
|
|
257
|
-
color: var(--dsw-alias-label-primary);
|
|
258
|
-
cursor: pointer;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@media (hover: hover) {
|
|
262
|
-
.dsh-menu-select__option:hover:not(:disabled) {
|
|
263
|
-
background-color: var(--dsw-alias-interactive-bg-hover);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.dsh-menu-select__option--selected {
|
|
268
|
-
background-color: var(--dsw-alias-button-ghost-active-fill);
|
|
269
|
-
font-weight: 500;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.dsh-menu-select__option:disabled {
|
|
273
|
-
color: var(--dsw-alias-label-caption);
|
|
274
|
-
cursor: not-allowed;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.dsh-menu-select__check {
|
|
278
|
-
margin-left: auto;
|
|
279
|
-
display: inline-flex;
|
|
280
|
-
color: var(--dsw-alias-label-secondary);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/* ── JSON 树 ────────────────────────────────────────────────────── */
|
|
284
|
-
.dsh-json-tree {
|
|
285
|
-
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
286
|
-
font-size: 12px;
|
|
287
|
-
line-height: 20px;
|
|
288
|
-
color: var(--dsw-alias-json-tree-punctuation, var(--dsw-alias-label-primary));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.dsh-json-tree__row {
|
|
292
|
-
display: flex;
|
|
293
|
-
align-items: baseline;
|
|
294
|
-
gap: 4px;
|
|
295
|
-
min-width: 0;
|
|
296
|
-
padding: 0 4px;
|
|
297
|
-
border-radius: var(--dsw-radius-xs, 4px);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.dsh-json-tree__toggle {
|
|
301
|
-
display: inline-flex;
|
|
302
|
-
align-items: center;
|
|
303
|
-
justify-content: center;
|
|
304
|
-
width: 14px;
|
|
305
|
-
height: 14px;
|
|
306
|
-
flex: none;
|
|
307
|
-
padding: 0;
|
|
308
|
-
border: 0;
|
|
309
|
-
background: none;
|
|
310
|
-
color: var(--dsw-alias-json-tree-icon, var(--dsw-alias-label-tertiary));
|
|
311
|
-
cursor: pointer;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.dsh-json-tree__key {
|
|
315
|
-
color: var(--dsw-alias-json-tree-property, var(--dsw-alias-label-secondary));
|
|
316
|
-
white-space: pre;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.dsh-json-tree__string {
|
|
320
|
-
color: var(--dsw-alias-json-tree-string, var(--dsw-alias-label-primary));
|
|
321
|
-
word-break: break-all;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.dsh-json-tree__number {
|
|
325
|
-
color: var(--dsw-alias-json-tree-number, var(--dsw-alias-label-primary));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.dsh-json-tree__keyword {
|
|
329
|
-
color: var(--dsw-alias-json-tree-keyword, var(--dsw-alias-label-primary));
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.dsh-json-tree__punct {
|
|
333
|
-
color: var(--dsw-alias-json-tree-punctuation, var(--dsw-alias-label-tertiary));
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.dsh-json-tree__children {
|
|
337
|
-
margin-left: 8px;
|
|
338
|
-
border-left: 0.5px solid var(--dsw-alias-border-l1);
|
|
339
|
-
padding-left: 8px;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.dsh-json-tree__summary {
|
|
343
|
-
color: var(--dsw-alias-json-tree-icon, var(--dsw-alias-label-tertiary));
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/* ── 代码块外壳 ─────────────────────────────────────────────────── */
|
|
347
|
-
.dsh-code-shell {
|
|
348
|
-
display: flex;
|
|
349
|
-
flex-direction: column;
|
|
350
|
-
border-radius: var(--dsw-radius-lg, 16px);
|
|
351
|
-
background-color: var(--dsw-alias-markdown-code-block);
|
|
352
|
-
overflow: hidden;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.dsh-code-shell__banner {
|
|
356
|
-
display: flex;
|
|
357
|
-
align-items: center;
|
|
358
|
-
justify-content: space-between;
|
|
359
|
-
gap: 8px;
|
|
360
|
-
flex: none;
|
|
361
|
-
padding: 6px 12px;
|
|
362
|
-
background-color: var(--dsw-alias-markdown-code-block-banner);
|
|
363
|
-
font-size: 12px;
|
|
364
|
-
line-height: 18px;
|
|
365
|
-
color: var(--dsw-alias-label-tertiary);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.dsh-code-shell__lang {
|
|
369
|
-
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.dsh-code-shell__actions {
|
|
373
|
-
display: flex;
|
|
374
|
-
align-items: center;
|
|
375
|
-
gap: 4px;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.dsh-code-shell__body {
|
|
379
|
-
min-height: 0;
|
|
380
|
-
padding: 10px 12px;
|
|
381
|
-
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
382
|
-
font-size: 12px;
|
|
383
|
-
line-height: 20px;
|
|
384
|
-
color: var(--dsw-alias-label-primary);
|
|
385
|
-
overflow: auto;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.dsh-code-shell__body pre {
|
|
389
|
-
margin: 0;
|
|
390
|
-
white-space: pre;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/* ── 文件类型徽标 ───────────────────────────────────────────────── */
|
|
394
|
-
.dsh-file-badge {
|
|
395
|
-
display: inline-flex;
|
|
396
|
-
align-items: center;
|
|
397
|
-
justify-content: center;
|
|
398
|
-
flex: none;
|
|
399
|
-
min-width: 24px;
|
|
400
|
-
height: 16px;
|
|
401
|
-
padding: 0 5px;
|
|
402
|
-
border-radius: var(--dsw-radius-xs, 4px);
|
|
403
|
-
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
404
|
-
font-size: 10px;
|
|
405
|
-
line-height: 16px;
|
|
406
|
-
font-weight: 500;
|
|
407
|
-
text-transform: uppercase;
|
|
408
|
-
background-color: var(--dsw-alias-bg-module-platform);
|
|
409
|
-
color: var(--dsw-alias-label-tertiary);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/* ── 状态行 ─────────────────────────────────────────────────────── */
|
|
413
|
-
.dsh-status-line {
|
|
414
|
-
display: inline-flex;
|
|
415
|
-
align-items: center;
|
|
416
|
-
gap: 6px;
|
|
417
|
-
min-width: 0;
|
|
418
|
-
font-size: 13px;
|
|
419
|
-
line-height: 20px;
|
|
420
|
-
color: var(--dsw-alias-label-tertiary);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.dsh-status-line__text {
|
|
424
|
-
min-width: 0;
|
|
425
|
-
overflow: hidden;
|
|
426
|
-
text-overflow: ellipsis;
|
|
427
|
-
white-space: nowrap;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.dsh-status-line__time {
|
|
431
|
-
flex: none;
|
|
432
|
-
font-variant-numeric: tabular-nums;
|
|
433
|
-
color: var(--dsw-alias-label-caption);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
@media (prefers-reduced-motion: reduce) {
|
|
437
|
-
.dsh-menu-select__popup {
|
|
438
|
-
animation: none;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
`
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* 注入 DSH 专属组合件样式。幂等。
|
|
445
|
-
*
|
|
446
|
-
* @returns 释放函数。
|
|
447
|
-
*/
|
|
448
|
-
export function injectCompositeStyles(): () => void {
|
|
449
|
-
return injectUiStyle('composites/components.css', COMPOSITES_CSS)
|
|
450
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* DSH 专属组合件样式。
|
|
3
|
+
*
|
|
4
|
+
* 这一层是相对直接用 Arco 的主要增量:设置页卡片、弹出层外壳、与宿主一致
|
|
5
|
+
* 的下拉选择器、JSON 树与文件类型徽标。全部由前几批的原子组件与令牌组合,
|
|
6
|
+
* 不引入新依赖。
|
|
7
|
+
*
|
|
8
|
+
* @module @dsh-plugin/dsh-ui-components/composites/styles
|
|
9
|
+
*/
|
|
10
|
+
import { injectUiStyle } from '../foundation/style.js'
|
|
11
|
+
import { G } from '../foundation/tokens.js'
|
|
12
|
+
|
|
13
|
+
/** DSH 专属组合件样式表。 */
|
|
14
|
+
export const COMPOSITES_CSS = `
|
|
15
|
+
/* ── 设置页卡片 ─────────────────────────────────────────────────── */
|
|
16
|
+
.dsh-settings-card {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: 16px;
|
|
20
|
+
padding: 16px;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
border-radius: var(--dsw-radius-xl, 20px);
|
|
23
|
+
background-color: var(--dsw-alias-settings-card-fill, var(--dsw-alias-bg-layer-2));
|
|
24
|
+
border: 0.5px solid var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l4));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dsh-settings-card__title {
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-size: 15px;
|
|
30
|
+
line-height: 22px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
color: var(--dsw-alias-label-primary);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dsh-settings-card__desc {
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
line-height: 20px;
|
|
38
|
+
color: var(--dsw-alias-label-tertiary);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dsh-settings-card__body {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: 16px;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dsh-settings-card__footer {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ── 设置行 ─────────────────────────────────────────────────────── */
|
|
55
|
+
.dsh-settings-row {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: space-between;
|
|
59
|
+
gap: 16px;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dsh-settings-row--stack {
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
align-items: stretch;
|
|
66
|
+
gap: 6px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.dsh-settings-row__text {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 2px;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dsh-settings-row__label {
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
line-height: 20px;
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
color: var(--dsw-alias-label-secondary);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.dsh-settings-row__desc {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
line-height: 18px;
|
|
86
|
+
color: var(--dsw-alias-label-tertiary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dsh-settings-row__control {
|
|
90
|
+
flex: none;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.dsh-settings-row--stack .dsh-settings-row__control {
|
|
95
|
+
flex: 1 1 auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ── 弹出层外壳 ─────────────────────────────────────────────────── */
|
|
99
|
+
.dsh-panel-shell {
|
|
100
|
+
position: fixed;
|
|
101
|
+
inset: 0;
|
|
102
|
+
z-index: 1000;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
padding: ${G.overlayMargin}px 24px;
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dsh-panel-shell__mask {
|
|
111
|
+
position: absolute;
|
|
112
|
+
inset: 0;
|
|
113
|
+
background-color: var(--dsw-alias-bg-mask-1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dsh-panel-shell__card {
|
|
117
|
+
position: relative;
|
|
118
|
+
z-index: 1;
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
width: min(560px, 100%);
|
|
122
|
+
max-height: calc(100dvh - ${G.overlayMargin * 2}px);
|
|
123
|
+
border-radius: var(--dsw-radius-panel, 28px);
|
|
124
|
+
border: 0;
|
|
125
|
+
background-color: var(--dsw-alias-bg-layer-2);
|
|
126
|
+
box-shadow: var(--dsw-elevation-prominent);
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.dsh-panel-shell__header {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: space-between;
|
|
134
|
+
gap: 12px;
|
|
135
|
+
flex: none;
|
|
136
|
+
padding: 20px 24px 14px;
|
|
137
|
+
border-bottom: 0.5px solid var(--dsw-alias-border-l1);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.dsh-panel-shell__title {
|
|
141
|
+
margin: 0;
|
|
142
|
+
font-size: 16px;
|
|
143
|
+
line-height: 24px;
|
|
144
|
+
font-weight: 500;
|
|
145
|
+
color: var(--dsw-alias-label-primary);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.dsh-panel-shell__body {
|
|
149
|
+
flex: 1 1 auto;
|
|
150
|
+
min-height: 0;
|
|
151
|
+
padding: 16px 24px;
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.dsh-panel-shell__footer {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: flex-end;
|
|
159
|
+
gap: 8px;
|
|
160
|
+
flex: none;
|
|
161
|
+
padding: 14px 24px;
|
|
162
|
+
border-top: 0.5px solid var(--dsw-alias-border-l1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* ── 宿主风格下拉 ───────────────────────────────────────────────── */
|
|
166
|
+
.dsh-menu-select {
|
|
167
|
+
position: relative;
|
|
168
|
+
width: 100%;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.dsh-menu-select__trigger {
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: space-between;
|
|
176
|
+
gap: 8px;
|
|
177
|
+
width: 100%;
|
|
178
|
+
box-sizing: border-box;
|
|
179
|
+
min-height: 32px;
|
|
180
|
+
padding: 5px 11px;
|
|
181
|
+
font-family: inherit;
|
|
182
|
+
font-size: 14px;
|
|
183
|
+
line-height: 20px;
|
|
184
|
+
text-align: left;
|
|
185
|
+
color: var(--dsw-alias-label-primary);
|
|
186
|
+
background-color: var(--dsw-alias-bg-layer-1);
|
|
187
|
+
border: 0.5px solid var(--dsw-alias-border-l4);
|
|
188
|
+
border-radius: var(--dsw-radius-md, 12px);
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dsh-menu-select__trigger:disabled {
|
|
193
|
+
opacity: 0.45;
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dsh-menu-select__trigger:focus-visible {
|
|
198
|
+
outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-alias-state-business-primary);
|
|
199
|
+
outline-offset: 2px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.dsh-menu-select__text {
|
|
203
|
+
min-width: 0;
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
text-overflow: ellipsis;
|
|
206
|
+
white-space: nowrap;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.dsh-menu-select__text--placeholder {
|
|
210
|
+
color: var(--dsw-alias-label-dimmed);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.dsh-menu-select__caret {
|
|
214
|
+
display: inline-flex;
|
|
215
|
+
flex: none;
|
|
216
|
+
align-items: center;
|
|
217
|
+
color: var(--dsw-alias-label-tertiary);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dsh-menu-select__popup {
|
|
221
|
+
position: absolute;
|
|
222
|
+
left: 0;
|
|
223
|
+
right: 0;
|
|
224
|
+
z-index: 1050;
|
|
225
|
+
margin-top: 4px;
|
|
226
|
+
max-height: 264px;
|
|
227
|
+
overflow: auto;
|
|
228
|
+
padding: 4px;
|
|
229
|
+
border-radius: var(--dsw-radius-lg, 16px);
|
|
230
|
+
background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));
|
|
231
|
+
backdrop-filter: var(--dsw-menu-backdrop-filter, none);
|
|
232
|
+
box-shadow: var(--dsw-elevation-panel);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.dsh-menu-select__popup--above {
|
|
236
|
+
margin-top: 0;
|
|
237
|
+
margin-bottom: 4px;
|
|
238
|
+
bottom: 100%;
|
|
239
|
+
top: auto;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.dsh-menu-select__option {
|
|
243
|
+
display: flex;
|
|
244
|
+
align-items: center;
|
|
245
|
+
gap: 8px;
|
|
246
|
+
width: 100%;
|
|
247
|
+
box-sizing: border-box;
|
|
248
|
+
min-height: 32px;
|
|
249
|
+
padding: 5px 10px;
|
|
250
|
+
border: 0;
|
|
251
|
+
border-radius: var(--dsw-radius-sm, 8px);
|
|
252
|
+
background: none;
|
|
253
|
+
font-family: inherit;
|
|
254
|
+
font-size: 14px;
|
|
255
|
+
line-height: 22px;
|
|
256
|
+
text-align: left;
|
|
257
|
+
color: var(--dsw-alias-label-primary);
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@media (hover: hover) {
|
|
262
|
+
.dsh-menu-select__option:hover:not(:disabled) {
|
|
263
|
+
background-color: var(--dsw-alias-interactive-bg-hover);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.dsh-menu-select__option--selected {
|
|
268
|
+
background-color: var(--dsw-alias-button-ghost-active-fill);
|
|
269
|
+
font-weight: 500;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.dsh-menu-select__option:disabled {
|
|
273
|
+
color: var(--dsw-alias-label-caption);
|
|
274
|
+
cursor: not-allowed;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.dsh-menu-select__check {
|
|
278
|
+
margin-left: auto;
|
|
279
|
+
display: inline-flex;
|
|
280
|
+
color: var(--dsw-alias-label-secondary);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* ── JSON 树 ────────────────────────────────────────────────────── */
|
|
284
|
+
.dsh-json-tree {
|
|
285
|
+
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
286
|
+
font-size: 12px;
|
|
287
|
+
line-height: 20px;
|
|
288
|
+
color: var(--dsw-alias-json-tree-punctuation, var(--dsw-alias-label-primary));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.dsh-json-tree__row {
|
|
292
|
+
display: flex;
|
|
293
|
+
align-items: baseline;
|
|
294
|
+
gap: 4px;
|
|
295
|
+
min-width: 0;
|
|
296
|
+
padding: 0 4px;
|
|
297
|
+
border-radius: var(--dsw-radius-xs, 4px);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.dsh-json-tree__toggle {
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
align-items: center;
|
|
303
|
+
justify-content: center;
|
|
304
|
+
width: 14px;
|
|
305
|
+
height: 14px;
|
|
306
|
+
flex: none;
|
|
307
|
+
padding: 0;
|
|
308
|
+
border: 0;
|
|
309
|
+
background: none;
|
|
310
|
+
color: var(--dsw-alias-json-tree-icon, var(--dsw-alias-label-tertiary));
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.dsh-json-tree__key {
|
|
315
|
+
color: var(--dsw-alias-json-tree-property, var(--dsw-alias-label-secondary));
|
|
316
|
+
white-space: pre;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.dsh-json-tree__string {
|
|
320
|
+
color: var(--dsw-alias-json-tree-string, var(--dsw-alias-label-primary));
|
|
321
|
+
word-break: break-all;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.dsh-json-tree__number {
|
|
325
|
+
color: var(--dsw-alias-json-tree-number, var(--dsw-alias-label-primary));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.dsh-json-tree__keyword {
|
|
329
|
+
color: var(--dsw-alias-json-tree-keyword, var(--dsw-alias-label-primary));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.dsh-json-tree__punct {
|
|
333
|
+
color: var(--dsw-alias-json-tree-punctuation, var(--dsw-alias-label-tertiary));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.dsh-json-tree__children {
|
|
337
|
+
margin-left: 8px;
|
|
338
|
+
border-left: 0.5px solid var(--dsw-alias-border-l1);
|
|
339
|
+
padding-left: 8px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.dsh-json-tree__summary {
|
|
343
|
+
color: var(--dsw-alias-json-tree-icon, var(--dsw-alias-label-tertiary));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* ── 代码块外壳 ─────────────────────────────────────────────────── */
|
|
347
|
+
.dsh-code-shell {
|
|
348
|
+
display: flex;
|
|
349
|
+
flex-direction: column;
|
|
350
|
+
border-radius: var(--dsw-radius-lg, 16px);
|
|
351
|
+
background-color: var(--dsw-alias-markdown-code-block);
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.dsh-code-shell__banner {
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
justify-content: space-between;
|
|
359
|
+
gap: 8px;
|
|
360
|
+
flex: none;
|
|
361
|
+
padding: 6px 12px;
|
|
362
|
+
background-color: var(--dsw-alias-markdown-code-block-banner);
|
|
363
|
+
font-size: 12px;
|
|
364
|
+
line-height: 18px;
|
|
365
|
+
color: var(--dsw-alias-label-tertiary);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.dsh-code-shell__lang {
|
|
369
|
+
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.dsh-code-shell__actions {
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
gap: 4px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.dsh-code-shell__body {
|
|
379
|
+
min-height: 0;
|
|
380
|
+
padding: 10px 12px;
|
|
381
|
+
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
382
|
+
font-size: 12px;
|
|
383
|
+
line-height: 20px;
|
|
384
|
+
color: var(--dsw-alias-label-primary);
|
|
385
|
+
overflow: auto;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.dsh-code-shell__body pre {
|
|
389
|
+
margin: 0;
|
|
390
|
+
white-space: pre;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* ── 文件类型徽标 ───────────────────────────────────────────────── */
|
|
394
|
+
.dsh-file-badge {
|
|
395
|
+
display: inline-flex;
|
|
396
|
+
align-items: center;
|
|
397
|
+
justify-content: center;
|
|
398
|
+
flex: none;
|
|
399
|
+
min-width: 24px;
|
|
400
|
+
height: 16px;
|
|
401
|
+
padding: 0 5px;
|
|
402
|
+
border-radius: var(--dsw-radius-xs, 4px);
|
|
403
|
+
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
404
|
+
font-size: 10px;
|
|
405
|
+
line-height: 16px;
|
|
406
|
+
font-weight: 500;
|
|
407
|
+
text-transform: uppercase;
|
|
408
|
+
background-color: var(--dsw-alias-bg-module-platform);
|
|
409
|
+
color: var(--dsw-alias-label-tertiary);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/* ── 状态行 ─────────────────────────────────────────────────────── */
|
|
413
|
+
.dsh-status-line {
|
|
414
|
+
display: inline-flex;
|
|
415
|
+
align-items: center;
|
|
416
|
+
gap: 6px;
|
|
417
|
+
min-width: 0;
|
|
418
|
+
font-size: 13px;
|
|
419
|
+
line-height: 20px;
|
|
420
|
+
color: var(--dsw-alias-label-tertiary);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.dsh-status-line__text {
|
|
424
|
+
min-width: 0;
|
|
425
|
+
overflow: hidden;
|
|
426
|
+
text-overflow: ellipsis;
|
|
427
|
+
white-space: nowrap;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.dsh-status-line__time {
|
|
431
|
+
flex: none;
|
|
432
|
+
font-variant-numeric: tabular-nums;
|
|
433
|
+
color: var(--dsw-alias-label-caption);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
@media (prefers-reduced-motion: reduce) {
|
|
437
|
+
.dsh-menu-select__popup {
|
|
438
|
+
animation: none;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
`
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* 注入 DSH 专属组合件样式。幂等。
|
|
445
|
+
*
|
|
446
|
+
* @returns 释放函数。
|
|
447
|
+
*/
|
|
448
|
+
export function injectCompositeStyles(): () => void {
|
|
449
|
+
return injectUiStyle('composites/components.css', COMPOSITES_CSS)
|
|
450
|
+
}
|