@24city/web-console 0.2.1 → 0.3.1

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 (47) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/GUIDELINES.md +53 -6
  3. package/README.md +44 -8
  4. package/dist/account/account-menu.d.ts +1 -1
  5. package/dist/account/allowance-meter.d.ts +21 -0
  6. package/dist/account/customization.d.ts +9 -0
  7. package/dist/account/index.d.ts +1 -0
  8. package/dist/account/index.js +64 -63
  9. package/dist/chunks/color-mode-DC4KIKya.js +40 -0
  10. package/dist/chunks/color-mode-switch-BinpVuZ0.js +24 -0
  11. package/dist/chunks/console-layout-Os4sQzMP.js +210 -0
  12. package/dist/chunks/form-layout-BDOTSKaB.js +75 -0
  13. package/dist/chunks/status-text-CKFIzlND.js +12 -0
  14. package/dist/chunks/upgrade-modal-BWnNve0z.js +696 -0
  15. package/dist/chunks/wallet-badge-Dt8fv-Du.js +575 -0
  16. package/dist/chunks/waterfall-Cmz0ZULQ.js +614 -0
  17. package/dist/chunks/work-summary-DVmaOkCu.js +195 -0
  18. package/dist/data/index.d.ts +1 -0
  19. package/dist/data/index.js +5 -3
  20. package/dist/data/status-text.d.ts +15 -0
  21. package/dist/form/field.d.ts +30 -0
  22. package/dist/form/form-layout.d.ts +34 -0
  23. package/dist/form/index.d.ts +2 -0
  24. package/dist/form/index.js +8 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +209 -177
  27. package/dist/layout/index.js +1 -1
  28. package/dist/list/filter-panel.d.ts +10 -2
  29. package/dist/list/index.js +1 -1
  30. package/dist/page/color-mode-switch.d.ts +10 -0
  31. package/dist/page/index.d.ts +1 -0
  32. package/dist/page/index.js +24 -22
  33. package/dist/styles.css +1502 -408
  34. package/dist/theme/color-mode.d.ts +29 -0
  35. package/dist/theme/index.d.ts +15 -7
  36. package/dist/theme/index.js +56 -37
  37. package/dist/theme/palette.d.ts +6 -0
  38. package/dist/workbench/index.d.ts +3 -0
  39. package/dist/workbench/index.js +15 -0
  40. package/dist/workbench/step-tabs.d.ts +59 -0
  41. package/dist/workbench/work-canvas.d.ts +43 -0
  42. package/dist/workbench/work-summary.d.ts +47 -0
  43. package/package.json +11 -1
  44. package/dist/chunks/console-layout-BWz1qRog.js +0 -210
  45. package/dist/chunks/upgrade-modal-DgChxbLm.js +0 -667
  46. package/dist/chunks/wallet-badge-dVrO6py9.js +0 -565
  47. package/dist/chunks/waterfall-CQG8aVdx.js +0 -613
