@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.cjs CHANGED
@@ -14407,9 +14407,20 @@ function CodeDemoContent({ data, showCode = true, controls = defaultControls })
14407
14407
  React5__namespace.default.useEffect(() => {
14408
14408
  const frame2 = iframeRef.current;
14409
14409
  if (!frame2) return;
14410
+ const getTargetOrigin = () => {
14411
+ const src = frame2.getAttribute("src");
14412
+ if (!src || src === "about:blank") {
14413
+ return window.location.origin;
14414
+ }
14415
+ try {
14416
+ return new URL(src, window.location.href).origin;
14417
+ } catch {
14418
+ return window.location.origin;
14419
+ }
14420
+ };
14410
14421
  const send = () => {
14411
14422
  const msg = { type: "nswds-theme", payload: themeValues };
14412
- frame2.contentWindow?.postMessage(msg, "*");
14423
+ frame2.contentWindow?.postMessage(msg, getTargetOrigin());
14413
14424
  };
14414
14425
  send();
14415
14426
  frame2.addEventListener("load", send);
@@ -18310,82 +18321,155 @@ var expandableSearchButtonVariants = classVarianceAuthority.cva("", {
18310
18321
  variant: "default"
18311
18322
  }
18312
18323
  });
18313
- var ExpandableSearchContext = React5__namespace.createContext(null);
18314
- var ExpandableSearch = React5__namespace.forwardRef(({ className, onAction, defaultValue = "", variant = "default", ...props }, ref) => {
18315
- const [value, setValue] = React5__namespace.useState(defaultValue);
18316
- const formRef = React5__namespace.useRef(null);
18317
- const resolvedVariant = variant ?? "default";
18318
- const handleAction = (e) => {
18319
- e.preventDefault();
18320
- if (onAction) {
18321
- onAction(value);
18324
+ var expandableSearchFocusVariants = classVarianceAuthority.cva("", {
18325
+ variants: {
18326
+ variant: {
18327
+ default: "focus-visible:ring-grey-100",
18328
+ "primary-800": "focus-visible:ring-primary-800",
18329
+ "primary-600": "focus-visible:ring-primary-600",
18330
+ "primary-400": "focus-visible:ring-primary-400",
18331
+ "primary-200": "focus-visible:ring-primary-200",
18332
+ "grey-800": "focus-visible:ring-grey-800",
18333
+ "grey-600": "focus-visible:ring-grey-600",
18334
+ "grey-400": "focus-visible:ring-grey-400",
18335
+ "grey-200": "focus-visible:ring-grey-200",
18336
+ "accent-800": "focus-visible:ring-accent-800",
18337
+ "accent-600": "focus-visible:ring-accent-600",
18338
+ "accent-400": "focus-visible:ring-accent-400",
18339
+ "accent-200": "focus-visible:ring-accent-200",
18340
+ white: "focus-visible:ring-white"
18322
18341
  }
18323
- };
18324
- return /* @__PURE__ */ jsxRuntime.jsx(
18325
- ExpandableSearchContext.Provider,
18326
- {
18327
- value: { value, setValue, formRef, variant: resolvedVariant },
18328
- children: /* @__PURE__ */ jsxRuntime.jsx(
18329
- "form",
18342
+ },
18343
+ defaultVariants: {
18344
+ variant: "default"
18345
+ }
18346
+ });
18347
+ var ExpandableSearchContext = React5__namespace.createContext(null);
18348
+ var ExpandableSearch = React5__namespace.forwardRef(
18349
+ ({
18350
+ className,
18351
+ onAction,
18352
+ defaultValue = "",
18353
+ onSubmit,
18354
+ onFocusCapture,
18355
+ onBlurCapture,
18356
+ variant = "default",
18357
+ ...props
18358
+ }, ref) => {
18359
+ const [value, setValue] = React5__namespace.useState(defaultValue);
18360
+ const [formHasFocusWithin, setFormHasFocusWithin] = React5__namespace.useState(false);
18361
+ const resolvedVariant = variant ?? "default";
18362
+ const handleSubmit = (e) => {
18363
+ onSubmit?.(e);
18364
+ if (e.defaultPrevented) {
18365
+ return;
18366
+ }
18367
+ e.preventDefault();
18368
+ onAction?.(value);
18369
+ };
18370
+ const handleFocusCapture = (e) => {
18371
+ setFormHasFocusWithin(true);
18372
+ onFocusCapture?.(e);
18373
+ };
18374
+ const handleBlurCapture = (e) => {
18375
+ const nextFocusedElement = e.relatedTarget;
18376
+ if (!e.currentTarget.contains(nextFocusedElement)) {
18377
+ setFormHasFocusWithin(false);
18378
+ }
18379
+ onBlurCapture?.(e);
18380
+ };
18381
+ return /* @__PURE__ */ jsxRuntime.jsx(
18382
+ ExpandableSearchContext.Provider,
18383
+ {
18384
+ value: { value, setValue, formHasFocusWithin, variant: resolvedVariant },
18385
+ children: /* @__PURE__ */ jsxRuntime.jsx(
18386
+ "form",
18387
+ {
18388
+ ref,
18389
+ className: cn("group relative inline-block select-none", className),
18390
+ onBlurCapture: handleBlurCapture,
18391
+ onFocusCapture: handleFocusCapture,
18392
+ onSubmit: handleSubmit,
18393
+ ...props
18394
+ }
18395
+ )
18396
+ }
18397
+ );
18398
+ }
18399
+ );
18400
+ ExpandableSearch.displayName = "ExpandableSearch";
18401
+ var ExpandableSearchField = React5__namespace.forwardRef(
18402
+ ({ className, id: id3, buttonLabel = "Search", buttonProps, ...props }, ref) => {
18403
+ const context = React5__namespace.useContext(ExpandableSearchContext);
18404
+ if (!context) throw new Error("ExpandableSearchField must be used within ExpandableSearch");
18405
+ const generatedId = React5__namespace.useId();
18406
+ const {
18407
+ className: buttonClassName,
18408
+ children: buttonChildren,
18409
+ "aria-label": buttonAriaLabel,
18410
+ ...restButtonProps
18411
+ } = buttonProps ?? {};
18412
+ const isActive = context.value.length > 0 || context.formHasFocusWithin;
18413
+ const variant = context.variant;
18414
+ const inputId = id3 ?? generatedId;
18415
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1", children: [
18416
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: inputId, children: "Search" }),
18417
+ /* @__PURE__ */ jsxRuntime.jsx(
18418
+ "input",
18330
18419
  {
18331
18420
  ref,
18332
- className: cn("relative inline-block select-none", className),
18333
- onSubmit: handleAction,
18421
+ id: inputId,
18422
+ value: context.value,
18423
+ onChange: (e) => context.setValue(e.target.value),
18424
+ className: cn(
18425
+ "align-center flex h-12 w-12 cursor-pointer overflow-hidden rounded-sm border-0 text-transparent",
18426
+ "ring-offset-white focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
18427
+ "transition-[width,box-shadow,background-color] duration-300 ease-in-out",
18428
+ "placeholder:text-transparent placeholder:opacity-0",
18429
+ "expandable-search__input",
18430
+ expandableSearchFocusVariants({ variant }),
18431
+ expandableSearchCollapsedVariants({ variant }),
18432
+ // Conditionally apply classes based on active state
18433
+ {
18434
+ "p-0": !isActive,
18435
+ "w-96 cursor-auto pt-0 pr-12 pb-0 pl-4 outline-none select-auto": isActive
18436
+ },
18437
+ isActive && expandableSearchSurfaceVariants({ variant }),
18438
+ isActive && (variant === "default" ? "placeholder:text-grey-700 placeholder:opacity-100" : "placeholder:text-current placeholder:opacity-70"),
18439
+ className
18440
+ ),
18334
18441
  ...props
18335
18442
  }
18443
+ ),
18444
+ /* @__PURE__ */ jsxRuntime.jsx(
18445
+ "button",
18446
+ {
18447
+ "aria-label": buttonAriaLabel ?? buttonLabel,
18448
+ type: "submit",
18449
+ className: cn(
18450
+ "absolute top-0 right-0 z-10 flex h-12 w-12 rounded-sm transition-[background-color,box-shadow] duration-200",
18451
+ "ring-offset-white focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
18452
+ expandableSearchButtonVariants({ variant }),
18453
+ expandableSearchFocusVariants({ variant }),
18454
+ {
18455
+ "pointer-events-none": !isActive,
18456
+ "pointer-events-auto": isActive
18457
+ },
18458
+ buttonClassName
18459
+ ),
18460
+ ...restButtonProps,
18461
+ children: buttonChildren ?? /* @__PURE__ */ jsxRuntime.jsx(
18462
+ Icons.search,
18463
+ {
18464
+ "aria-hidden": "true",
18465
+ className: "m-auto block h-8 w-8 shrink-0 fill-current leading-none"
18466
+ }
18467
+ )
18468
+ }
18336
18469
  )
18337
- }
18338
- );
18339
- });
18340
- ExpandableSearch.displayName = "ExpandableSearch";
18341
- var ExpandableSearchField = React5__namespace.forwardRef(({ className, ...props }, ref) => {
18342
- const context = React5__namespace.useContext(ExpandableSearchContext);
18343
- if (!context) throw new Error("ExpandableSearchField must be used within ExpandableSearch");
18344
- const [isFocused, setIsFocused] = React5__namespace.useState(false);
18345
- const isActive = context.value.length > 0 || isFocused;
18346
- const variant = context.variant;
18347
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1", children: [
18348
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: "expandable-search", children: "Search" }),
18349
- /* @__PURE__ */ jsxRuntime.jsx(
18350
- "input",
18351
- {
18352
- ref,
18353
- value: context.value,
18354
- onChange: (e) => context.setValue(e.target.value),
18355
- onFocus: () => setIsFocused(true),
18356
- onBlur: () => setIsFocused(false),
18357
- className: cn(
18358
- "peer align-center flex h-12 w-12 cursor-pointer overflow-hidden rounded-sm border-0 text-transparent",
18359
- "ring-offset-white focus-visible:ring-2 focus-visible:ring-primary-650/70 focus-visible:ring-offset-2 focus-visible:outline-none",
18360
- "transition-[width,box-shadow,background-color] duration-300 ease-in-out",
18361
- "placeholder:text-transparent placeholder:opacity-0",
18362
- "expandable-search__input",
18363
- expandableSearchCollapsedVariants({ variant }),
18364
- // Conditionally apply classes based on active state
18365
- {
18366
- "p-0": !isActive,
18367
- "w-96 cursor-auto pt-0 pr-12 pb-0 pl-4 outline-none select-auto": isActive
18368
- },
18369
- isActive && expandableSearchSurfaceVariants({ variant }),
18370
- isActive && (variant === "default" ? "placeholder:text-grey-700 placeholder:opacity-100" : "placeholder:text-current placeholder:opacity-70"),
18371
- className
18372
- ),
18373
- ...props
18374
- }
18375
- ),
18376
- /* @__PURE__ */ jsxRuntime.jsx(
18377
- "button",
18378
- {
18379
- type: "button",
18380
- className: cn(
18381
- "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",
18382
- expandableSearchButtonVariants({ variant })
18383
- ),
18384
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.search, { className: "m-auto block h-8 w-8 shrink-0 fill-current leading-none" })
18385
- }
18386
- )
18387
- ] });
18388
- });
18470
+ ] });
18471
+ }
18472
+ );
18389
18473
  ExpandableSearchField.displayName = "ExpandableSearchField";
