@vvedantb/ui 0.55.0 → 0.57.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 +25 -1
- package/dist/shell/src/AppShell.js +213 -147
- package/dist/shell/src/ButtonTrack.js +57 -0
- package/dist/shell/src/SidePanelTabs.js +595 -0
- package/dist/shell/src/SidebarPanel.js +20 -15
- package/dist/shell/src/SidebarRail.js +121 -59
- package/dist/shell/src/index.js +5 -1
- package/dist/shell/src/shell-panel-motion.js +62 -0
- package/dist/shell/src/shell-variant.js +28 -0
- package/dist/src/client.js +6 -1
- package/dist/src/index.js +6 -1
- package/dist/src/motion/dock-motion.js +209 -0
- package/dist/tokens/src/css/motion.css +7 -1
- package/dist/tokens/src/css/tabs.css +4 -0
- package/package.json +1 -1
- package/shell/src/AppShell.tsx +45 -17
- package/shell/src/ButtonTrack.tsx +26 -0
- package/shell/src/SidePanelTabs.tsx +380 -0
- package/shell/src/SidebarPanel.tsx +3 -0
- package/shell/src/SidebarRail.tsx +33 -9
- package/shell/src/index.ts +19 -1
- package/shell/src/shell-panel-motion.ts +64 -0
- package/shell/src/shell-variant.ts +46 -0
- package/src/client.ts +30 -1
- package/src/index.ts +30 -1
- package/src/motion/dock-motion.ts +188 -0
- package/tokens/src/css/motion.css +7 -1
- package/tokens/src/css/tabs.css +4 -0
package/README.md
CHANGED
|
@@ -342,6 +342,7 @@ import {
|
|
|
342
342
|
|
|
343
343
|
- Widths: `AppShell` sets `--app-shell-rail-width` (default `3.5rem`; `4rem` before 0.49.0), `--app-shell-sidebar-width` (rail plus panel, default `19.5rem`; `20rem` before 0.49.0) and `--app-shell-mobile-header-height` (default `calc(3.5rem + env(safe-area-inset-top, 0px))`) as inline style. Change them with `railWidth`, `sidebarWidth` and `mobileHeaderHeight`. The other pieces read these variables. Outside `AppShell`, set the variables yourself or pass a width class with `className`.
|
|
344
344
|
- `AppShell`: `sidebar`, `children`, `panelHidden` (main offsets by the rail width instead of the sidebar width), `skipLinkLabel` (`"Skip to main content"`), `mainId` (`"main-content"`), `className`, `mainClassName`, `contentClassName`, `scroll` (`"contained"`: the shell is one screen high and the content card scrolls; `"document"`: the page scrolls, with no card, gutter or margin animation).
|
|
345
|
+
- `AppShell` `variant`: `"floating"` (default) or `"rail"`. Both take the same inputs, so an app switches layout with this one prop and switches back the same way. `"rail"` has no content card or gutter (the page sits on the frame tone), puts each `SidebarRail` slot (`top`, body, `footer`) on a `RailGroup` trough with a sliding pill, and draws no `showDivider` border or `RailDivider`. A `bodyAsChild` body is not grouped. The frame gets `data-shell-variant="rail"`. `variant` is also on `AppShell.Root`; with composed parts, add `Sidebar.RailGroup` yourself. `useAppShellVariant()` reads it. `scroll` and the theme stay separate choices.
|
|
345
346
|
- `AppSidebar`: legacy (still supported) `rail`, `panel` and `mobile*` props; compose `Sidebar.*` instead. `rail`, `panel` (not rendered while `panelHidden`), `collapsed`, `panelHidden`, `isDesktop`, `mobileOpen`, `onMobileOpenChange`, `id` (default from `useId`), `asideProps` (`data-*` attributes for the `<aside>`), `className`, `mobileTitle`, `mobileHeaderActions` (0.5.2; trailing actions such as icon buttons, in place of the end spacer), `mobileMenuIcon` (`(open) => node`, default a menu icon), `mobileMenuLabel` (`"Open navigation menu"`), `closeLabel` (`"Close navigation"`). Swipe left or Escape closes the drawer. The drawer is `inert` while closed on mobile, and closes when `isDesktop` becomes `true`. Close it on route change in the app. The mobile header is a three-column grid, so the title and trailing actions stay on one row and a long title truncates (0.5.4).
|
|
346
347
|
- `SidebarRail`: legacy (still supported) `top`, `footer`, `bodyAsChild`, `tabs` and `*ClassName` props; compose `Sidebar.Rail` parts instead. `top`, `children` (scroll body), `footer`, `showDivider`, `bodyAsChild` (the single child, for example a tabs list, becomes the body), `className`, `topClassName`, `bodyClassName`, `footerClassName`. Other HTML attributes (`id`, `data-*`, `aria-*`) go to the root `<div>`. The top and footer wrappers render only when their slot is set.
|
|
347
348
|
- `RailTile`: `label` (`aria-label` and tooltip), `active`, `tooltip`, `showTooltip` (default `true`), `badge` (inside the tile, after the children; style it with `railBadgeClass`), `asChild`, `app`, `className`. Without `asChild` it is a native `<button type="button">` (0.5.3), so icons keep their authored size; other props go to it. With `asChild` the child (for example a router link) gets the tile classes and `aria-current="page"` when active.
|
|
@@ -1238,7 +1239,30 @@ Single-plan callers need no change. To move to the multi-plan layout, replace
|
|
|
1238
1239
|
- `signOut={{ onSignOut, description? }}`: a separator and a danger "Sign out" item, last. It opens `SignOutDialog`; Alt-click skips the dialog and `ConfirmSkipHint` shows while Alt is held. The menu owns the dialog state. If `onSignOut` rejects, the dialog buttons enable again.
|
|
1239
1240
|
- `itemIconSize`: `size` of those two items' icons. Default: the icon's own size.
|
|
1240
1241
|
|
|
1241
|
-
`RailCollapseTile({ collapsed, onToggle })`: the rail tile that shows or hides the sidebar panel ("Show sidebar" with the expand icon, or "Hide sidebar").
|
|
1242
|
+
`RailCollapseTile({ collapsed, onToggle })`: the rail tile that shows or hides the sidebar panel ("Show sidebar" with the expand icon, or "Hide sidebar"). In `AppShell variant="rail"` it runs the dock motion (below).
|
|
1243
|
+
|
|
1244
|
+
Rail-variant pieces (all work without the rail variant too, except the first):
|
|
1245
|
+
|
|
1246
|
+
- **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.
|
|
1247
|
+
- **`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.
|
|
1248
|
+
- **`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.
|
|
1249
|
+
- **`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.
|
|
1250
|
+
|
|
1251
|
+
```tsx
|
|
1252
|
+
<SidePanelTabs.Frame
|
|
1253
|
+
collapsed={collapsed}
|
|
1254
|
+
rail={
|
|
1255
|
+
<SidePanelTabs.Rail>
|
|
1256
|
+
<SidePanelTabs.List value={tab} onValueChange={setTab} aria-label="Panel">
|
|
1257
|
+
<SidePanelTabs.Tab value="files" label="Files" icon={<IconFiles />} count={3} onReselect={toggleCard} />
|
|
1258
|
+
<SidePanelTabs.Tab value="notes" label="Notes" icon={<IconNote />} />
|
|
1259
|
+
</SidePanelTabs.List>
|
|
1260
|
+
</SidePanelTabs.Rail>
|
|
1261
|
+
}
|
|
1262
|
+
>
|
|
1263
|
+
{tab === "files" ? <Files /> : <Notes />}
|
|
1264
|
+
</SidePanelTabs.Frame>
|
|
1265
|
+
```
|
|
1242
1266
|
|
|
1243
1267
|
## Animated nav icons (0.11.0)
|
|
1244
1268
|
|
|
@@ -2,6 +2,13 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { cn } from "../../src/utils/cn.js";
|
|
4
4
|
import { SidebarResizeProvider, useSidebarResizeContext, useSidebarResizeState } from "./SidebarResize.js";
|
|
5
|
+
import { AppShellPanelDockContext, AppShellVariantContext, useAppShellVariant } from "./shell-variant.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `variant` picks the layout: `"floating"` (default) or `"rail"`. Both take
|
|
9
|
+
* the same inputs, so an app switches with this one prop. The sidebar pieces
|
|
10
|
+
* inside (`SidebarRail`, `RailDivider`) read it from the shell.
|
|
11
|
+
*/
|
|
5
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
13
|
const AppShellContext = /*#__PURE__*/createContext({
|
|
7
14
|
mainId: "main-content",
|
|
@@ -10,8 +17,9 @@ const AppShellContext = /*#__PURE__*/createContext({
|
|
|
10
17
|
});
|
|
11
18
|
/** Frame `<div>`: sets the `--app-shell-*` variables and owns the resize state. `style` merges over the variables. */
|
|
12
19
|
function Root(t0) {
|
|
13
|
-
const $ = _c(
|
|
20
|
+
const $ = _c(44);
|
|
14
21
|
let className;
|
|
22
|
+
let panelMotion;
|
|
15
23
|
let props;
|
|
16
24
|
let resizable;
|
|
17
25
|
let style;
|
|
@@ -21,6 +29,7 @@ function Root(t0) {
|
|
|
21
29
|
let t4;
|
|
22
30
|
let t5;
|
|
23
31
|
let t6;
|
|
32
|
+
let t7;
|
|
24
33
|
if ($[0] !== t0) {
|
|
25
34
|
({
|
|
26
35
|
panelHidden: t1,
|
|
@@ -30,32 +39,38 @@ function Root(t0) {
|
|
|
30
39
|
scroll: t4,
|
|
31
40
|
mobileHeaderHeight: t5,
|
|
32
41
|
mainId: t6,
|
|
42
|
+
variant: t7,
|
|
43
|
+
panelMotion,
|
|
33
44
|
className,
|
|
34
45
|
style,
|
|
35
46
|
...props
|
|
36
47
|
} = t0);
|
|
37
48
|
$[0] = t0;
|
|
38
49
|
$[1] = className;
|
|
39
|
-
$[2] =
|
|
40
|
-
$[3] =
|
|
41
|
-
$[4] =
|
|
42
|
-
$[5] =
|
|
43
|
-
$[6] =
|
|
44
|
-
$[7] =
|
|
45
|
-
$[8] =
|
|
46
|
-
$[9] =
|
|
47
|
-
$[10] =
|
|
50
|
+
$[2] = panelMotion;
|
|
51
|
+
$[3] = props;
|
|
52
|
+
$[4] = resizable;
|
|
53
|
+
$[5] = style;
|
|
54
|
+
$[6] = t1;
|
|
55
|
+
$[7] = t2;
|
|
56
|
+
$[8] = t3;
|
|
57
|
+
$[9] = t4;
|
|
58
|
+
$[10] = t5;
|
|
59
|
+
$[11] = t6;
|
|
60
|
+
$[12] = t7;
|
|
48
61
|
} else {
|
|
49
62
|
className = $[1];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
panelMotion = $[2];
|
|
64
|
+
props = $[3];
|
|
65
|
+
resizable = $[4];
|
|
66
|
+
style = $[5];
|
|
67
|
+
t1 = $[6];
|
|
68
|
+
t2 = $[7];
|
|
69
|
+
t3 = $[8];
|
|
70
|
+
t4 = $[9];
|
|
71
|
+
t5 = $[10];
|
|
72
|
+
t6 = $[11];
|
|
73
|
+
t7 = $[12];
|
|
59
74
|
}
|
|
60
75
|
const panelHidden = t1 === undefined ? false : t1;
|
|
61
76
|
const railWidth = t2 === undefined ? "3.5rem" : t2;
|
|
@@ -63,98 +78,127 @@ function Root(t0) {
|
|
|
63
78
|
const scroll = t4 === undefined ? "contained" : t4;
|
|
64
79
|
const mobileHeaderHeight = t5 === undefined ? "calc(3.5rem + env(safe-area-inset-top, 0px))" : t5;
|
|
65
80
|
const mainId = t6 === undefined ? "main-content" : t6;
|
|
81
|
+
const variant = t7 === undefined ? "floating" : t7;
|
|
66
82
|
const resize = useSidebarResizeState(resizable);
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
if ($[
|
|
70
|
-
|
|
83
|
+
const t8 = resize ? `calc(${railWidth} + ${resize.width}px)` : sidebarWidth;
|
|
84
|
+
let t9;
|
|
85
|
+
if ($[13] !== mobileHeaderHeight || $[14] !== railWidth || $[15] !== t8) {
|
|
86
|
+
t9 = {
|
|
71
87
|
"--app-shell-rail-width": railWidth,
|
|
72
|
-
"--app-shell-sidebar-width":
|
|
88
|
+
"--app-shell-sidebar-width": t8,
|
|
73
89
|
"--app-shell-mobile-header-height": mobileHeaderHeight
|
|
74
90
|
};
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
91
|
+
$[13] = mobileHeaderHeight;
|
|
92
|
+
$[14] = railWidth;
|
|
93
|
+
$[15] = t8;
|
|
94
|
+
$[16] = t9;
|
|
79
95
|
} else {
|
|
80
|
-
|
|
96
|
+
t9 = $[16];
|
|
81
97
|
}
|
|
82
|
-
const vars =
|
|
83
|
-
let
|
|
84
|
-
if ($[
|
|
85
|
-
|
|
98
|
+
const vars = t9;
|
|
99
|
+
let t10;
|
|
100
|
+
if ($[17] !== mainId || $[18] !== panelHidden || $[19] !== scroll) {
|
|
101
|
+
t10 = {
|
|
86
102
|
mainId,
|
|
87
103
|
panelHidden,
|
|
88
104
|
scroll
|
|
89
105
|
};
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
106
|
+
$[17] = mainId;
|
|
107
|
+
$[18] = panelHidden;
|
|
108
|
+
$[19] = scroll;
|
|
109
|
+
$[20] = t10;
|
|
94
110
|
} else {
|
|
95
|
-
|
|
111
|
+
t10 = $[20];
|
|
96
112
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
$[21] =
|
|
113
|
+
const t11 = variant === "rail" && panelMotion !== "none";
|
|
114
|
+
const t12 = variant === "rail" ? "rail" : undefined;
|
|
115
|
+
const t13 = scroll === "document" ? "relative min-h-dvh bg-background" : "relative h-dvh overflow-hidden bg-background";
|
|
116
|
+
let t14;
|
|
117
|
+
if ($[21] !== className || $[22] !== t13) {
|
|
118
|
+
t14 = cn(t13, className);
|
|
119
|
+
$[21] = className;
|
|
120
|
+
$[22] = t13;
|
|
121
|
+
$[23] = t14;
|
|
104
122
|
} else {
|
|
105
|
-
|
|
123
|
+
t14 = $[23];
|
|
106
124
|
}
|
|
107
|
-
let
|
|
108
|
-
if ($[
|
|
109
|
-
|
|
125
|
+
let t15;
|
|
126
|
+
if ($[24] !== style || $[25] !== vars) {
|
|
127
|
+
t15 = {
|
|
110
128
|
...vars,
|
|
111
129
|
...style
|
|
112
130
|
};
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
131
|
+
$[24] = style;
|
|
132
|
+
$[25] = vars;
|
|
133
|
+
$[26] = t15;
|
|
116
134
|
} else {
|
|
117
|
-
|
|
135
|
+
t15 = $[26];
|
|
118
136
|
}
|
|
119
|
-
let
|
|
120
|
-
if ($[
|
|
121
|
-
|
|
137
|
+
let t16;
|
|
138
|
+
if ($[27] !== props || $[28] !== t12 || $[29] !== t14 || $[30] !== t15) {
|
|
139
|
+
t16 = /*#__PURE__*/_jsx("div", {
|
|
122
140
|
...props,
|
|
123
|
-
|
|
124
|
-
|
|
141
|
+
"data-shell-variant": t12,
|
|
142
|
+
className: t14,
|
|
143
|
+
style: t15
|
|
125
144
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
145
|
+
$[27] = props;
|
|
146
|
+
$[28] = t12;
|
|
147
|
+
$[29] = t14;
|
|
148
|
+
$[30] = t15;
|
|
149
|
+
$[31] = t16;
|
|
130
150
|
} else {
|
|
131
|
-
|
|
151
|
+
t16 = $[31];
|
|
132
152
|
}
|
|
133
|
-
let
|
|
134
|
-
if ($[
|
|
135
|
-
|
|
153
|
+
let t17;
|
|
154
|
+
if ($[32] !== resize || $[33] !== t16) {
|
|
155
|
+
t17 = /*#__PURE__*/_jsx(SidebarResizeProvider, {
|
|
136
156
|
value: resize,
|
|
137
|
-
children:
|
|
157
|
+
children: t16
|
|
138
158
|
});
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
159
|
+
$[32] = resize;
|
|
160
|
+
$[33] = t16;
|
|
161
|
+
$[34] = t17;
|
|
142
162
|
} else {
|
|
143
|
-
|
|
163
|
+
t17 = $[34];
|
|
144
164
|
}
|
|
145
|
-
let
|
|
146
|
-
if ($[
|
|
147
|
-
|
|
148
|
-
value:
|
|
149
|
-
children:
|
|
165
|
+
let t18;
|
|
166
|
+
if ($[35] !== t11 || $[36] !== t17) {
|
|
167
|
+
t18 = /*#__PURE__*/_jsx(AppShellPanelDockContext, {
|
|
168
|
+
value: t11,
|
|
169
|
+
children: t17
|
|
170
|
+
});
|
|
171
|
+
$[35] = t11;
|
|
172
|
+
$[36] = t17;
|
|
173
|
+
$[37] = t18;
|
|
174
|
+
} else {
|
|
175
|
+
t18 = $[37];
|
|
176
|
+
}
|
|
177
|
+
let t19;
|
|
178
|
+
if ($[38] !== t18 || $[39] !== variant) {
|
|
179
|
+
t19 = /*#__PURE__*/_jsx(AppShellVariantContext, {
|
|
180
|
+
value: variant,
|
|
181
|
+
children: t18
|
|
150
182
|
});
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
183
|
+
$[38] = t18;
|
|
184
|
+
$[39] = variant;
|
|
185
|
+
$[40] = t19;
|
|
154
186
|
} else {
|
|
155
|
-
|
|
187
|
+
t19 = $[40];
|
|
156
188
|
}
|
|
157
|
-
|
|
189
|
+
let t20;
|
|
190
|
+
if ($[41] !== t10 || $[42] !== t19) {
|
|
191
|
+
t20 = /*#__PURE__*/_jsx(AppShellContext.Provider, {
|
|
192
|
+
value: t10,
|
|
193
|
+
children: t19
|
|
194
|
+
});
|
|
195
|
+
$[41] = t10;
|
|
196
|
+
$[42] = t19;
|
|
197
|
+
$[43] = t20;
|
|
198
|
+
} else {
|
|
199
|
+
t20 = $[43];
|
|
200
|
+
}
|
|
201
|
+
return t20;
|
|
158
202
|
}
|
|
159
203
|
/** Visually hidden link to `<main>`, shown on focus. */
|
|
160
204
|
function SkipLink(t0) {
|
|
@@ -214,7 +258,7 @@ function SkipLink(t0) {
|
|
|
214
258
|
}
|
|
215
259
|
/** `<main>`, offset by the sidebar (or rail while the Root `panelHidden`). `id` defaults to the Root `mainId`. */
|
|
216
260
|
function Main(t0) {
|
|
217
|
-
const $ = _c(
|
|
261
|
+
const $ = _c(14);
|
|
218
262
|
let className;
|
|
219
263
|
let id;
|
|
220
264
|
let props;
|
|
@@ -240,39 +284,42 @@ function Main(t0) {
|
|
|
240
284
|
} = useContext(AppShellContext);
|
|
241
285
|
const pageScrolls = scroll === "document";
|
|
242
286
|
const resize = useSidebarResizeContext();
|
|
287
|
+
const rail = useAppShellVariant() === "rail";
|
|
243
288
|
const t1 = id ?? mainId;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
let t5;
|
|
248
|
-
if ($[4] !== className || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
249
|
-
t5 = cn(t2, t3, t4, className);
|
|
289
|
+
let t2;
|
|
290
|
+
if ($[4] !== className || $[5] !== pageScrolls || $[6] !== panelHidden || $[7] !== rail || $[8] !== resize?.isResizing) {
|
|
291
|
+
t2 = cn(pageScrolls ? "relative z-10 flex min-h-dvh outline-none" : cn("relative z-10 flex h-full min-h-0 outline-none", !rail && "md:p-2"), panelHidden ? "md:ml-[var(--app-shell-rail-width)]" : "md:ml-[var(--app-shell-sidebar-width)]", !pageScrolls && !resize?.isResizing && "md:transition-[margin-left] md:[transition-duration:280ms] md:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]", className);
|
|
250
292
|
$[4] = className;
|
|
251
|
-
$[5] =
|
|
252
|
-
$[6] =
|
|
253
|
-
$[7] =
|
|
254
|
-
$[8] =
|
|
293
|
+
$[5] = pageScrolls;
|
|
294
|
+
$[6] = panelHidden;
|
|
295
|
+
$[7] = rail;
|
|
296
|
+
$[8] = resize?.isResizing;
|
|
297
|
+
$[9] = t2;
|
|
255
298
|
} else {
|
|
256
|
-
|
|
299
|
+
t2 = $[9];
|
|
257
300
|
}
|
|
258
|
-
let
|
|
259
|
-
if ($[
|
|
260
|
-
|
|
301
|
+
let t3;
|
|
302
|
+
if ($[10] !== props || $[11] !== t1 || $[12] !== t2) {
|
|
303
|
+
t3 = /*#__PURE__*/_jsx("main", {
|
|
261
304
|
id: t1,
|
|
262
305
|
tabIndex: -1,
|
|
263
306
|
...props,
|
|
264
|
-
className:
|
|
307
|
+
className: t2
|
|
265
308
|
});
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
309
|
+
$[10] = props;
|
|
310
|
+
$[11] = t1;
|
|
311
|
+
$[12] = t2;
|
|
312
|
+
$[13] = t3;
|
|
270
313
|
} else {
|
|
271
|
-
|
|
314
|
+
t3 = $[13];
|
|
272
315
|
}
|
|
273
|
-
return
|
|
316
|
+
return t3;
|
|
274
317
|
}
|
|
275
|
-
/**
|
|
318
|
+
/**
|
|
319
|
+
* Content card inside `<main>`. A plain column, with no card, while the Root
|
|
320
|
+
* `scroll` is `"document"` or its `variant` is `"rail"`. Pads for the mobile
|
|
321
|
+
* header below `md`.
|
|
322
|
+
*/
|
|
276
323
|
function Content(t0) {
|
|
277
324
|
const $ = _c(9);
|
|
278
325
|
let className;
|
|
@@ -292,7 +339,8 @@ function Content(t0) {
|
|
|
292
339
|
const {
|
|
293
340
|
scroll
|
|
294
341
|
} = useContext(AppShellContext);
|
|
295
|
-
const
|
|
342
|
+
const rail = useAppShellVariant() === "rail";
|
|
343
|
+
const t1 = scroll === "document" ? "flex min-w-0 flex-1 flex-col pt-[var(--app-shell-mobile-header-height)] md:pt-0" : rail ? "flex min-h-0 flex-1 flex-col overflow-hidden pt-[var(--app-shell-mobile-header-height)] md:pt-0" : "flex min-h-0 flex-1 flex-col overflow-hidden bg-surface pt-[var(--app-shell-mobile-header-height)] md:rounded-lg md:pt-0";
|
|
296
344
|
let t2;
|
|
297
345
|
if ($[3] !== className || $[4] !== t1) {
|
|
298
346
|
t2 = cn(t1, className);
|
|
@@ -323,7 +371,7 @@ function Content(t0) {
|
|
|
323
371
|
* `.Main` and `.Content`.
|
|
324
372
|
*/
|
|
325
373
|
function LegacyAppShell(t0) {
|
|
326
|
-
const $ = _c(
|
|
374
|
+
const $ = _c(26);
|
|
327
375
|
const {
|
|
328
376
|
sidebar,
|
|
329
377
|
children,
|
|
@@ -335,53 +383,69 @@ function LegacyAppShell(t0) {
|
|
|
335
383
|
mobileHeaderHeight,
|
|
336
384
|
skipLinkLabel,
|
|
337
385
|
mainId: t2,
|
|
386
|
+
variant: t3,
|
|
387
|
+
panelMotion,
|
|
338
388
|
className,
|
|
339
389
|
mainClassName,
|
|
340
390
|
contentClassName
|
|
341
391
|
} = t0;
|
|
342
392
|
const panelHidden = t1 === undefined ? false : t1;
|
|
343
393
|
const mainId = t2 === undefined ? "main-content" : t2;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
394
|
+
const variant = t3 === undefined ? "floating" : t3;
|
|
395
|
+
let t4;
|
|
396
|
+
if ($[0] !== panelMotion || $[1] !== variant) {
|
|
397
|
+
t4 = variant === "rail" ? {
|
|
398
|
+
variant: "rail",
|
|
399
|
+
panelMotion
|
|
400
|
+
} : {};
|
|
401
|
+
$[0] = panelMotion;
|
|
402
|
+
$[1] = variant;
|
|
403
|
+
$[2] = t4;
|
|
404
|
+
} else {
|
|
405
|
+
t4 = $[2];
|
|
406
|
+
}
|
|
407
|
+
const layout = t4;
|
|
408
|
+
let t5;
|
|
409
|
+
if ($[3] !== mainId || $[4] !== skipLinkLabel) {
|
|
410
|
+
t5 = /*#__PURE__*/_jsx(SkipLink, {
|
|
347
411
|
label: skipLinkLabel,
|
|
348
412
|
targetId: mainId
|
|
349
413
|
});
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
414
|
+
$[3] = mainId;
|
|
415
|
+
$[4] = skipLinkLabel;
|
|
416
|
+
$[5] = t5;
|
|
353
417
|
} else {
|
|
354
|
-
|
|
418
|
+
t5 = $[5];
|
|
355
419
|
}
|
|
356
|
-
let
|
|
357
|
-
if ($[
|
|
358
|
-
|
|
420
|
+
let t6;
|
|
421
|
+
if ($[6] !== children || $[7] !== contentClassName) {
|
|
422
|
+
t6 = /*#__PURE__*/_jsx(Content, {
|
|
359
423
|
className: contentClassName,
|
|
360
424
|
children: children
|
|
361
425
|
});
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
426
|
+
$[6] = children;
|
|
427
|
+
$[7] = contentClassName;
|
|
428
|
+
$[8] = t6;
|
|
365
429
|
} else {
|
|
366
|
-
|
|
430
|
+
t6 = $[8];
|
|
367
431
|
}
|
|
368
|
-
let
|
|
369
|
-
if ($[
|
|
370
|
-
|
|
432
|
+
let t7;
|
|
433
|
+
if ($[9] !== mainClassName || $[10] !== mainId || $[11] !== t6) {
|
|
434
|
+
t7 = /*#__PURE__*/_jsx(Main, {
|
|
371
435
|
id: mainId,
|
|
372
436
|
className: mainClassName,
|
|
373
|
-
children:
|
|
437
|
+
children: t6
|
|
374
438
|
});
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
439
|
+
$[9] = mainClassName;
|
|
440
|
+
$[10] = mainId;
|
|
441
|
+
$[11] = t6;
|
|
442
|
+
$[12] = t7;
|
|
379
443
|
} else {
|
|
380
|
-
|
|
444
|
+
t7 = $[12];
|
|
381
445
|
}
|
|
382
|
-
let
|
|
383
|
-
if ($[
|
|
384
|
-
|
|
446
|
+
let t8;
|
|
447
|
+
if ($[13] !== className || $[14] !== layout || $[15] !== mainId || $[16] !== mobileHeaderHeight || $[17] !== panelHidden || $[18] !== railWidth || $[19] !== resizable || $[20] !== scroll || $[21] !== sidebar || $[22] !== sidebarWidth || $[23] !== t5 || $[24] !== t7) {
|
|
448
|
+
t8 = /*#__PURE__*/_jsxs(Root, {
|
|
385
449
|
panelHidden: panelHidden,
|
|
386
450
|
railWidth: railWidth,
|
|
387
451
|
sidebarWidth: sidebarWidth,
|
|
@@ -389,25 +453,27 @@ function LegacyAppShell(t0) {
|
|
|
389
453
|
scroll: scroll,
|
|
390
454
|
mobileHeaderHeight: mobileHeaderHeight,
|
|
391
455
|
mainId: mainId,
|
|
456
|
+
...layout,
|
|
392
457
|
className: className,
|
|
393
|
-
children: [
|
|
458
|
+
children: [t5, sidebar, t7]
|
|
394
459
|
});
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
460
|
+
$[13] = className;
|
|
461
|
+
$[14] = layout;
|
|
462
|
+
$[15] = mainId;
|
|
463
|
+
$[16] = mobileHeaderHeight;
|
|
464
|
+
$[17] = panelHidden;
|
|
465
|
+
$[18] = railWidth;
|
|
466
|
+
$[19] = resizable;
|
|
467
|
+
$[20] = scroll;
|
|
468
|
+
$[21] = sidebar;
|
|
469
|
+
$[22] = sidebarWidth;
|
|
470
|
+
$[23] = t5;
|
|
471
|
+
$[24] = t7;
|
|
472
|
+
$[25] = t8;
|
|
407
473
|
} else {
|
|
408
|
-
|
|
474
|
+
t8 = $[25];
|
|
409
475
|
}
|
|
410
|
-
return
|
|
476
|
+
return t8;
|
|
411
477
|
}
|
|
412
478
|
LegacyAppShell.displayName = "AppShell";
|
|
413
479
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { cn } from "../../src/utils/cn.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The trough of a `ButtonTrack`: the `Sidebar.RailGroup` tone as a row.
|
|
6
|
+
* Buttons on it are flat (the trough is their surface) and hover at half the
|
|
7
|
+
* pill tone. Empty, it takes no space.
|
|
8
|
+
*/
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export const buttonTrackClass = "flex shrink-0 items-center gap-0.5 rounded-xl bg-default p-0.5 empty:hidden [&_button]:bg-transparent [&_button:not([data-active]):not(:disabled):hover]:bg-segment/50";
|
|
11
|
+
/** A group of icon buttons on one trough, for example the actions of a page header. */
|
|
12
|
+
export function ButtonTrack(t0) {
|
|
13
|
+
const $ = _c(10);
|
|
14
|
+
let className;
|
|
15
|
+
let props;
|
|
16
|
+
let t1;
|
|
17
|
+
if ($[0] !== t0) {
|
|
18
|
+
({
|
|
19
|
+
direction: t1,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
} = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = className;
|
|
25
|
+
$[2] = props;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
className = $[1];
|
|
29
|
+
props = $[2];
|
|
30
|
+
t1 = $[3];
|
|
31
|
+
}
|
|
32
|
+
const direction = t1 === undefined ? "row" : t1;
|
|
33
|
+
const t2 = direction === "column" ? "gap-1 md:flex-col" : "flex-wrap justify-end";
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[4] !== className || $[5] !== t2) {
|
|
36
|
+
t3 = cn(buttonTrackClass, t2, className);
|
|
37
|
+
$[4] = className;
|
|
38
|
+
$[5] = t2;
|
|
39
|
+
$[6] = t3;
|
|
40
|
+
} else {
|
|
41
|
+
t3 = $[6];
|
|
42
|
+
}
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[7] !== props || $[8] !== t3) {
|
|
45
|
+
t4 = /*#__PURE__*/_jsx("div", {
|
|
46
|
+
role: "group",
|
|
47
|
+
...props,
|
|
48
|
+
className: t3
|
|
49
|
+
});
|
|
50
|
+
$[7] = props;
|
|
51
|
+
$[8] = t3;
|
|
52
|
+
$[9] = t4;
|
|
53
|
+
} else {
|
|
54
|
+
t4 = $[9];
|
|
55
|
+
}
|
|
56
|
+
return t4;
|
|
57
|
+
}
|