@pharos-ds/core 1.0.9 → 1.0.10-canary.2189f39
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/CHANGELOG.md +4 -0
- package/dist/SideNav/SideNav.d.ts +5 -1
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +8 -2
- package/dist/pharos.umd.js +12 -12
- package/dist/pharos.umd.js.map +3 -3
- package/package.json +1 -1
- package/src/SideNav/SideNav.doc.mjs +13 -4
- package/src/SideNav/SideNav.test.tsx +65 -0
- package/src/SideNav/SideNav.tsx +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Sidebar navigation container with five zones: header + topContent (sticky together),
|
|
8
8
|
* children (scrollable), footer, and footerIcons (sticky bottom).
|
|
9
|
+
* When collapsed to the icon rail, `footer` is hidden; `footerIcons` and the
|
|
10
|
+
* collapse button remain.
|
|
9
11
|
*
|
|
10
12
|
* Supports optional resize via drag handle at the inline-end edge.
|
|
11
13
|
*
|
|
@@ -43,7 +45,9 @@ export interface SideNavProps extends BaseProps<HTMLElement> {
|
|
|
43
45
|
*/
|
|
44
46
|
children: ReactNode;
|
|
45
47
|
/**
|
|
46
|
-
* Footer area above icon bar (e.g., promo cards).
|
|
48
|
+
* Footer area above icon bar (e.g., promo cards). Not rendered while the
|
|
49
|
+
* sidebar is collapsed to the icon rail (full-width content doesn't fit);
|
|
50
|
+
* use `footerIcons` for actions that must stay visible in the rail.
|
|
47
51
|
*/
|
|
48
52
|
footer?: ReactNode;
|
|
49
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNav.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNav.tsx"],"names":[],"mappings":"AAIA;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WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;QACnD,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACP;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,EACtB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,WAAW,EACX,WAAmB,EACnB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,+BAqQd;yBApRe,OAAO"}
|
package/dist/SideNav/SideNav.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Sidebar navigation container with five zones: header + topContent (sticky together),
|
|
12
12
|
* children (scrollable), footer, and footerIcons (sticky bottom).
|
|
13
|
+
* When collapsed to the icon rail, `footer` is hidden; `footerIcons` and the
|
|
14
|
+
* collapse button remain.
|
|
13
15
|
*
|
|
14
16
|
* Supports optional resize via drag handle at the inline-end edge.
|
|
15
17
|
*
|
|
@@ -255,7 +257,11 @@ export function SideNav({
|
|
|
255
257
|
// Default mode — full sidebar
|
|
256
258
|
// =========================================================================
|
|
257
259
|
const hasStickyTop = !!(header || topContent);
|
|
258
|
-
|
|
260
|
+
// In the collapsed rail, `footer` is not rendered: its content is laid out
|
|
261
|
+
// full-width (promo cards, segmented controls, account blocks) and doesn't
|
|
262
|
+
// fit the icon-only rail. `footerIcons` and the collapse button stay.
|
|
263
|
+
const visibleFooter = collapsed ? null : footer;
|
|
264
|
+
const hasStickyBottom = !!(visibleFooter || footerIcons);
|
|
259
265
|
// The built-in collapse button only renders when collapse is enabled and it
|
|
260
266
|
// hasn't been opted out via `collapsible.hasButton: false` (e.g. when the
|
|
261
267
|
// consumer places a SideNavCollapseButton in the header instead).
|
|
@@ -323,7 +329,7 @@ export function SideNav({
|
|
|
323
329
|
className: "x78zum5 xdt5ytf x2lah0s xr1yuqi x7wzq59 x1ey2m1c xgcd1z6 x1txdalj xf314gf x1wesfrj xexx8yu"
|
|
324
330
|
}
|
|
325
331
|
}[!!collapsed << 0],
|
|
326
|
-
children: [
|
|
332
|
+
children: [visibleFooter, /*#__PURE__*/_jsxs("div", {
|
|
327
333
|
...{
|
|
328
334
|
0: {
|
|
329
335
|
className: "x78zum5 x6s0dn4 xzye2dw"
|