18390
18474
  function Fieldset2({
18391
18475
  className,
@@ -18914,7 +18998,7 @@ function FormatToggle({ format, setFormat }) {
18914
18998
 
18915
18999
  // package.json
18916
19000
  var package_default = {
18917
- version: "1.117.0"};
19001
+ version: "1.119.0"};
18918
19002
  var SluggerContext = React5__namespace.default.createContext(null);
18919
19003
  function flattenText(nodes) {
18920
19004
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -29873,20 +29957,24 @@ function createVariantStyles({
29873
29957
  border,
29874
29958
  triggerTone,
29875
29959
  triggerActive,
29876
- triggerEdge,
29877
29960
  featuredLink,
29878
29961
  sectionLink
29879
29962
  }) {
29880
29963
  return {
29881
- surface,
29882
- border,
29883
- triggerTone,
29884
- triggerActive,
29885
- triggerEdge,
29886
- dropdownSurface: "bg-white",
29887
- featuredLink,
29888
- sectionLink,
29889
- sectionLinkTitle: "text-grey-900"
29964
+ surface: cn(surface, "dark:bg-grey-900 dark:text-white"),
29965
+ border: cn(border, "dark:border-grey-700"),
29966
+ triggerTone: cn(triggerTone, "dark:text-white"),
29967
+ triggerActive: cn(
29968
+ triggerActive,
29969
+ "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"
29970
+ ),
29971
+ dropdownSurface: "bg-white dark:bg-grey-900",
29972
+ featuredLink: cn(featuredLink, "dark:text-white dark:hover:bg-white/10"),
29973
+ sectionLink: cn(
29974
+ sectionLink,
29975
+ "dark:border-grey-700 dark:bg-grey-900 dark:hover:bg-white/10 dark:hover:text-white"
29976
+ ),
29977
+ sectionLinkTitle: "text-grey-900 dark:text-white"
29890
29978
  };
29891
29979
  }
29892
29980
  var navigationMenuMainNavigationVariantStyles = {
@@ -29895,7 +29983,6 @@ var navigationMenuMainNavigationVariantStyles = {
29895
29983
  border: "border-primary-700",
29896
29984
  triggerTone: "text-white",
29897
29985
  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",
29898
- 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",
29899
29986
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29900
29987
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29901
29988
  }),
@@ -29904,7 +29991,6 @@ var navigationMenuMainNavigationVariantStyles = {
29904
29991
  border: "border-primary-600",
29905
29992
  triggerTone: "text-white",
29906
29993
  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",
29907
- 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",
29908
29994
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29909
29995
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29910
29996
  }),
@@ -29913,7 +29999,6 @@ var navigationMenuMainNavigationVariantStyles = {
29913
29999
  border: "border-primary-200",
29914
30000
  triggerTone: "text-primary-800",
29915
30001
  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",
29916
- 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",
29917
30002
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29918
30003
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29919
30004
  }),
@@ -29922,7 +30007,6 @@ var navigationMenuMainNavigationVariantStyles = {
29922
30007
  border: "border-primary-200",
29923
30008
  triggerTone: "text-primary-800",
29924
30009
  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",
29925
- 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",
29926
30010
  featuredLink: "text-primary-800 hover:bg-primary-800/5",
29927
30011
  sectionLink: "border-grey-200 bg-white hover:bg-primary-800/5 hover:font-bold hover:text-primary-800"
29928
30012
  }),
