@nswds/app 1.118.0 → 1.119.1

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
@@ -14351,9 +14351,20 @@ function CodeDemoContent({ data, showCode = true, controls = defaultControls })
14351
14351
  React5__default.useEffect(() => {
14352
14352
  const frame2 = iframeRef.current;
14353
14353
  if (!frame2) return;
14354
+ const getTargetOrigin = () => {
14355
+ const src = frame2.getAttribute("src");
14356
+ if (!src || src === "about:blank") {
14357
+ return window.location.origin;
14358
+ }
14359
+ try {
14360
+ return new URL(src, window.location.href).origin;
14361
+ } catch {
14362
+ return window.location.origin;
14363
+ }
14364
+ };
14354
14365
  const send = () => {
14355
14366
  const msg = { type: "nswds-theme", payload: themeValues };
14356
- frame2.contentWindow?.postMessage(msg, "*");
14367
+ frame2.contentWindow?.postMessage(msg, getTargetOrigin());
14357
14368
  };
14358
14369
  send();
14359
14370
  frame2.addEventListener("load", send);
@@ -18254,82 +18265,155 @@ var expandableSearchButtonVariants = cva("", {
18254
18265
  variant: "default"
18255
18266
  }
18256
18267
  });
18257
- var ExpandableSearchContext = React5.createContext(null);
18258
- var ExpandableSearch = React5.forwardRef(({ className, onAction, defaultValue = "", variant = "default", ...props }, ref) => {
18259
- const [value, setValue] = React5.useState(defaultValue);
18260
- const formRef = React5.useRef(null);
18261
- const resolvedVariant = variant ?? "default";
18262
- const handleAction = (e) => {
18263
- e.preventDefault();
18264
- if (onAction) {
18265
- onAction(value);
18268
+ var expandableSearchFocusVariants = cva("", {
18269
+ variants: {
18270
+ variant: {
18271
+ default: "focus-visible:ring-grey-100",
18272
+ "primary-800": "focus-visible:ring-primary-800",
18273
+ "primary-600": "focus-visible:ring-primary-600",
18274
+ "primary-400": "focus-visible:ring-primary-400",
18275
+ "primary-200": "focus-visible:ring-primary-200",
18276
+ "grey-800": "focus-visible:ring-grey-800",
18277
+ "grey-600": "focus-visible:ring-grey-600",
18278
+ "grey-400": "focus-visible:ring-grey-400",
18279
+ "grey-200": "focus-visible:ring-grey-200",
18280
+ "accent-800": "focus-visible:ring-accent-800",
18281
+ "accent-600": "focus-visible:ring-accent-600",
18282
+ "accent-400": "focus-visible:ring-accent-400",
18283
+ "accent-200": "focus-visible:ring-accent-200",
18284
+ white: "focus-visible:ring-white"
18266
18285
  }
18267
- };
18268
- return /* @__PURE__ */ jsx(
18269
- ExpandableSearchContext.Provider,
18270
- {
18271
- value: { value, setValue, formRef, variant: resolvedVariant },
18272
- children: /* @__PURE__ */ jsx(
18273
- "form",
18286
+ },
18287
+ defaultVariants: {
18288
+ variant: "default"
18289
+ }
18290
+ });
18291
+ var ExpandableSearchContext = React5.createContext(null);
18292
+ var ExpandableSearch = React5.forwardRef(
18293
+ ({
18294
+ className,
18295
+ onAction,
18296
+ defaultValue = "",
18297
+ onSubmit,
18298
+ onFocusCapture,
18299
+ onBlurCapture,
18300
+ variant = "default",
18301
+ ...props
18302
+ }, ref) => {
18303
+ const [value, setValue] = React5.useState(defaultValue);
18304
+ const [formHasFocusWithin, setFormHasFocusWithin] = React5.useState(false);
18305
+ const resolvedVariant = variant ?? "default";
18306
+ const handleSubmit = (e) => {
18307
+ onSubmit?.(e);
18308
+ if (e.defaultPrevented) {
18309
+ return;
18310
+ }
18311
+ e.preventDefault();
18312
+ onAction?.(value);
18313
+ };
18314
+ const handleFocusCapture = (e) => {
18315
+ setFormHasFocusWithin(true);
18316
+ onFocusCapture?.(e);
18317
+ };
18318
+ const handleBlurCapture = (e) => {
18319
+ const nextFocusedElement = e.relatedTarget;
18320
+ if (!e.currentTarget.contains(nextFocusedElement)) {
18321
+ setFormHasFocusWithin(false);
18322
+ }
18323
+ onBlurCapture?.(e);
18324
+ };
18325
+ return /* @__PURE__ */ jsx(
18326
+ ExpandableSearchContext.Provider,
18327
+ {
18328
+ value: { value, setValue, formHasFocusWithin, variant: resolvedVariant },
18329
+ children: /* @__PURE__ */ jsx(
18330
+ "form",
18331
+ {
18332
+ ref,
18333
+ className: cn("group relative inline-block select-none", className),
18334
+ onBlurCapture: handleBlurCapture,
18335
+ onFocusCapture: handleFocusCapture,
18336
+ onSubmit: handleSubmit,
18337
+ ...props
18338
+ }
18339
+ )
18340
+ }
18341
+ );
18342
+ }
18343
+ );
18344
+ ExpandableSearch.displayName = "ExpandableSearch";
18345
+ var ExpandableSearchField = React5.forwardRef(
18346
+ ({ className, id: id3, buttonLabel = "Search", buttonProps, ...props }, ref) => {
18347
+ const context = React5.useContext(ExpandableSearchContext);
18348
+ if (!context) throw new Error("ExpandableSearchField must be used within ExpandableSearch");
18349
+ const generatedId = React5.useId();
18350
+ const {
18351
+ className: buttonClassName,
18352
+ children: buttonChildren,
18353
+ "aria-label": buttonAriaLabel,
18354
+ ...restButtonProps
18355
+ } = buttonProps ?? {};
18356
+ const isActive = context.value.length > 0 || context.formHasFocusWithin;
18357
+ const variant = context.variant;
18358
+ const inputId = id3 ?? generatedId;
18359
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
18360
+ /* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: inputId, children: "Search" }),
18361
+ /* @__PURE__ */ jsx(
18362
+ "input",
18274
18363
  {
18275
18364
  ref,
18276
- className: cn("relative inline-block select-none", className),
18277
- onSubmit: handleAction,
18365
+ id: inputId,
18366
+ value: context.value,
18367
+ onChange: (e) => context.setValue(e.target.value),
18368
+ className: cn(
18369
+ "align-center flex h-12 w-12 cursor-pointer overflow-hidden rounded-sm border-0 text-transparent",
18370
+ "ring-offset-white focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
18371
+ "transition-[width,box-shadow,background-color] duration-300 ease-in-out",
18372
+ "placeholder:text-transparent placeholder:opacity-0",
18373
+ "expandable-search__input",
18374
+ expandableSearchFocusVariants({ variant }),
18375
+ expandableSearchCollapsedVariants({ variant }),
18376
+ // Conditionally apply classes based on active state
18377
+ {
18378
+ "p-0": !isActive,
18379
+ "w-96 cursor-auto pt-0 pr-12 pb-0 pl-4 outline-none select-auto": isActive
18380
+ },
18381
+ isActive && expandableSearchSurfaceVariants({ variant }),
18382
+ isActive && (variant === "default" ? "placeholder:text-grey-700 placeholder:opacity-100" : "placeholder:text-current placeholder:opacity-70"),
18383
+ className
18384
+ ),
18278
18385
  ...props
18279
18386
  }
18387
+ ),
18388
+ /* @__PURE__ */ jsx(
18389
+ "button",
18390
+ {
18391
+ "aria-label": buttonAriaLabel ?? buttonLabel,
18392
+ type: "submit",
18393
+ className: cn(
18394
+ "absolute top-0 right-0 z-10 flex h-12 w-12 rounded-sm transition-[background-color,box-shadow] duration-200",
18395
+ "ring-offset-white focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
18396
+ expandableSearchButtonVariants({ variant }),
18397
+ expandableSearchFocusVariants({ variant }),
18398
+ {
18399
+ "pointer-events-none": !isActive,
18400
+ "pointer-events-auto": isActive
18401
+ },
18402
+ buttonClassName
18403
+ ),
18404
+ ...restButtonProps,
18405
+ children: buttonChildren ?? /* @__PURE__ */ jsx(
18406
+ Icons.search,
18407
+ {
18408
+ "aria-hidden": "true",
18409
+ className: "m-auto block h-8 w-8 shrink-0 fill-current leading-none"
18410
+ }
18411
+ )
18412
+ }
18280
18413
  )
18281
- }
18282
- );
18283
- });
18284
- ExpandableSearch.displayName = "ExpandableSearch";
18285
- var ExpandableSearchField = React5.forwardRef(({ className, ...props }, ref) => {
18286
- const context = React5.useContext(ExpandableSearchContext);
18287
- if (!context) throw new Error("ExpandableSearchField must be used within ExpandableSearch");
18288
- const [isFocused, setIsFocused] = React5.useState(false);
18289
- const isActive = context.value.length > 0 || isFocused;
18290
- const variant = context.variant;
18291
- return /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
18292
- /* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "expandable-search", children: "Search" }),
18293
- /* @__PURE__ */ jsx(
18294
- "input",
18295
- {
18296
- ref,
18297
- value: context.value,
18298
- onChange: (e) => context.setValue(e.target.value),
18299
- onFocus: () => setIsFocused(true),
18300
- onBlur: () => setIsFocused(false),
18301
- className: cn(
18302
- "peer align-center flex h-12 w-12 cursor-pointer overflow-hidden rounded-sm border-0 text-transparent",
18303
- "ring-offset-white focus-visible:ring-2 focus-visible:ring-primary-650/70 focus-visible:ring-offset-2 focus-visible:outline-none",
18304
- "transition-[width,box-shadow,background-color] duration-300 ease-in-out",
18305
- "placeholder:text-transparent placeholder:opacity-0",
18306
- "expandable-search__input",
18307
- expandableSearchCollapsedVariants({ variant }),
18308
- // Conditionally apply classes based on active state
18309
- {
18310
- "p-0": !isActive,
18311
- "w-96 cursor-auto pt-0 pr-12 pb-0 pl-4 outline-none select-auto": isActive
18312
- },
18313
- isActive && expandableSearchSurfaceVariants({ variant }),
18314
- isActive && (variant === "default" ? "placeholder:text-grey-700 placeholder:opacity-100" : "placeholder:text-current placeholder:opacity-70"),
18315
- className
18316
- ),
18317
- ...props
18318
- }
18319
- ),
18320
- /* @__PURE__ */ jsx(
18321
- "button",
18322
- {
18323
- type: "button",
18324
- className: cn(
18325
- "pointer-events-none absolute top-0 right-0 z-10 flex h-12 w-12 rounded-sm transition-colors duration-200 peer-focus:pointer-events-auto",
18326
- expandableSearchButtonVariants({ variant })
18327
- ),
18328
- children: /* @__PURE__ */ jsx(Icons.search, { className: "m-auto block h-8 w-8 shrink-0 fill-current leading-none" })
18329
- }
18330
- )
18331
- ] });
18332
- });
18414
+ ] });
18415
+ }
18416
+ );
18333
18417
  ExpandableSearchField.displayName = "ExpandableSearchField";
