@rainbow-oh/yee-c 0.8.14 → 0.8.16

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 (69) hide show
  1. package/dist/cjs/Progress/circle.js +1 -1
  2. package/dist/cjs/Progress/line.js +1 -1
  3. package/dist/cjs/Progress/progress.js +2 -0
  4. package/dist/cjs/Progress/steps.js +1 -1
  5. package/dist/cjs/Search/search.js +45 -16
  6. package/dist/cjs/Select/interface.d.ts +2 -1
  7. package/dist/cjs/Spin/demo/types.js +1 -1
  8. package/dist/cjs/Spin/indicator.d.ts +1 -1
  9. package/dist/cjs/Spin/indicator.js +144 -0
  10. package/dist/cjs/Spin/interface.d.ts +1 -1
  11. package/dist/cjs/Spin/style/index.less +86 -0
  12. package/dist/cjs/Table/demo/fixed.d.ts +3 -0
  13. package/dist/cjs/Table/demo/fixed.js +123 -0
  14. package/dist/cjs/Table/hooks/useColumns.d.ts +2 -1
  15. package/dist/cjs/Table/hooks/useColumns.js +4 -3
  16. package/dist/cjs/Table/style/index.less +23 -3
  17. package/dist/cjs/Table/table.js +67 -21
  18. package/dist/cjs/Table/util/index.d.ts +1 -1
  19. package/dist/cjs/Table/util/index.js +16 -3
  20. package/dist/cjs/style/themes.css +1 -1
  21. package/dist/cjs/style/variables.css +1 -1
  22. package/dist/cjs/version.d.ts +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/esm/Progress/circle.js +2 -1
  25. package/dist/esm/Progress/line.js +2 -1
  26. package/dist/esm/Progress/progress.js +2 -0
  27. package/dist/esm/Progress/steps.js +6 -1
  28. package/dist/esm/Search/search.js +31 -7
  29. package/dist/esm/Select/interface.d.ts +2 -1
  30. package/dist/esm/Spin/demo/types.js +10 -7
  31. package/dist/esm/Spin/indicator.d.ts +1 -1
  32. package/dist/esm/Spin/indicator.js +137 -0
  33. package/dist/esm/Spin/interface.d.ts +1 -1
  34. package/dist/esm/Spin/style/index.less +86 -0
  35. package/dist/esm/Table/demo/fixed.d.ts +3 -0
  36. package/dist/esm/Table/demo/fixed.js +84 -0
  37. package/dist/esm/Table/hooks/useColumns.d.ts +2 -1
  38. package/dist/esm/Table/hooks/useColumns.js +4 -3
  39. package/dist/esm/Table/style/index.less +23 -3
  40. package/dist/esm/Table/table.js +85 -26
  41. package/dist/esm/Table/util/index.d.ts +1 -1
  42. package/dist/esm/Table/util/index.js +16 -3
  43. package/dist/esm/style/themes.css +1 -1
  44. package/dist/esm/style/variables.css +1 -1
  45. package/dist/esm/version.d.ts +1 -1
  46. package/dist/esm/version.js +1 -1
  47. package/dist/umd/yee-c.min.css +1 -1
  48. package/dist/umd/yee-c.min.js +1 -1
  49. package/package.json +1 -1
  50. package/src/Progress/circle.tsx +1 -1
  51. package/src/Progress/line.tsx +1 -1
  52. package/src/Progress/progress.tsx +2 -0
  53. package/src/Progress/steps.tsx +3 -1
  54. package/src/Search/search.tsx +33 -4
  55. package/src/Select/interface.ts +2 -1
  56. package/src/Spin/demo/types.tsx +18 -3
  57. package/src/Spin/index.en-US.md +5 -2
  58. package/src/Spin/index.zh-CN.md +5 -2
  59. package/src/Spin/indicator.tsx +165 -1
  60. package/src/Spin/interface.ts +1 -1
  61. package/src/Spin/style/index.less +86 -0
  62. package/src/Table/demo/fixed.tsx +92 -0
  63. package/src/Table/hooks/useColumns.ts +4 -2
  64. package/src/Table/index.en-US.md +1 -0
  65. package/src/Table/index.zh-CN.md +1 -0
  66. package/src/Table/style/index.less +23 -3
  67. package/src/Table/table.tsx +88 -23
  68. package/src/Table/util/index.ts +32 -7
  69. package/src/version.ts +1 -1
