@xdmp-open/ui-shared 0.1.4 → 0.1.5

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.
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * @xdmp-open/ui-shared 全局样式汇总入口
3
- * 自应用壳 src/styles 迁移的业务通用部分(sidebar/icon 等应用布局样式留在应用仓)。
4
- * 注意:mixin/variables 为 SCSS 工具文件,仅在被业务 SCSS @use 时生效;
5
- * element-variables/transition/btn 会产出实际 CSS。
3
+ * tokens = 中性名;theme-default = 现网蓝(SaaS 可只引 tokens 再自己覆盖)。
4
+ * sidebar/icon 等壳 chrome 仍留在应用仓。
6
5
  */
6
+ @import './tokens';
7
+ @import './theme-default';
7
8
  @import './variables';
8
9
  @import './element-variables';
9
10
  @import './mixin';
10
11
  @import './transition';
11
12
  @import './btn';
13
+ @import './search-input';
@@ -0,0 +1,110 @@
1
+ /* 必须放在 cascade layer 外:未分层的 Element Plus 会压过 @layer 内的 width。 */
2
+ .searchInputCustomStyle .el-input {
3
+ width: 220px;
4
+ height: 100%;
5
+ }
6
+
7
+ .searchInputCustomStyle .el-input__wrapper {
8
+ background-color: var(--xdmp-color-bg-disabled);
9
+ border-radius: var(--xdmp-radius-sm);
10
+ box-shadow: unset;
11
+ border: 1px solid transparent;
12
+ }
13
+
14
+ .searchInputCustomStyle .el-input__wrapper.is-focus {
15
+ border: 1px solid var(--el-color-primary);
16
+ }
17
+
18
+ .searchInputCustomStyle .el-input__inner {
19
+ color: var(--xdmp-color-text-secondary);
20
+ border-radius: var(--xdmp-radius-sm);
21
+ font-size: 14px;
22
+ border: 1px solid var(--xdmp-color-bg-disabled);
23
+ }
24
+
25
+ .searchInputCustomStyle .el-input__inner:hover {
26
+ border-color: var(--xdmp-color-bg-disabled);
27
+ }
28
+
29
+ .searchInputCustomStyle .el-input__inner:focus {
30
+ outline: none;
31
+ color: var(--xdmp-color-text-primary);
32
+ }
33
+
34
+ .searchInputCustomStyle .el-select {
35
+ width: 160px;
36
+ height: 100%;
37
+ }
38
+
39
+ .searchInputCustomStyle .el-select .el-select__wrapper {
40
+ height: 100%;
41
+ background-color: var(--xdmp-color-bg-disabled);
42
+ border-radius: var(--xdmp-radius-sm);
43
+ box-shadow: unset;
44
+ border: 1px solid var(--xdmp-color-bg-disabled);
45
+ }
46
+
47
+ .searchInputCustomStyle .el-select .el-select__wrapper.is-focused {
48
+ border: 1px solid var(--el-color-primary);
49
+ }
50
+
51
+ .searchInputCustomStyle .el-select .el-select__input-wrapper {
52
+ height: 32px;
53
+ }
54
+
55
+ .searchInputCustomStyle .el-select .el-select__input-wrapper .el-select__input {
56
+ height: calc(100% - 1px);
57
+ }
58
+
59
+ .searchInputCustomStyle .el-select .el-input.is-focus .el-input__inner {
60
+ border-color: var(--el-color-primary);
61
+ }
62
+
63
+ .searchInputCustomStyle .el-select:hover .el-input__inner {
64
+ border-color: var(--xdmp-color-bg-disabled);
65
+ }
66
+
67
+ .searchInputCustomStyle .el-checkbox__input.is-checked .el-checkbox__inner,
68
+ .searchInputCustomStyle .el-checkbox__input.is-indeterminate .el-checkbox__inner {
69
+ background-color: var(--el-color-primary);
70
+ border-color: var(--el-color-primary);
71
+ }
72
+
73
+ .searchInputCustomStyle .el-button--text {
74
+ color: var(--el-color-primary);
75
+ }
76
+
77
+ .searchInputCustomStyle .el-button--default {
78
+ border-color: var(--el-color-primary);
79
+ color: var(--el-color-primary);
80
+ transition: 0.3s;
81
+ }
82
+
83
+ .searchInputCustomStyle .el-button--default:hover {
84
+ background: var(--el-color-primary);
85
+ color: #fff;
86
+ }
87
+
88
+ .searchInputCustomStyle .el-button--default:visited {
89
+ background: unset;
90
+ }
91
+
92
+ .searchInputCustomStyle .el-range-input {
93
+ background-color: var(--xdmp-color-bg-disabled);
94
+ }
95
+
96
+ .searchInputCustomStyle .el-date-editor {
97
+ background-color: var(--xdmp-color-bg-disabled);
98
+ border: 1px solid var(--xdmp-color-bg-disabled);
99
+ height: 36px !important;
100
+ box-shadow: unset !important;
101
+ }
102
+
103
+ .searchInputCustomStyle .el-date-editor.is-active {
104
+ border: 1px solid var(--el-color-primary);
105
+ }
106
+
107
+ .searchInputCustomStyle .el-date-editor .el-input__prefix {
108
+ padding-left: 5px;
109
+ background-color: var(--xdmp-color-bg-disabled) !important;
110
+ }
@@ -0,0 +1,10 @@
1
+ @layer xdmp.host {
2
+ :root {
3
+ --xdmp-color-brand: #0070FF;
4
+ --xdmp-color-brand-hover: #66A9FF;
5
+ --xdmp-color-brand-active: #0059CC;
6
+ --el-color-primary: var(--xdmp-color-brand);
7
+ --el-color-primary-hover: var(--xdmp-color-brand-hover);
8
+ --el-color-primary-active: var(--xdmp-color-brand-active);
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ @layer xdmp.host {
2
+ :root {
3
+ --xdmp-color-brand: #0070FF;
4
+ --xdmp-color-brand-hover: #66A9FF;
5
+ --xdmp-color-brand-active: #0059CC;
6
+ --el-color-primary: var(--xdmp-color-brand);
7
+ --el-color-primary-hover: var(--xdmp-color-brand-hover);
8
+ --el-color-primary-active: var(--xdmp-color-brand-active);
9
+ }
10
+ }
@@ -0,0 +1,19 @@
1
+ @layer xdmp.reset, xdmp.theme, xdmp.layout, xdmp.widgets, xdmp.pages, xdmp.host;
2
+ @layer xdmp.theme {
3
+ :root {
4
+ --xdmp-color-brand: #737373;
5
+ --xdmp-color-brand-hover: #8a8a8a;
6
+ --xdmp-color-brand-active: #5c5c5c;
7
+ --xdmp-color-text-primary: #222222;
8
+ --xdmp-color-text-regular: #666666;
9
+ --xdmp-color-text-secondary: #999999;
10
+ --xdmp-color-bg-page: #f2f6f9;
11
+ --xdmp-color-bg-disabled: #f9f9fa;
12
+ --xdmp-color-border: #dee4ec;
13
+ --xdmp-space-2: 8px;
14
+ --xdmp-space-4: 16px;
15
+ --xdmp-radius-sm: 0px;
16
+ --xdmp-sidenav-width: 200px;
17
+ --xdmp-z-drawer: 2000;
18
+ }
19
+ }
@@ -0,0 +1,20 @@
1
+ @layer xdmp.reset, xdmp.theme, xdmp.layout, xdmp.widgets, xdmp.pages, xdmp.host;
2
+
3
+ @layer xdmp.theme {
4
+ :root {
5
+ --xdmp-color-brand: #737373;
6
+ --xdmp-color-brand-hover: #8a8a8a;
7
+ --xdmp-color-brand-active: #5c5c5c;
8
+ --xdmp-color-text-primary: #222222;
9
+ --xdmp-color-text-regular: #666666;
10
+ --xdmp-color-text-secondary: #999999;
11
+ --xdmp-color-bg-page: #f2f6f9;
12
+ --xdmp-color-bg-disabled: #f9f9fa;
13
+ --xdmp-color-border: #dee4ec;
14
+ --xdmp-space-2: 8px;
15
+ --xdmp-space-4: 16px;
16
+ --xdmp-radius-sm: 0px;
17
+ --xdmp-sidenav-width: 200px;
18
+ --xdmp-z-drawer: 2000;
19
+ }
20
+ }
package/dist/styles.css CHANGED
@@ -1,10 +1,38 @@
1
1
  @charset "UTF-8";
2
2
  /**
3
3
  * @xdmp-open/ui-shared 全局样式汇总入口
4
- * 自应用壳 src/styles 迁移的业务通用部分(sidebar/icon 等应用布局样式留在应用仓)。
5
- * 注意:mixin/variables 为 SCSS 工具文件,仅在被业务 SCSS @use 时生效;
6
- * element-variables/transition/btn 会产出实际 CSS。
4
+ * tokens = 中性名;theme-default = 现网蓝(SaaS 可只引 tokens 再自己覆盖)。
5
+ * sidebar/icon 等壳 chrome 仍留在应用仓。
7
6
  */
7
+ @layer xdmp.reset, xdmp.theme, xdmp.layout, xdmp.widgets, xdmp.pages, xdmp.host;
8
+ @layer xdmp.theme {
9
+ :root {
10
+ --xdmp-color-brand: #737373;
11
+ --xdmp-color-brand-hover: #8a8a8a;
12
+ --xdmp-color-brand-active: #5c5c5c;
13
+ --xdmp-color-text-primary: #222222;
14
+ --xdmp-color-text-regular: #666666;
15
+ --xdmp-color-text-secondary: #999999;
16
+ --xdmp-color-bg-page: #f2f6f9;
17
+ --xdmp-color-bg-disabled: #f9f9fa;
18
+ --xdmp-color-border: #dee4ec;
19
+ --xdmp-space-2: 8px;
20
+ --xdmp-space-4: 16px;
21
+ --xdmp-radius-sm: 0px;
22
+ --xdmp-sidenav-width: 200px;
23
+ --xdmp-z-drawer: 2000;
24
+ }
25
+ }
26
+ @layer xdmp.host {
27
+ :root {
28
+ --xdmp-color-brand: #0070FF;
29
+ --xdmp-color-brand-hover: #66A9FF;
30
+ --xdmp-color-brand-active: #0059CC;
31
+ --el-color-primary: var(--xdmp-color-brand);
32
+ --el-color-primary-hover: var(--xdmp-color-brand-hover);
33
+ --el-color-primary-active: var(--xdmp-color-brand-active);
34
+ }
35
+ }
8
36
  :export {
9
37
  menuText: rgba(0, 0, 0, 0.7);
10
38
  menuActiveText: #0070FF;
@@ -252,3 +280,114 @@
252
280
  color: #fff;
253
281
  background: var(--el-color-primary);
254
282
  }
283
+
284
+ /* 必须放在 cascade layer 外:未分层的 Element Plus 会压过 @layer 内的 width。 */
285
+ .searchInputCustomStyle .el-input {
286
+ width: 220px;
287
+ height: 100%;
288
+ }
289
+
290
+ .searchInputCustomStyle .el-input__wrapper {
291
+ background-color: var(--xdmp-color-bg-disabled);
292
+ border-radius: var(--xdmp-radius-sm);
293
+ box-shadow: unset;
294
+ border: 1px solid transparent;
295
+ }
296
+
297
+ .searchInputCustomStyle .el-input__wrapper.is-focus {
298
+ border: 1px solid var(--el-color-primary);
299
+ }
300
+
301
+ .searchInputCustomStyle .el-input__inner {
302
+ color: var(--xdmp-color-text-secondary);
303
+ border-radius: var(--xdmp-radius-sm);
304
+ font-size: 14px;
305
+ border: 1px solid var(--xdmp-color-bg-disabled);
306
+ }
307
+
308
+ .searchInputCustomStyle .el-input__inner:hover {
309
+ border-color: var(--xdmp-color-bg-disabled);
310
+ }
311
+
312
+ .searchInputCustomStyle .el-input__inner:focus {
313
+ outline: none;
314
+ color: var(--xdmp-color-text-primary);
315
+ }
316
+
317
+ .searchInputCustomStyle .el-select {
318
+ width: 160px;
319
+ height: 100%;
320
+ }
321
+
322
+ .searchInputCustomStyle .el-select .el-select__wrapper {
323
+ height: 100%;
324
+ background-color: var(--xdmp-color-bg-disabled);
325
+ border-radius: var(--xdmp-radius-sm);
326
+ box-shadow: unset;
327
+ border: 1px solid var(--xdmp-color-bg-disabled);
328
+ }
329
+
330
+ .searchInputCustomStyle .el-select .el-select__wrapper.is-focused {
331
+ border: 1px solid var(--el-color-primary);
332
+ }
333
+
334
+ .searchInputCustomStyle .el-select .el-select__input-wrapper {
335
+ height: 32px;
336
+ }
337
+
338
+ .searchInputCustomStyle .el-select .el-select__input-wrapper .el-select__input {
339
+ height: calc(100% - 1px);
340
+ }
341
+
342
+ .searchInputCustomStyle .el-select .el-input.is-focus .el-input__inner {
343
+ border-color: var(--el-color-primary);
344
+ }
345
+
346
+ .searchInputCustomStyle .el-select:hover .el-input__inner {
347
+ border-color: var(--xdmp-color-bg-disabled);
348
+ }
349
+
350
+ .searchInputCustomStyle .el-checkbox__input.is-checked .el-checkbox__inner,
351
+ .searchInputCustomStyle .el-checkbox__input.is-indeterminate .el-checkbox__inner {
352
+ background-color: var(--el-color-primary);
353
+ border-color: var(--el-color-primary);
354
+ }
355
+
356
+ .searchInputCustomStyle .el-button--text {
357
+ color: var(--el-color-primary);
358
+ }
359
+
360
+ .searchInputCustomStyle .el-button--default {
361
+ border-color: var(--el-color-primary);
362
+ color: var(--el-color-primary);
363
+ transition: 0.3s;
364
+ }
365
+
366
+ .searchInputCustomStyle .el-button--default:hover {
367
+ background: var(--el-color-primary);
368
+ color: #fff;
369
+ }
370
+
371
+ .searchInputCustomStyle .el-button--default:visited {
372
+ background: unset;
373
+ }
374
+
375
+ .searchInputCustomStyle .el-range-input {
376
+ background-color: var(--xdmp-color-bg-disabled);
377
+ }
378
+
379
+ .searchInputCustomStyle .el-date-editor {
380
+ background-color: var(--xdmp-color-bg-disabled);
381
+ border: 1px solid var(--xdmp-color-bg-disabled);
382
+ height: 36px !important;
383
+ box-shadow: unset !important;
384
+ }
385
+
386
+ .searchInputCustomStyle .el-date-editor.is-active {
387
+ border: 1px solid var(--el-color-primary);
388
+ }
389
+
390
+ .searchInputCustomStyle .el-date-editor .el-input__prefix {
391
+ padding-left: 5px;
392
+ background-color: var(--xdmp-color-bg-disabled) !important;
393
+ }
@@ -0,0 +1,4 @@
1
+ export declare const TOKEN_NAMES: readonly ["--xdmp-color-brand", "--xdmp-color-brand-hover", "--xdmp-color-brand-active", "--xdmp-color-text-primary", "--xdmp-color-text-regular", "--xdmp-color-text-secondary", "--xdmp-color-bg-page", "--xdmp-color-bg-disabled", "--xdmp-color-border", "--xdmp-space-2", "--xdmp-space-4", "--xdmp-radius-sm", "--xdmp-sidenav-width", "--xdmp-z-drawer"];
2
+ export type TokenName = (typeof TOKEN_NAMES)[number];
3
+ /** 中性 fallback。禁止放 XDMP 蓝,品牌值只属于 theme-default / 应用 :root。 */
4
+ export declare const TOKEN_NEUTRAL_FALLBACKS: Record<TokenName, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdmp-open/ui-shared",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "XDMP platform shared Vue 3 components, directives and theme tokens",
5
5
  "license": "Apache-2.0",
6
6
  "author": "China Mobile IoT",
@@ -31,8 +31,10 @@
31
31
  },
32
32
  "./styles": "./dist/styles.css",
33
33
  "./style.css": "./dist/style.css",
34
+ "./tokens.css": "./dist/styles/tokens.css",
35
+ "./theme-default.css": "./dist/styles/theme-default.css",
34
36
  "./styles/*.scss": "./dist/styles/*.scss",
35
- "./styles/*": "./dist/styles/*.scss",
37
+ "./styles/*": "./dist/styles/*",
36
38
  "./package.json": "./package.json"
37
39
  },
38
40
  "sideEffects": [
@@ -66,7 +68,7 @@
66
68
  "@xdmp-open/sdk-admin": "0.1.3"
67
69
  },
68
70
  "scripts": {
69
- "build": "vite build && sass src/styles/index.scss dist/styles.css --no-source-map && mkdir -p dist/styles && cp src/styles/*.scss dist/styles/",
71
+ "build": "vite build && sass src/styles/index.scss dist/styles.css --no-source-map && mkdir -p dist/styles && cp src/styles/*.scss dist/styles/ && sass src/styles/tokens.scss dist/styles/tokens.css --no-source-map && sass src/styles/theme-default.scss dist/styles/theme-default.css --no-source-map",
70
72
  "lint": "eslint src tests",
71
73
  "test": "vitest run",
72
74
  "typecheck": "vue-tsc --noEmit"