@@ -0,0 +1,210 @@
1
+ import { jsx as t, jsxs as c, Fragment as H } from "react/jsx-runtime";
2
+ import { useState as z, useEffect as $ } from "react";
3
+ import { Layout as g, Button as v, Typography as O, Space as F, Nav as S } from "@douyinfe/semi-ui";
4
+ import { IconSidebar as T } from "@douyinfe/semi-icons";
5
+ import { useLocation as Q, useNavigate as Y, Outlet as q } from "react-router";
6
+ import { h as D, B as J, o as V, e as X, W as Z, b as ee } from "./wallet-badge-Dt8fv-Du.js";
7
+ import { u as P, b as te, a as ne } from "./context-CaVim6ZO.js";
8
+ import { u as ae } from "./use-media-query-DvyinWNg.js";
9
+ import { a as oe } from "./scale-smFifpMm.js";
10
+ const se = "_layout_1vz0g_6", le = "_header_1vz0g_13", re = "_headerLeft_1vz0g_34", ce = "_logo_1vz0g_43", ie = "_logoMark_1vz0g_58", de = "_logoText_1vz0g_65", ue = "_modules_1vz0g_75", me = "_module_1vz0g_75", _e = "_moduleText_1vz0g_123", pe = "_moduleIcon_1vz0g_143", he = "_moduleInk_1vz0g_147", ge = "_headerRight_1vz0g_167", ve = "_walletSlot_1vz0g_172", fe = "_body_1vz0g_180", ye = "_sider_1vz0g_186", ke = "_siderInner_1vz0g_200", Ne = "_panel_1vz0g_207", ze = "_expandButton_1vz0g_244", be = "_menu_1vz0g_260", Ie = "_menuGroup_1vz0g_271", we = "_menuGroupPlain_1vz0g_280", xe = "_menuGroupTitle_1vz0g_285", Ce = "_menuList_1vz0g_296", Me = "_collapseButton_1vz0g_419", Be = "_mask_1vz0g_440", Le = "_content_1vz0g_449", Ge = "_contentCentered_1vz0g_455", Se = "_contentInner_1vz0g_467", Te = "_letterMark_1vz0g_520", e = {
11
+ layout: se,
12
+ header: le,
13
+ headerLeft: re,
14
+ logo: ce,
15
+ logoMark: ie,
16
+ logoText: de,
17
+ modules: ue,
18
+ module: me,
19
+ moduleText: _e,
20
+ moduleIcon: pe,
21
+ moduleInk: he,
22
+ headerRight: ge,
23
+ walletSlot: ve,
24
+ body: fe,
25
+ sider: ye,
26
+ siderInner: ke,
27
+ panel: Ne,
28
+ expandButton: ze,
29
+ menu: be,
30
+ menuGroup: Ie,
31
+ menuGroupPlain: we,
32
+ menuGroupTitle: xe,
33
+ menuList: Ce,
34
+ collapseButton: Me,
35
+ mask: Be,
36
+ content: Le,
37
+ contentCentered: Ge,
38
+ contentInner: Se,
39
+ letterMark: Te
40
+ }, $e = (a, l) => a === l || a.startsWith(`${l}/`), Pe = (a, l) => a.flatMap((o) => o.items).find((o) => new URL(o.to, "http://console.local").pathname === l), Re = (a, l) => {
41
+ var o;
42
+ return (o = [...a].map((r) => ({ module: r, path: new URL(r.to, "http://console.local").pathname })).filter(({ path: r }) => $e(l, r)).sort((r, u) => u.path.length - r.path.length)[0]) == null ? void 0 : o.module;
43
+ }, Ue = () => {
44
+ const [a, l] = z(!1);
45
+ return $(() => {
46
+ const o = () => l(window.scrollY > 0);
47
+ return o(), window.addEventListener("scroll", o, { passive: !0 }), () => window.removeEventListener("scroll", o);
48
+ }, []), a;
49
+ }, Ae = ({ size: a = 30, className: l }) => {
50
+ const o = P(), r = (u) => l ? `${u} ${l}` : u;
51
+ return o.markUrl ? /* @__PURE__ */ t(
52
+ "span",
53
+ {
54
+ className: r(e.logoMark),
55
+ style: { width: a, height: a, backgroundImage: `url("${o.markUrl}")` },
56
+ "aria-hidden": "true"
57
+ }
58
+ ) : /* @__PURE__ */ t("span", { className: r(e.letterMark), style: { width: a, height: a }, "aria-hidden": "true", children: Array.from(o.mark).slice(0, 2).join("") });
59
+ }, qe = ({
60
+ modules: a = [],
61
+ activeModuleKey: l,
62
+ moduleTarget: o,
63
+ sidebar: r = [],
64
+ selectedKey: u,
65
+ renderItemLabel: b,
66
+ headerRight: R,
67
+ menuLabel: U = "工作台菜单",
68
+ children: A,
69
+ extra: E
70
+ }) => {
71
+ var G;
72
+ const { config: I } = te(), w = P(), f = Q(), y = Y(), x = I.routes.app, p = D(x, J(ne())), C = V(x, f.pathname), h = C ? [] : r ?? [], M = h.length > 0, K = l ?? ((G = Re(a, f.pathname)) == null ? void 0 : G.key), m = Pe([...h, p], f.pathname), B = u ?? (m == null ? void 0 : m.key), i = ae(oe("desktop")), W = Ue(), [_, k] = z(!i), [N, d] = z(!1), j = new Map([...h, p].flatMap((n) => n.items.map((s) => [s.key, s])));
73
+ $(() => {
74
+ k(!i), d(!1);
75
+ }, [i]);
76
+ const L = (n) => {
77
+ const s = j.get(n);
78
+ s && y(s.to), d(!1);
79
+ };
80
+ return /* @__PURE__ */ c(g, { className: e.layout, children: [
81
+ /* @__PURE__ */ c(g.Header, { className: e.header, "data-scrolled": W ? "true" : "false", children: [
82
+ /* @__PURE__ */ c("div", { className: e.headerLeft, children: [
83
+ /* @__PURE__ */ c(
84
+ v,
85
+ {
86
+ theme: "borderless",
87
+ type: "tertiary",
88
+ className: e.logo,
89
+ "aria-label": `${w.shortName} 首页`,
90
+ onClick: () => y(I.routes.publicHome),
91
+ children: [
92
+ /* @__PURE__ */ t(Ae, {}),
93
+ /* @__PURE__ */ t(O.Text, { className: e.logoText, children: w.shortName })
94
+ ]
95
+ }
96
+ ),
97
+ a.length ? /* @__PURE__ */ t("div", { className: e.modules, role: "navigation", "aria-label": "产品模块", children: a.map((n) => /* @__PURE__ */ c(
98
+ v,
99
+ {
100
+ theme: "borderless",
101
+ type: "tertiary",
102
+ className: e.module,
103
+ "aria-current": K === n.key ? "page" : void 0,
104
+ onClick: () => y(o ? o(n) : n.to),
105
+ children: [
106
+ /* @__PURE__ */ c("span", { className: e.moduleText, children: [
107
+ n.icon ? /* @__PURE__ */ t("span", { className: e.moduleIcon, children: /* @__PURE__ */ t(n.icon, {}) }) : null,
108
+ n.label
109
+ ] }),
110
+ /* @__PURE__ */ t("span", { className: e.moduleInk, "aria-hidden": "true" })
111
+ ]
112
+ },
113
+ n.key
114
+ )) }) : null
115
+ ] }),
116
+ /* @__PURE__ */ t(F, { spacing: 10, className: e.headerRight, children: R ?? /* @__PURE__ */ c(H, { children: [
117
+ /* @__PURE__ */ t(X, {}),
118
+ /* @__PURE__ */ t("span", { className: e.walletSlot, children: /* @__PURE__ */ t(Z, {}) }),
119
+ /* @__PURE__ */ t(ee, { personal: p, selectedKey: m && p.items.includes(m) ? m.key : void 0, onOpen: L })
120
+ ] }) })
121
+ ] }),
122
+ /* @__PURE__ */ c(g, { className: e.body, children: [
123
+ M ? /* @__PURE__ */ t("aside", { className: e.sider, "data-collapsed": _ ? "true" : "false", children: /* @__PURE__ */ c(
124
+ "div",
125
+ {
126
+ className: e.siderInner,
127
+ "data-collapsed": _ ? "true" : "false",
128
+ "data-peek": N ? "true" : "false",
129
+ onMouseEnter: () => {
130
+ _ && i && d(!0);
131
+ },
132
+ onMouseLeave: () => {
133
+ i && d(!1);
134
+ },
135
+ children: [
136
+ _ ? /* @__PURE__ */ t(
137
+ v,
138
+ {
139
+ theme: "light",
140
+ type: "tertiary",
141
+ className: e.expandButton,
142
+ icon: /* @__PURE__ */ t(T, { "aria-hidden": "true" }),
143
+ "aria-label": "展开侧边栏",
144
+ "aria-expanded": N,
145
+ onClick: () => {
146
+ i ? (k(!1), d(!1)) : d((n) => !n);
147
+ }
148
+ }
149
+ ) : null,
150
+ /* @__PURE__ */ c("div", { className: e.panel, children: [
151
+ /* @__PURE__ */ t("nav", { className: e.menu, "aria-label": U, children: h.map((n) => /* @__PURE__ */ c(
152
+ "div",
153
+ {
154
+ className: n.label ? e.menuGroup : `${e.menuGroup} ${e.menuGroupPlain}`,
155
+ role: "group",
156
+ "aria-label": n.label || void 0,
157
+ children: [
158
+ n.label ? /* @__PURE__ */ t("div", { className: e.menuGroupTitle, children: n.label }) : null,
159
+ /* @__PURE__ */ t(
160
+ S,
161
+ {
162
+ mode: "vertical",
163
+ className: e.menuList,
164
+ selectedKeys: B ? [B] : [],
165
+ onSelect: ({ itemKey: s }) => L(String(s)),
166
+ children: n.items.map((s) => /* @__PURE__ */ t(
167
+ S.Item,
168
+ {
169
+ itemKey: s.key,
170
+ icon: s.icon ? /* @__PURE__ */ t(s.icon, {}) : void 0,
171
+ text: b ? b(s) : s.label
172
+ },
173
+ s.key
174
+ ))
175
+ }
176
+ )
177
+ ]
178
+ },
179
+ n.key
180
+ )) }),
181
+ i ? /* @__PURE__ */ t(
182
+ v,
183
+ {
184
+ theme: "borderless",
185
+ type: "tertiary",
186
+ className: e.collapseButton,
187
+ icon: /* @__PURE__ */ t(T, { "aria-hidden": "true" }),
188
+ onClick: () => {
189
+ k((n) => !n), d(!1);
190
+ },
191
+ children: _ ? "固定侧边栏" : "收起侧边栏"
192
+ }
193
+ ) : null
194
+ ] })
195
+ ]
196
+ }
197
+ ) }) : null,
198
+ N && !i && M ? /* @__PURE__ */ t("div", { className: e.mask, "aria-hidden": "true", onClick: () => d(!1) }) : null,
199
+ /* @__PURE__ */ t(g.Content, { className: C ? `${e.content} ${e.contentCentered}` : e.content, children: /* @__PURE__ */ t("div", { className: e.contentInner, children: A ?? /* @__PURE__ */ t(q, {}) }) })
200
+ ] }),
201
+ E
202
+ ] });
203
+ };
204
+ export {
205
+ Ae as B,
206
+ qe as C,
207
+ Pe as a,
208
+ Re as f,
209
+ $e as i
210
+ };
@@ -0,0 +1,75 @@
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import { useId as g, isValidElement as H, cloneElement as E } from "react";
3
+ const F = "_field_elhdd_8", $ = "_labelRow_elhdd_19", w = "_label_elhdd_19", B = "_required_elhdd_35", D = "_optional_elhdd_40", I = "_extra_elhdd_46", R = "_hint_elhdd_53", S = "_error_elhdd_54", T = "_stack_elhdd_69", j = "_grid_elhdd_76", q = "_section_elhdd_91", A = "_sectionHead_elhdd_104", G = "_sectionHeading_elhdd_112", V = "_sectionTitle_elhdd_119", z = "_sectionDescription_elhdd_126", C = "_sectionExtra_elhdd_132", J = "_actions_elhdd_141", K = "_actionButtons_elhdd_150", L = "_actionNote_elhdd_157", e = {
4
+ field: F,
5
+ labelRow: $,
6
+ label: w,
7
+ required: B,
8
+ optional: D,
9
+ extra: I,
10
+ hint: R,
11
+ error: S,
12
+ stack: T,
13
+ grid: j,
14
+ section: q,
15
+ sectionHead: A,
16
+ sectionHeading: G,
17
+ sectionTitle: V,
18
+ sectionDescription: z,
19
+ sectionExtra: C,
20
+ actions: J,
21
+ actionButtons: K,
22
+ actionNote: L
23
+ }, P = ({ label: s, required: i, optional: n, extra: h, hint: u, error: o, span: k, bare: x, className: N, children: v }) => {
24
+ const f = g(), m = `${f}-label`, b = `${f}-note`, d = o != null && o !== !1 && o !== "", c = d ? o : u, p = c != null && c !== !1 && c !== "", t = !x && H(v) ? v : null;
25
+ let y = v;
26
+ if (t) {
27
+ const r = t.props, _ = {};
28
+ r["aria-label"] === void 0 && r["aria-labelledby"] === void 0 && (_["aria-labelledby"] = m), p && r["aria-describedby"] === void 0 && (_["aria-describedby"] = b), d && (r["aria-invalid"] === void 0 && (_["aria-invalid"] = !0), typeof t.type != "string" && r.validateStatus === void 0 && (_.validateStatus = "error")), y = E(t, _);
29
+ }
30
+ return /* @__PURE__ */ l(
31
+ "div",
32
+ {
33
+ className: N ? `${e.field} ${N}` : e.field,
34
+ "data-span": k,
35
+ "data-invalid": d ? "true" : void 0,
36
+ role: t ? void 0 : "group",
37
+ "aria-labelledby": t ? void 0 : m,
38
+ "aria-describedby": !t && p ? b : void 0,
39
+ children: [
40
+ /* @__PURE__ */ l("div", { className: e.labelRow, children: [
41
+ /* @__PURE__ */ l("span", { id: m, className: e.label, children: [
42
+ s,
43
+ i ? /* @__PURE__ */ a("span", { className: e.required, "aria-hidden": "true", children: "*" }) : null,
44
+ n && !i ? /* @__PURE__ */ a("span", { className: e.optional, children: "(可选)" }) : null
45
+ ] }),
46
+ h ? /* @__PURE__ */ a("span", { className: e.extra, children: h }) : null
47
+ ] }),
48
+ y,
49
+ p ? /* @__PURE__ */ a("span", { id: b, className: d ? e.error : e.hint, role: d ? "alert" : void 0, children: c }) : null
50
+ ]
51
+ }
52
+ );
53
+ }, Q = ({ children: s, className: i }) => /* @__PURE__ */ a("div", { className: i ? `${e.stack} ${i}` : e.stack, children: s }), U = ({ columns: s = 2, children: i }) => /* @__PURE__ */ a("div", { className: e.grid, style: { "--form-columns": s }, children: i }), W = ({ title: s, description: i, extra: n, children: h }) => {
54
+ const u = g();
55
+ return /* @__PURE__ */ l("section", { className: e.section, "aria-labelledby": s ? u : void 0, children: [
56
+ s || n ? /* @__PURE__ */ l("div", { className: e.sectionHead, children: [
57
+ /* @__PURE__ */ l("div", { className: e.sectionHeading, children: [
58
+ s ? /* @__PURE__ */ a("span", { id: u, className: e.sectionTitle, children: s }) : null,
59
+ i ? /* @__PURE__ */ a("span", { className: e.sectionDescription, children: i }) : null
60
+ ] }),
61
+ n ? /* @__PURE__ */ a("div", { className: e.sectionExtra, children: n }) : null
62
+ ] }) : null,
63
+ /* @__PURE__ */ a("div", { className: e.stack, children: h })
64
+ ] });
65
+ }, X = ({ children: s, note: i, sticky: n }) => /* @__PURE__ */ l("div", { className: e.actions, "data-sticky": n ? "true" : void 0, children: [
66
+ /* @__PURE__ */ a("div", { className: e.actionButtons, children: s }),
67
+ i ? /* @__PURE__ */ a("span", { className: e.actionNote, role: "status", children: i }) : null
68
+ ] });
69
+ export {
70
+ P as F,
71
+ X as a,
72
+ U as b,
73
+ W as c,
74
+ Q as d
75
+ };
@@ -0,0 +1,12 @@
1
+ import { jsxs as a, jsx as c } from "react/jsx-runtime";
2
+ import { IconSpin as i } from "@douyinfe/semi-icons";
3
+ const r = "_text_ug7q1_3", x = "_icon_ug7q1_31", t = {
4
+ text: r,
5
+ icon: x
6
+ }, p = ({ tone: e = "neutral", loading: s = !1, className: n, children: o }) => /* @__PURE__ */ a("span", { className: n ? `${t.text} ${n}` : t.text, "data-tone": e, children: [
7
+ s ? /* @__PURE__ */ c(i, { spin: !0, className: t.icon, "aria-hidden": "true" }) : null,
8
+ o
9
+ ] });
10
+ export {
11
+ p as S
12
+ };