@fluid-app/rep-core 0.1.14 → 0.1.16

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 (311) hide show
  1. package/dist/chunk-CKQMccvm.cjs +28 -0
  2. package/dist/data-sources/DataAwareWidget.cjs +47 -56
  3. package/dist/data-sources/DataAwareWidget.cjs.map +1 -1
  4. package/dist/data-sources/DataAwareWidget.d.cts +27 -19
  5. package/dist/data-sources/DataAwareWidget.d.cts.map +1 -0
  6. package/dist/data-sources/DataAwareWidget.d.mts +38 -0
  7. package/dist/data-sources/DataAwareWidget.d.mts.map +1 -0
  8. package/dist/data-sources/DataAwareWidget.mjs +48 -0
  9. package/dist/data-sources/DataAwareWidget.mjs.map +1 -0
  10. package/dist/data-sources/ErrorState.cjs +18 -10
  11. package/dist/data-sources/ErrorState.cjs.map +1 -1
  12. package/dist/data-sources/ErrorState.d.cts +5 -3
  13. package/dist/data-sources/ErrorState.d.cts.map +1 -0
  14. package/dist/data-sources/ErrorState.d.mts +7 -0
  15. package/dist/data-sources/ErrorState.d.mts.map +1 -0
  16. package/dist/data-sources/ErrorState.mjs +18 -0
  17. package/dist/data-sources/ErrorState.mjs.map +1 -0
  18. package/dist/data-sources/context.cjs +22 -14
  19. package/dist/data-sources/context.cjs.map +1 -1
  20. package/dist/data-sources/context.d.cts +16 -10
  21. package/dist/data-sources/context.d.cts.map +1 -0
  22. package/dist/data-sources/context.d.mts +22 -0
  23. package/dist/data-sources/context.d.mts.map +1 -0
  24. package/dist/data-sources/context.mjs +21 -0
  25. package/dist/data-sources/context.mjs.map +1 -0
  26. package/dist/data-sources/fetchers/api.cjs +63 -10
  27. package/dist/data-sources/fetchers/api.cjs.map +1 -1
  28. package/dist/data-sources/fetchers/api.d.cts +4 -2
  29. package/dist/data-sources/fetchers/api.d.cts.map +1 -0
  30. package/dist/data-sources/fetchers/api.d.mts +10 -0
  31. package/dist/data-sources/fetchers/api.d.mts.map +1 -0
  32. package/dist/data-sources/fetchers/api.mjs +64 -0
  33. package/dist/data-sources/fetchers/api.mjs.map +1 -0
  34. package/dist/data-sources/fetchers/custom.cjs +106 -10
  35. package/dist/data-sources/fetchers/custom.cjs.map +1 -1
  36. package/dist/data-sources/fetchers/custom.d.cts +4 -2
  37. package/dist/data-sources/fetchers/custom.d.cts.map +1 -0
  38. package/dist/data-sources/fetchers/{custom.d.ts → custom.d.mts} +4 -2
  39. package/dist/data-sources/fetchers/custom.d.mts.map +1 -0
  40. package/dist/data-sources/fetchers/custom.mjs +107 -0
  41. package/dist/data-sources/fetchers/custom.mjs.map +1 -0
  42. package/dist/data-sources/fetchers/static.cjs +159 -14
  43. package/dist/data-sources/fetchers/static.cjs.map +1 -1
  44. package/dist/data-sources/fetchers/static.d.cts +12 -10
  45. package/dist/data-sources/fetchers/static.d.cts.map +1 -0
  46. package/dist/data-sources/fetchers/{static.d.ts → static.d.mts} +12 -10
  47. package/dist/data-sources/fetchers/static.d.mts.map +1 -0
  48. package/dist/data-sources/fetchers/static.mjs +158 -0
  49. package/dist/data-sources/fetchers/static.mjs.map +1 -0
  50. package/dist/data-sources/preview-context.cjs +15 -15
  51. package/dist/data-sources/preview-context.cjs.map +1 -1
  52. package/dist/data-sources/preview-context.d.cts +10 -6
  53. package/dist/data-sources/preview-context.d.cts.map +1 -0
  54. package/dist/data-sources/preview-context.d.mts +15 -0
  55. package/dist/data-sources/preview-context.d.mts.map +1 -0
  56. package/dist/data-sources/preview-context.mjs +18 -0
  57. package/dist/data-sources/preview-context.mjs.map +1 -0
  58. package/dist/data-sources/registry-context.cjs +51 -24
  59. package/dist/data-sources/registry-context.cjs.map +1 -1
  60. package/dist/data-sources/registry-context.d.cts +30 -22
  61. package/dist/data-sources/registry-context.d.cts.map +1 -0
  62. package/dist/data-sources/registry-context.d.mts +49 -0
  63. package/dist/data-sources/registry-context.d.mts.map +1 -0
  64. package/dist/data-sources/registry-context.mjs +49 -0
  65. package/dist/data-sources/registry-context.mjs.map +1 -0
  66. package/dist/data-sources/registry.cjs +29 -18
  67. package/dist/data-sources/registry.cjs.map +1 -1
  68. package/dist/data-sources/registry.d.cts +9 -7
  69. package/dist/data-sources/registry.d.cts.map +1 -0
  70. package/dist/data-sources/registry.d.mts +19 -0
  71. package/dist/data-sources/registry.d.mts.map +1 -0
  72. package/dist/data-sources/registry.mjs +29 -0
  73. package/dist/data-sources/registry.mjs.map +1 -0
  74. package/dist/data-sources/transformers.cjs +152 -10
  75. package/dist/data-sources/transformers.cjs.map +1 -1
  76. package/dist/data-sources/transformers.d.cts +4 -17
  77. package/dist/data-sources/transformers.d.cts.map +1 -0
  78. package/dist/data-sources/transformers.d.mts +10 -0
  79. package/dist/data-sources/transformers.d.mts.map +1 -0
  80. package/dist/data-sources/transformers.mjs +153 -0
  81. package/dist/data-sources/transformers.mjs.map +1 -0
  82. package/dist/data-sources/types.cjs +0 -4
  83. package/dist/data-sources/types.d.cts +2 -157
  84. package/dist/data-sources/types.d.mts +2 -0
  85. package/dist/data-sources/types.mjs +1 -0
  86. package/dist/data-sources/use-widget-data.cjs +109 -17
  87. package/dist/data-sources/use-widget-data.cjs.map +1 -1
  88. package/dist/data-sources/use-widget-data.d.cts +9 -8
  89. package/dist/data-sources/use-widget-data.d.cts.map +1 -0
  90. package/dist/data-sources/use-widget-data.d.mts +17 -0
  91. package/dist/data-sources/use-widget-data.d.mts.map +1 -0
  92. package/dist/data-sources/use-widget-data.mjs +109 -0
  93. package/dist/data-sources/use-widget-data.mjs.map +1 -0
  94. package/dist/index-Bxe_LIi8.d.cts +287 -0
  95. package/dist/index-Bxe_LIi8.d.cts.map +1 -0
  96. package/dist/index-CCAu2n19.d.mts +287 -0
  97. package/dist/index-CCAu2n19.d.mts.map +1 -0
  98. package/dist/registries/index.cjs +212 -127
  99. package/dist/registries/index.cjs.map +1 -1
  100. package/dist/registries/index.d.cts +146 -149
  101. package/dist/registries/index.d.cts.map +1 -0
  102. package/dist/registries/{index.d.ts → index.d.mts} +146 -149
  103. package/dist/registries/index.d.mts.map +1 -0
  104. package/dist/registries/index.mjs +229 -0
  105. package/dist/registries/index.mjs.map +1 -0
  106. package/dist/shell/AppShellLayout.cjs +47 -12
  107. package/dist/shell/AppShellLayout.cjs.map +1 -1
  108. package/dist/shell/AppShellLayout.d.cts +29 -19
  109. package/dist/shell/AppShellLayout.d.cts.map +1 -0
  110. package/dist/shell/AppShellLayout.d.mts +40 -0
  111. package/dist/shell/AppShellLayout.d.mts.map +1 -0
  112. package/dist/shell/AppShellLayout.mjs +46 -0
  113. package/dist/{chunk-45BCVWQK.cjs.map → shell/AppShellLayout.mjs.map} +1 -1
  114. package/dist/shell/ScreenHeader.cjs +44 -0
  115. package/dist/shell/ScreenHeader.cjs.map +1 -0
  116. package/dist/shell/ScreenHeader.d.cts +12 -0
  117. package/dist/shell/ScreenHeader.d.cts.map +1 -0
  118. package/dist/shell/ScreenHeader.d.mts +12 -0
  119. package/dist/shell/ScreenHeader.d.mts.map +1 -0
  120. package/dist/shell/ScreenHeader.mjs +42 -0
  121. package/dist/shell/ScreenHeader.mjs.map +1 -0
  122. package/dist/shell/ScreenHeaderContext.cjs +91 -0
  123. package/dist/shell/ScreenHeaderContext.cjs.map +1 -0
  124. package/dist/shell/ScreenHeaderContext.d.cts +36 -0
  125. package/dist/shell/ScreenHeaderContext.d.cts.map +1 -0
  126. package/dist/shell/ScreenHeaderContext.d.mts +36 -0
  127. package/dist/shell/ScreenHeaderContext.d.mts.map +1 -0
  128. package/dist/shell/ScreenHeaderContext.mjs +86 -0
  129. package/dist/shell/ScreenHeaderContext.mjs.map +1 -0
  130. package/dist/shell/ThemeModeContext.cjs +68 -18
  131. package/dist/shell/ThemeModeContext.cjs.map +1 -1
  132. package/dist/shell/ThemeModeContext.d.cts +23 -16
  133. package/dist/shell/ThemeModeContext.d.cts.map +1 -0
  134. package/dist/shell/ThemeModeContext.d.mts +34 -0
  135. package/dist/shell/ThemeModeContext.d.mts.map +1 -0
  136. package/dist/shell/ThemeModeContext.mjs +66 -0
  137. package/dist/shell/ThemeModeContext.mjs.map +1 -0
  138. package/dist/shell/index.cjs +43 -205
  139. package/dist/shell/index.d.cts +7 -43
  140. package/dist/shell/index.d.mts +7 -0
  141. package/dist/shell/index.mjs +7 -0
  142. package/dist/shell/sidebar.cjs +372 -87
  143. package/dist/shell/sidebar.cjs.map +1 -1
  144. package/dist/shell/sidebar.d.cts +38 -36
  145. package/dist/shell/sidebar.d.cts.map +1 -0
  146. package/dist/shell/{sidebar.d.ts → sidebar.d.mts} +38 -36
  147. package/dist/shell/sidebar.d.mts.map +1 -0
  148. package/dist/shell/sidebar.mjs +364 -0
  149. package/dist/{chunk-PFDBULOI.cjs.map → shell/sidebar.mjs.map} +1 -1
  150. package/dist/shell/use-mobile.cjs +49 -18
  151. package/dist/shell/use-mobile.cjs.map +1 -1
  152. package/dist/shell/use-mobile.d.cts +3 -1
  153. package/dist/shell/use-mobile.d.cts.map +1 -0
  154. package/dist/shell/{use-mobile.d.ts → use-mobile.d.mts} +3 -1
  155. package/dist/shell/use-mobile.d.mts.map +1 -0
  156. package/dist/shell/use-mobile.mjs +47 -0
  157. package/dist/shell/use-mobile.mjs.map +1 -0
  158. package/dist/theme/index.cjs +663 -549
  159. package/dist/theme/index.cjs.map +1 -1
  160. package/dist/theme/index.d.cts +32 -32
  161. package/dist/theme/index.d.cts.map +1 -0
  162. package/dist/theme/{index.d.ts → index.d.mts} +32 -32
  163. package/dist/theme/index.d.mts.map +1 -0
  164. package/dist/theme/index.mjs +728 -0
  165. package/dist/theme/index.mjs.map +1 -0
  166. package/dist/types/index.cjs +18 -72
  167. package/dist/types/index.d.cts +4 -268
  168. package/dist/types/index.d.mts +4 -0
  169. package/dist/types/index.mjs +2 -0
  170. package/dist/types-BIXtQlHB.d.cts +155 -0
  171. package/dist/types-BIXtQlHB.d.cts.map +1 -0
  172. package/dist/types-BXFX9bXp.cjs +303 -0
  173. package/dist/types-BXFX9bXp.cjs.map +1 -0
  174. package/dist/types-Bjmd7Fdx.mjs +208 -0
  175. package/dist/types-Bjmd7Fdx.mjs.map +1 -0
  176. package/dist/types-ByG6Xy3C.d.mts +85 -0
  177. package/dist/types-ByG6Xy3C.d.mts.map +1 -0
  178. package/dist/types-C5OFJy-O.d.mts +155 -0
  179. package/dist/types-C5OFJy-O.d.mts.map +1 -0
  180. package/dist/types-Ctu-Zio6.d.cts +85 -0
  181. package/dist/types-Ctu-Zio6.d.cts.map +1 -0
  182. package/dist/{widget-schema-D-ca3--K.d.ts → widget-schema--PY1uMWx.d.cts} +38 -41
  183. package/dist/widget-schema--PY1uMWx.d.cts.map +1 -0
  184. package/dist/{widget-schema-DvJdg1-B.d.cts → widget-schema-YkD5p3v4.d.mts} +38 -41
  185. package/dist/widget-schema-YkD5p3v4.d.mts.map +1 -0
  186. package/dist/widget-utils/index.cjs +96 -89
  187. package/dist/widget-utils/index.cjs.map +1 -1
  188. package/dist/widget-utils/index.d.cts +8 -6
  189. package/dist/widget-utils/index.d.cts.map +1 -0
  190. package/dist/widget-utils/{index.d.ts → index.d.mts} +8 -6
  191. package/dist/widget-utils/index.d.mts.map +1 -0
  192. package/dist/widget-utils/index.mjs +119 -0
  193. package/dist/widget-utils/index.mjs.map +1 -0
  194. package/package.json +4 -4
  195. package/dist/chunk-2SPTFZRC.js +0 -72
  196. package/dist/chunk-2SPTFZRC.js.map +0 -1
  197. package/dist/chunk-3I5Y3PEO.js +0 -23
  198. package/dist/chunk-3I5Y3PEO.js.map +0 -1
  199. package/dist/chunk-3ZRE7GX6.js +0 -620
  200. package/dist/chunk-3ZRE7GX6.js.map +0 -1
  201. package/dist/chunk-45BCVWQK.cjs +0 -38
  202. package/dist/chunk-46PUWB7C.cjs +0 -69
  203. package/dist/chunk-46PUWB7C.cjs.map +0 -1
  204. package/dist/chunk-5NYM4UTW.cjs +0 -58
  205. package/dist/chunk-5NYM4UTW.cjs.map +0 -1
  206. package/dist/chunk-B2NTWEDF.cjs +0 -130
  207. package/dist/chunk-B2NTWEDF.cjs.map +0 -1
  208. package/dist/chunk-GDY76JA6.cjs +0 -153
  209. package/dist/chunk-GDY76JA6.cjs.map +0 -1
  210. package/dist/chunk-HGVSPZEL.cjs +0 -119
  211. package/dist/chunk-HGVSPZEL.cjs.map +0 -1
  212. package/dist/chunk-HIDJYVKJ.js +0 -54
  213. package/dist/chunk-HIDJYVKJ.js.map +0 -1
  214. package/dist/chunk-KTXGU7OP.cjs +0 -136
  215. package/dist/chunk-KTXGU7OP.cjs.map +0 -1
  216. package/dist/chunk-KW5E2H5T.js +0 -128
  217. package/dist/chunk-KW5E2H5T.js.map +0 -1
  218. package/dist/chunk-LBLHDGMT.js +0 -25
  219. package/dist/chunk-LBLHDGMT.js.map +0 -1
  220. package/dist/chunk-MNVDL4FX.js +0 -134
  221. package/dist/chunk-MNVDL4FX.js.map +0 -1
  222. package/dist/chunk-MOTOSPAO.cjs +0 -15
  223. package/dist/chunk-MOTOSPAO.cjs.map +0 -1
  224. package/dist/chunk-N2K6W7FX.cjs +0 -169
  225. package/dist/chunk-N2K6W7FX.cjs.map +0 -1
  226. package/dist/chunk-PFDBULOI.cjs +0 -665
  227. package/dist/chunk-PVTQWD4I.js +0 -166
  228. package/dist/chunk-PVTQWD4I.js.map +0 -1
  229. package/dist/chunk-SJQPHJL4.cjs +0 -26
  230. package/dist/chunk-SJQPHJL4.cjs.map +0 -1
  231. package/dist/chunk-TML66UEU.js +0 -13
  232. package/dist/chunk-TML66UEU.js.map +0 -1
  233. package/dist/chunk-U3CQLX2Z.cjs +0 -28
  234. package/dist/chunk-U3CQLX2Z.cjs.map +0 -1
  235. package/dist/chunk-UUNEVOA5.js +0 -36
  236. package/dist/chunk-UUNEVOA5.js.map +0 -1
  237. package/dist/chunk-VRF7QEID.js +0 -67
  238. package/dist/chunk-VRF7QEID.js.map +0 -1
  239. package/dist/chunk-VSZWXSQA.js +0 -38
  240. package/dist/chunk-VSZWXSQA.js.map +0 -1
  241. package/dist/chunk-WYOHFNNW.js +0 -117
  242. package/dist/chunk-WYOHFNNW.js.map +0 -1
  243. package/dist/chunk-YKF5ZFF5.js +0 -136
  244. package/dist/chunk-YKF5ZFF5.js.map +0 -1
  245. package/dist/chunk-YXJMBVXO.cjs +0 -76
  246. package/dist/chunk-YXJMBVXO.cjs.map +0 -1
  247. package/dist/chunk-ZA4AE7KF.cjs +0 -42
  248. package/dist/chunk-ZA4AE7KF.cjs.map +0 -1
  249. package/dist/data-sources/DataAwareWidget.d.ts +0 -30
  250. package/dist/data-sources/DataAwareWidget.js +0 -57
  251. package/dist/data-sources/DataAwareWidget.js.map +0 -1
  252. package/dist/data-sources/ErrorState.d.ts +0 -5
  253. package/dist/data-sources/ErrorState.js +0 -3
  254. package/dist/data-sources/ErrorState.js.map +0 -1
  255. package/dist/data-sources/context.d.ts +0 -16
  256. package/dist/data-sources/context.js +0 -3
  257. package/dist/data-sources/context.js.map +0 -1
  258. package/dist/data-sources/fetchers/api.d.ts +0 -8
  259. package/dist/data-sources/fetchers/api.js +0 -3
  260. package/dist/data-sources/fetchers/api.js.map +0 -1
  261. package/dist/data-sources/fetchers/custom.js +0 -3
  262. package/dist/data-sources/fetchers/custom.js.map +0 -1
  263. package/dist/data-sources/fetchers/static.js +0 -3
  264. package/dist/data-sources/fetchers/static.js.map +0 -1
  265. package/dist/data-sources/preview-context.d.ts +0 -11
  266. package/dist/data-sources/preview-context.js +0 -18
  267. package/dist/data-sources/preview-context.js.map +0 -1
  268. package/dist/data-sources/registry-context.d.ts +0 -41
  269. package/dist/data-sources/registry-context.js +0 -9
  270. package/dist/data-sources/registry-context.js.map +0 -1
  271. package/dist/data-sources/registry.d.ts +0 -17
  272. package/dist/data-sources/registry.js +0 -7
  273. package/dist/data-sources/registry.js.map +0 -1
  274. package/dist/data-sources/transformers.d.ts +0 -23
  275. package/dist/data-sources/transformers.js +0 -3
  276. package/dist/data-sources/transformers.js.map +0 -1
  277. package/dist/data-sources/types.cjs.map +0 -1
  278. package/dist/data-sources/types.d.ts +0 -157
  279. package/dist/data-sources/types.js +0 -3
  280. package/dist/data-sources/types.js.map +0 -1
  281. package/dist/data-sources/use-widget-data.d.ts +0 -16
  282. package/dist/data-sources/use-widget-data.js +0 -10
  283. package/dist/data-sources/use-widget-data.js.map +0 -1
  284. package/dist/registries/index.js +0 -144
  285. package/dist/registries/index.js.map +0 -1
  286. package/dist/shareable-item-DkgWpwoU.d.cts +0 -21
  287. package/dist/shareable-item-DkgWpwoU.d.ts +0 -21
  288. package/dist/shell/AppShellLayout.d.ts +0 -30
  289. package/dist/shell/AppShellLayout.js +0 -5
  290. package/dist/shell/AppShellLayout.js.map +0 -1
  291. package/dist/shell/ThemeModeContext.d.ts +0 -27
  292. package/dist/shell/ThemeModeContext.js +0 -3
  293. package/dist/shell/ThemeModeContext.js.map +0 -1
  294. package/dist/shell/index.cjs.map +0 -1
  295. package/dist/shell/index.d.ts +0 -43
  296. package/dist/shell/index.js +0 -76
  297. package/dist/shell/index.js.map +0 -1
  298. package/dist/shell/sidebar.js +0 -4
  299. package/dist/shell/sidebar.js.map +0 -1
  300. package/dist/shell/use-mobile.js +0 -3
  301. package/dist/shell/use-mobile.js.map +0 -1
  302. package/dist/theme/index.js +0 -611
  303. package/dist/theme/index.js.map +0 -1
  304. package/dist/types/index.cjs.map +0 -1
  305. package/dist/types/index.d.ts +0 -268
  306. package/dist/types/index.js +0 -3
  307. package/dist/types/index.js.map +0 -1
  308. package/dist/types-CNIhy4JD.d.cts +0 -83
  309. package/dist/types-CNIhy4JD.d.ts +0 -83
  310. package/dist/widget-utils/index.js +0 -111
  311. package/dist/widget-utils/index.js.map +0 -1
