@sdata/web-vue 3.13.0 → 3.14.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 (224) hide show
  1. package/dist/sd.css +141 -111
  2. package/dist/sd.min.css +2 -2
  3. package/es/_components/input-label/input-label.d.ts +2 -0
  4. package/es/_components/input-label/input-label.js +4 -2
  5. package/es/_components/input-label/style/index.css +2 -2
  6. package/es/_components/picker/style/index.scss +8 -2
  7. package/es/_components/resize-observer.js +1 -1
  8. package/es/_components/resize-trigger.vue_vue_type_script_setup_true_lang.js +9 -2
  9. package/es/_components/select-view/select-view.d.ts +2 -0
  10. package/es/_components/select-view/select-view.js +5 -1
  11. package/es/_components/select-view/style/index.css +5 -5
  12. package/es/_hooks/use-focus-trap.d.ts +10 -0
  13. package/es/_hooks/use-focus-trap.js +115 -0
  14. package/es/_utils/dom.js +1 -10
  15. package/es/_utils/keyboard.d.ts +4 -0
  16. package/es/_utils/keyboard.js +21 -2
  17. package/es/alert/alert.vue.d.ts +2 -2
  18. package/es/alert/alert.vue_vue_type_script_setup_true_lang.js +12 -3
  19. package/es/alert/index.d.ts +5 -5
  20. package/es/alert/style/index.css +1 -1
  21. package/es/alert/style/index.scss +1 -1
  22. package/es/anchor/anchor-link.vue_vue_type_script_setup_true_lang.js +3 -1
  23. package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +2 -0
  24. package/es/anchor/style/index.css +1 -1
  25. package/es/anchor/style/index.scss +3 -1
  26. package/es/auto-complete/auto-complete.js +8 -0
  27. package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +8 -2
  28. package/es/avatar/style/index.css +2 -2
  29. package/es/avatar/style/index.scss +2 -2
  30. package/es/back-top/back-top.vue_vue_type_script_setup_true_lang.js +5 -1
  31. package/es/back-top/style/index.css +1 -1
  32. package/es/back-top/style/index.scss +2 -1
  33. package/es/badge/badge.js +4 -1
  34. package/es/badge/style/index.css +3 -3
  35. package/es/badge/style/index.scss +3 -3
  36. package/es/breadcrumb/breadcrumb.js +1 -0
  37. package/es/button/button.vue_vue_type_script_setup_true_lang.js +10 -5
  38. package/es/button/style/index.css +15 -6
  39. package/es/button/style/index.scss +25 -7
  40. package/es/calendar/style/event.scss +2 -2
  41. package/es/calendar/style/index.css +2 -2
  42. package/es/card/style/index.css +3 -3
  43. package/es/card/style/index.scss +3 -3
  44. package/es/carousel/carousel-arrow.vue.d.ts +4 -4
  45. package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +20 -4
  46. package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +23 -4
  47. package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +8 -1
  48. package/es/carousel/carousel.js +18 -1
  49. package/es/carousel/style/index.css +1 -1
  50. package/es/carousel/style/index.scss +1 -1
  51. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +11 -2
  52. package/es/cascader/style/index.css +2 -2
  53. package/es/cascader/style/index.scss +3 -1
  54. package/es/checkbox/checkbox-group.js +4 -1
  55. package/es/checkbox/checkbox.d.ts +9 -0
  56. package/es/checkbox/checkbox.js +14 -0
  57. package/es/checkbox/index.d.ts +15 -0
  58. package/es/checkbox/style/index.css +1 -1
  59. package/es/checkbox/style/index.scss +1 -1
  60. package/es/collapse/collapse-item.js +21 -3
  61. package/es/collapse/context.d.ts +1 -1
  62. package/es/color-picker/color-picker.js +6 -0
  63. package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +10 -2
  64. package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +14 -1
  65. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +1 -0
  66. package/es/date-picker/style/index.css +5 -5
  67. package/es/date-picker/style/index.scss +4 -3
  68. package/es/drawer/drawer.vue.d.ts +1 -1
  69. package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +28 -7
  70. package/es/drawer/index.d.ts +3 -3
  71. package/es/dropdown/dropdown-option.vue_vue_type_script_setup_true_lang.js +5 -1
  72. package/es/dropdown/dropdown-panel.vue.d.ts +9 -0
  73. package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +75 -2
  74. package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +5 -2
  75. package/es/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +4 -2
  76. package/es/dropdown/style/index.css +1 -1
  77. package/es/dropdown/style/index.scss +3 -1
  78. package/es/file-previewer/file-previewer.vue.d.ts +1 -1
  79. package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +7 -3
  80. package/es/file-previewer/index.d.ts +3 -3
  81. package/es/form/context.d.ts +1 -0
  82. package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +6 -2
  83. package/es/form/style/index.css +2 -2
  84. package/es/form/style/index.scss +2 -2
  85. package/es/image/preview.vue.d.ts +1 -1
  86. package/es/image/preview.vue_vue_type_script_setup_true_lang.js +1 -1
  87. package/es/index.css +141 -111
  88. package/es/input/input.js +16 -2
  89. package/es/input/style/index.css +2 -2
  90. package/es/input/style/input.scss +4 -4
  91. package/es/input-number/input-number.js +5 -1
  92. package/es/input-number/style/index.css +3 -3
  93. package/es/input-number/style/index.scss +5 -1
  94. package/es/input-tag/index.d.ts +3 -0
  95. package/es/input-tag/input-tag.d.ts +2 -0
  96. package/es/input-tag/input-tag.js +34 -30
  97. package/es/input-tag/style/index.css +8 -8
  98. package/es/input-tag/style/index.scss +11 -5
  99. package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +31 -6
  100. package/es/layout/style/index.css +2 -2
  101. package/es/layout/style/index.scss +4 -2
  102. package/es/link/style/index.css +1 -1
  103. package/es/link/style/index.scss +3 -1
  104. package/es/mention/mention.js +8 -0
  105. package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +29 -3
  106. package/es/menu/item.js +14 -1
  107. package/es/menu/style/index.css +6 -6
  108. package/es/menu/style/index.scss +5 -3
  109. package/es/message/style/index.css +3 -3
  110. package/es/message/style/index.scss +5 -3
  111. package/es/modal/index.d.ts +3 -3
  112. package/es/modal/modal.vue.d.ts +1 -1
  113. package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +28 -13
  114. package/es/modal/style/index.css +2 -2
  115. package/es/modal/style/index.scss +3 -2
  116. package/es/notification/style/index.css +3 -3
  117. package/es/notification/style/index.scss +11 -3
  118. package/es/page-header/page-header.vue.d.ts +6 -6
  119. package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +12 -1
  120. package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +12 -2
  121. package/es/pagination/page-item-step.vue.d.ts +2 -2
  122. package/es/pagination/page-item-step.vue_vue_type_script_setup_true_lang.js +19 -2
  123. package/es/pagination/page-item.vue.d.ts +2 -2
  124. package/es/pagination/page-item.vue_vue_type_script_setup_true_lang.js +21 -3
  125. package/es/pagination/pagination.js +5 -1
  126. package/es/pagination/style/index.css +6 -1
  127. package/es/pagination/style/index.scss +9 -3
  128. package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +2 -0
  129. package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +2 -0
  130. package/es/progress/style/index.css +2 -2
  131. package/es/progress/style/index.scss +5 -3
  132. package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +5 -1
  133. package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +11 -6
  134. package/es/radio/context.d.ts +1 -0
  135. package/es/radio/radio-group.js +6 -2
  136. package/es/radio/radio.js +1 -0
  137. package/es/radio/style/index.css +2 -2
  138. package/es/radio/style/index.scss +4 -2
  139. package/es/rate/rate.js +25 -1
  140. package/es/resize-box/resize-box.vue.d.ts +4 -4
  141. package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +30 -1
  142. package/es/result/result.vue_vue_type_script_setup_true_lang.js +7 -4
  143. package/es/select/index.d.ts +124 -0
  144. package/es/select/select-dropdown.vue_vue_type_script_setup_true_lang.js +4 -1
  145. package/es/select/select.d.ts +62 -0
  146. package/es/select/select.js +18 -2
  147. package/es/select/style/index.css +1 -1
  148. package/es/select/style/index.scss +3 -1
  149. package/es/selectable-card/style/index.css +2 -2
  150. package/es/selectable-card/style/index.scss +5 -5
  151. package/es/skeleton/skeleton.vue_vue_type_script_setup_true_lang.js +5 -1
  152. package/es/slider/slider-button.vue.d.ts +2 -0
  153. package/es/slider/slider-button.vue_vue_type_script_setup_true_lang.js +7 -2
  154. package/es/slider/slider.vue_vue_type_script_setup_true_lang.js +23 -2
  155. package/es/slider/style/index.css +1 -1
  156. package/es/slider/style/index.scss +3 -1
  157. package/es/spin/spin.js +7 -2
  158. package/es/spin/style/index.css +1 -1
  159. package/es/spin/style/index.scss +1 -1
  160. package/es/split/split.vue.d.ts +4 -4
  161. package/es/split/split.vue_vue_type_script_setup_true_lang.js +27 -3
  162. package/es/steps/context.d.ts +1 -0
  163. package/es/steps/step.vue_vue_type_script_setup_true_lang.js +15 -2
  164. package/es/steps/steps.vue_vue_type_script_setup_true_lang.js +6 -1
  165. package/es/steps/style/index.css +1 -1
  166. package/es/steps/style/index.scss +1 -1
  167. package/es/style/animation/index.scss +1 -0
  168. package/es/style/animation/reduced-motion.scss +22 -0
  169. package/es/style/animation/zoom.scss +7 -6
  170. package/es/style/icon.scss +9 -1
  171. package/es/switch/style/index.css +1 -1
  172. package/es/switch/style/index.scss +4 -1
  173. package/es/switch/switch.vue_vue_type_script_setup_true_lang.js +6 -1
  174. package/es/table/style/index.css +8 -8
  175. package/es/table/style/index.scss +11 -8
  176. package/es/table/table-operation-td.d.ts +15 -0
  177. package/es/table/table-tbody.js +4 -1
  178. package/es/table/table-td.js +2 -1
  179. package/es/table/table-th.js +4 -2
  180. package/es/table/table-thead.js +4 -1
  181. package/es/table/table-tr.js +4 -1
  182. package/es/table/table.js +6 -2
  183. package/es/tabs/context.d.ts +1 -0
  184. package/es/tabs/style/index.css +5 -5
  185. package/es/tabs/style/index.scss +7 -7
  186. package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +21 -2
  187. package/es/tabs/tabs-nav.js +34 -1
  188. package/es/tabs/tabs-tab.vue_vue_type_script_setup_true_lang.js +27 -4
  189. package/es/tabs/tabs.js +4 -2
  190. package/es/tag/index.d.ts +5 -5
  191. package/es/tag/style/index.css +1 -1
  192. package/es/tag/style/index.scss +3 -1
  193. package/es/tag/tag.vue.d.ts +2 -2
  194. package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +19 -2
  195. package/es/textarea/style/index.css +2 -2
  196. package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +15 -3
  197. package/es/time-picker/time-column.vue_vue_type_script_setup_true_lang.js +11 -3
  198. package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +4 -1
  199. package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +1 -0
  200. package/es/transfer/style/index.css +1 -1
  201. package/es/transfer/style/index.scss +1 -1
  202. package/es/transfer/transfer-list-item.js +16 -2
  203. package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +27 -7
  204. package/es/tree/context.d.ts +2 -0
  205. package/es/tree/style/index.css +1 -1
  206. package/es/tree/style/index.scss +1 -1
  207. package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +81 -2
  208. package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +10 -1
  209. package/es/trigger/index.d.ts +45 -0
  210. package/es/trigger/trigger.d.ts +27 -0
  211. package/es/trigger/trigger.js +47 -5
  212. package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +11 -8
  213. package/es/typography/operations.vue_vue_type_script_setup_true_lang.js +38 -6
  214. package/es/typography/style/index.css +2 -2
  215. package/es/typography/style/index.scss +2 -2
  216. package/es/upload/style/index.css +9 -9
  217. package/es/upload/style/index.scss +15 -9
  218. package/es/upload/upload-list-item.js +18 -5
  219. package/es/upload/upload-picture-item.js +25 -3
  220. package/es/verification-code/verification-code.js +6 -1
  221. package/json/vetur-attributes.json +15 -0
  222. package/json/vetur-tags.json +6 -2
  223. package/json/web-types.json +33 -1
  224. package/package.json +1 -1