18334
18418
  function Fieldset2({
18335
18419
  className,
@@ -18858,7 +18942,7 @@ function FormatToggle({ format, setFormat }) {
18858
18942
 
18859
18943
  // package.json
18860
18944
  var package_default = {
18861
- version: "1.117.0"};
18945
+ version: "1.119.0"};
18862
18946
  var SluggerContext = React5__default.createContext(null);
18863
18947
  function flattenText(nodes) {
18864
18948
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -29817,20 +29901,24 @@ function createVariantStyles({
29817
29901
  border,
29818
29902
  triggerTone,
29819
29903
  triggerActive,
29820
- triggerEdge,
29821
29904
  featuredLink,
29822
29905
  sectionLink
29823
29906
  }) {
29824
29907
  return {
29825
- surface,
29826
- border,
29827
- triggerTone,
29828
- triggerActive,
29829
- triggerEdge,
29830
- dropdownSurface: "bg-white",
29831
- featuredLink,
29832
- sectionLink,
29833
- sectionLinkTitle: "text-grey-900"
29908
+ surface: cn(surface, "dark:bg-grey-900 dark:text-white"),
29909
+ border: cn(border, "dark:border-grey-700"),
29910
+ triggerTone: cn(triggerTone, "dark:text-white"),
29911
+ triggerActive: cn(
29912
+ triggerActive,
29913
+ "dark:hover:bg-grey-800 dark:hover:text-white dark:focus:bg-grey-800 dark:focus:text-white dark:data-[state=open]:bg-grey-800 dark:data-[state=open]:text-white"
29914
+ ),
29915
+ dropdownSurface: "bg-white dark:bg-grey-900",
29916
+ featuredLink: cn(featuredLink, "dark:text-white dark:hover:bg-white/10"),
29917
+ sectionLink: cn(
29918
+ sectionLink,
29919
+ "dark:border-grey-700 dark:bg-grey-900 dark:hover:bg-white/10 dark:hover:text-white"
29920
+ ),
29921
+ sectionLinkTitle: "text-grey-900 dark:text-white"
29834
29922
  };
29835
29923
  }
29836
29924
  var navigationMenuMainNavigationVariantStyles = {
@@ -29839,7 +29927,6 @@ var navigationMenuMainNavigationVariantStyles = {
29839
29927
  border: "border-primary-700",
29840
29928
  triggerTone: "text-white",
29841
29929
  triggerActive: "hover:bg-primary-700 hover:text-white focus:bg-primary-700 focus:text-white data-[state=open]:bg-primary-700 data-[state=open]:text-white",
29842
- triggerEdge: "hover:before:bg-primary-700 hover:after:bg-primary-700 focus:before:bg-primary-700 focus:after:bg-primary-700 data-[state=open]:before:bg-primary-700 data-[state=open]:after:bg-primary-700",
29843
29930
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29844
29931
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29845
29932
  }),
@@ -29848,7 +29935,6 @@ var navigationMenuMainNavigationVariantStyles = {
29848
29935
  border: "border-primary-600",
29849
29936
  triggerTone: "text-white",
29850
29937
  triggerActive: "hover:bg-primary-700 hover:text-white focus:bg-primary-700 focus:text-white data-[state=open]:bg-primary-700 data-[state=open]:text-white",
29851
- triggerEdge: "hover:before:bg-primary-700 hover:after:bg-primary-700 focus:before:bg-primary-700 focus:after:bg-primary-700 data-[state=open]:before:bg-primary-700 data-[state=open]:after:bg-primary-700",
29852
29938
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29853
29939
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29854
29940
  }),
@@ -29857,7 +29943,6 @@ var navigationMenuMainNavigationVariantStyles = {
29857
29943
  border: "border-primary-200",
29858
29944
  triggerTone: "text-primary-800",
29859
29945
  triggerActive: "hover:bg-primary-200 hover:text-primary-800 focus:bg-primary-200 focus:text-primary-800 data-[state=open]:bg-primary-200 data-[state=open]:text-primary-800",
29860
- triggerEdge: "hover:before:bg-primary-200 hover:after:bg-primary-200 focus:before:bg-primary-200 focus:after:bg-primary-200 data-[state=open]:before:bg-primary-200 data-[state=open]:after:bg-primary-200",
29861
29946
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29862
29947
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29863
29948
  }),
@@ -29866,7 +29951,6 @@ var navigationMenuMainNavigationVariantStyles = {
29866
29951
  border: "border-primary-200",
29867
29952
  triggerTone: "text-primary-800",
29868
29953
  triggerActive: "hover:bg-primary-100 hover:text-primary-800 focus:bg-primary-100 focus:text-primary-800 data-[state=open]:bg-primary-100 data-[state=open]:text-primary-800",
29869
- triggerEdge: "hover:before:bg-primary-100 hover:after:bg-primary-100 focus:before:bg-primary-100 focus:after:bg-primary-100 data-[state=open]:before:bg-primary-100 data-[state=open]:after:bg-primary-100",
29870
29954
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29871
29955
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29872
29956
  }),
