@composy/keyboard-vue 0.0.1 → 0.0.2

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 (172) hide show
  1. package/README.md +48 -24
  2. package/dist/index.css +552 -560
  3. package/dist/index.js +228 -192
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.css +1 -1
  6. package/dist/index.min.js +954 -1
  7. package/dist/index.min.js.map +1 -0
  8. package/es/.dts-output-manifest.json +1 -0
  9. package/es/.dts.tsbuildinfo +1 -0
  10. package/es/components/KeyboardKey.js +1 -1
  11. package/es/components/KeyboardKey.js.map +1 -1
  12. package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js +16 -7
  13. package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/es/components/KeyboardPopup.js +1 -1
  15. package/es/components/KeyboardPopup.js.map +1 -1
  16. package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js +8 -5
  17. package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/es/components/LicensePlateKeyboard.js +1 -1
  19. package/es/components/LicensePlateKeyboard.js.map +1 -1
  20. package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js +2 -2
  21. package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/es/components/VirtualKeyboard.js +1 -1
  23. package/es/components/VirtualKeyboard.js.map +1 -1
  24. package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js +4 -4
  25. package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/es/components/index.d.ts +1 -2
  27. package/es/components/index.d.ts.map +1 -1
  28. package/es/components/index.js +1 -1
  29. package/es/composables/index.d.ts +0 -1
  30. package/es/composables/index.js +1 -1
  31. package/es/composables/useKeyboard.d.ts +1 -2
  32. package/es/composables/useKeyboard.d.ts.map +1 -1
  33. package/es/composables/useKeyboard.js +8 -15
  34. package/es/composables/useKeyboard.js.map +1 -1
  35. package/es/composables/useKeyboardPopup.d.ts +2 -51
  36. package/es/composables/useKeyboardPopup.d.ts.map +1 -1
  37. package/es/composables/useKeyboardPopup.js +66 -49
  38. package/es/composables/useKeyboardPopup.js.map +1 -1
  39. package/es/directives/index.d.ts +0 -1
  40. package/es/directives/index.js +1 -1
  41. package/es/directives/v-keyboard.d.ts +0 -1
  42. package/es/directives/v-keyboard.d.ts.map +1 -1
  43. package/es/directives/v-keyboard.js +10 -11
  44. package/es/directives/v-keyboard.js.map +1 -1
  45. package/es/index.d.ts +3 -4
  46. package/es/index.d.ts.map +1 -1
  47. package/es/index.js +2 -5
  48. package/es/index.js.map +1 -1
  49. package/es/plugins/engine-plugin.d.ts +0 -1
  50. package/es/plugins/engine-plugin.d.ts.map +1 -1
  51. package/es/plugins/engine-plugin.js +19 -4
  52. package/es/plugins/engine-plugin.js.map +1 -1
  53. package/es/plugins/index.d.ts +0 -1
  54. package/es/plugins/index.js +1 -1
  55. package/es/style/css.js +1 -1
  56. package/es/style/index.css +2 -0
  57. package/es/style/index.js +1 -1
  58. package/es/styles/index.css +391 -0
  59. package/es/styles/keyboard.css +252 -0
  60. package/es/styles/themes.css +137 -0
  61. package/esm/components/KeyboardKey.js +17 -0
  62. package/esm/components/KeyboardKey.js.map +1 -0
  63. package/esm/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js +140 -0
  64. package/esm/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js.map +1 -0
  65. package/esm/components/KeyboardPopup.js +17 -0
  66. package/esm/components/KeyboardPopup.js.map +1 -0
  67. package/esm/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js +167 -0
  68. package/esm/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  69. package/esm/components/LicensePlateKeyboard.js +17 -0
  70. package/esm/components/LicensePlateKeyboard.js.map +1 -0
  71. package/esm/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js +97 -0
  72. package/esm/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  73. package/esm/components/VirtualKeyboard.js +17 -0
  74. package/esm/components/VirtualKeyboard.js.map +1 -0
  75. package/esm/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js +127 -0
  76. package/esm/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  77. package/{lib → esm}/components/index.d.ts +1 -1
  78. package/esm/components/index.d.ts.map +1 -0
  79. package/esm/components/index.js +15 -0
  80. package/esm/composables/index.d.ts.map +1 -0
  81. package/esm/composables/index.js +13 -0
  82. package/{lib → esm}/composables/useKeyboard.d.ts +1 -1
  83. package/esm/composables/useKeyboard.d.ts.map +1 -0
  84. package/esm/composables/useKeyboard.js +68 -0
  85. package/esm/composables/useKeyboard.js.map +1 -0
  86. package/esm/composables/useKeyboardPopup.d.ts +25 -0
  87. package/esm/composables/useKeyboardPopup.d.ts.map +1 -0
  88. package/esm/composables/useKeyboardPopup.js +136 -0
  89. package/esm/composables/useKeyboardPopup.js.map +1 -0
  90. package/esm/directives/index.d.ts.map +1 -0
  91. package/esm/directives/index.js +12 -0
  92. package/esm/directives/v-keyboard.d.ts.map +1 -0
  93. package/esm/directives/v-keyboard.js +64 -0
  94. package/esm/directives/v-keyboard.js.map +1 -0
  95. package/esm/index.d.ts +42 -0
  96. package/esm/index.d.ts.map +1 -0
  97. package/esm/index.js +34 -0
  98. package/esm/index.js.map +1 -0
  99. package/esm/plugins/engine-plugin.d.ts.map +1 -0
  100. package/esm/plugins/engine-plugin.js +53 -0
  101. package/esm/plugins/engine-plugin.js.map +1 -0
  102. package/esm/plugins/index.d.ts.map +1 -0
  103. package/esm/plugins/index.js +12 -0
  104. package/esm/style/css.js +1 -0
  105. package/esm/style/index.js +1 -0
  106. package/{es → esm}/style/index.less +1 -1
  107. package/esm/styles/index.less +5 -0
  108. package/esm/styles/keyboard.less +286 -0
  109. package/esm/styles/themes.less +164 -0
  110. package/lib/components/KeyboardKey.cjs +1 -1
  111. package/lib/components/KeyboardKey.cjs.map +1 -1
  112. package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs +16 -7
  113. package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  114. package/lib/components/KeyboardPopup.cjs +1 -1
  115. package/lib/components/KeyboardPopup.cjs.map +1 -1
  116. package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs +8 -5
  117. package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  118. package/lib/components/LicensePlateKeyboard.cjs +1 -1
  119. package/lib/components/LicensePlateKeyboard.cjs.map +1 -1
  120. package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs +2 -2
  121. package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  122. package/lib/components/VirtualKeyboard.cjs +1 -1
  123. package/lib/components/VirtualKeyboard.cjs.map +1 -1
  124. package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs +4 -4
  125. package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  126. package/lib/components/index.cjs +1 -1
  127. package/lib/components/index.d.cts +8 -0
  128. package/lib/components/index.d.cts.map +1 -0
  129. package/lib/composables/index.cjs +1 -1
  130. package/lib/composables/index.d.cts +6 -0
  131. package/lib/composables/index.d.cts.map +1 -0
  132. package/lib/composables/useKeyboard.cjs +8 -15
  133. package/lib/composables/useKeyboard.cjs.map +1 -1
  134. package/lib/composables/useKeyboard.d.cts +112 -0
  135. package/lib/composables/useKeyboard.d.cts.map +1 -0
  136. package/lib/composables/useKeyboardPopup.cjs +66 -49
  137. package/lib/composables/useKeyboardPopup.cjs.map +1 -1
  138. package/lib/composables/useKeyboardPopup.d.cts +24 -0
  139. package/lib/composables/useKeyboardPopup.d.cts.map +1 -0
  140. package/lib/directives/index.cjs +1 -1
  141. package/lib/directives/index.d.cts +5 -0
  142. package/lib/directives/index.d.cts.map +1 -0
  143. package/lib/directives/v-keyboard.cjs +10 -11
  144. package/lib/directives/v-keyboard.cjs.map +1 -1
  145. package/lib/directives/v-keyboard.d.cts +35 -0
  146. package/lib/directives/v-keyboard.d.cts.map +1 -0
  147. package/lib/index.cjs +2 -2
  148. package/lib/index.cjs.map +1 -1
  149. package/lib/index.d.cts +41 -0
  150. package/lib/index.d.cts.map +1 -0
  151. package/lib/plugins/engine-plugin.cjs +19 -3
  152. package/lib/plugins/engine-plugin.cjs.map +1 -1
  153. package/lib/plugins/engine-plugin.d.cts +36 -0
  154. package/lib/plugins/engine-plugin.d.cts.map +1 -0
  155. package/lib/plugins/index.cjs +1 -1
  156. package/lib/plugins/index.d.cts +5 -0
  157. package/lib/plugins/index.d.cts.map +1 -0
  158. package/lib/style/index.css +1 -1
  159. package/lib/styles/index.css +357 -195
  160. package/lib/styles/keyboard.css +92 -186
  161. package/lib/styles/themes.css +102 -178
  162. package/package.json +43 -34
  163. package/es/styles/index.less +0 -267
  164. package/es/styles/keyboard.less +0 -399
  165. package/es/styles/themes.less +0 -233
  166. package/lib/composables/useKeyboardPopup.d.ts +0 -73
  167. package/lib/index.d.ts +0 -42
  168. /package/{lib → esm}/composables/index.d.ts +0 -0
  169. /package/{lib → esm}/directives/index.d.ts +0 -0
  170. /package/{lib → esm}/directives/v-keyboard.d.ts +0 -0
  171. /package/{lib → esm}/plugins/engine-plugin.d.ts +0 -0
  172. /package/{lib → esm}/plugins/index.d.ts +0 -0