@@ -80,7 +80,7 @@
80
80
  text-align: center;
81
81
  background-color: var(--sd-color-neutral-2);
82
82
  border-radius: var(--sd-border-radius-circle);
83
- transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
83
+ transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
84
84
  }
85
85
  .sd-avatar-trigger-icon-mask {
86
86
  position: absolute;
@@ -97,7 +97,7 @@
97
97
  background-color: color-mix(in srgb, #1d2129 60%, transparent);
98
98
  border-radius: var(--sd-border-radius-medium);
99
99
  opacity: 0;
100
- transition: all 0.1s cubic-bezier(0, 0, 1, 1);
100
+ transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
101
101
  }
102
102
  .sd-avatar-circle .sd-avatar-trigger-icon-mask {
103
103
  border-radius: var(--sd-border-radius-circle);
@@ -80,7 +80,7 @@ $avatar-prefix-cls: string.unquote('#{theme.$prefix}-avatar');
80
80
  background-color: $avatar-color-trigger-button-bg;
81
81
  border-radius: $avatar-border-trigger-button-radius;
82
82
  transition: background-color theme.$transition-duration-1
83
- theme.$transition-timing-function-linear;
83
+ theme.$transition-timing-function-standard;
84
84
  }
85
85
 
86
86
  &-trigger-icon-mask {
@@ -102,7 +102,7 @@ $avatar-prefix-cls: string.unquote('#{theme.$prefix}-avatar');
102
102
  );
103
103
  border-radius: $avatar-square-border-radius;
104
104
  opacity: 0;
105
- transition: all theme.$transition-duration-1 theme.$transition-timing-function-linear;
105
+ transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-standard;
106
106
  }
