@aviala-design/spiral 2.6.2 → 2.7.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.
@@ -48,6 +48,14 @@
48
48
  }
49
49
  ],
50
50
  "Checkbox": [
51
+ {
52
+ "version": "2.7.0",
53
+ "sections": {
54
+ "Fixed": [
55
+ "半选(`indeterminate`)时内部标记未居中:勾选 SVG 在 `opacity: 0` 下仍占 flex 布局宽度,现改为半选态隐藏勾选图标并将 indicator 绝对铺满"
56
+ ]
57
+ }
58
+ },
51
59
  {
52
60
  "version": "2.5.0",
53
61
  "sections": {
@@ -295,6 +303,17 @@
295
303
  }
296
304
  }
297
305
  ],
306
+ "Progress": [
307
+ {
308
+ "version": "2.7.0",
309
+ "sections": {
310
+ "Changed": [
311
+ "对齐 Figma Progress(589:55818):条形高度改为 6 / 8px(`default` / `big`),轨道使用 `control-normal-lightbackground-1` 且去掉描边",
312
+ "环形进度半径改为「直径一半 − stroke/2」,轨道按 `type` 使用对应浅色 / 主题色"
313
+ ]
314
+ }
315
+ }
316
+ ],
298
317
  "ScrollPicker": [
299
318
  {
300
319
  "version": "2.6.1",
@@ -307,6 +326,15 @@
307
326
  }
308
327
  ],
309
328
  "SegmentatorGroup": [
329
+ {
330
+ "version": "2.7.0",
331
+ "sections": {
332
+ "Changed": [
333
+ "nested 模式轨道 Hover 使用 `segmentator-bg-hover`(filled-hover);项级 Hover/Active 仍独立",
334
+ "共享 elevation `BasicShadow-Level4WithLine` 发丝线透明度调整为 18%"
335
+ ]
336
+ }
337
+ },
310
338
  {
311
339
  "version": "2.6.1",
312
340
  "sections": {
@@ -393,6 +421,23 @@
393
421
  }
394
422
  }
395
423
  ],
