@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
@@ -60,7 +60,9 @@ var CheckboxGroup = function CheckboxGroup(baseprops) {
60
60
  };
61
61
  return /*#__PURE__*/React.createElement("div", {
62
62
  className: cls,
63
- style: style
63
+ style: style,
64
+ role: "group",
65
+ "aria-disabled": disabled || undefined
64
66
  }, /*#__PURE__*/React.createElement(CheckboxGroupCtx.Provider, {
65
67
  value: {
66
68
  name: name,
@@ -55,7 +55,8 @@ var Checkbox = function Checkbox(baseprops) {
55
55
  };
56
56
  return /*#__PURE__*/React.createElement("label", {
57
57
  className: clsx("".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-wrapper-disabled"), disabled), className),
58
- style: style
58
+ style: style,
59
+ "aria-disabled": disabled || undefined
59
60
  }, /*#__PURE__*/React.createElement("span", {
60
61
  className: clsx("".concat(prefixCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-checked"), mergedChecked), "".concat(prefixCls, "-indeterminate"), indeterminate), "".concat(prefixCls, "-disabled"), disabled))
61
62
  }, /*#__PURE__*/React.createElement("input", _extends({}, rest, {
@@ -65,10 +66,12 @@ var Checkbox = function Checkbox(baseprops) {
65
66
  value: value,
66
67
  disabled: disabled,
67
68
  checked: mergedChecked,
68
- onChange: handleChange
69
+ onChange: handleChange,
70
+ "aria-checked": indeterminate ? 'mixed' : mergedChecked
69
71
  })), /*#__PURE__*/React.createElement("span", {
70
72
  className: clsx("".concat(prefixCls, "-inner"), classNames === null || classNames === void 0 ? void 0 : classNames.inner),
71
- style: styles === null || styles === void 0 ? void 0 : styles.inner
73
+ style: styles === null || styles === void 0 ? void 0 : styles.inner,
74
+ "aria-hidden": "true"
72
75
  })), children ? /*#__PURE__*/React.createElement("span", {
73
76
  className: clsx("".concat(prefixCls, "-label"), classNames === null || classNames === void 0 ? void 0 : classNames.label),
74
77
  style: styles === null || styles === void 0 ? void 0 : styles.label
@@ -5,7 +5,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
5
5
  import clsx from 'clsx';
6
6
  import { ChevronRight } from 'lucide-react';
7
7
  import { AnimatePresence, motion } from 'motion/react';
8
- import React, { useContext } from 'react';
8
+ import React, { useContext, useId } from 'react';
9
9
  import Button from "../Button";
10
10
  import { CollapseContext } from "./collapse";
11
11
  var Panel = function Panel(props) {
@@ -21,6 +21,9 @@ var Panel = function Panel(props) {
21
21
  prefixCls = _useContext.prefixCls,
22
22
  activeKey = _useContext.activeKey,
23
23
  onExpand = _useContext.onExpand;
24
+ var panelId = useId();
25
+ var headerId = "".concat(panelId, "-header");
26
+ var contentId = "".concat(panelId, "-content");
24
27
  var expanded = activeKey.includes(id);
25
28
  var itemClassName = clsx("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-expanded"), expanded), className);
26
29
  return /*#__PURE__*/React.createElement("div", {
@@ -30,7 +33,9 @@ var Panel = function Panel(props) {
30
33
  className: clsx("".concat(prefixCls, "-header"), classNames === null || classNames === void 0 ? void 0 : classNames.header),
31
34
  role: "button",
32
35
  style: styles === null || styles === void 0 ? void 0 : styles.header,
36
+ id: headerId,
33
37
  "aria-expanded": expanded,
38
+ "aria-controls": contentId,
34
39
  "aria-disabled": "false",
35
40
  tabIndex: 0,
36
41
  onClick: function onClick() {
@@ -50,7 +55,8 @@ var Panel = function Panel(props) {
50
55
  },
51
56
  transition: {
52
57
  duration: 0.15
53
- }
58
+ },
59
+ "aria-hidden": "true"
54
60
  }, /*#__PURE__*/React.createElement(Button, {
55
61
  icon: /*#__PURE__*/React.createElement(ChevronRight, {
56
62
  size: 16
@@ -69,6 +75,9 @@ var Panel = function Panel(props) {
69
75
  }, typeof extra === 'function' ? extra() : extra)), /*#__PURE__*/React.createElement(AnimatePresence, null, expanded && /*#__PURE__*/React.createElement(motion.div, {
70
76
  className: clsx("".concat(prefixCls, "-content"), classNames === null || classNames === void 0 ? void 0 : classNames.content),
71
77
  style: styles === null || styles === void 0 ? void 0 : styles.content,
78
+ id: contentId,
79
+ role: "region",
80
+ "aria-labelledby": headerId,
72
81
  initial: {
73
82
  height: 0,
74
83
  opacity: 0
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
17
  import clsx from 'clsx';
18
18
  import { X } from 'lucide-react';
19
19
  import { motion } from 'motion/react';
20
- import React, { useContext, useEffect, useRef, useState } from 'react';
20
+ import React, { useCallback, useContext, useEffect, useId, useRef, useState } from 'react';
21
21
  import Button from "../Button";
22
22
  import { GlobalContext } from "../Config-Provider";
23
23
  import useEsc from "../hooks/useEsc";
@@ -35,7 +35,6 @@ var ANIMATION_DURATION = 0.2;
35
35
  var CLOSE_ICON_SIZE = 16;
36
36
  var CLOSE_ICON_STROKE_WIDTH = 1.5;
37
37
  var Dialog = function Dialog(baseprops) {
38
- var _contentRef$current2;
39
38
  var _useContext = useContext(GlobalContext),
40
39
  dialog = _useContext.dialog;
41
40
  var props = mergeContextToProps(baseprops, dialog);
@@ -84,7 +83,18 @@ var Dialog = function Dialog(baseprops) {
84
83
  _useState2 = _slicedToArray(_useState, 2),
85
84
  delayOpen = _useState2[0],
86
85
  setDelayOpen = _useState2[1];
86
+ var _useState3 = useState(null),
87
+ _useState4 = _slicedToArray(_useState3, 2),
88
+ contentElement = _useState4[0],
89
+ setContentElement = _useState4[1];
87
90
  var contentRef = useRef(null);
91
+ var setContentRef = useCallback(function (element) {
92
+ contentRef.current = element;
93
+ setContentElement(element);
94
+ }, []);
95
+ var dialogId = useId();
96
+ var titleId = "".concat(dialogId, "-title");
97
+ var bodyId = "".concat(dialogId, "-body");
88
98
 
89
99
  // When open changes and openResetLocation is true, reset position
90
100
  useEffect(function () {
@@ -102,7 +112,7 @@ var Dialog = function Dialog(baseprops) {
102
112
  });
103
113
 
104
114
  // lock focus in the dialog
105
- useLockFocus((_contentRef$current2 = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) !== null && _contentRef$current2 !== void 0 ? _contentRef$current2 : null, delayOpen);
115
+ useLockFocus(contentElement, delayOpen);
106
116
 
107
117
  // enable esc to close dialog
108
118
  useEsc({
@@ -112,8 +122,8 @@ var Dialog = function Dialog(baseprops) {
112
122
  }
113
123
  });
114
124
 
115
- // manage focus
116
- useFocusManage(contentRef.current, delayOpen);
125
+ // manage focus once per open cycle
126
+ useFocusManage(contentElement, open);
117
127
  var cls = clsx(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-open"), delayOpen), "".concat(prefixCls, "-fullscreen"), fullscreen));
118
128
  var renderFooter = function renderFooter() {
119
129
  if (footer === false || footer === null) {
@@ -164,7 +174,8 @@ var Dialog = function Dialog(baseprops) {
164
174
  }
165
175
  }), showMask && delayOpen && /*#__PURE__*/React.createElement("div", {
166
176
  className: clsx("".concat(prefixCls, "-mask"), classNames === null || classNames === void 0 ? void 0 : classNames.mask),
167
- style: styles === null || styles === void 0 ? void 0 : styles.mask
177
+ style: styles === null || styles === void 0 ? void 0 : styles.mask,
178
+ "aria-hidden": "true"
168
179
  }), /*#__PURE__*/React.createElement("div", {
169
180
  className: "".concat(prefixCls, "-content-wrapper"),
170
181
  onClick: maskClosable ? onCancel : undefined
@@ -177,7 +188,11 @@ var Dialog = function Dialog(baseprops) {
177
188
  onClick: function onClick(e) {
178
189
  return e.stopPropagation();
179
190
  },
180
- ref: contentRef
191
+ ref: setContentRef,
192
+ role: "dialog",
193
+ "aria-modal": showMask ? true : undefined,
194
+ "aria-labelledby": title ? titleId : undefined,
195
+ "aria-describedby": bodyId
181
196
  }, closable ? /*#__PURE__*/React.createElement(Button, {
182
197
  type: "text",
183
198
  icon: /*#__PURE__*/React.createElement(X, {
@@ -190,11 +205,13 @@ var Dialog = function Dialog(baseprops) {
190
205
  }) : null, title ? /*#__PURE__*/React.createElement("div", {
191
206
  className: clsx("".concat(prefixCls, "-header"), classNames === null || classNames === void 0 ? void 0 : classNames.header),
192
207
  style: styles === null || styles === void 0 ? void 0 : styles.header
193
- }, /*#__PURE__*/React.createElement("div", {
194
- className: "".concat(prefixCls, "-title")
195
- }, title)) : null, /*#__PURE__*/React.createElement("div", {
208
+ }, typeof title === 'string' ? /*#__PURE__*/React.createElement("div", {
209
+ className: "".concat(prefixCls, "-title"),
210
+ id: titleId
211
+ }, title) : title) : null, /*#__PURE__*/React.createElement("div", {
196
212
  className: clsx("".concat(prefixCls, "-body"), classNames === null || classNames === void 0 ? void 0 : classNames.body),
197
- style: styles === null || styles === void 0 ? void 0 : styles.body
213
+ style: styles === null || styles === void 0 ? void 0 : styles.body,
214
+ id: bodyId
198
215
  }, children), renderFooter())));
199
216
  return /*#__PURE__*/React.createElement(Portal, {
200
217
  open: open,
@@ -53,7 +53,7 @@ export interface DialogProps extends DataAttributeProps {
53
53
  /**
54
54
  * Title
55
55
  */
56
- title?: string;
56
+ title?: string | React.ReactNode;
57
57
  /**
58
58
  * Cancel button text
59
59
  * @default Cancel
@@ -37,7 +37,8 @@
37
37
  }
38
38
 
39
39
  &-title {
40
- font-weight: 600;
40
+ font-size: var(--yee-dialog-title-font-size);
41
+ font-weight: var(--yee-dialog-title-font-weight);
41
42
  }
42
43
 
43
44
  &-content {
@@ -15,7 +15,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
15
15
  import clsx from 'clsx';
16
16
  import { X } from 'lucide-react';
17
17
  import { motion } from 'motion/react';
18
- import React, { useContext, useRef, useState } from 'react';
18
+ import React, { useContext, useId, useRef, useState } from 'react';
19
19
  import Button from "../Button";
20
20
  import { GlobalContext } from "../Config-Provider";
21
21
  import Portal from "../Portal";
@@ -132,6 +132,9 @@ var Drawer = function Drawer(baseprops) {
132
132
  delayOpen = _useState2[0],
133
133
  setDelayOpen = _useState2[1];
134
134
  var contentRef = useRef(null);
135
+ var drawerId = useId();
136
+ var titleId = "".concat(drawerId, "-title");
137
+ var bodyId = "".concat(drawerId, "-body");
135
138
  useLockFocus(contentRef.current, delayOpen);
136
139
  useEsc({
137
140
  enabled: keyboard,
@@ -177,8 +180,7 @@ var Drawer = function Drawer(baseprops) {
177
180
  exit = _getAnimate.exit;
178
181
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
179
182
  className: cls,
180
- style: style,
181
- role: "modal"
183
+ style: style
182
184
  }), showMask && delayOpen && /*#__PURE__*/React.createElement(motion.div, {
183
185
  className: clsx("".concat(prefixCls, "-mask"), classNames === null || classNames === void 0 ? void 0 : classNames.mask),
184
186
  style: styles === null || styles === void 0 ? void 0 : styles.mask,
@@ -196,7 +198,8 @@ var Drawer = function Drawer(baseprops) {
196
198
  },
197
199
  transition: {
198
200
  duration: ANIMATION_DURATION
199
- }
201
+ },
202
+ "aria-hidden": "true"
200
203
  }), /*#__PURE__*/React.createElement(motion.div, {
201
204
  className: "".concat(prefixCls, "-content-wrapper"),
202
205
  style: {
@@ -223,16 +226,22 @@ var Drawer = function Drawer(baseprops) {
223
226
  className: clsx("".concat(prefixCls, "-content"), classNames === null || classNames === void 0 ? void 0 : classNames.content),
224
227
  tabIndex: 0,
225
228
  style: styles === null || styles === void 0 ? void 0 : styles.content,
226
- ref: contentRef
229
+ ref: contentRef,
230
+ role: "dialog",
231
+ "aria-modal": showMask ? true : undefined,
232
+ "aria-labelledby": title ? titleId : undefined,
233
+ "aria-describedby": bodyId
227
234
  }, renderClose(), title ? /*#__PURE__*/React.createElement("div", {
228
235
  className: clsx("".concat(prefixCls, "-header"), classNames === null || classNames === void 0 ? void 0 : classNames.header),
229
236
  style: styles === null || styles === void 0 ? void 0 : styles.header
230
237
  }, /*#__PURE__*/React.createElement("div", {
231
238
  className: clsx("".concat(prefixCls, "-title"), classNames === null || classNames === void 0 ? void 0 : classNames.title),
232
- style: styles === null || styles === void 0 ? void 0 : styles.title
239
+ style: styles === null || styles === void 0 ? void 0 : styles.title,
240
+ id: titleId
233
241
  }, title)) : null, /*#__PURE__*/React.createElement("div", {
234
242
  className: clsx("".concat(prefixCls, "-body"), classNames === null || classNames === void 0 ? void 0 : classNames.body),
235
- style: styles === null || styles === void 0 ? void 0 : styles.body
243
+ style: styles === null || styles === void 0 ? void 0 : styles.body,
244
+ id: bodyId
236
245
  }, children), renderFooter())));
237
246
  };
238
247
  return /*#__PURE__*/React.createElement(Portal, {
@@ -16,9 +16,9 @@ import clsx from 'clsx';
16
16
  import { AnimatePresence, motion } from 'motion/react';
17
17
  import React, { useContext, useEffect, useId, useMemo, useReducer, useRef } from 'react';
18
18
  import Grid from "../Grid";
19
- import { runValidator } from "./utils/validate";
20
19
  import FieldContext from "./FieldContext";
21
20
  import FormContext from "./FormContext";
21
+ import { runValidator } from "./utils/validate";
22
22
  var Group = function Group(props) {
23
23
  var _errors$;
24
24
  var label = props.label,
@@ -69,7 +69,11 @@ var MenuItem = function MenuItem(props) {
69
69
  paddingLeft: paddingLeft
70
70
  }, styles === null || styles === void 0 ? void 0 : styles.item),
71
71
  onClick: handleClick,
72
- title: isCollapsed && typeof label === 'string' ? label : undefined
72
+ title: isCollapsed && typeof label === 'string' ? label : undefined,
73
+ role: "menuitem",
74
+ "aria-disabled": disabled || undefined,
75
+ "aria-current": selectedKeys !== null && selectedKeys !== void 0 && selectedKeys.includes(key) ? 'page' : undefined,
76
+ tabIndex: disabled ? -1 : 0
73
77
  }, iconNode, !isCollapsed && /*#__PURE__*/React.createElement("span", {
74
78
  className: "".concat(prefixCls, "-item-content"),
75
79
  title: typeof label === 'string' ? label : ''
@@ -130,7 +134,8 @@ var MenuItem = function MenuItem(props) {
130
134
  if (isCollapsed) return null;
131
135
  if (mode === 'vertical' || mode === 'horizontal') {
132
136
  return /*#__PURE__*/React.createElement("span", {
133
- className: "".concat(prefixCls, "-item-switch")
137
+ className: "".concat(prefixCls, "-item-switch"),
138
+ "aria-hidden": "true"
134
139
  }, /*#__PURE__*/React.createElement(ChevronRight, {
135
140
  strokeWidth: 2,
136
141
  size: 18
@@ -143,14 +148,18 @@ var MenuItem = function MenuItem(props) {
143
148
  },
144
149
  transition: {
145
150
  duration: 0.15
146
- }
151
+ },
152
+ "aria-hidden": "true"
147
153
  }, /*#__PURE__*/React.createElement(ChevronDown, {
148
154
  strokeWidth: 2,
149
155
  size: 18
150
156
  }));
151
157
  };
152
158
  var triggerNode = /*#__PURE__*/React.createElement("div", {
153
- role: "submenu",
159
+ role: "menuitem",
160
+ "aria-haspopup": "true",
161
+ "aria-expanded": opened,
162
+ "aria-disabled": disabled || undefined,
154
163
  className: clsx("".concat(prefixCls, "-submenu-title"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-submenu-open"), opened), "".concat(prefixCls, "-submenu-selected"), selectedKeys.includes(key) || selectedKeys.find(function (k) {
155
164
  return childrenKeys.includes(k);
156
165
  }))),
@@ -158,6 +167,7 @@ var MenuItem = function MenuItem(props) {
158
167
  paddingLeft: paddingLeft
159
168
  },
160
169
  onClick: handleExpand,
170
+ tabIndex: disabled ? -1 : 0,
161
171
  title: isCollapsed && typeof label === 'string' ? label : undefined
162
172
  }, iconNode, !isCollapsed && /*#__PURE__*/React.createElement("div", {
163
173
  className: "".concat(prefixCls, "-item-content"),
@@ -168,7 +178,8 @@ var MenuItem = function MenuItem(props) {
168
178
  var usePopup = mode === 'vertical' || mode === 'horizontal' || isCollapsed;
169
179
  var placement = mode === 'horizontal' && !isCollapsed ? 'bottomLeft' : 'rightTop';
170
180
  var childNode = /*#__PURE__*/React.createElement("li", {
171
- className: cls
181
+ className: cls,
182
+ role: "none"
172
183
  }, usePopup ? /*#__PURE__*/React.createElement(Trigger, {
173
184
  open: openKeys.includes(key),
174
185
  popup: popup,
@@ -25,11 +25,16 @@ var MenuGroup = function MenuGroup(_ref2) {
25
25
  prefixCls = _ref2.prefixCls,
26
26
  renderItems = _ref2.renderItems;
27
27
  return /*#__PURE__*/React.createElement("li", {
28
- className: "".concat(prefixCls, "-item-group")
28
+ className: "".concat(prefixCls, "-item-group"),
29
+ role: "none"
29
30
  }, /*#__PURE__*/React.createElement("div", {
30
- className: "".concat(prefixCls, "-item-group-title")
31
+ className: "".concat(prefixCls, "-item-group-title"),
32
+ role: "presentation",
33
+ id: "".concat(prefixCls, "-group-").concat(String(item.label))
31
34
  }, item.label), /*#__PURE__*/React.createElement("ul", {
32
- className: "".concat(prefixCls, "-item-group-list")
35
+ className: "".concat(prefixCls, "-item-group-list"),
36
+ role: "group",
37
+ "aria-labelledby": "".concat(prefixCls, "-group-").concat(String(item.label))
33
38
  }, renderItems(item.children)));
34
39
  };
35
40
  var Menu = function Menu(props) {
@@ -89,7 +94,7 @@ var Menu = function Menu(props) {
89
94
  return /*#__PURE__*/React.createElement("ul", _extends({}, dataAttrs, {
90
95
  className: cls,
91
96
  style: rootStyle,
92
- role: "menu"
97
+ role: root && mode === 'horizontal' ? 'menubar' : 'menu'
93
98
  }), /*#__PURE__*/React.createElement(MenuCtx.Provider, {
94
99
  value: {
95
100
  level: level,
@@ -98,7 +103,8 @@ var Menu = function Menu(props) {
98
103
  styles: styles
99
104
  }
100
105
  }, getChildFromItems(items), level === 0 && footer && /*#__PURE__*/React.createElement("li", {
101
- className: "".concat(prefixCls, "-footer")
106
+ className: "".concat(prefixCls, "-footer"),
107
+ role: "none"
102
108
  }, footer)));
103
109
  };
104
110
  Menu.displayName = 'Menu';
@@ -60,15 +60,18 @@ var Items = function Items(props) {
60
60
  }
61
61
  },
62
62
  role: "button",
63
+ "aria-label": "Jump back 7 pages",
63
64
  key: "turnleft"
64
65
  }, (_components$jumpPrev = components === null || components === void 0 ? void 0 : components.jumpPrev) !== null && _components$jumpPrev !== void 0 ? _components$jumpPrev : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
65
- className: "".concat(prefixCls, "-jump-prev-ellipsis")
66
+ className: "".concat(prefixCls, "-jump-prev-ellipsis"),
67
+ "aria-hidden": "true"
66
68
  }, /*#__PURE__*/React.createElement(Ellipsis, {
67
69
  className: "ellipsis",
68
70
  size: 18,
69
71
  strokeWidth: 1.5
70
72
  })), /*#__PURE__*/React.createElement("span", {
71
- className: "".concat(prefixCls, "-jump-prev-icon")
73
+ className: "".concat(prefixCls, "-jump-prev-icon"),
74
+ "aria-hidden": "true"
72
75
  }, /*#__PURE__*/React.createElement(ChevronsLeft, {
73
76
  className: "turn",
74
77
  size: 18,
@@ -89,15 +92,18 @@ var Items = function Items(props) {
89
92
  }
90
93
  },
91
94
  role: "button",
95
+ "aria-label": "Jump forward 7 pages",
92
96
  key: "turn-right"
93
97
  }, (_components$jumpNext = components === null || components === void 0 ? void 0 : components.jumpNext) !== null && _components$jumpNext !== void 0 ? _components$jumpNext : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
94
- className: "".concat(prefixCls, "-jump-next-ellipsis")
98
+ className: "".concat(prefixCls, "-jump-next-ellipsis"),
99
+ "aria-hidden": "true"
95
100
  }, /*#__PURE__*/React.createElement(Ellipsis, {
96
101
  className: "ellipsis",
97
102
  size: 18,
98
103
  strokeWidth: 1.5
99
104
  })), /*#__PURE__*/React.createElement("span", {
100
- className: "".concat(prefixCls, "-jump-next-icon")
105
+ className: "".concat(prefixCls, "-jump-next-icon"),
106
+ "aria-hidden": "true"
101
107
  }, /*#__PURE__*/React.createElement(ChevronsRight, {
102
108
  className: "turn",
103
109
  size: 18,
@@ -116,7 +122,10 @@ var Items = function Items(props) {
116
122
  if (e.key === 'Enter') {
117
123
  onChange(number);
118
124
  }
119
- }
125
+ },
126
+ role: "button",
127
+ "aria-label": "Page ".concat(number),
128
+ "aria-current": current === number ? 'page' : undefined
120
129
  }, number);
121
130
  }
122
131
  }));
@@ -169,10 +169,14 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
169
169
  prevClick();
170
170
  }
171
171
  },
172
+ role: "button",
173
+ "aria-label": "Previous page",
174
+ "aria-disabled": mergedCurrent === 1 || undefined,
172
175
  key: "prev"
173
176
  }, (_components$prev = components === null || components === void 0 ? void 0 : components.prev) !== null && _components$prev !== void 0 ? _components$prev : /*#__PURE__*/React.createElement(ChevronLeft, {
174
177
  size: 20,
175
- strokeWidth: 1.5
178
+ strokeWidth: 1.5,
179
+ "aria-hidden": "true"
176
180
  }));
177
181
  };
178
182
  var renderNext = function renderNext() {
@@ -187,10 +191,14 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
187
191
  nextClick();
188
192
  }
189
193
  },
194
+ role: "button",
195
+ "aria-label": "Next page",
196
+ "aria-disabled": mergedCurrent === pageCount || undefined,
190
197
  key: "next"
191
198
  }, (_components$next = components === null || components === void 0 ? void 0 : components.next) !== null && _components$next !== void 0 ? _components$next : /*#__PURE__*/React.createElement(ChevronRight, {
192
199
  size: 20,
193
- strokeWidth: 1.5
200
+ strokeWidth: 1.5,
201
+ "aria-hidden": "true"
194
202
  }));
195
203
  };
196
204
  var renderSizeChanger = function renderSizeChanger() {
@@ -225,11 +233,15 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
225
233
  return /*#__PURE__*/React.createElement("ul", _extends({}, rest, {
226
234
  className: cls,
227
235
  style: style,
228
- ref: ref
236
+ ref: ref,
237
+ role: "navigation",
238
+ "aria-label": "Pagination",
239
+ "aria-disabled": disabled || undefined
229
240
  }), renderTotal(), renderPrevious(), simple ? /*#__PURE__*/React.createElement("li", {
230
241
  className: "".concat(prefixCls, "-simple")
231
242
  }, renderNumber(false), /*#__PURE__*/React.createElement("span", {
232
- className: "split"
243
+ className: "split",
244
+ "aria-hidden": "true"
233
245
  }, "/"), /*#__PURE__*/React.createElement("span", {
234
246
  className: "total-page"
235
247
  }, pageCount)) : /*#__PURE__*/React.createElement(Items, {
@@ -1,6 +1,6 @@
1
1
  import { Dayjs } from 'dayjs';
2
2
  import * as React from 'react';
3
- import type { PickerType, PanelSharedProps } from '../../interface';
3
+ import type { PanelSharedProps, PickerType } from '../../interface';
4
4
  interface DateTimePanelProps extends Omit<PanelSharedProps, 'onSelect'> {
5
5
  onSelect?: (panel: PickerType, date: Dayjs) => void;
6
6
  showTime?: boolean;
@@ -53,14 +53,15 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
53
53
  setMergedValue(event.target.value);
54
54
  onChange === null || onChange === void 0 || onChange(event.target.value, event);
55
55
  };
56
- return /*#__PURE__*/React.createElement("div", {
56
+ return /*#__PURE__*/React.createElement("div", _extends({
57
57
  className: cls,
58
58
  style: _objectSpread(_objectSpread({}, style), {}, {
59
59
  gap: gap
60
60
  }),
61
61
  ref: ref,
62
- role: "radiogroup"
63
- }, /*#__PURE__*/React.createElement(GroupCtx.Provider, {
62
+ role: "radiogroup",
63
+ "aria-disabled": disabled || undefined
64
+ }, rest), /*#__PURE__*/React.createElement(GroupCtx.Provider, {
64
65
  value: {
65
66
  name: name,
66
67
  buttonStyle: buttonStyle,
@@ -69,7 +70,7 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
69
70
  }, options === null || options === void 0 ? void 0 : options.map(function (option, index) {
70
71
  return /*#__PURE__*/React.createElement(Radio, _extends({
71
72
  disabled: disabled
72
- }, rest, option, {
73
+ }, option, {
73
74
  checked: option.value === mergedValue,
74
75
  key: option.value || index
75
76
  }));
@@ -70,7 +70,8 @@ var Radio = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
70
70
  return /*#__PURE__*/React.createElement("label", {
71
71
  className: cls,
72
72
  style: style,
73
- onClick: handleClick
73
+ onClick: handleClick,
74
+ "aria-disabled": disabled || undefined
74
75
  }, /*#__PURE__*/React.createElement("span", {
75
76
  className: clsx(prefixCls, _defineProperty({}, "".concat(prefixCls, "-disabled"), disabled))
76
77
  }, /*#__PURE__*/React.createElement("input", _extends({}, rest, {
@@ -81,11 +82,11 @@ var Radio = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
81
82
  value: value,
82
83
  checked: mergedChecked,
83
84
  disabled: disabled,
84
- onChange: handleChange,
85
- "aria-checked": mergedChecked
85
+ onChange: handleChange
86
86
  })), !buttonStyle && /*#__PURE__*/React.createElement("span", {
87
87
  className: clsx("".concat(prefixCls, "-inner"), classNames === null || classNames === void 0 ? void 0 : classNames.inner),
88
- style: styles === null || styles === void 0 ? void 0 : styles.inner
88
+ style: styles === null || styles === void 0 ? void 0 : styles.inner,
89
+ "aria-hidden": "true"
89
90
  })), /*#__PURE__*/React.createElement("span", {
90
91
  className: clsx("".concat(prefixCls, "-label"), classNames === null || classNames === void 0 ? void 0 : classNames.label),
91
92
  style: styles === null || styles === void 0 ? void 0 : styles.label
@@ -107,7 +107,12 @@ var Rate = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
107
107
  onMouseLeave: onLeave,
108
108
  ref: componentRef,
109
109
  role: "radiogroup",
110
- "aria-label": "Rating"
110
+ "aria-label": "Rating",
111
+ "aria-disabled": disabled || undefined,
112
+ "aria-valuemin": 0,
113
+ "aria-valuemax": count,
114
+ "aria-valuenow": mergedValue,
115
+ "aria-valuetext": "".concat(mergedValue, " out of ").concat(count, " stars")
111
116
  }), Array(count).fill(0).map(function (_, index) {
112
117
  var cls = clsx("".concat(prefixCls, "-star"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-star-full"), index < mergedValue), "".concat(prefixCls, "-star-half-active"), allowHalf && index + 0.5 === mergedValue));
113
118
  return /*#__PURE__*/React.createElement(Star, {
@@ -35,6 +35,7 @@ var Star = function Star(props) {
35
35
  "aria-checked": active,
36
36
  "aria-posinset": index + 1,
37
37
  "aria-setsize": count,
38
+ "aria-label": "".concat(index + 1, " ").concat(index + 1 === 1 ? 'star' : 'stars'),
38
39
  key: 'star-' + index
39
40
  }, /*#__PURE__*/React.createElement("div", {
40
41
  className: "".concat(prefixCls, "-star-first"),
@@ -48,11 +49,13 @@ var Star = function Star(props) {
48
49
  }
49
50
  },
50
51
  tabIndex: 0,
52
+ "aria-label": "".concat(index + 0.5, " stars"),
51
53
  key: 'star-' + index + 'left'
52
54
  }, character ? /*#__PURE__*/React.createElement("span", {
53
55
  className: "".concat(prefixCls, "-character")
54
56
  }, renderCharacter()) : /*#__PURE__*/React.createElement(StarHalf, {
55
- className: "".concat(prefixCls, "-star-half")
57
+ className: "".concat(prefixCls, "-star-half"),
58
+ "aria-hidden": "true"
56
59
  })), /*#__PURE__*/React.createElement("div", {
57
60
  className: "".concat(prefixCls, "-star-second"),
58
61
  onMouseMove: onSecondHover,
@@ -65,11 +68,13 @@ var Star = function Star(props) {
65
68
  }
66
69
  },
67
70
  tabIndex: 0,
71
+ "aria-label": "".concat(index + 1, " ").concat(index + 1 === 1 ? 'star' : 'stars'),
68
72
  key: 'star-' + index + 'right'
69
73
  }, character ? /*#__PURE__*/React.createElement("span", {
70
74
  className: "".concat(prefixCls, "-character")
71
75
  }, renderCharacter()) : /*#__PURE__*/React.createElement(StarFull, {
72
- className: "".concat(prefixCls, "-star-full")
76
+ className: "".concat(prefixCls, "-star-full"),
77
+ "aria-hidden": "true"
73
78
  }))) : /*#__PURE__*/React.createElement("li", {
74
79
  className: className,
75
80
  onClick: function onClick() {
@@ -88,13 +93,16 @@ var Star = function Star(props) {
88
93
  "aria-checked": active,
89
94
  "aria-posinset": index + 1,
90
95
  "aria-setsize": count,
96
+ "aria-label": "".concat(index + 1, " ").concat(index + 1 === 1 ? 'star' : 'stars'),
91
97
  key: 'star-' + index
92
98
  }, character ? /*#__PURE__*/React.createElement("span", {
93
99
  className: "".concat(prefixCls, "-character")
94
100
  }, renderCharacter()) : active ? /*#__PURE__*/React.createElement(StarFull, {
95
- className: "".concat(prefixCls, "-star-active")
101
+ className: "".concat(prefixCls, "-star-active"),
102
+ "aria-hidden": "true"
96
103
  }) : /*#__PURE__*/React.createElement(StarFull, {
97
- className: "".concat(prefixCls, "-star-inactive")
104
+ className: "".concat(prefixCls, "-star-inactive"),
105
+ "aria-hidden": "true"
98
106
  })), children ? /*#__PURE__*/React.createElement(Tooltip, {
99
107
  title: value,
100
108
  placement: "top"
@@ -1,3 +1,3 @@
1
1
  import InternalSegmented from './segmented';
2
- export type { SegmentedOption, SegmentedLabeledOption, SegmentedRawOption, SegmentedSemanticDOM, SegmentedValue, SegmentedProps, } from './interface';
2
+ export type { SegmentedLabeledOption, SegmentedOption, SegmentedProps, SegmentedRawOption, SegmentedSemanticDOM, SegmentedValue, } from './interface';
3
3
  export default InternalSegmented;
@@ -13,8 +13,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
15
  import clsx from 'clsx';
16
- import React, { useContext, useId, useMemo } from 'react';
17
16
  import { motion } from 'motion/react';
17
+ import React, { useContext, useId, useMemo } from 'react';
18
18
  import { GlobalContext } from "../Config-Provider";
19
19
  import useMergedState from "../hooks/useMergedState";
20
20
  import mergeContextToProps from "../utils/mergeContextToProps";