@octohirono/stitch-design-system 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BarChart/BarChart.d.ts +42 -0
- package/dist/components/BarChart/BarChart.js +71 -0
- package/dist/components/BarChart/bar-chart.module.js +4 -0
- package/dist/components/BarChart/index.d.ts +2 -0
- package/dist/components/Calendar/Calendar.d.ts +57 -0
- package/dist/components/Calendar/Calendar.js +83 -0
- package/dist/components/Calendar/calendar.module.js +26 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/ChatFile/ChatFile.d.ts +34 -0
- package/dist/components/ChatFile/ChatFile.js +71 -0
- package/dist/components/ChatFile/chat-file.module.js +12 -0
- package/dist/components/ChatFile/index.d.ts +2 -0
- package/dist/components/ChatImage/ChatImage.d.ts +31 -0
- package/dist/components/ChatImage/ChatImage.js +88 -0
- package/dist/components/ChatImage/chat-image.module.js +12 -0
- package/dist/components/ChatImage/index.d.ts +2 -0
- package/dist/components/ChatInput/ChatInput.d.ts +77 -0
- package/dist/components/ChatInput/ChatInput.js +88 -0
- package/dist/components/ChatInput/chat-input.module.js +11 -0
- package/dist/components/ChatInput/index.d.ts +2 -0
- package/dist/components/ChatList/ChatList.d.ts +58 -0
- package/dist/components/ChatList/ChatList.js +49 -0
- package/dist/components/ChatList/chat-list.module.js +7 -0
- package/dist/components/ChatList/index.d.ts +2 -0
- package/dist/components/ChatMessage/ChatMessage.d.ts +52 -0
- package/dist/components/ChatMessage/ChatMessage.js +71 -0
- package/dist/components/ChatMessage/chat-message.module.js +21 -0
- package/dist/components/ChatMessage/index.d.ts +2 -0
- package/dist/components/ChatMessageActions/ChatMessageActions.d.ts +40 -0
- package/dist/components/ChatMessageActions/ChatMessageActions.js +34 -0
- package/dist/components/ChatMessageActions/chat-message-actions.module.js +7 -0
- package/dist/components/ChatMessageActions/index.d.ts +2 -0
- package/dist/components/ChatVoice/ChatVoice.d.ts +39 -0
- package/dist/components/ChatVoice/ChatVoice.js +44 -0
- package/dist/components/ChatVoice/chat-voice.module.js +12 -0
- package/dist/components/ChatVoice/index.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu.js +41 -34
- package/dist/components/ContextMenu/context-menu.module.js +10 -9
- package/dist/components/DatePicker/DatePicker.d.ts +60 -0
- package/dist/components/DatePicker/DatePicker.js +75 -0
- package/dist/components/DatePicker/datepicker.module.js +17 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +45 -38
- package/dist/components/DropdownMenu/dropdown-menu.module.js +10 -9
- package/dist/components/Icon/Icon.d.ts +36 -0
- package/dist/components/Icon/Icon.js +59 -1
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/image.module.js +14 -14
- package/dist/components/LineChart/LineChart.d.ts +48 -0
- package/dist/components/LineChart/LineChart.js +110 -0
- package/dist/components/LineChart/index.d.ts +2 -0
- package/dist/components/LineChart/line-chart.module.js +7 -0
- package/dist/components/PieChart/PieChart.d.ts +43 -0
- package/dist/components/PieChart/PieChart.js +56 -0
- package/dist/components/PieChart/index.d.ts +2 -0
- package/dist/components/PieChart/pie-chart.module.js +7 -0
- package/dist/components/Select/Select.js +87 -83
- package/dist/components/Select/select.module.js +10 -9
- package/dist/components/Stat/Stat.d.ts +71 -0
- package/dist/components/Stat/Stat.js +66 -0
- package/dist/components/Stat/StatGroup.d.ts +14 -0
- package/dist/components/Stat/StatGroup.js +16 -0
- package/dist/components/Stat/index.d.ts +4 -0
- package/dist/components/Stat/stat.module.js +23 -0
- package/dist/components/TypingIndicator/TypingIndicator.d.ts +24 -0
- package/dist/components/TypingIndicator/TypingIndicator.js +29 -0
- package/dist/components/TypingIndicator/index.d.ts +2 -0
- package/dist/components/TypingIndicator/typing-indicator.module.js +8 -0
- package/dist/components/_internal/dataviz/ChartFrame.d.ts +20 -0
- package/dist/components/_internal/dataviz/ChartFrame.js +18 -0
- package/dist/components/_internal/dataviz/ChartTooltip.d.ts +23 -0
- package/dist/components/_internal/dataviz/ChartTooltip.js +33 -0
- package/dist/components/_internal/dataviz/chart-frame.module.js +4 -0
- package/dist/components/_internal/dataviz/chart-tooltip.module.js +11 -0
- package/dist/components/_internal/dataviz/chartColors.d.ts +12 -0
- package/dist/components/_internal/dataviz/chartColors.js +3 -0
- package/dist/components/_internal/dataviz/index.d.ts +5 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +37 -22
- package/dist/style.css +1305 -448
- package/dist/themes/seline.css +39 -0
- package/dist/themes/steep.css +37 -0
- package/package.json +9 -4
|
@@ -1,50 +1,57 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import t from "
|
|
2
|
+
import { ScrollArea as t } from "../ScrollArea/ScrollArea.js";
|
|
3
|
+
import n from "./context-menu.module.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { ContextMenu as
|
|
5
|
+
import r from "clsx";
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { ContextMenu as s } from "radix-ui";
|
|
7
8
|
//#region packages/react/src/components/ContextMenu/ContextMenu.tsx
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
let
|
|
11
|
-
name:
|
|
9
|
+
function c(l, u = "") {
|
|
10
|
+
return l.map((l, d) => {
|
|
11
|
+
let f = `${u}${d}`, p = /* @__PURE__ */ o(i, { children: [l.icon && /* @__PURE__ */ a(e, {
|
|
12
|
+
name: l.icon,
|
|
12
13
|
size: "1em",
|
|
13
|
-
className:
|
|
14
|
-
}), /* @__PURE__ */
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
14
|
+
className: n.itemIcon
|
|
15
|
+
}), /* @__PURE__ */ a("span", {
|
|
16
|
+
className: n.itemLabel,
|
|
17
|
+
children: l.label
|
|
17
18
|
})] });
|
|
18
|
-
return
|
|
19
|
-
className: n
|
|
20
|
-
disabled:
|
|
21
|
-
children: [
|
|
19
|
+
return l.children && l.children.length > 0 ? /* @__PURE__ */ o(s.Sub, { children: [/* @__PURE__ */ o(s.SubTrigger, {
|
|
20
|
+
className: r(n.item, l.danger && n.danger),
|
|
21
|
+
disabled: l.disabled,
|
|
22
|
+
children: [p, /* @__PURE__ */ a(e, {
|
|
22
23
|
name: "chevron-right",
|
|
23
24
|
size: "1em",
|
|
24
|
-
className:
|
|
25
|
+
className: n.subArrow
|
|
25
26
|
})]
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
className:
|
|
27
|
+
}), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.SubContent, {
|
|
28
|
+
className: n.content,
|
|
28
29
|
sideOffset: 8,
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
children: /* @__PURE__ */ a(t, {
|
|
31
|
+
className: n.scroll,
|
|
32
|
+
children: c(l.children, `${f}-`)
|
|
33
|
+
})
|
|
34
|
+
}) })] }, f) : /* @__PURE__ */ a(s.Item, {
|
|
35
|
+
className: r(n.item, l.danger && n.danger),
|
|
36
|
+
disabled: l.disabled,
|
|
37
|
+
onSelect: l.onClick,
|
|
38
|
+
children: p
|
|
39
|
+
}, f);
|
|
36
40
|
});
|
|
37
41
|
}
|
|
38
|
-
var
|
|
39
|
-
onOpenChange:
|
|
40
|
-
children: [/* @__PURE__ */
|
|
42
|
+
var l = ({ children: e, items: i, onOpenChange: l, className: u }) => /* @__PURE__ */ o(s.Root, {
|
|
43
|
+
onOpenChange: l,
|
|
44
|
+
children: [/* @__PURE__ */ a(s.Trigger, {
|
|
41
45
|
asChild: !0,
|
|
42
46
|
children: e
|
|
43
|
-
}), /* @__PURE__ */
|
|
44
|
-
className: n
|
|
45
|
-
children:
|
|
47
|
+
}), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Content, {
|
|
48
|
+
className: r(n.content, u),
|
|
49
|
+
children: /* @__PURE__ */ a(t, {
|
|
50
|
+
className: n.scroll,
|
|
51
|
+
children: c(i)
|
|
52
|
+
})
|
|
46
53
|
}) })]
|
|
47
54
|
});
|
|
48
|
-
|
|
55
|
+
l.displayName = "ContextMenu";
|
|
49
56
|
//#endregion
|
|
50
|
-
export {
|
|
57
|
+
export { l as ContextMenu };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
//#region packages/react/src/components/ContextMenu/context-menu.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_content_1dpag_1", t = "_scroll_1dpag_21", n = "_item_1dpag_27", r = "_danger_1dpag_47", i = "_itemIcon_1dpag_54", a = "_itemLabel_1dpag_58", o = "_subArrow_1dpag_61", s = {
|
|
3
3
|
content: e,
|
|
4
|
-
"stitch-context-menu-in": "_stitch-context-menu-
|
|
5
|
-
"stitch-context-menu-out": "_stitch-context-menu-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
"stitch-context-menu-in": "_stitch-context-menu-in_1dpag_1",
|
|
5
|
+
"stitch-context-menu-out": "_stitch-context-menu-out_1dpag_1",
|
|
6
|
+
scroll: t,
|
|
7
|
+
item: n,
|
|
8
|
+
danger: r,
|
|
9
|
+
itemIcon: i,
|
|
10
|
+
itemLabel: a,
|
|
11
|
+
subArrow: o
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
|
-
export { e as content,
|
|
14
|
+
export { e as content, r as danger, s as default, n as item, i as itemIcon, a as itemLabel, t as scroll, o as subArrow };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CalendarMode, type CalendarCaptionLayout, type DateRange } from '../Calendar';
|
|
3
|
+
export type DatePickerSize = 'small' | 'middle' | 'large';
|
|
4
|
+
/**
|
|
5
|
+
* 日期选择器(Ant `DatePicker` / `RangePicker` 语义):字段触发器 + 复用现有
|
|
6
|
+
* {@link Popover} 弹出内联 {@link Calendar}(不另造浮层)。`mode="single"` 单日、
|
|
7
|
+
* `mode="range"` 范围(`Jul 28 – Aug 26` 的范围触发器)。
|
|
8
|
+
*
|
|
9
|
+
* 跨-prop 注意事项:
|
|
10
|
+
* - **取值随 `mode` 变形**(同 Calendar):`single`→`Date`;`range`→{@link DateRange}
|
|
11
|
+
* (`{from,to}`)。`onChange` 同步收对应形态或 `undefined`(清除时)。
|
|
12
|
+
* - **受控/非受控双开关**:取值 `value`/`defaultValue`/`onChange`(Ant v5 取值约定)与浮层
|
|
13
|
+
* `open`/`onOpenChange`(Ant v5 气泡约定)各自独立支持受控与非受控。
|
|
14
|
+
* - **`allowClear`(默认开)** 有值且未禁用时在字段尾部显示清除按钮(走 `<Icon name="close">`、
|
|
15
|
+
* 原生 `<button>`、`clearAriaLabel` 定可及名);点击清空且不冒泡打开浮层。
|
|
16
|
+
* - **`disabledDate(date)`** 透传给内层 Calendar 逐日禁用;`disabled` 禁用整个触发器。
|
|
17
|
+
* - **面 = 角色变量**:字段结构靠 `--stitch-border` + `--stitch-radius-input`,选中态与范围底色
|
|
18
|
+
* 由 Calendar 上皮(accent / bg-accent)承载;日历图标与翻月箭头一律经 `<Icon>`,无裸 svg。
|
|
19
|
+
*/
|
|
20
|
+
export interface DatePickerProps {
|
|
21
|
+
/** 选择模式:单日或范围 @default 'single' */
|
|
22
|
+
mode?: CalendarMode;
|
|
23
|
+
/** 受控选中值(`single`→`Date`,`range`→`DateRange`) */
|
|
24
|
+
value?: Date | DateRange;
|
|
25
|
+
/** 非受控初始选中值(`single`→`Date`,`range`→`DateRange`) */
|
|
26
|
+
defaultValue?: Date | DateRange;
|
|
27
|
+
/** 选中变化回调(含清除时的 `undefined`) */
|
|
28
|
+
onChange?: (value: Date | DateRange | undefined) => void;
|
|
29
|
+
/** 逐日禁用判定:返回 `true` 的日期不可选 */
|
|
30
|
+
disabledDate?: (date: Date) => boolean;
|
|
31
|
+
/** 首屏展示的月份(Ant `defaultPickerValue`);不给则据选中值 / 当月 */
|
|
32
|
+
defaultPickerValue?: Date;
|
|
33
|
+
/** 弹出日历顶部年月区形态:`'dropdown'` 可点选月 / 年,`'label'` 静态标题 @default 'dropdown' */
|
|
34
|
+
captionLayout?: CalendarCaptionLayout;
|
|
35
|
+
/** 禁用整个触发器 @default false */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** 允许一键清除 @default true */
|
|
38
|
+
allowClear?: boolean;
|
|
39
|
+
/** 清除按钮的无障碍标签 @default '清除' */
|
|
40
|
+
clearAriaLabel?: string;
|
|
41
|
+
/** 占位符(`range` 可传 `[起, 止]` 两段) */
|
|
42
|
+
placeholder?: string | [string, string];
|
|
43
|
+
/** 日期展示格式(date-fns 格式串) @default 'yyyy-MM-dd' */
|
|
44
|
+
format?: string;
|
|
45
|
+
/** 触发器尺寸 @default 'middle' */
|
|
46
|
+
size?: DatePickerSize;
|
|
47
|
+
/** 校验态(error 同时置 `aria-invalid`) */
|
|
48
|
+
status?: 'error' | 'warning';
|
|
49
|
+
/** 受控浮层显隐(Ant v5 `open`) */
|
|
50
|
+
open?: boolean;
|
|
51
|
+
/** 非受控初始显隐 @default false */
|
|
52
|
+
defaultOpen?: boolean;
|
|
53
|
+
/** 显隐变化回调(Ant v5 `onOpenChange`) */
|
|
54
|
+
onOpenChange?: (open: boolean) => void;
|
|
55
|
+
/** 触发器的可访问名 */
|
|
56
|
+
'aria-label'?: string;
|
|
57
|
+
/** 自定义类名(挂到字段包裹上) */
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare const DatePicker: React.FC<DatePickerProps>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
+
import { Calendar as t } from "../Calendar/Calendar.js";
|
|
3
|
+
import { Popover as n } from "../Popover/Popover.js";
|
|
4
|
+
import r from "./datepicker.module.js";
|
|
5
|
+
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
6
|
+
import c from "clsx";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { format as d } from "date-fns";
|
|
9
|
+
//#region packages/react/src/components/DatePicker/DatePicker.tsx
|
|
10
|
+
var f = (e) => typeof e == "object" && !!e && !(e instanceof Date), p = ({ mode: p = "single", value: m, defaultValue: h, onChange: g, disabledDate: _, defaultPickerValue: v, captionLayout: y, disabled: b = !1, allowClear: x = !0, clearAriaLabel: S = "清除", placeholder: C, format: w = "yyyy-MM-dd", size: T = "middle", status: E, open: D, defaultOpen: O, onOpenChange: k, className: A, "aria-label": j }) => {
|
|
11
|
+
let M = m !== void 0, [N, P] = s(h), F = M ? m : N, I = D !== void 0, [L, R] = s(O ?? !1), z = I ? D : L, B = i((e) => {
|
|
12
|
+
I || R(e), k?.(e);
|
|
13
|
+
}, [I, k]), V = o(0);
|
|
14
|
+
a(() => {
|
|
15
|
+
z && (V.current = 0);
|
|
16
|
+
}, [z]);
|
|
17
|
+
let H = i((e) => {
|
|
18
|
+
M || P(e), g?.(e);
|
|
19
|
+
}, [M, g]), U = i((e) => {
|
|
20
|
+
H(e), p === "range" ? (V.current += 1, V.current >= 2 && f(e) && e.from && e.to && B(!1)) : e && B(!1);
|
|
21
|
+
}, [
|
|
22
|
+
H,
|
|
23
|
+
p,
|
|
24
|
+
B
|
|
25
|
+
]), W = i((e) => {
|
|
26
|
+
e.stopPropagation(), H(void 0);
|
|
27
|
+
}, [H]), G = (e) => e ? d(e, w) : "", K = "", q = !1;
|
|
28
|
+
p === "range" && f(F) ? (q = !!(F.from || F.to), q && (K = `${G(F.from)} – ${G(F.to)}`)) : p === "single" && F instanceof Date && (q = !0, K = G(F));
|
|
29
|
+
let [J, Y] = Array.isArray(C) ? C : [C, C], X = p === "range" ? `${J ?? "开始日期"} – ${Y ?? "结束日期"}` : J ?? "请选择日期", Z = x && q && !b, Q = c(r.field, r[T], E && r[`status-${E}`], b && r.disabled, A), $ = /* @__PURE__ */ u("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
className: r.trigger,
|
|
32
|
+
disabled: b,
|
|
33
|
+
"aria-label": j,
|
|
34
|
+
"aria-invalid": E === "error" ? "true" : void 0,
|
|
35
|
+
"aria-haspopup": "dialog",
|
|
36
|
+
children: [/* @__PURE__ */ l(e, {
|
|
37
|
+
name: "calendar",
|
|
38
|
+
size: 16,
|
|
39
|
+
className: r.calendarIcon
|
|
40
|
+
}), /* @__PURE__ */ l("span", {
|
|
41
|
+
className: c(r.text, !q && r.placeholder),
|
|
42
|
+
children: q ? K : X
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ u("span", {
|
|
46
|
+
className: Q,
|
|
47
|
+
children: [/* @__PURE__ */ l(n, {
|
|
48
|
+
open: z,
|
|
49
|
+
onOpenChange: B,
|
|
50
|
+
"aria-label": j ?? X,
|
|
51
|
+
trigger: $,
|
|
52
|
+
className: r.panel,
|
|
53
|
+
children: /* @__PURE__ */ l(t, {
|
|
54
|
+
mode: p,
|
|
55
|
+
value: F,
|
|
56
|
+
onChange: U,
|
|
57
|
+
disabledDate: _,
|
|
58
|
+
defaultMonth: v,
|
|
59
|
+
captionLayout: y
|
|
60
|
+
})
|
|
61
|
+
}), Z && /* @__PURE__ */ l("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
className: r.clear,
|
|
64
|
+
"aria-label": S,
|
|
65
|
+
onClick: W,
|
|
66
|
+
children: /* @__PURE__ */ l(e, {
|
|
67
|
+
name: "close",
|
|
68
|
+
size: 14
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
p.displayName = "DatePicker";
|
|
74
|
+
//#endregion
|
|
75
|
+
export { p as DatePicker };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region packages/react/src/components/DatePicker/datepicker.module.less
|
|
2
|
+
var e = "_field_qa4ee_1", t = "_trigger_qa4ee_7", n = "_calendarIcon_qa4ee_37", r = "_text_qa4ee_41", i = "_placeholder_qa4ee_47", a = "_small_qa4ee_50", o = "_middle_qa4ee_54", s = "_large_qa4ee_57", c = "_clear_qa4ee_73", l = "_panel_qa4ee_94", u = {
|
|
3
|
+
field: e,
|
|
4
|
+
trigger: t,
|
|
5
|
+
calendarIcon: n,
|
|
6
|
+
text: r,
|
|
7
|
+
placeholder: i,
|
|
8
|
+
small: a,
|
|
9
|
+
middle: o,
|
|
10
|
+
large: s,
|
|
11
|
+
"status-error": "_status-error_qa4ee_61",
|
|
12
|
+
"status-warning": "_status-warning_qa4ee_67",
|
|
13
|
+
clear: c,
|
|
14
|
+
panel: l
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as calendarIcon, c as clear, u as default, e as field, s as large, o as middle, l as panel, i as placeholder, a as small, r as text, t as trigger };
|
|
@@ -1,54 +1,61 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import t from "
|
|
2
|
+
import { ScrollArea as t } from "../ScrollArea/ScrollArea.js";
|
|
3
|
+
import n from "./dropdown-menu.module.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { DropdownMenu as
|
|
5
|
+
import r from "clsx";
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { DropdownMenu as s } from "radix-ui";
|
|
7
8
|
//#region packages/react/src/components/DropdownMenu/DropdownMenu.tsx
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
let
|
|
11
|
-
name:
|
|
9
|
+
function c(l, u = "") {
|
|
10
|
+
return l.map((l, d) => {
|
|
11
|
+
let f = `${u}${d}`, p = /* @__PURE__ */ o(i, { children: [l.icon && /* @__PURE__ */ a(e, {
|
|
12
|
+
name: l.icon,
|
|
12
13
|
size: "1em",
|
|
13
|
-
className:
|
|
14
|
-
}), /* @__PURE__ */
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
14
|
+
className: n.itemIcon
|
|
15
|
+
}), /* @__PURE__ */ a("span", {
|
|
16
|
+
className: n.itemLabel,
|
|
17
|
+
children: l.label
|
|
17
18
|
})] });
|
|
18
|
-
return
|
|
19
|
-
className: n
|
|
20
|
-
disabled:
|
|
21
|
-
children: [
|
|
19
|
+
return l.children && l.children.length > 0 ? /* @__PURE__ */ o(s.Sub, { children: [/* @__PURE__ */ o(s.SubTrigger, {
|
|
20
|
+
className: r(n.item, l.danger && n.danger),
|
|
21
|
+
disabled: l.disabled,
|
|
22
|
+
children: [p, /* @__PURE__ */ a(e, {
|
|
22
23
|
name: "chevron-right",
|
|
23
24
|
size: "1em",
|
|
24
|
-
className:
|
|
25
|
+
className: n.subArrow
|
|
25
26
|
})]
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
className:
|
|
27
|
+
}), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.SubContent, {
|
|
28
|
+
className: n.content,
|
|
28
29
|
sideOffset: 8,
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
children: /* @__PURE__ */ a(t, {
|
|
31
|
+
className: n.scroll,
|
|
32
|
+
children: c(l.children, `${f}-`)
|
|
33
|
+
})
|
|
34
|
+
}) })] }, f) : /* @__PURE__ */ a(s.Item, {
|
|
35
|
+
className: r(n.item, l.danger && n.danger),
|
|
36
|
+
disabled: l.disabled,
|
|
37
|
+
onSelect: l.onClick,
|
|
38
|
+
children: p
|
|
39
|
+
}, f);
|
|
36
40
|
});
|
|
37
41
|
}
|
|
38
|
-
var
|
|
39
|
-
open:
|
|
40
|
-
defaultOpen:
|
|
41
|
-
onOpenChange:
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
var l = ({ trigger: e, items: i, open: l, defaultOpen: u, onOpenChange: d, sideOffset: f = 8, className: p, "aria-label": m }) => /* @__PURE__ */ o(s.Root, {
|
|
43
|
+
open: l,
|
|
44
|
+
defaultOpen: u,
|
|
45
|
+
onOpenChange: d,
|
|
46
|
+
children: [/* @__PURE__ */ a(s.Trigger, {
|
|
43
47
|
asChild: !0,
|
|
44
|
-
"aria-label":
|
|
48
|
+
"aria-label": m,
|
|
45
49
|
children: e
|
|
46
|
-
}), /* @__PURE__ */
|
|
47
|
-
className: n
|
|
48
|
-
sideOffset:
|
|
49
|
-
children:
|
|
50
|
+
}), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Content, {
|
|
51
|
+
className: r(n.content, p),
|
|
52
|
+
sideOffset: f,
|
|
53
|
+
children: /* @__PURE__ */ a(t, {
|
|
54
|
+
className: n.scroll,
|
|
55
|
+
children: c(i)
|
|
56
|
+
})
|
|
50
57
|
}) })]
|
|
51
58
|
});
|
|
52
|
-
|
|
59
|
+
l.displayName = "DropdownMenu";
|
|
53
60
|
//#endregion
|
|
54
|
-
export {
|
|
61
|
+
export { l as DropdownMenu };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
//#region packages/react/src/components/DropdownMenu/dropdown-menu.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_content_6jxoc_1", t = "_scroll_6jxoc_21", n = "_item_6jxoc_27", r = "_danger_6jxoc_47", i = "_itemIcon_6jxoc_54", a = "_itemLabel_6jxoc_58", o = "_subArrow_6jxoc_61", s = {
|
|
3
3
|
content: e,
|
|
4
|
-
"stitch-dropdown-in": "_stitch-dropdown-
|
|
5
|
-
"stitch-dropdown-out": "_stitch-dropdown-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
"stitch-dropdown-in": "_stitch-dropdown-in_6jxoc_1",
|
|
5
|
+
"stitch-dropdown-out": "_stitch-dropdown-out_6jxoc_1",
|
|
6
|
+
scroll: t,
|
|
7
|
+
item: n,
|
|
8
|
+
danger: r,
|
|
9
|
+
itemIcon: i,
|
|
10
|
+
itemLabel: a,
|
|
11
|
+
subArrow: o
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
|
-
export { e as content,
|
|
14
|
+
export { e as content, r as danger, s as default, n as item, i as itemIcon, a as itemLabel, t as scroll, o as subArrow };
|
|
@@ -4,6 +4,8 @@ declare const ICON_PATHS: {
|
|
|
4
4
|
readonly close: readonly ["M6 6l12 12", "M18 6L6 18"];
|
|
5
5
|
readonly 'chevron-down': readonly ["M5 9l7 7 7-7"];
|
|
6
6
|
readonly 'chevron-right': readonly ["M9 5l7 7-7 7"];
|
|
7
|
+
readonly 'chevron-left': readonly ["M15 5l-7 7 7 7"];
|
|
8
|
+
readonly calendar: readonly ["M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z", "M8 3v4", "M16 3v4", "M4 10h16"];
|
|
7
9
|
readonly search: readonly ["M4 11a7 7 0 1 0 14 0a7 7 0 1 0 -14 0z", "M16.5 16.5L21 21"];
|
|
8
10
|
readonly menu: readonly ["M4 7h16", "M4 12h16", "M4 17h16"];
|
|
9
11
|
readonly info: readonly ["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0z", "M12 11v5", "M12 7.5h0.01"];
|
|
@@ -19,6 +21,13 @@ declare const ICON_PATHS: {
|
|
|
19
21
|
readonly 'align-left': readonly ["M4 6h16", "M4 12h10", "M4 18h13"];
|
|
20
22
|
readonly 'align-center': readonly ["M4 6h16", "M7 12h10", "M6 18h12"];
|
|
21
23
|
readonly 'align-right': readonly ["M4 6h16", "M10 12h10", "M7 18h13"];
|
|
24
|
+
readonly 'arrow-up-right': readonly ["M7 17L17 7", "M8 7h9v9"];
|
|
25
|
+
readonly 'arrow-down-right': readonly ["M7 7L17 17", "M17 8v9H8"];
|
|
26
|
+
readonly send: readonly ["M22 2L11 13", "M22 2L15 22 11 13 2 9z"];
|
|
27
|
+
readonly play: readonly ["M8 5v14l11-7z"];
|
|
28
|
+
readonly pause: readonly ["M8 5h3v14H8z", "M13 5h3v14h-3z"];
|
|
29
|
+
readonly file: readonly ["M13 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z", "M13 3v6h6"];
|
|
30
|
+
readonly download: readonly ["M12 4v11", "M8 11l4 4 4-4", "M5 20h14"];
|
|
22
31
|
};
|
|
23
32
|
export type IconName = keyof typeof ICON_PATHS;
|
|
24
33
|
/**
|
|
@@ -69,6 +78,12 @@ export declare const ICON_LIST: readonly [{
|
|
|
69
78
|
}, {
|
|
70
79
|
readonly name: 'chevron-right';
|
|
71
80
|
readonly label: 'Chevron right';
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: 'chevron-left';
|
|
83
|
+
readonly label: 'Chevron left';
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: 'calendar';
|
|
86
|
+
readonly label: 'Calendar';
|
|
72
87
|
}, {
|
|
73
88
|
readonly name: 'search';
|
|
74
89
|
readonly label: 'Search';
|
|
@@ -96,5 +111,26 @@ export declare const ICON_LIST: readonly [{
|
|
|
96
111
|
}, {
|
|
97
112
|
readonly name: 'eye-off';
|
|
98
113
|
readonly label: 'Eye off';
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: 'arrow-up-right';
|
|
116
|
+
readonly label: 'Trend up';
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: 'arrow-down-right';
|
|
119
|
+
readonly label: 'Trend down';
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: 'send';
|
|
122
|
+
readonly label: 'Send';
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: 'play';
|
|
125
|
+
readonly label: 'Play';
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: 'pause';
|
|
128
|
+
readonly label: 'Pause';
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: 'file';
|
|
131
|
+
readonly label: 'File';
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: 'download';
|
|
134
|
+
readonly label: 'Download';
|
|
99
135
|
}];
|
|
100
136
|
export {};
|
|
@@ -8,6 +8,13 @@ var r = {
|
|
|
8
8
|
close: ["M6 6l12 12", "M18 6L6 18"],
|
|
9
9
|
"chevron-down": ["M5 9l7 7 7-7"],
|
|
10
10
|
"chevron-right": ["M9 5l7 7-7 7"],
|
|
11
|
+
"chevron-left": ["M15 5l-7 7 7 7"],
|
|
12
|
+
calendar: [
|
|
13
|
+
"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z",
|
|
14
|
+
"M8 3v4",
|
|
15
|
+
"M16 3v4",
|
|
16
|
+
"M4 10h16"
|
|
17
|
+
],
|
|
11
18
|
search: ["M4 11a7 7 0 1 0 14 0a7 7 0 1 0 -14 0z", "M16.5 16.5L21 21"],
|
|
12
19
|
menu: [
|
|
13
20
|
"M4 7h16",
|
|
@@ -59,8 +66,23 @@ var r = {
|
|
|
59
66
|
"M4 6h16",
|
|
60
67
|
"M10 12h10",
|
|
61
68
|
"M7 18h13"
|
|
69
|
+
],
|
|
70
|
+
"arrow-up-right": ["M7 17L17 7", "M8 7h9v9"],
|
|
71
|
+
"arrow-down-right": ["M7 7L17 17", "M17 8v9H8"],
|
|
72
|
+
send: ["M22 2L11 13", "M22 2L15 22 11 13 2 9z"],
|
|
73
|
+
play: ["M8 5v14l11-7z"],
|
|
74
|
+
pause: ["M8 5h3v14H8z", "M13 5h3v14h-3z"],
|
|
75
|
+
file: ["M13 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z", "M13 3v6h6"],
|
|
76
|
+
download: [
|
|
77
|
+
"M12 4v11",
|
|
78
|
+
"M8 11l4 4 4-4",
|
|
79
|
+
"M5 20h14"
|
|
62
80
|
]
|
|
63
|
-
}, i = /* @__PURE__ */ new Set([
|
|
81
|
+
}, i = /* @__PURE__ */ new Set([
|
|
82
|
+
"dot",
|
|
83
|
+
"play",
|
|
84
|
+
"pause"
|
|
85
|
+
]), a = ({ name: a, src: o, size: s = 24, label: c, strokeWidth: l, className: u, style: d, ...f }) => {
|
|
64
86
|
let p = t(e.icon, u), m = c == null ? { "aria-hidden": !0 } : {
|
|
65
87
|
role: "img",
|
|
66
88
|
"aria-label": c
|
|
@@ -109,6 +131,14 @@ var o = [
|
|
|
109
131
|
name: "chevron-right",
|
|
110
132
|
label: "Chevron right"
|
|
111
133
|
},
|
|
134
|
+
{
|
|
135
|
+
name: "chevron-left",
|
|
136
|
+
label: "Chevron left"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "calendar",
|
|
140
|
+
label: "Calendar"
|
|
141
|
+
},
|
|
112
142
|
{
|
|
113
143
|
name: "search",
|
|
114
144
|
label: "Search"
|
|
@@ -144,6 +174,34 @@ var o = [
|
|
|
144
174
|
{
|
|
145
175
|
name: "eye-off",
|
|
146
176
|
label: "Eye off"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "arrow-up-right",
|
|
180
|
+
label: "Trend up"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "arrow-down-right",
|
|
184
|
+
label: "Trend down"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "send",
|
|
188
|
+
label: "Send"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "play",
|
|
192
|
+
label: "Play"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "pause",
|
|
196
|
+
label: "Pause"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "file",
|
|
200
|
+
label: "File"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "download",
|
|
204
|
+
label: "Download"
|
|
147
205
|
}
|
|
148
206
|
];
|
|
149
207
|
//#endregion
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
//#region packages/react/src/components/Image/image.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_image_94mwe_1", t = "_img_94mwe_19", n = "_loaded_94mwe_26", r = "_error_94mwe_29", i = "_preview_94mwe_71", a = "_mask_94mwe_82", o = "_dialog_94mwe_92", s = "_previewImg_94mwe_97", c = "_closeBtn_94mwe_105", l = {
|
|
3
3
|
image: e,
|
|
4
4
|
img: t,
|
|
5
5
|
loaded: n,
|
|
6
6
|
error: r,
|
|
7
|
-
"image-accent": "_image-
|
|
8
|
-
"image-danger": "_image-
|
|
9
|
-
"image-success": "_image-
|
|
10
|
-
"image-warning": "_image-
|
|
11
|
-
"image-info": "_image-
|
|
12
|
-
"image-cat-1": "_image-cat-
|
|
13
|
-
"image-cat-2": "_image-cat-
|
|
14
|
-
"image-cat-3": "_image-cat-
|
|
15
|
-
"image-cat-4": "_image-cat-
|
|
16
|
-
"image-cat-5": "_image-cat-
|
|
17
|
-
"image-cat-6": "_image-cat-
|
|
7
|
+
"image-accent": "_image-accent_94mwe_38",
|
|
8
|
+
"image-danger": "_image-danger_94mwe_41",
|
|
9
|
+
"image-success": "_image-success_94mwe_44",
|
|
10
|
+
"image-warning": "_image-warning_94mwe_47",
|
|
11
|
+
"image-info": "_image-info_94mwe_50",
|
|
12
|
+
"image-cat-1": "_image-cat-1_94mwe_53",
|
|
13
|
+
"image-cat-2": "_image-cat-2_94mwe_56",
|
|
14
|
+
"image-cat-3": "_image-cat-3_94mwe_59",
|
|
15
|
+
"image-cat-4": "_image-cat-4_94mwe_62",
|
|
16
|
+
"image-cat-5": "_image-cat-5_94mwe_65",
|
|
17
|
+
"image-cat-6": "_image-cat-6_94mwe_68",
|
|
18
18
|
preview: i,
|
|
19
19
|
mask: a,
|
|
20
|
-
"stitch-image-fade-in": "_stitch-image-fade-
|
|
20
|
+
"stitch-image-fade-in": "_stitch-image-fade-in_94mwe_1",
|
|
21
21
|
dialog: o,
|
|
22
22
|
previewImg: s,
|
|
23
|
-
"stitch-image-zoom-in": "_stitch-image-zoom-
|
|
23
|
+
"stitch-image-zoom-in": "_stitch-image-zoom-in_94mwe_1",
|
|
24
24
|
closeBtn: c
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** 单条系列:从每行数据里取哪个字段、显示成什么名。 */
|
|
3
|
+
export interface LineChartSeries {
|
|
4
|
+
/** 该系列在数据项里取值的字段名 */
|
|
5
|
+
dataKey: string;
|
|
6
|
+
/** 系列显示名(tooltip / 图例);缺省用 `dataKey` */
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 折线 / 面积图。系列色只从契约分类色槽 `var(--stitch-cat-*)` 取、按序号循环,随站换肤整图跟随;
|
|
11
|
+
* `area` 开启时线下软填充由同一系列色经 `color-mix()` 派生。多系列不只靠颜色区分——每系列按序
|
|
12
|
+
* 循环线型(`strokeDasharray`),并在末点旁直接标出系列名(文字走 `var(--stitch-text-primary)`),
|
|
13
|
+
* 故主题线色偏淡时也能分辨(不依赖颜色,守 a11y)。svg 全由 recharts 出、源码零手写 svg,无 emoji。
|
|
14
|
+
* 整图作一张图对外——`role="img"` + `aria-label`(缺省兜底非空名)。
|
|
15
|
+
*/
|
|
16
|
+
export interface LineChartProps {
|
|
17
|
+
/** 数据源,每项一行记录(Ant charts `data` 语义) */
|
|
18
|
+
data: Record<string, unknown>[];
|
|
19
|
+
/** x 轴取值字段名(Ant charts `xField` 语义) */
|
|
20
|
+
xField: string;
|
|
21
|
+
/** 一条或多条系列(各取一个 y 字段) */
|
|
22
|
+
series: LineChartSeries[];
|
|
23
|
+
/**
|
|
24
|
+
* 平滑曲线(Ant charts `smooth` 语义)
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
smooth?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 折线下渲染派生软填充面积(Ant charts `area` 语义)
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
area?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 图表高度(px);宽度恒铺满容器
|
|
35
|
+
* @default 300
|
|
36
|
+
*/
|
|
37
|
+
height?: number;
|
|
38
|
+
/** y 值格式化(如货币);作用于坐标轴刻度与 tooltip 值 */
|
|
39
|
+
valueFormatter?: (value: number) => string;
|
|
40
|
+
/** 图表整体可访问名(`role="img"` 的文本替代);缺省兜底非空名 */
|
|
41
|
+
ariaLabel?: string;
|
|
42
|
+
/** 透传外层容器类名 */
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 把数据画成折线(可选面积),系列色走契约分类色槽、随站换肤。
|
|
47
|
+
*/
|
|
48
|
+
export declare const LineChart: React.FC<LineChartProps>;
|