@bison-lab/payload-blocks 3.22.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/admin.mjs CHANGED
@@ -2,27 +2,27 @@
2
2
  import "./link-32261jXB.mjs";
3
3
  import { a as linkTypeOf, n as headerItemsFromBlocks, o as resolveAdminPreviewLink } from "./header-CTMSB4C0.mjs";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { ArrayField, DefaultEditView, FieldDescription, FieldError, FieldLabel, FieldPathContext, toast, useConfig, useField, useFieldPath, useForm, useTranslation } from "@payloadcms/ui";
5
+ import { ArrayField, DefaultEditView, FieldDescription, FieldError, FieldLabel, FieldPathContext, toast, useConfig, useField, useFieldPath, useForm, useTheme, useTranslation } from "@payloadcms/ui";
6
6
  import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
7
- import { Canvas, ConfirmDialog, ItemRail, LinkGlyph, MainHead, MegaGlyph, RailSlot, TypeCard, TypeCards } from "@bison-lab/admin-ui";
7
+ import { Button, Canvas, Checkbox, ConfirmDialog, Dialog, Field, Fold, Input, ItemRail, Kicker, KindGlyph, KitProvider, Label, MainHead, RailSlot, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Stack, Textarea, TypeCard, TypeCards } from "@bison-lab/admin-ui";
8
8
  import { resolveThemeIdentity, themeHeadFromDoc } from "@bison-lab/payload-core/theme";
9
9
  //#region src/admin/workspace-css.ts
10
10
  /**
11
11
  * Payload Edit View → mockup workspace. Scoped to the document that
12
12
  * opted in (Header first). Theme, Pages, and other collections stay
13
- * Payload's form. Hex is the approved mockup, not Payload elevation.
13
+ * Payload's form. Surfaces follow Payload elevation so Light / Dark
14
+ * match the admin header toggle.
14
15
  *
15
16
  * A second kit editor reuses this file by opting into the same view;
16
17
  * do not copy Header selectors into that editor.
17
18
  */