107
107
 
108
108
  &-circle &-trigger-icon-mask {
@@ -89,7 +89,11 @@ var back_top_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
89
89
  key: 0,
90
90
  class: normalizeClass(unref(prefixCls)),
91
91
  onClick: scrollToTop
92
- }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("button", { class: normalizeClass(`${unref(prefixCls)}-btn`) }, [createVNode(unref(IconToTop))], 2)])], 2)) : createCommentVNode("", true)]),
92
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("button", {
93
+ type: "button",
94
+ class: normalizeClass(`${unref(prefixCls)}-btn`),
95
+ "aria-label": "Back to top"
96
+ }, [createVNode(unref(IconToTop))], 2)])], 2)) : createCommentVNode("", true)]),
93
97
  _: 3
94
98
  });
95
99
  };
@@ -32,7 +32,7 @@
32
32
  border-radius: var(--sd-border-radius-circle);
33
33
  outline: none;
34
34
  cursor: pointer;
35
- transition: all 0.2s cubic-bezier(0, 0, 1, 1);
35
+ transition: background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
36
36
  }
37
37
  .sd-back-top-btn:hover {
38
38
  background-color: rgb(var(--sd-primary-5));
@@ -21,7 +21,8 @@ $backtop-prefix-cls: string.unquote('#{theme.$prefix}-back-top');
21
21
  border-radius: $backtop-button-border-radius;
22
22
  outline: none;
23
23
  cursor: pointer;
24
- transition: all theme.$transition-duration-2 theme.$transition-timing-function-linear;
24
+ transition: background-color theme.$transition-duration-2
25
+ theme.$transition-timing-function-standard;
25
26
 
26
27
  &:hover {
27
28
  background-color: $backtop-button-color-bg_hover;
package/es/badge/badge.js CHANGED
@@ -126,9 +126,12 @@ var badge_default = /* @__PURE__ */ defineComponent({
126
126
  [`${prefixCls}-status-${statusValue}`]: statusValue,
127
127
  [`${prefixCls}-color-${colorValue}`]: colorValue
128
128
  }],
129
- "style": mergedStyle
129
+ "style": mergedStyle,
130
+ "aria-hidden": "true"
130
131
  }, null), textValue && createVNode("span", { "class": `${prefixCls}-status-text` }, [textValue])]);