@@ -75,6 +75,7 @@ var import_tbody = __toESM(require("./tbody"));
75
75
  var import_tfooter = __toESM(require("./tfooter"));
76
76
  var import_theader = __toESM(require("./theader"));
77
77
  var import_Config_Provider = require("../Config-Provider");
78
+ var import_useLatest = __toESM(require("../hooks/useLatest"));
78
79
  var import_mergeContextToProps = __toESM(require("../utils/mergeContextToProps"));
79
80
  var import_omit = __toESM(require("../utils/omit"));
80
81
  var import_types = require("../utils/types");
@@ -140,6 +141,7 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
140
141
  "onChange"
141
142
  ]);
142
143
  const dataAttrs = (0, import_types.pickDataAttrs)(rest);
144
+ const [measuredColumnWidths, setMeasuredColumnWidths] = import_react.default.useState();
143
145
  const getRowKey = import_react.default.useCallback(
144
146
  (record, key = rowKey) => {
145
147
  return typeof key === "function" ? key(record) : record[key];
@@ -153,7 +155,8 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
153
155
  children,
154
156
  columns: propColumns,
155
157
  expandable,
156
- rowSelection
158
+ rowSelection,
159
+ measuredColumnWidths
157
160
  });
158
161
  const {
159
162
  data: filteredData,
@@ -212,28 +215,58 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
212
215
  onChange: onSelectionChange
213
216
  } = (0, import_useSelection.default)({ pageData, dataSource, getRowKey, rowSelection, allKeys });
214
217
  const prevFilterRecordsRef = (0, import_react.useRef)(filterRecords);
215
- const contentWrapperRef = (0, import_react.useRef)(null);
216
218
  const contentRef = (0, import_react.useRef)(null);
219
+ const tableRef = (0, import_react.useRef)(null);
217
220
  const [horizontalScroll, setHorizontalScroll] = import_react.default.useState({
218
221
  left: false,
219
222
  right: false
220
223
  });
221
224
  const updateHorizontalScroll = import_react.default.useCallback(() => {
222
- const wrapper = contentWrapperRef.current;
223
225
  const content = contentRef.current;
224
- if (!wrapper || !content)
226
+ if (!content)
225
227
  return;
226
- const scrollContainer = content.scrollWidth - content.clientWidth > 1 ? content : wrapper;
227
- const maxScrollLeft = scrollContainer.scrollWidth - scrollContainer.clientWidth;
228
+ const maxScrollLeft = content.scrollWidth - content.clientWidth;
228
229
  const hasHorizontalScroll = maxScrollLeft > 1;
229
230
  const next = {
230
- left: hasHorizontalScroll && scrollContainer.scrollLeft > 1,
231
- right: hasHorizontalScroll && scrollContainer.scrollLeft < maxScrollLeft - 1
231
+ left: hasHorizontalScroll && content.scrollLeft > 1,
232
+ right: hasHorizontalScroll && content.scrollLeft < maxScrollLeft - 1
232
233
  };
233
234
  setHorizontalScroll(
234
235
  (current2) => current2.left === next.left && current2.right === next.right ? current2 : next
235
236
  );
236
237
  }, []);