@@ -29875,7 +29959,6 @@ var navigationMenuMainNavigationVariantStyles = {
29875
29959
  border: "border-grey-700",
29876
29960
  triggerTone: "text-white",
29877
29961
  triggerActive: "hover:bg-grey-700 hover:text-white focus:bg-grey-700 focus:text-white data-[state=open]:bg-grey-700 data-[state=open]:text-white",
29878
- triggerEdge: "hover:before:bg-grey-700 hover:after:bg-grey-700 focus:before:bg-grey-700 focus:after:bg-grey-700 data-[state=open]:before:bg-grey-700 data-[state=open]:after:bg-grey-700",
29879
29962
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29880
29963
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29881
29964
  }),
@@ -29884,7 +29967,6 @@ var navigationMenuMainNavigationVariantStyles = {
29884
29967
  border: "border-grey-600",
29885
29968
  triggerTone: "text-white",
29886
29969
  triggerActive: "hover:bg-grey-700 hover:text-white focus:bg-grey-700 focus:text-white data-[state=open]:bg-grey-700 data-[state=open]:text-white",
29887
- triggerEdge: "hover:before:bg-grey-700 hover:after:bg-grey-700 focus:before:bg-grey-700 focus:after:bg-grey-700 data-[state=open]:before:bg-grey-700 data-[state=open]:after:bg-grey-700",
29888
29970
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29889
29971
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29890
29972
  }),