131
132
  if ((dotValue || colorValue) && countValue > 0) return createVNode("span", {
133
+ "role": "status",
134
+ "aria-label": String(countValue),
132
135
  "class": [`${prefixCls}-dot`, { [`${prefixCls}-color-${colorValue}`]: colorValue }],
133
136
  "style": mergedStyle
134
137
  }, null);
@@ -144,7 +144,7 @@
144
144
 
145
145
  @keyframes sd-badge-scale {
146
146
  from {
147
- transform: scale(0, 0);
147
+ transform: scale(0.5, 0.5);
148
148
  }
149
149
  to {
150
150
  transform: scale(1, 1);
@@ -152,7 +152,7 @@
152
152
  }
153
153
  .badge-zoom-enter,
154
154
  .badge-zoom-appear {
155
- transform: translate(50%, -50%) scale(0.2, 0.2);
155
+ transform: translate(50%, -50%) scale(0.5, 0.5);
156
156
  transform-origin: center;
157
157
  }
158
158
 
@@ -171,7 +171,7 @@
171
171
  }
172
172
 
173
173
  .badge-zoom-exit-active {
174
- transform: translate(50%, -50%) scale(0.2, 0.2);
174
+ transform: translate(50%, -50%) scale(0.5, 0.5);
175
175
  transform-origin: center;
176
176
  opacity: 0;
177
177
  transition: opacity 0.3s cubic-bezier(0.3, 1.3, 0.3, 1), transform 0.3s cubic-bezier(0.3, 1.3, 0.3, 1);
@@ -159,7 +159,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
159
159
 
160
160
  @keyframes #{theme.$prefix}-badge-scale {
161
161
  from {
162
- transform: scale(0, 0);
162
+ transform: scale(0.5, 0.5);
163
163
  }
164
164
 
165
165
  to {
@@ -169,7 +169,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
169
169
 
170
170
  .badge-zoom-enter,
171
171
  .badge-zoom-appear {
172
- transform: translate(50%, -50%) scale(0.2, 0.2);
172
+ transform: translate(50%, -50%) scale(0.5, 0.5);
173
173
  // opacity: 0;
174
174
  transform-origin: center;
175
175
  }
@@ -191,7 +191,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
191
191
  }
192
192
 
193
193
  .badge-zoom-exit-active {
194
- transform: translate(50%, -50%) scale(0.2, 0.2);
194
+ transform: translate(50%, -50%) scale(0.5, 0.5);
195
195
  transform-origin: center;
196
196
  opacity: 0;
197
197
  transition:
@@ -105,6 +105,7 @@ var breadcrumb_default = /* @__PURE__ */ defineComponent({
105
105
  return () => {
106
106
  return createVNode("div", {
107
107
  "role": "list",
108
+ "aria-label": "Breadcrumb",
108
109
  "class": prefixCls
109
110
  }, [slots.default ? renderByChildren() : renderByRoutes()]);
110
111
  };
@@ -7,7 +7,7 @@ import IconLoading from "../icon/icon-loading/index.js";
7
7
  import { useSize } from "../_hooks/use-size.js";
8
8
  import Tooltip from "../tooltip/index.js";
9
9
  import { buttonGroupInjectionKey } from "./context.js";
10
- import { computed, createBlock, createCommentVNode, createElementBlock, createSlots, defineComponent, guardReactiveProps, inject, normalizeClass, normalizeProps, onMounted, onUpdated, openBlock, ref, renderSlot, resolveDynamicComponent, toRefs, unref, useSlots, withCtx } from "vue";
10
+ import { cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createSlots, defineComponent, guardReactiveProps, inject, normalizeClass, normalizeProps, onMounted, onUpdated, openBlock, ref, renderSlot, resolveDynamicComponent, toRefs, unref, useSlots, withCtx } from "vue";
11
11
  //#region components/button/button.vue?vue&type=script&setup=true&lang.ts
12
12
  var _hoisted_1 = ["href"];
13
13
  var _hoisted_2 = { key: 2 };
@@ -114,10 +114,15 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
114
114
  */
115
115
  const { size, disabled } = toRefs(props);
116
116
  const prefixCls = getPrefixCls("btn");
117
- const PassThrough = (_, { slots: passSlots }) => {
118
- var _passSlots$default;
119
- return (_passSlots$default = passSlots.default) === null || _passSlots$default === void 0 ? void 0 : _passSlots$default.call(passSlots);
120
- };
117
+ const PassThrough = defineComponent({
118
+ name: "ButtonPassThrough",
119
+ inheritAttrs: false,
120
+ setup: (_, { slots, attrs }) => () => {
121
+ var _slots$default;
122
+ const vnodes = (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
123
+ return (vnodes === null || vnodes === void 0 ? void 0 : vnodes.length) ? cloneVNode(vnodes[0], attrs) : void 0;
124
+ }
125
+ });
121
126
  const slots = useSlots();
122
127
  const hasTooltip = computed(() => props.tooltip != null || Boolean(slots.tooltip));
123
128
  const tooltipWrapper = computed(() => hasTooltip.value ? Tooltip : PassThrough);
@@ -32,7 +32,7 @@
32
32
  white-space: nowrap;
33
33
  outline: none;
34
34
  cursor: pointer;
35
- transition: all 0.1s cubic-bezier(0, 0, 1, 1);
35
+ transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), transform 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
36
36
  appearance: none;
37
37
  user-select: none;
38
38
  }
@@ -40,7 +40,7 @@
40
40
  color: currentcolor;
41
41
  }
42
42
  .sd-btn:active {
43
- transition: none;
43
+ transform: scale(0.97);
44
44
  }
45
45
  .sd-btn-long {
46
46
  display: flex;
@@ -80,13 +80,10 @@
80
80
  background: #fff;
81
81
  border-radius: inherit;
82
82
  opacity: 0.4;
83
- transition: opacity 0.1s cubic-bezier(0, 0, 1, 1);
83
+ transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
84
84
  content: "";
85
85
  pointer-events: none;
86
86
  }
87
- .sd-btn-loading-fixed-width {
88
- transition: none;
89
- }
90
87
  .sd-btn-two-chinese-chars > *:not(svg) {
91
88
  margin-right: -0.3em;
92
89
  letter-spacing: 0.3em;
@@ -909,6 +906,9 @@
909
906
  .sd-btn-group .sd-btn-dashed:active {
910
907
  z-index: 2;
911
908
  }
909
+ .sd-btn-group .sd-btn:active {
910
+ transform: none;
911
+ }
912
912
  .sd-btn-group .sd-btn:first-child {
913
913
  border-top-right-radius: 0;
914
914
  border-bottom-right-radius: 0;
@@ -923,4 +923,13 @@
923
923
 
924
924
  :where(body, [sd-theme])[sd-theme=dark] .sd-btn-primary.sd-btn-disabled {
925
925
  color: rgba(255, 255, 255, 0.3);
926
+ }
927
+
928
+ @media (prefers-reduced-motion: reduce) {
929
+ .sd-btn:active {
930
+ transform: none;
931
+ }
932
+ .sd-btn .sd-icon-loading {
933
+ animation-duration: 3s;
934
+ }
926
935
  }
@@ -63,7 +63,12 @@ $token-var-aliases: (
63
63
  white-space: nowrap;
64
64
  outline: none;
65
65
  cursor: pointer;
66
- transition: all theme.$transition-duration-1 theme.$transition-timing-function-linear;
66
+ // 状态切换只过渡颜色与按压形变;box-shadow(聚焦环)保持即时切换以保证可见性
67
+ transition:
68
+ color theme.$transition-duration-1 theme.$transition-timing-function-standard,
69
+ background-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
70
+ border-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
71
+ transform theme.$transition-duration-1 theme.$transition-timing-function-standard;
67
72
  appearance: none;
68
73
  user-select: none;
69
74
 
@@ -72,7 +77,7 @@ $token-var-aliases: (
72
77
  }
73
78
 
74
79
  &:active {
75
- transition: none;
80
+ transform: scale(0.97);
76
81
  }
77
82
 
78
83
  &-long {
@@ -119,16 +124,12 @@ $token-var-aliases: (
119
124
  background: #fff;
120
125
  border-radius: inherit;
121
126
  opacity: 0.4;
122
- transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-linear;
127
+ transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-standard;
123
128
  content: '';
124
129
  pointer-events: none;
125
130
  }
126
131
  }
127
132
 
128
- &-loading-fixed-width {
129
- transition: none;
130
- }
131
-
132
133
  &-two-chinese-chars > *:not(svg) {
133
134
  margin-right: -0.3em;
134
135
  letter-spacing: 0.3em;
@@ -324,6 +325,11 @@ $token-var-aliases: (
324
325
  }
325
326
  }
326
327
 
328
+ // 按钮组是连体控件,单个按钮按压形变会与相邻按钮产生缝隙,故禁用形变
329
+ .#{$btn-prefix-cls}:active {
330
+ transform: none;
331
+ }
332
+
327
333
  .#{$btn-prefix-cls}:first-child {
328
334
  border-top-right-radius: 0;
329
335
  border-bottom-right-radius: 0;
@@ -344,3 +350,15 @@ $token-var-aliases: (
344
350
  color: rgb(255 255 255 / 30%);
345
351
  }
346
352
  }
353
+
354
+ // 减少动态偏好:去掉按压形变(位移),保留颜色过渡(有助于理解状态);
355
+ // 放慢加载图标旋转,避免快速循环带来的不适,但仍可表达加载态
356
+ @media (prefers-reduced-motion: reduce) {
357
+ .#{$btn-prefix-cls}:active {
358
+ transform: none;
359
+ }
360
+
361
+ .#{$btn-prefix-cls} .#{theme.$prefix}-icon-loading {
362
+ animation-duration: 3s;
363
+ }
364
+ }
@@ -56,7 +56,7 @@ $calendar-css-prefix: string.unquote('--#{theme.$prefix}-calendar');
56
56
  }
