@devalok/shilp-sutra 0.8.3 → 0.9.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.
Files changed (217) hide show
  1. package/dist/_chunks/avatar.js +50 -0
  2. package/dist/_chunks/button.js +95 -0
  3. package/dist/_chunks/card.js +40 -0
  4. package/dist/_chunks/checkbox.js +14 -0
  5. package/dist/_chunks/form.js +27 -0
  6. package/dist/_chunks/primitives.js +6965 -0
  7. package/dist/_chunks/sidebar.js +592 -0
  8. package/dist/_chunks/spinner.js +34 -0
  9. package/dist/_chunks/tiptap.js +15254 -0
  10. package/dist/_chunks/tooltip.js +13 -0
  11. package/dist/_chunks/tree-view.js +304 -0
  12. package/dist/_chunks/use-calendar.js +990 -0
  13. package/dist/_chunks/utils.js +15 -0
  14. package/dist/_chunks/vendor.js +5823 -0
  15. package/dist/composed/avatar-group.js +20 -20
  16. package/dist/composed/command-palette.js +1 -1
  17. package/dist/composed/confirm-dialog.js +5 -5
  18. package/dist/composed/content-card.d.ts +1 -1
  19. package/dist/composed/content-card.js +6 -6
  20. package/dist/composed/date-picker/index.js +13 -0
  21. package/dist/composed/empty-state.js +10 -10
  22. package/dist/composed/error-boundary.js +2 -2
  23. package/dist/composed/global-loading.js +4 -4
  24. package/dist/composed/index.js +45 -53
  25. package/dist/composed/loading-skeleton.js +2 -2
  26. package/dist/composed/member-picker.js +5 -5
  27. package/dist/composed/page-header.js +4 -4
  28. package/dist/composed/page-skeletons.js +1 -1
  29. package/dist/composed/priority-indicator.js +6 -6
  30. package/dist/composed/rich-text-editor.js +422 -209
  31. package/dist/composed/schedule-view.js +1 -1
  32. package/dist/composed/simple-tooltip.js +6 -6
  33. package/dist/composed/status-badge.d.ts +1 -1
  34. package/dist/composed/status-badge.js +2 -2
  35. package/dist/shell/bottom-navbar.js +1 -1
  36. package/dist/shell/notification-center.js +2 -2
  37. package/dist/shell/notification-preferences.js +32 -33
  38. package/dist/shell/sidebar.js +24 -24
  39. package/dist/shell/top-bar.js +22 -22
  40. package/dist/ui/accordion.js +17 -17
  41. package/dist/ui/alert-dialog.js +29 -29
  42. package/dist/ui/alert.d.ts +2 -2
  43. package/dist/ui/alert.js +65 -44
  44. package/dist/ui/aspect-ratio.js +1 -1
  45. package/dist/ui/autocomplete.js +11 -11
  46. package/dist/ui/avatar.d.ts +1 -1
  47. package/dist/ui/avatar.js +67 -25
  48. package/dist/ui/badge.d.ts +2 -2
  49. package/dist/ui/badge.js +115 -91
  50. package/dist/ui/banner.d.ts +1 -1
  51. package/dist/ui/banner.js +5 -5
  52. package/dist/ui/breadcrumb.js +14 -14
  53. package/dist/ui/button-group.js +30 -15
  54. package/dist/ui/button.d.ts +2 -2
  55. package/dist/ui/button.js +114 -71
  56. package/dist/ui/card.js +66 -22
  57. package/dist/ui/charts/index.js +1221 -18
  58. package/dist/ui/checkbox.js +25 -5
  59. package/dist/ui/chip.d.ts +4 -4
  60. package/dist/ui/chip.js +2 -2
  61. package/dist/ui/code.js +1 -1
  62. package/dist/ui/collapsible.js +5 -5
  63. package/dist/ui/color-input.js +11 -11
  64. package/dist/ui/combobox.js +12 -12
  65. package/dist/ui/container.js +4 -4
  66. package/dist/ui/context-menu.js +37 -37
  67. package/dist/ui/data-table-toolbar.js +18 -18
  68. package/dist/ui/data-table.js +2 -2
  69. package/dist/ui/dialog.js +33 -33
  70. package/dist/ui/dropdown-menu.js +60 -60
  71. package/dist/ui/file-upload.js +1 -1
  72. package/dist/ui/form.js +36 -15
  73. package/dist/ui/hover-card.js +7 -7
  74. package/dist/ui/icon-button.js +9 -9
  75. package/dist/ui/index.js +523 -325
  76. package/dist/ui/input-otp.d.ts +2 -2
  77. package/dist/ui/input-otp.js +14 -14
  78. package/dist/ui/input.js +56 -28
  79. package/dist/ui/label.js +18 -4
  80. package/dist/ui/lib/utils.js +4 -5
  81. package/dist/ui/link.js +9 -9
  82. package/dist/ui/menubar.js +81 -81
  83. package/dist/ui/navigation-menu.js +42 -42
  84. package/dist/ui/number-input.js +13 -13
  85. package/dist/ui/pagination.js +5 -5
  86. package/dist/ui/popover.js +9 -9
  87. package/dist/ui/progress.d.ts +1 -1
  88. package/dist/ui/progress.js +15 -15
  89. package/dist/ui/radio.js +10 -10
  90. package/dist/ui/search-input.js +5 -5
  91. package/dist/ui/segmented-control.js +91 -83
  92. package/dist/ui/select.js +52 -52
  93. package/dist/ui/separator.js +20 -5
  94. package/dist/ui/sheet.js +28 -28
  95. package/dist/ui/sidebar.js +36 -560
  96. package/dist/ui/skeleton.d.ts +1 -1
  97. package/dist/ui/skeleton.js +9 -9
  98. package/dist/ui/slider.js +11 -11
  99. package/dist/ui/spinner.js +37 -2
  100. package/dist/ui/stack.js +1 -1
  101. package/dist/ui/stat-card.js +1 -1
  102. package/dist/ui/stepper.js +15 -15
  103. package/dist/ui/switch.js +22 -3
  104. package/dist/ui/table.js +1 -1
  105. package/dist/ui/tabs.js +59 -32
  106. package/dist/ui/text.js +2 -2
  107. package/dist/ui/textarea.js +7 -7
  108. package/dist/ui/toast.d.ts +1 -1
  109. package/dist/ui/toast.js +28 -28
  110. package/dist/ui/toggle-group.js +11 -11
  111. package/dist/ui/toggle.js +9 -9
  112. package/dist/ui/tooltip.js +17 -6
  113. package/dist/ui/transitions.js +68 -58
  114. package/dist/ui/tree-view/index.js +7 -0
  115. package/dist/ui/visually-hidden.js +3 -3
  116. package/llms-full.txt +1 -1
  117. package/llms.txt +7 -0
  118. package/package.json +656 -701
  119. package/dist/_virtual/client.js +0 -5
  120. package/dist/_virtual/index.js +0 -5
  121. package/dist/_virtual/react-dom-client.development.js +0 -5
  122. package/dist/_virtual/react-dom-client.production.js +0 -5
  123. package/dist/_virtual/scheduler.development.js +0 -5
  124. package/dist/_virtual/scheduler.production.js +0 -5
  125. package/dist/composed/date-picker/calendar-grid.js +0 -194
  126. package/dist/composed/date-picker/date-picker.js +0 -124
  127. package/dist/composed/date-picker/date-range-picker.js +0 -167
  128. package/dist/composed/date-picker/date-time-picker.js +0 -193
  129. package/dist/composed/date-picker/month-picker.js +0 -53
  130. package/dist/composed/date-picker/presets.js +0 -84
  131. package/dist/composed/date-picker/time-picker.js +0 -181
  132. package/dist/composed/date-picker/use-calendar.js +0 -17
  133. package/dist/composed/date-picker/year-picker.js +0 -45
  134. package/dist/composed/extensions/emoji-suggestion.js +0 -119
  135. package/dist/composed/extensions/file-attachment.js +0 -55
  136. package/dist/composed/extensions/mention-suggestion.js +0 -79
  137. package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
  138. package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
  139. package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
  140. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
  141. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
  142. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
  143. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
  144. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
  145. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
  146. package/dist/primitives/_internal/number.js +0 -6
  147. package/dist/primitives/_internal/primitive.js +0 -9
  148. package/dist/primitives/_internal/react-arrow.js +0 -13
  149. package/dist/primitives/_internal/react-collection.js +0 -48
  150. package/dist/primitives/_internal/react-compose-refs.js +0 -29
  151. package/dist/primitives/_internal/react-context.js +0 -76
  152. package/dist/primitives/_internal/react-direction.js +0 -10
  153. package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
  154. package/dist/primitives/_internal/react-focus-guards.js +0 -17
  155. package/dist/primitives/_internal/react-focus-scope.js +0 -137
  156. package/dist/primitives/_internal/react-id.js +0 -14
  157. package/dist/primitives/_internal/react-popper.js +0 -137
  158. package/dist/primitives/_internal/react-portal.js +0 -16
  159. package/dist/primitives/_internal/react-presence.js +0 -71
  160. package/dist/primitives/_internal/react-primitive.js +0 -36
  161. package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
  162. package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
  163. package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
  164. package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
  165. package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
  166. package/dist/primitives/_internal/react-use-previous.js +0 -8
  167. package/dist/primitives/_internal/react-use-size.js +0 -27
  168. package/dist/primitives/react-accordion.js +0 -239
  169. package/dist/primitives/react-alert-dialog.js +0 -127
  170. package/dist/primitives/react-aspect-ratio.js +0 -43
  171. package/dist/primitives/react-avatar.js +0 -75
  172. package/dist/primitives/react-checkbox.js +0 -251
  173. package/dist/primitives/react-collapsible.js +0 -120
  174. package/dist/primitives/react-context-menu.js +0 -240
  175. package/dist/primitives/react-dialog.js +0 -262
  176. package/dist/primitives/react-dropdown-menu.js +0 -227
  177. package/dist/primitives/react-hover-card.js +0 -187
  178. package/dist/primitives/react-label.js +0 -20
  179. package/dist/primitives/react-menu.js +0 -652
  180. package/dist/primitives/react-menubar.js +0 -355
  181. package/dist/primitives/react-navigation-menu.js +0 -607
  182. package/dist/primitives/react-popover.js +0 -243
  183. package/dist/primitives/react-progress.js +0 -84
  184. package/dist/primitives/react-radio-group.js +0 -238
  185. package/dist/primitives/react-roving-focus.js +0 -183
  186. package/dist/primitives/react-select.js +0 -862
  187. package/dist/primitives/react-separator.js +0 -24
  188. package/dist/primitives/react-slider.js +0 -437
  189. package/dist/primitives/react-slot.js +0 -70
  190. package/dist/primitives/react-switch.js +0 -132
  191. package/dist/primitives/react-tabs.js +0 -163
  192. package/dist/primitives/react-toast.js +0 -446
  193. package/dist/primitives/react-toggle-group.js +0 -137
  194. package/dist/primitives/react-toggle.js +0 -33
  195. package/dist/primitives/react-tooltip.js +0 -338
  196. package/dist/primitives/react-visually-hidden.js +0 -32
  197. package/dist/ui/charts/_internal/animation.js +0 -18
  198. package/dist/ui/charts/_internal/axes.js +0 -42
  199. package/dist/ui/charts/_internal/colors.js +0 -21
  200. package/dist/ui/charts/_internal/grid-lines.js +0 -43
  201. package/dist/ui/charts/_internal/legend.js +0 -29
  202. package/dist/ui/charts/_internal/tooltip.js +0 -39
  203. package/dist/ui/charts/_internal/types.js +0 -10
  204. package/dist/ui/charts/area-chart.js +0 -245
  205. package/dist/ui/charts/bar-chart.js +0 -153
  206. package/dist/ui/charts/chart-container.js +0 -27
  207. package/dist/ui/charts/gauge-chart.js +0 -72
  208. package/dist/ui/charts/line-chart.js +0 -163
  209. package/dist/ui/charts/pie-chart.js +0 -132
  210. package/dist/ui/charts/radar-chart.js +0 -223
  211. package/dist/ui/charts/sparkline.js +0 -124
  212. package/dist/ui/lib/motion.js +0 -32
  213. package/dist/ui/lib/use-reduced-motion.js +0 -15
  214. package/dist/ui/lib/use-ripple.js +0 -14
  215. package/dist/ui/tree-view/tree-item.js +0 -139
  216. package/dist/ui/tree-view/tree-view.js +0 -140
  217. package/dist/ui/tree-view/use-tree.js +0 -38
