@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/code-block.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/code-block
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild, t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
8
|
-
import { t as SvgAttributes } from "./icon
|
|
9
|
-
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, _ as MantleCodeBlockValue, a as Mode, c as ResolvedPreRenderedCodeBlockProps, d as parseMetastring, f as resolvePreRenderedCodeBlockProps, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, i as MetaInput, j as FoldToken, k as FoldScope, l as defaultMeta, m as parseCodeBlockHighlightLines, n as DefaultMeta, o as ResolvePreRenderedCodeBlockPropsInput, p as tokenizeMetastring, r as Meta, s as ResolvePreRenderedCodeBlockPropsResult, t as CodeBlockPreElementInput, u as normalizeValue, v as MantleCodeOptions, w as inferIndentation, x as mantleCode, y as createMantleCodeBlockValue, z as decorateHighlightedHtml } from "./code-block-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
8
|
+
import { t as SvgAttributes } from "./icon--purqHRo.js";
|
|
9
|
+
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, _ as MantleCodeBlockValue, a as Mode, c as ResolvedPreRenderedCodeBlockProps, d as parseMetastring, f as resolvePreRenderedCodeBlockProps, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, i as MetaInput, j as FoldToken, k as FoldScope, l as defaultMeta, m as parseCodeBlockHighlightLines, n as DefaultMeta, o as ResolvePreRenderedCodeBlockPropsInput, p as tokenizeMetastring, r as Meta, s as ResolvePreRenderedCodeBlockPropsResult, t as CodeBlockPreElementInput, u as normalizeValue, v as MantleCodeOptions, w as inferIndentation, x as mantleCode, y as createMantleCodeBlockValue, z as decorateHighlightedHtml } from "./code-block-BDw6MEwH.js";
|
|
10
10
|
import { ComponentProps, ReactNode } from "react";
|
|
11
11
|
import { Content, List, Trigger } from "@radix-ui/react-tabs";
|
|
12
12
|
type CodeBlockRootProps = Omit<ComponentProps<"div">, "align"> & WithAsChild & {
|
|
@@ -158,10 +158,10 @@ declare const Header: ({ "data-slot": dataSlot, asChild, className, ref, ...prop
|
|
|
158
158
|
* use `asChild` to render a different element.
|
|
159
159
|
*
|
|
160
160
|
* The heading carries `translate="no"` by default, because the title usually names
|
|
161
|
-
* a file
|
|
161
|
+
* a file (`example.ts`), and a translated filename names a file that does not
|
|
162
162
|
* exist. The slot takes arbitrary children though, so pass `translate="yes"` when
|
|
163
163
|
* the title is prose rather than a filename. `CodeBlock.Code` takes no such
|
|
164
|
-
* override
|
|
164
|
+
* override: a block of code is never translatable.
|
|
165
165
|
*
|
|
166
166
|
* @see https://mantle.ngrok.com/components/data-display/code-block#codeblocktitle
|
|
167
167
|
*
|
|
@@ -180,9 +180,7 @@ declare const Header: ({ "data-slot": dataSlot, asChild, className, ref, ...prop
|
|
|
180
180
|
* </CodeBlock.Root>
|
|
181
181
|
* ```
|
|
182
182
|
*/
|
|
183
|
-
declare const Title: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: ComponentProps<"h3"> &
|
|
184
|
-
asChild?: boolean;
|
|
185
|
-
} & WithDataSlot) => import("react").JSX.Element;
|
|
183
|
+
declare const Title: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: ComponentProps<"h3"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
186
184
|
type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "aria-label" | "children" | "type"> & SelfClosingWithAsChild & {
|
|
187
185
|
/**
|
|
188
186
|
* Not part of the API: `label` is the single way to name the button.
|
|
@@ -208,7 +206,7 @@ type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "aria-label" | "c
|
|
|
208
206
|
};
|
|
209
207
|
/**
|
|
210
208
|
* The optional copy button. Copies the raw source of the mounted
|
|
211
|
-
* `CodeBlock.Code` to the clipboard
|
|
209
|
+
* `CodeBlock.Code` to the clipboard (in a tabbed block, the active tab's code).
|
|
212
210
|
* Omit it to render the code block without a copy control.
|
|
213
211
|
*
|
|
214
212
|
* @see https://mantle.ngrok.com/components/data-display/code-block#codeblockcopybutton
|
|
@@ -515,8 +513,8 @@ declare const CodeBlock: {
|
|
|
515
513
|
readonly Code: typeof Code;
|
|
516
514
|
/**
|
|
517
515
|
* The optional copy button. Copies the raw source of the mounted
|
|
518
|
-
* `CodeBlock.Code` to the clipboard
|
|
519
|
-
* code. Omit it to render the code block without a copy control.
|
|
516
|
+
* `CodeBlock.Code` to the clipboard (in a tabbed block, the active tab's
|
|
517
|
+
* code). Omit it to render the code block without a copy control.
|
|
520
518
|
*
|
|
521
519
|
* @see https://mantle.ngrok.com/components/data-display/code-block#codeblockcopybutton
|
|
522
520
|
*
|
|
@@ -707,11 +705,11 @@ declare const CodeBlock: {
|
|
|
707
705
|
};
|
|
708
706
|
/**
|
|
709
707
|
* Tokenize a JSON string into the same per-line, CSS-variable-colored span markup
|
|
710
|
-
* that Mantle's server/build-time Shiki highlighter produces
|
|
708
|
+
* that Mantle's server/build-time Shiki highlighter produces, without shipping
|
|
711
709
|
* Shiki (or any grammar/theme/WASM) to the browser.
|
|
712
710
|
*
|
|
713
711
|
* Byte-for-byte parity with `extractHighlightedCodeInnerHtml(shiki.codeToHtml(code, …))`
|
|
714
|
-
* is guaranteed for **canonical `JSON.stringify` output
|
|
712
|
+
* is guaranteed for **canonical `JSON.stringify` output**. That is the only shape
|
|
715
713
|
* {@link jsonCodeBlockValue} ever feeds it (2-space indent: an opener is always
|
|
716
714
|
* followed by a newline, never inline whitespace; line endings are `\n`). That
|
|
717
715
|
* exact-parity set is locked by the `json-*.fixtures` golden tests. Other valid
|
|
@@ -735,7 +733,7 @@ declare function jsonToShikiHtml(code: string): string;
|
|
|
735
733
|
/** Options for {@link jsonCodeBlockValue}. */
|
|
736
734
|
type JsonCodeBlockValueOptions = {
|
|
737
735
|
/**
|
|
738
|
-
* Whether to render line numbers. Defaults to `false
|
|
736
|
+
* Whether to render line numbers. Defaults to `false`: detail panels usually
|
|
739
737
|
* read better without a gutter.
|
|
740
738
|
*/
|
|
741
739
|
showLineNumbers?: boolean | undefined;
|
|
@@ -749,15 +747,15 @@ type JsonCodeBlockValueOptions = {
|
|
|
749
747
|
};
|
|
750
748
|
/**
|
|
751
749
|
* Build a `MantleCodeBlockValue` that renders a value as syntax-highlighted JSON
|
|
752
|
-
* entirely on the client
|
|
750
|
+
* entirely on the client, with no Shiki runtime, build-time plugin, or server
|
|
753
751
|
* roundtrip. The value is `JSON.stringify`'d (2-space indent), tokenized to
|
|
754
752
|
* Shiki-identical markup by {@link jsonToShikiHtml}, and decorated with the same
|
|
755
753
|
* `decorateHighlightedHtml` the server pipeline uses, so it looks identical to a
|
|
756
754
|
* server/build-time highlighted block and adapts to light/dark themes for free.
|
|
757
755
|
*
|
|
758
756
|
* By default, multi-line objects and arrays get collapsible fold toggles (opt
|
|
759
|
-
* out with `foldable: false`)
|
|
760
|
-
*
|
|
757
|
+
* out with `foldable: false`). These are also identical to server/build-time
|
|
758
|
+
* blocks, because both compute ranges with the same `computeJsonFoldRanges`.
|
|
761
759
|
*
|
|
762
760
|
* Pass the result straight to `CodeBlock.Code`'s `value` prop. Ideal for
|
|
763
761
|
* inspecting a row's underlying object inside a `DataTable.ExpandedRow`.
|
package/dist/code-block.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./use-copy-to-clipboard-Dy_0Qzb7.js";import{t}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t as n}from"./alternate-announcement-BkH4bOKp.js";import{n as r}from"./compose-refs-sFdxsL7k.js";import{t as i}from"./cx-CK7o_rVv.js";import{t as a}from"./data-slot-EM6s2WEU.js";import{t as o}from"./icon-kK0c-POG.js";import{r as s}from"./button-Cu9e3SM7.js";import{t as c}from"./icons-CSwTVV2m.js";import{t as l}from"./button-BWGUuWnu.js";import{t as u}from"./live-region-DQ1QLv3L.js";import{t as d}from"./slot-DdYN1L1C.js";import{S as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,h as b,i as x,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as j,y as M}from"./code-block-W3kWPxCJ.js";import{c as N}from"react/compiler-runtime";import{CaretDownIcon as P}from"@phosphor-icons/react/CaretDown";import{createContext as F,useContext as I,useEffect as ee,useId as L,useLayoutEffect as te,useRef as R,useState as z}from"react";import B from"tiny-invariant";import{jsx as V,jsxs as H}from"react/jsx-runtime";import{CheckIcon as ne}from"@phosphor-icons/react/Check";import{CopyIcon as U}from"@phosphor-icons/react/Copy";import{FileTextIcon as re}from"@phosphor-icons/react/FileText";import{TerminalIcon as ie}from"@phosphor-icons/react/Terminal";import{Content as W,List as G,Root as K,Trigger as ae}from"@radix-ui/react-tabs";function oe(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&`;break;case`<`:n+=`<`;break;case`>`:n+=`>`;break;case`"`:n+=`"`;break;case`'`:n+=`'`;break;default:n+=t}}return n}const q=/* @__PURE__ */ new WeakMap;function J(e){let t=/* @__PURE__ */ new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function Y(e){let t=q.get(e);if(t!=null&&le(t))return t;let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=J(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return q.set(e,a),a}function se(e){q.delete(e)}function ce(e){se(e),e.removeAttribute(`data-folded-regions`)}function le(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function ue(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function X(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=J(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=Y(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&ue(e,r,t)}return!0}const Z=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&X(n)};function de(e){return e.addEventListener(`click`,Z),()=>{e.removeEventListener(`click`,Z)}}const Q=F(null);function fe(){let e=I(Q);return B(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const $=e=>{let t=N(34),n,r,o,s,c,l,u,f;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],f=t[8]):({"data-slot":o,asChild:f,className:r,defaultTab:s,activeTab:n,onActiveTabChange:c,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f);let p=f!==void 0&&f,m=R(``),h=L(),g=R(0),[_,v]=z(!1),[y,b]=z(!1),x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{B(g.current===0,`You can only render a single CodeBlock.Code within a CodeBlock.`),g.current+=1},t[9]=x):x=t[9];let S=x,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{--g.current},t[10]=C):C=t[10];let w=C,T;t[11]!==h||t[12]!==_||t[13]!==y?(T={codeId:h,copyTextRef:m,hasCodeExpander:_,isCodeExpanded:y,registerCode:S,setHasCodeExpander:v,setIsCodeExpanded:b,unregisterCode:w},t[11]=h,t[12]=_,t[13]=y,t[14]=T):T=t[14];let E=T,D=s!=null||n!=null,O=p?d:`div`,k;t[15]===o?k=t[16]:(k=a(o,`code-block`),t[15]=o,t[16]=k);let A;t[17]===r?A=t[18]:(A=i(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,r),t[17]=r,t[18]=A);let j;t[19]!==O||t[20]!==l||t[21]!==u||t[22]!==k||t[23]!==A?(j=/* @__PURE__ */ V(O,{"data-slot":k,className:A,ref:u,...l}),t[19]=O,t[20]=l,t[21]=u,t[22]=k,t[23]=A,t[24]=j):j=t[24];let M=j,P;t[25]!==n||t[26]!==s||t[27]!==D||t[28]!==c||t[29]!==M?(P=D?/* @__PURE__ */ V(K,{asChild:!0,defaultValue:s,value:n,onValueChange:c,children:M}):M,t[25]=n,t[26]=s,t[27]=D,t[28]=c,t[29]=M,t[30]=P):P=t[30];let F;return t[31]!==E||t[32]!==P?(F=/* @__PURE__ */ V(Q.Provider,{value:E,children:P}),t[31]=E,t[32]=P,t[33]=F):F=t[33],F},pe=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`div`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-body`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`relative`,`[&_.mantle-code-line]:pr-4`,`[&:has([data-slot=code-block-copy-button])_.mantle-code-line:nth-child(-n+2)]:pr-14`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,className:f,ref:s,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},me=/SHIKI_VAL_(\d+)/g;function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const ge=/* @__PURE__ */ new Map;function _e(e){if(e==null||e.length===0)return me;let t=ge.get(e);return t??(ge.size>=500&&ge.clear(),t=RegExp(`${he(e)}(\\d+)__`,`g`),ge.set(e,t)),t}function ve({input:e,vals:t,preValToken:n,mapValue:r}){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(_e(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function ye(e,t,n){return ve({input:e,vals:t,preValToken:n,mapValue:e=>oe(String(e))})}function be(e,t,n){return ve({input:e,vals:t,preValToken:n,mapValue:e=>String(e)})}const xe=e=>{let t=N(58),n,a,o,s,c;t[0]===e?(n=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({className:n,style:s,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l=R(null),u=r(l,o),{codeId:d,copyTextRef:f,hasCodeExpander:p,isCodeExpanded:m,registerCode:h,unregisterCode:g}=fe(),{language:_,code:v,"~preValToken":y,"~preVals":b,"~highlightLines":x,"~lineNumberStart":S,"~preHtml":C,"~showLineNumbers":w}=c,T=x,E=S??1,D=w??!1,O;t[6]!==y||t[7]!==b||t[8]!==v?(O=b!=null&&b.length>0?be(v,b,y):v,t[6]=y,t[7]=b,t[8]=v,t[9]=O):O=t[9];let k=O,A,j;t[10]!==k||t[11]!==f?(A=()=>{f.current=k},j=[f,k],t[10]=k,t[11]=f,t[12]=A,t[13]=j):(A=t[12],j=t[13]),te(A,j);let M,P;t[14]!==h||t[15]!==g?(M=()=>(h(),()=>{g()}),P=[h,g],t[14]=h,t[15]=g,t[16]=M,t[17]=P):(M=t[16],P=t[17]),ee(M,P);let F;bb0:{if(C==null){F=void 0;break bb0}let e;t[18]!==C||t[19]!==y||t[20]!==b?(e=b!=null&&b.length>0?ye(C,b,y):C,t[18]=C,t[19]=y,t[20]=b,t[21]=e):e=t[21],F=e}let I=F,L,z;t[22]===I?(L=t[23],z=t[24]):(L=()=>{let e=l.current;if(e==null||I==null)return;let t=e.querySelector(`code`);return t!=null&&ce(t),de(e)},z=[I],t[22]=I,t[23]=L,t[24]=z),ee(L,z);let B=I!=null,H;t[25]!==k||t[26]!==I?(H=I??oe(k),t[25]=k,t[26]=I,t[27]=H):H=t[27];let ne=H,U;t[28]===ne?U=t[29]:(U={__html:ne},t[28]=ne,t[29]=U);let re=U,ie=m?`expanded`:`collapsed`,W;t[30]===s?W=t[31]:(W=s??{},t[30]=s,t[31]=W);let G;if(t[32]!==W){let{MozTabSize:e,...n}=W;G=n,t[32]=W,t[33]=G}else G=t[33];let K=p?ie:void 0,ae=!B&&`pr-14`,q;t[34]!==n||t[35]!==ae?(q=i(`scrollbar overflow-x-auto overscroll-x-none overflow-y-hidden py-4`,ae,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`data-[state=collapsed]:max-h-[13.6rem]`,n),t[34]=n,t[35]=ae,t[36]=q):q=t[36];let J=B?`true`:`false`,Y;t[37]!==T||t[38]!==B?(Y=B&&T!=null&&T.length>0?T.join(`,`):void 0,t[37]=T,t[38]=B,t[39]=Y):Y=t[39];let se=B&&D?String(E):`1`,le=B&&D?`true`:`false`,ue=String(E),X;t[40]!==G||t[41]!==ue?(X={...G,"--mantle-line-number-start":ue,tabSize:2},t[40]=G,t[41]=ue,t[42]=X):X=t[42];let Z=X,Q;t[43]===re?Q=t[44]:(Q=/* @__PURE__ */ V(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:re}),t[43]=re,t[44]=Q);let $;return t[45]!==d||t[46]!==u||t[47]!==_||t[48]!==a||t[49]!==K||t[50]!==q||t[51]!==J||t[52]!==Y||t[53]!==se||t[54]!==le||t[55]!==Z||t[56]!==Q?($=/* @__PURE__ */ V(`pre`,{"data-slot":`code-block-code`,"data-state":K,className:q,"data-highlighted":J,"data-lang":_,"data-mantle-highlight-lines":Y,"data-mantle-line-number-start":se,"data-mantle-line-numbers":le,id:d,ref:u,style:Z,...a,translate:`no`,children:Q}),t[45]=d,t[46]=u,t[47]=_,t[48]=a,t[49]=K,t[50]=q,t[51]=J,t[52]=Y,t[53]=se,t[54]=le,t[55]=Z,t[56]=Q,t[57]=$):$=t[57],$},Se=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`div`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-header`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,className:f,ref:s,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},Ce=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`h3`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-title`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`m-0 font-sans text-xs font-medium`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,ref:s,className:f,translate:`no`,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},we=t=>{let r=N(33),a,o,c,d,f,p,m;r[0]===t?(a=r[1],o=r[2],c=r[3],d=r[4],f=r[5],p=r[6],m=r[7]):({className:a,label:m,onCopy:c,onCopyError:d,onClick:o,ref:p,...f}=t,r[0]=t,r[1]=a,r[2]=o,r[3]=c,r[4]=d,r[5]=f,r[6]=p,r[7]=m);let h=m===void 0?`Copy code`:m,{copyTextRef:g}=fe(),_=e(),[v,y]=z(``),b=v!==``,x=R(!1),S=R(void 0),C,w;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>()=>{S.current!=null&&clearTimeout(S.current)},w=[],r[8]=C,r[9]=w):(C=r[8],w=r[9]),ee(C,w);let T;r[10]===v?T=r[11]:(T=/* @__PURE__ */ V(u,{children:v}),r[10]=v,r[11]=T);let E=b?`check`:`copy`,D;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(D={check:/* @__PURE__ */ V(ne,{}),copy:/* @__PURE__ */ V(U,{})},r[12]=D):D=r[12];let O;r[13]===E?O=r[14]:(O=/* @__PURE__ */ V(s,{active:E,icons:D}),r[13]=E,r[14]=O);let k;r[15]===a?k=r[16]:(k=i(`bg-base not-disabled:hover:bg-neutral-500/15`,a),r[15]=a,r[16]=k);let A;r[17]!==g||r[18]!==_||r[19]!==o||r[20]!==c||r[21]!==d?(A=async e=>{try{if(o?.(e),e.defaultPrevented){S.current!=null&&clearTimeout(S.current);return}let t=g.current;await _(t),c?.(t),y(n(`Copied`,x)),S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{y(``)},2e3)}catch(e){d?.(e)}},r[17]=g,r[18]=_,r[19]=o,r[20]=c,r[21]=d,r[22]=A):A=r[22];let j;r[23]!==h||r[24]!==f||r[25]!==p||r[26]!==O||r[27]!==k||r[28]!==A?(j=/* @__PURE__ */ V(l,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:h,icon:O,className:k,ref:p,onClick:A,...f}),r[23]=h,r[24]=f,r[25]=p,r[26]=O,r[27]=k,r[28]=A,r[29]=j):j=r[29];let M;return r[30]!==j||r[31]!==T?(M=/* @__PURE__ */ H(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-(--icon-button-border-radius,0.375rem) bg-base`,children:[T,j]}),r[30]=j,r[31]=T,r[32]=M):M=r[32],M},Te=e=>{let n=N(31),r,s,c,l,u;n[0]===e?(r=n[1],s=n[2],c=n[3],l=n[4],u=n[5]):({"data-slot":s,className:r,onClick:c,ref:u,...l}=e,n[0]=e,n[1]=r,n[2]=s,n[3]=c,n[4]=l,n[5]=u);let{codeId:d,isCodeExpanded:f,setIsCodeExpanded:p,setHasCodeExpander:m}=fe(),h,g;n[6]===m?(h=n[7],g=n[8]):(h=()=>(m(!0),()=>{m(!1)}),g=[m],n[6]=m,n[7]=h,n[8]=g),t(h,g);let _;n[9]===s?_=n[10]:(_=a(s,`code-block-expander-button`),n[9]=s,n[10]=_);let v;n[11]===r?v=n[12]:(v=i(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,r),n[11]=r,n[12]=v);let y;n[13]!==c||n[14]!==p?(y=e=>{p(Oe),c?.(e)},n[13]=c,n[14]=p,n[15]=y):y=n[15];let b=f?`Show less`:`Show more`,x;n[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ V(P,{weight:`bold`}),n[16]=x):x=n[16];let S=f&&`rotate-180`,C;n[17]===S?C=n[18]:(C=i(`size-4`,S,`transition-transform duration-200 ease-out-strong motion-reduce:transition-none`),n[17]=S,n[18]=C);let w;n[19]===C?w=n[20]:(w=/* @__PURE__ */ V(o,{svg:x,className:C}),n[19]=C,n[20]=w);let T;return n[21]!==d||n[22]!==f||n[23]!==l||n[24]!==u||n[25]!==w||n[26]!==_||n[27]!==v||n[28]!==y||n[29]!==b?(T=/* @__PURE__ */ H(`button`,{...l,"data-slot":_,"aria-controls":d,"aria-expanded":f,className:v,ref:u,type:`button`,onClick:y,children:[b,` `,w]}),n[21]=d,n[22]=f,n[23]=l,n[24]=u,n[25]=w,n[26]=_,n[27]=v,n[28]=y,n[29]=b,n[30]=T):T=n[30],T};function Ee(e){let t=N(18),n,r,s,l,u;t[0]===e?(n=t[1],r=t[2],s=t[3],l=t[4],u=t[5]):({"data-slot":s,className:r,preset:l,svg:n,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=l,t[5]=u);let d=n;if(l!=null)bb0:switch(l){case`file`:{let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(re,{weight:`fill`}),t[6]=e):e=t[6],d=e;break bb0}case`cli`:{let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(ie,{weight:`fill`}),t[7]=e):e=t[7],d=e;break bb0}case`traffic-policy`:{let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(c,{}),t[8]=e):e=t[8],d=e}}let f;t[9]===s?f=t[10]:(f=a(s,`code-block-icon`),t[9]=s,t[10]=f);let p;t[11]===r?p=t[12]:(p=i(`size-5`,r),t[11]=r,t[12]=p);let m;return t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p?(m=/* @__PURE__ */ V(o,{"data-slot":f,className:p,svg:d,...u}),t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}const De={Root:$,Body:pe,Code:xe,CopyButton:we,ExpanderButton:Te,Header:Se,Icon:Ee,TabContent:e=>{let t=N(8),n,r;t[0]===e?(n=t[1],r=t[2]):({"data-slot":n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(n,`code-block-tab-content`),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=/* @__PURE__ */ V(W,{"data-slot":i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o},TabList:e=>{let t=N(14),n,r,o,s;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4]):({"data-slot":r,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s);let c;t[5]===r?c=t[6]:(c=a(r,`code-block-tab-list`),t[5]=r,t[6]=c);let l;t[7]===n?l=t[8]:(l=i(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,n),t[7]=n,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ V(G,{"data-slot":c,className:l,ref:s,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},TabTrigger:e=>{let t=N(14),n,r,o,s;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4]):({"data-slot":r,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s);let c;t[5]===r?c=t[6]:(c=a(r,`code-block-tab-trigger`),t[5]=r,t[6]=c);let l;t[7]===n?l=t[8]:(l=i(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,n),t[7]=n,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ V(ae,{"data-slot":c,className:l,ref:s,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},Title:Ce};function Oe(e){return!e}const ke=`var(--shiki-foreground)`;function Ae(e){return e.replace(/[&<]/g,e=>e===`&`?`&`:`<`)}function je(e){return e===` `||e===` `||e===`
|
|
1
|
+
"use client";import{t as e}from"./use-copy-to-clipboard-hBL6_65i.js";import{t}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t as n}from"./alternate-announcement-BkH4bOKp.js";import{t as r}from"./use-composed-refs-DPYmLDSe.js";import{t as i}from"./cx-CK7o_rVv.js";import{t as a}from"./data-slot-EM6s2WEU.js";import{t as o}from"./icon-xb7d9M7X.js";import{r as s}from"./button-DNLTJ32M.js";import{t as c}from"./icons-DXadFwpo.js";import{t as l}from"./button-B9bChDgl.js";import{t as u}from"./live-region-Dhapu8a5.js";import{t as d}from"./slot-B7rwscwd.js";import{S as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,h as b,i as x,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as j,y as M}from"./code-block-CKzsAMzj.js";import{c as N}from"react/compiler-runtime";import{CaretDownIcon as P}from"@phosphor-icons/react/CaretDown";import{createContext as F,useContext as I,useEffect as ee,useId as L,useLayoutEffect as te,useRef as R,useState as z}from"react";import B from"tiny-invariant";import{jsx as V,jsxs as H}from"react/jsx-runtime";import{CheckIcon as ne}from"@phosphor-icons/react/Check";import{CopyIcon as U}from"@phosphor-icons/react/Copy";import{FileTextIcon as re}from"@phosphor-icons/react/FileText";import{TerminalIcon as ie}from"@phosphor-icons/react/Terminal";import{Content as W,List as G,Root as K,Trigger as ae}from"@radix-ui/react-tabs";function oe(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&`;break;case`<`:n+=`<`;break;case`>`:n+=`>`;break;case`"`:n+=`"`;break;case`'`:n+=`'`;break;default:n+=t}}return n}const q=/* @__PURE__ */ new WeakMap;function J(e){let t=/* @__PURE__ */ new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function Y(e){let t=q.get(e);if(t!=null&&le(t))return t;let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=J(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return q.set(e,a),a}function se(e){q.delete(e)}function ce(e){se(e),e.removeAttribute(`data-folded-regions`)}function le(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function ue(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function X(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=J(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=Y(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&ue(e,r,t)}return!0}const Z=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&X(n)};function de(e){return e.addEventListener(`click`,Z),()=>{e.removeEventListener(`click`,Z)}}const Q=F(null);function fe(){let e=I(Q);return B(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const $=e=>{let t=N(34),n,r,o,s,c,l,u,f;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],f=t[8]):({"data-slot":o,asChild:f,className:r,defaultTab:s,activeTab:n,onActiveTabChange:c,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f);let p=f!==void 0&&f,m=R(``),h=L(),g=R(0),[_,v]=z(!1),[y,b]=z(!1),x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{B(g.current===0,`You can only render a single CodeBlock.Code within a CodeBlock.`),g.current+=1},t[9]=x):x=t[9];let S=x,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{--g.current},t[10]=C):C=t[10];let w=C,T;t[11]!==h||t[12]!==_||t[13]!==y?(T={codeId:h,copyTextRef:m,hasCodeExpander:_,isCodeExpanded:y,registerCode:S,setHasCodeExpander:v,setIsCodeExpanded:b,unregisterCode:w},t[11]=h,t[12]=_,t[13]=y,t[14]=T):T=t[14];let E=T,D=s!=null||n!=null,O=p?d:`div`,k;t[15]===o?k=t[16]:(k=a(o,`code-block`),t[15]=o,t[16]=k);let A;t[17]===r?A=t[18]:(A=i(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,r),t[17]=r,t[18]=A);let j;t[19]!==O||t[20]!==l||t[21]!==u||t[22]!==k||t[23]!==A?(j=/* @__PURE__ */ V(O,{"data-slot":k,className:A,ref:u,...l}),t[19]=O,t[20]=l,t[21]=u,t[22]=k,t[23]=A,t[24]=j):j=t[24];let M=j,P;t[25]!==n||t[26]!==s||t[27]!==D||t[28]!==c||t[29]!==M?(P=D?/* @__PURE__ */ V(K,{asChild:!0,defaultValue:s,value:n,onValueChange:c,children:M}):M,t[25]=n,t[26]=s,t[27]=D,t[28]=c,t[29]=M,t[30]=P):P=t[30];let F;return t[31]!==E||t[32]!==P?(F=/* @__PURE__ */ V(Q.Provider,{value:E,children:P}),t[31]=E,t[32]=P,t[33]=F):F=t[33],F},pe=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`div`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-body`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`relative`,`[&_.mantle-code-line]:pr-4`,`[&:has([data-slot=code-block-copy-button])_.mantle-code-line:nth-child(-n+2)]:pr-14`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,className:f,ref:s,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},me=/SHIKI_VAL_(\d+)/g;function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const ge=/* @__PURE__ */ new Map;function _e(e){if(e==null||e.length===0)return me;let t=ge.get(e);return t??(ge.size>=500&&ge.clear(),t=RegExp(`${he(e)}(\\d+)__`,`g`),ge.set(e,t)),t}function ve({input:e,vals:t,preValToken:n,mapValue:r}){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(_e(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function ye(e,t,n){return ve({input:e,vals:t,preValToken:n,mapValue:e=>oe(String(e))})}function be(e,t,n){return ve({input:e,vals:t,preValToken:n,mapValue:e=>String(e)})}const xe=e=>{let t=N(58),n,a,o,s,c;t[0]===e?(n=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({className:n,style:s,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l=R(null),u=r(l,o),{codeId:d,copyTextRef:f,hasCodeExpander:p,isCodeExpanded:m,registerCode:h,unregisterCode:g}=fe(),{language:_,code:v,"~preValToken":y,"~preVals":b,"~highlightLines":x,"~lineNumberStart":S,"~preHtml":C,"~showLineNumbers":w}=c,T=x,E=S??1,D=w??!1,O;t[6]!==y||t[7]!==b||t[8]!==v?(O=b!=null&&b.length>0?be(v,b,y):v,t[6]=y,t[7]=b,t[8]=v,t[9]=O):O=t[9];let k=O,A,j;t[10]!==k||t[11]!==f?(A=()=>{f.current=k},j=[f,k],t[10]=k,t[11]=f,t[12]=A,t[13]=j):(A=t[12],j=t[13]),te(A,j);let M,P;t[14]!==h||t[15]!==g?(M=()=>(h(),()=>{g()}),P=[h,g],t[14]=h,t[15]=g,t[16]=M,t[17]=P):(M=t[16],P=t[17]),ee(M,P);let F;bb0:{if(C==null){F=void 0;break bb0}let e;t[18]!==C||t[19]!==y||t[20]!==b?(e=b!=null&&b.length>0?ye(C,b,y):C,t[18]=C,t[19]=y,t[20]=b,t[21]=e):e=t[21],F=e}let I=F,L,z;t[22]===I?(L=t[23],z=t[24]):(L=()=>{let e=l.current;if(e==null||I==null)return;let t=e.querySelector(`code`);return t!=null&&ce(t),de(e)},z=[I],t[22]=I,t[23]=L,t[24]=z),ee(L,z);let B=I!=null,H;t[25]!==k||t[26]!==I?(H=I??oe(k),t[25]=k,t[26]=I,t[27]=H):H=t[27];let ne=H,U;t[28]===ne?U=t[29]:(U={__html:ne},t[28]=ne,t[29]=U);let re=U,ie=m?`expanded`:`collapsed`,W;t[30]===s?W=t[31]:(W=s??{},t[30]=s,t[31]=W);let G;if(t[32]!==W){let{MozTabSize:e,...n}=W;G=n,t[32]=W,t[33]=G}else G=t[33];let K=p?ie:void 0,ae=!B&&`pr-14`,q;t[34]!==n||t[35]!==ae?(q=i(`scrollbar overflow-x-auto overscroll-x-none overflow-y-hidden py-4`,ae,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`data-[state=collapsed]:max-h-[13.6rem]`,n),t[34]=n,t[35]=ae,t[36]=q):q=t[36];let J=B?`true`:`false`,Y;t[37]!==T||t[38]!==B?(Y=B&&T!=null&&T.length>0?T.join(`,`):void 0,t[37]=T,t[38]=B,t[39]=Y):Y=t[39];let se=B&&D?String(E):`1`,le=B&&D?`true`:`false`,ue=String(E),X;t[40]!==G||t[41]!==ue?(X={...G,"--mantle-line-number-start":ue,tabSize:2},t[40]=G,t[41]=ue,t[42]=X):X=t[42];let Z=X,Q;t[43]===re?Q=t[44]:(Q=/* @__PURE__ */ V(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:re}),t[43]=re,t[44]=Q);let $;return t[45]!==d||t[46]!==u||t[47]!==_||t[48]!==a||t[49]!==K||t[50]!==q||t[51]!==J||t[52]!==Y||t[53]!==se||t[54]!==le||t[55]!==Z||t[56]!==Q?($=/* @__PURE__ */ V(`pre`,{"data-slot":`code-block-code`,"data-state":K,className:q,"data-highlighted":J,"data-lang":_,"data-mantle-highlight-lines":Y,"data-mantle-line-number-start":se,"data-mantle-line-numbers":le,id:d,ref:u,style:Z,...a,translate:`no`,children:Q}),t[45]=d,t[46]=u,t[47]=_,t[48]=a,t[49]=K,t[50]=q,t[51]=J,t[52]=Y,t[53]=se,t[54]=le,t[55]=Z,t[56]=Q,t[57]=$):$=t[57],$},Se=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`div`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-header`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,className:f,ref:s,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},Ce=e=>{let t=N(16),n,r,o,s,c;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":r,asChild:c,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c);let l=c!==void 0&&c?d:`h3`,u;t[6]===r?u=t[7]:(u=a(r,`code-block-title`),t[6]=r,t[7]=u);let f;t[8]===n?f=t[9]:(f=i(`m-0 font-sans text-xs font-medium`,n),t[8]=n,t[9]=f);let p;return t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==u||t[14]!==f?(p=/* @__PURE__ */ V(l,{"data-slot":u,ref:s,className:f,translate:`no`,...o}),t[10]=l,t[11]=o,t[12]=s,t[13]=u,t[14]=f,t[15]=p):p=t[15],p},we=t=>{let r=N(33),a,o,c,d,f,p,m;r[0]===t?(a=r[1],o=r[2],c=r[3],d=r[4],f=r[5],p=r[6],m=r[7]):({className:a,label:m,onCopy:c,onCopyError:d,onClick:o,ref:p,...f}=t,r[0]=t,r[1]=a,r[2]=o,r[3]=c,r[4]=d,r[5]=f,r[6]=p,r[7]=m);let h=m===void 0?`Copy code`:m,{copyTextRef:g}=fe(),_=e(),[v,y]=z(``),b=v!==``,x=R(!1),S=R(void 0),C,w;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>()=>{S.current!=null&&clearTimeout(S.current)},w=[],r[8]=C,r[9]=w):(C=r[8],w=r[9]),ee(C,w);let T;r[10]===v?T=r[11]:(T=/* @__PURE__ */ V(u,{children:v}),r[10]=v,r[11]=T);let E=b?`check`:`copy`,D;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(D={check:/* @__PURE__ */ V(ne,{}),copy:/* @__PURE__ */ V(U,{})},r[12]=D):D=r[12];let O;r[13]===E?O=r[14]:(O=/* @__PURE__ */ V(s,{active:E,icons:D}),r[13]=E,r[14]=O);let k;r[15]===a?k=r[16]:(k=i(`bg-base not-disabled:hover:bg-neutral-500/15`,a),r[15]=a,r[16]=k);let A;r[17]!==g||r[18]!==_||r[19]!==o||r[20]!==c||r[21]!==d?(A=async e=>{try{if(o?.(e),e.defaultPrevented){S.current!=null&&clearTimeout(S.current);return}let t=g.current;await _(t),c?.(t),y(n(`Copied`,x)),S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{y(``)},2e3)}catch(e){d?.(e)}},r[17]=g,r[18]=_,r[19]=o,r[20]=c,r[21]=d,r[22]=A):A=r[22];let j;r[23]!==h||r[24]!==f||r[25]!==p||r[26]!==O||r[27]!==k||r[28]!==A?(j=/* @__PURE__ */ V(l,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:h,icon:O,className:k,ref:p,onClick:A,...f}),r[23]=h,r[24]=f,r[25]=p,r[26]=O,r[27]=k,r[28]=A,r[29]=j):j=r[29];let M;return r[30]!==j||r[31]!==T?(M=/* @__PURE__ */ H(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-(--icon-button-border-radius,0.375rem) bg-base`,children:[T,j]}),r[30]=j,r[31]=T,r[32]=M):M=r[32],M},Te=e=>{let n=N(31),r,s,c,l,u;n[0]===e?(r=n[1],s=n[2],c=n[3],l=n[4],u=n[5]):({"data-slot":s,className:r,onClick:c,ref:u,...l}=e,n[0]=e,n[1]=r,n[2]=s,n[3]=c,n[4]=l,n[5]=u);let{codeId:d,isCodeExpanded:f,setIsCodeExpanded:p,setHasCodeExpander:m}=fe(),h,g;n[6]===m?(h=n[7],g=n[8]):(h=()=>(m(!0),()=>{m(!1)}),g=[m],n[6]=m,n[7]=h,n[8]=g),t(h,g);let _;n[9]===s?_=n[10]:(_=a(s,`code-block-expander-button`),n[9]=s,n[10]=_);let v;n[11]===r?v=n[12]:(v=i(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,r),n[11]=r,n[12]=v);let y;n[13]!==c||n[14]!==p?(y=e=>{p(Oe),c?.(e)},n[13]=c,n[14]=p,n[15]=y):y=n[15];let b=f?`Show less`:`Show more`,x;n[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ V(P,{weight:`bold`}),n[16]=x):x=n[16];let S=f&&`rotate-180`,C;n[17]===S?C=n[18]:(C=i(`size-4`,S,`transition-transform duration-200 ease-out-strong motion-reduce:transition-none`),n[17]=S,n[18]=C);let w;n[19]===C?w=n[20]:(w=/* @__PURE__ */ V(o,{svg:x,className:C}),n[19]=C,n[20]=w);let T;return n[21]!==d||n[22]!==f||n[23]!==l||n[24]!==u||n[25]!==w||n[26]!==_||n[27]!==v||n[28]!==y||n[29]!==b?(T=/* @__PURE__ */ H(`button`,{...l,"data-slot":_,"aria-controls":d,"aria-expanded":f,className:v,ref:u,type:`button`,onClick:y,children:[b,` `,w]}),n[21]=d,n[22]=f,n[23]=l,n[24]=u,n[25]=w,n[26]=_,n[27]=v,n[28]=y,n[29]=b,n[30]=T):T=n[30],T};function Ee(e){let t=N(18),n,r,s,l,u;t[0]===e?(n=t[1],r=t[2],s=t[3],l=t[4],u=t[5]):({"data-slot":s,className:r,preset:l,svg:n,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=l,t[5]=u);let d=n;if(l!=null)bb0:switch(l){case`file`:{let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(re,{weight:`fill`}),t[6]=e):e=t[6],d=e;break bb0}case`cli`:{let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(ie,{weight:`fill`}),t[7]=e):e=t[7],d=e;break bb0}case`traffic-policy`:{let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ V(c,{}),t[8]=e):e=t[8],d=e}}let f;t[9]===s?f=t[10]:(f=a(s,`code-block-icon`),t[9]=s,t[10]=f);let p;t[11]===r?p=t[12]:(p=i(`size-5`,r),t[11]=r,t[12]=p);let m;return t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p?(m=/* @__PURE__ */ V(o,{"data-slot":f,className:p,svg:d,...u}),t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}const De={Root:$,Body:pe,Code:xe,CopyButton:we,ExpanderButton:Te,Header:Se,Icon:Ee,TabContent:e=>{let t=N(8),n,r;t[0]===e?(n=t[1],r=t[2]):({"data-slot":n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(n,`code-block-tab-content`),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=/* @__PURE__ */ V(W,{"data-slot":i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o},TabList:e=>{let t=N(14),n,r,o,s;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4]):({"data-slot":r,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s);let c;t[5]===r?c=t[6]:(c=a(r,`code-block-tab-list`),t[5]=r,t[6]=c);let l;t[7]===n?l=t[8]:(l=i(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,n),t[7]=n,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ V(G,{"data-slot":c,className:l,ref:s,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},TabTrigger:e=>{let t=N(14),n,r,o,s;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4]):({"data-slot":r,className:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s);let c;t[5]===r?c=t[6]:(c=a(r,`code-block-tab-trigger`),t[5]=r,t[6]=c);let l;t[7]===n?l=t[8]:(l=i(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,n),t[7]=n,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ V(ae,{"data-slot":c,className:l,ref:s,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},Title:Ce};function Oe(e){return!e}const ke=`var(--shiki-foreground)`;function Ae(e){return e.replace(/[&<]/g,e=>e===`&`?`&`:`<`)}function je(e){return e===` `||e===` `||e===`
|
|
2
2
|
`||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function Me(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t}else{if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
|
|
3
3
|
`||t===`\r`)s+=1;else break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Ne(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=ke;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${Ae(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function Pe(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
|
|
4
4
|
`||o===`\r`){o===`\r`&&e[i+1]===`
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* rendering, and Web Workers. This module intentionally avoids importing
|
|
4
4
|
* any React or DOM-dependent code so it can run in non-browser contexts.
|
|
5
5
|
*/
|
|
6
|
-
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./code-block-
|
|
6
|
+
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./code-block-BDw6MEwH.js";
|
|
7
7
|
export { type ComputeFoldRangesInput, type DecorateHighlightedHtmlInput, type FoldExplanation, type FoldLine, type FoldScope, type FoldStrategy, type FoldToken, type FoldableRange, type Indentation, type LineRange, type SupportedLanguage, computeFoldRanges, computeJsonFoldRanges, decorateHighlightedHtml, defaultShowLineNumbers, finalizeFoldRanges, foldStrategyFor, inferIndentation, isIndentation, isSupportedLanguage, normalizeIndentation, normalizeValue, parseCodeBlockHighlightLines, parseCodeBlockLineNumberStart, parseCodeBlockShowLineNumbers, parseLanguage, supportedLanguages, tokenizeMetastring };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{h as computeFoldRanges,v as computeJsonFoldRanges,_ as decorateHighlightedHtml,x as defaultShowLineNumbers,y as finalizeFoldRanges,g as foldStrategyFor,p as inferIndentation,m as isIndentation,l as isSupportedLanguage,f as normalizeIndentation,n as normalizeValue,o as parseCodeBlockHighlightLines,s as parseCodeBlockLineNumberStart,c as parseCodeBlockShowLineNumbers,u as parseLanguage,d as supportedLanguages,a as tokenizeMetastring}from"./code-block-
|
|
1
|
+
export{h as computeFoldRanges,v as computeJsonFoldRanges,_ as decorateHighlightedHtml,x as defaultShowLineNumbers,y as finalizeFoldRanges,g as foldStrategyFor,p as inferIndentation,m as isIndentation,l as isSupportedLanguage,f as normalizeIndentation,n as normalizeValue,o as parseCodeBlockHighlightLines,s as parseCodeBlockLineNumberStart,c as parseCodeBlockShowLineNumbers,u as parseLanguage,d as supportedLanguages,a as tokenizeMetastring}from"./code-block-CKzsAMzj.js";
|
package/dist/code.d.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/code
|
|
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 } from "react";
|
|
9
9
|
/**
|
|
10
|
-
* Marks a short fragment of inline computer code
|
|
10
|
+
* Marks a short fragment of inline computer code: a function name, a
|
|
11
11
|
* variable, a CLI flag, a key. Renders a native `<code>` element with
|
|
12
12
|
* mantle's monospace styling.
|
|
13
13
|
*
|
|
@@ -27,7 +27,7 @@ import { ComponentProps } from "react";
|
|
|
27
27
|
* browser translation engine skips the subtree. A translated CLI flag, env var,
|
|
28
28
|
* or YAML key is wrong, and the reader copies it anyway. `Code` also styles terms
|
|
29
29
|
* that are not code, so pass `translate="yes"` when the content is prose.
|
|
30
|
-
* `Kbd` and `CodeBlock.Code` take no such override
|
|
30
|
+
* `Kbd` and `CodeBlock.Code` take no such override: a key and a block of code
|
|
31
31
|
* are never translatable.
|
|
32
32
|
*
|
|
33
33
|
* @useWhen Mark a short fragment of code inside a sentence, such as a function name, a file path,
|
package/dist/code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Code}from"./code-
|
|
1
|
+
export{t as Code}from"./code-BPKNY1_w.js";
|
package/dist/combobox.d.ts
CHANGED
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/forms/combobox
|
|
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 { o as WithValidation } from "./field-BshcNVe_.js";
|
|
9
|
-
import { n as Separator } from "./separator-
|
|
9
|
+
import { n as Separator } from "./separator-Ck4sPrdN.js";
|
|
10
10
|
import { ComponentProps } from "react";
|
|
11
11
|
import { ComboboxGroupLabelProps as ComboboxGroupLabelProps$1, ComboboxGroupProps as ComboboxGroupProps$1, ComboboxItemProps as ComboboxItemProps$1, ComboboxItemValueProps as ComboboxItemValueProps$1, ComboboxPopoverProps, ComboboxProps as ComboboxProps$1, ComboboxProviderProps } from "@ariakit/react/combobox";
|
|
12
12
|
type ComboboxProps = ComboboxProviderProps;
|
|
13
13
|
/**
|
|
14
14
|
* The outermost part of a combobox. It owns the ariakit store that holds the query text, the open state, and the selection.
|
|
15
15
|
*
|
|
16
|
-
* Use Combobox for a list of options where the user types to filter
|
|
16
|
+
* Use Combobox for a list of options where the user types to filter: large static lists,
|
|
17
17
|
* async/server-side data, or any single-select where search is helpful. For very small
|
|
18
18
|
* finite lists with no filtering, prefer Select. For multi-selection, prefer MultiSelect.
|
|
19
19
|
*
|
|
20
|
-
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier
|
|
21
|
-
*
|
|
20
|
+
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier.
|
|
21
|
+
* It does not portal, so the dialog primitive's Escape guard can see it. Inside
|
|
22
22
|
* an overlay it paints with the overlay's content. Outside one, an open overlay
|
|
23
23
|
* (`z-60`) covers it.
|
|
24
24
|
*
|
|
@@ -91,8 +91,8 @@ type ComboboxContentProps = Omit<ComboboxPopoverProps, "render"> & WithAsChild &
|
|
|
91
91
|
/**
|
|
92
92
|
* Renders a popover that contains combobox content, e.g. Combobox.Items, Combobox.Groups, and Combobox.Separators.
|
|
93
93
|
*
|
|
94
|
-
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier
|
|
95
|
-
*
|
|
94
|
+
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier.
|
|
95
|
+
* It does not portal, so the dialog primitive's Escape guard can see it. Inside
|
|
96
96
|
* an overlay it paints with the overlay's content. Outside one, an open overlay
|
|
97
97
|
* (`z-60`) covers it.
|
|
98
98
|
*
|
|
@@ -246,12 +246,12 @@ declare const ComboboxSeparatorComponent: ({ "data-slot": dataSlot, className, r
|
|
|
246
246
|
* Choose from a list of suggested values with full keyboard support.
|
|
247
247
|
* It follows the WAI-ARIA Combobox Pattern and builds on the ariakit Combobox.
|
|
248
248
|
*
|
|
249
|
-
* Use Combobox for a list of options where the user types to filter
|
|
249
|
+
* Use Combobox for a list of options where the user types to filter: large static lists,
|
|
250
250
|
* async/server-side data, or any single-select where search is helpful. For very small
|
|
251
251
|
* finite lists with no filtering, prefer Select. For multi-selection, prefer MultiSelect.
|
|
252
252
|
*
|
|
253
|
-
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier
|
|
254
|
-
*
|
|
253
|
+
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier.
|
|
254
|
+
* It does not portal, so the dialog primitive's Escape guard can see it. Inside
|
|
255
255
|
* an overlay it paints with the overlay's content. Outside one, an open overlay
|
|
256
256
|
* (`z-60`) covers it.
|
|
257
257
|
*
|
|
@@ -297,12 +297,12 @@ declare const Combobox: {
|
|
|
297
297
|
/**
|
|
298
298
|
* The outermost part of a combobox. It owns the ariakit store that holds the query text, the open state, and the selection.
|
|
299
299
|
*
|
|
300
|
-
* Use Combobox for a list of options where the user types to filter
|
|
300
|
+
* Use Combobox for a list of options where the user types to filter: large static lists,
|
|
301
301
|
* async/server-side data, or any single-select where search is helpful. For very small
|
|
302
302
|
* finite lists with no filtering, prefer Select. For multi-selection, prefer MultiSelect.
|
|
303
303
|
*
|
|
304
|
-
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier
|
|
305
|
-
*
|
|
304
|
+
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier.
|
|
305
|
+
* It does not portal, so the dialog primitive's Escape guard can see it.
|
|
306
306
|
* Inside an overlay it paints with the overlay's content. Outside one, an open
|
|
307
307
|
* overlay (`z-60`) covers it.
|
|
308
308
|
*
|
|
@@ -327,8 +327,8 @@ declare const Combobox: {
|
|
|
327
327
|
/**
|
|
328
328
|
* Renders a popover that contains combobox content, e.g. Combobox.Items, Combobox.Groups, and Combobox.Separators.
|
|
329
329
|
*
|
|
330
|
-
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier
|
|
331
|
-
*
|
|
330
|
+
* `Combobox.Content` renders in place at Tailwind `z-50`, Mantle's float tier.
|
|
331
|
+
* It does not portal, so the dialog primitive's Escape guard can see it.
|
|
332
332
|
* Inside an overlay it paints with the overlay's content. Outside one, an open
|
|
333
333
|
* overlay (`z-60`) covers it.
|
|
334
334
|
*
|
package/dist/combobox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{a as n,r}from"./field-
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{a as n,r}from"./field-Bpvn4tQp.js";import{n as i}from"./separator-DnvhwY2J.js";import{t as a}from"./slot-B7rwscwd.js";import{c as o}from"react/compiler-runtime";import{jsx as s}from"react/jsx-runtime";import{Combobox as c,ComboboxGroup as l,ComboboxGroupLabel as u,ComboboxItem as d,ComboboxItemValue as f,ComboboxPopover as p,ComboboxProvider as m}from"@ariakit/react/combobox";const h={Root:e=>{let t=o(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=/* @__PURE__ */ s(m,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i},Content:n=>{let r=o(22),i,a,c,l,u,d,f,m;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5],d=r[6],f=r[7],m=r[8]):({"data-slot":c,asChild:d,children:i,className:a,ref:u,sameWidth:f,unmountOnHide:m,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u,r[6]=d,r[7]=f,r[8]=m);let h=d!==void 0&&d,_=f===void 0||f,v=m===void 0||m,y;r[9]===c?y=r[10]:(y=t(c,`combobox-content`),r[9]=c,r[10]=y);let b;r[11]===a?b=r[12]:(b=e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,a),r[11]=a,r[12]=b);let x=h?g:void 0,S;return r[13]!==i||r[14]!==l||r[15]!==u||r[16]!==_||r[17]!==y||r[18]!==b||r[19]!==x||r[20]!==v?(S=/* @__PURE__ */ s(p,{"data-slot":y,className:b,ref:u,render:x,sameWidth:_,unmountOnHide:v,...l,children:i}),r[13]=i,r[14]=l,r[15]=u,r[16]=_,r[17]=y,r[18]=b,r[19]=x,r[20]=v,r[21]=S):S=r[21],S},Group:n=>{let r=o(18),i,a,c,u,d,f;r[0]===n?(i=r[1],a=r[2],c=r[3],u=r[4],d=r[5],f=r[6]):({"data-slot":c,asChild:f,children:i,className:a,ref:d,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=u,r[5]=d,r[6]=f);let p=f!==void 0&&f,m;r[7]===c?m=r[8]:(m=t(c,`combobox-group`),r[7]=c,r[8]=m);let h;r[9]===a?h=r[10]:(h=e(`space-y-px`,a),r[9]=a,r[10]=h);let g=p?v:void 0,_;return r[11]!==i||r[12]!==u||r[13]!==d||r[14]!==m||r[15]!==h||r[16]!==g?(_=/* @__PURE__ */ s(l,{"data-slot":m,className:h,ref:d,render:g,...u,children:i}),r[11]=i,r[12]=u,r[13]=d,r[14]=m,r[15]=h,r[16]=g,r[17]=_):_=r[17],_},GroupLabel:n=>{let r=o(18),i,a,c,l,d,f;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],d=r[5],f=r[6]):({"data-slot":c,asChild:f,children:i,className:a,ref:d,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=d,r[6]=f);let p=f!==void 0&&f,m;r[7]===c?m=r[8]:(m=t(c,`combobox-group-label`),r[7]=c,r[8]=m);let h;r[9]===a?h=r[10]:(h=e(`text-muted px-2 py-1 text-xs font-medium`,a),r[9]=a,r[10]=h);let g=p?y:void 0,_;return r[11]!==i||r[12]!==l||r[13]!==d||r[14]!==m||r[15]!==h||r[16]!==g?(_=/* @__PURE__ */ s(u,{"data-slot":m,className:h,ref:d,render:g,...l,children:i}),r[11]=i,r[12]=l,r[13]=d,r[14]=m,r[15]=h,r[16]=g,r[17]=_):_=r[17],_},Input:i=>{let a=o(25),l,u,d,f,p,m,h,g;a[0]===i?(l=a[1],u=a[2],d=a[3],f=a[4],p=a[5],m=a[6],h=a[7],g=a[8]):({"data-slot":f,"aria-invalid":l,autoComplete:h,autoSelect:g,className:d,ref:m,validation:u,...p}=i,a[0]=i,a[1]=l,a[2]=u,a[3]=d,a[4]=f,a[5]=p,a[6]=m,a[7]=h,a[8]=g);let _=h===void 0?`list`:h,v=g===void 0?`always`:g,y=n(),b=u??y,x;a[9]!==l||a[10]!==b?(x=r({"aria-invalid":l,validation:b}),a[9]=l,a[10]=b,a[11]=x):x=a[11];let{ariaInvalid:S,validation:C}=x,w;a[12]===f?w=a[13]:(w=t(f,`combobox-input`),a[12]=f,a[13]=w);let T;a[14]===d?T=a[15]:(T=e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger motion-safe:data-validation-error:animate-shake`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,d),a[14]=d,a[15]=T);let E=C||void 0,D;return a[16]!==S||a[17]!==_||a[18]!==v||a[19]!==p||a[20]!==m||a[21]!==w||a[22]!==T||a[23]!==E?(D=/* @__PURE__ */ s(c,{"aria-invalid":S,autoComplete:_,autoSelect:v,"data-slot":w,className:T,"data-validation":E,ref:m,...p}),a[16]=S,a[17]=_,a[18]=v,a[19]=p,a[20]=m,a[21]=w,a[22]=T,a[23]=E,a[24]=D):D=a[24],D},Item:n=>{let r=o(22),i,a,c,l,u,f,p,m;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5],f=r[6],p=r[7],m=r[8]):({"data-slot":c,asChild:f,children:i,className:a,focusOnHover:p,ref:u,value:m,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u,r[6]=f,r[7]=p,r[8]=m);let h=f!==void 0&&f,g=p===void 0||p,v;r[9]===c?v=r[10]:(v=t(c,`combobox-item`),r[9]=c,r[10]=v);let y;r[11]===a?y=r[12]:(y=e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,a),r[11]=a,r[12]=y);let b=h?_:void 0,x;return r[13]!==i||r[14]!==g||r[15]!==l||r[16]!==u||r[17]!==v||r[18]!==y||r[19]!==b||r[20]!==m?(x=/* @__PURE__ */ s(d,{"data-slot":v,className:y,focusOnHover:g,ref:u,render:b,value:m,...l,children:i}),r[13]=i,r[14]=g,r[15]=l,r[16]=u,r[17]=v,r[18]=y,r[19]=b,r[20]=m,r[21]=x):x=r[21],x},ItemValue:n=>{let r=o(16),i,a,c,l,u;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5]):({"data-slot":a,asChild:u,className:i,ref:l,...c}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u);let d=u!==void 0&&u,p;r[6]===a?p=r[7]:(p=t(a,`combobox-item-value`),r[6]=a,r[7]=p);let m;r[8]===i?m=r[9]:(m=e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,i),r[8]=i,r[9]=m);let h=d?b:void 0,g;return r[10]!==c||r[11]!==l||r[12]!==p||r[13]!==m||r[14]!==h?(g=/* @__PURE__ */ s(f,{"data-slot":p,className:m,ref:l,render:h,...c}),r[10]=c,r[11]=l,r[12]=p,r[13]=m,r[14]=h,r[15]=g):g=r[15],g},Separator:n=>{let r=o(14),a,c,l,u;r[0]===n?(a=r[1],c=r[2],l=r[3],u=r[4]):({"data-slot":c,className:a,ref:u,...l}=n,r[0]=n,r[1]=a,r[2]=c,r[3]=l,r[4]=u);let d;r[5]===c?d=r[6]:(d=t(c,`combobox-separator`),r[5]=c,r[6]=d);let f;r[7]===a?f=r[8]:(f=e(`-mx-1.25 my-1 w-auto`,a),r[7]=a,r[8]=f);let p;return r[9]!==l||r[10]!==u||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ s(i,{ref:u,"data-slot":d,className:f,...l}),r[9]=l,r[10]=u,r[11]=d,r[12]=f,r[13]=p):p=r[13],p}};function g(e){let{ref:t,...n}=e;return/* @__PURE__ */ s(a,{ref:t,...n})}function _(e){let{ref:t,...n}=e;return/* @__PURE__ */ s(a,{ref:t,...n})}function v(e){let{ref:t,...n}=e;return/* @__PURE__ */ s(a,{ref:t,...n})}function y(e){let{ref:t,...n}=e;return/* @__PURE__ */ s(a,{ref:t,...n})}function b(e){let{ref:t,...n}=e;return/* @__PURE__ */ s(a,{ref:t,...n})}export{h as Combobox};
|