57
57
 
58
58
  [class*='-calendar-delete-btn-enter-from'] {
59
- transform: scale(0) rotate(-90deg);
59
+ transform: scale(0.5) rotate(-90deg);
60
60
  }
61
61
 
62
62
  [class*='-calendar-delete-btn-enter-to'] {
@@ -64,6 +64,6 @@ $calendar-css-prefix: string.unquote('--#{theme.$prefix}-calendar');
64
64
  }
65
65
 
66
66
  [class*='-calendar-delete-btn-leave-active'] {
67
- transform: scale(0);
67
+ transform: scale(0.5);
68
68
  transition: 0.3s ease-in-out;
69
69
  }
@@ -1626,7 +1626,7 @@
1626
1626
  }
1627
1627
 
1628
1628
  [class*=-calendar-delete-btn-enter-from] {
1629
- transform: scale(0) rotate(-90deg);
1629
+ transform: scale(0.5) rotate(-90deg);
1630
1630
  }
1631
1631
 
1632
1632
  [class*=-calendar-delete-btn-enter-to] {
@@ -1634,6 +1634,6 @@
1634
1634
  }
1635
1635
 
1636
1636
  [class*=-calendar-delete-btn-leave-active] {
1637
- transform: scale(0);
1637
+ transform: scale(0.5);
1638
1638
  transition: 0.3s ease-in-out;
1639
1639
  }