@@ -1,607 +0,0 @@
1
- import * as a from "react";
2
- import Ie from "react-dom";
3
- import { createContextScope as ye } from "./_internal/react-context.js";
4
- import { composeEventHandlers as I } from "./_internal/primitive.js";
5
- import { Primitive as _, dispatchDiscreteCustomEvent as Q } from "./_internal/react-primitive.js";
6
- import { useControllableState as oe } from "./_internal/react-use-controllable-state.js";
7
- import { useComposedRefs as k, composeRefs as be } from "./_internal/react-compose-refs.js";
8
- import { useDirection as _e } from "./_internal/react-direction.js";
9
- import { Presence as K } from "./_internal/react-presence.js";
10
- import { useId as re } from "./_internal/react-id.js";
11
- import { createCollection as ie } from "./_internal/react-collection.js";
12
- import { DismissableLayer as Pe } from "./_internal/react-dismissable-layer.js";
13
- import { usePrevious as xe } from "./_internal/react-use-previous.js";
14
- import { useLayoutEffect as G } from "./_internal/react-use-layout-effect.js";
15
- import { useCallbackRef as S } from "./_internal/react-use-callback-ref.js";
16
- import { Root as De } from "./react-visually-hidden.js";
17
- import { jsx as l, jsxs as Z, Fragment as ee } from "react/jsx-runtime";
18
- var A = "NavigationMenu", [$, ae, Se] = ie(A), [z, Ae, Oe] = ie(A), [Y] = ye(
19
- A,
20
- [Se, Oe]
21
- ), [ke, b] = Y(A), [Fe, Le] = Y(A), se = a.forwardRef(
22
- (e, t) => {
23
- const {
24
- __scopeNavigationMenu: r,
25
- value: i,
26
- onValueChange: n,
27
- defaultValue: o,
28
- delayDuration: s = 200,
29
- skipDelayDuration: d = 300,
30
- orientation: c = "horizontal",
31
- dir: R,
32
- ...u
33
- } = e, [g, h] = a.useState(null), E = k(t, (w) => h(w)), C = _e(R), p = a.useRef(0), M = a.useRef(0), T = a.useRef(0), [P, f] = a.useState(!0), [m, v] = oe({
34
- prop: i,
35
- onChange: (w) => {
36
- const D = w !== "", V = d > 0;
37
- D ? (window.clearTimeout(T.current), V && f(!1)) : (window.clearTimeout(T.current), T.current = window.setTimeout(
38
- () => f(!0),
39
- d
40
- )), n == null || n(w);
41
- },
42
- defaultProp: o ?? "",
43
- caller: A
44
- }), N = a.useCallback(() => {
45
- window.clearTimeout(M.current), M.current = window.setTimeout(() => v(""), 150);
46
- }, [v]), y = a.useCallback(
47
- (w) => {
48
- window.clearTimeout(M.current), v(w);
49
- },
50
- [v]
51
- ), x = a.useCallback(
52
- (w) => {
53
- m === w ? window.clearTimeout(M.current) : p.current = window.setTimeout(() => {
54
- window.clearTimeout(M.current), v(w);
55
- }, s);
56
- },
57
- [m, v, s]
58
- );
59
- return a.useEffect(() => () => {
60
- window.clearTimeout(p.current), window.clearTimeout(M.current), window.clearTimeout(T.current);
61
- }, []), /* @__PURE__ */ l(
62
- ce,
63
- {
64
- scope: r,
65
- isRootMenu: !0,
66
- value: m,
67
- dir: C,
68
- orientation: c,
69
- rootNavigationMenu: g,
70
- onTriggerEnter: (w) => {
71
- window.clearTimeout(p.current), P ? x(w) : y(w);
72
- },
73
- onTriggerLeave: () => {
74
- window.clearTimeout(p.current), N();
75
- },
76
- onContentEnter: () => window.clearTimeout(M.current),
77
- onContentLeave: N,
78
- onItemSelect: (w) => {
79
- v((D) => D === w ? "" : w);
80
- },
81
- onItemDismiss: () => v(""),
82
- children: /* @__PURE__ */ l(
83
- _.nav,
84
- {
85
- "aria-label": "Main",
86
- "data-orientation": c,
87
- dir: C,
88
- ...u,
89
- ref: E
90
- }
91
- )
92
- }
93
- );
94
- }
95
- );
96
- se.displayName = A;
97
- var U = "NavigationMenuSub", Ke = a.forwardRef(
98
- (e, t) => {
99
- const {
100
- __scopeNavigationMenu: r,
101
- value: i,
102
- onValueChange: n,
103
- defaultValue: o,
104
- orientation: s = "horizontal",
105
- ...d
106
- } = e, c = b(U, r), [R, u] = oe({
107
- prop: i,
108
- onChange: n,
109
- defaultProp: o ?? "",
110
- caller: U
111
- });
112
- return /* @__PURE__ */ l(
113
- ce,
114
- {
115
- scope: r,
116
- isRootMenu: !1,
117
- value: R,
118
- dir: c.dir,
119
- orientation: s,
120
- rootNavigationMenu: c.rootNavigationMenu,
121
- onTriggerEnter: (g) => u(g),
122
- onItemSelect: (g) => u(g),
123
- onItemDismiss: () => u(""),
124
- children: /* @__PURE__ */ l(_.div, { "data-orientation": s, ...d, ref: t })
125
- }
126
- );
127
- }
128
- );
129
- Ke.displayName = U;
130
- var ce = (e) => {
131
- const {
132
- scope: t,
133
- isRootMenu: r,
134
- rootNavigationMenu: i,
135
- dir: n,
136
- orientation: o,
137
- children: s,
138
- value: d,
139
- onItemSelect: c,
140
- onItemDismiss: R,
141
- onTriggerEnter: u,
142
- onTriggerLeave: g,
143
- onContentEnter: h,
144
- onContentLeave: E
145
- } = e, [C, p] = a.useState(null), [M, T] = a.useState(/* @__PURE__ */ new Map()), [P, f] = a.useState(null);
146
- return /* @__PURE__ */ l(
147
- ke,
148
- {
149
- scope: t,
150
- isRootMenu: r,
151
- rootNavigationMenu: i,
152
- value: d,
153
- previousValue: xe(d),
154
- baseId: re(),
155
- dir: n,
156
- orientation: o,
157
- viewport: C,
158
- onViewportChange: p,
159
- indicatorTrack: P,
160
- onIndicatorTrackChange: f,
161
- onTriggerEnter: S(u),
162
- onTriggerLeave: S(g),
163
- onContentEnter: S(h),
164
- onContentLeave: S(E),
165
- onItemSelect: S(c),
166
- onItemDismiss: S(R),
167
- onViewportContentChange: a.useCallback((m, v) => {
168
- T((N) => (N.set(m, v), new Map(N)));
169
- }, []),
170
- onViewportContentRemove: a.useCallback((m) => {
171
- T((v) => v.has(m) ? (v.delete(m), new Map(v)) : v);
172
- }, []),
173
- children: /* @__PURE__ */ l($.Provider, { scope: t, children: /* @__PURE__ */ l(Fe, { scope: t, items: M, children: s }) })
174
- }
175
- );
176
- }, ue = "NavigationMenuList", le = a.forwardRef(
177
- (e, t) => {
178
- const { __scopeNavigationMenu: r, ...i } = e, n = b(ue, r), o = /* @__PURE__ */ l(_.ul, { "data-orientation": n.orientation, ...i, ref: t });
179
- return /* @__PURE__ */ l(_.div, { style: { position: "relative" }, ref: n.onIndicatorTrackChange, children: /* @__PURE__ */ l($.Slot, { scope: r, children: n.isRootMenu ? /* @__PURE__ */ l(Me, { asChild: !0, children: o }) : o }) });
180
- }
181
- );
182
- le.displayName = ue;
183
- var de = "NavigationMenuItem", [Ve, ve] = Y(de), fe = a.forwardRef(
184
- (e, t) => {
185
- const { __scopeNavigationMenu: r, value: i, ...n } = e, o = re(), s = i || o || "LEGACY_REACT_AUTO_VALUE", d = a.useRef(null), c = a.useRef(null), R = a.useRef(null), u = a.useRef(() => {
186
- }), g = a.useRef(!1), h = a.useCallback((C = "start") => {
187
- if (d.current) {
188
- u.current();
189
- const p = B(d.current);
190
- p.length && X(C === "start" ? p : p.reverse());
191
- }
192
- }, []), E = a.useCallback(() => {
193
- if (d.current) {
194
- const C = B(d.current);
195
- C.length && (u.current = $e(C));
196
- }
197
- }, []);
198
- return /* @__PURE__ */ l(
199
- Ve,
200
- {
201
- scope: r,
202
- value: s,
203
- triggerRef: c,
204
- contentRef: d,
205
- focusProxyRef: R,
206
- wasEscapeCloseRef: g,
207
- onEntryKeyDown: h,
208
- onFocusProxyEnter: h,
209
- onRootContentClose: E,
210
- onContentFocusOutside: E,
211
- children: /* @__PURE__ */ l(_.li, { ...n, ref: t })
212
- }
213
- );
214
- }
215
- );
216
- fe.displayName = de;
217
- var H = "NavigationMenuTrigger", me = a.forwardRef((e, t) => {
218
- const { __scopeNavigationMenu: r, disabled: i, ...n } = e, o = b(H, e.__scopeNavigationMenu), s = ve(H, e.__scopeNavigationMenu), d = a.useRef(null), c = k(d, s.triggerRef, t), R = he(o.baseId, s.value), u = Ee(o.baseId, s.value), g = a.useRef(!1), h = a.useRef(!1), E = s.value === o.value;
219
- return /* @__PURE__ */ Z(ee, { children: [
220
- /* @__PURE__ */ l($.ItemSlot, { scope: r, value: s.value, children: /* @__PURE__ */ l(Ne, { asChild: !0, children: /* @__PURE__ */ l(
221
- _.button,
222
- {
223
- id: R,
224
- disabled: i,
225
- "data-disabled": i ? "" : void 0,
226
- "data-state": J(E),
227
- "aria-expanded": E,
228
- "aria-controls": u,
229
- ...n,
230
- ref: c,
231
- onPointerEnter: I(e.onPointerEnter, () => {
232
- h.current = !1, s.wasEscapeCloseRef.current = !1;
233
- }),
234
- onPointerMove: I(
235
- e.onPointerMove,
236
- L(() => {
237
- i || h.current || s.wasEscapeCloseRef.current || g.current || (o.onTriggerEnter(s.value), g.current = !0);
238
- })
239
- ),
240
- onPointerLeave: I(
241
- e.onPointerLeave,
242
- L(() => {
243
- i || (o.onTriggerLeave(), g.current = !1);
244
- })
245
- ),
246
- onClick: I(e.onClick, () => {
247
- o.onItemSelect(s.value), h.current = E;
248
- }),
249
- onKeyDown: I(e.onKeyDown, (C) => {
250
- const M = { horizontal: "ArrowDown", vertical: o.dir === "rtl" ? "ArrowLeft" : "ArrowRight" }[o.orientation];
251
- E && C.key === M && (s.onEntryKeyDown(), C.preventDefault());
252
- })
253
- }
254
- ) }) }),
255
- E && /* @__PURE__ */ Z(ee, { children: [
256
- /* @__PURE__ */ l(
257
- De,
258
- {
259
- "aria-hidden": !0,
260
- tabIndex: 0,
261
- ref: s.focusProxyRef,
262
- onFocus: (C) => {
263
- const p = s.contentRef.current, M = C.relatedTarget, T = M === d.current, P = p == null ? void 0 : p.contains(M);
264
- (T || !P) && s.onFocusProxyEnter(T ? "start" : "end");
265
- }
266
- }
267
- ),
268
- o.viewport && /* @__PURE__ */ l("span", { "aria-owns": u })
269
- ] })
270
- ] });
271
- });
272
- me.displayName = H;
273
- var Ge = "NavigationMenuLink", te = "navigationMenu.linkSelect", ge = a.forwardRef(
274
- (e, t) => {
275
- const { __scopeNavigationMenu: r, active: i, onSelect: n, ...o } = e;
276
- return /* @__PURE__ */ l(Ne, { asChild: !0, children: /* @__PURE__ */ l(
277
- _.a,
278
- {
279
- "data-active": i ? "" : void 0,
280
- "aria-current": i ? "page" : void 0,
281
- ...o,
282
- ref: t,
283
- onClick: I(
284
- e.onClick,
285
- (s) => {
286
- const d = s.target, c = new CustomEvent(te, {
287
- bubbles: !0,
288
- cancelable: !0
289
- });
290
- if (d.addEventListener(te, (R) => n == null ? void 0 : n(R), { once: !0 }), Q(d, c), !c.defaultPrevented && !s.metaKey) {
291
- const R = new CustomEvent(F, {
292
- bubbles: !0,
293
- cancelable: !0
294
- });
295
- Q(d, R);
296
- }
297
- },
298
- { checkForDefaultPrevented: !1 }
299
- )
300
- }
301
- ) });
302
- }
303
- );
304
- ge.displayName = Ge;
305
- var j = "NavigationMenuIndicator", pe = a.forwardRef((e, t) => {
306
- const { forceMount: r, ...i } = e, n = b(j, e.__scopeNavigationMenu), o = !!n.value;
307
- return n.indicatorTrack ? Ie.createPortal(
308
- /* @__PURE__ */ l(K, { present: r || o, children: /* @__PURE__ */ l(ze, { ...i, ref: t }) }),
309
- n.indicatorTrack
310
- ) : null;
311
- });
312
- pe.displayName = j;
313
- var ze = a.forwardRef((e, t) => {
314
- const { __scopeNavigationMenu: r, ...i } = e, n = b(j, r), o = ae(r), [s, d] = a.useState(
315
- null
316
- ), [c, R] = a.useState(null), u = n.orientation === "horizontal", g = !!n.value;
317
- a.useEffect(() => {
318
- var p;
319
- const C = (p = o().find((M) => M.value === n.value)) == null ? void 0 : p.ref.current;
320
- C && d(C);
321
- }, [o, n.value]);
322
- const h = () => {
323
- s && R({
324
- size: u ? s.offsetWidth : s.offsetHeight,
325
- offset: u ? s.offsetLeft : s.offsetTop
326
- });
327
- };
328
- return W(s, h), W(n.indicatorTrack, h), c ? /* @__PURE__ */ l(
329
- _.div,
330
- {
331
- "aria-hidden": !0,
332
- "data-state": g ? "visible" : "hidden",
333
- "data-orientation": n.orientation,
334
- ...i,
335
- ref: t,
336
- style: {
337
- position: "absolute",
338
- ...u ? {
339
- left: 0,
340
- width: c.size + "px",
341
- transform: `translateX(${c.offset}px)`
342
- } : {
343
- top: 0,
344
- height: c.size + "px",
345
- transform: `translateY(${c.offset}px)`
346
- },
347
- ...i.style
348
- }
349
- }
350
- ) : null;
351
- }), O = "NavigationMenuContent", we = a.forwardRef((e, t) => {
352
- const { forceMount: r, ...i } = e, n = b(O, e.__scopeNavigationMenu), o = ve(O, e.__scopeNavigationMenu), s = k(o.contentRef, t), d = o.value === n.value, c = {
353
- value: o.value,
354
- triggerRef: o.triggerRef,
355
- focusProxyRef: o.focusProxyRef,
356
- wasEscapeCloseRef: o.wasEscapeCloseRef,
357
- onContentFocusOutside: o.onContentFocusOutside,
358
- onRootContentClose: o.onRootContentClose,
359
- ...i
360
- };
361
- return n.viewport ? /* @__PURE__ */ l(Ue, { forceMount: r, ...c, ref: s }) : /* @__PURE__ */ l(K, { present: r || d, children: /* @__PURE__ */ l(
362
- Ce,
363
- {
364
- "data-state": J(d),
365
- ...c,
366
- ref: s,
367
- onPointerEnter: I(e.onPointerEnter, n.onContentEnter),
368
- onPointerLeave: I(
369
- e.onPointerLeave,
370
- L(n.onContentLeave)
371
- ),
372
- style: {
373
- // Prevent interaction when animating out
374
- pointerEvents: !d && n.isRootMenu ? "none" : void 0,
375
- ...c.style
376
- }
377
- }
378
- ) });
379
- });
380
- we.displayName = O;
381
- var Ue = a.forwardRef((e, t) => {
382
- const r = b(O, e.__scopeNavigationMenu), { onViewportContentChange: i, onViewportContentRemove: n } = r;
383
- return G(() => {
384
- i(e.value, {
385
- ref: t,
386
- ...e
387
- });
388
- }, [e, t, i]), G(() => () => n(e.value), [e.value, n]), null;
389
- }), F = "navigationMenu.rootContentDismiss", Ce = a.forwardRef((e, t) => {
390
- const {
391
- __scopeNavigationMenu: r,
392
- value: i,
393
- triggerRef: n,
394
- focusProxyRef: o,
395
- wasEscapeCloseRef: s,
396
- onRootContentClose: d,
397
- onContentFocusOutside: c,
398
- ...R
399
- } = e, u = b(O, r), g = a.useRef(null), h = k(g, t), E = he(u.baseId, i), C = Ee(u.baseId, i), p = ae(r), M = a.useRef(null), { onItemDismiss: T } = u;
400
- a.useEffect(() => {
401
- const f = g.current;
402
- if (u.isRootMenu && f) {
403
- const m = () => {
404
- var v;
405
- T(), d(), f.contains(document.activeElement) && ((v = n.current) == null || v.focus());
406
- };
407
- return f.addEventListener(F, m), () => f.removeEventListener(F, m);
408
- }
409
- }, [u.isRootMenu, e.value, n, T, d]);
410
- const P = a.useMemo(() => {
411
- const m = p().map((D) => D.value);
412
- u.dir === "rtl" && m.reverse();
413
- const v = m.indexOf(u.value), N = m.indexOf(u.previousValue), y = i === u.value, x = N === m.indexOf(i);
414
- if (!y && !x) return M.current;
415
- const w = (() => {
416
- if (v !== N) {
417
- if (y && N !== -1) return v > N ? "from-end" : "from-start";
418
- if (x && v !== -1) return v > N ? "to-start" : "to-end";
419
- }
420
- return null;
421
- })();
422
- return M.current = w, w;
423
- }, [u.previousValue, u.value, u.dir, p, i]);
424
- return /* @__PURE__ */ l(Me, { asChild: !0, children: /* @__PURE__ */ l(
425
- Pe,
426
- {
427
- id: C,
428
- "aria-labelledby": E,
429
- "data-motion": P,
430
- "data-orientation": u.orientation,
431
- ...R,
432
- ref: h,
433
- disableOutsidePointerEvents: !1,
434
- onDismiss: () => {
435
- var m;
436
- const f = new Event(F, {
437
- bubbles: !0,
438
- cancelable: !0
439
- });
440
- (m = g.current) == null || m.dispatchEvent(f);
441
- },
442
- onFocusOutside: I(e.onFocusOutside, (f) => {
443
- var v;
444
- c();
445
- const m = f.target;
446
- (v = u.rootNavigationMenu) != null && v.contains(m) && f.preventDefault();
447
- }),
448
- onPointerDownOutside: I(e.onPointerDownOutside, (f) => {
449
- var y;
450
- const m = f.target, v = p().some((x) => {
451
- var w;
452
- return (w = x.ref.current) == null ? void 0 : w.contains(m);
453
- }), N = u.isRootMenu && ((y = u.viewport) == null ? void 0 : y.contains(m));
454
- (v || N || !u.isRootMenu) && f.preventDefault();
455
- }),
456
- onKeyDown: I(e.onKeyDown, (f) => {
457
- var N;
458
- const m = f.altKey || f.ctrlKey || f.metaKey;
459
- if (f.key === "Tab" && !m) {
460
- const y = B(f.currentTarget), x = document.activeElement, w = y.findIndex((Te) => Te === x), V = f.shiftKey ? y.slice(0, w).reverse() : y.slice(w + 1, y.length);
461
- X(V) ? f.preventDefault() : (N = o.current) == null || N.focus();
462
- }
463
- }),
464
- onEscapeKeyDown: I(e.onEscapeKeyDown, (f) => {
465
- s.current = !0;
466
- })
467
- }
468
- ) });
469
- }), q = "NavigationMenuViewport", Re = a.forwardRef((e, t) => {
470
- const { forceMount: r, ...i } = e, o = !!b(q, e.__scopeNavigationMenu).value;
471
- return /* @__PURE__ */ l(K, { present: r || o, children: /* @__PURE__ */ l(He, { ...i, ref: t }) });
472
- });
473
- Re.displayName = q;
474
- var He = a.forwardRef((e, t) => {
475
- const { __scopeNavigationMenu: r, children: i, ...n } = e, o = b(q, r), s = k(t, o.onViewportChange), d = Le(
476
- O,
477
- e.__scopeNavigationMenu
478
- ), [c, R] = a.useState(null), [u, g] = a.useState(null), h = c ? (c == null ? void 0 : c.width) + "px" : void 0, E = c ? (c == null ? void 0 : c.height) + "px" : void 0, C = !!o.value, p = C ? o.value : o.previousValue;
479
- return W(u, () => {
480
- u && R({ width: u.offsetWidth, height: u.offsetHeight });
481
- }), /* @__PURE__ */ l(
482
- _.div,
483
- {
484
- "data-state": J(C),
485
- "data-orientation": o.orientation,
486
- ...n,
487
- ref: s,
488
- style: {
489
- // Prevent interaction when animating out
490
- pointerEvents: !C && o.isRootMenu ? "none" : void 0,
491
- "--radix-navigation-menu-viewport-width": h,
492
- "--radix-navigation-menu-viewport-height": E,
493
- ...n.style
494
- },
495
- onPointerEnter: I(e.onPointerEnter, o.onContentEnter),
496
- onPointerLeave: I(e.onPointerLeave, L(o.onContentLeave)),
497
- children: Array.from(d.items).map(([T, { ref: P, forceMount: f, ...m }]) => {
498
- const v = p === T;
499
- return /* @__PURE__ */ l(K, { present: f || v, children: /* @__PURE__ */ l(
500
- Ce,
501
- {
502
- ...m,
503
- ref: be(P, (N) => {
504
- v && N && g(N);
505
- })
506
- }
507
- ) }, T);
508
- })
509
- }
510
- );
511
- }), Be = "FocusGroup", Me = a.forwardRef(
512
- (e, t) => {
513
- const { __scopeNavigationMenu: r, ...i } = e, n = b(Be, r);
514
- return /* @__PURE__ */ l(z.Provider, { scope: r, children: /* @__PURE__ */ l(z.Slot, { scope: r, children: /* @__PURE__ */ l(_.div, { dir: n.dir, ...i, ref: t }) }) });
515
- }
516
- ), ne = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"], We = "FocusGroupItem", Ne = a.forwardRef(
517
- (e, t) => {
518
- const { __scopeNavigationMenu: r, ...i } = e, n = Ae(r), o = b(We, r);
519
- return /* @__PURE__ */ l(z.ItemSlot, { scope: r, children: /* @__PURE__ */ l(
520
- _.button,
521
- {
522
- ...i,
523
- ref: t,
524
- onKeyDown: I(e.onKeyDown, (s) => {
525
- if (["Home", "End", ...ne].includes(s.key)) {
526
- let c = n().map((g) => g.ref.current);
527
- if ([o.dir === "rtl" ? "ArrowRight" : "ArrowLeft", "ArrowUp", "End"].includes(s.key) && c.reverse(), ne.includes(s.key)) {
528
- const g = c.indexOf(s.currentTarget);
529
- c = c.slice(g + 1);
530
- }
531
- setTimeout(() => X(c)), s.preventDefault();
532
- }
533
- })
534
- }
535
- ) });
536
- }
537
- );
538
- function B(e) {
539
- const t = [], r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
540
- acceptNode: (i) => {
541
- const n = i.tagName === "INPUT" && i.type === "hidden";
542
- return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
543
- }
544
- });
545
- for (; r.nextNode(); ) t.push(r.currentNode);
546
- return t;
547
- }
548
- function X(e) {
549
- const t = document.activeElement;
550
- return e.some((r) => r === t ? !0 : (r.focus(), document.activeElement !== t));
551
- }
552
- function $e(e) {
553
- return e.forEach((t) => {
554
- t.dataset.tabindex = t.getAttribute("tabindex") || "", t.setAttribute("tabindex", "-1");
555
- }), () => {
556
- e.forEach((t) => {
557
- const r = t.dataset.tabindex;
558
- t.setAttribute("tabindex", r);
559
- });
560
- };
561
- }
562
- function W(e, t) {
563
- const r = S(t);
564
- G(() => {
565
- let i = 0;
566
- if (e) {
567
- const n = new ResizeObserver(() => {
568
- cancelAnimationFrame(i), i = window.requestAnimationFrame(r);
569
- });
570
- return n.observe(e), () => {
571
- window.cancelAnimationFrame(i), n.unobserve(e);
572
- };
573
- }
574
- }, [e, r]);
575
- }
576
- function J(e) {
577
- return e ? "open" : "closed";
578
- }
579
- function he(e, t) {
580
- return `${e}-trigger-${t}`;
581
- }
582
- function Ee(e, t) {
583
- return `${e}-content-${t}`;
584
- }
585
- function L(e) {
586
- return (t) => t.pointerType === "mouse" ? e(t) : void 0;
587
- }
588
- var ut = se, lt = le, dt = fe, vt = me, ft = ge, mt = pe, gt = we, pt = Re;
589
- export {
590
- gt as Content,
591
- mt as Indicator,
592
- dt as Item,
593
- ft as Link,
594
- lt as List,
595
- se as NavigationMenu,
596
- we as NavigationMenuContent,
597
- pe as NavigationMenuIndicator,
598
- fe as NavigationMenuItem,
599
- ge as NavigationMenuLink,
600
- le as NavigationMenuList,
601
- Ke as NavigationMenuSub,
602
- me as NavigationMenuTrigger,
603
- Re as NavigationMenuViewport,
604
- ut as Root,
605
- vt as Trigger,
606
- pt as Viewport
607
- };