@ngrok/mantle 0.86.3 → 0.88.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/dist/agent.json +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/app-layout.d.ts +412 -104
- package/dist/app-layout.js +1 -1
- package/dist/command.d.ts +30 -19
- package/dist/command.js +1 -1
- package/dist/description-list.d.ts +4 -0
- package/dist/description-list.js +1 -1
- package/dist/{dialog-D8Bb_pil.js → dialog-HIdb5d3I.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/hooks.d.ts +36 -1
- package/dist/hooks.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main-Dv2zuT_b.js +1 -0
- package/dist/main.d.ts +8 -12
- package/dist/main.js +1 -1
- package/dist/mantle.css +9 -20
- package/dist/primitive-w3wFk2La.js +1 -0
- package/dist/sheet-B5x8EO9Y.js +1 -0
- package/dist/sheet.d.ts +213 -4
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +64 -64
- package/dist/sidebar.js +1 -1
- package/dist/tabs.d.ts +172 -33
- package/dist/tabs.js +1 -1
- package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +1 -0
- package/package.json +2 -2
- package/dist/primitive-vXDjYdbu.js +0 -1
- package/dist/sheet-CIgu6vwS.js +0 -1
- package/dist/use-breakpoint-CjyNk0fi.js +0 -1
package/dist/sheet.d.ts
CHANGED
|
@@ -1,8 +1,204 @@
|
|
|
1
1
|
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-crUf0hbR.js";
|
|
2
|
-
import { n as Content$1, r as Description$1, s as Title$1 } from "./dialog-CZYD3xL-.js";
|
|
2
|
+
import { c as Trigger$1, n as Content$1, o as Root$1, r as Description$1, s as Title$1, t as Close$1 } from "./dialog-CZYD3xL-.js";
|
|
3
3
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
//#region src/components/sheet/sheet.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The root component for a `Sheet`. Should compose the `Sheet.Trigger` and `Sheet.Content`.
|
|
8
|
+
* Acts as a stateful provider for the Sheet's open/closed state.
|
|
9
|
+
*
|
|
10
|
+
* Every `Sheet` part reads a dialog scope of its own, so it binds to the
|
|
11
|
+
* nearest `Sheet.Root` and never to a `Dialog.Root`. The reverse holds too: a
|
|
12
|
+
* `Dialog.Trigger` or `Command.SearchTrigger` inside `Sheet.Content` reaches
|
|
13
|
+
* the `Dialog.Root` or `Command.DialogRoot` above the sheet, not the sheet. A
|
|
14
|
+
* `Dialog.Close` inside a sheet with no `Dialog.Root` above it throws Radix's
|
|
15
|
+
* "must be used within `Dialog`"; use `Sheet.Close` to close a sheet.
|
|
16
|
+
*
|
|
17
|
+
* `Sheet` renders its floating layer at Tailwind `z-60`, Mantle's overlay tier,
|
|
18
|
+
* above every float (`z-50`). Floats composed inside the content portal into
|
|
19
|
+
* the positioner (`data-slot="sheet-positioner"`) and paint above the content.
|
|
20
|
+
* When multiple overlays are open, the most recently mounted overlay renders on
|
|
21
|
+
* top.
|
|
22
|
+
*
|
|
23
|
+
* @see https://mantle.ngrok.com/components/overlays/sheet#sheetroot
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // Triggering a stateful sheet
|
|
28
|
+
* <Sheet.Root>
|
|
29
|
+
* <Sheet.Trigger asChild>
|
|
30
|
+
* <Button type="button" appearance="filled" intent="neutral">
|
|
31
|
+
* Open Sheet
|
|
32
|
+
* </Button>
|
|
33
|
+
* </Sheet.Trigger>
|
|
34
|
+
* <Sheet.Content>
|
|
35
|
+
* <Sheet.Header>
|
|
36
|
+
* <Sheet.TitleGroup>
|
|
37
|
+
* <Sheet.Title>Are you absolutely sure?</Sheet.Title>
|
|
38
|
+
* <Sheet.Actions>
|
|
39
|
+
* <IconButton
|
|
40
|
+
* appearance="ghost"
|
|
41
|
+
* intent="neutral"
|
|
42
|
+
* type="button"
|
|
43
|
+
* icon={<TrashSimple />}
|
|
44
|
+
* label="Delete"
|
|
45
|
+
* />
|
|
46
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
47
|
+
* <Sheet.CloseIconButton />
|
|
48
|
+
* </Sheet.Actions>
|
|
49
|
+
* </Sheet.TitleGroup>
|
|
50
|
+
* <Sheet.Description>
|
|
51
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
52
|
+
* </Sheet.Description>
|
|
53
|
+
* </Sheet.Header>
|
|
54
|
+
* <Sheet.Body>
|
|
55
|
+
* <p>
|
|
56
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
57
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
58
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
59
|
+
* proident amet.
|
|
60
|
+
* </p>
|
|
61
|
+
* </Sheet.Body>
|
|
62
|
+
* <Sheet.Footer>
|
|
63
|
+
* <Sheet.Close asChild>
|
|
64
|
+
* <Button type="button" appearance="outlined" intent="neutral">Close</Button>
|
|
65
|
+
* </Sheet.Close>
|
|
66
|
+
* <Button type="button" appearance="filled" intent="neutral">
|
|
67
|
+
* Save
|
|
68
|
+
* </Button>
|
|
69
|
+
* </Sheet.Footer>
|
|
70
|
+
* </Sheet.Content>
|
|
71
|
+
* </Sheet.Root>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
77
|
+
* <Sheet.Root open onOpenChange={() => onClose()}>
|
|
78
|
+
* <Sheet.Content>
|
|
79
|
+
* <Sheet.Header>
|
|
80
|
+
* <Sheet.TitleGroup>
|
|
81
|
+
* <Sheet.Title>Are you absolutely sure?</Sheet.Title>
|
|
82
|
+
* <Sheet.Actions>
|
|
83
|
+
* <IconButton
|
|
84
|
+
* appearance="ghost"
|
|
85
|
+
* intent="neutral"
|
|
86
|
+
* type="button"
|
|
87
|
+
* icon={<TrashSimple />}
|
|
88
|
+
* label="Delete"
|
|
89
|
+
* />
|
|
90
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
91
|
+
* <Sheet.CloseIconButton />
|
|
92
|
+
* </Sheet.Actions>
|
|
93
|
+
* </Sheet.TitleGroup>
|
|
94
|
+
* <Sheet.Description>
|
|
95
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
96
|
+
* </Sheet.Description>
|
|
97
|
+
* </Sheet.Header>
|
|
98
|
+
* <Sheet.Body>
|
|
99
|
+
* <p>
|
|
100
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
101
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
102
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
103
|
+
* proident amet.
|
|
104
|
+
* </p>
|
|
105
|
+
* </Sheet.Body>
|
|
106
|
+
* <Sheet.Footer>
|
|
107
|
+
* <Sheet.Close asChild>
|
|
108
|
+
* <Button type="button" appearance="outlined" intent="neutral">Close</Button>
|
|
109
|
+
* </Sheet.Close>
|
|
110
|
+
* <Button type="button" appearance="filled" intent="neutral">
|
|
111
|
+
* Save
|
|
112
|
+
* </Button>
|
|
113
|
+
* </Sheet.Footer>
|
|
114
|
+
* </Sheet.Content>
|
|
115
|
+
* </Sheet.Root>
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
declare const Root: (props: ComponentProps<typeof Root$1>) => import("react").JSX.Element;
|
|
119
|
+
/**
|
|
120
|
+
* The button trigger for a `Sheet`. Should be rendered as a child of the `Sheet` component.
|
|
121
|
+
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
122
|
+
*
|
|
123
|
+
* Opens the nearest `Sheet.Root`. It never opens a `Dialog.Root`, and a
|
|
124
|
+
* `Dialog.Trigger` inside the sheet never opens the sheet.
|
|
125
|
+
*
|
|
126
|
+
* @see https://mantle.ngrok.com/components/overlays/sheet#sheettrigger
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* <Sheet.Root>
|
|
131
|
+
* <Sheet.Trigger asChild>
|
|
132
|
+
* <Button type="button" appearance="filled" intent="neutral">Open Sheet</Button>
|
|
133
|
+
* </Sheet.Trigger>
|
|
134
|
+
* <Sheet.Content>
|
|
135
|
+
* <Sheet.Header>
|
|
136
|
+
* <Sheet.TitleGroup>
|
|
137
|
+
* <Sheet.Title>Are you absolutely sure?</Sheet.Title>
|
|
138
|
+
* <Sheet.Actions>
|
|
139
|
+
* <Sheet.CloseIconButton />
|
|
140
|
+
* </Sheet.Actions>
|
|
141
|
+
* </Sheet.TitleGroup>
|
|
142
|
+
* <Sheet.Description>
|
|
143
|
+
* This action cannot be undone.
|
|
144
|
+
* </Sheet.Description>
|
|
145
|
+
* </Sheet.Header>
|
|
146
|
+
* <Sheet.Body>
|
|
147
|
+
* <p>Sheet content.</p>
|
|
148
|
+
* </Sheet.Body>
|
|
149
|
+
* <Sheet.Footer>
|
|
150
|
+
* <Sheet.Close asChild>
|
|
151
|
+
* <Button type="button" appearance="outlined" intent="neutral">Close</Button>
|
|
152
|
+
* </Sheet.Close>
|
|
153
|
+
* <Button type="button" appearance="filled" intent="neutral">Save</Button>
|
|
154
|
+
* </Sheet.Footer>
|
|
155
|
+
* </Sheet.Content>
|
|
156
|
+
* </Sheet.Root>
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare const Trigger: (props: ComponentProps<typeof Trigger$1>) => import("react").JSX.Element;
|
|
160
|
+
/**
|
|
161
|
+
* The close button for a `Sheet`. Should be rendered as a child of the `Sheet.Content` component.
|
|
162
|
+
* Usually contained within the `Sheet.Footer` component.
|
|
163
|
+
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
164
|
+
*
|
|
165
|
+
* Closes the nearest `Sheet.Root`. It never closes a `Dialog.Root`, and a
|
|
166
|
+
* `Dialog.Close` inside the sheet never closes the sheet.
|
|
167
|
+
*
|
|
168
|
+
* @see https://mantle.ngrok.com/components/overlays/sheet#sheetclose
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```tsx
|
|
172
|
+
* <Sheet.Root>
|
|
173
|
+
* <Sheet.Trigger asChild>
|
|
174
|
+
* <Button type="button" appearance="filled" intent="neutral">Open Sheet</Button>
|
|
175
|
+
* </Sheet.Trigger>
|
|
176
|
+
* <Sheet.Content>
|
|
177
|
+
* <Sheet.Header>
|
|
178
|
+
* <Sheet.TitleGroup>
|
|
179
|
+
* <Sheet.Title>Are you absolutely sure?</Sheet.Title>
|
|
180
|
+
* <Sheet.Actions>
|
|
181
|
+
* <Sheet.CloseIconButton />
|
|
182
|
+
* </Sheet.Actions>
|
|
183
|
+
* </Sheet.TitleGroup>
|
|
184
|
+
* <Sheet.Description>
|
|
185
|
+
* This action cannot be undone.
|
|
186
|
+
* </Sheet.Description>
|
|
187
|
+
* </Sheet.Header>
|
|
188
|
+
* <Sheet.Body>
|
|
189
|
+
* <p>Sheet content.</p>
|
|
190
|
+
* </Sheet.Body>
|
|
191
|
+
* <Sheet.Footer>
|
|
192
|
+
* <Sheet.Close asChild>
|
|
193
|
+
* <Button type="button" appearance="outlined" intent="neutral">Close</Button>
|
|
194
|
+
* </Sheet.Close>
|
|
195
|
+
* <Button type="button" appearance="filled" intent="neutral">Save</Button>
|
|
196
|
+
* </Sheet.Footer>
|
|
197
|
+
* </Sheet.Content>
|
|
198
|
+
* </Sheet.Root>
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare const Close: (props: ComponentProps<typeof Close$1>) => import("react").JSX.Element;
|
|
6
202
|
declare const sheetVariants: (props?: ({
|
|
7
203
|
side?: "left" | "right" | null | undefined;
|
|
8
204
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -633,6 +829,13 @@ declare const Sheet: {
|
|
|
633
829
|
* The root component for a `Sheet`. Should compose the `Sheet.Trigger` and `Sheet.Content`.
|
|
634
830
|
* Acts as a stateful provider for the Sheet's open/closed state.
|
|
635
831
|
*
|
|
832
|
+
* Every `Sheet` part reads a dialog scope of its own, so it binds to the
|
|
833
|
+
* nearest `Sheet.Root` and never to a `Dialog.Root`. The reverse holds too: a
|
|
834
|
+
* `Dialog.Trigger` or `Command.SearchTrigger` inside `Sheet.Content` reaches
|
|
835
|
+
* the `Dialog.Root` or `Command.DialogRoot` above the sheet, not the sheet. A
|
|
836
|
+
* `Dialog.Close` inside a sheet with no `Dialog.Root` above it throws Radix's
|
|
837
|
+
* "must be used within `Dialog`"; use `Sheet.Close` to close a sheet.
|
|
838
|
+
*
|
|
636
839
|
* `Sheet` renders its floating layer at Tailwind `z-60`, Mantle's overlay
|
|
637
840
|
* tier, above every float (`z-50`). Floats composed inside the content portal
|
|
638
841
|
* into the positioner (`data-slot="sheet-positioner"`) and paint above the
|
|
@@ -672,7 +875,7 @@ declare const Sheet: {
|
|
|
672
875
|
* </Sheet.Root>
|
|
673
876
|
* ```
|
|
674
877
|
*/
|
|
675
|
-
readonly Root:
|
|
878
|
+
readonly Root: typeof Root;
|
|
676
879
|
/**
|
|
677
880
|
* A group container for the actions of a `Sheet`. Typically rendered as a child of `Sheet.TitleGroup`.
|
|
678
881
|
*
|
|
@@ -753,6 +956,9 @@ declare const Sheet: {
|
|
|
753
956
|
* Usually contained within the `Sheet.Footer` component.
|
|
754
957
|
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
755
958
|
*
|
|
959
|
+
* Closes the nearest `Sheet.Root`. It never closes a `Dialog.Root`, and a
|
|
960
|
+
* `Dialog.Close` inside the sheet never closes the sheet.
|
|
961
|
+
*
|
|
756
962
|
* @see https://mantle.ngrok.com/components/overlays/sheet#sheetclose
|
|
757
963
|
*
|
|
758
964
|
* @example
|
|
@@ -786,7 +992,7 @@ declare const Sheet: {
|
|
|
786
992
|
* </Sheet.Root>
|
|
787
993
|
* ```
|
|
788
994
|
*/
|
|
789
|
-
readonly Close:
|
|
995
|
+
readonly Close: typeof Close;
|
|
790
996
|
/**
|
|
791
997
|
* An icon button that closes the `Sheet` when clicked.
|
|
792
998
|
* Should be rendered within the `Sheet.Header` as a child of `Sheet.Actions`.
|
|
@@ -1065,6 +1271,9 @@ declare const Sheet: {
|
|
|
1065
1271
|
* The button trigger for a `Sheet`. Should be rendered as a child of the `Sheet` component.
|
|
1066
1272
|
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
1067
1273
|
*
|
|
1274
|
+
* Opens the nearest `Sheet.Root`. It never opens a `Dialog.Root`, and a
|
|
1275
|
+
* `Dialog.Trigger` inside the sheet never opens the sheet.
|
|
1276
|
+
*
|
|
1068
1277
|
* @see https://mantle.ngrok.com/components/overlays/sheet#sheettrigger
|
|
1069
1278
|
*
|
|
1070
1279
|
* @example
|
|
@@ -1098,7 +1307,7 @@ declare const Sheet: {
|
|
|
1098
1307
|
* </Sheet.Root>
|
|
1099
1308
|
* ```
|
|
1100
1309
|
*/
|
|
1101
|
-
readonly Trigger:
|
|
1310
|
+
readonly Trigger: typeof Trigger;
|
|
1102
1311
|
};
|
|
1103
1312
|
//#endregion
|
|
1104
1313
|
export { Sheet };
|
package/dist/sheet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./sheet-
|
|
1
|
+
import{t as e}from"./sheet-B5x8EO9Y.js";export{e as Sheet};
|
package/dist/sidebar.d.ts
CHANGED
|
@@ -273,7 +273,7 @@ type SidebarNavProps = ComponentProps<"div"> & WithDataSlot;
|
|
|
273
273
|
* | Data Attribute | Value | Description |
|
|
274
274
|
* | --- | --- | --- |
|
|
275
275
|
* | `data-state` | `"expanded"` \| `"collapsed"` | On the desktop panel surface. Mirrors the root's expanded state and drives the width collapse to the icon rail; descendant parts style off it with `group-data-[state=collapsed]/sidebar-nav:`. |
|
|
276
|
-
* | `data-hydrated` | present after hydration | Presence-only, desktop panel surface. The
|
|
276
|
+
* | `data-hydrated` | present one frame after hydration | Presence-only, desktop panel surface. The panel's pre-hydration visibility gate, its width transition, and descendant collapse transitions all key off its absence in CSS (`not-data-hydrated:`, `group-not-data-hydrated/sidebar-nav:`). The stamp waits one frame, so an SSR state correction paints first and snaps instead of animating on page load. |
|
|
277
277
|
* | `data-mobile` | present in the mobile sheet | Presence-only. Marks the `Sheet.Content` presentation used below the root's `mobileBreakpoint`. |
|
|
278
278
|
* | `data-state` | `"open"` \| `"closed"` | In the mobile sheet only, where the panel *is* the `Sheet`'s Radix dialog content element and Radix owns the attribute — the sheet's open/close animation state, not the desktop expanded state. Consumers style against it too. |
|
|
279
279
|
*
|
|
@@ -1099,15 +1099,15 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1099
1099
|
* @example
|
|
1100
1100
|
* ```tsx
|
|
1101
1101
|
* <Sidebar.Root>
|
|
1102
|
-
* <
|
|
1103
|
-
* <Sidebar.
|
|
1104
|
-
* <Sidebar.
|
|
1105
|
-
* <
|
|
1106
|
-
*
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
* <
|
|
1102
|
+
* <Command.DialogRoot>
|
|
1103
|
+
* <Sidebar.Nav aria-label="Main">
|
|
1104
|
+
* <Sidebar.Header>
|
|
1105
|
+
* <Sidebar.SwitcherTrigger>
|
|
1106
|
+
* <GlobeIcon />
|
|
1107
|
+
* <span className="text-strong min-w-0 flex-1 truncate text-base">Universal Gateway</span>
|
|
1108
|
+
* </Sidebar.SwitcherTrigger>
|
|
1109
|
+
* </Sidebar.Header>
|
|
1110
|
+
* <Sidebar.Body>
|
|
1111
1111
|
* <Sidebar.Tooltip label="Search">
|
|
1112
1112
|
* <Command.SearchTrigger>
|
|
1113
1113
|
* <Sidebar.SearchTrigger
|
|
@@ -1123,28 +1123,28 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1123
1123
|
* </Sidebar.SearchTrigger>
|
|
1124
1124
|
* </Command.SearchTrigger>
|
|
1125
1125
|
* </Sidebar.Tooltip>
|
|
1126
|
-
* <
|
|
1127
|
-
* <
|
|
1128
|
-
* <
|
|
1129
|
-
* <
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
*
|
|
1145
|
-
* </
|
|
1146
|
-
* </
|
|
1147
|
-
* </
|
|
1126
|
+
* <Sidebar.Group>
|
|
1127
|
+
* <Sidebar.GroupLabel>Traffic</Sidebar.GroupLabel>
|
|
1128
|
+
* <Sidebar.List>
|
|
1129
|
+
* <Sidebar.Item>
|
|
1130
|
+
* <Sidebar.ItemButton asChild current>
|
|
1131
|
+
* <a href="/endpoints">
|
|
1132
|
+
* <GraphIcon />
|
|
1133
|
+
* Endpoints
|
|
1134
|
+
* </a>
|
|
1135
|
+
* </Sidebar.ItemButton>
|
|
1136
|
+
* </Sidebar.Item>
|
|
1137
|
+
* </Sidebar.List>
|
|
1138
|
+
* </Sidebar.Group>
|
|
1139
|
+
* </Sidebar.Body>
|
|
1140
|
+
* </Sidebar.Nav>
|
|
1141
|
+
* <Command.DialogContent>
|
|
1142
|
+
* <Command.Input placeholder="Search endpoints, agents, and settings..." />
|
|
1143
|
+
* <Command.List>
|
|
1144
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
1145
|
+
* </Command.List>
|
|
1146
|
+
* </Command.DialogContent>
|
|
1147
|
+
* </Command.DialogRoot>
|
|
1148
1148
|
* <Sidebar.Trigger />
|
|
1149
1149
|
* </Sidebar.Root>
|
|
1150
1150
|
* ```
|
|
@@ -1586,7 +1586,7 @@ declare const Sidebar: {
|
|
|
1586
1586
|
* | Data Attribute | Value | Description |
|
|
1587
1587
|
* | --- | --- | --- |
|
|
1588
1588
|
* | `data-state` | `"expanded"` \| `"collapsed"` | On the desktop panel surface. Mirrors the root's expanded state and drives the width collapse to the icon rail; descendant parts style off it with `group-data-[state=collapsed]/sidebar-nav:`. |
|
|
1589
|
-
* | `data-hydrated` | present after hydration | Presence-only, desktop panel surface. The
|
|
1589
|
+
* | `data-hydrated` | present one frame after hydration | Presence-only, desktop panel surface. The panel's pre-hydration visibility gate, its width transition, and descendant collapse transitions all key off its absence in CSS (`not-data-hydrated:`, `group-not-data-hydrated/sidebar-nav:`). The stamp waits one frame, so an SSR state correction paints first and snaps instead of animating on page load. |
|
|
1590
1590
|
* | `data-mobile` | present in the mobile sheet | Presence-only. Marks the `Sheet.Content` presentation used below the root's `mobileBreakpoint`. |
|
|
1591
1591
|
* | `data-state` | `"open"` \| `"closed"` | In the mobile sheet only, where the panel *is* the `Sheet`'s Radix dialog content element and Radix owns the attribute — the sheet's open/close animation state, not the desktop expanded state. Consumers style against it too. |
|
|
1592
1592
|
*
|
|
@@ -2193,15 +2193,15 @@ declare const Sidebar: {
|
|
|
2193
2193
|
* @example
|
|
2194
2194
|
* ```tsx
|
|
2195
2195
|
* <Sidebar.Root>
|
|
2196
|
-
* <
|
|
2197
|
-
* <Sidebar.
|
|
2198
|
-
* <Sidebar.
|
|
2199
|
-
* <
|
|
2200
|
-
*
|
|
2201
|
-
*
|
|
2202
|
-
*
|
|
2203
|
-
*
|
|
2204
|
-
* <
|
|
2196
|
+
* <Command.DialogRoot>
|
|
2197
|
+
* <Sidebar.Nav aria-label="Main">
|
|
2198
|
+
* <Sidebar.Header>
|
|
2199
|
+
* <Sidebar.SwitcherTrigger>
|
|
2200
|
+
* <GlobeIcon />
|
|
2201
|
+
* <span className="text-strong min-w-0 flex-1 truncate text-base">Universal Gateway</span>
|
|
2202
|
+
* </Sidebar.SwitcherTrigger>
|
|
2203
|
+
* </Sidebar.Header>
|
|
2204
|
+
* <Sidebar.Body>
|
|
2205
2205
|
* <Sidebar.Tooltip label="Search">
|
|
2206
2206
|
* <Command.SearchTrigger>
|
|
2207
2207
|
* <Sidebar.SearchTrigger
|
|
@@ -2217,28 +2217,28 @@ declare const Sidebar: {
|
|
|
2217
2217
|
* </Sidebar.SearchTrigger>
|
|
2218
2218
|
* </Command.SearchTrigger>
|
|
2219
2219
|
* </Sidebar.Tooltip>
|
|
2220
|
-
* <
|
|
2221
|
-
* <
|
|
2222
|
-
* <
|
|
2223
|
-
* <
|
|
2224
|
-
*
|
|
2225
|
-
*
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2228
|
-
*
|
|
2229
|
-
*
|
|
2230
|
-
*
|
|
2231
|
-
*
|
|
2232
|
-
*
|
|
2233
|
-
*
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
*
|
|
2237
|
-
*
|
|
2238
|
-
*
|
|
2239
|
-
* </
|
|
2240
|
-
* </
|
|
2241
|
-
* </
|
|
2220
|
+
* <Sidebar.Group>
|
|
2221
|
+
* <Sidebar.GroupLabel>Traffic</Sidebar.GroupLabel>
|
|
2222
|
+
* <Sidebar.List>
|
|
2223
|
+
* <Sidebar.Item>
|
|
2224
|
+
* <Sidebar.ItemButton asChild current>
|
|
2225
|
+
* <a href="/endpoints">
|
|
2226
|
+
* <GraphIcon />
|
|
2227
|
+
* Endpoints
|
|
2228
|
+
* </a>
|
|
2229
|
+
* </Sidebar.ItemButton>
|
|
2230
|
+
* </Sidebar.Item>
|
|
2231
|
+
* </Sidebar.List>
|
|
2232
|
+
* </Sidebar.Group>
|
|
2233
|
+
* </Sidebar.Body>
|
|
2234
|
+
* </Sidebar.Nav>
|
|
2235
|
+
* <Command.DialogContent>
|
|
2236
|
+
* <Command.Input placeholder="Search endpoints, agents, and settings..." />
|
|
2237
|
+
* <Command.List>
|
|
2238
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
2239
|
+
* </Command.List>
|
|
2240
|
+
* </Command.DialogContent>
|
|
2241
|
+
* </Command.DialogRoot>
|
|
2242
2242
|
* <Sidebar.Trigger />
|
|
2243
2243
|
* </Sidebar.Root>
|
|
2244
2244
|
* ```
|
package/dist/sidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-CIgu6vwS.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-H03l7E4Y.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{n as i}from"./separator-D98be0gY.js";import{n as a,t as o}from"./use-is-apple-platform-CMPzIYjz.js";import{t as s}from"./use-callback-ref-BvVyI5K1.js";import{n as c}from"./cookie-ca4g5CKp.js";import{t as l}from"./sheet-B5x8EO9Y.js";import{i as u,t as d}from"./use-is-hydrated-after-paint-Drj0lNi4.js";import{t as f}from"./tooltip-H03l7E4Y.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`max-sm:not-data-hydrated:hidden`,md:`max-md:not-data-hydrated:hidden`,lg:`max-lg:not-data-hydrated:hidden`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:o,onOpenChange:c,onOpenMobileChange:l,open:d,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=o===void 0?`lg`:o,x=u(b),C=_(),w=d!=null,[T,D]=y(m),O=w?d:T,k;t[0]!==w||t[1]!==c?(k=e=>{w||D(e),c?.(e)},t[0]=w,t[1]=c,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=s(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=a(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(48),i,a,o,s,c,u;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6]):({"aria-label":i,"aria-labelledby":a,children:o,className:s,"data-slot":c,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=u);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=d(),b=i??(a==null?`Main`:void 0);if(f){let n;r[7]===c?n=r[8]:(n=t(c,`sidebar-nav`),r[7]=c,r[8]=n);let i;r[9]===a?i=r[10]:(i=a==null?null:{"aria-labelledby":a},r[9]=a,r[10]=i);let d;r[11]===s?d=r[12]:(d=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,s),r[11]=s,r[12]=d);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(l.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==a||r[17]!==o||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":a,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:o}),r[15]=b,r[16]=a,r[17]=o,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==u||r[21]!==n||r[22]!==i||r[23]!==d||r[24]!==p||r[25]!==m?(g=C(l.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:d,...u,children:[p,m]}),r[20]=u,r[21]=n,r[22]=i,r[23]=d,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(l.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===c?x=r[32]:(x=t(c,`sidebar-nav`),r[31]=c,r[32]=x);let w=T[m],E;r[33]!==s||r[34]!==w?(E=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,w,`transition-[width] duration-200 ease-linear motion-reduce:transition-none not-data-hydrated:transition-none`,s),r[33]=s,r[34]=w,r[35]=E):E=r[35];let D=g?`expanded`:`collapsed`,k=y?``:void 0,A;r[36]!==b||r[37]!==a||r[38]!==o||r[39]!==h?(A=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":a,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:o}),r[36]=b,r[37]=a,r[38]=o,r[39]=h,r[40]=A):A=r[40];let j;return r[41]!==u||r[42]!==x||r[43]!==E||r[44]!==D||r[45]!==k||r[46]!==A?(j=S(`div`,{"data-slot":x,className:E,...u,"data-state":D,"data-hydrated":k,children:A}),r[41]=u,r[42]=x,r[43]=E,r[44]=D,r[45]=k,r[46]=A,r[47]=j):j=r[47],j},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,s,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...s}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=s,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=o(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==s||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...s})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=s,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`transition-opacity duration-200 ease-linear motion-reduce:transition-none group-not-data-hydrated/sidebar-nav:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),a,o,s;r[0]===n?(a=r[1],o=r[2],s=r[3]):({className:a,"data-slot":o,...s}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===a?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,a),r[6]=a,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(i,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=c(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|