@sia.soul/sia-react-ui 0.1.38 → 0.1.39

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.
@@ -2,10 +2,11 @@ import {
2
2
  TextArea
3
3
  } from "./chunk-SMCYEPBL.js";
4
4
  import {
5
+ FloatingScrollbarProvider,
5
6
  Popover,
6
7
  Tooltip,
7
8
  useOverlayLifecycle
8
- } from "./chunk-ZTJUFVJO.js";
9
+ } from "./chunk-LRGD2QDA.js";
9
10
  import {
10
11
  Dropdown,
11
12
  Icon
@@ -244,7 +245,12 @@ function Tabs({
244
245
  }
245
246
  const listRect = list.getBoundingClientRect();
246
247
  const rect = active.getBoundingClientRect();
247
- indicator.style.transform = `translate(${rect.left - listRect.left - list.clientLeft + list.scrollLeft}px, ${rect.top - listRect.top - list.clientTop + list.scrollTop}px)`;
248
+ if (type === "tech-line" && resolvedOrientation === "horizontal") {
249
+ if (rect.left < listRect.left) list.scrollLeft += rect.left - listRect.left;
250
+ else if (rect.right > listRect.right) list.scrollLeft += rect.right - listRect.right;
251
+ }
252
+ const currentRect = active.getBoundingClientRect();
253
+ indicator.style.transform = `translate(${currentRect.left - listRect.left - list.clientLeft + list.scrollLeft}px, ${currentRect.top - listRect.top - list.clientTop + list.scrollTop}px)`;
248
254
  indicator.style.width = `${rect.width}px`;
249
255
  indicator.style.height = `${rect.height}px`;
250
256
  indicator.style.visibility = "visible";
@@ -314,6 +320,7 @@ function Tabs({
314
320
  ...withTitleTooltip(props),
315
321
  children: [
316
322
  /* @__PURE__ */ jsxs4("div", { className: "sia-tabs__header", children: [
323
+ /* @__PURE__ */ jsx4(FloatingScrollbarProvider, { targetRef: listRef, disabled: type !== "tech-line" || resolvedOrientation !== "horizontal" }),
317
324
  tabBarTitle ? /* @__PURE__ */ jsxs4("div", { className: "sia-tabs__title", children: [
318
325
  tabBarTitle,
319
326
  type === "tech-line" ? /* @__PURE__ */ jsx4("svg", { className: "sia-tabs__title-connector", viewBox: "0 0 32 40", "aria-hidden": "true", children: /* @__PURE__ */ jsx4("path", { d: "M0 39.25 H5 Q8 39.25 10 35.25 L28 3.75 Q29 1.75 32 1.75", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }) }) : null
@@ -721,7 +721,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
721
721
  * @defaultValue false
722
722
  */
723
723
  centered?: boolean;
724
- /** 标签栏左侧标题,科技大屏型会附带装饰线;折线科技型横向布局按标题内容及装饰留白确定宽度,窄屏时标题独占一行。 */
724
+ /** 标签栏左侧标题,科技大屏型会附带装饰线;折线科技型横向布局按标题内容及装饰留白确定宽度,标签超宽时独立横向滚动并保持当前标签可见,窄屏时标题独占一行。 */
725
725
  tabBarTitle?: ReactNode;
726
726
  /** 标签栏与内容面板之间的间距,单位 px,支持 0;未指定时上下布局为 16px,左右布局为 20px。仅影响当前 Tabs,不传递给嵌套实例。 */
727
727
  contentGap?: number;
@@ -721,7 +721,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
721
721
  * @defaultValue false
722
722
  */
723
723
  centered?: boolean;
724
- /** 标签栏左侧标题,科技大屏型会附带装饰线;折线科技型横向布局按标题内容及装饰留白确定宽度,窄屏时标题独占一行。 */
724
+ /** 标签栏左侧标题,科技大屏型会附带装饰线;折线科技型横向布局按标题内容及装饰留白确定宽度,标签超宽时独立横向滚动并保持当前标签可见,窄屏时标题独占一行。 */
725
725
  tabBarTitle?: ReactNode;
726
726
  /** 标签栏与内容面板之间的间距,单位 px,支持 0;未指定时上下布局为 16px,左右布局为 20px。仅影响当前 Tabs,不传递给嵌套实例。 */
727
727
  contentGap?: number;