@vlrc-fe/components 1.0.6 → 1.0.8
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/Form/FormFileUpload/index.d.ts +1 -1
- package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -40
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +46 -80
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +22 -60
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1147 -43
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +30 -64
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -147
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +93 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +80 -25
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +9 -50
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +30 -156
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +350 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +11 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +55 -60
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +430 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +36 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +28 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +14 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +156 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +19 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +67 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +118 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +36 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +13 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +44 -121
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +31 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +37 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +123 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +44 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +43 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +14 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +23 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +34 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +27 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +30 -12
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +26 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +157 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +34 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +46 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +142 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +125 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +26 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +88 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +221 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +166 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +8 -12
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +126 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +15 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +17 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +22 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +18 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +6 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +7 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +8 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +7 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +12 -112
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +7 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +9 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +69 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +11 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +202 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +124 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +20 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +69 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +32 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -726
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +11 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +280 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +157 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +20 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +10 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +14 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +8 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +8 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +11 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +10 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +79 -339
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +6 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +8 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +8 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +10 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +11 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +15 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +11 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +11 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +6 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +43 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +19 -66
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +382 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +40 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +23 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +59 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +55 -0
- package/dist/index185.cjs +1 -0
- package/dist/index185.js +54 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +57 -0
- package/dist/index187.cjs +1 -0
- package/dist/index187.js +57 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +88 -0
- package/dist/index189.cjs +1 -0
- package/dist/index189.js +66 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +18 -8
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +594 -0
- package/dist/index191.cjs +9 -0
- package/dist/index191.js +30 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +50 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +65 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +48 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +67 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +151 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +23 -0
- package/dist/index198.cjs +1 -0
- package/dist/index198.js +27 -0
- package/dist/index199.cjs +1 -0
- package/dist/index199.js +53 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +51 -98
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +161 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +16 -0
- package/dist/index202.cjs +1 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +81 -28
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +64 -14
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +25 -22
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1014 -33
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +22 -96
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +108 -25
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +15 -9
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +20 -66
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +81 -11
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +91 -29
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +14 -41
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +93 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +22 -62
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +84 -22
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +85 -33
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +407 -25
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +170 -25
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +28 -154
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +158 -33
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +104 -45
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +337 -140
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +96 -124
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +319 -23
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +205 -81
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +33 -220
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +161 -163
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +20 -125
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -14
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +167 -7
- package/dist/index5.js +26 -14
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +44 -15
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +15 -18
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -17
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -4
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +24 -6
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +66 -4
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +14 -5
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -8
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +50 -67
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +85 -46
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +6 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -199
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +13 -122
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +9 -30
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +3 -20
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +24 -66
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +68 -30
- package/dist/index67.cjs +38 -1
- package/dist/index67.js +3 -11
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +12 -279
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -155
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +29 -85
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +115 -19
- package/dist/index71.cjs +4 -1
- package/dist/index71.js +6 -9
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +12 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +539 -6
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +197 -6
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +120 -9
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +912 -8
- package/dist/index77.cjs +3 -1
- package/dist/index77.js +76 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +120 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -6
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +35 -62
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +14 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +113 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +725 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +346 -9
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +74 -9
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +148 -4
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +31 -42
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +12 -380
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +345 -37
- package/dist/index89.cjs +20 -1
- package/dist/index89.js +40 -18
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +85 -17
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +113 -56
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +272 -51
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +129 -50
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +13 -54
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -55
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +525 -80
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +75 -61
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +67 -583
- package/dist/index98.cjs +1 -9
- package/dist/index98.js +32 -27
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -49
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/carousel.d.ts +20 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/context-menu.d.ts +26 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/drawer.d.ts +14 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/index.d.ts +23 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +12 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts +27 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/pagination.d.ts +14 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/resizable.d.ts +9 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sidebar.d.ts +70 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/toggle-group.d.ts +8 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle.d.ts +10 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/package.json +23 -5
package/dist/index95.js
CHANGED
|
@@ -1,88 +1,533 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContextScope as e } from "./index6.js";
|
|
3
|
+
import { useComposedRefs as t } from "./index7.js";
|
|
4
|
+
import { composeEventHandlers as n } from "./index8.js";
|
|
5
|
+
import { Primitive as r, dispatchDiscreteCustomEvent as i } from "./index12.js";
|
|
6
|
+
import { useCallbackRef as a } from "./index15.js";
|
|
7
|
+
import { useLayoutEffect2 as o } from "./index16.js";
|
|
8
|
+
import { useControllableState as s } from "./index29.js";
|
|
9
|
+
import { Presence as c } from "./index30.js";
|
|
10
|
+
import { useId as l } from "./index31.js";
|
|
11
|
+
import { createCollection as u } from "./index36.js";
|
|
12
|
+
import { DismissableLayer as d } from "./index37.js";
|
|
13
|
+
import { usePrevious as f } from "./index93.js";
|
|
14
|
+
import { Root as p } from "./index94.js";
|
|
15
|
+
import * as m from "react";
|
|
16
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
|
+
import * as v from "react-dom";
|
|
18
|
+
import { useDirection as y } from "@radix-ui/react-direction";
|
|
19
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-navigation-menu@1.2.22_@types+react-dom@19.2.3_@types+react@19.2.17__@t_2e370fc17262ac30682919648490a6de/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs
|
|
20
|
+
var b = Object.defineProperty, x = (e, t) => b(e, "name", {
|
|
21
|
+
value: t,
|
|
22
|
+
configurable: !0
|
|
23
|
+
}), S = "NavigationMenu", [C, w, T] = u(S), [E, D, O] = u(S), [k, A] = e(S, [T, O]), [j, M] = k(S), [ee, te] = k(S), ne = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, n) {
|
|
24
|
+
let { __scopeNavigationMenu: i, value: a, onValueChange: o, defaultValue: c, delayDuration: l = 200, skipDelayDuration: u = 300, orientation: d = "horizontal", dir: f, ...p } = e, [h, _] = m.useState(null), v = t(n, _), b = y(f), C = m.useRef(0), w = m.useRef(0), T = m.useRef(0), [E, D] = m.useState(!0), [O, k] = s({
|
|
25
|
+
prop: a,
|
|
26
|
+
onChange: /* @__PURE__ */ x((e) => {
|
|
27
|
+
let t = e !== "", n = u > 0;
|
|
28
|
+
t ? (window.clearTimeout(T.current), n && D(!1)) : (window.clearTimeout(T.current), T.current = window.setTimeout(() => D(!0), u)), o?.(e);
|
|
29
|
+
}, "onChange"),
|
|
30
|
+
defaultProp: c ?? "",
|
|
31
|
+
caller: S
|
|
32
|
+
}), A = m.useCallback(() => {
|
|
33
|
+
window.clearTimeout(w.current), w.current = window.setTimeout(() => k(""), 150);
|
|
34
|
+
}, [k]), j = m.useCallback((e) => {
|
|
35
|
+
window.clearTimeout(w.current), k(e);
|
|
36
|
+
}, [k]), M = m.useCallback((e) => {
|
|
37
|
+
O === e ? window.clearTimeout(w.current) : C.current = window.setTimeout(() => {
|
|
38
|
+
window.clearTimeout(w.current), k(e);
|
|
39
|
+
}, l);
|
|
40
|
+
}, [
|
|
41
|
+
O,
|
|
42
|
+
k,
|
|
43
|
+
l
|
|
44
|
+
]);
|
|
45
|
+
return m.useEffect(() => () => {
|
|
46
|
+
window.clearTimeout(C.current), window.clearTimeout(w.current), window.clearTimeout(T.current);
|
|
47
|
+
}, []), /* @__PURE__ */ g(re, {
|
|
48
|
+
scope: i,
|
|
49
|
+
isRootMenu: !0,
|
|
50
|
+
value: O,
|
|
51
|
+
dir: b,
|
|
52
|
+
orientation: d,
|
|
53
|
+
rootNavigationMenu: h,
|
|
54
|
+
onTriggerEnter: (e) => {
|
|
55
|
+
window.clearTimeout(C.current), E ? M(e) : j(e);
|
|
56
|
+
},
|
|
57
|
+
onTriggerLeave: () => {
|
|
58
|
+
window.clearTimeout(C.current), A();
|
|
59
|
+
},
|
|
60
|
+
onContentEnter: () => window.clearTimeout(w.current),
|
|
61
|
+
onContentLeave: A,
|
|
62
|
+
onItemSelect: (e) => {
|
|
63
|
+
k((t) => t === e ? "" : e);
|
|
64
|
+
},
|
|
65
|
+
onItemDismiss: () => k(""),
|
|
66
|
+
children: /* @__PURE__ */ g(r.nav, {
|
|
67
|
+
"aria-label": "Main",
|
|
68
|
+
"data-orientation": d,
|
|
69
|
+
dir: b,
|
|
70
|
+
...p,
|
|
71
|
+
ref: v
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}, "NavigationMenu")), re = /* @__PURE__ */ x((e) => {
|
|
75
|
+
let { scope: t, isRootMenu: n, rootNavigationMenu: r, dir: i, orientation: o, children: s, value: c, onItemSelect: u, onItemDismiss: d, onTriggerEnter: p, onTriggerLeave: h, onContentEnter: _, onContentLeave: v } = e, [y, b] = m.useState(null), [x, S] = m.useState(/* @__PURE__ */ new Map()), [w, T] = m.useState(null);
|
|
76
|
+
return /* @__PURE__ */ g(j, {
|
|
77
|
+
scope: t,
|
|
78
|
+
isRootMenu: n,
|
|
79
|
+
rootNavigationMenu: r,
|
|
80
|
+
value: c,
|
|
81
|
+
previousValue: f(c),
|
|
82
|
+
baseId: l(),
|
|
83
|
+
dir: i,
|
|
84
|
+
orientation: o,
|
|
85
|
+
viewport: y,
|
|
86
|
+
onViewportChange: b,
|
|
87
|
+
indicatorTrack: w,
|
|
88
|
+
onIndicatorTrackChange: T,
|
|
89
|
+
onTriggerEnter: a(p),
|
|
90
|
+
onTriggerLeave: a(h),
|
|
91
|
+
onContentEnter: a(_),
|
|
92
|
+
onContentLeave: a(v),
|
|
93
|
+
onItemSelect: a(u),
|
|
94
|
+
onItemDismiss: a(d),
|
|
95
|
+
onViewportContentChange: m.useCallback((e, t) => {
|
|
96
|
+
S((n) => (n.set(e, t), new Map(n)));
|
|
97
|
+
}, []),
|
|
98
|
+
onViewportContentRemove: m.useCallback((e) => {
|
|
99
|
+
S((t) => t.has(e) ? (t.delete(e), new Map(t)) : t);
|
|
100
|
+
}, []),
|
|
101
|
+
children: /* @__PURE__ */ g(C.Provider, {
|
|
102
|
+
scope: t,
|
|
103
|
+
children: /* @__PURE__ */ g(ee, {
|
|
104
|
+
scope: t,
|
|
105
|
+
items: x,
|
|
106
|
+
children: s
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}, "NavigationMenuProvider"), ie = "NavigationMenuList", ae = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
111
|
+
let { __scopeNavigationMenu: n, ...i } = e, a = M(ie, n), o = /* @__PURE__ */ g(r.ul, {
|
|
112
|
+
"data-orientation": a.orientation,
|
|
113
|
+
...i,
|
|
114
|
+
ref: t
|
|
115
|
+
});
|
|
116
|
+
return /* @__PURE__ */ g(r.div, {
|
|
117
|
+
style: { position: "relative" },
|
|
118
|
+
ref: a.onIndicatorTrackChange,
|
|
119
|
+
children: /* @__PURE__ */ g(C.Slot, {
|
|
120
|
+
scope: n,
|
|
121
|
+
children: a.isRootMenu ? /* @__PURE__ */ g(H, {
|
|
122
|
+
asChild: !0,
|
|
123
|
+
children: o
|
|
124
|
+
}) : o
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}, "NavigationMenuList")), [N, P] = k("NavigationMenuItem"), oe = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
128
|
+
let { __scopeNavigationMenu: n, value: i, ...a } = e, o = l(), s = i || o || "LEGACY_REACT_AUTO_VALUE", c = m.useRef(null), u = m.useRef(null), d = m.useRef(null), f = m.useRef(() => {}), p = m.useRef(!1), h = m.useCallback((e = "start") => {
|
|
129
|
+
if (c.current) {
|
|
130
|
+
f.current();
|
|
131
|
+
let t = G(c.current);
|
|
132
|
+
t.length && K(e === "start" ? t : t.reverse());
|
|
18
133
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
134
|
+
}, []), _ = m.useCallback(() => {
|
|
135
|
+
if (c.current) {
|
|
136
|
+
let e = G(c.current);
|
|
137
|
+
e.length && (f.current = q(e));
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
return /* @__PURE__ */ g(N, {
|
|
141
|
+
scope: n,
|
|
142
|
+
value: s,
|
|
143
|
+
triggerRef: u,
|
|
144
|
+
contentRef: c,
|
|
145
|
+
focusProxyRef: d,
|
|
146
|
+
wasEscapeCloseRef: p,
|
|
147
|
+
onEntryKeyDown: h,
|
|
148
|
+
onFocusProxyEnter: h,
|
|
149
|
+
onRootContentClose: _,
|
|
150
|
+
onContentFocusOutside: _,
|
|
151
|
+
children: /* @__PURE__ */ g(r.li, {
|
|
152
|
+
...a,
|
|
153
|
+
ref: t
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}, "NavigationMenuItem")), F = "NavigationMenuTrigger", se = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, i) {
|
|
157
|
+
let { __scopeNavigationMenu: a, disabled: o, ...s } = e, c = M(F, e.__scopeNavigationMenu), l = P(F, e.__scopeNavigationMenu), u = m.useRef(null), d = t(u, l.triggerRef, i), f = X(c.baseId, l.value), v = Z(c.baseId, l.value), y = m.useRef(!1), b = m.useRef(!1), x = l.value === c.value;
|
|
158
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(C.ItemSlot, {
|
|
159
|
+
scope: a,
|
|
160
|
+
value: l.value,
|
|
161
|
+
children: /* @__PURE__ */ g(W, {
|
|
28
162
|
asChild: !0,
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
disabled:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
163
|
+
children: /* @__PURE__ */ g(r.button, {
|
|
164
|
+
id: f,
|
|
165
|
+
disabled: o,
|
|
166
|
+
"data-disabled": o ? "" : void 0,
|
|
167
|
+
"data-state": Y(x),
|
|
168
|
+
"aria-expanded": x,
|
|
169
|
+
"aria-controls": x ? v : void 0,
|
|
170
|
+
...s,
|
|
171
|
+
ref: d,
|
|
172
|
+
onPointerEnter: n(e.onPointerEnter, () => {
|
|
173
|
+
b.current = !1, l.wasEscapeCloseRef.current = !1;
|
|
174
|
+
}),
|
|
175
|
+
onPointerMove: n(e.onPointerMove, Q(() => {
|
|
176
|
+
o || b.current || l.wasEscapeCloseRef.current || y.current || (c.onTriggerEnter(l.value), y.current = !0);
|
|
177
|
+
})),
|
|
178
|
+
onPointerLeave: n(e.onPointerLeave, Q(() => {
|
|
179
|
+
o || (c.onTriggerLeave(), y.current = !1);
|
|
180
|
+
})),
|
|
181
|
+
onClick: n(e.onClick, () => {
|
|
182
|
+
c.onItemSelect(l.value), b.current = x;
|
|
183
|
+
}),
|
|
184
|
+
onKeyDown: n(e.onKeyDown, (e) => {
|
|
185
|
+
let t = {
|
|
186
|
+
horizontal: "ArrowDown",
|
|
187
|
+
vertical: c.dir === "rtl" ? "ArrowLeft" : "ArrowRight"
|
|
188
|
+
}[c.orientation];
|
|
189
|
+
x && e.key === t && (l.onEntryKeyDown(), e.preventDefault());
|
|
190
|
+
})
|
|
44
191
|
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
192
|
+
})
|
|
193
|
+
}), x && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(p, {
|
|
194
|
+
"aria-hidden": !0,
|
|
195
|
+
tabIndex: 0,
|
|
196
|
+
ref: l.focusProxyRef,
|
|
197
|
+
onFocus: (e) => {
|
|
198
|
+
let t = l.contentRef.current, n = e.relatedTarget, r = n === u.current, i = t?.contains(n);
|
|
199
|
+
(r || !i) && l.onFocusProxyEnter(r ? "start" : "end");
|
|
200
|
+
}
|
|
201
|
+
}), c.viewport && /* @__PURE__ */ g("span", { "aria-owns": v })] })] });
|
|
202
|
+
}, "NavigationMenuTrigger")), I = "navigationMenu.linkSelect", ce = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
203
|
+
let { __scopeNavigationMenu: a, active: o, onSelect: s, ...c } = e;
|
|
204
|
+
return /* @__PURE__ */ g(W, {
|
|
205
|
+
asChild: !0,
|
|
206
|
+
children: /* @__PURE__ */ g(r.a, {
|
|
207
|
+
"data-active": o ? "" : void 0,
|
|
208
|
+
"aria-current": o ? "page" : void 0,
|
|
209
|
+
...c,
|
|
210
|
+
ref: t,
|
|
211
|
+
onClick: n(e.onClick, (e) => {
|
|
212
|
+
let t = e.target, n = new CustomEvent(I, {
|
|
213
|
+
bubbles: !0,
|
|
214
|
+
cancelable: !0
|
|
215
|
+
});
|
|
216
|
+
t.addEventListener(I, (e) => s?.(e), { once: !0 }), i(t, n), !n.defaultPrevented && !e.metaKey && i(t, new CustomEvent(z, {
|
|
217
|
+
bubbles: !0,
|
|
218
|
+
cancelable: !0
|
|
219
|
+
}));
|
|
220
|
+
}, { checkForDefaultPrevented: !1 })
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
}, "NavigationMenuLink")), L = "NavigationMenuIndicator", le = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
224
|
+
let { forceMount: n, ...r } = e, i = M(L, e.__scopeNavigationMenu), a = !!i.value;
|
|
225
|
+
return i.indicatorTrack ? v.createPortal(/* @__PURE__ */ g(c, {
|
|
226
|
+
present: n || a,
|
|
227
|
+
children: /* @__PURE__ */ g(ue, {
|
|
228
|
+
...r,
|
|
229
|
+
ref: t
|
|
230
|
+
})
|
|
231
|
+
}), i.indicatorTrack) : null;
|
|
232
|
+
}, "NavigationMenuIndicator")), ue = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
233
|
+
let { __scopeNavigationMenu: n, ...i } = e, a = M(L, n), o = w(n), [s, c] = m.useState(null), [l, u] = m.useState(null), d = a.orientation === "horizontal", f = !!a.value;
|
|
234
|
+
m.useEffect(() => {
|
|
235
|
+
let e = o().find((e) => e.value === a.value)?.ref.current;
|
|
236
|
+
e && c(e);
|
|
237
|
+
}, [o, a.value]);
|
|
238
|
+
let p = /* @__PURE__ */ x(() => {
|
|
239
|
+
s && u({
|
|
240
|
+
size: d ? s.offsetWidth : s.offsetHeight,
|
|
241
|
+
offset: d ? s.offsetLeft : s.offsetTop
|
|
242
|
+
});
|
|
243
|
+
}, "handlePositionChange");
|
|
244
|
+
return J(s, p), J(a.indicatorTrack, p), l ? /* @__PURE__ */ g(r.div, {
|
|
245
|
+
"aria-hidden": !0,
|
|
246
|
+
"data-state": f ? "visible" : "hidden",
|
|
247
|
+
"data-orientation": a.orientation,
|
|
248
|
+
...i,
|
|
249
|
+
ref: t,
|
|
250
|
+
style: {
|
|
251
|
+
position: "absolute",
|
|
252
|
+
...d ? {
|
|
253
|
+
left: 0,
|
|
254
|
+
width: l.size + "px",
|
|
255
|
+
transform: `translateX(${l.offset}px)`,
|
|
256
|
+
"--radix-navigation-menu-indicator-translate-x": `${l.offset}px`
|
|
257
|
+
} : {
|
|
258
|
+
top: 0,
|
|
259
|
+
height: l.size + "px",
|
|
260
|
+
transform: `translateY(${l.offset}px)`,
|
|
261
|
+
"--radix-navigation-menu-indicator-translate-y": `${l.offset}px`
|
|
262
|
+
},
|
|
263
|
+
...i.style
|
|
264
|
+
}
|
|
265
|
+
}) : null;
|
|
266
|
+
}, "NavigationMenuIndicatorImpl")), R = "NavigationMenuContent", de = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, r) {
|
|
267
|
+
let { forceMount: i, ...a } = e, o = M(R, e.__scopeNavigationMenu), s = P(R, e.__scopeNavigationMenu), l = t(s.contentRef, r), u = s.value === o.value, d = {
|
|
268
|
+
value: s.value,
|
|
269
|
+
triggerRef: s.triggerRef,
|
|
270
|
+
focusProxyRef: s.focusProxyRef,
|
|
271
|
+
wasEscapeCloseRef: s.wasEscapeCloseRef,
|
|
272
|
+
onContentFocusOutside: s.onContentFocusOutside,
|
|
273
|
+
onRootContentClose: s.onRootContentClose,
|
|
274
|
+
...a
|
|
275
|
+
};
|
|
276
|
+
return o.viewport ? /* @__PURE__ */ g(fe, {
|
|
277
|
+
forceMount: i,
|
|
278
|
+
...d,
|
|
279
|
+
ref: l
|
|
280
|
+
}) : /* @__PURE__ */ g(c, {
|
|
281
|
+
present: i || u,
|
|
282
|
+
children: /* @__PURE__ */ g(B, {
|
|
283
|
+
"data-state": Y(u),
|
|
284
|
+
...d,
|
|
285
|
+
ref: l,
|
|
286
|
+
onPointerEnter: n(e.onPointerEnter, o.onContentEnter),
|
|
287
|
+
onPointerLeave: n(e.onPointerLeave, Q(o.onContentLeave)),
|
|
288
|
+
style: {
|
|
289
|
+
pointerEvents: !u && o.isRootMenu ? "none" : void 0,
|
|
290
|
+
...d.style
|
|
291
|
+
}
|
|
292
|
+
})
|
|
293
|
+
});
|
|
294
|
+
}, "NavigationMenuContent")), fe = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
295
|
+
let { onViewportContentChange: n, onViewportContentRemove: r } = M(R, e.__scopeNavigationMenu);
|
|
296
|
+
return o(() => {
|
|
297
|
+
n(e.value, {
|
|
298
|
+
ref: t,
|
|
299
|
+
...e
|
|
300
|
+
});
|
|
301
|
+
}, [
|
|
302
|
+
e,
|
|
303
|
+
t,
|
|
304
|
+
n
|
|
305
|
+
]), o(() => () => r(e.value), [e.value, r]), null;
|
|
306
|
+
}, "ViewportContentMounter")), z = "navigationMenu.rootContentDismiss", B = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, r) {
|
|
307
|
+
let { __scopeNavigationMenu: i, value: a, triggerRef: o, focusProxyRef: s, wasEscapeCloseRef: c, onRootContentClose: l, onContentFocusOutside: u, ...f } = e, p = M(R, i), h = m.useRef(null), _ = t(h, r), v = X(p.baseId, a), y = Z(p.baseId, a), b = w(i), S = m.useRef(null), { onItemDismiss: C } = p;
|
|
308
|
+
return m.useEffect(() => {
|
|
309
|
+
let e = h.current;
|
|
310
|
+
if (p.isRootMenu && e) {
|
|
311
|
+
let t = /* @__PURE__ */ x(() => {
|
|
312
|
+
C(), l(), e.contains(document.activeElement) && o.current?.focus();
|
|
313
|
+
}, "handleClose");
|
|
314
|
+
return e.addEventListener(z, t), () => e.removeEventListener(z, t);
|
|
315
|
+
}
|
|
316
|
+
}, [
|
|
317
|
+
p.isRootMenu,
|
|
318
|
+
e.value,
|
|
319
|
+
o,
|
|
320
|
+
C,
|
|
321
|
+
l
|
|
322
|
+
]), /* @__PURE__ */ g(H, {
|
|
323
|
+
asChild: !0,
|
|
324
|
+
children: /* @__PURE__ */ g(d, {
|
|
325
|
+
id: y,
|
|
326
|
+
"aria-labelledby": v,
|
|
327
|
+
"data-motion": m.useMemo(() => {
|
|
328
|
+
let e = b().map((e) => e.value);
|
|
329
|
+
p.dir === "rtl" && e.reverse();
|
|
330
|
+
let t = e.indexOf(p.value), n = e.indexOf(p.previousValue), r = a === p.value, i = n === e.indexOf(a);
|
|
331
|
+
if (!r && !i) return S.current;
|
|
332
|
+
let o = (() => {
|
|
333
|
+
if (t !== n) {
|
|
334
|
+
if (r && n !== -1) return t > n ? "from-end" : "from-start";
|
|
335
|
+
if (i && t !== -1) return t > n ? "to-start" : "to-end";
|
|
76
336
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
337
|
+
return null;
|
|
338
|
+
})();
|
|
339
|
+
return S.current = o, o;
|
|
340
|
+
}, [
|
|
341
|
+
p.previousValue,
|
|
342
|
+
p.value,
|
|
343
|
+
p.dir,
|
|
344
|
+
b,
|
|
345
|
+
a
|
|
346
|
+
]),
|
|
347
|
+
"data-orientation": p.orientation,
|
|
348
|
+
...f,
|
|
349
|
+
ref: _,
|
|
350
|
+
disableOutsidePointerEvents: !1,
|
|
351
|
+
onDismiss: () => {
|
|
352
|
+
let e = new Event(z, {
|
|
353
|
+
bubbles: !0,
|
|
354
|
+
cancelable: !0
|
|
355
|
+
});
|
|
356
|
+
h.current?.dispatchEvent(e);
|
|
357
|
+
},
|
|
358
|
+
onFocusOutside: n(e.onFocusOutside, (e) => {
|
|
359
|
+
u();
|
|
360
|
+
let t = e.target;
|
|
361
|
+
p.rootNavigationMenu?.contains(t) && e.preventDefault();
|
|
362
|
+
}),
|
|
363
|
+
onPointerDownOutside: n(e.onPointerDownOutside, (e) => {
|
|
364
|
+
let t = e.target, n = b().some((e) => e.ref.current?.contains(t)), r = p.isRootMenu && p.viewport?.contains(t);
|
|
365
|
+
(n || r || !p.isRootMenu) && e.preventDefault();
|
|
366
|
+
}),
|
|
367
|
+
onKeyDown: n(e.onKeyDown, (e) => {
|
|
368
|
+
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
369
|
+
if (e.key === "Tab" && !t) {
|
|
370
|
+
let t = G(e.currentTarget), n = document.activeElement, r = t.findIndex((e) => e === n);
|
|
371
|
+
K(e.shiftKey ? t.slice(0, r).reverse() : t.slice(r + 1, t.length)) ? e.preventDefault() : s.current?.focus();
|
|
372
|
+
}
|
|
373
|
+
}),
|
|
374
|
+
onEscapeKeyDown: n(e.onEscapeKeyDown, (e) => {
|
|
375
|
+
c.current = !0;
|
|
83
376
|
})
|
|
84
|
-
})
|
|
377
|
+
})
|
|
378
|
+
});
|
|
379
|
+
}, "NavigationMenuContentImpl")), V = "NavigationMenuViewport", pe = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
380
|
+
let { forceMount: n, ...r } = e, i = !!M(V, e.__scopeNavigationMenu).value;
|
|
381
|
+
return /* @__PURE__ */ g(c, {
|
|
382
|
+
present: n || i,
|
|
383
|
+
children: /* @__PURE__ */ g(me, {
|
|
384
|
+
...r,
|
|
385
|
+
ref: t
|
|
386
|
+
})
|
|
387
|
+
});
|
|
388
|
+
}, "NavigationMenuViewport")), me = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, i) {
|
|
389
|
+
let { __scopeNavigationMenu: a, children: o, ...s } = e, l = M(V, a), u = t(i, l.onViewportChange), d = te(R, e.__scopeNavigationMenu), [f, p] = m.useState(null), [h, _] = m.useState(null), v = f ? f?.width + "px" : void 0, y = f ? f?.height + "px" : void 0, b = !!l.value, S = b ? l.value : l.previousValue;
|
|
390
|
+
return J(h, /* @__PURE__ */ x(() => {
|
|
391
|
+
h && p({
|
|
392
|
+
width: h.offsetWidth,
|
|
393
|
+
height: h.offsetHeight
|
|
394
|
+
});
|
|
395
|
+
}, "handleSizeChange")), /* @__PURE__ */ g(r.div, {
|
|
396
|
+
"data-state": Y(b),
|
|
397
|
+
"data-orientation": l.orientation,
|
|
398
|
+
...s,
|
|
399
|
+
ref: u,
|
|
400
|
+
style: {
|
|
401
|
+
pointerEvents: !b && l.isRootMenu ? "none" : void 0,
|
|
402
|
+
"--radix-navigation-menu-viewport-width": v,
|
|
403
|
+
"--radix-navigation-menu-viewport-height": y,
|
|
404
|
+
...s.style
|
|
405
|
+
},
|
|
406
|
+
onPointerEnter: n(e.onPointerEnter, l.onContentEnter),
|
|
407
|
+
onPointerLeave: n(e.onPointerLeave, Q(l.onContentLeave)),
|
|
408
|
+
children: Array.from(d.items).map(([e, { ref: t, forceMount: n, ...r }]) => {
|
|
409
|
+
let i = S === e;
|
|
410
|
+
return /* @__PURE__ */ g(c, {
|
|
411
|
+
present: n || i,
|
|
412
|
+
children: /* @__PURE__ */ g(he, {
|
|
413
|
+
...r,
|
|
414
|
+
contentRef: t,
|
|
415
|
+
isActive: i,
|
|
416
|
+
onActiveContentChange: _
|
|
417
|
+
})
|
|
418
|
+
}, e);
|
|
419
|
+
})
|
|
85
420
|
});
|
|
421
|
+
}, "NavigationMenuViewportImpl")), he = /* @__PURE__ */ x(({ contentRef: e, isActive: n, onActiveContentChange: r, ...i }) => {
|
|
422
|
+
let a = t(e, m.useCallback((e) => {
|
|
423
|
+
n && e && r(e);
|
|
424
|
+
}, [n, r]));
|
|
425
|
+
return /* @__PURE__ */ g(B, {
|
|
426
|
+
...i,
|
|
427
|
+
ref: a
|
|
428
|
+
});
|
|
429
|
+
}, "NavigationMenuViewportItem"), ge = "FocusGroup", H = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
430
|
+
let { __scopeNavigationMenu: n, ...i } = e, a = M(ge, n);
|
|
431
|
+
return /* @__PURE__ */ g(E.Provider, {
|
|
432
|
+
scope: n,
|
|
433
|
+
children: /* @__PURE__ */ g(E.Slot, {
|
|
434
|
+
scope: n,
|
|
435
|
+
children: /* @__PURE__ */ g(r.div, {
|
|
436
|
+
dir: a.dir,
|
|
437
|
+
...i,
|
|
438
|
+
ref: t
|
|
439
|
+
})
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
}, "FocusGroup")), U = [
|
|
443
|
+
"ArrowRight",
|
|
444
|
+
"ArrowLeft",
|
|
445
|
+
"ArrowUp",
|
|
446
|
+
"ArrowDown"
|
|
447
|
+
], _e = "FocusGroupItem", W = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ x(function(e, t) {
|
|
448
|
+
let { __scopeNavigationMenu: i, ...a } = e, o = D(i), s = M(_e, i);
|
|
449
|
+
return /* @__PURE__ */ g(E.ItemSlot, {
|
|
450
|
+
scope: i,
|
|
451
|
+
children: /* @__PURE__ */ g(r.button, {
|
|
452
|
+
...a,
|
|
453
|
+
ref: t,
|
|
454
|
+
onKeyDown: n(e.onKeyDown, (e) => {
|
|
455
|
+
if ([
|
|
456
|
+
"Home",
|
|
457
|
+
"End",
|
|
458
|
+
...U
|
|
459
|
+
].includes(e.key)) {
|
|
460
|
+
let t = o().map((e) => e.ref.current);
|
|
461
|
+
if ([
|
|
462
|
+
s.dir === "rtl" ? "ArrowRight" : "ArrowLeft",
|
|
463
|
+
"ArrowUp",
|
|
464
|
+
"End"
|
|
465
|
+
].includes(e.key) && t.reverse(), U.includes(e.key)) {
|
|
466
|
+
let n = t.indexOf(e.currentTarget);
|
|
467
|
+
t = t.slice(n + 1);
|
|
468
|
+
}
|
|
469
|
+
setTimeout(() => K(t)), e.preventDefault();
|
|
470
|
+
}
|
|
471
|
+
})
|
|
472
|
+
})
|
|
473
|
+
});
|
|
474
|
+
}, "FocusGroupItem"));
|
|
475
|
+
function G(e) {
|
|
476
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ x((e) => {
|
|
477
|
+
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
478
|
+
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
479
|
+
}, "acceptNode") });
|
|
480
|
+
for (; n.nextNode();) t.push(n.currentNode);
|
|
481
|
+
return t;
|
|
482
|
+
}
|
|
483
|
+
x(G, "getTabbableCandidates");
|
|
484
|
+
function K(e) {
|
|
485
|
+
let t = document.activeElement;
|
|
486
|
+
return e.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
487
|
+
}
|
|
488
|
+
x(K, "focusFirst");
|
|
489
|
+
function q(e) {
|
|
490
|
+
return e.forEach((e) => {
|
|
491
|
+
e.dataset.tabindex = e.getAttribute("tabindex") || "", e.setAttribute("tabindex", "-1");
|
|
492
|
+
}), () => {
|
|
493
|
+
e.forEach((e) => {
|
|
494
|
+
let t = e.dataset.tabindex;
|
|
495
|
+
e.setAttribute("tabindex", t);
|
|
496
|
+
});
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
x(q, "removeFromTabOrder");
|
|
500
|
+
function J(e, t) {
|
|
501
|
+
let n = a(t);
|
|
502
|
+
o(() => {
|
|
503
|
+
let t = 0;
|
|
504
|
+
if (e) {
|
|
505
|
+
let r = new ResizeObserver(() => {
|
|
506
|
+
cancelAnimationFrame(t), t = window.requestAnimationFrame(n);
|
|
507
|
+
});
|
|
508
|
+
return r.observe(e), () => {
|
|
509
|
+
window.cancelAnimationFrame(t), r.unobserve(e);
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
}, [e, n]);
|
|
513
|
+
}
|
|
514
|
+
x(J, "useResizeObserver");
|
|
515
|
+
function Y(e) {
|
|
516
|
+
return e ? "open" : "closed";
|
|
517
|
+
}
|
|
518
|
+
x(Y, "getOpenState");
|
|
519
|
+
function X(e, t) {
|
|
520
|
+
return `${e}-trigger-${t}`;
|
|
521
|
+
}
|
|
522
|
+
x(X, "makeTriggerId");
|
|
523
|
+
function Z(e, t) {
|
|
524
|
+
return `${e}-content-${t}`;
|
|
525
|
+
}
|
|
526
|
+
x(Z, "makeContentId");
|
|
527
|
+
function Q(e) {
|
|
528
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
86
529
|
}
|
|
530
|
+
x(Q, "whenMouse");
|
|
531
|
+
var ve = ne, ye = ae, $ = oe, be = se, xe = ce, Se = le, Ce = de, we = pe;
|
|
87
532
|
//#endregion
|
|
88
|
-
export {
|
|
533
|
+
export { Ce as Content, Se as Indicator, $ as Item, xe as Link, ye as List, ve as Root2, be as Trigger, we as Viewport };
|
package/dist/index96.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index7.cjs"),r=require("./index8.cjs"),i=require("./index22.cjs"),a=require("./index71.cjs"),o=require("./index92.cjs"),s=require("./index94.cjs"),c=require("./index95.cjs");let l=require("lucide-react"),u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime");function f({value:e,onChange:f,placeholder:p=`Select Date`,pickerType:m,dateFormat:h,showTime:g,size:_=`large`,status:v,width:y=`auto`,disabled:b,allowClear:x,hideValue:S,suffixIcon:C,className:w,disabledDate:T,disabledTime:E}){let[D,O]=u.default.useState(!1),k=o.buildTimeConfig(g,m),A=e?o.formatDateValue(e,h):``,j=t=>{if(!t){f(void 0),(m===`date`||!g)&&O(!1);return}let n=t;g&&e&&(n=new Date(t),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds())),f(n),m===`date`&&!g&&O(!1)},M=e=>{f(e)};return(0,d.jsxs)(i.Popover,{open:D,onOpenChange:O,children:[(0,d.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,d.jsxs)(n.Button,{variant:`outline`,disabled:b,className:t.cn(`justify-between font-normal`,o.getSizeClassName(_),o.getStatusClassName(v),!e&&`text-muted-foreground`,y===`auto`?`w-full`:``,w),style:y===`auto`?void 0:{width:y},children:[!S&&A?A:(0,d.jsx)(`span`,{children:p}),(0,d.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[x&&e&&(0,d.jsx)(`span`,{onClick:e=>{e.stopPropagation(),f(void 0)},className:`hover:text-destructive cursor-pointer`,children:`×`}),C||(m===`time`?(0,d.jsx)(l.Clock,{className:`h-4 w-4 opacity-50`}):(0,d.jsx)(l.CalendarIcon,{className:`h-4 w-4 opacity-50`}))]})]})}),(0,d.jsx)(i.PopoverContent,{className:`w-auto p-0`,align:`start`,children:m===`time`?(0,d.jsxs)(`div`,{className:`p-2`,children:[(0,d.jsx)(c.default,{value:e,onChange:M,timeConfig:k,disabledTime:o.buildDisabledTime(e,E)}),(0,d.jsx)(`div`,{className:`mt-2 pt-2 border-t`,children:(0,d.jsx)(s.default,{value:e,onChange:M,timeConfig:k})})]}):(0,d.jsxs)(`div`,{className:`flex`,children:[(0,d.jsx)(r.Calendar,{mode:`single`,selected:e,onSelect:j,disabled:T,captionLayout:`dropdown`,locale:a.default,month:e,hidden:{after:new Date(new Date().getFullYear()+50,11,31)},onMonthChange:e=>{m===`month`&&(f(e),O(!1))}}),g&&(0,d.jsx)(c.default,{value:e,onChange:M,timeConfig:k,disabledTime:o.buildDisabledTime(e,E)})]})})]})}exports.default=f;
|
|
1
|
+
"use client";const e=require("./index2.cjs"),t=require("./index7.cjs"),n=require("./index8.cjs"),r=require("./index9.cjs"),i=require("./index13.cjs"),a=require("./index16.cjs"),o=require("./index17.cjs"),s=require("./index30.cjs"),c=require("./index31.cjs"),l=require("./index32.cjs"),u=require("./index37.cjs"),d=require("./index38.cjs"),f=require("./index94.cjs"),p=require("./index95.cjs");let m=require("react");m=e.__toESM(m,1);let h=require("react/jsx-runtime"),g=require("react-dom");g=e.__toESM(g,1);let _=require("@radix-ui/react-direction");var v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0}),b=`NavigationMenu`,[x,S,C]=u.createCollection(b),[w,T,E]=u.createCollection(b),[D,O]=t.createContextScope(b,[C,E]),[k,A]=D(b),[j,M]=D(b),ee=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:r,value:a,onValueChange:o,defaultValue:c,delayDuration:l=200,skipDelayDuration:u=300,orientation:d=`horizontal`,dir:f,...p}=e,[g,v]=m.useState(null),x=n.useComposedRefs(t,v),S=(0,_.useDirection)(f),C=m.useRef(0),w=m.useRef(0),T=m.useRef(0),[E,D]=m.useState(!0),[O,k]=s.useControllableState({prop:a,onChange:y(e=>{let t=e!==``,n=u>0;t?(window.clearTimeout(T.current),n&&D(!1)):(window.clearTimeout(T.current),T.current=window.setTimeout(()=>D(!0),u)),o?.(e)},`onChange`),defaultProp:c??``,caller:b}),A=m.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>k(``),150)},[k]),j=m.useCallback(e=>{window.clearTimeout(w.current),k(e)},[k]),M=m.useCallback(e=>{O===e?window.clearTimeout(w.current):C.current=window.setTimeout(()=>{window.clearTimeout(w.current),k(e)},l)},[O,k,l]);return m.useEffect(()=>()=>{window.clearTimeout(C.current),window.clearTimeout(w.current),window.clearTimeout(T.current)},[]),(0,h.jsx)(te,{scope:r,isRootMenu:!0,value:O,dir:S,orientation:d,rootNavigationMenu:g,onTriggerEnter:e=>{window.clearTimeout(C.current),E?M(e):j(e)},onTriggerLeave:()=>{window.clearTimeout(C.current),A()},onContentEnter:()=>window.clearTimeout(w.current),onContentLeave:A,onItemSelect:e=>{k(t=>t===e?``:e)},onItemDismiss:()=>k(``),children:(0,h.jsx)(i.Primitive.nav,{"aria-label":`Main`,"data-orientation":d,dir:S,...p,ref:x})})},`NavigationMenu`)),te=y(e=>{let{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:s,value:c,onItemSelect:u,onItemDismiss:d,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:_,onContentLeave:v}=e,[y,b]=m.useState(null),[S,C]=m.useState(new Map),[w,T]=m.useState(null);return(0,h.jsx)(k,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:f.usePrevious(c),baseId:l.useId(),dir:i,orientation:o,viewport:y,onViewportChange:b,indicatorTrack:w,onIndicatorTrackChange:T,onTriggerEnter:a.useCallbackRef(p),onTriggerLeave:a.useCallbackRef(g),onContentEnter:a.useCallbackRef(_),onContentLeave:a.useCallbackRef(v),onItemSelect:a.useCallbackRef(u),onItemDismiss:a.useCallbackRef(d),onViewportContentChange:m.useCallback((e,t)=>{C(n=>(n.set(e,t),new Map(n)))},[]),onViewportContentRemove:m.useCallback(e=>{C(t=>t.has(e)?(t.delete(e),new Map(t)):t)},[]),children:(0,h.jsx)(x.Provider,{scope:t,children:(0,h.jsx)(j,{scope:t,items:S,children:s})})})},`NavigationMenuProvider`),ne=`NavigationMenuList`,re=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,...r}=e,a=A(ne,n),o=(0,h.jsx)(i.Primitive.ul,{"data-orientation":a.orientation,...r,ref:t});return(0,h.jsx)(i.Primitive.div,{style:{position:`relative`},ref:a.onIndicatorTrackChange,children:(0,h.jsx)(x.Slot,{scope:n,children:a.isRootMenu?(0,h.jsx)(U,{asChild:!0,children:o}):o})})},`NavigationMenuList`)),[ie,N]=D(`NavigationMenuItem`),P=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,value:r,...a}=e,o=l.useId(),s=r||o||`LEGACY_REACT_AUTO_VALUE`,c=m.useRef(null),u=m.useRef(null),d=m.useRef(null),f=m.useRef(()=>{}),p=m.useRef(!1),g=m.useCallback((e=`start`)=>{if(c.current){f.current();let t=K(c.current);t.length&&q(e===`start`?t:t.reverse())}},[]),_=m.useCallback(()=>{if(c.current){let e=K(c.current);e.length&&(f.current=J(e))}},[]);return(0,h.jsx)(ie,{scope:n,value:s,triggerRef:u,contentRef:c,focusProxyRef:d,wasEscapeCloseRef:p,onEntryKeyDown:g,onFocusProxyEnter:g,onRootContentClose:_,onContentFocusOutside:_,children:(0,h.jsx)(i.Primitive.li,{...a,ref:t})})},`NavigationMenuItem`)),F=`NavigationMenuTrigger`,I=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:a,disabled:o,...s}=e,c=A(F,e.__scopeNavigationMenu),l=N(F,e.__scopeNavigationMenu),u=m.useRef(null),d=n.useComposedRefs(u,l.triggerRef,t),f=Z(c.baseId,l.value),g=Q(c.baseId,l.value),_=m.useRef(!1),v=m.useRef(!1),y=l.value===c.value;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ItemSlot,{scope:a,value:l.value,children:(0,h.jsx)(G,{asChild:!0,children:(0,h.jsx)(i.Primitive.button,{id:f,disabled:o,"data-disabled":o?``:void 0,"data-state":X(y),"aria-expanded":y,"aria-controls":y?g:void 0,...s,ref:d,onPointerEnter:r.composeEventHandlers(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:r.composeEventHandlers(e.onPointerMove,$(()=>{o||v.current||l.wasEscapeCloseRef.current||_.current||(c.onTriggerEnter(l.value),_.current=!0)})),onPointerLeave:r.composeEventHandlers(e.onPointerLeave,$(()=>{o||(c.onTriggerLeave(),_.current=!1)})),onClick:r.composeEventHandlers(e.onClick,()=>{c.onItemSelect(l.value),v.current=y}),onKeyDown:r.composeEventHandlers(e.onKeyDown,e=>{let t={horizontal:`ArrowDown`,vertical:c.dir===`rtl`?`ArrowLeft`:`ArrowRight`}[c.orientation];y&&e.key===t&&(l.onEntryKeyDown(),e.preventDefault())})})})}),y&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p.Root,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:e=>{let t=l.contentRef.current,n=e.relatedTarget,r=n===u.current,i=t?.contains(n);(r||!i)&&l.onFocusProxyEnter(r?`start`:`end`)}}),c.viewport&&(0,h.jsx)(`span`,{"aria-owns":g})]})]})},`NavigationMenuTrigger`)),L=`navigationMenu.linkSelect`,ae=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,active:a,onSelect:o,...s}=e;return(0,h.jsx)(G,{asChild:!0,children:(0,h.jsx)(i.Primitive.a,{"data-active":a?``:void 0,"aria-current":a?`page`:void 0,...s,ref:t,onClick:r.composeEventHandlers(e.onClick,e=>{let t=e.target,n=new CustomEvent(L,{bubbles:!0,cancelable:!0});t.addEventListener(L,e=>o?.(e),{once:!0}),i.dispatchDiscreteCustomEvent(t,n),!n.defaultPrevented&&!e.metaKey&&i.dispatchDiscreteCustomEvent(t,new CustomEvent(B,{bubbles:!0,cancelable:!0}))},{checkForDefaultPrevented:!1})})})},`NavigationMenuLink`)),R=`NavigationMenuIndicator`,oe=m.forwardRef(y(function(e,t){let{forceMount:n,...r}=e,i=A(R,e.__scopeNavigationMenu),a=!!i.value;return i.indicatorTrack?g.createPortal((0,h.jsx)(c.Presence,{present:n||a,children:(0,h.jsx)(se,{...r,ref:t})}),i.indicatorTrack):null},`NavigationMenuIndicator`)),se=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,...r}=e,a=A(R,n),o=S(n),[s,c]=m.useState(null),[l,u]=m.useState(null),d=a.orientation===`horizontal`,f=!!a.value;m.useEffect(()=>{let e=o().find(e=>e.value===a.value)?.ref.current;e&&c(e)},[o,a.value]);let p=y(()=>{s&&u({size:d?s.offsetWidth:s.offsetHeight,offset:d?s.offsetLeft:s.offsetTop})},`handlePositionChange`);return Y(s,p),Y(a.indicatorTrack,p),l?(0,h.jsx)(i.Primitive.div,{"aria-hidden":!0,"data-state":f?`visible`:`hidden`,"data-orientation":a.orientation,...r,ref:t,style:{position:`absolute`,...d?{left:0,width:l.size+`px`,transform:`translateX(${l.offset}px)`,"--radix-navigation-menu-indicator-translate-x":`${l.offset}px`}:{top:0,height:l.size+`px`,transform:`translateY(${l.offset}px)`,"--radix-navigation-menu-indicator-translate-y":`${l.offset}px`},...r.style}}):null},`NavigationMenuIndicatorImpl`)),z=`NavigationMenuContent`,ce=m.forwardRef(y(function(e,t){let{forceMount:i,...a}=e,o=A(z,e.__scopeNavigationMenu),s=N(z,e.__scopeNavigationMenu),l=n.useComposedRefs(s.contentRef,t),u=s.value===o.value,d={value:s.value,triggerRef:s.triggerRef,focusProxyRef:s.focusProxyRef,wasEscapeCloseRef:s.wasEscapeCloseRef,onContentFocusOutside:s.onContentFocusOutside,onRootContentClose:s.onRootContentClose,...a};return o.viewport?(0,h.jsx)(le,{forceMount:i,...d,ref:l}):(0,h.jsx)(c.Presence,{present:i||u,children:(0,h.jsx)(V,{"data-state":X(u),...d,ref:l,onPointerEnter:r.composeEventHandlers(e.onPointerEnter,o.onContentEnter),onPointerLeave:r.composeEventHandlers(e.onPointerLeave,$(o.onContentLeave)),style:{pointerEvents:!u&&o.isRootMenu?`none`:void 0,...d.style}})})},`NavigationMenuContent`)),le=m.forwardRef(y(function(e,t){let{onViewportContentChange:n,onViewportContentRemove:r}=A(z,e.__scopeNavigationMenu);return o.useLayoutEffect2(()=>{n(e.value,{ref:t,...e})},[e,t,n]),o.useLayoutEffect2(()=>()=>r(e.value),[e.value,r]),null},`ViewportContentMounter`)),B=`navigationMenu.rootContentDismiss`,V=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:i,value:a,triggerRef:o,focusProxyRef:s,wasEscapeCloseRef:c,onRootContentClose:l,onContentFocusOutside:u,...f}=e,p=A(z,i),g=m.useRef(null),_=n.useComposedRefs(g,t),v=Z(p.baseId,a),b=Q(p.baseId,a),x=S(i),C=m.useRef(null),{onItemDismiss:w}=p;return m.useEffect(()=>{let e=g.current;if(p.isRootMenu&&e){let t=y(()=>{w(),l(),e.contains(document.activeElement)&&o.current?.focus()},`handleClose`);return e.addEventListener(B,t),()=>e.removeEventListener(B,t)}},[p.isRootMenu,e.value,o,w,l]),(0,h.jsx)(U,{asChild:!0,children:(0,h.jsx)(d.DismissableLayer,{id:b,"aria-labelledby":v,"data-motion":m.useMemo(()=>{let e=x().map(e=>e.value);p.dir===`rtl`&&e.reverse();let t=e.indexOf(p.value),n=e.indexOf(p.previousValue),r=a===p.value,i=n===e.indexOf(a);if(!r&&!i)return C.current;let o=(()=>{if(t!==n){if(r&&n!==-1)return t>n?`from-end`:`from-start`;if(i&&t!==-1)return t>n?`to-start`:`to-end`}return null})();return C.current=o,o},[p.previousValue,p.value,p.dir,x,a]),"data-orientation":p.orientation,...f,ref:_,disableOutsidePointerEvents:!1,onDismiss:()=>{let e=new Event(B,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(e)},onFocusOutside:r.composeEventHandlers(e.onFocusOutside,e=>{u();let t=e.target;p.rootNavigationMenu?.contains(t)&&e.preventDefault()}),onPointerDownOutside:r.composeEventHandlers(e.onPointerDownOutside,e=>{let t=e.target,n=x().some(e=>e.ref.current?.contains(t)),r=p.isRootMenu&&p.viewport?.contains(t);(n||r||!p.isRootMenu)&&e.preventDefault()}),onKeyDown:r.composeEventHandlers(e.onKeyDown,e=>{let t=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!t){let t=K(e.currentTarget),n=document.activeElement,r=t.findIndex(e=>e===n);q(e.shiftKey?t.slice(0,r).reverse():t.slice(r+1,t.length))?e.preventDefault():s.current?.focus()}}),onEscapeKeyDown:r.composeEventHandlers(e.onEscapeKeyDown,e=>{c.current=!0})})})},`NavigationMenuContentImpl`)),H=`NavigationMenuViewport`,ue=m.forwardRef(y(function(e,t){let{forceMount:n,...r}=e,i=!!A(H,e.__scopeNavigationMenu).value;return(0,h.jsx)(c.Presence,{present:n||i,children:(0,h.jsx)(de,{...r,ref:t})})},`NavigationMenuViewport`)),de=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:a,children:o,...s}=e,l=A(H,a),u=n.useComposedRefs(t,l.onViewportChange),d=M(z,e.__scopeNavigationMenu),[f,p]=m.useState(null),[g,_]=m.useState(null),v=f?f?.width+`px`:void 0,b=f?f?.height+`px`:void 0,x=!!l.value,S=x?l.value:l.previousValue;return Y(g,y(()=>{g&&p({width:g.offsetWidth,height:g.offsetHeight})},`handleSizeChange`)),(0,h.jsx)(i.Primitive.div,{"data-state":X(x),"data-orientation":l.orientation,...s,ref:u,style:{pointerEvents:!x&&l.isRootMenu?`none`:void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":b,...s.style},onPointerEnter:r.composeEventHandlers(e.onPointerEnter,l.onContentEnter),onPointerLeave:r.composeEventHandlers(e.onPointerLeave,$(l.onContentLeave)),children:Array.from(d.items).map(([e,{ref:t,forceMount:n,...r}])=>{let i=S===e;return(0,h.jsx)(c.Presence,{present:n||i,children:(0,h.jsx)(fe,{...r,contentRef:t,isActive:i,onActiveContentChange:_})},e)})})},`NavigationMenuViewportImpl`)),fe=y(({contentRef:e,isActive:t,onActiveContentChange:r,...i})=>{let a=n.useComposedRefs(e,m.useCallback(e=>{t&&e&&r(e)},[t,r]));return(0,h.jsx)(V,{...i,ref:a})},`NavigationMenuViewportItem`),pe=`FocusGroup`,U=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,...r}=e,a=A(pe,n);return(0,h.jsx)(w.Provider,{scope:n,children:(0,h.jsx)(w.Slot,{scope:n,children:(0,h.jsx)(i.Primitive.div,{dir:a.dir,...r,ref:t})})})},`FocusGroup`)),W=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`],me=`FocusGroupItem`,G=m.forwardRef(y(function(e,t){let{__scopeNavigationMenu:n,...a}=e,o=T(n),s=A(me,n);return(0,h.jsx)(w.ItemSlot,{scope:n,children:(0,h.jsx)(i.Primitive.button,{...a,ref:t,onKeyDown:r.composeEventHandlers(e.onKeyDown,e=>{if([`Home`,`End`,...W].includes(e.key)){let t=o().map(e=>e.ref.current);if([s.dir===`rtl`?`ArrowRight`:`ArrowLeft`,`ArrowUp`,`End`].includes(e.key)&&t.reverse(),W.includes(e.key)){let n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout(()=>q(t)),e.preventDefault()}})})})},`FocusGroupItem`));function K(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:y(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}y(K,`getTabbableCandidates`);function q(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}y(q,`focusFirst`);function J(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}y(J,`removeFromTabOrder`);function Y(e,t){let n=a.useCallbackRef(t);o.useLayoutEffect2(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}y(Y,`useResizeObserver`);function X(e){return e?`open`:`closed`}y(X,`getOpenState`);function Z(e,t){return`${e}-trigger-${t}`}y(Z,`makeTriggerId`);function Q(e,t){return`${e}-content-${t}`}y(Q,`makeContentId`);function $(e){return t=>t.pointerType===`mouse`?e(t):void 0}y($,`whenMouse`);var he=ee,ge=re,_e=P,ve=I,ye=ae,be=oe,xe=ce,Se=ue;exports.Content=xe,exports.Indicator=be,exports.Item=_e,exports.Link=ye,exports.List=ge,exports.Root2=he,exports.Trigger=ve,exports.Viewport=Se;
|