@nswds/app 1.108.2 → 1.109.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/index.js CHANGED
@@ -15683,8 +15683,8 @@ function ColorPairingToolContent({ visibleFormats }) {
15683
15683
  const previewHeroStatusLabel = getPreviewHeroStatusLabel(contrastRatio);
15684
15684
  const contrastTone = getContrastTone(contrastRatio);
15685
15685
  const resolvedCopyFormat = visibleFormats.includes(copyFormat) ? copyFormat : visibleFormats[0] ?? DEFAULT_VISIBLE_FORMATS[0];
15686
- return /* @__PURE__ */ jsx("section", { className: "overflow-hidden rounded-sm bg-white text-grey-800", children: /* @__PURE__ */ jsxs("div", { className: "grid min-h-[46rem] xl:grid-cols-[260px_minmax(0,1fr)] xl:gap-x-6", children: [
15687
- /* @__PURE__ */ jsx("aside", { className: "border-b border-grey-200 py-5 xl:border-b-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
15686
+ return /* @__PURE__ */ jsx("section", { className: "min-w-0 overflow-hidden rounded-sm bg-white text-grey-800", children: /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 xl:min-h-[46rem] xl:grid-cols-[260px_minmax(0,1fr)] xl:gap-x-6", children: [
15687
+ /* @__PURE__ */ jsx("aside", { className: "border-b border-grey-200 px-4 py-5 sm:px-6 xl:border-b-0 xl:px-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
15688
15688
  /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
15689
15689
  /* @__PURE__ */ jsx(SectionLabel, { children: "Palette" }),
15690
15690
  /* @__PURE__ */ jsxs("div", { className: "inline-flex rounded-sm border border-grey-200 bg-white p-1", children: [
@@ -15708,7 +15708,7 @@ function ColorPairingToolContent({ visibleFormats }) {
15708
15708
  ] }),
15709
15709
  /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
15710
15710
  /* @__PURE__ */ jsx(SectionLabel, { children: "Background family" }),
15711
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 gap-1", children: selectableFamilies.map((family) => /* @__PURE__ */ jsx(
15711
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 sm:grid-cols-5", children: selectableFamilies.map((family) => /* @__PURE__ */ jsx(
15712
15712
  FamilyButton,
15713
15713
  {
15714
15714
  family,
@@ -15720,7 +15720,7 @@ function ColorPairingToolContent({ visibleFormats }) {
15720
15720
  ] }),
15721
15721
  /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
15722
15722
  /* @__PURE__ */ jsx(SectionLabel, { children: "Background shade" }),
15723
- /* @__PURE__ */ jsx("div", { className: "h-[20.5rem] space-y-1 overflow-y-auto pr-1", children: backgroundShadeOptions.map((shade) => /* @__PURE__ */ jsx(
15723
+ /* @__PURE__ */ jsx("div", { className: "space-y-1 sm:max-h-[20.5rem] sm:overflow-y-auto sm:pr-1", children: backgroundShadeOptions.map((shade) => /* @__PURE__ */ jsx(
15724
15724
  ShadeButton,
15725
15725
  {
15726
15726
  shade,
@@ -15733,7 +15733,7 @@ function ColorPairingToolContent({ visibleFormats }) {
15733
15733
  ] }),
15734
15734
  /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
15735
15735
  /* @__PURE__ */ jsx(SectionLabel, { children: "Accent family" }),
15736
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 gap-1", children: selectableAccentFamilies.map((family) => /* @__PURE__ */ jsx(
15736
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 sm:grid-cols-5", children: selectableAccentFamilies.map((family) => /* @__PURE__ */ jsx(
15737
15737
  FamilyButton,
15738
15738
  {
15739
15739
  family,
@@ -15744,8 +15744,8 @@ function ColorPairingToolContent({ visibleFormats }) {
15744
15744
  )) })
15745
15745
  ] })
15746
15746
  ] }) }),
15747
- /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-col", children: [
15748
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-5 overflow-y-auto py-5 sm:py-6", children: [
15747
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-col px-4 sm:px-6 xl:px-0", children: [
15748
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-5 py-5 sm:py-6 xl:overflow-y-auto", children: [
15749
15749
  /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button2, { variant: "soft", color: "primary", onClick: handleCopyUrl, className: "mr-1", children: copiedKey === "share-url" ? /* @__PURE__ */ jsxs(Fragment, { children: [
15750
15750
  /* @__PURE__ */ jsx(Icons.check, { "data-slot": "icon", className: "size-4" }),
15751
15751
  "Copied URL!"
@@ -18665,7 +18665,7 @@ function FormatToggle({ format, setFormat }) {
18665
18665
 
18666
18666
  // package.json
18667
18667
  var package_default = {
18668
- version: "1.108.0"};
18668
+ version: "1.108.2"};
18669
18669
  var SluggerContext = React5__default.createContext(null);
18670
18670
  function flattenText(nodes) {
18671
18671
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -20495,8 +20495,8 @@ function MobileSearch({ navigation }) {
20495
20495
  ] })
20496
20496
  ] });
20497
20497
  }
20498
- function generateLevelId() {
20499
- return `level-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
20498
+ function buildLevelId(path) {
20499
+ return `level-${path.length > 0 ? path.join("--") : "root"}`;
20500
20500
  }
20501
20501
  function generateBreadcrumb(levels, maxLength = 50) {
20502
20502
  if (levels.length <= 1) return levels[0]?.title || "Menu";
@@ -20527,7 +20527,7 @@ function MultiLevelPushMenu({
20527
20527
  }) {
20528
20528
  const pathname = usePathname();
20529
20529
  const [navigationHistory, setNavigationHistory] = useState([
20530
- { items: navigation || [], title: initialTitle, depth: 1, id: generateLevelId() }
20530
+ { items: navigation || [], title: initialTitle, depth: 1, id: buildLevelId([]) }
20531
20531
  ]);
20532
20532
  const [animationState, setAnimationState] = useState("idle");
20533
20533
  const [isAnimationStarted, setIsAnimationStarted] = useState(false);
@@ -20539,12 +20539,16 @@ function MultiLevelPushMenu({
20539
20539
  const navigateToSubmenu = useCallback(
20540
20540
  (item) => {
20541
20541
  if (item.links && item.links.length > 0 && animationState === "idle") {
20542
+ const levelPath = [
20543
+ ...navigationHistory.flatMap((level) => level.parentItem ? [level.parentItem.id] : []),
20544
+ item.id
20545
+ ];
20542
20546
  const newLevel = {
20543
20547
  items: item.links,
20544
20548
  title: item.title,
20545
20549
  parentItem: item,
20546
20550
  depth: navigationHistory[navigationHistory.length - 1].depth + 1,
20547
- id: generateLevelId()
20551
+ id: buildLevelId(levelPath)
20548
20552
  };
20549
20553
  const newHistory = [...navigationHistory, newLevel];
20550
20554
  setNavigationHistory(newHistory);