one-design-next 0.0.7 → 0.0.9

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.
package/README.md CHANGED
@@ -128,8 +128,16 @@ one-design-next/
128
128
  ├── .cursor/skills/ # AI Skill 知识包与流程(SKILL.md 为总入口)
129
129
  ├── .dumi/ # Dumi 配置与构建数据
130
130
  ├── scripts/ # 构建、benchmark、反馈等工具脚本
131
- ├── skills/ # 对外摘要型 Skill 文档
132
- ├── dist/ # 构建产物
131
+ ├── skills/ # 对外发布 Skill(多产品)
132
+ ├── src/
133
+ │ │ ├── shared/ # 共享:ODN 组件知识、流水线 GUIDE
134
+ │ │ ├── ruyi/ # 如翼专属:业务知识、区块、页面、scaffold
135
+ │ │ └── huxuan/ # 互选专属:业务知识、区块、页面、scaffold
136
+ │ ├── dist/ # 构建产物(gitignored,由 CI 生成)
137
+ │ │ ├── ruyi/ # 如翼 skill 发布包(自包含)
138
+ │ │ └── huxuan/ # 互选 skill 发布包(自包含)
139
+ │ └── build.sh # bash skills/build.sh [ruyi|huxuan]
140
+ ├── dist/ # 组件库构建产物
133
141
  └── public/ # 静态资源
