@24city/web-console 0.3.1 → 0.3.3

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { A as s, a as o, c as r, b as t, h as n, j as i, k as l, m as u, o as c, p, q as S, s as d, t as m, i as C, d as f, v as P, x as g, l as A, n as L, r as E, y as F, z as R, B as T, e as h, f as x, C as B, D as b, E as y, u as N, g as O, w as _ } from "./chunks/logout-signal-CiD_zY5M.js";
2
- import { A as k, a as I, C as U, L as D, P as v, b as w, c as q, Q as W, R as K, S as Q, d as G, T as z, U as H, e as V, p as Y, f as j, g as X, h as Z, y as J } from "./chunks/upgrade-modal-BWnNve0z.js";
2
+ import { A as k, a as I, C as U, L as D, P as v, b as w, c as q, Q as W, R as K, S as Q, d as G, T as z, U as H, e as V, p as Y, f as j, g as X, h as Z, y as J } from "./chunks/upgrade-modal-DyPkV9OB.js";
3
3
  import { A as aa, a as ea, b as sa, E as oa, F as ra, P as ta, c as na, d as ia, U as la, e as ua, W as ca, f as pa, g as Sa, h as da, i as ma, j as Ca, k as fa, l as Pa, m as ga, n as Aa, o as La, p as Ea, q as Fa, r as Ra, s as Ta, t as ha, u as xa, v as Ba, w as ba, x as ya, y as Na, z as Oa, B as _a, C as Ma, D as ka, G as Ia, H as Ua, I as Da, J as va, K as wa, L as qa, M as Wa, N as Ka, O as Qa, Q as Ga } from "./chunks/wallet-badge-Dt8fv-Du.js";
4
4
  import { A as Ha } from "./chunks/auth-provider-CqiyTeOt.js";
5
5
  import { M as Ya, a as ja, S as Xa } from "./chunks/status-tag-BrLUhH6Z.js";
@@ -10,8 +10,8 @@ import { B as ce, C as pe, f as Se, a as de, i as me } from "./chunks/console-la
10
10
  import { C as fe, a as Pe, b as ge, F as Ae, c as Le, d as Ee, e as Fe, f as Re, g as Te, h as he, i as xe, j as Be, k as be, L as ye, M as Ne, S as Oe, l as _e, m as Me, n as ke, o as Ie, T as Ue, W as De, p as ve, w as we } from "./chunks/waterfall-Cmz0ZULQ.js";
11
11
  import { C as We } from "./chunks/color-mode-switch-BinpVuZ0.js";
12
12
  import { E as Qe, R as Ge, U as ze } from "./chunks/unsupported-browser-Dwq1mNRy.js";
13
- import { L as Ve } from "./chunks/link-button-giJEcTmG.js";
14
- import { N as je, S as Xe, a as Ze, T as Je } from "./chunks/text-link-BAKoHe5o.js";
13
+ import { L as Ve } from "./chunks/link-button-PqZcqU6s.js";
14
+ import { N as je, S as Xe, a as Ze, T as Je } from "./chunks/text-link-Ch_4QIkx.js";
15
15
  import { E as as, a as es, b as ss, F as os, c as rs, L as ts, d as ns, P as is, S as ls, e as us, T as cs } from "./chunks/page-YBG0dEN1.js";
16
16
  import { C as Ss, R as ds, c as ms, e as Cs, k as fs, l as Ps, p as gs, a as As, r as Ls, s as Es } from "./chunks/stale-build-DG-Tb2RA.js";
17
17
  import { C as Rs, u as Ts, a as hs, b as xs } from "./chunks/context-CaVim6ZO.js";
@@ -1,7 +1,7 @@
1
1
  import { C as r } from "../chunks/color-mode-switch-BinpVuZ0.js";
2
2
  import { E as e, R as t, U as l } from "../chunks/unsupported-browser-Dwq1mNRy.js";
3
- import { L as n } from "../chunks/link-button-giJEcTmG.js";
4
- import { N as p, S as g, a as i, T as E } from "../chunks/text-link-BAKoHe5o.js";
3
+ import { L as n } from "../chunks/link-button-PqZcqU6s.js";
4
+ import { N as p, S as g, a as i, T as E } from "../chunks/text-link-Ch_4QIkx.js";
5
5
  import { E as m, a as P, b as S, F as c, c as x, L as f, d as B, P as C, S as b, e as k, T as F } from "../chunks/page-YBG0dEN1.js";