@@ -29931,7 +30015,6 @@ var navigationMenuMainNavigationVariantStyles = {
29931
30015
  border: "border-grey-700",
29932
30016
  triggerTone: "text-white",
29933
30017
  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",
29934
- 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",
29935
30018
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29936
30019
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29937
30020
  }),
@@ -29940,7 +30023,6 @@ var navigationMenuMainNavigationVariantStyles = {
29940
30023
  border: "border-grey-600",
29941
30024
  triggerTone: "text-white",
29942
30025
  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",
29943
- 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",
29944
30026
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29945
30027
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29946
30028
  }),
@@ -29949,7 +30031,6 @@ var navigationMenuMainNavigationVariantStyles = {
29949
30031
  border: "border-grey-300",
29950
30032
  triggerTone: "text-grey-800",
29951
30033
  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",
29952
- 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",
29953
30034
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29954
30035
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29955
30036
  }),
@@ -29958,7 +30039,6 @@ var navigationMenuMainNavigationVariantStyles = {
29958
30039
  border: "border-grey-200",
29959
30040
  triggerTone: "text-grey-800",
29960
30041
  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",
29961
- 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",
29962
30042
  featuredLink: "text-grey-800 hover:bg-grey-800/5",
29963
30043
  sectionLink: "border-grey-200 bg-white hover:bg-grey-800/5 hover:font-bold hover:text-grey-800"
29964
30044
  }),
