@robert-stackflow/oneui 0.6.47 → 0.6.48
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/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,8 @@ export type TableOfContentsProps = {
|
|
|
12
12
|
hoverMode?: "single" | "nearby" | "all";
|
|
13
13
|
/** Display the full compact hierarchy in a rail popup. */
|
|
14
14
|
railLayout?: "preview" | "outline";
|
|
15
|
+
/** Align short rail marks to the start or end of their column. */
|
|
16
|
+
railAlign?: "start" | "end";
|
|
15
17
|
popoverSide?: "left" | "right";
|
|
16
18
|
previewCount?: number;
|
|
17
19
|
depthBasedLength?: boolean;
|
|
@@ -24,4 +26,4 @@ export type TableOfContentsProps = {
|
|
|
24
26
|
scrollable?: boolean;
|
|
25
27
|
className?: string;
|
|
26
28
|
};
|
|
27
|
-
export declare function TableOfContents({ items, contentRef, variant, hoverMode, railLayout, popoverSide, previewCount, depthBasedLength, label, activeId, onActiveChange, maxLevel, scrollOffset, scrollable, className, }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
29
|
+
export declare function TableOfContents({ items, contentRef, variant, hoverMode, railLayout, railAlign, popoverSide, previewCount, depthBasedLength, label, activeId, onActiveChange, maxLevel, scrollOffset, scrollable, className, }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
@@ -23,6 +23,7 @@ function TableOfContents({
|
|
|
23
23
|
variant = "tree",
|
|
24
24
|
hoverMode = "nearby",
|
|
25
25
|
railLayout = "preview",
|
|
26
|
+
railAlign = "end",
|
|
26
27
|
popoverSide = "left",
|
|
27
28
|
previewCount = 5,
|
|
28
29
|
depthBasedLength = false,
|
|
@@ -391,6 +392,7 @@ function TableOfContents({
|
|
|
391
392
|
{
|
|
392
393
|
ref: railRoot,
|
|
393
394
|
className: `${s.rail} ${className}`,
|
|
395
|
+
"data-rail-align": railAlign,
|
|
394
396
|
"aria-label": `${label}\u5FEB\u6377\u5B9A\u4F4D`,
|
|
395
397
|
onPointerEnter: () => {
|
|
396
398
|
keepOpen();
|
|
@@ -115,6 +115,16 @@
|
|
|
115
115
|
opacity 180ms var(--ease),
|
|
116
116
|
background-color 180ms var(--ease);
|
|
117
117
|
}
|
|
118
|
+
.rail[data-rail-align="start"] .trigger {
|
|
119
|
+
align-items: flex-start;
|
|
120
|
+
}
|
|
121
|
+
.rail[data-rail-align="start"] .railItem {
|
|
122
|
+
justify-content: flex-start;
|
|
123
|
+
padding-inline: 3px 0;
|
|
124
|
+
}
|
|
125
|
+
.rail[data-rail-align="start"] .railItem > i {
|
|
126
|
+
transform-origin: left center;
|
|
127
|
+
}
|
|
118
128
|
.railItem[data-active="true"] > i {
|
|
119
129
|
background: var(--fg);
|
|
120
130
|
opacity: 1;
|