@@ -19,7 +19,7 @@
19
19
  position: relative;
20
20
  background: var(--sd-color-bg-2);
21
21
  border-radius: var(--sd-border-radius-none);
22
- transition: box-shadow 0.2s cubic-bezier(0, 0, 1, 1);
22
+ transition: box-shadow 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
23
23
  }
24
24
  .sd-card-header {
25
25
  position: relative;
@@ -79,7 +79,7 @@
79
79
  justify-content: center;
80
80
  color: var(--sd-color-text-2);
81
81
  cursor: pointer;
82
- transition: color 0.2s cubic-bezier(0, 0, 1, 1);
82
+ transition: color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
83
83
  overflow: hidden;
84
84
  white-space: nowrap;
85
85
  text-overflow: ellipsis;
@@ -124,7 +124,7 @@
124
124
  .sd-card-grid::before {
125
125
  position: absolute;
126
126
  inset: 0;
127
- transition: box-shadow 0.2s cubic-bezier(0, 0, 1, 1);
127
+ transition: box-shadow 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
128
128
  content: "";
129
129
  pointer-events: none;
130
130
  }
@@ -23,7 +23,7 @@ $card-prefix-cls: string.unquote('#{theme.$prefix}-card');
23
23
  position: relative;
24
24
  background: $card-color-bg;
25
25
  border-radius: $card-border-radius-no-border;
26
- transition: box-shadow theme.$transition-duration-2 theme.$transition-timing-function-linear;
26
+ transition: box-shadow theme.$transition-duration-2 theme.$transition-timing-function-standard;
27
27
 
28
28
  &-header {
29
29
  position: relative;
@@ -90,7 +90,7 @@ $card-prefix-cls: string.unquote('#{theme.$prefix}-card');
90
90
  justify-content: center;
91
91
  color: $card-color-action;
92
92
  cursor: pointer;
93
- transition: color theme.$transition-duration-2 theme.$transition-timing-function-linear;
93
+ transition: color theme.$transition-duration-2 theme.$transition-timing-function-standard;
94
94
 
95
95
  @include text-ellipsis();
96
96
 
@@ -150,7 +150,7 @@ $card-prefix-cls: string.unquote('#{theme.$prefix}-card');
150
150
  &::before {
151
151
  position: absolute;
152
152
  inset: 0;
153
- transition: box-shadow theme.$transition-duration-2 theme.$transition-timing-function-linear;
153
+ transition: box-shadow theme.$transition-duration-2 theme.$transition-timing-function-standard;
154
154
  content: '';
155
155
  pointer-events: none;
156
156
  }
@@ -8,8 +8,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
8
8
  default: string;
9
9
  };
10
10
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- previousClick: (_ev: MouseEvent) => any;
12
- nextClick: (_ev: MouseEvent) => any;
11
+ previousClick: (_ev: Event) => any;
12
+ nextClick: (_ev: Event) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
14
14
  direction: {
15
15
  type: StringConstructor;
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
20
20
  default: string;
21
21
  };
22
22
  }>> & Readonly<{
23
- onPreviousClick?: ((_ev: MouseEvent) => any) | undefined;
24
- onNextClick?: ((_ev: MouseEvent) => any) | undefined;
23
+ onPreviousClick?: ((_ev: Event) => any) | undefined;
24
+ onNextClick?: ((_ev: Event) => any) | undefined;
25
25
  }>, {
26
26
  showArrow: string;
27
27
  direction: string;
@@ -1,5 +1,6 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
+ import { isActivationKey } from "../_utils/keyboard.js";
3
4
  import IconRight from "../icon/icon-right/index.js";
4
5
  import IconDown from "../icon/icon-down/index.js";
5
6
  import IconLeft from "../icon/icon-left/index.js";
@@ -29,15 +30,30 @@ var carousel_arrow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
29
30
  const onNextClick = (ev) => {
30
31
  emit("nextClick", ev);
31
32
  };
33
+ const onKeydown = (e, which) => {
34
+ if (isActivationKey(e)) {
35
+ e.preventDefault();
36
+ if (which === "previous") emit("previousClick", e);
37
+ else emit("nextClick", e);
38
+ }
39
+ };
32
40
  const cls = computed(() => [`${prefixCls}-arrow`, { [`${prefixCls}-arrow-hover`]: props.showArrow === "hover" }]);
33
41
  return (_ctx, _cache) => {
34
42
  return openBlock(), createElementBlock("div", { class: normalizeClass(cls.value) }, [createElementVNode("div", {
43
+ role: "button",
44
+ tabindex: "0",
45
+ "aria-label": "Previous slide",
35
46
  class: normalizeClass(`${unref(prefixCls)}-arrow-${__props.direction === "vertical" ? "top" : "left"}`),
36
- onClick: onPreviousClick
37
- }, [__props.direction === "horizontal" ? (openBlock(), createBlock(unref(IconLeft), { key: 0 })) : (openBlock(), createBlock(unref(IconUp), { key: 1 }))], 2), createElementVNode("div", {
47
+ onClick: onPreviousClick,
48
+ onKeydown: _cache[0] || (_cache[0] = (e) => onKeydown(e, "previous"))
49
+ }, [__props.direction === "horizontal" ? (openBlock(), createBlock(unref(IconLeft), { key: 0 })) : (openBlock(), createBlock(unref(IconUp), { key: 1 }))], 34), createElementVNode("div", {
50
+ role: "button",
51
+ tabindex: "0",
52
+ "aria-label": "Next slide",
38
53
  class: normalizeClass(`${unref(prefixCls)}-arrow-${__props.direction === "vertical" ? "bottom" : "right"}`),
39
- onClick: onNextClick
40
- }, [__props.direction === "horizontal" ? (openBlock(), createBlock(unref(IconRight), { key: 0 })) : (openBlock(), createBlock(unref(IconDown), { key: 1 }))], 2)], 2);
54
+ onClick: onNextClick,
55
+ onKeydown: _cache[1] || (_cache[1] = (e) => onKeydown(e, "next"))
56
+ }, [__props.direction === "horizontal" ? (openBlock(), createBlock(unref(IconRight), { key: 0 })) : (openBlock(), createBlock(unref(IconDown), { key: 1 }))], 34)], 2);
41
57
  };
