@vitnode/core 1.2.0-canary.59 → 1.2.0-canary.61

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 (283) hide show
  1. package/dist/scripts/get-config.js +15 -0
  2. package/dist/scripts/plugin.js +188 -0
  3. package/dist/scripts/prepare-database.js +177 -0
  4. package/dist/scripts/prepare-plugins-files.js +134 -0
  5. package/dist/scripts/run-interactive-shell-command.js +21 -0
  6. package/dist/scripts/scripts.js +39 -13
  7. package/dist/scripts/shared/file-utils.js +203 -0
  8. package/dist/src/api/adapters/sso/discord.js +1 -77
  9. package/dist/src/api/adapters/sso/facebook.js +1 -76
  10. package/dist/src/api/adapters/sso/google.js +1 -87
  11. package/dist/src/api/config.js +1 -67
  12. package/dist/src/api/lib/check-plugin-id.js +1 -43
  13. package/dist/src/api/lib/cron.js +1 -22
  14. package/dist/src/api/lib/logger-middleware.js +1 -35
  15. package/dist/src/api/lib/module.js +1 -22
  16. package/dist/src/api/lib/plugin.js +1 -22
  17. package/dist/src/api/lib/route.js +1 -27
  18. package/dist/src/api/lib/with-pagination.js +1 -83
  19. package/dist/src/api/middlewares/captcha.middleware.js +1 -63
  20. package/dist/src/api/middlewares/cron-auth.middleware.js +1 -19
  21. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
  22. package/dist/src/api/middlewares/global.middleware.js +1 -104
  23. package/dist/src/api/middlewares/rate-limiter.middleware.js +1 -32
  24. package/dist/src/api/models/device.js +1 -61
  25. package/dist/src/api/models/email.d.ts.map +1 -1
  26. package/dist/src/api/models/email.js +1 -77
  27. package/dist/src/api/models/password.js +1 -36
  28. package/dist/src/api/models/session-admin.d.ts.map +1 -1
  29. package/dist/src/api/models/session-admin.js +1 -97
  30. package/dist/src/api/models/session.d.ts.map +1 -1
  31. package/dist/src/api/models/session.js +1 -76
  32. package/dist/src/api/models/sso.js +1 -120
  33. package/dist/src/api/models/user/get-user-by-id.js +1 -19
  34. package/dist/src/api/models/user/sign-in-with-passwords.js +1 -22
  35. package/dist/src/api/models/user/sign-up.js +1 -73
  36. package/dist/src/api/models/user.js +1 -8
  37. package/dist/src/api/modules/admin/admin.module.js +1 -19
  38. package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +1 -11
  39. package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +1 -12
  40. package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +1 -66
  41. package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +1 -95
  42. package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -10
  43. package/dist/src/api/modules/admin/debug/routes/logs.route.js +1 -94
  44. package/dist/src/api/modules/admin/routes/session.route.js +1 -47
  45. package/dist/src/api/modules/admin/users/routes/list.route.js +1 -79
  46. package/dist/src/api/modules/admin/users/routes/users.route.js +1 -84
  47. package/dist/src/api/modules/admin/users/users.admin.module.js +1 -10
  48. package/dist/src/api/modules/cron/cron/clean.cron.js +1 -24
  49. package/dist/src/api/modules/cron/cron.module.js +1 -14
  50. package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -1
  51. package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +1 -72
  52. package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -1
  53. package/dist/src/api/modules/cron/routes/cron.route.js +1 -95
  54. package/dist/src/api/modules/middleware/middleware.module.js +1 -10
  55. package/dist/src/api/modules/middleware/route.js +1 -49
  56. package/dist/src/api/modules/users/avatar-color.js +1 -43
  57. package/dist/src/api/modules/users/routes/change-password.route.js +1 -58
  58. package/dist/src/api/modules/users/routes/reset-passowrd.route.js +1 -91
  59. package/dist/src/api/modules/users/routes/session.route.js +1 -46
  60. package/dist/src/api/modules/users/routes/sign-in.route.js +1 -71
  61. package/dist/src/api/modules/users/routes/sign-out.route.js +1 -43
  62. package/dist/src/api/modules/users/routes/sign-up.route.js +1 -77
  63. package/dist/src/api/modules/users/routes/test.route.js +1 -33
  64. package/dist/src/api/modules/users/sso/routes/callback.route.js +1 -52
  65. package/dist/src/api/modules/users/sso/routes/create-url.route.js +1 -36
  66. package/dist/src/api/modules/users/sso/sso.module.js +1 -12
  67. package/dist/src/api/modules/users/users.module.js +1 -26
  68. package/dist/src/api/plugin.js +1 -15
  69. package/dist/src/app/login/page.js +1 -16
  70. package/dist/src/app/login/reset-password/page.js +1 -18
  71. package/dist/src/app/login/sso/[providerId]/page.js +1 -10
  72. package/dist/src/app/register/page.js +1 -16
  73. package/dist/src/app_admin/core/advanced/cron/page.js +1 -42
  74. package/dist/src/app_admin/core/debug/page.js +1 -45
  75. package/dist/src/app_admin/core/page.js +1 -5
  76. package/dist/src/app_admin/core/test/page.js +1 -5
  77. package/dist/src/app_admin/core/users/page.js +1 -38
  78. package/dist/src/components/avatar.js +1 -14
  79. package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +1 -42
  80. package/dist/src/components/confirm-action/content.js +1 -31
  81. package/dist/src/components/date-format.js +1 -41
  82. package/dist/src/components/form/auto-form.js +1 -103
  83. package/dist/src/components/form/common/desc.js +1 -9
  84. package/dist/src/components/form/common/label.js +1 -18
  85. package/dist/src/components/form/fields/checkbox.js +1 -37
  86. package/dist/src/components/form/fields/combobox-async.js +1 -123
  87. package/dist/src/components/form/fields/combobox.js +1 -87
  88. package/dist/src/components/form/fields/input.js +1 -39
  89. package/dist/src/components/form/fields/radio-group.js +1 -50
  90. package/dist/src/components/form/fields/select.js +1 -58
  91. package/dist/src/components/form/fields/switch.js +1 -36
  92. package/dist/src/components/form/fields/textarea.js +1 -36
  93. package/dist/src/components/i18n-provider.js +1 -43
  94. package/dist/src/components/logo-vitnode.js +1 -119
  95. package/dist/src/components/switchers/langs/language-switcher.js +1 -47
  96. package/dist/src/components/switchers/themes/theme-switcher.js +1 -28
  97. package/dist/src/components/table/content.js +1 -81
  98. package/dist/src/components/table/data-table.js +1 -68
  99. package/dist/src/components/table/order-table-head.js +1 -50
  100. package/dist/src/components/table/pagination.js +1 -122
  101. package/dist/src/components/tiptap/extension.js +1 -33
  102. package/dist/src/components/tiptap/toolbar/actions/alignment-action.js +1 -91
  103. package/dist/src/components/tiptap/toolbar/actions/bold-action.js +1 -39
  104. package/dist/src/components/tiptap/toolbar/actions/headings-action.js +1 -93
  105. package/dist/src/components/tiptap/toolbar/actions/italic-action.js +1 -38
  106. package/dist/src/components/tiptap/toolbar/actions/list-action.js +1 -61
  107. package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +1 -59
  108. package/dist/src/components/tiptap/toolbar/actions/underline-action.js +1 -38
  109. package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +1 -63
  110. package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +1 -11
  111. package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +1 -55
  112. package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +1 -5
  113. package/dist/src/components/ui/accordion.js +1 -46
  114. package/dist/src/components/ui/alert-dialog.js +1 -123
  115. package/dist/src/components/ui/alert.js +1 -39
  116. package/dist/src/components/ui/badge.js +1 -28
  117. package/dist/src/components/ui/button-client.js +1 -57
  118. package/dist/src/components/ui/button.js +1 -32
  119. package/dist/src/components/ui/card.js +1 -52
  120. package/dist/src/components/ui/checkbox.js +1 -20
  121. package/dist/src/components/ui/collapsible.js +1 -22
  122. package/dist/src/components/ui/command.js +1 -98
  123. package/dist/src/components/ui/context-menu.js +1 -140
  124. package/dist/src/components/ui/dialog.js +1 -189
  125. package/dist/src/components/ui/drawer.js +1 -83
  126. package/dist/src/components/ui/dropdown-menu.js +1 -141
  127. package/dist/src/components/ui/editor-content.js +1 -10
  128. package/dist/src/components/ui/editor.js +1 -35
  129. package/dist/src/components/ui/form.js +1 -148
  130. package/dist/src/components/ui/header-content.js +1 -30
  131. package/dist/src/components/ui/hover-card.js +1 -29
  132. package/dist/src/components/ui/input-otp.js +1 -48
  133. package/dist/src/components/ui/input.js +1 -11
  134. package/dist/src/components/ui/label.js +1 -12
  135. package/dist/src/components/ui/loader.js +1 -16
  136. package/dist/src/components/ui/menubar.js +1 -151
  137. package/dist/src/components/ui/navigation-menu.js +1 -82
  138. package/dist/src/components/ui/popover.js +1 -35
  139. package/dist/src/components/ui/progress.js +1 -19
  140. package/dist/src/components/ui/radio-group.js +1 -27
  141. package/dist/src/components/ui/scroll-area.js +1 -33
  142. package/dist/src/components/ui/select.js +1 -113
  143. package/dist/src/components/ui/separator.js +1 -14
  144. package/dist/src/components/ui/sheet.js +1 -92
  145. package/dist/src/components/ui/sidebar.js +1 -433
  146. package/dist/src/components/ui/skeleton.js +1 -10
  147. package/dist/src/components/ui/slider.js +1 -50
  148. package/dist/src/components/ui/sonner.js +1 -26
  149. package/dist/src/components/ui/switch.js +1 -16
  150. package/dist/src/components/ui/table.js +1 -63
  151. package/dist/src/components/ui/tabs.js +1 -33
  152. package/dist/src/components/ui/textarea.js +1 -10
  153. package/dist/src/components/ui/toggle-group.js +1 -45
  154. package/dist/src/components/ui/toggle.js +1 -34
  155. package/dist/src/components/ui/tooltip.js +1 -57
  156. package/dist/src/config.js +1 -4
  157. package/dist/src/database/admins.js +1 -74
  158. package/dist/src/database/cron.js +1 -22
  159. package/dist/src/database/languages.js +1 -52
  160. package/dist/src/database/logs.js +1 -34
  161. package/dist/src/database/moderators.js +1 -37
  162. package/dist/src/database/roles.js +1 -13
  163. package/dist/src/database/sessions.js +1 -60
  164. package/dist/src/database/users.js +1 -145
  165. package/dist/src/drizzle.config.js +1 -67
  166. package/dist/src/emails/default-template.js +1 -99
  167. package/dist/src/emails/reset-password.js +1 -132
  168. package/dist/src/emails/ui/button.js +1 -36
  169. package/dist/src/emails/ui/card.js +1 -39
  170. package/dist/src/hooks/use-before-unload.js +1 -30
  171. package/dist/src/hooks/use-captcha.js +1 -122
  172. package/dist/src/hooks/use-mobile.js +1 -16
  173. package/dist/src/lib/api/get-middleware-api.js +1 -13
  174. package/dist/src/lib/api/get-next-cron-run-date.js +1 -14
  175. package/dist/src/lib/api/get-next-cron-run-date.test.js +1 -55
  176. package/dist/src/lib/api/get-session-admin-api.js +1 -19
  177. package/dist/src/lib/api/get-session-api.js +1 -14
  178. package/dist/src/lib/api/should-cron-job-run.js +1 -16
  179. package/dist/src/lib/api/should-cron-job-run.test.js +1 -213
  180. package/dist/src/lib/api/validate-cron-schedule.d.ts +2 -0
  181. package/dist/src/lib/api/validate-cron-schedule.d.ts.map +1 -0
  182. package/dist/src/lib/api/validate-cron-schedule.js +1 -0
  183. package/dist/src/lib/api/validate-cron-schedule.test.d.ts +2 -0
  184. package/dist/src/lib/api/validate-cron-schedule.test.d.ts.map +1 -0
  185. package/dist/src/lib/api/validate-cron-schedule.test.js +1 -0
  186. package/dist/src/lib/colors.js +1 -140
  187. package/dist/src/lib/colors.test.js +1 -173
  188. package/dist/src/lib/config.js +1 -14
  189. package/dist/src/lib/ctrl-or-command-character.js +1 -5
  190. package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -12
  191. package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +1 -78
  192. package/dist/src/lib/fetcher/core.js +3 -48
  193. package/dist/src/lib/fetcher/helpers-server.js +1 -18
  194. package/dist/src/lib/fetcher/helpers.js +1 -16
  195. package/dist/src/lib/fetcher/helpers.test.js +1 -37
  196. package/dist/src/lib/fetcher/types.js +1 -1
  197. package/dist/src/lib/fetcher-client.js +1 -17
  198. package/dist/src/lib/fetcher.js +1 -33
  199. package/dist/src/lib/helpers/auto-form.js +1 -98
  200. package/dist/src/lib/helpers/auto-form.test.js +1 -336
  201. package/dist/src/lib/navigation.d.ts +15 -13
  202. package/dist/src/lib/navigation.d.ts.map +1 -1
  203. package/dist/src/lib/navigation.js +1 -11
  204. package/dist/src/lib/plugin.js +1 -3
  205. package/dist/src/lib/special-characters.js +1 -4
  206. package/dist/src/lib/special-characters.test.js +1 -56
  207. package/dist/src/lib/utils.js +1 -5
  208. package/dist/src/locales/en.json +308 -0
  209. package/dist/src/tests/setup.js +1 -6
  210. package/dist/src/views/admin/layouts/admin-layout.js +1 -73
  211. package/dist/src/views/admin/layouts/sidebar/nav/item.js +1 -98
  212. package/dist/src/views/admin/layouts/sidebar/nav/nav.js +1 -60
  213. package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -28
  214. package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -14
  215. package/dist/src/views/admin/layouts/user-bar/client.js +1 -69
  216. package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -32
  217. package/dist/src/views/admin/sign-in/sign-in-admin-view.js +1 -27
  218. package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +1 -97
  219. package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +1 -23
  220. package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +1 -38
  221. package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +1 -44
  222. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +1 -35
  223. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +1 -5
  224. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +1 -281
  225. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +1 -67
  226. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +1 -14
  227. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +1 -30
  228. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +1 -96
  229. package/dist/src/views/admin/views/core/test.js +1 -161
  230. package/dist/src/views/admin/views/core/users/users-admin-view.js +1 -89
  231. package/dist/src/views/auth/password-reset/change-password-form/form.js +1 -48
  232. package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +1 -22
  233. package/dist/src/views/auth/password-reset/change-password-form/use-form.js +1 -36
  234. package/dist/src/views/auth/password-reset/form/form.js +1 -104
  235. package/dist/src/views/auth/password-reset/form/mutation-api.js +1 -21
  236. package/dist/src/views/auth/password-reset/form/use-form.js +1 -33
  237. package/dist/src/views/auth/password-reset/password-reset-view.js +1 -37
  238. package/dist/src/views/auth/sign-in/form/form.js +1 -64
  239. package/dist/src/views/auth/sign-in/form/mutation-api.js +1 -33
  240. package/dist/src/views/auth/sign-in/form/use-form.d.ts.map +1 -1
  241. package/dist/src/views/auth/sign-in/form/use-form.js +1 -38
  242. package/dist/src/views/auth/sign-in/sign-in-view.js +1 -61
  243. package/dist/src/views/auth/sign-up/components/password-input.js +1 -96
  244. package/dist/src/views/auth/sign-up/email-confirmation-view.js +1 -55
  245. package/dist/src/views/auth/sign-up/form/form.js +1 -89
  246. package/dist/src/views/auth/sign-up/form/mutation-api.js +1 -30
  247. package/dist/src/views/auth/sign-up/form/use-form.js +1 -70
  248. package/dist/src/views/auth/sign-up/sign-up-view.js +1 -65
  249. package/dist/src/views/auth/sign-up/wrapper.js +1 -22
  250. package/dist/src/views/auth/sso/buttons/client.js +1 -22
  251. package/dist/src/views/auth/sso/buttons/mutation-api.js +1 -24
  252. package/dist/src/views/auth/sso/buttons/sso-buttons.js +1 -56
  253. package/dist/src/views/auth/sso/callback/callback-sso-view.js +1 -32
  254. package/dist/src/views/auth/sso/callback/client/client.js +1 -68
  255. package/dist/src/views/auth/sso/callback/client/mutation-api.js +1 -32
  256. package/dist/src/views/error/back-button.js +1 -14
  257. package/dist/src/views/error/error-view.js +1 -58
  258. package/dist/src/views/error/global-error-view.js +1 -50
  259. package/dist/src/views/layouts/provider.js +1 -44
  260. package/dist/src/views/layouts/root-layout.js +1 -25
  261. package/dist/src/views/layouts/theme/header/header.js +1 -38
  262. package/dist/src/views/layouts/theme/header/user/auth/auth.js +1 -33
  263. package/dist/src/views/layouts/theme/header/user/auth/client.js +1 -47
  264. package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +1 -27
  265. package/dist/src/views/layouts/theme/header/user/user.js +1 -32
  266. package/dist/src/views/layouts/theme/layout.js +1 -16
  267. package/dist/src/vitnode.config.d.ts.map +1 -1
  268. package/dist/src/vitnode.config.js +1 -42
  269. package/dist/tsconfig.tsbuildinfo +1 -1
  270. package/dist/tsup.config.js +18 -0
  271. package/dist/vitest.config.d.ts.map +1 -1
  272. package/dist/vitest.config.js +49 -0
  273. package/eslint.config.mjs +2 -0
  274. package/package.json +40 -44
  275. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +0 -3
  276. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +0 -1
  277. package/dist/src/api/adapters/cron/node-cron.adapter.js +0 -11
  278. package/dist/src/api/adapters/email/nodemailer.d.ts +0 -10
  279. package/dist/src/api/adapters/email/nodemailer.d.ts.map +0 -1
  280. package/dist/src/api/adapters/email/nodemailer.js +0 -30
  281. package/dist/src/api/adapters/email/resend.d.ts +0 -6
  282. package/dist/src/api/adapters/email/resend.d.ts.map +0 -1
  283. package/dist/src/api/adapters/email/resend.js +0 -21