@@ -29893,7 +29975,6 @@ var navigationMenuMainNavigationVariantStyles = {
29893
29975
  border: "border-grey-300",
29894
29976
  triggerTone: "text-grey-800",
29895
29977
  triggerActive: "hover:bg-grey-200 hover:text-grey-800 focus:bg-grey-200 focus:text-grey-800 data-[state=open]:bg-grey-200 data-[state=open]:text-grey-800",
29896
- triggerEdge: "hover:before:bg-grey-200 hover:after:bg-grey-200 focus:before:bg-grey-200 focus:after:bg-grey-200 data-[state=open]:before:bg-grey-200 data-[state=open]:after:bg-grey-200",
29897
29978
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29898
29979
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29899
29980
  }),
@@ -29902,7 +29983,6 @@ var navigationMenuMainNavigationVariantStyles = {
29902
29983
  border: "border-grey-200",
29903
29984
  triggerTone: "text-grey-800",
29904
29985
  triggerActive: "hover:bg-grey-100 hover:text-grey-800 focus:bg-grey-100 focus:text-grey-800 data-[state=open]:bg-grey-100 data-[state=open]:text-grey-800",
29905
- triggerEdge: "hover:before:bg-grey-100 hover:after:bg-grey-100 focus:before:bg-grey-100 focus:after:bg-grey-100 data-[state=open]:before:bg-grey-100 data-[state=open]:after:bg-grey-100",
29906
29986
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29907
29987
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29908
29988
  }),
