@charcuterie/ui 3.23.0 → 3.24.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/Board/Board.d.ts +6 -3
- package/dist/Board/Board.d.ts.map +1 -1
- package/dist/Board/Board.js +19 -1
- package/dist/Board/Board.js.map +1 -1
- package/dist/Board/BoardCard.d.ts +42 -7
- package/dist/Board/BoardCard.d.ts.map +1 -1
- package/dist/Board/BoardCard.js +54 -8
- package/dist/Board/BoardCard.js.map +1 -1
- package/dist/Nav/Nav.d.ts +167 -0
- package/dist/Nav/Nav.d.ts.map +1 -0
- package/dist/Nav/Nav.js +165 -0
- package/dist/Nav/Nav.js.map +1 -0
- package/dist/Nav/NavLink.d.ts +43 -0
- package/dist/Nav/NavLink.d.ts.map +1 -0
- package/dist/Nav/NavLink.js +111 -0
- package/dist/Nav/NavLink.js.map +1 -0
- package/dist/Nav/navItems.d.ts +67 -0
- package/dist/Nav/navItems.d.ts.map +1 -0
- package/dist/Nav/navItems.js +104 -0
- package/dist/Nav/navItems.js.map +1 -0
- package/dist/Nav/useNavLayout.d.ts +86 -0
- package/dist/Nav/useNavLayout.d.ts.map +1 -0
- package/dist/Nav/useNavLayout.js +114 -0
- package/dist/Nav/useNavLayout.js.map +1 -0
- package/dist/NavBar/NavBar.d.ts +37 -111
- package/dist/NavBar/NavBar.d.ts.map +1 -1
- package/dist/NavBar/NavBar.js +30 -110
- package/dist/NavBar/NavBar.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Board/Board.mdx +25 -2
- package/src/Board/Board.stories.tsx +52 -1
- package/src/Board/Board.test.tsx +82 -0
- package/src/Board/Board.tsx +24 -4
- package/src/Board/BoardCard.tsx +103 -21
- package/src/Board/boardMoveHandleContainer.test.ts +54 -0
- package/src/Nav/Nav.mdx +169 -0
- package/src/Nav/Nav.stories.tsx +402 -0
- package/src/Nav/Nav.test.tsx +338 -0
- package/src/Nav/Nav.tsx +406 -0
- package/src/Nav/NavLink.tsx +220 -0
- package/src/Nav/navItems.test.ts +163 -0
- package/src/Nav/navItems.ts +175 -0
- package/src/Nav/useNavLayout.ts +197 -0
- package/src/NavBar/NavBar.mdx +26 -0
- package/src/NavBar/NavBar.tsx +54 -240
- package/src/index.ts +20 -1
- package/src/sourceRules.test.ts +13 -1
- package/dist/NavBar/NavBarLink.d.ts +0 -43
- package/dist/NavBar/NavBarLink.d.ts.map +0 -1
- package/dist/NavBar/NavBarLink.js +0 -67
- package/dist/NavBar/NavBarLink.js.map +0 -1
- package/dist/NavBar/navBarCurrent.d.ts +0 -37
- package/dist/NavBar/navBarCurrent.d.ts.map +0 -1
- package/dist/NavBar/navBarCurrent.js +0 -48
- package/dist/NavBar/navBarCurrent.js.map +0 -1
- package/src/NavBar/NavBarLink.tsx +0 -139
- package/src/NavBar/navBarCurrent.test.ts +0 -81
- package/src/NavBar/navBarCurrent.ts +0 -64
package/dist/Board/Board.d.ts
CHANGED
|
@@ -30,12 +30,15 @@ export type BoardProps = {
|
|
|
30
30
|
label: string;
|
|
31
31
|
lanes: readonly BoardLane[];
|
|
32
32
|
/**
|
|
33
|
-
* What the move handle shows
|
|
34
|
-
*
|
|
33
|
+
* What the move handle shows **while the lanes are side by side**.
|
|
34
|
+
* Below `cq-lg` the handle says "Move" whatever this is, because
|
|
35
|
+
* there is nowhere to drag to — see `BoardCard`.
|
|
36
|
+
*
|
|
37
|
+
* The library ships no icons and no symbol glyphs in a default —
|
|
35
38
|
* they render as nothing where the font lacks them, which
|
|
36
39
|
* includes this sandbox's chromium, the kiosk image and the
|
|
37
40
|
* ePaper build — so the default is a word and an app that owns a
|
|
38
|
-
* glyph set passes one. On a dense board it is worth ~
|
|
41
|
+
* glyph set passes one. On a dense board it is worth ~35px a row.
|
|
39
42
|
*/
|
|
40
43
|
moveIcon?: ReactNode;
|
|
41
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Board.d.ts","sourceRoot":"","sources":["../../src/Board/Board.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AASpD,MAAM,MAAM,SAAS,GAAG;IACtB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;IAC3B
|
|
1
|
+
{"version":3,"file":"Board.d.ts","sourceRoot":"","sources":["../../src/Board/Board.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AASpD,MAAM,MAAM,SAAS,GAAG;IACtB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;IAC3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;CACnC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,eAAO,MAAM,KAAK,GAAI,6EAQnB,UAAU,KAAG,SAiNf,CAAA"}
|
package/dist/Board/Board.js
CHANGED
|
@@ -121,7 +121,25 @@ export const Board = ({ className, headingLevel = 3, label, lanes, moveIcon, nar
|
|
|
121
121
|
});
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
|
-
return (_jsxs("section", { "aria-label": label,
|
|
124
|
+
return (_jsxs("section", { "aria-label": label,
|
|
125
|
+
/*
|
|
126
|
+
* `@container/board`, and the NAME is what a card's move
|
|
127
|
+
* handle needs.
|
|
128
|
+
*
|
|
129
|
+
* An unnamed container query matches the nearest ancestor
|
|
130
|
+
* container, and between this box and a card there is a
|
|
131
|
+
* second one — the lane's, one level down, which decides what
|
|
132
|
+
* shape a card is. So a `cq-lg:` written inside `BoardCard`
|
|
133
|
+
* asks about the LANE, and the answer is inverted against the
|
|
134
|
+
* question the handle has to ask: in a three-up board a lane
|
|
135
|
+
* is ~280px, and in the Narrow View the single lane is the
|
|
136
|
+
* whole board. Naming this one lets the handle query past the
|
|
137
|
+
* lane to the box that actually decides how many lanes are on
|
|
138
|
+
* screen. Naming changes nothing else — a named container
|
|
139
|
+
* still answers an unnamed query, which is why the segmented
|
|
140
|
+
* control and the lanes below keep their plain `cq-lg:`.
|
|
141
|
+
*/
|
|
142
|
+
className: toClassName("@container/board", className), children: [_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(SegmentedControl, { className: "max-w-full flex-wrap cq-lg:hidden", items: lanes.map((lane) => ({
|
|
125
143
|
// Stacked rather than `Todo (6)`, because the count is
|
|
126
144
|
// the reason to look: a lane picker that reads
|
|
127
145
|
// "In Progress (5)" on one line is a long label with a
|
package/dist/Board/Board.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Board.js","sourceRoot":"","sources":["../../src/Board/Board.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAA0C,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAsC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AACnD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Board.js","sourceRoot":"","sources":["../../src/Board/Board.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAA0C,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAsC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AACnD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA4DhD;;;;;;;;;;;;;;;;;;;;;;;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AAS,EAAE,EAAE;oCACrB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CACvB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAC/B,CAAA;oCAED,UAAU,CAAC;wCACT,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAC7B,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAC7B;wCACD,WAAW,EAAE,IAAI,CAAC,GAAG;wCACrB,OAAO;wCACP,2CAA2C;wCAC3C,0CAA0C;wCAC1C,2CAA2C;wCAC3C,wCAAwC;wCACxC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;wCAClC,SAAS;qCACV,CAAC,CAAA;gCACJ,CAAC;gCACH,CAAC,CAAC,SAAS,EAEf,WAAW,EACT,MAAM;gCACJ,CAAC,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE;oCACvB,SAAS,CAAC,YAAY,EAAE;wCACtB,GAAG,MAAM;wCACT,WAAW,EAAE,IAAI,CAAC,GAAG;qCACtB,CAAC,CAAA;gCACJ,CAAC;gCACH,CAAC,CAAC,SAAS,EAEf,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IA1CtC,IAAI,CAAC,GAAG,CA2Cb,CACH,CAAC,GACE,IACF,EAQN,KAAC,cAAc,kBACD,GAAG,KAAK,WAAW,EAC/B,IAAI,EAAC,QAAQ,YAEZ,gBAAgB,GACF,IACT,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -127,13 +127,16 @@ export type BoardCardProps = {
|
|
|
127
127
|
item: BoardItem;
|
|
128
128
|
laneLabel: string;
|
|
129
129
|
/**
|
|
130
|
-
* Shown on the move handle
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
130
|
+
* Shown on the move handle **while the lanes are side by side**,
|
|
131
|
+
* instead of the word "Move". Below the board's `cq-lg` the word
|
|
132
|
+
* comes back whatever this is — see the handle section below.
|
|
133
|
+
*
|
|
134
|
+
* The library ships no icons, so the default is words — a `⋮`
|
|
135
|
+
* renders as nothing where the font lacks it, which includes the
|
|
136
|
+
* kiosk image and the ePaper build. An app that already owns a
|
|
137
|
+
* glyph set passes one and buys back the ~35px per row that a
|
|
138
|
+
* word costs, which in a 500px lane is several characters of
|
|
139
|
+
* title.
|
|
137
140
|
*/
|
|
138
141
|
moveIcon?: ReactNode;
|
|
139
142
|
/** The lanes this card can be sent to — never its own. */
|
|
@@ -187,6 +190,38 @@ export type BoardCardProps = {
|
|
|
187
190
|
* on screen at all. Dragging from it moves the card directly. Both
|
|
188
191
|
* commit through the same callback, so there is no second code path
|
|
189
192
|
* to keep honest and neither is a fallback for the other.
|
|
193
|
+
*
|
|
194
|
+
* ### What it WEARS depends on whether a drag can succeed
|
|
195
|
+
*
|
|
196
|
+
* The two drivers are not equally available at every width, so the
|
|
197
|
+
* handle does not claim they are:
|
|
198
|
+
*
|
|
199
|
+
* | The board is | The handle shows | Because |
|
|
200
|
+
* | --- | --- | --- |
|
|
201
|
+
* | `cq-lg` and wider — lanes side by side | the app's `moveIcon` | the other lanes are on screen, so a drag has somewhere to land, and a grip glyph teaches that gesture |
|
|
202
|
+
* | narrower — one lane and a segmented control | the word **Move** | there is nothing on screen to drop onto, so the only gesture the glyph teaches is the one that cannot work |
|
|
203
|
+
*
|
|
204
|
+
* That table is a bug report. QueuePilot shipped a `≡` handle in a
|
|
205
|
+
* one-lane board and the owner could not move anybody: *"I can't
|
|
206
|
+
* seem to drag 'n drop the names from Everyone Else anywhere else.
|
|
207
|
+
* There's no right-click or anything. How do I move these?"* The
|
|
208
|
+
* first fix took the glyph away everywhere, which was the wrong
|
|
209
|
+
* half — *"I think the drag handles were fine, but now you have it
|
|
210
|
+
* in a 3-column mode, so dragging would work, but it has this
|
|
211
|
+
* 'move' button instead."*
|
|
212
|
+
*
|
|
213
|
+
* Both are in the DOM and CSS picks; neither is rendered from a
|
|
214
|
+
* measurement. A `ResizeObserver` would get the first paint wrong,
|
|
215
|
+
* and a kiosk Pi shows that. Both are `aria-hidden`, and the
|
|
216
|
+
* handle's whole accessible name comes from the `VisuallyHidden`
|
|
217
|
+
* beside them — so the name is the same sentence at every width,
|
|
218
|
+
* which is what keeps one `getByRole` query working in both
|
|
219
|
+
* layouts.
|
|
220
|
+
*
|
|
221
|
+
* The query is against the **board's** container, named `board`,
|
|
222
|
+
* not the lane's. A lane in a three-up board is narrow and the
|
|
223
|
+
* Narrow View's single lane is wide, so the nearer container
|
|
224
|
+
* answers this question exactly backwards.
|
|
190
225
|
*/
|
|
191
226
|
export declare const BoardCard: ({ item, laneLabel, moveIcon, moveTargets, onMoveToLane, onStartDrag, }: BoardCardProps) => ReactNode;
|
|
192
227
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoardCard.d.ts","sourceRoot":"","sources":["../../src/Board/BoardCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAc/D,KAAK,eAAe,GAAG;IACrB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACr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AAY,EAAE;QAC3B,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,aAAa,EAAE,WAAW,GAAG,OAAO,CAAA;QACpC,SAAS,EAAE,MAAM,CAAA;KAClB,KAAK,IAAI,CAAA;CACX,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,SAAS,GAAI,wEAOvB,cAAc,KAAG,SAqOnB,CAAA"}
|
package/dist/Board/BoardCard.js
CHANGED
|
@@ -44,6 +44,38 @@ import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
|
44
44
|
* on screen at all. Dragging from it moves the card directly. Both
|
|
45
45
|
* commit through the same callback, so there is no second code path
|
|
46
46
|
* to keep honest and neither is a fallback for the other.
|
|
47
|
+
*
|
|
48
|
+
* ### What it WEARS depends on whether a drag can succeed
|
|
49
|
+
*
|
|
50
|
+
* The two drivers are not equally available at every width, so the
|
|
51
|
+
* handle does not claim they are:
|
|
52
|
+
*
|
|
53
|
+
* | The board is | The handle shows | Because |
|
|
54
|
+
* | --- | --- | --- |
|
|
55
|
+
* | `cq-lg` and wider — lanes side by side | the app's `moveIcon` | the other lanes are on screen, so a drag has somewhere to land, and a grip glyph teaches that gesture |
|
|
56
|
+
* | narrower — one lane and a segmented control | the word **Move** | there is nothing on screen to drop onto, so the only gesture the glyph teaches is the one that cannot work |
|
|
57
|
+
*
|
|
58
|
+
* That table is a bug report. QueuePilot shipped a `≡` handle in a
|
|
59
|
+
* one-lane board and the owner could not move anybody: *"I can't
|
|
60
|
+
* seem to drag 'n drop the names from Everyone Else anywhere else.
|
|
61
|
+
* There's no right-click or anything. How do I move these?"* The
|
|
62
|
+
* first fix took the glyph away everywhere, which was the wrong
|
|
63
|
+
* half — *"I think the drag handles were fine, but now you have it
|
|
64
|
+
* in a 3-column mode, so dragging would work, but it has this
|
|
65
|
+
* 'move' button instead."*
|
|
66
|
+
*
|
|
67
|
+
* Both are in the DOM and CSS picks; neither is rendered from a
|
|
68
|
+
* measurement. A `ResizeObserver` would get the first paint wrong,
|
|
69
|
+
* and a kiosk Pi shows that. Both are `aria-hidden`, and the
|
|
70
|
+
* handle's whole accessible name comes from the `VisuallyHidden`
|
|
71
|
+
* beside them — so the name is the same sentence at every width,
|
|
72
|
+
* which is what keeps one `getByRole` query working in both
|
|
73
|
+
* layouts.
|
|
74
|
+
*
|
|
75
|
+
* The query is against the **board's** container, named `board`,
|
|
76
|
+
* not the lane's. A lane in a three-up board is narrow and the
|
|
77
|
+
* Narrow View's single lane is wide, so the nearer container
|
|
78
|
+
* answers this question exactly backwards.
|
|
47
79
|
*/
|
|
48
80
|
export const BoardCard = ({ item, laneLabel, moveIcon, moveTargets, onMoveToLane, onStartDrag, }) => {
|
|
49
81
|
const [isMenuVisible, setIsMenuVisible] = useState(false);
|
|
@@ -76,18 +108,32 @@ export const BoardCard = ({ item, laneLabel, moveIcon, moveTargets, onMoveToLane
|
|
|
76
108
|
},
|
|
77
109
|
})), onDismiss: () => {
|
|
78
110
|
setIsMenuVisible(false);
|
|
79
|
-
}, placement: "bottom-end", trigger: _jsxs(Button, { appearance: "ghost", intent: "neutral",
|
|
111
|
+
}, placement: "bottom-end", trigger: _jsxs(Button, { appearance: "ghost", intent: "neutral", className: toClassName(
|
|
80
112
|
// `touch-none` so a touch drag is a drag
|
|
81
113
|
// rather than a page scroll. Only the handle
|
|
82
|
-
// needs it; the rest of the gesture is
|
|
83
|
-
// by `preventDefault` on the
|
|
84
|
-
// `pointermove`.
|
|
85
|
-
|
|
114
|
+
// needs it; the rest of the gesture is
|
|
115
|
+
// covered by `preventDefault` on the
|
|
116
|
+
// captured `pointermove`.
|
|
117
|
+
"touch-none opacity-70 group-hover:opacity-100",
|
|
118
|
+
// `sizing` is a prop and cannot be two
|
|
119
|
+
// things at once, so the button stays
|
|
120
|
+
// `control`-sized — which is what the word
|
|
121
|
+
// needs — and takes `icon` sizing back at
|
|
122
|
+
// the width where the glyph is what is
|
|
123
|
+
// showing. These are the two utilities
|
|
124
|
+
// `ICON_CONTROL_SIZE_CLASS.sm` is, minus the
|
|
125
|
+
// height `CONTROL_SIZE_CLASS.sm` already
|
|
126
|
+
// set. Deterministic rather than a
|
|
127
|
+
// specificity coin-flip: Tailwind orders a
|
|
128
|
+
// variant after the utility it varies, which
|
|
129
|
+
// is the same thing the lane's own
|
|
130
|
+
// `cq-lg:p-0` relies on.
|
|
131
|
+
moveIcon != null &&
|
|
132
|
+
"@min-[48rem]/board:w-(--control-height-sm) @min-[48rem]/board:px-0"), onClick: () => {
|
|
86
133
|
setIsMenuVisible((isVisible) => !isVisible);
|
|
87
134
|
}, onPointerDown: (pointerEvent) => {
|
|
88
135
|
onStartDrag?.(pointerEvent);
|
|
89
|
-
}, size: "sm", sizing: moveIcon ? "
|
|
90
|
-
|
|
91
|
-
: ` ${item.title}, currently in ${laneLabel}` })] }) })) : null] })) : null] }), item.footer ? (_jsx("div", { className: "min-w-0 text-content-secondary text-xs", children: item.footer })) : null] })] }));
|
|
136
|
+
}, size: "sm", sizing: "control", children: [moveIcon == null ? null : (_jsx("span", { "aria-hidden": "true", className: "hidden @min-[48rem]/board:contents", children: moveIcon })), _jsx("span", { "aria-hidden": "true", className: toClassName(moveIcon != null &&
|
|
137
|
+
"@min-[48rem]/board:hidden"), children: "Move" }), _jsx(VisuallyHidden, { children: `Move ${item.title}, currently in ${laneLabel}` })] }) })) : null] })) : null] }), item.footer ? (_jsx("div", { className: "min-w-0 text-content-secondary text-xs", children: item.footer })) : null] })] }));
|
|
92
138
|
};
|
|
93
139
|
//# sourceMappingURL=BoardCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoardCard.js","sourceRoot":"","sources":["../../src/Board/BoardCard.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,MAA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AI,IACJ,EAEL,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAC,wCAAwC,YACpD,IAAI,CAAC,MAAM,GACR,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,IACH,CACN,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { ControlSize } from "@charcuterie/tokens";
|
|
2
|
+
import type { Placement } from "@floating-ui/react";
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
|
+
import type { NavItem } from "./navItems.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Where the destinations are drawn. Not *whether* — see
|
|
7
|
+
* `useNavLayout`, which answers that from the width.
|
|
8
|
+
*/
|
|
9
|
+
export type NavLayout = "bar" | "bottom" | "menu" | "rail" | "railIcons";
|
|
10
|
+
type NavCommonProps = {
|
|
11
|
+
/**
|
|
12
|
+
* The destinations, in the order the product reads.
|
|
13
|
+
*
|
|
14
|
+
* Annotate the array as `NavRailItem[]` when the app uses a rail:
|
|
15
|
+
* it is the same shape with `icon` made **required**, because
|
|
16
|
+
* `railIcons` takes the label away and an item with no glyph is a
|
|
17
|
+
* blank square that still navigates. `NavItem` keeps `icon`
|
|
18
|
+
* optional so that a `bar`, where the label never goes anywhere,
|
|
19
|
+
* does not have to invent one.
|
|
20
|
+
*/
|
|
21
|
+
items: readonly NavItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The address the app is at — usually `location.pathname`. The
|
|
24
|
+
* item that matches wears `aria-current="page"`.
|
|
25
|
+
*
|
|
26
|
+
* Omitted means nothing is current, which is honest on a screen
|
|
27
|
+
* the nav does not contain (a modal route, an error page) and is
|
|
28
|
+
* better than marking the closest thing.
|
|
29
|
+
*/
|
|
30
|
+
activeHref?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The `<nav>`'s accessible name. Default `"Main"`.
|
|
34
|
+
*
|
|
35
|
+
* Required in spirit and defaulted in practice: two unnamed
|
|
36
|
+
* navigations on one page are two landmarks a screen reader
|
|
37
|
+
* announces identically, which is axe's `landmark-unique`. An app
|
|
38
|
+
* with a second nav — a queue's sub-navigation, a footer — names
|
|
39
|
+
* that one and leaves this one alone.
|
|
40
|
+
*/
|
|
41
|
+
label?: string;
|
|
42
|
+
};
|
|
43
|
+
type NavPlacedProps = NavCommonProps & {
|
|
44
|
+
/**
|
|
45
|
+
* **Initial** only, and the bar owns it from then on — the same
|
|
46
|
+
* uncontrolled contract every other component here has. It exists
|
|
47
|
+
* so a story (and a screenshot) can show the menu open; an app
|
|
48
|
+
* almost never passes it. `bar` only.
|
|
49
|
+
*/
|
|
50
|
+
isMenuVisible?: boolean;
|
|
51
|
+
layout?: "bar" | "bottom" | "rail" | "railIcons";
|
|
52
|
+
/**
|
|
53
|
+
* Where the trigger sits in the bar's track once the row has
|
|
54
|
+
* folded. `"end"` when the header puts its own actions at the far
|
|
55
|
+
* edge, so the fold control joins them instead of hugging the
|
|
56
|
+
* wordmark with the whole track empty after it.
|
|
57
|
+
*
|
|
58
|
+
* It reaches **only** the folded row, which holds exactly one
|
|
59
|
+
* item — so it cannot disturb where the links sit when the bar is
|
|
60
|
+
* whole, and there is deliberately no prop that can.
|
|
61
|
+
*/
|
|
62
|
+
menuAlign?: "end" | "start";
|
|
63
|
+
/**
|
|
64
|
+
* The folded trigger's glyph. **No default** — the library ships
|
|
65
|
+
* no icons, and a hamburger renders as nothing where the font
|
|
66
|
+
* lacks it. With no icon the trigger is a text button reading
|
|
67
|
+
* `menuLabel`, which works everywhere.
|
|
68
|
+
*/
|
|
69
|
+
menuIcon?: ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* Names the trigger and, through it, the panel it opens. A
|
|
72
|
+
* `role="dialog"` takes no accessible name from its content.
|
|
73
|
+
*/
|
|
74
|
+
menuLabel?: string;
|
|
75
|
+
menuPlacement?: Placement;
|
|
76
|
+
size?: ControlSize;
|
|
77
|
+
};
|
|
78
|
+
type NavMenuProps = NavCommonProps & {
|
|
79
|
+
isVisible: boolean;
|
|
80
|
+
layout: "menu";
|
|
81
|
+
onDismiss: () => void;
|
|
82
|
+
placement?: Placement;
|
|
83
|
+
/** The control the panel hangs off. **Cloned, not wrapped.** */
|
|
84
|
+
trigger: ReactElement;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* The union splits on `menu` and **only** on `menu`, because that is
|
|
88
|
+
* the one layout an app cannot reach with a variable: its trigger
|
|
89
|
+
* goes in the `Header`, so the app is already writing the branch.
|
|
90
|
+
*
|
|
91
|
+
* Everything else takes `layout={navLayout.layout}` straight from
|
|
92
|
+
* `useNavLayout` — which is a *variable*, not a literal, so a union
|
|
93
|
+
* that also split `items` by layout would force a `switch` at the
|
|
94
|
+
* one call site this component exists to make short.
|
|
95
|
+
*/
|
|
96
|
+
export type NavProps = NavMenuProps | NavPlacedProps;
|
|
97
|
+
/**
|
|
98
|
+
* The app's destinations — a header row, a side rail, a collapsed
|
|
99
|
+
* rail, a strip along the foot of the Narrow View, or a panel behind
|
|
100
|
+
* one control. The same list, drawn where it fits.
|
|
101
|
+
*
|
|
102
|
+
* ## What was actually missing
|
|
103
|
+
*
|
|
104
|
+
* `Shell` / `Header` / `Rail` / `Main` shipped the page frame on
|
|
105
|
+
* 2026-08-10 and left the **contents of the nav rail empty**. Twelve
|
|
106
|
+
* UI repos, and exactly two of them had a `<nav>` at all: Docket
|
|
107
|
+
* hand-rolled a row of `NavLink`s with the collapse rule in the
|
|
108
|
+
* app's own stylesheet, Folio hand-rolled another, and the other ten
|
|
109
|
+
* had no destinations anywhere. The two that existed already
|
|
110
|
+
* disagreed — Docket *wraps* below its breakpoint and stands three
|
|
111
|
+
* lines tall on a phone, which is not a decision anybody made, it is
|
|
112
|
+
* what `flex-wrap` does when nobody writes the other rule.
|
|
113
|
+
*
|
|
114
|
+
* ## Every item is a real link
|
|
115
|
+
*
|
|
116
|
+
* `<a href>`, through the injected `RouterLinkProvider` — see
|
|
117
|
+
* `NavLink`, which is where that argument is written down.
|
|
118
|
+
*
|
|
119
|
+
* ## `aria-current="page"`, and exactly one of them
|
|
120
|
+
*
|
|
121
|
+
* `resolveActiveKey` takes the **deepest** matching path, so an app
|
|
122
|
+
* holding both `/settings` and `/settings/labels` marks the page the
|
|
123
|
+
* reader is actually on rather than both.
|
|
124
|
+
*
|
|
125
|
+
* ## `bar` folds WHOLE, and it is measured
|
|
126
|
+
*
|
|
127
|
+
* There is no `collapseAt` and no media query on this axis. The bar
|
|
128
|
+
* reads the width its links actually have and folds when their sum
|
|
129
|
+
* stops fitting, so a longer label, a tenth destination, a
|
|
130
|
+
* `data-density="kiosk"` or a reader at 175% browser zoom each move
|
|
131
|
+
* the fold on their own. mux-magic collapses at a hardcoded `480px`
|
|
132
|
+
* and plex-channels at `760px`, and neither number has a reason.
|
|
133
|
+
*
|
|
134
|
+
* It folds *whole* rather than progressively, unlike `Toolbar`:
|
|
135
|
+
* `Toolbar`'s items are ranked, and a nav's order is the shape of
|
|
136
|
+
* the product (Docket's reads as the pipeline: Triage → Backlog →
|
|
137
|
+
* Phases → Board → Archives). Half of that behind a button is a rule
|
|
138
|
+
* no reader can learn.
|
|
139
|
+
*
|
|
140
|
+
* ⚠️ **A `bar` must not be sized by its own contents.** It measures
|
|
141
|
+
* its own box to decide what to draw in it, so a container that
|
|
142
|
+
* shrink-wraps makes the answer its own input: put it in a
|
|
143
|
+
* `minmax(0, 1fr)` grid track or a `flex-1 min-w-0` row. The root
|
|
144
|
+
* carries `min-w-0 flex-1` for the flex case; a grid track is the
|
|
145
|
+
* caller's to declare.
|
|
146
|
+
*
|
|
147
|
+
* ## `menu` is the rail's narrow state, and the app owns it
|
|
148
|
+
*
|
|
149
|
+
* `bar` builds its own trigger because it knows when it folded.
|
|
150
|
+
* `menu` takes one, because the rail's narrow state puts that
|
|
151
|
+
* control in the `Header` — a different corner of `Shell`'s grid
|
|
152
|
+
* from a side rail, and no media query moves an element across a
|
|
153
|
+
* grid. `useNavLayout` is what tells the app which of the two it is
|
|
154
|
+
* rendering.
|
|
155
|
+
*
|
|
156
|
+
* ## Mounted exactly once
|
|
157
|
+
*
|
|
158
|
+
* A destination is in the bar or in the panel, never both. The
|
|
159
|
+
* fleet's habit is to render the whole nav twice and hide one copy
|
|
160
|
+
* with `hidden md:flex` — mux-magic's `PageHeader` across two
|
|
161
|
+
* ~55-line blocks, mail-sifter's `TriageQueue` again — which puts
|
|
162
|
+
* every link in the DOM at every width, so an agent driving the page
|
|
163
|
+
* finds two of each and cannot tell which one a human can see.
|
|
164
|
+
*/
|
|
165
|
+
export declare const Nav: (props: NavProps) => ReactNode;
|
|
166
|
+
export {};
|
|
167
|
+
//# sourceMappingURL=Nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nav.d.ts","sourceRoot":"","sources":["../../src/Nav/Nav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,WAAW,CAAA;AAEf,KAAK,cAAc,GAAG;IACpB;;;;;;;;;OASG;IACH,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;IACzB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,cAAc,GAAG,cAAc,GAAG;IACrC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IAChD;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAAA;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB,CAAA;AAED,KAAK,YAAY,GAAG,cAAc,GAAG;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,gEAAgE;IAChE,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,cAAc,CAAA;AAqBpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,QAAQ,KAAG,SAsMrC,CAAA"}
|
package/dist/Nav/Nav.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useVisibility } from "@charcuterie/logic";
|
|
3
|
+
import { Button } from "../Button/Button.js";
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
|
+
import { usePanelItemSize } from "../Overlay/usePanelItemSize.js";
|
|
6
|
+
import { Popover } from "../Popover/Popover.js";
|
|
7
|
+
import { useToolbarOverflow } from "../Toolbar/useToolbarOverflow.js";
|
|
8
|
+
import { toClassName } from "../toClassName.js";
|
|
9
|
+
import { NavLink } from "./NavLink.js";
|
|
10
|
+
import { getNavItemKey, resolveActiveKey, } from "./navItems.js";
|
|
11
|
+
const LIST_CLASS = {
|
|
12
|
+
bar: "flex min-w-0 flex-row items-center gap-1",
|
|
13
|
+
// `auto-cols-fr` with `grid-flow-col`: equal columns whose count
|
|
14
|
+
// comes from the item list, so four destinations divide the width
|
|
15
|
+
// and five still do, with no per-app count to keep in step.
|
|
16
|
+
bottom: "grid auto-cols-fr grid-flow-col gap-0",
|
|
17
|
+
menu: "flex min-w-48 flex-col gap-0.5",
|
|
18
|
+
rail: "flex min-w-0 flex-col gap-1",
|
|
19
|
+
railIcons: "flex flex-col items-center gap-1",
|
|
20
|
+
};
|
|
21
|
+
const NAV_CLASS = {
|
|
22
|
+
bar: "flex min-w-0 flex-1 items-center gap-1",
|
|
23
|
+
bottom: "border-border-subtle border-t bg-surface-raised",
|
|
24
|
+
menu: "min-w-0",
|
|
25
|
+
rail: "min-w-0",
|
|
26
|
+
railIcons: "min-w-0",
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The app's destinations — a header row, a side rail, a collapsed
|
|
30
|
+
* rail, a strip along the foot of the Narrow View, or a panel behind
|
|
31
|
+
* one control. The same list, drawn where it fits.
|
|
32
|
+
*
|
|
33
|
+
* ## What was actually missing
|
|
34
|
+
*
|
|
35
|
+
* `Shell` / `Header` / `Rail` / `Main` shipped the page frame on
|
|
36
|
+
* 2026-08-10 and left the **contents of the nav rail empty**. Twelve
|
|
37
|
+
* UI repos, and exactly two of them had a `<nav>` at all: Docket
|
|
38
|
+
* hand-rolled a row of `NavLink`s with the collapse rule in the
|
|
39
|
+
* app's own stylesheet, Folio hand-rolled another, and the other ten
|
|
40
|
+
* had no destinations anywhere. The two that existed already
|
|
41
|
+
* disagreed — Docket *wraps* below its breakpoint and stands three
|
|
42
|
+
* lines tall on a phone, which is not a decision anybody made, it is
|
|
43
|
+
* what `flex-wrap` does when nobody writes the other rule.
|
|
44
|
+
*
|
|
45
|
+
* ## Every item is a real link
|
|
46
|
+
*
|
|
47
|
+
* `<a href>`, through the injected `RouterLinkProvider` — see
|
|
48
|
+
* `NavLink`, which is where that argument is written down.
|
|
49
|
+
*
|
|
50
|
+
* ## `aria-current="page"`, and exactly one of them
|
|
51
|
+
*
|
|
52
|
+
* `resolveActiveKey` takes the **deepest** matching path, so an app
|
|
53
|
+
* holding both `/settings` and `/settings/labels` marks the page the
|
|
54
|
+
* reader is actually on rather than both.
|
|
55
|
+
*
|
|
56
|
+
* ## `bar` folds WHOLE, and it is measured
|
|
57
|
+
*
|
|
58
|
+
* There is no `collapseAt` and no media query on this axis. The bar
|
|
59
|
+
* reads the width its links actually have and folds when their sum
|
|
60
|
+
* stops fitting, so a longer label, a tenth destination, a
|
|
61
|
+
* `data-density="kiosk"` or a reader at 175% browser zoom each move
|
|
62
|
+
* the fold on their own. mux-magic collapses at a hardcoded `480px`
|
|
63
|
+
* and plex-channels at `760px`, and neither number has a reason.
|
|
64
|
+
*
|
|
65
|
+
* It folds *whole* rather than progressively, unlike `Toolbar`:
|
|
66
|
+
* `Toolbar`'s items are ranked, and a nav's order is the shape of
|
|
67
|
+
* the product (Docket's reads as the pipeline: Triage → Backlog →
|
|
68
|
+
* Phases → Board → Archives). Half of that behind a button is a rule
|
|
69
|
+
* no reader can learn.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ **A `bar` must not be sized by its own contents.** It measures
|
|
72
|
+
* its own box to decide what to draw in it, so a container that
|
|
73
|
+
* shrink-wraps makes the answer its own input: put it in a
|
|
74
|
+
* `minmax(0, 1fr)` grid track or a `flex-1 min-w-0` row. The root
|
|
75
|
+
* carries `min-w-0 flex-1` for the flex case; a grid track is the
|
|
76
|
+
* caller's to declare.
|
|
77
|
+
*
|
|
78
|
+
* ## `menu` is the rail's narrow state, and the app owns it
|
|
79
|
+
*
|
|
80
|
+
* `bar` builds its own trigger because it knows when it folded.
|
|
81
|
+
* `menu` takes one, because the rail's narrow state puts that
|
|
82
|
+
* control in the `Header` — a different corner of `Shell`'s grid
|
|
83
|
+
* from a side rail, and no media query moves an element across a
|
|
84
|
+
* grid. `useNavLayout` is what tells the app which of the two it is
|
|
85
|
+
* rendering.
|
|
86
|
+
*
|
|
87
|
+
* ## Mounted exactly once
|
|
88
|
+
*
|
|
89
|
+
* A destination is in the bar or in the panel, never both. The
|
|
90
|
+
* fleet's habit is to render the whole nav twice and hide one copy
|
|
91
|
+
* with `hidden md:flex` — mux-magic's `PageHeader` across two
|
|
92
|
+
* ~55-line blocks, mail-sifter's `TriageQueue` again — which puts
|
|
93
|
+
* every link in the DOM at every width, so an agent driving the page
|
|
94
|
+
* finds two of each and cannot tell which one a human can see.
|
|
95
|
+
*/
|
|
96
|
+
export const Nav = (props) => {
|
|
97
|
+
const { activeHref, className, items, label = "Main", } = props;
|
|
98
|
+
const layout = props.layout ?? "bar";
|
|
99
|
+
const activeKey = resolveActiveKey(items, activeHref);
|
|
100
|
+
const itemKeys = items.map(getNavItemKey);
|
|
101
|
+
const { containerRef, trackItem, visibleCount } = useToolbarOverflow({ itemKeys });
|
|
102
|
+
// The bar-only knobs. `menu` is the one variant that does not
|
|
103
|
+
// carry them, and it is the one variant the app branches on
|
|
104
|
+
// anyway.
|
|
105
|
+
const placedProps = props.layout === "menu" ? null : props;
|
|
106
|
+
const { hide, isVisible, toggle } = useVisibility({
|
|
107
|
+
isVisible: placedProps?.isMenuVisible ?? false,
|
|
108
|
+
});
|
|
109
|
+
const panelItemSize = usePanelItemSize("lg");
|
|
110
|
+
/**
|
|
111
|
+
* All or nothing. `visibleCount` is the progressive answer and
|
|
112
|
+
* this is the only thing read off it: the moment one link stops
|
|
113
|
+
* fitting, every link goes into the menu together.
|
|
114
|
+
*/
|
|
115
|
+
const isFolded = layout === "bar" && visibleCount < items.length;
|
|
116
|
+
const size = placedProps?.size ?? "sm";
|
|
117
|
+
const renderList = (placement, listLayout) => (_jsx("ul", { className: toClassName("list-none p-0", LIST_CLASS[listLayout]), children: items.map((item) => {
|
|
118
|
+
const key = getNavItemKey(item);
|
|
119
|
+
return (_jsx("li", { className: "min-w-0", children: _jsx(NavLink, { isCurrent: key === activeKey, item: item, onNavigate: placement === "panel" ? hide : undefined, placement: placement, size: placement === "panel" ? panelItemSize : size, trackElement: placement === "bar"
|
|
120
|
+
? (element) => {
|
|
121
|
+
trackItem(key, element);
|
|
122
|
+
}
|
|
123
|
+
: undefined }) }, key));
|
|
124
|
+
}) }));
|
|
125
|
+
if (props.layout === "menu") {
|
|
126
|
+
/**
|
|
127
|
+
* A `Popover` rather than a `Menu`. `Menu`'s items are
|
|
128
|
+
* `onSelect` callbacks on `<button>`s, which is right for the
|
|
129
|
+
* things a menu usually holds — undo, redo, a scheme cycle — and
|
|
130
|
+
* wrong for a destination, for every reason `NavLink` gives.
|
|
131
|
+
*
|
|
132
|
+
* `modal={false}` inside it, so the caret is not trapped: the
|
|
133
|
+
* panel is a disclosure, not a dialog somebody has to answer.
|
|
134
|
+
*/
|
|
135
|
+
return (_jsx(Popover
|
|
136
|
+
// The default panel is `max-w-xs p-3` — sized for a
|
|
137
|
+
// paragraph of prose. This one holds full-bleed rows that
|
|
138
|
+
// bring their own inset, so the padding shrinks to the
|
|
139
|
+
// gutter around them and the width is left to the list.
|
|
140
|
+
, {
|
|
141
|
+
// The default panel is `max-w-xs p-3` — sized for a
|
|
142
|
+
// paragraph of prose. This one holds full-bleed rows that
|
|
143
|
+
// bring their own inset, so the padding shrinks to the
|
|
144
|
+
// gutter around them and the width is left to the list.
|
|
145
|
+
className: "max-w-none p-1", heading: label, isVisible: props.isVisible, onDismiss: props.onDismiss, placement: props.placement ?? "bottom-start", trigger: props.trigger, children: _jsx("nav", { "aria-label": label, children: renderList("panel", "menu") }) }));
|
|
146
|
+
}
|
|
147
|
+
if (layout !== "bar") {
|
|
148
|
+
return (_jsx("nav", { "aria-label": label, className: toClassName(NAV_CLASS[layout], className), children: renderList(layout === "rail"
|
|
149
|
+
? "rail"
|
|
150
|
+
: layout === "railIcons"
|
|
151
|
+
? "railIcons"
|
|
152
|
+
: "bottom", layout) }));
|
|
153
|
+
}
|
|
154
|
+
const menuLabel = placedProps?.menuLabel ?? "Menu";
|
|
155
|
+
const menuIcon = placedProps?.menuIcon;
|
|
156
|
+
const trigger = menuIcon === undefined ? (_jsx(Button, { appearance: "ghost", intent: "neutral", onClick: toggle, size: size, children: menuLabel })) : (_jsx(IconButton, { appearance: "ghost", intent: "neutral", label: menuLabel, onClick: toggle, size: size, children: menuIcon }));
|
|
157
|
+
return (_jsx("nav", { "aria-label": label, className: toClassName(NAV_CLASS.bar,
|
|
158
|
+
// Two written-out entries rather than one interpolated
|
|
159
|
+
// string: Tailwind's scanner cannot see a class that exists
|
|
160
|
+
// only at runtime.
|
|
161
|
+
isFolded && placedProps?.menuAlign === "end"
|
|
162
|
+
? "justify-end"
|
|
163
|
+
: "justify-start", className), ref: containerRef, children: isFolded ? (_jsx(Popover, { className: "max-w-none p-1", heading: menuLabel, isVisible: isVisible, onDismiss: hide, placement: placedProps?.menuPlacement ?? "bottom-start", trigger: trigger, children: renderList("panel", "menu") })) : (renderList("bar", "bar")) }));
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=Nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nav.js","sourceRoot":"","sources":["../../src/Nav/Nav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKlD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA8B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAwB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAA;AAEvC,OAAO,EACL,aAAa,EACb,gBAAgB,GACjB,MAAM,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