package/dist/index.css CHANGED
@@ -1,275 +1,425 @@
1
1
  /* style/index.less */
2
2
 
3
- /*# sourceMappingURL=src/style/index.less.map */
3
+ /*# sourceMappingURL=src\style\index.less.map */
4
4
 
5
5
  /* styles/index.less */
6
6
  /**
7
- * LDesign Keyboard 样式
8
- * @module styles
7
+ * LDesign Keyboard styles
9
8
  */
10
- /* 核心样式 */
11
- @import 'keyboard.css';
12
- /* 主题样式 */
13
- @import 'themes.css';
14
- /* 深色主题 */
15
- .dark,
16
- [data-theme="dark"] {
17
- --keyboard-bg: #374151;
18
- --keyboard-key-bg: #4b5563;
19
- --keyboard-key-color: #f9fafb;
20
- --keyboard-key-active-bg: #6b7280;
21
- --keyboard-fn-key-bg: #1f2937;
22
- --keyboard-fn-key-color: #f9fafb;
23
- --keyboard-fn-key-active-bg: #111827;
24
- --keyboard-primary-bg: #2563eb;
25
- --keyboard-primary-active-bg: #1d4ed8;
26
- }
27
- /* iOS 风格主题 */
28
- .keyboard-theme-ios {
29
- --keyboard-bg: #d1d5db;
30
- --keyboard-key-bg: #ffffff;
31
- --keyboard-key-color: #000000;
32
- --keyboard-key-active-bg: #c4c7cc;
33
- --keyboard-fn-key-bg: #adb3bc;
34
- --keyboard-fn-key-color: #000000;
35
- --keyboard-fn-key-active-bg: #8e9399;
36
- --keyboard-primary-bg: #007aff;
37
- --keyboard-primary-active-bg: #0062cc;
38
- --keyboard-key-radius: 5px;
39
- }
40
- /* Android 风格主题 */
41
- .keyboard-theme-android {
42
- --keyboard-bg: #263238;
43
- --keyboard-key-bg: #37474f;
44
- --keyboard-key-color: #ffffff;
45
- --keyboard-key-active-bg: #455a64;
46
- --keyboard-fn-key-bg: #455a64;
47
- --keyboard-fn-key-color: #90a4ae;
48
- --keyboard-fn-key-active-bg: #546e7a;
49
- --keyboard-primary-bg: #4285f4;
50
- --keyboard-primary-active-bg: #3367d6;
51
- --keyboard-key-radius: 4px;
52
- }
53
- /* 基础重置 */
9
+ /**
10
+ * LDesign Keyboard shared styles.
11
+ */
12
+ :root {
13
+ --keyboard-bg: var(--ld-bg-surface);
14
+ --keyboard-key-bg: var(--ld-bg-container);
15
+ --keyboard-key-color: var(--ld-text-primary);
16
+ --keyboard-key-active-bg: var(--ld-primary-50);
17
+ --keyboard-key-border: var(--ld-border);
18
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
19
+ --keyboard-fn-key-color: var(--ld-text-secondary);
20
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
21
+ --keyboard-primary-bg: var(--ld-primary-500);
22
+ --keyboard-primary-active-bg: var(--ld-primary-600);
23
+ --keyboard-primary-color: var(--ld-text-inverse);
24
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
25
+ --keyboard-key-height: var(--ld-px-48);
26
+ --keyboard-key-radius: var(--ld-radius-md);
27
+ --keyboard-key-gap: var(--ld-spacing-sm);
28
+ --keyboard-font-size: var(--ld-font-lg);
29
+ --keyboard-fn-font-size: var(--ld-font-sm);
30
+ --keyboard-padding: var(--ld-spacing-sm);
31
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
32
+ }
54
33
  .virtual-keyboard,
