@ngrok/mantle 0.79.3 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +158 -19
- package/dist/accordion.js +1 -1
- package/dist/agent.json +5 -1
- package/dist/alert-dialog.d.ts +465 -32
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +116 -14
- package/dist/alert.js +1 -1
- package/dist/anchor-DfeXTpKW.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/area-chart.d.ts +504 -0
- package/dist/area-chart.js +1 -0
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +491 -0
- package/dist/bar-chart.js +1 -0
- package/dist/breadcrumb.d.ts +196 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-BAno7KIU.js +1 -0
- package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
- package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
- package/dist/button-DjpEKt2X.js +1 -0
- package/dist/button-DvHMWAPl.js +1 -0
- package/dist/button.d.ts +5 -5
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +131 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +209 -8
- package/dist/centered-layout.js +1 -1
- package/dist/chart-BROa2gqt.js +2 -0
- package/dist/chart-BcOC6Qj0.d.ts +275 -0
- package/dist/checkbox-0EoxOyMA.js +1 -0
- package/dist/checkbox.d.ts +13 -11
- package/dist/checkbox.js +1 -1
- package/dist/choice-BHwFSSyv.js +1 -0
- package/dist/choice-BNRQXszu.d.ts +254 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +242 -52
- package/dist/code-block.js +6 -6
- 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 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +171 -16
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +279 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +28 -6
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +67 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-BM4wPCft.d.ts +24 -0
- package/dist/dialog-DWZWd5Jt.js +1 -0
- package/dist/dialog.d.ts +226 -35
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
- package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
- package/dist/dropdown-menu-RyDWoKHx.js +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +7 -22
- package/dist/empty.js +1 -1
- package/dist/field-B1wqeZr4.js +1 -0
- package/dist/field.d.ts +568 -47
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +0 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +48 -7
- package/dist/hover-card.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
- package/dist/icon-d-nMCfAI.js +1 -0
- package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
- package/dist/icon-lZ48P8Nn.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
- package/dist/icons-DLCs1hLP.js +1 -0
- package/dist/icons.d.ts +7 -15
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-BnlpQF0c.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
- package/dist/input.d.ts +5 -56
- package/dist/input.js +1 -1
- package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
- package/dist/label-D-D11mlp.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +490 -0
- package/dist/line-chart.js +1 -0
- package/dist/list-51KQvENW.js +1 -0
- package/dist/list.d.ts +135 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +5 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/mantle-dark-high-contrast.css +17 -0
- package/dist/mantle-dark.css +13 -0
- package/dist/mantle-light-high-contrast.css +15 -0
- package/dist/mantle.css +29 -0
- package/dist/media-object.d.ts +18 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +282 -24
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +118 -6
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +61 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CE4OlWkd.d.ts +208 -0
- package/dist/popover-CQ9s7jG5.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-trJDqIXJ.js +1 -0
- package/dist/progress.d.ts +2 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +101 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +110 -35
- package/dist/radio-group.js +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +495 -0
- package/dist/scatter-plot.js +1 -0
- package/dist/select-0z7HVS6r.d.ts +579 -0
- package/dist/select-BCHWvmyC.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +225 -298
- package/dist/selectable-list.js +1 -1
- package/dist/separator-B5UmkVRL.d.ts +75 -0
- package/dist/separator-bpE_kooz.js +1 -0
- package/dist/separator.d.ts +1 -52
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +285 -38
- package/dist/sheet.js +1 -1
- package/dist/skeleton-CsbUHbBA.js +1 -0
- package/dist/skeleton.d.ts +4 -7
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +24 -4
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
- package/dist/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +14 -14
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +10 -7
- package/dist/switch.js +1 -1
- package/dist/table-Bo0vNxIJ.d.ts +848 -0
- package/dist/table-CGxJwtbL.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +124 -25
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-C26-Xolp.js +1 -0
- package/dist/theme-switcher.d.ts +105 -33
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +54 -15
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +86 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +50 -5
- package/dist/tooltip.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +9 -3
- package/dist/anchor-C_tjSVy6.js +0 -1
- package/dist/as-child-CYEVu1WY.d.ts +0 -23
- package/dist/button-5t6-JS_I.js +0 -1
- package/dist/button-ClC60Nzg.js +0 -1
- package/dist/checkbox-DJ2xl7Rc.js +0 -1
- package/dist/choice-DOdyNzFC.js +0 -1
- package/dist/compose-refs-Cjf2gfB8.js +0 -1
- package/dist/dialog-vxLIvB8M.js +0 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
- package/dist/field-context-BR01g789.js +0 -1
- package/dist/icon-CDtYjF_H.js +0 -1
- package/dist/icon-button-DV2-GZHf.js +0 -1
- package/dist/index-g2rfwNCH.d.ts +0 -1
- package/dist/input-Ct1YOqSy.js +0 -1
- package/dist/label-BMlHW_2D.js +0 -1
- package/dist/popover-D5WxxnBY.js +0 -1
- package/dist/primitive-C64-m48O.d.ts +0 -13
- package/dist/primitive-IKruV2iB.js +0 -1
- package/dist/select-Bwt2YduR.d.ts +0 -345
- package/dist/select-D-5u0Blc.js +0 -1
- package/dist/separator-kBnnv3Cw.js +0 -1
- package/dist/skeleton-Bu3tgNcW.js +0 -1
- package/dist/slot-DmPrjM7N.js +0 -1
- package/dist/svg-only-DDx6FtJd.js +0 -1
- package/dist/table-CPH2md2-.js +0 -1
- package/dist/table-CwFHXC-G.d.ts +0 -414
- package/dist/theme-D3MDng6U.js +0 -1
- package/dist/theme-provider-C9zpDyJW.js +0 -1
- package/dist/toast-BsCjaMVS.js +0 -1
- package/dist/virtual-DZMBu7Ch.js +0 -1
- /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
- /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
- /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
- /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
- /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
- /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
- /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
package/dist/choice.d.ts
CHANGED
|
@@ -1,253 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as Label } from "./label-v2-bv98k.js";
|
|
3
|
-
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
//#region src/components/choice/choice.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Props for `Choice.Root`. Extends `<div>` props (minus `id`, narrowed below)
|
|
7
|
-
* with the disabled / id / name controls. Inside a `Field.Control`, the field's
|
|
8
|
-
* `id` / `name` / `aria-*` take precedence over these.
|
|
9
|
-
*
|
|
10
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* <Choice.Root name="notify">
|
|
15
|
-
* <Choice.Indicator>
|
|
16
|
-
* <Checkbox />
|
|
17
|
-
* </Choice.Indicator>
|
|
18
|
-
* <Choice.Content>
|
|
19
|
-
* <Choice.Label>Email</Choice.Label>
|
|
20
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
21
|
-
* </Choice.Content>
|
|
22
|
-
* </Choice.Root>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
type ChoiceRootProps = Omit<ComponentProps<"div">, "id"> & {
|
|
26
|
-
/** Marks the choice disabled — dims the text and is injected onto the control. */
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Explicit control id. Defaults to a generated id, or — when composed inside a
|
|
30
|
-
* `Field.Control` — the field's id, so `Field.Label` and `Choice.Label` resolve
|
|
31
|
-
* to the same control.
|
|
32
|
-
*/
|
|
33
|
-
id?: string;
|
|
34
|
-
/** Form value name for the control. Inherited from `Field` when composed within one. */
|
|
35
|
-
name?: string;
|
|
36
|
-
/** `Choice.Indicator`, a `Choice.Content` (with `Label` / `Title` + `Description`). */
|
|
37
|
-
children: ReactNode;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Root of a `Choice`: the indicator-left / content-right layout for pairing a
|
|
41
|
-
* checkbox or radio with a titled, multi-line label. Owns the control's `id` and the
|
|
42
|
-
* description's `id`, and — when rendered inside a `Field.Control` — reads the
|
|
43
|
-
* field's `id` / `name` / `aria-*` from `FieldControlContext` and merges them
|
|
44
|
-
* into the props `Indicator` injects onto the control (the field's
|
|
45
|
-
* `aria-describedby` is concatenated with this `Choice`'s own description id).
|
|
46
|
-
* Outside a `Field` it falls back to its own generated ids, so the two compose
|
|
47
|
-
* but neither requires the other.
|
|
48
|
-
*
|
|
49
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```tsx
|
|
53
|
-
* <Choice.Root name="notify">
|
|
54
|
-
* <Choice.Indicator>
|
|
55
|
-
* <Checkbox />
|
|
56
|
-
* </Choice.Indicator>
|
|
57
|
-
* <Choice.Content>
|
|
58
|
-
* <Choice.Label>Email</Choice.Label>
|
|
59
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
60
|
-
* </Choice.Content>
|
|
61
|
-
* </Choice.Root>
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
declare const Root: import("react").ForwardRefExoticComponent<Omit<ChoiceRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
65
|
-
/**
|
|
66
|
-
* The left control slot of a `Choice` — drop the control here (a `Checkbox`, a
|
|
67
|
-
* radio indicator, a `Switch`, …). Its single element child is cloned with the
|
|
68
|
-
* shared `id` / `name` / `aria-*` / `disabled` from `Root`, so a control placed
|
|
69
|
-
* here is wired to `Choice.Label` and the description without the caller
|
|
70
|
-
* threading ids. A non-element child (or none) is rendered untouched.
|
|
71
|
-
*
|
|
72
|
-
* The slot is one line tall (`h-lh`) using the same `text-sm` line box as the
|
|
73
|
-
* title, and centers its child — so the control sits centered on the title's
|
|
74
|
-
* first line and stays put when the title wraps.
|
|
75
|
-
*
|
|
76
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```tsx
|
|
80
|
-
* <Choice.Root name="notify">
|
|
81
|
-
* <Choice.Indicator>
|
|
82
|
-
* <Checkbox />
|
|
83
|
-
* </Choice.Indicator>
|
|
84
|
-
* <Choice.Content>
|
|
85
|
-
* <Choice.Label>Email</Choice.Label>
|
|
86
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
87
|
-
* </Choice.Content>
|
|
88
|
-
* </Choice.Root>
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
declare const Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
92
|
-
type ChoiceContentProps = ComponentProps<"div"> & WithAsChild;
|
|
93
|
-
/**
|
|
94
|
-
* The right column of a `Choice` — stacks a `Choice.Label` / `Choice.Title` over
|
|
95
|
-
* an optional `Choice.Description`. `min-w-0` so long titles truncate instead of
|
|
96
|
-
* pushing the row wide.
|
|
97
|
-
*
|
|
98
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```tsx
|
|
102
|
-
* <Choice.Root name="notify">
|
|
103
|
-
* <Choice.Indicator>
|
|
104
|
-
* <Checkbox />
|
|
105
|
-
* </Choice.Indicator>
|
|
106
|
-
* <Choice.Content>
|
|
107
|
-
* <Choice.Label>Email</Choice.Label>
|
|
108
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
109
|
-
* </Choice.Content>
|
|
110
|
-
* </Choice.Root>
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
declare const Content: import("react").ForwardRefExoticComponent<Omit<ChoiceContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
114
|
-
/**
|
|
115
|
-
* Props for `Choice.Label`. The mantle `Label` props, minus `htmlFor` and
|
|
116
|
-
* `disabled` — those are owned by `Choice.Root` (the control id and the choice's
|
|
117
|
-
* disabled state) and are not part of the public surface, so consumer props can
|
|
118
|
-
* never override the label-to-control wiring.
|
|
119
|
-
*/
|
|
120
|
-
type ChoiceLabelProps = Omit<ComponentProps<typeof Label>, "htmlFor" | "disabled">;
|
|
121
|
-
/**
|
|
122
|
-
* The emphasized title of a `Choice`, rendered as a real `<label>` wired to the
|
|
123
|
-
* control by `htmlFor`, so clicking it toggles the control and it supplies the
|
|
124
|
-
* control's accessible name. Use this when the `Choice` owns the labeling (a
|
|
125
|
-
* standalone checkbox, a raw `<form>`, React-state-only).
|
|
126
|
-
*
|
|
127
|
-
* It is the mantle {@link Label} (not a re-implementation), so it keeps every
|
|
128
|
-
* base-label behavior — cursor, the double-click text-selection guard, and the
|
|
129
|
-
* auto `font-medium` — and mirrors how `Field.Label` reuses `Label`. When an
|
|
130
|
-
* ancestor already owns the labeling and click target (a fully-clickable list
|
|
131
|
-
* row or a Headless radio item), use `Choice.Title` instead — a label-less `<p>`
|
|
132
|
-
* (it accepts `asChild`) — so labels never nest or compete.
|
|
133
|
-
*
|
|
134
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```tsx
|
|
138
|
-
* <Choice.Root name="notify">
|
|
139
|
-
* <Choice.Indicator>
|
|
140
|
-
* <Checkbox />
|
|
141
|
-
* </Choice.Indicator>
|
|
142
|
-
* <Choice.Content>
|
|
143
|
-
* <Choice.Label>Email</Choice.Label>
|
|
144
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
145
|
-
* </Choice.Content>
|
|
146
|
-
* </Choice.Root>
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
declare const ChoiceLabel: import("react").ForwardRefExoticComponent<Omit<ChoiceLabelProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
150
|
-
/**
|
|
151
|
-
* The emphasized title of a `Choice`, label-styled but **not** a `<label>` —
|
|
152
|
-
* renders a `<p>`. Mirrors `Field.LabelText`. Use this when something else owns
|
|
153
|
-
* the control's labeling and click target: a fully-clickable list row or a
|
|
154
|
-
* Headless radio item. It avoids nesting two `<label>`s or splitting
|
|
155
|
-
* the click target. Pass `asChild` to supply your own element. For a standalone
|
|
156
|
-
* control — or inside a `Field` — where the title can be the label, use
|
|
157
|
-
* `Choice.Label`.
|
|
158
|
-
*
|
|
159
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```tsx
|
|
163
|
-
* <Choice.Root id="onboarding-key">
|
|
164
|
-
* <Choice.Indicator>
|
|
165
|
-
* <Checkbox />
|
|
166
|
-
* </Choice.Indicator>
|
|
167
|
-
* <Choice.Content>
|
|
168
|
-
* <Choice.Title>Onboarding Key</Choice.Title>
|
|
169
|
-
* <Choice.Description>ng-3FaThZL***8xiA</Choice.Description>
|
|
170
|
-
* </Choice.Content>
|
|
171
|
-
* </Choice.Root>
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
declare const Title: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
175
|
-
/**
|
|
176
|
-
* The de-emphasized supplementary line of a `Choice`, in the muted body color
|
|
177
|
-
* and wired to the control via `aria-describedby` (never a second label).
|
|
178
|
-
* Renders a `<p>`; pass `asChild` to supply your own element.
|
|
179
|
-
*
|
|
180
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```tsx
|
|
184
|
-
* <Choice.Root name="notify">
|
|
185
|
-
* <Choice.Indicator>
|
|
186
|
-
* <Checkbox />
|
|
187
|
-
* </Choice.Indicator>
|
|
188
|
-
* <Choice.Content>
|
|
189
|
-
* <Choice.Label>Email</Choice.Label>
|
|
190
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
191
|
-
* </Choice.Content>
|
|
192
|
-
* </Choice.Root>
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
196
|
-
/**
|
|
197
|
-
* A reusable indicator-left / content-right layout for a single choice: a
|
|
198
|
-
* control (checkbox, radio, switch) beside an emphasized title and an optional
|
|
199
|
-
* de-emphasized description. Use it to pair a checkbox or radio with a rich,
|
|
200
|
-
* titled label, or reach for it directly to build your own choice-like rows.
|
|
201
|
-
*
|
|
202
|
-
* It is a pure layout + association primitive: it owns the control's `id` and
|
|
203
|
-
* the description's `id` and wires them together, but does **not** own the
|
|
204
|
-
* control's value — drop your own control into `Choice.Indicator`. Pick
|
|
205
|
-
* `Choice.Label` (a real `<label>`) when the `Choice` owns the labeling, or
|
|
206
|
-
* `Choice.Title` (label-less text) when an ancestor (a clickable row or a
|
|
207
|
-
* Headless radio item) already does.
|
|
208
|
-
*
|
|
209
|
-
* **Use it for choice-like layouts** — a checkbox or radio input that needs an
|
|
210
|
-
* associated label and an optional supplementary description. It is not a
|
|
211
|
-
* general-purpose layout primitive; for laying out non-control content, reach
|
|
212
|
-
* for a plain flex/grid or `MediaObject` instead.
|
|
213
|
-
*
|
|
214
|
-
* **Field interop.** Inside a `Field.Control`, `Choice.Root` reads the field's
|
|
215
|
-
* `id` / `name` / `aria-*` and merges its description into the control's
|
|
216
|
-
* `aria-describedby`. Outside a `Field` it uses its own generated ids — the two
|
|
217
|
-
* are aware of each other but neither is required.
|
|
218
|
-
*
|
|
219
|
-
* @see https://mantle.ngrok.com/components/forms/choice
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* Composition:
|
|
223
|
-
* ```
|
|
224
|
-
* Choice.Root
|
|
225
|
-
* ├── Choice.Indicator
|
|
226
|
-
* └── Choice.Content
|
|
227
|
-
* ├── Choice.Label (or Choice.Title — pick one)
|
|
228
|
-
* └── Choice.Description
|
|
229
|
-
* ```
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* ```tsx
|
|
233
|
-
* <Choice.Root name="notify">
|
|
234
|
-
* <Choice.Indicator>
|
|
235
|
-
* <Checkbox />
|
|
236
|
-
* </Choice.Indicator>
|
|
237
|
-
* <Choice.Content>
|
|
238
|
-
* <Choice.Label>Email</Choice.Label>
|
|
239
|
-
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
240
|
-
* </Choice.Content>
|
|
241
|
-
* </Choice.Root>
|
|
242
|
-
* ```
|
|
243
|
-
*/
|
|
244
|
-
declare const Choice: {
|
|
245
|
-
Root: typeof Root;
|
|
246
|
-
Indicator: typeof Indicator;
|
|
247
|
-
Content: typeof Content;
|
|
248
|
-
Label: typeof ChoiceLabel;
|
|
249
|
-
Title: typeof Title;
|
|
250
|
-
Description: typeof Description;
|
|
251
|
-
};
|
|
252
|
-
//#endregion
|
|
1
|
+
import { n as ChoiceRootProps, t as Choice } from "./choice-BNRQXszu.js";
|
|
253
2
|
export { Choice, type ChoiceRootProps };
|
package/dist/choice.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./choice-
|
|
1
|
+
import{t as e}from"./choice-BHwFSSyv.js";export{e as Choice};
|
package/dist/code-block.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as SvgAttributes } from "./
|
|
3
|
-
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 "./
|
|
4
|
-
import { ComponentProps,
|
|
1
|
+
import { n as WithAsChild, t as SelfClosingWithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
|
|
3
|
+
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-B6OlZrSI.js";
|
|
4
|
+
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
import { Content, List, Trigger } from "@radix-ui/react-tabs";
|
|
6
6
|
//#region src/components/code-block/code-block.d.ts
|
|
7
7
|
type CodeBlockRootProps = Omit<ComponentProps<"div">, "align"> & WithAsChild & {
|
|
@@ -21,6 +21,49 @@ type CodeBlockRootProps = Omit<ComponentProps<"div">, "align"> & WithAsChild & {
|
|
|
21
21
|
*/
|
|
22
22
|
onActiveTabChange?: (value: string) => void;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Shiki-powered code blocks with build-time syntax highlighting and zero browser bundle.
|
|
26
|
+
* This is the root component for all CodeBlock components.
|
|
27
|
+
*
|
|
28
|
+
* For tabbed code blocks, pass `defaultTab` (uncontrolled) or `activeTab` / `onActiveTabChange`
|
|
29
|
+
* (controlled) to enable tab switching with `CodeBlock.TabList` and `CodeBlock.TabContent`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <CodeBlock.Root>
|
|
34
|
+
* <CodeBlock.Header>
|
|
35
|
+
* <CodeBlock.Icon preset="file" />
|
|
36
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
37
|
+
* </CodeBlock.Header>
|
|
38
|
+
* <CodeBlock.Body>
|
|
39
|
+
* <CodeBlock.CopyButton />
|
|
40
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
41
|
+
* </CodeBlock.Body>
|
|
42
|
+
* <CodeBlock.ExpanderButton />
|
|
43
|
+
* </CodeBlock.Root>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const Root$1: ({ asChild, className, defaultTab, activeTab, onActiveTabChange, ref, ...props }: CodeBlockRootProps) => import("react").JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* The body of the `CodeBlock`. This is where `CodeBlock.Code` and
|
|
49
|
+
* the optional `CodeBlock.CopyButton` are rendered.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <CodeBlock.Root>
|
|
54
|
+
* <CodeBlock.Header>
|
|
55
|
+
* <CodeBlock.Icon preset="file" />
|
|
56
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
57
|
+
* </CodeBlock.Header>
|
|
58
|
+
* <CodeBlock.Body>
|
|
59
|
+
* <CodeBlock.CopyButton />
|
|
60
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
61
|
+
* </CodeBlock.Body>
|
|
62
|
+
* <CodeBlock.ExpanderButton />
|
|
63
|
+
* </CodeBlock.Root>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare const Body: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
24
67
|
type CodeBlockCodeProps = Omit<ComponentProps<"pre">, "children"> & {
|
|
25
68
|
/**
|
|
26
69
|
* The code value produced by `mantleCode("lang")` tagged template.
|
|
@@ -29,7 +72,127 @@ type CodeBlockCodeProps = Omit<ComponentProps<"pre">, "children"> & {
|
|
|
29
72
|
*/
|
|
30
73
|
value: MantleCodeBlockValue;
|
|
31
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* The `CodeBlock` content. Renders pre-highlighted code from `mantleCode()`.
|
|
77
|
+
*
|
|
78
|
+
* `value["~preHtml"]` must be provided by Mantle's Vite plugin or server highlighter.
|
|
79
|
+
* Runtime highlighting and runtime line decoration are intentionally unsupported.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <CodeBlock.Root>
|
|
84
|
+
* <CodeBlock.Header>
|
|
85
|
+
* <CodeBlock.Icon preset="file" />
|
|
86
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
87
|
+
* </CodeBlock.Header>
|
|
88
|
+
* <CodeBlock.Body>
|
|
89
|
+
* <CodeBlock.CopyButton />
|
|
90
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
91
|
+
* </CodeBlock.Body>
|
|
92
|
+
* <CodeBlock.ExpanderButton />
|
|
93
|
+
* </CodeBlock.Root>
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
declare const Code: ({ className, style, value, ref, ...props }: CodeBlockCodeProps) => import("react").JSX.Element;
|
|
97
|
+
/**
|
|
98
|
+
* The (optional) header slot of the `CodeBlock`. This is where
|
|
99
|
+
* `CodeBlock.Icon` and `CodeBlock.Title` are rendered.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* <CodeBlock.Root>
|
|
104
|
+
* <CodeBlock.Header>
|
|
105
|
+
* <CodeBlock.Icon preset="file" />
|
|
106
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
107
|
+
* </CodeBlock.Header>
|
|
108
|
+
* <CodeBlock.Body>
|
|
109
|
+
* <CodeBlock.CopyButton />
|
|
110
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
111
|
+
* </CodeBlock.Body>
|
|
112
|
+
* <CodeBlock.ExpanderButton />
|
|
113
|
+
* </CodeBlock.Root>
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare const Header: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* The (optional) title of the `CodeBlock`. Renders as `h3` by default;
|
|
119
|
+
* use `asChild` to render a different element.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* <CodeBlock.Root>
|
|
124
|
+
* <CodeBlock.Header>
|
|
125
|
+
* <CodeBlock.Icon preset="file" />
|
|
126
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
127
|
+
* </CodeBlock.Header>
|
|
128
|
+
* <CodeBlock.Body>
|
|
129
|
+
* <CodeBlock.CopyButton />
|
|
130
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
131
|
+
* </CodeBlock.Body>
|
|
132
|
+
* <CodeBlock.ExpanderButton />
|
|
133
|
+
* </CodeBlock.Root>
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
declare const Title: ({ asChild, className, ref, ...props }: ComponentProps<"h3"> & {
|
|
137
|
+
asChild?: boolean;
|
|
138
|
+
}) => import("react").JSX.Element;
|
|
139
|
+
type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "children" | "type"> & SelfClosingWithAsChild & {
|
|
140
|
+
/**
|
|
141
|
+
* The accessible label for the copy button. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
|
142
|
+
*
|
|
143
|
+
* @default "Copy code"
|
|
144
|
+
*/
|
|
145
|
+
label?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Callback fired when the copy button is clicked, passes the copied text as an argument.
|
|
148
|
+
*/
|
|
149
|
+
onCopy?: (value: string) => void;
|
|
150
|
+
/**
|
|
151
|
+
* Callback fired when an error occurs during copying.
|
|
152
|
+
*/
|
|
153
|
+
onCopyError?: (error: unknown) => void;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* The (optional) copy button of the `CodeBlock`. Copies the code content
|
|
157
|
+
* to the clipboard when clicked.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <CodeBlock.Root>
|
|
162
|
+
* <CodeBlock.Header>
|
|
163
|
+
* <CodeBlock.Icon preset="file" />
|
|
164
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
165
|
+
* </CodeBlock.Header>
|
|
166
|
+
* <CodeBlock.Body>
|
|
167
|
+
* <CodeBlock.CopyButton />
|
|
168
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
169
|
+
* </CodeBlock.Body>
|
|
170
|
+
* <CodeBlock.ExpanderButton />
|
|
171
|
+
* </CodeBlock.Root>
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
declare const CopyButton: ({ className, label, onCopy, onCopyError, onClick, ref, ...props }: CodeBlockCopyButtonProps) => import("react").JSX.Element;
|
|
32
175
|
type CodeBlockExpanderButtonProps = Omit<ComponentProps<"button">, "children" | "aria-controls" | "aria-expanded"> & WithAsChild;
|
|
176
|
+
/**
|
|
177
|
+
* The (optional) expander button of the `CodeBlock`. Toggles the expanded
|
|
178
|
+
* state of the code block. When present, the code block is collapsible.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* <CodeBlock.Root>
|
|
183
|
+
* <CodeBlock.Header>
|
|
184
|
+
* <CodeBlock.Icon preset="file" />
|
|
185
|
+
* <CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
186
|
+
* </CodeBlock.Header>
|
|
187
|
+
* <CodeBlock.Body>
|
|
188
|
+
* <CodeBlock.CopyButton />
|
|
189
|
+
* <CodeBlock.Code value={mantleCode("typescript")`const x = "hello";`} />
|
|
190
|
+
* </CodeBlock.Body>
|
|
191
|
+
* <CodeBlock.ExpanderButton />
|
|
192
|
+
* </CodeBlock.Root>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
declare const ExpanderButton: ({ asChild, className, onClick, ref, ...props }: CodeBlockExpanderButtonProps) => import("react").JSX.Element;
|
|
33
196
|
type CodeBlockIconProps = Omit<SvgAttributes, "children"> & ({
|
|
34
197
|
/**
|
|
35
198
|
* A custom icon SVG to display in the code block header.
|
|
@@ -74,8 +237,73 @@ type CodeBlockIconProps = Omit<SvgAttributes, "children"> & ({
|
|
|
74
237
|
*/
|
|
75
238
|
declare function CodeBlockIconComponent({ className, preset, svg: _svgProp, ...props }: CodeBlockIconProps): import("react").JSX.Element;
|
|
76
239
|
type CodeBlockTabListProps = Omit<ComponentProps<typeof List>, "asChild" | "loop">;
|
|
240
|
+
/**
|
|
241
|
+
* A tab list for the `CodeBlock` header. Renders pill-styled tab triggers
|
|
242
|
+
* that switch which code is displayed. Built on Radix Tabs primitives.
|
|
243
|
+
*
|
|
244
|
+
* Place this inside `CodeBlock.Header` and pair with `CodeBlock.TabContent`
|
|
245
|
+
* in `CodeBlock.Body` to conditionally render code based on the active tab.
|
|
246
|
+
* Tab state is managed by `CodeBlock.Root` via `defaultTab` / `activeTab` / `onActiveTabChange`.
|
|
247
|
+
*
|
|
248
|
+
* When the tabs exceed the available width they scroll horizontally with an edge
|
|
249
|
+
* fade (`scroll-fade-x`) instead of wrapping to a second row.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* <CodeBlock.Root defaultTab="yml">
|
|
254
|
+
* <CodeBlock.Header>
|
|
255
|
+
* <CodeBlock.TabList>
|
|
256
|
+
* <CodeBlock.TabTrigger value="yml">policy.yml</CodeBlock.TabTrigger>
|
|
257
|
+
* <CodeBlock.TabTrigger value="json">policy.json</CodeBlock.TabTrigger>
|
|
258
|
+
* </CodeBlock.TabList>
|
|
259
|
+
* </CodeBlock.Header>
|
|
260
|
+
* <CodeBlock.Body>
|
|
261
|
+
* <CodeBlock.CopyButton />
|
|
262
|
+
* <CodeBlock.TabContent value="yml">
|
|
263
|
+
* <CodeBlock.Code value={ymlValue} />
|
|
264
|
+
* </CodeBlock.TabContent>
|
|
265
|
+
* <CodeBlock.TabContent value="json">
|
|
266
|
+
* <CodeBlock.Code value={jsonValue} />
|
|
267
|
+
* </CodeBlock.TabContent>
|
|
268
|
+
* </CodeBlock.Body>
|
|
269
|
+
* </CodeBlock.Root>
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
declare const TabList: ({ className, ref, ...props }: CodeBlockTabListProps) => import("react").JSX.Element;
|
|
77
273
|
type CodeBlockTabTriggerProps = Omit<ComponentProps<typeof Trigger>, "asChild">;
|
|
274
|
+
/**
|
|
275
|
+
* A pill-styled tab trigger for the `CodeBlock` header.
|
|
276
|
+
* Must be rendered within a `CodeBlock.TabList`.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```tsx
|
|
280
|
+
* <CodeBlock.TabList>
|
|
281
|
+
* <CodeBlock.TabTrigger value="yml">policy.yml</CodeBlock.TabTrigger>
|
|
282
|
+
* <CodeBlock.TabTrigger value="json">policy.json</CodeBlock.TabTrigger>
|
|
283
|
+
* </CodeBlock.TabList>
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
declare const TabTrigger: ({ className, ref, ...props }: CodeBlockTabTriggerProps) => import("react").JSX.Element;
|
|
78
287
|
type CodeBlockTabContentProps = Omit<ComponentProps<typeof Content>, "asChild" | "forceMount">;
|
|
288
|
+
/**
|
|
289
|
+
* Conditionally renders its children when the associated tab is active.
|
|
290
|
+
* Pair with `CodeBlock.TabList` and `CodeBlock.TabTrigger` in the header,
|
|
291
|
+
* and set `defaultTab` / `activeTab` on `CodeBlock.Root`.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```tsx
|
|
295
|
+
* <CodeBlock.Body>
|
|
296
|
+
* <CodeBlock.CopyButton />
|
|
297
|
+
* <CodeBlock.TabContent value="yml">
|
|
298
|
+
* <CodeBlock.Code value={ymlValue} />
|
|
299
|
+
* </CodeBlock.TabContent>
|
|
300
|
+
* <CodeBlock.TabContent value="json">
|
|
301
|
+
* <CodeBlock.Code value={jsonValue} />
|
|
302
|
+
* </CodeBlock.TabContent>
|
|
303
|
+
* </CodeBlock.Body>
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
declare const TabContent: (props: CodeBlockTabContentProps) => import("react").JSX.Element;
|
|
79
307
|
/**
|
|
80
308
|
* Shiki-powered code blocks with build-time syntax highlighting and zero browser bundle.
|
|
81
309
|
*
|
|
@@ -158,7 +386,7 @@ declare const CodeBlock: {
|
|
|
158
386
|
* </CodeBlock.Root>
|
|
159
387
|
* ```
|
|
160
388
|
*/
|
|
161
|
-
readonly Root:
|
|
389
|
+
readonly Root: typeof Root$1;
|
|
162
390
|
/**
|
|
163
391
|
* The body of the `CodeBlock`. Contains `Code` and optional `CopyButton`.
|
|
164
392
|
*
|
|
@@ -177,7 +405,7 @@ declare const CodeBlock: {
|
|
|
177
405
|
* </CodeBlock.Root>
|
|
178
406
|
* ```
|
|
179
407
|
*/
|
|
180
|
-
readonly Body:
|
|
408
|
+
readonly Body: typeof Body;
|
|
181
409
|
/**
|
|
182
410
|
* The code content. Renders pre-highlighted Shiki HTML when the Vite plugin is active.
|
|
183
411
|
*
|
|
@@ -196,7 +424,7 @@ declare const CodeBlock: {
|
|
|
196
424
|
* </CodeBlock.Root>
|
|
197
425
|
* ```
|
|
198
426
|
*/
|
|
199
|
-
readonly Code:
|
|
427
|
+
readonly Code: typeof Code;
|
|
200
428
|
/**
|
|
201
429
|
* The optional copy button.
|
|
202
430
|
*
|
|
@@ -215,43 +443,7 @@ declare const CodeBlock: {
|
|
|
215
443
|
* </CodeBlock.Root>
|
|
216
444
|
* ```
|
|
217
445
|
*/
|
|
218
|
-
readonly CopyButton:
|
|
219
|
-
asChild: true;
|
|
220
|
-
children: ReactNode;
|
|
221
|
-
} & {
|
|
222
|
-
/**
|
|
223
|
-
* The accessible label for the copy button. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
|
224
|
-
*
|
|
225
|
-
* @default "Copy code"
|
|
226
|
-
*/
|
|
227
|
-
label?: string;
|
|
228
|
-
/**
|
|
229
|
-
* Callback fired when the copy button is clicked, passes the copied text as an argument.
|
|
230
|
-
*/
|
|
231
|
-
onCopy?: (value: string) => void;
|
|
232
|
-
/**
|
|
233
|
-
* Callback fired when an error occurs during copying.
|
|
234
|
-
*/
|
|
235
|
-
onCopyError?: (error: unknown) => void;
|
|
236
|
-
}, "ref"> | Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "type"> & {
|
|
237
|
-
asChild?: false | undefined;
|
|
238
|
-
children?: undefined;
|
|
239
|
-
} & {
|
|
240
|
-
/**
|
|
241
|
-
* The accessible label for the copy button. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
|
242
|
-
*
|
|
243
|
-
* @default "Copy code"
|
|
244
|
-
*/
|
|
245
|
-
label?: string;
|
|
246
|
-
/**
|
|
247
|
-
* Callback fired when the copy button is clicked, passes the copied text as an argument.
|
|
248
|
-
*/
|
|
249
|
-
onCopy?: (value: string) => void;
|
|
250
|
-
/**
|
|
251
|
-
* Callback fired when an error occurs during copying.
|
|
252
|
-
*/
|
|
253
|
-
onCopyError?: (error: unknown) => void;
|
|
254
|
-
}, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
446
|
+
readonly CopyButton: typeof CopyButton;
|
|
255
447
|
/**
|
|
256
448
|
* The optional expander button for collapsible code blocks.
|
|
257
449
|
*
|
|
@@ -270,7 +462,7 @@ declare const CodeBlock: {
|
|
|
270
462
|
* </CodeBlock.Root>
|
|
271
463
|
* ```
|
|
272
464
|
*/
|
|
273
|
-
readonly ExpanderButton:
|
|
465
|
+
readonly ExpanderButton: typeof ExpanderButton;
|
|
274
466
|
/**
|
|
275
467
|
* The optional header slot for icon and title.
|
|
276
468
|
*
|
|
@@ -289,7 +481,7 @@ declare const CodeBlock: {
|
|
|
289
481
|
* </CodeBlock.Root>
|
|
290
482
|
* ```
|
|
291
483
|
*/
|
|
292
|
-
readonly Header:
|
|
484
|
+
readonly Header: typeof Header;
|
|
293
485
|
/**
|
|
294
486
|
* A small icon for the code block header. Use `preset` or `svg`.
|
|
295
487
|
*
|
|
@@ -333,7 +525,7 @@ declare const CodeBlock: {
|
|
|
333
525
|
* </CodeBlock.Root>
|
|
334
526
|
* ```
|
|
335
527
|
*/
|
|
336
|
-
readonly TabContent:
|
|
528
|
+
readonly TabContent: typeof TabContent;
|
|
337
529
|
/**
|
|
338
530
|
* A tab list for the code block header. Renders pill-styled tabs for switching code.
|
|
339
531
|
*
|
|
@@ -358,7 +550,7 @@ declare const CodeBlock: {
|
|
|
358
550
|
* </CodeBlock.Root>
|
|
359
551
|
* ```
|
|
360
552
|
*/
|
|
361
|
-
readonly TabList:
|
|
553
|
+
readonly TabList: typeof TabList;
|
|
362
554
|
/**
|
|
363
555
|
* A pill-styled tab trigger for the code block header. Must be inside `TabList`.
|
|
364
556
|
*
|
|
@@ -383,7 +575,7 @@ declare const CodeBlock: {
|
|
|
383
575
|
* </CodeBlock.Root>
|
|
384
576
|
* ```
|
|
385
577
|
*/
|
|
386
|
-
readonly TabTrigger:
|
|
578
|
+
readonly TabTrigger: typeof TabTrigger;
|
|
387
579
|
/**
|
|
388
580
|
* The optional title rendered in the header.
|
|
389
581
|
*
|
|
@@ -402,9 +594,7 @@ declare const CodeBlock: {
|
|
|
402
594
|
* </CodeBlock.Root>
|
|
403
595
|
* ```
|
|
404
596
|
*/
|
|
405
|
-
readonly Title:
|
|
406
|
-
asChild?: boolean;
|
|
407
|
-
} & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
597
|
+
readonly Title: typeof Title;
|
|
408
598
|
};
|
|
409
599
|
//#endregion
|
|
410
600
|
//#region src/components/code-block/json-highlight.d.ts
|