@nswds/ui 9.0.1 → 9.1.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.
|
@@ -1,10 +1,134 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
1
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The four looks, set on `Breadcrumb` and read by every part through
|
|
8
|
+
* `group-data-*` (DESIGN.md, Breadcrumb):
|
|
9
|
+
*
|
|
10
|
+
* - `default`: no chrome; underlined ink links and chevrons. Use it unless the
|
|
11
|
+
* page has a reason not to.
|
|
12
|
+
* - `rail`: the masterbrand line system — hairlines above and below in the
|
|
13
|
+
* text colour, slash separators. For a page whose top is already quiet.
|
|
14
|
+
* - `band`: the solid brand band — Blue 01 with white links, deepening to
|
|
15
|
+
* `primary-950` in dark exactly as Header's `dark` colour does, so a band
|
|
16
|
+
* under that header stays flush in both modes (AGENTS.md §3 brand band). A
|
|
17
|
+
* dark-only hairline in the ink at 15% keeps its edge on a dark page, where
|
|
18
|
+
* 950 alone is ~1.06:1 against the canvas; under Header it is the band's
|
|
19
|
+
* bottom edge, so it never seams. Labels are white in both modes for the
|
|
20
|
+
* reason Button's solid labels are: `--text-inverse` flips.
|
|
21
|
+
* - `soft`: a 10% ink tint with a 30% ink hairline under it.
|
|
22
|
+
*
|
|
23
|
+
* Every hairline is optical: the padding beside it is 1px shorter, so each
|
|
24
|
+
* look lands on the 4px grid (40px tall, 48px with the ellipsis).
|
|
25
|
+
*/
|
|
26
|
+
declare const breadcrumbVariants: (props?: ({
|
|
27
|
+
variant?: "default" | "soft" | "band" | "rail" | null | undefined;
|
|
28
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
29
|
+
/**
|
|
30
|
+
* The `sideOffset` to give a DropdownMenuContent opened from the ellipsis. The
|
|
31
|
+
* band, tint and rail add up to 8px of their own edge below the 24px trigger,
|
|
32
|
+
* so the menu's default 4px would open it over that edge; 14px clears all
|
|
33
|
+
* four looks.
|
|
34
|
+
*/
|
|
35
|
+
declare const BREADCRUMB_MENU_OFFSET = 14;
|
|
36
|
+
/**
|
|
37
|
+
* The trail's landmark. `aria-label` defaults to "Breadcrumb" and can be
|
|
38
|
+
* overridden (a page with two trails needs two names).
|
|
39
|
+
*
|
|
40
|
+
* `collapse` is on by default: when the full trail would wrap, it shortens to
|
|
41
|
+
* its first step, a "…" menu of the steps it hides, and the current page's
|
|
42
|
+
* parent — "Home › … › Licences and permits". The site root and the way up
|
|
43
|
+
* stay visible and every hidden step is one tap away; the page heading names
|
|
44
|
+
* the current page. The first step and the parent share one row, the parent
|
|
45
|
+
* wrapping within it if its title is long. A team's own ellipsis stays in the
|
|
46
|
+
* trail when it collapses. A trail that fits on one line stays whole at any
|
|
47
|
+
* width, and a trail whose parent is its first step never collapses — there
|
|
48
|
+
* would be nothing to hide but the current page. Pass `collapse={false}` to
|
|
49
|
+
* keep the full trail, which then wraps.
|
|
50
|
+
*
|
|
51
|
+
* The menu's rows are plain links built from the hidden steps' `href`s, so
|
|
52
|
+
* they navigate with a full page load. A team whose framework routes on the
|
|
53
|
+
* client can put its own ellipsis menu in the trail instead.
|
|
54
|
+
*
|
|
55
|
+
* Wrapping is measured, so it needs JavaScript. Until the first measurement —
|
|
56
|
+
* server-rendered HTML, or no script — an eligible trail is shown collapsed,
|
|
57
|
+
* without the menu, at every width: one row that never clips, and the
|
|
58
|
+
* measurement only ever expands it or adds the "…", so the page never changes
|
|
59
|
+
* height when it lands. The nav takes `w-full`, which keeps its width
|
|
60
|
+
* independent of its own collapse state; without it a shrink-to-fit parent (a
|
|
61
|
+
* `flex items-center` header) would size it to the collapsed trail and it
|
|
62
|
+
* could never measure wider. It is a plain class, so a consumer `w-*` still
|
|
63
|
+
* wins.
|
|
64
|
+
*/
|
|
65
|
+
declare function Breadcrumb({ className, variant, collapse, 'aria-label': ariaLabel, ref, ...props }: React.ComponentProps<'nav'> & VariantProps<typeof breadcrumbVariants> & {
|
|
66
|
+
collapse?: boolean;
|
|
67
|
+
}): React.JSX.Element;
|
|
68
|
+
/**
|
|
69
|
+
* Default separators are drawn by the item after them (BreadcrumbItem's lead),
|
|
70
|
+
* so a wrapped line starts with its separator and its target together instead
|
|
71
|
+
* of stranding a chevron at the end of the line above. The separator `<li>`
|
|
72
|
+
* stays in the tree — it is what the collapse rules count — but renders
|
|
73
|
+
* nothing. A separator with custom children is drawn where it stands. Rows
|
|
74
|
+
* sit 8px apart, 20px on a coarse pointer so the 44px touch targets of
|
|
75
|
+
* neighbouring rows never overlap.
|
|
76
|
+
*
|
|
77
|
+
* The collapse rules key on the trail's shape rather than on markers the
|
|
78
|
+
* consumer must add: the parent is the item two before the end, with a
|
|
79
|
+
* separator between it and the current page. A collapsed trail keeps the
|
|
80
|
+
* first item, any ellipsis item a team supplied, and that parent, and hides
|
|
81
|
+
* the rest; the parent's "…" menu (BreadcrumbItem) offers what was hidden. The
|
|
82
|
+
* rules apply only when the parent is a link and not the first item, so a
|
|
83
|
+
* trail of one or two steps, or one whose parent slot is an ellipsis, stays
|
|
84
|
+
* whole. A custom separator before the parent stays, so the kept steps are
|
|
85
|
+
* still divided. The first item keeps its width and the parent takes the
|
|
86
|
+
* rest of the row, wrapping within it if its title is long. (One `:has()` per
|
|
87
|
+
* condition: `:has()` cannot nest.) The rules are written for the measured
|
|
88
|
+
* state (`data-collapsed`) and again for the stand-in before measurement,
|
|
89
|
+
* which collapses an eligible trail at every width.
|
|
90
|
+
*/
|
|
5
91
|
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
|
|
6
|
-
|
|
7
|
-
|
|
92
|
+
/**
|
|
93
|
+
* One step in the trail: the separator glyph it leads with, then its content.
|
|
94
|
+
* The glyph — a chevron, or a slash on the rail — shows only when a default
|
|
95
|
+
* BreadcrumbSeparator precedes the item, so the first item never carries one.
|
|
96
|
+
* It aligns to the first line of a label that wraps, and to the centre of the
|
|
97
|
+
* ellipsis trigger.
|
|
98
|
+
*
|
|
99
|
+
* The content sits in its own span so the link inside stays inline: a flex
|
|
100
|
+
* item is blockified, and a block `<a>` would draw one rectangular halo and
|
|
101
|
+
* focus ring round a wrapped label instead of one per line.
|
|
102
|
+
*
|
|
103
|
+
* A `<button>` whose direct child is a `BreadcrumbEllipsis` is styled as the
|
|
104
|
+
* ellipsis trigger, which keeps the trail composable with `DropdownMenuTrigger`
|
|
105
|
+
* (or any other trigger), and so is the "…" a collapsed trail adds. It is a
|
|
106
|
+
* 24px control on the 4px radius — one line tall, so a row never changes
|
|
107
|
+
* height with it — tinted from the ink at 10% on hover and 20% while
|
|
108
|
+
* pressed or open, with the system's 2px offset focus ring and, in forced
|
|
109
|
+
* colours (where tints are dropped), a 1px border. The selector sits inside
|
|
110
|
+
* `:where()` so it carries no specificity: a `className` on the trigger itself
|
|
111
|
+
* still wins.
|
|
112
|
+
*/
|
|
113
|
+
declare function BreadcrumbItem({ className, children, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
114
|
+
/**
|
|
115
|
+
* A link in the trail, in the system's link signature (DESIGN.md, Links):
|
|
116
|
+
* medium weight, underlined in the ink at 4px offset, a 10% ink halo with a
|
|
117
|
+
* 2px underline on hover and an 18% halo while pressed, and the 2px offset
|
|
118
|
+
* focus ring in the ink, which appears in the ink at once: the transition
|
|
119
|
+
* leaves `outline-color` out, so the ring never fades in from the base layer's
|
|
120
|
+
* grey. The halo is Link's recipe, mixed in the same oklch
|
|
121
|
+
* space; it is reproduced rather than reusing `linkVariants` because Link's
|
|
122
|
+
* `primary` colour is fixed while a trail's ink changes with its look (white
|
|
123
|
+
* on the band). There is deliberately no visited colour: a trail is
|
|
124
|
+
* wayfinding, and a visited step is not information.
|
|
125
|
+
*
|
|
126
|
+
* A coarse-pointer TouchTarget rides inside the link's target, expanding the
|
|
127
|
+
* hit area to 44px without growing the box (the Same-Floor Rule). It is only
|
|
128
|
+
* added when the text comes through `children`; a link whose text lives
|
|
129
|
+
* inside its `render` element keeps that text and goes without it.
|
|
130
|
+
*/
|
|
131
|
+
declare function BreadcrumbLink({ className, render, children, ...props }: useRender.ComponentProps<'a'>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
8
132
|
/**
|
|
9
133
|
* The current page's entry in the trail — plain text, not a link.
|
|
10
134
|
*
|
|
@@ -14,9 +138,27 @@ declare function BreadcrumbLink({ className, render, ...props }: useRender.Compo
|
|
|
14
138
|
* something that is neither a link nor operable, and puts a hand-rolled ARIA
|
|
15
139
|
* role on an element that needs none. axe-core does not flag it, so it
|
|
16
140
|
* survives an a11y gate set to `error`; it is removed deliberately here.
|
|
141
|
+
*
|
|
142
|
+
* Regular weight under the links' medium on every look: the step you are on is
|
|
143
|
+
* the one you cannot follow, so it is never the heaviest word in the trail.
|
|
17
144
|
*/
|
|
18
145
|
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
146
|
+
/**
|
|
147
|
+
* Marks the step boundary. Decorative and hidden from assistive tech. Left
|
|
148
|
+
* empty, it draws nothing itself: the item after it leads with the look's
|
|
149
|
+
* glyph (BreadcrumbItem), so the glyph wraps with its target. Given children,
|
|
150
|
+
* it draws them where it stands, as before.
|
|
151
|
+
*/
|
|
19
152
|
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
153
|
+
/**
|
|
154
|
+
* The collapsed-steps glyph, with "More pages" for screen readers so a trigger
|
|
155
|
+
* built around it is never unnamed. Put it as the only child of a trigger and
|
|
156
|
+
* name the trigger by what it reveals, e.g.
|
|
157
|
+
* `<DropdownMenuTrigger aria-label='Show 2 more pages'><BreadcrumbEllipsis /></DropdownMenuTrigger>`.
|
|
158
|
+
* BreadcrumbItem styles that trigger, and the glyph carries a coarse-pointer
|
|
159
|
+
* TouchTarget so the 24px control still takes a 44px tap. Open the menu with
|
|
160
|
+
* `sideOffset={BREADCRUMB_MENU_OFFSET}`.
|
|
161
|
+
*/
|
|
20
162
|
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
21
163
|
|
|
22
|
-
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
164
|
+
export { BREADCRUMB_MENU_OFFSET, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, breadcrumbVariants };
|
|
@@ -1,12 +1,163 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
3
4
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import * as React from 'react';
|
|
4
7
|
import { IconChevronRight } from '../icons/chevron-right.js';
|
|
5
8
|
import { IconMoreHoriz } from '../icons/more-horiz.js';
|
|
9
|
+
import { overlayInk } from '../lib/overlay.js';
|
|
6
10
|
import { cn } from '../lib/utils.js';
|
|
11
|
+
import { TouchTarget } from './button.js';
|
|
12
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLinkItem } from './dropdown-menu.js';
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
const onSurface = "[--bc-current:var(--foreground)] [--bc-ink:var(--overlay-ink)] [--bc-separator:var(--muted-foreground)]";
|
|
15
|
+
const chromeInset = "max-sm:[--bc-inset:--spacing(4)] sm:max-lg:[--bc-inset:--spacing(6)] lg:[--bc-inset:--spacing(12)] [--bc-max-width:var(--header-max-width,none)]";
|
|
16
|
+
const breadcrumbVariants = cva(["group/breadcrumb text-base/6", overlayInk], {
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
default: onSurface,
|
|
20
|
+
rail: ["border-y border-foreground py-[calc(--spacing(2)-1px)]", onSurface],
|
|
21
|
+
band: [
|
|
22
|
+
"bg-primary-800 py-2 dark:border-b dark:border-(--bc-ink)/15 dark:bg-primary-950 dark:pb-[calc(--spacing(2)-1px)]",
|
|
23
|
+
"[--bc-current:var(--color-white)] [--bc-ink:var(--color-white)] [--bc-separator:color-mix(in_oklch,var(--color-white)_72%,transparent)]",
|
|
24
|
+
chromeInset
|
|
25
|
+
],
|
|
26
|
+
soft: [
|
|
27
|
+
"border-b border-(--bc-ink)/30 bg-(--bc-ink)/10 pt-2 pb-[calc(--spacing(2)-1px)]",
|
|
28
|
+
onSurface,
|
|
29
|
+
chromeInset
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: { variant: "default" }
|
|
34
|
+
});
|
|
35
|
+
const BREADCRUMB_MENU_OFFSET = 14;
|
|
36
|
+
function trailWraps(nav) {
|
|
37
|
+
const probe = nav.cloneNode(true);
|
|
38
|
+
probe.removeAttribute("data-collapse");
|
|
39
|
+
probe.removeAttribute("data-collapsed");
|
|
40
|
+
probe.removeAttribute("data-measured");
|
|
41
|
+
for (const el of [probe, ...probe.querySelectorAll("[id]")]) el.removeAttribute("id");
|
|
42
|
+
probe.setAttribute("aria-hidden", "true");
|
|
43
|
+
probe.inert = true;
|
|
44
|
+
Object.assign(probe.style, {
|
|
45
|
+
position: "absolute",
|
|
46
|
+
insetBlockStart: "0",
|
|
47
|
+
insetInlineStart: "0",
|
|
48
|
+
width: `${nav.offsetWidth}px`,
|
|
49
|
+
visibility: "hidden",
|
|
50
|
+
pointerEvents: "none"
|
|
51
|
+
});
|
|
52
|
+
const list = probe.querySelector("[data-slot=breadcrumb-list]");
|
|
53
|
+
if (!list) return false;
|
|
54
|
+
list.style.flexWrap = "nowrap";
|
|
55
|
+
list.style.whiteSpace = "nowrap";
|
|
56
|
+
for (const item of list.children) item.style.flexShrink = "0";
|
|
57
|
+
nav.after(probe);
|
|
58
|
+
const wraps = list.scrollWidth > list.clientWidth + 1;
|
|
59
|
+
probe.remove();
|
|
60
|
+
return wraps;
|
|
61
|
+
}
|
|
62
|
+
const NO_HIDDEN_STEPS = [];
|
|
63
|
+
function hiddenSteps(nav) {
|
|
64
|
+
const items = [
|
|
65
|
+
...nav.querySelectorAll(
|
|
66
|
+
"[data-slot=breadcrumb-list] > [data-slot=breadcrumb-item]"
|
|
67
|
+
)
|
|
68
|
+
];
|
|
69
|
+
return items.slice(1, -2).flatMap((item) => {
|
|
70
|
+
const link = item.querySelector(
|
|
71
|
+
":scope > [data-slot=breadcrumb-content] > a[href]"
|
|
72
|
+
);
|
|
73
|
+
const href = link?.getAttribute("href");
|
|
74
|
+
return link && href != null ? [{ href, label: link.textContent?.trim() ?? "" }] : [];
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const BreadcrumbHiddenContext = React.createContext(NO_HIDDEN_STEPS);
|
|
78
|
+
function Breadcrumb({
|
|
79
|
+
className,
|
|
80
|
+
variant,
|
|
81
|
+
collapse = true,
|
|
82
|
+
"aria-label": ariaLabel = "Breadcrumb",
|
|
83
|
+
ref,
|
|
84
|
+
...props
|
|
85
|
+
}) {
|
|
86
|
+
const look = variant ?? "default";
|
|
87
|
+
const collapses = collapse;
|
|
88
|
+
const navRef = React.useRef(null);
|
|
89
|
+
const [wraps, setWraps] = React.useState(null);
|
|
90
|
+
const [hidden, setHidden] = React.useState(NO_HIDDEN_STEPS);
|
|
91
|
+
React.useLayoutEffect(() => {
|
|
92
|
+
const nav = navRef.current;
|
|
93
|
+
if (!collapses || !nav) {
|
|
94
|
+
setWraps(null);
|
|
95
|
+
setHidden(NO_HIDDEN_STEPS);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let frame = 0;
|
|
99
|
+
let measuredWidth = -1;
|
|
100
|
+
let dirty = true;
|
|
101
|
+
const measure = () => {
|
|
102
|
+
const width = nav.offsetWidth;
|
|
103
|
+
if (width === 0 || !dirty && width === measuredWidth) return;
|
|
104
|
+
measuredWidth = width;
|
|
105
|
+
dirty = false;
|
|
106
|
+
const next = nav.querySelector("[data-slot=breadcrumb-list] a[href]") ? trailWraps(nav) : false;
|
|
107
|
+
setWraps(next);
|
|
108
|
+
const steps = next ? hiddenSteps(nav) : NO_HIDDEN_STEPS;
|
|
109
|
+
setHidden((prev) => JSON.stringify(prev) === JSON.stringify(steps) ? prev : steps);
|
|
110
|
+
};
|
|
111
|
+
const schedule = () => {
|
|
112
|
+
cancelAnimationFrame(frame);
|
|
113
|
+
frame = requestAnimationFrame(measure);
|
|
114
|
+
};
|
|
115
|
+
measure();
|
|
116
|
+
const invalidate = () => {
|
|
117
|
+
dirty = true;
|
|
118
|
+
schedule();
|
|
119
|
+
};
|
|
120
|
+
const resize = new ResizeObserver(schedule);
|
|
121
|
+
resize.observe(nav);
|
|
122
|
+
const content = new MutationObserver(invalidate);
|
|
123
|
+
content.observe(nav, {
|
|
124
|
+
childList: true,
|
|
125
|
+
characterData: true,
|
|
126
|
+
subtree: true,
|
|
127
|
+
attributeFilter: ["class", "href", "style"]
|
|
128
|
+
});
|
|
129
|
+
const fonts = document.fonts;
|
|
130
|
+
let disposed = false;
|
|
131
|
+
fonts?.ready.then(() => {
|
|
132
|
+
if (!disposed) invalidate();
|
|
133
|
+
});
|
|
134
|
+
fonts?.addEventListener("loadingdone", invalidate);
|
|
135
|
+
return () => {
|
|
136
|
+
disposed = true;
|
|
137
|
+
cancelAnimationFrame(frame);
|
|
138
|
+
resize.disconnect();
|
|
139
|
+
content.disconnect();
|
|
140
|
+
fonts?.removeEventListener("loadingdone", invalidate);
|
|
141
|
+
};
|
|
142
|
+
}, [collapses]);
|
|
143
|
+
return /* @__PURE__ */ jsx(BreadcrumbHiddenContext.Provider, { value: collapses && wraps ? hidden : NO_HIDDEN_STEPS, children: /* @__PURE__ */ jsx(
|
|
144
|
+
"nav",
|
|
145
|
+
{
|
|
146
|
+
ref: (node) => {
|
|
147
|
+
navRef.current = node;
|
|
148
|
+
if (typeof ref === "function") ref(node);
|
|
149
|
+
else if (ref) ref.current = node;
|
|
150
|
+
},
|
|
151
|
+
"aria-label": ariaLabel,
|
|
152
|
+
"data-slot": "breadcrumb",
|
|
153
|
+
"data-variant": look,
|
|
154
|
+
"data-collapse": collapses || void 0,
|
|
155
|
+
"data-measured": collapses && wraps !== null ? "" : void 0,
|
|
156
|
+
"data-collapsed": collapses && wraps ? "" : void 0,
|
|
157
|
+
className: cn(breadcrumbVariants({ variant: look }), collapses && "w-full", className),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
10
161
|
}
|
|
11
162
|
function BreadcrumbList({ className, ...props }) {
|
|
12
163
|
return /* @__PURE__ */ jsx(
|
|
@@ -14,29 +165,104 @@ function BreadcrumbList({ className, ...props }) {
|
|
|
14
165
|
{
|
|
15
166
|
"data-slot": "breadcrumb-list",
|
|
16
167
|
className: cn(
|
|
17
|
-
"flex flex-wrap items-center gap-
|
|
168
|
+
"mx-auto flex max-w-(--bc-max-width) flex-wrap items-center gap-x-2 px-(--bc-inset) wrap-break-word text-(--bc-separator) not-pointer-coarse:gap-y-2 group-data-[variant=rail]/breadcrumb:gap-x-3 pointer-coarse:gap-y-5",
|
|
169
|
+
"[&>[data-slot=breadcrumb-separator]:not([data-custom])]:hidden",
|
|
170
|
+
"group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:not(:first-child):not(:nth-last-child(3)):not([data-custom]:nth-last-child(4)):not(:has(>[data-slot=breadcrumb-content]>button>[data-slot=breadcrumb-ellipsis]))]:hidden",
|
|
171
|
+
"group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:not(:first-child):not(:nth-last-child(3)):not([data-custom]:nth-last-child(4)):not(:has(>[data-slot=breadcrumb-content]>button>[data-slot=breadcrumb-ellipsis]))]:hidden",
|
|
172
|
+
"group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:shrink-0 group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:self-start group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:shrink-0 group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:self-start group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)]:flex-1 group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)]:flex-1",
|
|
173
|
+
"group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)>[data-slot=breadcrumb-content]>[data-slot=breadcrumb-more]]:inline-flex",
|
|
18
174
|
className
|
|
19
175
|
),
|
|
20
176
|
...props
|
|
21
177
|
}
|
|
22
178
|
);
|
|
23
179
|
}
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
180
|
+
function BreadcrumbMore({ steps }) {
|
|
181
|
+
return /* @__PURE__ */ jsxs(
|
|
182
|
+
"span",
|
|
183
|
+
{
|
|
184
|
+
"data-slot": "breadcrumb-more",
|
|
185
|
+
className: "me-2 hidden items-center gap-2 align-top group-data-[variant=rail]/breadcrumb:me-3 group-data-[variant=rail]/breadcrumb:gap-3",
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
DropdownMenuTrigger,
|
|
190
|
+
{
|
|
191
|
+
"aria-label": `Show ${steps.length} more ${steps.length === 1 ? "page" : "pages"}`,
|
|
192
|
+
children: /* @__PURE__ */ jsx(BreadcrumbEllipsis, {})
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { sideOffset: BREADCRUMB_MENU_OFFSET, children: steps.map((step) => /* @__PURE__ */ jsx(
|
|
196
|
+
DropdownMenuLinkItem,
|
|
197
|
+
{
|
|
198
|
+
href: step.href,
|
|
199
|
+
className: "underline underline-offset-4",
|
|
200
|
+
children: step.label
|
|
201
|
+
},
|
|
202
|
+
`${step.href} ${step.label}`
|
|
203
|
+
)) })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "inline-flex shrink-0 [&>svg]:size-5", children: [
|
|
206
|
+
/* @__PURE__ */ jsx(IconChevronRight, { className: "group-data-[variant=rail]/breadcrumb:hidden rtl:rotate-180" }),
|
|
207
|
+
/* @__PURE__ */ jsx("span", { className: "hidden text-xl/6 group-data-[variant=rail]/breadcrumb:inline", children: "/" })
|
|
208
|
+
] })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
function BreadcrumbItem({ className, children, ...props }) {
|
|
214
|
+
const hidden = React.useContext(BreadcrumbHiddenContext);
|
|
215
|
+
return /* @__PURE__ */ jsxs(
|
|
26
216
|
"li",
|
|
27
217
|
{
|
|
28
218
|
"data-slot": "breadcrumb-item",
|
|
29
|
-
className: cn(
|
|
30
|
-
|
|
219
|
+
className: cn(
|
|
220
|
+
"inline-flex min-w-0 items-start gap-2 group-data-[variant=rail]/breadcrumb:gap-3 has-[>[data-slot=breadcrumb-content]>button]:items-center",
|
|
221
|
+
"[[data-slot=breadcrumb-separator]:not([data-custom])+&>[data-slot=breadcrumb-lead]]:inline-flex",
|
|
222
|
+
"[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:relative [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:inline-flex [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:size-6 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:cursor-pointer [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:items-center [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:justify-center [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:rounded-sm [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:bg-transparent [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:px-0 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:text-(--bc-ink) [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:motion-safe:transition-[color,background-color]",
|
|
223
|
+
"[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:not-forced-colors:border-0 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:forced-colors:border",
|
|
224
|
+
"[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:hover:bg-(--bc-ink)/10 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:active:bg-(--bc-ink)/20 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:aria-expanded:bg-(--bc-ink)/20",
|
|
225
|
+
"[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-2 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-offset-2 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-(--bc-ink) [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-solid",
|
|
226
|
+
className
|
|
227
|
+
),
|
|
228
|
+
...props,
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ jsxs(
|
|
231
|
+
"span",
|
|
232
|
+
{
|
|
233
|
+
"data-slot": "breadcrumb-lead",
|
|
234
|
+
"aria-hidden": "true",
|
|
235
|
+
className: "hidden h-6 shrink-0 items-center [&>svg]:size-5",
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsx(IconChevronRight, { className: "group-data-[variant=rail]/breadcrumb:hidden rtl:rotate-180" }),
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "hidden text-xl/6 group-data-[variant=rail]/breadcrumb:inline", children: "/" })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "breadcrumb-content", className: "min-w-0 has-[>button]:flex", children: [
|
|
243
|
+
hidden.length > 0 && /* @__PURE__ */ jsx(BreadcrumbMore, { steps: hidden }),
|
|
244
|
+
children
|
|
245
|
+
] })
|
|
246
|
+
]
|
|
31
247
|
}
|
|
32
248
|
);
|
|
33
249
|
}
|
|
34
|
-
function BreadcrumbLink({ className, render, ...props }) {
|
|
250
|
+
function BreadcrumbLink({ className, render, children, ...props }) {
|
|
35
251
|
return useRender({
|
|
36
252
|
defaultTagName: "a",
|
|
37
253
|
props: mergeProps(
|
|
38
254
|
{
|
|
39
|
-
className: cn(
|
|
255
|
+
className: cn(
|
|
256
|
+
"relative box-decoration-clone font-medium text-(--bc-ink) underline decoration-1 underline-offset-4 motion-safe:transition-[color,background-color,text-decoration-color,box-shadow]",
|
|
257
|
+
"[--bc-halo-active:color-mix(in_oklch,var(--bc-ink)_18%,transparent)] [--bc-halo:color-mix(in_oklch,var(--bc-ink)_10%,transparent)]",
|
|
258
|
+
"hover:bg-(--bc-halo) hover:decoration-2 hover:shadow-[0_-2px_0_var(--bc-halo),0_4px_0_var(--bc-halo)]",
|
|
259
|
+
"active:bg-(--bc-halo-active) active:decoration-2 active:shadow-[0_-2px_0_var(--bc-halo-active),0_4px_0_var(--bc-halo-active)]",
|
|
260
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--bc-ink) focus-visible:outline-solid",
|
|
261
|
+
className
|
|
262
|
+
),
|
|
263
|
+
...children !== void 0 && {
|
|
264
|
+
children: /* @__PURE__ */ jsx(TouchTarget, { children })
|
|
265
|
+
}
|
|
40
266
|
},
|
|
41
267
|
props
|
|
42
268
|
),
|
|
@@ -52,7 +278,7 @@ function BreadcrumbPage({ className, ...props }) {
|
|
|
52
278
|
{
|
|
53
279
|
"data-slot": "breadcrumb-page",
|
|
54
280
|
"aria-current": "page",
|
|
55
|
-
className: cn("font-normal text-
|
|
281
|
+
className: cn("font-normal text-(--bc-current)", className),
|
|
56
282
|
...props
|
|
57
283
|
}
|
|
58
284
|
);
|
|
@@ -62,28 +288,30 @@ function BreadcrumbSeparator({ children, className, ...props }) {
|
|
|
62
288
|
"li",
|
|
63
289
|
{
|
|
64
290
|
"data-slot": "breadcrumb-separator",
|
|
291
|
+
"data-custom": children === void 0 ? void 0 : "",
|
|
65
292
|
role: "presentation",
|
|
66
293
|
"aria-hidden": "true",
|
|
67
|
-
className: cn("[&>svg]:size-
|
|
294
|
+
className: cn("inline-flex items-center [&>svg]:size-5", className),
|
|
68
295
|
...props,
|
|
69
|
-
children
|
|
296
|
+
children
|
|
70
297
|
}
|
|
71
298
|
);
|
|
72
299
|
}
|
|
73
300
|
function BreadcrumbEllipsis({ className, ...props }) {
|
|
74
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ jsxs(
|
|
75
302
|
"span",
|
|
76
303
|
{
|
|
77
304
|
"data-slot": "breadcrumb-ellipsis",
|
|
78
|
-
|
|
79
|
-
"aria-hidden": "true",
|
|
80
|
-
className: cn("flex size-4 items-center justify-center [&>svg]:size-3.5", className),
|
|
305
|
+
className: cn("relative flex size-6 items-center justify-center [&_svg]:size-6", className),
|
|
81
306
|
...props,
|
|
82
|
-
children:
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ jsx(TouchTarget, { children: /* @__PURE__ */ jsx(IconMoreHoriz, { "aria-hidden": "true" }) }),
|
|
309
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
310
|
+
]
|
|
83
311
|
}
|
|
84
312
|
);
|
|
85
313
|
}
|
|
86
314
|
|
|
87
|
-
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
315
|
+
export { BREADCRUMB_MENU_OFFSET, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, breadcrumbVariants };
|
|
88
316
|
//# sourceMappingURL=breadcrumb.js.map
|
|
89
317
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":";;;;;;;AAQA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACxE,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,YAAA,EAAW,YAAA,EAAa,WAAA,EAAU,YAAA,EAAa,SAAA,EAAW,EAAA,CAAG,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClG;AAEA,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,2FAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,gCAAA,EAAkC,SAAS,CAAA;AAAA,MACxD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,eAAe,EAAE,SAAA,EAAW,MAAA,EAAQ,GAAG,OAAM,EAAkC;AACtF,EAAA,OAAO,SAAA,CAAU;AAAA,IACf,cAAA,EAAgB,GAAA;AAAA,IAChB,KAAA,EAAO,UAAA;AAAA,MACL;AAAA,QACE,SAAA,EAAW,EAAA,CAAG,yCAAA,EAA2C,SAAS;AAAA,OACpE;AAAA,MACA;AAAA,KACF;AAAA,IACA,MAAA;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM;AAAA;AACR,GACD,CAAA;AACH;AAYA,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAiC;AAC7E,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,cAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,MACrD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,oBAAoB,EAAE,QAAA,EAAU,SAAA,EAAW,GAAG,OAAM,EAA+B;AAC1F,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,sBAAA;AAAA,MACV,IAAA,EAAK,cAAA;AAAA,MACL,aAAA,EAAY,MAAA;AAAA,MACZ,SAAA,EAAW,EAAA,CAAG,kBAAA,EAAoB,SAAS,CAAA;AAAA,MAC1C,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA,QAAA,oBAAY,GAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAU,gBAAA,EAAiB;AAAA;AAAA,GAC5D;AAEJ;AAEA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAiC;AACjF,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,IAAA,EAAK,cAAA;AAAA,MACL,aAAA,EAAY,MAAA;AAAA,MACZ,SAAA,EAAW,EAAA,CAAG,0DAAA,EAA4D,SAAS,CAAA;AAAA,MAClF,GAAG,KAAA;AAAA,MAEJ,8BAAC,aAAA,EAAA,EAAc;AAAA;AAAA,GACjB;AAEJ","file":"breadcrumb.js","sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\n\nimport { IconChevronRight } from '../icons/chevron-right.js'\nimport { IconMoreHoriz } from '../icons/more-horiz.js'\nimport { cn } from '../lib/utils.js'\n\nfunction Breadcrumb({ className, ...props }: React.ComponentProps<'nav'>) {\n return <nav aria-label='breadcrumb' data-slot='breadcrumb' className={cn(className)} {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {\n return (\n <ol\n data-slot='breadcrumb-list'\n className={cn(\n 'flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot='breadcrumb-item'\n className={cn('inline-flex items-center gap-1', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<'a'>) {\n return useRender({\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn('transition-colors hover:text-foreground', className),\n },\n props,\n ),\n render,\n state: {\n slot: 'breadcrumb-link',\n },\n })\n}\n\n/**\n * The current page's entry in the trail — plain text, not a link.\n *\n * Carries `aria-current='page'` and nothing else. The upstream shadcn version\n * adds `role='link' aria-disabled='true'` to a `<span>` that has no `href` and\n * no `tabIndex`, which makes AT announce \"link, dimmed, current page\" for\n * something that is neither a link nor operable, and puts a hand-rolled ARIA\n * role on an element that needs none. axe-core does not flag it, so it\n * survives an a11y gate set to `error`; it is removed deliberately here.\n */\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='breadcrumb-page'\n aria-current='page'\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot='breadcrumb-separator'\n role='presentation'\n aria-hidden='true'\n className={cn('[&>svg]:size-3.5', className)}\n {...props}\n >\n {children ?? <IconChevronRight className='rtl:rotate-180' />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='breadcrumb-ellipsis'\n role='presentation'\n aria-hidden='true'\n className={cn('flex size-4 items-center justify-center [&>svg]:size-3.5', className)}\n {...props}\n >\n <IconMoreHoriz />\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,MAAM,SAAA,GACJ,yGAAA;AASF,MAAM,WAAA,GACJ,kJAAA;AAsBF,MAAM,kBAAA,GAAqB,GAAA,CAAI,CAAC,8BAAA,EAAgC,UAAU,CAAA,EAAG;AAAA,EAC3E,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM,CAAC,wDAAA,EAA0D,SAAS,CAAA;AAAA,MAC1E,IAAA,EAAM;AAAA,QACJ,kHAAA;AAAA,QACA,yIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,iFAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AACF;AACF,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC;AAQD,MAAM,sBAAA,GAAyB;AAY/B,SAAS,WAAW,GAAA,EAA2B;AAC7C,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,SAAA,CAAU,IAAI,CAAA;AAChC,EAAA,KAAA,CAAM,gBAAgB,eAAe,CAAA;AACrC,EAAA,KAAA,CAAM,gBAAgB,gBAAgB,CAAA;AACtC,EAAA,KAAA,CAAM,gBAAgB,eAAe,CAAA;AACrC,EAAA,KAAA,MAAW,EAAA,IAAM,CAAC,KAAA,EAAO,GAAG,KAAA,CAAM,gBAAA,CAAiB,MAAM,CAAC,CAAA,EAAG,EAAA,CAAG,eAAA,CAAgB,IA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,aAAA,EAAY,MAAA;AAAA,MACZ,SAAA,EAAW,EAAA,CAAG,yCAAA,EAA2C,SAAS,CAAA;AAAA,MACjE,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;AAWA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAiC;AACjF,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,iEAAA,EAAmE,SAAS,CAAA;AAAA,MACzF,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,WAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,aAAA,EAAY,QAAO,CAAA,EACpC,CAAA;AAAA,wBACA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAU,QAAA,EAAA,YAAA,EAAU;AAAA;AAAA;AAAA,GACtC;AAEJ","file":"breadcrumb.js","sourcesContent":["'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { IconChevronRight } from '../icons/chevron-right.js'\nimport { IconMoreHoriz } from '../icons/more-horiz.js'\nimport { overlayInk } from '../lib/overlay.js'\nimport { cn } from '../lib/utils.js'\nimport { TouchTarget } from './button.js'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuLinkItem,\n DropdownMenuTrigger,\n} from './dropdown-menu.js'\n\n/**\n * The three variables every non-band look shares: the interactive ink (read\n * from `overlayInk`, so a retune of the ink is one edit — AGENTS.md §3), the\n * current page in the text colour and muted separators. Each variant sets all\n * three itself rather than overriding a base value, so the class string never\n * holds two declarations of one property — the exported `breadcrumbVariants`\n * stays correct without tailwind-merge, where the stylesheet's emission order\n * would otherwise pick the winner.\n */\nconst onSurface =\n '[--bc-current:var(--foreground)] [--bc-ink:var(--overlay-ink)] [--bc-separator:var(--muted-foreground)]'\n\n/**\n * The band and the tint are page chrome, so their content lines up with\n * Header's: the same 16 → 24 → 48px inset (`--header-padding-x`'s ladder,\n * written as disjoint ranges for cascade safety) and the same optional\n * `--header-max-width` column. BreadcrumbList applies both; `default` and\n * `rail` sit in page content and leave them unset. Retune with `--bc-inset`.\n */\nconst chromeInset =\n 'max-sm:[--bc-inset:--spacing(4)] sm:max-lg:[--bc-inset:--spacing(6)] lg:[--bc-inset:--spacing(12)] [--bc-max-width:var(--header-max-width,none)]'\n\n/**\n * The four looks, set on `Breadcrumb` and read by every part through\n * `group-data-*` (DESIGN.md, Breadcrumb):\n *\n * - `default`: no chrome; underlined ink links and chevrons. Use it unless the\n * page has a reason not to.\n * - `rail`: the masterbrand line system — hairlines above and below in the\n * text colour, slash separators. For a page whose top is already quiet.\n * - `band`: the solid brand band — Blue 01 with white links, deepening to\n * `primary-950` in dark exactly as Header's `dark` colour does, so a band\n * under that header stays flush in both modes (AGENTS.md §3 brand band). A\n * dark-only hairline in the ink at 15% keeps its edge on a dark page, where\n * 950 alone is ~1.06:1 against the canvas; under Header it is the band's\n * bottom edge, so it never seams. Labels are white in both modes for the\n * reason Button's solid labels are: `--text-inverse` flips.\n * - `soft`: a 10% ink tint with a 30% ink hairline under it.\n *\n * Every hairline is optical: the padding beside it is 1px shorter, so each\n * look lands on the 4px grid (40px tall, 48px with the ellipsis).\n */\nconst breadcrumbVariants = cva(['group/breadcrumb text-base/6', overlayInk], {\n variants: {\n variant: {\n default: onSurface,\n rail: ['border-y border-foreground py-[calc(--spacing(2)-1px)]', onSurface],\n band: [\n 'bg-primary-800 py-2 dark:border-b dark:border-(--bc-ink)/15 dark:bg-primary-950 dark:pb-[calc(--spacing(2)-1px)]',\n '[--bc-current:var(--color-white)] [--bc-ink:var(--color-white)] [--bc-separator:color-mix(in_oklch,var(--color-white)_72%,transparent)]',\n chromeInset,\n ],\n soft: [\n 'border-b border-(--bc-ink)/30 bg-(--bc-ink)/10 pt-2 pb-[calc(--spacing(2)-1px)]',\n onSurface,\n chromeInset,\n ],\n },\n },\n defaultVariants: { variant: 'default' },\n})\n\n/**\n * The `sideOffset` to give a DropdownMenuContent opened from the ellipsis. The\n * band, tint and rail add up to 8px of their own edge below the 24px trigger,\n * so the menu's default 4px would open it over that edge; 14px clears all\n * four looks.\n */\nconst BREADCRUMB_MENU_OFFSET = 14\n\n/**\n * Whether the full trail would wrap at the nav's current width. Measured on a\n * hidden clone placed beside the nav — same parent, so the same inherited\n * tokens and font — with the collapse state stripped, so a collapsed trail can\n * still ask how long it would be. The clone's list is laid out as one\n * unwrapped, unshrunk row, and the trail would wrap when that row overflows:\n * `scrollWidth` past `clientWidth`. Both are layout widths, so neither item\n * heights (an icon, a looser line height) nor transforms (a zooming dialog)\n * can sway the answer.\n */\nfunction trailWraps(nav: HTMLElement): boolean {\n const probe = nav.cloneNode(true) as HTMLElement\n probe.removeAttribute('data-collapse')\n probe.removeAttribute('data-collapsed')\n probe.removeAttribute('data-measured')\n for (const el of [probe, ...probe.querySelectorAll('[id]')]) el.removeAttribute('id')\n probe.setAttribute('aria-hidden', 'true')\n probe.inert = true\n Object.assign(probe.style, {\n position: 'absolute',\n insetBlockStart: '0',\n insetInlineStart: '0',\n width: `${nav.offsetWidth}px`,\n visibility: 'hidden',\n pointerEvents: 'none',\n })\n const list = probe.querySelector<HTMLElement>('[data-slot=breadcrumb-list]')\n if (!list) return false\n list.style.flexWrap = 'nowrap'\n list.style.whiteSpace = 'nowrap'\n for (const item of list.children) (item as HTMLElement).style.flexShrink = '0'\n nav.after(probe)\n const wraps = list.scrollWidth > list.clientWidth + 1\n probe.remove()\n return wraps\n}\n\n/** A step a collapsed trail hides, offered in its \"…\" menu instead. */\ntype BreadcrumbHiddenStep = { href: string; label: string }\n\nconst NO_HIDDEN_STEPS: BreadcrumbHiddenStep[] = []\n\n/**\n * The links a collapsed trail hides: every item between the first and the\n * parent that holds a link. A team's own ellipsis item has none, so it is\n * left out here and stays visible in the trail.\n */\nfunction hiddenSteps(nav: HTMLElement): BreadcrumbHiddenStep[] {\n const items = [\n ...nav.querySelectorAll<HTMLElement>(\n '[data-slot=breadcrumb-list] > [data-slot=breadcrumb-item]',\n ),\n ]\n return items.slice(1, -2).flatMap((item) => {\n const link = item.querySelector<HTMLAnchorElement>(\n ':scope > [data-slot=breadcrumb-content] > a[href]',\n )\n // `a[href]` matches an empty href too (a link to this page), and the\n // collapse rules treat it as a step, so the menu keeps it as well.\n const href = link?.getAttribute('href')\n return link && href != null ? [{ href, label: link.textContent?.trim() ?? '' }] : []\n })\n}\n\n/** The hidden steps of the enclosing collapsed trail, for the parent's \"…\" menu. */\nconst BreadcrumbHiddenContext = React.createContext<BreadcrumbHiddenStep[]>(NO_HIDDEN_STEPS)\n\n/**\n * The trail's landmark. `aria-label` defaults to \"Breadcrumb\" and can be\n * overridden (a page with two trails needs two names).\n *\n * `collapse` is on by default: when the full trail would wrap, it shortens to\n * its first step, a \"…\" menu of the steps it hides, and the current page's\n * parent — \"Home › … › Licences and permits\". The site root and the way up\n * stay visible and every hidden step is one tap away; the page heading names\n * the current page. The first step and the parent share one row, the parent\n * wrapping within it if its title is long. A team's own ellipsis stays in the\n * trail when it collapses. A trail that fits on one line stays whole at any\n * width, and a trail whose parent is its first step never collapses — there\n * would be nothing to hide but the current page. Pass `collapse={false}` to\n * keep the full trail, which then wraps.\n *\n * The menu's rows are plain links built from the hidden steps' `href`s, so\n * they navigate with a full page load. A team whose framework routes on the\n * client can put its own ellipsis menu in the trail instead.\n *\n * Wrapping is measured, so it needs JavaScript. Until the first measurement —\n * server-rendered HTML, or no script — an eligible trail is shown collapsed,\n * without the menu, at every width: one row that never clips, and the\n * measurement only ever expands it or adds the \"…\", so the page never changes\n * height when it lands. The nav takes `w-full`, which keeps its width\n * independent of its own collapse state; without it a shrink-to-fit parent (a\n * `flex items-center` header) would size it to the collapsed trail and it\n * could never measure wider. It is a plain class, so a consumer `w-*` still\n * wins.\n */\nfunction Breadcrumb({\n className,\n variant,\n collapse = true,\n 'aria-label': ariaLabel = 'Breadcrumb',\n ref,\n ...props\n}: React.ComponentProps<'nav'> &\n VariantProps<typeof breadcrumbVariants> & {\n collapse?: boolean\n }) {\n // VariantProps admits null, which cva reads as \"no variant\" and would leave\n // every --bc-* variable unset.\n const look = variant ?? 'default'\n const collapses = collapse\n const navRef = React.useRef<HTMLElement>(null)\n // null until measured: the CSS width fallback applies until then.\n const [wraps, setWraps] = React.useState<boolean | null>(null)\n const [hidden, setHidden] = React.useState<BreadcrumbHiddenStep[]>(NO_HIDDEN_STEPS)\n\n React.useLayoutEffect(() => {\n const nav = navRef.current\n if (!collapses || !nav) {\n setWraps(null)\n setHidden(NO_HIDDEN_STEPS)\n return\n }\n let frame = 0\n let measuredWidth = -1\n let dirty = true\n /** Re-measures whether the full trail wraps, and records the steps a collapse would hide. */\n const measure = () => {\n const width = nav.offsetWidth\n // Hidden (a display:none ancestor): nothing to learn until it shows,\n // which the ResizeObserver reports. Same width and same content: the\n // answer cannot have changed, so a height-only resize — including the\n // one collapsing causes — costs nothing.\n if (width === 0 || (!dirty && width === measuredWidth)) return\n measuredWidth = width\n dirty = false\n // No link at all: there is nothing to keep, so the trail never collapses.\n const next = nav.querySelector('[data-slot=breadcrumb-list] a[href]')\n ? trailWraps(nav)\n : false\n setWraps(next)\n const steps = next ? hiddenSteps(nav) : NO_HIDDEN_STEPS\n // Keep the same array when nothing changed, so the menu does not\n // re-render (and re-trigger the content observer) for no reason.\n setHidden((prev) => (JSON.stringify(prev) === JSON.stringify(steps) ? prev : steps))\n }\n /** Coalesces observer callbacks into one measurement on the next frame. */\n const schedule = () => {\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(measure)\n }\n measure()\n // The observer's first callback reports the width just measured, so it\n // is skipped above. The probe is a sibling and the state lands as\n // attributes on the nav, so neither observer sees its own measurement.\n // Of attributes, `class` and `style` can change the trail's width without\n // changing the nav's, which a ResizeObserver cannot see, and `href`\n // changes no width but is copied into the \"…\" menu, so a changed\n // destination must rebuild it. Data and ARIA attributes, including the\n // menu trigger's, are left out.\n /** Marks the content changed and re-measures, whatever the width does. */\n const invalidate = () => {\n dirty = true\n schedule()\n }\n const resize = new ResizeObserver(schedule)\n resize.observe(nav)\n const content = new MutationObserver(invalidate)\n content.observe(nav, {\n childList: true,\n characterData: true,\n subtree: true,\n attributeFilter: ['class', 'href', 'style'],\n })\n // A web font that finishes loading changes the trail's width and nothing\n // the observers see (the nav's width holds), so the first measurement,\n // taken in the fallback font, would otherwise stand until the next\n // resize. Re-measure once the fonts in use are ready and on every later\n // load.\n const fonts = document.fonts as FontFaceSet | undefined\n let disposed = false\n fonts?.ready.then(() => {\n if (!disposed) invalidate()\n })\n fonts?.addEventListener('loadingdone', invalidate)\n return () => {\n disposed = true\n cancelAnimationFrame(frame)\n resize.disconnect()\n content.disconnect()\n fonts?.removeEventListener('loadingdone', invalidate)\n }\n }, [collapses])\n\n return (\n <BreadcrumbHiddenContext.Provider value={collapses && wraps ? hidden : NO_HIDDEN_STEPS}>\n <nav\n ref={(node) => {\n navRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n aria-label={ariaLabel}\n data-slot='breadcrumb'\n data-variant={look}\n data-collapse={collapses || undefined}\n data-measured={collapses && wraps !== null ? '' : undefined}\n data-collapsed={collapses && wraps ? '' : undefined}\n className={cn(breadcrumbVariants({ variant: look }), collapses && 'w-full', className)}\n {...props}\n />\n </BreadcrumbHiddenContext.Provider>\n )\n}\n\n/**\n * Default separators are drawn by the item after them (BreadcrumbItem's lead),\n * so a wrapped line starts with its separator and its target together instead\n * of stranding a chevron at the end of the line above. The separator `<li>`\n * stays in the tree — it is what the collapse rules count — but renders\n * nothing. A separator with custom children is drawn where it stands. Rows\n * sit 8px apart, 20px on a coarse pointer so the 44px touch targets of\n * neighbouring rows never overlap.\n *\n * The collapse rules key on the trail's shape rather than on markers the\n * consumer must add: the parent is the item two before the end, with a\n * separator between it and the current page. A collapsed trail keeps the\n * first item, any ellipsis item a team supplied, and that parent, and hides\n * the rest; the parent's \"…\" menu (BreadcrumbItem) offers what was hidden. The\n * rules apply only when the parent is a link and not the first item, so a\n * trail of one or two steps, or one whose parent slot is an ellipsis, stays\n * whole. A custom separator before the parent stays, so the kept steps are\n * still divided. The first item keeps its width and the parent takes the\n * rest of the row, wrapping within it if its title is long. (One `:has()` per\n * condition: `:has()` cannot nest.) The rules are written for the measured\n * state (`data-collapsed`) and again for the stand-in before measurement,\n * which collapses an eligible trail at every width.\n */\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {\n return (\n <ol\n data-slot='breadcrumb-list'\n className={cn(\n 'mx-auto flex max-w-(--bc-max-width) flex-wrap items-center gap-x-2 px-(--bc-inset) wrap-break-word text-(--bc-separator) not-pointer-coarse:gap-y-2 group-data-[variant=rail]/breadcrumb:gap-x-3 pointer-coarse:gap-y-5',\n '[&>[data-slot=breadcrumb-separator]:not([data-custom])]:hidden',\n 'group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:not(:first-child):not(:nth-last-child(3)):not([data-custom]:nth-last-child(4)):not(:has(>[data-slot=breadcrumb-content]>button>[data-slot=breadcrumb-ellipsis]))]:hidden',\n 'group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:not(:first-child):not(:nth-last-child(3)):not([data-custom]:nth-last-child(4)):not(:has(>[data-slot=breadcrumb-content]>button>[data-slot=breadcrumb-ellipsis]))]:hidden',\n 'group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:shrink-0 group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:self-start group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:shrink-0 group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:first-child]:self-start group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)]:flex-1 group-[[data-collapse]:not([data-measured])]/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)]:flex-1',\n 'group-data-collapsed/breadcrumb:[&:has(>[data-slot=breadcrumb-item]:nth-last-child(3):not(:first-child)>[data-slot=breadcrumb-content]>a[href]):has(>[data-slot=breadcrumb-separator]:nth-last-child(2))>li:nth-last-child(3)>[data-slot=breadcrumb-content]>[data-slot=breadcrumb-more]]:inline-flex',\n className,\n )}\n {...props}\n />\n )\n}\n\n/**\n * The \"…\" a collapsed trail adds before its parent: a menu of the steps it\n * hides, then the look's separator. It is rendered in every item while the\n * trail is collapsed and hidden steps exist, and BreadcrumbList shows it only\n * in the parent — inside that item, so the tab order matches what is seen:\n * Home, …, parent. The rows are underlined like the trail's links.\n */\nfunction BreadcrumbMore({ steps }: { steps: BreadcrumbHiddenStep[] }) {\n return (\n <span\n data-slot='breadcrumb-more'\n className='me-2 hidden items-center gap-2 align-top group-data-[variant=rail]/breadcrumb:me-3 group-data-[variant=rail]/breadcrumb:gap-3'\n >\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label={`Show ${steps.length} more ${steps.length === 1 ? 'page' : 'pages'}`}\n >\n <BreadcrumbEllipsis />\n </DropdownMenuTrigger>\n <DropdownMenuContent sideOffset={BREADCRUMB_MENU_OFFSET}>\n {steps.map((step) => (\n <DropdownMenuLinkItem\n key={`${step.href} ${step.label}`}\n href={step.href}\n className='underline underline-offset-4'\n >\n {step.label}\n </DropdownMenuLinkItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n <span aria-hidden='true' className='inline-flex shrink-0 [&>svg]:size-5'>\n <IconChevronRight className='group-data-[variant=rail]/breadcrumb:hidden rtl:rotate-180' />\n <span className='hidden text-xl/6 group-data-[variant=rail]/breadcrumb:inline'>/</span>\n </span>\n </span>\n )\n}\n\n/**\n * One step in the trail: the separator glyph it leads with, then its content.\n * The glyph — a chevron, or a slash on the rail — shows only when a default\n * BreadcrumbSeparator precedes the item, so the first item never carries one.\n * It aligns to the first line of a label that wraps, and to the centre of the\n * ellipsis trigger.\n *\n * The content sits in its own span so the link inside stays inline: a flex\n * item is blockified, and a block `<a>` would draw one rectangular halo and\n * focus ring round a wrapped label instead of one per line.\n *\n * A `<button>` whose direct child is a `BreadcrumbEllipsis` is styled as the\n * ellipsis trigger, which keeps the trail composable with `DropdownMenuTrigger`\n * (or any other trigger), and so is the \"…\" a collapsed trail adds. It is a\n * 24px control on the 4px radius — one line tall, so a row never changes\n * height with it — tinted from the ink at 10% on hover and 20% while\n * pressed or open, with the system's 2px offset focus ring and, in forced\n * colours (where tints are dropped), a 1px border. The selector sits inside\n * `:where()` so it carries no specificity: a `className` on the trigger itself\n * still wins.\n */\nfunction BreadcrumbItem({ className, children, ...props }: React.ComponentProps<'li'>) {\n const hidden = React.useContext(BreadcrumbHiddenContext)\n return (\n <li\n data-slot='breadcrumb-item'\n className={cn(\n 'inline-flex min-w-0 items-start gap-2 group-data-[variant=rail]/breadcrumb:gap-3 has-[>[data-slot=breadcrumb-content]>button]:items-center',\n '[[data-slot=breadcrumb-separator]:not([data-custom])+&>[data-slot=breadcrumb-lead]]:inline-flex',\n '[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:relative [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:inline-flex [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:size-6 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:cursor-pointer [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:items-center [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:justify-center [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:rounded-sm [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:bg-transparent [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:px-0 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:text-(--bc-ink) [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:motion-safe:transition-[color,background-color]',\n '[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:not-forced-colors:border-0 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:forced-colors:border',\n '[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:hover:bg-(--bc-ink)/10 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:active:bg-(--bc-ink)/20 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:aria-expanded:bg-(--bc-ink)/20',\n '[:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-2 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-offset-2 [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-(--bc-ink) [:where(&>[data-slot=breadcrumb-content]_button:has(>[data-slot=breadcrumb-ellipsis]))]:focus-visible:outline-solid',\n className,\n )}\n {...props}\n >\n <span\n data-slot='breadcrumb-lead'\n aria-hidden='true'\n className='hidden h-6 shrink-0 items-center [&>svg]:size-5'\n >\n <IconChevronRight className='group-data-[variant=rail]/breadcrumb:hidden rtl:rotate-180' />\n <span className='hidden text-xl/6 group-data-[variant=rail]/breadcrumb:inline'>/</span>\n </span>\n <span data-slot='breadcrumb-content' className='min-w-0 has-[>button]:flex'>\n {hidden.length > 0 && <BreadcrumbMore steps={hidden} />}\n {children}\n </span>\n </li>\n )\n}\n\n/**\n * A link in the trail, in the system's link signature (DESIGN.md, Links):\n * medium weight, underlined in the ink at 4px offset, a 10% ink halo with a\n * 2px underline on hover and an 18% halo while pressed, and the 2px offset\n * focus ring in the ink, which appears in the ink at once: the transition\n * leaves `outline-color` out, so the ring never fades in from the base layer's\n * grey. The halo is Link's recipe, mixed in the same oklch\n * space; it is reproduced rather than reusing `linkVariants` because Link's\n * `primary` colour is fixed while a trail's ink changes with its look (white\n * on the band). There is deliberately no visited colour: a trail is\n * wayfinding, and a visited step is not information.\n *\n * A coarse-pointer TouchTarget rides inside the link's target, expanding the\n * hit area to 44px without growing the box (the Same-Floor Rule). It is only\n * added when the text comes through `children`; a link whose text lives\n * inside its `render` element keeps that text and goes without it.\n */\nfunction BreadcrumbLink({ className, render, children, ...props }: useRender.ComponentProps<'a'>) {\n return useRender({\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn(\n 'relative box-decoration-clone font-medium text-(--bc-ink) underline decoration-1 underline-offset-4 motion-safe:transition-[color,background-color,text-decoration-color,box-shadow]',\n '[--bc-halo-active:color-mix(in_oklch,var(--bc-ink)_18%,transparent)] [--bc-halo:color-mix(in_oklch,var(--bc-ink)_10%,transparent)]',\n 'hover:bg-(--bc-halo) hover:decoration-2 hover:shadow-[0_-2px_0_var(--bc-halo),0_4px_0_var(--bc-halo)]',\n 'active:bg-(--bc-halo-active) active:decoration-2 active:shadow-[0_-2px_0_var(--bc-halo-active),0_4px_0_var(--bc-halo-active)]',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--bc-ink) focus-visible:outline-solid',\n className,\n ),\n ...(children !== undefined && {\n children: <TouchTarget>{children}</TouchTarget>,\n }),\n },\n props,\n ),\n render,\n state: {\n slot: 'breadcrumb-link',\n },\n })\n}\n\n/**\n * The current page's entry in the trail — plain text, not a link.\n *\n * Carries `aria-current='page'` and nothing else. The upstream shadcn version\n * adds `role='link' aria-disabled='true'` to a `<span>` that has no `href` and\n * no `tabIndex`, which makes AT announce \"link, dimmed, current page\" for\n * something that is neither a link nor operable, and puts a hand-rolled ARIA\n * role on an element that needs none. axe-core does not flag it, so it\n * survives an a11y gate set to `error`; it is removed deliberately here.\n *\n * Regular weight under the links' medium on every look: the step you are on is\n * the one you cannot follow, so it is never the heaviest word in the trail.\n */\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='breadcrumb-page'\n aria-current='page'\n className={cn('font-normal text-(--bc-current)', className)}\n {...props}\n />\n )\n}\n\n/**\n * Marks the step boundary. Decorative and hidden from assistive tech. Left\n * empty, it draws nothing itself: the item after it leads with the look's\n * glyph (BreadcrumbItem), so the glyph wraps with its target. Given children,\n * it draws them where it stands, as before.\n */\nfunction BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot='breadcrumb-separator'\n data-custom={children === undefined ? undefined : ''}\n role='presentation'\n aria-hidden='true'\n className={cn('inline-flex items-center [&>svg]:size-5', className)}\n {...props}\n >\n {children}\n </li>\n )\n}\n\n/**\n * The collapsed-steps glyph, with \"More pages\" for screen readers so a trigger\n * built around it is never unnamed. Put it as the only child of a trigger and\n * name the trigger by what it reveals, e.g.\n * `<DropdownMenuTrigger aria-label='Show 2 more pages'><BreadcrumbEllipsis /></DropdownMenuTrigger>`.\n * BreadcrumbItem styles that trigger, and the glyph carries a coarse-pointer\n * TouchTarget so the 24px control still takes a 44px tap. Open the menu with\n * `sideOffset={BREADCRUMB_MENU_OFFSET}`.\n */\nfunction BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='breadcrumb-ellipsis'\n className={cn('relative flex size-6 items-center justify-center [&_svg]:size-6', className)}\n {...props}\n >\n <TouchTarget>\n <IconMoreHoriz aria-hidden='true' />\n </TouchTarget>\n <span className='sr-only'>More pages</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BREADCRUMB_MENU_OFFSET,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n breadcrumbVariants,\n}\n"]}
|
|
@@ -13,7 +13,7 @@ import './link.js';
|
|
|
13
13
|
*/
|
|
14
14
|
declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
15
15
|
declare const inputGroupAddonVariants: (props?: ({
|
|
16
|
-
align?: "inline-
|
|
16
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
17
17
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
18
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
19
19
|
declare const inputGroupButtonVariants: (props?: ({
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
|
|
3
3
|
export { AspectRatio } from './components/aspect-ratio.js';
|
|
4
4
|
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from './components/avatar.js';
|
|
5
5
|
export { Badge, BadgeProps, badgeVariants } from './components/badge.js';
|
|
6
|
-
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from './components/breadcrumb.js';
|
|
6
|
+
export { BREADCRUMB_MENU_OFFSET, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, breadcrumbVariants } from './components/breadcrumb.js';
|
|
7
7
|
export { ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, ButtonGroupVariant, buttonGroupVariants } from './components/button-group.js';
|
|
8
8
|
export { Button, ButtonLink, ButtonLinkProps, ButtonProps, IconSlot, TouchTarget, buttonColorVariants, buttonVariants } from './components/button.js';
|
|
9
9
|
export { Alert, AlertProps, AlertStatus, Callout, CalloutProps, CalloutStatus, alertVariants, calloutVariants } from './components/callout.js';
|