@@ -1,148 +1 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useTranslations } from "next-intl";
4
- import { Slot } from "radix-ui";
5
- import React from "react";
6
- import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
7
- import { Label } from "./label.js";
8
- import { cn } from "../../lib/utils.js";
9
- import { useBeforeUnload } from "../../hooks/use-before-unload.js";
10
- import { Button } from "./button.js";
11
- import { useDialog } from "./dialog.js";
12
- function Form({ children, form, className, onSubmit, ...props }) {
13
- const t = useTranslations("core.global");
14
- const formIsDirty = form.formState.isDirty;
15
- useBeforeUnload(formIsDirty && !props.disableBeforeUnload, `${t("are_you_sure_want_to_leave_form.title")} ${t("are_you_sure_want_to_leave_form.desc")}`);
16
- const { setIsDirty } = useDialog();
17
- React.useEffect(()=>{
18
- if (props.disableBeforeUnload) return;
19
- setIsDirty?.(formIsDirty);
20
- }, [
21
- formIsDirty,
22
- props.disableBeforeUnload,
23
- setIsDirty
24
- ]);
25
- return /*#__PURE__*/ _jsx(FormProvider, {
26
- ...form,
27
- children: /*#__PURE__*/ _jsx("form", {
28
- className: cn("space-y-8", className),
29
- onSubmit: form.handleSubmit(onSubmit),
30
- ...props,
31
- children: children
32
- })
33
- });
34
- }
35
- const FormFieldContext = /*#__PURE__*/ React.createContext({});
36
- const FormField = ({ ...props })=>{
37
- const contextValue = React.useMemo(()=>({
38
- name: props.name
39
- }), [
40
- props.name
41
- ]);
42
- return /*#__PURE__*/ _jsx(FormFieldContext, {
43
- value: contextValue,
44
- children: /*#__PURE__*/ _jsx(Controller, {
45
- ...props
46
- })
47
- });
48
- };
49
- const useFormField = ()=>{
50
- const fieldContext = React.use(FormFieldContext);
51
- const itemContext = React.use(FormItemContext);
52
- const { getFieldState } = useFormContext();
53
- const formState = useFormState({
54
- name: fieldContext.name
55
- });
56
- const fieldState = getFieldState(fieldContext.name, formState);
57
- if (!fieldContext) {
58
- throw new Error("useFormField should be used within <FormField>");
59
- }
60
- const { id } = itemContext;
61
- return {
62
- id,
63
- name: fieldContext.name,
64
- formItemId: `${id}-form-item`,
65
- formDescriptionId: `${id}-form-item-description`,
66
- formMessageId: `${id}-form-item-message`,
67
- ...fieldState
68
- };
69
- };
70
- const FormItemContext = /*#__PURE__*/ React.createContext({});
71
- function FormItem({ className, ...props }) {
72
- const id = React.useId();
73
- const contextValue = React.useMemo(()=>({
74
- id
75
- }), [
76
- id
77
- ]);
78
- return /*#__PURE__*/ _jsx(FormItemContext, {
79
- value: contextValue,
80
- children: /*#__PURE__*/ _jsx("div", {
81
- className: cn("grid gap-2", className),
82
- "data-slot": "form-item",
83
- ...props
84
- })
85
- });
86
- }
87
- function FormLabel({ className, children, isOptional, ...props }) {
88
- const t = useTranslations("core.global");
89
- const { error, formItemId } = useFormField();
90
- return /*#__PURE__*/ _jsxs(Label, {
91
- className: cn("data-[error=true]:text-destructive", className),
92
- "data-error": !!error,
93
- "data-slot": "form-label",
94
- htmlFor: formItemId,
95
- ...props,
96
- children: [
97
- children,
98
- isOptional && /*#__PURE__*/ _jsx("span", {
99
- className: "text-muted-foreground text-xs",
100
- children: t("optional")
101
- })
102
- ]
103
- });
104
- }
105
- function FormControl({ ...props }) {
106
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
107
- return /*#__PURE__*/ _jsx(Slot.Root, {
108
- "aria-describedby": error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId,
109
- "aria-invalid": !!error,
110
- "data-slot": "form-control",
111
- id: formItemId,
112
- ...props
113
- });
114
- }
115
- function FormDescription({ className, ...props }) {
116
- const { formDescriptionId } = useFormField();
117
- return /*#__PURE__*/ _jsx("p", {
118
- className: cn("text-muted-foreground text-sm", className),
119
- "data-slot": "form-description",
120
- id: formDescriptionId,
121
- ...props
122
- });
123
- }
124
- function FormMessage({ className, ...props }) {
125
- const { error, formMessageId } = useFormField();
126
- const body = error ? error?.message ?? "" : props.children;
127
- if (!body) {
128
- return null;
129
- }
130
- return /*#__PURE__*/ _jsx("p", {
131
- className: cn("text-destructive text-sm", className),
132
- "data-slot": "form-message",
133
- id: formMessageId,
134
- ...props,
135
- children: body
136
- });
137
- }
138
- const FormButtonSubmit = ({ className, ...props })=>{
139
- const { formState } = useFormContext();
140
- return /*#__PURE__*/ _jsx(Button, {
141
- className: cn("w-full", className),
142
- disabled: !formState.isValid,
143
- isLoading: formState.isSubmitting,
144
- type: "submit",
145
- ...props
146
- });
147
- };
148
- export { Form, FormButtonSubmit, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
1
+ "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useTranslations}from"next-intl";import{Slot}from"radix-ui";import React from"react";import{Controller,FormProvider,useFormContext,useFormState}from"react-hook-form";import{Label}from"./label.js";import{cn}from"../../lib/utils.js";import{useBeforeUnload}from"../../hooks/use-before-unload.js";import{Button}from"./button.js";import{useDialog}from"./dialog.js";function Form({children,form,className,onSubmit,...props}){const t=useTranslations("core.global");const formIsDirty=form.formState.isDirty;useBeforeUnload(formIsDirty&&!props.disableBeforeUnload,`${t("are_you_sure_want_to_leave_form.title")} ${t("are_you_sure_want_to_leave_form.desc")}`);const{setIsDirty}=useDialog();React.useEffect(()=>{if(props.disableBeforeUnload)return;setIsDirty?.(formIsDirty)},[formIsDirty,props.disableBeforeUnload,setIsDirty]);return _jsx(FormProvider,{...form,children:_jsx("form",{className:cn("space-y-8",className),onSubmit:form.handleSubmit(onSubmit),...props,children:children})})}const FormFieldContext=React.createContext({});const FormField=({...props})=>{const contextValue=React.useMemo(()=>({name:props.name}),[props.name]);return _jsx(FormFieldContext,{value:contextValue,children:_jsx(Controller,{...props})})};const useFormField=()=>{const fieldContext=React.use(FormFieldContext);const itemContext=React.use(FormItemContext);const{getFieldState}=useFormContext();const formState=useFormState({name:fieldContext.name});const fieldState=getFieldState(fieldContext.name,formState);if(!fieldContext){throw new Error("useFormField should be used within <FormField>")}const{id}=itemContext;return{id,name:fieldContext.name,formItemId:`${id}-form-item`,formDescriptionId:`${id}-form-item-description`,formMessageId:`${id}-form-item-message`,...fieldState}};const FormItemContext=React.createContext({});function FormItem({className,...props}){const id=React.useId();const contextValue=React.useMemo(()=>({id}),[id]);return _jsx(FormItemContext,{value:contextValue,children:_jsx("div",{className:cn("grid gap-2",className),"data-slot":"form-item",...props})})}function FormLabel({className,children,isOptional,...props}){const t=useTranslations("core.global");const{error,formItemId}=useFormField();return _jsxs(Label,{className:cn("data-[error=true]:text-destructive",className),"data-error":!!error,"data-slot":"form-label",htmlFor:formItemId,...props,children:[children,isOptional&&_jsx("span",{className:"text-muted-foreground text-xs",children:t("optional")})]})}function FormControl({...props}){const{error,formItemId,formDescriptionId,formMessageId}=useFormField();return _jsx(Slot.Root,{"aria-describedby":error?`${formDescriptionId} ${formMessageId}`:formDescriptionId,"aria-invalid":!!error,"data-slot":"form-control",id:formItemId,...props})}function FormDescription({className,...props}){const{formDescriptionId}=useFormField();return _jsx("p",{className:cn("text-muted-foreground text-sm",className),"data-slot":"form-description",id:formDescriptionId,...props})}function FormMessage({className,...props}){const{error,formMessageId}=useFormField();const body=error?error?.message??"":props.children;if(!body){return null}return _jsx("p",{className:cn("text-destructive text-sm",className),"data-slot":"form-message",id:formMessageId,...props,children:body})}const FormButtonSubmit=({className,...props})=>{const{formState}=useFormContext();return _jsx(Button,{className:cn("w-full",className),disabled:!formState.isValid,isLoading:formState.isSubmitting,type:"submit",...props})};export{Form,FormButtonSubmit,FormControl,FormDescription,FormField,FormItem,FormLabel,FormMessage,useFormField};
@@ -1,30 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "../../lib/utils.js";
3
- export const HeaderContent = ({ children, className, desc, h1, h2, ref })=>{
4
- return /*#__PURE__*/ _jsxs("div", {
5
- className: cn("mb-6 flex min-h-9 flex-col items-start gap-2 sm:flex-row sm:gap-4", className),
6
- ref: ref,
7
- children: [
8
- /*#__PURE__*/ _jsxs("div", {
9
- className: "h-full flex-1 space-y-1 text-left sm:self-center",
10
- children: [
11
- h1 ? /*#__PURE__*/ _jsx("h1", {
12
- className: "text-foreground text-2xl font-bold sm:text-3xl",
13
- children: h1
14
- }) : /*#__PURE__*/ _jsx("h2", {
15
- className: "text-foreground text-xl font-bold sm:text-2xl",
16
- children: h2
17
- }),
18
- desc && /*#__PURE__*/ _jsx("div", {
19
- className: "text-muted-foreground",
20
- children: desc
21
- })
22
- ]
23
- }),
24
- children && /*#__PURE__*/ _jsx("div", {
25
- className: "flex w-full flex-col flex-wrap items-center justify-center gap-2 sm:w-auto sm:flex-row [&>*]:w-full [&>*]:sm:w-auto",
26
- children: children
27
- })
28
- ]
29
- });
30
- };
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{cn}from"../../lib/utils.js";export const HeaderContent=({children,className,desc,h1,h2,ref})=>{return _jsxs("div",{className:cn("mb-6 flex min-h-9 flex-col items-start gap-2 sm:flex-row sm:gap-4",className),ref:ref,children:[_jsxs("div",{className:"h-full flex-1 space-y-1 text-left sm:self-center",children:[h1?_jsx("h1",{className:"text-foreground text-2xl font-bold sm:text-3xl",children:h1}):_jsx("h2",{className:"text-foreground text-xl font-bold sm:text-2xl",children:h2}),desc&&_jsx("div",{className:"text-muted-foreground",children:desc})]}),children&&_jsx("div",{className:"flex w-full flex-col flex-wrap items-center justify-center gap-2 sm:w-auto sm:flex-row [&>*]:w-full [&>*]:sm:w-auto",children:children})]})};
@@ -1,29 +1 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { HoverCard as HoverCardPrimitive } from "radix-ui";
4
- import { cn } from "../../lib/utils.js";
5
- function HoverCard({ ...props }) {
6
- return /*#__PURE__*/ _jsx(HoverCardPrimitive.Root, {
7
- "data-slot": "hover-card",
8
- ...props
9
- });
10
- }
11
- function HoverCardTrigger({ ...props }) {
12
- return /*#__PURE__*/ _jsx(HoverCardPrimitive.Trigger, {
13
- "data-slot": "hover-card-trigger",
14
- ...props
15
- });
16
- }
17
- function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
18
- return /*#__PURE__*/ _jsx(HoverCardPrimitive.Portal, {
19
- "data-slot": "hover-card-portal",
20
- children: /*#__PURE__*/ _jsx(HoverCardPrimitive.Content, {
21
- align: align,
22
- className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin) outline-hidden z-50 w-64 rounded-md border p-4 shadow-md", className),
23
- "data-slot": "hover-card-content",
24
- sideOffset: sideOffset,
25
- ...props
26
- })
27
- });
28
- }
29
- export { HoverCard, HoverCardContent, HoverCardTrigger };
1
+ "use client";import{jsx as _jsx}from"react/jsx-runtime";import{HoverCard as HoverCardPrimitive}from"radix-ui";import{cn}from"../../lib/utils.js";function HoverCard({...props}){return _jsx(HoverCardPrimitive.Root,{"data-slot":"hover-card",...props})}function HoverCardTrigger({...props}){return _jsx(HoverCardPrimitive.Trigger,{"data-slot":"hover-card-trigger",...props})}function HoverCardContent({className,align="center",sideOffset=4,...props}){return _jsx(HoverCardPrimitive.Portal,{"data-slot":"hover-card-portal",children:_jsx(HoverCardPrimitive.Content,{align:align,className:cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",className),"data-slot":"hover-card-content",sideOffset:sideOffset,...props})})}export{HoverCard,HoverCardContent,HoverCardTrigger};
@@ -1,48 +1 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { OTPInput, OTPInputContext } from "input-otp";
4
- import { MinusIcon } from "lucide-react";
5
- import React from "react";
6
- import { cn } from "../../lib/utils.js";
7
- function InputOTP({ className, containerClassName, ...props }) {
8
- return /*#__PURE__*/ _jsx(OTPInput, {
9
- className: cn("disabled:cursor-not-allowed", className),
10
- containerClassName: cn("has-disabled:opacity-50 flex items-center gap-2", containerClassName),
11
- "data-slot": "input-otp",
12
- ...props
13
- });
14
- }
15
- function InputOTPGroup({ className, ...props }) {
16
- return /*#__PURE__*/ _jsx("div", {
17
- className: cn("flex items-center", className),
18
- "data-slot": "input-otp-group",
19
- ...props
20
- });
21
- }
22
- function InputOTPSlot({ index, className, ...props }) {
23
- const inputOTPContext = React.use(OTPInputContext);
24
- const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
25
- return /*#__PURE__*/ _jsxs("div", {
26
- className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input shadow-xs relative flex h-9 w-9 items-center justify-center border-y border-r text-sm outline-none transition-all first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
27
- "data-active": isActive,
28
- "data-slot": "input-otp-slot",
29
- ...props,
30
- children: [
31
- char,
32
- hasFakeCaret && /*#__PURE__*/ _jsx("div", {
33
- className: "pointer-events-none absolute inset-0 flex items-center justify-center",
34
- children: /*#__PURE__*/ _jsx("div", {
35
- className: "animate-caret-blink bg-foreground h-4 w-px duration-1000"
36
- })
37
- })
38
- ]
39
- });
40
- }
41
- function InputOTPSeparator({ ...props }) {
42
- return /*#__PURE__*/ _jsx("div", {
43
- "data-slot": "input-otp-separator",
44
- ...props,
45
- children: /*#__PURE__*/ _jsx(MinusIcon, {})
46
- });
47
- }
48
- export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
1
+ "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{OTPInput,OTPInputContext}from"input-otp";import{MinusIcon}from"lucide-react";import React from"react";import{cn}from"../../lib/utils.js";function InputOTP({className,containerClassName,...props}){return _jsx(OTPInput,{className:cn("disabled:cursor-not-allowed",className),containerClassName:cn("flex items-center gap-2 has-disabled:opacity-50",containerClassName),"data-slot":"input-otp",...props})}function InputOTPGroup({className,...props}){return _jsx("div",{className:cn("flex items-center",className),"data-slot":"input-otp-group",...props})}function InputOTPSlot({index,className,...props}){const inputOTPContext=React.use(OTPInputContext);const{char,hasFakeCaret,isActive}=inputOTPContext?.slots[index]??{};return _jsxs("div",{className:cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",className),"data-active":isActive,"data-slot":"input-otp-slot",...props,children:[char,hasFakeCaret&&_jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function InputOTPSeparator({...props}){return _jsx("div",{"data-slot":"input-otp-separator",...props,children:_jsx(MinusIcon,{})})}export{InputOTP,InputOTPGroup,InputOTPSeparator,InputOTPSlot};
@@ -1,11 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../../lib/utils.js";
3
- function Input({ className, type, ...props }) {
4
- return /*#__PURE__*/ _jsx("input", {
5
- className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
6
- "data-slot": "input",
7
- type: type,
8
- ...props
9
- });
10
- }
11
- export { Input };
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{cn}from"../../lib/utils.js";function Input({className,type,...props}){return _jsx("input",{className:cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",className),"data-slot":"input",type:type,...props})}export{Input};
@@ -1,12 +1 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Label as LabelPrimitive } from "radix-ui";
4
- import { cn } from "../../lib/utils.js";
5
- function Label({ className, ...props }) {
6
- return /*#__PURE__*/ _jsx(LabelPrimitive.Root, {
7
- className: cn("flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50", className),
8
- "data-slot": "label",
9
- ...props
10
- });
11
- }
12
- export { Label };
1
+ "use client";import{jsx as _jsx}from"react/jsx-runtime";import{Label as LabelPrimitive}from"radix-ui";import{cn}from"../../lib/utils.js";function Label({className,...props}){return _jsx(LabelPrimitive.Root,{className:cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",className),"data-slot":"label",...props})}export{Label};
@@ -1,16 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Loader2 } from "lucide-react";
3
- import { cn } from "../../lib/utils.js";
4
- export const Loader = ({ className, small })=>{
5
- if (small) {
6
- return /*#__PURE__*/ _jsx(Loader2, {
7
- className: cn("size-5 animate-spin", className)
8
- });
9
- }
10
- return /*#__PURE__*/ _jsx("div", {
11
- className: cn("flex items-center justify-center", className),
12
- children: /*#__PURE__*/ _jsx(Loader2, {
13
- className: cn("size-10 animate-spin")
14
- })
15
- });
16
- };
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Loader2}from"lucide-react";import{cn}from"../../lib/utils.js";export const Loader=({className,small})=>{if(small){return _jsx(Loader2,{className:cn("size-5 animate-spin",className)})}return _jsx("div",{className:cn("flex items-center justify-center",className),children:_jsx(Loader2,{className:cn("size-10 animate-spin")})})};
@@ -1,151 +1 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
4
- import { Menubar as MenubarPrimitive } from "radix-ui";
5
- import { cn } from "../../lib/utils.js";
6
- function Menubar({ className, ...props }) {
7
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Root, {
8
- className: cn("bg-background shadow-xs flex h-9 items-center gap-1 rounded-md border p-1", className),
9
- "data-slot": "menubar",
10
- ...props
11
- });
12
- }
13
- function MenubarMenu({ ...props }) {
14
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Menu, {
15
- "data-slot": "menubar-menu",
16
- ...props
17
- });
18
- }
19
- function MenubarGroup({ ...props }) {
20
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Group, {
21
- "data-slot": "menubar-group",
22
- ...props
23
- });
24
- }
25
- function MenubarPortal({ ...props }) {
26
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Portal, {
27
- "data-slot": "menubar-portal",
28
- ...props
29
- });
30
- }
31
- function MenubarRadioGroup({ ...props }) {
32
- return /*#__PURE__*/ _jsx(MenubarPrimitive.RadioGroup, {
33
- "data-slot": "menubar-radio-group",
34
- ...props
35
- });
36
- }
37
- function MenubarTrigger({ className, ...props }) {
38
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Trigger, {
39
- className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden flex select-none items-center rounded-sm px-2 py-1 text-sm font-medium", className),
40
- "data-slot": "menubar-trigger",
41
- ...props
42
- });
43
- }
44
- function MenubarContent({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }) {
45
- return /*#__PURE__*/ _jsx(MenubarPortal, {
46
- children: /*#__PURE__*/ _jsx(MenubarPrimitive.Content, {
47
- align: align,
48
- alignOffset: alignOffset,
49
- className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin) z-50 min-w-[12rem] overflow-hidden rounded-md border p-1 shadow-md", className),
50
- "data-slot": "menubar-content",
51
- sideOffset: sideOffset,
52
- ...props
53
- })
54
- });
55
- }
56
- function MenubarItem({ className, inset, variant = "default", ...props }) {
57
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Item, {
58
- className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
59
- "data-inset": inset,
60
- "data-slot": "menubar-item",
61
- "data-variant": variant,
62
- ...props
63
- });
64
- }
65
- function MenubarCheckboxItem({ className, children, checked, ...props }) {
66
- return /*#__PURE__*/ _jsxs(MenubarPrimitive.CheckboxItem, {
67
- checked: checked,
68
- className: cn("focus:bg-accent focus:text-accent-foreground rounded-xs outline-hidden relative flex cursor-default select-none items-center gap-2 py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
69
- "data-slot": "menubar-checkbox-item",
70
- ...props,
71
- children: [
72
- /*#__PURE__*/ _jsx("span", {
73
- className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
74
- children: /*#__PURE__*/ _jsx(MenubarPrimitive.ItemIndicator, {
75
- children: /*#__PURE__*/ _jsx(CheckIcon, {
76
- className: "size-4"
77
- })
78
- })
79
- }),
80
- children
81
- ]
82
- });
83
- }
84
- function MenubarRadioItem({ className, children, ...props }) {
85
- return /*#__PURE__*/ _jsxs(MenubarPrimitive.RadioItem, {
86
- className: cn("focus:bg-accent focus:text-accent-foreground rounded-xs outline-hidden relative flex cursor-default select-none items-center gap-2 py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
87
- "data-slot": "menubar-radio-item",
88
- ...props,
89
- children: [
90
- /*#__PURE__*/ _jsx("span", {
91
- className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
92
- children: /*#__PURE__*/ _jsx(MenubarPrimitive.ItemIndicator, {
93
- children: /*#__PURE__*/ _jsx(CircleIcon, {
94
- className: "size-2 fill-current"
95
- })
96
- })
97
- }),
98
- children
99
- ]
100
- });
101
- }
102
- function MenubarLabel({ className, inset, ...props }) {
103
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Label, {
104
- className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
105
- "data-inset": inset,
106
- "data-slot": "menubar-label",
107
- ...props
108
- });
109
- }
110
- function MenubarSeparator({ className, ...props }) {
111
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Separator, {
112
- className: cn("bg-border -mx-1 my-1 h-px", className),
113
- "data-slot": "menubar-separator",
114
- ...props
115
- });
116
- }
117
- function MenubarShortcut({ className, ...props }) {
118
- return /*#__PURE__*/ _jsx("span", {
119
- className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
120
- "data-slot": "menubar-shortcut",
121
- ...props
122
- });
123
- }
124
- function MenubarSub({ ...props }) {
125
- return /*#__PURE__*/ _jsx(MenubarPrimitive.Sub, {
126
- "data-slot": "menubar-sub",
127
- ...props
128
- });
129
- }
130
- function MenubarSubTrigger({ className, inset, children, ...props }) {
131
- return /*#__PURE__*/ _jsxs(MenubarPrimitive.SubTrigger, {
132
- className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[inset]:pl-8", className),
133
- "data-inset": inset,
134
- "data-slot": "menubar-sub-trigger",
135
- ...props,
136
- children: [
137
- children,
138
- /*#__PURE__*/ _jsx(ChevronRightIcon, {
139
- className: "ml-auto size-4"
140
- })
141
- ]
142
- });
143
- }
144
- function MenubarSubContent({ className, ...props }) {
145
- return /*#__PURE__*/ _jsx(MenubarPrimitive.SubContent, {
146
- className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg", className),
147
- "data-slot": "menubar-sub-content",
148
- ...props
149
- });
150
- }
151
- export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger };
1
+ "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{CheckIcon,ChevronRightIcon,CircleIcon}from"lucide-react";import{Menubar as MenubarPrimitive}from"radix-ui";import{cn}from"../../lib/utils.js";function Menubar({className,...props}){return _jsx(MenubarPrimitive.Root,{className:cn("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",className),"data-slot":"menubar",...props})}function MenubarMenu({...props}){return _jsx(MenubarPrimitive.Menu,{"data-slot":"menubar-menu",...props})}function MenubarGroup({...props}){return _jsx(MenubarPrimitive.Group,{"data-slot":"menubar-group",...props})}function MenubarPortal({...props}){return _jsx(MenubarPrimitive.Portal,{"data-slot":"menubar-portal",...props})}function MenubarRadioGroup({...props}){return _jsx(MenubarPrimitive.RadioGroup,{"data-slot":"menubar-radio-group",...props})}function MenubarTrigger({className,...props}){return _jsx(MenubarPrimitive.Trigger,{className:cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",className),"data-slot":"menubar-trigger",...props})}function MenubarContent({className,align="start",alignOffset=-4,sideOffset=8,...props}){return _jsx(MenubarPortal,{children:_jsx(MenubarPrimitive.Content,{align:align,alignOffset:alignOffset,className:cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",className),"data-slot":"menubar-content",sideOffset:sideOffset,...props})})}function MenubarItem({className,inset,variant="default",...props}){return _jsx(MenubarPrimitive.Item,{className:cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",className),"data-inset":inset,"data-slot":"menubar-item","data-variant":variant,...props})}function MenubarCheckboxItem({className,children,checked,...props}){return _jsxs(MenubarPrimitive.CheckboxItem,{checked:checked,className:cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",className),"data-slot":"menubar-checkbox-item",...props,children:[_jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:_jsx(MenubarPrimitive.ItemIndicator,{children:_jsx(CheckIcon,{className:"size-4"})})}),children]})}function MenubarRadioItem({className,children,...props}){return _jsxs(MenubarPrimitive.RadioItem,{className:cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",className),"data-slot":"menubar-radio-item",...props,children:[_jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:_jsx(MenubarPrimitive.ItemIndicator,{children:_jsx(CircleIcon,{className:"size-2 fill-current"})})}),children]})}function MenubarLabel({className,inset,...props}){return _jsx(MenubarPrimitive.Label,{className:cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",className),"data-inset":inset,"data-slot":"menubar-label",...props})}function MenubarSeparator({className,...props}){return _jsx(MenubarPrimitive.Separator,{className:cn("bg-border -mx-1 my-1 h-px",className),"data-slot":"menubar-separator",...props})}function MenubarShortcut({className,...props}){return _jsx("span",{className:cn("text-muted-foreground ml-auto text-xs tracking-widest",className),"data-slot":"menubar-shortcut",...props})}function MenubarSub({...props}){return _jsx(MenubarPrimitive.Sub,{"data-slot":"menubar-sub",...props})}function MenubarSubTrigger({className,inset,children,...props}){return _jsxs(MenubarPrimitive.SubTrigger,{className:cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",className),"data-inset":inset,"data-slot":"menubar-sub-trigger",...props,children:[children,_jsx(ChevronRightIcon,{className:"ml-auto size-4"})]})}function MenubarSubContent({className,...props}){return _jsx(MenubarPrimitive.SubContent,{className:cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",className),"data-slot":"menubar-sub-content",...props})}export{Menubar,MenubarCheckboxItem,MenubarContent,MenubarGroup,MenubarItem,MenubarLabel,MenubarMenu,MenubarPortal,MenubarRadioGroup,MenubarRadioItem,MenubarSeparator,MenubarShortcut,MenubarSub,MenubarSubContent,MenubarSubTrigger,MenubarTrigger};
@@ -1,82 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cva } from "class-variance-authority";
3
- import { ChevronDownIcon } from "lucide-react";
4
- import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
5
- import { cn } from "../../lib/utils.js";
6
- function NavigationMenu({ className, children, viewport = true, ...props }) {
7
- return /*#__PURE__*/ _jsxs(NavigationMenuPrimitive.Root, {
8
- className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
9
- "data-slot": "navigation-menu",
10
- "data-viewport": viewport,
11
- ...props,
12
- children: [
13
- children,
14
- viewport && /*#__PURE__*/ _jsx(NavigationMenuViewport, {})
15
- ]
16
- });
17
- }
18
- function NavigationMenuList({ className, ...props }) {
19
- return /*#__PURE__*/ _jsx(NavigationMenuPrimitive.List, {
20
- className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
21
- "data-slot": "navigation-menu-list",
22
- ...props
23
- });
24
- }
25
- function NavigationMenuItem({ className, ...props }) {
26
- return /*#__PURE__*/ _jsx(NavigationMenuPrimitive.Item, {
27
- className: cn("relative", className),
28
- "data-slot": "navigation-menu-item",
29
- ...props
30
- });
31
- }
32
- const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");
33
- function NavigationMenuTrigger({ className, children, ...props }) {
34
- return /*#__PURE__*/ _jsxs(NavigationMenuPrimitive.Trigger, {
35
- className: cn(navigationMenuTriggerStyle(), "group", className),
36
- "data-slot": "navigation-menu-trigger",
37
- ...props,
38
- children: [
39
- children,
40
- " ",
41
- /*#__PURE__*/ _jsx(ChevronDownIcon, {
42
- "aria-hidden": "true",
43
- className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
44
- })
45
- ]
46
- });
47
- }
48
- function NavigationMenuContent({ className, ...props }) {
49
- return /*#__PURE__*/ _jsx(NavigationMenuPrimitive.Content, {
50
- className: cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full p-2 pr-2.5 md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200", className),
51
- "data-slot": "navigation-menu-content",
52
- ...props
53
- });
54
- }
55
- function NavigationMenuViewport({ className, ...props }) {
56
- return /*#__PURE__*/ _jsx("div", {
57
- className: cn("absolute left-0 top-full isolate z-50 flex justify-center"),
58
- children: /*#__PURE__*/ _jsx(NavigationMenuPrimitive.Viewport, {
59
- className: cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]", className),
60
- "data-slot": "navigation-menu-viewport",
61
- ...props
62
- })
63
- });
64
- }
65
- function NavigationMenuLink({ className, ...props }) {
66
- return /*#__PURE__*/ _jsx(NavigationMenuPrimitive.Link, {
67
- className: cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm outline-none transition-all focus-visible:outline-1 focus-visible:ring-[3px] [&_svg]:size-4", className),
68
- "data-slot": "navigation-menu-link",
69
- ...props
70
- });
71
- }
72
- function NavigationMenuIndicator({ className, ...props }) {
73
- return /*#__PURE__*/ _jsx(NavigationMenuPrimitive.Indicator, {
74
- className: cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden", className),
75
- "data-slot": "navigation-menu-indicator",
76
- ...props,
77
- children: /*#__PURE__*/ _jsx("div", {
78
- className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"
79
- })
80
- });
81
- }
82
- export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport };
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{cva}from"class-variance-authority";import{ChevronDownIcon}from"lucide-react";import{NavigationMenu as NavigationMenuPrimitive}from"radix-ui";import{cn}from"../../lib/utils.js";function NavigationMenu({className,children,viewport=true,...props}){return _jsxs(NavigationMenuPrimitive.Root,{className:cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",className),"data-slot":"navigation-menu","data-viewport":viewport,...props,children:[children,viewport&&_jsx(NavigationMenuViewport,{})]})}function NavigationMenuList({className,...props}){return _jsx(NavigationMenuPrimitive.List,{className:cn("group flex flex-1 list-none items-center justify-center gap-1",className),"data-slot":"navigation-menu-list",...props})}function NavigationMenuItem({className,...props}){return _jsx(NavigationMenuPrimitive.Item,{className:cn("relative",className),"data-slot":"navigation-menu-item",...props})}const navigationMenuTriggerStyle=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function NavigationMenuTrigger({className,children,...props}){return _jsxs(NavigationMenuPrimitive.Trigger,{className:cn(navigationMenuTriggerStyle(),"group",className),"data-slot":"navigation-menu-trigger",...props,children:[children," ",_jsx(ChevronDownIcon,{"aria-hidden":"true",className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"})]})}function NavigationMenuContent({className,...props}){return _jsx(NavigationMenuPrimitive.Content,{className:cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",className),"data-slot":"navigation-menu-content",...props})}function NavigationMenuViewport({className,...props}){return _jsx("div",{className:cn("absolute top-full left-0 isolate z-50 flex justify-center"),children:_jsx(NavigationMenuPrimitive.Viewport,{className:cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",className),"data-slot":"navigation-menu-viewport",...props})})}function NavigationMenuLink({className,...props}){return _jsx(NavigationMenuPrimitive.Link,{className:cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg]:size-4",className),"data-slot":"navigation-menu-link",...props})}function NavigationMenuIndicator({className,...props}){return _jsx(NavigationMenuPrimitive.Indicator,{className:cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",className),"data-slot":"navigation-menu-indicator",...props,children:_jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}export{NavigationMenu,NavigationMenuContent,NavigationMenuIndicator,NavigationMenuItem,NavigationMenuLink,NavigationMenuList,NavigationMenuTrigger,navigationMenuTriggerStyle,NavigationMenuViewport};
@@ -1,35 +1 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Popover as PopoverPrimitive } from "radix-ui";
4
- import { cn } from "../../lib/utils.js";
5
- function Popover({ ...props }) {
6
- return /*#__PURE__*/ _jsx(PopoverPrimitive.Root, {
7
- "data-slot": "popover",
8
- ...props
9
- });
10
- }
11
- function PopoverTrigger({ ...props }) {
12
- return /*#__PURE__*/ _jsx(PopoverPrimitive.Trigger, {
13
- "data-slot": "popover-trigger",
14
- ...props
15
- });
16
- }
17
- function PopoverContent({ className, align = "center", sideOffset = 4, collisionPadding = 8, ...props }) {
18
- return /*#__PURE__*/ _jsx(PopoverPrimitive.Portal, {
19
- children: /*#__PURE__*/ _jsx(PopoverPrimitive.Content, {
20
- align: align,
21
- className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin) outline-hidden z-50 w-72 rounded-md border p-4 shadow-md", className),
22
- collisionPadding: collisionPadding,
23
- "data-slot": "popover-content",
24
- sideOffset: sideOffset,
25
- ...props
26
- })
27
- });
28
- }
29
- function PopoverAnchor({ ...props }) {
30
- return /*#__PURE__*/ _jsx(PopoverPrimitive.Anchor, {
31
- "data-slot": "popover-anchor",
32
- ...props
33
- });
34
- }
35
- export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
1
+ "use client";import{jsx as _jsx}from"react/jsx-runtime";import{Popover as PopoverPrimitive}from"radix-ui";import{cn}from"../../lib/utils.js";function Popover({...props}){return _jsx(PopoverPrimitive.Root,{"data-slot":"popover",...props})}function PopoverTrigger({...props}){return _jsx(PopoverPrimitive.Trigger,{"data-slot":"popover-trigger",...props})}function PopoverContent({className,align="center",sideOffset=4,collisionPadding=8,...props}){return _jsx(PopoverPrimitive.Portal,{children:_jsx(PopoverPrimitive.Content,{align:align,className:cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",className),collisionPadding:collisionPadding,"data-slot":"popover-content",sideOffset:sideOffset,...props})})}function PopoverAnchor({...props}){return _jsx(PopoverPrimitive.Anchor,{"data-slot":"popover-anchor",...props})}export{Popover,PopoverAnchor,PopoverContent,PopoverTrigger};