@ngrok/mantle 0.94.0 → 0.94.1
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 +11 -2
- package/dist/accordion.d.ts +61 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +61 -56
- package/dist/alert-BkJHDx9X.js +1 -0
- package/dist/{alert-HffaioZM.d.ts → alert-D0zRRUHV.d.ts} +6 -6
- package/dist/alert-center.d.ts +53 -53
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +22 -10
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-Dc6IgvXV.js +1 -0
- package/dist/anchor.d.ts +5 -5
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +18 -18
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +13 -13
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +24 -24
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +7 -7
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +12 -12
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +36 -36
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CZfkNw5A.js +1 -0
- package/dist/browser-only-ymFoM3Ya.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/{button-K0pKc3GN.d.ts → button-5Pc7Mby_.d.ts} +3 -3
- package/dist/button-B9bChDgl.js +1 -0
- package/dist/button-D8jixIbH.js +1 -0
- package/dist/button-DNLTJ32M.js +1 -0
- package/dist/{button-Cgf2IcEC.d.ts → button-Ddj6yr10.d.ts} +26 -26
- package/dist/{button-BGwOPjGV.d.ts → button-DnYv7IOT.d.ts} +22 -21
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +23 -23
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-CE5Uaqz9.js → chart-BLCqzt56.js} +1 -1
- package/dist/{chart-DCTGGlWL.js → chart-CChZiCrt.js} +1 -1
- package/dist/{chart-BO9EwQ60.js → chart-CUmSu9d7.js} +1 -1
- package/dist/{chart-jitNqimS.d.ts → chart-Dl8gFo_D.d.ts} +22 -22
- package/dist/chart-DtgZBAas.js +2 -0
- package/dist/checkbox-Cu5cgZmk.js +1 -0
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/choice-CCVG2hb9.js +1 -0
- package/dist/{choice-BwfmbepO.d.ts → choice-CNiOSzqV.d.ts} +20 -20
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-BPKNY1_w.js +1 -0
- package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
- package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
- package/dist/code-block.d.ts +15 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -3
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -15
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +47 -47
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdRUneoc.js +1 -0
- package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
- package/dist/cx.d.ts +4 -4
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table.d.ts +36 -36
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +1 -1
- package/dist/description-list.js +1 -1
- package/dist/{dialog-DD5H3EH1.d.ts → dialog-CIEuwNys.d.ts} +24 -8
- package/dist/{dialog-B9JAGy_x.d.ts → dialog-CbEEA0fl.d.ts} +7 -3
- package/dist/dialog-DmzoDfY3.js +1 -0
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DmDxYPde.d.ts → dropdown-menu-CeY498yk.d.ts} +10 -10
- package/dist/dropdown-menu-uheL0prz.js +1 -0
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +2 -2
- package/dist/empty.js +1 -1
- package/dist/field-Bpvn4tQp.js +1 -0
- package/dist/field-Cai_4c1l.js +1 -0
- package/dist/field.d.ts +41 -41
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +30 -10
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +3 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/{icon-NYvyyRMG.d.ts → icon-DuIYoyft.d.ts} +2 -2
- package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
- package/dist/icon-xb7d9M7X.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-DEDCLZ8B.js +1 -0
- package/dist/icons-DXadFwpo.js +1 -0
- package/dist/icons-DcesO4Ng.js +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{input-q8o5uMhW.d.ts → input-DC4nW0Sr.d.ts} +1 -1
- package/dist/input-fW8QSZEO.js +1 -0
- package/dist/input.d.ts +4 -4
- package/dist/input.js +1 -1
- package/dist/kbd-P1nQshWo.js +1 -0
- package/dist/kbd.d.ts +5 -5
- package/dist/kbd.js +1 -1
- package/dist/label-DO1RlMKl.js +1 -0
- package/dist/{label-r2sJcSQ4.d.ts → label-epgtywRz.d.ts} +8 -8
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DL4yclOu.js +1 -0
- package/dist/layer-container.d.ts +2 -2
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +12 -12
- package/dist/line-chart.js +1 -1
- package/dist/list-cQZPSjfz.js +1 -0
- package/dist/list.d.ts +17 -17
- package/dist/list.js +1 -1
- package/dist/live-region-Dhapu8a5.js +1 -0
- package/dist/live-region.d.ts +1 -1
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +23 -22
- package/dist/main-CHyWYDak.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +25 -25
- package/dist/media-object.d.ts +4 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +28 -28
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +3 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +1 -1
- package/dist/{popover-lwkwWcRW.d.ts → popover-Bei0jyfH.d.ts} +73 -7
- package/dist/popover-DhgunktK.js +1 -0
- package/dist/popover-T2EyaqGK.d.ts +1 -0
- package/dist/popover.d.ts +2 -2
- package/dist/popover.js +1 -1
- package/dist/primitive-D8CzV_Ft.js +1 -0
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +3 -3
- package/dist/qr-code.js +1 -1
- package/dist/query-filter.d.ts +6 -6
- package/dist/query.d.ts +8 -3
- package/dist/query.js +1 -1
- package/dist/{radio-group-sLz5AA9I.d.ts → radio-group-BJQ6EOqh.d.ts} +1 -1
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-ggEkCi0V.js +1 -0
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +30 -30
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +13 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select-1xuUx_os.js +1 -0
- package/dist/{select-BqmpVJJT.d.ts → select-BpaXHxJm.d.ts} +6 -6
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +18 -18
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-QfH0ot5K.d.ts → separator-Ck4sPrdN.d.ts} +1 -1
- package/dist/separator-DnvhwY2J.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
- package/dist/sheet-DHy_vlme.js +1 -0
- package/dist/sheet.d.ts +23 -7
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +37 -37
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DHfyjuQi.js +1 -0
- package/dist/skeleton.d.ts +4 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +1 -1
- package/dist/slot-B7rwscwd.js +1 -0
- package/dist/{slot-D12N_fZJ.d.ts → slot-BEMQMbk3.d.ts} +4 -4
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button.d.ts +9 -9
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +22 -22
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-BnLdXUai.js +1 -0
- package/dist/{table-rWiVWEgB.d.ts → table-Ii9hHUWN.d.ts} +5 -5
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-BNdZl352.js +1 -0
- package/dist/theme-switcher.d.ts +4 -4
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +14 -12
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +3261 -0
- package/dist/tokens.json +4933 -0
- package/dist/tokens.resolver.json +37 -0
- package/dist/{tooltip-CpK3XTor.d.ts → tooltip-CstGDKwy.d.ts} +4 -4
- package/dist/tooltip-DQO40Mrq.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +1 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
- package/dist/use-callback-ref-DiOXFQzM.js +1 -0
- package/dist/use-composed-refs-DPYmLDSe.js +1 -0
- package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
- package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
- package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
- package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
- package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
- package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
- package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
- package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
- package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +1 -1
- package/dist/well.js +1 -1
- package/package.json +16 -2
- package/dist/alert-CH99Rw-R.js +0 -1
- package/dist/anchor-CgcbWEUs.js +0 -1
- package/dist/browser-only-BTSrYWLj.js +0 -1
- package/dist/button-69InNC_m.js +0 -1
- package/dist/button-BWGUuWnu.js +0 -1
- package/dist/button-Cu9e3SM7.js +0 -1
- package/dist/chart-DudCw24t.js +0 -2
- package/dist/checkbox-CS504fKk.js +0 -1
- package/dist/choice-uyYccm0A.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/dialog-CsugEt2A.js +0 -1
- package/dist/dropdown-menu-DHdgaw4P.js +0 -1
- package/dist/field-Bihblt8U.js +0 -1
- package/dist/field-CPvjazWN.js +0 -1
- package/dist/icon-kK0c-POG.js +0 -1
- package/dist/icons-4JA-SGfv.js +0 -1
- package/dist/icons-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/input-DHovzBjS.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-DmDwzPD8.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-CO_yLdln.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-BhTFutCz.d.ts +0 -1
- package/dist/popover-DxOqLKxy.js +0 -1
- package/dist/primitive-Dz9Al-us.js +0 -1
- package/dist/radio-group-HDVxTNPi.js +0 -1
- package/dist/radio-group-jj2abc0t.js +0 -1
- package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-C6Su0dU0.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/sheet-Bd2LIhzF.js +0 -1
- package/dist/skeleton-DBpI-ko5.js +0 -1
- package/dist/slot-DdYN1L1C.js +0 -1
- package/dist/table-CFHiDBW8.js +0 -1
- package/dist/theme-DdZgLvKH.js +0 -1
- package/dist/tooltip-b6oiTaWq.js +0 -1
- package/dist/use-breakpoint--mo7kr9d.js +0 -1
- package/dist/use-callback-ref-BvVyI5K1.js +0 -1
- package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
- package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
- package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
- package/dist/use-matches-media-query-m860lols.js +0 -1
- package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
package/dist/sidebar.d.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* @see https://mantle.ngrok.com/components/navigation/sidebar
|
|
8
8
|
*/
|
|
9
9
|
import { n as WithAsChild, t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
10
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
11
|
-
import { n as IconButtonProps } from "./button-
|
|
12
|
-
import { n as Separator } from "./separator-
|
|
13
|
-
import { t as Tooltip } from "./tooltip-
|
|
10
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
11
|
+
import { n as IconButtonProps } from "./button-DnYv7IOT.js";
|
|
12
|
+
import { n as Separator } from "./separator-Ck4sPrdN.js";
|
|
13
|
+
import { t as Tooltip } from "./tooltip-CstGDKwy.js";
|
|
14
14
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
15
15
|
/**
|
|
16
16
|
* The breakpoints below which `Sidebar.Nav` swaps from the inline desktop
|
|
@@ -117,7 +117,7 @@ type SidebarState = {
|
|
|
117
117
|
declare function useSidebar(): SidebarState;
|
|
118
118
|
type SidebarRootProps = {
|
|
119
119
|
/**
|
|
120
|
-
* The sidebar's parts
|
|
120
|
+
* The sidebar's parts: a `Sidebar.Nav` and anything that reads the state,
|
|
121
121
|
* including a `Sidebar.Trigger` rendered anywhere below (an
|
|
122
122
|
* `AppLayout.Header`, for example). `Root` renders no DOM of its own.
|
|
123
123
|
*/
|
|
@@ -154,14 +154,14 @@ type SidebarRootProps = {
|
|
|
154
154
|
/**
|
|
155
155
|
* Toggle the sidebar with `⌘B` (macOS) / `Ctrl+B` (Windows/Linux). The
|
|
156
156
|
* shortcut requires exactly the platform modifier + `b`: `⌘` on Apple
|
|
157
|
-
* platforms and `Ctrl` everywhere else, resolved per host
|
|
157
|
+
* platforms and `Ctrl` everywhere else, resolved per host. The two never
|
|
158
158
|
* substitute for each other, so macOS's native `Ctrl+B` ("move the caret
|
|
159
159
|
* back one character") is left alone. Combinations with `Shift`/`Alt` (e.g.
|
|
160
160
|
* the browser's own `⌘⇧B`) pass through too.
|
|
161
161
|
*
|
|
162
162
|
* The shortcut is also ignored while focus is in a text-editing or form
|
|
163
|
-
* control
|
|
164
|
-
* host
|
|
163
|
+
* control (an `<input>`, `<textarea>`, `<select>`, or any `contenteditable`
|
|
164
|
+
* host), because the chord is usually already bound there (`⌘B` is "bold")
|
|
165
165
|
* and this is a `window` listener that calls `preventDefault()`. That covers
|
|
166
166
|
* embedded editors like Monaco and CodeMirror, which attach to exactly those
|
|
167
167
|
* elements. Set `false` to opt out entirely.
|
|
@@ -181,7 +181,7 @@ type SidebarRootProps = {
|
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
183
183
|
* The state owner for a sidebar. Renders no DOM of its own (like
|
|
184
|
-
* `Tooltip.Root`)
|
|
184
|
+
* `Tooltip.Root`). It carries the expanded/collapsed and mobile-sheet state
|
|
185
185
|
* to every part below it, so `Sidebar.Trigger` can live anywhere in the tree
|
|
186
186
|
* (for example inside an `AppLayout.Header`) without coupling the app shell
|
|
187
187
|
* to the sidebar.
|
|
@@ -378,12 +378,12 @@ type SidebarTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "chi
|
|
|
378
378
|
label?: string;
|
|
379
379
|
/**
|
|
380
380
|
* The keyboard chord that also toggles the sidebar, rendered after the label
|
|
381
|
-
* in the tooltip
|
|
381
|
+
* in the tooltip, usually `<><MetaKey /><Kbd>B</Kbd></>`.
|
|
382
382
|
*
|
|
383
383
|
* Ignored under `Sidebar.Root keyboardShortcut={false}`, so the tooltip can
|
|
384
384
|
* never name a binding that is not bound. Passed rather than built in so the
|
|
385
385
|
* sidebar does not have to reach into another component for the platform
|
|
386
|
-
* modifier glyph
|
|
386
|
+
* modifier glyph. `aria-keyshortcuts` is stamped either way, which is also
|
|
387
387
|
* why the chips render `aria-hidden`.
|
|
388
388
|
*/
|
|
389
389
|
shortcut?: ReactNode;
|
|
@@ -400,13 +400,13 @@ type SidebarTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "chi
|
|
|
400
400
|
* `mobileBreakpoint`, the desktop expanded state otherwise. Renders a small
|
|
401
401
|
* ghost neutral `IconButton` with `aria-expanded` and `aria-controls` wired to
|
|
402
402
|
* the sidebar's `<nav>`. Place it in your app shell's header (for example
|
|
403
|
-
* `AppLayout.Header`)
|
|
403
|
+
* `AppLayout.Header`). It must stay visible at every breakpoint where the
|
|
404
404
|
* sidebar can collapse, or users have no way to reopen it.
|
|
405
405
|
*
|
|
406
406
|
* The button is icon-only at every breakpoint, so it always renders a tooltip
|
|
407
407
|
* showing `label` (plus the optional `shortcut` chips). **That means it requires
|
|
408
408
|
* a `TooltipProvider` ancestor, like any `Tooltip.Root`, and throws without
|
|
409
|
-
* one
|
|
409
|
+
* one.** Mount a single provider at your app root, decoupled from the sidebar,
|
|
410
410
|
* so the app-wide delay and hover settings stay app-wide.
|
|
411
411
|
*
|
|
412
412
|
* It also stamps `aria-keyshortcuts` for the `⌘B` / `Ctrl+B` chord the root
|
|
@@ -514,7 +514,7 @@ type SidebarHeaderProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
|
514
514
|
* construction.
|
|
515
515
|
*
|
|
516
516
|
* Every child after the first stacks flush below the band in its own row, the
|
|
517
|
-
* way rows stack in `Sidebar.Footer
|
|
517
|
+
* way rows stack in `Sidebar.Footer`: the band's own lower half is the space
|
|
518
518
|
* between them. The header grows to fit them. The band, and with it the toolbar,
|
|
519
519
|
* stays the height of the switcher row alone, so a search row pinned under the
|
|
520
520
|
* switcher (`Sidebar.SearchTrigger`) needs no override and no hand-copied
|
|
@@ -522,13 +522,13 @@ type SidebarHeaderProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
|
522
522
|
*
|
|
523
523
|
* The alignment is positional: keep the aligned row as the header's first direct
|
|
524
524
|
* child. A wrapper around both rows takes the band itself. A first row taller
|
|
525
|
-
* than the band overflows it
|
|
525
|
+
* than the band overflows it. Raise the variable instead.
|
|
526
526
|
*
|
|
527
527
|
* **CSS variables (public API):**
|
|
528
528
|
*
|
|
529
529
|
* | CSS Variable | Default | Description |
|
|
530
530
|
* | --- | --- | --- |
|
|
531
|
-
* | `--sidebar-header-height` | `4.5rem` | The first child's band (72px)
|
|
531
|
+
* | `--sidebar-header-height` | `4.5rem` | The first child's band (72px): the height an `AppLayout.Header` toolbar matches, not a cap on the header, which grows for every row after the first. Set it on a common ancestor of the sidebar and `AppLayout.Header`, not on `Sidebar.Nav`, so both rows read one value. |
|
|
532
532
|
*
|
|
533
533
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarheader
|
|
534
534
|
*
|
|
@@ -886,7 +886,7 @@ type SidebarListProps = ComponentProps<"ul"> & WithAsChild & WithDataSlot;
|
|
|
886
886
|
declare const List: ({ "aria-labelledby": ariaLabelledBy, asChild, children, className, "data-slot": dataSlot, ...props }: SidebarListProps) => import("react").JSX.Element;
|
|
887
887
|
type SidebarItemProps = ComponentProps<"li"> & WithAsChild & WithDataSlot;
|
|
888
888
|
/**
|
|
889
|
-
* A single `<li>` row of a `Sidebar.List`. A plain wrapper
|
|
889
|
+
* A single `<li>` row of a `Sidebar.List`. A plain wrapper: the interactive
|
|
890
890
|
* element is the `Sidebar.ItemButton` child, so props, `ref`, and `className`
|
|
891
891
|
* all target the list item itself.
|
|
892
892
|
*
|
|
@@ -1048,7 +1048,7 @@ declare const ItemButton: ({ asChild, children, className, current, "data-slot":
|
|
|
1048
1048
|
type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
1049
1049
|
/**
|
|
1050
1050
|
* Compose the search row's styling onto your own element. Then the
|
|
1051
|
-
* row's entire content is yours
|
|
1051
|
+
* row's entire content is yours, including any shortcut hint, which
|
|
1052
1052
|
* `shortcut` cannot add to a cloned child.
|
|
1053
1053
|
*/
|
|
1054
1054
|
asChild: true;
|
|
@@ -1056,12 +1056,12 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1056
1056
|
} | {
|
|
1057
1057
|
/**
|
|
1058
1058
|
* Compose the search row's styling onto your own element. Then the
|
|
1059
|
-
* row's entire content is yours
|
|
1059
|
+
* row's entire content is yours, including any shortcut hint, which
|
|
1060
1060
|
* `shortcut` cannot add to a cloned child.
|
|
1061
1061
|
*/
|
|
1062
1062
|
asChild?: false;
|
|
1063
1063
|
/**
|
|
1064
|
-
* The keyboard hint for the chord that opens the same palette
|
|
1064
|
+
* The keyboard hint for the chord that opens the same palette, usually
|
|
1065
1065
|
* `<><MetaKey /><Kbd>K</Kbd></>`.
|
|
1066
1066
|
*
|
|
1067
1067
|
* Rendered pinned to the end of the row and **revealed only on hover or
|
|
@@ -1077,7 +1077,7 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1077
1077
|
shortcut?: ReactNode;
|
|
1078
1078
|
});
|
|
1079
1079
|
/**
|
|
1080
|
-
* The search row
|
|
1080
|
+
* The search row: the row that opens a search or command palette.
|
|
1081
1081
|
*
|
|
1082
1082
|
* Put it at the top of `Sidebar.Body`, above the first `Sidebar.Group`: it lands
|
|
1083
1083
|
* in the same `px-3` gutter as the navigation rows, so it shares their column in
|
|
@@ -1086,19 +1086,19 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1086
1086
|
* `Sidebar.Header`, under the switcher, also works, and pins the row above the
|
|
1087
1087
|
* scrolling body instead. The switcher stays the header's first child, so it
|
|
1088
1088
|
* keeps the `--sidebar-header-height` band an `AppLayout.Header` toolbar
|
|
1089
|
-
* matches, and this row takes the next row down
|
|
1089
|
+
* matches, and this row takes the next row down. The header grows for it, so
|
|
1090
1090
|
* nothing needs a token override. The header reserves no scrollbar gutter, so on
|
|
1091
1091
|
* a platform whose scrollbars take space the row runs wider than the navigation
|
|
1092
1092
|
* rows below it, which sit inside `Sidebar.Body`'s reserved gutter.
|
|
1093
1093
|
*
|
|
1094
1094
|
* It is deliberately a navigation row and not a text field. The row is the same
|
|
1095
|
-
* chrome as a `Sidebar.ItemButton`
|
|
1096
|
-
* the same 28px chip in the collapsed icon rail
|
|
1095
|
+
* chrome as a `Sidebar.ItemButton` (same height, padding, radius, hover, and
|
|
1096
|
+
* the same 28px chip in the collapsed icon rail), because a search entry point
|
|
1097
1097
|
* in a sidebar is one of the rows, not a form control wedged among them. The
|
|
1098
1098
|
* `shortcut` hint appears on hover or focus and is otherwise invisible, which
|
|
1099
1099
|
* keeps the resting panel quiet.
|
|
1100
1100
|
*
|
|
1101
|
-
* A styled button only
|
|
1101
|
+
* A styled button only. It is not wired to any state. Compose it with
|
|
1102
1102
|
* [`Command.SearchTrigger`](https://mantle.ngrok.com/components/navigation/command#commandsearchtrigger),
|
|
1103
1103
|
* which supplies the dialog wiring, `aria-keyshortcuts`, and the behavior that
|
|
1104
1104
|
* makes typing or pasting into the row open the palette with that text already
|
|
@@ -1266,12 +1266,12 @@ declare const SwitcherTrigger: ({ asChild, children, className, "data-slot": dat
|
|
|
1266
1266
|
*/
|
|
1267
1267
|
type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "children" | "side"> & WithDataSlot & {
|
|
1268
1268
|
/**
|
|
1269
|
-
* The row this labels
|
|
1269
|
+
* The row this labels: a `Sidebar.ItemButton` or `Sidebar.SwitcherTrigger`,
|
|
1270
1270
|
* optionally already wrapped in a `DropdownMenu.Trigger asChild`.
|
|
1271
1271
|
*
|
|
1272
1272
|
* A single element, required: `Tooltip.Trigger asChild` clones its child, so
|
|
1273
1273
|
* text renders nothing a pointer can hover and no children renders no row at
|
|
1274
|
-
* all
|
|
1274
|
+
* all. Both fail silently.
|
|
1275
1275
|
*/
|
|
1276
1276
|
children: ReactElement;
|
|
1277
1277
|
/**
|
|
@@ -1282,7 +1282,7 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
|
|
|
1282
1282
|
*/
|
|
1283
1283
|
label: ReactNode;
|
|
1284
1284
|
/**
|
|
1285
|
-
* The keyboard chord that reaches the same row, rendered after the label
|
|
1285
|
+
* The keyboard chord that reaches the same row, rendered after the label,
|
|
1286
1286
|
* usually `<><MetaKey /><Kbd>K</Kbd></>`. The rail hides the row's own
|
|
1287
1287
|
* shortcut hint along with its label, so the tooltip is where a pointer user
|
|
1288
1288
|
* can still learn the chord. The chips are `aria-hidden`: a tooltip is wired
|
|
@@ -1302,7 +1302,7 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
|
|
|
1302
1302
|
side?: ComponentProps<typeof Tooltip.Content>["side"];
|
|
1303
1303
|
};
|
|
1304
1304
|
/**
|
|
1305
|
-
* Labels a sidebar row
|
|
1305
|
+
* Labels a sidebar row only while the desktop panel is collapsed
|
|
1306
1306
|
* to the icon rail. Wrap it around a `Sidebar.ItemButton` or
|
|
1307
1307
|
* `Sidebar.SwitcherTrigger`.
|
|
1308
1308
|
*
|
|
@@ -1313,13 +1313,13 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
|
|
|
1313
1313
|
* the mobile sheet shows full labels, so the collapsed desktop rail is the only
|
|
1314
1314
|
* state that shows a label at all.
|
|
1315
1315
|
*
|
|
1316
|
-
* It opens the way any tooltip does
|
|
1317
|
-
* reaching it
|
|
1316
|
+
* It opens the way any tooltip does (the pointer entering the row, or focus
|
|
1317
|
+
* reaching it), and the rail state vetoes it: the expanded panel and the mobile
|
|
1318
1318
|
* sheet keep the row at `data-state="closed"` with no `aria-describedby`, and
|
|
1319
1319
|
* toggling the rail dismisses whatever was showing, so collapsing the panel
|
|
1320
1320
|
* cannot pop a label under a pointer that has already moved on.
|
|
1321
1321
|
*
|
|
1322
|
-
* **Requires a `TooltipProvider` ancestor**, like any `Tooltip.Root
|
|
1322
|
+
* **Requires a `TooltipProvider` ancestor**, like any `Tooltip.Root`. Mount one
|
|
1323
1323
|
* at your app root. This part deliberately does not mount its own, so the
|
|
1324
1324
|
* app-wide tooltip delay stays app-wide rather than being overridden per row.
|
|
1325
1325
|
* The one provider setting it does override is hoverable content: a rail label
|
|
@@ -1328,7 +1328,7 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
|
|
|
1328
1328
|
* It composes with a menu trigger: nest `DropdownMenu.Root >
|
|
1329
1329
|
* Sidebar.Tooltip > DropdownMenu.Trigger asChild > Sidebar.ItemButton` for a
|
|
1330
1330
|
* row that opens a menu *and* labels itself in the rail. `DropdownMenu.Root` must
|
|
1331
|
-
* stay **outside** the tooltip
|
|
1331
|
+
* stay **outside** the tooltip: it is renderless, and `Tooltip.Trigger asChild`
|
|
1332
1332
|
* needs a real element to clone.
|
|
1333
1333
|
*
|
|
1334
1334
|
* `children` is the row; `label` is what the tooltip says. Every other prop is
|
|
@@ -1480,9 +1480,9 @@ type SidebarSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" |
|
|
|
1480
1480
|
declare const SidebarSeparator: ({ className, "data-slot": dataSlot, ...props }: SidebarSeparatorProps) => import("react").JSX.Element;
|
|
1481
1481
|
/**
|
|
1482
1482
|
* A composable, collapsible app-navigation sidebar. `Sidebar.Root` owns the
|
|
1483
|
-
* state (no DOM)
|
|
1483
|
+
* state (no DOM). `Sidebar.Nav` renders the panel: inline on desktop,
|
|
1484
1484
|
* collapsing to a skinny icon rail, and a left-side `Sheet` below the root's
|
|
1485
|
-
* `mobileBreakpoint
|
|
1485
|
+
* `mobileBreakpoint`. `Sidebar.Trigger` toggles it from anywhere under the
|
|
1486
1486
|
* root (typically an `AppLayout.Header`). Navigation is grouped with
|
|
1487
1487
|
* `Sidebar.Group`/`Sidebar.GroupLabel`/`Sidebar.List`, and the switcher rows
|
|
1488
1488
|
* (app switcher up top, account/user down bottom) compose
|
|
@@ -1580,7 +1580,7 @@ declare const SidebarSeparator: ({ className, "data-slot": dataSlot, ...props }:
|
|
|
1580
1580
|
*/
|
|
1581
1581
|
declare const Sidebar: {
|
|
1582
1582
|
/**
|
|
1583
|
-
* The state owner for a sidebar. Renders no DOM
|
|
1583
|
+
* The state owner for a sidebar. Renders no DOM. It carries expanded /
|
|
1584
1584
|
* mobile-sheet state to every part below it so the trigger can live in the
|
|
1585
1585
|
* app shell without coupling it to the sidebar.
|
|
1586
1586
|
*
|
|
@@ -2244,7 +2244,7 @@ declare const Sidebar: {
|
|
|
2244
2244
|
* The search row: an item-shaped row whose `shortcut` hint appears on hover or
|
|
2245
2245
|
* focus, and the same chip as any other row in the collapsed icon rail. Goes
|
|
2246
2246
|
* in `Sidebar.Body` to scroll with the navigation, or in `Sidebar.Header` to
|
|
2247
|
-
* stay pinned above it. Not state-wired
|
|
2247
|
+
* stay pinned above it. Not state-wired: compose with
|
|
2248
2248
|
* `Command.SearchTrigger`.
|
|
2249
2249
|
*
|
|
2250
2250
|
* **Data attributes:**
|
package/dist/sidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-callback-ref-BvVyI5K1.js";import{r as t}from"./use-breakpoint--mo7kr9d.js";import{n,t as r}from"./use-is-apple-platform-D4nifHMx.js";import{t as i}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as a}from"./cx-CK7o_rVv.js";import{t as o}from"./data-slot-EM6s2WEU.js";import{t as s}from"./button-BWGUuWnu.js";import{n as c}from"./separator-DfzxVutO.js";import{t as l}from"./sheet-Bd2LIhzF.js";import{t as u}from"./slot-DdYN1L1C.js";import{t as d}from"./tooltip-b6oiTaWq.js";import{n as f}from"./cookie-ca4g5CKp.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useLayoutEffect as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`max-sm:not-data-hydrated:hidden`,md:`max-md:not-data-hydrated:hidden`,lg:`max-lg:not-data-hydrated:hidden`},D=`duration-200 ease-out-strong motion-reduce:transition-none group-not-data-hydrated/sidebar-nav:transition-none`,O=m(null);function k(){let e=h(O);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function A(e){let t=h(O);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const j=[];function M(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function N(){let e=Symbol(`sidebar-keyboard-shortcut`);return j.push(e),{isOwner:()=>j[0]===e,release:()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}}const P=r=>{let i=p(35),{children:a,defaultOpen:o,keyboardShortcut:s,mobileBreakpoint:c,onOpenChange:l,onOpenMobileChange:u,open:d,openMobile:f}=r,m=o===void 0||o,h=s===void 0||s,x=c===void 0?`lg`:c,S=t(x),w=_(),T=y(l),E=y(u),D;i[0]!==l||i[1]!==u?(D=()=>{T.current=l,E.current=u},i[0]=l,i[1]=u,i[2]=D):D=i[2],v(D);let k=d!=null,[A,j]=b(m),P=k?d:A,F;i[3]===k?F=i[4]:(F=e=>{k||j(e),T.current?.(e)},i[3]=k,i[4]=F);let I=F,L=f!=null,[R,z]=b(!1),B=L?f:R,V;i[5]===L?V=i[6]:(V=e=>{L||z(e),E.current?.(e)},i[5]=L,i[6]=V);let H=V,U=y(S),W,G;i[7]!==S||i[8]!==B||i[9]!==H?(W=()=>{let e=U.current&&!S;U.current=S,e&&B&&H(!1)},G=[S,B,H],i[7]=S,i[8]=B,i[9]=H,i[10]=W,i[11]=G):(W=i[10],G=i[11]),g(W,G);let K;i[12]!==S||i[13]!==P||i[14]!==B||i[15]!==I||i[16]!==H?(K=()=>{S?H(!B):I(!P)},i[12]=S,i[13]=P,i[14]=B,i[15]=I,i[16]=H,i[17]=K):K=i[17];let q=K,J=e(q),Y,X;i[18]!==h||i[19]!==J?(Y=()=>{if(!h)return;let e=N(),t=n(),r=n=>{if(!e.isOwner()||n.defaultPrevented||M(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(),J())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},X=[h,J],i[18]=h,i[19]=J,i[20]=Y,i[21]=X):(Y=i[20],X=i[21]),g(Y,X);let Z;i[22]!==S||i[23]!==h||i[24]!==x||i[25]!==w||i[26]!==P||i[27]!==B||i[28]!==I||i[29]!==H||i[30]!==q?(Z={isMobile:S,keyboardShortcut:h,mobileBreakpoint:x,navId:w,open:P,openMobile:B,setOpen:I,setOpenMobile:H,toggle:q},i[22]=S,i[23]=h,i[24]=x,i[25]=w,i[26]=P,i[27]=B,i[28]=I,i[29]=H,i[30]=q,i[31]=Z):Z=i[31];let Q=Z,$;return i[32]!==a||i[33]!==Q?($=/* @__PURE__ */ C(O.Provider,{value:Q,children:a}),i[32]=a,i[33]=Q,i[34]=$):$=i[34],$},F=e=>{let t=p(48),n,r,s,c,u,d;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4],u=t[5],d=t[6]):({"aria-label":n,"aria-labelledby":r,children:s,className:c,"data-slot":u,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c,t[5]=u,t[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=A(`Nav`),y=i(),b=n??(r==null?`Main`:void 0);if(f){let e;t[7]===u?e=t[8]:(e=o(u,`sidebar-nav`),t[7]=u,t[8]=e);let n;t[9]===r?n=t[10]:(n=r==null?null:{"aria-labelledby":r},t[9]=r,t[10]=n);let i;t[11]===c?i=t[12]:(i=a(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),t[11]=c,t[12]=i);let f=b??`Sidebar`,p;t[13]===f?p=t[14]:(p=/* @__PURE__ */ C(l.Title,{className:`sr-only`,children:f}),t[13]=f,t[14]=p);let m;t[15]!==b||t[16]!==r||t[17]!==s||t[18]!==h?(m=/* @__PURE__ */ C(`nav`,{id:h,"aria-label":b,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),t[15]=b,t[16]=r,t[17]=s,t[18]=h,t[19]=m):m=t[19];let g;t[20]!==d||t[21]!==e||t[22]!==n||t[23]!==i||t[24]!==p||t[25]!==m?(g=/* @__PURE__ */ w(l.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":e,"data-mobile":``,...n,className:i,...d,children:[p,m]}),t[20]=d,t[21]=e,t[22]=n,t[23]=i,t[24]=p,t[25]=m,t[26]=g):g=t[26];let y;return t[27]!==_||t[28]!==v||t[29]!==g?(y=/* @__PURE__ */ C(l.Root,{open:_,onOpenChange:v,children:g}),t[27]=_,t[28]=v,t[29]=g,t[30]=y):y=t[30],y}let x;t[31]===u?x=t[32]:(x=o(u,`sidebar-nav`),t[31]=u,t[32]=x);let S=E[m],T;t[33]!==c||t[34]!==S?(T=a(`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)`,S,`transition-[width] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,c),t[33]=c,t[34]=S,t[35]=T):T=t[35];let D=g?`expanded`:`collapsed`,O=y?``:void 0,k;t[36]!==b||t[37]!==r||t[38]!==s||t[39]!==h?(k=/* @__PURE__ */ C(`nav`,{id:h,"aria-label":b,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),t[36]=b,t[37]=r,t[38]=s,t[39]=h,t[40]=k):k=t[40];let j;return t[41]!==d||t[42]!==x||t[43]!==T||t[44]!==D||t[45]!==O||t[46]!==k?(j=/* @__PURE__ */ C(`div`,{"data-slot":x,className:T,...d,"data-state":D,"data-hydrated":O,children:k}),t[41]=d,t[42]=x,t[43]=T,t[44]=D,t[45]=O,t[46]=k,t[47]=j):j=t[47],j},I=/* @__PURE__ */ C(T,{}),L=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=/* @__PURE__ */ C(`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&&/* @__PURE__ */ C(`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`,translate:`no`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=/* @__PURE__ */ w(`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},R=e=>{let t=p(34),n,i,a,c,l,u,f,m,h;t[0]===e?(n=t[1],i=t[2],a=t[3],c=t[4],l=t[5],u=t[6],f=t[7],m=t[8],h=t[9]):({appearance:l,"data-slot":n,icon:u,intent:f,label:m,onClick:i,shortcut:c,size:h,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=f,t[8]=m,t[9]=h);let g=l===void 0?`ghost`:l,_=u===void 0?I:u,v=f===void 0?`neutral`:f,y=m===void 0?`Toggle Sidebar`:m,b=h===void 0?`sm`:h,{isMobile:x,keyboardShortcut:S,navId:T,open:E,openMobile:D,toggle:O}=A(`Trigger`),k=r(),j=x?D:E,M=!x||D,N=S?c:void 0,P=k?`Meta+B`:`Control+B`,F=M?T:void 0,R=S?P:void 0,z;t[10]===n?z=t[11]:(z=o(n,`sidebar-trigger`),t[10]=n,t[11]=z);let B=j?`expanded`:`collapsed`,V;t[12]!==i||t[13]!==O?(V=e=>{i?.(e),e.defaultPrevented||O()},t[12]=i,t[13]=O,t[14]=V):V=t[14];let H;t[15]!==g||t[16]!==j||t[17]!==_||t[18]!==v||t[19]!==y||t[20]!==a||t[21]!==b||t[22]!==V||t[23]!==F||t[24]!==R||t[25]!==z||t[26]!==B?(H=/* @__PURE__ */ C(d.Trigger,{asChild:!0,children:/* @__PURE__ */ C(s,{appearance:g,"aria-controls":F,"aria-expanded":j,"aria-keyshortcuts":R,"data-slot":z,"data-state":B,icon:_,intent:v,label:y,onClick:V,size:b,...a})}),t[15]=g,t[16]=j,t[17]=_,t[18]=v,t[19]=y,t[20]=a,t[21]=b,t[22]=V,t[23]=F,t[24]=R,t[25]=z,t[26]=B,t[27]=H):H=t[27];let U;t[28]!==N||t[29]!==y?(U=/* @__PURE__ */ C(d.Content,{"data-slot":`sidebar-trigger-tooltip`,children:/* @__PURE__ */ C(L,{label:y,shortcut:N})}),t[28]=N,t[29]=y,t[30]=U):U=t[30];let W;return t[31]!==H||t[32]!==U?(W=/* @__PURE__ */ w(d.Root,{children:[H,U]}),t[31]=H,t[32]=U,t[33]=W):W=t[33],W},z=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-header`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`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`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},B=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-body`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`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`,`transition-[padding]`,D,`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`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},V=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-footer`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},H=m(null),U=e=>{let t=p(21),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let[l,d]=b(null),f;t[6]===l?f=t[7]:(f={mountedLabelId:l,setMountedLabelId:d},t[6]=l,t[7]=f);let m=f,h=n?u:`div`,g;t[8]===s?g=t[9]:(g=o(s,`sidebar-group`),t[8]=s,t[9]=g);let _;t[10]===i?_=t[11]:(_=a(`pt-0.5`,i),t[10]=i,t[11]=_);let v;t[12]!==h||t[13]!==r||t[14]!==c||t[15]!==g||t[16]!==_?(v=/* @__PURE__ */ C(h,{"data-slot":g,className:_,...c,children:r}),t[12]=h,t[13]=r,t[14]=c,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;return t[18]!==m||t[19]!==v?(y=/* @__PURE__ */ C(H.Provider,{value:m,children:v}),t[18]=m,t[19]=v,t[20]=y):y=t[20],y},W=e=>{let t=p(22),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({asChild:n,children:r,className:i,"data-slot":s,id:c,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=h(H),f=_(),m=c??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;t[7]!==m||t[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],t[7]=m,t[8]=v,t[9]=y,t[10]=b):(y=t[9],b=t[10]),g(y,b);let x=n?u:`div`,S;t[11]===s?S=t[12]:(S=o(s,`sidebar-group-label`),t[11]=s,t[12]=S);let w;t[13]===i?w=t[14]:(w=a(`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`,D,i),t[13]=i,t[14]=w);let T;return t[15]!==x||t[16]!==r||t[17]!==m||t[18]!==l||t[19]!==S||t[20]!==w?(T=/* @__PURE__ */ C(x,{id:m,"data-slot":S,className:w,...l,children:r}),t[15]=x,t[16]=r,t[17]=m,t[18]=l,t[19]=S,t[20]=w,t[21]=T):T=t[21],T},G=e=>{let t=p(18),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({"aria-labelledby":n,asChild:r,children:i,className:s,"data-slot":c,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=h(H),f=r?u:`ul`,m=n??d?.mountedLabelId??void 0,g;t[7]===c?g=t[8]:(g=o(c,`sidebar-list`),t[7]=c,t[8]=g);let _;t[9]===s?_=t[10]:(_=a(`mb-2 space-y-px`,s),t[9]=s,t[10]=_);let v;return t[11]!==f||t[12]!==i||t[13]!==l||t[14]!==m||t[15]!==g||t[16]!==_?(v=/* @__PURE__ */ C(f,{"aria-labelledby":m,"data-slot":g,className:_,...l,children:i}),t[11]=f,t[12]=i,t[13]=l,t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17],v},K=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`li`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-item`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`list-none`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},q=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal 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`,`aria-expanded:bg-neutral-500/15 aria-expanded: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`,`group-data-[state=collapsed]/sidebar-nav:text-clip`,`transition-[width,padding,margin] ${D}`].join(` `),J={Root:P,Nav:F,Trigger:R,Header:z,Body:B,Footer:V,Group:U,GroupLabel:W,List:G,Item:K,ItemButton:e=>{let t=p(21),n,r,i,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6],d=t[7]):({asChild:n,children:r,className:i,current:s,"data-slot":c,type:d,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=d);let f=n?u:`button`,m;t[8]===c?m=t[9]:(m=o(c,`sidebar-item-button`),t[8]=c,t[9]=m);let h=s?``:void 0,g=s?`page`:void 0,_=n?d:d??`button`,v;t[10]===i?v=t[11]:(v=a(q,`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`,i),t[10]=i,t[11]=v);let y;return t[12]!==f||t[13]!==r||t[14]!==l||t[15]!==m||t[16]!==h||t[17]!==g||t[18]!==_||t[19]!==v?(y=/* @__PURE__ */ C(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...l,children:r}),t[12]=f,t[13]=r,t[14]=l,t[15]=m,t[16]=h,t[17]=g,t[18]=_,t[19]=v,t[20]=y):y=t[20],y},SearchTrigger:e=>{let t=p(23),n,r,i,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6],d=t[7]):({asChild:n,children:r,className:i,"data-slot":s,shortcut:l,type:d,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=d);let f=n?u:`button`,m;t[8]!==n||t[9]!==r||t[10]!==l?(m=n?r:/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:r}),/* @__PURE__ */ C(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,translate:`no`,className:a(`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:l})]}),t[8]=n,t[9]=r,t[10]=l,t[11]=m):m=t[11];let h=m,g;t[12]===s?g=t[13]:(g=o(s,`sidebar-search-trigger`),t[12]=s,t[13]=g);let _=n?d:d??`button`,v;t[14]===i?v=t[15]:(v=a(`group`,q,`[&>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`,i),t[14]=i,t[15]=v);let y;return t[16]!==f||t[17]!==h||t[18]!==c||t[19]!==g||t[20]!==_||t[21]!==v?(y=/* @__PURE__ */ C(f,{"data-slot":g,type:_,className:v,...c,children:h}),t[16]=f,t[17]=h,t[18]=c,t[19]=g,t[20]=_,t[21]=v,t[22]=y):y=t[22],y},SwitcherTrigger:e=>{let t=p(18),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({asChild:n,children:r,className:i,"data-slot":s,type:l,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=n?u:`button`,f;t[7]===s?f=t[8]:(f=o(s,`sidebar-switcher-trigger`),t[7]=s,t[8]=f);let m=n?l:l??`button`,h;t[9]===i?h=t[10]:(h=a(`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`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`aria-expanded:bg-neutral-500/15 aria-expanded: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`,`transition-[width,padding]`,D,i),t[9]=i,t[10]=h);let g;return t[11]!==d||t[12]!==r||t[13]!==c||t[14]!==f||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ C(d,{"data-slot":f,type:m,className:h,...c,children:r}),t[11]=d,t[12]=r,t[13]=c,t[14]=f,t[15]=m,t[16]=h,t[17]=g):g=t[17],g},Tooltip:e=>{let t=p(26),n,r,i,a,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6]):({children:n,"data-slot":r,label:i,shortcut:s,side:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:f}=A(`Tooltip`),m=!u&&!f,[h,g]=b(!1),[_,v]=b(m);_!==m&&(v(m),g(!1));let y;t[7]===m?y=t[8]:(y=e=>{g(e&&m)},t[7]=m,t[8]=y);let x=y,S=m&&h,T;t[9]===n?T=t[10]:(T=/* @__PURE__ */ C(d.Trigger,{asChild:!0,children:n}),t[9]=n,t[10]=T);let E;t[11]===r?E=t[12]:(E=o(r,`sidebar-tooltip`),t[11]=r,t[12]=E);let D;t[13]!==i||t[14]!==s?(D=/* @__PURE__ */ C(L,{label:i,shortcut:s}),t[13]=i,t[14]=s,t[15]=D):D=t[15];let O;t[16]!==a||t[17]!==l||t[18]!==E||t[19]!==D?(O=/* @__PURE__ */ C(d.Content,{"data-slot":E,side:l,...a,children:D}),t[16]=a,t[17]=l,t[18]=E,t[19]=D,t[20]=O):O=t[20];let k;return t[21]!==x||t[22]!==S||t[23]!==T||t[24]!==O?(k=/* @__PURE__ */ w(d.Root,{disableHoverableContent:!0,onOpenChange:x,open:S,children:[T,O]}),t[21]=x,t[22]=S,t[23]=T,t[24]=O,t[25]=k):k=t[25],k},Separator:e=>{let t=p(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,"data-slot":r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let s;t[4]===r?s=t[5]:(s=o(r,`sidebar-separator`),t[4]=r,t[5]=s);let l;t[6]===n?l=t[7]:(l=a(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`transition-[width]`,D,n),t[6]=n,t[7]=l);let u;return t[8]!==i||t[9]!==s||t[10]!==l?(u=/* @__PURE__ */ C(c,{"data-slot":s,className:l,...i}),t[8]=i,t[9]=s,t[10]=l,t[11]=u):u=t[11],u}},Y=`mantle-sidebar-state`,X={collapsed:`collapsed`,expanded:`expanded`};function Z(e){let t=f(e,Y);if(t===X.expanded)return!0;if(t===X.collapsed)return!1}function Q(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?X.expanded:X.collapsed,c=[`${Y}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{Y as SIDEBAR_STATE_COOKIE_NAME,J as Sidebar,Z as extractSidebarStateCookie,Q as serializeSidebarStateCookie,k as useSidebar};
|
|
1
|
+
"use client";import{t as e}from"./use-callback-ref-DiOXFQzM.js";import{r as t}from"./use-breakpoint-B4Kh0xE6.js";import{n,t as r}from"./use-is-apple-platform-Bq6_KbVX.js";import{t as i}from"./use-is-hydrated-after-paint-CrHt3OHw.js";import{t as a}from"./cx-CK7o_rVv.js";import{t as o}from"./data-slot-EM6s2WEU.js";import{t as s}from"./button-B9bChDgl.js";import{n as c}from"./separator-DnvhwY2J.js";import{t as l}from"./sheet-DHy_vlme.js";import{t as u}from"./slot-B7rwscwd.js";import{t as d}from"./tooltip-DQO40Mrq.js";import{n as f}from"./cookie-ca4g5CKp.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useLayoutEffect as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`max-sm:not-data-hydrated:hidden`,md:`max-md:not-data-hydrated:hidden`,lg:`max-lg:not-data-hydrated:hidden`},D=`duration-200 ease-out-strong motion-reduce:transition-none group-not-data-hydrated/sidebar-nav:transition-none`,O=m(null);function k(){let e=h(O);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function A(e){let t=h(O);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const j=[];function M(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function N(){let e=Symbol(`sidebar-keyboard-shortcut`);return j.push(e),{isOwner:()=>j[0]===e,release:()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}}const P=r=>{let i=p(35),{children:a,defaultOpen:o,keyboardShortcut:s,mobileBreakpoint:c,onOpenChange:l,onOpenMobileChange:u,open:d,openMobile:f}=r,m=o===void 0||o,h=s===void 0||s,x=c===void 0?`lg`:c,S=t(x),w=_(),T=y(l),E=y(u),D;i[0]!==l||i[1]!==u?(D=()=>{T.current=l,E.current=u},i[0]=l,i[1]=u,i[2]=D):D=i[2],v(D);let k=d!=null,[A,j]=b(m),P=k?d:A,F;i[3]===k?F=i[4]:(F=e=>{k||j(e),T.current?.(e)},i[3]=k,i[4]=F);let I=F,L=f!=null,[R,z]=b(!1),B=L?f:R,V;i[5]===L?V=i[6]:(V=e=>{L||z(e),E.current?.(e)},i[5]=L,i[6]=V);let H=V,U=y(S),W,G;i[7]!==S||i[8]!==B||i[9]!==H?(W=()=>{let e=U.current&&!S;U.current=S,e&&B&&H(!1)},G=[S,B,H],i[7]=S,i[8]=B,i[9]=H,i[10]=W,i[11]=G):(W=i[10],G=i[11]),g(W,G);let K;i[12]!==S||i[13]!==P||i[14]!==B||i[15]!==I||i[16]!==H?(K=()=>{S?H(!B):I(!P)},i[12]=S,i[13]=P,i[14]=B,i[15]=I,i[16]=H,i[17]=K):K=i[17];let q=K,J=e(q),Y,X;i[18]!==h||i[19]!==J?(Y=()=>{if(!h)return;let e=N(),t=n(),r=n=>{if(!e.isOwner()||n.defaultPrevented||M(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(),J())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},X=[h,J],i[18]=h,i[19]=J,i[20]=Y,i[21]=X):(Y=i[20],X=i[21]),g(Y,X);let Z;i[22]!==S||i[23]!==h||i[24]!==x||i[25]!==w||i[26]!==P||i[27]!==B||i[28]!==I||i[29]!==H||i[30]!==q?(Z={isMobile:S,keyboardShortcut:h,mobileBreakpoint:x,navId:w,open:P,openMobile:B,setOpen:I,setOpenMobile:H,toggle:q},i[22]=S,i[23]=h,i[24]=x,i[25]=w,i[26]=P,i[27]=B,i[28]=I,i[29]=H,i[30]=q,i[31]=Z):Z=i[31];let Q=Z,$;return i[32]!==a||i[33]!==Q?($=/* @__PURE__ */ C(O.Provider,{value:Q,children:a}),i[32]=a,i[33]=Q,i[34]=$):$=i[34],$},F=e=>{let t=p(48),n,r,s,c,u,d;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4],u=t[5],d=t[6]):({"aria-label":n,"aria-labelledby":r,children:s,className:c,"data-slot":u,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c,t[5]=u,t[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=A(`Nav`),y=i(),b=n??(r==null?`Main`:void 0);if(f){let e;t[7]===u?e=t[8]:(e=o(u,`sidebar-nav`),t[7]=u,t[8]=e);let n;t[9]===r?n=t[10]:(n=r==null?null:{"aria-labelledby":r},t[9]=r,t[10]=n);let i;t[11]===c?i=t[12]:(i=a(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),t[11]=c,t[12]=i);let f=b??`Sidebar`,p;t[13]===f?p=t[14]:(p=/* @__PURE__ */ C(l.Title,{className:`sr-only`,children:f}),t[13]=f,t[14]=p);let m;t[15]!==b||t[16]!==r||t[17]!==s||t[18]!==h?(m=/* @__PURE__ */ C(`nav`,{id:h,"aria-label":b,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),t[15]=b,t[16]=r,t[17]=s,t[18]=h,t[19]=m):m=t[19];let g;t[20]!==d||t[21]!==e||t[22]!==n||t[23]!==i||t[24]!==p||t[25]!==m?(g=/* @__PURE__ */ w(l.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":e,"data-mobile":``,...n,className:i,...d,children:[p,m]}),t[20]=d,t[21]=e,t[22]=n,t[23]=i,t[24]=p,t[25]=m,t[26]=g):g=t[26];let y;return t[27]!==_||t[28]!==v||t[29]!==g?(y=/* @__PURE__ */ C(l.Root,{open:_,onOpenChange:v,children:g}),t[27]=_,t[28]=v,t[29]=g,t[30]=y):y=t[30],y}let x;t[31]===u?x=t[32]:(x=o(u,`sidebar-nav`),t[31]=u,t[32]=x);let S=E[m],T;t[33]!==c||t[34]!==S?(T=a(`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)`,S,`transition-[width] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,c),t[33]=c,t[34]=S,t[35]=T):T=t[35];let D=g?`expanded`:`collapsed`,O=y?``:void 0,k;t[36]!==b||t[37]!==r||t[38]!==s||t[39]!==h?(k=/* @__PURE__ */ C(`nav`,{id:h,"aria-label":b,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),t[36]=b,t[37]=r,t[38]=s,t[39]=h,t[40]=k):k=t[40];let j;return t[41]!==d||t[42]!==x||t[43]!==T||t[44]!==D||t[45]!==O||t[46]!==k?(j=/* @__PURE__ */ C(`div`,{"data-slot":x,className:T,...d,"data-state":D,"data-hydrated":O,children:k}),t[41]=d,t[42]=x,t[43]=T,t[44]=D,t[45]=O,t[46]=k,t[47]=j):j=t[47],j},I=/* @__PURE__ */ C(T,{}),L=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=/* @__PURE__ */ C(`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&&/* @__PURE__ */ C(`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`,translate:`no`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=/* @__PURE__ */ w(`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},R=e=>{let t=p(34),n,i,a,c,l,u,f,m,h;t[0]===e?(n=t[1],i=t[2],a=t[3],c=t[4],l=t[5],u=t[6],f=t[7],m=t[8],h=t[9]):({appearance:l,"data-slot":n,icon:u,intent:f,label:m,onClick:i,shortcut:c,size:h,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=f,t[8]=m,t[9]=h);let g=l===void 0?`ghost`:l,_=u===void 0?I:u,v=f===void 0?`neutral`:f,y=m===void 0?`Toggle Sidebar`:m,b=h===void 0?`sm`:h,{isMobile:x,keyboardShortcut:S,navId:T,open:E,openMobile:D,toggle:O}=A(`Trigger`),k=r(),j=x?D:E,M=!x||D,N=S?c:void 0,P=k?`Meta+B`:`Control+B`,F=M?T:void 0,R=S?P:void 0,z;t[10]===n?z=t[11]:(z=o(n,`sidebar-trigger`),t[10]=n,t[11]=z);let B=j?`expanded`:`collapsed`,V;t[12]!==i||t[13]!==O?(V=e=>{i?.(e),e.defaultPrevented||O()},t[12]=i,t[13]=O,t[14]=V):V=t[14];let H;t[15]!==g||t[16]!==j||t[17]!==_||t[18]!==v||t[19]!==y||t[20]!==a||t[21]!==b||t[22]!==V||t[23]!==F||t[24]!==R||t[25]!==z||t[26]!==B?(H=/* @__PURE__ */ C(d.Trigger,{asChild:!0,children:/* @__PURE__ */ C(s,{appearance:g,"aria-controls":F,"aria-expanded":j,"aria-keyshortcuts":R,"data-slot":z,"data-state":B,icon:_,intent:v,label:y,onClick:V,size:b,...a})}),t[15]=g,t[16]=j,t[17]=_,t[18]=v,t[19]=y,t[20]=a,t[21]=b,t[22]=V,t[23]=F,t[24]=R,t[25]=z,t[26]=B,t[27]=H):H=t[27];let U;t[28]!==N||t[29]!==y?(U=/* @__PURE__ */ C(d.Content,{"data-slot":`sidebar-trigger-tooltip`,children:/* @__PURE__ */ C(L,{label:y,shortcut:N})}),t[28]=N,t[29]=y,t[30]=U):U=t[30];let W;return t[31]!==H||t[32]!==U?(W=/* @__PURE__ */ w(d.Root,{children:[H,U]}),t[31]=H,t[32]=U,t[33]=W):W=t[33],W},z=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-header`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`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`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},B=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-body`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`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`,`transition-[padding]`,D,`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`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},V=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`div`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-footer`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},H=m(null),U=e=>{let t=p(21),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let[l,d]=b(null),f;t[6]===l?f=t[7]:(f={mountedLabelId:l,setMountedLabelId:d},t[6]=l,t[7]=f);let m=f,h=n?u:`div`,g;t[8]===s?g=t[9]:(g=o(s,`sidebar-group`),t[8]=s,t[9]=g);let _;t[10]===i?_=t[11]:(_=a(`pt-0.5`,i),t[10]=i,t[11]=_);let v;t[12]!==h||t[13]!==r||t[14]!==c||t[15]!==g||t[16]!==_?(v=/* @__PURE__ */ C(h,{"data-slot":g,className:_,...c,children:r}),t[12]=h,t[13]=r,t[14]=c,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;return t[18]!==m||t[19]!==v?(y=/* @__PURE__ */ C(H.Provider,{value:m,children:v}),t[18]=m,t[19]=v,t[20]=y):y=t[20],y},W=e=>{let t=p(22),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({asChild:n,children:r,className:i,"data-slot":s,id:c,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=h(H),f=_(),m=c??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;t[7]!==m||t[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],t[7]=m,t[8]=v,t[9]=y,t[10]=b):(y=t[9],b=t[10]),g(y,b);let x=n?u:`div`,S;t[11]===s?S=t[12]:(S=o(s,`sidebar-group-label`),t[11]=s,t[12]=S);let w;t[13]===i?w=t[14]:(w=a(`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`,D,i),t[13]=i,t[14]=w);let T;return t[15]!==x||t[16]!==r||t[17]!==m||t[18]!==l||t[19]!==S||t[20]!==w?(T=/* @__PURE__ */ C(x,{id:m,"data-slot":S,className:w,...l,children:r}),t[15]=x,t[16]=r,t[17]=m,t[18]=l,t[19]=S,t[20]=w,t[21]=T):T=t[21],T},G=e=>{let t=p(18),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({"aria-labelledby":n,asChild:r,children:i,className:s,"data-slot":c,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=h(H),f=r?u:`ul`,m=n??d?.mountedLabelId??void 0,g;t[7]===c?g=t[8]:(g=o(c,`sidebar-list`),t[7]=c,t[8]=g);let _;t[9]===s?_=t[10]:(_=a(`mb-2 space-y-px`,s),t[9]=s,t[10]=_);let v;return t[11]!==f||t[12]!==i||t[13]!==l||t[14]!==m||t[15]!==g||t[16]!==_?(v=/* @__PURE__ */ C(f,{"aria-labelledby":m,"data-slot":g,className:_,...l,children:i}),t[11]=f,t[12]=i,t[13]=l,t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17],v},K=e=>{let t=p(16),n,r,i,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c);let l=n?u:`li`,d;t[6]===s?d=t[7]:(d=o(s,`sidebar-item`),t[6]=s,t[7]=d);let f;t[8]===i?f=t[9]:(f=a(`list-none`,i),t[8]=i,t[9]=f);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==d||t[14]!==f?(m=/* @__PURE__ */ C(l,{"data-slot":d,className:f,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},q=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal 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`,`aria-expanded:bg-neutral-500/15 aria-expanded: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`,`group-data-[state=collapsed]/sidebar-nav:text-clip`,`transition-[width,padding,margin] ${D}`].join(` `),J={Root:P,Nav:F,Trigger:R,Header:z,Body:B,Footer:V,Group:U,GroupLabel:W,List:G,Item:K,ItemButton:e=>{let t=p(21),n,r,i,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6],d=t[7]):({asChild:n,children:r,className:i,current:s,"data-slot":c,type:d,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=d);let f=n?u:`button`,m;t[8]===c?m=t[9]:(m=o(c,`sidebar-item-button`),t[8]=c,t[9]=m);let h=s?``:void 0,g=s?`page`:void 0,_=n?d:d??`button`,v;t[10]===i?v=t[11]:(v=a(q,`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`,i),t[10]=i,t[11]=v);let y;return t[12]!==f||t[13]!==r||t[14]!==l||t[15]!==m||t[16]!==h||t[17]!==g||t[18]!==_||t[19]!==v?(y=/* @__PURE__ */ C(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...l,children:r}),t[12]=f,t[13]=r,t[14]=l,t[15]=m,t[16]=h,t[17]=g,t[18]=_,t[19]=v,t[20]=y):y=t[20],y},SearchTrigger:e=>{let t=p(23),n,r,i,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6],d=t[7]):({asChild:n,children:r,className:i,"data-slot":s,shortcut:l,type:d,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=d);let f=n?u:`button`,m;t[8]!==n||t[9]!==r||t[10]!==l?(m=n?r:/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:r}),/* @__PURE__ */ C(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,translate:`no`,className:a(`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:l})]}),t[8]=n,t[9]=r,t[10]=l,t[11]=m):m=t[11];let h=m,g;t[12]===s?g=t[13]:(g=o(s,`sidebar-search-trigger`),t[12]=s,t[13]=g);let _=n?d:d??`button`,v;t[14]===i?v=t[15]:(v=a(`group`,q,`[&>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`,i),t[14]=i,t[15]=v);let y;return t[16]!==f||t[17]!==h||t[18]!==c||t[19]!==g||t[20]!==_||t[21]!==v?(y=/* @__PURE__ */ C(f,{"data-slot":g,type:_,className:v,...c,children:h}),t[16]=f,t[17]=h,t[18]=c,t[19]=g,t[20]=_,t[21]=v,t[22]=y):y=t[22],y},SwitcherTrigger:e=>{let t=p(18),n,r,i,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6]):({asChild:n,children:r,className:i,"data-slot":s,type:l,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l);let d=n?u:`button`,f;t[7]===s?f=t[8]:(f=o(s,`sidebar-switcher-trigger`),t[7]=s,t[8]=f);let m=n?l:l??`button`,h;t[9]===i?h=t[10]:(h=a(`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`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`aria-expanded:bg-neutral-500/15 aria-expanded: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`,`transition-[width,padding]`,D,i),t[9]=i,t[10]=h);let g;return t[11]!==d||t[12]!==r||t[13]!==c||t[14]!==f||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ C(d,{"data-slot":f,type:m,className:h,...c,children:r}),t[11]=d,t[12]=r,t[13]=c,t[14]=f,t[15]=m,t[16]=h,t[17]=g):g=t[17],g},Tooltip:e=>{let t=p(26),n,r,i,a,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6]):({children:n,"data-slot":r,label:i,shortcut:s,side:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:f}=A(`Tooltip`),m=!u&&!f,[h,g]=b(!1),[_,v]=b(m);_!==m&&(v(m),g(!1));let y;t[7]===m?y=t[8]:(y=e=>{g(e&&m)},t[7]=m,t[8]=y);let x=y,S=m&&h,T;t[9]===n?T=t[10]:(T=/* @__PURE__ */ C(d.Trigger,{asChild:!0,children:n}),t[9]=n,t[10]=T);let E;t[11]===r?E=t[12]:(E=o(r,`sidebar-tooltip`),t[11]=r,t[12]=E);let D;t[13]!==i||t[14]!==s?(D=/* @__PURE__ */ C(L,{label:i,shortcut:s}),t[13]=i,t[14]=s,t[15]=D):D=t[15];let O;t[16]!==a||t[17]!==l||t[18]!==E||t[19]!==D?(O=/* @__PURE__ */ C(d.Content,{"data-slot":E,side:l,...a,children:D}),t[16]=a,t[17]=l,t[18]=E,t[19]=D,t[20]=O):O=t[20];let k;return t[21]!==x||t[22]!==S||t[23]!==T||t[24]!==O?(k=/* @__PURE__ */ w(d.Root,{disableHoverableContent:!0,onOpenChange:x,open:S,children:[T,O]}),t[21]=x,t[22]=S,t[23]=T,t[24]=O,t[25]=k):k=t[25],k},Separator:e=>{let t=p(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,"data-slot":r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let s;t[4]===r?s=t[5]:(s=o(r,`sidebar-separator`),t[4]=r,t[5]=s);let l;t[6]===n?l=t[7]:(l=a(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`transition-[width]`,D,n),t[6]=n,t[7]=l);let u;return t[8]!==i||t[9]!==s||t[10]!==l?(u=/* @__PURE__ */ C(c,{"data-slot":s,className:l,...i}),t[8]=i,t[9]=s,t[10]=l,t[11]=u):u=t[11],u}},Y=`mantle-sidebar-state`,X={collapsed:`collapsed`,expanded:`expanded`};function Z(e){let t=f(e,Y);if(t===X.expanded)return!0;if(t===X.collapsed)return!1}function Q(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?X.expanded:X.collapsed,c=[`${Y}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{Y as SIDEBAR_STATE_COOKIE_NAME,J as Sidebar,Z as extractSidebarStateCookie,Q as serializeSidebarStateCookie,k as useSidebar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-B7rwscwd.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a=a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":c,asChild:d,className:s,ref:u,...l}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=d!==void 0&&d?n:`div`,p;o[6]===c?p=o[7]:(p=t(c,`skeleton`),o[6]=c,o[7]=p);let m;o[8]===s?m=o[9]:(m=e(`h-4 animate-pulse rounded-md bg-gray-300/25 dark:bg-gray-950/10`,s),o[8]=s,o[9]=m);let h;return o[10]!==f||o[11]!==l||o[12]!==u||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,"aria-hidden":!0,className:m,ref:u,...l}),o[10]=f,o[11]=l,o[12]=u,o[13]=p,o[14]=m,o[15]=h):h=o[15],h};export{a as t};
|
package/dist/skeleton.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/feedback/skeleton
|
|
5
5
|
*/
|
|
6
6
|
import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
8
8
|
import { ComponentProps } from "react";
|
|
9
9
|
type Props = Omit<ComponentProps<"div">, "children"> & SelfClosingWithAsChild & WithDataSlot;
|
|
10
10
|
/**
|
|
@@ -19,14 +19,14 @@ type Props = Omit<ComponentProps<"div">, "children"> & SelfClosingWithAsChild &
|
|
|
19
19
|
* - On initial page load, before data has resolved.
|
|
20
20
|
*
|
|
21
21
|
* **When not to use**
|
|
22
|
-
* - For very short fetches (< 200 ms)
|
|
22
|
+
* - For very short fetches (< 200 ms). A flash of skeleton is more
|
|
23
23
|
* distracting than helpful.
|
|
24
24
|
* - To convey error or empty states. Use {@link https://mantle.ngrok.com/components/feedback/empty Empty} instead.
|
|
25
25
|
* - As a permanent decorative shape.
|
|
26
26
|
*
|
|
27
27
|
* **Sizing.** Default height is `1rem`. Override `className` with `h-*`,
|
|
28
|
-
* `w-*`, and `rounded-*` utilities to match the real content's dimensions
|
|
29
|
-
*
|
|
28
|
+
* `w-*`, and `rounded-*` utilities to match the real content's dimensions.
|
|
29
|
+
* The more closely the skeleton matches, the less layout shift on swap.
|
|
30
30
|
*
|
|
31
31
|
* **Accessibility.** Skeletons are decorative and convey no semantic
|
|
32
32
|
* meaning to assistive tech, so the element renders `aria-hidden="true"` by
|
package/dist/skeleton.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Skeleton}from"./skeleton-
|
|
1
|
+
export{t as Skeleton}from"./skeleton-DHfyjuQi.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/primitives/skip-to-main-link
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
7
|
import { ComponentProps } from "react";
|
|
8
8
|
type SkipToMainLinkProps = Omit<ComponentProps<"a">, "href"> & WithDataSlot & {
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./anchor-
|
|
1
|
+
"use client";import{t as e}from"./anchor-Dc6IgvXV.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a=a=>{let o=r(21),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({children:d,className:s,"data-slot":c,onClick:l,targetId:f,...u}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=d===void 0?`Skip to main content`:d,m=f===void 0?`main`:f,h;o[7]===c?h=o[8]:(h=n(c,`skip-to-main-link`),o[7]=c,o[8]=h);let g=`#${m}`,_;o[9]!==l||o[10]!==m?(_=e=>{e.preventDefault(),window.history.replaceState(null,``,`#${m}`),document.getElementById(m)?.focus(),l?.(e)},o[9]=l,o[10]=m,o[11]=_):_=o[11];let v;o[12]===s?v=o[13]:(v=t(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,s),o[12]=s,o[13]=v);let y;return o[14]!==p||o[15]!==u||o[16]!==h||o[17]!==g||o[18]!==_||o[19]!==v?(y=/* @__PURE__ */ i(e,{...u,"data-slot":h,href:g,onClick:_,className:v,children:p}),o[14]=p,o[15]=u,o[16]=h,o[17]=g,o[18]=_,o[19]=v,o[20]=y):y=o[20],y};export{a as SkipToMainLink};
|
package/dist/slider.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/forms/slider
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
7
|
import { ComponentProps } from "react";
|
|
8
8
|
import { Root } from "@radix-ui/react-slider";
|
|
9
9
|
type SliderBaseProps = Omit<ComponentProps<typeof Root>, "defaultValue" | "value">;
|
package/dist/slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./field-
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./field-Cai_4c1l.js";import{c as r}from"react/compiler-runtime";import{useContext as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Range as s,Root as c,Thumb as l,Track as u}from"@radix-ui/react-slider";function d(d){let g=r(55),_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P;g[0]===d?(_=g[1],v=g[2],y=g[3],b=g[4],x=g[5],S=g[6],C=g[7],w=g[8],T=g[9],E=g[10],D=g[11],O=g[12],k=g[13],A=g[14],j=g[15],M=g[16],N=g[17],P=g[18]):({"data-slot":C,"aria-describedby":_,"aria-errormessage":v,"aria-invalid":y,"aria-label":b,"aria-labelledby":x,className:S,color:O,defaultValue:w,id:T,max:k,min:A,minStepsBetweenThumbs:j,name:E,step:M,showTicks:N,value:P,...D}=d,g[0]=d,g[1]=_,g[2]=v,g[3]=y,g[4]=b,g[5]=x,g[6]=S,g[7]=C,g[8]=w,g[9]=T,g[10]=E,g[11]=D,g[12]=O,g[13]=k,g[14]=A,g[15]=j,g[16]=M,g[17]=N,g[18]=P);let F=O===void 0?`bg-accent-600`:O,I=k===void 0?100:k,L=A===void 0?0:A,R=j===void 0?1:j,z=M===void 0?1:M,B=N!==void 0&&N,V=i(n),H;if(g[19]!==_||g[20]!==v||g[21]!==y||g[22]!==b||g[23]!==x||g[24]!==S||g[25]!==F||g[26]!==C||g[27]!==w||g[28]!==V||g[29]!==T||g[30]!==I||g[31]!==L||g[32]!==R||g[33]!==E||g[34]!==D||g[35]!==B||g[36]!==z||g[37]!==P){let n=p(P),r=p(w),i=n??r??[L],d=m({showTicks:B,min:L,max:I,step:z}),O;g[39]===C?O=g[40]:(O=t(C,`slider`),g[39]=C,g[40]=O);let k;g[41]!==_||g[42]!==v||g[43]!==y||g[44]!==V||g[45]!==T?(k=V?{}:{"aria-describedby":_,"aria-errormessage":v,"aria-invalid":y,id:T},g[41]=_,g[42]=v,g[43]=y,g[44]=V,g[45]=T,g[46]=k):k=g[46];let A=d>0&&`mb-3`,j;g[47]!==S||g[48]!==A?(j=e(`[--slider-thumb-size:--spacing(4.5)]`,`data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col`,A,S),g[47]=S,g[48]=A,g[49]=j):j=g[49];let M;g[50]===Symbol.for(`react.memo_cache_sentinel`)?(M=e(`bg-neutral-300 rounded-full relative grow overflow-hidden`,`data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full`,`data-orientation-vertical:w-1.5 data-orientation-vertical:h-full`),g[50]=M):M=g[50];let N;g[51]===F?N=g[52]:(N=e(`absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full`,F),g[51]=F,g[52]=N);let U;g[53]===N?U=g[54]:(U=/* @__PURE__ */ a(u,{"data-slot":`slider-track`,className:M,children:/* @__PURE__ */ a(s,{"data-slot":`slider-range`,className:N})}),g[53]=N,g[54]=U),H=/* @__PURE__ */ o(c,{"data-slot":O,defaultValue:r,value:n,...k,min:L,minStepsBetweenThumbs:R,max:I,name:E,step:z,className:j,...D,children:[U,Array.from({length:i.length},(t,n)=>/* @__PURE__ */ a(l,{"data-slot":`slider-thumb`,"aria-describedby":V?.[`aria-describedby`]??_,"aria-errormessage":V?.[`aria-errormessage`]??v,"aria-invalid":V?.[`aria-invalid`]??y,"aria-label":h({ariaLabel:b,index:n,thumbCount:i.length}),"aria-labelledby":x,id:n===0?V?.id:void 0,className:e(`bg-static-white border-card relative size-(--slider-thumb-size) rounded-full border`,`shadow-md transition-[color,box-shadow]`,`after:absolute after:-inset-2`,`focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden`,`block shrink-0 cursor-pointer select-none`,`data-disabled:pointer-events-none data-disabled:cursor-default`)},n)),d>0&&/* @__PURE__ */ a(`div`,{"data-slot":`slider-ticks`,className:`absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]`,"aria-hidden":`true`,children:Array.from({length:d},f)})]}),g[19]=_,g[20]=v,g[21]=y,g[22]=b,g[23]=x,g[24]=S,g[25]=F,g[26]=C,g[27]=w,g[28]=V,g[29]=T,g[30]=I,g[31]=L,g[32]=R,g[33]=E,g[34]=D,g[35]=B,g[36]=z,g[37]=P,g[38]=H}else H=g[38];return H}function f(e,t){return/* @__PURE__ */ a(`span`,{"data-slot":`slider-tick`,className:`bg-card-border h-1.5 w-px`},t)}function p(e){if(e!=null)return Array.isArray(e)?e:[e]}function m({showTicks:e,min:t,max:n,step:r}){let i=n-t;return!e||!Number.isFinite(i)||!Number.isFinite(r)||r<=0||i<=0?0:Math.floor(i/r)+1}function h({ariaLabel:e,index:t,thumbCount:n}){if(e)return n===1?e:n===2?`${t===0?`Minimum`:`Maximum`} ${e}`:`${e} ${t+1} of ${n}`}export{d as Slider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{Children as r,createElement as i,isValidElement as a}from"react";import{jsx as o}from"react/jsx-runtime";import{createSlot as s}from"@radix-ui/react-slot";const c=s(`Slot`);function l(t,n){return typeof n==`function`?(...r)=>e(t,n(...r)):e(t,n)}function u(e,t){return typeof t==`function`?(...n)=>({...e,...t(...n)}):e==null?t:t==null?e:{...e,...t}}const d=e=>{let s=n(36),d,f,p,m,h,g;if(s[0]===e?(d=s[1],f=s[2],p=s[3],m=s[4],h=s[5],g=s[6]):({children:d,className:f,"data-slot":p,ref:h,style:g,...m}=e,s[0]=e,s[1]=d,s[2]=f,s[3]=p,s[4]=m,s[5]=h,s[6]=g),!a(d)){let e;return s[7]===d?e=s[8]:(e=r.only(d),s[7]=d,s[8]=e),e}let _,v,y,b,x,S;if(s[9]!==d.key||s[10]!==d.props||s[11]!==d.type||s[12]!==f||s[13]!==p||s[14]!==m||s[15]!==h||s[16]!==g){let{className:e,style:n,"data-slot":r,...a}=d.props,o=t(p,r);_=c,v=h,y=m,s[23]!==e||s[24]!==f?(b=l(f,e),s[23]=e,s[24]=f,s[25]=b):b=s[25],s[26]!==n||s[27]!==g?(x=u(g,n),s[26]=n,s[27]=g,s[28]=x):x=s[28],S=i(d.type,{...a,...o!=null&&{"data-slot":o},key:d.key??void 0}),s[9]=d.key,s[10]=d.props,s[11]=d.type,s[12]=f,s[13]=p,s[14]=m,s[15]=h,s[16]=g,s[17]=_,s[18]=v,s[19]=y,s[20]=b,s[21]=x,s[22]=S}else _=s[17],v=s[18],y=s[19],b=s[20],x=s[21],S=s[22];let C;return s[29]!==_||s[30]!==v||s[31]!==y||s[32]!==b||s[33]!==x||s[34]!==S?(C=/* @__PURE__ */ o(_,{ref:v,...y,className:b,style:x,children:S}),s[29]=_,s[30]=v,s[31]=y,s[32]=b,s[33]=x,s[34]=S,s[35]=C):C=s[35],C};export{d as t};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
3
3
|
import { CSSProperties, ComponentProps, HTMLAttributes } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* A `className` or `style` the child resolves itself, from state only the child
|
|
6
|
-
* knows
|
|
6
|
+
* knows: react-router's `NavLink` calls it with
|
|
7
7
|
* `{ isActive, isPending, isTransitioning }`, another component with something else
|
|
8
8
|
* entirely. `Slot` never invents arguments for one and never inspects them; it
|
|
9
9
|
* forwards the ones the child supplied, so they are typed `unknown`.
|
|
@@ -35,8 +35,8 @@ type Props = Omit<ComponentProps<typeof SlotPrimitive>, "className" | "style"> &
|
|
|
35
35
|
* chain first, then the child's own) so `asChild` composition accumulates the
|
|
36
36
|
* whole slot chain instead of one side clobbering the other.
|
|
37
37
|
*
|
|
38
|
-
* A child that resolves its own `className` or `style` from state only it knows
|
|
39
|
-
* react-router's `NavLink`, whose `className` may be `({ isActive }) => …`
|
|
38
|
+
* A child that resolves its own `className` or `style` from state only it knows
|
|
39
|
+
* (react-router's `NavLink`, whose `className` may be `({ isActive }) => …`) keeps
|
|
40
40
|
* that behavior: the merge composes a function of the same shape, which forwards
|
|
41
41
|
* the child's arguments to the child's function and merges the resolved value with
|
|
42
42
|
* the slot's classes or style. `Slot` never calls it, so it needs to know nothing
|
package/dist/slot.d.ts
CHANGED
package/dist/slot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Slot}from"./slot-
|
|
1
|
+
export{t as Slot}from"./slot-B7rwscwd.js";
|
package/dist/source-all.css
CHANGED
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* dist files for utility class names. This is the supported way to register
|
|
6
6
|
* mantle's Tailwind sources.
|
|
7
7
|
*
|
|
8
|
+
* The glob scans only the JavaScript. The `.d.ts`, `agent.json`, `llms.txt`, and
|
|
9
|
+
* migration files hold JSDoc examples, so a scan of them emits CSS that no
|
|
10
|
+
* component renders.
|
|
11
|
+
*
|
|
8
12
|
* Usage:
|
|
9
13
|
* @import "@ngrok/mantle/mantle.css";
|
|
10
14
|
* @import "@ngrok/mantle/source-all.css";
|
|
11
15
|
*/
|
|
12
|
-
@source "../dist";
|
|
16
|
+
@source "../dist/*.js";
|
package/dist/split-button.d.ts
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/actions/split-button
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
-
import { t as Button } from "./button-
|
|
8
|
-
import { t as IconButton } from "./button-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
|
+
import { t as Button } from "./button-Ddj6yr10.js";
|
|
8
|
+
import { t as IconButton } from "./button-DnYv7IOT.js";
|
|
9
9
|
import { t as ButtonSize } from "./button-L4exxu_L.js";
|
|
10
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
10
|
+
import { t as DropdownMenu } from "./dropdown-menu-CeY498yk.js";
|
|
11
11
|
import { ComponentProps, ReactNode } from "react";
|
|
12
12
|
type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
|
|
13
13
|
/**
|
|
14
14
|
* The size of the SplitButton, default `"md"`. Applied to both the
|
|
15
15
|
* primary action and the menu trigger so the two halves always share
|
|
16
|
-
* one height
|
|
16
|
+
* one height. The parts do not accept `size`, so mixed-size
|
|
17
17
|
* composites cannot be expressed in the type system.
|
|
18
18
|
*/
|
|
19
19
|
size?: ButtonSize;
|
|
@@ -81,7 +81,7 @@ type PrimaryActionProps = Omit<ComponentProps<typeof Button>, "appearance" | "in
|
|
|
81
81
|
* </SplitButton.Root>
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
declare const PrimaryAction: (props: PrimaryActionProps) => import("react").JSX.Element;
|
|
84
|
+
declare const PrimaryAction: ({ "data-slot": dataSlot, ...props }: PrimaryActionProps) => import("react").JSX.Element;
|
|
85
85
|
type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "intent" | "size" | "asChild" | "icon"> & {
|
|
86
86
|
icon?: ReactNode;
|
|
87
87
|
};
|
|
@@ -112,7 +112,7 @@ type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "
|
|
|
112
112
|
* </SplitButton.Root>
|
|
113
113
|
* ```
|
|
114
114
|
*/
|
|
115
|
-
declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
|
|
115
|
+
declare const MenuTrigger: ({ "data-slot": dataSlot, icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
|
|
116
116
|
/**
|
|
117
117
|
* The container for the split button dropdown menu content. Appears in a
|
|
118
118
|
* portal with scrolling and animations.
|
|
@@ -141,7 +141,7 @@ declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("rea
|
|
|
141
141
|
* </SplitButton.Root>
|
|
142
142
|
* ```
|
|
143
143
|
*/
|
|
144
|
-
declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
|
|
144
|
+
declare const MenuContent: ({ align, "data-slot": dataSlot, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
|
|
145
145
|
/**
|
|
146
146
|
* A standard item in the split button dropdown menu that can be selected or
|
|
147
147
|
* activated.
|
|
@@ -170,7 +170,7 @@ declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownM
|
|
|
170
170
|
* </SplitButton.Root>
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
|
-
declare const MenuItem: ({ className, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
|
|
173
|
+
declare const MenuItem: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
|
|
174
174
|
/**
|
|
175
175
|
* A button group that pairs a one-click default action with a dropdown menu
|
|
176
176
|
* of related alternatives. Best for when users typically want one action but
|
package/dist/split-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-DNLTJ32M.js";import{t as r}from"./button-B9bChDgl.js";import{t as i}from"./dropdown-menu-uheL0prz.js";import{t as a}from"./icon-xb7d9M7X.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=c({size:`md`}),f={Root:n=>{let r=o(35),a,s,c,l,f,p,m,h,g,_,v;r[0]===n?(a=r[1],s=r[2],c=r[3],l=r[4],f=r[5],p=r[6],m=r[7],h=r[8],g=r[9],_=r[10],v=r[11]):({"data-slot":c,className:s,children:a,dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,size:v,ref:_,...g}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=c,r[4]=l,r[5]=f,r[6]=p,r[7]=m,r[8]=h,r[9]=g,r[10]=_,r[11]=v);let y=v===void 0?`md`:v,b;r[12]===y?b=r[13]:(b={size:y},r[12]=y,r[13]=b);let x=b,S;r[14]===c?S=r[15]:(S=t(c,`split-button`),r[14]=c,r[15]=S);let C;r[16]===s?C=r[17]:(C=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,s),r[16]=s,r[17]=C);let w;r[18]!==a||r[19]!==g||r[20]!==_||r[21]!==y||r[22]!==S||r[23]!==C?(w=/* @__PURE__ */ u(`div`,{"data-slot":S,"data-size":y,className:C,ref:_,...g,children:a}),r[18]=a,r[19]=g,r[20]=_,r[21]=y,r[22]=S,r[23]=C,r[24]=w):w=r[24];let T;r[25]!==x||r[26]!==w?(T=/* @__PURE__ */ u(d.Provider,{value:x,children:w}),r[25]=x,r[26]=w,r[27]=T):T=r[27];let E;return r[28]!==l||r[29]!==f||r[30]!==p||r[31]!==m||r[32]!==h||r[33]!==T?(E=/* @__PURE__ */ u(i.Root,{dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,children:T}),r[28]=l,r[29]=f,r[30]=p,r[31]=m,r[32]=h,r[33]=T,r[34]=E):E=r[34],E},PrimaryAction:e=>{let r=o(9),i,a;r[0]===e?(i=r[1],a=r[2]):({"data-slot":i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let{size:s}=l(d),c;r[3]===i?c=r[4]:(c=t(i,`split-button-primary-action`),r[3]=i,r[4]=c);let f;return r[5]!==a||r[6]!==s||r[7]!==c?(f=/* @__PURE__ */ u(n,{appearance:`outlined`,intent:`neutral`,size:s,"data-slot":c,...a}),r[5]=a,r[6]=s,r[7]=c,r[8]=f):f=r[8],f},MenuTrigger:e=>{let n=o(15),c,f,p;n[0]===e?(c=n[1],f=n[2],p=n[3]):({"data-slot":c,icon:f,...p}=e,n[0]=e,n[1]=c,n[2]=f,n[3]=p);let{size:m}=l(d),h;n[4]===c?h=n[5]:(h=t(c,`split-button-menu-trigger`),n[4]=c,n[5]=h);let g;n[6]===f?g=n[7]:(g=f??/* @__PURE__ */ u(a,{svg:/* @__PURE__ */ u(s,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`})}),n[6]=f,n[7]=g);let _;n[8]!==p||n[9]!==m||n[10]!==g?(_=/* @__PURE__ */ u(r,{icon:g,appearance:`outlined`,intent:`neutral`,size:m,...p}),n[8]=p,n[9]=m,n[10]=g,n[11]=_):_=n[11];let v;return n[12]!==h||n[13]!==_?(v=/* @__PURE__ */ u(i.Trigger,{asChild:!0,className:`group`,"data-slot":h,children:_}),n[12]=h,n[13]=_,n[14]=v):v=n[14],v},MenuContent:e=>{let n=o(10),r,a,s;n[0]===e?(r=n[1],a=n[2],s=n[3]):({align:s,"data-slot":r,...a}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=s);let c=s===void 0?`end`:s,l;n[4]===r?l=n[5]:(l=t(r,`split-button-menu-content`),n[4]=r,n[5]=l);let d;return n[6]!==c||n[7]!==a||n[8]!==l?(d=/* @__PURE__ */ u(i.Content,{align:c,"data-slot":l,...a}),n[6]=c,n[7]=a,n[8]=l,n[9]=d):d=n[9],d},MenuItem:n=>{let r=o(12),a,s,c;r[0]===n?(a=r[1],s=r[2],c=r[3]):({className:a,"data-slot":s,...c}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=c);let l;r[4]===a?l=r[5]:(l=e(`gap-2`,a),r[4]=a,r[5]=l);let d;r[6]===s?d=r[7]:(d=t(s,`split-button-menu-item`),r[6]=s,r[7]=d);let f;return r[8]!==c||r[9]!==l||r[10]!==d?(f=/* @__PURE__ */ u(i.Item,{className:l,"data-slot":d,...c}),r[8]=c,r[9]=l,r[10]=d,r[11]=f):f=r[11],f}};export{f as SplitButton};
|