@@ -29967,7 +30047,6 @@ var navigationMenuMainNavigationVariantStyles = {
29967
30047
  border: "border-accent-600",
29968
30048
  triggerTone: "text-white",
29969
30049
  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",
29970
- 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",
29971
30050
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29972
30051
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29973
30052
  }),
@@ -29976,7 +30055,6 @@ var navigationMenuMainNavigationVariantStyles = {
29976
30055
  border: "border-accent-600",
29977
30056
  triggerTone: "text-white",
29978
30057
  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",
29979
- 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",
29980
30058
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29981
30059
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29982
30060
  }),
@@ -29985,7 +30063,6 @@ var navigationMenuMainNavigationVariantStyles = {
29985
30063
  border: "border-accent-200",
29986
30064
  triggerTone: "text-accent-800",
29987
30065
  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",
29988
- 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",
29989
30066
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29990
30067
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
29991
30068
  }),
@@ -29994,7 +30071,6 @@ var navigationMenuMainNavigationVariantStyles = {
29994
30071
  border: "border-accent-200",
29995
30072
  triggerTone: "text-accent-800",
29996
30073
  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",
29997
- 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",
29998
30074
  featuredLink: "text-accent-800 hover:bg-accent-800/5",
29999
30075
  sectionLink: "border-grey-200 bg-white hover:bg-accent-800/5 hover:font-bold hover:text-accent-800"
30000
30076
  }),