424
+ "Table": [
425
+ {
426
+ "version": "2.7.0",
427
+ "sections": {
428
+ "Added": [
429
+ "`Table` `stickyHeader`:表头在表格滚动区域内吸顶",
430
+ "`TableCell` `caption`:主文案下方次要说明",
431
+ "`TableCell` `iconPlace` / `content=\"icon-place+text\"`:带形底的图标位 + 文案布局",
432
+ "`TableCell` `grabber`:可选前置拖拽/把手控件",
433
+ "`TableHead` `actions` / `checkboxProps`:表头操作区与全选 Checkbox 配置"
434
+ ],
435
+ "Changed": [
436
+ "单元格改为网格边框与表头底色 token(含 `--table-head-bg`、非对称左右内边距等)"
437
+ ]
438
+ }
439
+ }
440
+ ],
396
441
  "TimePickerField": [
397
442
  {
398
443
  "version": "2.6.1",
package/dist/index.cjs CHANGED
@@ -3061,9 +3061,9 @@ var Progress = (0, import_react21.forwardRef)(
3061
3061
  const resolvedShape = shape ?? "bar";
3062
3062
  const displayLabel = label ?? `${Math.round(percent)}%`;
3063
3063
  const diameter = resolvedSize === "big" ? 24 : 16;
3064
- const radius = diameter / 2;
3064
+ const center = diameter / 2;
3065
3065
  const stroke = 2;
3066
- const normalizedRadius = radius - stroke;
3066
+ const normalizedRadius = center - stroke / 2;
3067
3067
  const circumference = normalizedRadius * 2 * Math.PI;
3068
3068
  const strokeDashoffset = circumference - percent / 100 * circumference;
3069
3069
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -3109,17 +3109,17 @@ var Progress = (0, import_react21.forwardRef)(
3109
3109
  "svg",
3110
3110
  {
3111
3111
  className: "aviala-progress__ring",
3112
- width: radius * 2,
3113
- height: radius * 2,
3114
- viewBox: `0 0 ${radius * 2} ${radius * 2}`,
3112
+ width: diameter,
3113
+ height: diameter,
3114
+ viewBox: `0 0 ${diameter} ${diameter}`,
3115
3115
  "aria-hidden": true,
3116
3116
  children: [
3117
3117
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3118
3118
  "circle",
3119
3119
  {
3120
3120
  className: "aviala-progress__ring-track",
3121
- cx: radius,
3122
- cy: radius,
3121
+ cx: center,
3122
+ cy: center,
3123
3123
  r: normalizedRadius,
3124
3124
  fill: "none",
3125
3125
  strokeWidth: stroke
@@ -3129,15 +3129,15 @@ var Progress = (0, import_react21.forwardRef)(
3129
3129
  "circle",
3130
3130
  {
3131
3131
  className: "aviala-progress__ring-fill",
3132
- cx: radius,
3133
- cy: radius,
3132
+ cx: center,
3133
+ cy: center,
3134
3134
  r: normalizedRadius,
3135
3135
  fill: "none",
3136
3136
  strokeWidth: stroke,
3137
3137
  strokeDasharray: `${circumference} ${circumference}`,
3138
3138
  strokeDashoffset,
3139
3139
  strokeLinecap: "round",
3140
- transform: `rotate(-90 ${radius} ${radius})`
3140
+ transform: `rotate(-90 ${center} ${center})`
3141
3141
  }
3142
3142
  )
3143
3143
  ]
@@ -11721,12 +11721,13 @@ CardBottom.displayName = "CardBottom";
11721
11721
  var import_react66 = require("react");
11722
11722
  var import_jsx_runtime63 = require("react/jsx-runtime");
11723
11723
  var Table = (0, import_react66.forwardRef)(
11724
- ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
11724
+ ({ className, stickyHeader = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
11725
11725
  "div",
11726
11726
  {
11727
11727
  ref,
11728
11728
  role: "table",
11729
11729
  className: cn("aviala-table", className),
11730
+ "data-sticky-header": stickyHeader ? "true" : void 0,
11730
11731
  ...props,
11731
11732
  children
11732
11733
  }
@@ -11747,23 +11748,9 @@ var TableRow = (0, import_react66.forwardRef)(
11747
11748
  )
11748
11749
  );
11749
11750
  TableRow.displayName = "TableRow";
11750
- var TableHead = (0, import_react66.forwardRef)(
11751
- ({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
11752
- "div",
11753
- {
11754
- ref,
11755
- role: "columnheader",
11756
- className: cn("aviala-table-head", className),
11757
- "data-content": content,
11758
- ...props,
11759
- children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "caption", as: "span", children }) : children
11760
- }
11761
- )
11762
- );
11763
- TableHead.displayName = "TableHead";
11764
- function renderCellIcon(node) {
11751
+ function renderCellIcon(node, sized = true) {
11765
11752
  if (!node) return null;
11766
- const content = (0, import_react66.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react66.cloneElement)(node, {
11753
+ const content = sized && (0, import_react66.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react66.cloneElement)(node, {
11767
11754
  width: 16,
11768
11755
  height: 16,
11769
11756
  className: cn(
@@ -11773,17 +11760,64 @@ function renderCellIcon(node) {
11773
11760
  }) : node;
11774
11761
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__icon", children: content });
11775
11762
  }
11763
+ function renderTextBlock(text, caption) {
11764
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "aviala-table-cell__text", children: [
11765
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children: text }),
11766
+ caption != null && caption !== false ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "caption", as: "span", className: "aviala-table-cell__caption", children: caption }) : null
11767
+ ] });
11768
+ }
11769
+ function renderActions(actions) {
11770
+ if (actions == null) return null;
11771
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aviala-table-cell__actions", children: actions });
11772
+ }
11773
+ function renderCellBody(main, actions) {
11774
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "aviala-table-cell__body", children: [
11775
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__main", children: main }),
11776
+ renderActions(actions)
11777
+ ] });
11778
+ }
11779
+ var TableHead = (0, import_react66.forwardRef)(
11780
+ ({ className, content = "text", actions, checkboxProps, children, ...props }, ref) => {
11781
+ const renderBody = () => {
11782
+ if (content === "checkbox") {
11783
+ return children ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Checkbox, { ...checkboxProps });
11784
+ }
11785
+ if (children != null) {
11786
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11787
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__main", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children }) : children }),
11788
+ renderActions(actions)
11789
+ ] });
11790
+ }
11791
+ return null;
11792
+ };
11793
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
11794
+ "div",
11795
+ {
11796
+ ref,
11797
+ role: "columnheader",
11798
+ className: cn("aviala-table-head", className),
11799
+ "data-content": content,
11800
+ ...props,
11801
+ children: renderBody()
11802
+ }
11803
+ );
11804
+ }
11805
+ );
11806
+ TableHead.displayName = "TableHead";
11776
11807
  var TableCell = (0, import_react66.forwardRef)(
11777
11808
  ({
11778
11809
  className,
11779
11810
  content = "text",
11780
11811
  icon,
11812
+ iconPlace,
11781
11813
  text,
11814
+ caption,
11782
11815
  people,
11783
11816
  badge,
11784
11817
  badgeLabel,
11785
11818
  switchProps,
11786
11819
  actions,
11820
+ grabber,
11787
11821
  checkboxProps,
11788
11822
  children,
11789
11823
  ...props
@@ -11793,25 +11827,57 @@ var TableCell = (0, import_react66.forwardRef)(
11793
11827
  switch (content) {
11794
11828
  case "checkbox":
11795
11829
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Checkbox, { ...checkboxProps });
11830
+ case "switch":
11831
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Switch, { ...switchProps });
11832
+ case "action":
11833
+ return renderActions(actions);
11796
11834
  case "icon+text":
11797
11835
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11798
- renderCellIcon(icon),
11799
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children: text }) })
11836
+ grabber,
11837
+ renderCellBody(
11838
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11839
+ renderCellIcon(icon),
11840
+ renderTextBlock(text, caption)
11841
+ ] }),
11842
+ actions
11843
+ )
11844
+ ] });
11845
+ case "icon-place+text":
11846
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11847
+ grabber,
11848
+ renderCellBody(
11849
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11850
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__icon-place", children: iconPlace ?? renderCellIcon(icon, false) ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { content: "text", level: "text", lineHeightFix: false, children: "A" }) }),
11851
+ renderTextBlock(text, caption)
11852
+ ] }),
11853
+ actions
11854
+ )
11800
11855
  ] });
11801
11856
  case "people":
11802
11857
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11803
- people ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { content: "text", level: "text", children: "A" }),
11804
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children: text }) })
11858
+ grabber,
11859
+ renderCellBody(
11860
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11861
+ people ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { content: "text", level: "text", lineHeightFix: false, children: "A" }),
11862
+ renderTextBlock(text, caption)
11863
+ ] }),
11864
+ actions
11865
+ )
11805
11866
  ] });
11806
11867
  case "badge":
11807
- return badge ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" });
11808
- case "switch":
11809
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Switch, { ...switchProps });
11810
- case "action":
11811
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aviala-table-cell__actions", children: actions });
11868
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11869
+ grabber,
11870
+ renderCellBody(
11871
+ badge ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" }),
11872
+ actions
11873
+ )
11874
+ ] });
11812
11875
  case "text":
11813
11876
  default:
11814
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children: text }) });
11877
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
11878
+ grabber,
11879
+ renderCellBody(renderTextBlock(text, caption), actions)
11880
+ ] });
11815
11881
  }
11816
11882
  };
11817
11883
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(