@w-run/wdesign-ui 0.0.0-stage → 1.0.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.
Files changed (70) hide show
  1. package/README.md +174 -2
  2. package/dist/index.d.ts +83 -0
  3. package/dist/style/ai-msg.css +187 -0
  4. package/dist/style/alert.css +64 -0
  5. package/dist/style/audio.css +1363 -0
  6. package/dist/style/avatar.css +88 -0
  7. package/dist/style/badge.css +48 -0
  8. package/dist/style/breadcrumb.css +54 -0
  9. package/dist/style/button.css +234 -0
  10. package/dist/style/card.css +71 -0
  11. package/dist/style/carousel.css +101 -0
  12. package/dist/style/checkbox.css +129 -0
  13. package/dist/style/chevron.css +33 -0
  14. package/dist/style/collapse.css +69 -0
  15. package/dist/style/command.css +201 -0
  16. package/dist/style/container.css +7 -0
  17. package/dist/style/datepicker.css +205 -0
  18. package/dist/style/descriptions.css +119 -0
  19. package/dist/style/divider.css +62 -0
  20. package/dist/style/dot.css +30 -0
  21. package/dist/style/drawer.css +145 -0
  22. package/dist/style/dropdown.css +83 -0
  23. package/dist/style/empty.css +36 -0
  24. package/dist/style/explorer.css +336 -0
  25. package/dist/style/file-list.css +92 -0
  26. package/dist/style/form.css +96 -0
  27. package/dist/style/grid.css +4 -0
  28. package/dist/style/group.css +478 -0
  29. package/dist/style/icon-btn.css +75 -0
  30. package/dist/style/image-preview.css +81 -0
  31. package/dist/style/input.css +119 -0
  32. package/dist/style/list.css +81 -0
  33. package/dist/style/markdown.css +312 -0
  34. package/dist/style/modal.css +164 -0
  35. package/dist/style/notification.css +52 -0
  36. package/dist/style/otp.css +139 -0
  37. package/dist/style/pagination.css +120 -0
  38. package/dist/style/popconfirm.css +87 -0
  39. package/dist/style/popover.css +110 -0
  40. package/dist/style/post-item.css +134 -0
  41. package/dist/style/progress.css +34 -0
  42. package/dist/style/radio.css +126 -0
  43. package/dist/style/rate.css +44 -0
  44. package/dist/style/result.css +54 -0
  45. package/dist/style/segmented-picker.css +120 -0
  46. package/dist/style/segmented.css +190 -0
  47. package/dist/style/select.css +281 -0
  48. package/dist/style/skeleton.css +31 -0
  49. package/dist/style/slider.css +81 -0
  50. package/dist/style/sortable.css +128 -0
  51. package/dist/style/space.css +25 -0
  52. package/dist/style/spinner.css +27 -0
  53. package/dist/style/statistic.css +44 -0
  54. package/dist/style/steps.css +100 -0
  55. package/dist/style/switch.css +95 -0
  56. package/dist/style/table.css +379 -0
  57. package/dist/style/tabs.css +167 -0
  58. package/dist/style/tag.css +97 -0
  59. package/dist/style/timeline.css +521 -0
  60. package/dist/style/toast.css +37 -0
  61. package/dist/style/tooltip.css +45 -0
  62. package/dist/style/tree.css +189 -0
  63. package/dist/style/typography.css +66 -0
  64. package/dist/style/upload.css +169 -0
  65. package/dist/style/vlist.css +49 -0
  66. package/dist/style/vplayer.css +846 -0
  67. package/dist/wdesign-ui.css +10300 -0
  68. package/dist/wdesign-ui.esm.js +16333 -0
  69. package/package.json +47 -3
  70. package/tokens.json +385 -0