@@ -30003,7 +30079,6 @@ var navigationMenuMainNavigationVariantStyles = {
30003
30079
  border: "border-grey-200",
30004
30080
  triggerTone: "text-grey-800",
30005
30081
  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",
30006
- 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",
30007
30082
  featuredLink: "text-grey-800 hover:bg-grey-100",
30008
30083
  sectionLink: "border-grey-200 bg-white hover:bg-grey-50 hover:font-bold hover:text-grey-800"
30009
30084
  })
@@ -30013,10 +30088,8 @@ function TopLevelItem({
30013
30088
  href = "#",
30014
30089
  title,
30015
30090
  variant,
30016
- syncBorderToSurface,
30017
30091
  triggerClassName,
30018
- triggerActiveClassName,
30019
- triggerActiveBorderClassName
30092
+ triggerActiveClassName
30020
30093
  }) {
30021
30094
  const styles5 = navigationMenuMainNavigationVariantStyles[variant];
30022
30095
  return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuItem, { className: "shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -30028,10 +30101,7 @@ function TopLevelItem({
30028
30101
  styles5.triggerTone,
30029
30102
  styles5.triggerActive,
30030
30103
  triggerClassName,
30031
- triggerActiveClassName,
30032
- 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",
30033
- syncBorderToSurface && styles5.triggerEdge,
30034
- syncBorderToSurface && triggerActiveBorderClassName
30104
+ triggerActiveClassName
30035
30105
  ),
30036
30106
  children: /* @__PURE__ */ jsxRuntime.jsx(Link14__default.default, { href, children: title })
30037
30107
  }
