@rainbow-oh/yee-c 0.8.0 → 0.8.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 (188) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +40 -25
  3. package/dist/cjs/Card/card.js +7 -3
  4. package/dist/cjs/Carousel/carousel-item.js +7 -2
  5. package/dist/cjs/Carousel/carousel.js +31 -4
  6. package/dist/cjs/Cascader/cascader.js +38 -30
  7. package/dist/cjs/Cascader/column.js +17 -9
  8. package/dist/cjs/Cascader/node.js +16 -4
  9. package/dist/cjs/Cascader/search-list.js +31 -14
  10. package/dist/cjs/Cascader/utils/index.js +1 -5
  11. package/dist/cjs/Checkbox/checkbox-group.js +23 -14
  12. package/dist/cjs/Checkbox/checkbox.js +6 -3
  13. package/dist/cjs/Collapse/panel.js +10 -1
  14. package/dist/cjs/Dialog/dialog.js +22 -7
  15. package/dist/cjs/Dialog/interface.d.ts +1 -1
  16. package/dist/cjs/Dialog/style/index.less +2 -1
  17. package/dist/cjs/Drawer/drawer.js +22 -5
  18. package/dist/cjs/Form/Group.js +1 -1
  19. package/dist/cjs/Form/demo/tooltip.js +1 -3
  20. package/dist/cjs/List/hooks/useListKeyboard.js +3 -1
  21. package/dist/cjs/Menu/menu-item.js +14 -5
  22. package/dist/cjs/Menu/menu.js +26 -2
  23. package/dist/cjs/Pagination/items.js +60 -27
  24. package/dist/cjs/Pagination/pagination.js +33 -11
  25. package/dist/cjs/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
  26. package/dist/cjs/PickerPanel/panels/MonthPanel/MonthHeader.js +7 -1
  27. package/dist/cjs/Radio/radio-group.js +6 -5
  28. package/dist/cjs/Radio/radio.js +39 -29
  29. package/dist/cjs/Rate/rate.js +6 -1
  30. package/dist/cjs/Rate/star.js +31 -3
  31. package/dist/cjs/Segmented/demo/variant.js +15 -1
  32. package/dist/cjs/Segmented/index.d.ts +1 -1
  33. package/dist/cjs/Segmented/segmented.js +12 -15
  34. package/dist/cjs/Select/option.js +8 -1
  35. package/dist/cjs/Select/options.js +9 -1
  36. package/dist/cjs/Select/select.js +3 -1
  37. package/dist/cjs/Steps/step.js +19 -5
  38. package/dist/cjs/Steps/steps.js +11 -1
  39. package/dist/cjs/Table/demo/components-override.js +31 -2
  40. package/dist/cjs/Table/demo/grouping.js +7 -1
  41. package/dist/cjs/Table/hooks/useColumns.d.ts +3 -3
  42. package/dist/cjs/Table/hooks/useColumns.js +11 -14
  43. package/dist/cjs/Table/index.d.ts +1 -1
  44. package/dist/cjs/Table/style/index.less +2 -4
  45. package/dist/cjs/Table/tbody/row.js +1 -4
  46. package/dist/cjs/Table/theader/index.js +12 -4
  47. package/dist/cjs/Tabs/tab-content.js +3 -1
  48. package/dist/cjs/Tabs/tab-header/index.js +3 -1
  49. package/dist/cjs/Tabs/tab-header/tab-header-title.js +3 -1
  50. package/dist/cjs/Tour/index.d.ts +1 -1
  51. package/dist/cjs/Tree/style/index.less +1 -5
  52. package/dist/cjs/Tree/tree.js +38 -35
  53. package/dist/cjs/hooks/useDelayState.js +3 -2
  54. package/dist/cjs/hooks/useEvent.js +1 -4
  55. package/dist/cjs/hooks/useFocusManage.d.ts +1 -1
  56. package/dist/cjs/hooks/useFocusManage.js +27 -22
  57. package/dist/cjs/style/size.css +2 -0
  58. package/dist/cjs/style/themes.css +1 -1
  59. package/dist/cjs/style/variables.css +3 -1
  60. package/dist/cjs/utils/focusStack.d.ts +6 -2
  61. package/dist/cjs/utils/focusStack.js +40 -11
  62. package/dist/cjs/version.d.ts +1 -1
  63. package/dist/cjs/version.js +1 -1
  64. package/dist/esm/Card/card.js +7 -3
  65. package/dist/esm/Carousel/carousel-item.js +7 -2
  66. package/dist/esm/Carousel/carousel.js +31 -4
  67. package/dist/esm/Cascader/cascader.js +3 -1
  68. package/dist/esm/Cascader/column.js +2 -1
  69. package/dist/esm/Cascader/node.js +18 -4
  70. package/dist/esm/Cascader/search-list.js +18 -4
  71. package/dist/esm/Checkbox/checkbox-group.js +3 -1
  72. package/dist/esm/Checkbox/checkbox.js +6 -3
  73. package/dist/esm/Collapse/panel.js +11 -2
  74. package/dist/esm/Dialog/dialog.js +28 -11
  75. package/dist/esm/Dialog/interface.d.ts +1 -1
  76. package/dist/esm/Dialog/style/index.less +2 -1
  77. package/dist/esm/Drawer/drawer.js +16 -7
  78. package/dist/esm/Form/Group.js +1 -1
  79. package/dist/esm/Menu/menu-item.js +16 -5
  80. package/dist/esm/Menu/menu.js +11 -5
  81. package/dist/esm/Pagination/items.js +14 -5
  82. package/dist/esm/Pagination/pagination.js +16 -4
  83. package/dist/esm/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
  84. package/dist/esm/Radio/radio-group.js +5 -4
  85. package/dist/esm/Radio/radio.js +5 -4
  86. package/dist/esm/Rate/rate.js +6 -1
  87. package/dist/esm/Rate/star.js +12 -4
  88. package/dist/esm/Segmented/index.d.ts +1 -1
  89. package/dist/esm/Segmented/segmented.js +1 -1
  90. package/dist/esm/Steps/step.js +12 -6
  91. package/dist/esm/Steps/steps.js +3 -1
  92. package/dist/esm/Table/demo/components-override.js +1 -0
  93. package/dist/esm/Table/hooks/useColumns.d.ts +3 -3
  94. package/dist/esm/Table/hooks/useColumns.js +13 -16
  95. package/dist/esm/Table/index.d.ts +1 -1
  96. package/dist/esm/Table/style/index.less +2 -4
  97. package/dist/esm/Tabs/tab-content.js +3 -1
  98. package/dist/esm/Tabs/tab-header/index.js +3 -1
  99. package/dist/esm/Tabs/tab-header/tab-header-title.js +3 -1
  100. package/dist/esm/Tour/index.d.ts +1 -1
  101. package/dist/esm/Tree/style/index.less +1 -5
  102. package/dist/esm/Tree/tree.js +1 -1
  103. package/dist/esm/hooks/useDelayState.js +5 -2
  104. package/dist/esm/hooks/useFocusManage.d.ts +1 -1
  105. package/dist/esm/hooks/useFocusManage.js +31 -13
  106. package/dist/esm/style/size.css +2 -0
  107. package/dist/esm/style/themes.css +1 -1
  108. package/dist/esm/style/variables.css +3 -1
  109. package/dist/esm/utils/focusStack.d.ts +6 -2
  110. package/dist/esm/utils/focusStack.js +37 -14
  111. package/dist/esm/version.d.ts +1 -1
  112. package/dist/esm/version.js +1 -1
  113. package/dist/umd/yee-c.min.css +2 -2
  114. package/dist/umd/yee-c.min.js +1 -1
  115. package/package.json +10 -6
  116. package/src/Anchor/anchor.tsx +2 -2
  117. package/src/Card/card.tsx +5 -1
  118. package/src/Carousel/carousel-item.tsx +7 -1
  119. package/src/Carousel/carousel.tsx +29 -3
  120. package/src/Cascader/cascader.tsx +5 -1
  121. package/src/Cascader/column.tsx +5 -1
  122. package/src/Cascader/node.tsx +14 -2
  123. package/src/Cascader/search-list.tsx +19 -3
  124. package/src/Cascader/utils/index.ts +3 -6
  125. package/src/Checkbox/checkbox-group.tsx +6 -1
  126. package/src/Checkbox/checkbox.tsx +3 -0
  127. package/src/Collapse/panel.tsx +11 -1
  128. package/src/Dialog/dialog.tsx +35 -6
  129. package/src/Dialog/interface.ts +1 -1
  130. package/src/Dialog/style/index.less +2 -1
  131. package/src/Drawer/drawer.tsx +18 -3
  132. package/src/Form/Group.tsx +2 -4
  133. package/src/Form/demo/tooltip.tsx +2 -11
  134. package/src/Form/utils/validate.ts +1 -4
  135. package/src/List/hooks/useListKeyboard.ts +3 -3
  136. package/src/List/list.tsx +2 -1
  137. package/src/Menu/menu-item.tsx +12 -3
  138. package/src/Menu/menu.tsx +22 -5
  139. package/src/Pagination/items.tsx +21 -4
  140. package/src/Pagination/pagination.tsx +24 -4
  141. package/src/PickerPanel/panels/DatePanel/DateBody.tsx +1 -1
  142. package/src/PickerPanel/panels/DateTimePanel/index.tsx +1 -1
  143. package/src/PickerPanel/panels/MonthPanel/MonthHeader.tsx +7 -2
  144. package/src/PickerPanel/panels/PanelBody.tsx +1 -1
  145. package/src/PickerPanel/panels/QuarterPanel/QuarterHeader.tsx +1 -1
  146. package/src/PickerPanel/panels/RangePanel/index.tsx +1 -1
  147. package/src/PickerPanel/panels/TimePanel/TimeBody.tsx +1 -1
  148. package/src/PickerPanel/panels/YearPanel/YearHeader.tsx +1 -1
  149. package/src/PickerPanel/utils/pickerUtils.ts +2 -1
  150. package/src/Radio/radio-group.tsx +2 -1
  151. package/src/Radio/radio.tsx +7 -2
  152. package/src/RangePicker/range-picker-mobile.tsx +1 -3
  153. package/src/Rate/rate.tsx +5 -0
  154. package/src/Rate/star.tsx +20 -4
  155. package/src/Segmented/demo/variant.tsx +10 -2
  156. package/src/Segmented/index.ts +2 -2
  157. package/src/Segmented/segmented.tsx +4 -11
  158. package/src/Select/interface.ts +0 -1
  159. package/src/Select/option.tsx +8 -2
  160. package/src/Select/options.tsx +11 -4
  161. package/src/Select/select.tsx +4 -4
  162. package/src/Steps/step.tsx +23 -5
  163. package/src/Steps/steps.tsx +8 -1
  164. package/src/Table/demo/components-override.tsx +34 -7
  165. package/src/Table/demo/grouping.tsx +8 -4
  166. package/src/Table/hooks/useColumns.ts +14 -18
  167. package/src/Table/index.ts +3 -3
  168. package/src/Table/style/index.less +2 -4
  169. package/src/Table/table.tsx +2 -4
  170. package/src/Table/tbody/row.tsx +1 -3
  171. package/src/Table/theader/index.tsx +9 -10
  172. package/src/Tabs/tab-content.tsx +2 -0
  173. package/src/Tabs/tab-header/index.tsx +2 -0
  174. package/src/Tabs/tab-header/tab-header-title.tsx +3 -1
  175. package/src/Tour/demo/placement.tsx +2 -1
  176. package/src/Tour/index.ts +1 -1
  177. package/src/Tree/style/index.less +1 -5
  178. package/src/Tree/tree.tsx +16 -11
  179. package/src/Tree/utils/tree-tools.ts +4 -1
  180. package/src/hooks/useDelayState.ts +4 -2
  181. package/src/hooks/useEvent.ts +1 -3
  182. package/src/hooks/useFocusManage.ts +33 -17
  183. package/src/locale/context.tsx +5 -1
  184. package/src/locale/interface.ts +3 -1
  185. package/src/style/size.css +2 -0
  186. package/src/utils/debounce.ts +1 -3
  187. package/src/utils/focusStack.ts +55 -12
  188. package/src/version.ts +1 -1