@@ -1,620 +0,0 @@
1
- import { useIsMobile } from './chunk-HIDJYVKJ.js';
2
- import { Slot } from '@radix-ui/react-slot';
3
- import { cva } from 'class-variance-authority';
4
- import { clsx } from 'clsx';
5
- import { twMerge } from 'tailwind-merge';
6
- import * as React from 'react';
7
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
-
9
- function cn(...inputs) {
10
- return twMerge(clsx(inputs));
11
- }
12
- function Separator({
13
- className,
14
- orientation = "horizontal",
15
- ...props
16
- }) {
17
- return /* @__PURE__ */ jsx(
18
- "div",
19
- {
20
- role: "separator",
21
- "aria-orientation": orientation,
22
- className: cn(
23
- "bg-border shrink-0",
24
- orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
25
- className
26
- ),
27
- ...props
28
- }
29
- );
30
- }
31
- function Skeleton({
32
- className,
33
- ...props
34
- }) {
35
- return /* @__PURE__ */ jsx(
36
- "div",
37
- {
38
- className: cn("bg-muted animate-pulse rounded-md", className),
39
- ...props
40
- }
41
- );
42
- }
43
- var SIDEBAR_WIDTH = "13rem";
44
- var SIDEBAR_WIDTH_MOBILE = "18rem";
45
- var SIDEBAR_WIDTH_ICON = "3rem";
46
- var SIDEBAR_KEYBOARD_SHORTCUT = "b";
47
- var SidebarContext = React.createContext(
48
- null
49
- );
50
- function useSidebar() {
51
- const context = React.useContext(SidebarContext);
52
- if (!context) {
53
- throw new Error("useSidebar must be used within a SidebarProvider.");
54
- }
55
- return context;
56
- }
57
- var SidebarProvider = React.forwardRef(
58
- ({
59
- defaultOpen = true,
60
- open: openProp,
61
- onOpenChange: setOpenProp,
62
- viewportWidth,
63
- previewMode,
64
- useBottomNav: useBottomNavProp = false,
65
- className,
66
- style,
67
- children,
68
- ...props
69
- }, ref) => {
70
- const windowIsMobile = useIsMobile();
71
- const isMobile = viewportWidth !== void 0 ? viewportWidth < 768 : windowIsMobile;
72
- const isPreviewMode = viewportWidth !== void 0 || !!previewMode;
73
- const [openMobile, setOpenMobile] = React.useState(false);
74
- const [_open, _setOpen] = React.useState(defaultOpen);
75
- const open = openProp ?? _open;
76
- const setOpen = React.useCallback(
77
- (value) => {
78
- const openState = typeof value === "function" ? value(open) : value;
79
- if (setOpenProp) {
80
- setOpenProp(openState);
81
- } else {
82
- _setOpen(openState);
83
- }
84
- },
85
- [setOpenProp, open]
86
- );
87
- const toggleSidebar = React.useCallback(() => {
88
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
89
- }, [isMobile, setOpen, setOpenMobile]);
90
- React.useEffect(() => {
91
- const handleKeyDown = (event) => {
92
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
93
- const activeElement = document.activeElement;
94
- const isComposerFocused = activeElement?.closest(".group\\/composer") || activeElement?.closest("[data-toolbar]") || activeElement?.classList.contains("ProseMirror");
95
- if (isComposerFocused) {
96
- return;
97
- }
98
- event.preventDefault();
99
- toggleSidebar();
100
- }
101
- };
102
- window.addEventListener("keydown", handleKeyDown);
103
- return () => window.removeEventListener("keydown", handleKeyDown);
104
- }, [toggleSidebar]);
105
- const state = open ? "expanded" : "collapsed";
106
- const contextValue = React.useMemo(
107
- () => ({
108
- state,
109
- open,
110
- setOpen,
111
- isMobile,
112
- openMobile,
113
- setOpenMobile,
114
- toggleSidebar,
115
- isPreviewMode,
116
- useBottomNav: useBottomNavProp
117
- }),
118
- [
119
- state,
120
- open,
121
- setOpen,
122
- isMobile,
123
- openMobile,
124
- setOpenMobile,
125
- toggleSidebar,
126
- isPreviewMode,
127
- useBottomNavProp
128
- ]
129
- );
130
- return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
131
- "div",
132
- {
133
- style: {
134
- "--sidebar-width": SIDEBAR_WIDTH,
135
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
136
- ...style
137
- },
138
- className: cn(
139
- "group/sidebar-wrapper flex min-h-0 w-full flex-1",
140
- className
141
- ),
142
- ref,
143
- ...props,
144
- children
145
- }
146
- ) });
147
- }
148
- );
149
- SidebarProvider.displayName = "SidebarProvider";
150
- var Sidebar = React.forwardRef(
151
- ({
152
- side = "left",
153
- variant = "sidebar",
154
- collapsible = "offcanvas",
155
- className,
156
- children,
157
- ...props
158
- }, ref) => {
159
- const {
160
- isMobile,
161
- state,
162
- openMobile,
163
- setOpenMobile,
164
- isPreviewMode,
165
- useBottomNav
166
- } = useSidebar();
167
- const sidebarWidth = state === "expanded" ? SIDEBAR_WIDTH : SIDEBAR_WIDTH_ICON;
168
- if (useBottomNav && isMobile) {
169
- return null;
170
- }
171
- if (collapsible === "none") {
172
- return /* @__PURE__ */ jsx(
173
- "div",
174
- {
175
- className: cn(
176
- "bg-sidebar text-sidebar-foreground flex w-(--sidebar-width) flex-col rounded-tl-lg",
177
- isPreviewMode ? "h-full" : "h-[97vh]",
178
- className
179
- ),
180
- ref,
181
- ...props,
182
- children
183
- }
184
- );
185
- }
186
- if (isMobile) {
187
- const positionClass = isPreviewMode ? "absolute" : "fixed";
188
- return /* @__PURE__ */ jsxs(Fragment, { children: [
189
- openMobile && /* @__PURE__ */ jsx(
190
- "div",
191
- {
192
- className: cn(positionClass, "inset-0 z-40 bg-black/50"),
193
- onClick: () => setOpenMobile(false),
194
- "aria-hidden": "true"
195
- }
196
- ),
197
- /* @__PURE__ */ jsx(
198
- "div",
199
- {
200
- "data-sidebar": "sidebar",
201
- "data-mobile": "true",
202
- className: cn(
203
- positionClass,
204
- "bg-sidebar text-sidebar-foreground top-0 left-0 z-50 h-full w-[--sidebar-width] p-0 transition-transform duration-300 ease-in-out",
205
- openMobile ? "translate-x-0" : "-translate-x-full",
206
- className
207
- ),
208
- style: {
209
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
210
- },
211
- ref,
212
- ...props,
213
- children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
214
- }
215
- )
216
- ] });
217
- }
218
- return /* @__PURE__ */ jsxs(
219
- "div",
220
- {
221
- ref,
222
- className: "group peer bg-sidebar text-sidebar-foreground hidden md:block",
223
- "data-state": state,
224
- "data-collapsible": state === "collapsed" ? collapsible : "",
225
- "data-variant": variant,
226
- "data-side": side,
227
- style: {
228
- "--sidebar-width": sidebarWidth
229
- },
230
- children: [
231
- /* @__PURE__ */ jsx(
232
- "div",
233
- {
234
- className: cn(
235
- "relative bg-transparent transition-[width] duration-200 ease-linear",
236
- "group-data-[collapsible=offcanvas]:w-0",
237
- "group-data-[side=right]:rotate-180",
238
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
239
- )
240
- }
241
- ),
242
- /* @__PURE__ */ jsx(
243
- "div",
244
- {
245
- className: cn(
246
- "relative inset-y-0 z-[20] hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
247
- isPreviewMode ? "h-full" : "h-svh",
248
- side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
249
- // Adjust the padding for floating and inset variants.
250
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=right]:border-l",
251
- className
252
- ),
253
- ...props,
254
- children: /* @__PURE__ */ jsx(
255
- "div",
256
- {
257
- "data-sidebar": "sidebar",
258
- className: "group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
259
- children
260
- }
261
- )
262
- }
263
- )
264
- ]
265
- }
266
- );
267
- }
268
- );
269
- Sidebar.displayName = "Sidebar";
270
- var SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
271
- const { toggleSidebar } = useSidebar();
272
- return /* @__PURE__ */ jsx(
273
- "button",
274
- {
275
- ref,
276
- "data-sidebar": "rail",
277
- "aria-label": "Toggle Sidebar",
278
- tabIndex: -1,
279
- onClick: toggleSidebar,
280
- title: "Toggle Sidebar",
281
- className: cn(
282
- "hover:after:bg-sidebar-border absolute inset-y-0 z-[10] hidden w-4 -translate-x-full transition-all ease-linear group-data-[side=left]:-right-[1.375rem] group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
283
- "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
284
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
285
- "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
286
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
287
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
288
- className
289
- ),
290
- ...props
291
- }
292
- );
293
- });
294
- SidebarRail.displayName = "SidebarRail";
295
- var SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
296
- const { isPreviewMode } = useSidebar();
297
- return /* @__PURE__ */ jsx(
298
- "main",
299
- {
300
- ref,
301
- className: cn(
302
- "relative flex flex-1 flex-col",
303
- isPreviewMode ? "max-h-[calc(100svh-(--spacing(13)))]" : "min-h-svh peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))]",
304
- "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
305
- className
306
- ),
307
- ...props
308
- }
309
- );
310
- });
311
- SidebarInset.displayName = "SidebarInset";
312
- var SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
313
- return /* @__PURE__ */ jsx(
314
- "input",
315
- {
316
- ref,
317
- "data-sidebar": "input",
318
- className: cn(
319
- "bg-background focus-visible:ring-sidebar-ring h-8 w-full rounded-md border px-3 text-sm shadow-none focus-visible:ring-2 focus-visible:outline-none",
320
- className
321
- ),
322
- ...props
323
- }
324
- );
325
- });
326
- SidebarInput.displayName = "SidebarInput";
327
- var SidebarHeader = React.forwardRef(({ className, ...props }, ref) => {
328
- return /* @__PURE__ */ jsx(
329
- "div",
330
- {
331
- ref,
332
- "data-sidebar": "header",
333
- className: cn("flex flex-col gap-2 p-2", className),
334
- ...props
335
- }
336
- );
337
- });
338
- SidebarHeader.displayName = "SidebarHeader";
339
- var SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
340
- return /* @__PURE__ */ jsx(
341
- "div",
342
- {
343
- ref,
344
- "data-sidebar": "footer",
345
- className: cn("flex flex-col gap-2 p-2", className),
346
- ...props
347
- }
348
- );
349
- });
350
- SidebarFooter.displayName = "SidebarFooter";
351
- var SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
352
- return /* @__PURE__ */ jsx(
353
- Separator,
354
- {
355
- ref,
356
- "data-sidebar": "separator",
357
- className: cn("bg-sidebar-border mx-2 w-auto", className),
358
- ...props
359
- }
360
- );
361
- });
362
- SidebarSeparator.displayName = "SidebarSeparator";
363
- var SidebarContent = React.forwardRef(({ className, ...props }, ref) => {
364
- return /* @__PURE__ */ jsx(
365
- "div",
366
- {
367
- ref,
368
- "data-sidebar": "content",
369
- className: cn(
370
- "scrollbar-none flex min-h-0 flex-1 flex-col gap-2 overflow-auto rounded group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:overflow-hidden group-data-[collapsible=icon]:pt-3",
371
- className
372
- ),
373
- ...props
374
- }
375
- );
376
- });
377
- SidebarContent.displayName = "SidebarContent";
378
- var SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
379
- return /* @__PURE__ */ jsx(
380
- "div",
381
- {
382
- ref,
383
- "data-sidebar": "group",
384
- className: cn(
385
- "relative flex w-full min-w-0 flex-col p-2 group-data-[collapsible=icon]:py-0 group-data-[collapsible=icon]:pt-4",
386
- className
387
- ),
388
- ...props
389
- }
390
- );
391
- });
392
- SidebarGroup.displayName = "SidebarGroup";
393
- var SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
394
- const Comp = asChild ? Slot : "div";
395
- return /* @__PURE__ */ jsx(
396
- Comp,
397
- {
398
- ref,
399
- "data-sidebar": "group-label",
400
- className: cn(
401
- "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
402
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:hidden",
403
- className
404
- ),
405
- ...props
406
- }
407
- );
408
- });
409
- SidebarGroupLabel.displayName = "SidebarGroupLabel";
410
- var SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
411
- const Comp = asChild ? Slot : "button";
412
- return /* @__PURE__ */ jsx(
413
- Comp,
414
- {
415
- ref,
416
- "data-sidebar": "group-action",
417
- className: cn(
418
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
419
- // Increases the hit area of the button on mobile.
420
- "after:absolute after:-inset-2 md:after:hidden",
421
- "group-data-[collapsible=icon]:hidden",
422
- className
423
- ),
424
- ...props
425
- }
426
- );
427
- });
428
- SidebarGroupAction.displayName = "SidebarGroupAction";
429
- var SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
430
- "div",
431
- {
432
- ref,
433
- "data-sidebar": "group-content",
434
- className: cn("w-full text-sm", className),
435
- ...props
436
- }
437
- ));
438
- SidebarGroupContent.displayName = "SidebarGroupContent";
439
- var SidebarMenu = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
440
- "ul",
441
- {
442
- ref,
443
- "data-sidebar": "menu",
444
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
445
- ...props
446
- }
447
- ));
448
- SidebarMenu.displayName = "SidebarMenu";
449
- var SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
450
- "li",
451
- {
452
- ref,
453
- "data-sidebar": "menu-item",
454
- className: cn("group/menu-item relative", className),
455
- ...props
456
- }
457
- ));
458
- SidebarMenuItem.displayName = "SidebarMenuItem";
459
- var sidebarMenuButtonVariants = cva(
460
- "peer/menu-button ring-sidebar-ring hover:bg-sidebar-primary hover:text-sidebar-primary-foreground active:bg-sidebar-primary active:text-sidebar-primary-foreground data-[active=true]:bg-sidebar-primary data-[active=true]:text-sidebar-primary-foreground data-[state=open]:hover:bg-sidebar-primary data-[state=open]:hover:text-sidebar-primary-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
461
- {
462
- variants: {
463
- variant: {
464
- default: "hover:bg-sidebar-primary hover:text-sidebar-primary-foreground",
465
- outline: "hover:bg-sidebar-primary hover:text-sidebar-primary-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-primary))]"
466
- },
467
- size: {
468
- default: "h-8 text-sm",
469
- sm: "h-7 text-xs",
470
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
471
- }
472
- },
473
- defaultVariants: {
474
- variant: "default",
475
- size: "default"
476
- }
477
- }
478
- );
479
- var SidebarMenuButton = React.forwardRef(
480
- ({
481
- asChild = false,
482
- isActive = false,
483
- variant = "default",
484
- size = "default",
485
- className,
486
- ...props
487
- }, ref) => {
488
- const Comp = asChild ? Slot : "button";
489
- const button = /* @__PURE__ */ jsx(
490
- Comp,
491
- {
492
- ref,
493
- "data-sidebar": "menu-button",
494
- "data-size": size,
495
- "data-active": isActive,
496
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
497
- ...props
498
- }
499
- );
500
- return button;
501
- }
502
- );
503
- SidebarMenuButton.displayName = "SidebarMenuButton";
504
- var SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
505
- const Comp = asChild ? Slot : "button";
506
- return /* @__PURE__ */ jsx(
507
- Comp,
508
- {
509
- ref,
510
- "data-sidebar": "menu-action",
511
- className: cn(
512
- "text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
513
- // Increases the hit area of the button on mobile.
514
- "after:absolute after:-inset-2 md:after:hidden",
515
- "peer-data-[size=sm]/menu-button:top-1",
516
- "peer-data-[size=default]/menu-button:top-1.5",
517
- "peer-data-[size=lg]/menu-button:top-2.5",
518
- "group-data-[collapsible=icon]:hidden",
519
- showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
520
- className
521
- ),
522
- ...props
523
- }
524
- );
525
- });
526
- SidebarMenuAction.displayName = "SidebarMenuAction";
527
- var SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
528
- "div",
529
- {
530
- ref,
531
- "data-sidebar": "menu-badge",
532
- className: cn(
533
- "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
534
- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
535
- "peer-data-[size=sm]/menu-button:top-1",
536
- "peer-data-[size=default]/menu-button:top-1.5",
537
- "peer-data-[size=lg]/menu-button:top-2.5",
538
- "group-data-[collapsible=icon]:hidden",
539
- className
540
- ),
541
- ...props
542
- }
543
- ));
544
- SidebarMenuBadge.displayName = "SidebarMenuBadge";
545
- var SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
546
- const width = React.useMemo(() => {
547
- return `${Math.floor(Math.random() * 40) + 50}%`;
548
- }, []);
549
- return /* @__PURE__ */ jsxs(
550
- "div",
551
- {
552
- ref,
553
- "data-sidebar": "menu-skeleton",
554
- className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
555
- ...props,
556
- children: [
557
- showIcon && /* @__PURE__ */ jsx(
558
- Skeleton,
559
- {
560
- className: "size-4 rounded-md",
561
- "data-sidebar": "menu-skeleton-icon"
562
- }
563
- ),
564
- /* @__PURE__ */ jsx(
565
- Skeleton,
566
- {
567
- className: "h-4 max-w-(--skeleton-width) flex-1",
568
- "data-sidebar": "menu-skeleton-text",
569
- style: {
570
- "--skeleton-width": width
571
- }
572
- }
573
- )
574
- ]
575
- }
576
- );
577
- });
578
- SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
579
- var SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
580
- "ul",
581
- {
582
- ref,
583
- "data-sidebar": "menu-sub",
584
- className: cn(
585
- "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
586
- "group-data-[collapsible=icon]:hidden",
587
- className
588
- ),
589
- ...props
590
- }
591
- ));
592
- SidebarMenuSub.displayName = "SidebarMenuSub";
593
- var SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, ...props }));
594
- SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
595
- var SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
596
- const Comp = asChild ? Slot : "a";
597
- return /* @__PURE__ */ jsx(
598
- Comp,
599
- {
600
- ref,
601
- "data-sidebar": "menu-sub-button",
602
- "data-size": size,
603
- "data-active": isActive,
604
- className: cn(
605
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
606
- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
607
- size === "sm" && "text-xs",
608
- size === "md" && "text-sm",
609
- "group-data-[collapsible=icon]:hidden",
610
- className
611
- ),
612
- ...props
613
- }
614
- );
615
- });
616
- SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
617
-
618
- export { Sidebar, SidebarContent, SidebarContext, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, useSidebar };
619
- //# sourceMappingURL=chunk-3ZRE7GX6.js.map
620
- //# sourceMappingURL=chunk-3ZRE7GX6.js.map