@nswds/app 1.44.0 → 1.45.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/globals.css +3 -10
- package/dist/index.cjs +41 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +41 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3 -10
- package/dist/styles.css.map +1 -1
- package/package.json +3 -3
package/dist/globals.css
CHANGED
|
@@ -383,9 +383,6 @@
|
|
|
383
383
|
.top-\[1px\] {
|
|
384
384
|
top: 1px;
|
|
385
385
|
}
|
|
386
|
-
.top-\[4\.75rem\] {
|
|
387
|
-
top: 4.75rem;
|
|
388
|
-
}
|
|
389
386
|
.top-\[50\%\] {
|
|
390
387
|
top: 50%;
|
|
391
388
|
}
|
|
@@ -1276,9 +1273,6 @@
|
|
|
1276
1273
|
.h-\[calc\(100\%-1px\)\] {
|
|
1277
1274
|
height: calc(100% - 1px);
|
|
1278
1275
|
}
|
|
1279
|
-
.h-\[calc\(100vh-4\.75rem\)\] {
|
|
1280
|
-
height: calc(100vh - 4.75rem);
|
|
1281
|
-
}
|
|
1282
1276
|
.h-\[var\(--radix-navigation-menu-viewport-height\)\] {
|
|
1283
1277
|
height: var(--radix-navigation-menu-viewport-height);
|
|
1284
1278
|
}
|
|
@@ -2476,10 +2470,6 @@
|
|
|
2476
2470
|
--tw-gradient-position: to right in oklab;
|
|
2477
2471
|
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
2478
2472
|
}
|
|
2479
|
-
.from-grey-600 {
|
|
2480
|
-
--tw-gradient-from: oklch(0.426426783985819 0.011202235626284581 232.61715023407646);
|
|
2481
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2482
|
-
}
|
|
2483
2473
|
.from-grey-800 {
|
|
2484
2474
|
--tw-gradient-from: oklch(0.26941250740174183 0.010359971488680036 242.08383926925922);
|
|
2485
2475
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -2685,6 +2675,9 @@
|
|
|
2685
2675
|
.px-8 {
|
|
2686
2676
|
padding-inline: calc(var(--spacing) * 8);
|
|
2687
2677
|
}
|
|
2678
|
+
.px-18 {
|
|
2679
|
+
padding-inline: calc(var(--spacing) * 18);
|
|
2680
|
+
}
|
|
2688
2681
|
.px-\[0\.5px\] {
|
|
2689
2682
|
padding-inline: 0.5px;
|
|
2690
2683
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -7512,9 +7512,10 @@ function FooterLegalLinks({ legalLinks }) {
|
|
|
7512
7512
|
function Footer({
|
|
7513
7513
|
legalLinks,
|
|
7514
7514
|
department,
|
|
7515
|
-
socialLinks
|
|
7515
|
+
socialLinks,
|
|
7516
|
+
className
|
|
7516
7517
|
}) {
|
|
7517
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "mx-auto w-full px-4 py-16 pb-16 lg:pr-0 lg:pl-8", children: [
|
|
7518
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: cn("mx-auto w-full px-4 py-16 pb-16 lg:pr-0 lg:pl-8", className), children: [
|
|
7518
7519
|
/* @__PURE__ */ jsxRuntime.jsx(FooterAcknowledgement, {}),
|
|
7519
7520
|
/* @__PURE__ */ jsxRuntime.jsx(Separator4, { className: "bg-grey-200 my-4" }),
|
|
7520
7521
|
/* @__PURE__ */ jsxRuntime.jsx(FooterLegalLinks, { legalLinks }),
|
|
@@ -7808,7 +7809,7 @@ function Heading({
|
|
|
7808
7809
|
|
|
7809
7810
|
// package.json
|
|
7810
7811
|
var package_default = {
|
|
7811
|
-
version: "1.
|
|
7812
|
+
version: "1.44.0"};
|
|
7812
7813
|
function Logo(props) {
|
|
7813
7814
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7814
7815
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "NSW Government" }),
|
|
@@ -16579,9 +16580,24 @@ function PrevNextLinksPageLink({
|
|
|
16579
16580
|
) })
|
|
16580
16581
|
] });
|
|
16581
16582
|
}
|
|
16583
|
+
function flattenNavigation(navigation) {
|
|
16584
|
+
const result = [];
|
|
16585
|
+
function traverse(items) {
|
|
16586
|
+
for (const item of items) {
|
|
16587
|
+
if (item.href) {
|
|
16588
|
+
result.push({ title: item.title, href: item.href });
|
|
16589
|
+
}
|
|
16590
|
+
if (item.links && Array.isArray(item.links)) {
|
|
16591
|
+
traverse(item.links);
|
|
16592
|
+
}
|
|
16593
|
+
}
|
|
16594
|
+
}
|
|
16595
|
+
traverse(navigation);
|
|
16596
|
+
return result;
|
|
16597
|
+
}
|
|
16582
16598
|
function PrevNextLinks({ navigation: navigation$1 }) {
|
|
16583
16599
|
const pathname = navigation.usePathname();
|
|
16584
|
-
const allLinks = navigation$1
|
|
16600
|
+
const allLinks = flattenNavigation(navigation$1);
|
|
16585
16601
|
const linkIndex = allLinks.findIndex((link) => link?.href === pathname);
|
|
16586
16602
|
const previousPage = linkIndex > 0 ? allLinks[linkIndex - 1] : null;
|
|
16587
16603
|
const nextPage = linkIndex > -1 && linkIndex < allLinks.length - 1 ? allLinks[linkIndex + 1] : null;
|
|
@@ -16755,6 +16771,15 @@ function SheetDescription({
|
|
|
16755
16771
|
}
|
|
16756
16772
|
);
|
|
16757
16773
|
}
|
|
16774
|
+
function isLinkOrDescendantActive(link, pathname) {
|
|
16775
|
+
if (pathname === link.href) {
|
|
16776
|
+
return true;
|
|
16777
|
+
}
|
|
16778
|
+
if (link.links && link.links.length > 0) {
|
|
16779
|
+
return link.links.some((childLink) => isLinkOrDescendantActive(childLink, pathname));
|
|
16780
|
+
}
|
|
16781
|
+
return false;
|
|
16782
|
+
}
|
|
16758
16783
|
function SidebarNavigation({
|
|
16759
16784
|
className,
|
|
16760
16785
|
onLinkClick,
|
|
@@ -16795,13 +16820,14 @@ function SidebarNavigation({
|
|
|
16795
16820
|
function SidebarLink({ link, pathname, onLinkClick, depth }) {
|
|
16796
16821
|
const hasChildren = Array.isArray(link.links) && link.links.length > 0;
|
|
16797
16822
|
const isActive = pathname === link.href;
|
|
16823
|
+
const isActiveOrHasActiveDescendant = isLinkOrDescendantActive(link, pathname);
|
|
16798
16824
|
const baseLinkClasses = clsx21__default.default(
|
|
16799
16825
|
"border-l pl-4 pr-2 text-base/8 sm:text-sm/6 w-full text-left py-1 rounded-r-md cursor-pointer",
|
|
16800
16826
|
"hover:border-grey-950 hover:text-grey-950 hover:font-semibold hover:bg-primary-800/10",
|
|
16801
16827
|
"dark:text-grey-400 dark:hover:border-grey-400 dark:hover:text-white",
|
|
16802
16828
|
isActive && "border-l border-primary-800 text-primary-800 font-bold dark:border-white bg-primary-800/10 dark:bg-white/20"
|
|
16803
16829
|
);
|
|
16804
|
-
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: "-ml-px flex flex-col items-start gap-1", children: hasChildren ? /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { className: "w-full", defaultOpen:
|
|
16830
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: "-ml-px flex flex-col items-start gap-1", children: hasChildren ? /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { className: "w-full", defaultOpen: isActiveOrHasActiveDescendant, children: [
|
|
16805
16831
|
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16806
16832
|
"button",
|
|
16807
16833
|
{
|
|
@@ -17742,6 +17768,7 @@ function ThemeColorPaletteContent() {
|
|
|
17742
17768
|
const themeParam = searchParams.get("theme");
|
|
17743
17769
|
const primaryParam = searchParams.get("primary");
|
|
17744
17770
|
const accentParam = searchParams.get("accent");
|
|
17771
|
+
const hasUrlParams = themeParam || primaryParam || accentParam;
|
|
17745
17772
|
let newCategory = themeCategory;
|
|
17746
17773
|
let newPrimary = primaryColor;
|
|
17747
17774
|
let newAccent = accentColor;
|
|
@@ -17760,12 +17787,20 @@ function ThemeColorPaletteContent() {
|
|
|
17760
17787
|
if (accentParam && availableColors.includes(accentParam) && accentParam !== newPrimary) {
|
|
17761
17788
|
newAccent = accentParam;
|
|
17762
17789
|
setAccentColor(accentParam);
|
|
17763
|
-
} else {
|
|
17790
|
+
} else if (hasUrlParams) {
|
|
17764
17791
|
const newAccentColor = availableColors.find((color2) => color2 !== newPrimary);
|
|
17765
17792
|
if (newAccentColor) {
|
|
17766
17793
|
newAccent = newAccentColor;
|
|
17767
17794
|
setAccentColor(newAccent);
|
|
17768
17795
|
}
|
|
17796
|
+
} else {
|
|
17797
|
+
if (!availableColors.includes(newAccent) || newAccent === newPrimary) {
|
|
17798
|
+
const newAccentColor = availableColors.find((color2) => color2 !== newPrimary);
|
|
17799
|
+
if (newAccentColor) {
|
|
17800
|
+
newAccent = newAccentColor;
|
|
17801
|
+
setAccentColor(newAccent);
|
|
17802
|
+
}
|
|
17803
|
+
}
|
|
17769
17804
|
}
|
|
17770
17805
|
const neutralKey = Object.keys(colorThemes[newCategory]).find(
|
|
17771
17806
|
(k) => k.toLowerCase().includes("grey")
|