134
142
  ```
135
143
 
@@ -154,7 +162,17 @@ one-design-next/
154
162
  | **P5** 落地 | `p5-figma-to-page` · `p5-feedback` | 整页拼装、上下文与反馈采集 |
155
163
  | **辅助** | `ten-questions` · `philosophy-talks` | 方法论讨论与设计哲学 |
156
164
 
157
- > **外部只读模式**:外部平台(如 Workbuddy)仅消费知识生成代码与建议,不修改本仓库的组件、区块与知识文件。
165
+ ### 多产品 Skill 发布
166
+
167
+ `skills/` 目录支持多产品构建,`shared/` 中的 ODN 铁律和流水线由所有产品共享,各产品在自己的目录下维护专属业务知识和区块:
168
+
169
+ ```bash
170
+ bash skills/build.sh # 构建全部产品
171
+ bash skills/build.sh ruyi # 只构建如翼
172
+ bash skills/build.sh huxuan # 只构建互选
173
+ ```
174
+
175
+ > **外部只读模式**:外部平台仅消费 `skills/dist/<product>/` 下的知识生成代码与建议,不修改本仓库的组件、区块与知识文件。
158
176
 
159
177
  ## 发布
160
178
 
@@ -51,6 +51,12 @@ export interface SkillItem {
51
51
  label: string;
52
52
  icon: string;
53
53
  description?: string;
54
+ /**
55
+ * 禁用态。设为 true 时按钮不可点击、不会触发 onSelect,视觉降级。
56
+ * 用于"该 Skill 处于灰度未开放 / 当前会话不支持"等场景,
57
+ * 既保留入口可见性,又避免误触;与 active 互斥(active 不会同时禁用)。
58
+ */
59
+ disabled?: boolean;
54
60
  }
55
61
  export interface SendMeta {
56
62
  attachments?: Attachment[];
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import './style';
4
3
  export interface AgentThinkProps {
5
4
  content: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DayPicker } from 'react-day-picker';
2
+ import { DayPicker } from '@daypicker/react';
3
3
  import '../date-picker/style';
4
4
  import './style';
5
5
  export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
@@ -16,8 +16,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  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; }
17
17
  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; }
18
18
  import React, { useRef, useState } from 'react';
19
- import { DayPicker } from 'react-day-picker';
20
- import { enUS, zhCN } from 'react-day-picker/locale';
19
+ import { DayPicker } from '@daypicker/react';
20
+ import { enUS, zhCN } from '@daypicker/react/locale';
21
21
  import "../date-picker/style";
22
22
  import "./style";
23
23
  var DEFAULT_HOVER_COLOR = 'rgba(33, 34, 38, 0.05)';
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import '../select/style';
4
4
  import CascaderPanel from './Panel';
5
5
  import './style';
6
- export interface BaseCascaderProps extends Omit<RcCascaderProps<DefaultOptionType, 'value', false>, 'prefixCls' | 'onChange' | 'value' | 'defaultValue' | 'showCheckedStrategy'> {
6
+ export interface BaseCascaderProps extends Omit<RcCascaderProps<DefaultOptionType, 'value', false>, 'prefixCls' | 'onChange' | 'value' | 'defaultValue' | 'showCheckedStrategy' | 'changeOnSelect'> {
7
7
  /** 组件尺寸 */
8
8
  size?: 'small' | 'medium' | 'large';
9
9
  /** 是否禁用 */
@@ -44,6 +44,12 @@ export interface BaseCascaderProps extends Omit<RcCascaderProps<DefaultOptionTyp
44
44
  separator?: string;
45
45
  /** 自定义下拉列表中每一项的渲染(rc-cascader 原生支持) */
46
46
  optionRender?: (option: DefaultOptionType) => React.ReactNode;
47
+ /**
48
+ * 点击非叶节点内容区域时的行为
49
+ * - `true`:选中非叶节点并关闭下拉
50
+ * - `'keep-open'`:选中非叶节点并触发 onChange,但保持下拉展开(子菜单继续展开)
51
+ */
52
+ changeOnSelect?: boolean | 'keep-open';
47
53
  }
48
54
  export type CascaderProps<V = (string | number)[] | null> = BaseCascaderProps & {
49
55
  mode?: 'single' | 'multiple';
@@ -136,7 +136,7 @@ function CascaderInner(_ref) {
136
136
  suffixIcon = _useIcons.suffixIcon,
137
137
  removeIcon = _useIcons.removeIcon,
138
138
  clearIcon = _useIcons.clearIcon;
139
- var cascaderClassName = [prefixCls, "".concat(prefixCls, "-").concat(size), disabled && "".concat(prefixCls, "-disabled"), !light && "".concat(prefixCls, "-outlined"), "".concat(prefixCls, "-show-arrow"), showInnerSearch && "".concat(prefixCls, "-show-inner-search"), 'odn-cascader', className].filter(Boolean).join(' ');
139
+ var cascaderClassName = [prefixCls, "".concat(prefixCls, "-").concat(size), disabled && "".concat(prefixCls, "-disabled"), light && "".concat(prefixCls, "-light"), !light && "".concat(prefixCls, "-outlined"), "".concat(prefixCls, "-show-arrow"), showInnerSearch && "".concat(prefixCls, "-show-inner-search"), 'odn-cascader', className].filter(Boolean).join(' ');
140
140
  var _useState = useState(visibleProp),
141
141
  _useState2 = _slicedToArray(_useState, 2),
142
142
  visible = _useState2[0],
@@ -264,6 +264,12 @@ function CascaderInner(_ref) {
264
264
 
265
265
  // 非叶节点仅在 changeOnSelect 时才可点击选中
266
266
  if (hasChildren && !changeOnSelectProp) return;
267
+
268
+ // keep-open:触发 onChange 但不关闭下拉,让 rc-cascader 继续展开子菜单
269
+ if (hasChildren && changeOnSelectProp === 'keep-open') {
270
+ handleChange(fullPath, pathOptions, e);
271
+ return;
272
+ }
267
273
  e.stopPropagation();
268
274
  handleChange(fullPath, pathOptions, e);
269
275
  handleVisibleChange(false);
@@ -367,7 +373,7 @@ function CascaderInner(_ref) {
367
373
  optionRender: optionRenderProp,
368
374
  // 单选模式不传 changeOnSelect 给 rc-cascader,
369
375
  // 使展开图标点击时 isSelectable 对非叶节点返回 false,只触发展开
370
- changeOnSelect: mode === 'single' ? false : changeOnSelectProp
376
+ changeOnSelect: mode === 'single' ? false : !!changeOnSelectProp
371
377
  });
372
378
  var dropdownRender = React.useMemo(function () {
373
379
  var searchRenderFn = showInnerSearch ? function (menu) {
@@ -25,7 +25,7 @@ type CollapsibleContentProps = Omit<HTMLMotionProps<'div'>, 'children' | 'ref' |
25
25
  children?: React.ReactNode;
26
26
  transition?: Transition;
27
27
  };
28
- declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<HTMLMotionProps<"div">, "children" | "transition" | "ref"> & {
28
+ declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<HTMLMotionProps<"div">, "transition" | "ref" | "children"> & {
29
29
  children?: React.ReactNode;
30
30
  transition?: Transition | undefined;
31
31
  } & React.RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DayPickerProps } from 'react-day-picker';
2
+ import { DayPickerProps } from '@daypicker/react';
3
3
  import { type PopoverProps } from '../pop-base';
4
4
  import './style';
5
5
  export interface DatePickerCommonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'value' | 'onChange' | 'prefix'> {
@@ -22,8 +22,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
  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; }
23
23
  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; }
24
24
  import React, { useEffect, useRef, useState } from 'react';
25
- import { DayPicker } from 'react-day-picker';
26
- import { enUS, zhCN } from 'react-day-picker/locale';
25
+ import { DayPicker } from '@daypicker/react';
26
+ import { enUS, zhCN } from '@daypicker/react/locale';
27
27
  import { DATE_INPUT_PLACEHOLDER, MONTHS, convertDateToString, convertMonthToString, convertQuarterToString, convertWeekToString, convertYearToString, getDefaultMaxDate, getDefaultMinDate, getEndOfQuarter, getEndOfWeek, getStartOfQuarter, getStartOfWeek, isDayAfter, isDayBefore, isDayInRange, isLegalDateString, isLegalMonthString, isLegalQuarterString, isLegalWeekString, isLegalYearString, isSameDay, isSameMonth, parseMonthStringToRange, parseQuarterStringToRange, parseWeekStringToRange, parseYearStringToRange, today } from "../_util/date";
28
28
  import HoverFill from "../hover-fill";
29
29
  import Icon from "../icon";
@@ -939,7 +939,7 @@ var DatePicker = function DatePicker(props) {
939
939
  onDayMouseLeave === null || onDayMouseLeave === void 0 || onDayMouseLeave(e, weekInfo);
940
940
  }
941
941
  },
942
- // RDP v9 仍然没有解决重复 render 的问题,每一个 day 即使 modifiers 完全相同也还是会重复 Render
942
+ // RDP v10 仍然存在重复 render 的问题,每一个 day 即使 modifiers 完全相同也还是会重复 Render
943
943
  // 这里尝试过加 memo,甚至直接 return false 也是会重新 render 的
944
944
  // 这意味着如果 numberOfMonths 设置为 2 或以上性能将会受到挑战,当然我们应该不会有这样的需求
945
945
  // 所造成的问题是 onClick 可能不会触发,而 mouseDown 和 mouseUp 是会触发的,推测的原因是因为在 down 和 up 之间重新 render 了,整个 dom 都被重新渲染了
@@ -22,8 +22,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
  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; }
23
23
  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; }
24
24
  import React, { useEffect, useMemo, useRef, useState } from 'react';
25
- import { DayPicker } from 'react-day-picker';
26
- import { enUS, zhCN } from 'react-day-picker/locale';
25
+ import { DayPicker } from '@daypicker/react';
26
+ import { enUS, zhCN } from '@daypicker/react/locale';
27
27
  import { DATE_RANGE_INPUT_PLACEHOLDER, MONTHS, convertDateRangeToString, convertDateToString, getDefaultMaxDate, getDefaultMinDate, isDayAfter, isDayBefore, isDayInRange, isLegalDateRangeString, isSameDay, isSameMonth, today } from "../_util/date";
28
28
  import "../date-picker/style";
29
29
  import HoverFill from "../hover-fill";
@@ -873,7 +873,7 @@ var DateRangePicker = function DateRangePicker(_ref) {
873
873
  _onMouseLeave === null || _onMouseLeave === void 0 || _onMouseLeave(e);
874
874
  handleTdHoverLeave(e);
875
875
  },
876
- // RDP v9 仍然没有解决重复 render 的问题,每一个 day 即使 modifiers 完全相同也还是会重复 Render
876
+ // RDP v10 仍然存在重复 render 的问题,每一个 day 即使 modifiers 完全相同也还是会重复 Render
877
877
  // 这里尝试过加 memo,甚至直接 return false 也是会重新 render 的
878
878
  // 这意味着如果 numberOfMonths 设置为 2 或以上性能将会受到挑战,当然我们应该不会有这样的需求
879
879
  // 所造成的问题是 onClick 可能不会触发,而 mouseDown 和 mouseUp 是会触发的,推测的原因是因为在 down 和 up 之间重新 render 了,整个 dom 都被重新渲染了
@@ -9,6 +9,7 @@ export interface FabProps {
9
9
  colors?: [string, string, string];
10
10
  hoverColors?: [string, string, string];
11
11
  bgOpacity?: number;
12
+ hoverBgOpacity?: number;
12
13
  speed?: number;
13
14
  hoverSpeed?: number;
14
15
  }
package/dist/fab/index.js CHANGED
@@ -52,35 +52,40 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
52
52
  className = _ref3.className,
53
53
  style = _ref3.style,
54
54
  _ref3$colors = _ref3.colors,
55
- colors = _ref3$colors === void 0 ? ['#99E1FF', '#19BCFF', '#99E1FF'] : _ref3$colors,
55
+ colors = _ref3$colors === void 0 ? ['#34D8FF', '#19BCFF', '#348FFF'] : _ref3$colors,
56
56
  _ref3$hoverColors = _ref3.hoverColors,
57
- hoverColors = _ref3$hoverColors === void 0 ? ['#93F2EF', '#1ABCFF', '#1ABCFF'] : _ref3$hoverColors,
57
+ hoverColors = _ref3$hoverColors === void 0 ? ['#56DFFF', '#1ABCFF', '#1FD4FD'] : _ref3$hoverColors,
58
58
  _ref3$bgOpacity = _ref3.bgOpacity,
59
- bgOpacity = _ref3$bgOpacity === void 0 ? 0.8 : _ref3$bgOpacity,
59
+ bgOpacity = _ref3$bgOpacity === void 0 ? 1 : _ref3$bgOpacity,
60
+ _ref3$hoverBgOpacity = _ref3.hoverBgOpacity,
61
+ hoverBgOpacity = _ref3$hoverBgOpacity === void 0 ? 1 : _ref3$hoverBgOpacity,
60
62
  _ref3$speed = _ref3.speed,
61
63
  speed = _ref3$speed === void 0 ? 1.49 : _ref3$speed,
62
64
  _ref3$hoverSpeed = _ref3.hoverSpeed,
63
- hoverSpeed = _ref3$hoverSpeed === void 0 ? 4.52 : _ref3$hoverSpeed;
65
+ hoverSpeed = _ref3$hoverSpeed === void 0 ? 2.77 : _ref3$hoverSpeed;
64
66
  var _useState = useState(false),
65
67
  _useState2 = _slicedToArray(_useState, 2),
66
68
  hovered = _useState2[0],
67
69
  setHovered = _useState2[1];
68
70
  var _useState3 = useState({
69
71
  colors: colors,
70
- speed: speed
72
+ speed: speed,
73
+ opacity: bgOpacity
71
74
  }),
72
75
  _useState4 = _slicedToArray(_useState3, 2),
73
76
  live = _useState4[0],
74
77
  setLive = _useState4[1];
75
78
  var fromRef = useRef({
76
79
  colors: colors,
77
- speed: speed
80
+ speed: speed,
81
+ opacity: bgOpacity
78
82
  });
79
83
  var rafRef = useRef(null);
80
84
  useEffect(function () {
81
85
  var target = {
82
86
  colors: hovered ? hoverColors : colors,
83
- speed: hovered ? hoverSpeed : speed
87
+ speed: hovered ? hoverSpeed : speed,
88
+ opacity: hovered ? hoverBgOpacity : bgOpacity
84
89
  };
85
90
  var from = fromRef.current;
86
91
  var start = performance.now();
@@ -88,7 +93,8 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
88
93
  var t = Math.min(1, (now - start) / COLOR_TRANSITION_MS);
89
94
  var next = {
90
95
  colors: lerpColors(from.colors, target.colors, t),
91
- speed: lerp(from.speed, target.speed, t)
96
+ speed: lerp(from.speed, target.speed, t),
97
+ opacity: lerp(from.opacity, target.opacity, t)
92
98
  };
93
99
  fromRef.current = next;
94
100
  setLive(next);
@@ -101,7 +107,7 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
101
107
  return function () {
102
108
  if (rafRef.current != null) cancelAnimationFrame(rafRef.current);
103
109
  };
104
- }, [hovered, colors, hoverColors, speed, hoverSpeed]);
110
+ }, [hovered, colors, hoverColors, speed, hoverSpeed, bgOpacity, hoverBgOpacity]);
105
111
  return /*#__PURE__*/React.createElement("button", {
106
112
  ref: ref,
107
113
  type: "button",
@@ -129,7 +135,7 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
129
135
  borderRadius: 'inherit',
130
136
  width: '100%',
131
137
  height: '100%',
132
- opacity: bgOpacity
138
+ opacity: live.opacity
133
139
  }
134
140
  }), /*#__PURE__*/React.createElement("div", {
135
141
  className: "odn-fab-glow",
@@ -28,8 +28,8 @@
28
28
  z-index: 5;
29
29
  left: 50%;
30
30
  bottom: var(--fab-glow-bottom, -28px);
31
- width: var(--fab-glow-width, 300px);
32
- height: var(--fab-glow-height, 33px);
31
+ width: var(--fab-glow-width, 250px);
32
+ height: var(--fab-glow-height, 4px);
33
33
  transform: translateX(-50%);
34
34
  border-radius: 50%;
35
35
  background: rgba(255, 255, 255, var(--fab-glow-alpha, 0.68));
@@ -43,16 +43,16 @@
43
43
  bottom: var(--fab-glow-hover-bottom, -28px);
44
44
  width: var(--fab-glow-hover-width, 313px);
45
45
  height: var(--fab-glow-hover-height, 65px);
46
- background: rgba(255, 255, 255, var(--fab-glow-hover-alpha, 1));
47
- background: color(display-p3 1 1 1/var(--fab-glow-hover-alpha, 1));
48
- filter: blur(var(--fab-glow-hover-blur, 59px));
46
+ background: rgba(255, 255, 255, var(--fab-glow-hover-alpha, 0.28));
47
+ background: color(display-p3 1 1 1/var(--fab-glow-hover-alpha, 0.28));
48
+ filter: blur(var(--fab-glow-hover-blur, 76px));
49
49
  }
50
50
 
51
51
  .odn-fab-icon {
52
52
  position: relative;
53
53
  z-index: 10;
54
54
  flex-shrink: 0;
55
- color: #002F4D;
55
+ color: #fff;
56
56
  }
57
57
 
58
58
  .odn-fab-label {
@@ -62,5 +62,5 @@
62
62
  font-weight: 600;
63
63
  font-size: 16px;
64
64
  line-height: 24px;
65
- color: #002F4D;
65
+ color: #fff;
66
66
  }
@@ -1,3 +1,3 @@
1
1
  import { svgData } from './svg-data';
2
2
  export type IconName = keyof typeof svgData;
3
- export declare const iconNames: ("filter" | "search" | "send" | "link" | "menu" | "text" | "info" | "warning" | "time" | "image" | "file" | "code" | "data" | "template" | "video" | "stop" | "addressBook" | "AIFile" | "alarmClock" | "alert-circle" | "alert-circle-filled" | "alert-triangle" | "archive" | "arrow-down" | "arrow-up" | "arrow-up-right" | "arrowDown" | "arrowDown-filled" | "arrowLeft" | "arrowLeft-filled" | "arrowRight" | "arrowRight-filled" | "arrowUp" | "arrowUp-filled" | "asset-square" | "assetProtecting" | "autoAD-square-filled" | "bar-chart-3" | "bell" | "bell-filled" | "bidding" | "biz-cancel" | "biz-magic" | "biz-send" | "biz-stop" | "biz-time" | "bottom" | "bottom-filled" | "calendar" | "cancel" | "cancel-circle" | "cancel-circle-filled" | "card-distribute" | "channels" | "channels-square-filled" | "chart" | "chatBubble-filled" | "check" | "check-circle" | "check-circle-filled" | "checkBadge" | "chevron-down" | "chevron-left" | "chevron-right" | "clock" | "comments" | "compare" | "container" | "copy" | "copy-new" | "custom" | "custom-filled" | "customColumn" | "dataAuth" | "dataBoard" | "dataBox" | "dataFolder" | "dataReport" | "dataReport-filled" | "dataRising" | "delete" | "deleteAD-filled" | "detect" | "doubleLeft" | "doubleLeft-filled" | "doubleRight" | "doubleRight-filled" | "down" | "down-bold" | "down-filled" | "download" | "download-1" | "download-filled" | "draggable" | "edit" | "ellipsis" | "exchange" | "exposure-filled" | "extendedConfig" | "fall-filled" | "file-code" | "file-filled" | "file-text" | "filter-filled" | "flag" | "flame" | "fold" | "folderZip" | "folderzip-bold" | "fullScreen" | "globe" | "guideBook" | "help-circle" | "help-circle-filled" | "histogram" | "hosting" | "hot" | "hot-filled" | "icon-outlined" | "idea" | "idea-bold" | "image-bold" | "image-filled" | "images" | "import" | "info-circle" | "info-circle-filled" | "keyword" | "LandingPage" | "languages" | "layers" | "left" | "left-bold" | "left-filled" | "leftFirst" | "leftFirst-filled" | "linkSquare" | "loader" | "location" | "lock" | "logout" | "magic" | "magic-filled" | "maxSize" | "menuLeft" | "menuLeft-bold" | "menuRight" | "menuRight-bold" | "message-circle-plus" | "messages-square" | "minigame-filled" | "miniProgram" | "minus" | "minus-circle" | "minus-circle-filled" | "mobile" | "mobile-filled" | "mobilePage" | "modify" | "modify-bold" | "moments-filled" | "more" | "more-vertical" | "mouse-pointer-click" | "multiCreate" | "mute" | "mutiImage" | "mutiImage-filled" | "mutiSelect" | "mutiSelect-filled" | "notepad" | "notepad-bold" | "offiaccount-filled" | "panel-left" | "panel-left-close" | "panel-right" | "paperclip" | "pause-filled" | "play-filled" | "playing" | "plus" | "plus-circle" | "plus-circle-filled" | "pointerLeft-filled" | "pointerRight-filled" | "puzzle" | "QRcode" | "qualification" | "quickFile" | "refresh" | "report" | "reportBook" | "right" | "right-bold" | "right-filled" | "rightLast" | "rightLast-filled" | "ringStruckture" | "rise-filled" | "rotate-ccw" | "save" | "search-bold" | "search-filled" | "searchAD" | "searchAD-filled" | "setting" | "share" | "shield" | "shield-filled" | "shop" | "shopping" | "sort" | "sound" | "sparkle" | "sparkles" | "square" | "star" | "star-filled" | "sticker" | "sticker-filled" | "subdivide" | "support-bold" | "tag" | "tag-filled" | "target" | "targeting" | "task" | "task-filled" | "templateBag" | "thumbDown" | "thumbDown-filled" | "thumbs-down" | "thumbs-up" | "thumbUp" | "thumbUp-filled" | "time-bold" | "top" | "top-filled" | "treeStructure" | "unfold" | "unfold-filled" | "up" | "up-bold" | "up-filled" | "user-add" | "user-circle" | "user-edit" | "user-pack" | "userList" | "userPack" | "users" | "users-bold" | "verify" | "videoBag-filled" | "videoScreenshot" | "viewMask" | "wallet" | "warning-filled" | "wechatBubble" | "wechatBubble-filled" | "wechatSearch" | "writing" | "x" | "x-circle" | "zap" | "zoomIn" | "zoomOut")[];
3
+ export declare const iconNames: ("code" | "data" | "link" | "menu" | "search" | "template" | "time" | "video" | "filter" | "image" | "stop" | "text" | "sort" | "copy" | "loader" | "target" | "file" | "mobile" | "x" | "calendar" | "addressBook" | "AIFile" | "alarmClock" | "alert-circle" | "alert-circle-filled" | "alert-triangle" | "archive" | "arrow-down" | "arrow-up" | "arrow-up-right" | "arrowDown" | "arrowDown-filled" | "arrowLeft" | "arrowLeft-filled" | "arrowRight" | "arrowRight-filled" | "arrowUp" | "arrowUp-filled" | "asset-square" | "assetProtecting" | "autoAD-square-filled" | "bar-chart-3" | "bell" | "bell-filled" | "bidding" | "biz-cancel" | "biz-magic" | "biz-send" | "biz-stop" | "biz-time" | "bottom" | "bottom-filled" | "cancel" | "cancel-circle" | "cancel-circle-filled" | "card-distribute" | "channels" | "channels-square-filled" | "chart" | "chatBubble-filled" | "check" | "check-circle" | "check-circle-filled" | "checkBadge" | "chevron-down" | "chevron-left" | "chevron-right" | "clock" | "comments" | "compare" | "container" | "copy-new" | "custom" | "custom-filled" | "customColumn" | "dataAuth" | "dataBoard" | "dataBox" | "dataFolder" | "dataReport" | "dataReport-filled" | "dataRising" | "delete" | "deleteAD-filled" | "detect" | "doubleLeft" | "doubleLeft-filled" | "doubleRight" | "doubleRight-filled" | "down" | "down-bold" | "down-filled" | "download" | "download-1" | "download-filled" | "draggable" | "edit" | "ellipsis" | "exchange" | "exposure-filled" | "extendedConfig" | "fall-filled" | "file-code" | "file-filled" | "file-text" | "filter-filled" | "flag" | "flame" | "fold" | "folderZip" | "folderzip-bold" | "fullScreen" | "globe" | "guideBook" | "help-circle" | "help-circle-filled" | "histogram" | "hosting" | "hot" | "hot-filled" | "icon-outlined" | "idea" | "idea-bold" | "image-bold" | "image-filled" | "images" | "import" | "info" | "info-circle" | "info-circle-filled" | "keyword" | "LandingPage" | "languages" | "layers" | "left" | "left-bold" | "left-filled" | "leftFirst" | "leftFirst-filled" | "linkSquare" | "location" | "lock" | "logout" | "magic" | "magic-filled" | "maxSize" | "menuLeft" | "menuLeft-bold" | "menuRight" | "menuRight-bold" | "message-circle-plus" | "messages-square" | "minigame-filled" | "miniProgram" | "minus" | "minus-circle" | "minus-circle-filled" | "mobile-filled" | "mobilePage" | "modify" | "modify-bold" | "moments-filled" | "more" | "more-vertical" | "mouse-pointer-click" | "multiCreate" | "mute" | "mutiImage" | "mutiImage-filled" | "mutiSelect" | "mutiSelect-filled" | "notepad" | "notepad-bold" | "offiaccount-filled" | "panel-left" | "panel-left-close" | "panel-right" | "paperclip" | "pause-filled" | "play-filled" | "playing" | "plus" | "plus-circle" | "plus-circle-filled" | "pointerLeft-filled" | "pointerRight-filled" | "puzzle" | "QRcode" | "qualification" | "quickFile" | "refresh" | "report" | "reportBook" | "right" | "right-bold" | "right-filled" | "rightLast" | "rightLast-filled" | "ringStruckture" | "rise-filled" | "rotate-ccw" | "save" | "search-bold" | "search-filled" | "searchAD" | "searchAD-filled" | "send" | "setting" | "share" | "shield" | "shield-filled" | "shop" | "shopping" | "sound" | "sparkle" | "sparkles" | "square" | "star" | "star-filled" | "sticker" | "sticker-filled" | "subdivide" | "support-bold" | "tag" | "tag-filled" | "targeting" | "task" | "task-filled" | "templateBag" | "thumbDown" | "thumbDown-filled" | "thumbs-down" | "thumbs-up" | "thumbUp" | "thumbUp-filled" | "time-bold" | "top" | "top-filled" | "treeStructure" | "unfold" | "unfold-filled" | "up" | "up-bold" | "up-filled" | "user-add" | "user-circle" | "user-edit" | "user-pack" | "userList" | "userPack" | "users" | "users-bold" | "verify" | "videoBag-filled" | "videoScreenshot" | "viewMask" | "wallet" | "warning" | "warning-filled" | "wechatBubble" | "wechatBubble-filled" | "wechatSearch" | "writing" | "x-circle" | "zap" | "zoomIn" | "zoomOut")[];
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export { default as Popover } from './popover';
40
40
  export { default as Radio, type RadioProps, type RadioGroupProps } from './radio';
41
41
  export { RuyiLayout, type RuyiLayoutProps, type RuyiMenuItem } from './layout';
42
42
  export { MpLayout, type MpLayoutProps, type MpMenuItem, type MpTabItem, type MpSubTab } from './layout';
43
+ export { HuxuanLayout, type HuxuanLayoutProps, type HuxuanNavItem, type HuxuanNavChild, type HuxuanActionItem } from './layout';
43
44
  export { default as ScrollArea, type ScrollAreaProps, type ScrollAreaRef } from './scroll-area';
44
45
  export { default as Select, type SelectProps } from './select';
45
46
  export { default as Slider, type SliderProps } from './slider';
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ export { default as Popover } from "./popover";
44
44
  export { default as Radio } from "./radio";
45
45
  export { RuyiLayout } from "./layout";
46
46
  export { MpLayout } from "./layout";
47
+ export { HuxuanLayout } from "./layout";
47
48
  export { default as ScrollArea } from "./scroll-area";
48
49
  export { default as Select } from "./select";
49
50
  export { default as Slider } from "./slider";
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ export type HuxuanNavChild = {
3
+ key: string;
4
+ label: string;
5
+ icon?: React.ReactNode;
6
+ };
7
+ export type HuxuanNavItem = {
8
+ key: string;
9
+ label: string;
10
+ badge?: string;
11
+ /** 子菜单项,有子项时 hover 会弹出 Popover 下拉 */
12
+ children?: HuxuanNavChild[];
13
+ };
14
+ export type HuxuanActionItem = {
15
+ key: string;
16
+ label: string;
17
+ /** 子菜单项,有子项时点击弹出 Popover 下拉 */
18
+ children?: HuxuanNavChild[];
19
+ /** 完全自定义的 Popover 弹出内容(优先级高于 children) */
20
+ popup?: React.ReactNode;
21
+ /** 无子项时的点击回调 */
22
+ onClick?: () => void;
23
+ };
24
+ export type HuxuanLayoutProps = {
25
+ /** 自定义 Logo,默认为互选平台 Logo */
26
+ logo?: React.ReactNode;
27
+ /** 顶栏导航项 */
28
+ navItems?: HuxuanNavItem[];
29
+ /** 当前激活的导航 key */
30
+ activeNav?: string;
31
+ /** 导航切换回调 */
32
+ onNavChange?: (key: string) => void;
33
+ /** 顶栏右侧操作按钮(发布招募任务、达人名单等) */
34
+ actionItems?: HuxuanActionItem[];
35
+ /** 操作按钮点击回调 */
36
+ onActionClick?: (key: string) => void;
37
+ /** 顶栏右侧完全自定义内容(设置后 actionItems 无效) */
38
+ headerRight?: React.ReactNode;
39
+ /** 账号名称 */
40
+ accountName?: string;
41
+ /** 账号 ID */
42
+ accountId?: string;
43
+ /** 外层容器 className */
44
+ className?: string;
45
+ /** 内容区 className */
46
+ contentClassName?: string;
47
+ children?: React.ReactNode;
48
+ };
49
+ export declare function HuxuanLayout({ logo, navItems, activeNav, onNavChange, actionItems, onActionClick, headerRight, accountName, accountId, className, contentClassName, children, }: HuxuanLayoutProps): React.JSX.Element;