@@ -30087,14 +30157,13 @@ function SectionLink({
30087
30157
  function MegaNavigationItem({
30088
30158
  section,
30089
30159
  variant,
30160
+ shadow,
30090
30161
  fullBleed,
30091
30162
  panelMetrics,
30092
30163
  onOpenIntent,
30093
30164
  dropdownBackgroundClassName,
30094
- syncBorderToSurface,
30095
30165
  triggerClassName,
30096
30166
  triggerActiveClassName,
30097
- triggerActiveBorderClassName,
30098
30167
  featuredLinkClassName,
30099
30168
  sectionLinkClassName,
30100
30169
  sectionLinkTitleClassName
@@ -30107,10 +30176,8 @@ function MegaNavigationItem({
30107
30176
  href: section.href,
30108
30177
  title: section.title,
30109
30178
  variant,
30110
- syncBorderToSurface,
30111
30179
  triggerClassName,
30112
- triggerActiveClassName,
30113
- triggerActiveBorderClassName
30180
+ triggerActiveClassName
30114
30181
  }
30115
30182
  );
30116
30183
  }
@@ -30124,10 +30191,7 @@ function MegaNavigationItem({
30124
30191
  styles5.triggerActive,
30125
30192
  triggerClassName,
30126
30193
  triggerActiveClassName,
30127
- "data-[state=open]:shadow-[inset_0_-4px_0_0_currentColor]",
30128
- 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",
30129
- syncBorderToSurface && styles5.triggerEdge,
30130
- syncBorderToSurface && triggerActiveBorderClassName
30194
+ "data-[state=open]:shadow-[inset_0_-4px_0_0_currentColor]"
30131
30195
  ),
30132
30196
  onPointerEnter: onOpenIntent,
30133
30197
  children: section.title
@@ -30137,45 +30201,56 @@ function MegaNavigationItem({
30137
30201
  NavigationMenuContent,
30138
30202
  {
30139
30203
  className: cn(
30140
- "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"
30204
+ "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"
30141
30205
  ),
30142
30206
  style: fullBleed && panelMetrics ? {
30143
30207
  left: `${-panelMetrics.left}px`,
30144
30208
  width: `${panelMetrics.viewportWidth}px`
30145
30209
  } : void 0,
30146
30210
  onPointerEnter: onOpenIntent,
30147
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full shadow", styles5.dropdownSurface, dropdownBackgroundClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(
30211
+ children: /* @__PURE__ */ jsxRuntime.jsx(
30148
30212
  "div",
30149
30213
  {
30150
- className: "grid w-full",
30151
- style: fullBleed && panelMetrics ? {
30152
- width: `${panelMetrics.width}px`,
30153
- marginLeft: "auto",
30154
- marginRight: "auto"
30155
- } : void 0,
30156
- children: [
30157
- /* @__PURE__ */ jsxRuntime.jsx(
30158
- FeaturedSectionLink,
30159
- {
30160
- href: section.href,
30161
- title: section.title,
30162
- variant,
30163
- className: featuredLinkClassName
30164
- }
30165
- ),
30166
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
30167
- SectionLink,
30168
- {
30169
- link,
30170
- variant,
30171
- className: sectionLinkClassName,
30172
- titleClassName: sectionLinkTitleClassName
30173
- },
30174
- `${link.title}-${link.href}-${index}`
30175
- )) })
30176
- ]
30214
+ className: cn(
30215
+ "relative z-10 w-full",
30216
+ shadow && "shadow-md shadow-slate-900/5 dark:shadow-none",
30217
+ styles5.dropdownSurface,
30218
+ dropdownBackgroundClassName
30219
+ ),
30220
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
30221
+ "div",
30222
+ {
30223
+ className: "grid w-full",
30224
+ style: fullBleed && panelMetrics ? {
30225
+ width: `${panelMetrics.width}px`,
30226
+ marginLeft: "auto",
30227
+ marginRight: "auto"
30228
+ } : void 0,
30229
+ children: [
30230
+ /* @__PURE__ */ jsxRuntime.jsx(
30231
+ FeaturedSectionLink,
30232
+ {
30233
+ href: section.href,
30234
+ title: section.title,
30235
+ variant,
30236
+ className: featuredLinkClassName
30237
+ }
30238
+ ),
30239
+ /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
30240
+ SectionLink,
30241
+ {
30242
+ link,
30243
+ variant,
30244
+ className: sectionLinkClassName,
30245
+ titleClassName: sectionLinkTitleClassName
30246
+ },
30247
+ `${link.title}-${link.href}-${index}`
30248
+ )) })
30249
+ ]
30250
+ }
30251
+ )
30177
30252
  }