238
+ const columnLayoutKey = (0, import_react.useMemo)(
239
+ () => wrapedColumns.map(
240
+ (column, index) => {
241
+ var _a2, _b, _c, _d;
242
+ return `${(_b = (_a2 = column.key) != null ? _a2 : column.dataIndex) != null ? _b : index}:${(_c = column.fixed) != null ? _c : ""}:${(_d = column.width) != null ? _d : ""}`;
243
+ }
244
+ ).join("|"),
245
+ [wrapedColumns]
246
+ );
247
+ const wrapedColumnsRef = (0, import_useLatest.default)(wrapedColumns);
248
+ const updateMeasuredColumnWidths = import_react.default.useCallback(() => {
249
+ var _a2;
250
+ const columns = wrapedColumnsRef.current;
251
+ if (!columns.some((column) => column.fixed))
252
+ return;
253
+ const colElements = (_a2 = tableRef.current) == null ? void 0 : _a2.querySelectorAll(
254
+ ":scope > colgroup > col"
255
+ );
256
+ if (!colElements || colElements.length !== columns.length)
257
+ return;
258
+ const nextWidths = Array.from(
259
+ colElements,
260
+ (column) => Math.round(column.getBoundingClientRect().width)
261
+ );
262
+ if (nextWidths.some((width) => !Number.isFinite(width) || width <= 0)) {
263
+ return;
264
+ }
265
+ setMeasuredColumnWidths((current2) => {
266
+ const unchanged = (current2 == null ? void 0 : current2.length) === nextWidths.length && current2.every((width, index) => width === nextWidths[index]);
267
+ return unchanged ? current2 : nextWidths;
268
+ });
269
+ }, [wrapedColumnsRef]);
237
270
  (0, import_react.useEffect)(() => {
238
271
  if (prevFilterRecordsRef.current === filterRecords)
239
272
  return;
@@ -258,20 +291,34 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
258
291
  onChange
259
292
  ]);
