@fiestaboard/ui 5.0.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chrome/breadcrumb.d.ts +43 -0
- package/dist/components/chrome/breadcrumb.js +76 -0
- package/dist/components/chrome/breadcrumb.js.map +1 -0
- package/dist/components/chrome/sidebar.d.ts +8 -1
- package/dist/components/chrome/sidebar.js +106 -102
- package/dist/components/chrome/sidebar.js.map +1 -1
- package/dist/components/data/bar-list.d.ts +81 -0
- package/dist/components/data/bar-list.js +54 -0
- package/dist/components/data/bar-list.js.map +1 -0
- package/dist/components/data/stat-strip.d.ts +86 -0
- package/dist/components/data/stat-strip.js +36 -0
- package/dist/components/data/stat-strip.js.map +1 -0
- package/dist/components/feedback/chip.d.ts +28 -0
- package/dist/components/feedback/chip.js +29 -0
- package/dist/components/feedback/chip.js.map +1 -0
- package/dist/components/forms/toggle.d.ts +56 -0
- package/dist/components/forms/toggle.js +97 -0
- package/dist/components/forms/toggle.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +95 -90
- package/dist/theme.css +55 -10
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Breadcrumb({ className, ...props }: Omit<React.ComponentProps<"nav">, "aria-label"> & {
|
|
3
|
+
/**
|
|
4
|
+
* Localized accessible name for the landmark (e.g. "Breadcrumb"). Required:
|
|
5
|
+
* an unnamed nav is indistinguishable from the site nav in a landmark list,
|
|
6
|
+
* and the repo does not ship English defaults for consumers to forget.
|
|
7
|
+
*/
|
|
8
|
+
"aria-label": string;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
11
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* A crumb that navigates. `asChild` (same useRender mechanics as Badge) lets
|
|
14
|
+
* the docs site pass Docusaurus's `<Link>` — router-aware prefetch and
|
|
15
|
+
* base-path handling — while this component keeps owning the look.
|
|
16
|
+
*/
|
|
17
|
+
declare function BreadcrumbLink({ className, asChild, children, ref, ...props }: React.ComponentProps<"a"> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
20
|
+
/** The trail's final entry: where you are, so it announces but never navigates. */
|
|
21
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* Visual divider between crumbs. Children override the glyph (the docs site
|
|
24
|
+
* may want `/`); the default chevron reads as "descends into" in LTR.
|
|
25
|
+
*/
|
|
26
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Collapsed-middle marker for deep trails. Static by design: expand/collapse
|
|
29
|
+
* behaviour belongs to the consumer (wrap it in a DropdownMenu trigger via
|
|
30
|
+
* that component's own mechanics); baking a disclosure in here would force a
|
|
31
|
+
* hook — and "use client" — onto every static docs page for a control most
|
|
32
|
+
* trails never show.
|
|
33
|
+
*/
|
|
34
|
+
declare function BreadcrumbEllipsis({ label, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
35
|
+
/**
|
|
36
|
+
* Localized sr-only announcement (e.g. "More pages"). Required, and NOT
|
|
37
|
+
* `aria-hidden` on the wrapper like shadcn's version — hiding the whole
|
|
38
|
+
* span silences the sr-only text inside it, leaving AT users with no hint
|
|
39
|
+
* that levels were elided. Only the glyph is hidden.
|
|
40
|
+
*/
|
|
41
|
+
label: string;
|
|
42
|
+
}): React.JSX.Element;
|
|
43
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { ChevronRight as t, MoreHorizontal as n } from "lucide-react";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { useRender as o } from "@base-ui/react/use-render";
|
|
6
|
+
//#region src/components/chrome/breadcrumb.tsx
|
|
7
|
+
function s({ className: e, ...t }) {
|
|
8
|
+
return /* @__PURE__ */ i("nav", {
|
|
9
|
+
"data-slot": "breadcrumb",
|
|
10
|
+
className: e,
|
|
11
|
+
...t
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function c({ className: t, ...n }) {
|
|
15
|
+
return /* @__PURE__ */ i("ol", {
|
|
16
|
+
"data-slot": "breadcrumb-list",
|
|
17
|
+
className: e("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5", t),
|
|
18
|
+
...n
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function l({ className: t, ...n }) {
|
|
22
|
+
return /* @__PURE__ */ i("li", {
|
|
23
|
+
"data-slot": "breadcrumb-item",
|
|
24
|
+
className: e("inline-flex items-center gap-1.5", t),
|
|
25
|
+
...n
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function u({ className: t, asChild: n = !1, children: i, ref: a, ...s }) {
|
|
29
|
+
return o({
|
|
30
|
+
defaultTagName: "a",
|
|
31
|
+
ref: a,
|
|
32
|
+
render: n ? r.Children.only(i) : void 0,
|
|
33
|
+
props: {
|
|
34
|
+
"data-slot": "breadcrumb-link",
|
|
35
|
+
className: e("focus-ring rounded-sm transition-colors hover:text-foreground", t),
|
|
36
|
+
...n ? {} : { children: i },
|
|
37
|
+
...s
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function d({ className: t, ...n }) {
|
|
42
|
+
return /* @__PURE__ */ i("span", {
|
|
43
|
+
"data-slot": "breadcrumb-page",
|
|
44
|
+
"aria-current": "page",
|
|
45
|
+
className: e("text-foreground font-normal", t),
|
|
46
|
+
...n
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function f({ children: n, className: r, ...a }) {
|
|
50
|
+
return /* @__PURE__ */ i("li", {
|
|
51
|
+
"data-slot": "breadcrumb-separator",
|
|
52
|
+
role: "presentation",
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: e("[&>svg]:size-3.5", r),
|
|
55
|
+
...a,
|
|
56
|
+
children: n ?? /* @__PURE__ */ i(t, {})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function p({ label: t, className: r, ...o }) {
|
|
60
|
+
return /* @__PURE__ */ a("span", {
|
|
61
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
62
|
+
className: e("flex items-center justify-center", r),
|
|
63
|
+
...o,
|
|
64
|
+
children: [/* @__PURE__ */ i(n, {
|
|
65
|
+
className: "size-4",
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}), /* @__PURE__ */ i("span", {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: t
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { s as Breadcrumb, p as BreadcrumbEllipsis, l as BreadcrumbItem, u as BreadcrumbLink, c as BreadcrumbList, d as BreadcrumbPage, f as BreadcrumbSeparator };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../src/components/chrome/breadcrumb.tsx"],"mappings":";;;;;;AAoCA,SAAS,EAAW,EAClB,cACA,GAAG,KAQF;CACD,OAAO,kBAAC,OAAD;EAAK,aAAU;EAAwB;EAAW,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,EAAe,EAAE,cAAW,GAAG,KAAqC;CAC3E,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAW,EAGT,4FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAe,EAAE,cAAW,GAAG,KAAqC;CAC3E,OAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,WAAW,EAAG,oCAAoC,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnH;AAOA,SAAS,EAAe,EACtB,cACA,aAAU,IACV,aACA,QACA,GAAG,KACiD;CACpD,OAAO,EAAU;EACf,gBAAgB;EACX;EACL,QAAQ,IAAW,EAAM,SAAS,KAAK,CAAQ,IAA2B,KAAA;EAC1E,OAAO;GACL,aAAa;GAOb,WAAW,EAAG,iEAAiE,CAAS;GACxF,GAAI,IAAU,CAAC,IAAI,EAAE,YAAS;GAC9B,GAAG;EACL;CACF,CAAC;AACH;AAGA,SAAS,EAAe,EAAE,cAAW,GAAG,KAAuC;CAC7E,OACE,kBAAC,QAAD;EACE,aAAU;EACV,gBAAa;EACb,WAAW,EAAG,+BAA+B,CAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAMA,SAAS,EAAoB,EAAE,aAAU,cAAW,GAAG,KAAqC;CAC1F,OAKE,kBAAC,MAAD;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,EAAG,oBAAoB,CAAS;EAC3C,GAAI;EAEH,UAAA,KAAY,kBAAC,GAAD,CAAe,CAAA;CAC1B,CAAA;AAER;AASA,SAAS,EAAmB,EAC1B,UACA,cACA,GAAG,KASF;CACD,OACE,kBAAC,QAAD;EAAM,aAAU;EAAsB,WAAW,EAAG,oCAAoC,CAAS;EAAG,GAAI;EAAxG,UAAA,CACE,kBAAC,GAAD;GAAgB,WAAU;GAAS,eAAY;EAAQ,CAAA,GACvD,kBAAC,QAAD;GAAM,WAAU;GAAW,UAAA;EAAY,CAAA,CACnC;;AAEV"}
|
|
@@ -55,7 +55,14 @@ export interface SidebarProps {
|
|
|
55
55
|
logoIconSrc?: string;
|
|
56
56
|
/** Click handler for the logo. When present, the lockup renders as a button. */
|
|
57
57
|
onLogoClick?: (e: React.MouseEvent) => void;
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* AI assistant nav entry; omit to hide. Renders as the LAST ROW of the main
|
|
60
|
+
* nav list — visually identical to the items around it, scrolling with
|
|
61
|
+
* them. It used to be its own one-row section between two hairlines below
|
|
62
|
+
* the list; a single entry fenced off by dividers read as a stranded
|
|
63
|
+
* mini-menu, and every hairline it added shrank the space the list had
|
|
64
|
+
* before it needed to scroll.
|
|
65
|
+
*/
|
|
59
66
|
ai?: {
|
|
60
67
|
active: boolean;
|
|
61
68
|
onOpen: () => void;
|
|
@@ -4,19 +4,19 @@ import { Button as t } from "../forms/button.js";
|
|
|
4
4
|
import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "../overlays/tooltip.js";
|
|
5
5
|
import { FIESTA_ICON_DATA_URI as o } from "./fiesta-icon.js";
|
|
6
6
|
import { FiestaLogo as s } from "./fiesta-logo.js";
|
|
7
|
-
import { ChevronLeft as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Fragment as
|
|
7
|
+
import { ChevronLeft as ee, ChevronRight as te, Menu as ne, Sparkles as c, X as l } from "lucide-react";
|
|
8
|
+
import { Fragment as u, memo as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
9
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/chrome/sidebar.tsx
|
|
11
|
-
var
|
|
11
|
+
var v = "nav-active font-semibold", y = "text-sidebar-foreground nav-active-hover", b = "flex items-center gap-3 rounded-lg px-4 py-3 text-base font-medium min-h-[48px]", x = e(b, v), S = e(b, y), C = "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-base font-medium min-h-[48px]", w = e(C, v), T = e(C, y), E = "flex items-center gap-3 py-2 pl-[14px] pr-3 rounded-lg text-sm font-medium transition-colors", D = e(E, v), re = e(E, y), O = "flex w-full items-center gap-3 py-2 pl-[14px] pr-3 rounded-lg text-sm font-medium transition-colors", k = e(O, v), A = e(O, y), j = "whitespace-nowrap overflow-hidden transition-opacity duration-fast", M = e(j, "opacity-0 max-w-0"), N = e(j, "opacity-100 max-w-48 delay-150"), P = "lg:hidden fixed inset-0 z-[var(--z-mobile-backdrop)] bg-black/25 backdrop-blur-[2px] transition-opacity duration-base pointer-events-none", ie = e(P, "opacity-100 pointer-events-auto"), F = e(P, "opacity-0"), I = "lg:hidden fixed top-[calc(var(--mobile-header-height,56px)+16px)] left-3 right-3 z-[var(--z-mobile-menu)] flex max-h-[calc(100dvh-var(--mobile-header-height,56px)-2rem)] flex-col overflow-hidden sidebar-gradient-horizontal", ae = e(I, "opacity-100"), oe = e(I, "opacity-0 pointer-events-none"), L = "clip-path var(--motion-duration-slower) var(--motion-ease-spring), opacity var(--motion-duration-exit) var(--motion-ease-standard)", se = {
|
|
12
12
|
clipPath: "inset(0 0 0 0 round var(--radius-chrome-mobile, 16px))",
|
|
13
|
-
transition:
|
|
13
|
+
transition: L
|
|
14
14
|
}, R = {
|
|
15
15
|
clipPath: "inset(0 0 100% 0 round var(--radius-chrome-mobile, 16px))",
|
|
16
|
-
transition:
|
|
17
|
-
}, z = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", B =
|
|
18
|
-
let [K, q] =
|
|
19
|
-
|
|
16
|
+
transition: L
|
|
17
|
+
}, z = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", B = d(function({ labels: d, primaryItems: v, secondaryItems: y, renderLink: b, collapsed: C, transitioning: E = !1, onToggleCollapsed: O, onTransitionEnd: j, logoIconSrc: P = o, onLogoClick: I, ai: L, boardSelector: B, mobileBoardSelector: V, renderAccount: H, versionSlot: U, themeToggleSlot: W, maxWidth: G, sidebarInset: ce }) {
|
|
18
|
+
let [K, q] = m(!1), [le, ue] = m(0), J = p(null), Y = p(null), X = p(null);
|
|
19
|
+
f(() => {
|
|
20
20
|
let e = J.current;
|
|
21
21
|
if (!e) return;
|
|
22
22
|
let t = null, n = "", r = () => {
|
|
@@ -29,9 +29,9 @@ var y = "nav-active font-semibold", b = "text-sidebar-foreground nav-active-hove
|
|
|
29
29
|
return i.observe(e), r(), () => {
|
|
30
30
|
i.disconnect(), t !== null && cancelAnimationFrame(t), document.documentElement.style.removeProperty("--mobile-header-height");
|
|
31
31
|
};
|
|
32
|
-
}, []),
|
|
32
|
+
}, []), f(() => (K ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
33
33
|
document.body.style.overflow = "";
|
|
34
|
-
}), [K]),
|
|
34
|
+
}), [K]), f(() => {
|
|
35
35
|
if (K) {
|
|
36
36
|
let e = Y.current;
|
|
37
37
|
(e?.querySelector(z) ?? e)?.focus();
|
|
@@ -55,7 +55,7 @@ var y = "nav-active font-semibold", b = "text-sidebar-foreground nav-active-hove
|
|
|
55
55
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
56
56
|
e.shiftKey ? (a === r || a === t) && (e.preventDefault(), i.focus()) : a === i && (e.preventDefault(), r.focus());
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
f(() => {
|
|
59
59
|
let e = null, t = () => {
|
|
60
60
|
e = null;
|
|
61
61
|
let t = Math.max(0, (document.body.clientWidth - G) / 2);
|
|
@@ -68,219 +68,223 @@ var y = "nav-active font-semibold", b = "text-sidebar-foreground nav-active-hove
|
|
|
68
68
|
};
|
|
69
69
|
}, [G]);
|
|
70
70
|
function Z(e) {
|
|
71
|
-
let t = e.icon, n = e.active ?
|
|
72
|
-
return e.external ? /* @__PURE__ */
|
|
71
|
+
let t = e.icon, n = e.active ? x : S;
|
|
72
|
+
return e.external ? /* @__PURE__ */ _("a", {
|
|
73
73
|
href: e.href,
|
|
74
74
|
target: "_blank",
|
|
75
75
|
rel: "noopener noreferrer",
|
|
76
76
|
onClick: () => q(!1),
|
|
77
77
|
className: n,
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
-
}, e.key) : /* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ g(t, { className: "h-5 w-5" }), e.label]
|
|
79
|
+
}, e.key) : /* @__PURE__ */ g("span", {
|
|
80
80
|
className: "contents",
|
|
81
|
-
children:
|
|
81
|
+
children: b({
|
|
82
82
|
href: e.href,
|
|
83
83
|
onClick: () => q(!1),
|
|
84
84
|
onMouseEnter: e.onPrefetch,
|
|
85
85
|
onFocus: e.onPrefetch,
|
|
86
86
|
className: n,
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(t, { className: "h-5 w-5" }), e.label] })
|
|
88
88
|
}, e)
|
|
89
89
|
}, e.key);
|
|
90
90
|
}
|
|
91
91
|
function Q(e) {
|
|
92
|
-
let t = e.icon, i = e.active ?
|
|
93
|
-
className:
|
|
92
|
+
let t = e.icon, i = e.active ? D : re, o = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(t, { className: "h-5 w-5 flex-shrink-0" }), /* @__PURE__ */ g("span", {
|
|
93
|
+
className: C ? M : N,
|
|
94
94
|
children: e.label
|
|
95
|
-
})] }), s = e.external ? /* @__PURE__ */
|
|
95
|
+
})] }), s = e.external ? /* @__PURE__ */ g("a", {
|
|
96
96
|
href: e.href,
|
|
97
97
|
target: "_blank",
|
|
98
98
|
rel: "noopener noreferrer",
|
|
99
99
|
className: i,
|
|
100
|
-
"aria-label":
|
|
100
|
+
"aria-label": C ? e.label : void 0,
|
|
101
101
|
children: o
|
|
102
|
-
}) :
|
|
102
|
+
}) : b({
|
|
103
103
|
href: e.href,
|
|
104
104
|
onMouseEnter: e.onPrefetch,
|
|
105
105
|
onFocus: e.onPrefetch,
|
|
106
106
|
className: i,
|
|
107
|
-
"aria-label":
|
|
107
|
+
"aria-label": C ? e.label : void 0,
|
|
108
108
|
children: o
|
|
109
109
|
}, e);
|
|
110
|
-
return
|
|
110
|
+
return C ? /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
111
111
|
asChild: !0,
|
|
112
112
|
children: s
|
|
113
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ g(r, {
|
|
114
114
|
side: "right",
|
|
115
115
|
className: "font-medium",
|
|
116
116
|
children: e.label
|
|
117
|
-
})] }, e.key) : /* @__PURE__ */
|
|
117
|
+
})] }, e.key) : /* @__PURE__ */ g(u, { children: s }, e.key);
|
|
118
118
|
}
|
|
119
119
|
let $ = (t) => {
|
|
120
|
-
let n = t === "mobile" ? /* @__PURE__ */
|
|
120
|
+
let n = t === "mobile" ? /* @__PURE__ */ g(s, {
|
|
121
121
|
size: "sm",
|
|
122
122
|
className: "logo-on-gradient whitespace-nowrap"
|
|
123
|
-
}) : /* @__PURE__ */
|
|
123
|
+
}) : /* @__PURE__ */ g(s, { className: e("logo-on-gradient whitespace-nowrap overflow-hidden transition-opacity duration-fast", C ? "opacity-0 max-w-0" : "opacity-100 max-w-48 delay-150") }), r = /* @__PURE__ */ g("img", {
|
|
124
124
|
src: P,
|
|
125
125
|
alt: "",
|
|
126
126
|
width: 32,
|
|
127
127
|
height: 32,
|
|
128
128
|
className: "flex-shrink-0"
|
|
129
129
|
}), i = t === "mobile" ? "flex items-center gap-3 flex-1 ml-2" : "flex items-center gap-2 overflow-hidden px-4 py-4";
|
|
130
|
-
return
|
|
130
|
+
return I ? /* @__PURE__ */ _("button", {
|
|
131
131
|
type: "button",
|
|
132
|
-
onClick:
|
|
133
|
-
"aria-label":
|
|
132
|
+
onClick: I,
|
|
133
|
+
"aria-label": d.logoButtonAriaLabel,
|
|
134
134
|
className: e(i, "cursor-pointer text-left", t === "desktop" && "w-full"),
|
|
135
135
|
children: [r, n]
|
|
136
|
-
}) : /* @__PURE__ */
|
|
136
|
+
}) : /* @__PURE__ */ _("div", {
|
|
137
137
|
className: i,
|
|
138
138
|
children: [r, n]
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ _(h, { children: [
|
|
142
|
+
/* @__PURE__ */ g("header", {
|
|
143
143
|
ref: J,
|
|
144
144
|
className: "lg:hidden fixed top-2 left-3 right-3 z-[var(--z-mobile-header)] overflow-hidden sidebar-gradient-horizontal",
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ _("div", {
|
|
146
146
|
className: "relative z-[1] flex min-h-14 flex-wrap items-center gap-y-2 px-3 py-2",
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ g(t, {
|
|
149
149
|
variant: "ghost",
|
|
150
150
|
size: "icon",
|
|
151
151
|
className: "h-9 w-9 flex-shrink-0 -ml-2 text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
152
152
|
onClick: (e) => {
|
|
153
153
|
K || (X.current = e.currentTarget), q(!K);
|
|
154
154
|
},
|
|
155
|
-
"aria-label": K ?
|
|
156
|
-
children:
|
|
155
|
+
"aria-label": K ? d.closeMenu : d.openMenu,
|
|
156
|
+
children: g(K ? l : ne, { className: "h-6 w-6" })
|
|
157
157
|
}),
|
|
158
158
|
$("mobile"),
|
|
159
|
-
V && /* @__PURE__ */
|
|
159
|
+
V && /* @__PURE__ */ g("div", {
|
|
160
160
|
className: "ml-auto pl-2 flex-shrink-0",
|
|
161
161
|
children: V
|
|
162
162
|
})
|
|
163
163
|
]
|
|
164
164
|
})
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ g("div", {
|
|
167
167
|
"data-testid": "mobile-backdrop",
|
|
168
|
-
className: K ? ie :
|
|
168
|
+
className: K ? ie : F,
|
|
169
169
|
onClick: () => q(!1),
|
|
170
170
|
"aria-hidden": "true"
|
|
171
171
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ _("div", {
|
|
173
173
|
ref: Y,
|
|
174
|
-
className: K ?
|
|
174
|
+
className: K ? ae : oe,
|
|
175
175
|
role: K ? "dialog" : void 0,
|
|
176
176
|
"aria-modal": K ? !0 : void 0,
|
|
177
|
-
"aria-label": K ?
|
|
177
|
+
"aria-label": K ? d.navigationMenu : void 0,
|
|
178
178
|
"aria-hidden": !K,
|
|
179
179
|
inert: !K || void 0,
|
|
180
180
|
tabIndex: K ? -1 : void 0,
|
|
181
181
|
onKeyDown: de,
|
|
182
|
-
style: K ?
|
|
182
|
+
style: K ? se : R,
|
|
183
183
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
"aria-label":
|
|
184
|
+
/* @__PURE__ */ _("nav", {
|
|
185
|
+
"aria-label": d.primaryNavigation,
|
|
186
186
|
className: "min-h-0 flex-1 space-y-1 overflow-y-auto px-3 py-4",
|
|
187
|
-
children: [
|
|
187
|
+
children: [v.map(Z), L && /* @__PURE__ */ _("button", {
|
|
188
188
|
type: "button",
|
|
189
189
|
onClick: () => {
|
|
190
|
-
|
|
190
|
+
L.onOpen(), q(!1);
|
|
191
191
|
},
|
|
192
|
-
className:
|
|
193
|
-
children: [/* @__PURE__ */
|
|
192
|
+
className: L.active ? w : T,
|
|
193
|
+
children: [/* @__PURE__ */ g(c, { className: "h-5 w-5" }), d.aiAssistant]
|
|
194
194
|
})]
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ g("div", { className: "shrink-0 border-t border-sidebar-border mx-3" }),
|
|
197
|
+
/* @__PURE__ */ _("div", {
|
|
198
198
|
className: "shrink-0 px-3 py-3 text-sidebar-foreground",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
-
"aria-label":
|
|
199
|
+
children: [/* @__PURE__ */ _("nav", {
|
|
200
|
+
"aria-label": d.secondaryNavigation,
|
|
201
201
|
className: "space-y-1",
|
|
202
|
-
children: [
|
|
202
|
+
children: [y.map(Z), H?.({
|
|
203
203
|
variant: "mobile",
|
|
204
204
|
collapsed: !1
|
|
205
205
|
})]
|
|
206
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ _("div", {
|
|
207
207
|
className: "mt-2 flex items-center justify-between gap-2 border-t border-sidebar-border/80 px-4 pt-3",
|
|
208
208
|
children: [U, W]
|
|
209
209
|
})]
|
|
210
210
|
})
|
|
211
211
|
]
|
|
212
212
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ g(i, {
|
|
214
214
|
delayDuration: 0,
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
"aria-label":
|
|
217
|
-
className: e("hidden lg:fixed lg:top-3 lg:bottom-3 lg:z-[var(--z-sidebar)] lg:block sidebar-gradient sidebar-transition",
|
|
215
|
+
children: /* @__PURE__ */ _("aside", {
|
|
216
|
+
"aria-label": d.mainNavigation,
|
|
217
|
+
className: e("hidden lg:fixed lg:top-3 lg:bottom-3 lg:z-[var(--z-sidebar)] lg:block sidebar-gradient sidebar-transition", C ? "lg:w-16" : "lg:w-64", E && "is-transitioning"),
|
|
218
218
|
style: { left: le + ce },
|
|
219
219
|
onTransitionEnd: (e) => {
|
|
220
220
|
e.target === e.currentTarget && e.propertyName === "width" && j?.();
|
|
221
221
|
},
|
|
222
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
223
223
|
asChild: !0,
|
|
224
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ g("button", {
|
|
225
225
|
onClick: O,
|
|
226
|
-
"aria-label":
|
|
226
|
+
"aria-label": C ? d.expandSidebar : d.collapseSidebar,
|
|
227
227
|
className: "absolute -right-3.5 top-[51px] z-[var(--z-sidebar-toggle)] flex h-7 w-7 items-center justify-center rounded-full border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-md transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
228
|
-
children:
|
|
228
|
+
children: g(C ? te : ee, { className: "h-3.5 w-3.5" })
|
|
229
229
|
})
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ g(r, {
|
|
231
231
|
side: "right",
|
|
232
|
-
children:
|
|
233
|
-
})] }), /* @__PURE__ */
|
|
232
|
+
children: C ? d.expandSidebar : d.collapseSidebar
|
|
233
|
+
})] }), /* @__PURE__ */ _("div", {
|
|
234
234
|
className: "relative z-[1] flex h-full flex-col overflow-hidden",
|
|
235
235
|
children: [
|
|
236
236
|
$("desktop"),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
|
|
239
|
-
className: "shrink-0 px-2 pb-3 pt-3",
|
|
237
|
+
B && /* @__PURE__ */ g("div", {
|
|
238
|
+
className: "shrink-0 px-2 pb-3",
|
|
240
239
|
children: B
|
|
241
|
-
}),
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ g("div", { className: "mx-2 border-t border-sidebar-border" }),
|
|
242
242
|
/* @__PURE__ */ _("nav", {
|
|
243
|
-
"aria-label":
|
|
243
|
+
"aria-label": d.primaryNavigation,
|
|
244
244
|
className: "min-h-0 flex-1 space-y-1 overflow-y-auto py-4 px-2",
|
|
245
|
-
children:
|
|
246
|
-
}),
|
|
247
|
-
I && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "mx-2 border-t border-sidebar-border" }), /* @__PURE__ */ _("div", {
|
|
248
|
-
className: "shrink-0 px-2 py-2",
|
|
249
|
-
children: /* @__PURE__ */ v(n, { children: [/* @__PURE__ */ _(a, {
|
|
245
|
+
children: [v.map(Q), L && (C ? /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
250
246
|
asChild: !0,
|
|
251
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ _("button", {
|
|
252
248
|
type: "button",
|
|
253
|
-
onClick:
|
|
254
|
-
"aria-label":
|
|
255
|
-
className:
|
|
256
|
-
children: [/* @__PURE__ */
|
|
257
|
-
className:
|
|
258
|
-
children:
|
|
249
|
+
onClick: L.onOpen,
|
|
250
|
+
"aria-label": d.aiAssistant,
|
|
251
|
+
className: L.active ? k : A,
|
|
252
|
+
children: [/* @__PURE__ */ g(c, { className: "h-5 w-5 flex-shrink-0" }), /* @__PURE__ */ g("span", {
|
|
253
|
+
className: M,
|
|
254
|
+
children: d.aiAssistant
|
|
259
255
|
})]
|
|
260
256
|
})
|
|
261
|
-
}),
|
|
257
|
+
}), /* @__PURE__ */ g(r, {
|
|
262
258
|
side: "right",
|
|
263
259
|
className: "font-medium",
|
|
264
|
-
children:
|
|
265
|
-
})] })
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
children: d.aiAssistant
|
|
261
|
+
})] }) : /* @__PURE__ */ _("button", {
|
|
262
|
+
type: "button",
|
|
263
|
+
onClick: L.onOpen,
|
|
264
|
+
className: L.active ? k : A,
|
|
265
|
+
children: [/* @__PURE__ */ g(c, { className: "h-5 w-5 flex-shrink-0" }), /* @__PURE__ */ g("span", {
|
|
266
|
+
className: N,
|
|
267
|
+
children: d.aiAssistant
|
|
268
|
+
})]
|
|
269
|
+
}))]
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ g("div", { className: "mx-2 border-t border-sidebar-border" }),
|
|
272
|
+
/* @__PURE__ */ _("div", {
|
|
269
273
|
className: "shrink-0 px-2 pt-2 pb-3",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
"aria-label":
|
|
274
|
+
children: [/* @__PURE__ */ _("nav", {
|
|
275
|
+
"aria-label": d.secondaryNavigation,
|
|
272
276
|
className: "space-y-1",
|
|
273
|
-
children: [
|
|
277
|
+
children: [y.map(Q), H?.({
|
|
274
278
|
variant: "desktop",
|
|
275
|
-
collapsed:
|
|
279
|
+
collapsed: C
|
|
276
280
|
})]
|
|
277
|
-
}), /* @__PURE__ */
|
|
278
|
-
className: e("mt-2 border-t border-sidebar-border/80 py-2",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
280
|
-
className: e("min-w-0 overflow-hidden whitespace-nowrap",
|
|
281
|
+
}), /* @__PURE__ */ _("div", {
|
|
282
|
+
className: e("mt-2 border-t border-sidebar-border/80 py-2", C ? "flex flex-col items-center gap-1" : "flex items-center justify-between gap-2 pl-[14px] pr-3"),
|
|
283
|
+
children: [/* @__PURE__ */ g("div", {
|
|
284
|
+
className: e("min-w-0 overflow-hidden whitespace-nowrap", C ? "order-2 w-full truncate text-center" : "order-1"),
|
|
281
285
|
children: U
|
|
282
|
-
}), /* @__PURE__ */
|
|
283
|
-
className: e("flex-shrink-0",
|
|
286
|
+
}), /* @__PURE__ */ g("div", {
|
|
287
|
+
className: e("flex-shrink-0", C ? "order-1" : "order-2"),
|
|
284
288
|
children: W
|
|
285
289
|
})]
|
|
286
290
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/chrome/sidebar.tsx"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAkB,4BAClB,IAAoB,4CAEpB,IAAmB,mFACnB,IAAqB,EAAG,GAAkB,CAAe,GACzD,IAAuB,EAAG,GAAkB,CAAiB,
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/chrome/sidebar.tsx"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAkB,4BAClB,IAAoB,4CAEpB,IAAmB,mFACnB,IAAqB,EAAG,GAAkB,CAAe,GACzD,IAAuB,EAAG,GAAkB,CAAiB,GAM7D,IAAiB,0FACjB,IAAmB,EAAG,GAAgB,CAAe,GACrD,IAAqB,EAAG,GAAgB,CAAiB,GAEzD,IACJ,gGACI,IAAsB,EAAG,GAAmB,CAAe,GAC3D,KAAwB,EAAG,GAAmB,CAAiB,GAE/D,IACJ,uGACI,IAAoB,EAAG,GAAiB,CAAe,GACvD,IAAsB,EAAG,GAAiB,CAAiB,GAE3D,IAAiB,sEACjB,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AU,sCAAuC,CAAA;MAEtD,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,OAAD;QAAK,cAAY,EAAO;QAAqB,WAAU;QAAvD,UAAA,CACG,EAAe,IAAI,CAAoB,GACvC,IAAgB;SAAE,SAAS;SAAW;QAAU,CAAC,CAC/C;OAGL,CAAA,GAAA,kBAAC,OAAD;QACE,WAAW,EACT,+CACA,IACI,qCACA,wDACN;QANF,UAAA,CAQE,kBAAC,OAAD;SACE,WAAW,EACT,6CACA,IAAY,wCAAwC,SACtD;SAEC,UAAA;QACE,CAAA,GACL,kBAAC,OAAD;SAAK,WAAW,EAAG,iBAAiB,IAAY,YAAY,SAAS;SAAI,UAAA;QAAqB,CAAA,CAC3F;OACF,CAAA,CAAA;;KACF;IACA,CAAA,CAAA;;EACQ,CAAA;CACjB,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Ranked horizontal bar list — label / track / fill / value rows. A thin
|
|
4
|
+
* cousin of a meter, not a chart library: no axes, no legend, no scales,
|
|
5
|
+
* just rows sorted by whoever calls it. Promoted from the docs site's
|
|
6
|
+
* "Popularity ranking" (issue #229), which hand-mixed a brand fill on an
|
|
7
|
+
* emphasis track once per page.
|
|
8
|
+
*
|
|
9
|
+
* This starts the `data` family: quantitative READOUTS (BarList, StatStrip).
|
|
10
|
+
* They are not `feedback` (no system status), not `containment` (no
|
|
11
|
+
* surface/box), not `typography` (the number is the point, not the prose) —
|
|
12
|
+
* they exist to show measured values, which no existing family owns.
|
|
13
|
+
*
|
|
14
|
+
* FILL COLOR — measured, not inherited (SC 1.4.11 wants 3:1 for meaningful
|
|
15
|
+
* graphics). The docs site used its brand orange; in this palette that forks
|
|
16
|
+
* into two tokens and only one of them survives measurement:
|
|
17
|
+
*
|
|
18
|
+
* vs light bg vs light muted vs dark bg vs dark muted
|
|
19
|
+
* --brand (hue-orange) 5.09:1 4.65:1 9.63:1 8.11:1
|
|
20
|
+
* --primary (#f5a623 tile) 1.83:1 1.67:1 9.77:1 8.23:1
|
|
21
|
+
*
|
|
22
|
+
* --primary is the literal tile and theme.css already rules it "legal as a
|
|
23
|
+
* field, illegal as a link" at 1.83:1 on a light page — a fill whose painted
|
|
24
|
+
* edge IS the datum is closer to a link than to a button face, so the tile
|
|
25
|
+
* fails here. --brand is the same hue at the ink plateau and clears 3:1
|
|
26
|
+
* against both the track and every surface in both themes, so a bar stays
|
|
27
|
+
* meaningful even before the reader finds the number. Strictly the value
|
|
28
|
+
* text makes the graphic redundant (see below) and 1.4.11 would exempt it,
|
|
29
|
+
* but passing outright beats litigating the exemption.
|
|
30
|
+
*
|
|
31
|
+
* The TRACK is --muted (1.09:1 light / 1.19:1 dark vs the page) — that low
|
|
32
|
+
* ratio is deliberate and mirrors the --border rationale in theme.css: the
|
|
33
|
+
* track is decoration marking where 100% would land, the fill and the text
|
|
34
|
+
* carry the information, so 1.4.11 does not apply to it.
|
|
35
|
+
*
|
|
36
|
+
* SEMANTICS — a plain list, no role="meter". Each row already renders its
|
|
37
|
+
* value as literal text beside the bar, so assistive tech hears
|
|
38
|
+
* "label, 943" with zero extra wiring; a meter role would announce the same
|
|
39
|
+
* number a second time and demand aria-valuemin/max/now plumbing to say
|
|
40
|
+
* nothing new. The track and fill are aria-hidden because they are that
|
|
41
|
+
* redundant graphic. role="list" is set explicitly: `list-none` (needed
|
|
42
|
+
* because rows are grid cells, not bullets) makes Safari/VoiceOver drop the
|
|
43
|
+
* implicit list role.
|
|
44
|
+
*/
|
|
45
|
+
export interface BarListItem {
|
|
46
|
+
key: string;
|
|
47
|
+
/** Row label. Any ReactNode — pass an anchor/Link element directly, or use `renderLabel`. */
|
|
48
|
+
label: React.ReactNode;
|
|
49
|
+
value: number;
|
|
50
|
+
/**
|
|
51
|
+
* Renders the label cell — inject your router's Link here, same contract
|
|
52
|
+
* as PluginCard's `renderLink`/Sidebar's `renderLink` (the house pattern
|
|
53
|
+
* for router-agnostic links). `className` carries the truncation and type
|
|
54
|
+
* styles and MUST land on the returned element, so the ellipsis clips the
|
|
55
|
+
* link itself rather than a wrapper. There is deliberately no `href`
|
|
56
|
+
* shortcut: a bare string href renders a plain <a> that full-page-reloads
|
|
57
|
+
* inside SPA consumers, which is exactly the trap `renderLink` exists to
|
|
58
|
+
* avoid — same reasoning as PluginCard.
|
|
59
|
+
*/
|
|
60
|
+
renderLabel?: (props: {
|
|
61
|
+
className: string;
|
|
62
|
+
children: React.ReactNode;
|
|
63
|
+
}) => React.ReactNode;
|
|
64
|
+
}
|
|
65
|
+
export interface BarListProps extends React.ComponentProps<"ul"> {
|
|
66
|
+
items: BarListItem[];
|
|
67
|
+
/**
|
|
68
|
+
* The value that fills the track completely. Defaults to the largest item
|
|
69
|
+
* value — the natural scale for a ranking, where the leader spans full
|
|
70
|
+
* width. Pass explicitly when rows share an external scale (a total, a
|
|
71
|
+
* quota) so bars stay comparable across lists.
|
|
72
|
+
*/
|
|
73
|
+
max?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Formats the visible value. Defaults to `toLocaleString()` — what the
|
|
76
|
+
* docs ranking shipped — so thousands read as "5,612" not "5612".
|
|
77
|
+
*/
|
|
78
|
+
formatValue?: (value: number) => string;
|
|
79
|
+
}
|
|
80
|
+
declare function BarList({ items, max, formatValue, className, ...props }: BarListProps): React.JSX.Element;
|
|
81
|
+
export { BarList };
|