@@ -0,0 +1,189 @@
1
+ @charset "UTF-8";
2
+ .wd-tree {
3
+ display: flex;
4
+ flex-direction: column;
5
+ font-size: 13px;
6
+ user-select: none;
7
+ }
8
+
9
+ .wd-tree__node {
10
+ display: flex;
11
+ align-items: center;
12
+ gap: 6px;
13
+ position: relative;
14
+ min-height: 32px;
15
+ padding-right: 14px;
16
+ /* 可点击项优先胶囊 */
17
+ border-radius: var(--wd-radius-pill);
18
+ color: var(--wd-ink);
19
+ cursor: pointer;
20
+ outline: none;
21
+ transition: background var(--wd-dur-fast) ease;
22
+ }
23
+
24
+ @media (hover: hover) {
25
+ .wd-tree__node:hover {
26
+ background: var(--wd-field-hover);
27
+ }
28
+ }
29
+ .wd-tree__node:focus-visible {
30
+ box-shadow: inset 0 0 0 2px var(--wd-focus-ring);
31
+ }
32
+
33
+ .wd-tree__node--selected {
34
+ background: var(--wd-field-hover);
35
+ color: var(--wd-red-text);
36
+ font-weight: 600;
37
+ }
38
+
39
+ @media (hover: hover) {
40
+ .wd-tree__node--selected:hover {
41
+ background: var(--wd-field);
42
+ }
43
+ }
44
+ /*
45
+ 禁用态用 .6 而非 .45:.45 在浅色底上对比度约 3:1,标签几乎读不出来。
46
+ 禁用需要「看起来不可用」,但不能牺牲可读性。
47
+ */
48
+ .wd-tree__node--disabled {
49
+ opacity: 0.6;
50
+ cursor: default;
51
+ pointer-events: none;
52
+ }
53
+
54
+ /* ---- 展开箭头 ---- */
55
+ .wd-tree__arrow {
56
+ flex: none;
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ width: 16px;
61
+ height: 16px;
62
+ color: var(--wd-ink-2);
63
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out);
64
+ }
65
+
66
+ .wd-tree__arrow--open {
67
+ transform: rotate(90deg);
68
+ }
69
+
70
+ .wd-tree__arrow--leaf {
71
+ visibility: hidden;
72
+ }
73
+
74
+ @media (hover: hover) {
75
+ .wd-tree__arrow:hover {
76
+ color: var(--wd-ink);
77
+ }
78
+ }
79
+ /* ---- 复选框 ---- */
80
+ /*
81
+ * 与 WdCheckbox / WdTransfer 统一为**圆形自绘**。
82
+ * ⚠️ 不用原生 input + accent-color:
83
+ * 各平台原生框是方形、尺寸不一,且 accent-color 只改填充色不改形状,
84
+ * 与全站的「圆形优先」冲突。
85
+ * 保留原生 input 的语义(可聚焦/可键盘操作),只是外观自绘。
86
+ */
87
+ .wd-tree__check {
88
+ flex: none;
89
+ display: inline-flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ margin-right: 6px;
93
+ }
94
+
95
+ .wd-tree__check input {
96
+ appearance: none;
97
+ -webkit-appearance: none;
98
+ position: relative;
99
+ width: 17px;
100
+ height: 17px;
101
+ margin: 0;
102
+ border-radius: 50%;
103
+ box-shadow: inset 0 0 0 1.5px var(--wd-ink-4);
104
+ background: transparent;
105
+ cursor: pointer;
106
+ transition: background var(--wd-dur-fast) ease, box-shadow var(--wd-dur-fast) ease;
107
+ }
108
+
109
+ .wd-tree__check input:hover {
110
+ box-shadow: inset 0 0 0 1.5px var(--wd-ink-3);
111
+ }
112
+
113
+ /* 选中:深色实心 + 白勾(与 Transfer 一致,不用主题红) */
114
+ .wd-tree__check input:checked {
115
+ background: var(--wd-ink);
116
+ box-shadow: none;
117
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6.2 5.1 8.3 9 4'/%3E%3C/svg%3E");
118
+ background-size: 11px 11px;
119
+ background-position: center;
120
+ background-repeat: no-repeat;
121
+ }
122
+
123
+ /* 半选(部分子节点选中):一条横杠 */
124
+ .wd-tree__check input:indeterminate {
125
+ background: var(--wd-ink);
126
+ box-shadow: none;
127
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 6h5'/%3E%3C/svg%3E");
128
+ background-size: 11px 11px;
129
+ background-position: center;
130
+ background-repeat: no-repeat;
131
+ }
132
+
133
+ .wd-tree__check input:focus-visible {
134
+ outline: none;
135
+ box-shadow: 0 0 0 3px var(--wd-focus-ring-soft);
136
+ }
137
+
138
+ .wd-tree__icon {
139
+ flex: none;
140
+ display: inline-flex;
141
+ align-items: center;
142
+ color: var(--wd-ink-2);
143
+ font-size: 13px;
144
+ }
145
+
146
+ .wd-tree__label {
147
+ flex: 1;
148
+ min-width: 0;
149
+ overflow: hidden;
150
+ text-overflow: ellipsis;
151
+ white-space: nowrap;
152
+ }
153
+
154
+ .wd-tree__extra {
155
+ flex: none;
156
+ display: inline-flex;
157
+ align-items: center;
158
+ gap: 4px;
159
+ opacity: 0;
160
+ transition: opacity var(--wd-dur-fast) ease;
161
+ }
162
+
163
+ .wd-tree__node:hover .wd-tree__extra,
164
+ .wd-tree__node--selected .wd-tree__extra {
165
+ opacity: 1;
166
+ }
167
+
168
+ /*
169
+ ---- 引导线 ----
170
+ 原来画在 left:0,每行一条,深一点的行也只会得到「贴着容器左边」的线,
171
+ 看起来像表格边框而不是层级引导。改为用 CSS 变量传深度偏移,
172
+ 从父级箭头中心处往下连,视觉上才成为「树的骨架」。
173
+ */
174
+ .wd-tree--line .wd-tree__node::before {
175
+ content: "";
176
+ position: absolute;
177
+ left: calc(var(--wd-tree-line-x, 0px));
178
+ top: 0;
179
+ bottom: 0;
180
+ width: 1px;
181
+ background: var(--wd-ink-5);
182
+ }
183
+
184
+ .wd-tree__empty {
185
+ padding: 18px 0;
186
+ text-align: center;
187
+ font-size: 12.5px;
188
+ color: var(--wd-ink-2);
189
+ }
@@ -0,0 +1,66 @@
1
+ @charset "UTF-8";
2
+ /* 锚点面(--wd-dark)在深色主题下翻转为浅色 → 其上配套色需同步翻转 */
3
+ .wd-em {
4
+ text-decoration: none;
5
+ border-bottom: 2px dashed #D62839;
6
+ padding-bottom: 1px;
7
+ }
8
+
9
+ .wd-title-line {
10
+ position: relative;
11
+ }
12
+ .wd-title-line::after {
13
+ content: "";
14
+ display: block;
15
+ width: 2em;
16
+ height: 5px;
17
+ border-radius: 999px;
18
+ background: #D62839;
19
+ opacity: 0.3;
20
+ margin-top: 0.5em;
21
+ transition: opacity 0.24s ease;
22
+ }
23
+ @media (hover: hover) {
24
+ .wd-title-line:hover::after {
25
+ opacity: 1;
26
+ }
27
+ }
28
+ .wd-title-line {
29
+ /* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
30
+ }
31
+ .wd-title-line.is-hover::after {
32
+ opacity: 1;
33
+ }
34
+
35
+ img.wd-theme-aware:not([src*=".svg"]) {
36
+ filter: var(--wd-img-filter, none);
37
+ }
38
+
39
+ img.wd-theme-invert {
40
+ filter: var(--wd-img-filter-invert, none);
41
+ }
42
+
43
+ .wd-theme-transition,
44
+ .wd-theme-transition * {
45
+ transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
46
+ }
47
+
48
+ .wd-reveal {
49
+ opacity: 0;
50
+ transform: translateY(12px);
51
+ transition: opacity var(--wd-dur-reveal, 0.45s) var(--wd-ease-out, cubic-bezier(0.16, 1, 0.3, 1)), transform var(--wd-dur-reveal, 0.45s) var(--wd-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
52
+ transition-delay: var(--wd-reveal-delay, 0s);
53
+ will-change: transform, opacity;
54
+ }
55
+ .wd-reveal.is-revealed {
56
+ opacity: 1;
57
+ transform: none;
58
+ }
59
+
60
+ @media (prefers-reduced-motion: reduce) {
61
+ .wd-reveal {
62
+ opacity: 1 !important;
63
+ transform: none !important;
64
+ transition: none !important;
65
+ }
66
+ }
@@ -0,0 +1,169 @@
1
+ @charset "UTF-8";
2
+ .wd-upload {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 10px;
6
+ }
7
+
8
+ .wd-upload__zone {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ gap: 10px;
13
+ padding: 32px 24px;
14
+ border: 2px dashed var(--wd-field);
15
+ border-radius: var(--wd-radius-lg);
16
+ background: var(--wd-bg);
17
+ cursor: pointer;
18
+ transition: border-color var(--wd-dur-fast) ease, background var(--wd-dur-fast) ease;
19
+ text-align: center;
20
+ }
21
+
22
+ @media (hover: hover) {
23
+ .wd-upload__zone:hover {
24
+ border-color: var(--wd-red-soft);
25
+ background: var(--wd-tint-1);
26
+ }
27
+ }
28
+ /* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
29
+ .wd-upload__zone.is-hover {
30
+ border-color: var(--wd-red-soft);
31
+ background: var(--wd-tint-1);
32
+ }
33
+
34
+ .wd-upload__zone--over {
35
+ border-color: var(--wd-red-soft);
36
+ background: var(--wd-tint-1);
37
+ }
38
+
39
+ .wd-upload__zone--over {
40
+ animation: wd-upload-pulse 0.6s ease;
41
+ }
42
+
43
+ @keyframes wd-upload-pulse {
44
+ 0%, 100% {
45
+ transform: scale(1);
46
+ }
47
+ 50% {
48
+ transform: scale(1.012);
49
+ }
50
+ }
51
+ .wd-upload__icon {
52
+ color: var(--wd-ink-3);
53
+ }
54
+
55
+ .wd-upload__hint {
56
+ font-size: 13.5px;
57
+ color: var(--wd-ink-2);
58
+ }
59
+
60
+ .wd-upload__hint strong {
61
+ color: var(--wd-red-text);
62
+ font-weight: 700;
63
+ }
64
+
65
+ .wd-upload__browse {
66
+ font-size: 13px;
67
+ color: var(--wd-red-text);
68
+ font-weight: 600;
69
+ }
70
+
71
+ .wd-upload__input {
72
+ display: none;
73
+ }
74
+
75
+ .wd-upload__list {
76
+ display: flex;
77
+ flex-direction: column;
78
+ gap: 8px;
79
+ }
80
+
81
+ .wd-upload__item {
82
+ display: flex;
83
+ align-items: center;
84
+ gap: 12px;
85
+ padding: 11px 14px;
86
+ background: var(--wd-card);
87
+ border-radius: var(--wd-radius-sm);
88
+ box-shadow: var(--wd-shadow);
89
+ }
90
+
91
+ .wd-upload__file-icon {
92
+ width: 38px;
93
+ height: 38px;
94
+ border-radius: 10px;
95
+ background: var(--wd-field-hover);
96
+ color: var(--wd-red-text);
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: center;
100
+ flex: none;
101
+ }
102
+
103
+ .wd-upload__info {
104
+ flex: 1;
105
+ min-width: 0;
106
+ }
107
+
108
+ .wd-upload__name {
109
+ font-size: 13.5px;
110
+ font-weight: 600;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ white-space: nowrap;
114
+ }
115
+
116
+ .wd-upload__meta {
117
+ font-size: 11.5px;
118
+ color: var(--wd-ink-2);
119
+ margin-top: 2px;
120
+ }
121
+
122
+ .wd-upload__remove {
123
+ width: 28px;
124
+ height: 28px;
125
+ border: 0;
126
+ border-radius: 50%;
127
+ background: transparent;
128
+ color: var(--wd-ink-2);
129
+ cursor: pointer;
130
+ display: inline-flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
134
+ }
135
+
136
+ @media (hover: hover) {
137
+ .wd-upload__remove:hover {
138
+ background: var(--wd-field-hover);
139
+ color: var(--wd-red-text);
140
+ }
141
+ }
142
+ .wd-upload__remove.is-hover {
143
+ background: var(--wd-field-hover);
144
+ color: var(--wd-red-text);
145
+ }
146
+
147
+ .wd-upload__progress {
148
+ height: 4px;
149
+ border-radius: 999px;
150
+ background: var(--wd-field);
151
+ margin-top: 4px;
152
+ overflow: hidden;
153
+ }
154
+
155
+ .wd-upload__progress-bar {
156
+ height: 100%;
157
+ border-radius: 999px;
158
+ background: var(--wd-red);
159
+ transition: width var(--wd-dur) ease;
160
+ }
161
+
162
+ /* ---- 超限提示 ---- */
163
+ .wd-upload__error {
164
+ display: block;
165
+ margin-top: 8px;
166
+ font-size: 12.5px;
167
+ font-weight: 600;
168
+ color: var(--wd-red-text);
169
+ }
@@ -0,0 +1,49 @@
1
+ @charset "UTF-8";
2
+ .wd-vlist {
3
+ position: relative;
4
+ overflow-y: auto;
5
+ overflow-x: hidden;
6
+ overscroll-behavior: contain;
7
+ /* 滚动容器需要独立层,避免内部 transform 影响外部布局 */
8
+ contain: strict;
9
+ border-radius: var(--wd-radius-sm);
10
+ }
11
+
12
+ .wd-vlist--hide-scrollbar {
13
+ scrollbar-width: none;
14
+ }
15
+
16
+ .wd-vlist--hide-scrollbar::-webkit-scrollbar {
17
+ display: none;
18
+ }
19
+
20
+ .wd-vlist__phantom {
21
+ position: relative;
22
+ width: 100%;
23
+ }
24
+
25
+ .wd-vlist__window {
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ will-change: transform;
31
+ }
32
+
33
+ .wd-vlist__item {
34
+ display: flex;
35
+ align-items: center;
36
+ box-sizing: border-box;
37
+ /* 固定行高下不裁切内容会溢出到相邻行 */
38
+ overflow: hidden;
39
+ }
40
+
41
+ .wd-vlist__empty {
42
+ position: absolute;
43
+ inset: 0;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ font-size: 13px;
48
+ color: var(--wd-ink-2);
49
+ }