@vvedantb/ui 0.80.0 → 0.82.0
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/README.md +2 -0
- package/dist/shell/src/AppSidebar.js +15 -9
- package/dist/shell/src/DockArrow.js +187 -0
- package/dist/shell/src/SidePanelTabs.js +65 -147
- package/dist/shell/src/SidebarChrome.js +294 -103
- package/dist/shell/src/SidebarPanel.js +24 -20
- package/dist/shell/src/SidebarPeek.js +179 -0
- package/dist/shell/src/SidebarRail.js +51 -39
- package/dist/src/client.js +2 -0
- package/dist/src/index.js +2 -0
- package/package.json +1 -1
- package/shell/src/AppSidebar.tsx +7 -0
- package/shell/src/DockArrow.tsx +125 -0
- package/shell/src/SidePanelTabs.tsx +8 -78
- package/shell/src/Sidebar.tsx +1 -0
- package/shell/src/SidebarChrome.tsx +98 -5
- package/shell/src/SidebarPanel.tsx +7 -3
- package/shell/src/SidebarPeek.ts +127 -0
- package/shell/src/SidebarRail.tsx +16 -1
- package/src/client.ts +4 -0
- package/src/index.ts +4 -0
package/README.md
CHANGED
|
@@ -1289,6 +1289,8 @@ Rail-variant pieces (all work without the rail variant too, except the first):
|
|
|
1289
1289
|
- **Dock motion of the sidebar panel.** In `variant="rail"` the panel shrinks into the `RailCollapseTile` on hide and grows back out on show, and the main content slides with the sidebar width. `panelMotion="none"` on `AppShell` turns it off (a rail-only input: a type error on `"floating"`). For a toggle of your own (a hotkey, a context setter) call `toggleShellPanel(collapsed, toggle)`, or `popOutShellPanel(hide)` and `popInShellPanelNextFrame()`. For a tile of your own, spread `shellDockTileProps` on it.
|
|
1290
1290
|
- **`dockPopIn`, `dockNudge`, `dockPopOut`, `slideWith`, `slideNextResize`** (`DockEdge`, `DOCK_MOTION_EVENT`, `DockMotionEvent`, `dockMotionOff`): the same motion for any panel that docks into a tile. All of it stops with `MotionProvider reducedMotion` and `PageMotionProvider disabled`: a show is instant and a hide runs at once.
|
|
1291
1291
|
- **`ButtonTrack`** (`buttonTrackClass`): a trough for a group of flat buttons, for page header actions (`direction="row"`, default) or tools under a side rail (`direction="column"`). It renders nothing visible when empty.
|
|
1292
|
+
- **`DockArrow`** and **`useDockArrow`**: the arrow `SidePanelTabs.Frame` draws, for any dock card. `<DockArrow ref={arrowRef} edge="left" hairline />` renders the 16 px rotated square (`bg-surface` fill; set another with a `bg-*` class). `hairline` adds a 0.5 px line on the two outer sides, matching `Card`'s inset ring, so it shows no seam on a `Card`. `useDockArrow({ frameRef, cardRef, arrowRef, tile, edge, watch })` puts it on the card's `edge` (`"left"` or `"right"`, the edge that touches the rail), level with the tile `tile(frame)` returns, and slides it in step with the tab pill. It runs `dockPopIn` when the card opens (the arrow fades in once the card lands) and `dockSwitch` when the tile changes. Close with `dockPopOut(card, tile, edge, hide, arrow)`. Motion stops under page motion off and reduced motion.
|
|
1293
|
+
- **Pin or unpin the sidebar panel (hover-open).** A collapsed `Sidebar.Root` or `AppSidebar` is now "unpinned": on desktop, hovering or focusing a rail item opens the panel as an overlay that grows out of that item (`dockPopIn`), and it shrinks back into it (`dockPopOut`) when the pointer leaves the rail and panel. It stays open while a menu opened from the sidebar is open. Rail links (`asChild`) and tabs (`tabValue`) open it by default; set `peek` on a `Sidebar.RailItem` to opt a button in (`peek` or `peek="value"`) or a link out (`peek={false}`). Pass `onCollapsedChange` to `Sidebar.Root` or `AppSidebar` and `SidebarPanel` shows `Sidebar.PinButton` in its header ("Unpin sidebar" or "Pin sidebar", desktop only); you can drop the `RailCollapseTile`. To show the hovered item's panel without navigating, make `const peek = useSidebarPeek()`, pass `peek={peek}` to the root, and read `peek.previewPath` (a hovered link's path) or `peek.previewValue` (its `tabValue` or `peek` string). `peek={false}` turns hover-open off.
|
|
1292
1294
|
- **`SidePanelTabs`**: tabs on a rail beside a content card, for a side panel. `SidePanelTabs.Frame({ collapsed, rail })` holds a `SidePanelTabs.Rail` with a `SidePanelTabs.List({ value, onValueChange })` of `SidePanelTabs.Tab({ value, label, icon, activeIcon, layout, count, indicator, onReselect })`. From `md` up the rail is on the right edge and an arrow on the card points at the active tab; below `md` the tabs are a strip on top. `collapsed` hides the card and leaves the rail (`SIDE_PANEL_RAIL_WIDTH_PX`, 44; `SIDE_PANEL_RAIL_LABELLED_WIDTH_PX`, 76). Close it with `popOutSidePanel(root, collapse)`. It does not depend on the `AppShell` variant. The rail is on the right only. The card is `bg-surface md:rounded-surface`. The tab trough is `bg-default`, and in dark (and `.dark.neutral`) it takes the card tone (`dark:bg-surface`) so the `bg-segment` pill stands out; `Sidebar.RailGroup` and `ButtonTrack` troughs do the same.
|
|
1293
1295
|
|
|
1294
1296
|
```tsx
|
|
@@ -12,11 +12,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* `.ResizeHandle` instead.
|
|
13
13
|
*/
|
|
14
14
|
export function AppSidebar(t0) {
|
|
15
|
-
const $ = _c(
|
|
15
|
+
const $ = _c(31);
|
|
16
16
|
const {
|
|
17
17
|
rail,
|
|
18
18
|
panel,
|
|
19
19
|
collapsed: t1,
|
|
20
|
+
onCollapsedChange,
|
|
21
|
+
peek,
|
|
20
22
|
panelHidden: t2,
|
|
21
23
|
isDesktop,
|
|
22
24
|
mobileOpen,
|
|
@@ -110,12 +112,14 @@ export function AppSidebar(t0) {
|
|
|
110
112
|
t10 = $[18];
|
|
111
113
|
}
|
|
112
114
|
let t11;
|
|
113
|
-
if ($[19] !== collapsed || $[20] !== id || $[21] !== isDesktop || $[22] !== mobileOpen || $[23] !==
|
|
115
|
+
if ($[19] !== collapsed || $[20] !== id || $[21] !== isDesktop || $[22] !== mobileOpen || $[23] !== onCollapsedChange || $[24] !== onMobileOpenChange || $[25] !== panelHidden || $[26] !== peek || $[27] !== t10 || $[28] !== t6 || $[29] !== t7) {
|
|
114
116
|
t11 = /*#__PURE__*/_jsxs(Parts.Root, {
|
|
115
117
|
isDesktop: isDesktop,
|
|
116
118
|
mobileOpen: mobileOpen,
|
|
117
119
|
onMobileOpenChange: onMobileOpenChange,
|
|
118
120
|
collapsed: collapsed,
|
|
121
|
+
onCollapsedChange: onCollapsedChange,
|
|
122
|
+
peek: peek,
|
|
119
123
|
panelHidden: panelHidden,
|
|
120
124
|
id: id,
|
|
121
125
|
children: [t6, t7, t10]
|
|
@@ -124,14 +128,16 @@ export function AppSidebar(t0) {
|
|
|
124
128
|
$[20] = id;
|
|
125
129
|
$[21] = isDesktop;
|
|
126
130
|
$[22] = mobileOpen;
|
|
127
|
-
$[23] =
|
|
128
|
-
$[24] =
|
|
129
|
-
$[25] =
|
|
130
|
-
$[26] =
|
|
131
|
-
$[27] =
|
|
132
|
-
$[28] =
|
|
131
|
+
$[23] = onCollapsedChange;
|
|
132
|
+
$[24] = onMobileOpenChange;
|
|
133
|
+
$[25] = panelHidden;
|
|
134
|
+
$[26] = peek;
|
|
135
|
+
$[27] = t10;
|
|
136
|
+
$[28] = t6;
|
|
137
|
+
$[29] = t7;
|
|
138
|
+
$[30] = t11;
|
|
133
139
|
} else {
|
|
134
|
-
t11 = $[
|
|
140
|
+
t11 = $[30];
|
|
135
141
|
}
|
|
136
142
|
return t11;
|
|
137
143
|
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
import { dockPopIn, dockSwitch } from "../../src/motion/dock-motion.js";
|
|
4
|
+
import { cn } from "../../src/utils/cn.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const ARROW_HALF_PX = 8;
|
|
7
|
+
/**
|
|
8
|
+
* The 16 px rotated square a dock card draws to point at its rail tile. Place
|
|
9
|
+
* it in the same positioned parent as the card and pass its ref to
|
|
10
|
+
* `useDockArrow`, which moves it. The fill is `bg-surface`: set another with a
|
|
11
|
+
* `bg-*` class in `className`. Hide it with `className` when the card is
|
|
12
|
+
* hidden (the hook already fades it out when the card has no width).
|
|
13
|
+
*/
|
|
14
|
+
export function DockArrow(t0) {
|
|
15
|
+
const $ = _c(12);
|
|
16
|
+
let className;
|
|
17
|
+
let props;
|
|
18
|
+
let t1;
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({
|
|
22
|
+
edge: t1,
|
|
23
|
+
hairline: t2,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
} = t0);
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
$[1] = className;
|
|
29
|
+
$[2] = props;
|
|
30
|
+
$[3] = t1;
|
|
31
|
+
$[4] = t2;
|
|
32
|
+
} else {
|
|
33
|
+
className = $[1];
|
|
34
|
+
props = $[2];
|
|
35
|
+
t1 = $[3];
|
|
36
|
+
t2 = $[4];
|
|
37
|
+
}
|
|
38
|
+
const edge = t1 === undefined ? "right" : t1;
|
|
39
|
+
const hairline = t2 === undefined ? false : t2;
|
|
40
|
+
const t3 = hairline && (edge === "right" ? "border-t-[0.5px] border-r-[0.5px]" : "border-b-[0.5px] border-l-[0.5px]");
|
|
41
|
+
const t4 = hairline && "border-black/[0.06] dark:border-white/[0.08]";
|
|
42
|
+
let t5;
|
|
43
|
+
if ($[5] !== className || $[6] !== t3 || $[7] !== t4) {
|
|
44
|
+
t5 = cn("t-side-panel-arrow pointer-events-none absolute top-0 size-4 rounded-xs bg-surface opacity-0", t3, t4, className);
|
|
45
|
+
$[5] = className;
|
|
46
|
+
$[6] = t3;
|
|
47
|
+
$[7] = t4;
|
|
48
|
+
$[8] = t5;
|
|
49
|
+
} else {
|
|
50
|
+
t5 = $[8];
|
|
51
|
+
}
|
|
52
|
+
let t6;
|
|
53
|
+
if ($[9] !== props || $[10] !== t5) {
|
|
54
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
"data-dock-arrow": "",
|
|
57
|
+
...props,
|
|
58
|
+
className: t5
|
|
59
|
+
});
|
|
60
|
+
$[9] = props;
|
|
61
|
+
$[10] = t5;
|
|
62
|
+
$[11] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[11];
|
|
65
|
+
}
|
|
66
|
+
return t6;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Places `arrowRef` at the card's `edge`, level with the active tile, and
|
|
70
|
+
* slides it to the next tile in step with the tab pill (`t-side-panel-arrow`).
|
|
71
|
+
* When the card opens it runs `dockPopIn` (the card grows out of the tile and
|
|
72
|
+
* the arrow fades in once it lands); when the tile changes it runs
|
|
73
|
+
* `dockSwitch`. Close with `dockPopOut(card, tile, edge, hide, arrow)`. The
|
|
74
|
+
* arrow hides while the card has no width or the tile is outside the card's
|
|
75
|
+
* height.
|
|
76
|
+
*/
|
|
77
|
+
export function useDockArrow(t0) {
|
|
78
|
+
const $ = _c(8);
|
|
79
|
+
const {
|
|
80
|
+
frameRef,
|
|
81
|
+
cardRef,
|
|
82
|
+
arrowRef,
|
|
83
|
+
tile,
|
|
84
|
+
edge: t1,
|
|
85
|
+
watch
|
|
86
|
+
} = t0;
|
|
87
|
+
const edge = t1 === undefined ? "right" : t1;
|
|
88
|
+
let t2;
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[0] !== arrowRef || $[1] !== cardRef || $[2] !== edge || $[3] !== frameRef || $[4] !== tile || $[5] !== watch) {
|
|
91
|
+
t2 = () => {
|
|
92
|
+
const frame = frameRef.current;
|
|
93
|
+
const card = cardRef.current;
|
|
94
|
+
const arrow = arrowRef.current;
|
|
95
|
+
if (!frame || !card || !arrow) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let placed = false;
|
|
99
|
+
let wasOpen = card.getBoundingClientRect().width > 0;
|
|
100
|
+
let lastTab = tile(frame);
|
|
101
|
+
const sync = () => {
|
|
102
|
+
const tab = tile(frame);
|
|
103
|
+
const f = frame.getBoundingClientRect();
|
|
104
|
+
const c = card.getBoundingClientRect();
|
|
105
|
+
const open = c.width > 0;
|
|
106
|
+
const opened = open && !wasOpen;
|
|
107
|
+
const switched = open && wasOpen && tab !== null && tab !== lastTab;
|
|
108
|
+
const previousTab = lastTab;
|
|
109
|
+
wasOpen = open;
|
|
110
|
+
if (tab) {
|
|
111
|
+
lastTab = tab;
|
|
112
|
+
}
|
|
113
|
+
if (!tab || !open) {
|
|
114
|
+
arrow.style.opacity = "0";
|
|
115
|
+
placed = false;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const t = tab.getBoundingClientRect();
|
|
119
|
+
const centre = t.top + t.height / 2;
|
|
120
|
+
const inCard = centre > c.top + 2 * ARROW_HALF_PX && centre < c.bottom - 2 * ARROW_HALF_PX;
|
|
121
|
+
if (!inCard) {
|
|
122
|
+
arrow.style.opacity = "0";
|
|
123
|
+
} else {
|
|
124
|
+
if (!placed) {
|
|
125
|
+
arrow.style.transition = "none";
|
|
126
|
+
}
|
|
127
|
+
const x = edge === "right" ? c.right - f.left - ARROW_HALF_PX - 1 : c.left - f.left - ARROW_HALF_PX + 1;
|
|
128
|
+
arrow.style.left = `${x}px`;
|
|
129
|
+
arrow.style.transform = `translateY(${centre - f.top - ARROW_HALF_PX}px) rotate(45deg)`;
|
|
130
|
+
arrow.style.opacity = "1";
|
|
131
|
+
if (!placed) {
|
|
132
|
+
arrow.style.transition = "";
|
|
133
|
+
placed = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (opened) {
|
|
137
|
+
dockPopIn(card, tab, edge, arrow);
|
|
138
|
+
} else {
|
|
139
|
+
if (switched) {
|
|
140
|
+
dockSwitch(card, previousTab, tab);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
sync();
|
|
145
|
+
if (typeof ResizeObserver === "undefined") {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const resize = new ResizeObserver(sync);
|
|
149
|
+
resize.observe(frame);
|
|
150
|
+
resize.observe(card);
|
|
151
|
+
const mutation = new MutationObserver(sync);
|
|
152
|
+
mutation.observe(frame, {
|
|
153
|
+
subtree: true,
|
|
154
|
+
attributes: true,
|
|
155
|
+
attributeFilter: ["data-state", "aria-selected"]
|
|
156
|
+
});
|
|
157
|
+
const list = watch?.(frame);
|
|
158
|
+
if (list) {
|
|
159
|
+
resize.observe(list);
|
|
160
|
+
}
|
|
161
|
+
const settle = ["scroll", "animationend", "transitionend"];
|
|
162
|
+
for (const type of settle) {
|
|
163
|
+
frame.addEventListener(type, sync, true);
|
|
164
|
+
}
|
|
165
|
+
return () => {
|
|
166
|
+
resize.disconnect();
|
|
167
|
+
mutation.disconnect();
|
|
168
|
+
for (const type_0 of settle) {
|
|
169
|
+
frame.removeEventListener(type_0, sync, true);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
t3 = [frameRef, cardRef, arrowRef, tile, edge, watch];
|
|
174
|
+
$[0] = arrowRef;
|
|
175
|
+
$[1] = cardRef;
|
|
176
|
+
$[2] = edge;
|
|
177
|
+
$[3] = frameRef;
|
|
178
|
+
$[4] = tile;
|
|
179
|
+
$[5] = watch;
|
|
180
|
+
$[6] = t2;
|
|
181
|
+
$[7] = t3;
|
|
182
|
+
} else {
|
|
183
|
+
t2 = $[6];
|
|
184
|
+
t3 = $[7];
|
|
185
|
+
}
|
|
186
|
+
useLayoutEffect(t2, t3);
|
|
187
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { dockPopOut } from "../../src/motion/dock-motion.js";
|
|
4
|
+
import { DockArrow, useDockArrow } from "./DockArrow.js";
|
|
4
5
|
import { Tabs, TabsList, TabsTrigger } from "../../src/ui/tabs.js";
|
|
5
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../src/ui/tooltip.js";
|
|
6
7
|
import { cn } from "../../src/utils/cn.js";
|
|
@@ -10,7 +11,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
10
11
|
export const SIDE_PANEL_RAIL_WIDTH_PX = 44;
|
|
11
12
|
/** Width of the rail with a label under each icon (`labelled`). */
|
|
12
13
|
export const SIDE_PANEL_RAIL_LABELLED_WIDTH_PX = 76;
|
|
13
|
-
const ARROW_HALF_PX = 8;
|
|
14
14
|
const RAIL_TABLIST_SELECTOR = ':scope > [data-side-panel-rail] [role="tablist"]';
|
|
15
15
|
const ACTIVE_TAB_SELECTOR = `${RAIL_TABLIST_SELECTOR} [role="tab"][data-state="active"]`;
|
|
16
16
|
const CARD_SELECTOR = "[data-side-panel-card]";
|
|
@@ -31,106 +31,10 @@ export function popOutSidePanel(root, collapse) {
|
|
|
31
31
|
const card = root?.querySelector(CARD_SELECTOR) ?? null;
|
|
32
32
|
dockPopOut(card, card ? activeTabOf(card) : null, "right", collapse, card ? arrowOf(card) : null);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let t0;
|
|
37
|
-
let t1;
|
|
38
|
-
if ($[0] !== arrowRef || $[1] !== cardRef || $[2] !== frameRef) {
|
|
39
|
-
t0 = () => {
|
|
40
|
-
const frame = frameRef.current;
|
|
41
|
-
const card = cardRef.current;
|
|
42
|
-
const arrow = arrowRef.current;
|
|
43
|
-
if (!frame || !card || !arrow) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
let placed = false;
|
|
47
|
-
let wasOpen = card.getBoundingClientRect().width > 0;
|
|
48
|
-
let lastTab = frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
49
|
-
const sync = () => {
|
|
50
|
-
const tab = frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
51
|
-
const f = frame.getBoundingClientRect();
|
|
52
|
-
const c = card.getBoundingClientRect();
|
|
53
|
-
const open = c.width > 0;
|
|
54
|
-
const opened = open && !wasOpen;
|
|
55
|
-
const switched = open && wasOpen && tab !== null && tab !== lastTab;
|
|
56
|
-
const previousTab = lastTab;
|
|
57
|
-
wasOpen = open;
|
|
58
|
-
if (tab) {
|
|
59
|
-
lastTab = tab;
|
|
60
|
-
}
|
|
61
|
-
if (!tab || !open) {
|
|
62
|
-
arrow.style.opacity = "0";
|
|
63
|
-
placed = false;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const t = tab.getBoundingClientRect();
|
|
67
|
-
const centre = t.top + t.height / 2;
|
|
68
|
-
const inCard = centre > c.top + 2 * ARROW_HALF_PX && centre < c.bottom - 2 * ARROW_HALF_PX;
|
|
69
|
-
if (!inCard) {
|
|
70
|
-
arrow.style.opacity = "0";
|
|
71
|
-
} else {
|
|
72
|
-
if (!placed) {
|
|
73
|
-
arrow.style.transition = "none";
|
|
74
|
-
}
|
|
75
|
-
arrow.style.left = `${c.right - f.left - ARROW_HALF_PX - 1}px`;
|
|
76
|
-
arrow.style.transform = `translateY(${centre - f.top - ARROW_HALF_PX}px) rotate(45deg)`;
|
|
77
|
-
arrow.style.opacity = "1";
|
|
78
|
-
if (!placed) {
|
|
79
|
-
arrow.style.transition = "";
|
|
80
|
-
placed = true;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (opened) {
|
|
84
|
-
dockPopIn(card, tab, "right", arrow);
|
|
85
|
-
} else {
|
|
86
|
-
if (switched) {
|
|
87
|
-
dockSwitch(card, previousTab, tab);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
sync();
|
|
92
|
-
if (typeof ResizeObserver === "undefined") {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const resize = new ResizeObserver(sync);
|
|
96
|
-
resize.observe(frame);
|
|
97
|
-
resize.observe(card);
|
|
98
|
-
const mutation = new MutationObserver(sync);
|
|
99
|
-
mutation.observe(frame, {
|
|
100
|
-
subtree: true,
|
|
101
|
-
attributes: true,
|
|
102
|
-
attributeFilter: ["data-state"]
|
|
103
|
-
});
|
|
104
|
-
const list = frame.querySelector(RAIL_TABLIST_SELECTOR);
|
|
105
|
-
if (list) {
|
|
106
|
-
resize.observe(list);
|
|
107
|
-
}
|
|
108
|
-
const settle = ["scroll", "animationend", "transitionend"];
|
|
109
|
-
for (const type of settle) {
|
|
110
|
-
frame.addEventListener(type, sync, true);
|
|
111
|
-
}
|
|
112
|
-
return () => {
|
|
113
|
-
resize.disconnect();
|
|
114
|
-
mutation.disconnect();
|
|
115
|
-
for (const type_0 of settle) {
|
|
116
|
-
frame.removeEventListener(type_0, sync, true);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
t1 = [frameRef, cardRef, arrowRef];
|
|
121
|
-
$[0] = arrowRef;
|
|
122
|
-
$[1] = cardRef;
|
|
123
|
-
$[2] = frameRef;
|
|
124
|
-
$[3] = t0;
|
|
125
|
-
$[4] = t1;
|
|
126
|
-
} else {
|
|
127
|
-
t0 = $[3];
|
|
128
|
-
t1 = $[4];
|
|
129
|
-
}
|
|
130
|
-
useLayoutEffect(t0, t1);
|
|
131
|
-
}
|
|
34
|
+
const activeTabIn = frame => frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
35
|
+
const railListIn = frame => frame.querySelector(RAIL_TABLIST_SELECTOR);
|
|
132
36
|
function Frame(t0) {
|
|
133
|
-
const $ = _c(
|
|
37
|
+
const $ = _c(19);
|
|
134
38
|
const {
|
|
135
39
|
collapsed: t1,
|
|
136
40
|
rail,
|
|
@@ -143,78 +47,92 @@ function Frame(t0) {
|
|
|
143
47
|
const frameRef = useRef(null);
|
|
144
48
|
const cardRef = useRef(null);
|
|
145
49
|
const arrowRef = useRef(null);
|
|
146
|
-
useActiveTabArrow(frameRef, cardRef, arrowRef);
|
|
147
50
|
let t2;
|
|
148
|
-
if ($[0]
|
|
149
|
-
t2 =
|
|
150
|
-
|
|
151
|
-
|
|
51
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
52
|
+
t2 = {
|
|
53
|
+
frameRef,
|
|
54
|
+
cardRef,
|
|
55
|
+
arrowRef,
|
|
56
|
+
tile: activeTabIn,
|
|
57
|
+
edge: "right",
|
|
58
|
+
watch: railListIn
|
|
59
|
+
};
|
|
60
|
+
$[0] = t2;
|
|
152
61
|
} else {
|
|
153
|
-
t2 = $[
|
|
62
|
+
t2 = $[0];
|
|
154
63
|
}
|
|
155
|
-
|
|
156
|
-
let
|
|
157
|
-
if ($[
|
|
158
|
-
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[4] = t4;
|
|
64
|
+
useDockArrow(t2);
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[1] !== className) {
|
|
67
|
+
t3 = cn("relative flex h-full min-h-0 flex-col md:flex-row-reverse", className);
|
|
68
|
+
$[1] = className;
|
|
69
|
+
$[2] = t3;
|
|
162
70
|
} else {
|
|
163
|
-
|
|
71
|
+
t3 = $[2];
|
|
164
72
|
}
|
|
73
|
+
const t4 = collapsed && "md:hidden";
|
|
165
74
|
let t5;
|
|
166
|
-
if ($[
|
|
167
|
-
t5 =
|
|
75
|
+
if ($[3] !== arrowClassName || $[4] !== t4) {
|
|
76
|
+
t5 = cn("hidden md:block", t4, arrowClassName);
|
|
77
|
+
$[3] = arrowClassName;
|
|
78
|
+
$[4] = t4;
|
|
79
|
+
$[5] = t5;
|
|
80
|
+
} else {
|
|
81
|
+
t5 = $[5];
|
|
82
|
+
}
|
|
83
|
+
let t6;
|
|
84
|
+
if ($[6] !== t5) {
|
|
85
|
+
t6 = /*#__PURE__*/_jsx(DockArrow, {
|
|
168
86
|
ref: arrowRef,
|
|
169
|
-
"
|
|
87
|
+
edge: "right",
|
|
170
88
|
"data-side-panel-arrow": "",
|
|
171
|
-
className:
|
|
89
|
+
className: t5
|
|
172
90
|
});
|
|
173
|
-
$[5] = t4;
|
|
174
91
|
$[6] = t5;
|
|
92
|
+
$[7] = t6;
|
|
175
93
|
} else {
|
|
176
|
-
|
|
94
|
+
t6 = $[7];
|
|
177
95
|
}
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
if ($[
|
|
181
|
-
|
|
182
|
-
$[
|
|
183
|
-
$[8] = t6;
|
|
96
|
+
const t7 = collapsed && "md:hidden";
|
|
97
|
+
let t8;
|
|
98
|
+
if ($[8] !== cardClassName || $[9] !== t7) {
|
|
99
|
+
t8 = cn("relative min-h-0 min-w-0 flex-1 overflow-hidden bg-surface md:my-2 md:mr-1.5 md:rounded-surface", t7, cardClassName);
|
|
100
|
+
$[8] = cardClassName;
|
|
184
101
|
$[9] = t7;
|
|
102
|
+
$[10] = t8;
|
|
185
103
|
} else {
|
|
186
|
-
|
|
104
|
+
t8 = $[10];
|
|
187
105
|
}
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
106
|
+
let t9;
|
|
107
|
+
if ($[11] !== children || $[12] !== t8) {
|
|
108
|
+
t9 = /*#__PURE__*/_jsx("div", {
|
|
191
109
|
ref: cardRef,
|
|
192
110
|
"data-side-panel-card": "",
|
|
193
|
-
className:
|
|
111
|
+
className: t8,
|
|
194
112
|
children: children
|
|
195
113
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[11] = t7;
|
|
114
|
+
$[11] = children;
|
|
198
115
|
$[12] = t8;
|
|
116
|
+
$[13] = t9;
|
|
199
117
|
} else {
|
|
200
|
-
|
|
118
|
+
t9 = $[13];
|
|
201
119
|
}
|
|
202
|
-
let
|
|
203
|
-
if ($[
|
|
204
|
-
|
|
120
|
+
let t10;
|
|
121
|
+
if ($[14] !== rail || $[15] !== t3 || $[16] !== t6 || $[17] !== t9) {
|
|
122
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
205
123
|
ref: frameRef,
|
|
206
|
-
className:
|
|
207
|
-
children: [rail,
|
|
124
|
+
className: t3,
|
|
125
|
+
children: [rail, t6, t9]
|
|
208
126
|
});
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[16] = t8;
|
|
127
|
+
$[14] = rail;
|
|
128
|
+
$[15] = t3;
|
|
129
|
+
$[16] = t6;
|
|
213
130
|
$[17] = t9;
|
|
131
|
+
$[18] = t10;
|
|
214
132
|
} else {
|
|
215
|
-
|
|
133
|
+
t10 = $[18];
|
|
216
134
|
}
|
|
217
|
-
return
|
|
135
|
+
return t10;
|
|
218
136
|
}
|
|
219
137
|
function Rail(t0) {
|
|
220
138
|
const $ = _c(10);
|