@nswds/app 1.58.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ var classVarianceAuthority = require('class-variance-authority');
8
8
  var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
9
9
  var Headless4 = require('@headlessui/react');
10
10
  var React4 = require('react');
11
- var Link11 = require('next/link');
11
+ var Link12 = require('next/link');
12
12
  var react = require('@remixicon/react');
13
13
  var RechartsPrimitive = require('recharts');
14
14
  var AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
@@ -86,7 +86,7 @@ var clsx12__default = /*#__PURE__*/_interopDefault(clsx12);
86
86
  var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
87
87
  var Headless4__namespace = /*#__PURE__*/_interopNamespace(Headless4);
88
88
  var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
89
- var Link11__default = /*#__PURE__*/_interopDefault(Link11);
89
+ var Link12__default = /*#__PURE__*/_interopDefault(Link12);
90
90
  var RechartsPrimitive__namespace = /*#__PURE__*/_interopNamespace(RechartsPrimitive);
91
91
  var AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespace(AspectRatioPrimitive);
92
92
  var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
@@ -397,7 +397,7 @@ function AlertDescription({ className, ...props }) {
397
397
  );
398
398
  }
399
399
  var Link = React4.forwardRef(function Link2(props, ref) {
400
- return /* @__PURE__ */ jsxRuntime.jsx(Headless4__namespace.DataInteractive, { children: /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { ...props, ref }) });
400
+ return /* @__PURE__ */ jsxRuntime.jsx(Headless4__namespace.DataInteractive, { children: /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { ...props, ref }) });
401
401
  });
402
402
  var styles = {
403
403
  base: [
@@ -3649,7 +3649,7 @@ function Breadcrumbs({
3649
3649
  const shouldCollapse = breadcrumbItems.length > maxItems;
3650
3650
  if (!shouldCollapse) {
3651
3651
  return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "-ml-1", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { children: breadcrumbItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React4__namespace.Fragment, { children: [
3652
- /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { href: item.path, children: item.label }) }) }),
3652
+ /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { href: item.path, children: item.label }) }) }),
3653
3653
  index < breadcrumbItems.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {})
3654
3654
  ] }, item.path)) }) });
3655
3655
  }
@@ -3660,7 +3660,7 @@ function Breadcrumbs({
3660
3660
  const collapsedItems = breadcrumbItems.slice(startItems, breadcrumbItems.length - endItems);
3661
3661
  return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsxs(BreadcrumbList, { children: [
3662
3662
  itemsAtStart.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React4__namespace.Fragment, { children: [
3663
- /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { href: item.path, children: item.label }) }) }),
3663
+ /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { href: item.path, children: item.label }) }) }),
3664
3664
  index < itemsAtStart.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {})
3665
3665
  ] }, item.path)),
3666
3666
  itemsAtStart.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
@@ -3669,11 +3669,11 @@ function Breadcrumbs({
3669
3669
  /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbEllipsis, { className: "h-4 w-4" }),
3670
3670
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle menu" })
3671
3671
  ] }),
3672
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align: "start", children: collapsedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { href: item.path, children: item.label }) }, item.path)) })
3672
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align: "start", children: collapsedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { href: item.path, children: item.label }) }, item.path)) })
3673
3673
  ] }) }),
3674
3674
  itemsAtEnd.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
3675
3675
  itemsAtEnd.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React4__namespace.Fragment, { children: [
3676
- /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { href: item.path, children: item.label }) }) }),
3676
+ /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { href: item.path, children: item.label }) }) }),
3677
3677
  index < itemsAtEnd.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {})
3678
3678
  ] }, item.path))
3679
3679
  ] }) });