@@ -48,8 +48,8 @@ __export(tree_exports, {
48
48
  });
49
49
  module.exports = __toCommonJS(tree_exports);
50
50
  var import_clsx = __toESM(require("clsx"));
51
- var import_react = __toESM(require("react"));
52
- var import_react2 = require("motion/react");
51
+ var import_react = require("motion/react");
52
+ var import_react2 = __toESM(require("react"));
53
53
  var import_Config_Provider = require("../Config-Provider");
54
54
  var import_useEvent = __toESM(require("../hooks/useEvent"));
55
55
  var import_useMergedState = __toESM(require("../hooks/useMergedState"));
@@ -63,7 +63,7 @@ var DEFAULTFIELDNAMES = {
63
63
  label: "label",
64
64
  children: "children"
65
65
  };
66
- var TreeContext = (0, import_react.createContext)({
66
+ var TreeContext = (0, import_react2.createContext)({
67
67
  showIcon: true,
68
68
  selectedUids: /* @__PURE__ */ new Set(),
69
69
  checkedUids: /* @__PURE__ */ new Set(),
@@ -103,11 +103,11 @@ function keysToUidArray(keys, flatItems) {
103
103
  return uids;
104
104
  }
105
105
  function useStableUidArray(keys, flatItems) {
106
- const ref = (0, import_react.useRef)({
106
+ const ref = (0, import_react2.useRef)({
107
107
  keys: void 0,
108
108
  result: void 0
109
109
  });
110
- const computed = (0, import_react.useMemo)(
110
+ const computed = (0, import_react2.useMemo)(
111
111
  () => keysToUidArray(keys, flatItems),
112
112
  [keys, flatItems]
113
113
  );
@@ -144,7 +144,7 @@ function setToArray(s) {
144
144
  return arr;
145
145
  }
146
146
  var Tree = (baseprops) => {
147
- const { tree } = (0, import_react.useContext)(import_Config_Provider.GlobalContext);
147
+ const { tree } = (0, import_react2.useContext)(import_Config_Provider.GlobalContext);
148
148
  const props = (0, import_mergeContextToProps.default)(baseprops, tree);
149
149
  const {
150
150
  prefixCls = "yee-tree",
@@ -175,11 +175,11 @@ var Tree = (baseprops) => {
175
175
  height,
176
176
  itemHeight = 28
177
177
  } = props;
178
- const [flatItems, itemMap] = (0, import_react.useMemo)(
178
+ const [flatItems, itemMap] = (0, import_react2.useMemo)(
179
179
  () => (0, import_tree_tools.tree2array)(dataSource != null ? dataSource : [], fieldNames),
180
180
  [dataSource, fieldNames]
181
181
  );
182
- const allParentUidArray = (0, import_react.useMemo)(() => {
182
+ const allParentUidArray = (0, import_react2.useMemo)(() => {
183
183
  const uids = [];
184
184
  for (const item of flatItems) {
185
185
  if (!item.isLeaf)
@@ -188,9 +188,15 @@ var Tree = (baseprops) => {
188
188
  return uids;
189
189
  }, [flatItems]);
190
190
  const stableExpandedValue = useStableUidArray(expandedKeys, flatItems);
191
- const stableExpandedDefault = useStableUidArray(defaultExpandedKeys, flatItems);
191
+ const stableExpandedDefault = useStableUidArray(
192
+ defaultExpandedKeys,
193
+ flatItems
194
+ );
192
195
  const stableSelectedValue = useStableUidArray(selectedKeys, flatItems);
193
- const stableSelectedDefault = useStableUidArray(defaultSelectedKeys, flatItems);
196
+ const stableSelectedDefault = useStableUidArray(
197
+ defaultSelectedKeys,
198
+ flatItems
199
+ );
194
200
  const stableCheckedValue = useStableUidArray(checkedKeys, flatItems);
195
201
  const stableCheckedDefault = useStableUidArray(defaultCheckedKeys, flatItems);
196
202
  const [expandedUidArray, setExpandedUidArray] = (0, import_useMergedState.default)(
@@ -200,18 +206,15 @@ var Tree = (baseprops) => {
200
206
  defaultValue: stableExpandedDefault
201
207
  }
202
208
  );
203
- const expandedUidSet = (0, import_react.useMemo)(
209
+ const expandedUidSet = (0, import_react2.useMemo)(
204
210
  () => arrayToSet(expandedUidArray),
205
211
  [expandedUidArray]
206
212
  );
207
- const [selectedUidArray, setSelectedUidArray] = (0, import_useMergedState.default)(
208
- [],
209
- {
210
- value: stableSelectedValue,
211
- defaultValue: stableSelectedDefault
212
- }
213
- );
214
- const selectedUidSet = (0, import_react.useMemo)(
213
+ const [selectedUidArray, setSelectedUidArray] = (0, import_useMergedState.default)([], {
214
+ value: stableSelectedValue,
215
+ defaultValue: stableSelectedDefault
216
+ });
217
+ const selectedUidSet = (0, import_react2.useMemo)(
215
218
  () => arrayToSet(selectedUidArray),
216
219
  [selectedUidArray]
217
220
  );
@@ -219,11 +222,11 @@ var Tree = (baseprops) => {
219
222
  value: stableCheckedValue,
220
223
  defaultValue: stableCheckedDefault
221
224
  });
222
- const checkedUidSet = (0, import_react.useMemo)(
225
+ const checkedUidSet = (0, import_react2.useMemo)(
223
226
  () => arrayToSet(checkedUidArray),
224
227
  [checkedUidArray]
225
228
  );
226
- const indeterminateUidSet = (0, import_react.useMemo)(() => {
229
+ const indeterminateUidSet = (0, import_react2.useMemo)(() => {
227
230
  const result = /* @__PURE__ */ new Set();
228
231
  for (const item of flatItems) {
229
232
  if (!item.isLeaf && !checkedUidSet.has(item.uid) && item.childUids && item.childUids.some((cuid) => checkedUidSet.has(cuid))) {
@@ -232,7 +235,7 @@ var Tree = (baseprops) => {
232
235
  }
233
236
  return result;
234
237
  }, [flatItems, checkedUidSet]);
235
- const visibleItems = (0, import_react.useMemo)(() => {
238
+ const visibleItems = (0, import_react2.useMemo)(() => {
236
239
  const visibleSet = /* @__PURE__ */ new Set();
237
240
  const result = [];
238
241
  for (const item of flatItems) {
@@ -326,9 +329,9 @@ var Tree = (baseprops) => {
326
329
  });
327
330
  }
328
331
  });
329
- const dragUidRef = (0, import_react.useRef)(null);
330
- const [draggingUid, setDraggingUid] = (0, import_react.useState)(null);
331
- const [dropState, setDropState] = (0, import_react.useState)(null);
332
+ const dragUidRef = (0, import_react2.useRef)(null);
333
+ const [draggingUid, setDraggingUid] = (0, import_react2.useState)(null);
334
+ const [dropState, setDropState] = (0, import_react2.useState)(null);
332
335
  const resolvePosition = (rect, clientY) => {
333
336
  const offset = (clientY - rect.top) / rect.height;
334
337
  if (offset < 0.25)
@@ -445,7 +448,7 @@ var Tree = (baseprops) => {
445
448
  setDraggingUid(null);
446
449
  setDropState(null);
447
450
  });
448
- const contextValue = (0, import_react.useMemo)(
451
+ const contextValue = (0, import_react2.useMemo)(
449
452
  () => ({
450
453
  prefixCls,
451
454
  checkable,
@@ -500,21 +503,21 @@ var Tree = (baseprops) => {
500
503
  });
501
504
  if (useVirtual) {
502
505
  const slicedItems = visibleItems.slice(start, end);
503
- return /* @__PURE__ */ import_react.default.createElement(
506
+ return /* @__PURE__ */ import_react2.default.createElement(
504
507
  "div",
505
508
  {
506
509
  className: (0, import_clsx.default)(prefixCls, className),
507
510
  style,
508
511
  onDragEnd: handleDragEnd
509
512
  },
510
- /* @__PURE__ */ import_react.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.default.createElement(
513
+ /* @__PURE__ */ import_react2.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react2.default.createElement(
511
514
  "div",
512
515
  {
513
516
  ref: viewportRef,
514
517
  onScroll,
515
518
  style: { height, overflowY: "auto" }
516
519
  },
517
- /* @__PURE__ */ import_react.default.createElement("div", { style: { height: totalHeight, position: "relative" } }, slicedItems.map((node, i) => /* @__PURE__ */ import_react.default.createElement(
520
+ /* @__PURE__ */ import_react2.default.createElement("div", { style: { height: totalHeight, position: "relative" } }, slicedItems.map((node, i) => /* @__PURE__ */ import_react2.default.createElement(
518
521
  import_tree_node.default,
519
522
  {
520
523
  node,
@@ -555,19 +558,19 @@ var Tree = (baseprops) => {
555
558
  if (currentGroup) {
556
559
  segments.push(__spreadValues({ type: "group" }, currentGroup));
557
560
  }
558
- return /* @__PURE__ */ import_react.default.createElement(
561
+ return /* @__PURE__ */ import_react2.default.createElement(
559
562
  "div",
560
563
  {
561
564
  className: (0, import_clsx.default)(prefixCls, className),
562
565
  style,
563
566
  onDragEnd: handleDragEnd
564
567
  },
565
- /* @__PURE__ */ import_react.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.default.createElement(import_react2.AnimatePresence, { initial: false }, segments.map((segment) => {
568
+ /* @__PURE__ */ import_react2.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react2.default.createElement(import_react.AnimatePresence, { initial: false }, segments.map((segment) => {
566
569
  if (segment.type === "node") {
567
- return /* @__PURE__ */ import_react.default.createElement(import_tree_node.default, { node: segment.node, key: segment.node.uid });
570
+ return /* @__PURE__ */ import_react2.default.createElement(import_tree_node.default, { node: segment.node, key: segment.node.uid });
568
571
  }
569
- return /* @__PURE__ */ import_react.default.createElement(
570
- import_react2.motion.div,
572
+ return /* @__PURE__ */ import_react2.default.createElement(
573
+ import_react.motion.div,
571
574
  {
572
575
  key: segment.pUid + "children",
573
576
  initial: { height: 0, opacity: 0 },
@@ -576,7 +579,7 @@ var Tree = (baseprops) => {
576
579
  transition: { duration: 0.15 },
577
580
  style: { overflow: "hidden" }
578
581
  },
579
- segment.nodes.map((node) => /* @__PURE__ */ import_react.default.createElement(import_tree_node.default, { node, key: node.uid }))
582
+ segment.nodes.map((node) => /* @__PURE__ */ import_react2.default.createElement(import_tree_node.default, { node, key: node.uid }))
580
583
  );
581
584
  })))
582
585
  );
@@ -26,9 +26,10 @@ var import_react = require("react");
26
26
  function useDelayState(state, delay = 0) {
27
27
  const [delayState, setDelayState] = (0, import_react.useState)();
28
28
  (0, import_react.useEffect)(() => {
29
- setTimeout(() => {
29
+ const timer = window.setTimeout(() => {
30
30
  setDelayState(state);
31
31
  }, delay * 1e3);
32
- }, [state]);
32
+ return () => window.clearTimeout(timer);
33
+ }, [delay, state]);
33
34
  return delayState;
34
35
  }
@@ -39,10 +39,7 @@ function useEvent(callback) {
39
39
  const memoFn = import_react.default.useCallback(
40
40
  (...args) => {
41
41
  var _a;
42
- return (_a = ref.current) == null ? void 0 : _a.call(
43
- ref,
44
- ...args
45
- );
42
+ return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
46
43
  },
47
44
  []
48
45
  );
@@ -1 +1 @@
1
- export default function useFocusManage(ele: HTMLElement, open: boolean): void;
1
+ export default function useFocusManage(element: HTMLElement | null, open: boolean): void;
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/hooks/useFocusManage.ts
@@ -34,19 +24,34 @@ __export(useFocusManage_exports, {
34
24
  module.exports = __toCommonJS(useFocusManage_exports);
35
25
  var import_react = require("react");
36
26
  var import_focusStack = require("../utils/focusStack");
37
- var import_useDelayState = __toESM(require("./useDelayState"));
38
- function useFocusManage(ele, open) {
39
- const delayOpen = (0, import_useDelayState.default)(open);
27
+ function useFocusManage(element, open) {
28
+ const entryRef = (0, import_react.useRef)(null);
29
+ const previousFocusRef = (0, import_react.useRef)(null);
30
+ const openCycleRef = (0, import_react.useRef)(false);
31
+ const releaseEntry = () => {
32
+ if (entryRef.current) {
33
+ (0, import_focusStack.popFocus)(entryRef.current);
34
+ entryRef.current = null;
35
+ }
36
+ };
37
+ const endOpenCycle = () => {
38
+ releaseEntry();
39
+ previousFocusRef.current = null;
40
+ openCycleRef.current = false;
41
+ };
42
+ (0, import_react.useEffect)(() => {
43
+ if (open && !openCycleRef.current) {
44
+ openCycleRef.current = true;
45
+ previousFocusRef.current = document.activeElement;
46
+ } else if (!open && openCycleRef.current) {
47
+ endOpenCycle();
48
+ }
49
+ }, [open]);
40
50
  (0, import_react.useEffect)(() => {
41
- if (!ele)
51
+ if (!open || !openCycleRef.current || !element || entryRef.current) {
42
52
  return;
43
- if (delayOpen) {
44
- (0, import_focusStack.pushFocus)(ele);
45
- } else {
46
- (0, import_focusStack.popFocus)();
47
53
  }
48
- return () => {
49
- (0, import_focusStack.popFocus)();
50
- };
51
- }, [ele, delayOpen]);
54
+ entryRef.current = (0, import_focusStack.pushFocus)(element, previousFocusRef.current);
55
+ }, [element, open]);
56
+ (0, import_react.useEffect)(() => releaseEntry, []);
52
57
  }
@@ -224,6 +224,8 @@
224
224
  /* --Dialog-- */
225
225
  --yee-dialog-z-index: var(--yee-z-index-overlay);
226
226
  --yee-dialog-mask-z-index: var(--yee-z-index-mask);
227
+ --yee-dialog-title-font-size: 18px;
228
+ --yee-dialog-title-font-weight: 600;
227
229
  --yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
228
230
  --yee-dialog-header-margin-bottom: 12px;
229
231
  --yee-dialog-content-margin-top: 10%;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @rainbow-oh/yee-c CSS Variables
3
3
  * Auto-generated, do not edit manually
4
- * Generated on 2026-07-22T03:22:12.652Z
4
+ * Generated on 2026-07-23T09:42:21.552Z
5
5
  */
6
6
 
7
7
  /* ========== color.blue.css ========== */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @rainbow-oh/yee-c CSS Variables
3
3
  * Auto-generated, do not edit manually
4
- * Generated on 2026-07-22T03:22:12.652Z
4
+ * Generated on 2026-07-23T09:42:21.552Z
5
5
  */
6
6
 
7
7
  /* ========== color.css ========== */
@@ -1346,6 +1346,8 @@
1346
1346
  /* --Dialog-- */
1347
1347
  --yee-dialog-z-index: var(--yee-z-index-overlay);
1348
1348
  --yee-dialog-mask-z-index: var(--yee-z-index-mask);
1349
+ --yee-dialog-title-font-size: 18px;
1350
+ --yee-dialog-title-font-weight: 600;
1349
1351
  --yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
1350
1352
  --yee-dialog-header-margin-bottom: 12px;
1351
1353
  --yee-dialog-content-margin-top: 10%;
@@ -1,4 +1,8 @@
1
1
  type Focusable = HTMLElement | null;
2
- export declare const pushFocus: (el: Focusable) => void;
3
- export declare const popFocus: () => void;
2
+ export interface FocusStackEntry {
3
+ container: HTMLElement;
4
+ previous: Focusable;
5
+ }
6
+ export declare const pushFocus: (container: HTMLElement, previous?: Focusable) => FocusStackEntry;
7
+ export declare const popFocus: (entry: FocusStackEntry) => void;
4
8
  export {};
@@ -23,21 +23,50 @@ __export(focusStack_exports, {
23
23
  pushFocus: () => pushFocus
24
24
  });
25
25
  module.exports = __toCommonJS(focusStack_exports);
26
+ var focusableSelector = [
27
+ "a[href]",
28
+ "button:not([disabled])",
29
+ "textarea:not([disabled])",
30
+ "input:not([disabled])",
31
+ "select:not([disabled])",
32
+ "details",
33
+ '[tabindex]:not([tabindex="-1"])'
34
+ ].join(",");
26
35
  var stack = [];
27
36
  var raf = 0;
28
- var schedule = (el) => {
37
+ var schedule = (callback) => {
29
38
  cancelAnimationFrame(raf);
30
- raf = requestAnimationFrame(() => el == null ? void 0 : el.focus());
39
+ raf = requestAnimationFrame(callback);
31
40
  };
32
- var pushFocus = (el) => {
33
- const prev = document.activeElement;
34
- if (prev && prev !== el)
35
- stack.push(prev);
36
- schedule(el);
41
+ var focusInitialElement = (entry) => {
42
+ if (stack[stack.length - 1] !== entry || !entry.container.isConnected) {
43
+ return;
44
+ }
45
+ const activeElement = document.activeElement;
46
+ if (activeElement && entry.container.contains(activeElement)) {
47
+ return;
48
+ }
49
+ const firstFocusable = entry.container.querySelector(focusableSelector);
50
+ (firstFocusable != null ? firstFocusable : entry.container).focus();
51
+ };
52
+ var pushFocus = (container, previous = document.activeElement) => {
53
+ const entry = { container, previous };
54
+ stack.push(entry);
55
+ schedule(() => focusInitialElement(entry));
56
+ return entry;
37
57
  };
38
- var popFocus = () => {
39
- const el = stack.pop();
40
- if (!el)
58
+ var popFocus = (entry) => {
59
+ const index = stack.lastIndexOf(entry);
60
+ if (index === -1)
61
+ return;
62
+ const isTopEntry = index === stack.length - 1;
63
+ stack.splice(index, 1);
64
+ if (!isTopEntry)
41
65
  return;
42
- schedule(el);
66
+ schedule(() => {
67
+ var _a;
68
+ if ((_a = entry.previous) == null ? void 0 : _a.isConnected) {
69
+ entry.previous.focus();
70
+ }
71
+ });
43
72
  };
@@ -3,4 +3,4 @@ declare global {
3
3
  __yee_c_version__: string;
4
4
  }
5
5
  }
6
- export declare const version = "0.8.0";
6
+ export declare const version = "0.8.2";
@@ -22,7 +22,7 @@ __export(version_exports, {
22
22
  version: () => version
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- var version = "0.8.0";
25
+ var version = "0.8.2";
26
26
  if (typeof window !== "undefined") {
27
27
  window.__yee_c_version__ = version;
28
28
  }
@@ -79,8 +79,8 @@ var Card = function Card(baseprops) {
79
79
  className: clsx("".concat(prefixCls, "-header-expand-icon"), classNames === null || classNames === void 0 ? void 0 : classNames.expandIcon),
80
80
  style: styles === null || styles === void 0 ? void 0 : styles.expandIcon,
81
81
  "aria-expanded": mergedExpanded,
82
+ "aria-label": mergedExpanded ? 'Collapse content' : 'Expand content',
82
83
  icon: icon ? icon : /*#__PURE__*/React.createElement(ChevronUp, {
83
- "aria-label": "expanded",
84
84
  strokeWidth: 1.5,
85
85
  size: 16,
86
86
  style: {
@@ -110,7 +110,8 @@ var Card = function Card(baseprops) {
110
110
  onClick: headerClickable ? handleExpand : undefined,
111
111
  onKeyDown: handleKeyDown,
112
112
  tabIndex: headerClickable ? 0 : undefined,
113
- role: headerClickable ? 'button' : undefined
113
+ role: headerClickable ? 'button' : undefined,
114
+ "aria-expanded": headerClickable ? mergedExpanded : undefined
114
115
  }, iconPosition === 'left' ? renderExpandIcon() : null, title ? /*#__PURE__*/React.createElement("div", {
115
116
  id: headerId,
116
117
  className: clsx("".concat(prefixCls, "-header-title"), classNames === null || classNames === void 0 ? void 0 : classNames.title),
@@ -131,7 +132,10 @@ var Card = function Card(baseprops) {
131
132
  },
132
133
  transition: {
133
134
  duration: animationDuration
134
- }
135
+ },
136
+ role: "region",
137
+ "aria-labelledby": title ? headerId : undefined,
138
+ "aria-hidden": !mergedExpanded
135
139
  }, children));
136
140
  };
137
141
  export default Card;
@@ -13,10 +13,15 @@ var CarouselItem = function CarouselItem(props) {
13
13
  var _React$useContext = React.useContext(CarouselCtx),
14
14
  prefixCls = _React$useContext.prefixCls,
15
15
  current = _React$useContext.current;
16
+ var isActive = index === current - 1;
16
17
  return /*#__PURE__*/React.createElement("div", {
17
- className: clsx("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-active"), index === current - 1), className),
18
+ className: clsx("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-active"), isActive), className),
18
19
  "data-index": index,
19
- style: style
20
+ style: style,
21
+ role: "tabpanel",
22
+ "aria-roledescription": "slide",
23
+ "aria-label": "Slide ".concat((index !== null && index !== void 0 ? index : 0) + 1),
24
+ "aria-hidden": !isActive
20
25
  }, children);
21
26
  };
22
27
  export default CarouselItem;
@@ -166,6 +166,9 @@ var Carousel = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
166
166
  };
167
167
  var carouselProps = _objectSpread(_objectSpread({}, rest), {}, {
168
168
  className: clsx(prefixCls, ["".concat(prefixCls, "-").concat(direction)], ["".concat(prefixCls, "-").concat(effect)], _defineProperty({}, "".concat(prefixCls, "-arrows-visible"), showArrow), className),
169
+ role: 'region',
170
+ 'aria-roledescription': 'carousel',
171
+ 'aria-live': autoplay ? 'off' : 'polite',
169
172
  onMouseEnter: handleMouseEnter,
170
173
  onMouseLeave: handleMouseLeave
171
174
  });
@@ -181,24 +184,48 @@ var Carousel = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
181
184
  show: infinite || current > 1
182
185
  }, classNames === null || classNames === void 0 ? void 0 : classNames.prev),
183
186
  style: styles === null || styles === void 0 ? void 0 : styles.prev,
184
- onClick: prev
187
+ onClick: prev,
188
+ role: "button",
189
+ "aria-label": "Previous slide",
190
+ tabIndex: 0,
191
+ onKeyDown: function onKeyDown(e) {
192
+ if (e.key === 'Enter' || e.key === ' ') {
193
+ e.preventDefault();
194
+ prev();
195
+ }
196
+ }
185
197
  }, direction === 'vertical' ? /*#__PURE__*/React.createElement(ChevronUp, null) : /*#__PURE__*/React.createElement(ChevronLeft, null)), /*#__PURE__*/React.createElement("div", {
186
198
  className: clsx("".concat(prefixCls, "-next"), {
187
199
  show: infinite || current !== count
188
200
  }, classNames === null || classNames === void 0 ? void 0 : classNames.next),
189
201
  style: styles === null || styles === void 0 ? void 0 : styles.next,
190
- onClick: next
202
+ onClick: next,
203
+ role: "button",
204
+ "aria-label": "Next slide",
205
+ tabIndex: 0,
206
+ onKeyDown: function onKeyDown(e) {
207
+ if (e.key === 'Enter' || e.key === ' ') {
208
+ e.preventDefault();
209
+ next();
210
+ }
211
+ }
191
212
  }, direction === 'vertical' ? /*#__PURE__*/React.createElement(ChevronDown, null) : /*#__PURE__*/React.createElement(ChevronRight, null)));
192
213
  };
193
214
  var renderDots = function renderDots() {
194
215
  return dots ? /*#__PURE__*/React.createElement("ul", {
195
216
  className: clsx("".concat(prefixCls, "-bar"), ["".concat(prefixCls, "-bar-").concat(dotShape)], ["".concat(prefixCls, "-bar-").concat(dotPosition)], classNames === null || classNames === void 0 ? void 0 : classNames.dot),
196
- style: styles === null || styles === void 0 ? void 0 : styles.dot
217
+ style: styles === null || styles === void 0 ? void 0 : styles.dot,
218
+ role: "tablist",
219
+ "aria-label": "Slide controls"
197
220
  }, new Array(React.Children.count(children)).fill(0).map(function (i, index) {
221
+ var isActive = current === index + 1 || current === 0 && index === count - 1;
198
222
  return /*#__PURE__*/React.createElement("li", {
199
223
  className: clsx({
200
- active: current === index + 1 || current === 0 && index === count
224
+ active: isActive
201
225
  }),
226
+ role: "tab",
227
+ "aria-selected": isActive,
228
+ "aria-label": "Slide ".concat(index + 1),
202
229
  tabIndex: 0,
203
230
  onClick: function onClick() {
204
231
  return handleIndicator(index + 1, 'click');
@@ -425,7 +425,9 @@ var Cascader = function Cascader(baseprops) {
425
425
  };
426
426
  var renderPopup = function renderPopup() {
427
427
  return /*#__PURE__*/React.createElement("div", {
428
- className: clsx(prefixCls)
428
+ className: clsx(prefixCls),
429
+ role: "group",
430
+ "aria-label": "Cascader options"
429
431
  }, isFilter ? /*#__PURE__*/React.createElement(SearchList, {
430
432
  prefixCls: prefixCls,
431
433
  items: filteredList,
@@ -7,7 +7,8 @@ var Column = function Column(props) {
7
7
  index = props.index;
8
8
  return /*#__PURE__*/React.createElement("ul", {
9
9
  className: "".concat(prefixCls, "-menu"),
10
- role: "menu"
10
+ role: "listbox",
11
+ "aria-label": "Level ".concat(index + 1, " options")
11
12
  }, Array.isArray(data) && data.map(function (item, idx) {
12
13
  return /*#__PURE__*/React.createElement(Node, _extends({}, item, {
13
14
  index: idx,
@@ -17,7 +17,7 @@ import isEqual from "../utils/isEqual";
17
17
  import { CascaderCtx } from "./cascader";
18
18
  import { getChildren, isHalfChecked } from "./utils";
19
19
  var Node = function Node(props) {
20
- var _expandedPath$level;
20
+ var _expandedPath$level, _expandedPath$level2, _expandedPath$level3;
21
21
  var uid = props.uid,
22
22
  value = props.value,
23
23
  disabled = props.disabled,
@@ -95,22 +95,36 @@ var Node = function Node(props) {
95
95
  onMouseEnter: handleMouseEnter,
96
96
  onClick: function onClick(e) {
97
97
  return handleClick(false, e);
98
+ },
99
+ role: "option",
100
+ "aria-disabled": disabled || undefined,
101
+ "aria-selected": checked || ((_expandedPath$level2 = expandedPath[level]) === null || _expandedPath$level2 === void 0 ? void 0 : _expandedPath$level2.key) === uid,
102
+ "aria-expanded": isParent ? ((_expandedPath$level3 = expandedPath[level]) === null || _expandedPath$level3 === void 0 ? void 0 : _expandedPath$level3.key) === uid : undefined,
103
+ tabIndex: disabled ? -1 : 0,
104
+ onKeyDown: function onKeyDown(e) {
105
+ if (e.key === 'Enter' || e.key === ' ') {
106
+ e.preventDefault();
107
+ handleClick(false, e);
108
+ }
98
109
  }
99
110
  }, multiple && /*#__PURE__*/React.createElement(Checkbox, {
100
111
  checked: isParent ? checkedAll : checked,
101
112
  onChange: isParent ? function () {
102
113
  return handleClick(true);
103
114
  } : undefined,
104
- indeterminate: indeterminate
115
+ indeterminate: indeterminate,
116
+ "aria-label": "Select ".concat(typeof label === 'string' ? label : String(label))
105
117
  }), /*#__PURE__*/React.createElement("span", {
106
118
  className: clsx("".concat(prefixCls, "-menu-item-label"), {
107
119
  loaded: load === 2
108
120
  }),
109
121
  title: typeof label === 'string' ? label : String(label)
110
122
  }, label), load === 1 ? /*#__PURE__*/React.createElement(Spin, {
111
- size: "small"
123
+ size: "small",
124
+ "aria-label": "Loading"
112
125
  }) : isLeaf === false ? /*#__PURE__*/React.createElement(ChevronRight, {
113
- size: 20
126
+ size: 20,
127
+ "aria-hidden": "true"
114
128
  }) : null);
115
129
  };
116
130
  export default /*#__PURE__*/memo(Node);
@@ -12,9 +12,11 @@ var SearchList = function SearchList(props) {
12
12
  items = props.items,
13
13
  _onClick = props.onClick;
14
14
  return /*#__PURE__*/React.createElement("ul", {
15
- className: "".concat(prefixCls, "-filter-menu")
15
+ className: "".concat(prefixCls, "-filter-menu"),
16
+ role: "listbox",
17
+ "aria-label": "Search results"
16
18
  }, items.length ? items.map(function (item) {
17
- var _item$data$$source;
19
+ var _item$data$$source, _item$data$$source2;
18
20
  var title = ((_item$data$$source = item.data.$source) === null || _item$data$$source === void 0 ? void 0 : _item$data$$source.title) || item.data.labelPath.join(' / ');
19
21
  return /*#__PURE__*/React.createElement("li", {
20
22
  className: "".concat(prefixCls, "-filter-menu-item"),
@@ -22,8 +24,20 @@ var SearchList = function SearchList(props) {
22
24
  onClick: function onClick() {
23
25
  return _onClick(item.data);
24
26
  },
25
- key: item.data.uid
27
+ key: item.data.uid,
28
+ role: "option",
29
+ "aria-disabled": ((_item$data$$source2 = item.data.$source) === null || _item$data$$source2 === void 0 ? void 0 : _item$data$$source2.disabled) || undefined,
30
+ tabIndex: 0,
31
+ onKeyDown: function onKeyDown(e) {
32
+ if (e.key === 'Enter' || e.key === ' ') {
33
+ e.preventDefault();
34
+ _onClick(item.data);
35
+ }
36
+ }
26
37
  }, renderHighlightText(item.matches));
27
- }) : /*#__PURE__*/React.createElement("p", null, 'No result'));
38
+ }) : /*#__PURE__*/React.createElement("li", {
39
+ role: "option",
40
+ "aria-disabled": "true"
41
+ }, 'No result'));
28
42
  };
29
43
  export default /*#__PURE__*/React.memo(SearchList);