6
6
  export {
7
7
  r as ColorModeSwitch,
@@ -1,8 +1,8 @@
1
- import type { AnchorHTMLAttributes, MouseEventHandler, ReactNode } from 'react';
1
+ import { type AnchorHTMLAttributes, type MouseEventHandler, type ReactNode } from 'react';
2
2
  export type LinkButtonTheme = 'solid' | 'light' | 'borderless' | 'outline';
3
3
  export type LinkButtonType = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
4
4
  export type LinkButtonSize = 'default' | 'small' | 'large';
5
- export interface LinkButtonProps {
5
+ export interface LinkButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type' | 'children' | 'className'> {
6
6
  href: string;
7
7
  /** `_blank` 时自动带 rel="noreferrer" */
8
8
  target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
@@ -15,15 +15,17 @@ export interface LinkButtonProps {
15
15
  size?: LinkButtonSize;
16
16
  /** 占满一行 */
17
17
  block?: boolean;
18
+ /** 只给图标、不给文字时是方形的图标按钮,这时必须给 aria-label */
18
19
  icon?: ReactNode;
19
20
  iconPosition?: 'left' | 'right';
20
21
  className?: string;
21
- 'aria-label'?: string;
22
22
  onClick?: MouseEventHandler<HTMLAnchorElement>;
23
23
  children?: ReactNode;
24
24
  }
25
25
  /**
26
26
  * 长得和 Semi 按钮一样的链接:Semi 的 Button 只渲染 button 元素,没有 href;去统一账号中心、下载安装包这类要新标签页打开、
27
27
  * 能右键复制地址的入口用它。套用 Semi 按钮的类名,主题、尺寸与真正的按钮完全一致。
28
+ *
29
+ * ref、事件和其余属性都转给 a 元素,可以直接包在 Tooltip、Popover 里当触发元素。
28
30
  */
29
- export declare const LinkButton: ({ href, target, rel, download, theme, type, size, block, icon, iconPosition, className, onClick, children, ...rest }: LinkButtonProps) => import("react").JSX.Element;
31
+ export declare const LinkButton: import("react").ForwardRefExoticComponent<LinkButtonProps & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,5 +1,5 @@
1
- import type { MouseEvent, ReactNode } from 'react';
2
- export interface TextLinkProps {
1
+ import { type HTMLAttributes, type MouseEvent, type ReactNode } from 'react';
2
+ export interface TextLinkProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'onClick'> {
3
3
  /** 没有 href 时是一个长得像链接的动作(例如“查看全部”),键盘可用 */
4
4
  href?: string;
5
5
  target?: string;
@@ -11,12 +11,15 @@ export interface TextLinkProps {
11
11
  /** danger 用危险色,warning 用警示色 */
12
12
  status?: 'danger' | 'warning';
13
13
  disabled?: boolean;
14
+ /** 加在最外层(Semi 的排版包装)上;其余属性、事件和 ref 都落在里面可聚焦的链接元素上 */
14
15
  className?: string;
15
- 'aria-label'?: string;
16
16
  children?: ReactNode;
17
17
  }
18
18
  /**
19
19
  * 文字链接:Semi 的 Typography 链接写法包一层,接受 href 或只接受 onClick(动作型链接,带键盘支持)。
20
20
  * 页面里的“查看全部”“换一批”这类轻操作用它;要像按钮的链接用 LinkButton。
21
+ *
22
+ * ref、事件和其余属性(aria-*、data-*、tabIndex……)都转给实际的链接元素(禁用时 Semi 把它渲染成 span),
23
+ * 所以可以直接包在 Tooltip、Popover、Popconfirm、Dropdown 里当触发元素:这些组件靠克隆子元素注入 ref 和事件来定位、开合。
21
24
  */
22
- export declare const TextLink: ({ href, target, rel, download, onClick, icon, status, disabled, className, children, ...rest }: TextLinkProps) => import("react").JSX.Element;
25
+ export declare const TextLink: import("react").ForwardRefExoticComponent<TextLinkProps & import("react").RefAttributes<HTMLElement>>;
package/dist/semi.js CHANGED
@@ -3,10 +3,15 @@ import "@douyinfe/semi-ui/react19-adapter";
3
3
  import { Modal as t, LocaleProvider as l } from "@douyinfe/semi-ui";
4
4
  import a from "@douyinfe/semi-ui/lib/es/locale/source/zh_CN";
5
5
  const r = { "aria-label": void 0 };
6
- t.defaultProps = { ...t.defaultProps, okButtonProps: { ...r }, cancelButtonProps: { ...r } };
7
- const P = (o) => ({ ...r, ...o }), n = ({ children: o }) => /* @__PURE__ */ e(l, { locale: a, children: o });
6
+ t.defaultProps = {
7
+ ...t.defaultProps,
8
+ centered: !0,
9
+ okButtonProps: { ...r },
10
+ cancelButtonProps: { ...r }
11
+ };
12
+ const n = (o) => ({ ...r, ...o }), P = ({ children: o }) => /* @__PURE__ */ e(l, { locale: a, children: o });
8
13
  export {
9
- n as ConsoleSemiProvider,
14
+ P as ConsoleSemiProvider,
10
15
  r as MODAL_BUTTON_PROPS,
11
- P as modalButtonProps
16
+ n as modalButtonProps
12
17
  };
package/dist/styles.css CHANGED
@@ -929,37 +929,25 @@
929
929
  font-variant-numeric: tabular-nums;
930
930
  }
931
931
  /* 套 Semi 按钮类名的链接:补上链接自己的默认样式差异(下划线、行内盒),其余全部来自 Semi 的按钮样式。 */
932
- ._linkButton_1i3vf_2,
933
- ._linkButton_1i3vf_2:hover,
934
- ._linkButton_1i3vf_2:focus,
935
- ._linkButton_1i3vf_2:active {
932
+ ._linkButton_vk9fy_2,
933
+ ._linkButton_vk9fy_2:hover,
934
+ ._linkButton_vk9fy_2:focus,
935
+ ._linkButton_vk9fy_2:active {
936
936
  box-sizing: border-box;
937
937
  text-decoration: none;
938
938
  }
939
939
 
940
- ._linkButton_1i3vf_2:focus-visible {
940
+ ._linkButton_vk9fy_2:focus-visible {
941
941
  outline: 2px solid var(--semi-color-primary-light-active);
942
942
  outline-offset: 1px;
943
943
  }
944
944
 
945
- ._icon_1i3vf_15 {
945
+ /* 图标固定 16px(主题让 Semi 图标跟随文字字号,按钮里的图标不跟);图标与文字的 8px 间距来自 Semi 的 .semi-button-content-left / -right。 */
946
+ ._icon_vk9fy_16 {
946
947
  display: inline-flex;
947
948
  align-items: center;
948
949
  font-size: 16px;
949
950
  }
950
-
951
- ._icon_1i3vf_15 + * {
952
- margin-left: 8px;
953
- }
954
-
955
- ._contentReverse_1i3vf_25 {
956
- flex-direction: row-reverse;
957
- }
958
-
959
- ._contentReverse_1i3vf_25 ._icon_1i3vf_15 + * {
960
- margin-right: 8px;
961
- margin-left: 0;
962
- }
963
951
  /*
964
952
  * 个人中心:整块内容在页面中间(最宽 1300px),左边 264px 身份卡片与分区菜单(吸顶),右边一整块白底面板,
965
953
  * 里面是分区标题和各段内容(段落平铺,不再各自成卡片)。面板与身份卡片同为 12px 圆角、同样的卡片投影,
@@ -2287,28 +2275,24 @@
2287
2275
  * 下半白底列推荐套餐的权益、黑色胶囊主按钮(带起步价)和“暂不升级”。颜色只用 Semi 色板变量。
2288
2276
  */
2289
2277
 
2290
- ._modal_19bot_6.semi-modal {
2291
- width: 400px;
2292
- max-width: calc(100vw - 32px);
2293
- }
2294
-
2295
- ._modal_19bot_6 .semi-modal-content {
2278
+ /* 宽度由组件的 width 属性给(Semi 把 className 挂在最外层包装上,写 .modal.semi-modal 命中不了);窄屏不超出视口由主题统一处理。 */
2279
+ ._modal_6pw0p_6 .semi-modal-content {
2296
2280
  overflow: hidden;
2297
2281
  padding: 0;
2298
2282
  border: none;
2299
2283
  border-radius: 16px;
2300
2284
  }
2301
2285
 
2302
- /* 只留关闭按钮:标题栏浮在插画右上角,不占高度。 */
2303
- ._modal_19bot_6 .semi-modal-header {
2286
+ /* 关闭按钮浮在插画右上角,不占高度。 */
2287
+ ._hero_6pw0p_15 ._close_6pw0p_15.semi-button {
2304
2288
  position: absolute;
2305
2289
  z-index: 2;
2306
2290
  top: 12px;
2307
2291
  right: 12px;
2308
- margin: 0;
2292
+ color: var(--semi-color-text-2);
2309
2293
  }
2310
2294
 
2311
- ._hero_19bot_27 {
2295
+ ._hero_6pw0p_15 {
2312
2296
  position: relative;
2313
2297
  display: flex;
2314
2298
  flex-direction: column;
@@ -2320,7 +2304,7 @@
2320
2304
  text-align: center;
2321
2305
  }
2322
2306
 
2323
- ._badge_19bot_39 {
2307
+ ._badge_6pw0p_35 {
2324
2308
  position: absolute;
2325
2309
  top: 16px;
2326
2310
  left: 16px;
@@ -2333,20 +2317,20 @@
2333
2317
  line-height: 22px;
2334
2318
  }
2335
2319
 
2336
- ._art_19bot_52 {
2320
+ ._art_6pw0p_48 {
2337
2321
  width: 150px;
2338
2322
  height: 150px;
2339
2323
  background: url('./assets/engine-hero-BaSSoV-3.webp') center / contain no-repeat;
2340
2324
  }
2341
2325
 
2342
- ._hero_19bot_27[data-art='crown'] ._art_19bot_52 {
2326
+ ._hero_6pw0p_15[data-art='crown'] ._art_6pw0p_48 {
2343
2327
  width: 128px;
2344
2328
  height: 128px;
2345
2329
  margin: 11px 0;
2346
2330
  background-image: url('./assets/upgrade-crown-Ci1IFoXi.webp');
2347
2331
  }
2348
2332
 
2349
- ._title_19bot_65 {
2333
+ ._title_6pw0p_61 {
2350
2334
  margin-top: 6px;
2351
2335
  color: rgb(var(--semi-grey-9));
2352
2336
  font-size: var(--app-font-size-h4);
@@ -2354,39 +2338,39 @@
2354
2338
  line-height: 28px;
2355
2339
  }
2356
2340
 
2357
- ._description_19bot_73 {
2341
+ ._description_6pw0p_69 {
2358
2342
  margin-top: 6px;
2359
2343
  color: var(--semi-color-text-1);
2360
2344
  font-size: var(--app-font-size-compact);
2361
2345
  line-height: 20px;
2362
2346
  }
2363
2347
 
2364
- ._body_19bot_80 {
2348
+ ._body_6pw0p_76 {
2365
2349
  display: flex;
2366
2350
  flex-direction: column;
2367
2351
  gap: 12px;
2368
2352
  padding: 20px 28px 16px;
2369
2353
  }
2370
2354
 
2371
- ._offer_19bot_87 {
2355
+ ._offer_6pw0p_83 {
2372
2356
  color: var(--semi-color-text-1);
2373
2357
  font-size: var(--app-font-size-compact);
2374
2358
  line-height: 20px;
2375
2359
  }
2376
2360
 
2377
- ._offerName_19bot_93 {
2361
+ ._offerName_6pw0p_89 {
2378
2362
  margin: 0 2px;
2379
2363
  color: rgb(var(--app-brand-6));
2380
2364
  font-weight: 600;
2381
2365
  }
2382
2366
 
2383
- ._lines_19bot_99 {
2367
+ ._lines_6pw0p_95 {
2384
2368
  display: flex;
2385
2369
  flex-direction: column;
2386
2370
  gap: 8px;
2387
2371
  }
2388
2372
 
2389
- ._line_19bot_99 {
2373
+ ._line_6pw0p_95 {
2390
2374
  display: flex;
2391
2375
  align-items: center;
2392
2376
  gap: 8px;
@@ -2395,7 +2379,7 @@
2395
2379
  line-height: 20px;
2396
2380
  }
2397
2381
 
2398
- ._check_19bot_114 {
2382
+ ._check_6pw0p_110 {
2399
2383
  display: inline-flex;
2400
2384
  width: 16px;
2401
2385
  height: 16px;
@@ -2408,7 +2392,7 @@
2408
2392
  font-size: 12px;
2409
2393
  }
2410
2394
 
2411
- ._body_19bot_80 ._cta_19bot_127.semi-button {
2395
+ ._body_6pw0p_76 ._cta_6pw0p_123.semi-button {
2412
2396
  border-radius: 999px;
2413
2397
  height: 42px;
2414
2398
  margin-top: 6px;
@@ -2419,13 +2403,13 @@
2419
2403
  font-weight: 600;
2420
2404
  }
2421
2405
 
2422
- ._body_19bot_80 ._cta_19bot_127.semi-button.semi-button-light:hover,
2423
- ._body_19bot_80 ._cta_19bot_127.semi-button.semi-button-light:active {
2406
+ ._body_6pw0p_76 ._cta_6pw0p_123.semi-button.semi-button-light:hover,
2407
+ ._body_6pw0p_76 ._cta_6pw0p_123.semi-button.semi-button-light:active {
2424
2408
  background: var(--app-strong-bg-hover);
2425
2409
  color: var(--app-strong-text);
2426
2410
  }
2427
2411
 
2428
- ._ctaPrice_19bot_144 {
2412
+ ._ctaPrice_6pw0p_140 {
2429
2413
  margin-left: 8px;
2430
2414
  padding: 0 8px;
2431
2415
  border-radius: 10px;
@@ -2435,7 +2419,7 @@
2435
2419
  line-height: 20px;
2436
2420
  }
2437
2421
 
2438
- ._ownerOnly_19bot_154 {
2422
+ ._ownerOnly_6pw0p_150 {
2439
2423
  margin-top: 6px;
2440
2424
  color: var(--semi-color-text-2);
2441
2425
  font-size: var(--app-font-size-compact);
@@ -2443,12 +2427,12 @@
2443
2427
  text-align: center;
2444
2428
  }
2445
2429
 
2446
- ._body_19bot_80 ._later_19bot_162.semi-button.semi-button-borderless {
2430
+ ._body_6pw0p_76 ._later_6pw0p_158.semi-button.semi-button-borderless {
2447
2431
  color: var(--semi-color-text-2);
2448
2432
  font-weight: 400;
2449
2433
  }
2450
2434
 
2451
- ._body_19bot_80 ._later_19bot_162.semi-button.semi-button-borderless:hover {
2435
+ ._body_6pw0p_76 ._later_6pw0p_158.semi-button.semi-button-borderless:hover {
2452
2436
  background: transparent;
2453
2437
  color: var(--semi-color-text-1);
2454
2438
  }
@@ -4773,6 +4757,12 @@ body .semi-button-size-small {
4773
4757
  border-radius: var(--app-radius-chip);
4774
4758
  }
4775
4759
 
4760
+ /* Semi 的 circle 属性只加类名 .semi-button-circle,2.104 的样式表里没有对应的规则,按钮还是圆角方块;这里补上。
4761
+ * 只给图标的按钮才是正圆,带文字的 circle 按钮是胶囊形。 */
4762
+ body .semi-button-circle {
4763
+ border-radius: var(--semi-border-radius-full);
4764
+ }
4765
+
4776
4766
  body .semi-button-primary.semi-button-solid:not(.semi-button-disabled) {
4777
4767
  box-shadow: 0 2px 6px rgba(var(--app-brand-6), 0.24);
4778
4768
  }
@@ -4784,6 +4774,25 @@ body .semi-button-primary-disabled.semi-button-solid:hover {
4784
4774
  color: var(--app-primary-disabled-text);
4785
4775
  }
4786
4776
 
4777
+ /* ---------- 文字排版:标题和加粗用 500(Semi 默认 600) ---------- */
4778
+
4779
+ /* 规范第 4 节:标题、选中项、强调数值 500。Semi 的 Title 六级和 Text strong 都是 600,卡片、弹窗、抽屉的标题里面也是一个 Title,
4780
+ * 所以写在外层类上的字重不起作用,要落到 Title 自己身上。显式传 weight 的标题不受影响(Semi 的 weight 类多一个类名,优先级更高)。 */
4781
+ body .semi-typography-h1.semi-typography,
4782
+ body .semi-typography-h2.semi-typography,
4783
+ body .semi-typography-h3.semi-typography,
4784
+ body .semi-typography-h4.semi-typography,
4785
+ body .semi-typography-h5.semi-typography,
4786
+ body .semi-typography-h6.semi-typography,
4787
+ body .semi-typography strong {
4788
+ font-weight: 500;
4789
+ }
4790
+
4791
+ /* 链接靠颜色区分,字重和周围的文字一样(Semi 默认 600,比标题还粗)。 */
4792
+ body .semi-typography.semi-typography-link {
4793
+ font-weight: 400;
4794
+ }
4795
+
4787
4796
  /* ---------- 图标:跟随所在文字的字号(Semi 默认固定 16px,Arco 时代是 1em,元信息行里的小图标才不会比字大) ---------- */
4788
4797
 
4789
4798
  body .semi-icon-default {
@@ -4854,14 +4863,32 @@ body .semi-radio-buttonRadioGroup {
4854
4863
  background-color: var(--app-segment-track);
4855
4864
  }
4856
4865
 
4866
+ /* Semi 默认每一项都是 12px、600 字重、左右 16px:未选中的反而比选中的粗,字也比别的控件小一号。
4867
+ * 这里按规范来:未选中 400、选中 500;字号跟控件走(默认和大号 14px,小号 12px);左右内边距收到 12px(大号 16px)。 */
4857
4868
  body .semi-radio-addon-buttonRadio {
4869
+ padding: 4px 12px;
4858
4870
  border-radius: var(--app-radius-chip);
4871
+ font-size: var(--app-font-size-body);
4872
+ font-weight: 400;
4859
4873
  transition:
4860
4874
  background-color var(--app-duration) var(--app-ease),
4861
4875
  color var(--app-duration) var(--app-ease),
4862
4876
  box-shadow var(--app-duration) var(--app-ease);
4863
4877
  }
4864
4878
 
4879
+ body .semi-radio-addon-buttonRadio-small {
4880
+ padding: 2px 12px;
4881
+ font-size: var(--app-font-size-caption);
4882
+ }
4883
+
4884
+ body .semi-radio-addon-buttonRadio-large {
4885
+ padding: 6px 16px;
4886
+ }
4887
+
4888
+ body .semi-radio-addon-buttonRadio-hover {
4889
+ font-weight: 400;
4890
+ }
4891
+
4865
4892
  body .semi-radio-addon-buttonRadio-checked {
4866
4893
  background: var(--semi-color-bg-1);
4867
4894
  box-shadow: var(--app-shadow-raised);
@@ -4912,10 +4939,40 @@ body .semi-page-item-active:hover {
4912
4939
 
4913
4940
  /* ---------- 标签页:粗圆角指示条 ---------- */
4914
4941
 
4915
- body .semi-tabs-bar-line .semi-tabs-tab-active::after,
4916
- body .semi-tabs-bar-line .semi-tabs-tab:hover::after {
4942
+ /* Semi 用页签自己的 border-bottom 画下划线(2px 直角)。这里把那条边留着占位但不上色,另画一条 3px 的圆角指示条压在同一位置:
4943
+ * 选中是主色,悬停和按下是浅灰。页签的高度和文字位置不变。 */
4944
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab,
4945
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab:hover,
4946
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab:active,
4947
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab-active,
4948
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab-active:hover {
4949
+ border-bottom-color: transparent;
4950
+ }
4951
+
4952
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab::after {
4953
+ position: absolute;
4954
+ right: 0;
4955
+ bottom: -2px;
4956
+ left: 0;
4917
4957
  height: 3px;
4918
4958
  border-radius: 3px;
4959
+ background-color: transparent;
4960
+ content: '';
4961
+ transition: background-color var(--app-duration) var(--app-ease);
4962
+ }
4963
+
4964
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab:hover::after {
4965
+ background-color: var(--semi-color-fill-0);
4966
+ }
4967
+
4968
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab:active::after {
4969
+ background-color: var(--semi-color-fill-1);
4970
+ }
4971
+
4972
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab-active::after,
4973
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab-active:hover::after,
4974
+ body .semi-tabs-bar-line.semi-tabs-bar-top .semi-tabs-tab-active:active::after {
4975
+ background-color: var(--semi-color-primary);
4919
4976
  }
4920
4977
 
4921
4978
  body .semi-tabs-bar .semi-tabs-tab {
@@ -4947,10 +5004,35 @@ body .semi-modal-title {
4947
5004
  font-weight: 500;
4948
5005
  }
4949
5006
 
5007
+ /*
5008
+ * Semi 给脚部里所有的按钮都加 12px 左外边距(后代选择器):产品自己排版的脚部(包一层,flex + gap)里每个按钮都被多推 12px,
5009
+ * 第一个按钮也被缩进。改成和 Arco 时一样只管两种情况,相邻两个按钮之间留 12px:
5010
+ * 1. Semi 默认的脚部:一层没有类名的 div(footerFill 时是 .semi-modal-footerfill)包着“取消”“确定”;
5011
+ * 2. 直接放进 footer 的按钮:footer={<><Button /><Button /></>}。
5012
+ * 自己包了一层的脚部,间距完全由产品自己的 gap 决定。
5013
+ */
5014
+ body .semi-modal-footer .semi-button {
5015
+ margin-left: 0;
5016
+ }
5017
+
5018
+ body .semi-modal-footer > .semi-button + .semi-button,
5019
+ body .semi-modal-footer > div[class=''] > .semi-button + .semi-button,
5020
+ body .semi-modal-footer > .semi-modal-footerfill > .semi-button + .semi-button {
5021
+ margin-left: 12px;
5022
+ }
5023
+
4950
5024
  body .semi-sidesheet-header {
4951
5025
  border-bottom-color: var(--app-border-1);
4952
5026
  }
4953
5027
 
5028
+ /*
5029
+ * 没有标题也没有关闭按钮时,Semi 仍然渲染一个空头部(上下内边距 24px + 20px),抽屉顶上平白空出 44px;
5030
+ * 内层透明、自己画面板的抽屉(如 AdFlow 的素材详情)会在这里露出遮罩。空的就不显示。
5031
+ */
5032
+ body .semi-sidesheet-header:empty {
5033
+ display: none;
5034
+ }
5035
+
4954
5036
  body .semi-sidesheet-title {
4955
5037
  color: var(--semi-color-text-0);
4956
5038
  font-size: var(--app-font-size-h6);
@@ -1,9 +1,9 @@
1
- import { readFileSync as d, readdirSync as $, statSync as v } from "node:fs";
2
- import { relative as b, join as x } from "node:path";
3
- import { D as _, F as I, B as N } from "../chunks/scale-smFifpMm.js";
4
- const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
5
- peerDependencies: O
6
- }, D = /<(button|input|select|textarea|option|label|form|table|thead|tbody|tr|td|th|details|summary|dialog|img|a|ul|ol|li|dl|dt|dd|h[1-6]|p)(\s|>|\/)/, R = [
1
+ import { readFileSync as f, readdirSync as L, statSync as _ } from "node:fs";
2
+ import { relative as y, join as v } from "node:path";
3
+ import { D as x, F as N, B as O } from "../chunks/scale-smFifpMm.js";
4
+ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
5
+ peerDependencies: C
6
+ }, R = /<(button|input|select|textarea|option|label|form|table|thead|tbody|tr|td|th|details|summary|dialog|img|a|ul|ol|li|dl|dt|dd|h[1-6]|p)(\s|>|\/)/, T = [
7
7
  "lucide-react",
8
8
  "@nuwa/customer-ui",
9
9
  "@nuwa/customer-shell",
@@ -15,43 +15,49 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
15
15
  ".arco-",
16
16
  "@douyinfe/semi-ui/dist/css",
17
17
  "theme-mode"
18
- ], T = ["--semi-", "--app-"], w = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b/, F = /\b(?:rgba?|hsla?)\((?!\s*var\()/, P = new RegExp(`(?:^|[\\s{;'"])(${T.map((s) => s.replace(/-/g, "\\-")).join("|")})[a-z0-9_-]*\\s*['"]?\\s*:`, "m"), h = (s) => $(s).flatMap((i) => {
19
- const e = x(s, i);
20
- return v(e).isDirectory() ? h(e) : [e];
21
- }), S = (s) => /\.test\.(ts|tsx)$/.test(s) || s.startsWith("test/") || s.endsWith(".d.ts"), Z = ({ sourceRoot: s, exclude: i = S }) => {
22
- const e = [], r = h(s).map((o) => ({ path: o, file: b(s, o) })).filter(({ file: o }) => !i(o));
18
+ ], w = ["--semi-", "--app-"], F = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b/, P = /\b(?:rgba?|hsla?)\((?!\s*var\()/, k = new RegExp(`(?:^|[\\s{;'"])(${w.map((s) => s.replace(/-/g, "\\-")).join("|")})[a-z0-9_-]*\\s*['"]?\\s*:`, "m"), W = /<IconSpin\b([^>]*)>/g, j = (s) => {
19
+ for (const i of s.matchAll(W))
20
+ if (!/(?:^|\s)spin(?=[\s=/]|$)/.test(i[1])) return i[0];
21
+ return null;
22
+ }, h = (s) => L(s).flatMap((i) => {
23
+ const e = v(s, i);
24
+ return _(e).isDirectory() ? h(e) : [e];
25
+ }), S = (s) => /\.test\.(ts|tsx)$/.test(s) || s.startsWith("test/") || s.endsWith(".d.ts"), X = ({ sourceRoot: s, exclude: i = S }) => {
26
+ const e = [], r = h(s).map((o) => ({ path: o, file: y(s, o) })).filter(({ file: o }) => !i(o));
23
27
  for (const { path: o, file: t } of r) {
24
28
  const n = t.endsWith(".tsx");
25
29
  if (!/\.(tsx?|css)$/.test(t)) continue;
26
- const c = d(o, "utf8");
30
+ const c = f(o, "utf8");
27
31
  if (n) {
28
- const m = c.match(D);
32
+ const m = c.match(R);
29
33
  m && e.push({ file: t, rule: "raw-element", detail: `应改用 Semi 组件,而不是 ${m[0].trim()}` }), /className="/.test(c) && e.push({ file: t, rule: "class-string", detail: "className 应引用 CSS Module,不写工具类字符串" });
34
+ const g = j(c);
35
+ g && e.push({ file: t, rule: "static-spinner", detail: `${g} 不会转:Semi 的 IconSpin 要加 spin` });
30
36
  }
31
- for (const m of R)
37
+ for (const m of T)
32
38
  c.includes(m) && e.push({ file: t, rule: "forbidden-import", detail: `不应引用 ${m}` });
33
- const a = c.match(w);
39
+ const a = c.match(F);
34
40
  a && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${a[0]}` });
35
- const u = c.match(F);
41
+ const u = c.match(P);
36
42
  u && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${u[0]}` });
37
- const E = c.match(P);
43
+ const E = c.match(k);
38
44
  E && e.push({ file: t, rule: "reserved-variable", detail: `不得声明主题变量 ${E[1]}…,品牌主色只能通过 runtime-config 的 brand.primaryColor 设置` });
39
45
  }
40
46
  return e;
41
- }, k = ["@douyinfe/semi-ui", "@douyinfe/semi-icons", "@douyinfe/semi-illustrations"], W = C.peerDependencies, f = W["@douyinfe/semi-ui"], K = (s) => {
47
+ }, M = ["@douyinfe/semi-ui", "@douyinfe/semi-icons", "@douyinfe/semi-illustrations"], z = D.peerDependencies, d = z["@douyinfe/semi-ui"], q = (s) => {
42
48
  var r, o;
43
- const i = JSON.parse(d(s, "utf8")), e = [];
44
- for (const t of k) {
49
+ const i = JSON.parse(f(s, "utf8")), e = [];
50
+ for (const t of M) {
45
51
  const n = ((r = i.dependencies) == null ? void 0 : r[t]) ?? ((o = i.devDependencies) == null ? void 0 : o[t]);
46
- !(t === "@douyinfe/semi-ui" || n !== void 0) || n === f || e.push({
52
+ !(t === "@douyinfe/semi-ui" || n !== void 0) || n === d || e.push({
47
53
  file: "package.json",
48
54
  rule: "semi-version",
49
- detail: n ? `${t} 必须精确声明为 ${f},现在是 ${n}` : `必须声明 ${t} ${f}`
55
+ detail: n ? `${t} 必须精确声明为 ${d},现在是 ${n}` : `必须声明 ${t} ${d}`
50
56
  });
51
57
  }
52
58
  return e;
53
- }, U = (s) => {
54
- const i = d(s, "utf8").replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g, ""), e = /import\s*\{[^}]*\bsemiCssLayer\b[^}]*\}\s*from\s*['"]@24city\/web-console\/vite['"]/.test(i), r = /\bsemiCssLayer\s*\(\s*\)/.test(i);
59
+ }, G = (s) => {
60
+ const i = f(s, "utf8").replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g, ""), e = /import\s*\{[^}]*\bsemiCssLayer\b[^}]*\}\s*from\s*['"]@24city\/web-console\/vite['"]/.test(i), r = /\bsemiCssLayer\s*\(\s*\)/.test(i);
55
61
  return e && r ? [] : [
56
62
  {
57
63
  file: "vite.config.ts",
@@ -59,38 +65,38 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
59
65
  detail: "plugins 里要加 semiCssLayer()(import { semiCssLayer } from '@24city/web-console/vite'),把 Semi 的样式放进 semi 层"
60
66
  }
61
67
  ];
62
- }, g = [...Object.values(I), ..._], A = Object.values(N), y = (s) => s.replace(/\/\*[\s\S]*?\*\//g, (i) => i.replace(/[^\n]/g, " ")), p = (s, i) => s.slice(0, i).split(`
63
- `).length, L = (s, i) => h(s).map((e) => ({ path: e, file: b(s, e) })).filter(({ file: e }) => e.endsWith(".css") && !i(e)), X = ({ sourceRoot: s, exclude: i = S }) => {
68
+ }, A = [...Object.values(N), ...x], b = Object.values(O), $ = (s) => s.replace(/\/\*[\s\S]*?\*\//g, (i) => i.replace(/[^\n]/g, " ")), p = (s, i) => s.slice(0, i).split(`
69
+ `).length, I = (s, i) => h(s).map((e) => ({ path: e, file: y(s, e) })).filter(({ file: e }) => e.endsWith(".css") && !i(e)), H = ({ sourceRoot: s, exclude: i = S }) => {
64
70
  const e = [];
65
- for (const { path: r, file: o } of L(s, i)) {
66
- const t = y(d(r, "utf8"));
71
+ for (const { path: r, file: o } of I(s, i)) {
72
+ const t = $(f(r, "utf8"));
67
73
  for (const n of t.matchAll(/font-size\s*:\s*(\d+(?:\.\d+)?)px/g))
68
- g.includes(Number(n[1])) || e.push({
74
+ A.includes(Number(n[1])) || e.push({
69
75
  file: o,
70
76
  line: p(t, n.index),
71
77
  rule: "font-size-scale",
72
- detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...g].sort((l, c) => l - c).join("、")})`
78
+ detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...A].sort((l, c) => l - c).join("、")})`
73
79
  });
74
80
  for (const n of t.matchAll(/@media[^{]*/g))
75
81
  for (const l of n[0].matchAll(/(min|max)-width\s*:\s*(\d+(?:\.\d+)?)px/g))
76
- A.includes(Number(l[2])) || e.push({
82
+ b.includes(Number(l[2])) || e.push({
77
83
  file: o,
78
84
  line: p(t, n.index),
79
85
  rule: "breakpoint",
80
- detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${A.join("、")})`
86
+ detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${b.join("、")})`
81
87
  });
82
88
  }
83
89
  return e;
84
- }, j = /(?:^|[\s>+~])(?::global\(\s*)?\.(semi-[A-Za-z0-9-]+)/, M = /:not\((?:[^()]|\([^()]*\))*\)/g, q = ({ sourceRoot: s, exclude: i = S }) => {
90
+ }, B = /(?:^|[\s>+~])(?::global\(\s*)?\.(semi-[A-Za-z0-9-]+)/, V = /:not\((?:[^()]|\([^()]*\))*\)/g, J = ({ sourceRoot: s, exclude: i = S }) => {
85
91
  const e = [];
86
- for (const { path: r, file: o } of L(s, i)) {
87
- const t = y(d(r, "utf8"));
92
+ for (const { path: r, file: o } of I(s, i)) {
93
+ const t = $(f(r, "utf8"));
88
94
  for (const n of t.matchAll(/([^{}]+)\{/g)) {
89
95
  const l = n[1];
90
96
  if (l.trimStart().startsWith("@")) continue;
91
97
  let c = 0;
92
98
  for (const a of l.split(",")) {
93
- const u = a.replace(M, "").trim().match(j);
99
+ const u = a.replace(V, "").trim().match(B);
94
100
  u && e.push({
95
101
  file: o,
96
102
  line: p(t, n.index + c + (a.length - a.trimStart().length)),
@@ -103,16 +109,16 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
103
109
  return e;
104
110
  };
105
111
  export {
106
- A as ALLOWED_BREAKPOINTS,
107
- g as ALLOWED_FONT_SIZES,
108
- f as EXPECTED_SEMI_VERSION,
109
- R as FORBIDDEN_SNIPPETS,
110
- D as RAW_ELEMENT_PATTERN,
111
- T as RESERVED_VARIABLE_PREFIXES,
112
- k as SEMI_PACKAGES,
113
- X as checkDesignScale,
114
- U as checkSemiCssLayer,
115
- q as checkSemiInternals,
116
- K as checkSemiVersion,
117
- Z as checkUiLibraryUsage
112
+ b as ALLOWED_BREAKPOINTS,
113
+ A as ALLOWED_FONT_SIZES,
114
+ d as EXPECTED_SEMI_VERSION,
115
+ T as FORBIDDEN_SNIPPETS,
116
+ R as RAW_ELEMENT_PATTERN,
117
+ w as RESERVED_VARIABLE_PREFIXES,
118
+ M as SEMI_PACKAGES,
119
+ H as checkDesignScale,
120
+ G as checkSemiCssLayer,
121
+ J as checkSemiInternals,
122
+ q as checkSemiVersion,
123
+ X as checkUiLibraryUsage
118
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24city/web-console",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "24.city 产品用户端的界面底座:Semi Design 主题与设计变量、控制台外壳、账号与会员界面、列表与数据组件、界面规范与守卫",
5
5
  "license": "MIT",
6
6
  "type": "module",