@ngrok/mantle 0.66.0 → 0.66.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +158 -154
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/alert-dialog.d.ts +282 -277
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.d.ts +145 -138
- package/dist/alert.js +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor.d.ts +25 -22
- package/dist/anchor.js +1 -1
- package/dist/anchor.js.map +1 -1
- package/dist/as-child-XMVTepJu.d.ts +31 -0
- package/dist/badge.d.ts +29 -19
- package/dist/badge.js +1 -1
- package/dist/badge.js.map +1 -1
- package/dist/booleanish-CBGdPL3Q.js +2 -0
- package/dist/booleanish-CBGdPL3Q.js.map +1 -0
- package/dist/browser-only-QPyyfLaB.js +2 -0
- package/dist/browser-only-QPyyfLaB.js.map +1 -0
- package/dist/browser-only.d.ts +20 -15
- package/dist/browser-only.js +1 -2
- package/dist/button-B6StZJsz.d.ts +175 -0
- package/dist/button-CRRPesae.js +2 -0
- package/dist/button-CRRPesae.js.map +1 -0
- package/dist/button-DA2p0_5F.js +2 -0
- package/dist/button-DA2p0_5F.js.map +1 -0
- package/dist/button.d.ts +4 -9
- package/dist/button.js +1 -2
- package/dist/calendar.d.ts +14 -8
- package/dist/calendar.js +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/card.d.ts +99 -97
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/checkbox.d.ts +14 -12
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/code-block.d.ts +254 -237
- package/dist/code-block.js +3 -3
- package/dist/code-block.js.map +1 -1
- package/dist/code.d.ts +5 -3
- package/dist/code.js +1 -1
- package/dist/code.js.map +1 -1
- package/dist/color.d.ts +2 -38
- package/dist/color.js +1 -1
- package/dist/color.js.map +1 -1
- package/dist/combobox.d.ts +172 -167
- package/dist/combobox.js +1 -1
- package/dist/combobox.js.map +1 -1
- package/dist/command.d.ts +234 -227
- package/dist/command.js +1 -1
- package/dist/command.js.map +1 -1
- package/dist/compose-refs-DeIsFv68.js +2 -0
- package/dist/compose-refs-DeIsFv68.js.map +1 -0
- package/dist/cx-bKromGBh.js +2 -0
- package/dist/cx-bKromGBh.js.map +1 -0
- package/dist/cx.d.ts +4 -2
- package/dist/cx.js +1 -2
- package/dist/data-table.d.ts +211 -184
- package/dist/data-table.js +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/deep-non-nullable-BLM3Gz0I.d.ts +8 -0
- package/dist/description-list.d.ts +61 -59
- package/dist/description-list.js +1 -1
- package/dist/description-list.js.map +1 -1
- package/dist/dialog-BuD_JQf_.d.ts +422 -0
- package/dist/dialog-Cr5u0Eai.js +2 -0
- package/dist/dialog-Cr5u0Eai.js.map +1 -0
- package/dist/dialog.d.ts +3 -410
- package/dist/dialog.js +1 -2
- package/dist/direction-DfrtFTny.js +2 -0
- package/dist/direction-DfrtFTny.js.map +1 -0
- package/dist/{direction-DHheuUag.d.ts → direction-deXpJFDZ.d.ts} +9 -7
- package/dist/dropdown-menu-CjOaj-Ap.js +2 -0
- package/dist/dropdown-menu-CjOaj-Ap.js.map +1 -0
- package/dist/dropdown-menu-D_ZoY1AH.d.ts +330 -0
- package/dist/dropdown-menu.d.ts +2 -325
- package/dist/dropdown-menu.js +1 -2
- package/dist/flag.d.ts +31 -22
- package/dist/flag.js +1 -1
- package/dist/flag.js.map +1 -1
- package/dist/hooks.d.ts +72 -59
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/hover-card.d.ts +97 -91
- package/dist/hover-card.js +1 -1
- package/dist/hover-card.js.map +1 -1
- package/dist/{icon-DXTMiV1L.d.ts → icon-B1XLv02t.d.ts} +11 -9
- package/dist/icon-B5oNYYrJ.js +2 -0
- package/dist/icon-B5oNYYrJ.js.map +1 -0
- package/dist/icon-button-2r6S3HVA.d.ts +98 -0
- package/dist/icon-button-D4e9-dq-.js +2 -0
- package/dist/icon-button-D4e9-dq-.js.map +1 -0
- package/dist/icon.d.ts +4 -4
- package/dist/icon.js +1 -2
- package/dist/icons.d.ts +54 -41
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/{in-view-aHeQHaUj.d.ts → in-view-CTQRT44m.d.ts} +29 -22
- package/dist/in-view-bPnaWEL4.js +2 -0
- package/dist/in-view-bPnaWEL4.js.map +1 -0
- package/dist/index-BLCvtjLi.d.ts +40 -0
- package/dist/index-DWqhfw9n.d.ts +103 -0
- package/dist/{button-group-BFnqgdtl.d.ts → index-ViSCOUrU.d.ts} +10 -8
- package/dist/index-s8rMcilU.d.ts +47 -0
- package/dist/input.d.ts +3 -100
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/is-input-BFR8yMM7.js +2 -0
- package/dist/is-input-BFR8yMM7.js.map +1 -0
- package/dist/kbd-pyj32aN4.js +2 -0
- package/dist/kbd-pyj32aN4.js.map +1 -0
- package/dist/kbd.d.ts +10 -4
- package/dist/kbd.js +1 -2
- package/dist/label.d.ts +8 -6
- package/dist/label.js +1 -1
- package/dist/label.js.map +1 -1
- package/dist/media-object.d.ts +70 -68
- package/dist/media-object.js +1 -1
- package/dist/media-object.js.map +1 -1
- package/dist/multi-select.d.ts +226 -218
- package/dist/multi-select.js +1 -1
- package/dist/multi-select.js.map +1 -1
- package/dist/pagination.d.ts +168 -164
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +119 -117
- package/dist/popover.js +1 -1
- package/dist/popover.js.map +1 -1
- package/dist/primitive-Cath9ASB.js +2 -0
- package/dist/primitive-Cath9ASB.js.map +1 -0
- package/dist/primitive-tuHqhoRE.d.ts +16 -0
- package/dist/progress.d.ts +175 -150
- package/dist/progress.js +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.d.ts +246 -230
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/sandboxed-on-click.d.ts +36 -31
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/sandboxed-on-click.js.map +1 -1
- package/dist/select-39Jfc1Cb.d.ts +265 -0
- package/dist/select-DZ2ztBkI.js +2 -0
- package/dist/select-DZ2ztBkI.js.map +1 -0
- package/dist/select.d.ts +2 -263
- package/dist/select.js +1 -2
- package/dist/separator-BcCNbHBg.js +2 -0
- package/dist/separator-BcCNbHBg.js.map +1 -0
- package/dist/separator.d.ts +28 -21
- package/dist/separator.js +1 -2
- package/dist/sheet.d.ts +319 -305
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/skeleton.d.ts +8 -6
- package/dist/skeleton.js +1 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/slider.d.ts +48 -35
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/slot-DdnjeV2n.js +2 -0
- package/dist/slot-DdnjeV2n.js.map +1 -0
- package/dist/slot.d.ts +6 -4
- package/dist/slot.js +1 -2
- package/dist/sort-CfPsu1Gs.js +2 -0
- package/dist/sort-CfPsu1Gs.js.map +1 -0
- package/dist/split-button.d.ts +158 -162
- package/dist/split-button.js +1 -1
- package/dist/split-button.js.map +1 -1
- package/dist/svg-only-BVLlbQ4e.js +2 -0
- package/dist/svg-only-BVLlbQ4e.js.map +1 -0
- package/dist/{svg-only-Cp8Mu_sh.d.ts → svg-only-Dti1FvNV.d.ts} +11 -9
- package/dist/switch.d.ts +10 -8
- package/dist/switch.js +1 -1
- package/dist/switch.js.map +1 -1
- package/dist/table-BWMp12sl.js +2 -0
- package/dist/table-BWMp12sl.js.map +1 -0
- package/dist/table-Dpt192qt.d.ts +398 -0
- package/dist/table.d.ts +2 -396
- package/dist/table.js +1 -2
- package/dist/tabs.d.ts +110 -104
- package/dist/tabs.js +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/text-area.d.ts +10 -8
- package/dist/text-area.js +1 -1
- package/dist/text-area.js.map +1 -1
- package/dist/theme-provider-C8F5nFrJ.js +2 -0
- package/dist/theme-provider-C8F5nFrJ.js.map +1 -0
- package/dist/theme.d.ts +66 -39
- package/dist/theme.js +1 -2
- package/dist/{themes-Bi46K9ZW.d.ts → themes-ClppRAGt.d.ts} +4 -2
- package/dist/toast-1AuBbrBS.js +2 -0
- package/dist/toast-1AuBbrBS.js.map +1 -0
- package/dist/toast.d.ts +95 -87
- package/dist/toast.js +1 -2
- package/dist/tooltip.d.ts +78 -73
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/{chunk-W2YQRWR5.js → traffic-policy-file-QnF-2YkY.js} +2 -2
- package/dist/traffic-policy-file-QnF-2YkY.js.map +1 -0
- package/dist/types-884RJJqm.js +2 -0
- package/dist/types-884RJJqm.js.map +1 -0
- package/dist/{types-DehRoXC5.d.ts → types-DgXUgkpc.d.ts} +38 -36
- package/dist/types-Dh4BVhXC.d.ts +9 -0
- package/dist/types.d.ts +6 -49
- package/dist/types.js +1 -2
- package/dist/use-copy-to-clipboard-BEbQOKHc.js +2 -0
- package/dist/use-copy-to-clipboard-BEbQOKHc.js.map +1 -0
- package/dist/use-matches-media-query-CojcYxlA.js +2 -0
- package/dist/use-matches-media-query-CojcYxlA.js.map +1 -0
- package/dist/use-prefers-reduced-motion-BiG6QGkf.js +2 -0
- package/dist/use-prefers-reduced-motion-BiG6QGkf.js.map +1 -0
- package/dist/utils.d.ts +6 -5
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/variant-props-UE-phTwh.d.ts +13 -0
- package/dist/with-style-props-D1QFTzj6.d.ts +29 -0
- package/package.json +6 -6
- package/dist/as-child-DJ7x3JFV.d.ts +0 -21
- package/dist/browser-only.js.map +0 -1
- package/dist/button-DLUUf_c-.d.ts +0 -173
- package/dist/button.js.map +0 -1
- package/dist/chunk-2FYR6IJV.js +0 -2
- package/dist/chunk-2FYR6IJV.js.map +0 -1
- package/dist/chunk-5VDCC3YW.js +0 -2
- package/dist/chunk-5VDCC3YW.js.map +0 -1
- package/dist/chunk-63ZAW25Z.js +0 -2
- package/dist/chunk-63ZAW25Z.js.map +0 -1
- package/dist/chunk-6J7D73WA.js +0 -2
- package/dist/chunk-6J7D73WA.js.map +0 -1
- package/dist/chunk-72TJUKMV.js +0 -1
- package/dist/chunk-72TJUKMV.js.map +0 -1
- package/dist/chunk-7MJQGBE4.js +0 -2
- package/dist/chunk-7MJQGBE4.js.map +0 -1
- package/dist/chunk-7YLII2US.js +0 -2
- package/dist/chunk-7YLII2US.js.map +0 -1
- package/dist/chunk-ADF5DAYG.js +0 -2
- package/dist/chunk-ADF5DAYG.js.map +0 -1
- package/dist/chunk-CBRSMQ26.js +0 -2
- package/dist/chunk-CBRSMQ26.js.map +0 -1
- package/dist/chunk-COQIVAQH.js +0 -2
- package/dist/chunk-COQIVAQH.js.map +0 -1
- package/dist/chunk-ELZLLG6G.js +0 -2
- package/dist/chunk-ELZLLG6G.js.map +0 -1
- package/dist/chunk-EVU5XGB4.js +0 -2
- package/dist/chunk-EVU5XGB4.js.map +0 -1
- package/dist/chunk-EYZYDUS2.js +0 -2
- package/dist/chunk-EYZYDUS2.js.map +0 -1
- package/dist/chunk-HKSO72E5.js +0 -2
- package/dist/chunk-HKSO72E5.js.map +0 -1
- package/dist/chunk-HL2HWYKP.js +0 -2
- package/dist/chunk-HL2HWYKP.js.map +0 -1
- package/dist/chunk-IVQ626TU.js +0 -2
- package/dist/chunk-IVQ626TU.js.map +0 -1
- package/dist/chunk-JQ5D5YZR.js +0 -2
- package/dist/chunk-JQ5D5YZR.js.map +0 -1
- package/dist/chunk-LBO5LEYM.js +0 -2
- package/dist/chunk-LBO5LEYM.js.map +0 -1
- package/dist/chunk-MLXONRJD.js +0 -2
- package/dist/chunk-MLXONRJD.js.map +0 -1
- package/dist/chunk-OHPGAB7U.js +0 -2
- package/dist/chunk-OHPGAB7U.js.map +0 -1
- package/dist/chunk-OP6JMBKJ.js +0 -2
- package/dist/chunk-OP6JMBKJ.js.map +0 -1
- package/dist/chunk-PFXFESEN.js +0 -2
- package/dist/chunk-PFXFESEN.js.map +0 -1
- package/dist/chunk-PNL7JOXI.js +0 -2
- package/dist/chunk-PNL7JOXI.js.map +0 -1
- package/dist/chunk-RED6SFAV.js +0 -2
- package/dist/chunk-RED6SFAV.js.map +0 -1
- package/dist/chunk-SBQHQ2SJ.js +0 -2
- package/dist/chunk-SBQHQ2SJ.js.map +0 -1
- package/dist/chunk-SGGOH2WW.js +0 -2
- package/dist/chunk-SGGOH2WW.js.map +0 -1
- package/dist/chunk-W2YQRWR5.js.map +0 -1
- package/dist/chunk-W5A5HSFE.js +0 -2
- package/dist/chunk-W5A5HSFE.js.map +0 -1
- package/dist/chunk-YPAUKPCE.js +0 -2
- package/dist/chunk-YPAUKPCE.js.map +0 -1
- package/dist/cx.js.map +0 -1
- package/dist/deep-non-nullable-SmpSvoSd.d.ts +0 -8
- package/dist/dialog.js.map +0 -1
- package/dist/dropdown-menu.js.map +0 -1
- package/dist/icon-button-CT71Ti9V.d.ts +0 -96
- package/dist/icon.js.map +0 -1
- package/dist/kbd.js.map +0 -1
- package/dist/primitive-CBR_XmVa.d.ts +0 -14
- package/dist/select.js.map +0 -1
- package/dist/separator.js.map +0 -1
- package/dist/slot.js.map +0 -1
- package/dist/table.js.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/toast.js.map +0 -1
- package/dist/types-BuKAGhC-.d.ts +0 -7
- package/dist/types.js.map +0 -1
- package/dist/variant-props-oDo2u-We.d.ts +0 -11
- package/dist/with-style-props-VnLWm0Yd.d.ts +0 -27
package/dist/code-block.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { t as SvgAttributes } from "./types-Dh4BVhXC.js";
|
|
2
|
+
import { t as WithAsChild } from "./as-child-XMVTepJu.js";
|
|
3
|
+
import * as react from "react";
|
|
4
|
+
import { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
+
//#region src/components/code-block/supported-languages.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* List of supported languages for syntax highlighting.
|
|
9
10
|
* @private
|
|
@@ -26,38 +27,44 @@ declare const isSupportedLanguage: (value: unknown) => value is SupportedLanguag
|
|
|
26
27
|
* Formats a language name into a class name that Prism.js can understand.
|
|
27
28
|
* @default "language-sh"
|
|
28
29
|
*/
|
|
29
|
-
declare function formatLanguageClassName(language?: SupportedLanguage | undefined): "language-html" | "language-ruby" | "language-
|
|
30
|
-
|
|
30
|
+
declare function formatLanguageClassName(language?: SupportedLanguage | undefined): "language-html" | "language-ruby" | "language-text" | "language-py" | "language-go" | "language-bash" | "language-cs" | "language-csharp" | "language-css" | "language-dotnet" | "language-java" | "language-javascript" | "language-js" | "language-json" | "language-jsx" | "language-markup" | "language-plain" | "language-plaintext" | "language-python" | "language-rb" | "language-rust" | "language-sh" | "language-shell" | "language-ts" | "language-tsx" | "language-txt" | "language-typescript" | "language-xml" | "language-yaml" | "language-yml";
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/code-block/indentation.d.ts
|
|
31
33
|
declare const indentations: readonly ["tabs", "spaces"];
|
|
32
34
|
type Indentation = (typeof indentations)[number];
|
|
33
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Type Predicate: checks if the given value is a valid indentation type.
|
|
37
|
+
*/
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/code-block/line-numbers.d.ts
|
|
34
40
|
/**
|
|
35
41
|
* A line range is a string in the format of `start-end` where `start` and `end` are line numbers.
|
|
36
42
|
*/
|
|
37
43
|
type LineRange = `${number}-${number}`;
|
|
38
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/code-block/parse-metastring.d.ts
|
|
39
46
|
declare const modes: readonly ["cli", "file", "traffic-policy"];
|
|
40
47
|
type Mode = (typeof modes)[number];
|
|
41
48
|
type MetaInput = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
collapsible?: boolean | undefined;
|
|
50
|
+
disableCopy?: boolean | undefined;
|
|
51
|
+
indentation?: Indentation | undefined;
|
|
52
|
+
mode?: Mode | undefined;
|
|
53
|
+
title?: string | undefined;
|
|
47
54
|
};
|
|
48
55
|
type Meta = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
collapsible: boolean;
|
|
57
|
+
disableCopy: boolean;
|
|
58
|
+
indentation?: Indentation | undefined;
|
|
59
|
+
mode?: Mode | undefined;
|
|
60
|
+
title?: string | undefined;
|
|
54
61
|
};
|
|
55
62
|
declare const defaultMeta: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
readonly collapsible: false;
|
|
64
|
+
readonly disableCopy: false;
|
|
65
|
+
readonly indentation: undefined;
|
|
66
|
+
readonly mode: undefined;
|
|
67
|
+
readonly title: undefined;
|
|
61
68
|
};
|
|
62
69
|
type DefaultMeta = typeof defaultMeta;
|
|
63
70
|
/**
|
|
@@ -67,64 +74,65 @@ type DefaultMeta = typeof defaultMeta;
|
|
|
67
74
|
* CodeBlock components as props.
|
|
68
75
|
*/
|
|
69
76
|
declare function parseMetastring(input: string | undefined): Meta;
|
|
70
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/code-block/code-block.d.ts
|
|
71
79
|
type CodeBlockCodeProps = Omit<ComponentProps<"pre">, "children"> & {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The code to display in the code block. Should be code formatted as a string. This code will be passed to our syntax highlighter.
|
|
82
|
+
*/
|
|
83
|
+
value: string;
|
|
84
|
+
/**
|
|
85
|
+
* @todo not implemented yet
|
|
86
|
+
*/
|
|
87
|
+
highlightLines?: (LineRange | number)[];
|
|
88
|
+
/**
|
|
89
|
+
* The type of indentation to use. Can be either "tabs" or "spaces".
|
|
90
|
+
* @default inferred from the given language, fallback to `spaces`
|
|
91
|
+
*/
|
|
92
|
+
indentation?: Indentation;
|
|
93
|
+
/**
|
|
94
|
+
* The language of the code block. This will be used to determine how to syntax highlight the code.
|
|
95
|
+
* @default `"text"`.
|
|
96
|
+
*/
|
|
97
|
+
language?: SupportedLanguage;
|
|
98
|
+
/**
|
|
99
|
+
* @todo not implemented yet
|
|
100
|
+
*/
|
|
101
|
+
showLineNumbers?: boolean;
|
|
94
102
|
};
|
|
95
103
|
type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "children" | "type"> & WithAsChild & {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Callback fired when the copy button is clicked, passes the copied text as an argument.
|
|
106
|
+
*/
|
|
107
|
+
onCopy?: (value: string) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Callback fired when an error occurs during copying.
|
|
110
|
+
*/
|
|
111
|
+
onCopyError?: (error: unknown) => void;
|
|
104
112
|
};
|
|
105
113
|
type CodeBlockExpanderButtonProps = Omit<ComponentProps<"button">, "children" | "aria-controls" | "aria-expanded"> & WithAsChild;
|
|
106
114
|
type CodeBlockIconProps = Omit<SvgAttributes, "children"> & ({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
/**
|
|
116
|
+
* A custom icon to display in the code block header.
|
|
117
|
+
* (Pass only one of `svg` or `preset`.)
|
|
118
|
+
*/
|
|
119
|
+
svg: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* A preset icon to display in the code block header.
|
|
122
|
+
* (Pass only one of `svg` or `preset`.)
|
|
123
|
+
*/
|
|
124
|
+
preset?: undefined | never;
|
|
117
125
|
} | {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
/**
|
|
127
|
+
* A custom icon to display in the code block header.
|
|
128
|
+
* (Pass only one of `svg` or `preset`.)
|
|
129
|
+
*/
|
|
130
|
+
svg?: undefined | never;
|
|
131
|
+
/**
|
|
132
|
+
* A preset icon to display in the code block header.
|
|
133
|
+
* (Pass only one of `svg` or `preset`.)
|
|
134
|
+
*/
|
|
135
|
+
preset: Mode;
|
|
128
136
|
});
|
|
129
137
|
/**
|
|
130
138
|
* A small icon that represents the type of code block being displayed,
|
|
@@ -150,9 +158,14 @@ type CodeBlockIconProps = Omit<SvgAttributes, "children"> & ({
|
|
|
150
158
|
* </CodeBlock.Root>
|
|
151
159
|
* ```
|
|
152
160
|
*/
|
|
153
|
-
declare function CodeBlockIconComponent({
|
|
161
|
+
declare function CodeBlockIconComponent({
|
|
162
|
+
className,
|
|
163
|
+
preset,
|
|
164
|
+
svg: _svgProp,
|
|
165
|
+
...props
|
|
166
|
+
}: CodeBlockIconProps): react_jsx_runtime0.JSX.Element;
|
|
154
167
|
declare namespace CodeBlockIconComponent {
|
|
155
|
-
|
|
168
|
+
var displayName: string;
|
|
156
169
|
}
|
|
157
170
|
/**
|
|
158
171
|
* Code blocks render and apply syntax highlighting to blocks of code.
|
|
@@ -175,159 +188,160 @@ declare namespace CodeBlockIconComponent {
|
|
|
175
188
|
* ```
|
|
176
189
|
*/
|
|
177
190
|
declare const CodeBlock: {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
191
|
+
/**
|
|
192
|
+
* Code blocks render and apply syntax highlighting to blocks of code.
|
|
193
|
+
* This is the root component for all code block components.
|
|
194
|
+
*
|
|
195
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockroot
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <CodeBlock.Root>
|
|
200
|
+
* <CodeBlock.Header>
|
|
201
|
+
* <CodeBlock.Icon preset="file" />
|
|
202
|
+
* <CodeBlock.Title>…</CodeBlock.Title>
|
|
203
|
+
* </CodeBlock.Header>
|
|
204
|
+
* <CodeBlock.Body>
|
|
205
|
+
* <CodeBlock.CopyButton />
|
|
206
|
+
* <CodeBlock.Code language="…" value={fmtCode\`…\`} />
|
|
207
|
+
* </CodeBlock.Body>
|
|
208
|
+
* <CodeBlock.ExpanderButton />
|
|
209
|
+
* </CodeBlock.Root>
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
readonly Root: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "align"> & WithAsChild, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
213
|
+
/**
|
|
214
|
+
* The body of the `CodeBlock`. This is where the `CodeBlock.Code` and optional
|
|
215
|
+
* `CodeBlock.CopyButton` is rendered.
|
|
216
|
+
*
|
|
217
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockbody
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```tsx
|
|
221
|
+
* <CodeBlock.Root>
|
|
222
|
+
* <CodeBlock.Body>
|
|
223
|
+
* <CodeBlock.CopyButton />
|
|
224
|
+
* <CodeBlock.Code language="…" value={fmtCode\`…\`} />
|
|
225
|
+
* </CodeBlock.Body>
|
|
226
|
+
* </CodeBlock.Root>
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
readonly Body: react.ForwardRefExoticComponent<Omit<react.ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
230
|
+
/**
|
|
231
|
+
* The `CodeBlock` content. This is where the code is rendered and syntax highlighted.
|
|
232
|
+
*
|
|
233
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockcode
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```tsx
|
|
237
|
+
* <CodeBlock.Root>
|
|
238
|
+
* <CodeBlock.Body>
|
|
239
|
+
* <CodeBlock.Code
|
|
240
|
+
* language="sh"
|
|
241
|
+
* value={fmtCode`ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0`}
|
|
242
|
+
* />
|
|
243
|
+
* </CodeBlock.Body>
|
|
244
|
+
* </CodeBlock.Root>
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
readonly Code: react.ForwardRefExoticComponent<Omit<CodeBlockCodeProps, "ref"> & react.RefAttributes<HTMLPreElement>>;
|
|
248
|
+
/**
|
|
249
|
+
* The (optional) copy button of the `CodeBlock`. Render this as a child of the
|
|
250
|
+
* `CodeBlock.Body` to allow users to copy the code block contents to their
|
|
251
|
+
* clipboard.
|
|
252
|
+
*
|
|
253
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockcopybutton
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```tsx
|
|
257
|
+
* <CodeBlock.Root>
|
|
258
|
+
* <CodeBlock.Body>
|
|
259
|
+
* <CodeBlock.CopyButton />
|
|
260
|
+
* <CodeBlock.Code language="…" value={fmtCode\`…\`} />
|
|
261
|
+
* </CodeBlock.Body>
|
|
262
|
+
* </CodeBlock.Root>
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
265
|
+
readonly CopyButton: react.ForwardRefExoticComponent<Omit<CodeBlockCopyButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
266
|
+
/**
|
|
267
|
+
* The (optional) expander button of the `CodeBlock`. Render this as a child of the
|
|
268
|
+
* `CodeBlock.Body` to allow users to expand/collapse the code block contents.
|
|
269
|
+
*
|
|
270
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockexpanderbutton
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```tsx
|
|
274
|
+
* <CodeBlock.Root>
|
|
275
|
+
* <CodeBlock.Body>
|
|
276
|
+
* <CodeBlock.Code language="…" value={fmtCode\`…\`} />
|
|
277
|
+
* </CodeBlock.Body>
|
|
278
|
+
* <CodeBlock.ExpanderButton />
|
|
279
|
+
* </CodeBlock.Root>
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
readonly ExpanderButton: react.ForwardRefExoticComponent<Omit<CodeBlockExpanderButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
283
|
+
/**
|
|
284
|
+
* The (optional) header slot of the `CodeBlock`. This is where things like the
|
|
285
|
+
* `CodeBlock.Icon` and `CodeBlock.Title` are rendered.
|
|
286
|
+
*
|
|
287
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockheader
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```tsx
|
|
291
|
+
* <CodeBlock.Root>
|
|
292
|
+
* <CodeBlock.Header>
|
|
293
|
+
* <CodeBlock.Icon preset="file" />
|
|
294
|
+
* <CodeBlock.Title>…</CodeBlock.Title>
|
|
295
|
+
* </CodeBlock.Header>
|
|
296
|
+
* <CodeBlock.Body>
|
|
297
|
+
* <CodeBlock.Code language="…" value={fmtCode\`…\`} />
|
|
298
|
+
* </CodeBlock.Body>
|
|
299
|
+
* </CodeBlock.Root>
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
readonly Header: react.ForwardRefExoticComponent<Omit<react.ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
303
|
+
/**
|
|
304
|
+
* A small icon that represents the type of code block being displayed,
|
|
305
|
+
* rendered as an SVG next to the code block title in the code block header.
|
|
306
|
+
*
|
|
307
|
+
* You can pass in a custom SVG component or use one of the presets
|
|
308
|
+
* (pass only one of `svg` or `preset`).
|
|
309
|
+
*
|
|
310
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblockicon
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* ```tsx
|
|
314
|
+
* <CodeBlock.Root>
|
|
315
|
+
* <CodeBlock.Header>
|
|
316
|
+
* <CodeBlock.Icon preset="file" />
|
|
317
|
+
* <CodeBlock.Title>…</CodeBlock.Title>
|
|
318
|
+
* </CodeBlock.Header>
|
|
319
|
+
* </CodeBlock.Root>
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
322
|
+
readonly Icon: typeof CodeBlockIconComponent;
|
|
323
|
+
/**
|
|
324
|
+
* The (optional) title of the `CodeBlock`. Default renders as an h3 element,
|
|
325
|
+
* use asChild to render something else.
|
|
326
|
+
*
|
|
327
|
+
* @see https://mantle.ngrok.com/components/code-block#codeblocktitle
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* <CodeBlock.Root>
|
|
332
|
+
* <CodeBlock.Header>
|
|
333
|
+
* <CodeBlock.Icon preset="file" />
|
|
334
|
+
* <CodeBlock.Title>example.js</CodeBlock.Title>
|
|
335
|
+
* </CodeBlock.Header>
|
|
336
|
+
* </CodeBlock.Root>
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
readonly Title: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
|
|
340
|
+
asChild?: boolean;
|
|
341
|
+
} & react.RefAttributes<HTMLHeadingElement>>;
|
|
329
342
|
};
|
|
330
|
-
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/components/code-block/escape-html.d.ts
|
|
331
345
|
/**
|
|
332
346
|
* Escapes special HTML characters in a string to their corresponding
|
|
333
347
|
* HTML entities, preventing issues like unintended HTML rendering or
|
|
@@ -348,24 +362,27 @@ declare const CodeBlock: {
|
|
|
348
362
|
* // Returns: '<div>Hello & "world"</div>'
|
|
349
363
|
*/
|
|
350
364
|
declare function escapeHtml(value: string): string;
|
|
351
|
-
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/components/code-block/fmt-code.d.ts
|
|
352
367
|
type Primitive = string | number | boolean | undefined | null;
|
|
353
368
|
/**
|
|
354
369
|
* Tagged template literal to format code blocks and normalize leading indentation
|
|
355
370
|
*/
|
|
356
371
|
declare function fmtCode(strings: TemplateStringsArray, ...values: Primitive[]): string;
|
|
357
|
-
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/components/code-block/normalize.d.ts
|
|
358
374
|
type Options = {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
375
|
+
/**
|
|
376
|
+
* The indentation type to use. Can be either "tabs" or "spaces".
|
|
377
|
+
* @default "spaces"
|
|
378
|
+
*/
|
|
379
|
+
indentation?: Indentation;
|
|
364
380
|
};
|
|
365
381
|
/**
|
|
366
382
|
* Trim any leading and trailing whitespace/empty lines, convert leading
|
|
367
383
|
* indentation to the given options.indentation
|
|
368
384
|
*/
|
|
369
385
|
declare function normalizeIndentation(value: string, options?: Options): string;
|
|
370
|
-
|
|
386
|
+
//#endregion
|
|
371
387
|
export { CodeBlock, type DefaultMeta, type Meta, type MetaInput, type Mode, type SupportedLanguage, defaultMeta, escapeHtml, fmtCode, formatLanguageClassName, isSupportedLanguage, normalizeIndentation, parseLanguage, parseMetastring, supportedLanguages };
|
|
388
|
+
//# sourceMappingURL=code-block.d.ts.map
|