18
19
  const ADMIN_WORKSPACE_CSS = `
19
20
  .global-edit--navigation{
20
- --bg:#0f1012;--panel:#141518;--panel2:#1b1d22;--panel3:#22252b;--line:#30333b;--line2:#444854;
21
- --text:#f6f7f9;--muted:#989daa;--muted2:#727887;--pink:#e60088;--pink2:#ff2da5;--danger:#ff8aa9;
22
- --theme-elevation-0:var(--panel);--theme-elevation-50:var(--panel2);--theme-elevation-100:var(--panel3);
23
- --theme-elevation-150:var(--line);--theme-elevation-250:var(--line2);--theme-elevation-500:var(--muted);
24
- --theme-elevation-800:var(--text);--theme-input-bg:#1d1f24;--theme-bg:var(--bg);--theme-text:var(--text);
25
- --brand-primary:var(--pink);
21
+ --bg:var(--theme-bg,var(--theme-elevation-0));--panel:var(--theme-elevation-50);--panel2:var(--theme-elevation-100);--panel3:var(--theme-elevation-150);
22
+ --line:var(--theme-elevation-150);--line2:var(--theme-elevation-250);
23
+ --text:var(--theme-text,var(--theme-elevation-800));--muted:var(--theme-elevation-500);--muted2:var(--theme-elevation-400,var(--theme-elevation-500));
24
+ --pink:var(--bl-kit-accent,#e60088);--pink2:#ff2da5;--danger:#ff8aa9;
25
+ --brand-primary:var(--bl-kit-accent,var(--pink));
26
26
  --gutter-h:0;--main-gutter-h-left:0;--main-gutter-h-right:0;
27
27
  --sidebar-gutter-h-left:0;--sidebar-gutter-h-right:0;
28
28
  background:var(--bg);color:var(--text);
@@ -700,14 +700,29 @@ const NavItemsField = ({ field, path, readOnly }) => {
700
700
  const fromPath = getDataByPath?.(path);
701
701
  const items = Array.isArray(fromPath) ? fromPath : Array.isArray(itemsField.value) ? itemsField.value : [];
702
702
  const ctaPath = ctaPathFromItems(path);
703
- const cta = useField({ path: ctaPath }).value ?? {};
703
+ const ctaField = useField({ path: ctaPath });
704
+ const ctaEnabled = useField({ path: `${ctaPath}.enabled` });
705
+ const ctaLabel = useField({ path: `${ctaPath}.label` });
706
+ const ctaPage = useField({ path: `${ctaPath}.page` });
707
+ const ctaHrefField = useField({ path: `${ctaPath}.href` });
708
+ const ctaType = useField({ path: `${ctaPath}.type` });
709
+ const ctaSnapshot = ctaField.value ?? {};
710
+ const cta = {
711
+ ...ctaSnapshot,
712
+ enabled: ctaEnabled.value ?? ctaSnapshot.enabled,
713
+ label: ctaLabel.value ?? ctaSnapshot.label,
714
+ page: ctaPage.value ?? ctaSnapshot.page,
715
+ href: ctaHrefField.value ?? ctaSnapshot.href,
716
+ type: ctaType.value ?? ctaSnapshot.type
717
+ };
704
718
  const ctaOn = cta.enabled !== false && Boolean(cta.label || cta.page || cta.href || cta.enabled);
705
719
  const { config } = useConfig();
706
720
  const endpoint = `${config.serverURL}${config.routes.api}`;
707
721
  const [selected, setSelected] = useState(0);
708
722
  const [adding, setAdding] = useState(false);
709
723
  const [confirmSwitch, setConfirmSwitch] = useState(false);
710
- const [previewDark, setPreviewDark] = useState(true);
724
+ const { theme, setTheme } = useTheme();
725
+ const previewDark = theme === "dark";
711
726
  const identityFallback = identityFallbackFromConfig(config);
712
727
  useEffect(() => {
713
728
  if (selected >= items.length) setSelected(Math.max(0, items.length - 1));
@@ -735,6 +750,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
735
750
  const [hoverItem, setHoverItem] = useState(null);
736
751
  const openItem = hoverItem && items.some((row) => row.label === hoverItem && row.blockType === "megaMenu") ? hoverItem : void 0;
737
752
  const openRow = items.find((row) => row.label === openItem && row.blockType === "megaMenu");
753
+ const openIndex = openRow ? items.indexOf(openRow) : -1;
738
754
  function add(blockType) {
739
755
  const seed = blockType === "navLink" ? emptyLink() : emptyMega();
740
756
  addFieldRow({
@@ -811,7 +827,8 @@ const NavItemsField = ({ field, path, readOnly }) => {
811
827
  }
812
828
  function onPreviewClick(event) {
813
829
  const target = event.target;
814
- const label = target.closest("[data-preview-item]")?.getAttribute("data-preview-item") ?? items.find((row) => row.label && target.textContent?.includes(row.label))?.label;
830
+ if (target.closest("a[href]")) event.preventDefault();
831
+ const label = target.closest("[data-preview-item]")?.getAttribute("data-preview-item");
815
832
  if (!label) return;
816
833
  const index = items.findIndex((row) => row.label === label);
817
834
  if (index >= 0) {
@@ -837,7 +854,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
837
854
  identityFallback
838
855
  ]);
839
856
  const ctaHref = resolveAdminPreviewLink(cta, pages);
840
- return /* @__PURE__ */ jsxs("div", {
857
+ return /* @__PURE__ */ jsx(KitProvider, { children: /* @__PURE__ */ jsxs("div", {
841
858
  className: "bl-nav-items field-type",
842
859
  children: [
843
860
  /* @__PURE__ */ jsx("style", {
@@ -860,12 +877,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
860
877
  children: [/* @__PURE__ */ jsxs("div", {
861
878
  className: "bl-nav-items__rail-row",
862
879
  children: [
863
- /* @__PURE__ */ jsx("span", {
864
- className: "bl-nav-items__badge",
865
- "data-kind": row.blockType,
866
- "aria-hidden": true,
867
- children: row.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MegaGlyph, {}) : /* @__PURE__ */ jsx(LinkGlyph, {})
868
- }),
880
+ /* @__PURE__ */ jsx(KindGlyph, { kind: row.blockType === "megaMenu" ? "megaMenu" : "navLink" }),
869
881
  /* @__PURE__ */ jsx("button", {
870
882
  type: "button",
871
883
  className: "bl-nav-items__rail-label",
@@ -885,12 +897,12 @@ const NavItemsField = ({ field, path, readOnly }) => {
885
897
  children: [/* @__PURE__ */ jsxs(TypeCards, {
886
898
  compact: true,
887
899
  children: [/* @__PURE__ */ jsx(TypeCard, {
888
- icon: /* @__PURE__ */ jsx(LinkGlyph, {}),
900
+ icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "navLink" }),
889
901
  label: "Link",
890
902
  active: row.blockType === "navLink",
891
903
  onClick: () => requestType("navLink")
892
904
  }), /* @__PURE__ */ jsx(TypeCard, {
893
- icon: /* @__PURE__ */ jsx(MegaGlyph, {}),
905
+ icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "megaMenu" }),
894
906
  label: "Mega",
895
907
  active: row.blockType === "megaMenu",
896
908
  onClick: () => requestType("megaMenu")
@@ -902,8 +914,8 @@ const NavItemsField = ({ field, path, readOnly }) => {
902
914
  })]
903
915
  }) : null]
904
916
  }, String(row.id ?? index)))
905
- }), readOnly ? null : /* @__PURE__ */ jsx("button", {
906
- type: "button",
917
+ }), readOnly ? null : /* @__PURE__ */ jsx(Button, {
918
+ variant: "outline",
907
919
  className: "bl-nav-items__add",
908
920
  onClick: () => setAdding(true),
909
921
  children: "Add item"
@@ -933,9 +945,9 @@ const NavItemsField = ({ field, path, readOnly }) => {
933
945
  if (next instanceof Node && event.currentTarget.contains(next)) return;
934
946
  setHoverItem(null);
935
947
  },
936
- children: [/* @__PURE__ */ jsx("div", {
948
+ children: [/* @__PURE__ */ jsxs("div", {
937
949
  className: "bl-nav-items__preview",
938
- children: /* @__PURE__ */ jsx(PreviewNav, {
950
+ children: [/* @__PURE__ */ jsx(Kicker, { children: "This is just a preview" }), /* @__PURE__ */ jsx(PreviewNav, {
939
951
  items: items.filter((row) => row.label).map((row) => {
940
952
  const mapped = previewItems.find((item) => item.label === row.label);
941
953
  return {
@@ -946,10 +958,13 @@ const NavItemsField = ({ field, path, readOnly }) => {
946
958
  };
947
959
  }),
948
960
  lockup,
949
- onLockupError: () => setLockup(null),
961
+ onLockupError: () => {
962
+ const next = lockupSrc(identityFallback?.lockup, config.serverURL);
963
+ setLockup((current) => current?.url === next?.url ? null : next);
964
+ },
950
965
  actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PreviewThemeToggle, {
951
966
  dark: previewDark,
952
- onToggle: () => setPreviewDark((next) => !next)
967
+ onToggle: () => setTheme(previewDark ? "light" : "dark")
953
968
  }), ctaOn && ctaHref && cta.label ? /* @__PURE__ */ jsx("a", {
954
969
  href: ctaHref,
955
970
  className: "bl-nav-items__preview-cta",
@@ -957,12 +972,14 @@ const NavItemsField = ({ field, path, readOnly }) => {
957
972
  }) : null] }),
958
973
  openItem,
959
974
  onItemEnter: (label) => setHoverItem(label)
960
- })
975
+ })]
961
976
  }), openRow ? /* @__PURE__ */ jsx("div", {
962
977
  className: "bl-nav-items__preview-stage",
963
978
  "data-testid": "nav-items-preview-mega",
964
979
  onMouseEnter: () => openItem && setHoverItem(openItem),
965
980
  children: /* @__PURE__ */ jsx(PreviewMega, {
981
+ path,
982
+ index: openIndex,
966
983
  row: openRow,
967
984
  pages
968
985
  })
@@ -978,37 +995,22 @@ const NavItemsField = ({ field, path, readOnly }) => {
978
995
  children: "Add a link or a mega menu to start the header."
979
996
  }) : null
980
997
  ] }),
981
- adding ? /* @__PURE__ */ jsx("div", {
982
- className: "bl-nav-kit__modal",
983
- role: "dialog",
984
- "aria-labelledby": "bl-nav-add-title",
985
- children: /* @__PURE__ */ jsxs("div", {
986
- className: "bl-nav-kit__modal-card",
987
- children: [
988
- /* @__PURE__ */ jsx("h2", {
989
- id: "bl-nav-add-title",
990
- children: "Add menu item"
991
- }),
992
- /* @__PURE__ */ jsxs(TypeCards, { children: [/* @__PURE__ */ jsx(TypeCard, {
993
- icon: /* @__PURE__ */ jsx(LinkGlyph, {}),
994
- label: "Plain link",
995
- description: "A bar item that goes to a page or URL.",
996
- onClick: () => add("navLink")
997
- }), /* @__PURE__ */ jsx(TypeCard, {
998
- icon: /* @__PURE__ */ jsx(MegaGlyph, {}),
999
- label: "Mega menu",
1000
- description: "A dropdown of columns, sections, and an optional footer.",
1001
- onClick: () => add("megaMenu")
1002
- })] }),
1003
- /* @__PURE__ */ jsx("button", {
1004
- type: "button",
1005
- className: "bl-nav-items__add",
1006
- onClick: () => setAdding(false),
1007
- children: "Cancel"
1008
- })
1009
- ]
1010
- })
1011
- }) : null,
998
+ /* @__PURE__ */ jsx(Dialog, {
999
+ open: adding,
1000
+ title: "Add menu item",
1001
+ onCancel: () => setAdding(false),
1002
+ children: /* @__PURE__ */ jsxs(TypeCards, { children: [/* @__PURE__ */ jsx(TypeCard, {
1003
+ icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "navLink" }),
1004
+ label: "Plain link",
1005
+ description: "A bar item that goes to a page or URL.",
1006
+ onClick: () => add("navLink")
1007
+ }), /* @__PURE__ */ jsx(TypeCard, {
1008
+ icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "megaMenu" }),
1009
+ label: "Mega menu",
1010
+ description: "A dropdown of columns, sections, and an optional footer.",
1011
+ onClick: () => add("megaMenu")
1012
+ })] })
1013
+ }),
1012
1014
  /* @__PURE__ */ jsx(ConfirmDialog, {
1013
1015
  open: confirmSwitch,
1014
1016
  title: "Switch to a plain link?",
@@ -1019,7 +1021,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
1019
1021
  children: "This drops the columns, sections, and footer. The label and destination stay."
1020
1022
  })
1021
1023
  ]
1022
- });
1024
+ }) });
1023
1025
  };
1024
1026
  function PreviewThemeToggle({ dark, onToggle }) {
1025
1027
  return /* @__PURE__ */ jsx("button", {
@@ -1088,10 +1090,7 @@ function PreviewNav({ items, lockup, onLockupError, actions, openItem, onItemEnt
1088
1090
  "data-href": item.href ?? "",
1089
1091
  "aria-label": `Preview ${item.label}`,
1090
1092
  onMouseEnter: () => onItemEnter?.(item.label),
1091
- children: [item.label, item.content || item.items?.length ? /* @__PURE__ */ jsx("span", {
1092
- "aria-hidden": true,
1093
- children: openItem === item.label ? " ⌃" : " ▾"
1094
- }) : null]
1093
+ children: [item.label, item.content || item.items?.length ? /* @__PURE__ */ jsx(PreviewChevron, {}) : null]
1095
1094
  }, item.label))
1096
1095
  }),
1097
1096
  /* @__PURE__ */ jsx("div", {
@@ -1106,10 +1105,42 @@ const PREVIEW_MAX_WIDTH = {
1106
1105
  standard: "42rem",
1107
1106
  wide: "48rem"
1108
1107
  };
1109
- function PreviewMega({ row, pages }) {
1108
+ const PREVIEW_TRACKS = {
1109
+ "25": 3,
1110
+ "33": 4,
1111
+ "50": 6,
1112
+ "66": 8,
1113
+ "75": 9,
1114
+ "100": 12
1115
+ };
1116
+ function previewColumnTrack(width) {
1117
+ const key = String(width ?? "100");
1118
+ return `minmax(0, ${PREVIEW_TRACKS[key] ?? Math.max(1, Number(key) || 1)}fr)`;
1119
+ }
1120
+ function PreviewMega({ path, index, row, pages }) {
1110
1121
  const panel = row.panel;
1111
1122
  const columns = panel?.columns ?? [];
1112
- const maxWidth = PREVIEW_MAX_WIDTH[panel?.maxWidth ?? "standard"] ?? PREVIEW_MAX_WIDTH.standard;
1123
+ const maxWidthField = useField({ path: `${path}.${index}.panel.maxWidth` });
1124
+ const width0 = useField({ path: `${path}.${index}.panel.columns.0.width` });
1125
+ const width1 = useField({ path: `${path}.${index}.panel.columns.1.width` });
1126
+ const width2 = useField({ path: `${path}.${index}.panel.columns.2.width` });
1127
+ const width3 = useField({ path: `${path}.${index}.panel.columns.3.width` });
1128
+ const divider1 = useField({ path: `${path}.${index}.panel.columns.1.divider` });
1129
+ const divider2 = useField({ path: `${path}.${index}.panel.columns.2.divider` });
1130
+ const divider3 = useField({ path: `${path}.${index}.panel.columns.3.divider` });
1131
+ const liveWidths = [
1132
+ width0.value,
1133
+ width1.value,
1134
+ width2.value,
1135
+ width3.value
1136
+ ];
1137
+ const liveDividers = [
1138
+ void 0,
1139
+ divider1.value,
1140
+ divider2.value,
1141
+ divider3.value
1142
+ ];
1143
+ const maxWidth = PREVIEW_MAX_WIDTH[maxWidthField.value ?? panel?.maxWidth ?? "standard"] ?? PREVIEW_MAX_WIDTH.standard;
1113
1144
  const complete = columns.some((column) => (column.sections ?? []).some((section) => (section.links ?? []).some((link) => {
1114
1145
  const item = link;
1115
1146
  return Boolean(item.label && resolveAdminPreviewLink(item, pages));
@@ -1124,9 +1155,9 @@ function PreviewMega({ row, pages }) {
1124
1155
  style: { maxWidth },
1125
1156
  children: [complete ? /* @__PURE__ */ jsx("div", {
1126
1157
  className: "bl-nav-items__preview-columns",
1127
- style: { gridTemplateColumns: columns.map((column) => `${Math.max(1, Number(column.width) || 1)}fr`).join(" ") },
1158
+ style: { gridTemplateColumns: columns.map((column, columnIndex) => previewColumnTrack(liveWidths[columnIndex] ?? column.width)).join(" ") },
1128
1159
  children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx("div", {
1129
- className: columnIndex > 0 && column.divider ? "bl-nav-items__preview-col has-border" : "bl-nav-items__preview-col",
1160
+ className: columnIndex > 0 && Boolean(liveDividers[columnIndex] ?? column.divider) ? "bl-nav-items__preview-col has-border" : "bl-nav-items__preview-col",
1130
1161
  children: (column.sections ?? []).map((section, sectionIndex) => {
1131
1162
  const links = (section.links ?? []).flatMap((link, linkIndex) => {
1132
1163
  const item = link;
@@ -1190,45 +1221,37 @@ function HeaderCta({ path, readOnly }) {
1190
1221
  className: "bl-nav-items__header-cta-head",
1191
1222
  children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: "Header button" }), /* @__PURE__ */ jsx("p", { children: "The pill on the right of the bar." })] })
1192
1223
  }),
1193
- /* @__PURE__ */ jsxs("label", {
1194
- className: "bl-nav-items__check bl-nav-items__header-cta-toggle",
1195
- children: [/* @__PURE__ */ jsx("input", {
1196
- type: "checkbox",
1197
- checked: on,
1198
- disabled: readOnly,
1199
- onChange: (event) => setEnabled(event.target.checked)
1200
- }), "Show Header button"]
1224
+ /* @__PURE__ */ jsx(CheckLabel, {
1225
+ className: "bl-nav-items__header-cta-toggle",
1226
+ checked: on,
1227
+ disabled: readOnly,
1228
+ onCheckedChange: setEnabled,
1229
+ children: "Show Header button"
1201
1230
  }),
1202
1231
  on ? /* @__PURE__ */ jsxs(Fragment, { children: [
1203
- /* @__PURE__ */ jsxs("label", {
1204
- className: "bl-nav-items__field",
1205
- children: [/* @__PURE__ */ jsxs("span", { children: [
1206
- "Label",
1207
- " ",
1208
- /* @__PURE__ */ jsx("span", {
1209
- className: "bl-nav-items__req",
1210
- "aria-hidden": true,
1211
- children: "*"
1212
- })
1213
- ] }), /* @__PURE__ */ jsx("input", {
1214
- value: label.value ?? "",
1215
- disabled: readOnly,
1216
- onChange: (event) => label.setValue(event.target.value)
1217
- })]
1218
- }),
1232
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsxs(Label, { children: [
1233
+ "Label",
1234
+ " ",
1235
+ /* @__PURE__ */ jsx("span", {
1236
+ className: "bl-nav-items__req",
1237
+ "aria-hidden": true,
1238
+ children: "*"
1239
+ })
1240
+ ] }), /* @__PURE__ */ jsx(Input, {
1241
+ value: label.value ?? "",
1242
+ disabled: readOnly,
1243
+ onChange: (event) => label.setValue(event.target.value)
1244
+ })] }),
1219
1245
  /* @__PURE__ */ jsx(ComposedLinkField, {
1220
1246
  path: `${path}._index-0`,
1221
1247
  parentPath: path,
1222
1248
  readOnly
1223
1249
  }),
1224
- /* @__PURE__ */ jsxs("label", {
1225
- className: "bl-nav-items__check",
1226
- children: [/* @__PURE__ */ jsx("input", {
1227
- type: "checkbox",
1228
- checked: Boolean(newTab.value),
1229
- disabled: readOnly,
1230
- onChange: (event) => newTab.setValue(event.target.checked)
1231
- }), "Open in a new tab"]
1250
+ /* @__PURE__ */ jsx(CheckLabel, {
1251
+ checked: Boolean(newTab.value),
1252
+ disabled: readOnly,
1253
+ onCheckedChange: (checked) => newTab.setValue(checked),
1254
+ children: "Open in a new tab"
1232
1255
  })
1233
1256
  ] }) : null,
1234
1257
  /* @__PURE__ */ jsx(FieldError, {
@@ -1245,27 +1268,21 @@ function ItemBasics({ path, index, readOnly }) {
1245
1268
  return /* @__PURE__ */ jsxs("div", {
1246
1269
  className: "bl-nav-items__basics",
1247
1270
  children: [
1248
- /* @__PURE__ */ jsxs("label", {
1249
- className: "bl-nav-items__field",
1250
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx("input", {
1251
- value: label.value ?? "",
1252
- disabled: readOnly,
1253
- onChange: (event) => label.setValue(event.target.value)
1254
- })]
1255
- }),
1271
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(Input, {
1272
+ value: label.value ?? "",
1273
+ disabled: readOnly,
1274
+ onChange: (event) => label.setValue(event.target.value)
1275
+ })] }),
1256
1276
  /* @__PURE__ */ jsx(ComposedLinkField, {
1257
1277
  path: `${path}.${index}._index-0`,
1258
1278
  parentPath: `${path}.${index}`,
1259
1279
  readOnly
1260
1280
  }),
1261
- /* @__PURE__ */ jsxs("label", {
1262
- className: "bl-nav-items__check",
1263
- children: [/* @__PURE__ */ jsx("input", {
1264
- type: "checkbox",
1265
- checked: Boolean(newTab.value),
1266
- disabled: readOnly,
1267
- onChange: (event) => newTab.setValue(event.target.checked)
1268
- }), "Open in a new tab"]
1281
+ /* @__PURE__ */ jsx(CheckLabel, {
1282
+ checked: Boolean(newTab.value),
1283
+ disabled: readOnly,
1284
+ onCheckedChange: (checked) => newTab.setValue(checked),
1285
+ children: "Open in a new tab"
1269
1286
  })
1270
1287
  ]
1271
1288
  });
@@ -1283,25 +1300,27 @@ function MegaEditor({ path, index, panel, readOnly }) {
1283
1300
  className: "bl-nav-items__builder-head",
1284
1301
  children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", { children: "Menu content" }), /* @__PURE__ */ jsx("p", { children: "Set each column’s width here. The header preview is what shows the live layout." })] }), /* @__PURE__ */ jsxs("label", {
1285
1302
  className: "bl-nav-items__tool",
1286
- children: ["Panel width", /* @__PURE__ */ jsxs("select", {
1287
- "aria-label": "Panel width",
1303
+ children: ["Panel width", /* @__PURE__ */ jsxs(Select, {
1288
1304
  value: maxWidth.value ?? panel.maxWidth ?? "standard",
1289
1305
  disabled: readOnly,
1290
- onChange: (event) => maxWidth.setValue(event.target.value),
1291
- children: [
1292
- /* @__PURE__ */ jsx("option", {
1306
+ onValueChange: (value) => maxWidth.setValue(value),
1307
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
1308
+ "aria-label": "Panel width",
1309
+ children: /* @__PURE__ */ jsx(SelectValue, {})
1310
+ }), /* @__PURE__ */ jsxs(SelectContent, { children: [
1311
+ /* @__PURE__ */ jsx(SelectItem, {
1293
1312
  value: "narrow",
1294
1313
  children: "Narrow"
1295
1314
  }),
1296
- /* @__PURE__ */ jsx("option", {
1315
+ /* @__PURE__ */ jsx(SelectItem, {
1297
1316
  value: "standard",
1298
1317
  children: "Standard"
1299
1318
  }),
1300
- /* @__PURE__ */ jsx("option", {
1319
+ /* @__PURE__ */ jsx(SelectItem, {
1301
1320
  value: "wide",
1302
1321
  children: "Wide"
1303
1322
  })
1304
- ]
1323
+ ] })]
1305
1324
  })]
1306
1325
  })]
1307
1326
  }),
@@ -1318,8 +1337,8 @@ function MegaEditor({ path, index, panel, readOnly }) {
1318
1337
  columnCount: columns.length
1319
1338
  }, columnIndex))
1320
1339
  }),
1321
- readOnly || columns.length >= 4 ? null : /* @__PURE__ */ jsx("button", {
1322
- type: "button",
1340
+ readOnly || columns.length >= 4 ? null : /* @__PURE__ */ jsx(Button, {
1341
+ variant: "outline",
1323
1342
  className: "bl-nav-items__add-column",
1324
1343
  onClick: () => {
1325
1344
  addFieldRow({
@@ -1374,13 +1393,10 @@ function MegaEditor({ path, index, panel, readOnly }) {
1374
1393
  parentPath: `${path}.${index}.panel.footer.overview`,
1375
1394
  readOnly
1376
1395
  }),
1377
- /* @__PURE__ */ jsxs("label", {
1378
- className: "bl-nav-items__field",
1379
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1380
- path: `${path}.${index}.panel.footer.overview.label`,
1381
- readOnly
1382
- })]
1383
- })
1396
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1397
+ path: `${path}.${index}.panel.footer.overview.label`,
1398
+ readOnly
1399
+ })] })
1384
1400
  ]
1385
1401
  }), /* @__PURE__ */ jsxs("div", {
1386
1402
  className: "bl-nav-items__footer-card",
@@ -1391,13 +1407,10 @@ function MegaEditor({ path, index, panel, readOnly }) {
1391
1407
  parentPath: `${path}.${index}.panel.footer.cta`,
1392
1408
  readOnly
1393
1409
  }),
1394
- /* @__PURE__ */ jsxs("label", {
1395
- className: "bl-nav-items__field",
1396
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1397
- path: `${path}.${index}.panel.footer.cta.label`,
1398
- readOnly
1399
- })]
1400
- })
1410
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1411
+ path: `${path}.${index}.panel.footer.cta.label`,
1412
+ readOnly
1413
+ })] })
1401
1414
  ]
1402
1415
  })]
1403
1416
  })]
@@ -1462,63 +1475,112 @@ function RowMenu({ label, index, count, path, allowRemove = true, onMoved }) {
1462
1475
  }) : null]
1463
1476
  });
1464
1477
  }
1478
+ function useRowActions({ index, count, path, allowRemove = true, onMoved, readOnly }) {
1479
+ const { moveFieldRow, removeFieldRow } = useForm();
1480
+ if (readOnly) return void 0;
1481
+ const actions = [{
1482
+ label: "Move up",
1483
+ disabled: index === 0,
1484
+ onClick: () => {
1485
+ moveFieldRow({
1486
+ path,
1487
+ moveFromIndex: index,
1488
+ moveToIndex: index - 1
1489
+ });
1490
+ onMoved?.(index - 1);
1491
+ }
1492
+ }, {
1493
+ label: "Move down",
1494
+ disabled: index === count - 1,
1495
+ onClick: () => {
1496
+ moveFieldRow({
1497
+ path,
1498
+ moveFromIndex: index,
1499
+ moveToIndex: index + 1
1500
+ });
1501
+ onMoved?.(index + 1);
1502
+ }
1503
+ }];
1504
+ if (allowRemove) actions.push({
1505
+ label: "Delete",
1506
+ danger: true,
1507
+ onClick: () => removeFieldRow({
1508
+ path,
1509
+ rowIndex: index
1510
+ })
1511
+ });
1512
+ return actions;
1513
+ }
1465
1514
  function MegaLinkEditor({ path, arrayPath, index, count, label, readOnly }) {
1466
1515
  const description = useField({ path: `${path}.description` });
1467
1516
  const newTab = useField({ path: `${path}.newTab` });
1468
- const name = label?.trim() || "Untitled";
1469
- return /* @__PURE__ */ jsxs("div", {
1470
- className: "bl-nav-items__link",
1517
+ return /* @__PURE__ */ jsxs(Fold, {
1518
+ title: label?.trim() || "Untitled",
1519
+ tone: "dark",
1520
+ actions: useRowActions({
1521
+ index,
1522
+ count,
1523
+ path: arrayPath,
1524
+ readOnly
1525
+ }),
1471
1526
  children: [
1472
- /* @__PURE__ */ jsxs("div", {
1473
- className: "bl-nav-items__link-head",
1474
- children: [/* @__PURE__ */ jsx("strong", { children: name }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1475
- label: name,
1476
- index,
1477
- count,
1478
- path: arrayPath
1479
- })]
1480
- }),
1481
- /* @__PURE__ */ jsxs("label", {
1482
- className: "bl-nav-items__field",
1483
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1484
- path: `${path}.label`,
1485
- readOnly
1486
- })]
1487
- }),
1527
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1528
+ path: `${path}.label`,
1529
+ readOnly
1530
+ })] }),
1488
1531
  /* @__PURE__ */ jsx(ComposedLinkField, {
1489
1532
  path: `${path}._index-0`,
1490
1533
  parentPath: path,
1491
1534
  readOnly
1492
1535
  }),
1493
- /* @__PURE__ */ jsxs("label", {
1494
- className: "bl-nav-items__field",
1495
- children: [/* @__PURE__ */ jsx("span", { children: "Description" }), /* @__PURE__ */ jsx("textarea", {
1496
- value: description.value ?? "",
1497
- disabled: readOnly,
1498
- rows: 2,
1499
- onChange: (event) => description.setValue(event.target.value)
1500
- })]
1501
- }),
1502
- /* @__PURE__ */ jsxs("label", {
1503
- className: "bl-nav-items__check",
1504
- children: [/* @__PURE__ */ jsx("input", {
1505
- type: "checkbox",
1506
- checked: Boolean(newTab.value),
1507
- disabled: readOnly,
1508
- onChange: (event) => newTab.setValue(event.target.checked)
1509
- }), "Open in a new tab"]
1536
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Description" }), /* @__PURE__ */ jsx(Textarea, {
1537
+ value: description.value ?? "",
1538
+ disabled: readOnly,
1539
+ rows: 2,
1540
+ onChange: (event) => description.setValue(event.target.value)
1541
+ })] }),
1542
+ /* @__PURE__ */ jsx(CheckLabel, {
1543
+ checked: Boolean(newTab.value),
1544
+ disabled: readOnly,
1545
+ onCheckedChange: (checked) => newTab.setValue(checked),
1546
+ children: "Open in a new tab"
1510
1547
  })
1511
1548
  ]
1512
1549
  });
1513
1550
  }
1514
1551
  function FooterText({ path, readOnly }) {
1515
1552
  const field = useField({ path });
1516
- return /* @__PURE__ */ jsx("input", {
1553
+ return /* @__PURE__ */ jsx(Input, {
1517
1554
  value: field.value ?? "",
1518
1555
  disabled: readOnly,
1519
1556
  onChange: (event) => field.setValue(event.target.value)
1520
1557
  });
1521
1558
  }
1559
+ function PreviewChevron() {
1560
+ return /* @__PURE__ */ jsx("svg", {
1561
+ className: "bl-nav-items__preview-chevron",
1562
+ viewBox: "0 0 24 24",
1563
+ width: "12",
1564
+ height: "12",
1565
+ fill: "none",
1566
+ stroke: "currentColor",
1567
+ strokeWidth: "2",
1568
+ strokeLinecap: "round",
1569
+ strokeLinejoin: "round",
1570
+ "aria-hidden": true,
1571
+ children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
1572
+ });
1573
+ }
1574
+ function CheckLabel({ checked, disabled, onCheckedChange, children, className }) {
1575
+ return /* @__PURE__ */ jsxs("label", {
1576
+ className: ["bl-nav-items__check", className].filter(Boolean).join(" "),
1577
+ children: [/* @__PURE__ */ jsx(Checkbox, {
1578
+ checked,
1579
+ disabled,
1580
+ onCheckedChange: (value) => onCheckedChange(value === true)
1581
+ }), children]
1582
+ });
1583
+ }
1522
1584
  function ColumnEditor({ path, itemIndex, columnIndex, column, readOnly, columnCount }) {
1523
1585
  const { addFieldRow } = useForm();
1524
1586
  const width = useField({ path: `${path}.${itemIndex}.panel.columns.${columnIndex}.width` });
@@ -1527,82 +1589,73 @@ function ColumnEditor({ path, itemIndex, columnIndex, column, readOnly, columnCo
1527
1589
  const sectionsPath = `${path}.${itemIndex}.panel.columns.${columnIndex}.sections`;
1528
1590
  const sections = column.sections ?? [];
1529
1591
  const columnName = `Column ${columnIndex + 1}`;
1530
- return /* @__PURE__ */ jsxs("section", {
1531
- className: "bl-nav-items__column",
1532
- role: "group",
1533
- "aria-label": columnName,
1534
- children: [/* @__PURE__ */ jsxs("div", {
1535
- className: "bl-nav-items__column-head",
1536
- children: [/* @__PURE__ */ jsxs("div", {
1537
- className: "bl-nav-items__column-title",
1538
- children: [
1539
- columnName,
1540
- " ",
1541
- /* @__PURE__ */ jsxs("span", {
1542
- className: "bl-nav-items__width-pill",
1543
- children: [width.value ?? column.width ?? "100", "%"]
1544
- })
1545
- ]
1546
- }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1547
- label: columnName,
1548
- index: columnIndex,
1549
- count: columnCount,
1550
- path: columnsPath,
1551
- allowRemove: columnCount > 1
1552
- })]
1553
- }), /* @__PURE__ */ jsxs("div", {
1554
- className: "bl-nav-items__column-body",
1555
- children: [
1556
- /* @__PURE__ */ jsxs("div", {
1557
- className: columnIndex === 0 ? "bl-nav-items__column-settings is-first" : "bl-nav-items__column-settings",
1558
- children: [/* @__PURE__ */ jsxs("label", { children: ["Width", /* @__PURE__ */ jsx("select", {
1559
- value: width.value ?? column.width ?? "100",
1560
- disabled: readOnly,
1561
- onChange: (event) => width.setValue(event.target.value),
1562
- children: WIDTHS.map((option) => /* @__PURE__ */ jsxs("option", {
1563
- value: option,
1564
- children: [option, "%"]
1565
- }, option))
1566
- })] }), columnIndex > 0 ? /* @__PURE__ */ jsxs("label", {
1567
- className: "bl-nav-items__check",
1568
- children: [/* @__PURE__ */ jsx("input", {
1569
- type: "checkbox",
1570
- checked: Boolean(divider.value ?? column.divider),
1571
- disabled: readOnly,
1572
- onChange: (event) => divider.setValue(event.target.checked)
1573
- }), "Draw a line on the left"]
1574
- }) : null]
1575
- }),
1576
- sections.map((section, sectionIndex) => /* @__PURE__ */ jsx(SectionEditor, {
1577
- path,
1578
- itemIndex,
1579
- columnIndex,
1580
- sectionIndex,
1581
- section,
1582
- readOnly,
1583
- sectionCount: sections.length
1584
- }, sectionIndex)),
1585
- readOnly || sections.length >= 8 ? null : /* @__PURE__ */ jsx("button", {
1586
- type: "button",
1587
- className: "bl-nav-items__add-section",
1588
- onClick: () => addFieldRow({
1589
- path: sectionsPath,
1590
- schemaPath: sectionsPath,
1591
- subFieldState: {
1592
- display: {
1593
- value: "list",
1594
- valid: true
1595
- },
1596
- hideDescriptionsOnMobile: {
1597
- value: true,
1598
- valid: true
1599
- }
1592
+ const actions = useRowActions({
1593
+ index: columnIndex,
1594
+ count: columnCount,
1595
+ path: columnsPath,
1596
+ allowRemove: columnCount > 1,
1597
+ readOnly
1598
+ });
1599
+ return /* @__PURE__ */ jsx(Fold, {
1600
+ title: columnName,
1601
+ tone: "light",
1602
+ badge: `${width.value ?? column.width ?? "100"}%`,
1603
+ meta: (open) => open ? null : /* @__PURE__ */ jsxs("small", { children: [
1604
+ sections.length,
1605
+ " ",
1606
+ sections.length === 1 ? "section" : "sections"
1607
+ ] }),
1608
+ actions,
1609
+ children: /* @__PURE__ */ jsxs(Stack, { children: [
1610
+ /* @__PURE__ */ jsxs("div", {
1611
+ className: "bl-nav-items__column-settings",
1612
+ children: [/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Width" }), /* @__PURE__ */ jsxs(Select, {
1613
+ value: width.value ?? column.width ?? "100",
1614
+ disabled: readOnly,
1615
+ onValueChange: (value) => width.setValue(value),
1616
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
1617
+ "aria-label": "Width",
1618
+ children: /* @__PURE__ */ jsx(SelectValue, {})
1619
+ }), /* @__PURE__ */ jsx(SelectContent, { children: WIDTHS.map((option) => /* @__PURE__ */ jsxs(SelectItem, {
1620
+ value: option,
1621
+ children: [option, "%"]
1622
+ }, option)) })]
1623
+ })] }), columnIndex > 0 ? /* @__PURE__ */ jsx(CheckLabel, {
1624
+ checked: Boolean(divider.value ?? column.divider),
1625
+ disabled: readOnly,
1626
+ onCheckedChange: (checked) => divider.setValue(checked),
1627
+ children: "Draw a line on the left"
1628
+ }) : null]
1629
+ }),
1630
+ sections.map((section, sectionIndex) => /* @__PURE__ */ jsx(SectionEditor, {
1631
+ path,
1632
+ itemIndex,
1633
+ columnIndex,
1634
+ sectionIndex,
1635
+ section,
1636
+ readOnly,
1637
+ sectionCount: sections.length
1638
+ }, sectionIndex)),
1639
+ readOnly || sections.length >= 8 ? null : /* @__PURE__ */ jsx(Button, {
1640
+ variant: "outline",
1641
+ className: "bl-nav-items__add-section",
1642
+ onClick: () => addFieldRow({
1643
+ path: sectionsPath,
1644
+ schemaPath: sectionsPath,
1645
+ subFieldState: {
1646
+ display: {
1647
+ value: "list",
1648
+ valid: true
1649
+ },
1650
+ hideDescriptionsOnMobile: {
1651
+ value: true,
1652
+ valid: true
1600
1653
  }
1601
- }),
1602
- children: "+ Add section to this column"
1603
- })
1604
- ]
1605
- })]
1654
+ }
1655
+ }),
1656
+ children: "+ Add section to this column"
1657
+ })
1658
+ ] })
1606
1659
  });
1607
1660
  }
1608
1661
  function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, readOnly, sectionCount }) {
@@ -1614,34 +1667,33 @@ function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, re
1614
1667
  const hideMobile = useField({ path: `${base}.hideDescriptionsOnMobile` });
1615
1668
  const links = section.links ?? [];
1616
1669
  const featured = (display.value ?? section.display) === "featured";
1617
- const sectionName = eyebrow.value || section.eyebrow || "Untitled section";
1618
- return /* @__PURE__ */ jsxs("div", {
1619
- className: "bl-nav-items__section",
1620
- children: [
1621
- /* @__PURE__ */ jsxs("div", {
1622
- className: "bl-nav-items__section-head",
1623
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: sectionName }), /* @__PURE__ */ jsx("small", { children: featured ? "featured" : "list" })] }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1624
- label: sectionName,
1625
- index: sectionIndex,
1626
- count: sectionCount,
1627
- path: sectionsPath
1628
- })]
1629
- }),
1670
+ return /* @__PURE__ */ jsx(Fold, {
1671
+ title: eyebrow.value || section.eyebrow || "Untitled section",
1672
+ tone: "dark",
1673
+ meta: (open) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("small", { children: featured ? "featured" : "list" }), open ? null : /* @__PURE__ */ jsxs("small", { children: [
1674
+ links.length,
1675
+ " ",
1676
+ links.length === 1 ? "link" : "links"
1677
+ ] })] }),
1678
+ actions: useRowActions({
1679
+ index: sectionIndex,
1680
+ count: sectionCount,
1681
+ path: sectionsPath,
1682
+ readOnly
1683
+ }),
1684
+ children: /* @__PURE__ */ jsxs(Stack, { children: [
1630
1685
  /* @__PURE__ */ jsxs("div", {
1631
1686
  className: "bl-nav-items__section-settings",
1632
1687
  children: [
1633
- /* @__PURE__ */ jsxs("label", {
1634
- className: "bl-nav-items__field",
1635
- children: [/* @__PURE__ */ jsx("span", { children: "Eyebrow" }), /* @__PURE__ */ jsx("input", {
1636
- value: eyebrow.value ?? section.eyebrow ?? "",
1637
- disabled: readOnly,
1638
- placeholder: "Optional heading",
1639
- onChange: (event) => eyebrow.setValue(event.target.value)
1640
- })]
1641
- }),
1642
- /* @__PURE__ */ jsxs("div", {
1643
- className: "bl-nav-items__field",
1644
- children: [/* @__PURE__ */ jsx("span", { children: "Display" }), /* @__PURE__ */ jsxs("div", {
1688
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Eyebrow" }), /* @__PURE__ */ jsx(Input, {
1689
+ value: eyebrow.value ?? section.eyebrow ?? "",
1690
+ disabled: readOnly,
1691
+ placeholder: "Optional heading",
1692
+ onChange: (event) => eyebrow.setValue(event.target.value)
1693
+ })] }),
1694
+ /* @__PURE__ */ jsxs(Field, {
1695
+ as: "div",
1696
+ children: [/* @__PURE__ */ jsx(Label, { children: "Display" }), /* @__PURE__ */ jsxs("div", {
1645
1697
  className: "bl-nav-items__seg",
1646
1698
  children: [/* @__PURE__ */ jsx("button", {
1647
1699
  type: "button",
@@ -1658,56 +1710,50 @@ function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, re
1658
1710
  })]
1659
1711
  })]
1660
1712
  }),
1661
- /* @__PURE__ */ jsxs("label", {
1662
- className: "bl-nav-items__check",
1663
- children: [/* @__PURE__ */ jsx("input", {
1664
- type: "checkbox",
1665
- checked: (hideMobile.value ?? section.hideDescriptionsOnMobile) !== false,
1666
- disabled: readOnly,
1667
- onChange: (event) => hideMobile.setValue(event.target.checked)
1668
- }), "Hide descriptions on mobile"]
1713
+ /* @__PURE__ */ jsx(CheckLabel, {
1714
+ checked: (hideMobile.value ?? section.hideDescriptionsOnMobile) !== false,
1715
+ disabled: readOnly,
1716
+ onCheckedChange: (checked) => hideMobile.setValue(checked),
1717
+ children: "Hide descriptions on mobile"
1669
1718
  })
1670
1719
  ]
1671
1720
  }),
1672
- /* @__PURE__ */ jsxs("div", {
1673
- className: "bl-nav-items__links",
1674
- children: [links.map((link, linkIndex) => /* @__PURE__ */ jsx(MegaLinkEditor, {
1675
- path: `${base}.links.${linkIndex}`,
1676
- arrayPath: `${base}.links`,
1677
- index: linkIndex,
1678
- count: links.length,
1679
- label: link.label,
1680
- readOnly
1681
- }, linkIndex)), readOnly ? null : /* @__PURE__ */ jsx("button", {
1682
- type: "button",
1683
- className: "bl-nav-items__inline-add",
1684
- onClick: () => addFieldRow({
1685
- path: `${base}.links`,
1686
- schemaPath: `${base}.links`,
1687
- subFieldState: {
1688
- label: {
1689
- value: "New link",
1690
- valid: true
1691
- },
1692
- type: {
1693
- value: "page",
1694
- valid: true
1695
- }
1721
+ links.map((link, linkIndex) => /* @__PURE__ */ jsx(MegaLinkEditor, {
1722
+ path: `${base}.links.${linkIndex}`,
1723
+ arrayPath: `${base}.links`,
1724
+ index: linkIndex,
1725
+ count: links.length,
1726
+ label: link.label,
1727
+ readOnly
1728
+ }, linkIndex)),
1729
+ readOnly ? null : /* @__PURE__ */ jsx(Button, {
1730
+ variant: "outline",
1731
+ className: "bl-nav-items__inline-add",
1732
+ onClick: () => addFieldRow({
1733
+ path: `${base}.links`,
1734
+ schemaPath: `${base}.links`,
1735
+ subFieldState: {
1736
+ label: {
1737
+ value: "New link",
1738
+ valid: true
1739
+ },
1740
+ type: {
1741
+ value: "page",
1742
+ valid: true
1696
1743
  }
1697
- }),
1698
- children: "+ Add link"
1699
- })]
1744
+ }
1745
+ }),
1746
+ children: "+ Add link"
1700
1747
  })
1701
- ]
1748
+ ] })
1702
1749
  });
1703
1750
  }
1704
1751
  const CSS = `
