@alexandregme/zljs 3.12.1 → 3.13.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/CHANGELOG.md +8 -1
- package/dist/{chunk-TMUYZTIH.js → chunk-EBJF4GLR.js} +6 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/next/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [3.13.0] - 2026-11-12
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `TopNav` doesn't show the menu button when no section has a link, such as with `sections={[]}`: there was nothing for it to open. The home link stays in the middle of the bar. It is for an app that reaches its pages another way, such as tabs at the bottom, and wants only the name of the app and the account at the top. `Navigation` on a small screen follows it
|
|
16
|
+
|
|
11
17
|
## [3.11.0] - 2026-11-12
|
|
12
18
|
|
|
13
19
|
### Added
|
|
@@ -516,7 +522,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
|
|
|
516
522
|
|
|
517
523
|
The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
|
|
518
524
|
|
|
519
|
-
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.
|
|
525
|
+
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.13.0...HEAD
|
|
526
|
+
[3.13.0]: https://github.com/alexandregme/zljs/compare/v3.11.0...v3.13.0
|
|
520
527
|
[3.11.0]: https://github.com/alexandregme/zljs/compare/v3.10.0...v3.11.0
|
|
521
528
|
[3.10.0]: https://github.com/alexandregme/zljs/compare/v3.9.0...v3.10.0
|
|
522
529
|
[3.9.0]: https://github.com/alexandregme/zljs/compare/v3.8.0...v3.9.0
|
|
@@ -862,6 +862,9 @@ var topNav = tv9({
|
|
|
862
862
|
// bar under the notch of a phone.
|
|
863
863
|
base: "relative shrink-0 bg-neutral-800 pt-[env(safe-area-inset-top)] text-neutral-300",
|
|
864
864
|
bar: "flex h-14 items-center gap-1 px-2",
|
|
865
|
+
// As wide as the menu button it stands in for, so the home link stays in
|
|
866
|
+
// the middle of the bar.
|
|
867
|
+
spacer: "size-10 shrink-0",
|
|
865
868
|
// Takes what the two buttons leave, with the home link in the middle of it.
|
|
866
869
|
home: "flex min-w-0 flex-1 justify-center",
|
|
867
870
|
// Over the page, under the bar, as wide as the screen. It scrolls when the
|
|
@@ -890,6 +893,7 @@ var TopNav = ({
|
|
|
890
893
|
}) => {
|
|
891
894
|
const [open, setOpen] = useState2(null);
|
|
892
895
|
const styles = topNav();
|
|
896
|
+
const hasLinks = sections.some((section2) => section2.items.length > 0);
|
|
893
897
|
const menuOpen = open === "menu";
|
|
894
898
|
const accountOpen = open === "account";
|
|
895
899
|
const menuIcon = menuOpen ? "X" : "Menu";
|
|
@@ -904,7 +908,7 @@ var TopNav = ({
|
|
|
904
908
|
};
|
|
905
909
|
return /* @__PURE__ */ jsxs6("header", { className: styles.base(), children: [
|
|
906
910
|
/* @__PURE__ */ jsxs6("div", { className: styles.bar(), children: [
|
|
907
|
-
/* @__PURE__ */ jsx11(
|
|
911
|
+
hasLinks ? /* @__PURE__ */ jsx11(
|
|
908
912
|
Button,
|
|
909
913
|
{
|
|
910
914
|
color: "ghost",
|
|
@@ -914,7 +918,7 @@ var TopNav = ({
|
|
|
914
918
|
"aria-expanded": menuOpen,
|
|
915
919
|
onClick: toggleMenu
|
|
916
920
|
}
|
|
917
|
-
),
|
|
921
|
+
) : /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: styles.spacer() }),
|
|
918
922
|
/* @__PURE__ */ jsx11("div", { className: styles.home(), children: homeHref && /* @__PURE__ */ jsxs6(
|
|
919
923
|
Link,
|
|
920
924
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -328,7 +328,10 @@ interface TabsProps {
|
|
|
328
328
|
declare const Tabs: ({ tabs, "aria-label": ariaLabel, defaultTab, onChange, }: TabsProps) => react.JSX.Element;
|
|
329
329
|
|
|
330
330
|
interface TopNavProps {
|
|
331
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* The same sections `Sidebar` takes. The menu button opens them. With no
|
|
333
|
+
* link in any section, the menu button isn't shown.
|
|
334
|
+
*/
|
|
332
335
|
sections: SidebarSection[];
|
|
333
336
|
/** The same user `Sidebar` takes. The account button shows it. */
|
|
334
337
|
user: SidebarUser;
|
package/dist/index.js
CHANGED
package/dist/next/index.js
CHANGED