42
58
  }
43
59
  }));
@@ -1,8 +1,15 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
+ import { isActivationKey } from "../_utils/keyboard.js";
3
4
  import { Fragment, computed, createElementBlock, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderList, unref } from "vue";
4
5
  //#region components/carousel/carousel-indicator.vue?vue&type=script&setup=true&lang.ts
5
- var _hoisted_1 = ["data-index"];
6
+ var _hoisted_1 = ["aria-label"];
7
+ var _hoisted_2 = [
8
+ "data-index",
9
+ "aria-label",
10
+ "aria-current",
11
+ "onKeydown"
12
+ ];
6
13
  var carousel_indicator_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Indicator" }), {}, {
7
14
  __name: "carousel-indicator",
8
15
  props: {
@@ -47,6 +54,12 @@ var carousel_indicator_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
47
54
  if (!Number.isNaN(index) && index !== props.activeIndex) emit("select", index);
48
55
  }
49
56
  };
57
+ const onItemKeydown = (event, index) => {
58
+ if (isActivationKey(event) && index !== props.activeIndex) {
59
+ event.preventDefault();
60
+ emit("select", index);
61
+ }
62
+ };
50
63
  const eventHandlers = computed(() => {
51
64
  return props.trigger === "click" ? { onClick } : { onMouseover: onClick };
52
65
  });
@@ -66,13 +79,19 @@ var carousel_indicator_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
66
79
  return openBlock(), createElementBlock("div", mergeProps({ class: cls.value }, eventHandlers.value), [__props.type === "slider" ? (openBlock(), createElementBlock("span", {
67
80
  key: 0,
68
81
  style: normalizeStyle(sliderStyle.value),
82
+ "aria-label": `Slide ${__props.activeIndex + 1} of ${__props.count}`,
69
83
  class: normalizeClass([`${unref(prefixCls)}-item`, `${unref(prefixCls)}-item-active`])
70
- }, null, 6)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(Array(__props.count), (_, index) => {
84
+ }, null, 14, _hoisted_1)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(Array(__props.count), (_, index) => {
71
85
  return openBlock(), createElementBlock("span", {
72
86
  key: index,
87
+ role: "button",
88
+ tabindex: "0",
73
89
  "data-index": index,
74
- class: normalizeClass([`${unref(prefixCls)}-item`, { [`${unref(prefixCls)}-item-active`]: index === __props.activeIndex }])
75
- }, null, 10, _hoisted_1);
90
+ "aria-label": `Go to slide ${index + 1}`,
91
+ "aria-current": index === __props.activeIndex ? "true" : void 0,
92
+ class: normalizeClass([`${unref(prefixCls)}-item`, { [`${unref(prefixCls)}-item-active`]: index === __props.activeIndex }]),
93
+ onKeydown: ($event) => onItemKeydown($event, index)
94
+ }, null, 42, _hoisted_2);
76
95
  }), 128))], 16);
