@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
package/dist/alert.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
3
|
-
import "./index-
|
|
4
|
-
import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-
|
|
5
|
-
import { ComponentProps,
|
|
3
|
+
import "./index-DA4ig3gj.js";
|
|
4
|
+
import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-C1AfGnQx.js";
|
|
5
|
+
import { ComponentProps, ReactNode } from "react";
|
|
6
6
|
//#region src/components/alert/alert.d.ts
|
|
7
7
|
declare const intents: readonly ["danger", "important", "info", "success", "warning"];
|
|
8
8
|
type AlertIntent = (typeof intents)[number];
|
|
@@ -23,13 +23,133 @@ type AlertProps = ComponentProps<"div"> & {
|
|
|
23
23
|
*/
|
|
24
24
|
appearance?: Appearance;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Displays a callout for user attention. Root container for all Alert sub-components.
|
|
28
|
+
*
|
|
29
|
+
* @see https://mantle.ngrok.com/components/feedback/alert#alertroot
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Alert intent="info">
|
|
34
|
+
* <AlertIcon />
|
|
35
|
+
* <AlertContent>
|
|
36
|
+
* <AlertTitle>Alert Title</AlertTitle>
|
|
37
|
+
* <AlertDismissIconButton />
|
|
38
|
+
* <AlertDescription>
|
|
39
|
+
* Alert description text.
|
|
40
|
+
* </AlertDescription>
|
|
41
|
+
* </AlertContent>
|
|
42
|
+
* </Alert>
|
|
43
|
+
*```
|
|
44
|
+
*/
|
|
45
|
+
declare const Root: {
|
|
46
|
+
({ appearance, className, intent, ref, ...props }: AlertProps): import("react").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
26
49
|
type AlertIconProps = Omit<SvgAttributes, "children"> & {
|
|
27
50
|
/**
|
|
28
51
|
* An optional icon that renders in place of the default icon for the Alert intent.
|
|
29
52
|
*/
|
|
30
53
|
svg?: ReactNode;
|
|
31
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* An optional icon that visually represents the intent of the Alert.
|
|
57
|
+
*
|
|
58
|
+
* The default rendered icon be overridden with a custom icon using the `svg` prop.
|
|
59
|
+
*
|
|
60
|
+
* @see https://mantle.ngrok.com/components/feedback/alert#alerticon
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <Alert intent="info">
|
|
65
|
+
* <AlertIcon />
|
|
66
|
+
* <AlertContent>
|
|
67
|
+
* <AlertTitle>Alert Title</AlertTitle>
|
|
68
|
+
* <AlertDismissIconButton />
|
|
69
|
+
* <AlertDescription>
|
|
70
|
+
* Alert description text.
|
|
71
|
+
* </AlertDescription>
|
|
72
|
+
* </AlertContent>
|
|
73
|
+
* </Alert>
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare const Icon: {
|
|
77
|
+
({ className, ref, svg, ...props }: AlertIconProps): import("react").JSX.Element;
|
|
78
|
+
displayName: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The container for the content slot of an alert. Place the title and description as direct children.
|
|
82
|
+
*
|
|
83
|
+
* @see https://mantle.ngrok.com/components/feedback/alert#alertcontent
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <Alert intent="info">
|
|
88
|
+
* <AlertIcon />
|
|
89
|
+
* <AlertContent>
|
|
90
|
+
* <AlertTitle>Alert Title</AlertTitle>
|
|
91
|
+
* <AlertDismissIconButton />
|
|
92
|
+
* <AlertDescription>
|
|
93
|
+
* Alert description text.
|
|
94
|
+
* </AlertDescription>
|
|
95
|
+
* </AlertContent>
|
|
96
|
+
* </Alert>
|
|
97
|
+
*```
|
|
98
|
+
*/
|
|
99
|
+
declare const Content: {
|
|
100
|
+
({ className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
101
|
+
displayName: string;
|
|
102
|
+
};
|
|
103
|
+
type AlertTitleProps = ComponentProps<"h5"> & WithAsChild;
|
|
104
|
+
/**
|
|
105
|
+
* The title of an alert. Default renders as an h5 element, use asChild to render something else.
|
|
106
|
+
*
|
|
107
|
+
* @see https://mantle.ngrok.com/components/feedback/alert#alerttitle
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```tsx
|
|
111
|
+
* <Alert intent="info">
|
|
112
|
+
* <AlertIcon />
|
|
113
|
+
* <AlertContent>
|
|
114
|
+
* <AlertTitle>Alert Title</AlertTitle>
|
|
115
|
+
* <AlertDismissIconButton />
|
|
116
|
+
* <AlertDescription>
|
|
117
|
+
* Alert description text.
|
|
118
|
+
* </AlertDescription>
|
|
119
|
+
* </AlertContent>
|
|
120
|
+
* </Alert>
|
|
121
|
+
*```
|
|
122
|
+
*/
|
|
123
|
+
declare const Title: {
|
|
124
|
+
({ asChild, className, ref, ...props }: AlertTitleProps): import("react").JSX.Element;
|
|
125
|
+
displayName: string;
|
|
126
|
+
};
|
|
32
127
|
type AlertDescriptionProps = ComponentProps<"div"> & WithAsChild;
|
|
128
|
+
/**
|
|
129
|
+
* The optional description of an alert.
|
|
130
|
+
* Renders as a `div` by default, but can be changed to any other element using
|
|
131
|
+
* the `asChild` prop.
|
|
132
|
+
*
|
|
133
|
+
* @see https://mantle.ngrok.com/components/feedback/alert#alertdescription
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <Alert intent="info">
|
|
138
|
+
* <AlertIcon />
|
|
139
|
+
* <AlertContent>
|
|
140
|
+
* <AlertTitle>Alert Title</AlertTitle>
|
|
141
|
+
* <AlertDismissIconButton />
|
|
142
|
+
* <AlertDescription>
|
|
143
|
+
* Alert description text.
|
|
144
|
+
* </AlertDescription>
|
|
145
|
+
* </AlertContent>
|
|
146
|
+
* </Alert>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare const Description: {
|
|
150
|
+
({ asChild, className, ref, ...props }: AlertDescriptionProps): import("react").JSX.Element;
|
|
151
|
+
displayName: string;
|
|
152
|
+
};
|
|
33
153
|
type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
|
|
34
154
|
/**
|
|
35
155
|
* The visual style of the dismiss button. Optional here —
|
|
@@ -95,7 +215,7 @@ declare const Alert: {
|
|
|
95
215
|
* </Alert.Root>
|
|
96
216
|
* ```
|
|
97
217
|
*/
|
|
98
|
-
readonly Root:
|
|
218
|
+
readonly Root: typeof Root;
|
|
99
219
|
/**
|
|
100
220
|
* The container for the content slot of an alert.
|
|
101
221
|
*
|
|
@@ -112,7 +232,7 @@ declare const Alert: {
|
|
|
112
232
|
* </Alert.Root>
|
|
113
233
|
* ```
|
|
114
234
|
*/
|
|
115
|
-
readonly Content:
|
|
235
|
+
readonly Content: typeof Content;
|
|
116
236
|
/**
|
|
117
237
|
* The optional description of an alert.
|
|
118
238
|
*
|
|
@@ -129,7 +249,7 @@ declare const Alert: {
|
|
|
129
249
|
* </Alert.Root>
|
|
130
250
|
* ```
|
|
131
251
|
*/
|
|
132
|
-
readonly Description:
|
|
252
|
+
readonly Description: typeof Description;
|
|
133
253
|
/**
|
|
134
254
|
* An optional dismiss button that can be used to close the alert.
|
|
135
255
|
*
|
|
@@ -164,7 +284,7 @@ declare const Alert: {
|
|
|
164
284
|
* </Alert.Root>
|
|
165
285
|
* ```
|
|
166
286
|
*/
|
|
167
|
-
readonly Icon:
|
|
287
|
+
readonly Icon: typeof Icon;
|
|
168
288
|
/**
|
|
169
289
|
* The title of an alert.
|
|
170
290
|
*
|
|
@@ -181,7 +301,7 @@ declare const Alert: {
|
|
|
181
301
|
* </Alert.Root>
|
|
182
302
|
* ```
|
|
183
303
|
*/
|
|
184
|
-
readonly Title:
|
|
304
|
+
readonly Title: typeof Title;
|
|
185
305
|
};
|
|
186
306
|
//#endregion
|
|
187
307
|
export { Alert };
|
package/dist/alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-d-nMCfAI.js";import{t as n}from"./slot-CDk0Bb9z.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./icon-button-DiOhreJD.js";import{createContext as a,useContext as o,useMemo as s}from"react";import c from"tiny-invariant";import{jsx as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{MegaphoneIcon as f}from"@phosphor-icons/react/Megaphone";import{WarningIcon as p}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as m}from"@phosphor-icons/react/WarningDiamond";import{XIcon as h}from"@phosphor-icons/react/X";import{cva as g}from"class-variance-authority";const _=a(null),v=l(h,{});function y(){let e=o(_);return c(e,`useAlertContext hook used outside of Alert parent!`),e}const b=g(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),x=({appearance:t=`default`,className:n,intent:r,ref:i,...a})=>{let o=s(()=>({intent:r}),[r]);return l(_.Provider,{value:o,children:l(`div`,{ref:i,"data-slot":`alert`,className:e(b({appearance:t,intent:r}),n),...a})})};x.displayName=`Alert`;const S={danger:l(p,{}),important:l(f,{mirrored:!0}),info:l(d,{}),success:l(u,{}),warning:l(m,{})},C=({className:n,ref:r,svg:i,...a})=>{let o=y(),s=S[o.intent];return l(t,{ref:r,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:i??s,...a})};C.displayName=`AlertIcon`;const w=({className:t,ref:n,...r})=>l(`div`,{ref:n,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...r});w.displayName=`AlertContent`;const T=({asChild:t=!1,className:r,ref:i,...a})=>l(t?n:`h5`,{ref:i,"data-slot":`alert-title`,className:e(`font-medium`,r),...a});T.displayName=`AlertTitle`;const E=({asChild:t=!1,className:r,ref:i,...a})=>l(t?n:`div`,{ref:i,"data-slot":`alert-description`,className:e(`text-sm`,r),...a});E.displayName=`AlertDescription`;const D=e=>`var(--color-${e}-700)`,O=e=>`var(--color-${e}-800)`,k=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,A=({size:t=`sm`,type:n=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=v,style:u,...d})=>{let f=y();return l(i,{appearance:o,icon:c,intent:`neutral`,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:n,style:r({...u,"--alert-dismiss-icon-color":D(f.intent),"--alert-dismiss-icon-hover-color":O(f.intent),"--alert-dismiss-hover-bg":k(f.intent)}),...d})};A.displayName=`AlertDismissIconButton`;const j={Root:x,Content:w,Description:E,DismissIconButton:A,Icon:C,Title:T};export{j as Alert};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CGgMKpJg.js";import{t as n}from"./slot-CDk0Bb9z.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),d=({asChild:e,children:d,className:p,rel:m,icon:h,iconPlacement:g=`start`,ref:_,...v})=>{let y=f(m),b={"data-slot":`anchor`,className:u(p),ref:_,rel:y,...v};if(e){let e=r.only(d);o(a(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{...b,children:i(e,{},l(s,{children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),u,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return l(`a`,{...b,children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]})};function f(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{u as n,f as r,d as t};
|
package/dist/anchor.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
//#region src/components/anchor/types.d.ts
|
|
4
4
|
/**
|
|
@@ -95,7 +95,7 @@ type AnchorProps = Omit<ComponentProps<"a">, "rel"> & WithAsChild & {
|
|
|
95
95
|
* </Anchor>
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
|
-
declare const Anchor:
|
|
98
|
+
declare const Anchor: ({ asChild, children, className, rel: propRel, icon, iconPlacement, ref, ...props }: AnchorProps) => import("react").JSX.Element;
|
|
99
99
|
/**
|
|
100
100
|
* Resolves the `rel` attribute to a string.
|
|
101
101
|
*
|
package/dist/anchor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./anchor-
|
|
1
|
+
import{n as e,r as t,t as n}from"./anchor-_2meGDfj.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/types/as-child.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Utility type for adding the optional `asChild` boolean prop to a component.
|
|
5
|
+
*/
|
|
6
|
+
type WithAsChild = {
|
|
7
|
+
/**
|
|
8
|
+
* Use the `asChild` prop to compose component functionality onto alternative
|
|
9
|
+
* element types or your own React components.
|
|
10
|
+
*
|
|
11
|
+
* When `asChild` is set to `true`, mantle will not render a default DOM
|
|
12
|
+
* element, instead cloning the part's child and passing it the props and
|
|
13
|
+
* behavior required to make it functional.
|
|
14
|
+
*
|
|
15
|
+
* `asChild` can be used as deeply as you need to. This means it is a great way
|
|
16
|
+
* to compose multiple primitive's behavior together.
|
|
17
|
+
*
|
|
18
|
+
* @see https://www.radix-ui.com/docs/primitives/guides/composition#composition
|
|
19
|
+
*/
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Utility type for adding the optional `asChild` boolean prop to a component
|
|
24
|
+
* that is self-closing.
|
|
25
|
+
* This is useful for components that do not have children, but still need to
|
|
26
|
+
* support the `asChild` prop.
|
|
27
|
+
*/
|
|
28
|
+
type SelfClosingWithAsChild = {
|
|
29
|
+
/**
|
|
30
|
+
* Use the `asChild` prop to compose component functionality onto alternative
|
|
31
|
+
* element types or your own React components.
|
|
32
|
+
*
|
|
33
|
+
* When `asChild` is set to `true`, mantle will not render a default DOM
|
|
34
|
+
* element, instead cloning the part's child and passing it the props and
|
|
35
|
+
* behavior required to make it functional.
|
|
36
|
+
*
|
|
37
|
+
* `asChild` can be used as deeply as you need to. This means it is a great way
|
|
38
|
+
* to compose multiple primitive's behavior together.
|
|
39
|
+
*
|
|
40
|
+
* @see https://www.radix-ui.com/docs/primitives/guides/composition#composition
|
|
41
|
+
*/
|
|
42
|
+
asChild: true;
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
} | {
|
|
45
|
+
asChild?: false | undefined;
|
|
46
|
+
children?: undefined;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { WithAsChild as n, SelfClosingWithAsChild as t };
|
package/dist/badge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as Color } from "./index-DorCusfG.js";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/components/badge/badge.d.ts
|
|
@@ -18,9 +18,48 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
|
|
|
18
18
|
*/
|
|
19
19
|
appearance: Appearance;
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
/**
|
|
22
|
+
* A non-interactive label used to highlight short, scannable information —
|
|
23
|
+
* a status, a category tag, or a count — in the smallest possible footprint.
|
|
24
|
+
*
|
|
25
|
+
* **When to use**
|
|
26
|
+
* - Status indicators: `Succeeded`, `Failed`, `Pending`, `Beta`.
|
|
27
|
+
* - Category or tag chips alongside list items, table rows, or cards.
|
|
28
|
+
* - Counts (e.g. `12 new`) when paired with brief context.
|
|
29
|
+
*
|
|
30
|
+
* **When not to use**
|
|
31
|
+
* - For interactive UI. Badges are not buttons or links — use {@link https://mantle.ngrok.com/components/actions/button Button}
|
|
32
|
+
* or {@link https://mantle.ngrok.com/components/navigation/anchor Anchor} (optionally with `asChild` styling) instead.
|
|
33
|
+
* - For long-form text. Keep labels to one or two short words.
|
|
34
|
+
* - As the sole signal of meaning. Pair color with a label or icon so the
|
|
35
|
+
* distinction works without color (color blindness, monochrome themes).
|
|
36
|
+
*
|
|
37
|
+
* **Choosing a `color`.** Prefer functional colors (`success`, `warning`,
|
|
38
|
+
* `danger`, `info`, `accent`, `neutral`) for status meaning so theming
|
|
39
|
+
* stays coherent. Reach for named hues only when the badge's semantic role
|
|
40
|
+
* isn't already covered.
|
|
41
|
+
*
|
|
42
|
+
* **Polymorphism.** Pass `asChild` to render the badge as a single child
|
|
43
|
+
* element — useful when the badge wraps a link or other semantic element
|
|
44
|
+
* while keeping the badge styling.
|
|
45
|
+
*
|
|
46
|
+
* @see https://mantle.ngrok.com/components/data-display/badge
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import { Badge } from "@ngrok/mantle/badge";
|
|
51
|
+
* import { CheckCircleIcon } from "@phosphor-icons/react/CheckCircle";
|
|
52
|
+
*
|
|
53
|
+
* <Badge appearance="muted" color="success" icon={<CheckCircleIcon />}>
|
|
54
|
+
* Succeeded
|
|
55
|
+
* </Badge>
|
|
56
|
+
*
|
|
57
|
+
* // Polymorphic — render the badge as a link, preserving its styling.
|
|
58
|
+
* <Badge appearance="muted" color="info" asChild>
|
|
59
|
+
* <a href="/status">Operational</a>
|
|
60
|
+
* </Badge>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const Badge: ({ appearance, asChild, children, className, color, icon, ...props }: BadgeProps) => import("react").JSX.Element;
|
|
25
64
|
//#endregion
|
|
26
65
|
export { Badge, type BadgeProps };
|
package/dist/badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-d-nMCfAI.js";import{t as n}from"./slot-CDk0Bb9z.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=({appearance:u,asChild:d=!1,children:p,className:h,color:g=`neutral`,icon:_,...v})=>{let y=f(g,u),b=m(g,u),x=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,_&&`ps-1`,y,b,h);if(d){let e=r.only(p);o(a(e),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{"data-slot":`badge`,className:x,...v,children:i(e,{},l(s,{children:[_&&c(t,{className:`size-4`,svg:_}),u]}))})}return l(`span`,{"data-slot":`badge`,className:x,...v,children:[_&&c(t,{className:`size-4`,svg:_}),p]})},d={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function f(e,t){switch(t){case`muted`:return d[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}const p={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function m(e,t){switch(t){case`muted`:return p[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}export{u as Badge};
|
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -1,7 +1,213 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/components/breadcrumb/breadcrumb.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The breadcrumb landmark. Renders a `<nav>` with a default
|
|
7
|
+
* `aria-label="Breadcrumb"` per the WAI-ARIA breadcrumb pattern — pass your
|
|
8
|
+
* own `aria-label` to override it (e.g. for localization or when a page has
|
|
9
|
+
* multiple breadcrumb trails). Carries no visual styling of its own.
|
|
10
|
+
*
|
|
11
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Breadcrumb.Root>
|
|
16
|
+
* <Breadcrumb.List>
|
|
17
|
+
* <Breadcrumb.Item>
|
|
18
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
19
|
+
* </Breadcrumb.Item>
|
|
20
|
+
* <Breadcrumb.Separator />
|
|
21
|
+
* <Breadcrumb.Item>
|
|
22
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
23
|
+
* </Breadcrumb.Item>
|
|
24
|
+
* <Breadcrumb.Separator />
|
|
25
|
+
* <Breadcrumb.Item>
|
|
26
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
27
|
+
* </Breadcrumb.Item>
|
|
28
|
+
* </Breadcrumb.List>
|
|
29
|
+
* </Breadcrumb.Root>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const Root: {
|
|
33
|
+
({ asChild, children, "data-slot": dataSlot, ref, ...props }: ComponentProps<"nav"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The ordered list of crumbs. Renders an `<ol>` — an **ordered** list, because
|
|
38
|
+
* the order of the items is the hierarchy, from the root to the current page.
|
|
39
|
+
* Lays crumbs out inline with wrapping and muted, small text.
|
|
40
|
+
*
|
|
41
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <Breadcrumb.Root>
|
|
46
|
+
* <Breadcrumb.List>
|
|
47
|
+
* <Breadcrumb.Item>
|
|
48
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
49
|
+
* </Breadcrumb.Item>
|
|
50
|
+
* <Breadcrumb.Separator />
|
|
51
|
+
* <Breadcrumb.Item>
|
|
52
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
53
|
+
* </Breadcrumb.Item>
|
|
54
|
+
* <Breadcrumb.Separator />
|
|
55
|
+
* <Breadcrumb.Item>
|
|
56
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
57
|
+
* </Breadcrumb.Item>
|
|
58
|
+
* </Breadcrumb.List>
|
|
59
|
+
* </Breadcrumb.Root>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const List: {
|
|
63
|
+
({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"ol"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* A single crumb. Renders an `<li>` (`role="listitem"`) that lays out its
|
|
68
|
+
* content — a `Breadcrumb.Link` or `Breadcrumb.Page` — inline.
|
|
69
|
+
*
|
|
70
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <Breadcrumb.Root>
|
|
75
|
+
* <Breadcrumb.List>
|
|
76
|
+
* <Breadcrumb.Item>
|
|
77
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
78
|
+
* </Breadcrumb.Item>
|
|
79
|
+
* <Breadcrumb.Separator />
|
|
80
|
+
* <Breadcrumb.Item>
|
|
81
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
82
|
+
* </Breadcrumb.Item>
|
|
83
|
+
* <Breadcrumb.Separator />
|
|
84
|
+
* <Breadcrumb.Item>
|
|
85
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
86
|
+
* </Breadcrumb.Item>
|
|
87
|
+
* </Breadcrumb.List>
|
|
88
|
+
* </Breadcrumb.Root>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const Item: {
|
|
92
|
+
({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"li"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
93
|
+
displayName: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* A link to an ancestor page in the hierarchy. Renders an `<a>` by default;
|
|
97
|
+
* the component is router-agnostic — use `asChild` to compose the styling
|
|
98
|
+
* onto your app router's link (e.g. react-router's `<Link>`) so client-side
|
|
99
|
+
* navigation kicks in.
|
|
100
|
+
*
|
|
101
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```tsx
|
|
105
|
+
* <Breadcrumb.Root>
|
|
106
|
+
* <Breadcrumb.List>
|
|
107
|
+
* <Breadcrumb.Item>
|
|
108
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
109
|
+
* </Breadcrumb.Item>
|
|
110
|
+
* <Breadcrumb.Separator />
|
|
111
|
+
* <Breadcrumb.Item>
|
|
112
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
113
|
+
* </Breadcrumb.Item>
|
|
114
|
+
* <Breadcrumb.Separator />
|
|
115
|
+
* <Breadcrumb.Item>
|
|
116
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
117
|
+
* </Breadcrumb.Item>
|
|
118
|
+
* </Breadcrumb.List>
|
|
119
|
+
* </Breadcrumb.Root>
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* <Breadcrumb.Link asChild>
|
|
125
|
+
* <Link to={href("/endpoints")}>Endpoints</Link>
|
|
126
|
+
* </Breadcrumb.Link>
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare const Link: {
|
|
130
|
+
({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"a"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
131
|
+
displayName: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* The current page — the last crumb in the trail. Renders a `<span>` (not a
|
|
135
|
+
* link; the user is already here) with `aria-current="page"`. The ARIA is the
|
|
136
|
+
* part's whole contract, so `aria-current` is always emitted and is not
|
|
137
|
+
* overridable via props.
|
|
138
|
+
*
|
|
139
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```tsx
|
|
143
|
+
* <Breadcrumb.Root>
|
|
144
|
+
* <Breadcrumb.List>
|
|
145
|
+
* <Breadcrumb.Item>
|
|
146
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
147
|
+
* </Breadcrumb.Item>
|
|
148
|
+
* <Breadcrumb.Separator />
|
|
149
|
+
* <Breadcrumb.Item>
|
|
150
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
151
|
+
* </Breadcrumb.Item>
|
|
152
|
+
* <Breadcrumb.Separator />
|
|
153
|
+
* <Breadcrumb.Item>
|
|
154
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
155
|
+
* </Breadcrumb.Item>
|
|
156
|
+
* </Breadcrumb.List>
|
|
157
|
+
* </Breadcrumb.Root>
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
declare const Page: {
|
|
161
|
+
({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"span"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
162
|
+
displayName: string;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* The props for `Breadcrumb.Separator`. When `asChild` is set, `children` is
|
|
166
|
+
* required: the child element is what gets rendered, so an `asChild` separator
|
|
167
|
+
* without children would clone the default caret icon into the list — invalid
|
|
168
|
+
* `<ol>` content. The union makes that misuse a compile error.
|
|
169
|
+
*/
|
|
170
|
+
type BreadcrumbSeparatorProps = Omit<ComponentProps<"li">, "children"> & ({
|
|
171
|
+
asChild: true;
|
|
172
|
+
children: ReactNode;
|
|
173
|
+
} | {
|
|
174
|
+
asChild?: false | undefined;
|
|
175
|
+
children?: ReactNode;
|
|
176
|
+
});
|
|
177
|
+
/**
|
|
178
|
+
* A purely visual divider between crumbs, hidden from assistive technology.
|
|
179
|
+
* Renders an `<li>` with `role="presentation"` and `aria-hidden="true"` — a
|
|
180
|
+
* listitem sibling of `Breadcrumb.Item` elements per the APG breadcrumb
|
|
181
|
+
* pattern, so it never counts as a crumb. Children default to a size-3.5
|
|
182
|
+
* caret icon (`<Icon svg={<CaretRightIcon />} className="size-3.5" />`); pass
|
|
183
|
+
* your own children (e.g. a slash) to replace it. With `asChild`, children
|
|
184
|
+
* are required — the child element is what renders.
|
|
185
|
+
*
|
|
186
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <Breadcrumb.Root>
|
|
191
|
+
* <Breadcrumb.List>
|
|
192
|
+
* <Breadcrumb.Item>
|
|
193
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
194
|
+
* </Breadcrumb.Item>
|
|
195
|
+
* <Breadcrumb.Separator />
|
|
196
|
+
* <Breadcrumb.Item>
|
|
197
|
+
* <Breadcrumb.Link href="/endpoints">Endpoints</Breadcrumb.Link>
|
|
198
|
+
* </Breadcrumb.Item>
|
|
199
|
+
* <Breadcrumb.Separator />
|
|
200
|
+
* <Breadcrumb.Item>
|
|
201
|
+
* <Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>
|
|
202
|
+
* </Breadcrumb.Item>
|
|
203
|
+
* </Breadcrumb.List>
|
|
204
|
+
* </Breadcrumb.Root>
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
declare const Separator: {
|
|
208
|
+
({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: BreadcrumbSeparatorProps & WithDataSlot): import("react").JSX.Element;
|
|
209
|
+
displayName: string;
|
|
210
|
+
};
|
|
5
211
|
/**
|
|
6
212
|
* Compound component for WAI-ARIA breadcrumb navigation — the path from a
|
|
7
213
|
* root to the current page as an ordered list of links inside a labeled
|
|
@@ -68,7 +274,7 @@ declare const Breadcrumb: {
|
|
|
68
274
|
* </Breadcrumb.Root>
|
|
69
275
|
* ```
|
|
70
276
|
*/
|
|
71
|
-
readonly Root:
|
|
277
|
+
readonly Root: typeof Root;
|
|
72
278
|
/**
|
|
73
279
|
* The ordered list of crumbs. Renders an `<ol>` — the order of the items
|
|
74
280
|
* is the hierarchy, from the root to the current page.
|
|
@@ -94,7 +300,7 @@ declare const Breadcrumb: {
|
|
|
94
300
|
* </Breadcrumb.Root>
|
|
95
301
|
* ```
|
|
96
302
|
*/
|
|
97
|
-
readonly List:
|
|
303
|
+
readonly List: typeof List;
|
|
98
304
|
/**
|
|
99
305
|
* A single crumb. Renders an `<li>` containing a `Breadcrumb.Link` or
|
|
100
306
|
* `Breadcrumb.Page`.
|
|
@@ -120,7 +326,7 @@ declare const Breadcrumb: {
|
|
|
120
326
|
* </Breadcrumb.Root>
|
|
121
327
|
* ```
|
|
122
328
|
*/
|
|
123
|
-
readonly Item:
|
|
329
|
+
readonly Item: typeof Item;
|
|
124
330
|
/**
|
|
125
331
|
* A link to an ancestor page. Renders an `<a>` by default; use `asChild`
|
|
126
332
|
* to compose onto your app router's link (e.g. react-router's `<Link>`).
|
|
@@ -146,7 +352,7 @@ declare const Breadcrumb: {
|
|
|
146
352
|
* </Breadcrumb.Root>
|
|
147
353
|
* ```
|
|
148
354
|
*/
|
|
149
|
-
readonly Link:
|
|
355
|
+
readonly Link: typeof Link;
|
|
150
356
|
/**
|
|
151
357
|
* The current page — the last crumb. Renders a `<span>` (not a link) with
|
|
152
358
|
* `aria-current="page"`; the ARIA is the part's whole contract and is not
|
|
@@ -173,7 +379,7 @@ declare const Breadcrumb: {
|
|
|
173
379
|
* </Breadcrumb.Root>
|
|
174
380
|
* ```
|
|
175
381
|
*/
|
|
176
|
-
readonly Page:
|
|
382
|
+
readonly Page: typeof Page;
|
|
177
383
|
/**
|
|
178
384
|
* A purely visual divider between crumbs, hidden from assistive
|
|
179
385
|
* technology (`role="presentation"` + `aria-hidden`). Children default to
|
|
@@ -200,13 +406,7 @@ declare const Breadcrumb: {
|
|
|
200
406
|
* </Breadcrumb.Root>
|
|
201
407
|
* ```
|
|
202
408
|
*/
|
|
203
|
-
readonly Separator:
|
|
204
|
-
asChild: true;
|
|
205
|
-
children: ReactNode;
|
|
206
|
-
} & WithDataSlot, "ref"> | Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "children"> & {
|
|
207
|
-
asChild?: false | undefined;
|
|
208
|
-
children?: ReactNode;
|
|
209
|
-
} & WithDataSlot, "ref">) & import("react").RefAttributes<HTMLLIElement>>;
|
|
409
|
+
readonly Separator: typeof Separator;
|
|
210
410
|
};
|
|
211
411
|
//#endregion
|
|
212
412
|
export { Breadcrumb };
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CGgMKpJg.js";import{n,t as r}from"./slot-CDk0Bb9z.js";import{cloneElement as i,isValidElement as a}from"react";import{jsx as o}from"react/jsx-runtime";import{CaretRightIcon as s}from"@phosphor-icons/react/CaretRight";const c=({asChild:e,children:t,"data-slot":i,ref:a,...s})=>o(e?r:`nav`,{ref:a,"data-slot":n(i,`breadcrumb`),"aria-label":`Breadcrumb`,...s,children:t});c.displayName=`Breadcrumb`;const l=({asChild:t,children:i,className:a,"data-slot":s,ref:c,...l})=>o(t?r:`ol`,{ref:c,"data-slot":n(s,`breadcrumb-list`),className:e(`text-muted flex flex-wrap items-center gap-1.5 text-sm`,a),...l,children:i});l.displayName=`BreadcrumbList`;const u=({asChild:t,children:i,className:a,"data-slot":s,ref:c,...l})=>o(t?r:`li`,{ref:c,"data-slot":n(s,`breadcrumb-item`),className:e(`inline-flex items-center gap-1.5`,a),...l,children:i});u.displayName=`BreadcrumbItem`;const d=({asChild:t,children:i,className:a,"data-slot":s,ref:c,...l})=>o(t?r:`a`,{ref:c,"data-slot":n(s,`breadcrumb-link`),className:e(`hover:text-strong transition-colors`,a),...l,children:i});d.displayName=`BreadcrumbLink`;const f=({asChild:t,children:s,className:c,"data-slot":l,ref:u,...d})=>{let f=t?r:`span`,p=t&&a(s)?i(s,{"aria-current":`page`}):s;return o(f,{ref:u,"data-slot":n(l,`breadcrumb-page`),className:e(`text-strong`,c),...d,"aria-current":`page`,children:p})};f.displayName=`BreadcrumbPage`;const p=({asChild:e,children:c,className:l,"data-slot":u,ref:d,...f})=>{let p=e?r:`li`,m=e&&a(c)?i(c,{role:`presentation`,"aria-hidden":`true`}):c??o(t,{svg:o(s,{}),className:`size-3.5`});return o(p,{ref:d,"data-slot":n(u,`breadcrumb-separator`),className:l,...f,role:`presentation`,"aria-hidden":`true`,children:m})};p.displayName=`BreadcrumbSeparator`;const m={Root:c,List:l,Item:u,Link:d,Page:f,Separator:p};export{m as Breadcrumb};
|