@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/app-layout.d.ts
CHANGED
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
* @see https://mantle.ngrok.com/layouts/app-layout
|
|
9
9
|
*/
|
|
10
10
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
11
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
12
|
-
import { n as IconButtonProps } from "./button-
|
|
11
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
12
|
+
import { n as IconButtonProps } from "./button-DnYv7IOT.js";
|
|
13
13
|
import { ComponentProps, ReactNode } from "react";
|
|
14
14
|
/**
|
|
15
15
|
* The outer frame of an application shell. Renders a `<div>` with
|
|
16
16
|
* `relative isolate flex h-full w-full flex-col overflow-clip`, so
|
|
17
|
-
* it fills its nearest sized ancestor
|
|
17
|
+
* it fills its nearest sized ancestor. That makes it embeddable in docs
|
|
18
18
|
* demos and tests. Real app shells pin it to the viewport by merging
|
|
19
19
|
* `className="fixed inset-0"` (mantle `cx` is tailwind-merge-backed, so the
|
|
20
|
-
* override is deterministic); the shell itself never scrolls
|
|
20
|
+
* override is deterministic); the shell itself never scrolls. Only
|
|
21
21
|
* `AppLayout.Body` does.
|
|
22
22
|
*
|
|
23
23
|
* It clips with `overflow-clip` rather than `overflow-hidden` for the same
|
|
24
24
|
* reason `AppLayout.Content` does: `hidden` **is** a scroll container that
|
|
25
25
|
* paints no scrollbar, so anything wider than the frame lets focus scroll the
|
|
26
|
-
* entire shell sideways
|
|
27
|
-
* view with no scrollbar and no gesture to bring them back. On a frame pinned
|
|
26
|
+
* entire shell sideways. That translates the notice, the rail, and the card out
|
|
27
|
+
* of view with no scrollbar and no gesture to bring them back. On a frame pinned
|
|
28
28
|
* with `fixed inset-0` that is the whole window. `clip` is not a scroll
|
|
29
29
|
* container at all.
|
|
30
30
|
*
|
|
@@ -66,14 +66,14 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
66
66
|
*/
|
|
67
67
|
declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
68
68
|
/**
|
|
69
|
-
* A full-window-width strip pinned above everything else in the shell
|
|
70
|
-
* including any sidebar
|
|
69
|
+
* A full-window-width strip pinned above everything else in the shell
|
|
70
|
+
* (including any sidebar) for maintenance notices, environment warnings,
|
|
71
71
|
* and similar app-wide messaging. It is a vertical composition slot: place a
|
|
72
72
|
* maintenance banner and an `AlertCenter.Bar` here, and each contributes its
|
|
73
73
|
* own row while the slot pushes the shell down. Renders an unstyled `<div>`
|
|
74
74
|
* (`flex w-full shrink-0 flex-col`): its children bring their own colors and
|
|
75
75
|
* layout, and the part collapses to nothing when empty. Deliberately not named
|
|
76
|
-
* `Banner` so it never reads as the ARIA `banner` landmark
|
|
76
|
+
* `Banner` so it never reads as the ARIA `banner` landmark: it claims no
|
|
77
77
|
* landmark at all.
|
|
78
78
|
*
|
|
79
79
|
* @see https://mantle.ngrok.com/layouts/app-layout#applayoutnotice
|
|
@@ -171,11 +171,11 @@ declare const Workspace: ({ asChild, children, className, "data-slot": dataSlot,
|
|
|
171
171
|
* the sidebar, holding `AppLayout.Header` and `AppLayout.Body`. A flex column
|
|
172
172
|
* that fills the remaining width of
|
|
173
173
|
* `AppLayout.Workspace` and insets itself from the window edge and the rail with
|
|
174
|
-
* its own margin (`--app-layout-card-gutter`, default `0.5rem`)
|
|
174
|
+
* its own margin (`--app-layout-card-gutter`, default `0.5rem`). The gutter
|
|
175
175
|
* belongs to the card so a rail stays flush against the window edge.
|
|
176
176
|
*
|
|
177
177
|
* The card does **not** scroll: `AppLayout.Body` does. `Content` is
|
|
178
|
-
* `overflow-clip`, which does two jobs
|
|
178
|
+
* `overflow-clip`, which does two jobs: it keeps a full-bleed page background
|
|
179
179
|
* from painting square corners over the card's `rounded-xl`, and it is
|
|
180
180
|
* deliberately `clip` rather than `hidden` because `hidden` is a scroll
|
|
181
181
|
* container with no scrollbar: a long toolbar would let focus scroll the card
|
|
@@ -422,7 +422,7 @@ declare const HeaderContent: ({ asChild, children, className, "data-slot": dataS
|
|
|
422
422
|
declare const HeaderActions: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
423
423
|
/**
|
|
424
424
|
* The page region of the content card, and the shell's **only** scroll
|
|
425
|
-
* container (`overflow-y-auto overscroll-none`)
|
|
425
|
+
* container (`overflow-y-auto overscroll-none`). The page body never scrolls,
|
|
426
426
|
* and scroll never bounces the shell. Render it after `AppLayout.Header` inside
|
|
427
427
|
* `AppLayout.Content`.
|
|
428
428
|
*
|
|
@@ -444,17 +444,17 @@ declare const HeaderActions: ({ asChild, children, className, "data-slot": dataS
|
|
|
444
444
|
* - `min-h-0 flex-1` gives it a definite height, so a page that asks for
|
|
445
445
|
* `h-full` fills exactly the card interior instead of overflowing it by the
|
|
446
446
|
* toolbar's height.
|
|
447
|
-
* - block layout inside
|
|
447
|
+
* - block layout inside (not flex) is why `mx-auto max-w-7xl` still centers a
|
|
448
448
|
* page at its max width. As a *flex child*, auto margins beat
|
|
449
449
|
* `align-items: stretch` and the same container shrink-to-fits, getting
|
|
450
450
|
* *narrower* as the viewport gets wider.
|
|
451
451
|
* - `w-full` states the width outright instead of leaning on the flex
|
|
452
452
|
* container's cross-axis `stretch`, so an `mx-auto` merged onto `Body` still
|
|
453
|
-
* leaves it full width
|
|
453
|
+
* leaves it full width. Auto cross-axis margins would otherwise turn a
|
|
454
454
|
* stretched item into a shrink-to-fit one. It is no floor, though: `cx` is
|
|
455
455
|
* tailwind-merge-backed and the consumer's `className` wins, so a merged
|
|
456
|
-
* `w-*` replaces it outright, while a merged `max-w-*`
|
|
457
|
-
* group
|
|
456
|
+
* `w-*` replaces it outright, while a merged `max-w-*` (a separate conflict
|
|
457
|
+
* group) survives beside it and clamps the scrollport. Constrain the *page*
|
|
458
458
|
* inside `Body`, not `Body` itself.
|
|
459
459
|
*
|
|
460
460
|
* It is `relative` too, so page content positioned with `absolute` is contained
|
|
@@ -1364,8 +1364,8 @@ declare const AppLayout: {
|
|
|
1364
1364
|
readonly Workspace: typeof Workspace;
|
|
1365
1365
|
/**
|
|
1366
1366
|
* The rounded `bg-card` surface beside the sidebar, holding the toolbar and
|
|
1367
|
-
* the page region. Insets itself with `--app-layout-card-gutter
|
|
1368
|
-
* scroll
|
|
1367
|
+
* the page region. Insets itself with `--app-layout-card-gutter`. It does not
|
|
1368
|
+
* scroll: `AppLayout.Body` does.
|
|
1369
1369
|
*
|
|
1370
1370
|
* @see https://mantle.ngrok.com/layouts/app-layout#applayoutcontent
|
|
1371
1371
|
*
|
package/dist/app-layout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./use-inert-siblings-CNmNuS2h.js";import{t as n}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as r}from"./use-matches-media-query-m860lols.js";import{n as i}from"./use-swipe-to-dismiss-i__cTF2v.js";import{n as a}from"./compose-refs-sFdxsL7k.js";import{t as o}from"./cx-CK7o_rVv.js";import{t as s}from"./data-slot-EM6s2WEU.js";import{r as c}from"./alert-DO00UiQe.js";import{u as l}from"./primitive-Dz9Al-us.js";import{t as u}from"./button-BWGUuWnu.js";import{t as d}from"./main-CC1L9IsH.js";import{t as f}from"./slot-DdYN1L1C.js";import{t as p}from"./tooltip-b6oiTaWq.js";import{n as m}from"./cookie-ca4g5CKp.js";import{c as h}from"react/compiler-runtime";import{createContext as g,useContext as _,useEffect as v,useId as y,useLayoutEffect as b,useRef as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{SidebarSimpleIcon as E}from"@phosphor-icons/react/SidebarSimple";const D=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},O=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-notice`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex w-full shrink-0 flex-col`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},k=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-workspace`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`@container/app-layout-workspace`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},A=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-content`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},j=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,M=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,j,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},ee=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-start`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex shrink-0 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},N=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-content`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex min-w-0 flex-1 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},P=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-actions`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`ml-auto flex shrink-0 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},F=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:d,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-body`),t[6]=a,t[7]=u);let p;t[8]===i?p=t[9]:(p=o(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,i),t[8]=i,t[9]=p);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==p?(m=/* @__PURE__ */ w(l,{"data-slot":u,className:p,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=p,t[15]=m):m=t[15],m},te={sm:`sm:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 sm:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 md:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100cqw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 lg:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100cqw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},ne={sm:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,md:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,lg:`md:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] md:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`},re={sm:`(width < 40rem)`,md:`(width < 40rem)`,lg:`(width < 48rem)`};function ie(e){return e!=null&&getComputedStyle(e).position===`absolute`}function I(e){return e.split(`,`).map(e=>Number.parseFloat(e)||0)}function ae(e){let t=getComputedStyle(e),n=I(t.transitionDuration),r=I(t.transitionDelay),i=t.transitionProperty.split(`,`).map((e,t)=>(n[t%n.length]??0)+(r[t%r.length]??0));return Math.max(0,...i)*1e3}const L=g(null);function R(){let e=_(L);return C(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function oe(e){let t=_(L);return C(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const z=e=>{let t=h(19),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,o=r!==void 0&&r,s=y(),l=a!=null,[u,d]=S(o),f=l?a:u,p=x(i),m;t[0]===i?m=t[1]:(m=()=>{p.current=i},t[0]=i,t[1]=m),b(m);let g=x(null),_=x(null),v;t[2]===l?v=t[3]:(v=e=>{l||d(e),p.current?.(e)},t[2]=l,t[3]=v);let C=v,T;t[4]!==f||t[5]!==C?(T=()=>{C(!f)},t[4]=f,t[5]=C,t[6]=T):T=t[6];let E=T,D,O;t[7]!==f||t[8]!==s?(D=()=>{if(f)return;let e=g.current;if(g.current=null,e==null)return;let t=document.getElementById(s),n=document.activeElement,r=t!=null&&t.contains(n),i=n===document.body;if(!r&&!i)return;let a=document.querySelectorAll(`[aria-controls="${s}"]`);for(let e of a)if(!(t!=null&&t.contains(e)||!c(e))&&(e.focus(),document.activeElement===e))return},O=[f,s],t[7]=f,t[8]=s,t[9]=D,t[10]=O):(D=t[9],O=t[10]),b(D,O);let k;t[11]!==f||t[12]!==s||t[13]!==C||t[14]!==E?(k={lastFocusedInsideRef:g,panelRef:_,state:{open:f,panelId:s,setOpen:C,toggle:E}},t[11]=f,t[12]=s,t[13]=C,t[14]=E,t[15]=k):k=t[15];let A=k,j;return t[16]!==n||t[17]!==A?(j=/* @__PURE__ */ w(L.Provider,{value:A,children:n}),t[16]=n,t[17]=A,t[18]=j):j=t[18],j},B=i=>{let c=h(53),u,d,f,p,m,g,_,y,b;c[0]===i?(u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],g=c[6],_=c[7],y=c[8],b=c[9]):({children:u,className:d,"data-slot":f,mobileBreakpoint:b,onBlur:p,onFocus:m,onKeyDown:g,ref:y,..._}=i,c[0]=i,c[1]=u,c[2]=d,c[3]=f,c[4]=p,c[5]=m,c[6]=g,c[7]=_,c[8]=y,c[9]=b);let C=b===void 0?`lg`:b,{lastFocusedInsideRef:T,panelRef:E,state:D}=oe(`SidePanel`),{open:O,panelId:k,setOpen:A}=D,j=n(),M=a(y,E),[ee,N]=S(!O);O&&ee&&N(!1);let P,F;c[10]!==O||c[11]!==E?(P=()=>{if(O)return;let e=E.current;if(e==null)return;let t=setTimeout(()=>N(!0),ae(e));return()=>clearTimeout(t)},F=[O,E],c[10]=O,c[11]=E,c[12]=P,c[13]=F):(P=c[12],F=c[13]),v(P,F);let I=r(re[C]),L=O&&I,R;c[14]===L?R=c[15]:(R={active:L},c[14]=L,c[15]=R),t(E,R);let z;c[16]===L?z=c[17]:(z={active:L},c[16]=L,c[17]=z),e(E,z);let B=x(!1),V,H;c[18]===E?(V=c[19],H=c[20]):(V=()=>{let e=E.current;if(e==null)return;let t=t=>{t.key===`Escape`&&(B.current=l(e,t.target))};return document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`keydown`,t,!0)}},H=[E],c[18]=E,c[19]=V,c[20]=H),v(V,H);let U;c[21]===f?U=c[22]:(U=s(f,`app-layout-side-panel`),c[21]=f,c[22]=U);let W=!O&&ee&&`transition-none`,G=te[C],K=ne[C],q;c[23]!==d||c[24]!==W||c[25]!==G||c[26]!==K?(q=o(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,W,`data-state-closed:pointer-events-none`,G,`@max-side-panel-lane-icon-rail/app-layout-workspace:absolute @max-side-panel-lane-icon-rail/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:z-20 @max-side-panel-lane-icon-rail/app-layout-workspace:my-0 @max-side-panel-lane-icon-rail/app-layout-workspace:rounded-xl @max-side-panel-lane-icon-rail/app-layout-workspace:shadow-lg @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-width:100%] @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-inset:0px] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:invisible`,`[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:absolute [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:z-20 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:my-0 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:rounded-xl [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:shadow-lg [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-width:100%] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-inset:0px] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:invisible`,K,d),c[23]=d,c[24]=W,c[25]=G,c[26]=K,c[27]=q):q=c[27];let J;c[28]!==T||c[29]!==m?(J=e=>{m?.(e),T.current=e.target},c[28]=T,c[29]=m,c[30]=J):J=c[30];let Y;c[31]!==T||c[32]!==p?(Y=e=>{p?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(T.current=null)},c[31]=T,c[32]=p,c[33]=Y):Y=c[33];let X;c[34]!==g||c[35]!==A?(X=e=>{g?.(e),e.defaultPrevented||e.key!==`Escape`||ie(e.currentTarget)&&(B.current?B.current=!1:(e.preventDefault(),A(!1)))},c[34]=g,c[35]=A,c[36]=X):X=c[36];let se=O?`open`:`closed`,ce=j?``:void 0,le=!O,Z;c[37]===Symbol.for(`react.memo_cache_sentinel`)?(Z=o(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),c[37]=Z):Z=c[37];let Q;c[38]===u?Q=c[39]:(Q=/* @__PURE__ */ w(`div`,{className:Z,children:u}),c[38]=u,c[39]=Q);let $;return c[40]!==M||c[41]!==k||c[42]!==_||c[43]!==q||c[44]!==J||c[45]!==Y||c[46]!==X||c[47]!==se||c[48]!==ce||c[49]!==le||c[50]!==Q||c[51]!==U?($=/* @__PURE__ */ w(`aside`,{ref:M,"data-slot":U,className:q,onFocus:J,onBlur:Y,onKeyDown:X,..._,id:k,"data-state":se,"data-hydrated":ce,inert:le,children:Q}),c[40]=M,c[41]=k,c[42]=_,c[43]=q,c[44]=J,c[45]=Y,c[46]=X,c[47]=se,c[48]=ce,c[49]=le,c[50]=Q,c[51]=U,c[52]=$):$=c[52],$},V=/* @__PURE__ */ w(E,{mirrored:!0}),H={Root:D,Notice:O,Workspace:k,Content:A,Header:M,HeaderStart:ee,HeaderContent:N,HeaderActions:P,Body:F,SidePanelRoot:z,SidePanel:B,SidePanelTrigger:e=>{let t=h(31),n,r,i,a,o,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8]):({appearance:a,"data-slot":n,icon:o,intent:c,label:l,onClick:r,size:d,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d);let f=a===void 0?`ghost`:a,m=o===void 0?V:o,g=c===void 0?`neutral`:c,_=l===void 0?`Toggle side panel`:l,v=d===void 0?`sm`:d,{open:y,panelId:b,toggle:x}=oe(`SidePanelTrigger`).state,S;t[9]===n?S=t[10]:(S=s(n,`app-layout-side-panel-trigger`),t[9]=n,t[10]=S);let C=y?`open`:`closed`,E;t[11]!==r||t[12]!==x?(E=e=>{r?.(e),e.defaultPrevented||x()},t[11]=r,t[12]=x,t[13]=E):E=t[13];let D;t[14]!==f||t[15]!==m||t[16]!==g||t[17]!==_||t[18]!==y||t[19]!==b||t[20]!==i||t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==E?(D=/* @__PURE__ */ w(p.Trigger,{asChild:!0,children:/* @__PURE__ */ w(u,{appearance:f,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:g,label:_,onClick:E,size:v,...i})}),t[14]=f,t[15]=m,t[16]=g,t[17]=_,t[18]=y,t[19]=b,t[20]=i,t[21]=v,t[22]=S,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;t[26]===_?O=t[27]:(O=/* @__PURE__ */ w(p.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:_}),t[26]=_,t[27]=O);let k;return t[28]!==O||t[29]!==D?(k=/* @__PURE__ */ T(p.Root,{children:[D,O]}),t[28]=O,t[29]=D,t[30]=k):k=t[30],k},SidePanelHeader:e=>{let t=h(27),n,r,c,l,u,d;t[0]===e?(n=t[1],r=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:n,children:r,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=n?f:`div`,m=_(L),g=x(null),v=a(d,g),y=m?.panelRef,b=m?.state.setOpen,S=m!=null,C;t[7]===y?C=t[8]:(C=()=>ie(y?.current??null)?`translate`:`flex-basis`,t[7]=y,t[8]=C);let T;t[9]===b?T=t[10]:(T=()=>{b?.(!1)},t[9]=b,t[10]=T);let E;t[11]!==y||t[12]!==S||t[13]!==C||t[14]!==T?(E={target:y,active:S,property:C,onDismiss:T},t[11]=y,t[12]=S,t[13]=C,t[14]=T,t[15]=E):E=t[15],i(g,E);let D;t[16]===l?D=t[17]:(D=s(l,`app-layout-side-panel-header`),t[16]=l,t[17]=D);let O;t[18]===c?O=t[19]:(O=o(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,`touch-pan-y`,j,c),t[18]=c,t[19]=O);let k;return t[20]!==p||t[21]!==r||t[22]!==v||t[23]!==u||t[24]!==D||t[25]!==O?(k=/* @__PURE__ */ w(p,{ref:v,"data-slot":D,className:O,...u,children:r}),t[20]=p,t[21]=r,t[22]=v,t[23]=u,t[24]=D,t[25]=O,t[26]=k):k=t[26],k},SidePanelBody:e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-side-panel-body`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},SidePanelFooter:e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-side-panel-footer`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex shrink-0 flex-col gap-2 px-3 pb-3`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p}},U=`mantle-side-panel-state`,W={closed:`closed`,open:`open`};function G(e){let t=m(e,U);if(t===W.open)return!0;if(t===W.closed)return!1}function K(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?W.open:W.closed,c=[`${U}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{H as AppLayout,U as SIDE_PANEL_STATE_COOKIE_NAME,G as extractSidePanelStateCookie,K as serializeSidePanelStateCookie,R as useSidePanel};
|
|
1
|
+
"use client";import{n as e,t}from"./use-inert-siblings-C4RHXrZc.js";import{t as n}from"./use-is-hydrated-after-paint-CrHt3OHw.js";import{t as r}from"./use-matches-media-query-FfvtNKQe.js";import{n as i}from"./use-swipe-to-dismiss-BYdlca8r.js";import{t as a}from"./use-composed-refs-DPYmLDSe.js";import{t as o}from"./cx-CK7o_rVv.js";import{t as s}from"./data-slot-EM6s2WEU.js";import{r as c}from"./alert-DO00UiQe.js";import{u as l}from"./primitive-D8CzV_Ft.js";import{t as u}from"./button-B9bChDgl.js";import{t as d}from"./main-CHyWYDak.js";import{t as f}from"./slot-B7rwscwd.js";import{t as p}from"./tooltip-DQO40Mrq.js";import{n as m}from"./cookie-ca4g5CKp.js";import{c as h}from"react/compiler-runtime";import{createContext as g,useContext as _,useEffect as v,useId as y,useLayoutEffect as b,useRef as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{SidebarSimpleIcon as E}from"@phosphor-icons/react/SidebarSimple";const D=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},O=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-notice`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex w-full shrink-0 flex-col`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},k=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-workspace`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`@container/app-layout-workspace`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},A=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-content`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},j=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,M=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,j,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},ee=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-start`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex shrink-0 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},N=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-content`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex min-w-0 flex-1 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},P=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-header-actions`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`ml-auto flex shrink-0 items-center gap-2`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},F=e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:d,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-body`),t[6]=a,t[7]=u);let p;t[8]===i?p=t[9]:(p=o(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,i),t[8]=i,t[9]=p);let m;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==p?(m=/* @__PURE__ */ w(l,{"data-slot":u,className:p,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=p,t[15]=m):m=t[15],m},te={sm:`sm:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 sm:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 md:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100cqw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 lg:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100cqw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},ne={sm:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,md:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,lg:`md:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] md:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`},re={sm:`(width < 40rem)`,md:`(width < 40rem)`,lg:`(width < 48rem)`};function ie(e){return e!=null&&getComputedStyle(e).position===`absolute`}function I(e){return e.split(`,`).map(e=>Number.parseFloat(e)||0)}function ae(e){let t=getComputedStyle(e),n=I(t.transitionDuration),r=I(t.transitionDelay),i=t.transitionProperty.split(`,`).map((e,t)=>(n[t%n.length]??0)+(r[t%r.length]??0));return Math.max(0,...i)*1e3}const L=g(null);function R(){let e=_(L);return C(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function oe(e){let t=_(L);return C(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const z=e=>{let t=h(19),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,o=r!==void 0&&r,s=y(),l=a!=null,[u,d]=S(o),f=l?a:u,p=x(i),m;t[0]===i?m=t[1]:(m=()=>{p.current=i},t[0]=i,t[1]=m),b(m);let g=x(null),_=x(null),v;t[2]===l?v=t[3]:(v=e=>{l||d(e),p.current?.(e)},t[2]=l,t[3]=v);let C=v,T;t[4]!==f||t[5]!==C?(T=()=>{C(!f)},t[4]=f,t[5]=C,t[6]=T):T=t[6];let E=T,D,O;t[7]!==f||t[8]!==s?(D=()=>{if(f)return;let e=g.current;if(g.current=null,e==null)return;let t=document.getElementById(s),n=document.activeElement,r=t!=null&&t.contains(n),i=n===document.body;if(!r&&!i)return;let a=document.querySelectorAll(`[aria-controls="${s}"]`);for(let e of a)if(!(t!=null&&t.contains(e)||!c(e))&&(e.focus(),document.activeElement===e))return},O=[f,s],t[7]=f,t[8]=s,t[9]=D,t[10]=O):(D=t[9],O=t[10]),b(D,O);let k;t[11]!==f||t[12]!==s||t[13]!==C||t[14]!==E?(k={lastFocusedInsideRef:g,panelRef:_,state:{open:f,panelId:s,setOpen:C,toggle:E}},t[11]=f,t[12]=s,t[13]=C,t[14]=E,t[15]=k):k=t[15];let A=k,j;return t[16]!==n||t[17]!==A?(j=/* @__PURE__ */ w(L.Provider,{value:A,children:n}),t[16]=n,t[17]=A,t[18]=j):j=t[18],j},B=i=>{let c=h(53),u,d,f,p,m,g,_,y,b;c[0]===i?(u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],g=c[6],_=c[7],y=c[8],b=c[9]):({children:u,className:d,"data-slot":f,mobileBreakpoint:b,onBlur:p,onFocus:m,onKeyDown:g,ref:y,..._}=i,c[0]=i,c[1]=u,c[2]=d,c[3]=f,c[4]=p,c[5]=m,c[6]=g,c[7]=_,c[8]=y,c[9]=b);let C=b===void 0?`lg`:b,{lastFocusedInsideRef:T,panelRef:E,state:D}=oe(`SidePanel`),{open:O,panelId:k,setOpen:A}=D,j=n(),M=a(y,E),[ee,N]=S(!O);O&&ee&&N(!1);let P,F;c[10]!==O||c[11]!==E?(P=()=>{if(O)return;let e=E.current;if(e==null)return;let t=setTimeout(()=>N(!0),ae(e));return()=>clearTimeout(t)},F=[O,E],c[10]=O,c[11]=E,c[12]=P,c[13]=F):(P=c[12],F=c[13]),v(P,F);let I=r(re[C]),L=O&&I,R;c[14]===L?R=c[15]:(R={active:L},c[14]=L,c[15]=R),t(E,R);let z;c[16]===L?z=c[17]:(z={active:L},c[16]=L,c[17]=z),e(E,z);let B=x(!1),V,H;c[18]===E?(V=c[19],H=c[20]):(V=()=>{let e=E.current;if(e==null)return;let t=t=>{t.key===`Escape`&&(B.current=l(e,t.target))};return document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`keydown`,t,!0)}},H=[E],c[18]=E,c[19]=V,c[20]=H),v(V,H);let U;c[21]===f?U=c[22]:(U=s(f,`app-layout-side-panel`),c[21]=f,c[22]=U);let W=!O&&ee&&`transition-none`,G=te[C],K=ne[C],q;c[23]!==d||c[24]!==W||c[25]!==G||c[26]!==K?(q=o(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,W,`data-state-closed:pointer-events-none`,G,`@max-side-panel-lane-icon-rail/app-layout-workspace:absolute @max-side-panel-lane-icon-rail/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:z-20 @max-side-panel-lane-icon-rail/app-layout-workspace:my-0 @max-side-panel-lane-icon-rail/app-layout-workspace:rounded-xl @max-side-panel-lane-icon-rail/app-layout-workspace:shadow-lg @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-width:100%] @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-inset:0px] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:invisible`,`[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:absolute [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:z-20 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:my-0 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:rounded-xl [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:shadow-lg [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-width:100%] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-inset:0px] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:invisible`,K,d),c[23]=d,c[24]=W,c[25]=G,c[26]=K,c[27]=q):q=c[27];let J;c[28]!==T||c[29]!==m?(J=e=>{m?.(e),T.current=e.target},c[28]=T,c[29]=m,c[30]=J):J=c[30];let Y;c[31]!==T||c[32]!==p?(Y=e=>{p?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(T.current=null)},c[31]=T,c[32]=p,c[33]=Y):Y=c[33];let X;c[34]!==g||c[35]!==A?(X=e=>{g?.(e),e.defaultPrevented||e.key!==`Escape`||ie(e.currentTarget)&&(B.current?B.current=!1:(e.preventDefault(),A(!1)))},c[34]=g,c[35]=A,c[36]=X):X=c[36];let se=O?`open`:`closed`,ce=j?``:void 0,le=!O,Z;c[37]===Symbol.for(`react.memo_cache_sentinel`)?(Z=o(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),c[37]=Z):Z=c[37];let Q;c[38]===u?Q=c[39]:(Q=/* @__PURE__ */ w(`div`,{className:Z,children:u}),c[38]=u,c[39]=Q);let $;return c[40]!==M||c[41]!==k||c[42]!==_||c[43]!==q||c[44]!==J||c[45]!==Y||c[46]!==X||c[47]!==se||c[48]!==ce||c[49]!==le||c[50]!==Q||c[51]!==U?($=/* @__PURE__ */ w(`aside`,{ref:M,"data-slot":U,className:q,onFocus:J,onBlur:Y,onKeyDown:X,..._,id:k,"data-state":se,"data-hydrated":ce,inert:le,children:Q}),c[40]=M,c[41]=k,c[42]=_,c[43]=q,c[44]=J,c[45]=Y,c[46]=X,c[47]=se,c[48]=ce,c[49]=le,c[50]=Q,c[51]=U,c[52]=$):$=c[52],$},V=/* @__PURE__ */ w(E,{mirrored:!0}),H={Root:D,Notice:O,Workspace:k,Content:A,Header:M,HeaderStart:ee,HeaderContent:N,HeaderActions:P,Body:F,SidePanelRoot:z,SidePanel:B,SidePanelTrigger:e=>{let t=h(31),n,r,i,a,o,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8]):({appearance:a,"data-slot":n,icon:o,intent:c,label:l,onClick:r,size:d,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d);let f=a===void 0?`ghost`:a,m=o===void 0?V:o,g=c===void 0?`neutral`:c,_=l===void 0?`Toggle side panel`:l,v=d===void 0?`sm`:d,{open:y,panelId:b,toggle:x}=oe(`SidePanelTrigger`).state,S;t[9]===n?S=t[10]:(S=s(n,`app-layout-side-panel-trigger`),t[9]=n,t[10]=S);let C=y?`open`:`closed`,E;t[11]!==r||t[12]!==x?(E=e=>{r?.(e),e.defaultPrevented||x()},t[11]=r,t[12]=x,t[13]=E):E=t[13];let D;t[14]!==f||t[15]!==m||t[16]!==g||t[17]!==_||t[18]!==y||t[19]!==b||t[20]!==i||t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==E?(D=/* @__PURE__ */ w(p.Trigger,{asChild:!0,children:/* @__PURE__ */ w(u,{appearance:f,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:g,label:_,onClick:E,size:v,...i})}),t[14]=f,t[15]=m,t[16]=g,t[17]=_,t[18]=y,t[19]=b,t[20]=i,t[21]=v,t[22]=S,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;t[26]===_?O=t[27]:(O=/* @__PURE__ */ w(p.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:_}),t[26]=_,t[27]=O);let k;return t[28]!==O||t[29]!==D?(k=/* @__PURE__ */ T(p.Root,{children:[D,O]}),t[28]=O,t[29]=D,t[30]=k):k=t[30],k},SidePanelHeader:e=>{let t=h(27),n,r,c,l,u,d;t[0]===e?(n=t[1],r=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:n,children:r,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=n?f:`div`,m=_(L),g=x(null),v=a(d,g),y=m?.panelRef,b=m?.state.setOpen,S=m!=null,C;t[7]===y?C=t[8]:(C=()=>ie(y?.current??null)?`translate`:`flex-basis`,t[7]=y,t[8]=C);let T;t[9]===b?T=t[10]:(T=()=>{b?.(!1)},t[9]=b,t[10]=T);let E;t[11]!==y||t[12]!==S||t[13]!==C||t[14]!==T?(E={target:y,active:S,property:C,onDismiss:T},t[11]=y,t[12]=S,t[13]=C,t[14]=T,t[15]=E):E=t[15],i(g,E);let D;t[16]===l?D=t[17]:(D=s(l,`app-layout-side-panel-header`),t[16]=l,t[17]=D);let O;t[18]===c?O=t[19]:(O=o(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,`touch-pan-y`,j,c),t[18]=c,t[19]=O);let k;return t[20]!==p||t[21]!==r||t[22]!==v||t[23]!==u||t[24]!==D||t[25]!==O?(k=/* @__PURE__ */ w(p,{ref:v,"data-slot":D,className:O,...u,children:r}),t[20]=p,t[21]=r,t[22]=v,t[23]=u,t[24]=D,t[25]=O,t[26]=k):k=t[26],k},SidePanelBody:e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-side-panel-body`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p},SidePanelFooter:e=>{let t=h(16),n,r,i,a,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5]):({asChild:n,children:r,className:i,"data-slot":a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c);let l=n?f:`div`,u;t[6]===a?u=t[7]:(u=s(a,`app-layout-side-panel-footer`),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=o(`flex shrink-0 flex-col gap-2 px-3 pb-3`,i),t[8]=i,t[9]=d);let p;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==d?(p=/* @__PURE__ */ w(l,{"data-slot":u,className:d,...c,children:r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=d,t[15]=p):p=t[15],p}},U=`mantle-side-panel-state`,W={closed:`closed`,open:`open`};function G(e){let t=m(e,U);if(t===W.open)return!0;if(t===W.closed)return!1}function K(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?W.open:W.closed,c=[`${U}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{H as AppLayout,U as SIDE_PANEL_STATE_COOKIE_NAME,G as extractSidePanelStateCookie,K as serializeSidePanelStateCookie,R as useSidePanel};
|
package/dist/area-chart.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/charts/area-chart
|
|
5
5
|
*/
|
|
6
|
-
import { _ as CurveKind, a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, g as ContinuousXScale, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, v as PointShape, y as SeriesColor } from "./chart-
|
|
6
|
+
import { _ as CurveKind, a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, g as ContinuousXScale, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, v as PointShape, y as SeriesColor } from "./chart-Dl8gFo_D.js";
|
|
7
7
|
/**
|
|
8
8
|
* Props for {@link AreaChart.List}.
|
|
9
9
|
*/
|
|
10
10
|
type AreaChartListProps = ChartListPrimitiveProps;
|
|
11
11
|
/**
|
|
12
12
|
* Props for {@link AreaChart.Root}. Areas fill from a shared zero baseline, so
|
|
13
|
-
* the y domain minimum is fixed at `0
|
|
13
|
+
* the y domain minimum is fixed at `0`. A truncated-area axis is
|
|
14
14
|
* unrepresentable.
|
|
15
15
|
*/
|
|
16
16
|
type AreaChartRootProps<TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive"> = Omit<ChartRootBaseProps, "yDomain"> & ChartAccessibilityProps<TMode> & {
|
|
@@ -80,7 +80,7 @@ type AreaChartAreaProps = {
|
|
|
80
80
|
type AreaChartGridProps = GridPrimitiveProps;
|
|
81
81
|
/**
|
|
82
82
|
* Props for {@link AreaChart.XAxis}. The tick formatter receives the row's x
|
|
83
|
-
* value
|
|
83
|
+
* value: the category value on point scales, a `Date` on time scales, and a
|
|
84
84
|
* number on linear scales.
|
|
85
85
|
*/
|
|
86
86
|
type AreaChartXAxisProps = XAxisPrimitiveProps;
|
|
@@ -169,7 +169,7 @@ type AreaChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
169
169
|
*/
|
|
170
170
|
declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive">(props: AreaChartRootProps<TDatum, TMode>) => import("react").JSX.Element;
|
|
171
171
|
/**
|
|
172
|
-
* One area series. Renders nothing itself
|
|
172
|
+
* One area series. Renders nothing itself: it registers the series with the
|
|
173
173
|
* chart, which paints it. Compose one `Area` per series; with
|
|
174
174
|
* `stacked` on the Root, areas stack in registration order with the
|
|
175
175
|
* first-registered series at the baseline, so an `Area` that mounts later
|
|
@@ -252,8 +252,8 @@ declare const XAxis: (props: AreaChartXAxisProps) => null;
|
|
|
252
252
|
*/
|
|
253
253
|
declare const YAxis: (props: AreaChartYAxisProps) => null;
|
|
254
254
|
/**
|
|
255
|
-
* A dashed horizontal marker at a y value
|
|
256
|
-
* limit (renderless; the chart paints it).
|
|
255
|
+
* A dashed horizontal marker at a y value, such as an SLO threshold, a budget,
|
|
256
|
+
* or a limit (renderless; the chart paints it).
|
|
257
257
|
*
|
|
258
258
|
* @see https://mantle.ngrok.com/components/charts/area-chart#areachartreferenceline
|
|
259
259
|
*
|
|
@@ -275,7 +275,7 @@ declare const ReferenceLine: (props: AreaChartReferenceLineProps) => null;
|
|
|
275
275
|
/**
|
|
276
276
|
* Customizes the hover/keyboard tooltip readout. The tooltip itself is part
|
|
277
277
|
* of `AreaChart.Root`'s interaction contract and renders even when this part
|
|
278
|
-
* is absent
|
|
278
|
+
* is absent. Compose it to format the label or values, append a footer, or
|
|
279
279
|
* replace the content entirely via the render-prop `children`.
|
|
280
280
|
*
|
|
281
281
|
* **Structure.** A `children` readout renders inside a
|
|
@@ -309,7 +309,7 @@ declare const ReferenceLine: (props: AreaChartReferenceLineProps) => null;
|
|
|
309
309
|
declare const Tooltip: (props: AreaChartTooltipProps) => null;
|
|
310
310
|
/**
|
|
311
311
|
* The legend: series names keyed by color swatches, rendered as real DOM in
|
|
312
|
-
* flow below the plot. Always compose it on multi-series charts
|
|
312
|
+
* flow below the plot. Always compose it on multi-series charts: identity
|
|
313
313
|
* must never rely on color-matching alone. It renders nothing for a single
|
|
314
314
|
* series (the chart's title already names it).
|
|
315
315
|
*
|
|
@@ -326,7 +326,7 @@ declare const Tooltip: (props: AreaChartTooltipProps) => null;
|
|
|
326
326
|
* | --- | --- | --- |
|
|
327
327
|
* | `data-slot` | `"area-chart-legend"` | The legend list. `AreaChart.Legend` renders it in flow below the plot. |
|
|
328
328
|
* | `data-slot` | `"area-chart-legend-label"` | On the `<div>` wrapping a `children` render prop. The default legend has none. |
|
|
329
|
-
* | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `AreaChart.Area` wears
|
|
329
|
+
* | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `AreaChart.Area` wears: the `shape` it set, else the circle. The swatch clips itself to that glyph, so target this only to restyle a key. |
|
|
330
330
|
*
|
|
331
331
|
* @see https://mantle.ngrok.com/components/charts/area-chart#areachartlegend
|
|
332
332
|
*
|
|
@@ -346,8 +346,8 @@ declare const Tooltip: (props: AreaChartTooltipProps) => null;
|
|
|
346
346
|
declare const Legend: (props: AreaChartLegendProps) => import("react").JSX.Element;
|
|
347
347
|
/**
|
|
348
348
|
* A button that copies the chart's current data to the clipboard as a
|
|
349
|
-
* markdown table (ISO dates, plain numbers, one column per series)
|
|
350
|
-
*
|
|
349
|
+
* markdown table (ISO dates, plain numbers, one column per series). The table
|
|
350
|
+
* pastes into Slack, issues, docs, spreadsheets, and LLM chats. Renders
|
|
351
351
|
* in flow where composed (alongside `Legend`, below the plot); `Root` is
|
|
352
352
|
* relatively positioned, so `className` can dock it over a corner instead
|
|
353
353
|
* (e.g. `absolute right-0 top-0`).
|
|
@@ -392,8 +392,8 @@ declare const CopyButton: (props: AreaChartCopyButtonProps) => import("react").J
|
|
|
392
392
|
*/
|
|
393
393
|
declare const List: (props: AreaChartListProps) => import("react").JSX.Element;
|
|
394
394
|
/**
|
|
395
|
-
* An area chart for showing how values
|
|
396
|
-
* total and its parts
|
|
395
|
+
* An area chart for showing how values (and, when stacked, a
|
|
396
|
+
* total and its parts) change over a continuous x axis. Each area fills with
|
|
397
397
|
* a 10% wash of the series color plus a 2px band-edge stroke; the Root-level
|
|
398
398
|
* `stacked` prop stacks the series in registration order from the baseline.
|
|
399
399
|
* Each series names its own `color`. Interaction ships with `Root`
|
package/dist/area-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,d as r,l as i,n as a,o,s,t as c,u as l}from"./chart-
|
|
1
|
+
"use client";import{_ as e,a as t,c as n,d as r,l as i,n as a,o,s,t as c,u as l}from"./chart-DtgZBAas.js";import{t as u}from"./chart-CChZiCrt.js";import{c as d}from"react/compiler-runtime";import{jsx as f}from"react/jsx-runtime";const p={Root:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(c,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,paintBackend:u,...e}),t[0]=e,t[1]=n),n},Area:e=>s(`AreaChart.Area`,`area`,e),Grid:e=>t(`AreaChart.Grid`,e),XAxis:e=>n(`AreaChart.XAxis`,e),YAxis:e=>i(`AreaChart.YAxis`,e),ReferenceLine:e=>o(`AreaChart.ReferenceLine`,e),Tooltip:e=>a(`AreaChart.Tooltip`,e),Legend:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(r,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:t=>{let n=d(2),r;return n[0]===t?r=n[1]:(r=/* @__PURE__ */ f(e,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...t}),n[0]=t,n[1]=r),r},List:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(l,{slotName:`area-chart-list`,...e}),t[0]=e,t[1]=n),n}};export{p as AreaChart};
|
package/dist/avatar.d.ts
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/avatar
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } 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, ReactEventHandler, ReactNode } from "react";
|
|
9
9
|
/**
|
|
10
10
|
* The shape an `Avatar.Root` renders as. Circles read as people, rounded
|
|
11
|
-
* squares as the things people belong to
|
|
11
|
+
* squares as the things people belong to: accounts, workspaces, teams,
|
|
12
12
|
* organizations. Keeping the two shapes visually distinct is the point: a
|
|
13
13
|
* switcher row showing both at once stays legible without labels.
|
|
14
14
|
*
|
|
@@ -23,8 +23,8 @@ import { ComponentProps, ReactEventHandler, ReactNode } from "react";
|
|
|
23
23
|
*/
|
|
24
24
|
type AvatarAppearance = "circle" | "square";
|
|
25
25
|
/**
|
|
26
|
-
* The props for `Avatar.Root`. A `<span>`'s props
|
|
27
|
-
* `ref`, `asChild`, and any `data-*` or `aria-*` reach the rendered element
|
|
26
|
+
* The props for `Avatar.Root`. A `<span>`'s props (so `className`, `style`,
|
|
27
|
+
* `ref`, `asChild`, and any `data-*` or `aria-*` reach the rendered element),
|
|
28
28
|
* plus the shape and swatch this root owns.
|
|
29
29
|
*/
|
|
30
30
|
type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
|
|
@@ -36,7 +36,7 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
|
|
|
36
36
|
*/
|
|
37
37
|
appearance?: AvatarAppearance;
|
|
38
38
|
/**
|
|
39
|
-
* A stable identifier
|
|
39
|
+
* A stable identifier (an account id, a user id) that deterministically
|
|
40
40
|
* selects a background swatch, so the same subject always gets the same
|
|
41
41
|
* color with nothing persisted. Omit it for a neutral surface, or set your
|
|
42
42
|
* own `bg-*` class through `className` to opt out entirely.
|
|
@@ -48,7 +48,7 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
|
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* A small image representing a person or an account, with a text or icon
|
|
51
|
-
* fallback for when there is no picture
|
|
51
|
+
* fallback for when there is no picture, or before one loads.
|
|
52
52
|
*
|
|
53
53
|
* The root sizes and shapes the avatar and paints the surface behind it. It is
|
|
54
54
|
* `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
|
|
@@ -77,9 +77,9 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
|
|
|
77
77
|
*/
|
|
78
78
|
declare const Root: ({ appearance, asChild, className, colorSeed, "data-slot": dataSlot, ...props }: AvatarRootProps) => import("react").JSX.Element;
|
|
79
79
|
/**
|
|
80
|
-
* The props for `Avatar.Image`. An `<img>`'s props
|
|
80
|
+
* The props for `Avatar.Image`. An `<img>`'s props (so `srcSet`, `sizes`,
|
|
81
81
|
* `loading`, `referrerPolicy`, `crossOrigin`, `className`, `style`, `ref`,
|
|
82
|
-
* `asChild`, and any `data-*` reach the element
|
|
82
|
+
* `asChild`, and any `data-*` reach the element), with `alt` promoted to
|
|
83
83
|
* required.
|
|
84
84
|
*/
|
|
85
85
|
type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsChild & WithDataSlot & {
|
|
@@ -88,8 +88,8 @@ type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsC
|
|
|
88
88
|
* `<img>` element: an avatar is the one image a developer reliably forgets,
|
|
89
89
|
* and an `<img>` with no `alt` announces its URL.
|
|
90
90
|
*
|
|
91
|
-
* Pass `alt=""` when adjacent text already names the subject
|
|
92
|
-
* case, and the reason this is not just "always pass the name". Pass the name
|
|
91
|
+
* Pass `alt=""` when adjacent text already names the subject. That is the
|
|
92
|
+
* common case, and the reason this is not just "always pass the name". Pass the name
|
|
93
93
|
* when the avatar stands alone, and name `Avatar.Root` as well (`role="img"`
|
|
94
94
|
* + `aria-label`) so the label survives the states where the image is gone.
|
|
95
95
|
*/
|
|
@@ -108,14 +108,14 @@ type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsC
|
|
|
108
108
|
* The avatar's picture, layered over `Avatar.Fallback` so the fallback shows
|
|
109
109
|
* through until the image paints. It is a plain `<img>` in the markup, which is
|
|
110
110
|
* the whole point: the server renders it, the browser starts fetching while it
|
|
111
|
-
* parses the HTML, and a cached image is *there* on the first frame
|
|
111
|
+
* parses the HTML, and a cached image is *there* on the first frame: no
|
|
112
112
|
* hydration, no swap, no flash of initials.
|
|
113
113
|
*
|
|
114
114
|
* A failed load unmounts the image and leaves the fallback showing. That covers
|
|
115
115
|
* every failure the client can observe; one it cannot is a load that fails
|
|
116
116
|
* *before* hydration, where the error event has already come and gone. There the
|
|
117
|
-
* browser's own rendering stands, which for `alt=""` is nothing at all
|
|
118
|
-
* fallback shows through
|
|
117
|
+
* browser's own rendering stands, which for `alt=""` is nothing at all (the
|
|
118
|
+
* fallback shows through), and is one more reason to prefer `alt=""`
|
|
119
119
|
* whenever adjacent text names the subject.
|
|
120
120
|
*
|
|
121
121
|
* `onError` runs first and can `preventDefault()` to keep the image mounted, for
|
|
@@ -143,13 +143,13 @@ declare const Image: ({ asChild, className, "data-slot": dataSlot, onError, src,
|
|
|
143
143
|
* The props for `Avatar.Fallback`. A `<span>`'s props, with the content stated
|
|
144
144
|
* exactly one way: either `children` you render yourself, or a `name` this part
|
|
145
145
|
* derives initials from. Passing both would leave the winner to precedence, so
|
|
146
|
-
* the type forbids it
|
|
147
|
-
*
|
|
146
|
+
* the type forbids it. `asChild`, which needs a real element to clone, belongs
|
|
147
|
+
* to the `children` side only.
|
|
148
148
|
*/
|
|
149
149
|
type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSlot & ({
|
|
150
150
|
/**
|
|
151
151
|
* Render this element instead of the fallback's own `<span>`. Only
|
|
152
|
-
* available beside `children
|
|
152
|
+
* available beside `children`: there has to be an element to clone.
|
|
153
153
|
*/
|
|
154
154
|
asChild?: boolean;
|
|
155
155
|
/**
|
|
@@ -163,20 +163,20 @@ type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSl
|
|
|
163
163
|
children?: never;
|
|
164
164
|
/**
|
|
165
165
|
* The subject's display name, rendered as at most two uppercase
|
|
166
|
-
* initials
|
|
166
|
+
* initials: `"Acme Corp"` becomes `"AC"`, and a name with no usable
|
|
167
167
|
* characters becomes `"?"`. Deriving it here keeps one implementation
|
|
168
168
|
* of a surprisingly fiddly rule (punctuation, code points, and casing
|
|
169
169
|
* that has to match between server and client).
|
|
170
170
|
*
|
|
171
171
|
* Initials derived this way are `aria-hidden`: they abbreviate a name
|
|
172
172
|
* the page already carries in text beside the avatar. When the avatar
|
|
173
|
-
* is the only thing naming its subject, name it
|
|
174
|
-
* `aria-label` on `Avatar.Root`
|
|
173
|
+
* is the only thing naming its subject, name it (`role="img"` plus
|
|
174
|
+
* `aria-label` on `Avatar.Root`) rather than announcing `"AC"`.
|
|
175
175
|
*/
|
|
176
176
|
name: string;
|
|
177
177
|
});
|
|
178
178
|
/**
|
|
179
|
-
* What the avatar shows when there is no picture
|
|
179
|
+
* What the avatar shows when there is no picture: initials, an icon, a
|
|
180
180
|
* monogram. It always renders, sitting *behind* `Avatar.Image`: that is what
|
|
181
181
|
* makes a loading image show initials instead of an empty box, with no loading
|
|
182
182
|
* state for anyone to handle. A loaded image covers it, so give a transparent
|
|
@@ -205,11 +205,11 @@ type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSl
|
|
|
205
205
|
declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot, name, ...props }: AvatarFallbackProps) => import("react").JSX.Element;
|
|
206
206
|
/**
|
|
207
207
|
* A small image representing a person or an account, with a text or icon
|
|
208
|
-
* fallback for when there is no picture
|
|
208
|
+
* fallback for when there is no picture, or before one loads.
|
|
209
209
|
*
|
|
210
210
|
* `appearance` carries the meaning: `"circle"` for a person, `"square"` (a
|
|
211
211
|
* rounded square) for an account, workspace, team, or organization. A row that
|
|
212
|
-
* shows both
|
|
212
|
+
* shows both (an account switcher with the signed-in user's photo beside it)
|
|
213
213
|
* stays readable without labels because the shapes differ.
|
|
214
214
|
*
|
|
215
215
|
* `colorSeed` gives a subject a stable color derived from its id, so the same
|
|
@@ -254,7 +254,7 @@ declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot,
|
|
|
254
254
|
declare const Avatar: {
|
|
255
255
|
/**
|
|
256
256
|
* A small image representing a person or an account, with a text or icon
|
|
257
|
-
* fallback for when there is no picture
|
|
257
|
+
* fallback for when there is no picture, or before one loads.
|
|
258
258
|
*
|
|
259
259
|
* The root sizes and shapes the avatar and paints the surface behind it. It is
|
|
260
260
|
* `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
|
|
@@ -303,7 +303,7 @@ declare const Avatar: {
|
|
|
303
303
|
*/
|
|
304
304
|
readonly Image: typeof Image;
|
|
305
305
|
/**
|
|
306
|
-
* What the avatar shows when there is no picture
|
|
306
|
+
* What the avatar shows when there is no picture: initials, an icon, a
|
|
307
307
|
* monogram. It always renders, behind `Avatar.Image`, which is what makes a
|
|
308
308
|
* loading image show initials rather than an empty box. Pass `name` to render
|
|
309
309
|
* the subject's initials, or `children` for anything else.
|
package/dist/avatar.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"./slot-
|
|
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{useState as i}from"react";import{jsx as a}from"react/jsx-runtime";const o={circle:`rounded-full`,square:`rounded-md`},s=[`bg-emerald-500`,`bg-gray-500`,`bg-red-500`,`bg-violet-500`,`bg-cyan-500`,`bg-rose-500`,`bg-purple-500`,`bg-fuchsia-500`,`bg-green-500`,`bg-orange-500`,`bg-indigo-500`,`bg-teal-500`,`bg-yellow-500`,`bg-sky-500`,`bg-pink-500`,`bg-blue-500`,`bg-amber-500`];function c(e){let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return t>>>0}function l(e){let t=c(e)%s.length;return s[t]??`bg-neutral-500`}function u(e){return e.replace(/[\p{P}`~!@#$%^&*+|=<>]/gu,``).trim().split(/\s+/).slice(0,2).map(e=>Array.from(e.toUpperCase())[0]??``).join(``)||`?`}const d={Root:i=>{let s=r(18),c,u,d,f,p,m;s[0]===i?(c=s[1],u=s[2],d=s[3],f=s[4],p=s[5],m=s[6]):({appearance:m,asChild:c,className:u,colorSeed:d,"data-slot":f,...p}=i,s[0]=i,s[1]=c,s[2]=u,s[3]=d,s[4]=f,s[5]=p,s[6]=m);let h=m===void 0?`circle`:m,g=c?n:`span`,_=o[h],v;s[7]!==u||s[8]!==d||s[9]!==_?(v=e(`text-body bg-neutral-500/15 relative flex size-7 shrink-0 items-center justify-center overflow-hidden text-xs font-medium select-none`,_,d!=null&&[`text-static-white`,l(d)],u),s[7]=u,s[8]=d,s[9]=_,s[10]=v):v=s[10];let y;s[11]===f?y=s[12]:(y=t(f,`avatar`),s[11]=f,s[12]=y);let b;return s[13]!==g||s[14]!==p||s[15]!==v||s[16]!==y?(b=/* @__PURE__ */ a(g,{className:v,"data-slot":y,...p}),s[13]=g,s[14]=p,s[15]=v,s[16]=y,s[17]=b):b=s[17],b},Image:o=>{let s=r(21),c,l,u,d,f,p;s[0]===o?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],p=s[6]):({asChild:c,className:l,"data-slot":u,onError:d,src:p,...f}=o,s[0]=o,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f,s[6]=p);let[m,h]=i(),g=c?n:`img`;if(p==null||p===``||p===m)return null;let _;s[7]===l?_=s[8]:(_=e(`absolute inset-0 size-full object-cover`,l),s[7]=l,s[8]=_);let v;s[9]===u?v=s[10]:(v=t(u,`avatar-image`),s[9]=u,s[10]=v);let y;s[11]!==d||s[12]!==p?(y=e=>{d?.(e),e.defaultPrevented||h(p)},s[11]=d,s[12]=p,s[13]=y):y=s[13];let b;return s[14]!==g||s[15]!==f||s[16]!==p||s[17]!==_||s[18]!==v||s[19]!==y?(b=/* @__PURE__ */ a(g,{className:_,"data-slot":v,onError:y,src:p,...f}),s[14]=g,s[15]=f,s[16]=p,s[17]=_,s[18]=v,s[19]=y,s[20]=b):b=s[20],b},Fallback:i=>{let o=r(21),s,c,l,d,f,p;o[0]===i?(s=o[1],c=o[2],l=o[3],d=o[4],f=o[5],p=o[6]):({asChild:s,children:c,className:l,"data-slot":d,name:f,...p}=i,o[0]=i,o[1]=s,o[2]=c,o[3]=l,o[4]=d,o[5]=f,o[6]=p);let m=s?n:`span`,h=f!=null||void 0,g;o[7]===l?g=o[8]:(g=e(`flex size-full items-center justify-center`,l),o[7]=l,o[8]=g);let _;o[9]===d?_=o[10]:(_=t(d,`avatar-fallback`),o[9]=d,o[10]=_);let v;o[11]!==c||o[12]!==f?(v=f==null?c:u(f),o[11]=c,o[12]=f,o[13]=v):v=o[13];let y;return o[14]!==m||o[15]!==p||o[16]!==h||o[17]!==g||o[18]!==_||o[19]!==v?(y=/* @__PURE__ */ a(m,{"aria-hidden":h,className:g,"data-slot":_,...p,children:v}),o[14]=m,o[15]=p,o[16]=h,o[17]=g,o[18]=_,o[19]=v,o[20]=y):y=o[20],y}};export{d as Avatar};
|
package/dist/badge.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
7
|
import { t as Color } from "./index-BZhHLrBi.js";
|
|
8
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
8
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
9
9
|
import { ComponentProps, ReactNode } from "react";
|
|
10
10
|
declare const appearances: readonly ["muted"];
|
|
11
11
|
type Appearance = (typeof appearances)[number];
|
|
@@ -26,8 +26,8 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
|
|
|
26
26
|
appearance: Appearance;
|
|
27
27
|
} & WithDataSlot;
|
|
28
28
|
/**
|
|
29
|
-
* A non-interactive label used to highlight short, scannable information
|
|
30
|
-
* a status, a category tag, or a count
|
|
29
|
+
* A non-interactive label used to highlight short, scannable information
|
|
30
|
+
* (a status, a category tag, or a count) in the smallest possible footprint.
|
|
31
31
|
*
|
|
32
32
|
* **When to use**
|
|
33
33
|
* - Status indicators: `Succeeded`, `Failed`, `Pending`, `Beta`.
|
|
@@ -35,7 +35,7 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
|
|
|
35
35
|
* - Counts (e.g. `12 new`) when paired with brief context.
|
|
36
36
|
*
|
|
37
37
|
* **When not to use**
|
|
38
|
-
* - For interactive UI. Badges are not buttons or links
|
|
38
|
+
* - For interactive UI. Badges are not buttons or links. Use {@link https://mantle.ngrok.com/components/actions/button Button}
|
|
39
39
|
* or {@link https://mantle.ngrok.com/components/navigation/anchor Anchor} (optionally with `asChild` styling) instead.
|
|
40
40
|
* - For long-form text. Keep labels to one or two short words.
|
|
41
41
|
* - As the sole signal of meaning. Pair color with a label or icon so the
|
|
@@ -47,12 +47,12 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
|
|
|
47
47
|
* isn't already covered.
|
|
48
48
|
*
|
|
49
49
|
* **Polymorphism.** Pass `asChild` to render the badge as a single child
|
|
50
|
-
* element
|
|
50
|
+
* element. This is useful when the badge wraps a link or other semantic element
|
|
51
51
|
* while keeping the badge styling.
|
|
52
52
|
*
|
|
53
53
|
* **Structure.** `children` render inside a `<span data-slot="badge-label">`,
|
|
54
54
|
* beside the `icon` slot. The span carries `display: contents`, so it lays out
|
|
55
|
-
* nothing of its own
|
|
55
|
+
* nothing of its own: every child stays a flex item of the badge, and the badge's
|
|
56
56
|
* `gap` still falls between them. The span exists so a newly-appearing icon
|
|
57
57
|
* inserts before an element sibling: a browser translation engine reparents text
|
|
58
58
|
* nodes, and an insert aimed at one throws. A label that must shrink stays a child
|
|
@@ -80,7 +80,7 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
|
|
|
80
80
|
* Succeeded
|
|
81
81
|
* </Badge>
|
|
82
82
|
*
|
|
83
|
-
* // Polymorphic
|
|
83
|
+
* // Polymorphic: render the badge as a link, preserving its styling.
|
|
84
84
|
* <Badge appearance="muted" color="info" asChild>
|
|
85
85
|
* <a href="/status">Operational</a>
|
|
86
86
|
* </Badge>
|
package/dist/badge.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"./icon-BudQMD2S.js";import{t as r}from"./slot-
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-B7rwscwd.js";import{c as i}from"react/compiler-runtime";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=f=>{let p=i(46),h,_,v,y,b,x,S,C;p[0]===f?(h=p[1],_=p[2],v=p[3],y=p[4],b=p[5],x=p[6],S=p[7],C=p[8]):({"data-slot":y,appearance:h,asChild:S,children:_,className:v,color:C,icon:b,...x}=f,p[0]=f,p[1]=h,p[2]=_,p[3]=v,p[4]=y,p[5]=b,p[6]=x,p[7]=S,p[8]=C);let w=S!==void 0&&S,T=C===void 0?`neutral`:C,E;if(p[9]!==h||p[10]!==v||p[11]!==T||p[12]!==b){let t=m(T,h),n=g(T,h);E=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,b&&`ps-1`,t,n,v),p[9]=h,p[10]=v,p[11]=T,p[12]=b,p[13]=E}else E=p[13];let D=E;if(w){let e,i,f,m,h;if(p[14]!==D||p[15]!==_||p[16]!==y||p[17]!==b||p[18]!==x){let g=a.only(_);c(s(g),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let v=g.props?.children;e=r,p[24]===y?i=p[25]:(i=t(y,`badge`),p[24]=y,p[25]=i),f=D,m=x;let S;p[26]===b?S=p[27]:(S=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[26]=b,p[27]=S),h=o(g,{},/* @__PURE__ */ d(l,{children:[S,/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:v})]})),p[14]=D,p[15]=_,p[16]=y,p[17]=b,p[18]=x,p[19]=e,p[20]=i,p[21]=f,p[22]=m,p[23]=h}else e=p[19],i=p[20],f=p[21],m=p[22],h=p[23];let g;return p[28]!==e||p[29]!==i||p[30]!==f||p[31]!==m||p[32]!==h?(g=/* @__PURE__ */ u(e,{"data-slot":i,className:f,...m,children:h}),p[28]=e,p[29]=i,p[30]=f,p[31]=m,p[32]=h,p[33]=g):g=p[33],g}let O;p[34]===y?O=p[35]:(O=t(y,`badge`),p[34]=y,p[35]=O);let k;p[36]===b?k=p[37]:(k=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[36]=b,p[37]=k);let A;p[38]===_?A=p[39]:(A=/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:_}),p[38]=_,p[39]=A);let j;return p[40]!==D||p[41]!==x||p[42]!==O||p[43]!==k||p[44]!==A?(j=/* @__PURE__ */ d(`span`,{"data-slot":O,className:D,...x,children:[k,A]}),p[40]=D,p[41]=x,p[42]=O,p[43]=k,p[44]=A,p[45]=j):j=p[45],j},p={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function m(e,t){switch(t){case`muted`:return p[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}const h={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function g(e,t){switch(t){case`muted`:return h[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}export{f as Badge};
|