@fiestaboard/ui 5.9.0 → 5.11.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/page-card.d.ts +122 -0
- package/dist/components/chrome/page-card.js +46 -0
- package/dist/components/chrome/page-card.js.map +1 -0
- package/dist/components/chrome/page-header.js +1 -0
- package/dist/components/chrome/page-header.js.map +1 -1
- package/dist/components/chrome/page-inset.d.ts +6 -0
- package/dist/components/chrome/page-inset.js.map +1 -1
- package/dist/components/chrome/page-toolbar.js +1 -0
- package/dist/components/chrome/page-toolbar.js.map +1 -1
- package/dist/components/chrome/pagination.d.ts +75 -0
- package/dist/components/chrome/pagination.js +93 -0
- package/dist/components/chrome/pagination.js.map +1 -0
- package/dist/components/chrome/top-nav.d.ts +102 -0
- package/dist/components/chrome/top-nav.js +91 -0
- package/dist/components/chrome/top-nav.js.map +1 -0
- package/dist/components/containment/action-card.d.ts +95 -0
- package/dist/components/containment/action-card.js +91 -0
- package/dist/components/containment/action-card.js.map +1 -0
- package/dist/components/containment/card.d.ts +24 -1
- package/dist/components/containment/card.js +11 -10
- package/dist/components/containment/card.js.map +1 -1
- package/dist/components/containment/icon-tile.d.ts +1 -1
- package/dist/components/editor/color-picker-content.js +17 -17
- package/dist/components/editor/filter-picker-content.js +20 -20
- package/dist/components/editor/formatting-picker-content.js +20 -20
- package/dist/components/editor/formula/formula-editor-panel.js +184 -184
- package/dist/components/editor/formula/formula-editor-panel.js.map +1 -1
- package/dist/components/editor/node-views/color-tile-node-view.js +5 -5
- package/dist/components/editor/node-views/formula-node-view.js +9 -9
- package/dist/components/editor/template-editor-toolbar.js +44 -44
- package/dist/components/editor/template-editor.js +23 -23
- package/dist/components/editor/toolbar-dropdown.js +6 -6
- package/dist/components/editor/variable-picker-content.js +79 -79
- package/dist/components/feedback/alert.d.ts +1 -1
- package/dist/components/feedback/badge.d.ts +1 -1
- package/dist/components/feedback/badge.js +6 -6
- package/dist/components/feedback/chip.js +6 -6
- package/dist/components/feedback/spinner.d.ts +1 -1
- package/dist/components/feedback/status-dot.d.ts +1 -1
- package/dist/components/forms/button.d.ts +2 -2
- package/dist/components/forms/button.js +6 -6
- package/dist/components/forms/field.d.ts +66 -0
- package/dist/components/forms/field.js +64 -0
- package/dist/components/forms/field.js.map +1 -0
- package/dist/components/forms/swatch.d.ts +4 -4
- package/dist/components/forms/time-picker.js +24 -24
- package/dist/components/forms/toggle-card.d.ts +2 -2
- package/dist/components/forms/toggle.d.ts +1 -1
- package/dist/components/plugin/plugin-card.js +5 -5
- package/dist/components/typography/heading.d.ts +2 -2
- package/dist/components/typography/kbd.d.ts +35 -0
- package/dist/components/typography/kbd.js +115 -0
- package/dist/components/typography/kbd.js.map +1 -0
- package/dist/components/typography/text.d.ts +2 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +114 -108
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
interface PageCardProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Pins the card to its parent's height so one section can scroll inside it
|
|
6
|
+
* rather than the page scrolling as a whole — the schedule calendar's shape.
|
|
7
|
+
* Pair with `PageLayout`'s own `fillHeight`, and mark the scrolling block
|
|
8
|
+
* with `<PageSection fill>`.
|
|
9
|
+
*/
|
|
10
|
+
fillHeight?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* THE WHOLE ROUTE, IN ONE CARD. The page title, the toolbar and the content
|
|
14
|
+
* are blocks inside a single surface whose border sits on `PageLayout`'s
|
|
15
|
+
* gutter.
|
|
16
|
+
*
|
|
17
|
+
* WHY, given that the three of them already shared a column. `Card` puts its
|
|
18
|
+
* border on the gutter and its words 24px inboard of it, and #270/#272 moved
|
|
19
|
+
* `PageHeader`, `PageToolbar` and bare content onto that same 24. The column
|
|
20
|
+
* was right. What was missing is that nothing DREW the border explaining it —
|
|
21
|
+
* so a reader met words indented from the page edge for no visible reason, and
|
|
22
|
+
* a route had two left edges of which only one was ever justified by something
|
|
23
|
+
* you could see. Three passes tried to align blocks to an invisible landmark.
|
|
24
|
+
* This makes the landmark visible instead, which is the one move that ends the
|
|
25
|
+
* argument rather than relocating it.
|
|
26
|
+
*
|
|
27
|
+
* BLOCKS THAT PAD THEMSELVES. The padding and the divider live on
|
|
28
|
+
* `PageSection`, not on a `[&>*]` rule here. That was the first shape and
|
|
29
|
+
* adoption killed it within a day: a settings route wraps its sections in
|
|
30
|
+
* `TabsContent`, an expandable one wraps its section in `Collapsible`, and a
|
|
31
|
+
* conditional wraps one in nothing at all — none of which are direct children,
|
|
32
|
+
* so every one of them lost its inset and its rule. A child selector can only
|
|
33
|
+
* see one level, and real routes nest.
|
|
34
|
+
*
|
|
35
|
+
* So this styles only what it must: `PageHeader` and `PageToolbar` predate the
|
|
36
|
+
* component and space themselves with a bottom margin, which is right on a
|
|
37
|
+
* page background and wrong inside a card. Those two get their margin swapped
|
|
38
|
+
* for block padding here, by slot. Everything else pads itself and composes to
|
|
39
|
+
* any depth.
|
|
40
|
+
*
|
|
41
|
+
* WHAT KEEPS ITS BORDER INSIDE. Sections flatten; items do not. A settings
|
|
42
|
+
* group or a Setup/Preview panel is a region of the page, so it loses its
|
|
43
|
+
* border and becomes a `PageSection`. A page tile, a collection tile or a
|
|
44
|
+
* plugin card is a thing you click to open, and its border IS the click
|
|
45
|
+
* target — flattening those removes the affordance, so they stay bordered
|
|
46
|
+
* inside whatever section holds them. That is a call-site judgement rather
|
|
47
|
+
* than a prop: a route swaps `Card`/`CardHeader`/`CardTitle` for
|
|
48
|
+
* `PageSection title=…` and leaves its tile grids alone.
|
|
49
|
+
*
|
|
50
|
+
* ADDITIVE ON PURPOSE. FiestaUI reaches FiestaBoard through npm, so the two
|
|
51
|
+
* repos cannot turn over in one commit. `PageHeader` and `PageToolbar` keep
|
|
52
|
+
* the standalone bottom margins they carry today and this zeroes them through
|
|
53
|
+
* their `data-slot`s, so a route that has not migrated renders exactly as it
|
|
54
|
+
* does now.
|
|
55
|
+
*/
|
|
56
|
+
export declare const PageCard: import("react").MemoExoticComponent<({ children, className, fillHeight }: PageCardProps) => import("react").JSX.Element>;
|
|
57
|
+
/**
|
|
58
|
+
* Standard div props come along so a section can take an `id` (the settings
|
|
59
|
+
* screens deep-link to one), an `aria-*`, a `style`. `title` is omitted
|
|
60
|
+
* because the HTML attribute of that name is a string tooltip and this one is
|
|
61
|
+
* a heading node — leaving both in scope would let a typo silently render a
|
|
62
|
+
* browser tooltip instead of a heading.
|
|
63
|
+
*/
|
|
64
|
+
interface PageSectionProps extends Omit<React.ComponentProps<"div">, "title"> {
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
/** Renders a `CardTitle` at the settings-card scale (#274). */
|
|
67
|
+
title?: React.ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* Leading glyph for the title, forwarded to `CardTitle`'s icon slot — so it
|
|
70
|
+
* is decorative and never announced, the title's text being the name.
|
|
71
|
+
*
|
|
72
|
+
* Exists because the settings screens this component replaces had already
|
|
73
|
+
* converged on it: 24 of FiestaBoard's section headers spell out
|
|
74
|
+
* `flex items-center gap-2 text-base` with an `h-4 w-4` glyph by hand, which
|
|
75
|
+
* is the exact pattern #274 added the slot for.
|
|
76
|
+
*/
|
|
77
|
+
icon?: React.ReactNode;
|
|
78
|
+
/** Sits under the title, in `CardDescription`'s tone. */
|
|
79
|
+
description?: React.ReactNode;
|
|
80
|
+
/** Right-aligned slot on the title row — a section-level action. */
|
|
81
|
+
action?: React.ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* Makes this the block that scrolls under `PageCard fillHeight`. Exactly one
|
|
84
|
+
* section per card should take it.
|
|
85
|
+
*/
|
|
86
|
+
fill?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Accessible name for the scroll region `fill` creates. Only read when
|
|
89
|
+
* `fill` is set. Defaults to the section's `title` when that is a string.
|
|
90
|
+
*/
|
|
91
|
+
scrollLabel?: string;
|
|
92
|
+
className?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Classes for the CONTENT region, below the heading.
|
|
95
|
+
*
|
|
96
|
+
* This exists because the collapse costs something: `Card` split its
|
|
97
|
+
* heading and its body into two components a consumer could class
|
|
98
|
+
* separately, and `PageSection` is one node doing both. Nearly every
|
|
99
|
+
* settings section it replaces carries a `space-y-*` that belongs to the
|
|
100
|
+
* body alone — put on the root it would also space the heading away from
|
|
101
|
+
* the body, on top of the heading's own margin.
|
|
102
|
+
*/
|
|
103
|
+
contentClassName?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* A BLOCK INSIDE A `PageCard`, optionally titled. This is what a content
|
|
107
|
+
* `Card` becomes once the route itself is the card — the same heading and the
|
|
108
|
+
* same words, with its border traded for the hairline above it.
|
|
109
|
+
*
|
|
110
|
+
* IT PADS ITSELF, and draws its own top rule when it is not the first thing in
|
|
111
|
+
* its container. That is what lets it sit inside a `TabsContent`, a
|
|
112
|
+
* `Collapsible` or a bare conditional and still land on the content column —
|
|
113
|
+
* the arrangement every real settings route turns out to need, and the one a
|
|
114
|
+
* parent's `[&>*]` rule cannot reach.
|
|
115
|
+
*
|
|
116
|
+
* REPLACES `PageInset`. That component existed to put bare body content on the
|
|
117
|
+
* content column of a route that had no card to explain the column. A route
|
|
118
|
+
* that IS a card does not need it: the block padding here does the same 24 and
|
|
119
|
+
* draws the rule as well.
|
|
120
|
+
*/
|
|
121
|
+
export declare const PageSection: import("react").MemoExoticComponent<({ children, title, icon, description, action, fill, scrollLabel, className, contentClassName, ...rest }: PageSectionProps) => import("react").JSX.Element>;
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Card as t, CardDescription as n, CardTitle as r } from "../containment/card.js";
|
|
3
|
+
import { memo as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/chrome/page-card.tsx
|
|
6
|
+
var s = i(function({ children: n, className: r, fillHeight: i }) {
|
|
7
|
+
return /* @__PURE__ */ a(t, {
|
|
8
|
+
"data-slot": "page-card",
|
|
9
|
+
className: e("gap-0 overflow-hidden py-0", "[&>[data-slot=page-header]]:mb-0 [&>[data-slot=page-header]]:py-6", "[&>[data-slot=page-toolbar]]:mb-0 [&>[data-slot=page-toolbar]]:py-6", "[&>[data-slot=page-toolbar]]:border-t", i && "min-h-0 flex-1", r),
|
|
10
|
+
children: n
|
|
11
|
+
});
|
|
12
|
+
}), c = i(function({ children: t, title: i, icon: s, description: c, action: l, fill: u, scrollLabel: d, className: f, contentClassName: p, ...m }) {
|
|
13
|
+
let h = i != null || c != null || l != null, g = d ?? (typeof i == "string" ? i : void 0);
|
|
14
|
+
return /* @__PURE__ */ o("div", {
|
|
15
|
+
"data-slot": "page-section",
|
|
16
|
+
className: e("px-6 py-6 [&:not(:first-child)]:border-t", u && "flex min-h-0 flex-1 flex-col overflow-hidden", f),
|
|
17
|
+
...m,
|
|
18
|
+
children: [h && /* @__PURE__ */ o("div", {
|
|
19
|
+
className: "mb-4 flex items-start justify-between gap-4",
|
|
20
|
+
children: [/* @__PURE__ */ o("div", {
|
|
21
|
+
className: "min-w-0",
|
|
22
|
+
children: [i != null && /* @__PURE__ */ a(r, {
|
|
23
|
+
size: "base",
|
|
24
|
+
icon: s,
|
|
25
|
+
children: i
|
|
26
|
+
}), c != null && /* @__PURE__ */ a(n, {
|
|
27
|
+
className: "mt-1.5",
|
|
28
|
+
children: c
|
|
29
|
+
})]
|
|
30
|
+
}), l]
|
|
31
|
+
}), u ? /* @__PURE__ */ a("div", {
|
|
32
|
+
className: e("min-h-0 flex-1 overflow-auto", p),
|
|
33
|
+
tabIndex: 0,
|
|
34
|
+
role: g ? "region" : void 0,
|
|
35
|
+
"aria-label": g,
|
|
36
|
+
children: t
|
|
37
|
+
}) : p ? /* @__PURE__ */ a("div", {
|
|
38
|
+
className: p,
|
|
39
|
+
children: t
|
|
40
|
+
}) : t]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as PageCard, c as PageSection };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=page-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-card.js","names":[],"sources":["../../../src/components/chrome/page-card.tsx"],"mappings":";;;;;AA6DA,IAAa,IAAW,EAAK,SAAkB,EAAE,aAAU,cAAW,iBAA6B;CACjG,OACE,kBAAC,GAAD;EACE,aAAU;EACV,WAAW,EAET,8BAKA,qEACA,uEACA,yCACA,KAAc,kBACd,CACF;EAEC;CACG,CAAA;AAEV,CAAC,GAmEY,IAAc,EAAK,SAAqB,EACnD,aACA,UACA,SACA,gBACA,WACA,SACA,gBACA,cACA,qBACA,GAAG,KACgB;CACnB,IAAM,IAAa,KAAS,QAAQ,KAAe,QAAQ,KAAU,MAQ/D,IAAQ,MAAgB,OAAO,KAAU,WAAW,IAAQ,KAAA;CAClE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EAKT,4CACA,KAAQ,gDACR,CACF;EACA,GAAI;EAXN,UAAA,CAaG,KACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,KAAS,QACR,kBAAC,GAAD;KAAW,MAAK;KAAa;KAC1B,UAAA;IACQ,CAAA,GAEZ,KAAe,QAAQ,kBAAC,GAAD;KAAiB,WAAU;KAAU,UAAA;IAA6B,CAAA,CACvF;GACJ,CAAA,GAAA,CACE;EAEN,CAAA,GAAA,IACC,kBAAC,OAAD;GACE,WAAW,EAAG,gCAAgC,CAAgB;GAC9D,UAAU;GAIV,MAAM,IAAQ,WAAW,KAAA;GACzB,cAAY;GAEX;EACE,CAAA,IACH,IAEF,kBAAC,OAAD;GAAK,WAAW;GAAmB;EAAc,CAAA,IAEjD,CAEC;;AAET,CAAC"}
|
|
@@ -25,6 +25,7 @@ function s(e) {
|
|
|
25
25
|
var c = t(function({ icon: t, title: i, description: a, children: c, className: l, animationDelay: u = "0ms", hue: d }) {
|
|
26
26
|
let f = d ?? s(i);
|
|
27
27
|
return /* @__PURE__ */ r("div", {
|
|
28
|
+
"data-slot": "page-header",
|
|
28
29
|
className: e("mb-6 flex flex-wrap items-start justify-between gap-x-6 gap-y-3 px-6 animate-card-fade-in", l),
|
|
29
30
|
style: { animationDelay: u },
|
|
30
31
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/chrome/page-header.tsx"],"mappings":";;;;AAMA,IAAM,IAAsC,EAAE,UAAU,WAAW,GAStD,IAAY;CAAC;CAAO;CAAU;CAAU;CAAS;CAAQ;AAAQ,GAIxE,IAAqC;CACzC,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,MAAM;CACN,QAAQ;AACV;AAqBA,SAAgB,EAAQ,GAAuB;CAC7C,IAAI,IAAI;CACR,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAE/B,AADA,KAAK,EAAK,WAAW,CAAC,GACtB,IAAI,KAAK,KAAK,GAAG,QAAU;CAE7B,OAAO,EAAU,KAAK,IAAI,CAAC,IAAI,EAAU;AAC3C;AA8DA,IAAa,IAAa,EAAK,SAAoB,EACjD,MAAM,GACN,UACA,gBACA,aACA,cACA,oBAAiB,OACjB,UACkB;CAClB,IAAM,IAAW,KAAO,EAAQ,CAAK;CACrC,OACE,kBAAC,OAAD;EACE,WAAW,EACT,6FACA,CACF;EACA,OAAO,EAAE,kBAAe;
|
|
1
|
+
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/chrome/page-header.tsx"],"mappings":";;;;AAMA,IAAM,IAAsC,EAAE,UAAU,WAAW,GAStD,IAAY;CAAC;CAAO;CAAU;CAAU;CAAS;CAAQ;AAAQ,GAIxE,IAAqC;CACzC,KA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AD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAO,WAAU;IAAkB,CAAA;GAClC;EACZ,CAAA,EAAA,CAAA;CACH,CAAA;AAET,CAAC"}
|
|
@@ -3,6 +3,12 @@ interface PageInsetProps {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated Use `PageSection` inside a `PageCard`. This component exists to
|
|
7
|
+
* put bare body content on the content column of a route that has no card to
|
|
8
|
+
* explain that column — and the route is now the card, so the column explains
|
|
9
|
+
* itself and the section draws the divider too. Kept working for consumers
|
|
10
|
+
* mid-migration; removed no earlier than the next major.
|
|
11
|
+
*
|
|
6
12
|
* THE CONTENT COLUMN, FOR BODY CONTENT THAT IS NOT A CARD. Wraps its children
|
|
7
13
|
* in the same `px-6` that `PageHeader` and `PageToolbar` carry, so a tab strip,
|
|
8
14
|
* a byline or a bare paragraph lands on the vertical the page title and every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-inset.js","names":[],"sources":["../../../src/components/chrome/page-inset.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"page-inset.js","names":[],"sources":["../../../src/components/chrome/page-inset.tsx"],"mappings":";;;;AA8CA,IAAa,IAAY,EAAK,SAAmB,EAAE,aAAU,gBAA6B;CACxF,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,QAAQ,CAAS;EAAI;CAAc,CAAA;AAC/D,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/components/chrome/page-toolbar.tsx
|
|
5
5
|
var i = { animationDelay: "50ms" }, a = t(function({ left: t, right: a, children: o, className: s }) {
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
7
|
+
"data-slot": "page-toolbar",
|
|
7
8
|
className: e("mb-4 px-6 animate-card-fade-in", s),
|
|
8
9
|
style: i,
|
|
9
10
|
children: o ?? /* @__PURE__ */ r("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-toolbar.js","names":[],"sources":["../../../src/components/chrome/page-toolbar.tsx"],"mappings":";;;;AAKA,IAAM,IAAqC,EAAE,gBAAgB,OAAO,GAmCvD,IAAc,EAAK,SAAqB,EAAE,SAAM,UAAO,aAAU,gBAA+B;CAC3G,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,kCAAkC,CAAS;EAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"page-toolbar.js","names":[],"sources":["../../../src/components/chrome/page-toolbar.tsx"],"mappings":";;;;AAKA,IAAM,IAAqC,EAAE,gBAAgB,OAAO,GAmCvD,IAAc,EAAK,SAAqB,EAAE,SAAM,UAAO,aAAU,gBAA+B;CAC3G,OACE,kBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,EAAG,kCAAkC,CAAS;EAAG,OAAO;EAC9F,UAAA,KACC,kBAAC,OAAD;GACE,WAAW,EACT,qCACA,KAAQ,IAAQ,oBAAoB,IAAQ,gBAAgB,eAC9D;GAJF,UAAA,CAMG,KAAQ,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAA;GAAU,CAAA,GAC5D,KAAS,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAA;GAAW,CAAA,CAC5D;;CAEJ,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/** One slot in the rendered strip: a page number, or an elided run. */
|
|
3
|
+
export type PaginationSlot = number | "ellipsis";
|
|
4
|
+
export interface PaginationRangeOptions {
|
|
5
|
+
/** The 1-based current page. Clamped into `[1, totalPages]`. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** How many pages exist. `<= 0` yields an empty range. */
|
|
8
|
+
totalPages: number;
|
|
9
|
+
/** Pages shown either side of the current one. @default 1 */
|
|
10
|
+
siblingCount?: number;
|
|
11
|
+
/** Pages pinned to each end of the strip. @default 1 */
|
|
12
|
+
boundaryCount?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The slots to render for one page of a list: boundary pages, the current
|
|
16
|
+
* page and its siblings, and `"ellipsis"` wherever a run of two or more pages
|
|
17
|
+
* is elided.
|
|
18
|
+
*
|
|
19
|
+
* The returned length is stable for a given `totalPages`/`siblingCount`/
|
|
20
|
+
* `boundaryCount` (until the range is short enough to fit whole), which is
|
|
21
|
+
* what keeps the pager from resizing under the reader's cursor.
|
|
22
|
+
*/
|
|
23
|
+
export declare function paginationRange({ page, totalPages, siblingCount, boundaryCount, }: PaginationRangeOptions): PaginationSlot[];
|
|
24
|
+
/** Localized copy. Required in full — the package ships no English defaults. */
|
|
25
|
+
export interface PaginationLabels {
|
|
26
|
+
/** Accessible name for the `<nav>` landmark, e.g. "Blog pages". */
|
|
27
|
+
navigation: string;
|
|
28
|
+
/** Accessible name for the previous-page chevron, e.g. "Previous page". */
|
|
29
|
+
previous: string;
|
|
30
|
+
/** Accessible name for the next-page chevron, e.g. "Next page". */
|
|
31
|
+
next: string;
|
|
32
|
+
/** Accessible name for a numbered link, e.g. `(n) => \`Page ${n}\``. */
|
|
33
|
+
page: (page: number) => string;
|
|
34
|
+
/** Screen-reader-only announcement for an elided run, e.g. "More pages". */
|
|
35
|
+
ellipsis: string;
|
|
36
|
+
}
|
|
37
|
+
/** Which control `renderLink` is being asked for, and where it goes. */
|
|
38
|
+
export interface PaginationLinkItem {
|
|
39
|
+
/** The 1-based page this control navigates to. */
|
|
40
|
+
page: number;
|
|
41
|
+
kind: "page" | "previous" | "next";
|
|
42
|
+
/** True only for the numbered link the reader is currently on. */
|
|
43
|
+
current: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Spread these onto your router's Link. `className` MUST land on it. */
|
|
46
|
+
export interface PaginationLinkProps {
|
|
47
|
+
className: string;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
"data-slot": string;
|
|
50
|
+
"aria-label": string;
|
|
51
|
+
"aria-current"?: "page";
|
|
52
|
+
rel?: "prev" | "next";
|
|
53
|
+
}
|
|
54
|
+
export interface PaginationProps extends Omit<React.ComponentProps<"nav">, "aria-label" | "children"> {
|
|
55
|
+
/** The 1-based current page. Clamped into `[1, totalPages]`. */
|
|
56
|
+
page: number;
|
|
57
|
+
/** How many pages exist. `<= 1` renders nothing at all. */
|
|
58
|
+
totalPages: number;
|
|
59
|
+
labels: PaginationLabels;
|
|
60
|
+
/**
|
|
61
|
+
* Renders one navigating control — inject your router's Link here. Receives
|
|
62
|
+
* spreadable DOM props first and the semantic item second, the same
|
|
63
|
+
* signature as {@link "./sidebar".Sidebar}'s `renderLink`. There is
|
|
64
|
+
* deliberately no `href` shortcut: a bare string href renders a plain `<a>`
|
|
65
|
+
* that full-page-reloads inside an SPA, which is exactly the trap this prop
|
|
66
|
+
* exists to avoid.
|
|
67
|
+
*/
|
|
68
|
+
renderLink: (props: PaginationLinkProps, item: PaginationLinkItem) => React.ReactNode;
|
|
69
|
+
/** Pages shown either side of the current one. @default 1 */
|
|
70
|
+
siblingCount?: number;
|
|
71
|
+
/** Pages pinned to each end of the strip. @default 1 */
|
|
72
|
+
boundaryCount?: number;
|
|
73
|
+
}
|
|
74
|
+
declare function Pagination({ page, totalPages, labels, renderLink, siblingCount, boundaryCount, className, ...props }: PaginationProps): React.JSX.Element | null;
|
|
75
|
+
export { Pagination };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { buttonVariants as t } from "../forms/button.js";
|
|
3
|
+
import { ChevronLeft as n, ChevronRight as r, MoreHorizontal as i } from "lucide-react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/chrome/pagination.tsx
|
|
6
|
+
function s(e, t) {
|
|
7
|
+
return Array.from({ length: Math.max(0, t - e + 1) }, (t, n) => e + n);
|
|
8
|
+
}
|
|
9
|
+
function c({ page: e, totalPages: t, siblingCount: n = 1, boundaryCount: r = 1 }) {
|
|
10
|
+
if (t <= 0) return [];
|
|
11
|
+
let i = Math.min(Math.max(Math.trunc(e), 1), t), a = s(1, Math.min(r, t)), o = s(Math.max(t - r + 1, r + 1), t), c = Math.max(Math.min(i - n, t - r - n * 2 - 1), r + 2), l = Math.min(Math.max(i + n, r + n * 2 + 2), o.length > 0 ? o[0] - 2 : t - 1);
|
|
12
|
+
return [
|
|
13
|
+
...a,
|
|
14
|
+
...c > r + 2 ? ["ellipsis"] : r + 1 < t - r ? [r + 1] : [],
|
|
15
|
+
...s(c, l),
|
|
16
|
+
...l < t - r - 1 ? ["ellipsis"] : t - r > r ? [t - r] : [],
|
|
17
|
+
...o
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
var l = "h-9 w-auto min-w-9 px-2 tabular-nums";
|
|
21
|
+
function u({ page: s, totalPages: u, labels: d, renderLink: f, siblingCount: p = 1, boundaryCount: m = 1, className: h, ...g }) {
|
|
22
|
+
if (u <= 1) return null;
|
|
23
|
+
let _ = Math.min(Math.max(Math.trunc(s), 1), u), v = c({
|
|
24
|
+
page: _,
|
|
25
|
+
totalPages: u,
|
|
26
|
+
siblingCount: p,
|
|
27
|
+
boundaryCount: m
|
|
28
|
+
}), y = t({
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
size: "icon"
|
|
31
|
+
}), b = (t) => {
|
|
32
|
+
let i = t === "previous" ? _ - 1 : _ + 1, o = a(t === "previous" ? n : r, { "aria-hidden": "true" }), s = `pagination-${t}`;
|
|
33
|
+
return i < 1 || i > u ? /* @__PURE__ */ a("span", {
|
|
34
|
+
"data-slot": s,
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: e(y, "pointer-events-none opacity-50"),
|
|
37
|
+
children: o
|
|
38
|
+
}) : f({
|
|
39
|
+
className: y,
|
|
40
|
+
children: o,
|
|
41
|
+
"data-slot": s,
|
|
42
|
+
"aria-label": t === "previous" ? d.previous : d.next,
|
|
43
|
+
rel: t === "previous" ? "prev" : "next"
|
|
44
|
+
}, {
|
|
45
|
+
page: i,
|
|
46
|
+
kind: t,
|
|
47
|
+
current: !1
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ a("nav", {
|
|
51
|
+
"data-slot": "pagination",
|
|
52
|
+
"aria-label": d.navigation,
|
|
53
|
+
className: h,
|
|
54
|
+
...g,
|
|
55
|
+
children: /* @__PURE__ */ o("ul", {
|
|
56
|
+
role: "list",
|
|
57
|
+
"data-slot": "pagination-list",
|
|
58
|
+
className: "flex list-none flex-wrap items-center gap-1 p-0",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ a("li", { children: b("previous") }),
|
|
61
|
+
v.map((n, r) => n === "ellipsis" ? /* @__PURE__ */ a("li", { children: /* @__PURE__ */ o("span", {
|
|
62
|
+
"data-slot": "pagination-ellipsis",
|
|
63
|
+
className: "flex h-9 min-w-9 items-center justify-center text-muted-foreground",
|
|
64
|
+
children: [/* @__PURE__ */ a(i, {
|
|
65
|
+
className: "size-4",
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}), /* @__PURE__ */ a("span", {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: d.ellipsis
|
|
70
|
+
})]
|
|
71
|
+
}) }, `ellipsis-${r}`) : /* @__PURE__ */ a("li", { children: f({
|
|
72
|
+
className: e(t({
|
|
73
|
+
variant: n === _ ? "outline" : "ghost",
|
|
74
|
+
size: "icon"
|
|
75
|
+
}), l),
|
|
76
|
+
children: n,
|
|
77
|
+
"data-slot": "pagination-link",
|
|
78
|
+
"aria-label": d.page(n),
|
|
79
|
+
...n === _ ? { "aria-current": "page" } : {}
|
|
80
|
+
}, {
|
|
81
|
+
page: n,
|
|
82
|
+
kind: "page",
|
|
83
|
+
current: n === _
|
|
84
|
+
}) }, n)),
|
|
85
|
+
/* @__PURE__ */ a("li", { children: b("next") })
|
|
86
|
+
]
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { u as Pagination, c as paginationRange };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","names":[],"sources":["../../../src/components/chrome/pagination.tsx"],"mappings":";;;;;AAmFA,SAAS,EAAM,GAAe,GAAuB;CACnD,OAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAM,IAAQ,CAAC,EAAE,IAAI,GAAG,MAAU,IAAQ,CAAK;AACzF;AAsBA,SAAgB,EAAgB,EAC9B,SACA,eACA,kBAAe,GACf,mBAAgB,KAC2B;CAC3C,IAAI,KAAc,GAAG,OAAO,CAAC;CAC7B,IAAM,IAAU,KAAK,IAAI,KAAK,IAAI,KAAK,MAAM,CAAI,GAAG,CAAC,GAAG,CAAU,GAE5D,IAAa,EAAM,GAAG,KAAK,IAAI,GAAe,CAAU,CAAC,GACzD,IAAW,EAAM,KAAK,IAAI,IAAa,IAAgB,GAAG,IAAgB,CAAC,GAAG,CAAU,GAKxF,IAAgB,KAAK,IACzB,KAAK,IAAI,IAAU,GAAc,IAAa,IAAgB,IAAe,IAAI,CAAC,GAClF,IAAgB,CAClB,GACM,IAAc,KAAK,IACvB,KAAK,IAAI,IAAU,GAAc,IAAgB,IAAe,IAAI,CAAC,GACrE,EAAS,SAAS,IAAI,EAAS,KAAK,IAAI,IAAa,CACvD;CAEA,OAAO;EACL,GAAG;EAGH,GAAI,IAAgB,IAAgB,IAC/B,CAAC,UAAU,IACZ,IAAgB,IAAI,IAAa,IAC/B,CAAC,IAAgB,CAAC,IAClB,CAAC;EACP,GAAG,EAAM,GAAe,CAAW;EACnC,GAAI,IAAc,IAAa,IAAgB,IAC1C,CAAC,UAAU,IACZ,IAAa,IAAgB,IAC3B,CAAC,IAAa,CAAa,IAC3B,CAAC;EACP,G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AW,UAAA,EAAO;KAAe,CAAA,CAC7C;IACJ,CAAA,EAAA,GAdK,YAAY,GAcjB,IAEJ,kBAAC,MAAD,EAAA,UACG,EACC;KACE,WAAW,EACT,EAAe;MAAE,SAAS,MAAS,IAAU,YAAY;MAAS,MAAM;KAAO,CAAC,GAChF,CACF;KACA,UAAU;KACV,aAAa;KACb,cAAc,EAAO,KAAK,CAAI;KAC9B,GAAI,MAAS,IAAU,EAAE,gBAAgB,OAAgB,IAAI,CAAC;IAChE,GACA;KAAE,MAAM;KAAM,MAAM;KAAQ,SAAS,MAAS;IAAQ,CACxD,EACE,GAdK,CAcL,CAER;IACA,kBAAC,MAAD,EAAA,UAAK,EAAK,MAAM,EAAM,CAAA;GACpB;;CACD,CAAA;AAET"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TopNavProps = React.ComponentProps<"div"> & {
|
|
3
|
+
/**
|
|
4
|
+
* Render the caller's own element instead of the default `<div>`. This is
|
|
5
|
+
* how the bar becomes a landmark when it should be one —
|
|
6
|
+
* `<TopNav asChild><nav aria-label={t("Main")}>…</nav></TopNav>` — without
|
|
7
|
+
* adding a wrapper element, and without this package guessing at either the
|
|
8
|
+
* landmark or its localized name. See DECISION 1 above.
|
|
9
|
+
*/
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare function TopNav({ className, asChild, children, ref, ...props }: TopNavProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
export type TopNavBrandProps = React.ComponentProps<"a"> & {
|
|
14
|
+
/** Render the caller's own element — a router `Link`, usually. */
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The bar's leading identity: a `FiestaLogo`, a wordmark, an icon plus a
|
|
19
|
+
* title. It is a link because it goes home; when it should not navigate,
|
|
20
|
+
* `asChild` a `<span>` and the geometry still applies.
|
|
21
|
+
*
|
|
22
|
+
* It is NOT `aria-current`-aware. The brand is the site's mark, not a row of
|
|
23
|
+
* the nav — painting a current-page pill on it (on the home page, where every
|
|
24
|
+
* visitor starts) would put two active-looking things in one bar.
|
|
25
|
+
*/
|
|
26
|
+
declare function TopNavBrand({ className, asChild, children, ref, ...props }: TopNavBrandProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
27
|
+
/**
|
|
28
|
+
* The row of destinations. A real `<ul>` of `<li>`s, exactly like `NavList`:
|
|
29
|
+
* that is what makes a screen reader announce "list, 5 items" and give
|
|
30
|
+
* per-item position, and it costs nothing visually.
|
|
31
|
+
*
|
|
32
|
+
* No landmark of its own — see DECISION 1 on {@link TopNav}.
|
|
33
|
+
*/
|
|
34
|
+
declare function TopNavList({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
35
|
+
/** One destination's list item. */
|
|
36
|
+
declare function TopNavItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
37
|
+
export type TopNavLinkProps = React.ComponentProps<"a"> & {
|
|
38
|
+
/**
|
|
39
|
+
* Render the caller's own element instead of an `<a>` — the same
|
|
40
|
+
* `useRender` mechanics as {@link "./nav-list".NavListLink}. This is how
|
|
41
|
+
* Docusaurus's `<Link>` (prefetch, base-path handling) or FiestaBoard's
|
|
42
|
+
* ViewTransitionLink keeps its behaviour while this component keeps owning
|
|
43
|
+
* the row's look and its ARIA.
|
|
44
|
+
*/
|
|
45
|
+
asChild?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Marks this row as the current destination: paints the pill AND sets
|
|
48
|
+
* `aria-current`. The app derives it from its router — the design system
|
|
49
|
+
* never guesses at routes.
|
|
50
|
+
*/
|
|
51
|
+
active?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Which kind of "current" this row is, when `active`. Defaults to `"page"`;
|
|
54
|
+
* a docs navbar whose row points at the section you are inside — rather
|
|
55
|
+
* than at the page you are on — passes `"location"`.
|
|
56
|
+
* @default "page"
|
|
57
|
+
*/
|
|
58
|
+
current?: "page" | "step" | "location" | "date" | "time";
|
|
59
|
+
};
|
|
60
|
+
declare function TopNavLink({ className, asChild, active, current, children, ref, ...props }: TopNavLinkProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
61
|
+
export type TopNavMenuTriggerProps = React.ComponentProps<"button"> & {
|
|
62
|
+
/**
|
|
63
|
+
* Paints the active pill when the current page lives inside this menu.
|
|
64
|
+
*
|
|
65
|
+
* It sets `data-active` and the fill, but NOT `aria-current`: the trigger
|
|
66
|
+
* opens a menu, it is not the current page. The page's `aria-current` goes
|
|
67
|
+
* on the item inside the menu that points at it.
|
|
68
|
+
*/
|
|
69
|
+
active?: boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The bar's dropdown row — a plain `<button>` wearing the link geometry, made
|
|
73
|
+
* to be handed to `DropdownMenuTrigger asChild`:
|
|
74
|
+
*
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <DropdownMenu>
|
|
77
|
+
* <DropdownMenuTrigger asChild>
|
|
78
|
+
* <TopNavMenuTrigger>Versions</TopNavMenuTrigger>
|
|
79
|
+
* </DropdownMenuTrigger>
|
|
80
|
+
* <DropdownMenuContent align="start">
|
|
81
|
+
* <DropdownMenuItem render={<a href="/v5" />}>v5</DropdownMenuItem>
|
|
82
|
+
* </DropdownMenuContent>
|
|
83
|
+
* </DropdownMenu>
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* Everything that makes it a menu button — `aria-haspopup`, `aria-expanded`,
|
|
87
|
+
* `aria-controls`, ArrowDown-to-open, typeahead, Escape-restores-focus — comes
|
|
88
|
+
* from Base UI through that trigger. This contributes the look and the caret,
|
|
89
|
+
* which is why it stays a bare button rather than a second Menu API.
|
|
90
|
+
*/
|
|
91
|
+
declare function TopNavMenuTrigger({ className, active, children, type, ...props }: TopNavMenuTriggerProps): React.JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* The bar's trailing slot: search, `ThemeToggle`, icon links (`Button`
|
|
94
|
+
* `size="icon"` `asChild` around an `<a>`). `ml-auto` pushes it to the end, so
|
|
95
|
+
* the caller never has to know that the row is a flex line.
|
|
96
|
+
*
|
|
97
|
+
* It is a plain `<div>`, not a list: these are controls of different kinds
|
|
98
|
+
* that happen to share an edge, and calling them a list would announce a
|
|
99
|
+
* "list, 3 items" that means nothing.
|
|
100
|
+
*/
|
|
101
|
+
declare function TopNavActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
102
|
+
export { TopNav, TopNavActions, TopNavBrand, TopNavItem, TopNavLink, TopNavList, TopNavMenuTrigger };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { ChevronDown as t } from "lucide-react";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { useRender as a } from "@base-ui/react/use-render";
|
|
6
|
+
//#region src/components/chrome/top-nav.tsx
|
|
7
|
+
var o = [
|
|
8
|
+
"inline-flex min-h-9 items-center gap-2 rounded-md px-3 py-2 text-sm font-medium whitespace-nowrap",
|
|
9
|
+
"transition-[color,background-color,border-color,box-shadow] duration-control focus-ring",
|
|
10
|
+
"[&>svg]:size-4 [&>svg]:shrink-0"
|
|
11
|
+
], s = "nav-active font-semibold", c = "text-muted-foreground nav-active-hover hover:text-foreground";
|
|
12
|
+
function l({ className: t, asChild: r = !1, children: i, ref: o, ...s }) {
|
|
13
|
+
return a({
|
|
14
|
+
defaultTagName: "div",
|
|
15
|
+
ref: o,
|
|
16
|
+
render: r ? n.Children.only(i) : void 0,
|
|
17
|
+
props: {
|
|
18
|
+
"data-slot": "top-nav",
|
|
19
|
+
className: e("flex min-h-14 w-full flex-wrap items-center gap-x-2 gap-y-1 border-b border-border bg-background px-4 py-2", t),
|
|
20
|
+
...r ? {} : { children: i },
|
|
21
|
+
...s
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function u({ className: t, asChild: r = !1, children: i, ref: o, ...s }) {
|
|
26
|
+
return a({
|
|
27
|
+
defaultTagName: "a",
|
|
28
|
+
ref: o,
|
|
29
|
+
render: r ? n.Children.only(i) : void 0,
|
|
30
|
+
props: {
|
|
31
|
+
"data-slot": "top-nav-brand",
|
|
32
|
+
className: e("focus-ring mr-1 flex shrink-0 items-center gap-2 rounded-md px-1 py-1 font-semibold text-foreground", "transition-[color,background-color,border-color,box-shadow] duration-control", t),
|
|
33
|
+
...r ? {} : { children: i },
|
|
34
|
+
...s
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function d({ className: t, ...n }) {
|
|
39
|
+
return /* @__PURE__ */ r("ul", {
|
|
40
|
+
role: "list",
|
|
41
|
+
"data-slot": "top-nav-list",
|
|
42
|
+
className: e("flex list-none flex-wrap items-center gap-1 p-0", t),
|
|
43
|
+
...n
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function f({ className: t, ...n }) {
|
|
47
|
+
return /* @__PURE__ */ r("li", {
|
|
48
|
+
"data-slot": "top-nav-item",
|
|
49
|
+
className: e("shrink-0", t),
|
|
50
|
+
...n
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function p({ className: t, asChild: r = !1, active: i = !1, current: l = "page", children: u, ref: d, ...f }) {
|
|
54
|
+
return a({
|
|
55
|
+
defaultTagName: "a",
|
|
56
|
+
ref: d,
|
|
57
|
+
render: r ? n.Children.only(u) : void 0,
|
|
58
|
+
props: {
|
|
59
|
+
"data-slot": "top-nav-link",
|
|
60
|
+
"data-active": i ? "" : void 0,
|
|
61
|
+
"aria-current": i ? l : void 0,
|
|
62
|
+
className: e(o, i ? s : c, t),
|
|
63
|
+
...r ? {} : { children: u },
|
|
64
|
+
...f
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function m({ className: n, active: a = !1, children: l, type: u = "button", ...d }) {
|
|
69
|
+
return /* @__PURE__ */ i("button", {
|
|
70
|
+
type: u,
|
|
71
|
+
"data-slot": "top-nav-menu-trigger",
|
|
72
|
+
"data-active": a ? "" : void 0,
|
|
73
|
+
className: e(o, a ? s : c, "group/top-nav-menu-trigger", n),
|
|
74
|
+
...d,
|
|
75
|
+
children: [l, /* @__PURE__ */ r(t, {
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
className: "transition-transform duration-control group-data-[popup-open]/top-nav-menu-trigger:rotate-180"
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function h({ className: t, ...n }) {
|
|
82
|
+
return /* @__PURE__ */ r("div", {
|
|
83
|
+
"data-slot": "top-nav-actions",
|
|
84
|
+
className: e("ml-auto flex shrink-0 items-center gap-1", t),
|
|
85
|
+
...n
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { l as TopNav, h as TopNavActions, u as TopNavBrand, f as TopNavItem, p as TopNavLink, d as TopNavList, m as TopNavMenuTrigger };
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=top-nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-nav.js","names":[],"sources":["../../../src/components/chrome/top-nav.tsx"],"mappings":";;;;;;AA6GA,IAAM,IAAc;CAClB;CACA;CACA;AACF,GAIM,IAAqB,4BACrB,IAAsB;AAiB5B,SAAS,EAAO,EAAE,cAAW,aAAU,IAAO,aAAU,QAAK,GAAG,KAAsB;CACpF,OAAO,EAAU;EACf,gBAAgB;EACX;EACL,QAAQ,IAAW,EAAM,SAAS,KAAK,CAAQ,IAA2B,KAAA;EAC1E,OAAO;GACL,aAAa;GACb,WAAW,EAGT,8GACA,CACF;GACA,GAAI,IAAU,CAAC,IAAI,EAAE,YAAS;GAC9B,GAAG;EACL;CACF,CAAC;AACH;AAoBA,SAAS,EAAY,EAAE,cAAW,aAAU,IAAO,aAAU,QAAK,GAAG,KAA2B;CAC9F,OAA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