30178
- ) })
30253
+ )
30179
30254
  }
30180
30255
  )
30181
30256
  ] });
@@ -30185,6 +30260,7 @@ function NavigationMenuMainNavigation({
30185
30260
  id: id3 = "nsw-main-navigation",
30186
30261
  variant = "white",
30187
30262
  borderPosition = "none",
30263
+ shadow = true,
30188
30264
  className,
30189
30265
  responsive = true,
30190
30266
  sticky = true,
@@ -30194,7 +30270,6 @@ function NavigationMenuMainNavigation({
30194
30270
  borderClassName,
30195
30271
  triggerClassName,
30196
30272
  triggerActiveClassName,
30197
- triggerActiveBorderClassName,
30198
30273
  featuredLinkClassName,
30199
30274
  sectionLinkClassName,
30200
30275
  sectionLinkTitleClassName,
@@ -30210,7 +30285,6 @@ function NavigationMenuMainNavigation({
30210
30285
  const hasTopBorder = resolvedBorderPosition === "top" || resolvedBorderPosition === "both";
30211
30286
  const hasBottomBorder = resolvedBorderPosition === "bottom" || resolvedBorderPosition === "both";
30212
30287
  const hasBorder = hasTopBorder || hasBottomBorder;
30213
- const syncBorderToSurface = hasBorder;
30214
30288
  const [panelMetrics, setPanelMetrics] = React5__namespace.useState({
30215
30289
  left: 0,
30216
30290
  width: 0,
@@ -30277,7 +30351,8 @@ function NavigationMenuMainNavigation({
30277
30351
  role: "navigation",
30278
30352
  id: id3,
30279
30353
  className: cn(
30280
- "z-40 shadow-md shadow-grey-900/5 dark:shadow-none",
30354
+ "z-40",
30355
+ shadow && "shadow-md shadow-slate-900/5 dark:shadow-none",
30281
30356
  navigationMenuMainNavigationVariantStyles[variant].surface,
30282
30357
  backgroundClassName,
30283
30358
  hasBorder && navigationMenuMainNavigationVariantStyles[variant].border,
@@ -30307,14 +30382,13 @@ function NavigationMenuMainNavigation({
30307
30382
  {
30308
30383
  section,
30309
30384
  variant,
30385
+ shadow,
30310
30386
  fullBleed,
30311
30387
  panelMetrics,
30312
30388
  onOpenIntent: cancelCloseTimer,
30313
30389
  dropdownBackgroundClassName,
30314
- syncBorderToSurface,
30315
30390
  triggerClassName,
30316
30391
  triggerActiveClassName,
30317
- triggerActiveBorderClassName,
30318
30392
  featuredLinkClassName,
30319
30393
  sectionLinkClassName,
30320
30394
  sectionLinkTitleClassName
@@ -31351,7 +31425,13 @@ function SidebarProvider({
31351
31425
  } else {
31352
31426
  _setOpen(openState);
31353
31427
  }
31354
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
31428
+ document.cookie = [
31429
+ `${SIDEBAR_COOKIE_NAME}=${encodeURIComponent(String(openState))}`,
31430
+ "path=/",
31431
+ `max-age=${SIDEBAR_COOKIE_MAX_AGE}`,
31432
+ "SameSite=Lax",
31433
+ "Secure"
31434
+ ].join("; ");
31355
31435
  },
31356
31436
  [setOpenProp, open]
31357
31437
  );