@ngrok/mantle 0.82.1 → 0.83.1
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 +7 -7
- package/dist/agent.json +3 -1
- package/dist/{alert-BWwNPOMI.d.ts → alert-B1HXfkYn.d.ts} +9 -7
- package/dist/{alert-vwFd7qdp.js → alert-BuG2qS5l.js} +1 -1
- package/dist/alert-center.d.ts +3 -3
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +18 -18
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +2 -2
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +67 -19
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +319 -0
- package/dist/avatar.js +1 -0
- package/dist/bar-chart.d.ts +73 -20
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +50 -17
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +3 -3
- package/dist/{button-C-gMbPso.d.ts → button-BIf69CSV.d.ts} +2 -2
- package/dist/button-BLDjW1u9.js +1 -0
- package/dist/{button-IlxHhjPK.js → button-CCkGqE1t.js} +1 -1
- package/dist/{button-C7vAl6lS.d.ts → button-DJ7AAgII.d.ts} +4 -6
- package/dist/{button-DARFK2KJ.d.ts → button-PoIujPMX.d.ts} +2 -2
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +15 -15
- package/dist/{chart-1cVjAcj8.d.ts → chart-0zcFJh4n.d.ts} +75 -22
- package/dist/chart-DBxT9BNl.js +2 -0
- package/dist/{choice-BNRQXszu.d.ts → choice-CVdQrs-m.d.ts} +118 -6
- package/dist/choice.d.ts +1 -1
- package/dist/{code-block-C9uaM9-V.js → code-block-CIE0F2fu.js} +1 -1
- package/dist/{code-block-B6OlZrSI.d.ts → code-block-CZWPrV4k.d.ts} +3 -3
- package/dist/code-block.d.ts +10 -7
- package/dist/code-block.js +2 -2
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/combobox.d.ts +8 -9
- package/dist/command.d.ts +668 -106
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +6 -6
- package/dist/data-table.js +1 -1
- package/dist/dialog-32Hq6w6P.js +1 -0
- package/dist/dialog-B6h1BCDL.d.ts +895 -0
- package/dist/dialog.d.ts +2 -805
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BcALUQMp.d.ts +1 -0
- package/dist/{dropdown-menu-D6pMAY7I.d.ts → dropdown-menu-DZOfj6HB.d.ts} +1 -1
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/field.d.ts +5 -5
- package/dist/field.js +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +16 -17
- package/dist/hooks.js +1 -1
- package/dist/icons-DEVx1oP9.js +1 -0
- package/dist/icons.d.ts +7 -6
- package/dist/icons.js +1 -1
- package/dist/{in-view-DDEGUKDR.d.ts → in-view-gxyc9Q1_.d.ts} +1 -1
- package/dist/{input-BuYDU6CF.d.ts → input-DpnC3Xgj.d.ts} +2 -2
- package/dist/input.d.ts +1 -1
- package/dist/kbd.d.ts +1 -1
- package/dist/line-chart.d.ts +60 -13
- package/dist/line-chart.js +1 -1
- package/dist/list-CwL23L_B.js +1 -0
- package/dist/list.d.ts +2 -2
- package/dist/list.js +1 -1
- package/dist/llms.txt +3 -1
- package/dist/mantle-dark-high-contrast.css +30 -17
- package/dist/mantle-dark.css +48 -13
- package/dist/mantle-light-high-contrast.css +33 -15
- package/dist/mantle.css +436 -26
- package/dist/media-object.d.ts +5 -1
- package/dist/multi-select.d.ts +7 -7
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +4 -4
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +2 -2
- package/dist/pagination.js +1 -1
- package/dist/progress.d.ts +4 -4
- package/dist/qr-code.d.ts +2 -2
- package/dist/sandbar.d.ts +471 -0
- package/dist/sandbar.js +1 -0
- package/dist/sandboxed-on-click.d.ts +4 -6
- package/dist/scatter-plot.d.ts +69 -24
- package/dist/scatter-plot.js +1 -1
- package/dist/{select-0z7HVS6r.d.ts → select-DVHmgih8.d.ts} +13 -7
- package/dist/select-LK9NX-vV.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +4 -4
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-B5UmkVRL.d.ts → separator-CNDs98Dv.d.ts} +2 -2
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-BxvTfPLM.js → sheet-BOSknSN9.js} +1 -1
- package/dist/sheet.d.ts +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +347 -366
- package/dist/sidebar.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/split-button.d.ts +12 -12
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +2 -1
- package/dist/{table-CGxJwtbL.js → table-C_Nm_RSV.js} +1 -1
- package/dist/{table-CZBYEmyK.d.ts → table-D51ZtV4U.d.ts} +18 -8
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +8 -13
- package/dist/tabs.js +1 -1
- package/dist/{theme-FbfjYiD3.d.ts → theme-6OxNhf6l.d.ts} +6 -6
- package/dist/theme-CVfq037P.js +1 -0
- package/dist/theme-switcher.d.ts +3 -3
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +86 -23
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +9 -9
- package/dist/toast.js +1 -1
- package/dist/{tooltip-mrpLz4DZ.d.ts → tooltip-DuXGxIse.d.ts} +6 -4
- package/dist/tooltip.d.ts +1 -1
- package/dist/use-breakpoint-Dqu12Szq.js +1 -0
- package/dist/use-callback-ref-IYti9y7x.js +1 -0
- package/dist/use-is-apple-platform-Cxwrb86L.js +1 -0
- package/dist/use-matches-media-query-Bd_GhhVd.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +5 -3
- package/dist/button-DvHMWAPl.js +0 -1
- package/dist/chart-B3pAvmkk.js +0 -2
- package/dist/dialog-DozL6n-F.js +0 -1
- package/dist/dropdown-menu-BbbQuae2.d.ts +0 -1
- package/dist/icons-Bb_zF2OV.js +0 -1
- package/dist/list-CJABVHwi.js +0 -1
- package/dist/platform-BVD3gpKD.js +0 -1
- package/dist/select-BReznXaw.js +0 -1
- package/dist/theme-BorfgnNh.js +0 -1
- package/dist/use-breakpoint-Wd7_5-Mu.js +0 -1
- package/dist/use-matches-media-query-CMSxHR9n.js +0 -1
package/dist/avatar.d.ts
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
+
import { ComponentProps, ReactEventHandler, ReactNode } from "react";
|
|
4
|
+
//#region src/components/avatar/avatar.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The shape an `Avatar.Root` renders as. Circles read as people, rounded
|
|
7
|
+
* squares as the things people belong to — accounts, workspaces, teams,
|
|
8
|
+
* organizations. Keeping the two shapes visually distinct is the point: a
|
|
9
|
+
* switcher row showing both at once stays legible without labels.
|
|
10
|
+
*
|
|
11
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
16
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
17
|
+
* </Avatar.Root>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
type AvatarAppearance = "circle" | "square";
|
|
21
|
+
/**
|
|
22
|
+
* The props for `Avatar.Root`. A `<span>`'s props — so `className`, `style`,
|
|
23
|
+
* `ref`, `asChild`, and any `data-*` or `aria-*` reach the rendered element —
|
|
24
|
+
* plus the shape and swatch this root owns.
|
|
25
|
+
*/
|
|
26
|
+
type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
|
|
27
|
+
/**
|
|
28
|
+
* The shape to render. `"circle"` for a person, `"square"` for a rounded
|
|
29
|
+
* square representing an account, workspace, or team.
|
|
30
|
+
*
|
|
31
|
+
* @default "circle"
|
|
32
|
+
*/
|
|
33
|
+
appearance?: AvatarAppearance;
|
|
34
|
+
/**
|
|
35
|
+
* A stable identifier — an account id, a user id — that deterministically
|
|
36
|
+
* selects a background swatch, so the same subject always gets the same
|
|
37
|
+
* color with nothing persisted. Omit it for a neutral surface, or set your
|
|
38
|
+
* own `bg-*` class through `className` to opt out entirely.
|
|
39
|
+
*
|
|
40
|
+
* Seed it with an **id, not a display name**: names get edited, and a
|
|
41
|
+
* rename would silently recolor the avatar.
|
|
42
|
+
*/
|
|
43
|
+
colorSeed?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A small image representing a person or an account, with a text or icon
|
|
47
|
+
* fallback for when there is no picture — or before one loads.
|
|
48
|
+
*
|
|
49
|
+
* The root sizes and shapes the avatar and paints the surface behind it. It is
|
|
50
|
+
* `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
|
|
51
|
+
* flex rows it usually sits in (a switcher row, a table cell, a comment header)
|
|
52
|
+
* must not be able to squeeze it. Override the size with `className`, which
|
|
53
|
+
* merges last and wins.
|
|
54
|
+
*
|
|
55
|
+
* It renders a `<span>`, not a `<div>`, so it stays valid inside the `<button>`
|
|
56
|
+
* of a switcher row.
|
|
57
|
+
*
|
|
58
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarroot
|
|
59
|
+
*
|
|
60
|
+
* **Data attributes:**
|
|
61
|
+
*
|
|
62
|
+
* | Data Attribute | Value | Description |
|
|
63
|
+
* | -------------- | ---------- | ------------------------------------------------------- |
|
|
64
|
+
* | `data-slot` | `"avatar"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
69
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
70
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
71
|
+
* </Avatar.Root>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare const Root: ({ appearance, asChild, className, colorSeed, "data-slot": dataSlot, ...props }: AvatarRootProps) => import("react").JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* The props for `Avatar.Image`. An `<img>`'s props — so `srcSet`, `sizes`,
|
|
77
|
+
* `loading`, `referrerPolicy`, `crossOrigin`, `className`, `style`, `ref`,
|
|
78
|
+
* `asChild`, and any `data-*` reach the element — with `alt` promoted to
|
|
79
|
+
* required.
|
|
80
|
+
*/
|
|
81
|
+
type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsChild & WithDataSlot & {
|
|
82
|
+
/**
|
|
83
|
+
* The image's alternative text. **Required**, deliberately stricter than the
|
|
84
|
+
* `<img>` element: an avatar is the one image a developer reliably forgets,
|
|
85
|
+
* and an `<img>` with no `alt` announces its URL.
|
|
86
|
+
*
|
|
87
|
+
* Pass `alt=""` when adjacent text already names the subject — the common
|
|
88
|
+
* case, and the reason this is not just "always pass the name". Pass the name
|
|
89
|
+
* when the avatar stands alone, and name `Avatar.Root` as well (`role="img"`
|
|
90
|
+
* + `aria-label`) so the label survives the states where the image is gone.
|
|
91
|
+
*/
|
|
92
|
+
alt: string;
|
|
93
|
+
/**
|
|
94
|
+
* Called when the image fails to load, **before** it unmounts itself.
|
|
95
|
+
* `preventDefault()` keeps it mounted, for a consumer who would rather retry
|
|
96
|
+
* a URL than fall back.
|
|
97
|
+
*
|
|
98
|
+
* Typed against `HTMLElement` rather than `HTMLImageElement`, because
|
|
99
|
+
* `asChild` means the element that failed may be a consumer's own.
|
|
100
|
+
*/
|
|
101
|
+
onError?: ReactEventHandler<HTMLElement>;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* The avatar's picture, layered over `Avatar.Fallback` so the fallback shows
|
|
105
|
+
* through until the image paints. It is a plain `<img>` in the markup, which is
|
|
106
|
+
* the whole point: the server renders it, the browser starts fetching while it
|
|
107
|
+
* parses the HTML, and a cached image is *there* on the first frame — no
|
|
108
|
+
* hydration, no swap, no flash of initials.
|
|
109
|
+
*
|
|
110
|
+
* A failed load unmounts the image and leaves the fallback showing. That covers
|
|
111
|
+
* every failure the client can observe; one it cannot is a load that fails
|
|
112
|
+
* *before* hydration, where the error event has already come and gone. There the
|
|
113
|
+
* browser's own rendering stands, which for `alt=""` is nothing at all — the
|
|
114
|
+
* fallback shows through — and is one more reason to prefer `alt=""`
|
|
115
|
+
* whenever adjacent text names the subject.
|
|
116
|
+
*
|
|
117
|
+
* `onError` runs first and can `preventDefault()` to keep the image mounted, for
|
|
118
|
+
* a consumer who would rather retry a URL than fall back. Changing `src` is
|
|
119
|
+
* always a fresh attempt: only the exact URL that failed stays unmounted.
|
|
120
|
+
*
|
|
121
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarimage
|
|
122
|
+
*
|
|
123
|
+
* **Data attributes:**
|
|
124
|
+
*
|
|
125
|
+
* | Data Attribute | Value | Description |
|
|
126
|
+
* | -------------- | ---------------- | ------------------------------------------------------- |
|
|
127
|
+
* | `data-slot` | `"avatar-image"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
132
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
133
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
134
|
+
* </Avatar.Root>
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
declare const Image: ({ asChild, className, "data-slot": dataSlot, onError, src, ...props }: AvatarImageProps) => import("react").JSX.Element | null;
|
|
138
|
+
/**
|
|
139
|
+
* The props for `Avatar.Fallback`. A `<span>`'s props, with the content stated
|
|
140
|
+
* exactly one way: either `children` you render yourself, or a `name` this part
|
|
141
|
+
* derives initials from. Passing both would leave the winner to precedence, so
|
|
142
|
+
* the type forbids it — and `asChild`, which needs a real element to clone,
|
|
143
|
+
* belongs to the `children` side only.
|
|
144
|
+
*/
|
|
145
|
+
type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSlot & ({
|
|
146
|
+
/**
|
|
147
|
+
* Render this element instead of the fallback's own `<span>`. Only
|
|
148
|
+
* available beside `children` — there has to be an element to clone.
|
|
149
|
+
*/
|
|
150
|
+
asChild?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* What to show when there is no image: initials, an icon, anything.
|
|
153
|
+
* When the content is only the subject's initials, use `name` instead.
|
|
154
|
+
*/
|
|
155
|
+
children: ReactNode;
|
|
156
|
+
name?: never;
|
|
157
|
+
} | {
|
|
158
|
+
asChild?: never;
|
|
159
|
+
children?: never;
|
|
160
|
+
/**
|
|
161
|
+
* The subject's display name, rendered as at most two uppercase
|
|
162
|
+
* initials — `"Acme Corp"` becomes `"AC"`, a name with no usable
|
|
163
|
+
* characters becomes `"?"`. Deriving it here keeps one implementation
|
|
164
|
+
* of a surprisingly fiddly rule (punctuation, code points, and casing
|
|
165
|
+
* that has to match between server and client).
|
|
166
|
+
*
|
|
167
|
+
* Initials derived this way are `aria-hidden`: they abbreviate a name
|
|
168
|
+
* the page already carries in text beside the avatar. When the avatar
|
|
169
|
+
* is the only thing naming its subject, name it — `role="img"` plus
|
|
170
|
+
* `aria-label` on `Avatar.Root` — rather than announcing `"AC"`.
|
|
171
|
+
*/
|
|
172
|
+
name: string;
|
|
173
|
+
});
|
|
174
|
+
/**
|
|
175
|
+
* What the avatar shows when there is no picture — initials, an icon, a
|
|
176
|
+
* monogram. It always renders, sitting *behind* `Avatar.Image`: that is what
|
|
177
|
+
* makes a loading image show initials instead of an empty box, with no loading
|
|
178
|
+
* state for anyone to handle. A loaded image covers it, so give a transparent
|
|
179
|
+
* PNG its own backdrop if you would rather not see initials through it.
|
|
180
|
+
*
|
|
181
|
+
* Pass `name` to render the subject's initials, or `children` for anything else.
|
|
182
|
+
* A fallback is decorative when adjacent text already names the subject, so
|
|
183
|
+
* unless the avatar is the only label, give an icon child `aria-hidden`.
|
|
184
|
+
*
|
|
185
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarfallback
|
|
186
|
+
*
|
|
187
|
+
* **Data attributes:**
|
|
188
|
+
*
|
|
189
|
+
* | Data Attribute | Value | Description |
|
|
190
|
+
* | -------------- | ------------------- | ------------------------------------------------------- |
|
|
191
|
+
* | `data-slot` | `"avatar-fallback"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```tsx
|
|
195
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
196
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
197
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
198
|
+
* </Avatar.Root>
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot, name, ...props }: AvatarFallbackProps) => import("react").JSX.Element;
|
|
202
|
+
/**
|
|
203
|
+
* A small image representing a person or an account, with a text or icon
|
|
204
|
+
* fallback for when there is no picture — or before one loads.
|
|
205
|
+
*
|
|
206
|
+
* `appearance` carries the meaning: `"circle"` for a person, `"square"` (a
|
|
207
|
+
* rounded square) for an account, workspace, team, or organization. A row that
|
|
208
|
+
* shows both — an account switcher with the signed-in user's photo beside it —
|
|
209
|
+
* stays readable without labels because the shapes differ.
|
|
210
|
+
*
|
|
211
|
+
* `colorSeed` gives a subject a stable color derived from its id, so the same
|
|
212
|
+
* account is the same color on every device with nothing stored. Omit it for a
|
|
213
|
+
* neutral surface.
|
|
214
|
+
*
|
|
215
|
+
* The picture is a plain `<img>` layered over the fallback, so the server
|
|
216
|
+
* renders it and a cached image is on screen in the first frame. There is no
|
|
217
|
+
* loading state to handle: the fallback is behind, and shows until the
|
|
218
|
+
* image paints.
|
|
219
|
+
*
|
|
220
|
+
* For a person's name and title beside their avatar, compose it with
|
|
221
|
+
* [MediaObject](https://mantle.ngrok.com/components/structure/media-object).
|
|
222
|
+
* For the leading visual of a sidebar switcher row, put it inside
|
|
223
|
+
* [Sidebar.SwitcherTrigger](https://mantle.ngrok.com/components/navigation/sidebar#sidebarswitchertrigger).
|
|
224
|
+
*
|
|
225
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* Composition:
|
|
229
|
+
* ```
|
|
230
|
+
* Avatar.Root
|
|
231
|
+
* ├── Avatar.Image
|
|
232
|
+
* └── Avatar.Fallback
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```tsx
|
|
237
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
238
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
239
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
240
|
+
* </Avatar.Root>
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
declare const Avatar: {
|
|
244
|
+
/**
|
|
245
|
+
* A small image representing a person or an account, with a text or icon
|
|
246
|
+
* fallback for when there is no picture — or before one loads.
|
|
247
|
+
*
|
|
248
|
+
* The root sizes and shapes the avatar and paints the surface behind it. It is
|
|
249
|
+
* `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
|
|
250
|
+
* flex rows it usually sits in must not be able to squeeze it. Override the
|
|
251
|
+
* size with `className`, which merges last and wins. It renders a `<span>`, so
|
|
252
|
+
* it stays valid inside the `<button>` of a switcher row.
|
|
253
|
+
*
|
|
254
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarroot
|
|
255
|
+
*
|
|
256
|
+
* **Data attributes:**
|
|
257
|
+
*
|
|
258
|
+
* | Data Attribute | Value | Description |
|
|
259
|
+
* | -------------- | ---------- | ------------------------------------------------------- |
|
|
260
|
+
* | `data-slot` | `"avatar"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```tsx
|
|
264
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
265
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
266
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
267
|
+
* </Avatar.Root>
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
readonly Root: typeof Root;
|
|
271
|
+
/**
|
|
272
|
+
* The avatar's picture, layered over `Avatar.Fallback` so the fallback shows
|
|
273
|
+
* through until the image paints. A plain `<img>` in the markup: the server
|
|
274
|
+
* renders it, and a cached image needs no hydration to appear. A failed load
|
|
275
|
+
* unmounts it and leaves the fallback showing.
|
|
276
|
+
*
|
|
277
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarimage
|
|
278
|
+
*
|
|
279
|
+
* **Data attributes:**
|
|
280
|
+
*
|
|
281
|
+
* | Data Attribute | Value | Description |
|
|
282
|
+
* | -------------- | ---------------- | ------------------------------------------------------- |
|
|
283
|
+
* | `data-slot` | `"avatar-image"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```tsx
|
|
287
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
288
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
289
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
290
|
+
* </Avatar.Root>
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
readonly Image: typeof Image;
|
|
294
|
+
/**
|
|
295
|
+
* What the avatar shows when there is no picture — initials, an icon, a
|
|
296
|
+
* monogram. It always renders, behind `Avatar.Image`, which is what makes a
|
|
297
|
+
* loading image show initials rather than an empty box. Pass `name` to render
|
|
298
|
+
* the subject's initials, or `children` for anything else.
|
|
299
|
+
*
|
|
300
|
+
* @see https://mantle.ngrok.com/components/data-display/avatar#avatarfallback
|
|
301
|
+
*
|
|
302
|
+
* **Data attributes:**
|
|
303
|
+
*
|
|
304
|
+
* | Data Attribute | Value | Description |
|
|
305
|
+
* | -------------- | ------------------- | ------------------------------------------------------- |
|
|
306
|
+
* | `data-slot` | `"avatar-fallback"` | Styling and test-targeting hook, with any forwarded chain ahead of it. |
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```tsx
|
|
310
|
+
* <Avatar.Root appearance="square" colorSeed="acc_123">
|
|
311
|
+
* <Avatar.Image src="https://example.com/acme.png" alt="" />
|
|
312
|
+
* <Avatar.Fallback name="Acme Corp" />
|
|
313
|
+
* </Avatar.Root>
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
readonly Fallback: typeof Fallback;
|
|
317
|
+
};
|
|
318
|
+
//#endregion
|
|
319
|
+
export { Avatar, type AvatarAppearance, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps };
|
package/dist/avatar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{useState as r}from"react";import{jsx as i}from"react/jsx-runtime";const a={circle:`rounded-full`,square:`rounded-md`},o=[`bg-emerald-500`,`bg-gray-500`,`bg-red-500`,`bg-violet-500`,`bg-cyan-500`,`bg-rose-500`,`bg-purple-500`,`bg-fuchsia-500`,`bg-green-500`,`bg-orange-500`,`bg-indigo-500`,`bg-teal-500`,`bg-yellow-500`,`bg-sky-500`,`bg-pink-500`,`bg-blue-500`,`bg-amber-500`];function s(e){let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return t>>>0}function c(e){let t=s(e)%o.length;return o[t]??`bg-neutral-500`}function l(e){return e.replace(/[\p{P}`~!@#$%^&*+|=<>]/gu,``).trim().split(/\s+/).slice(0,2).map(e=>Array.from(e.toUpperCase())[0]??``).join(``)||`?`}const u={Root:({appearance:r=`circle`,asChild:o,className:s,colorSeed:l,"data-slot":u,...d})=>i(o?n:`span`,{className:e(`text-body bg-neutral-500/15 relative flex size-7 shrink-0 items-center justify-center overflow-hidden text-xs font-medium select-none`,a[r],l!=null&&[`text-static-white`,c(l)],s),"data-slot":t(u,`avatar`),...d}),Image:({asChild:a,className:o,"data-slot":s,onError:c,src:l,...u})=>{let[d,f]=r();return l==null||l===``||l===d?null:i(a?n:`img`,{className:e(`absolute inset-0 size-full object-cover`,o),"data-slot":t(s,`avatar-image`),onError:e=>{c?.(e),e.defaultPrevented||f(l)},src:l,...u})},Fallback:({asChild:r,children:a,className:o,"data-slot":s,name:c,...u})=>i(r?n:`span`,{"aria-hidden":c!=null||void 0,className:e(`flex size-full items-center justify-center`,o),"data-slot":t(s,`avatar-fallback`),...u,children:c==null?a:l(c)})};export{u as Avatar};
|
package/dist/bar-chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as LegendPrimitiveProps, c as XAxisPrimitiveProps, d as BarTexture, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, u as BarOrientation, v as SeriesColor } from "./chart-0zcFJh4n.js";
|
|
2
2
|
//#region src/components/bar-chart/bar-chart.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Props for {@link BarChart.Root}. Bars encode value by length from a shared
|
|
@@ -18,7 +18,8 @@ type BarChartRootProps<TDatum extends ChartDatum = ChartDatum> = Omit<ChartRootB
|
|
|
18
18
|
* categories along the x axis; `"horizontal"` bars run rightward from a
|
|
19
19
|
* left baseline with categories down the y axis — better for long category
|
|
20
20
|
* labels or many categories. The value axis, baseline, reference lines, and
|
|
21
|
-
* `"perpendicular"`
|
|
21
|
+
* the two rung textures (`"perpendicular"` and `"parallel"`) all flip to
|
|
22
|
+
* match.
|
|
22
23
|
*/
|
|
23
24
|
orientation?: BarOrientation;
|
|
24
25
|
};
|
|
@@ -31,25 +32,49 @@ type BarChartBarProps = {
|
|
|
31
32
|
/** Display name for the legend, tooltip, and data table. Defaults to `dataKey`. */
|
|
32
33
|
label?: string;
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* A fixed visual identity slot. Slots `1` through `8` select a chart color.
|
|
36
|
+
* `"other"` selects the shared neutral treatment.
|
|
37
|
+
*
|
|
38
|
+
* Series receive unreserved slots in composition order. Set `seriesSlot` to
|
|
39
|
+
* give a series a fixed visual identity. Several series may share one slot;
|
|
40
|
+
* use distinct textures to tell those bars apart.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <BarChart.Bar dataKey="errors" seriesSlot={4} />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
seriesSlot?: ChartSeriesSlot;
|
|
48
|
+
/**
|
|
49
|
+
* Override the color channel with a chart token or any CSS color. This does
|
|
50
|
+
* not change the series slot. When omitted, the series paints the color from
|
|
51
|
+
* its slot.
|
|
52
|
+
*
|
|
53
|
+
* A static color (raw hex) cannot follow the four themes, so prefer a
|
|
54
|
+
* `var(--your-token)` declared per theme. A series that carries good/bad
|
|
55
|
+
* meaning should wear the semantic status colors, never a categorical slot.
|
|
40
56
|
*/
|
|
41
57
|
color?: SeriesColor;
|
|
42
58
|
/**
|
|
43
59
|
* The fill texture the series wears, on canvas and on its legend key:
|
|
44
60
|
* `"solid"` (default), diagonal hatch lines at 45° (`"hatch"`), the 135°
|
|
45
61
|
* mirror (`"hatch-reverse"`), both (`"crosshatch"`), rungs perpendicular
|
|
46
|
-
* to the bar's length (`"perpendicular"`
|
|
47
|
-
* (`"
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
62
|
+
* to the bar's length (`"perpendicular"` — horizontal lines on vertical
|
|
63
|
+
* bars), rungs parallel to it (`"parallel"` — vertical lines on vertical
|
|
64
|
+
* bars), the orthogonal lattice of both rung directions (`"grid"`), or an
|
|
65
|
+
* offset dot field (`"dots"`).
|
|
66
|
+
*
|
|
67
|
+
* The two rung textures flip with the Root's `orientation`, in opposite
|
|
68
|
+
* senses. Every other value is direction-free, `"grid"` included — it is the
|
|
69
|
+
* orthogonal lattice against `"crosshatch"`'s diagonal one. Eight values
|
|
70
|
+
* match the palette's eight series slots.
|
|
71
|
+
*
|
|
72
|
+
* Texture is a redundant identity encoding alongside color — tone-on-tone
|
|
73
|
+
* ink from the series' own fill — so grouped and stacked series stay
|
|
74
|
+
* distinguishable without color vision, in grayscale print, and under
|
|
75
|
+
* forced colors. Keep it opt-in and purposeful, never decorative: leave the
|
|
76
|
+
* first series solid and texture the rest, or texture only the series in a
|
|
77
|
+
* pair that color alone cannot separate.
|
|
53
78
|
*/
|
|
54
79
|
texture?: BarTexture;
|
|
55
80
|
};
|
|
@@ -89,6 +114,12 @@ type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
89
114
|
* table, Enter/Space + click activation). Compose the chrome and series parts
|
|
90
115
|
* as children.
|
|
91
116
|
*
|
|
117
|
+
* The Root's own subtree is addressable by slot: `bar-chart` on the wrapper,
|
|
118
|
+
* then `bar-chart-plot`, `bar-chart-canvas`, `bar-chart-crosshair`,
|
|
119
|
+
* `bar-chart-hover-band`, `bar-chart-markers`, `bar-chart-tooltip`, and
|
|
120
|
+
* `bar-chart-data-table`. A bar chart shows the band and never the crosshair
|
|
121
|
+
* or the markers, but all three layers mount on every kind.
|
|
122
|
+
*
|
|
92
123
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartroot
|
|
93
124
|
*
|
|
94
125
|
* @example
|
|
@@ -113,8 +144,9 @@ declare const Root: <TDatum extends ChartDatum = ChartDatum>(props: BarChartRoot
|
|
|
113
144
|
/**
|
|
114
145
|
* One bar series. Renders nothing itself — it registers the series with the
|
|
115
146
|
* chart, which paints it on canvas. Compose one `Bar` per series; with
|
|
116
|
-
* `stacked` on the Root, bars stack
|
|
117
|
-
* `
|
|
147
|
+
* `stacked` on the Root, bars stack from the baseline up in registration
|
|
148
|
+
* order, so a `Bar` that mounts later stacks on top whatever its position in
|
|
149
|
+
* the JSX. `texture` adds a pattern fill as a redundant identity encoding
|
|
118
150
|
* alongside color, worn by the bars and the series' legend key alike.
|
|
119
151
|
*
|
|
120
152
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartbar
|
|
@@ -212,9 +244,9 @@ declare const YAxis: (props: BarChartYAxisProps) => null;
|
|
|
212
244
|
declare const ReferenceLine: (props: BarChartReferenceLineProps) => null;
|
|
213
245
|
/**
|
|
214
246
|
* Customizes the hover/keyboard tooltip readout. The tooltip itself is part
|
|
215
|
-
* of `BarChart.Root`'s interaction contract and renders
|
|
216
|
-
*
|
|
217
|
-
*
|
|
247
|
+
* of `BarChart.Root`'s interaction contract and renders even when this part is
|
|
248
|
+
* absent — compose it to format the label or values, append a footer, or
|
|
249
|
+
* replace the content entirely via the render-prop `children`.
|
|
218
250
|
*
|
|
219
251
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barcharttooltip
|
|
220
252
|
*
|
|
@@ -237,6 +269,13 @@ declare const Tooltip: (props: BarChartTooltipProps) => null;
|
|
|
237
269
|
* must never rely on color-matching alone. It renders nothing for a single
|
|
238
270
|
* series (the chart's title already names it).
|
|
239
271
|
*
|
|
272
|
+
* **Data attributes:**
|
|
273
|
+
*
|
|
274
|
+
* | Data Attribute | Value | Description |
|
|
275
|
+
* | --- | --- | --- |
|
|
276
|
+
* | `data-slot` | `"bar-chart-legend"` | The legend list. `BarChart.Legend` renders it in flow below the plot. |
|
|
277
|
+
* | `data-texture` | `"solid"` \| `"hatch"` \| `"hatch-reverse"` \| `"crosshatch"` \| `"perpendicular"` \| `"parallel"` \| `"grid"` \| `"dots"` | On each series' swatch, naming the `texture` its `BarChart.Bar` registered. The swatch paints the pattern itself, so target this only to restyle a key. |
|
|
278
|
+
*
|
|
240
279
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartlegend
|
|
241
280
|
*
|
|
242
281
|
* @example
|
|
@@ -281,6 +320,20 @@ declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JS
|
|
|
281
320
|
* per-category tooltip, keyboard stepping, aria-live announcements, and an
|
|
282
321
|
* sr-only data table — ships with `Root` unconditionally.
|
|
283
322
|
*
|
|
323
|
+
* **CSS variables (public API):**
|
|
324
|
+
*
|
|
325
|
+
* | CSS Variable | Default | Description |
|
|
326
|
+
* | --- | --- | --- |
|
|
327
|
+
* | `--color-chart-1` … `--color-chart-8` | per theme | The validated categorical series slots, in assignment order. |
|
|
328
|
+
* | `--color-chart-other` | `--color-neutral-500` | The neutral overflow slot a series wears once every slot is held. |
|
|
329
|
+
*
|
|
330
|
+
* Two ways to change a series color, both public API. The `color` prop on
|
|
331
|
+
* `BarChart.Bar` sets one series and takes any CSS color. To restyle a slot
|
|
332
|
+
* itself, redeclare its token on `Root` —
|
|
333
|
+
* `className="[--color-chart-1:var(--color-brand)]"`. The engine resolves every
|
|
334
|
+
* token through a probe inside `Root`, so a declaration scoped there wins for
|
|
335
|
+
* that chart and leaves every other chart on the page alone.
|
|
336
|
+
*
|
|
284
337
|
* @see https://mantle.ngrok.com/components/charts/bar-chart
|
|
285
338
|
*
|
|
286
339
|
* @example
|
package/dist/bar-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,...e}),Bar:e=>a(`BarChart.Bar`,`bar`,e),Grid:e=>n(`BarChart.Grid`,e),XAxis:e=>t(`BarChart.XAxis`,e),YAxis:e=>r(`BarChart.YAxis`,e),ReferenceLine:t=>e(`BarChart.ReferenceLine`,t),Tooltip:e=>s(`BarChart.Tooltip`,e),Legend:e=>l(i,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),CopyButton:e=>l(c,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...e})};export{u as BarChart};
|
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -6,9 +6,12 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
6
6
|
* The breadcrumb landmark. Renders a `<nav>` with a default
|
|
7
7
|
* `aria-label="Breadcrumb"` per the WAI-ARIA breadcrumb pattern — pass your
|
|
8
8
|
* own `aria-label` to override it (e.g. for localization or when a page has
|
|
9
|
-
* multiple breadcrumb trails). Carries no visual styling
|
|
9
|
+
* multiple breadcrumb trails). Carries no visual styling. Its one layout class
|
|
10
|
+
* is `min-w-0`: inside a flex row such as `AppLayout.Header` the landmark must
|
|
11
|
+
* shrink below the trail's width, or `Breadcrumb.List` never scrolls and the
|
|
12
|
+
* crumbs push their siblings out of the row.
|
|
10
13
|
*
|
|
11
|
-
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
14
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbroot
|
|
12
15
|
*
|
|
13
16
|
* @example
|
|
14
17
|
* ```tsx
|
|
@@ -29,13 +32,30 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
29
32
|
* </Breadcrumb.Root>
|
|
30
33
|
* ```
|
|
31
34
|
*/
|
|
32
|
-
declare const Root: ({ asChild, children, "data-slot": dataSlot, ref, ...props }: ComponentProps<"nav"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
35
|
+
declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"nav"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
33
36
|
/**
|
|
34
37
|
* The ordered list of crumbs. Renders an `<ol>` — an **ordered** list, because
|
|
35
38
|
* the order of the items is the hierarchy, from the root to the current page.
|
|
36
|
-
* Lays crumbs out
|
|
39
|
+
* Lays the crumbs out in one row of muted, small text.
|
|
37
40
|
*
|
|
38
|
-
*
|
|
41
|
+
* A trail wider than its container scrolls sideways instead of wrapping to a
|
|
42
|
+
* second row, which a one-row app header has no space for. Its edges carry the
|
|
43
|
+
* same `scroll-fade-x` mask as `Tabs.List`: an edge with crumbs beyond it fades
|
|
44
|
+
* out, and an edge with nothing beyond it stays flush.
|
|
45
|
+
*
|
|
46
|
+
* The trail keeps its end in view, because the end is the current page. It
|
|
47
|
+
* scrolls itself there whenever that end moves — on mount, when a navigation
|
|
48
|
+
* swaps the crumbs, and when the row around it resizes — and leaves the reader's
|
|
49
|
+
* own scroll position alone the rest of the time, including while a crumb holds
|
|
50
|
+
* focus. Tabbing to a crumb the trail has scrolled past is the browser's own
|
|
51
|
+
* job, and `scroll-padding` the width of the fade zone is what lands that crumb
|
|
52
|
+
* clear of the fade rather than under it.
|
|
53
|
+
*
|
|
54
|
+
* To wrap instead, pass `className="flex-wrap overflow-x-visible"`. The mask
|
|
55
|
+
* needs a scrollport to animate against, so without one it renders fully
|
|
56
|
+
* opaque and the row wraps as it did before.
|
|
57
|
+
*
|
|
58
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumblist
|
|
39
59
|
*
|
|
40
60
|
* @example
|
|
41
61
|
* ```tsx
|
|
@@ -61,7 +81,11 @@ declare const List: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
61
81
|
* A single crumb. Renders an `<li>` (`role="listitem"`) that lays out its
|
|
62
82
|
* content — a `Breadcrumb.Link` or `Breadcrumb.Page` — inline.
|
|
63
83
|
*
|
|
64
|
-
*
|
|
84
|
+
* The crumb never shrinks (`shrink-0`). A squeezed crumb would break its own
|
|
85
|
+
* label across two lines, so a trail too wide for its container scrolls in
|
|
86
|
+
* `Breadcrumb.List` instead.
|
|
87
|
+
*
|
|
88
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbitem
|
|
65
89
|
*
|
|
66
90
|
* @example
|
|
67
91
|
* ```tsx
|
|
@@ -168,7 +192,10 @@ type BreadcrumbSeparatorProps = Omit<ComponentProps<"li">, "children"> & ({
|
|
|
168
192
|
* your own children (e.g. a slash) to replace it. With `asChild`, children
|
|
169
193
|
* are required — the child element is what renders.
|
|
170
194
|
*
|
|
171
|
-
*
|
|
195
|
+
* Like `Breadcrumb.Item`, the divider never shrinks (`shrink-0`), so a trail
|
|
196
|
+
* too wide for its container scrolls in `Breadcrumb.List` instead.
|
|
197
|
+
*
|
|
198
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbseparator
|
|
172
199
|
*
|
|
173
200
|
* @example
|
|
174
201
|
* ```tsx
|
|
@@ -189,12 +216,13 @@ type BreadcrumbSeparatorProps = Omit<ComponentProps<"li">, "children"> & ({
|
|
|
189
216
|
* </Breadcrumb.Root>
|
|
190
217
|
* ```
|
|
191
218
|
*/
|
|
192
|
-
declare const Separator: ({ asChild, children, "data-slot": dataSlot, ref, ...props }: BreadcrumbSeparatorProps & WithDataSlot) => import("react").JSX.Element;
|
|
219
|
+
declare const Separator: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: BreadcrumbSeparatorProps & WithDataSlot) => import("react").JSX.Element;
|
|
193
220
|
/**
|
|
194
221
|
* Compound component for WAI-ARIA breadcrumb navigation — the path from a
|
|
195
222
|
* root to the current page as an ordered list of links inside a labeled
|
|
196
223
|
* `<nav>` landmark. Router-agnostic: compose `Breadcrumb.Link` onto your app
|
|
197
|
-
* router's link via `asChild`.
|
|
224
|
+
* router's link via `asChild`. A trail too wide for its row scrolls sideways
|
|
225
|
+
* with faded edges instead of wrapping, and starts at the current page.
|
|
198
226
|
*
|
|
199
227
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
200
228
|
*
|
|
@@ -233,9 +261,10 @@ declare const Breadcrumb: {
|
|
|
233
261
|
/**
|
|
234
262
|
* The breadcrumb landmark. Renders a `<nav>` with a default
|
|
235
263
|
* `aria-label="Breadcrumb"` — pass your own `aria-label` to override it.
|
|
236
|
-
* Carries no visual styling
|
|
264
|
+
* Carries no visual styling; `min-w-0` is what lets the landmark shrink
|
|
265
|
+
* inside a flex row so the trail scrolls.
|
|
237
266
|
*
|
|
238
|
-
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
267
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbroot
|
|
239
268
|
*
|
|
240
269
|
* @example
|
|
241
270
|
* ```tsx
|
|
@@ -259,9 +288,11 @@ declare const Breadcrumb: {
|
|
|
259
288
|
readonly Root: typeof Root;
|
|
260
289
|
/**
|
|
261
290
|
* The ordered list of crumbs. Renders an `<ol>` — the order of the items
|
|
262
|
-
* is the hierarchy, from the root to the current page.
|
|
291
|
+
* is the hierarchy, from the root to the current page. A trail wider than
|
|
292
|
+
* its container scrolls sideways with a faded edge instead of wrapping, and
|
|
293
|
+
* starts at the current page.
|
|
263
294
|
*
|
|
264
|
-
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
295
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumblist
|
|
265
296
|
*
|
|
266
297
|
* @example
|
|
267
298
|
* ```tsx
|
|
@@ -285,9 +316,10 @@ declare const Breadcrumb: {
|
|
|
285
316
|
readonly List: typeof List;
|
|
286
317
|
/**
|
|
287
318
|
* A single crumb. Renders an `<li>` containing a `Breadcrumb.Link` or
|
|
288
|
-
* `Breadcrumb.Page`.
|
|
319
|
+
* `Breadcrumb.Page`. The crumb never shrinks, so a wide trail scrolls
|
|
320
|
+
* instead of breaking a label across two lines.
|
|
289
321
|
*
|
|
290
|
-
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
322
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbitem
|
|
291
323
|
*
|
|
292
324
|
* @example
|
|
293
325
|
* ```tsx
|
|
@@ -365,9 +397,10 @@ declare const Breadcrumb: {
|
|
|
365
397
|
/**
|
|
366
398
|
* A purely visual divider between crumbs, hidden from assistive
|
|
367
399
|
* technology (`role="presentation"` + `aria-hidden`). Children default to
|
|
368
|
-
* a caret icon; pass your own (e.g. a slash) to replace it.
|
|
400
|
+
* a caret icon; pass your own (e.g. a slash) to replace it. Like the crumbs
|
|
401
|
+
* it divides, it never shrinks.
|
|
369
402
|
*
|
|
370
|
-
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
403
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbseparator
|
|
371
404
|
*
|
|
372
405
|
* @example
|
|
373
406
|
* ```tsx
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-BdBMM9ga.js";import{t as n}from"./cx-IiQEAKf5.js";import{t as r}from"./icon-lZ48P8Nn.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./slot-DpNWVci8.js";import{cloneElement as o,isValidElement as s,useEffect as c,useRef as l}from"react";import{jsx as u}from"react/jsx-runtime";import{CaretRightIcon as d}from"@phosphor-icons/react/CaretRight";const f=({asChild:e,children:t,className:r,"data-slot":o,ref:s,...c})=>u(e?a:`nav`,{ref:s,"data-slot":i(o,`breadcrumb`),"aria-label":`Breadcrumb`,className:n(`min-w-0`,r),...c,children:t});function p(e,t){let n=e.scrollWidth-e.clientWidth;return n===t||e.contains(document.activeElement)?t:(e.scrollLeft=n,n)}const m={Root:f,List:({asChild:r,children:o,className:s,"data-slot":d,ref:f,...m})=>{let h=r?a:`ol`,g=l(null),_=t(g,f),v=l(void 0);return e(()=>{let e=g.current;e!=null&&(v.current=p(e,v.current))}),c(()=>{let e=g.current;if(e==null)return;let t=new ResizeObserver(()=>{v.current=p(e,v.current)});return t.observe(e),()=>{t.disconnect()}},[]),u(h,{ref:_,"data-slot":i(d,`breadcrumb-list`),className:n(`text-muted flex items-center gap-1.5 text-sm`,`scroll-fade-x min-w-0 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,`scroll-px-10`,s),...m,children:o})},Item:({asChild:e,children:t,className:r,"data-slot":o,ref:s,...c})=>u(e?a:`li`,{ref:s,"data-slot":i(o,`breadcrumb-item`),className:n(`inline-flex shrink-0 items-center gap-1.5`,r),...c,children:t}),Link:({asChild:e,children:t,className:r,"data-slot":o,ref:s,...c})=>u(e?a:`a`,{ref:s,"data-slot":i(o,`breadcrumb-link`),className:n(`hover:text-strong transition-colors`,r),...c,children:t}),Page:({asChild:e,children:t,className:r,"data-slot":c,ref:l,...d})=>{let f=e?a:`span`,p=e&&s(t)?o(t,{"aria-current":`page`}):t;return u(f,{ref:l,"data-slot":i(c,`breadcrumb-page`),className:n(`text-muted`,r),...d,"aria-current":`page`,children:p})},Separator:({asChild:e,children:t,className:c,"data-slot":l,ref:f,...p})=>{let m=e?a:`li`,h=e&&s(t)?o(t,{role:`presentation`,"aria-hidden":`true`}):t??u(r,{svg:u(d,{}),className:`size-3.5`});return u(m,{ref:f,"data-slot":i(l,`breadcrumb-separator`),className:n(`shrink-0`,c),...p,role:`presentation`,"aria-hidden":`true`,children:h})}};export{m as Breadcrumb};
|