1705
- .bl-nav-items{--bg:#0f1012;--panel:#141518;--panel2:#1b1d22;--line:#30333b;--line2:#444854;--text:#f6f7f9;--muted:#989daa;--pink:#e60088;display:grid;grid-template-columns:300px minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}
1706
- .bl-nav-items button,.bl-nav-items input,.bl-nav-items select,.bl-nav-items textarea{font:inherit;color:inherit}
1707
- .bl-workspace__rail{border-right:1px solid var(--line);background:#121316;min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}
1708
- .bl-nav-items__kicker,.bl-workspace__kicker{margin:0;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:800}
1752
+ .bl-nav-items{--bg:var(--theme-bg,var(--theme-elevation-0,#fff));--panel:var(--theme-elevation-50,#f4f4f5);--panel2:var(--theme-elevation-100,#e4e4e7);--line:var(--theme-elevation-150,#e4e4e7);--line2:var(--theme-elevation-250,#d4d4d8);--text:var(--theme-text,var(--theme-elevation-800,#18181b));--muted:var(--theme-elevation-500,#71717a);--pink:var(--bl-kit-accent,#e60088);display:grid;grid-template-columns:300px minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}
1753
+ .bl-nav-items button:not([class*="bl-nav-kit"]),.bl-nav-items input:not([class*="bl-nav-kit"]),.bl-nav-items select:not([class*="bl-nav-kit"]),.bl-nav-items textarea:not([class*="bl-nav-kit"]){font:inherit;color:inherit}
1754
+ .bl-workspace__rail{border-right:1px solid var(--line);background:var(--theme-elevation-50,var(--panel));min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}
1709
1755
  .bl-nav-items__rail-body{padding:12px;flex:1;min-height:0;overflow:auto}
1710
- .bl-workspace__rail-slot{flex:none;min-height:0;max-height:100%;overflow:auto;border-top:1px solid var(--line);background:#101115;padding:14px 12px 16px}
1756
+ .bl-workspace__rail-slot{flex:none;min-height:0;max-height:100%;overflow:auto;border-top:1px solid var(--line);background:var(--theme-elevation-0,var(--bg));padding:14px 12px 16px}
1711
1757
  .bl-nav-items__header-cta{margin:0;padding:0;border:0;min-width:0}
1712
1758
  .bl-nav-items__header-cta-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:10px}
1713
1759
  .bl-nav-items__header-cta-head h3{margin:0;font-size:14px}
@@ -1715,22 +1761,20 @@ const CSS = `
1715
1761
  .bl-nav-items__req{color:var(--pink)}
1716
1762
  .bl-nav-items__list{list-style:none;margin:0;padding:0}
1717
1763
  .bl-nav-items__list li{border:1px solid transparent;border-radius:9px;margin-bottom:7px}
1718
- .bl-nav-items__list li[data-selected="true"]{border-color:#414550;background:#1b1d22}
1764
+ .bl-nav-items__list li[data-selected="true"]{border-color:var(--line2);background:var(--theme-elevation-100,var(--panel2))}
1719
1765
  .bl-nav-items__rail-row{display:grid;grid-template-columns:20px 1fr auto;gap:8px;align-items:center;padding:6px 8px}
1720
1766
  .bl-nav-items__rail-label{border:0;background:transparent;text-align:left;font:inherit;font-weight:650;color:inherit;cursor:pointer;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1721
- .bl-nav-items__badge{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;background:#292c33;color:#c9ccd4}
1722
- .bl-nav-items__badge[data-kind="megaMenu"]{background:#32142a;color:#ff91ce}
1767
+ .bl-nav-items__badge{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;background:var(--theme-elevation-150,var(--line));color:var(--theme-elevation-800,var(--text))}
1768
+ .bl-nav-items__badge[data-kind="megaMenu"]{background:color-mix(in srgb,var(--pink) 22%,var(--theme-elevation-0,var(--bg)));color:var(--pink)}
1723
1769
  .bl-nav-items__rail-edit{display:block;border-top:1px solid var(--line);padding:10px}
1724
- .bl-nav-items__add,.bl-nav-items__add-section,.bl-nav-items__add-column,.bl-nav-items__inline-add{width:100%;border:1px dashed #3a3e47;background:transparent;border-radius:9px;padding:10px;color:#c6cad2;cursor:pointer}
1725
- .bl-nav-items__add:hover,.bl-nav-items__add-section:hover,.bl-nav-items__add-column:hover,.bl-nav-items__inline-add:hover{border-color:var(--pink);color:#fff}
1770
+ .bl-nav-items__add,.bl-nav-items__add-section,.bl-nav-items__add-column,.bl-nav-items__inline-add{width:100%}
1726
1771
  .bl-nav-items__add-column{margin-top:12px}
1727
- .bl-nav-items__inline-add{border-width:1px 0 0;border-radius:0;text-align:left}
1728
1772
  .bl-workspace__canvas{min-width:0;min-height:0;height:100%;overflow:auto;padding:0 28px 44px;max-width:1250px;margin:0 auto;width:100%}
1729
- .bl-workspace__main-head{padding:18px 0 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:flex-start}
1773
+ .bl-workspace__main-head{padding:18px 0 14px;display:flex;justify-content:space-between;align-items:flex-start}
1730
1774
  .bl-workspace__main-head h1{font-size:20px;margin:2px 0 4px}
1731
1775
  .bl-workspace__main-head p{margin:0;color:var(--muted)}
1732
1776
  .bl-nav-items__preview-block{position:sticky;top:0;z-index:20;background:transparent;padding:0;overflow:visible}
1733
- .bl-nav-items__preview{padding:12px 0 0}
1777
+ .bl-nav-items__preview{padding:16px;display:flex;flex-direction:column;gap:16px;background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:visible}
1734
1778
  .bl-nav-items__preview-theme{border:0;background:transparent;color:inherit;width:36px;height:36px;display:grid;place-items:center;border-radius:8px;cursor:pointer;flex:none}
1735
1779
  .bl-nav-items__preview-theme:hover{background:#24242b}
1736
1780
  .bl-nav-items__preview-block[data-theme="dark"] .bl-nav-items__preview-logo img{filter:invert(1) hue-rotate(180deg)}
@@ -1756,72 +1800,54 @@ const CSS = `
1756
1800
  .bl-nav-items__preview-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#1f2126;border-top:1px solid var(--line)}
1757
1801
  .bl-nav-items__preview-footer a{color:var(--pink2,#ff2da5);text-decoration:underline;text-underline-offset:2px;font-weight:650;font-size:13px}
1758
1802
  .bl-nav-items__preview-footer .cta{background:var(--pink);padding:8px 12px;border-radius:8px;color:#fff;font-weight:650;font-size:13px}
1759
- .bl-nav-items__preview-nav{display:flex;align-items:center;gap:24px;padding:12px 16px 12px 20px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:rgba(20,21,24,.85);box-shadow:0 10px 28px rgba(0,0,0,.28)}
1760
- .bl-nav-items__preview-logo{flex:1;min-width:0;display:flex;align-items:center}
1803
+ .bl-nav-items__preview-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:24px;padding:12px 16px 12px 20px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:rgba(20,21,24,.85)}
1804
+ .bl-nav-items__preview-logo{justify-self:start;min-width:0;display:flex;align-items:center}
1761
1805
  .bl-nav-items__preview-logo img{height:20px;width:auto;display:block}
1762
- .bl-nav-items__preview-links{display:flex;align-items:center;gap:4px;flex:none}
1763
- .bl-nav-items__preview-link{color:#d7dae0;background:none;border:0;padding:8px 12px;border-radius:8px;font-weight:550;cursor:pointer;white-space:nowrap}
1806
+ .bl-nav-items__preview-links{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0}
1807
+ .bl-nav-items__preview-link{display:inline-flex;align-items:center;gap:4px;color:#d7dae0;background:none;border:0;padding:8px 12px;border-radius:8px;font-weight:550;cursor:pointer;white-space:nowrap}
1764
1808
  .bl-nav-items__preview-link.is-open{background:#24242b}
1765
- .bl-nav-items__preview-actions{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
1809
+ .bl-nav-items__preview-chevron{flex:none;width:12px;height:12px;transition:transform .2s}
1810
+ .bl-nav-items__preview-link.is-open .bl-nav-items__preview-chevron{transform:rotate(180deg)}
1811
+ .bl-nav-items__preview-actions{justify-self:end;display:flex;align-items:center;justify-content:flex-end;gap:8px}
1766
1812
  .bl-nav-items__preview-cta{flex:none;background:var(--pink);border:0;border-radius:8px;color:#fff;font-weight:650;font-size:13px;padding:8px 12px;white-space:nowrap;text-decoration:none}
1767
1813
  .bl-nav-items__builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:26px 0 10px}
1768
1814
  .bl-nav-items__builder-head h2{font-size:18px;margin:0}
1769
1815
  .bl-nav-items__builder-head p{margin:3px 0 0;color:var(--muted);font-size:13px}
1770
1816
  .bl-nav-items__builder-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
1771
1817
  .bl-nav-items__tool{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
1772
- .bl-nav-items__tool select{width:auto;min-width:160px;padding:8px 30px 8px 10px;background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;color:#fff}
1818
+ .bl-nav-items__tool .bl-nav-kit__select-trigger{width:auto;min-width:160px}
1773
1819
  .bl-nav-items__columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
1774
1820
  .bl-nav-items__columns:has(> :only-child){grid-template-columns:minmax(0,1fr)}
1775
- .bl-nav-items__column{border:1px solid var(--line2);background:var(--panel);border-radius:12px;overflow:visible;margin:0;min-width:0;padding:0}
1776
- .bl-nav-items__column-head{padding:12px 14px;background:#1b1d22;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
1777
- .bl-nav-items__column-title{display:flex;align-items:center;gap:8px;font-weight:700}
1778
- .bl-nav-items__width-pill{font-size:11px;color:#c2c5cc;background:#292c33;border-radius:999px;padding:3px 8px}
1779
- .bl-nav-items__column-body{padding:12px}
1780
- .bl-nav-items__column-settings{display:grid;grid-template-columns:1fr 1fr;column-gap:10px;row-gap:7px;margin-bottom:12px;padding:10px;background:#101115;border:1px solid var(--line);border-radius:9px;align-items:center}
1781
- .bl-nav-items__column-settings.is-first{grid-template-columns:1fr}
1782
- .bl-nav-items__column-settings > label:not(.bl-nav-items__check){display:block;font-size:12px;font-weight:700}
1783
- .bl-nav-items__column-settings select{width:100%;background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;color:#fff;padding:10px 11px;margin-top:7px}
1784
- .bl-nav-items__field{display:block;font-size:12px;font-weight:700;margin:0 0 13px}
1785
- .bl-nav-items__field > span{display:block;margin-bottom:7px}
1786
- .bl-nav-items__field input,.bl-nav-items__field select,.bl-nav-items__field textarea{width:100%;font:inherit;font-weight:400;padding:10px 11px;border:1px solid #3a3d46;border-radius:8px;background:#1d1f24;color:#fff;outline:none}
1787
- .bl-nav-items__check{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:500;color:#d8dbe1}
1821
+ .bl-nav-items__column-settings{display:grid;grid-template-columns:1fr;gap:10px;padding:10px;background:var(--theme-elevation-50,var(--panel));border:1px solid var(--line);border-radius:9px;align-items:center}
1822
+ .bl-nav-items__column-settings .bl-nav-kit__field{margin:0}
1823
+ .bl-nav-items__column-settings .bl-nav-kit__select-trigger{width:100%}
1824
+ .bl-nav-items__check{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:500;color:var(--text)}
1788
1825
  .bl-nav-items__header-cta .bl-nav-items__check{gap:16px}
1789
1826
  .bl-nav-items__header-cta-toggle{margin-bottom:20px}
1790
- .bl-nav-items__check input{accent-color:var(--pink);margin:0;flex:none}
1791
1827
  .bl-nav-items__seg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
1792
- .bl-nav-items__seg button{border:1px solid var(--line2);background:#15171b;border-radius:7px;padding:8px 6px;font-size:12px;color:inherit;cursor:pointer}
1793
- .bl-nav-items__seg button.is-active{border-color:var(--pink);background:#261722}
1794
- .bl-nav-items__section{border:1px solid var(--line);background:#111216;border-radius:10px;margin-bottom:10px}
1795
- .bl-nav-items__section-head{padding:11px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
1796
- .bl-nav-items__section-head strong{font-size:13px}
1797
- .bl-nav-items__section-head small{color:var(--muted);margin-left:6px}
1798
- .bl-nav-items__section-settings{padding:10px 12px;border-bottom:1px solid var(--line);background:#0e0f13}
1799
- .bl-nav-items__links{padding:8px}
1800
- .bl-nav-items__link{border:1px solid var(--line);background:#111216;border-radius:7px;padding:0 10px 12px;margin:.5rem 0}
1801
- .bl-nav-items__link-head{margin:0 -10px 8px;padding:11px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
1802
- .bl-nav-items__link-head strong{font-size:13px}
1803
- .bl-nav-items__footer,.bl-nav-items__panel{margin-top:18px;border:1px solid var(--line2);background:#141518;border-radius:12px;overflow:hidden}
1828
+ .bl-nav-items__seg button{border:1px solid var(--line2);background:var(--theme-elevation-50,var(--panel));border-radius:7px;padding:8px 6px;font-size:12px;color:inherit;cursor:pointer}
1829
+ .bl-nav-items__seg button.is-active{border-color:var(--pink);background:color-mix(in srgb,var(--pink) 16%,var(--theme-elevation-0,var(--bg)))}
1830
+ .bl-nav-items__section-settings{padding:10px 12px;border:1px solid var(--line);background:var(--theme-elevation-50,var(--panel));border-radius:9px}
1831
+ .bl-nav-items__footer,.bl-nav-items__panel{margin-top:18px;border:1px solid var(--line2);background:var(--theme-elevation-50,var(--panel));border-radius:12px;overflow:hidden}
1804
1832
  .bl-nav-items__footer-head,.bl-nav-items__panel-head{display:flex;align-items:flex-start;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line);gap:12px}
1805
1833
  .bl-nav-items__footer-head h3,.bl-nav-items__panel-head h3{margin:0;font-size:16px}
1806
1834
  .bl-nav-items__footer-head p,.bl-nav-items__panel-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
1807
1835
  .bl-nav-items__footer-body,.bl-nav-items__panel-body{padding:14px 16px}
1808
1836
  .bl-nav-items__footer-body{display:grid;grid-template-columns:1fr 1fr;gap:14px}
1809
- .bl-nav-items__footer-card{background:#101115;border:1px solid var(--line);border-radius:10px;padding:14px}
1837
+ .bl-nav-items__footer-card{background:var(--theme-elevation-0,var(--bg));border:1px solid var(--line);border-radius:10px;padding:14px}
1810
1838
  .bl-nav-items__footer-card h4{margin:0 0 12px;font-size:14px}
1811
1839
  .bl-nav-items__panel-body{max-width:480px}
1812
1840
  .bl-nav-items__empty{color:var(--muted);font-size:13px;padding:28px;text-align:center}
1813
1841
  .bl-nav-items__menu{position:relative}
1814
1842
  .bl-nav-items__menu > button{border:0;background:transparent;color:inherit;cursor:pointer}
1815
- .bl-nav-items__menu-pop{position:absolute;right:0;top:34px;z-index:12;min-width:140px;padding:4px;border:1px solid var(--line2);border-radius:8px;background:#1b1d22}
1816
- .bl-nav-items__menu-pop button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:7px 8px;border-radius:6px;color:#d8dbe1;cursor:pointer}
1817
- .bl-nav-items .field-label,.bl-nav-items .field-label__label{display:block !important;font-size:12px;font-weight:700;margin:0 0 7px;color:var(--text)}
1843
+ .bl-nav-items__menu-pop{position:absolute;right:0;top:34px;z-index:12;min-width:140px;padding:4px;border:1px solid var(--line2);border-radius:8px;background:var(--theme-elevation-50,var(--panel))}
1844
+ .bl-nav-items__menu-pop button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:7px 8px;border-radius:6px;color:var(--text);cursor:pointer}
1845
+ .bl-nav-items .field-label,.bl-nav-items .field-label__label{display:block !important;margin:0;padding:0;font:12px/1.2 Inter,ui-sans-serif,system-ui,sans-serif;font-weight:700;color:inherit}
1818
1846
  .bl-nav-items .field-description,.bl-nav-items .field__description{display:none !important}
1819
- .bl-nav-items .bl-link-field{margin:0 0 13px}
1820
- .bl-nav-items .bl-link-field__control{background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;min-height:auto;padding:8px 10px;color:#fff;box-shadow:none}
1821
- .bl-nav-items .bl-link-field__kind{background:#292c33;color:#c9ccd4;border-radius:999px;padding:3px 7px}
1847
+ .bl-nav-items .bl-link-field{display:flex;flex-direction:column;gap:8px;margin:0 0 16px}
1848
+ .bl-nav-items .bl-link-field__control{background:var(--theme-input-bg,var(--theme-elevation-0,#fff));border:1px solid var(--theme-elevation-250,var(--line2));border-radius:8px;min-height:auto;padding:8px 10px;color:var(--text);box-shadow:none}
1849
+ .bl-nav-items .bl-link-field__kind{background:var(--theme-elevation-150,var(--line));color:var(--theme-elevation-800,var(--text));border-radius:999px;padding:3px 7px}
1822
1850
  .bl-nav-items .bl-link-field__kind:first-letter{text-transform:uppercase}
1823
- .bl-nav-kit__modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:rgba(0,0,0,.62)}
1824
- .bl-nav-kit__modal-card{width:min(36rem,calc(100vw - 2rem));background:#15161a;border:1px solid #343741;border-radius:14px;padding:1.25rem;color:var(--text)}
1825
1851
  @media(max-width:1280px){.bl-nav-items{grid-template-columns:250px minmax(0,1fr)}}
1826
1852
  @media(max-width:850px){.bl-nav-items{grid-template-columns:1fr}.bl-nav-items__footer-body,.bl-nav-items__columns,.bl-nav-items__columns:has(> :only-child){grid-template-columns:minmax(0,1fr) !important}}
1827
1853
  `;