@@ -29911,7 +29991,6 @@ var navigationMenuMainNavigationVariantStyles = {
29911
29991
  border: "border-accent-600",
29912
29992
  triggerTone: "text-white",
29913
29993
  triggerActive: "hover:bg-accent-600 hover:text-white focus:bg-accent-600 focus:text-white data-[state=open]:bg-accent-600 data-[state=open]:text-white",
29914
- triggerEdge: "hover:before:bg-accent-600 hover:after:bg-accent-600 focus:before:bg-accent-600 focus:after:bg-accent-600 data-[state=open]:before:bg-accent-600 data-[state=open]:after:bg-accent-600",
29915
29994
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29916
29995
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29917
29996
  }),
@@ -29920,7 +29999,6 @@ var navigationMenuMainNavigationVariantStyles = {
29920
29999
  border: "border-accent-600",
29921
30000
  triggerTone: "text-white",
29922
30001
  triggerActive: "hover:bg-accent-800 hover:text-white focus:bg-accent-800 focus:text-white data-[state=open]:bg-accent-800 data-[state=open]:text-white",
29923
- triggerEdge: "hover:before:bg-accent-800 hover:after:bg-accent-800 focus:before:bg-accent-800 focus:after:bg-accent-800 data-[state=open]:before:bg-accent-800 data-[state=open]:after:bg-accent-800",
29924
30002
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29925
30003
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29926
30004
  }),
@@ -29929,7 +30007,6 @@ var navigationMenuMainNavigationVariantStyles = {
29929
30007
  border: "border-accent-200",
29930
30008
  triggerTone: "text-accent-800",
29931
30009
  triggerActive: "hover:bg-accent-200 hover:text-accent-800 focus:bg-accent-200 focus:text-accent-800 data-[state=open]:bg-accent-200 data-[state=open]:text-accent-800",
29932
- triggerEdge: "hover:before:bg-accent-200 hover:after:bg-accent-200 focus:before:bg-accent-200 focus:after:bg-accent-200 data-[state=open]:before:bg-accent-200 data-[state=open]:after:bg-accent-200",
29933
30010
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29934
30011
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29935
30012
  }),
@@ -29938,7 +30015,6 @@ var navigationMenuMainNavigationVariantStyles = {
29938
30015
  border: "border-accent-200",
29939
30016
  triggerTone: "text-accent-800",
29940
30017
  triggerActive: "hover:bg-accent-50 hover:text-accent-800 focus:bg-accent-50 focus:text-accent-800 data-[state=open]:bg-accent-50 data-[state=open]:text-accent-800",
29941
- triggerEdge: "hover:before:bg-accent-50 hover:after:bg-accent-50 focus:before:bg-accent-50 focus:after:bg-accent-50 data-[state=open]:before:bg-accent-50 data-[state=open]:after:bg-accent-50",
29942
30018
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29943
30019
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29944
30020
  }),
@@ -29947,7 +30023,6 @@ var navigationMenuMainNavigationVariantStyles = {
29947
30023
  border: "border-grey-200",
29948
30024
  triggerTone: "text-grey-800",
29949
30025
  triggerActive: "hover:bg-grey-100 hover:text-grey-800 focus:bg-grey-100 focus:text-grey-800 data-[state=open]:bg-grey-100 data-[state=open]:text-grey-800",
29950
- triggerEdge: "hover:before:bg-grey-100 hover:after:bg-grey-100 focus:before:bg-grey-100 focus:after:bg-grey-100 data-[state=open]:before:bg-grey-100 data-[state=open]:after:bg-grey-100",
29951
30026
  featuredLink: "text-grey-800 hover:bg-grey-100",
29952
30027
  sectionLink: "border-grey-200 bg-white hover:bg-grey-50 hover:font-bold hover:text-grey-800"
29953
30028
  })