@@ -11727,7 +11727,7 @@ function FooterLegalLinks({ legalLinks }) {
11727
11727
  "aria-label": "Footer",
11728
11728
  className: "flex flex-wrap justify-center gap-x-4 gap-y-3 py-4 text-sm lg:justify-start",
11729
11729
  children: legalLinks?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
11730
- Link11__default.default,
11730
+ Link12__default.default,
11731
11731
  {
11732
11732
  href: item.href,
11733
11733
  className: "-m-1 rounded p-1 text-grey-600 underline underline-offset-4 hover:bg-primary-800/10 hover:text-grey-600 hover:decoration-2",
@@ -12003,7 +12003,7 @@ function FormatToggle({ format, setFormat }) {
12003
12003
 
12004
12004
  // package.json
12005
12005
  var package_default = {
12006
- version: "1.57.0"};
12006
+ version: "1.58.0"};
12007
12007
  function Heading({
12008
12008
  className,
12009
12009
  trim = "normal",
@@ -12209,7 +12209,7 @@ function Header2({
12209
12209
  ),
12210
12210
  children: [
12211
12211
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex grow basis-0 items-center", children: [
12212
- /* @__PURE__ */ jsxRuntime.jsxs(Link11__default.default, { href: "/", "aria-label": "Home page", className: "flex items-center justify-between", children: [
12212
+ /* @__PURE__ */ jsxRuntime.jsxs(Link12__default.default, { href: "/", "aria-label": "Home page", className: "flex items-center justify-between", children: [
12213
12213
  /* @__PURE__ */ jsxRuntime.jsx(Logo, { className: "h-12 w-auto lg:h-14" }),
12214
12214
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 6, className: "ml-6", children: sitename })
12215
12215
  ] }),
@@ -13255,7 +13255,7 @@ function MainNavigation({ navigation }) {
13255
13255
  }
13256
13256
  function TopLevel({ title, href }) {
13257
13257
  return /* @__PURE__ */ jsxRuntime.jsx(
13258
- Link11__default.default,
13258
+ Link12__default.default,
13259
13259
  {
13260
13260
  href,
13261
13261
  className: cn(
@@ -13309,7 +13309,7 @@ function MegaMenu({ title, href, links }) {
13309
13309
  className: "absolute inset-x-0 top-0 -z-10 pt-14 shadow transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[enter]:ease-out data-[leave]:duration-150 data-[leave]:ease-in",
13310
13310
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto grid bg-white", children: [
13311
13311
  /* @__PURE__ */ jsxRuntime.jsxs(
13312
- Link11__default.default,
13312
+ Link12__default.default,
13313
13313
  {
13314
13314
  href,
13315
13315
  className: "group flex items-center px-8 py-8 text-xl font-bold text-primary-800 hover:bg-primary-800/10",
@@ -13332,7 +13332,7 @@ function MegaMenu({ title, href, links }) {
13332
13332
  "focus-within:rounded-sm focus-within:outline focus-within:outline-inherit"
13333
13333
  ),
13334
13334
  children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-grey-900", children: /* @__PURE__ */ jsxRuntime.jsxs(
13335
- Link11__default.default,
13335
+ Link12__default.default,
13336
13336
  {
13337
13337
  href: item.href,
13338
13338
  className: cn(
@@ -13717,24 +13717,14 @@ function MultiLevelPushMenu({
13717
13717
  const isCurrentLevel = index === navigationHistory.length - 1;
13718
13718
  let translateX = 0;
13719
13719
  if (animationState === "sliding-forward") {
13720
- if (isCurrentLevel) {
13721
- translateX = isAnimationStarted ? 0 : 100;
13722
- } else {
13723
- translateX = 0;
13724
- }
13720
+ translateX = isCurrentLevel ? isAnimationStarted ? 0 : 100 : 0;
13725
13721
  } else if (animationState === "sliding-backward") {
13726
- if (isCurrentLevel) {
13727
- translateX = 100;
13728
- } else {
13729
- translateX = 0;
13730
- }
13731
- } else {
13732
- translateX = 0;
13722
+ translateX = isCurrentLevel ? 100 : 0;
13733
13723
  }
13734
13724
  return /* @__PURE__ */ jsxRuntime.jsx(
13735
13725
  "div",
13736
13726
  {
13737
- className: `absolute inset-0 h-full w-full will-change-transform`,
13727
+ className: "absolute inset-0 h-full w-full will-change-transform",
13738
13728
  style: {
13739
13729
  transform: `translateX(${translateX}%)`,
13740
13730
  transition: animationState === "sliding-forward" && isAnimationStarted ? "transform 300ms ease-out" : animationState === "sliding-backward" ? "transform 300ms ease-out" : "none",
@@ -13763,11 +13753,22 @@ function MultiLevelPushMenu({
13763
13753
  "div",
13764
13754
  {
13765
13755
  className: "divide-y divide-grey-200 overflow-hidden bg-white ring-1 ring-grey-200",
13766
- children: /* @__PURE__ */ jsxRuntime.jsxs(
13756
+ children: item.href && !item.links?.length ? /* @__PURE__ */ jsxRuntime.jsx(
13757
+ Link12__default.default,
13758
+ {
13759
+ href: item.href,
13760
+ onClick: (e) => handleItemClick(item, e),
13761
+ className: clsx12__default.default(
13762
+ "relative flex w-full cursor-pointer items-center justify-between gap-x-6 border-l p-4 transition-colors hover:border-primary-800 hover:bg-primary-800/10",
13763
+ pathname === item.href ? "border-primary-800 bg-primary-800/10 font-semibold text-primary-800" : "border-transparent text-grey-800",
13764
+ isAnimating && "pointer-events-none"
13765
+ ),
13766
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.title }) }) })
13767
+ }
13768
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
13767
13769
  "button",
13768
13770
  {
13769
- ...item.href && !item.links?.length ? { href: item.href } : {},
13770
- onClick: (event) => handleItemClick(item, event),
13771
+ onClick: (e) => handleItemClick(item, e),
13771
13772
  disabled: isAnimating,
13772
13773
  className: clsx12__default.default(
13773
13774
  "relative flex w-full cursor-pointer items-center justify-between gap-x-6 border-l p-4 transition-colors hover:border-primary-800 hover:bg-primary-800/10",
@@ -13806,7 +13807,7 @@ function MultiLevelPushMenu({
13806
13807
  Array.from({ length: Math.min(level.depth, 10) }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
13807
13808
  "div",
13808
13809
  {
13809
- className: `h-1 w-2 rounded-full bg-primary-800 transition-colors duration-300`
13810
+ className: "h-1 w-2 rounded-full bg-primary-800 transition-colors duration-300"
13810
13811
  },
13811
13812
  i
13812
13813
  )),
@@ -13914,7 +13915,7 @@ function MobileHeader({
13914
13915
  /* @__PURE__ */ jsxRuntime.jsx(Icons.menu, { "aria-hidden": "true" })
13915
13916
  ] }),
13916
13917
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
13917
- Link11__default.default,
13918
+ Link12__default.default,
13918
13919
  {
13919
13920
  href: "/",
13920
13921
  "aria-label": "Home page",
@@ -21790,7 +21791,7 @@ function NavigationLink({
21790
21791
  }) {
21791
21792
  const pathname = navigation.usePathname();
21792
21793
  return /* @__PURE__ */ jsxRuntime.jsx(
21793
- Link11__default.default,
21794
+ Link12__default.default,
21794
21795
  {
21795
21796
  href,
21796
21797
  onClick,
@@ -21960,8 +21961,8 @@ function PageHeading({
21960
21961
  heading,
21961
21962
  children
21962
21963
  }) {
21963
- return /* @__PURE__ */ jsxRuntime.jsx("header", { className: "nsw:border-b nsw:border-grey-300 nsw:bg-white", children: /* @__PURE__ */ jsxRuntime.jsxs(Wrapper, { children: [
21964
- heading && /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 1, size: 2, className: "nsw:font-semibold", children: heading }),
21964
+ return /* @__PURE__ */ jsxRuntime.jsx("header", { className: "border-b border-grey-300 bg-white", children: /* @__PURE__ */ jsxRuntime.jsxs(Wrapper, { children: [
21965
+ heading && /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 1, size: 2, className: "font-semibold", children: heading }),
21965
21966
  children
21966
21967
  ] }) });
21967
21968
  }
@@ -22080,7 +22081,7 @@ function PrevNextLinksPageLink({
22080
22081
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, children: [
22081
22082
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "font-display text-sm font-medium text-slate-900 dark:text-white", children: dir === "next" ? "Next" : "Previous" }),
22082
22083
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "mt-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
22083
- Link11__default.default,
22084
+ Link12__default.default,
22084
22085
  {
22085
22086
  href,
22086
22087
  className: clsx12__default.default(
@@ -23208,7 +23209,7 @@ function SidebarLink({ link, pathname, onLinkClick, depth }) {
23208
23209
  },
23209
23210
  childLink.href
23210
23211
  )) }) })
23211
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(Link11__default.default, { href: link.href, onClick: onLinkClick, className: baseLinkClasses, children: link.title }) });
23212
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(Link12__default.default, { href: link.href, onClick: onLinkClick, className: baseLinkClasses, children: link.title }) });
23212
23213
  }
23213
23214
  function Slider({
23214
23215
  className,
@@ -23577,7 +23578,7 @@ var StepIndicator = React4__namespace.forwardRef(
23577
23578
  }
23578
23579
  ) : null,
23579
23580
  /* @__PURE__ */ jsxRuntime.jsxs(
23580
- Link11__default.default,
23581
+ Link12__default.default,
23581
23582
  {
23582
23583
  href: step.href,
23583
23584
  className: "group relative flex items-center",
@@ -23606,7 +23607,7 @@ var StepIndicator = React4__namespace.forwardRef(
23606
23607
  }
23607
23608
  ) : null,
23608
23609
  /* @__PURE__ */ jsxRuntime.jsxs(
23609
- Link11__default.default,
23610
+ Link12__default.default,
23610
23611
  {
23611
23612
  href: step.href,
23612
23613
  "aria-current": "step",
@@ -23630,7 +23631,7 @@ var StepIndicator = React4__namespace.forwardRef(
23630
23631
  }
23631
23632
  ) : null,
23632
23633
  /* @__PURE__ */ jsxRuntime.jsxs(
23633
- Link11__default.default,
23634
+ Link12__default.default,
23634
23635
  {
23635
23636
  href: step.href,
23636
23637
  className: "group relative flex items-center",
@@ -23653,7 +23654,7 @@ var StepIndicator = React4__namespace.forwardRef(
23653
23654
  }
23654
23655
  ) : null,
23655
23656
  /* @__PURE__ */ jsxRuntime.jsxs(
23656
- Link11__default.default,
23657
+ Link12__default.default,
23657
23658
  {
23658
23659
  href: step.href,
23659
23660
  className: "group relative flex items-center",
@@ -23676,7 +23677,7 @@ var StepIndicator = React4__namespace.forwardRef(
23676
23677
  }
23677
23678
  ) : null,
23678
23679
  /* @__PURE__ */ jsxRuntime.jsxs(
23679
- Link11__default.default,
23680
+ Link12__default.default,
23680
23681
  {
23681
23682
  href: step.href,
23682
23683
  className: "group relative flex items-center",
@@ -23699,7 +23700,7 @@ var StepIndicator = React4__namespace.forwardRef(
23699
23700
  }
23700
23701
  ) : null,
23701
23702
  /* @__PURE__ */ jsxRuntime.jsxs(
23702
- Link11__default.default,
23703
+ Link12__default.default,
23703
23704
  {
23704
23705
  href: step.href,
23705
23706
  className: "group relative flex items-center",
@@ -23722,7 +23723,7 @@ var StepIndicator = React4__namespace.forwardRef(
23722
23723
  }
23723
23724
  ) : null,
23724
23725
  /* @__PURE__ */ jsxRuntime.jsxs(
23725
- Link11__default.default,
23726
+ Link12__default.default,
23726
23727
  {
23727
23728
  href: step.href,
23728
23729
  className: "group relative flex items-center",
@@ -23745,7 +23746,7 @@ var StepIndicator = React4__namespace.forwardRef(
23745
23746
  }
23746
23747
  ) : null,
23747
23748
  /* @__PURE__ */ jsxRuntime.jsxs(
23748
- Link11__default.default,
23749
+ Link12__default.default,
23749
23750
  {
23750
23751
  href: step.href,
23751
23752
  className: "group relative flex items-center",
@@ -23768,7 +23769,7 @@ var StepIndicator = React4__namespace.forwardRef(
23768
23769
  }
23769
23770
  ) : null,
23770
23771
  /* @__PURE__ */ jsxRuntime.jsxs(
23771
- Link11__default.default,
23772
+ Link12__default.default,
23772
23773
  {
23773
23774
  href: step.href,
23774
23775
  className: "group relative flex items-center",
@@ -24035,7 +24036,7 @@ function TableOfContents({ tableOfContents }) {
24035
24036
  ),
24036
24037
  children: tableOfContents.map((section) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
24037
24038
  /* @__PURE__ */ jsxRuntime.jsx(
24038
- Link11__default.default,
24039
+ Link12__default.default,
24039
24040
  {
24040
24041
  href: `#${section.id}`,
24041
24042
  className: clsx12__default.default(
@@ -24047,7 +24048,7 @@ function TableOfContents({ tableOfContents }) {
24047
24048
  }
24048
24049
  ),
24049
24050
  section.children.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ol", { role: "list", className: "mt-3 flex flex-col gap-2", children: section.children.map((subSection) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
24050
- Link11__default.default,
24051
+ Link12__default.default,
24051
24052
  {
24052
24053
  href: `#${subSection.id}`,
24053
24054
  className: clsx12__default.default(
@@ -24063,6 +24064,151 @@ function TableOfContents({ tableOfContents }) {
24063
24064
  )
24064
24065
  ] }) });
24065
24066
  }
24067
+ function getSubtree(options, content) {
24068
+ const { asChild, children } = options;
24069
+ if (!asChild) return typeof content === "function" ? content(children) : content;
24070
+ const firstChild = React4__namespace.default.Children.only(children);
24071
+ return React4__namespace.default.cloneElement(firstChild, {
24072
+ ...firstChild.props,
24073
+ children: typeof content === "function" ? content(firstChild.props.children) : content
24074
+ });
24075
+ }
24076
+ var TabNavigationContext = React4.createContext({
24077
+ hoveredTab: null,
24078
+ setHoveredTab: () => {
24079
+ },
24080
+ activeTab: null,
24081
+ setActiveTab: () => {
24082
+ },
24083
+ tabRefs: /* @__PURE__ */ new Map(),
24084
+ registerTab: () => {
24085
+ }
24086
+ });
24087
+ var TabNavigation = React4__namespace.default.forwardRef(({ className, children, ...props }, forwardedRef) => {
24088
+ const [hoveredTab, setHoveredTab] = React4.useState(null);
24089
+ const [activeTab, setActiveTab] = React4.useState(null);
24090
+ const [tabRefs] = React4.useState(/* @__PURE__ */ new Map());
24091
+ const registerTab = (id3, element) => {
24092
+ tabRefs.set(id3, element);
24093
+ };
24094
+ return /* @__PURE__ */ jsxRuntime.jsx(
24095
+ TabNavigationContext.Provider,
24096
+ {
24097
+ value: {
24098
+ hoveredTab,
24099
+ setHoveredTab,
24100
+ activeTab,
24101
+ setActiveTab,
24102
+ tabRefs,
24103
+ registerTab
24104
+ },
24105
+ children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Root, { ref: forwardedRef, ...props, asChild: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
24106
+ NavigationMenuPrimitive__namespace.List,
24107
+ {
24108
+ className: cn(
24109
+ // base
24110
+ "relative flex cursor-pointer items-center justify-start border-b whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
24111
+ // border color
24112
+ "border-grey-200 dark:border-grey-800",
24113
+ className
24114
+ ),
24115
+ children: [
24116
+ hoveredTab && /* @__PURE__ */ jsxRuntime.jsx(
24117
+ motion.div,
24118
+ {
24119
+ layoutId: "hoverBackground",
24120
+ className: "absolute top-2 bottom-2 transform rounded-md border border-grey-100 bg-grey-150 transition-all duration-200 ease-out dark:border-grey-700 dark:bg-grey-800",
24121
+ transition: {
24122
+ type: "spring",
24123
+ stiffness: 500,
24124
+ damping: 30
24125
+ },
24126
+ style: {
24127
+ left: (tabRefs.get(hoveredTab)?.offsetLeft || 0) + 6,
24128
+ width: (tabRefs.get(hoveredTab)?.offsetWidth || 0) - 12
24129
+ }
24130
+ }
24131
+ ),
24132
+ children
24133
+ ]
24134
+ }
24135
+ ) })
24136
+ }
24137
+ );
24138
+ });
24139
+ TabNavigation.displayName = "TabNavigation";
24140
+ var TabNavigationLink = React4__namespace.default.forwardRef(({ asChild, disabled, className, children, tabId, ...props }, forwardedRef) => {
24141
+ const { setHoveredTab, activeTab, setActiveTab, registerTab } = React4.useContext(TabNavigationContext);
24142
+ const linkRef = React4__namespace.default.useRef(null);
24143
+ const id3 = tabId || "unique-id";
24144
+ React4__namespace.default.useEffect(() => {
24145
+ if (linkRef.current) {
24146
+ registerTab(id3, linkRef.current);
24147
+ }
24148
+ }, [id3, registerTab]);
24149
+ const handleMouseEnter = () => {
24150
+ if (!disabled) {
24151
+ setHoveredTab(id3);
24152
+ }
24153
+ };
24154
+ const handleMouseLeave = () => {
24155
+ setHoveredTab(null);
24156
+ };
24157
+ const handleClick = () => {
24158
+ if (!disabled) {
24159
+ setActiveTab(id3);
24160
+ }
24161
+ };
24162
+ const isActive = activeTab === id3;
24163
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Item, { className: "flex", "aria-disabled": disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
24164
+ NavigationMenuPrimitive__namespace.Link,
24165
+ {
24166
+ ref: React4__namespace.default.useMemo(() => {
24167
+ return (node) => {
24168
+ linkRef.current = node;
24169
+ if (typeof forwardedRef === "function") {
24170
+ forwardedRef(node);
24171
+ } else if (forwardedRef) {
24172
+ forwardedRef.current = node;
24173
+ }
24174
+ };
24175
+ }, [forwardedRef]),
24176
+ "aria-disabled": disabled,
24177
+ className: cn(
24178
+ "group relative flex shrink-0 items-center justify-center select-none",
24179
+ disabled ? "pointer-events-none" : ""
24180
+ ),
24181
+ onSelect: handleClick,
24182
+ onMouseEnter: handleMouseEnter,
24183
+ onMouseLeave: handleMouseLeave,
24184
+ asChild,
24185
+ "data-active": isActive ? "" : void 0,
24186
+ ...props,
24187
+ children: getSubtree({ asChild, children }, (children2) => /* @__PURE__ */ jsxRuntime.jsx(
24188
+ "span",
24189
+ {
24190
+ className: cn(
24191
+ // base
24192
+ "relative z-10 -mb-px flex items-center justify-center border-b-2 border-transparent p-4 text-sm font-medium whitespace-nowrap transition-all",
24193
+ // text color
24194
+ "text-grey-800 dark:text-grey-500",
24195
+ // hover
24196
+ "group-hover:text-grey-900 dark:group-hover:text-grey-400",
24197
+ // selected
24198
+ isActive && "border-primary-800 font-semibold text-primary-800",
24199
+ isActive && "dark:border-primary-600 dark:text-primary-600",
24200
+ // disabled
24201
+ disabled ? "pointer-events-none text-grey-300 dark:text-grey-700" : "",
24202
+ focusRing,
24203
+ className
24204
+ ),
24205
+ children: children2
24206
+ }
24207
+ ))
24208
+ }
24209
+ ) });
24210
+ });
24211
+ TabNavigationLink.displayName = "TabNavigationLink";
24066
24212
  var Tabs2 = (props) => {
24067
24213
  return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitives__namespace.Root, { "tremor-id": "tremor-raw", ...props });
24068
24214
  };
@@ -24947,6 +25093,8 @@ exports.Strong = Strong;
24947
25093
  exports.Switch = Switch2;
24948
25094
  exports.SwitchField = SwitchField;
24949
25095
  exports.SwitchGroup = SwitchGroup;
25096
+ exports.TabNavigation = TabNavigation;
25097
+ exports.TabNavigationLink = TabNavigationLink;
24950
25098
  exports.Table = Table;
24951
25099
  exports.TableBody = TableBody;
24952
25100
  exports.TableCaption = TableCaption;