260
293
  (0, import_react.useEffect)(() => {
261
- updateHorizontalScroll();
262
- const wrapper = contentWrapperRef.current;
263
294
  const content = contentRef.current;
264
- if (!wrapper || !content)
295
+ const tableElement = tableRef.current;
296
+ if (!content || !tableElement)
265
297
  return void 0;
298
+ const handleResize = () => {
299
+ updateHorizontalScroll();
300
+ updateMeasuredColumnWidths();
301
+ };
266
302
  if (typeof ResizeObserver === "undefined") {
267
- window.addEventListener("resize", updateHorizontalScroll);
268
- return () => window.removeEventListener("resize", updateHorizontalScroll);
303
+ window.addEventListener("resize", handleResize);
304
+ return () => window.removeEventListener("resize", handleResize);
269
305
  }
270
- const resizeObserver = new ResizeObserver(updateHorizontalScroll);
271
- resizeObserver.observe(wrapper);
306
+ const resizeObserver = new ResizeObserver(handleResize);
272
307
  resizeObserver.observe(content);
308
+ resizeObserver.observe(tableElement);
273
309
  return () => resizeObserver.disconnect();
274
- }, [updateHorizontalScroll, wrapedColumns, pageData, scroll == null ? void 0 : scroll.x]);
310
+ }, [updateHorizontalScroll, updateMeasuredColumnWidths]);
311
+ (0, import_react.useEffect)(() => {
312
+ updateHorizontalScroll();
313
+ updateMeasuredColumnWidths();
314
+ }, [
315
+ columnLayoutKey,
316
+ pageData,
317
+ scroll == null ? void 0 : scroll.x,
318
+ scroll == null ? void 0 : scroll.y,
319
+ updateHorizontalScroll,
320
+ updateMeasuredColumnWidths
321
+ ]);
275
322
  const renderHeader = () => {
276
323
  return /* @__PURE__ */ import_react.default.createElement(
277
324
  import_header.default,
@@ -326,6 +373,7 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
326
373
  const renderTable = () => {
327
374
  const tableProps = {
328
375
  style: __spreadProps(__spreadValues({}, styles == null ? void 0 : styles.table), {
376
+ minWidth: scroll == null ? void 0 : scroll.x,
329
377
  tableLayout: (pageData == null ? void 0 : pageData.length) ? tableLayout : void 0
330
378
  }),
331
379
  className: (0, import_clsx.default)(
@@ -346,17 +394,15 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
346
394
  rowKey
347
395
  }
348
396
  },
349
- /* @__PURE__ */ import_react.default.createElement("table", __spreadValues({}, tableProps), /* @__PURE__ */ import_react.default.createElement(import_col_group.default, { columns: wrapedColumns }), renderTHeader(), renderTBody(), renderTFooter())
397
+ /* @__PURE__ */ import_react.default.createElement("table", __spreadValues({ ref: tableRef }, tableProps), /* @__PURE__ */ import_react.default.createElement(import_col_group.default, { columns: wrapedColumns }), renderTHeader(), renderTBody(), renderTFooter())
350
398
  );
351
399
  return /* @__PURE__ */ import_react.default.createElement(
352
400
  "div",
353
401
  {
354
- ref: contentWrapperRef,
355
402
  className: (0, import_clsx.default)(`${prefixCls}-content-wrapper`, {
356
403
  [`${prefixCls}-content-wrapper-scroll-left`]: horizontalScroll.left,
357
404
  [`${prefixCls}-content-wrapper-scroll-right`]: horizontalScroll.right
358
- }),
359
- onScroll: updateHorizontalScroll
405
+ })
360
406
  },
361
407
  /* @__PURE__ */ import_react.default.createElement(
362
408
  "div",
@@ -366,7 +412,7 @@ var Table = import_react.default.forwardRef((baseprops, ref) => {
366
412
  [`${prefixCls}-${size}-size`]: size,
367
413
  [`${prefixCls}-fixed-header`]: scroll == null ? void 0 : scroll.y
368
414
  }),
369
- style: { height: scroll == null ? void 0 : scroll.y, width: scroll == null ? void 0 : scroll.x },
415
+ style: { height: scroll == null ? void 0 : scroll.y },
370
416
  onScroll: updateHorizontalScroll
371
417
  },
372
418
  table2
@@ -1,2 +1,2 @@
1
1
  import { WrapedColumnProps } from '../interface';
2
- export declare function handleColumns(columns: Array<WrapedColumnProps>): WrapedColumnProps[];
2
+ export declare function handleColumns(columns: Array<WrapedColumnProps>, measuredColumnWidths?: number[]): WrapedColumnProps[];
@@ -39,7 +39,20 @@ __export(util_exports, {
39
39
  handleColumns: () => handleColumns
40
40
  });
41
41
  module.exports = __toCommonJS(util_exports);
42
- function handleColumns(columns) {
42
+ var getColumnWidth = (column, index, measuredColumnWidths) => {
43
+ const measuredWidth = measuredColumnWidths == null ? void 0 : measuredColumnWidths[index];
44
+ if (Number.isFinite(measuredWidth) && measuredWidth && measuredWidth > 0) {
45
+ return measuredWidth;
46
+ }
47
+ if (typeof column.width === "number") {
48
+ return column.width;
49
+ }
50
+ if (typeof column.width === "string" && /^\s*\d+(?:\.\d+)?px\s*$/.test(column.width)) {
51
+ return Number.parseFloat(column.width);
52
+ }
53
+ return 0;
54
+ };
55
+ function handleColumns(columns, measuredColumnWidths) {
43
56
  var _a, _b;
44
57
  let leftWidthCount = 0;
45
58
  let rightWidthCount = 0;
@@ -53,7 +66,7 @@ function handleColumns(columns) {
53
66
  if (!nextIsFixedLeft) {
54
67
  col.isFixedLeftLast = true;
55
68
  }
56
- leftWidthCount = leftWidthCount + (col.width ? parseFloat(col.width) : 0);
69
+ leftWidthCount += getColumnWidth(col, i, measuredColumnWidths);
57
70
  }
58
71
  }
59
72
  for (let j = columns.length - 1; j >= 0; j--) {
@@ -63,7 +76,7 @@ function handleColumns(columns) {
63
76
  if (((_b = columns[j - 1]) == null ? void 0 : _b.fixed) !== "right") {
64
77
  col.isFixedRightFirst = true;
65
78
  }
66
- rightWidthCount = rightWidthCount + (col.width ? parseFloat(col.width) : 0);
79
+ rightWidthCount += getColumnWidth(col, j, measuredColumnWidths);
67
80
  }
68
81
  }
69
82
  return columns;
@@ -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-30T09:31:08.775Z
4
+ * Generated on 2026-08-03T08:40:43.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-30T09:31:08.775Z
4
+ * Generated on 2026-08-03T08:40:43.552Z
5
5
  */
6
6
 
7
7
  /* ========== color.css ========== */
@@ -3,4 +3,4 @@ declare global {
3
3
  __yee_c_version__: string;
4
4
  }
5
5
  }
6
- export declare const version = "0.8.14";
6
+ export declare const version = "0.8.16";
@@ -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.14";
25
+ var version = "0.8.16";
26
26
  if (typeof window !== "undefined") {
27
27
  window.__yee_c_version__ = version;
28
28
  }
@@ -103,7 +103,8 @@ var Circle = /*#__PURE__*/React.forwardRef(function (props, ref) {
103
103
  ref: ref
104
104
  }, /*#__PURE__*/React.createElement("svg", {
105
105
  className: "".concat(prefixCls, "-circle"),
106
- viewBox: "0 0 120 120"
106
+ viewBox: "0 0 120 120",
107
+ "aria-hidden": "true"
107
108
  }, /*#__PURE__*/React.createElement("circle", {
108
109
  className: "".concat(prefixCls, "-circle-trail"),
109
110
  cx: "60",
@@ -39,7 +39,8 @@ var Line = /*#__PURE__*/React.forwardRef(function (props, ref) {
39
39
  className: "".concat(prefixCls, "-inner"),
40
40
  style: {
41
41
  height: strokeWidth
42
- }
42
+ },
43
+ "aria-hidden": "true"
43
44
  }, /*#__PURE__*/React.createElement("div", {
44
45
  className: "".concat(prefixCls, "-bg"),
45
46
  style: _objectSpread({
@@ -90,6 +90,8 @@ var Progress = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
90
90
  "aria-valuenow": percent,
91
91
  "aria-valuemin": 0,
92
92
  "aria-valuemax": 100,
93
+ "aria-valuetext": "".concat(percent, "%"),
94
+ "aria-label": status === 'error' ? "Progress: ".concat(percent, "%, error") : "Progress: ".concat(percent, "%"),
93
95
  ref: ref
94
96
  }, dataAttrs), progress);
95
97
  });
@@ -43,7 +43,12 @@ var Steps = /*#__PURE__*/React.forwardRef(function (props, ref) {
43
43
  return /*#__PURE__*/React.createElement("div", {
44
44
  className: "".concat(prefixCls, "-steps"),
45
45
  ref: ref
46
- }, renderSteps(), showInfo && /*#__PURE__*/React.createElement("span", {
46
+ }, /*#__PURE__*/React.createElement("div", {
47
+ "aria-hidden": "true",
48
+ style: {
49
+ display: 'contents'
50
+ }
51
+ }, renderSteps()), showInfo && /*#__PURE__*/React.createElement("span", {
47
52
  className: "".concat(prefixCls, "-text")
48
53
  }, children));
49
54
  });
@@ -14,7 +14,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
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
16
  import { X } from 'lucide-react';
17
- import React, { startTransition, useContext, useEffect, useRef, useState } from 'react';
17
+ import React, { startTransition, useContext, useEffect, useId, useRef, useState } from 'react';
18
18
  import { GlobalContext } from "../Config-Provider";
19
19
  import useMergedState from "../hooks/useMergedState";
20
20
  import List from "../List";
@@ -65,6 +65,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
65
65
  open = _useState2[0],
66
66
  setOpen = _useState2[1];
67
67
  var popupRef = useRef(undefined);
68
+ var listboxId = useId();
68
69
  var _useSelectKeyboard = useSelectKeyboard({
69
70
  open: open,
70
71
  options: options || suggestions,
@@ -127,9 +128,19 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
127
128
  }, showClearIcon && /*#__PURE__*/React.createElement("span", {
128
129
  className: clsx("".concat(prefixCls, "-clear-icon"), classNames === null || classNames === void 0 ? void 0 : classNames.clear),
129
130
  style: styles === null || styles === void 0 ? void 0 : styles.clear,
130
- onClick: handleClear
131
+ onClick: handleClear,
132
+ role: "button",
133
+ "aria-label": "Clear search",
134
+ tabIndex: 0,
135
+ onKeyDown: function onKeyDown(e) {
136
+ if (e.key === 'Enter' || e.key === ' ') {
137
+ e.preventDefault();
138
+ handleClear(e);
139
+ }
140
+ }
131
141
  }, /*#__PURE__*/React.createElement(X, {
132
- size: 14
142
+ size: 14,
143
+ "aria-hidden": "true"
133
144
  })), suffix);
134
145
  };
135
146
  var renderPrefix = function renderPrefix() {
@@ -145,9 +156,12 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
145
156
  var getRootClassName = function getRootClassName() {
146
157
  return clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-small"), size === 'small'), "".concat(prefixCls, "-large"), size === 'large'), className);
147
158
  };
159
+ var hasPopup = Array.isArray(options) || Array.isArray(suggestions);
148
160
  var popup = /*#__PURE__*/React.createElement("div", {
149
161
  className: "".concat(prefixCls, "-popup"),
150
- tabIndex: 0
162
+ tabIndex: 0,
163
+ id: listboxId,
164
+ role: "listbox"
151
165
  }, Array.isArray(options) ? /*#__PURE__*/React.createElement(List, {
152
166
  focusedKey: focusedKey,
153
167
  items: options,
@@ -165,7 +179,12 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
165
179
  onOpenChange: setOpen
166
180
  }, /*#__PURE__*/React.createElement("div", {
167
181
  className: getRootClassName(),
168
- style: style
182
+ style: style,
183
+ role: "combobox",
184
+ "aria-expanded": hasPopup ? open : undefined,
185
+ "aria-haspopup": hasPopup ? 'listbox' : undefined,
186
+ "aria-owns": hasPopup && open ? listboxId : undefined,
187
+ "aria-disabled": disabled || undefined
169
188
  }, renderPrefix(), /*#__PURE__*/React.createElement("input", _extends({}, rest, {
170
189
  ref: ref,
171
190
  value: searchValue,
@@ -174,10 +193,15 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
174
193
  disabled: disabled,
175
194
  placeholder: placeholder,
176
195
  onChange: handleChange,
177
- onKeyDown: onKeyDown
196
+ onKeyDown: onKeyDown,
197
+ role: "searchbox",
198
+ "aria-autocomplete": hasPopup ? 'list' : undefined,
199
+ "aria-controls": hasPopup && open ? listboxId : undefined,
200
+ "aria-activedescendant": hasPopup && open && focusedKey !== null ? String(focusedKey) : undefined
178
201
  })), loading ? /*#__PURE__*/React.createElement(Spin, {
179
202
  variant: "ring",
180
- size: "small"
203
+ size: "small",
204
+ "aria-label": "Loading"
181
205
  }) : renderSuffix()));
182
206
  });
183
207
  export default Search;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import type { TriggerProps } from '../Trigger';
2
3
  import type { SelectorProps } from '../Selector';
3
4
  import type { DataAttributeProps } from '../utils/types';
4
5
  export type Option = {
@@ -23,7 +24,7 @@ export type Option = {
23
24
  */
24
25
  [prop: string]: any;
25
26
  };
26
- export interface SelectProps extends DataAttributeProps, Pick<SelectorProps, 'size'> {
27
+ export interface SelectProps extends DataAttributeProps, Pick<SelectorProps, 'size'>, Omit<TriggerProps, 'popup' | 'children'> {
27
28
  /**
28
29
  * Custom class name prefix
29
30
  * */
@@ -4,13 +4,16 @@ export default (function () {
4
4
  return /*#__PURE__*/React.createElement(Space, {
5
5
  direction: "vertical"
6
6
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
7
- variant: "dot",
8
- color: "error"
7
+ variant: "dot"
9
8
  }), /*#__PURE__*/React.createElement("span", null, "dot")), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
10
- variant: "ring",
11
- color: "error"
9
+ variant: "ring"
12
10
  }), /*#__PURE__*/React.createElement("span", null, "ring")), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
13
- variant: "spokes",
14
- color: "error"
15
- }), /*#__PURE__*/React.createElement("span", null, "spokes")));
11
+ variant: "spokes"
12
+ }), /*#__PURE__*/React.createElement("span", null, "spokes")), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
13
+ variant: "bounce"
14
+ }), /*#__PURE__*/React.createElement("span", null, "bounce")), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
15
+ variant: "pulse"
16
+ }), /*#__PURE__*/React.createElement("span", null, "pulse")), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Spin, {
17
+ variant: "wheel"
18
+ }), /*#__PURE__*/React.createElement("span", null, "wheel")));
16
19
  });
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SpinProps } from './interface';
3
3
  interface IndicatorProps extends SpinProps {
4
- variant?: 'dot' | 'ring' | 'spokes';
4
+ variant?: 'dot' | 'ring' | 'spokes' | 'bounce' | 'pulse' | 'wheel';
5
5
  }