77
96
  };
78
97
  }
@@ -3,7 +3,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
3
3
  import { carouselInjectionKey } from "./context.js";
4
4
  import { computed, createElementBlock, defineComponent, getCurrentInstance, inject, normalizeClass, normalizeStyle, openBlock, renderSlot } from "vue";
5
5
  //#region components/carousel/carousel-item.vue?vue&type=script&setup=true&lang.ts
6
- var _hoisted_1 = ["aria-hidden"];
6
+ var _hoisted_1 = ["aria-label", "aria-hidden"];
7
7
  var carousel_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "CarouselItem" }), {}, {
8
8
  __name: "carousel-item",
9
9
  setup(__props) {
@@ -14,6 +14,10 @@ var carousel_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
14
14
  var _context$items$indexO, _context$items, _instance$uid;
15
15
  return (_context$items$indexO = (_context$items = context.items) === null || _context$items === void 0 ? void 0 : _context$items.indexOf((_instance$uid = instance === null || instance === void 0 ? void 0 : instance.uid) !== null && _instance$uid !== void 0 ? _instance$uid : -1)) !== null && _context$items$indexO !== void 0 ? _context$items$indexO : -1;
16
16
  });
17
+ const slideCount = computed(() => {
18
+ var _context$items$length, _context$items2;
19
+ return (_context$items$length = (_context$items2 = context.items) === null || _context$items2 === void 0 ? void 0 : _context$items2.length) !== null && _context$items$length !== void 0 ? _context$items$length : 0;
20
+ });
17
21
  const isCurrent = computed(() => {
18
22
  var _context$mergedIndexe;
19
23
  return ((_context$mergedIndexe = context.mergedIndexes) === null || _context$mergedIndexe === void 0 ? void 0 : _context$mergedIndexe.mergedIndex) === index.value;
@@ -39,6 +43,9 @@ var carousel_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
39
43
  });
40
44
  return (_ctx, _cache) => {
41
45
  return openBlock(), createElementBlock("div", {
46
+ role: "group",
47
+ "aria-roledescription": "slide",
48
+ "aria-label": `Slide ${index.value + 1} of ${slideCount.value}`,
42
49
  "aria-hidden": !isCurrent.value,
43
50
  class: normalizeClass(cls.value),
44
51
  style: normalizeStyle(animationStyle.value)
@@ -1,6 +1,7 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
3
  import { isNumber, isObject } from "../_utils/is.js";
4
+ import { KEYBOARD_KEY } from "../_utils/keyboard.js";
4
5
  import { useChildrenComponents } from "../_hooks/use-children-components.js";
5
6
  import carousel_arrow_default from "./carousel-arrow.js";
6
7
  import carousel_indicator_default from "./carousel-indicator.js";
@@ -214,6 +215,15 @@ var carousel_default = /* @__PURE__ */ defineComponent({
214
215
  isNegative: index < mergedIndexes.value.mergedIndex,
215
216
  isManual: true
216
217
  });
218
+ const onKeydown = (e) => {
219
+ if (e.key === KEYBOARD_KEY.ARROW_RIGHT || e.key === KEYBOARD_KEY.ARROW_DOWN) {
220
+ e.preventDefault();
221
+ onNextClick();
222
+ } else if (e.key === KEYBOARD_KEY.ARROW_LEFT || e.key === KEYBOARD_KEY.ARROW_UP) {
223
+ e.preventDefault();
224
+ onPreviousClick();
225
+ }
226
+ };
217
227
  const eventHandlers = computed(() => {
218
228
  return computedAutoPlay.value.hoverToPause ? {
219
229
  onMouseenter: () => {
@@ -246,7 +256,14 @@ var carousel_default = /* @__PURE__ */ defineComponent({
246
256
  return () => {
247
257
  var _slots$default;
248
258
  children.value = (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
249
- return createVNode("div", mergeProps({ "class": cls.value }, eventHandlers.value), [
259
+ return createVNode("div", mergeProps({
260
+ "class": cls.value,
261
+ "role": "region",
262
+ "aria-roledescription": "carousel",
263
+ "aria-label": "Carousel",
264
+ "tabindex": "0",
265
+ "onKeydown": onKeydown
266
+ }, eventHandlers.value), [
250
267
  createVNode("div", { "class": contentCls.value }, [children.value]),
251
268
  hasIndicator.value && createVNode("div", { "class": indicatorCls.value }, [createVNode(carousel_indicator_default, {
252
269
  "class": props.indicatorClass,
@@ -424,7 +424,7 @@
424
424
  }
425
425
  .sd-carousel-arrow-hover div {
426
426
  opacity: 0;
427
- transition: all 0.3s;
427
+ transition: opacity 0.3s;
428
428
  }
429
429
  .sd-carousel:hover .sd-carousel-arrow-hover div {
430
430
  opacity: 1;
@@ -372,7 +372,7 @@ $carousel-prefix-cls: string.unquote('#{theme.$prefix}-carousel');
372
372
 
373
373
  &-arrow-hover div {
374
374
  opacity: 0;
375
- transition: all 0.3s;
375
+ transition: opacity 0.3s;
376
376
  }
377
377
 
378
378
  &:hover {