@ngrok/mantle 0.79.2 → 0.80.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 +169 -12
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +496 -30
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +129 -9
- package/dist/alert.js +1 -1
- package/dist/anchor-_2meGDfj.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +214 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-5WsvzIQ6.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-BPMwa2jN.d.ts} +3 -3
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +146 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +224 -8
- package/dist/centered-layout.js +1 -1
- package/dist/checkbox-Cq17y0-R.js +1 -0
- package/dist/checkbox.d.ts +12 -10
- package/dist/checkbox.js +1 -1
- package/dist/choice-Cc8dA5r8.js +1 -0
- package/dist/choice-Ct0KK8jw.d.ts +269 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +270 -50
- package/dist/code-block.js +6 -6
- 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 +190 -11
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +285 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +33 -5
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +79 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CQ2C6vkE.js +1 -0
- package/dist/dialog.d.ts +239 -18
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-CSCDdA3K.js +1 -0
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-CoyozLzy.d.ts} +170 -29
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +596 -45
- 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 +54 -4
- package/dist/hover-card.js +1 -1
- package/dist/{icon-Cevjo93X.d.ts → icon-BDqpcZ-n.d.ts} +1 -1
- package/dist/icon-CGgMKpJg.js +1 -0
- package/dist/{icon-button-B7uEj1qq.d.ts → icon-button-C1AfGnQx.d.ts} +11 -60
- package/dist/icon-button-DiOhreJD.js +1 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +5 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/index-B8mIWKIU.d.ts +211 -0
- package/dist/{index-Rv8RL7xy.d.ts → index-BtwKJTLq.d.ts} +1 -1
- package/dist/{index-BivvYYs-.d.ts → index-C2jj8U4a.d.ts} +8 -5
- package/dist/index-CdPXa9h1.d.ts +1 -0
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-CVyAVbim.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-DV9M6K4v.d.ts} +42 -2
- package/dist/input.d.ts +4 -55
- 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/list.d.ts +150 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/mantle.css +21 -7
- package/dist/media-object.d.ts +27 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +312 -15
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +129 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +70 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CBMADtjV.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-CJRIlrLz.d.ts +31 -0
- package/dist/primitive-DCPHJsRs.js +1 -0
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +113 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +128 -23
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-C3e5Auo3.js → resolve-pre-rendered-props-C9uaM9-V.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/select-SR_9-bxA.js +1 -0
- package/dist/select-idm1jy7y.d.ts +600 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +252 -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 +295 -21
- 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/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → sort-B_DDQcVD.js} +1 -1
- package/dist/split-button.d.ts +28 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → svg-only-CdI_v82i.d.ts} +1 -1
- package/dist/svg-only-d-nMCfAI.js +1 -0
- package/dist/switch.d.ts +9 -6
- package/dist/switch.js +1 -1
- package/dist/table-DUSvU_Jw.d.ts +875 -0
- package/dist/table-GDkapNFi.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +139 -12
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-provider-BftkIiZn.js +1 -0
- package/dist/theme-switcher.d.ts +110 -29
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-wVnzzx2F.js +1 -0
- package/dist/theme.d.ts +53 -14
- package/dist/theme.js +1 -1
- package/dist/toast-DKgMRv4F.js +1 -0
- package/dist/toast.d.ts +98 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +28 -1
- package/dist/tooltip.js +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → traffic-policy-file-CF1lbWtp.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/virtual-UrzmaSQm.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +5 -5
- 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-ZCgG41hx.js +0 -1
- package/dist/dropdown-menu-Bt1aKF1g.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-M-kZdNIS.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-D8kZCOzM.js +0 -1
- package/dist/theme-provider-Djj_jBo6.js +0 -1
- package/dist/toast-D3ntBmn4.js +0 -1
- package/dist/virtual-DZMBu7Ch.js +0 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as Label } from "./label-C6YH9skg.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: {
|
|
65
|
+
({ "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, children, className, disabled, id, name, ref, ...props }: ChoiceRootProps): import("react").JSX.Element;
|
|
66
|
+
displayName: string;
|
|
67
|
+
};
|
|
68
|
+
type ChoiceIndicatorProps = ComponentProps<"span">;
|
|
69
|
+
/**
|
|
70
|
+
* The left control slot of a `Choice` — drop the control here (a `Checkbox`, a
|
|
71
|
+
* radio indicator, a `Switch`, …). Its single element child is cloned with the
|
|
72
|
+
* shared `id` / `name` / `aria-*` / `disabled` from `Root`, so a control placed
|
|
73
|
+
* here is wired to `Choice.Label` and the description without the caller
|
|
74
|
+
* threading ids. A non-element child (or none) is rendered untouched.
|
|
75
|
+
*
|
|
76
|
+
* The slot is one line tall (`h-lh`) using the same `text-sm` line box as the
|
|
77
|
+
* title, and centers its child — so the control sits centered on the title's
|
|
78
|
+
* first line and stays put when the title wraps.
|
|
79
|
+
*
|
|
80
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Choice.Root name="notify">
|
|
85
|
+
* <Choice.Indicator>
|
|
86
|
+
* <Checkbox />
|
|
87
|
+
* </Choice.Indicator>
|
|
88
|
+
* <Choice.Content>
|
|
89
|
+
* <Choice.Label>Email</Choice.Label>
|
|
90
|
+
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
91
|
+
* </Choice.Content>
|
|
92
|
+
* </Choice.Root>
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare const Indicator: {
|
|
96
|
+
({ children, className, ref, ...props }: ChoiceIndicatorProps): import("react").JSX.Element;
|
|
97
|
+
displayName: string;
|
|
98
|
+
};
|
|
99
|
+
type ChoiceContentProps = ComponentProps<"div"> & WithAsChild;
|
|
100
|
+
/**
|
|
101
|
+
* The right column of a `Choice` — stacks a `Choice.Label` / `Choice.Title` over
|
|
102
|
+
* an optional `Choice.Description`. `min-w-0` so long titles truncate instead of
|
|
103
|
+
* pushing the row wide.
|
|
104
|
+
*
|
|
105
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* <Choice.Root name="notify">
|
|
110
|
+
* <Choice.Indicator>
|
|
111
|
+
* <Checkbox />
|
|
112
|
+
* </Choice.Indicator>
|
|
113
|
+
* <Choice.Content>
|
|
114
|
+
* <Choice.Label>Email</Choice.Label>
|
|
115
|
+
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
116
|
+
* </Choice.Content>
|
|
117
|
+
* </Choice.Root>
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare const Content: {
|
|
121
|
+
({ asChild, className, ref, ...props }: ChoiceContentProps): import("react").JSX.Element;
|
|
122
|
+
displayName: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Props for `Choice.Label`. The mantle `Label` props, minus `htmlFor` and
|
|
126
|
+
* `disabled` — those are owned by `Choice.Root` (the control id and the choice's
|
|
127
|
+
* disabled state) and are not part of the public surface, so consumer props can
|
|
128
|
+
* never override the label-to-control wiring.
|
|
129
|
+
*/
|
|
130
|
+
type ChoiceLabelProps = Omit<ComponentProps<typeof Label>, "htmlFor" | "disabled">;
|
|
131
|
+
/**
|
|
132
|
+
* The emphasized title of a `Choice`, rendered as a real `<label>` wired to the
|
|
133
|
+
* control by `htmlFor`, so clicking it toggles the control and it supplies the
|
|
134
|
+
* control's accessible name. Use this when the `Choice` owns the labeling (a
|
|
135
|
+
* standalone checkbox, a raw `<form>`, React-state-only).
|
|
136
|
+
*
|
|
137
|
+
* It is the mantle {@link Label} (not a re-implementation), so it keeps every
|
|
138
|
+
* base-label behavior — cursor, the double-click text-selection guard, and the
|
|
139
|
+
* auto `font-medium` — and mirrors how `Field.Label` reuses `Label`. When an
|
|
140
|
+
* ancestor already owns the labeling and click target (a fully-clickable list
|
|
141
|
+
* row or a Headless radio item), use `Choice.Title` instead — a label-less `<p>`
|
|
142
|
+
* (it accepts `asChild`) — so labels never nest or compete.
|
|
143
|
+
*
|
|
144
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```tsx
|
|
148
|
+
* <Choice.Root name="notify">
|
|
149
|
+
* <Choice.Indicator>
|
|
150
|
+
* <Checkbox />
|
|
151
|
+
* </Choice.Indicator>
|
|
152
|
+
* <Choice.Content>
|
|
153
|
+
* <Choice.Label>Email</Choice.Label>
|
|
154
|
+
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
155
|
+
* </Choice.Content>
|
|
156
|
+
* </Choice.Root>
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare const ChoiceLabel: ({ className, ref, ...props }: ChoiceLabelProps) => import("react").JSX.Element;
|
|
160
|
+
/**
|
|
161
|
+
* The emphasized title of a `Choice`, label-styled but **not** a `<label>` —
|
|
162
|
+
* renders a `<p>`. Mirrors `Field.LabelText`. Use this when something else owns
|
|
163
|
+
* the control's labeling and click target: a fully-clickable list row or a
|
|
164
|
+
* Headless radio item. It avoids nesting two `<label>`s or splitting
|
|
165
|
+
* the click target. Pass `asChild` to supply your own element. For a standalone
|
|
166
|
+
* control — or inside a `Field` — where the title can be the label, use
|
|
167
|
+
* `Choice.Label`.
|
|
168
|
+
*
|
|
169
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```tsx
|
|
173
|
+
* <Choice.Root id="onboarding-key">
|
|
174
|
+
* <Choice.Indicator>
|
|
175
|
+
* <Checkbox />
|
|
176
|
+
* </Choice.Indicator>
|
|
177
|
+
* <Choice.Content>
|
|
178
|
+
* <Choice.Title>Onboarding Key</Choice.Title>
|
|
179
|
+
* <Choice.Description>ng-3FaThZL***8xiA</Choice.Description>
|
|
180
|
+
* </Choice.Content>
|
|
181
|
+
* </Choice.Root>
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
declare const Title: {
|
|
185
|
+
({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild): import("react").JSX.Element;
|
|
186
|
+
displayName: string;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* The de-emphasized supplementary line of a `Choice`, in the muted body color
|
|
190
|
+
* and wired to the control via `aria-describedby` (never a second label).
|
|
191
|
+
* Renders a `<p>`; pass `asChild` to supply your own element.
|
|
192
|
+
*
|
|
193
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```tsx
|
|
197
|
+
* <Choice.Root name="notify">
|
|
198
|
+
* <Choice.Indicator>
|
|
199
|
+
* <Checkbox />
|
|
200
|
+
* </Choice.Indicator>
|
|
201
|
+
* <Choice.Content>
|
|
202
|
+
* <Choice.Label>Email</Choice.Label>
|
|
203
|
+
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
204
|
+
* </Choice.Content>
|
|
205
|
+
* </Choice.Root>
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
declare const Description: {
|
|
209
|
+
({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild): import("react").JSX.Element;
|
|
210
|
+
displayName: string;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* A reusable indicator-left / content-right layout for a single choice: a
|
|
214
|
+
* control (checkbox, radio, switch) beside an emphasized title and an optional
|
|
215
|
+
* de-emphasized description. Use it to pair a checkbox or radio with a rich,
|
|
216
|
+
* titled label, or reach for it directly to build your own choice-like rows.
|
|
217
|
+
*
|
|
218
|
+
* It is a pure layout + association primitive: it owns the control's `id` and
|
|
219
|
+
* the description's `id` and wires them together, but does **not** own the
|
|
220
|
+
* control's value — drop your own control into `Choice.Indicator`. Pick
|
|
221
|
+
* `Choice.Label` (a real `<label>`) when the `Choice` owns the labeling, or
|
|
222
|
+
* `Choice.Title` (label-less text) when an ancestor (a clickable row or a
|
|
223
|
+
* Headless radio item) already does.
|
|
224
|
+
*
|
|
225
|
+
* **Use it for choice-like layouts** — a checkbox or radio input that needs an
|
|
226
|
+
* associated label and an optional supplementary description. It is not a
|
|
227
|
+
* general-purpose layout primitive; for laying out non-control content, reach
|
|
228
|
+
* for a plain flex/grid or `MediaObject` instead.
|
|
229
|
+
*
|
|
230
|
+
* **Field interop.** Inside a `Field.Control`, `Choice.Root` reads the field's
|
|
231
|
+
* `id` / `name` / `aria-*` and merges its description into the control's
|
|
232
|
+
* `aria-describedby`. Outside a `Field` it uses its own generated ids — the two
|
|
233
|
+
* are aware of each other but neither is required.
|
|
234
|
+
*
|
|
235
|
+
* @see https://mantle.ngrok.com/components/forms/choice
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* Composition:
|
|
239
|
+
* ```
|
|
240
|
+
* Choice.Root
|
|
241
|
+
* ├── Choice.Indicator
|
|
242
|
+
* └── Choice.Content
|
|
243
|
+
* ├── Choice.Label (or Choice.Title — pick one)
|
|
244
|
+
* └── Choice.Description
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```tsx
|
|
249
|
+
* <Choice.Root name="notify">
|
|
250
|
+
* <Choice.Indicator>
|
|
251
|
+
* <Checkbox />
|
|
252
|
+
* </Choice.Indicator>
|
|
253
|
+
* <Choice.Content>
|
|
254
|
+
* <Choice.Label>Email</Choice.Label>
|
|
255
|
+
* <Choice.Description>Get notified by email.</Choice.Description>
|
|
256
|
+
* </Choice.Content>
|
|
257
|
+
* </Choice.Root>
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
declare const Choice: {
|
|
261
|
+
Root: typeof Root;
|
|
262
|
+
Indicator: typeof Indicator;
|
|
263
|
+
Content: typeof Content;
|
|
264
|
+
Label: typeof ChoiceLabel;
|
|
265
|
+
Title: typeof Title;
|
|
266
|
+
Description: typeof Description;
|
|
267
|
+
};
|
|
268
|
+
//#endregion
|
|
269
|
+
export { ChoiceRootProps as n, Choice as t };
|
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-Ct0KK8jw.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-Cc8dA5r8.js";export{e as Choice};
|