6
6
  declare const Indicator: React.FC<IndicatorProps>;
7
7
  export default Indicator;
@@ -141,6 +141,134 @@ var DotSpinner = function DotSpinner(props) {
141
141
  });
142
142
  })), /*#__PURE__*/React.createElement("style", null, "\n @keyframes spinner-rotate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner-pulse {\n 0%, 100% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(0.6);\n opacity: 0.7;\n }\n }\n "));
143
143
  };
144
+
145
+ /**
146
+ * Bounce spinner - three dots that bounce up and down sequentially
147
+ */
148
+ var BounceSpinner = function BounceSpinner(props) {
149
+ var _props$prefixCls4 = props.prefixCls,
150
+ prefixCls = _props$prefixCls4 === void 0 ? 'yee-spin' : _props$prefixCls4,
151
+ _props$size4 = props.size,
152
+ size = _props$size4 === void 0 ? 'default' : _props$size4,
153
+ classNames = props.classNames,
154
+ styles = props.styles,
155
+ width = props.width,
156
+ height = props.height,
157
+ color = props.color;
158
+ var containerSize = sizeMap[size];
159
+ var dotSizeMap = {
160
+ small: 4,
161
+ default: 6,
162
+ large: 10
163
+ };
164
+ var dotSize = dotSizeMap[size];
165
+ return /*#__PURE__*/React.createElement("div", {
166
+ className: clsx("".concat(prefixCls, "-indicator"), "".concat(prefixCls, "-indicator-bounce"), classNames === null || classNames === void 0 ? void 0 : classNames.indicator),
167
+ style: _objectSpread({
168
+ width: width || containerSize,
169
+ height: height || containerSize
170
+ }, styles === null || styles === void 0 ? void 0 : styles.indicator)
171
+ }, /*#__PURE__*/React.createElement("div", {
172
+ className: "".concat(prefixCls, "-bounce")
173
+ }, [0, 1, 2].map(function (i) {
174
+ return /*#__PURE__*/React.createElement("span", {
175
+ key: i,
176
+ className: "".concat(prefixCls, "-bounce-dot"),
177
+ style: {
178
+ width: dotSize,
179
+ height: dotSize,
180
+ animationDelay: "".concat(i * 0.15, "s"),
181
+ backgroundColor: color
182
+ }
183
+ });
184
+ })));
185
+ };
186
+
187
+ /**
188
+ * Pulse spinner - a circle that pulses (scales up and fades out) repeatedly
189
+ */
190
+ var PulseSpinner = function PulseSpinner(props) {
191
+ var _props$prefixCls5 = props.prefixCls,
192
+ prefixCls = _props$prefixCls5 === void 0 ? 'yee-spin' : _props$prefixCls5,
193
+ _props$size5 = props.size,
194
+ size = _props$size5 === void 0 ? 'default' : _props$size5,
195
+ classNames = props.classNames,
196
+ styles = props.styles,
197
+ width = props.width,
198
+ height = props.height,
199
+ color = props.color;
200
+ var containerSize = sizeMap[size];
201
+ return /*#__PURE__*/React.createElement("div", {
202
+ className: clsx("".concat(prefixCls, "-indicator"), "".concat(prefixCls, "-indicator-pulse"), classNames === null || classNames === void 0 ? void 0 : classNames.indicator),
203
+ style: _objectSpread({
204
+ width: width || containerSize,
205
+ height: height || containerSize
206
+ }, styles === null || styles === void 0 ? void 0 : styles.indicator)
207
+ }, /*#__PURE__*/React.createElement("span", {
208
+ className: "".concat(prefixCls, "-pulse-circle"),
209
+ style: {
210
+ backgroundColor: color
211
+ }
212
+ }), /*#__PURE__*/React.createElement("span", {
213
+ className: "".concat(prefixCls, "-pulse-circle ").concat(prefixCls, "-pulse-circle-delay"),
214
+ style: {
215
+ backgroundColor: color
216
+ }
217
+ }));
218
+ };
219
+
220
+ /**
221
+ * Wheel spinner - similar to spokes but each line is offset from center,
222
+ * creating a visible hollow circle in the middle
223
+ */
224
+ var WheelSpinner = function WheelSpinner(props) {
225
+ var _props$prefixCls6 = props.prefixCls,
226
+ prefixCls = _props$prefixCls6 === void 0 ? 'yee-spin' : _props$prefixCls6,
227
+ _props$size6 = props.size,
228
+ size = _props$size6 === void 0 ? 'default' : _props$size6,
229
+ classNames = props.classNames,
230
+ styles = props.styles,
231
+ width = props.width,
232
+ height = props.height,
233
+ color = props.color;
234
+ var containerSize = sizeMap[size];
235
+ var count = 10;
236
+ var innerRadius = 0.38; // start at 38% from center (larger hollow area)
237
+ var spokeLength = containerSize * 0.22;
238
+ return /*#__PURE__*/React.createElement("div", {
239
+ className: clsx("".concat(prefixCls, "-indicator"), "".concat(prefixCls, "-indicator-wheel"), classNames === null || classNames === void 0 ? void 0 : classNames.indicator),
240
+ style: _objectSpread({
241
+ width: width || containerSize,
242
+ height: height || containerSize
243
+ }, styles === null || styles === void 0 ? void 0 : styles.indicator)
244
+ }, /*#__PURE__*/React.createElement("div", {
245
+ className: "".concat(prefixCls, "-wheel-spokes")
246
+ }, Array.from({
247
+ length: count
248
+ }, function (_, i) {
249
+ var angle = i * 360 / count;
250
+ var rad = angle * Math.PI / 180;
251
+ // Position each spoke: starts at innerRadius from center
252
+ var cx = containerSize / 2;
253
+ var cy = containerSize / 2;
254
+ var x = cx + innerRadius * containerSize * Math.sin(rad);
255
+ var y = cy - innerRadius * containerSize * Math.cos(rad);
256
+ return /*#__PURE__*/React.createElement("div", {
257
+ key: i,
258
+ className: "".concat(prefixCls, "-wheel-spoke"),
259
+ style: {
260
+ top: y,
261
+ left: x,
262
+ height: spokeLength,
263
+ marginLeft: -1,
264
+ transform: "rotate(".concat(angle, "deg)"),
265
+ transformOrigin: 'top center',
266
+ animationDelay: "".concat(i * 1.2 / count, "s"),
267
+ backgroundColor: color
268
+ }
269
+ });
270
+ })));
271
+ };
144
272
  var Indicator = function Indicator(_ref) {
145
273
  var _ref$variant = _ref.variant,
146
274
  variant = _ref$variant === void 0 ? 'dot' : _ref$variant,
@@ -151,6 +279,15 @@ var Indicator = function Indicator(_ref) {
151
279
  if (variant === 'spokes') {
152
280
  return /*#__PURE__*/React.createElement(SpokesSpinner, props);
153
281
  }
282
+ if (variant === 'bounce') {
283
+ return /*#__PURE__*/React.createElement(BounceSpinner, props);
284
+ }
285
+ if (variant === 'pulse') {
286
+ return /*#__PURE__*/React.createElement(PulseSpinner, props);
287
+ }
288
+ if (variant === 'wheel') {
289
+ return /*#__PURE__*/React.createElement(WheelSpinner, props);
290
+ }
154
291
  return /*#__PURE__*/React.createElement(DotSpinner, props);
155
292
  };
156
293
  export default Indicator;
@@ -66,7 +66,7 @@ export type SpinProps = DataAttributeProps & {
66
66
  /**
67
67
  * Indicator variant
68
68
  * */
69
- variant?: 'dot' | 'ring' | 'spokes';
69
+ variant?: 'dot' | 'ring' | 'spokes' | 'bounce' | 'pulse' | 'wheel';
70
70
  /**
71
71
  * Loading indicator
72
72
  */