55
- .virtual-keyboard * {
34
+ .virtual-keyboard *,
35
+ .keyboard-popup,
36
+ .keyboard-popup * {
56
37
  box-sizing: border-box;
38
+ margin: 0;
39
+ padding: 0;
57
40
  }
58
41
  .virtual-keyboard {
59
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
42
+ display: flex;
43
+ flex-direction: column;
44
+ width: 100%;
45
+ padding: var(--keyboard-padding);
46
+ background-color: var(--keyboard-bg);
47
+ font-family: var(--ld-font-family);
60
48
  -webkit-font-smoothing: antialiased;
61
49
  -moz-osx-font-smoothing: grayscale;
62
- }
63
- /* 禁止选中 */
64
- .virtual-keyboard,
65
- .keyboard-popup {
66
50
  -webkit-touch-callout: none;
67
51
  -webkit-user-select: none;
68
52
  -moz-user-select: none;
69
53
  user-select: none;
70
54
  }
71
- /* 禁止 iOS 点击高亮 */
55
+ .virtual-keyboard__row,
56
+ .numpad-row {
57
+ display: flex;
58
+ justify-content: center;
59
+ width: 100%;
60
+ gap: var(--keyboard-key-gap);
61
+ margin-bottom: var(--keyboard-key-gap);
62
+ }
63
+ .virtual-keyboard__row:last-child {
64
+ margin-bottom: 0;
65
+ }
72
66
  .keyboard-key {
67
+ display: inline-flex;
68
+ flex: 1;
69
+ align-items: center;
70
+ justify-content: center;
71
+ min-width: 0;
72
+ height: var(--keyboard-key-height);
73
+ padding: 0 var(--ld-spacing-xs);
74
+ border: 0;
75
+ border-radius: var(--keyboard-key-radius);
76
+ background-color: var(--keyboard-key-bg);
77
+ color: var(--keyboard-key-color);
78
+ font-size: var(--keyboard-font-size);
79
+ font-weight: 500;
80
+ cursor: pointer;
81
+ touch-action: manipulation;
82
+ transition: background-color var(--ld-duration-fast), transform var(--ld-duration-fast);
73
83
  -webkit-tap-highlight-color: transparent;
84
+ box-shadow: var(--keyboard-key-shadow);
74
85
  }
75
- /* 移动端优化 */
76
- @media (max-width: 768px) {
77
- :root {
78
- --keyboard-key-height: 46px;
79
- --keyboard-font-size: 18px;
80
- }
86
+ .keyboard-key:active {
87
+ background-color: var(--keyboard-key-active-bg);
88
+ transform: scale(0.98);
89
+ }
90
+ .keyboard-key--disabled {
91
+ opacity: 0;
92
+ cursor: default;
93
+ pointer-events: none;
94
+ }
95
+ .keyboard-key--backspace,
96
+ .keyboard-key--shift,
97
+ .keyboard-key--tab,
98
+ .keyboard-key--clear,
99
+ .keyboard-key--close {
100
+ background-color: var(--keyboard-fn-key-bg);
101
+ color: var(--keyboard-fn-key-color);
102
+ font-size: var(--keyboard-fn-font-size);
103
+ font-weight: 400;
104
+ }
105
+ .keyboard-key--backspace:active,
106
+ .keyboard-key--shift:active,
107
+ .keyboard-key--tab:active,
108
+ .keyboard-key--clear:active,
109
+ .keyboard-key--close:active {
110
+ background-color: var(--keyboard-fn-key-active-bg);
111
+ }
112
+ .keyboard-key--shift.keyboard-key--active,
113
+ .keyboard-key--done,
114
+ .keyboard-key--enter {
115
+ background-color: var(--keyboard-primary-bg);
116
+ color: var(--keyboard-primary-color);
117
+ }
118
+ .keyboard-key--done:active,
119
+ .keyboard-key--enter:active {
120
+ background-color: var(--keyboard-primary-active-bg);
121
+ }
122
+ .keyboard-key--space {
123
+ flex: 4;
124
+ }
125
+ .key-placeholder {
126
+ background-color: transparent;
127
+ box-shadow: none;
128
+ cursor: default;
129
+ pointer-events: none;
130
+ }
131
+ .numpad-row .keyboard-key {
132
+ height: var(--ld-px-56);
133
+ font-size: var(--ld-font-xl);
134
+ }
135
+ .key-num,
136
+ .key-plate-province,
137
+ .key-plate-letter,
138
+ .key-plate-number {
139
+ background-color: var(--keyboard-key-bg);
140
+ color: var(--keyboard-key-color);
141
+ }
142
+ .key-numpad-fn,
143
+ .key-plate-fn,
144
+ .key-plate-switch {
145
+ background-color: var(--keyboard-fn-key-bg);
146
+ color: var(--keyboard-fn-key-color);
147
+ font-size: var(--keyboard-fn-font-size);
148
+ }
149
+ .key-numpad-done,
150
+ .key-plate-done {
151
+ background-color: var(--keyboard-primary-bg);
152
+ color: var(--keyboard-primary-color);
153
+ font-size: var(--keyboard-fn-font-size);
154
+ box-shadow: none;
155
+ }
156
+ .key-numpad-done:active,
157
+ .key-plate-done:active {
158
+ background-color: var(--keyboard-primary-active-bg);
159
+ }
160
+ .virtual-keyboard:has(.plate-keyboard-row) {
161
+ min-width: var(--ld-px-280);
162
+ }
163
+ .plate-keyboard-row {
164
+ display: flex;
165
+ flex-wrap: nowrap;
166
+ width: 100%;
167
+ gap: var(--ld-spacing-xs);
168
+ }
169
+ .plate-keyboard-row .keyboard-key {
170
+ flex: 1 1 0;
171
+ min-width: var(--ld-px-28);
172
+ height: var(--ld-px-42);
173
+ padding: 0 var(--ld-px-2);
174
+ font-size: var(--ld-font-sm);
175
+ border-radius: var(--ld-radius-sm);
176
+ }
177
+ .key-plate-fn {
178
+ flex: 1.2 1 0 !important;
179
+ }
180
+ .key-plate-done {
181
+ flex: 1.5 1 0 !important;
182
+ }
183
+ .key-plate-switch {
184
+ flex: 1.3 1 0 !important;
185
+ }
186
+ .key-plate-special {
187
+ background-color: var(--ld-warning-50);
188
+ color: var(--ld-warning-700);
189
+ }
190
+ .keyboard-popup {
191
+ position: fixed;
192
+ z-index: 1000;
193
+ overflow: hidden;
194
+ background-color: var(--keyboard-bg);
195
+ }
196
+ .keyboard-popup--desktop {
197
+ min-width: var(--ld-px-280);
198
+ border-radius: var(--ld-radius-lg);
199
+ box-shadow: var(--ld-shadow-lg, none);
200
+ }
201
+ .keyboard-popup--mobile {
202
+ right: 0;
203
+ bottom: 0;
204
+ left: 0;
205
+ border-radius: 0;
206
+ border-top-left-radius: var(--ld-radius-lg);
207
+ border-top-right-radius: var(--ld-radius-lg);
208
+ box-shadow: var(--ld-shadow-md, none);
209
+ }
210
+ .keyboard-mask {
211
+ position: fixed;
212
+ inset: 0;
213
+ z-index: 999;
214
+ background-color: var(--keyboard-mask-bg);
215
+ }
216
+ .keyboard-mask-enter-active,
217
+ .keyboard-mask-leave-active {
218
+ transition: opacity var(--ld-duration-fast);
219
+ }
220
+ .keyboard-mask-enter-from,
221
+ .keyboard-mask-leave-to {
222
+ opacity: 0;
223
+ }
224
+ .keyboard-fade-enter-active,
225
+ .keyboard-fade-leave-active {
226
+ transition: opacity var(--ld-duration-fast), transform var(--ld-duration-fast);
227
+ }
228
+ .keyboard-fade-enter-from,
229
+ .keyboard-fade-leave-to {
230
+ opacity: 0;
231
+ transform: translateY(calc(-1 * var(--ld-px-4))) scale(0.98);
232
+ }
233
+ .keyboard-slide-enter-active,
234
+ .keyboard-slide-leave-active {
235
+ transition: transform var(--ld-duration-normal);
236
+ }
237
+ .keyboard-slide-enter-from,
238
+ .keyboard-slide-leave-to {
239
+ transform: translateY(100%);
240
+ }
241
+ @media (max-width: 48em) {
81
242
  .virtual-keyboard {
82
- padding: 6px 2px;
243
+ padding: var(--ld-spacing-xs);
83
244
  }
84
245
  .keyboard-key {
85
- margin: 3px;
246
+ height: var(--ld-px-48);
86
247
  }
87
248
  }
88
- /* 横屏优化 */
89
- @media (orientation: landscape) and (max-height: 500px) {
90
- :root {
91
- --keyboard-key-height: 36px;
92
- --keyboard-font-size: 14px;
93
- }
94
- .virtual-keyboard {
95
- padding: 4px 2px;
249
+ @media (orientation: landscape) and (max-height: 32em) {
250
+ .keyboard-key {
251
+ height: var(--ld-px-36);
252
+ font-size: var(--ld-font-base);
96
253
  }
97
254
  }
98
- /* 安全区域适配 */
99
255
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
100
256
  .keyboard-popup--mobile {
101
- padding-bottom: calc(8px + env(safe-area-inset-bottom));
257
+ padding-bottom: env(safe-area-inset-bottom);
102
258
  }
103
259
  }
104
- /* =========================
105
- 数字键盘专用样式
106
- ========================= */
107
- .number-keyboard-row {
108
- display: flex;
109
- justify-content: center;
110
- width: 100%;
111
- }
112
- .number-keyboard-row .keyboard-key {
113
- flex: 1;
114
- max-width: 25%;
115
- height: 52px;
116
- font-size: 22px;
117
- font-weight: 500;
118
- }
119
- .number-keyboard-row .key-number {
120
- background-color: var(--keyboard-key-bg, #fff);
121
- color: var(--keyboard-key-color, #333);
260
+ /**
261
+ * Keyboard theme tokens.
262
+ * Theme values intentionally reference the shared LDesign color and size runtime.
263
+ */
264
+ [data-theme="miui"],
265
+ .keyboard-theme-miui {
266
+ --keyboard-bg: var(--ld-bg-surface);
267
+ --keyboard-key-bg: var(--ld-bg-container);
268
+ --keyboard-key-color: var(--ld-text-primary);
269
+ --keyboard-key-active-bg: var(--ld-warning-50);
270
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
271
+ --keyboard-fn-key-color: var(--ld-text-secondary);
272
+ --keyboard-fn-key-active-bg: var(--ld-warning-100);
273
+ --keyboard-primary-bg: var(--ld-warning-500);
274
+ --keyboard-primary-active-bg: var(--ld-warning-600);
275
+ --keyboard-primary-color: var(--ld-text-inverse);
276
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
277
+ --keyboard-key-border: var(--ld-border);
278
+ --keyboard-key-radius: var(--ld-radius-md);
279
+ --keyboard-key-gap: var(--ld-spacing-sm);
280
+ --keyboard-key-height: var(--ld-px-48);
281
+ --keyboard-font-size: var(--ld-font-lg);
282
+ --keyboard-fn-font-size: var(--ld-font-sm);
283
+ --keyboard-padding: var(--ld-spacing-sm);
284
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
122
285
  }
123
- .number-keyboard-row .key-side {
124
- background-color: var(--keyboard-fn-key-bg, #d4d6dc);
125
- color: var(--keyboard-fn-key-color, #333);
126
- font-size: 14px;
286
+ [data-theme="ios"],
287
+ .keyboard-theme-ios {
288
+ --keyboard-bg: var(--ld-bg-surface);
289
+ --keyboard-key-bg: var(--ld-bg-container);
290
+ --keyboard-key-color: var(--ld-text-primary);
291
+ --keyboard-key-active-bg: var(--ld-primary-50);
292
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
293
+ --keyboard-fn-key-color: var(--ld-text-primary);
294
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
295
+ --keyboard-primary-bg: var(--ld-primary-500);
296
+ --keyboard-primary-active-bg: var(--ld-primary-600);
297
+ --keyboard-primary-color: var(--ld-text-inverse);
298
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
299
+ --keyboard-key-border: var(--ld-border);
300
+ --keyboard-key-radius: var(--ld-radius-sm);
301
+ --keyboard-key-gap: var(--ld-spacing-sm);
302
+ --keyboard-key-height: var(--ld-px-42);
303
+ --keyboard-font-size: var(--ld-font-xl);
304
+ --keyboard-fn-font-size: var(--ld-font-base);
305
+ --keyboard-padding: var(--ld-spacing-xs);
306
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
127
307
  }
128
- .number-keyboard-row .key-side:active {
129
- background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
308
+ [data-theme="material"],
309
+ .keyboard-theme-material {
310
+ --keyboard-bg: var(--ld-bg-elevated);
311
+ --keyboard-key-bg: var(--ld-bg-container);
312
+ --keyboard-key-color: var(--ld-text-primary);
313
+ --keyboard-key-active-bg: var(--ld-success-50);
314
+ --keyboard-fn-key-bg: var(--ld-bg-surface);
315
+ --keyboard-fn-key-color: var(--ld-text-secondary);
316
+ --keyboard-fn-key-active-bg: var(--ld-success-100);
317
+ --keyboard-primary-bg: var(--ld-success-500);
318
+ --keyboard-primary-active-bg: var(--ld-success-600);
319
+ --keyboard-primary-color: var(--ld-text-inverse);
320
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
321
+ --keyboard-key-border: var(--ld-border);
322
+ --keyboard-key-radius: var(--ld-radius-sm);
323
+ --keyboard-key-gap: var(--ld-spacing-xs);
324
+ --keyboard-key-height: var(--ld-px-48);
325
+ --keyboard-font-size: var(--ld-font-lg);
326
+ --keyboard-fn-font-size: var(--ld-font-sm);
327
+ --keyboard-padding: var(--ld-spacing-sm);
328
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
130
329
  }
131
- .number-keyboard-row .key-done {
132
- background-color: var(--keyboard-primary-bg, #007aff);
133
- color: #fff;
330
+ [data-theme="minimal"],
331
+ .keyboard-theme-minimal {
332
+ --keyboard-bg: var(--ld-bg-surface);
333
+ --keyboard-key-bg: var(--ld-bg-container);
334
+ --keyboard-key-color: var(--ld-text-primary);
335
+ --keyboard-key-active-bg: var(--ld-primary-50);
336
+ --keyboard-fn-key-bg: var(--ld-bg-surface);
337
+ --keyboard-fn-key-color: var(--ld-text-secondary);
338
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
339
+ --keyboard-primary-bg: var(--ld-text-primary);
340
+ --keyboard-primary-active-bg: var(--ld-text-secondary);
341
+ --keyboard-primary-color: var(--ld-bg-container);
342
+ --keyboard-key-border: var(--ld-border-subtle);
343
+ --keyboard-key-radius: var(--ld-radius-lg);
344
+ --keyboard-key-gap: var(--ld-spacing-sm);
345
+ --keyboard-key-height: var(--ld-px-48);
346
+ --keyboard-font-size: var(--ld-font-base);
347
+ --keyboard-fn-font-size: var(--ld-font-sm);
348
+ --keyboard-padding: var(--ld-spacing-md);
349
+ --keyboard-key-shadow: none;
134
350
  }
135
- .number-keyboard-row .key-done:active {
136
- background-color: var(--keyboard-primary-active-bg, #0062cc);
351
+ [data-theme="dark"],
352
+ .keyboard-theme-dark {
353
+ --keyboard-bg: var(--ld-bg-surface);
354
+ --keyboard-key-bg: var(--ld-bg-elevated);
355
+ --keyboard-key-color: var(--ld-text-primary);
356
+ --keyboard-key-active-bg: var(--ld-primary-100);
357
+ --keyboard-fn-key-bg: var(--ld-bg-container);
358
+ --keyboard-fn-key-color: var(--ld-text-secondary);
359
+ --keyboard-fn-key-active-bg: var(--ld-primary-200);
360
+ --keyboard-primary-bg: var(--ld-primary-500);
361
+ --keyboard-primary-active-bg: var(--ld-primary-600);
362
+ --keyboard-primary-color: var(--ld-text-inverse);
363
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
364
+ --keyboard-key-border: var(--ld-border);
365
+ --keyboard-key-radius: var(--ld-radius-md);
366
+ --keyboard-key-gap: var(--ld-spacing-sm);
367
+ --keyboard-key-height: var(--ld-px-48);
368
+ --keyboard-font-size: var(--ld-font-lg);
369
+ --keyboard-fn-font-size: var(--ld-font-sm);
370
+ --keyboard-padding: var(--ld-spacing-sm);
371
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
137
372
  }
138
- .number-keyboard-row .key-decimal,
139
- .number-keyboard-row .key-double-zero {
140
- background-color: var(--keyboard-key-bg, #fff);
141
- font-size: 18px;
373
+ [data-theme="green"],
374
+ .keyboard-theme-green {
375
+ --keyboard-primary-bg: var(--ld-success-500);
376
+ --keyboard-primary-active-bg: var(--ld-success-600);
142
377
  }
143
- .number-keyboard-row .key-placeholder {
144
- background-color: transparent;
145
- box-shadow: none;
146
- cursor: default;
378
+ [data-theme="blue"],
379
+ .keyboard-theme-blue {
380
+ --keyboard-primary-bg: var(--ld-info-500);
381
+ --keyboard-primary-active-bg: var(--ld-info-600);
147
382
  }
148
- .number-keyboard-row .key-placeholder:active {
149
- transform: none;
150
- background-color: transparent;
383
+ .keyboard-theme-light {
384
+ color-scheme: light;
151
385
  }
152
- /* =========================
153
- PC端专用样式
154
- ========================= */
155
- .keyboard-popup--desktop {
156
- min-width: 320px;
157
- }
158
- .keyboard-popup--desktop .keyboard-key {
159
- height: 40px;
160
- font-size: 15px;
161
- border-radius: 5px;
162
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
163
- }
164
- .keyboard-popup--desktop .keyboard-key:hover {
165
- background-color: var(--keyboard-key-active-bg, #e5e7eb);
166
- }
167
- .keyboard-popup--desktop .keyboard-key--backspace:hover,
168
- .keyboard-popup--desktop .keyboard-key--shift:hover,
169
- .keyboard-popup--desktop .keyboard-key--tab:hover,
170
- .keyboard-popup--desktop .keyboard-key--clear:hover,
171
- .keyboard-popup--desktop .keyboard-key--close:hover {
172
- background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
173
- }
174
- .keyboard-popup--desktop .keyboard-key--done:hover,
175
- .keyboard-popup--desktop .keyboard-key--enter:hover {
176
- background-color: var(--keyboard-primary-active-bg, #0062cc);
177
- }
178
- /* PC端数字键盘 */
179
- .keyboard-popup--desktop .number-keyboard-row .keyboard-key {
180
- height: 44px;
181
- font-size: 18px;
182
- }
183
- .keyboard-popup--desktop .number-keyboard-row .key-side {
184
- font-size: 13px;
185
- }
186
- /* =========================
187
- 移动端专用样式
188
- ========================= */
189
- .keyboard-popup--mobile {
190
- width: 100%;
386
+ .keyboard-theme-dark {
387
+ color-scheme: dark;
191
388
  }
192
- .keyboard-popup--mobile .keyboard-key {
193
- height: 46px;
194
- font-size: 18px;
195
- border-radius: 6px;
196
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
197
- }
198
- /* 移动端数字键盘 */
199
- .keyboard-popup--mobile .number-keyboard-row .keyboard-key {
200
- height: 54px;
201
- font-size: 24px;
202
- border-radius: 8px;
203
- }
204
- .keyboard-popup--mobile .number-keyboard-row .key-side {
205
- font-size: 15px;
206
- }
207
- /* =========================
208
- 键盘顶部栅栏(移动端)
209
- ========================= */
210
- .keyboard-toolbar {
211
- display: flex;
212
- justify-content: space-between;
213
- align-items: center;
214
- padding: 8px 16px;
215
- background-color: var(--keyboard-bg, #d1d5db);
216
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
217
- }
218
- .keyboard-toolbar__title {
219
- font-size: 14px;
220
- color: var(--keyboard-fn-key-color, #666);
221
- }
222
- .keyboard-toolbar__done {
223
- padding: 6px 16px;
224
- background: none;
225
- border: none;
226
- color: var(--keyboard-primary-bg, #007aff);
227
- font-size: 15px;
228
- font-weight: 500;
229
- cursor: pointer;
389
+ .keyboard-popup,
390
+ .virtual-keyboard {
391
+ transition: background-color var(--ld-duration-fast);
230
392
  }
231
- .keyboard-toolbar__done:active {
232
- opacity: 0.7;
393
+ .keyboard-key {
394
+ transition: background-color var(--ld-duration-fast), transform var(--ld-duration-fast);
233
395
  }
234
- /*# sourceMappingURL=src/styles/index.less.map */
396
+ /*# sourceMappingURL=src\styles\index.less.map */
235
397
 
236
398
  /* styles/keyboard.less */
237
399
  /**
238
- * LDesign Keyboard - 核心样式
239
- * 简洁现代的默认主题
400
+ * LDesign Keyboard shared styles.
240
401
  */
241
- /* ====================
242
- CSS 变量 - 简洁主题
243
- ==================== */
244
402
  :root {
245
- /* 键盘背景 */
246
- --keyboard-bg: #f7f7f7;
247
- /* 普通按键 */
248
- --keyboard-key-bg: #ffffff;
249
- --keyboard-key-color: #333333;
250
- --keyboard-key-active-bg: #e5e5e5;
251
- --keyboard-key-border: #e0e0e0;
252
- /* 功能键 */
253
- --keyboard-fn-bg: #e8e8e8;
254
- --keyboard-fn-color: #666666;
255
- --keyboard-fn-active-bg: #d8d8d8;
256
- /* 主色调按键 */
257
- --keyboard-primary-bg: #2563eb;
258
- --keyboard-primary-active-bg: #1d4ed8;
259
- --keyboard-primary-color: #ffffff;
260
- /* 按键尺寸 */
261
- --keyboard-key-height: 48px;
262
- --keyboard-key-radius: 8px;
263
- --keyboard-key-gap: 6px;
264
- /* 字体 */
265
- --keyboard-font-size: 20px;
266
- --keyboard-fn-font-size: 14px;
267
- /* 动画 */
268
- --keyboard-transition: 80ms ease-out;
269
- }
270
- /* ====================
271
- 基础重置
272
- ==================== */
403
+ --keyboard-bg: var(--ld-bg-surface);
404
+ --keyboard-key-bg: var(--ld-bg-container);
405
+ --keyboard-key-color: var(--ld-text-primary);
406
+ --keyboard-key-active-bg: var(--ld-primary-50);
407
+ --keyboard-key-border: var(--ld-border);
408
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
409
+ --keyboard-fn-key-color: var(--ld-text-secondary);
410
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
411
+ --keyboard-primary-bg: var(--ld-primary-500);
412
+ --keyboard-primary-active-bg: var(--ld-primary-600);
413
+ --keyboard-primary-color: var(--ld-text-inverse);
414
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
415
+ --keyboard-key-height: var(--ld-px-48);
416
+ --keyboard-key-radius: var(--ld-radius-md);
417
+ --keyboard-key-gap: var(--ld-spacing-sm);
418
+ --keyboard-font-size: var(--ld-font-lg);
419
+ --keyboard-fn-font-size: var(--ld-font-sm);
420
+ --keyboard-padding: var(--ld-spacing-sm);
421
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
422
+ }
273
423
  .virtual-keyboard,
274
424
  .virtual-keyboard *,
275
425
  .keyboard-popup,
@@ -279,7 +429,12 @@
279
429
  padding: 0;
280
430
  }
281
431
  .virtual-keyboard {
282
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
432
+ display: flex;
433
+ flex-direction: column;
434
+ width: 100%;
435
+ padding: var(--keyboard-padding);
436
+ background-color: var(--keyboard-bg);
437
+ font-family: var(--ld-font-family);
283
438
  -webkit-font-smoothing: antialiased;
284
439
  -moz-osx-font-smoothing: grayscale;
285
440
  -webkit-touch-callout: none;
@@ -287,17 +442,8 @@
287
442
  -moz-user-select: none;
288
443
  user-select: none;
289
444
  }
290
- /* ====================
291
- 键盘容器
292
- ==================== */
293
- .virtual-keyboard {
294
- display: flex;
295
- flex-direction: column;
296
- padding: 8px;
297
- background-color: var(--keyboard-bg);
298
- width: 100%;
299
- }
300
- .virtual-keyboard__row {
445
+ .virtual-keyboard__row,
446
+ .numpad-row {
301
447
  display: flex;
302
448
  justify-content: center;
303
449
  width: 100%;
@@ -307,18 +453,15 @@
307
453
  .virtual-keyboard__row:last-child {
308
454
  margin-bottom: 0;
309
455
  }
310
- /* ====================
311
- 按键基础样式
312
- ==================== */
313
456
  .keyboard-key {
314
457
  display: inline-flex;
458
+ flex: 1;
315
459
  align-items: center;
316
460
  justify-content: center;
317
- flex: 1;
318
- height: var(--keyboard-key-height);
319
461
  min-width: 0;
320
- padding: 0 4px;
321
- border: none;
462
+ height: var(--keyboard-key-height);
463
+ padding: 0 var(--ld-spacing-xs);
464
+ border: 0;
322
465
  border-radius: var(--keyboard-key-radius);
323
466
  background-color: var(--keyboard-key-bg);
324
467
  color: var(--keyboard-key-color);
@@ -326,9 +469,9 @@
326
469
  font-weight: 500;
327
470
  cursor: pointer;
328
471
  touch-action: manipulation;
329
- transition: background-color var(--keyboard-transition), transform var(--keyboard-transition);
472
+ transition: background-color var(--ld-duration-fast), transform var(--ld-duration-fast);
330
473
  -webkit-tap-highlight-color: transparent;
331
- box-shadow: 0 1px 0 var(--keyboard-key-border);
474
+ box-shadow: var(--keyboard-key-shadow);
332
475
  }
333
476
  .keyboard-key:active {
334
477
  background-color: var(--keyboard-key-active-bg);
@@ -339,192 +482,130 @@
339
482
  cursor: default;
340
483
  pointer-events: none;
341
484
  }
342
- /* ====================
343
- 功能键样式
344
- ==================== */
345
485
  .keyboard-key--backspace,
346
486
  .keyboard-key--shift,
347
487
  .keyboard-key--tab,
348
488
  .keyboard-key--clear,
349
489
  .keyboard-key--close {
350
- background-color: var(--keyboard-fn-bg);
351
- color: var(--keyboard-fn-color);
490
+ background-color: var(--keyboard-fn-key-bg);
491
+ color: var(--keyboard-fn-key-color);
352
492
  font-size: var(--keyboard-fn-font-size);
353
493
  font-weight: 400;
354
- box-shadow: 0 1px 0 var(--keyboard-key-border);
355
494
  }
356
495
  .keyboard-key--backspace:active,
357
496
  .keyboard-key--shift:active,
358
497
  .keyboard-key--tab:active,
359
498
  .keyboard-key--clear:active,
360
499
  .keyboard-key--close:active {
361
- background-color: var(--keyboard-fn-active-bg);
362
- }
363
- /* Shift 激活状态 */
364
- .keyboard-key--shift.keyboard-key--active {
365
- background-color: var(--keyboard-primary-bg);
366
- color: var(--keyboard-primary-color);
500
+ background-color: var(--keyboard-fn-key-active-bg);
367
501
  }
368
- /* ====================
369
- 主色按键(完成/确认)
370
- ==================== */
502
+ .keyboard-key--shift.keyboard-key--active,
371
503
  .keyboard-key--done,
372
504
  .keyboard-key--enter {
373
505
  background-color: var(--keyboard-primary-bg);
374
506
  color: var(--keyboard-primary-color);
375
- font-size: var(--keyboard-fn-font-size);
376
- font-weight: 500;
377
- box-shadow: none;
378
507
  }
379
508
  .keyboard-key--done:active,
380
509
  .keyboard-key--enter:active {
381
510
  background-color: var(--keyboard-primary-active-bg);
382
511
  }
383
- /* ====================
384
- 空格键
385
- ==================== */
386
512
  .keyboard-key--space {
387
513
  flex: 4;
388
514
  }
389
- /* ====================
390
- 占位键(透明)
391
- ==================== */
392
515
  .key-placeholder {
393
- background-color: transparent !important;
394
- box-shadow: none !important;
516
+ background-color: transparent;
517
+ box-shadow: none;
395
518
  cursor: default;
396
519
  pointer-events: none;
397
520
  }
398
- /* ====================
399
- 数字键盘通用样式
400
- ==================== */
401
- .numpad-row {
402
- display: flex;
403
- gap: var(--keyboard-key-gap);
404
- width: 100%;
405
- }
406
521
  .numpad-row .keyboard-key {
407
- flex: 1;
408
- height: 54px;
409
- font-size: 24px;
410
- font-weight: 500;
522
+ height: var(--ld-px-56);
523
+ font-size: var(--ld-font-xl);
411
524
  }
412
- /* 数字键 */
413
- .key-num {
525
+ .key-num,
526
+ .key-plate-province,
527
+ .key-plate-letter,
528
+ .key-plate-number {
414
529
  background-color: var(--keyboard-key-bg);
415
530
  color: var(--keyboard-key-color);
416
531
  }
417
- /* 功能键 */
418
- .key-numpad-fn {
419
- background-color: var(--keyboard-fn-bg);
420
- color: var(--keyboard-fn-color);
421
- font-size: 14px;
422
- font-weight: 400;
532
+ .key-numpad-fn,
533
+ .key-plate-fn,
534
+ .key-plate-switch {
535
+ background-color: var(--keyboard-fn-key-bg);
536
+ color: var(--keyboard-fn-key-color);
537
+ font-size: var(--keyboard-fn-font-size);
423
538
  }
424
- /* 完成键 */
425
- .key-numpad-done {
539
+ .key-numpad-done,
540
+ .key-plate-done {
426
541
  background-color: var(--keyboard-primary-bg);
427
542
  color: var(--keyboard-primary-color);
428
- font-size: 16px;
429
- font-weight: 500;
543
+ font-size: var(--keyboard-fn-font-size);
430
544
  box-shadow: none;
431
545
  }
432
- .key-numpad-done:active {
546
+ .key-numpad-done:active,
547
+ .key-plate-done:active {
433
548
  background-color: var(--keyboard-primary-active-bg);
434
549
  }
435
- /* ====================
436
- 车牌键盘样式
437
- ==================== */
438
550
  .virtual-keyboard:has(.plate-keyboard-row) {
439
- min-width: 340px;
551
+ min-width: var(--ld-px-280);
440
552
  }
441
553
  .plate-keyboard-row {
442
554
  display: flex;
443
- gap: 3px;
444
- width: 100%;
445
555
  flex-wrap: nowrap;
556
+ width: 100%;
557
+ gap: var(--ld-spacing-xs);
446
558
  }
447
559
  .plate-keyboard-row .keyboard-key {
448
560
  flex: 1 1 0;
449
- height: 42px;
450
- min-width: 28px;
451
- max-width: none;
452
- padding: 0 2px;
453
- font-size: 15px;
454
- font-weight: 500;
455
- border-radius: 5px;
456
- }
457
- .key-plate-province,
458
- .key-plate-letter,
459
- .key-plate-number {
460
- background-color: var(--keyboard-key-bg);
561
+ min-width: var(--ld-px-28);
562
+ height: var(--ld-px-42);
563
+ padding: 0 var(--ld-px-2);
564
+ font-size: var(--ld-font-sm);
565
+ border-radius: var(--ld-radius-sm);
461
566
  }
462
567
  .key-plate-fn {
463
- background-color: var(--keyboard-fn-bg);
464
- font-size: 12px;
465
568
  flex: 1.2 1 0 !important;
466
569
  }
467
570
  .key-plate-done {
468
- background-color: var(--keyboard-primary-bg);
469
- color: var(--keyboard-primary-color);
470
- font-size: 13px;
471
- box-shadow: none;
472
571
  flex: 1.5 1 0 !important;
473
572
  }
474
573
  .key-plate-switch {
475
- background-color: var(--keyboard-fn-bg);
476
- font-size: 12px;
477
574
  flex: 1.3 1 0 !important;
478
575
  }
479
576
  .key-plate-special {
480
- background-color: #fef3c7;
481
- color: #92400e;
577
+ background-color: var(--ld-warning-50);
578
+ color: var(--ld-warning-700);
482
579
  }
483
- /* ====================
484
- 弹出层样式
485
- ==================== */
486
580
  .keyboard-popup {
487
581
  position: fixed;
488
582
  z-index: 1000;
489
- background-color: var(--keyboard-bg);
490
583
  overflow: hidden;
584
+ background-color: var(--keyboard-bg);
491
585
  }
492
586
  .keyboard-popup--desktop {
493
- border-radius: 12px;
494
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
495
- min-width: 300px;
587
+ min-width: var(--ld-px-280);
588
+ border-radius: var(--ld-radius-lg);
589
+ box-shadow: var(--ld-shadow-lg, none);
496
590
  }
497
591
  .keyboard-popup--mobile {
498
- position: fixed;
499
- left: 0;
500
592
  right: 0;
501
593
  bottom: 0;
594
+ left: 0;
502
595
  border-radius: 0;
503
- border-top-left-radius: 12px;
504
- border-top-right-radius: 12px;
505
- box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
596
+ border-top-left-radius: var(--ld-radius-lg);
597
+ border-top-right-radius: var(--ld-radius-lg);
598
+ box-shadow: var(--ld-shadow-md, none);
506
599
  }
507
- /* 安全区域 */
508
- @supports (padding-bottom: env(safe-area-inset-bottom)) {
509
- .keyboard-popup--mobile {
510
- padding-bottom: env(safe-area-inset-bottom);
511
- }
512
- }
513
- /* ====================
514
- 遮罩层
515
- ==================== */
516
600
  .keyboard-mask {
517
601
  position: fixed;
518
602
  inset: 0;
519
- background-color: rgba(0, 0, 0, 0.3);
520
603
  z-index: 999;
604
+ background-color: var(--keyboard-mask-bg);
521
605
  }
522
- /* ====================
523
- 动画
524
- ==================== */
525
606
  .keyboard-mask-enter-active,
526
607
  .keyboard-mask-leave-active {
527
- transition: opacity 0.2s ease;
608
+ transition: opacity var(--ld-duration-fast);
528
609
  }
529
610
  .keyboard-mask-enter-from,
530
611
  .keyboard-mask-leave-to {
@@ -532,266 +613,177 @@
532
613
  }
533
614
  .keyboard-fade-enter-active,
534
615
  .keyboard-fade-leave-active {
535
- transition: opacity 0.15s ease, transform 0.15s ease;
616
+ transition: opacity var(--ld-duration-fast), transform var(--ld-duration-fast);
536
617
  }
537
618
  .keyboard-fade-enter-from,
538
619
  .keyboard-fade-leave-to {
539
620
  opacity: 0;
540
- transform: translateY(-4px) scale(0.98);
621
+ transform: translateY(calc(-1 * var(--ld-px-4))) scale(0.98);
541
622
  }
542
623
  .keyboard-slide-enter-active,
543
624
  .keyboard-slide-leave-active {
544
- transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
625
+ transition: transform var(--ld-duration-normal);
545
626
  }
546
627
  .keyboard-slide-enter-from,
547
628
  .keyboard-slide-leave-to {
548
629
  transform: translateY(100%);
549
630
  }
550
- /* ====================
551
- 移动端适配
552
- ==================== */
553
- @media (max-width: 768px) {
631
+ @media (max-width: 48em) {
554
632
  .virtual-keyboard {
555
- padding: 6px;
633
+ padding: var(--ld-spacing-xs);
556
634
  }
557
635
  .keyboard-key {
558
- height: 44px;
559
- }
560
- .numpad-row .keyboard-key {
561
- height: 52px;
562
- font-size: 22px;
563
- }
564
- .plate-keyboard-row .keyboard-key {
565
- height: 40px;
566
- font-size: 15px;
636
+ height: var(--ld-px-48);
567
637
  }
568
638
  }
569
- /* ====================
570
- 横屏适配
571
- ==================== */
572
- @media (orientation: landscape) and (max-height: 500px) {
639
+ @media (orientation: landscape) and (max-height: 32em) {
573
640
  .keyboard-key {
574
- height: 36px;
575
- font-size: 16px;
641
+ height: var(--ld-px-36);
642
+ font-size: var(--ld-font-base);
576
643
  }
577
- .numpad-row .keyboard-key {
578
- height: 42px;
579
- font-size: 18px;
644
+ }
645
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
646
+ .keyboard-popup--mobile {
647
+ padding-bottom: env(safe-area-inset-bottom);
580
648
  }
581
649
  }
582
- /*# sourceMappingURL=src/styles/keyboard.less.map */
650
+ /*# sourceMappingURL=src\styles\keyboard.less.map */
583
651
 
584
652
  /* styles/themes.less */
585
653
  /**
586
- * LDesign Keyboard - 主题预设
587
- * 简洁 · 现代 · 优雅
654
+ * Keyboard theme tokens.
655
+ * Theme values intentionally reference the shared LDesign color and size runtime.
588
656
  */
589
- /* ====================
590
- MIUI 主题 - 小米风格(默认)
591
- ==================== */
592
657
  [data-theme="miui"],
593
658
  .keyboard-theme-miui {
594
- --keyboard-bg: #f5f5f5;
595
- --keyboard-key-bg: #ffffff;
596
- --keyboard-key-color: #1a1a1a;
597
- --keyboard-key-active-bg: #e8e8e8;
598
- --keyboard-fn-key-bg: #e0e0e0;
599
- --keyboard-fn-key-color: #666666;
600
- --keyboard-fn-key-active-bg: #d0d0d0;
601
- --keyboard-primary-bg: #ff6700;
602
- --keyboard-primary-active-bg: #e55d00;
603
- --keyboard-primary-color: #ffffff;
604
- --keyboard-key-radius: 8px;
605
- --keyboard-key-gap: 6px;
606
- --keyboard-key-height: 46px;
607
- --keyboard-font-size: 18px;
608
- --keyboard-fn-font-size: 14px;
609
- --keyboard-padding: 8px;
610
- --keyboard-key-shadow: none;
611
- }
612
- [data-theme="miui"] .keyboard-key,
613
- .keyboard-theme-miui .keyboard-key {
614
- font-weight: 500;
659
+ --keyboard-bg: var(--ld-bg-surface);
660
+ --keyboard-key-bg: var(--ld-bg-container);
661
+ --keyboard-key-color: var(--ld-text-primary);
662
+ --keyboard-key-active-bg: var(--ld-warning-50);
663
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
664
+ --keyboard-fn-key-color: var(--ld-text-secondary);
665
+ --keyboard-fn-key-active-bg: var(--ld-warning-100);
666
+ --keyboard-primary-bg: var(--ld-warning-500);
667
+ --keyboard-primary-active-bg: var(--ld-warning-600);
668
+ --keyboard-primary-color: var(--ld-text-inverse);
669
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
670
+ --keyboard-key-border: var(--ld-border);
671
+ --keyboard-key-radius: var(--ld-radius-md);
672
+ --keyboard-key-gap: var(--ld-spacing-sm);
673
+ --keyboard-key-height: var(--ld-px-48);
674
+ --keyboard-font-size: var(--ld-font-lg);
675
+ --keyboard-fn-font-size: var(--ld-font-sm);
676
+ --keyboard-padding: var(--ld-spacing-sm);
677
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
615
678
  }
616
- /* ====================
617
- iOS 主题 - 苹果风格
618
- ==================== */
619
679
  [data-theme="ios"],
620
680
  .keyboard-theme-ios {
621
- --keyboard-bg: #d1d3d9;
622
- --keyboard-key-bg: #ffffff;
623
- --keyboard-key-color: #000000;
624
- --keyboard-key-active-bg: #c8cad0;
625
- --keyboard-key-border: #a8aab4;
626
- --keyboard-fn-key-bg: #adb0b8;
627
- --keyboard-fn-key-color: #000000;
628
- --keyboard-fn-key-active-bg: #9ea1a9;
629
- --keyboard-primary-bg: #007aff;
630
- --keyboard-primary-active-bg: #0066d6;
631
- --keyboard-primary-color: #ffffff;
632
- --keyboard-key-radius: 5px;
633
- --keyboard-key-gap: 6px;
634
- --keyboard-key-height: 43px;
635
- --keyboard-font-size: 23px;
636
- --keyboard-fn-font-size: 15px;
637
- --keyboard-padding: 4px;
638
- --keyboard-key-shadow: 0 1px 0 #a8aab4;
639
- }
640
- [data-theme="ios"] .keyboard-key,
641
- .keyboard-theme-ios .keyboard-key {
642
- font-weight: 400;
681
+ --keyboard-bg: var(--ld-bg-surface);
682
+ --keyboard-key-bg: var(--ld-bg-container);
683
+ --keyboard-key-color: var(--ld-text-primary);
684
+ --keyboard-key-active-bg: var(--ld-primary-50);
685
+ --keyboard-fn-key-bg: var(--ld-bg-elevated);
686
+ --keyboard-fn-key-color: var(--ld-text-primary);
687
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
688
+ --keyboard-primary-bg: var(--ld-primary-500);
689
+ --keyboard-primary-active-bg: var(--ld-primary-600);
690
+ --keyboard-primary-color: var(--ld-text-inverse);
691
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
692
+ --keyboard-key-border: var(--ld-border);
693
+ --keyboard-key-radius: var(--ld-radius-sm);
694
+ --keyboard-key-gap: var(--ld-spacing-sm);
695
+ --keyboard-key-height: var(--ld-px-42);
696
+ --keyboard-font-size: var(--ld-font-xl);
697
+ --keyboard-fn-font-size: var(--ld-font-base);
698
+ --keyboard-padding: var(--ld-spacing-xs);
699
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
643
700
  }
644
- [data-theme="ios"] .keyboard-key:active,
645
- .keyboard-theme-ios .keyboard-key:active {
646
- transform: none;
647
- }
648
- /* ====================
649
- Material 主题 - 质感设计
650
- ==================== */
651
701
  [data-theme="material"],
652
702
  .keyboard-theme-material {
653
- --keyboard-bg: #263238;
654
- --keyboard-key-bg: #37474f;
655
- --keyboard-key-color: #ffffff;
656
- --keyboard-key-active-bg: #455a64;
657
- --keyboard-fn-key-bg: #455a64;
658
- --keyboard-fn-key-color: #b0bec5;
659
- --keyboard-fn-key-active-bg: #546e7a;
660
- --keyboard-primary-bg: #4caf50;
661
- --keyboard-primary-active-bg: #43a047;
662
- --keyboard-primary-color: #ffffff;
663
- --keyboard-key-radius: 4px;
664
- --keyboard-key-gap: 4px;
665
- --keyboard-key-height: 48px;
666
- --keyboard-font-size: 20px;
667
- --keyboard-fn-font-size: 14px;
668
- --keyboard-padding: 6px;
669
- --keyboard-key-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
670
- }
671
- [data-theme="material"] .keyboard-key,
672
- .keyboard-theme-material .keyboard-key {
673
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
674
- }
675
- [data-theme="material"] .keyboard-key:active,
676
- .keyboard-theme-material .keyboard-key:active {
677
- transform: none;
678
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
679
- }
680
- /* ====================
681
- Minimal 极简主题 - 无边框
682
- ==================== */
703
+ --keyboard-bg: var(--ld-bg-elevated);
704
+ --keyboard-key-bg: var(--ld-bg-container);
705
+ --keyboard-key-color: var(--ld-text-primary);
706
+ --keyboard-key-active-bg: var(--ld-success-50);
707
+ --keyboard-fn-key-bg: var(--ld-bg-surface);
708
+ --keyboard-fn-key-color: var(--ld-text-secondary);
709
+ --keyboard-fn-key-active-bg: var(--ld-success-100);
710
+ --keyboard-primary-bg: var(--ld-success-500);
711
+ --keyboard-primary-active-bg: var(--ld-success-600);
712
+ --keyboard-primary-color: var(--ld-text-inverse);
713
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
714
+ --keyboard-key-border: var(--ld-border);
715
+ --keyboard-key-radius: var(--ld-radius-sm);
716
+ --keyboard-key-gap: var(--ld-spacing-xs);
717
+ --keyboard-key-height: var(--ld-px-48);
718
+ --keyboard-font-size: var(--ld-font-lg);
719
+ --keyboard-fn-font-size: var(--ld-font-sm);
720
+ --keyboard-padding: var(--ld-spacing-sm);
721
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
722
+ }
683
723
  [data-theme="minimal"],
684
724
  .keyboard-theme-minimal {
685
- --keyboard-bg: rgba(250, 250, 250, 0.95);
686
- --keyboard-key-bg: transparent;
687
- --keyboard-key-color: #333333;
688
- --keyboard-key-active-bg: rgba(0, 0, 0, 0.08);
689
- --keyboard-fn-key-bg: transparent;
690
- --keyboard-fn-key-color: #888888;
691
- --keyboard-fn-key-active-bg: rgba(0, 0, 0, 0.08);
692
- --keyboard-primary-bg: #333333;
693
- --keyboard-primary-active-bg: #1a1a1a;
694
- --keyboard-primary-color: #ffffff;
695
- --keyboard-key-radius: 12px;
696
- --keyboard-key-gap: 8px;
697
- --keyboard-key-height: 44px;
698
- --keyboard-font-size: 17px;
699
- --keyboard-fn-font-size: 13px;
700
- --keyboard-padding: 12px;
725
+ --keyboard-bg: var(--ld-bg-surface);
726
+ --keyboard-key-bg: var(--ld-bg-container);
727
+ --keyboard-key-color: var(--ld-text-primary);
728
+ --keyboard-key-active-bg: var(--ld-primary-50);
729
+ --keyboard-fn-key-bg: var(--ld-bg-surface);
730
+ --keyboard-fn-key-color: var(--ld-text-secondary);
731
+ --keyboard-fn-key-active-bg: var(--ld-primary-100);
732
+ --keyboard-primary-bg: var(--ld-text-primary);
733
+ --keyboard-primary-active-bg: var(--ld-text-secondary);
734
+ --keyboard-primary-color: var(--ld-bg-container);
735
+ --keyboard-key-border: var(--ld-border-subtle);
736
+ --keyboard-key-radius: var(--ld-radius-lg);
737
+ --keyboard-key-gap: var(--ld-spacing-sm);
738
+ --keyboard-key-height: var(--ld-px-48);
739
+ --keyboard-font-size: var(--ld-font-base);
740
+ --keyboard-fn-font-size: var(--ld-font-sm);
741
+ --keyboard-padding: var(--ld-spacing-md);
701
742
  --keyboard-key-shadow: none;
702
743
  }
703
- [data-theme="minimal"] .keyboard-key,
704
- .keyboard-theme-minimal .keyboard-key {
705
- box-shadow: none;
706
- }
707
- [data-theme="minimal"] .keyboard-key:active,
708
- .keyboard-theme-minimal .keyboard-key:active {
709
- transform: scale(0.95);
710
- }
711
- /* ====================
712
- Dark 深色主题
713
- ==================== */
714
744
  [data-theme="dark"],
715
745
  .keyboard-theme-dark {
716
- --keyboard-bg: #1c1c1e;
717
- --keyboard-key-bg: #3a3a3c;
718
- --keyboard-key-color: #ffffff;
719
- --keyboard-key-active-bg: #4a4a4c;
720
- --keyboard-fn-key-bg: #2c2c2e;
721
- --keyboard-fn-key-color: #ebebf5;
722
- --keyboard-fn-key-active-bg: #3c3c3e;
723
- --keyboard-primary-bg: #0a84ff;
724
- --keyboard-primary-active-bg: #0070e0;
725
- --keyboard-primary-color: #ffffff;
726
- --keyboard-key-radius: 8px;
727
- --keyboard-key-gap: 6px;
728
- --keyboard-key-height: 45px;
729
- --keyboard-font-size: 18px;
730
- --keyboard-fn-font-size: 14px;
731
- --keyboard-padding: 8px;
732
- --keyboard-key-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
733
- }
734
- [data-theme="dark"] .keyboard-key,
735
- .keyboard-theme-dark .keyboard-key {
736
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
737
- }
738
- /* 深色车牌键盘特殊样式 */
739
- [data-theme="dark"] .key-plate-special,
740
- .keyboard-theme-dark .key-plate-special {
741
- background-color: #4a3728;
742
- color: #fcd34d;
743
- }
744
- /* ====================
745
- Green 护眼主题
746
- ==================== */
746
+ --keyboard-bg: var(--ld-bg-surface);
747
+ --keyboard-key-bg: var(--ld-bg-elevated);
748
+ --keyboard-key-color: var(--ld-text-primary);
749
+ --keyboard-key-active-bg: var(--ld-primary-100);
750
+ --keyboard-fn-key-bg: var(--ld-bg-container);
751
+ --keyboard-fn-key-color: var(--ld-text-secondary);
752
+ --keyboard-fn-key-active-bg: var(--ld-primary-200);
753
+ --keyboard-primary-bg: var(--ld-primary-500);
754
+ --keyboard-primary-active-bg: var(--ld-primary-600);
755
+ --keyboard-primary-color: var(--ld-text-inverse);
756
+ --keyboard-mask-bg: color-mix(in srgb, var(--ld-black) 40%, var(--ld-transparent));
757
+ --keyboard-key-border: var(--ld-border);
758
+ --keyboard-key-radius: var(--ld-radius-md);
759
+ --keyboard-key-gap: var(--ld-spacing-sm);
760
+ --keyboard-key-height: var(--ld-px-48);
761
+ --keyboard-font-size: var(--ld-font-lg);
762
+ --keyboard-fn-font-size: var(--ld-font-sm);
763
+ --keyboard-padding: var(--ld-spacing-sm);
764
+ --keyboard-key-shadow: var(--ld-shadow-sm, none);
765
+ }
747
766
  [data-theme="green"],
748
767
  .keyboard-theme-green {
749
- --keyboard-bg: #e8f5e9;
750
- --keyboard-key-bg: #ffffff;
751
- --keyboard-key-color: #2e7d32;
752
- --keyboard-key-active-bg: #c8e6c9;
753
- --keyboard-key-border: #a5d6a7;
754
- --keyboard-fn-bg: #c8e6c9;
755
- --keyboard-fn-color: #388e3c;
756
- --keyboard-fn-active-bg: #a5d6a7;
757
- --keyboard-primary-bg: #43a047;
758
- --keyboard-primary-active-bg: #388e3c;
759
- --keyboard-primary-color: #ffffff;
760
- --keyboard-key-radius: 8px;
761
- }
762
- /* ====================
763
- Blue 蓝色主题
764
- ==================== */
768
+ --keyboard-primary-bg: var(--ld-success-500);
769
+ --keyboard-primary-active-bg: var(--ld-success-600);
770
+ }
765
771
  [data-theme="blue"],
766
772
  .keyboard-theme-blue {
767
- --keyboard-bg: #e3f2fd;
768
- --keyboard-key-bg: #ffffff;
769
- --keyboard-key-color: #1565c0;
770
- --keyboard-key-active-bg: #bbdefb;
771
- --keyboard-key-border: #90caf9;
772
- --keyboard-fn-bg: #bbdefb;
773
- --keyboard-fn-color: #1976d2;
774
- --keyboard-fn-active-bg: #90caf9;
775
- --keyboard-primary-bg: #1976d2;
776
- --keyboard-primary-active-bg: #1565c0;
777
- --keyboard-primary-color: #ffffff;
778
- --keyboard-key-radius: 8px;
779
- }
780
- /* ====================
781
- 主题工具类
782
- ==================== */
773
+ --keyboard-primary-bg: var(--ld-info-500);
774
+ --keyboard-primary-active-bg: var(--ld-info-600);
775
+ }
783
776
  .keyboard-theme-light {
784
777
  color-scheme: light;
785
778
  }
786
779
  .keyboard-theme-dark {
787
780
  color-scheme: dark;
788
781
  }
789
- /* 平滑主题切换 */
790
782
  .keyboard-popup,
791
783
  .virtual-keyboard {
792
- transition: background-color 0.2s ease;
784
+ transition: background-color var(--ld-duration-fast);
793
785
  }
794
786
  .keyboard-key {
795
- transition: background-color var(--keyboard-transition) ease, transform var(--keyboard-transition) ease;
787
+ transition: background-color var(--ld-duration-fast), transform var(--ld-duration-fast);
796
788
  }
797
- /*# sourceMappingURL=src/styles/themes.less.map */
789
+ /*# sourceMappingURL=src\styles\themes.less.map */