@@ -29957,10 +30032,8 @@ function TopLevelItem({
29957
30032
  href = "#",
29958
30033
  title,
29959
30034
  variant,
29960
- syncBorderToSurface,
29961
30035
  triggerClassName,
29962
- triggerActiveClassName,
29963
- triggerActiveBorderClassName
30036
+ triggerActiveClassName
29964
30037
  }) {
29965
30038
  const styles5 = navigationMenuMainNavigationVariantStyles[variant];
29966
30039
  return /* @__PURE__ */ jsx(NavigationMenuItem, { className: "shrink-0", children: /* @__PURE__ */ jsx(
@@ -29972,10 +30045,7 @@ function TopLevelItem({
29972
30045
  styles5.triggerTone,
29973
30046
  styles5.triggerActive,
29974
30047
  triggerClassName,
29975
- triggerActiveClassName,
29976
- syncBorderToSurface && "before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-transparent after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-transparent",
29977
- syncBorderToSurface && styles5.triggerEdge,
29978
- syncBorderToSurface && triggerActiveBorderClassName
30048
+ triggerActiveClassName
29979
30049
  ),
29980
30050
  children: /* @__PURE__ */ jsx(Link14, { href, children: title })
29981
30051
  }
@@ -30031,14 +30101,13 @@ function SectionLink({
30031
30101
  function MegaNavigationItem({
30032
30102
  section,
30033
30103
  variant,
30104
+ shadow,
30034
30105
  fullBleed,
30035
30106
  panelMetrics,
30036
30107
  onOpenIntent,
30037
30108
  dropdownBackgroundClassName,
30038
- syncBorderToSurface,
30039
30109
  triggerClassName,
30040
30110
  triggerActiveClassName,
30041
- triggerActiveBorderClassName,
30042
30111
  featuredLinkClassName,
30043
30112
  sectionLinkClassName,
30044
30113
  sectionLinkTitleClassName
@@ -30051,10 +30120,8 @@ function MegaNavigationItem({
30051
30120
  href: section.href,
30052
30121
  title: section.title,
30053
30122
  variant,
30054
- syncBorderToSurface,
30055
30123
  triggerClassName,
30056
- triggerActiveClassName,
30057
- triggerActiveBorderClassName
30124
+ triggerActiveClassName
30058
30125
  }
30059
30126
  );
30060
30127
  }
@@ -30068,10 +30135,7 @@ function MegaNavigationItem({
30068
30135
  styles5.triggerActive,
30069
30136
  triggerClassName,
30070
30137
  triggerActiveClassName,
30071
- "data-[state=open]:shadow-[inset_0_-4px_0_0_currentColor]",
30072
- syncBorderToSurface && "before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-transparent after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-transparent",
30073
- syncBorderToSurface && styles5.triggerEdge,
30074
- syncBorderToSurface && triggerActiveBorderClassName
30138
+ "data-[state=open]:shadow-[inset_0_-4px_0_0_currentColor]"
30075
30139
  ),
30076
30140
  onPointerEnter: onOpenIntent,
30077
30141
  children: section.title
@@ -30081,45 +30145,56 @@ function MegaNavigationItem({
30081
30145
  NavigationMenuContent,
30082
30146
  {
30083
30147
  className: cn(
30084
- "left-0 w-full p-0 pr-0 whitespace-normal group-data-[viewport=false]/navigation-menu:mt-0 group-data-[viewport=false]/navigation-menu:rounded-none group-data-[viewport=false]/navigation-menu:border-0 group-data-[viewport=false]/navigation-menu:bg-transparent group-data-[viewport=false]/navigation-menu:shadow-none data-[motion=from-end]:[--tw-enter-translate-x:0] data-[motion=from-start]:[--tw-enter-translate-x:0] data-[motion=to-end]:[--tw-exit-translate-x:0] data-[motion=to-start]:[--tw-exit-translate-x:0] data-[motion^=from-]:!animate-none data-[motion^=from-]:[--tw-enter-opacity:1] data-[motion^=from-]:[--tw-enter-rotate:0] data-[motion^=from-]:[--tw-enter-scale:1] data-[motion^=from-]:[--tw-enter-translate-y:0] data-[motion^=to-]:!animate-none data-[motion^=to-]:[--tw-exit-opacity:1] data-[motion^=to-]:[--tw-exit-rotate:0] data-[motion^=to-]:[--tw-exit-scale:1] data-[motion^=to-]:[--tw-exit-translate-y:0] group-data-[viewport=false]/navigation-menu:data-[state=closed]:!animate-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:[--tw-exit-opacity:1] group-data-[viewport=false]/navigation-menu:data-[state=closed]:[--tw-exit-scale:1] group-data-[viewport=false]/navigation-menu:data-[state=open]:!animate-none group-data-[viewport=false]/navigation-menu:data-[state=open]:[--tw-enter-opacity:1] group-data-[viewport=false]/navigation-menu:data-[state=open]:[--tw-enter-scale:1] md:w-full"
30148
+ "left-0 w-full p-0 pr-0 whitespace-normal group-data-[viewport=false]/navigation-menu:mt-0 group-data-[viewport=false]/navigation-menu:!overflow-visible group-data-[viewport=false]/navigation-menu:rounded-none group-data-[viewport=false]/navigation-menu:border-0 group-data-[viewport=false]/navigation-menu:bg-transparent group-data-[viewport=false]/navigation-menu:shadow-none data-[motion=from-end]:[--tw-enter-translate-x:0] data-[motion=from-start]:[--tw-enter-translate-x:0] data-[motion=to-end]:[--tw-exit-translate-x:0] data-[motion=to-start]:[--tw-exit-translate-x:0] data-[motion^=from-]:!animate-none data-[motion^=from-]:[--tw-enter-opacity:1] data-[motion^=from-]:[--tw-enter-rotate:0] data-[motion^=from-]:[--tw-enter-scale:1] data-[motion^=from-]:[--tw-enter-translate-y:0] data-[motion^=to-]:!animate-none data-[motion^=to-]:[--tw-exit-opacity:1] data-[motion^=to-]:[--tw-exit-rotate:0] data-[motion^=to-]:[--tw-exit-scale:1] data-[motion^=to-]:[--tw-exit-translate-y:0] group-data-[viewport=false]/navigation-menu:data-[state=closed]:!animate-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:[--tw-exit-opacity:1] group-data-[viewport=false]/navigation-menu:data-[state=closed]:[--tw-exit-scale:1] group-data-[viewport=false]/navigation-menu:data-[state=open]:!animate-none group-data-[viewport=false]/navigation-menu:data-[state=open]:[--tw-enter-opacity:1] group-data-[viewport=false]/navigation-menu:data-[state=open]:[--tw-enter-scale:1] md:w-full"
30085
30149
  ),
30086
30150
  style: fullBleed && panelMetrics ? {
30087
30151
  left: `${-panelMetrics.left}px`,
30088
30152
  width: `${panelMetrics.viewportWidth}px`
30089
30153
  } : void 0,
30090
30154
  onPointerEnter: onOpenIntent,
30091
- children: /* @__PURE__ */ jsx("div", { className: cn("w-full shadow", styles5.dropdownSurface, dropdownBackgroundClassName), children: /* @__PURE__ */ jsxs(
30155
+ children: /* @__PURE__ */ jsx(
30092
30156
  "div",
30093
30157
  {
30094
- className: "grid w-full",
30095
- style: fullBleed && panelMetrics ? {
30096
- width: `${panelMetrics.width}px`,
30097
- marginLeft: "auto",
30098
- marginRight: "auto"
30099
- } : void 0,
30100
- children: [
30101
- /* @__PURE__ */ jsx(
30102
- FeaturedSectionLink,
30103
- {
30104
- href: section.href,
30105
- title: section.title,
30106
- variant,
30107
- className: featuredLinkClassName
30108
- }
30109
- ),
30110
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 overflow-hidden px-4 pb-12 sm:grid-cols-2 lg:grid-cols-3", children: section.links.map((link, index) => /* @__PURE__ */ jsx(
30111
- SectionLink,
30112
- {
30113
- link,
30114
- variant,
30115
- className: sectionLinkClassName,
30116
- titleClassName: sectionLinkTitleClassName
30117
- },
30118
- `${link.title}-${link.href}-${index}`
30119
- )) })
30120
- ]
30158
+ className: cn(
30159
+ "relative z-10 w-full",
30160
+ shadow && "shadow-md shadow-slate-900/5 dark:shadow-none",
30161
+ styles5.dropdownSurface,
30162
+ dropdownBackgroundClassName
30163
+ ),
30164
+ children: /* @__PURE__ */ jsxs(
30165
+ "div",
30166
+ {
30167
+ className: "grid w-full",
30168
+ style: fullBleed && panelMetrics ? {
30169
+ width: `${panelMetrics.width}px`,
30170
+ marginLeft: "auto",
30171
+ marginRight: "auto"
30172
+ } : void 0,
30173
+ children: [
30174
+ /* @__PURE__ */ jsx(
30175
+ FeaturedSectionLink,
30176
+ {
30177
+ href: section.href,
30178
+ title: section.title,
30179
+ variant,
30180
+ className: featuredLinkClassName
30181
+ }
30182
+ ),
30183
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 overflow-hidden px-4 pb-12 sm:grid-cols-2 lg:grid-cols-3", children: section.links.map((link, index) => /* @__PURE__ */ jsx(
30184
+ SectionLink,
30185
+ {
30186
+ link,
30187
+ variant,
30188
+ className: sectionLinkClassName,
30189
+ titleClassName: sectionLinkTitleClassName
30190
+ },
30191
+ `${link.title}-${link.href}-${index}`
30192
+ )) })
30193
+ ]
30194
+ }
30195
+ )
30121
30196
  }
30122
- ) })
30197
+ )
30123
30198
  }
30124
30199
  )
30125
30200
  ] });
