@ngrok/mantle 0.84.1 → 0.84.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 +14 -10
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/{alert-Blmunr_D.d.ts → alert-DCVfviBx.d.ts} +18 -3
- package/dist/alert-DtBQuuuP.js +1 -0
- package/dist/alert-center.d.ts +15 -6
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +58 -37
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/alternate-announcement-BkH4bOKp.js +1 -0
- package/dist/anchor-Cqu4GPPV.js +1 -0
- package/dist/anchor.d.ts +15 -15
- package/dist/anchor.js +1 -1
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -1
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +17 -8
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-B52_vczK.js +1 -0
- package/dist/{button-DjsmeoJ2.d.ts → button-B5i9n7Qp.d.ts} +19 -7
- package/dist/button-CaM-ZAH5.js +1 -0
- package/dist/{button-DwFvQWu4.js → button-DGsTE3P2.js} +1 -1
- package/dist/{button-CRCNRnk6.d.ts → button-DO53OA70.d.ts} +2 -2
- package/dist/{button-YkYZ0ymH.js → button-Wn-yt0c_.js} +1 -1
- package/dist/{button-C39M5h4K.d.ts → button-crUf0hbR.d.ts} +19 -2
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +20 -4
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +10 -6
- package/dist/card.js +1 -1
- package/dist/centered-layout.js +1 -1
- package/dist/chart-B_rZqf8a.js +2 -0
- package/dist/checkbox-Gg6nGUnR.js +1 -0
- package/dist/checkbox.js +1 -1
- package/dist/choice-CT_AdesL.js +1 -0
- package/dist/{choice-zOjixuj7.d.ts → choice-PESu-9s8.d.ts} +36 -12
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/{code-block-Dj9otiLi.js → code-block-BE3Q0iAo.js} +2 -2
- package/dist/code-block.d.ts +26 -2
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +19 -2
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +32 -13
- package/dist/command.js +1 -1
- package/dist/compose-refs-DdUwopIY.js +1 -0
- package/dist/{cx-IiQEAKf5.js → cx-0HCjnNv1.js} +1 -1
- package/dist/cx.d.ts +3 -3
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +114 -61
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +43 -9
- package/dist/description-list.js +1 -1
- package/dist/{dialog-u8PtHYES.d.ts → dialog-B8YvfyIo.d.ts} +5 -3
- package/dist/{dialog-CSUE-jw8.js → dialog-CA-1Z0Np.js} +1 -1
- package/dist/{dialog-CEk0L7M7.d.ts → dialog-CtLI_uex.d.ts} +5 -3
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpsUJGbn.d.ts → dropdown-menu-BYapTV0f.d.ts} +8 -5
- package/dist/dropdown-menu-BkPBh_8y.d.ts +1 -0
- package/dist/{dropdown-menu-Cy7mLIpJ.js → dropdown-menu-lxHsgLiw.js} +1 -1
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +4 -4
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +91 -38
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +9 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +15 -18
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +11 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-k4E9yNWD.d.ts → icon-BmJ57Tgh.d.ts} +10 -0
- package/dist/icon-CGKaq_tV.js +1 -0
- package/dist/icon-U24NfYv7.js +1 -0
- package/dist/icon-w0HUe7tr.d.ts +42 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/{icons-DEVx1oP9.js → icons-Cie4gcrm.js} +1 -1
- package/dist/icons.d.ts +7 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-gxyc9Q1_.d.ts → in-view-Ch5vJtWo.d.ts} +10 -5
- package/dist/input-BhykQSvJ.js +1 -0
- package/dist/input-DQyN6gN0.js +1 -0
- package/dist/input.d.ts +22 -10
- package/dist/input.js +1 -1
- package/dist/{kbd-B9qmYaW8.js → kbd-4_0Y_8rx.js} +1 -1
- package/dist/kbd.d.ts +15 -9
- package/dist/kbd.js +1 -1
- package/dist/{label-C6YH9skg.d.ts → label-Bnfe9YJ6.d.ts} +3 -1
- package/dist/label-BqIp6kFx.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-BTcQpd4K.js +1 -0
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/{list-7w5k3HiN.js → list-Bo1mExIg.js} +1 -1
- package/dist/list.d.ts +37 -14
- package/dist/list.js +1 -1
- package/dist/live-region-CV7kykeo.js +1 -0
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +4 -2
- package/dist/main.js +1 -1
- package/dist/media-object.d.ts +5 -12
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +45 -13
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +9 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +165 -19
- package/dist/pagination.js +1 -1
- package/dist/{popover-D6x6Bq-G.js → popover-Bp-9B3GR.js} +1 -1
- package/dist/{popover-DDuw1UaJ.d.ts → popover-s2LhmzfQ.d.ts} +8 -4
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-CejGAoGb.js +1 -0
- package/dist/progress.d.ts +65 -31
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -4
- package/dist/qr-code.js +1 -1
- package/dist/radio-group-HDVxTNPi.js +1 -0
- package/dist/radio-group.d.ts +50 -25
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-UagMFl_U.js +1 -0
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.js +1 -1
- package/dist/select-Dov9H2CX.js +1 -0
- package/dist/{select-DkFkSYBP.d.ts → select-ouAW88jx.d.ts} +30 -9
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +64 -20
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CNDs98Dv.d.ts → separator-Bo4nY_3M.d.ts} +13 -2
- package/dist/{separator-D1K7DSTv.js → separator-Da8lDnio.js} +1 -1
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-2AQT0DNu.js → sheet-C6UGAvRk.js} +1 -1
- package/dist/sheet.d.ts +5 -5
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +7 -6
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-paJOgf-f.js +1 -0
- package/dist/skeleton.d.ts +5 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +9 -6
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +7 -3
- package/dist/slider.js +1 -1
- package/dist/{slot-CxM7jdFi.js → slot-C3gII_9c.js} +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +8 -3
- package/dist/split-button.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-D51ZtV4U.d.ts → table-DEI-qvSC.d.ts} +25 -12
- package/dist/table-EZNW3nFk.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-DN-Et3A_.js +1 -0
- package/dist/theme-switcher.d.ts +24 -12
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +18 -4
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +8 -3
- package/dist/toast.js +1 -1
- package/dist/tooltip-CkAibjBb.js +1 -0
- package/dist/{tooltip-BKWK5c7_.d.ts → tooltip-DA41fxe5.d.ts} +7 -1
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{use-breakpoint-Dqu12Szq.js → use-breakpoint-BhJ_3El2.js} +1 -1
- package/dist/use-is-apple-platform-CMPzIYjz.js +1 -0
- package/dist/use-matches-media-query-DCBT6iNA.js +1 -0
- package/dist/use-prefers-reduced-motion-DHYDQk1h.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.js +1 -1
- package/package.json +3 -3
- package/dist/alert-D8StKSjK.js +0 -1
- package/dist/anchor-BjyGV6tB.js +0 -1
- package/dist/button-BCk0KpWb.js +0 -1
- package/dist/button-DiDlvAOp.js +0 -1
- package/dist/chart-DVt4hvnu.js +0 -2
- package/dist/checkbox-0EoxOyMA.js +0 -1
- package/dist/choice-BKkfjjAd.js +0 -1
- package/dist/compose-refs-BdBMM9ga.js +0 -1
- package/dist/dropdown-menu-CNaaABck.d.ts +0 -1
- package/dist/icon-CX_gj6sW.d.ts +0 -25
- package/dist/icon-d-nMCfAI.js +0 -1
- package/dist/icon-lZ48P8Nn.js +0 -1
- package/dist/input-BnlpQF0c.js +0 -1
- package/dist/input-CXmS0OFN.js +0 -1
- package/dist/label-D-D11mlp.js +0 -1
- package/dist/layer-container-CglTh9-6.js +0 -1
- package/dist/primitive-BSBmlRyy.js +0 -1
- package/dist/select-B52tWHOB.js +0 -1
- package/dist/skeleton-D86Gsflk.js +0 -1
- package/dist/table-C_Nm_RSV.js +0 -1
- package/dist/theme-CVfq037P.js +0 -1
- package/dist/tooltip-BZRRJgpm.js +0 -1
- package/dist/use-is-apple-platform-Cxwrb86L.js +0 -1
- package/dist/use-matches-media-query-Bd_GhhVd.js +0 -1
- package/dist/use-prefers-reduced-motion-Bk5zAfHY.js +0 -1
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
3
|
import "./index-DA4ig3gj.js";
|
|
3
4
|
import { ComponentProps } from "react";
|
|
4
5
|
//#region src/components/description-list/description-list.d.ts
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Props for `DescriptionList.Root`.
|
|
8
|
+
*/
|
|
9
|
+
type DescriptionListProps = ComponentProps<"dl"> & WithAsChild & WithDataSlot;
|
|
6
10
|
/**
|
|
7
11
|
* A semantically correct description list built on the HTML `<dl>` element.
|
|
8
12
|
* Renders a list of label/value pairs with alternating row backgrounds,
|
|
9
13
|
* commonly used in detail views to display metadata about a resource.
|
|
10
14
|
*
|
|
15
|
+
* | Data Attribute | Value | Description |
|
|
16
|
+
* | --- | --- | --- |
|
|
17
|
+
* | `data-slot` | `"description-list"` | The `<dl>`. A consumer `data-slot` joins in front of it. |
|
|
18
|
+
*
|
|
11
19
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistroot
|
|
12
20
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
|
|
13
21
|
*
|
|
@@ -21,13 +29,20 @@ type DescriptionListProps = ComponentProps<"dl"> & WithAsChild;
|
|
|
21
29
|
* </DescriptionList.Root>
|
|
22
30
|
* ```
|
|
23
31
|
*/
|
|
24
|
-
declare const Root: ({ asChild, className, children, ref, ...rest }: DescriptionListProps) => import("react").JSX.Element;
|
|
32
|
+
declare const Root: ({ asChild, className, children, "data-slot": dataSlot, ref, ...rest }: DescriptionListProps) => import("react").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Props for `DescriptionList.Item`.
|
|
35
|
+
*/
|
|
25
36
|
type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
|
|
26
37
|
/**
|
|
27
38
|
* A wrapper that groups a `DescriptionList.Label` and `DescriptionList.Value`
|
|
28
39
|
* pair. Renders as a `<div>` inside the `<dl>` with a subgrid layout that
|
|
29
40
|
* inherits column tracks from the root.
|
|
30
41
|
*
|
|
42
|
+
* | Data Attribute | Value | Description |
|
|
43
|
+
* | --- | --- | --- |
|
|
44
|
+
* | `data-slot` | `"description-list-item"` | The row wrapper. |
|
|
45
|
+
*
|
|
31
46
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistitem
|
|
32
47
|
*
|
|
33
48
|
* @example
|
|
@@ -41,10 +56,17 @@ type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
|
|
|
41
56
|
* ```
|
|
42
57
|
*/
|
|
43
58
|
declare const Item: ({ asChild, className, children, ref, ...rest }: DescriptionListItemProps) => import("react").JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* Props for `DescriptionList.Label`.
|
|
61
|
+
*/
|
|
44
62
|
type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
|
|
45
63
|
/**
|
|
46
64
|
* The label for a description list item. Renders as a `<dt>` element.
|
|
47
65
|
*
|
|
66
|
+
* | Data Attribute | Value | Description |
|
|
67
|
+
* | --- | --- | --- |
|
|
68
|
+
* | `data-slot` | `"description-list-label"` | The `<dt>`. |
|
|
69
|
+
*
|
|
48
70
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistlabel
|
|
49
71
|
*
|
|
50
72
|
* @example
|
|
@@ -58,12 +80,19 @@ type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
|
|
|
58
80
|
* ```
|
|
59
81
|
*/
|
|
60
82
|
declare const Label: ({ asChild, className, children, ref, ...rest }: DescriptionListLabelProps) => import("react").JSX.Element;
|
|
83
|
+
/**
|
|
84
|
+
* Props for `DescriptionList.Value`.
|
|
85
|
+
*/
|
|
61
86
|
type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
|
|
62
87
|
/**
|
|
63
88
|
* The value for a description list item. Renders as a `<dd>` element.
|
|
64
|
-
* Compose any content inside
|
|
89
|
+
* Compose any content inside: the component is intentionally "dumb" and
|
|
65
90
|
* imposes no layout on its children.
|
|
66
91
|
*
|
|
92
|
+
* | Data Attribute | Value | Description |
|
|
93
|
+
* | --- | --- | --- |
|
|
94
|
+
* | `data-slot` | `"description-list-value"` | The `<dd>`. |
|
|
95
|
+
*
|
|
67
96
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistvalue
|
|
68
97
|
*
|
|
69
98
|
* @example
|
|
@@ -116,7 +145,9 @@ declare const Value: ({ asChild, className, children, ref, ...rest }: Descriptio
|
|
|
116
145
|
*/
|
|
117
146
|
declare const DescriptionList: {
|
|
118
147
|
/**
|
|
119
|
-
*
|
|
148
|
+
* A semantically correct description list built on the HTML `<dl>` element.
|
|
149
|
+
* Renders a list of label/value pairs with alternating row backgrounds,
|
|
150
|
+
* commonly used in detail views to display metadata about a resource.
|
|
120
151
|
*
|
|
121
152
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistroot
|
|
122
153
|
*
|
|
@@ -132,8 +163,9 @@ declare const DescriptionList: {
|
|
|
132
163
|
*/
|
|
133
164
|
readonly Root: typeof Root;
|
|
134
165
|
/**
|
|
135
|
-
* A wrapper that groups a
|
|
136
|
-
* subgrid layout
|
|
166
|
+
* A wrapper that groups a `DescriptionList.Label` and `DescriptionList.Value`
|
|
167
|
+
* pair. Renders as a `<div>` inside the `<dl>` with a subgrid layout that
|
|
168
|
+
* inherits column tracks from the root.
|
|
137
169
|
*
|
|
138
170
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistitem
|
|
139
171
|
*
|
|
@@ -149,7 +181,7 @@ declare const DescriptionList: {
|
|
|
149
181
|
*/
|
|
150
182
|
readonly Item: typeof Item;
|
|
151
183
|
/**
|
|
152
|
-
* The label for a description list item. Renders a `<dt>` element.
|
|
184
|
+
* The label for a description list item. Renders as a `<dt>` element.
|
|
153
185
|
*
|
|
154
186
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistlabel
|
|
155
187
|
*
|
|
@@ -165,7 +197,9 @@ declare const DescriptionList: {
|
|
|
165
197
|
*/
|
|
166
198
|
readonly Label: typeof Label;
|
|
167
199
|
/**
|
|
168
|
-
* The value for a description list item. Renders a `<dd>` element.
|
|
200
|
+
* The value for a description list item. Renders as a `<dd>` element.
|
|
201
|
+
* Compose any content inside: the component is intentionally "dumb" and
|
|
202
|
+
* imposes no layout on its children.
|
|
169
203
|
*
|
|
170
204
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistvalue
|
|
171
205
|
*
|
|
@@ -182,4 +216,4 @@ declare const DescriptionList: {
|
|
|
182
216
|
readonly Value: typeof Value;
|
|
183
217
|
};
|
|
184
218
|
//#endregion
|
|
185
|
-
export { DescriptionList, type DescriptionListProps };
|
|
219
|
+
export { DescriptionList, type DescriptionListItemProps, type DescriptionListLabelProps, type DescriptionListProps, type DescriptionListValueProps };
|
package/dist/description-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-C3gII_9c.js";import{jsx as r}from"react/jsx-runtime";const i={Root:({asChild:i=!1,className:a,children:o,"data-slot":s,ref:c,...l})=>r(i?n:`dl`,{ref:c,"data-slot":t(s,`description-list`),className:e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_1fr] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,a),...l,children:o}),Item:({asChild:t=!1,className:i,children:a,ref:o,...s})=>r(t?n:`div`,{ref:o,"data-slot":`description-list-item`,className:e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,i),...s,children:a}),Label:({asChild:t=!1,className:i,children:a,ref:o,...s})=>r(t?n:`dt`,{ref:o,"data-slot":`description-list-label`,className:e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,i),...s,children:a}),Value:({asChild:t=!1,className:i,children:a,ref:o,...s})=>r(t?n:`dd`,{ref:o,"data-slot":`description-list-value`,className:e(`text-body font-mono text-mono py-2 px-3`,i),...s,children:a})};export{i as DescriptionList};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, ComponentPropsWithoutRef, Ref } from "react";
|
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
|
|
3
|
+
declare namespace primitive_d_exports {
|
|
4
|
+
export { Close, Content, Description, Overlay, Portal, Root, Title, Trigger, isDialogOverlayTarget };
|
|
5
|
+
}
|
|
4
6
|
type DialogPrimitiveContentProps = ComponentProps<typeof DialogPrimitive.Content>;
|
|
5
|
-
declare
|
|
7
|
+
declare const Root: import("react").FC<DialogPrimitive.DialogProps>;
|
|
6
8
|
declare const Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
9
|
/**
|
|
8
10
|
* Mounts dialog layers into the nearest layer container — an enclosing
|
|
@@ -27,4 +29,4 @@ declare const Description: ({ asChild, children, ref, ...props }: ComponentProps
|
|
|
27
29
|
*/
|
|
28
30
|
declare function isDialogOverlayTarget(target: EventTarget | null): boolean;
|
|
29
31
|
//#endregion
|
|
30
|
-
export { Portal as a, Trigger as c, Overlay as i, isDialogOverlayTarget as l, Content as n, Root as o, Description as r, Title as s, Close as t };
|
|
32
|
+
export { Portal as a, Trigger as c, Overlay as i, isDialogOverlayTarget as l, Content as n, Root as o, Description as r, Title as s, Close as t, primitive_d_exports as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-CaM-ZAH5.js";import{t as n}from"./layer-container-BTcQpd4K.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./primitive-CejGAoGb.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";const m=s,h=e=>d(i,{"data-slot":`dialog-trigger`,...e}),g=r,_=e=>d(u,{"data-slot":`dialog-close`,...e}),v=({className:t,ref:n,...r})=>d(a,{ref:n,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-60 backdrop-blur-xs`,t),...r}),y={centered:`inset-4`,"full-page":`inset-4`,"full-bleed":`inset-0`},b={centered:`border-dialog rounded-xl border`,"full-page":`border-dialog h-full max-w-none rounded-xl border`,"full-bleed":`h-full max-w-none`},x={Root:m,Body:({className:t,...n})=>d(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n}),Close:_,CloseIconButton:({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>d(u,{asChild:!0,children:d(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:d(p,{}),intent:a,label:r,size:e,type:n,...o})}),Content:({appearance:t=`centered`,children:r,className:i,preferredWidth:a,ref:s,...c})=>f(g,{children:[d(v,{}),d(n,{"data-slot":`dialog-positioner`,className:e(`fixed z-60 flex items-center justify-center`,y[t]),children:d(o,{"data-appearance":t,"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`bg-dialog shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,b[t],t===`centered`&&(a??`max-w-lg`),i),ref:s,...c,children:r})})]}),Description:({className:t,ref:n,...r})=>d(c,{ref:n,"data-slot":`dialog-description`,className:e(`text-muted`,t),...r}),Footer:({className:t,...n})=>d(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n}),Header:({className:t,children:n,...r})=>d(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n}),Overlay:v,Portal:g,Title:({className:t,ref:n,...r})=>d(l,{ref:n,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...r}),Trigger:h};export{x as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
1
|
+
import { a as Portal, c as Trigger$1, i as Overlay$1, n as Content$1, r as Description$1, s as Title$1, t as Close$1, u as primitive_d_exports } from "./dialog-B8YvfyIo.js";
|
|
2
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-crUf0hbR.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
//#region src/components/dialog/dialog.d.ts
|
|
5
5
|
/**
|
|
@@ -510,7 +510,7 @@ declare const Dialog: {
|
|
|
510
510
|
* </Dialog.Root>
|
|
511
511
|
* ```
|
|
512
512
|
*/
|
|
513
|
-
readonly Root:
|
|
513
|
+
readonly Root: import("react").FC<import("@radix-ui/react-dialog").DialogProps>;
|
|
514
514
|
/**
|
|
515
515
|
* Contains the main content of the dialog.
|
|
516
516
|
*
|
|
@@ -677,6 +677,8 @@ declare const Dialog: {
|
|
|
677
677
|
readonly Content: typeof Content;
|
|
678
678
|
/**
|
|
679
679
|
* An accessible description to be announced when the dialog is opened.
|
|
680
|
+
* Renders as a `div` by default, but can be changed to any other element using
|
|
681
|
+
* the `asChild` prop.
|
|
680
682
|
*
|
|
681
683
|
* @see https://mantle.ngrok.com/components/overlays/dialog#dialogdescription
|
|
682
684
|
*
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { l as isDialogOverlayTarget } from "./dialog-
|
|
2
|
-
import { t as Dialog } from "./dialog-
|
|
1
|
+
import { l as isDialogOverlayTarget } from "./dialog-B8YvfyIo.js";
|
|
2
|
+
import { t as Dialog } from "./dialog-CtLI_uex.js";
|
|
3
3
|
export { Dialog, isDialogOverlayTarget };
|
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./primitive-
|
|
1
|
+
import{l as e}from"./primitive-CejGAoGb.js";import{t}from"./dialog-CA-1Z0Np.js";export{t as Dialog,e as isDialogOverlayTarget};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
2
|
+
import { n as Separator } from "./separator-Bo4nY_3M.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
5
|
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
@@ -63,7 +63,8 @@ declare const Group: ({ className, ...props }: ComponentProps<typeof DropdownMen
|
|
|
63
63
|
*/
|
|
64
64
|
declare const RadioGroup: ({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) => import("react").JSX.Element;
|
|
65
65
|
/**
|
|
66
|
-
* A trigger for a dropdown menu sub-menu.
|
|
66
|
+
* A trigger for a dropdown menu sub-menu. It opens the submenu on hover, or on
|
|
67
|
+
* ArrowRight or Enter.
|
|
67
68
|
*
|
|
68
69
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenusubtrigger
|
|
69
70
|
*
|
|
@@ -255,7 +256,8 @@ declare const Label: ({ className, inset, ...props }: ComponentProps<typeof Drop
|
|
|
255
256
|
*/
|
|
256
257
|
declare const DropdownSeparator: ({ className, ...props }: ComponentProps<typeof Separator>) => import("react").JSX.Element;
|
|
257
258
|
/**
|
|
258
|
-
* A keyboard shortcut indicator for dropdown menu items.
|
|
259
|
+
* A keyboard shortcut indicator for dropdown menu items. It locks
|
|
260
|
+
* `translate="no"`, because a translated key name names the wrong key.
|
|
259
261
|
*
|
|
260
262
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenushortcut
|
|
261
263
|
*
|
|
@@ -272,7 +274,7 @@ declare const DropdownSeparator: ({ className, ...props }: ComponentProps<typeof
|
|
|
272
274
|
* </DropdownMenu.Root>
|
|
273
275
|
* ```
|
|
274
276
|
*/
|
|
275
|
-
declare const Shortcut: ({ className, ...props }: ComponentProps<"span">) => import("react").JSX.Element;
|
|
277
|
+
declare const Shortcut: ({ className, ...props }: Omit<ComponentProps<"span">, "translate">) => import("react").JSX.Element;
|
|
276
278
|
/**
|
|
277
279
|
* A menu of options or actions, triggered by a button.
|
|
278
280
|
*
|
|
@@ -577,7 +579,8 @@ declare const DropdownMenu: {
|
|
|
577
579
|
*/
|
|
578
580
|
readonly SubContent: typeof SubContent;
|
|
579
581
|
/**
|
|
580
|
-
*
|
|
582
|
+
* A trigger for a dropdown menu sub-menu. It opens the submenu on hover, or on
|
|
583
|
+
* ArrowRight or Enter.
|
|
581
584
|
*
|
|
582
585
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenusubtrigger
|
|
583
586
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./dropdown-menu-BYapTV0f.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-CGKaq_tV.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{r}from"./layer-container-BTcQpd4K.js";import{n as i}from"./separator-Da8lDnio.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{CheckIcon as s}from"@phosphor-icons/react/Check";import{CaretRightIcon as c}from"@phosphor-icons/react/CaretRight";import*as l from"@radix-ui/react-dropdown-menu";const u=l.Root,d=e=>a(l.Trigger,{"data-slot":`dropdown-menu-trigger`,...e}),f=({className:t,...n})=>a(l.Group,{"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}),p=({container:e,...t})=>{let n=r();return a(l.Portal,{container:e??n,...t})},m={Root:u,CheckboxItem:({className:n,children:r,checked:i,...c})=>o(l.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:i,...c,children:[a(`span`,{className:`absolute right-2 flex items-center`,children:a(l.ItemIndicator,{children:a(t,{svg:a(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}),Content:({className:t,"data-slot":r,onClick:i,loop:o=!0,width:s,...c})=>a(p,{children:a(l.Content,{"data-slot":n(r,`dropdown-menu-content`),className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,s===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:o,onClick:e=>{e.stopPropagation(),i?.(e)},...c})}),Group:f,Item:({className:t,inset:n,...r})=>a(l.Item,{"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}),Label:({className:t,inset:n,...r})=>a(l.Label,{"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}),RadioGroup:({className:t,...n})=>a(l.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}),RadioItem:({className:n,children:r,...i})=>o(l.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),...i,children:[a(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:a(l.ItemIndicator,{children:a(t,{svg:a(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}),Separator:({className:t,...n})=>a(i,{"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...n}),Shortcut:({className:t,...n})=>a(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n,translate:`no`}),Sub:l.Sub,SubContent:({className:t,loop:n=!0,...r})=>a(p,{children:a(l.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,...r})}),SubTrigger:({className:n,inset:r,children:i,...s})=>o(l.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),...s,children:[i,a(`span`,{className:`absolute right-2 flex items-center`,children:a(t,{svg:a(c,{weight:`bold`}),className:`size-4`})})]}),Trigger:d};export{m as t};
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
2
|
-
import "./dropdown-menu-
|
|
1
|
+
import { t as DropdownMenu } from "./dropdown-menu-BYapTV0f.js";
|
|
2
|
+
import "./dropdown-menu-BkPBh_8y.js";
|
|
3
3
|
export { DropdownMenu };
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./dropdown-menu-lxHsgLiw.js";export{e as DropdownMenu};
|
package/dist/empty.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
|
|
3
|
-
import { ComponentProps,
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/components/empty/empty.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The root container for an empty state. Centers content horizontally
|
|
@@ -68,7 +68,7 @@ declare const Icon: ({ className, svg, ...props }: EmptyIconProps) => import("re
|
|
|
68
68
|
* </Empty.Title>
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare const Title: ({ asChild, children, className, ...props }:
|
|
71
|
+
declare const Title: ({ asChild, children, className, ...props }: ComponentProps<"h3"> & WithAsChild) => import("react").JSX.Element;
|
|
72
72
|
/**
|
|
73
73
|
* Supporting descriptive text below the title. Renders as a `div` with
|
|
74
74
|
* `space-y-4` so multiple paragraphs can be placed inside. Use the `asChild`
|
|
@@ -145,8 +145,8 @@ declare const Actions: ({ asChild, children, className, ...props }: ComponentPro
|
|
|
145
145
|
*/
|
|
146
146
|
declare const Empty: {
|
|
147
147
|
/**
|
|
148
|
-
* The root container for an empty state. Centers content
|
|
149
|
-
*
|
|
148
|
+
* The root container for an empty state. Centers content horizontally
|
|
149
|
+
* with consistent vertical padding and max-width.
|
|
150
150
|
*
|
|
151
151
|
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
152
152
|
*
|
package/dist/empty.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-U24NfYv7.js";import{t as n}from"./slot-C3gII_9c.js";import{jsx as r}from"react/jsx-runtime";const i={Root:({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty`,className:e(`mx-auto flex max-w-lg flex-col items-center p-6 text-center`,a),...o,children:i}),Icon:({className:n,svg:i,...a})=>r(t,{"data-slot":`empty-icon`,className:e(`mb-1 size-10 text-neutral-400`,n),svg:i,...a}),Title:({asChild:t,children:i,className:a,...o})=>r(t?n:`h3`,{"data-slot":`empty-title`,className:e(`text-strong text-sm font-medium font-sans`,a),...o,children:i}),Description:({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty-description`,className:e(`text-muted space-y-4 text-sm font-sans`,a),...o,children:i}),Actions:({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty-actions`,className:e(`mt-4 flex items-center gap-2`,a),...o,children:i})};export{i as Empty};
|
package/dist/field.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
2
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-crUf0hbR.js";
|
|
3
3
|
import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./field-7QeiTFwl.js";
|
|
4
|
-
import { t as Label } from "./label-
|
|
4
|
+
import { t as Label } from "./label-Bnfe9YJ6.js";
|
|
5
5
|
import { t as Slot } from "./slot-DdgxmuI5.js";
|
|
6
|
-
import { t as Popover } from "./popover-
|
|
6
|
+
import { t as Popover } from "./popover-s2LhmzfQ.js";
|
|
7
7
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
8
8
|
//#region src/components/field/field-context.d.ts
|
|
9
9
|
/**
|
|
@@ -25,8 +25,8 @@ type FieldControlAriaProps = {
|
|
|
25
25
|
*/
|
|
26
26
|
"aria-invalid"?: ComponentProps<"input">["aria-invalid"];
|
|
27
27
|
/**
|
|
28
|
-
* Stable DOM id for the focusable control
|
|
29
|
-
*
|
|
28
|
+
* Stable DOM id for the focusable control: `Field.Item`'s `id` when set,
|
|
29
|
+
* else an id it generates. `Field.Label` uses it as the default `htmlFor`.
|
|
30
30
|
*/
|
|
31
31
|
id?: string;
|
|
32
32
|
/**
|
|
@@ -96,25 +96,27 @@ declare const FieldSet: ({ className, ref, ...props }: ComponentProps<"fieldset"
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
declare const Legend: ({ className, ref, ...props }: ComponentProps<"legend">) => import("react").JSX.Element;
|
|
99
|
+
/**
|
|
100
|
+
* Props for `Field.Label`: the Mantle `Label` props without `htmlFor`.
|
|
101
|
+
*/
|
|
102
|
+
type FieldLabelProps = Omit<ComponentProps<typeof Label>, "htmlFor">;
|
|
99
103
|
/**
|
|
100
104
|
* Caption for a `Field.Item`. Renders the Mantle `Label` with the same
|
|
101
|
-
*
|
|
102
|
-
* `Field.Item
|
|
103
|
-
*
|
|
104
|
-
* focusable child, and `Field.Label`
|
|
105
|
-
*
|
|
106
|
-
* for the control's form name — no matching `htmlFor` / `id` pair, no separate
|
|
107
|
-
* `useId()` call.
|
|
105
|
+
* click-to-focus, disabled, and typography behavior, and always points its
|
|
106
|
+
* `htmlFor` at the surrounding `Field.Item`'s control id. `Field.Item` owns
|
|
107
|
+
* that id (its `id` prop, else a generated one), `Field.Control` splats it
|
|
108
|
+
* onto the focusable child, and `Field.Label` follows it. `htmlFor` is not a
|
|
109
|
+
* prop here, so a label and its control cannot drift apart.
|
|
108
110
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
111
|
+
* Render the focusable element inside `Field.Control` so the id lands on it.
|
|
112
|
+
* For a checkbox or switch row, wrap the `Field.Control` in the `Field.Label`;
|
|
113
|
+
* the label then also names the control by nesting.
|
|
112
114
|
*
|
|
113
115
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
114
116
|
*
|
|
115
117
|
* @example
|
|
116
118
|
* ```tsx
|
|
117
|
-
* // htmlFor is wired automatically from Field.Item
|
|
119
|
+
* // htmlFor is wired automatically from Field.Item.
|
|
118
120
|
* <Field.Item name="apiKey">
|
|
119
121
|
* <Field.Label>API key</Field.Label>
|
|
120
122
|
* <Field.Control>
|
|
@@ -122,14 +124,26 @@ declare const Legend: ({ className, ref, ...props }: ComponentProps<"legend">) =
|
|
|
122
124
|
* </Field.Control>
|
|
123
125
|
* </Field.Item>
|
|
124
126
|
*
|
|
125
|
-
* //
|
|
126
|
-
* <Field.Item name="
|
|
127
|
-
* <Field.Label
|
|
128
|
-
* <
|
|
127
|
+
* // Field.Item's id names the control; the label follows it.
|
|
128
|
+
* <Field.Item name="password" id="password">
|
|
129
|
+
* <Field.Label>Password</Field.Label>
|
|
130
|
+
* <Field.Control>
|
|
131
|
+
* <PasswordInput />
|
|
132
|
+
* </Field.Control>
|
|
133
|
+
* </Field.Item>
|
|
134
|
+
*
|
|
135
|
+
* // A checkbox row: the label wraps the control.
|
|
136
|
+
* <Field.Item name="terms">
|
|
137
|
+
* <Field.Label className="flex items-center gap-2">
|
|
138
|
+
* <Field.Control>
|
|
139
|
+
* <Checkbox />
|
|
140
|
+
* </Field.Control>
|
|
141
|
+
* Accept terms and conditions
|
|
142
|
+
* </Field.Label>
|
|
129
143
|
* </Field.Item>
|
|
130
144
|
* ```
|
|
131
145
|
*/
|
|
132
|
-
declare const FieldLabel: ({
|
|
146
|
+
declare const FieldLabel: ({ ref, ...props }: FieldLabelProps) => import("react").JSX.Element;
|
|
133
147
|
/**
|
|
134
148
|
* Static, label-styled text for a `Field.Item` row that does **not** caption a
|
|
135
149
|
* focusable form control. Renders a `<p>` (not a `<label>`) with the same
|
|
@@ -374,7 +388,15 @@ declare const Group: ({ asChild, className, ref, ...props }: ComponentProps<"div
|
|
|
374
388
|
/**
|
|
375
389
|
* Props for `Field.Item`.
|
|
376
390
|
*/
|
|
377
|
-
type FieldItemProps = ComponentProps<"div"> & WithAsChild & WithValidation & {
|
|
391
|
+
type FieldItemProps = Omit<ComponentProps<"div">, "id"> & WithAsChild & WithValidation & {
|
|
392
|
+
/**
|
|
393
|
+
* DOM id for the focusable control, not for the wrapping `<div>`.
|
|
394
|
+
* `Field.Control` splats it onto the control and `Field.Label` uses it
|
|
395
|
+
* as the default `htmlFor`. When omitted, `Field.Item` generates a
|
|
396
|
+
* stable id. Set it when a test locator or an anchor link must find the
|
|
397
|
+
* control by id.
|
|
398
|
+
*/
|
|
399
|
+
id?: string;
|
|
378
400
|
/**
|
|
379
401
|
* Form-value name for the field. Required so `Field.Control` can splat
|
|
380
402
|
* it onto the focusable child while `Field.Item` owns the stable
|
|
@@ -395,6 +417,18 @@ type FieldItemProps = ComponentProps<"div"> & WithAsChild & WithValidation & {
|
|
|
395
417
|
* infer an `"error"` validation state unless `validation` is supplied as an
|
|
396
418
|
* explicit override.
|
|
397
419
|
*
|
|
420
|
+
* **Server rendering.** The inference runs on the client, so the inferred
|
|
421
|
+
* `"error"` state applies after hydration. Before that, the server HTML
|
|
422
|
+
* carries the error list but no `aria-invalid="true"`, `aria-errormessage`, or
|
|
423
|
+
* `data-validation="error"`. When an error can render on the server, set
|
|
424
|
+
* `validation={messages.length > 0 && "error"}` on `Field.Item`: an explicit
|
|
425
|
+
* `validation` reaches the server HTML.
|
|
426
|
+
*
|
|
427
|
+
* **Control id.** `Field.Item` owns the control's DOM id, so its `id` prop
|
|
428
|
+
* names the control, not the wrapping `<div>`. It generates one by default;
|
|
429
|
+
* pass `id` to set it yourself, and both `Field.Control` and `Field.Label`
|
|
430
|
+
* follow it. An `id` on the control element itself is overwritten.
|
|
431
|
+
*
|
|
398
432
|
* **Single-slot constraint.** A `Field.Item` owns one description ID and one
|
|
399
433
|
* errors ID, so render at most one `Field.Description` and one
|
|
400
434
|
* `Field.Errors` *or* `Field.ErrorList` (not both) per item. A second instance
|
|
@@ -426,12 +460,13 @@ type FieldItemProps = ComponentProps<"div"> & WithAsChild & WithValidation & {
|
|
|
426
460
|
* </Field.Group>
|
|
427
461
|
* ```
|
|
428
462
|
*/
|
|
429
|
-
declare const Item: ({ asChild, children, className, name, ref, validation: validationProp, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
430
|
-
type FieldControlSlotProps = Omit<ComponentProps<typeof Slot>, "aria-describedby" | "aria-errormessage" | "aria-invalid" | "children">;
|
|
463
|
+
declare const Item: ({ asChild, children, className, id: idProp, name, ref, validation: validationProp, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
464
|
+
type FieldControlSlotProps = Omit<ComponentProps<typeof Slot>, "aria-describedby" | "aria-errormessage" | "aria-invalid" | "children" | "id">;
|
|
431
465
|
/**
|
|
432
466
|
* Element-child form of `Field.Control`. Renders via `Slot`, so it accepts
|
|
433
467
|
* any HTML/Slot props, including `ref` — those land on the single child
|
|
434
|
-
* element along with the generated ARIA props.
|
|
468
|
+
* element along with the generated ARIA props. `id` is not a prop here;
|
|
469
|
+
* `Field.Item` owns the control id.
|
|
435
470
|
*/
|
|
436
471
|
type FieldControlElementProps = FieldControlSlotProps & {
|
|
437
472
|
/**
|
|
@@ -501,8 +536,9 @@ type FieldControlProps = FieldControlElementProps | FieldControlRenderProps;
|
|
|
501
536
|
* `Field.Item` owns the full control contract — `id`, `name`, `aria-*`, and
|
|
502
537
|
* `validation` all flow down from the surrounding `Field.Item` and overwrite
|
|
503
538
|
* anything passed on the child. To override these values, set them on
|
|
504
|
-
* `Field.Item` itself (
|
|
505
|
-
*
|
|
539
|
+
* `Field.Item` itself (`<Field.Item id="password">`,
|
|
540
|
+
* `<Field.Item validation="error">`); to opt out of the contract entirely,
|
|
541
|
+
* render your control without `Field.Control`.
|
|
506
542
|
*
|
|
507
543
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
508
544
|
*
|
|
@@ -622,6 +658,11 @@ type FieldErrorsProps = Omit<ComponentProps<"ul">, "children" | "id"> & {
|
|
|
622
658
|
* `Field.Errors` *or* `Field.ErrorList` per item, not both, and pass multiple
|
|
623
659
|
* messages to one `Field.Errors` instead of rendering it twice.
|
|
624
660
|
*
|
|
661
|
+
* **Server rendering.** The `"error"` state this list infers applies after
|
|
662
|
+
* hydration. The server HTML carries the list but not the invalid state. When
|
|
663
|
+
* the messages can render on the server, set
|
|
664
|
+
* `validation={messages.length > 0 && "error"}` on `Field.Item`.
|
|
665
|
+
*
|
|
625
666
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
626
667
|
*
|
|
627
668
|
* @example
|
|
@@ -663,6 +704,11 @@ declare const FieldErrors: ({ messages, ref, ...props }: FieldErrorsProps) => im
|
|
|
663
704
|
* per item, not both, and put multiple `Field.ErrorItem` children inside the
|
|
664
705
|
* single list instead of rendering two `Field.ErrorList`s.
|
|
665
706
|
*
|
|
707
|
+
* **Server rendering.** The `"error"` state this list infers applies after
|
|
708
|
+
* hydration. The server HTML carries the list but not the invalid state. When
|
|
709
|
+
* the items can render on the server, set
|
|
710
|
+
* `validation={errors.length > 0 && "error"}` on `Field.Item`.
|
|
711
|
+
*
|
|
666
712
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
667
713
|
*
|
|
668
714
|
* @example
|
|
@@ -739,6 +785,9 @@ declare const Field: {
|
|
|
739
785
|
* A single form field. Passes message IDs and validation state to
|
|
740
786
|
* `Field.Control`; rendered errors infer `"error"` validation.
|
|
741
787
|
*
|
|
788
|
+
* The inferred state applies after hydration. For a server-rendered error,
|
|
789
|
+
* set `validation` on `Field.Item`.
|
|
790
|
+
*
|
|
742
791
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
743
792
|
*
|
|
744
793
|
* @example
|
|
@@ -868,19 +917,17 @@ declare const Field: {
|
|
|
868
917
|
*/
|
|
869
918
|
readonly Legend: typeof Legend;
|
|
870
919
|
/**
|
|
871
|
-
* The Mantle `Label`, exposed on `Field` for field composition.
|
|
872
|
-
* `
|
|
873
|
-
* splats onto its focusable child
|
|
874
|
-
*
|
|
875
|
-
*
|
|
876
|
-
* opt out (e.g. when the focusable element is rendered outside of
|
|
877
|
-
* `Field.Control`).
|
|
920
|
+
* The Mantle `Label`, exposed on `Field` for field composition. Its
|
|
921
|
+
* `htmlFor` always points at the surrounding `Field.Item`'s control id, the
|
|
922
|
+
* same id `Field.Control` splats onto its focusable child, so the
|
|
923
|
+
* label-to-control association needs no `htmlFor` / `id` pair by hand.
|
|
924
|
+
* `htmlFor` is not a prop; set `id` on `Field.Item` to choose the id.
|
|
878
925
|
*
|
|
879
926
|
* @see https://mantle.ngrok.com/components/forms/field#fieldlabel
|
|
880
927
|
*
|
|
881
928
|
* @example
|
|
882
929
|
* ```tsx
|
|
883
|
-
* // htmlFor is wired automatically from Field.Item
|
|
930
|
+
* // htmlFor is wired automatically from Field.Item.
|
|
884
931
|
* <Field.Group>
|
|
885
932
|
* <Field.Item name="apiKey">
|
|
886
933
|
* <Field.LabelRow>
|
|
@@ -1108,6 +1155,9 @@ declare const Field: {
|
|
|
1108
1155
|
* filters empty values, and renders a `Field.ErrorList` with one
|
|
1109
1156
|
* `Field.ErrorItem` for each remaining message.
|
|
1110
1157
|
*
|
|
1158
|
+
* The inferred `"error"` state applies after hydration. For a
|
|
1159
|
+
* server-rendered error, set `validation` on `Field.Item`.
|
|
1160
|
+
*
|
|
1111
1161
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
1112
1162
|
*
|
|
1113
1163
|
* @example
|
|
@@ -1137,6 +1187,9 @@ declare const Field: {
|
|
|
1137
1187
|
* Wraps one or more `Field.ErrorItem` children in a semantic `<ul>`.
|
|
1138
1188
|
* Renders nothing when given no renderable children.
|
|
1139
1189
|
*
|
|
1190
|
+
* The inferred `"error"` state applies after hydration. For a
|
|
1191
|
+
* server-rendered error, set `validation` on `Field.Item`.
|
|
1192
|
+
*
|
|
1140
1193
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
1141
1194
|
*
|
|
1142
1195
|
* @example
|
|
@@ -1205,10 +1258,10 @@ type FieldError = {
|
|
|
1205
1258
|
*
|
|
1206
1259
|
* @example
|
|
1207
1260
|
* ```tsx
|
|
1208
|
-
* <Field.Item>
|
|
1209
|
-
* <Field.Label
|
|
1261
|
+
* <Field.Item name={field.name}>
|
|
1262
|
+
* <Field.Label>Email</Field.Label>
|
|
1210
1263
|
* <Field.Control>
|
|
1211
|
-
* <Input
|
|
1264
|
+
* <Input value={field.state.value} />
|
|
1212
1265
|
* </Field.Control>
|
|
1213
1266
|
* <Field.Errors messages={toErrorMessages(field.state.meta.errors)} />
|
|
1214
1267
|
* </Field.Item>
|
package/dist/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./slot-C3gII_9c.js";import{t as r}from"./button-CaM-ZAH5.js";import{i,n as a,r as o,t as s}from"./field-Bpptk_9t.js";import{n as c,r as l,t as u}from"./field-B1wqeZr4.js";import{t as d}from"./label-BqIp6kFx.js";import{t as f}from"./popover-Bp-9B3GR.js";import{Children as p,Fragment as m,cloneElement as h,isValidElement as g,useCallback as _,useContext as v,useId as y,useMemo as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!g(e)){n=!0;return}if(e.type===t){n=E(e.props.children);return}if(e.type===m){n=D({children:e.props.children,errorItemType:t});return}n=!0}}),n},O=({className:e,ref:n,...r})=>C(`fieldset`,{ref:n,"data-slot":`field-set`,className:t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,e),...r}),k=({className:e,ref:n,...r})=>C(`legend`,{ref:n,"data-slot":`field-legend`,className:t(`text-strong mb-1.5 text-sm font-medium font-sans`,e),...r}),A=({ref:e,...t})=>{let n=v(c);return C(d,{ref:e,...t,htmlFor:n?.controlId})},j=({asChild:e,className:r,ref:i,...a})=>C(e?n:`p`,{ref:i,"data-slot":`field-label-text`,className:t(`text-strong text-sm font-medium font-sans`,r),...a}),M=({asChild:e,className:r,ref:i,...a})=>C(e?n:`div`,{ref:i,"data-slot":`field-label-row`,className:t(`flex items-center gap-1`,r),...a}),N=f.Root,P=C(w,{}),F=({appearance:e=`ghost`,className:n,icon:i=P,intent:a=`neutral`,label:o,ref:s,size:c=`xs`,type:l=`button`,...u})=>C(f.Trigger,{asChild:!0,children:C(r,{ref:s,appearance:e,className:t(`text-body -my-0.5`,n),icon:i,intent:a,label:o,size:c,type:l,...u})}),I=({ref:e,...t})=>C(f.Content,{ref:e,"data-slot":`field-help-content`,...t}),L=({asChild:e,children:r,className:i,ref:a,...o})=>C(e?n:`span`,{ref:a,"data-slot":`field-optional`,className:t(`text-muted text-sm font-normal font-sans`,i),...o,children:r??`(Optional)`}),R=({asChild:e,className:r,ref:i,...a})=>C(e?n:`div`,{ref:i,"data-slot":`field-group`,className:t(`flex w-full flex-col gap-4`,r),...a}),z=({asChild:e,children:r,className:a,id:o,name:l,ref:u,validation:d,...f})=>{let p=e?n:`div`,m=y(),h=o??m,g=y(),v=y(),[S,w]=x(!1),T=i(d??(S?`error`:void 0)),E=_(()=>(w(!0),()=>{w(!1)}),[]),D=b(()=>({controlId:h,descriptionId:g,errorId:v,name:l,registerError:E,validation:T}),[h,g,v,l,E,T]);return C(c.Provider,{value:D,children:C(s,{validation:T,children:C(p,{ref:u,"data-slot":`field-item`,"data-validation":T,className:t(`flex w-full flex-col gap-1.5`,a),...f,children:r})})})},B=({children:e,ref:t,...r})=>{let i=v(c),a=l({context:i});return typeof e==`function`?C(s,{validation:a.validation,children:C(u.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(S(g(e),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),C(s,{validation:a.validation,children:C(u.Provider,{value:i?a.ariaProps:null,children:C(n,{ref:t,...r,children:h(e,a.ariaProps)})})}))},V=({asChild:e,className:r,ref:i,...a})=>{let o=e?n:`p`,s=v(c);return C(o,{ref:i,"data-slot":`field-description`,id:s?.descriptionId,className:t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...a})},H=({children:e,className:n,ref:r,...i})=>E(e)?C(`li`,{ref:r,"data-slot":`field-error`,className:t(`text-danger-600 text-sm leading-4`,n),...i,children:e}):null,U=({messages:e,ref:t,...n})=>C(W,{ref:t,...n,children:T(e).map(e=>C(H,{children:e},e))}),W=({asChild:r,children:i,className:a,ref:o,...s})=>{let l=D({children:i,errorItemType:H}),u=v(c),d=u?.registerError;return e(()=>{if(l&&d!=null)return d()},[l,d]),l?C(r?n:`ul`,{ref:o,"data-slot":`field-error-list`,id:u?.errorId,role:`list`,className:t(`m-0 flex w-full flex-col list-none p-0`,a),...s,children:i}):null},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H},K=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,a as isAriaInvalid,o as parseValidation,i as resolveValidation,K as toErrorMessages};
|