@@ -30129,6 +30204,7 @@ function NavigationMenuMainNavigation({
30129
30204
  id: id3 = "nsw-main-navigation",
30130
30205
  variant = "white",
30131
30206
  borderPosition = "none",
30207
+ shadow = true,
30132
30208
  className,
30133
30209
  responsive = true,
30134
30210
  sticky = true,
@@ -30138,7 +30214,6 @@ function NavigationMenuMainNavigation({
30138
30214
  borderClassName,
30139
30215
  triggerClassName,
30140
30216
  triggerActiveClassName,
30141
- triggerActiveBorderClassName,
30142
30217
  featuredLinkClassName,
30143
30218
  sectionLinkClassName,
30144
30219
  sectionLinkTitleClassName,
@@ -30154,7 +30229,6 @@ function NavigationMenuMainNavigation({
30154
30229
  const hasTopBorder = resolvedBorderPosition === "top" || resolvedBorderPosition === "both";
30155
30230
  const hasBottomBorder = resolvedBorderPosition === "bottom" || resolvedBorderPosition === "both";
30156
30231
  const hasBorder = hasTopBorder || hasBottomBorder;
30157
- const syncBorderToSurface = hasBorder;
30158
30232
  const [panelMetrics, setPanelMetrics] = React5.useState({
30159
30233
  left: 0,
30160
30234
  width: 0,
@@ -30221,7 +30295,8 @@ function NavigationMenuMainNavigation({
30221
30295
  role: "navigation",
30222
30296
  id: id3,
30223
30297
  className: cn(
30224
- "z-40 shadow-md shadow-grey-900/5 dark:shadow-none",
30298
+ "z-40",
30299
+ shadow && "shadow-md shadow-slate-900/5 dark:shadow-none",
30225
30300
  navigationMenuMainNavigationVariantStyles[variant].surface,
30226
30301
  backgroundClassName,
30227
30302
  hasBorder && navigationMenuMainNavigationVariantStyles[variant].border,
@@ -30251,14 +30326,13 @@ function NavigationMenuMainNavigation({
30251
30326
  {
30252
30327
  section,
30253
30328
  variant,
30329
+ shadow,
30254
30330
  fullBleed,
30255
30331
  panelMetrics,
30256
30332
  onOpenIntent: cancelCloseTimer,
30257
30333
  dropdownBackgroundClassName,
30258
- syncBorderToSurface,
30259
30334
  triggerClassName,
30260
30335
  triggerActiveClassName,
30261
- triggerActiveBorderClassName,
30262
30336
  featuredLinkClassName,
30263
30337
  sectionLinkClassName,
30264
30338
  sectionLinkTitleClassName
@@ -31295,7 +31369,13 @@ function SidebarProvider({
31295
31369
  } else {
31296
31370
  _setOpen(openState);
31297
31371
  }
31298
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
31372
+ document.cookie = [
31373
+ `${SIDEBAR_COOKIE_NAME}=${encodeURIComponent(String(openState))}`,
31374
+ "path=/",
31375
+ `max-age=${SIDEBAR_COOKIE_MAX_AGE}`,
31376
+ "SameSite=Lax",
31377
+ "Secure"
31378
+ ].join("; ");
31299
31379
  },
31300
31380
  [setOpenProp, open]
31301
31381
  );