@goplusvn/core 0.1.1 → 0.1.3

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 (223) hide show
  1. package/package.json +31 -175
  2. package/dist/audit/index.d.mts +0 -115
  3. package/dist/audit/index.d.ts +0 -115
  4. package/dist/audit/index.js +0 -204
  5. package/dist/audit/index.js.map +0 -1
  6. package/dist/audit/index.mjs +0 -200
  7. package/dist/audit/index.mjs.map +0 -1
  8. package/dist/auth/index.d.mts +0 -86
  9. package/dist/auth/index.d.ts +0 -86
  10. package/dist/auth/index.js +0 -210
  11. package/dist/auth/index.js.map +0 -1
  12. package/dist/auth/index.mjs +0 -198
  13. package/dist/auth/index.mjs.map +0 -1
  14. package/dist/button-1dWvP9Ib.d.mts +0 -30
  15. package/dist/button-1dWvP9Ib.d.ts +0 -30
  16. package/dist/calendar-2QzdEo1z.d.mts +0 -20
  17. package/dist/calendar-2QzdEo1z.d.ts +0 -20
  18. package/dist/code-generation/index.d.mts +0 -30
  19. package/dist/code-generation/index.d.ts +0 -30
  20. package/dist/code-generation/index.js +0 -31
  21. package/dist/code-generation/index.js.map +0 -1
  22. package/dist/code-generation/index.mjs +0 -28
  23. package/dist/code-generation/index.mjs.map +0 -1
  24. package/dist/configs/index.d.mts +0 -175
  25. package/dist/configs/index.d.ts +0 -175
  26. package/dist/configs/index.js +0 -254
  27. package/dist/configs/index.js.map +0 -1
  28. package/dist/configs/index.mjs +0 -233
  29. package/dist/configs/index.mjs.map +0 -1
  30. package/dist/crud/index.d.mts +0 -646
  31. package/dist/crud/index.d.ts +0 -646
  32. package/dist/crud/index.js +0 -11772
  33. package/dist/crud/index.js.map +0 -1
  34. package/dist/crud/index.mjs +0 -11665
  35. package/dist/crud/index.mjs.map +0 -1
  36. package/dist/crud/server.d.mts +0 -20
  37. package/dist/crud/server.d.ts +0 -20
  38. package/dist/crud/server.js +0 -123
  39. package/dist/crud/server.js.map +0 -1
  40. package/dist/crud/server.mjs +0 -120
  41. package/dist/crud/server.mjs.map +0 -1
  42. package/dist/data-table-skeleton-12NA8Mjx.d.mts +0 -39
  43. package/dist/data-table-skeleton-12NA8Mjx.d.ts +0 -39
  44. package/dist/dialog-bKfjZMTd.d.mts +0 -22
  45. package/dist/dialog-bKfjZMTd.d.ts +0 -22
  46. package/dist/dynamic-icon-DrGIiu2N.d.mts +0 -10
  47. package/dist/dynamic-icon-DrGIiu2N.d.ts +0 -10
  48. package/dist/home/index.d.mts +0 -269
  49. package/dist/home/index.d.ts +0 -269
  50. package/dist/home/index.js +0 -1678
  51. package/dist/home/index.js.map +0 -1
  52. package/dist/home/index.mjs +0 -1635
  53. package/dist/home/index.mjs.map +0 -1
  54. package/dist/hooks/index.d.mts +0 -7
  55. package/dist/hooks/index.d.ts +0 -7
  56. package/dist/hooks/index.js +0 -8316
  57. package/dist/hooks/index.js.map +0 -1
  58. package/dist/hooks/index.mjs +0 -8255
  59. package/dist/hooks/index.mjs.map +0 -1
  60. package/dist/index-50hpiPrV.d.ts +0 -116
  61. package/dist/index-B9zQVEVi.d.mts +0 -116
  62. package/dist/index.d.mts +0 -5
  63. package/dist/index.d.ts +0 -5
  64. package/dist/index.js +0 -123
  65. package/dist/index.js.map +0 -1
  66. package/dist/index.mjs +0 -118
  67. package/dist/index.mjs.map +0 -1
  68. package/dist/infrastructure/index.d.mts +0 -423
  69. package/dist/infrastructure/index.d.ts +0 -423
  70. package/dist/infrastructure/index.js +0 -633
  71. package/dist/infrastructure/index.js.map +0 -1
  72. package/dist/infrastructure/index.mjs +0 -619
  73. package/dist/infrastructure/index.mjs.map +0 -1
  74. package/dist/label-DWTEkNPo.d.ts +0 -226
  75. package/dist/label-LPpdcoBx.d.mts +0 -226
  76. package/dist/layout/index.d.mts +0 -48
  77. package/dist/layout/index.d.ts +0 -48
  78. package/dist/layout/index.js +0 -117
  79. package/dist/layout/index.js.map +0 -1
  80. package/dist/layout/index.mjs +0 -90
  81. package/dist/layout/index.mjs.map +0 -1
  82. package/dist/navigation/index.d.mts +0 -16
  83. package/dist/navigation/index.d.ts +0 -16
  84. package/dist/navigation/index.js +0 -53
  85. package/dist/navigation/index.js.map +0 -1
  86. package/dist/navigation/index.mjs +0 -50
  87. package/dist/navigation/index.mjs.map +0 -1
  88. package/dist/notification/index.d.mts +0 -105
  89. package/dist/notification/index.d.ts +0 -105
  90. package/dist/notification/index.js +0 -278
  91. package/dist/notification/index.js.map +0 -1
  92. package/dist/notification/index.mjs +0 -274
  93. package/dist/notification/index.mjs.map +0 -1
  94. package/dist/organization/index.d.mts +0 -99
  95. package/dist/organization/index.d.ts +0 -99
  96. package/dist/organization/index.js +0 -360
  97. package/dist/organization/index.js.map +0 -1
  98. package/dist/organization/index.mjs +0 -352
  99. package/dist/organization/index.mjs.map +0 -1
  100. package/dist/plugin/index.d.mts +0 -83
  101. package/dist/plugin/index.d.ts +0 -83
  102. package/dist/plugin/index.js +0 -86
  103. package/dist/plugin/index.js.map +0 -1
  104. package/dist/plugin/index.mjs +0 -84
  105. package/dist/plugin/index.mjs.map +0 -1
  106. package/dist/providers/index.d.mts +0 -25
  107. package/dist/providers/index.d.ts +0 -25
  108. package/dist/providers/index.js +0 -84
  109. package/dist/providers/index.js.map +0 -1
  110. package/dist/providers/index.mjs +0 -77
  111. package/dist/providers/index.mjs.map +0 -1
  112. package/dist/rbac/index.d.mts +0 -226
  113. package/dist/rbac/index.d.ts +0 -226
  114. package/dist/rbac/index.js +0 -4784
  115. package/dist/rbac/index.js.map +0 -1
  116. package/dist/rbac/index.mjs +0 -4722
  117. package/dist/rbac/index.mjs.map +0 -1
  118. package/dist/rbac/permissions.d.mts +0 -26
  119. package/dist/rbac/permissions.d.ts +0 -26
  120. package/dist/rbac/permissions.js +0 -94
  121. package/dist/rbac/permissions.js.map +0 -1
  122. package/dist/rbac/permissions.mjs +0 -90
  123. package/dist/rbac/permissions.mjs.map +0 -1
  124. package/dist/rbac/server.d.mts +0 -1
  125. package/dist/rbac/server.d.ts +0 -1
  126. package/dist/rbac/server.js +0 -128
  127. package/dist/rbac/server.js.map +0 -1
  128. package/dist/rbac/server.mjs +0 -124
  129. package/dist/rbac/server.mjs.map +0 -1
  130. package/dist/schemas/index.d.mts +0 -1257
  131. package/dist/schemas/index.d.ts +0 -1257
  132. package/dist/schemas/index.js +0 -572
  133. package/dist/schemas/index.js.map +0 -1
  134. package/dist/schemas/index.mjs +0 -523
  135. package/dist/schemas/index.mjs.map +0 -1
  136. package/dist/server-QuYCTa89.d.mts +0 -83
  137. package/dist/server-QuYCTa89.d.ts +0 -83
  138. package/dist/sonner-C74GlRDQ.d.mts +0 -71
  139. package/dist/sonner-C74GlRDQ.d.ts +0 -71
  140. package/dist/status-BOXZgIqX.d.mts +0 -12
  141. package/dist/status-BOXZgIqX.d.ts +0 -12
  142. package/dist/system/index.d.mts +0 -77
  143. package/dist/system/index.d.ts +0 -77
  144. package/dist/system/index.js +0 -102
  145. package/dist/system/index.js.map +0 -1
  146. package/dist/system/index.mjs +0 -100
  147. package/dist/system/index.mjs.map +0 -1
  148. package/dist/tabs-C6FfBwPY.d.mts +0 -18
  149. package/dist/tabs-C6FfBwPY.d.ts +0 -18
  150. package/dist/tenant-provider-B8eC_Wpb.d.mts +0 -27
  151. package/dist/tenant-provider-B8eC_Wpb.d.ts +0 -27
  152. package/dist/types/index.d.mts +0 -469
  153. package/dist/types/index.d.ts +0 -469
  154. package/dist/types/index.js +0 -25
  155. package/dist/types/index.js.map +0 -1
  156. package/dist/types/index.mjs +0 -21
  157. package/dist/types/index.mjs.map +0 -1
  158. package/dist/ui/auth.d.mts +0 -39
  159. package/dist/ui/auth.d.ts +0 -39
  160. package/dist/ui/auth.js +0 -4941
  161. package/dist/ui/auth.js.map +0 -1
  162. package/dist/ui/auth.mjs +0 -4896
  163. package/dist/ui/auth.mjs.map +0 -1
  164. package/dist/ui/crud.d.mts +0 -2
  165. package/dist/ui/crud.d.ts +0 -2
  166. package/dist/ui/crud.js +0 -4
  167. package/dist/ui/crud.js.map +0 -1
  168. package/dist/ui/crud.mjs +0 -3
  169. package/dist/ui/crud.mjs.map +0 -1
  170. package/dist/ui/data-display.d.mts +0 -596
  171. package/dist/ui/data-display.d.ts +0 -596
  172. package/dist/ui/data-display.js +0 -5307
  173. package/dist/ui/data-display.js.map +0 -1
  174. package/dist/ui/data-display.mjs +0 -5212
  175. package/dist/ui/data-display.mjs.map +0 -1
  176. package/dist/ui/feedback.d.mts +0 -55
  177. package/dist/ui/feedback.d.ts +0 -55
  178. package/dist/ui/feedback.js +0 -2608
  179. package/dist/ui/feedback.js.map +0 -1
  180. package/dist/ui/feedback.mjs +0 -2526
  181. package/dist/ui/feedback.mjs.map +0 -1
  182. package/dist/ui/forms.d.mts +0 -309
  183. package/dist/ui/forms.d.ts +0 -309
  184. package/dist/ui/forms.js +0 -4656
  185. package/dist/ui/forms.js.map +0 -1
  186. package/dist/ui/forms.mjs +0 -4571
  187. package/dist/ui/forms.mjs.map +0 -1
  188. package/dist/ui/index.d.mts +0 -331
  189. package/dist/ui/index.d.ts +0 -331
  190. package/dist/ui/index.js +0 -16953
  191. package/dist/ui/index.js.map +0 -1
  192. package/dist/ui/index.mjs +0 -16598
  193. package/dist/ui/index.mjs.map +0 -1
  194. package/dist/ui/primitives/client.d.mts +0 -61
  195. package/dist/ui/primitives/client.d.ts +0 -61
  196. package/dist/ui/primitives/client.js +0 -3408
  197. package/dist/ui/primitives/client.js.map +0 -1
  198. package/dist/ui/primitives/client.mjs +0 -3256
  199. package/dist/ui/primitives/client.mjs.map +0 -1
  200. package/dist/ui/primitives.d.mts +0 -113
  201. package/dist/ui/primitives.d.ts +0 -113
  202. package/dist/ui/primitives.js +0 -3356
  203. package/dist/ui/primitives.js.map +0 -1
  204. package/dist/ui/primitives.mjs +0 -3227
  205. package/dist/ui/primitives.mjs.map +0 -1
  206. package/dist/user/index.d.mts +0 -228
  207. package/dist/user/index.d.ts +0 -228
  208. package/dist/user/index.js +0 -4306
  209. package/dist/user/index.js.map +0 -1
  210. package/dist/user/index.mjs +0 -4260
  211. package/dist/user/index.mjs.map +0 -1
  212. package/dist/utils/index.d.mts +0 -205
  213. package/dist/utils/index.d.ts +0 -205
  214. package/dist/utils/index.js +0 -574
  215. package/dist/utils/index.js.map +0 -1
  216. package/dist/utils/index.mjs +0 -514
  217. package/dist/utils/index.mjs.map +0 -1
  218. package/dist/workflow/index.d.mts +0 -40
  219. package/dist/workflow/index.d.ts +0 -40
  220. package/dist/workflow/index.js +0 -3710
  221. package/dist/workflow/index.js.map +0 -1
  222. package/dist/workflow/index.mjs +0 -3677
  223. package/dist/workflow/index.mjs.map +0 -1
@@ -1,4306 +0,0 @@
1
- 'use strict';
2
-
3
- var clsx = require('clsx');
4
- var tailwindMerge = require('tailwind-merge');
5
- var React12 = require('react');
6
- var classVarianceAuthority = require('class-variance-authority');
7
- var reactSlot = require('@radix-ui/react-slot');
8
- var jsxRuntime = require('react/jsx-runtime');
9
- var CheckboxPrimitive = require('@radix-ui/react-checkbox');
10
- var lucideReact = require('lucide-react');
11
- require('@radix-ui/react-dropdown-menu');
12
- var DialogPrimitive = require('@radix-ui/react-dialog');
13
- var TabsPrimitive = require('@radix-ui/react-tabs');
14
- require('next/link');
15
- require('next/navigation');
16
- require('next/image');
17
- require('react-day-picker');
18
- var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
19
- var SelectPrimitive = require('@radix-ui/react-select');
20
- require('@radix-ui/react-popover');
21
- require('@radix-ui/react-switch');
22
- var LabelPrimitive = require('@radix-ui/react-label');
23
- var TooltipPrimitive = require('@radix-ui/react-tooltip');
24
- require('react-resizable-panels');
25
- require('@radix-ui/react-slider');
26
- require('@radix-ui/react-toggle');
27
- require('@radix-ui/react-toggle-group');
28
- require('@radix-ui/react-menubar');
29
- require('@radix-ui/react-navigation-menu');
30
- require('@radix-ui/react-context-menu');
31
- require('vaul');
32
- require('@radix-ui/react-progress');
33
- require('sonner');
34
- require('framer-motion');
35
- var AvatarPrimitive = require('@radix-ui/react-avatar');
36
- require('next-auth/react');
37
- require('react-use');
38
- require('@radix-ui/react-direction');
39
- require('@radix-ui/react-alert-dialog');
40
- require('@radix-ui/react-radio-group');
41
- require('cmdk');
42
- require('date-fns');
43
- var dynamic = require('next/dynamic');
44
- require('emoji-picker-react');
45
- require('react-dropzone');
46
- require('input-otp');
47
- require('react-phone-number-input');
48
- require('@tiptap/extension-color');
49
- require('@tiptap/extension-image');
50
- require('@tiptap/extension-link');
51
- require('@tiptap/extension-placeholder');
52
- require('@tiptap/extension-text-align');
53
- require('@tiptap/extension-text-style');
54
- require('@tiptap/extension-typography');
55
- require('@tiptap/extension-underline');
56
- require('@tiptap/react');
57
- require('@tiptap/starter-kit');
58
- var reactHookForm = require('react-hook-form');
59
- require('recharts');
60
- require('embla-carousel-react');
61
- require('@radix-ui/react-accordion');
62
- require('@dnd-kit/sortable');
63
- require('@dnd-kit/utilities');
64
- require('@dnd-kit/core');
65
- require('react-dom');
66
- require('@radix-ui/react-aspect-ratio');
67
- require('hast-util-to-jsx-runtime');
68
- require('shiki/bundle/web');
69
- require('@radix-ui/react-collapsible');
70
- require('@radix-ui/react-hover-card');
71
- var zod$1 = require('@hookform/resolvers/zod');
72
- var zod = require('zod');
73
-
74
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
75
-
76
- function _interopNamespace(e) {
77
- if (e && e.__esModule) return e;
78
- var n = Object.create(null);
79
- if (e) {
80
- Object.keys(e).forEach(function (k) {
81
- if (k !== 'default') {
82
- var d = Object.getOwnPropertyDescriptor(e, k);
83
- Object.defineProperty(n, k, d.get ? d : {
84
- enumerable: true,
85
- get: function () { return e[k]; }
86
- });
87
- }
88
- });
89
- }
90
- n.default = e;
91
- return Object.freeze(n);
92
- }
93
-
94
- var React12__namespace = /*#__PURE__*/_interopNamespace(React12);
95
- var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
96
- var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
97
- var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
98
- var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
99
- var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
100
- var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
101
- var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
102
- var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
103
- var dynamic__default = /*#__PURE__*/_interopDefault(dynamic);
104
-
105
- var __getOwnPropNames = Object.getOwnPropertyNames;
106
- var __esm = (fn, res) => function __init() {
107
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
108
- };
109
- function cn(...inputs) {
110
- return tailwindMerge.twMerge(clsx.clsx(inputs));
111
- }
112
- function getInitials(fullName) {
113
- if (fullName.length === 0) return "";
114
- const names = fullName.split(" ");
115
- const initials = names.map((name) => name.charAt(0).toUpperCase()).join("");
116
- return initials;
117
- }
118
- function formatFileSize(bytes, decimals = 2) {
119
- const k = 1e3;
120
- const dm = decimals < 0 ? 0 : decimals;
121
- const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
122
- const i = Math.floor(Math.log(bytes) / Math.log(k));
123
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
124
- }
125
- var Logger;
126
- var init_utils = __esm({
127
- "src/utils/index.ts"() {
128
- Logger = class {
129
- log(level, message, context, error) {
130
- const entry = {
131
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
132
- level,
133
- message,
134
- context
135
- };
136
- if (error instanceof Error) {
137
- entry.error = {
138
- name: error.name,
139
- message: error.message,
140
- stack: error.stack
141
- };
142
- } else if (error) {
143
- entry.error = error;
144
- }
145
- const logString = JSON.stringify(entry);
146
- switch (level) {
147
- case "error":
148
- console.error(logString);
149
- break;
150
- case "warn":
151
- console.warn(logString);
152
- break;
153
- case "debug":
154
- if (process.env.NODE_ENV === "development") console.debug(logString);
155
- break;
156
- default:
157
- console.log(logString);
158
- }
159
- }
160
- info(message, context) {
161
- this.log("info", message, context);
162
- }
163
- warn(message, context) {
164
- this.log("warn", message, context);
165
- }
166
- error(message, error, context) {
167
- this.log("error", message, context, error);
168
- }
169
- debug(message, context) {
170
- this.log("debug", message, context);
171
- }
172
- };
173
- new Logger();
174
- }
175
- });
176
- var buttonVariants, Button;
177
- var init_button = __esm({
178
- "src/ui/primitives/button.tsx"() {
179
- init_utils();
180
- buttonVariants = classVarianceAuthority.cva(
181
- "inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
182
- {
183
- variants: {
184
- variant: {
185
- // Existing variants (backwards-compatible)
186
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
187
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
188
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
189
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
190
- ghost: "hover:bg-accent hover:text-accent-foreground",
191
- link: "text-primary underline-offset-4 hover:underline",
192
- // New Plane-inspired variants using semantic tokens
193
- accent: "bg-accent-primary text-text-on-color hover:bg-accent-primary-hover active:bg-accent-primary-active disabled:bg-layer-disabled disabled:text-text-disabled",
194
- danger: "bg-danger text-text-on-color hover:bg-danger-hover active:bg-danger-hover disabled:bg-layer-disabled disabled:text-text-disabled",
195
- "danger-outline": "border border-danger bg-layer-2 text-danger-text hover:bg-danger-subtle active:bg-danger-subtle disabled:border-border-subtle disabled:bg-layer-2 disabled:text-text-disabled",
196
- success: "bg-success-semantic text-text-on-color hover:bg-success-semantic/90 active:bg-success-semantic/80 disabled:bg-layer-disabled disabled:text-text-disabled",
197
- tertiary: "bg-layer-3 text-text-secondary hover:bg-layer-3-hover active:bg-layer-3-hover disabled:bg-transparent disabled:text-text-disabled"
198
- },
199
- size: {
200
- // Existing sizes (backwards-compatible)
201
- default: "h-10 px-4 py-2",
202
- sm: "h-9 rounded-md px-3",
203
- lg: "h-11 rounded-md px-8",
204
- icon: "h-10 w-10",
205
- // New ERP-specific compact sizes
206
- xs: "h-7 rounded-sm px-2 text-xs",
207
- compact: "h-8 rounded-md px-3 text-xs",
208
- "icon-sm": "h-8 w-8",
209
- "icon-xs": "h-7 w-7"
210
- }
211
- },
212
- defaultVariants: {
213
- variant: "default",
214
- size: "default"
215
- }
216
- }
217
- );
218
- Button = React12__namespace.forwardRef(
219
- ({ className, variant, size, asChild = false, loading = false, prependIcon, appendIcon, children, disabled, ...props }, ref) => {
220
- if (asChild) {
221
- return /* @__PURE__ */ jsxRuntime.jsx(
222
- reactSlot.Slot,
223
- {
224
- className: cn(buttonVariants({ variant, size }), className),
225
- ref,
226
- ...{ disabled: disabled || loading },
227
- ...props,
228
- children: React12__namespace.isValidElement(children) && (prependIcon || appendIcon) ? React12__namespace.cloneElement(children, {}, /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
229
- prependIcon && React12__namespace.cloneElement(prependIcon, {
230
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
231
- }),
232
- children.props.children,
233
- appendIcon && React12__namespace.cloneElement(appendIcon, {
234
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
235
- })
236
- ] })) : children
237
- }
238
- );
239
- }
240
- return /* @__PURE__ */ jsxRuntime.jsxs(
241
- "button",
242
- {
243
- className: cn(buttonVariants({ variant, size }), className),
244
- ref,
245
- disabled: disabled || loading,
246
- ...props,
247
- children: [
248
- prependIcon && React12__namespace.cloneElement(prependIcon, {
249
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
250
- }),
251
- children,
252
- appendIcon && React12__namespace.cloneElement(appendIcon, {
253
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
254
- })
255
- ]
256
- }
257
- );
258
- }
259
- );
260
- Button.displayName = "Button";
261
- }
262
- });
263
- function Badge({ className, variant, size, ...props }) {
264
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant, size }), className), ...props });
265
- }
266
- var badgeVariants;
267
- var init_badge = __esm({
268
- "src/ui/primitives/badge.tsx"() {
269
- init_utils();
270
- badgeVariants = classVarianceAuthority.cva(
271
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
272
- {
273
- variants: {
274
- variant: {
275
- // Existing variants (backwards-compatible)
276
- default: "border-transparent bg-primary text-primary-foreground",
277
- secondary: "border-transparent bg-secondary text-secondary-foreground",
278
- destructive: "border-transparent bg-destructive text-destructive-foreground",
279
- outline: "text-foreground",
280
- // Enhanced semantic variants (using Design Tokens)
281
- success: "border-transparent bg-success-subtle text-success-text",
282
- warning: "border-transparent bg-warning-subtle text-warning-text",
283
- danger: "border-transparent bg-danger-subtle text-danger-text",
284
- info: "border-transparent bg-info-subtle text-info-text",
285
- accent: "border-transparent bg-accent-primary-subtle text-accent-primary"
286
- },
287
- size: {
288
- default: "",
289
- sm: "px-1.5 py-0 text-[10px]",
290
- lg: "px-3 py-1 text-sm"
291
- }
292
- },
293
- defaultVariants: {
294
- variant: "default",
295
- size: "default"
296
- }
297
- }
298
- );
299
- }
300
- });
301
- var Input;
302
- var init_input = __esm({
303
- "src/ui/primitives/input.tsx"() {
304
- init_utils();
305
- Input = React12__namespace.forwardRef(
306
- ({ className, type, ...props }, ref) => {
307
- return /* @__PURE__ */ jsxRuntime.jsx(
308
- "input",
309
- {
310
- type,
311
- className: cn(
312
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
313
- className
314
- ),
315
- ref,
316
- ...props
317
- }
318
- );
319
- }
320
- );
321
- Input.displayName = "Input";
322
- }
323
- });
324
- var Checkbox;
325
- var init_checkbox = __esm({
326
- "src/ui/primitives/checkbox.tsx"() {
327
- "use client";
328
- init_utils();
329
- Checkbox = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
330
- CheckboxPrimitive__namespace.Root,
331
- {
332
- ref,
333
- className: cn(
334
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
335
- className
336
- ),
337
- ...props,
338
- children: /* @__PURE__ */ jsxRuntime.jsx(
339
- CheckboxPrimitive__namespace.Indicator,
340
- {
341
- className: cn("flex items-center justify-center text-current"),
342
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" })
343
- }
344
- )
345
- }
346
- ));
347
- Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
348
- }
349
- });
350
- var Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter;
351
- var init_card = __esm({
352
- "src/ui/primitives/card.tsx"() {
353
- init_utils();
354
- Card = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
355
- "div",
356
- {
357
- ref,
358
- className: cn(
359
- "rounded-lg border bg-card text-card-foreground shadow-sm",
360
- className
361
- ),
362
- ...props
363
- }
364
- ));
365
- Card.displayName = "Card";
366
- CardHeader = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
367
- "div",
368
- {
369
- ref,
370
- className: cn("flex flex-col space-y-1.5 p-6", className),
371
- ...props
372
- }
373
- ));
374
- CardHeader.displayName = "CardHeader";
375
- CardTitle = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
376
- "h3",
377
- {
378
- ref,
379
- className: cn(
380
- "text-2xl font-semibold leading-none tracking-tight",
381
- className
382
- ),
383
- ...props
384
- }
385
- ));
386
- CardTitle.displayName = "CardTitle";
387
- CardDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
388
- "p",
389
- {
390
- ref,
391
- className: cn("text-sm text-muted-foreground", className),
392
- ...props
393
- }
394
- ));
395
- CardDescription.displayName = "CardDescription";
396
- CardContent = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
397
- CardContent.displayName = "CardContent";
398
- CardFooter = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
399
- "div",
400
- {
401
- ref,
402
- className: cn("flex items-center p-6 pt-0", className),
403
- ...props
404
- }
405
- ));
406
- CardFooter.displayName = "CardFooter";
407
- }
408
- });
409
- var Separator;
410
- var init_separator = __esm({
411
- "src/ui/primitives/separator.tsx"() {
412
- init_utils();
413
- Separator = React12__namespace.forwardRef(
414
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
415
- "div",
416
- {
417
- ref,
418
- className: cn(
419
- "shrink-0 bg-border",
420
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
421
- className
422
- ),
423
- ...props
424
- }
425
- )
426
- );
427
- Separator.displayName = "Separator";
428
- }
429
- });
430
- var Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption;
431
- var init_table = __esm({
432
- "src/ui/primitives/table.tsx"() {
433
- init_utils();
434
- Table = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
435
- "table",
436
- {
437
- ref,
438
- className: cn("w-max min-w-full caption-bottom text-xs", className),
439
- ...props
440
- }
441
- ) }));
442
- Table.displayName = "Table";
443
- TableHeader = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
444
- TableHeader.displayName = "TableHeader";
445
- TableBody = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
446
- "tbody",
447
- {
448
- ref,
449
- className: cn("[&_tr:last-child]:border-0", className),
450
- ...props
451
- }
452
- ));
453
- TableBody.displayName = "TableBody";
454
- TableFooter = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
455
- "tfoot",
456
- {
457
- ref,
458
- className: cn(
459
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
460
- className
461
- ),
462
- ...props
463
- }
464
- ));
465
- TableFooter.displayName = "TableFooter";
466
- TableRow = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
467
- "tr",
468
- {
469
- ref,
470
- className: cn(
471
- "border-b transition-colors even:bg-muted/30 data-[state=selected]:bg-muted",
472
- className
473
- ),
474
- ...props
475
- }
476
- ));
477
- TableRow.displayName = "TableRow";
478
- TableHead = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
479
- "th",
480
- {
481
- ref,
482
- className: cn(
483
- "h-9 px-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
484
- className
485
- ),
486
- ...props
487
- }
488
- ));
489
- TableHead.displayName = "TableHead";
490
- TableCell = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
491
- "td",
492
- {
493
- ref,
494
- className: cn("px-3 py-1.5 align-middle [&:has([role=checkbox])]:pr-0 text-xs", className),
495
- ...props
496
- }
497
- ));
498
- TableCell.displayName = "TableCell";
499
- TableCaption = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
500
- "caption",
501
- {
502
- ref,
503
- className: cn("mt-4 text-sm text-muted-foreground", className),
504
- ...props
505
- }
506
- ));
507
- TableCaption.displayName = "TableCaption";
508
- }
509
- });
510
- var init_dropdown_menu = __esm({
511
- "src/ui/primitives/dropdown-menu.tsx"() {
512
- "use client";
513
- }
514
- });
515
- var DialogPortal, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription;
516
- var init_dialog = __esm({
517
- "src/ui/primitives/dialog.tsx"() {
518
- "use client";
519
- init_utils();
520
- DialogPortal = DialogPrimitive__namespace.Portal;
521
- DialogOverlay = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
522
- DialogPrimitive__namespace.Overlay,
523
- {
524
- ref,
525
- className: cn(
526
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
527
- className
528
- ),
529
- ...props
530
- }
531
- ));
532
- DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
533
- DialogContent = React12__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
534
- /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
535
- /* @__PURE__ */ jsxRuntime.jsxs(
536
- DialogPrimitive__namespace.Content,
537
- {
538
- ref,
539
- className: cn(
540
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
541
- className
542
- ),
543
- ...props,
544
- children: [
545
- children,
546
- /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
547
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
548
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
549
- ] })
550
- ]
551
- }
552
- )
553
- ] }));
554
- DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
555
- DialogHeader = ({
556
- className,
557
- ...props
558
- }) => /* @__PURE__ */ jsxRuntime.jsx(
559
- "div",
560
- {
561
- className: cn(
562
- "flex flex-col space-y-1.5 text-center sm:text-left",
563
- className
564
- ),
565
- ...props
566
- }
567
- );
568
- DialogHeader.displayName = "DialogHeader";
569
- DialogFooter = ({
570
- className,
571
- ...props
572
- }) => /* @__PURE__ */ jsxRuntime.jsx(
573
- "div",
574
- {
575
- className: cn(
576
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
577
- className
578
- ),
579
- ...props
580
- }
581
- );
582
- DialogFooter.displayName = "DialogFooter";
583
- DialogTitle = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
584
- DialogPrimitive__namespace.Title,
585
- {
586
- ref,
587
- className: cn(
588
- "text-lg font-semibold leading-none tracking-tight",
589
- className
590
- ),
591
- ...props
592
- }
593
- ));
594
- DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
595
- DialogDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
596
- DialogPrimitive__namespace.Description,
597
- {
598
- ref,
599
- className: cn("text-sm text-muted-foreground", className),
600
- ...props
601
- }
602
- ));
603
- DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
604
- }
605
- });
606
- var TabsList, TabsTrigger, TabsContent;
607
- var init_tabs = __esm({
608
- "src/ui/primitives/tabs.tsx"() {
609
- "use client";
610
- init_utils();
611
- TabsList = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
612
- TabsPrimitive__namespace.List,
613
- {
614
- ref,
615
- className: cn(
616
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
617
- className
618
- ),
619
- ...props
620
- }
621
- ));
622
- TabsList.displayName = TabsPrimitive__namespace.List.displayName;
623
- TabsTrigger = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
624
- TabsPrimitive__namespace.Trigger,
625
- {
626
- ref,
627
- className: cn(
628
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
629
- className
630
- ),
631
- ...props
632
- }
633
- ));
634
- TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
635
- TabsContent = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
636
- TabsPrimitive__namespace.Content,
637
- {
638
- ref,
639
- className: cn(
640
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
641
- className
642
- ),
643
- ...props
644
- }
645
- ));
646
- TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
647
- }
648
- });
649
- var init_breadcrumb = __esm({
650
- "src/ui/primitives/breadcrumb.tsx"() {
651
- }
652
- });
653
- var init_keyboard = __esm({
654
- "src/ui/primitives/keyboard.tsx"() {
655
- }
656
- });
657
- var init_pagination = __esm({
658
- "src/ui/primitives/pagination.tsx"() {
659
- }
660
- });
661
- var init_status_badge = __esm({
662
- "src/ui/primitives/status-badge.tsx"() {
663
- }
664
- });
665
- var init_command_menu = __esm({
666
- "src/ui/layout/command-menu.tsx"() {
667
- "use client";
668
- }
669
- });
670
- var init_logo = __esm({
671
- "src/ui/layout/logo.tsx"() {
672
- "use client";
673
- }
674
- });
675
- var init_sidebar_group_icon_menu = __esm({
676
- "src/ui/layout/sidebar-group-icon-menu.tsx"() {
677
- "use client";
678
- }
679
- });
680
- var init_sidebar = __esm({
681
- "src/ui/layout/sidebar.tsx"() {
682
- "use client";
683
- }
684
- });
685
- var init_calendar = __esm({
686
- "src/ui/primitives/calendar.tsx"() {
687
- "use client";
688
- init_utils();
689
- init_button();
690
- }
691
- });
692
- function ScrollArea({
693
- orientation,
694
- className,
695
- children,
696
- ...props
697
- }) {
698
- return /* @__PURE__ */ jsxRuntime.jsxs(
699
- ScrollAreaPrimitive__namespace.Root,
700
- {
701
- "data-slot": "scroll-area",
702
- className: cn("relative overflow-hidden", className),
703
- ...props,
704
- children: [
705
- /* @__PURE__ */ jsxRuntime.jsx(
706
- ScrollAreaPrimitive__namespace.Viewport,
707
- {
708
- "data-slot": "scroll-area-viewport",
709
- className: "h-full w-full rounded-[inherit]",
710
- children
711
- }
712
- ),
713
- /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation }),
714
- /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
715
- ]
716
- }
717
- );
718
- }
719
- function ScrollBar({
720
- className,
721
- orientation = "vertical",
722
- ...props
723
- }) {
724
- return /* @__PURE__ */ jsxRuntime.jsx(
725
- ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
726
- {
727
- "data-slot": "scroll-area-scrollbar",
728
- orientation,
729
- className: cn(
730
- "flex touch-none select-none transition-colors",
731
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
732
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
733
- className
734
- ),
735
- ...props,
736
- children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
737
- }
738
- );
739
- }
740
- var init_scroll_area = __esm({
741
- "src/ui/primitives/scroll-area.tsx"() {
742
- "use client";
743
- init_utils();
744
- }
745
- });
746
- var init_combobox = __esm({
747
- "src/ui/primitives/combobox.tsx"() {
748
- "use client";
749
- }
750
- });
751
- function Select({
752
- ...props
753
- }) {
754
- return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Root, { "data-slot": "select", ...props });
755
- }
756
- function SelectValue({
757
- ...props
758
- }) {
759
- return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { "data-slot": "select-value", ...props });
760
- }
761
- function SelectTrigger({
762
- className,
763
- children,
764
- ...props
765
- }) {
766
- return /* @__PURE__ */ jsxRuntime.jsxs(
767
- SelectPrimitive__namespace.Trigger,
768
- {
769
- "data-slot": "select-trigger",
770
- className: cn(
771
- "cursor-pointer flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
772
- className
773
- ),
774
- ...props,
775
- children: [
776
- children,
777
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
778
- ]
779
- }
780
- );
781
- }
782
- function SelectScrollUpButton({
783
- className,
784
- ...props
785
- }) {
786
- return /* @__PURE__ */ jsxRuntime.jsx(
787
- SelectPrimitive__namespace.ScrollUpButton,
788
- {
789
- "data-slot": "select-scroll-up-button",
790
- className: cn(
791
- "flex cursor-pointer items-center justify-center py-1",
792
- className
793
- ),
794
- ...props,
795
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
796
- }
797
- );
798
- }
799
- function SelectScrollDownButton({
800
- className,
801
- ...props
802
- }) {
803
- return /* @__PURE__ */ jsxRuntime.jsx(
804
- SelectPrimitive__namespace.ScrollDownButton,
805
- {
806
- "data-slot": "select-scroll-down-button",
807
- className: cn(
808
- "flex cursor-pointer items-center justify-center py-1",
809
- className
810
- ),
811
- ...props,
812
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
813
- }
814
- );
815
- }
816
- function SelectContent({
817
- className,
818
- children,
819
- position = "popper",
820
- ...props
821
- }) {
822
- return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
823
- SelectPrimitive__namespace.Content,
824
- {
825
- "data-slot": "select-content",
826
- className: cn(
827
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
828
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
829
- className
830
- ),
831
- position,
832
- ...props,
833
- children: [
834
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
835
- /* @__PURE__ */ jsxRuntime.jsx(
836
- SelectPrimitive__namespace.Viewport,
837
- {
838
- className: cn(
839
- "p-1",
840
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
841
- ),
842
- children
843
- }
844
- ),
845
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
846
- ]
847
- }
848
- ) });
849
- }
850
- function SelectItem({
851
- className,
852
- children,
853
- ...props
854
- }) {
855
- return /* @__PURE__ */ jsxRuntime.jsxs(
856
- SelectPrimitive__namespace.Item,
857
- {
858
- "data-slot": "select-item",
859
- className: cn(
860
- "relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
861
- className
862
- ),
863
- ...props,
864
- children: [
865
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
866
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
867
- ]
868
- }
869
- );
870
- }
871
- var init_select = __esm({
872
- "src/ui/primitives/select.tsx"() {
873
- "use client";
874
- init_utils();
875
- }
876
- });
877
- var init_popover = __esm({
878
- "src/ui/primitives/popover.tsx"() {
879
- "use client";
880
- }
881
- });
882
- var init_switch = __esm({
883
- "src/ui/primitives/switch.tsx"() {
884
- "use client";
885
- }
886
- });
887
- var Label3;
888
- var init_label = __esm({
889
- "src/ui/primitives/label.tsx"() {
890
- "use client";
891
- init_utils();
892
- Label3 = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
893
- LabelPrimitive__namespace.Root,
894
- {
895
- ref,
896
- className: cn(
897
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
898
- className
899
- ),
900
- ...props
901
- }
902
- ));
903
- Label3.displayName = LabelPrimitive__namespace.Root.displayName;
904
- }
905
- });
906
- function TooltipProvider({
907
- delayDuration = 0,
908
- ...props
909
- }) {
910
- return /* @__PURE__ */ jsxRuntime.jsx(
911
- TooltipPrimitive__namespace.Provider,
912
- {
913
- "data-slot": "tooltip-provider",
914
- delayDuration,
915
- ...props
916
- }
917
- );
918
- }
919
- function Tooltip({
920
- ...props
921
- }) {
922
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props }) });
923
- }
924
- function TooltipTrigger({
925
- className,
926
- ...props
927
- }) {
928
- return /* @__PURE__ */ jsxRuntime.jsx(
929
- TooltipPrimitive__namespace.Trigger,
930
- {
931
- "data-slot": "tooltip-trigger",
932
- className: cn("cursor-pointer", className),
933
- ...props
934
- }
935
- );
936
- }
937
- function TooltipContent({
938
- className,
939
- sideOffset = 0,
940
- ...props
941
- }) {
942
- return /* @__PURE__ */ jsxRuntime.jsx(
943
- TooltipPrimitive__namespace.Content,
944
- {
945
- "data-slot": "tooltip-content",
946
- sideOffset,
947
- className: cn(
948
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
949
- className
950
- ),
951
- ...props
952
- }
953
- );
954
- }
955
- var init_tooltip = __esm({
956
- "src/ui/primitives/tooltip.tsx"() {
957
- "use client";
958
- init_utils();
959
- }
960
- });
961
- var init_resizable = __esm({
962
- "src/ui/primitives/resizable.tsx"() {
963
- "use client";
964
- }
965
- });
966
- var init_slider = __esm({
967
- "src/ui/primitives/slider.tsx"() {
968
- "use client";
969
- }
970
- });
971
- var init_toggle = __esm({
972
- "src/ui/primitives/toggle.tsx"() {
973
- "use client";
974
- classVarianceAuthority.cva(
975
- "cursor-pointer inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
976
- {
977
- variants: {
978
- variant: {
979
- default: "bg-transparent",
980
- outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
981
- },
982
- size: {
983
- default: "h-9 px-3",
984
- sm: "h-8 px-2",
985
- lg: "h-10 px-3"
986
- }
987
- },
988
- defaultVariants: {
989
- variant: "default",
990
- size: "default"
991
- }
992
- }
993
- );
994
- }
995
- });
996
- var init_toggle_group = __esm({
997
- "src/ui/primitives/toggle-group.tsx"() {
998
- "use client";
999
- React12.createContext({
1000
- size: "default",
1001
- variant: "default"
1002
- });
1003
- }
1004
- });
1005
- var init_menubar = __esm({
1006
- "src/ui/primitives/menubar.tsx"() {
1007
- "use client";
1008
- }
1009
- });
1010
- var init_navigation_menu = __esm({
1011
- "src/ui/primitives/navigation-menu.tsx"() {
1012
- classVarianceAuthority.cva(
1013
- "group cursor-pointer 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"
1014
- );
1015
- }
1016
- });
1017
- var init_sticky_layout = __esm({
1018
- "src/ui/primitives/sticky-layout.tsx"() {
1019
- }
1020
- });
1021
- var init_prefetch_link = __esm({
1022
- "src/ui/primitives/prefetch-link.tsx"() {
1023
- "use client";
1024
- }
1025
- });
1026
- var init_dynamic_icon = __esm({
1027
- "src/ui/primitives/dynamic-icon.tsx"() {
1028
- "use client";
1029
- }
1030
- });
1031
- var InputNumber;
1032
- var init_input_number = __esm({
1033
- "src/ui/primitives/input-number.tsx"() {
1034
- "use client";
1035
- init_utils();
1036
- init_input();
1037
- InputNumber = React12__namespace.forwardRef(
1038
- ({ value, onChange, className, decimalScale = 0, suffix, ...props }, ref) => {
1039
- const [displayValue, setDisplayValue] = React12__namespace.useState("");
1040
- const parseDisplayValue = (val) => {
1041
- const clean = val.replace(/\./g, "").replace(",", ".");
1042
- return Number(clean);
1043
- };
1044
- const formatNumber = React12__namespace.useCallback(
1045
- (num) => {
1046
- return new Intl.NumberFormat("vi-VN", {
1047
- maximumFractionDigits: decimalScale,
1048
- minimumFractionDigits: 0
1049
- }).format(num);
1050
- },
1051
- [decimalScale]
1052
- );
1053
- React12__namespace.useEffect(() => {
1054
- if (value === null || value === void 0 || value === "") {
1055
- setDisplayValue("");
1056
- return;
1057
- }
1058
- const numValue = Number(value);
1059
- if (isNaN(numValue)) return;
1060
- const currentNum = parseDisplayValue(displayValue);
1061
- if (currentNum !== numValue) {
1062
- setDisplayValue(formatNumber(numValue));
1063
- }
1064
- }, [value, decimalScale, displayValue, formatNumber]);
1065
- const handleChange = (e) => {
1066
- const rawValue = e.target.value;
1067
- let cleanVal = rawValue.replace(/[^0-9,]/g, "");
1068
- const parts = cleanVal.split(",");
1069
- if (parts.length > 2) {
1070
- cleanVal = parts[0] + "," + parts.slice(1).join("");
1071
- }
1072
- if (cleanVal === "") {
1073
- setDisplayValue("");
1074
- onChange?.(null);
1075
- return;
1076
- }
1077
- const [integerPart, decimalPart] = cleanVal.split(",");
1078
- let formattedInteger = integerPart;
1079
- if (integerPart) {
1080
- formattedInteger = new Intl.NumberFormat("vi-VN").format(
1081
- Number(integerPart)
1082
- );
1083
- }
1084
- let newDisplayValue = formattedInteger;
1085
- let finalDecimalPart = decimalPart;
1086
- if (decimalPart !== void 0) {
1087
- if (decimalScale !== void 0 && decimalPart.length > decimalScale) {
1088
- finalDecimalPart = decimalPart.substring(0, decimalScale);
1089
- }
1090
- newDisplayValue += "," + finalDecimalPart;
1091
- }
1092
- setDisplayValue(newDisplayValue);
1093
- let numStr = integerPart;
1094
- if (finalDecimalPart !== void 0) {
1095
- numStr += "." + finalDecimalPart;
1096
- }
1097
- const numValue = Number(numStr.replace(/\./g, ""));
1098
- onChange?.(numValue);
1099
- };
1100
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1101
- /* @__PURE__ */ jsxRuntime.jsx(
1102
- Input,
1103
- {
1104
- ...props,
1105
- ref,
1106
- type: "text",
1107
- inputMode: "numeric",
1108
- value: displayValue,
1109
- onChange: handleChange,
1110
- className: cn("pr-8", className)
1111
- }
1112
- ),
1113
- suffix && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-muted-foreground text-sm", children: suffix })
1114
- ] });
1115
- }
1116
- );
1117
- InputNumber.displayName = "InputNumber";
1118
- }
1119
- });
1120
- function Sheet({
1121
- ...props
1122
- }) {
1123
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
1124
- }
1125
- function SheetPortal({
1126
- ...props
1127
- }) {
1128
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
1129
- }
1130
- function SheetOverlay({
1131
- className,
1132
- ...props
1133
- }) {
1134
- return /* @__PURE__ */ jsxRuntime.jsx(
1135
- DialogPrimitive__namespace.Overlay,
1136
- {
1137
- "data-slot": "sheet-overlay",
1138
- className: cn(
1139
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1140
- className
1141
- ),
1142
- ...props
1143
- }
1144
- );
1145
- }
1146
- function SheetContent({
1147
- className,
1148
- children,
1149
- side = "right",
1150
- ...props
1151
- }) {
1152
- return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
1153
- /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
1154
- /* @__PURE__ */ jsxRuntime.jsx(
1155
- DialogPrimitive__namespace.Content,
1156
- {
1157
- "data-slot": "sheet-content",
1158
- className: cn(sheetVariants({ side }), className),
1159
- ...props,
1160
- children
1161
- }
1162
- )
1163
- ] });
1164
- }
1165
- function SheetTitle({
1166
- className,
1167
- ...props
1168
- }) {
1169
- return /* @__PURE__ */ jsxRuntime.jsx(
1170
- DialogPrimitive__namespace.Title,
1171
- {
1172
- "data-slot": "sheet-title",
1173
- className: cn("text-lg font-semibold text-foreground", className),
1174
- ...props
1175
- }
1176
- );
1177
- }
1178
- var sheetVariants;
1179
- var init_sheet = __esm({
1180
- "src/ui/feedback/sheet.tsx"() {
1181
- "use client";
1182
- init_utils();
1183
- sheetVariants = classVarianceAuthority.cva(
1184
- "fixed z-50 gap-4 bg-background p-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
1185
- {
1186
- variants: {
1187
- side: {
1188
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1189
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1190
- left: "inset-y-0 left-0 h-full w-72 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1191
- right: "inset-y-0 right-0 h-full w-72 border-s data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
1192
- start: "inset-y-0 start-0 h-full w-72 border-e data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left data-[state=closed]:rtl:slide-out-to-right data-[state=open]:rtl:slide-in-from-right sm:max-w-sm",
1193
- end: "inset-y-0 end-0 h-full w-72 border-s data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right data-[state=closed]:rtl:slide-out-to-left data-[state=open]:rtl:slide-in-from-left sm:max-w-sm"
1194
- }
1195
- },
1196
- defaultVariants: {
1197
- side: "right"
1198
- }
1199
- }
1200
- );
1201
- }
1202
- });
1203
- var init_context_menu = __esm({
1204
- "src/ui/feedback/context-menu.tsx"() {
1205
- "use client";
1206
- }
1207
- });
1208
- var init_drawer = __esm({
1209
- "src/ui/feedback/drawer.tsx"() {
1210
- "use client";
1211
- }
1212
- });
1213
- var init_progress = __esm({
1214
- "src/ui/feedback/progress.tsx"() {
1215
- "use client";
1216
- }
1217
- });
1218
- var init_sonner = __esm({
1219
- "src/ui/feedback/sonner.tsx"() {
1220
- "use client";
1221
- }
1222
- });
1223
-
1224
- // src/ui/primitives/client.ts
1225
- var init_client = __esm({
1226
- "src/ui/primitives/client.ts"() {
1227
- "use client";
1228
- init_calendar();
1229
- init_combobox();
1230
- init_scroll_area();
1231
- init_select();
1232
- init_popover();
1233
- init_dropdown_menu();
1234
- init_switch();
1235
- init_checkbox();
1236
- init_label();
1237
- init_tooltip();
1238
- init_sidebar2();
1239
- init_resizable();
1240
- init_slider();
1241
- init_toggle();
1242
- init_toggle_group();
1243
- init_menubar();
1244
- init_navigation_menu();
1245
- init_sticky_layout();
1246
- init_prefetch_link();
1247
- init_dynamic_icon();
1248
- init_input_number();
1249
- init_sheet();
1250
- init_context_menu();
1251
- init_drawer();
1252
- init_progress();
1253
- init_sonner();
1254
- }
1255
- });
1256
- var init_language_dropdown = __esm({
1257
- "src/ui/layout/language-dropdown.tsx"() {
1258
- "use client";
1259
- }
1260
- });
1261
- var init_footer = __esm({
1262
- "src/ui/layout/footer.tsx"() {
1263
- }
1264
- });
1265
- var init_header_breadcrumb = __esm({
1266
- "src/ui/layout/header-breadcrumb.tsx"() {
1267
- "use client";
1268
- }
1269
- });
1270
- var init_animated_list = __esm({
1271
- "src/ui/layout/animated-list.tsx"() {
1272
- }
1273
- });
1274
- var init_animated_sidebar = __esm({
1275
- "src/ui/layout/animated-sidebar.tsx"() {
1276
- "use client";
1277
- }
1278
- });
1279
- var init_customizer = __esm({
1280
- "src/ui/layout/customizer.tsx"() {
1281
- "use client";
1282
- }
1283
- });
1284
- function Avatar({
1285
- className,
1286
- ...props
1287
- }) {
1288
- return /* @__PURE__ */ jsxRuntime.jsx(
1289
- AvatarPrimitive__namespace.Root,
1290
- {
1291
- "data-slot": "avatar",
1292
- className: cn("relative flex h-10 w-10 shrink-0", className),
1293
- ...props
1294
- }
1295
- );
1296
- }
1297
- function AvatarImage({
1298
- className,
1299
- ...props
1300
- }) {
1301
- return /* @__PURE__ */ jsxRuntime.jsx(
1302
- AvatarPrimitive__namespace.Image,
1303
- {
1304
- "data-slot": "avatar-image",
1305
- className: cn(
1306
- "aspect-square h-full w-full bg-muted rounded-lg object-cover",
1307
- className
1308
- ),
1309
- ...props
1310
- }
1311
- );
1312
- }
1313
- function AvatarFallback({
1314
- className,
1315
- ...props
1316
- }) {
1317
- return /* @__PURE__ */ jsxRuntime.jsx(
1318
- AvatarPrimitive__namespace.Fallback,
1319
- {
1320
- className: cn(
1321
- "flex h-full w-full items-center justify-center bg-muted rounded-lg",
1322
- className
1323
- ),
1324
- ...props
1325
- }
1326
- );
1327
- }
1328
- var init_avatar = __esm({
1329
- "src/ui/data-display/avatar.tsx"() {
1330
- "use client";
1331
- init_utils();
1332
- classVarianceAuthority.cva(
1333
- "transition duration-300 hover:scale-105 hover:z-10",
1334
- {
1335
- variants: {
1336
- size: {
1337
- default: "h-10 w-10",
1338
- sm: "h-9 w-9 text-sm",
1339
- lg: "h-11 w-11"
1340
- }
1341
- },
1342
- defaultVariants: {
1343
- size: "default"
1344
- }
1345
- }
1346
- );
1347
- }
1348
- });
1349
- var init_tab_content_cache = __esm({
1350
- "src/ui/layout/tab-content-cache.tsx"() {
1351
- "use client";
1352
- React12.createContext(void 0);
1353
- }
1354
- });
1355
- var init_tab_navigation_provider = __esm({
1356
- "src/ui/layout/tab-navigation-provider.tsx"() {
1357
- "use client";
1358
- React12.createContext(void 0);
1359
- }
1360
- });
1361
- var init_user_dropdown = __esm({
1362
- "src/ui/layout/user-dropdown.tsx"() {
1363
- "use client";
1364
- }
1365
- });
1366
- var init_notification_dropdown = __esm({
1367
- "src/ui/layout/notification-dropdown.tsx"() {
1368
- "use client";
1369
- }
1370
- });
1371
- var init_mode_dropdown = __esm({
1372
- "src/ui/layout/mode-dropdown.tsx"() {
1373
- "use client";
1374
- }
1375
- });
1376
- var init_full_screen_toggle = __esm({
1377
- "src/ui/layout/full-screen-toggle.tsx"() {
1378
- "use client";
1379
- }
1380
- });
1381
- var init_route_cache = __esm({
1382
- "src/ui/layout/route-cache.tsx"() {
1383
- "use client";
1384
- React12.createContext(
1385
- void 0
1386
- );
1387
- }
1388
- });
1389
- var init_page_tabs = __esm({
1390
- "src/ui/layout/page-tabs.tsx"() {
1391
- "use client";
1392
- }
1393
- });
1394
- var init_toggle_mobile_sidebar = __esm({
1395
- "src/ui/layout/toggle-mobile-sidebar.tsx"() {
1396
- "use client";
1397
- }
1398
- });
1399
- var init_top_bar_header_menubar = __esm({
1400
- "src/ui/layout/top-bar-header-menubar.tsx"() {
1401
- "use client";
1402
- }
1403
- });
1404
- var init_vertical_layout_header = __esm({
1405
- "src/ui/layout/vertical-layout-header.tsx"() {
1406
- "use client";
1407
- }
1408
- });
1409
- var init_horizontal_layout_header = __esm({
1410
- "src/ui/layout/horizontal-layout-header.tsx"() {
1411
- "use client";
1412
- }
1413
- });
1414
- var init_vertical_layout = __esm({
1415
- "src/ui/layout/vertical-layout.tsx"() {
1416
- "use client";
1417
- }
1418
- });
1419
- var init_horizontal_layout = __esm({
1420
- "src/ui/layout/horizontal-layout.tsx"() {
1421
- "use client";
1422
- }
1423
- });
1424
- var init_main_layout = __esm({
1425
- "src/ui/layout/main-layout.tsx"() {
1426
- "use client";
1427
- }
1428
- });
1429
-
1430
- // src/ui/layout/index.tsx
1431
- var init_layout = __esm({
1432
- "src/ui/layout/index.tsx"() {
1433
- init_sidebar();
1434
- init_language_dropdown();
1435
- init_footer();
1436
- init_logo();
1437
- init_header_breadcrumb();
1438
- init_animated_list();
1439
- init_animated_sidebar();
1440
- init_command_menu();
1441
- init_sidebar_group_icon_menu();
1442
- init_customizer();
1443
- init_user_dropdown();
1444
- init_notification_dropdown();
1445
- init_mode_dropdown();
1446
- init_full_screen_toggle();
1447
- init_page_tabs();
1448
- init_tab_navigation_provider();
1449
- init_route_cache();
1450
- init_toggle_mobile_sidebar();
1451
- init_top_bar_header_menubar();
1452
- init_vertical_layout_header();
1453
- init_horizontal_layout_header();
1454
- init_vertical_layout();
1455
- init_horizontal_layout();
1456
- init_main_layout();
1457
- init_tab_content_cache();
1458
- }
1459
- });
1460
-
1461
- // src/hooks/use-tenant.ts
1462
- var init_use_tenant = __esm({
1463
- "src/hooks/use-tenant.ts"() {
1464
- }
1465
- });
1466
- function useMediaQuery(query) {
1467
- const [matches, setMatches] = React12.useState(false);
1468
- React12.useEffect(() => {
1469
- if (typeof window !== "undefined") {
1470
- const media = window.matchMedia(query);
1471
- setMatches(media.matches);
1472
- const listener = (event) => setMatches(event.matches);
1473
- media.addEventListener("change", listener);
1474
- return () => media.removeEventListener("change", listener);
1475
- }
1476
- }, [query]);
1477
- return matches;
1478
- }
1479
- function useMobile() {
1480
- return useMediaQuery("(max-width: 768px)");
1481
- }
1482
- var init_hooks = __esm({
1483
- "src/hooks/index.tsx"() {
1484
- "use client";
1485
- init_use_tenant();
1486
- React12.createContext(null);
1487
- }
1488
- });
1489
- var init_alert = __esm({
1490
- "src/ui/feedback/alert.tsx"() {
1491
- classVarianceAuthority.cva(
1492
- "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
1493
- {
1494
- variants: {
1495
- variant: {
1496
- default: "bg-background text-foreground",
1497
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
1498
- }
1499
- },
1500
- defaultVariants: {
1501
- variant: "default"
1502
- }
1503
- }
1504
- );
1505
- }
1506
- });
1507
- var GlobalErrorEmitter;
1508
- var init_error_dialog = __esm({
1509
- "src/ui/feedback/error-dialog.tsx"() {
1510
- "use client";
1511
- GlobalErrorEmitter = class {
1512
- constructor() {
1513
- this.listeners = [];
1514
- }
1515
- subscribe(listener) {
1516
- this.listeners.push(listener);
1517
- return () => {
1518
- this.listeners = this.listeners.filter((l) => l !== listener);
1519
- };
1520
- }
1521
- emit(data) {
1522
- this.listeners.forEach((listener) => listener(data));
1523
- }
1524
- };
1525
- new GlobalErrorEmitter();
1526
- React12.createContext(null);
1527
- }
1528
- });
1529
- var init_feedback = __esm({
1530
- "src/ui/feedback/index.tsx"() {
1531
- init_progress();
1532
- init_sheet();
1533
- init_alert();
1534
- init_context_menu();
1535
- init_drawer();
1536
- init_sonner();
1537
- init_error_dialog();
1538
- }
1539
- });
1540
- function useSidebar() {
1541
- const context = React12__namespace.useContext(SidebarContext);
1542
- if (!context) {
1543
- throw new Error("useSidebar must be used within a SidebarProvider.");
1544
- }
1545
- return context;
1546
- }
1547
- var SIDEBAR_WIDTH, SIDEBAR_WIDTH_MOBILE, SIDEBAR_WIDTH_ICON, SIDEBAR_KEYBOARD_SHORTCUT, SidebarContext, SidebarProvider, Sidebar, SidebarTrigger, SidebarRail, SidebarInset, SidebarInput, SidebarHeader, SidebarFooter, SidebarSeparator, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarGroupAction, SidebarGroupContent, SidebarMenu, SidebarMenuItem, sidebarMenuButtonVariants, SidebarMenuButton, SidebarMenuAction, SidebarMenuBadge, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton;
1548
- var init_sidebar2 = __esm({
1549
- "src/ui/primitives/sidebar.tsx"() {
1550
- "use client";
1551
- init_hooks();
1552
- init_utils();
1553
- init_button();
1554
- init_feedback();
1555
- init_tooltip();
1556
- SIDEBAR_WIDTH = "16rem";
1557
- SIDEBAR_WIDTH_MOBILE = "18rem";
1558
- SIDEBAR_WIDTH_ICON = "3rem";
1559
- SIDEBAR_KEYBOARD_SHORTCUT = "b";
1560
- SidebarContext = React12__namespace.createContext(null);
1561
- SidebarProvider = React12__namespace.forwardRef(
1562
- ({
1563
- defaultOpen = false,
1564
- open: openProp,
1565
- onOpenChange: setOpenProp,
1566
- className,
1567
- style,
1568
- children,
1569
- ...props
1570
- }, ref) => {
1571
- const isMobile = useMobile();
1572
- const [openMobile, setOpenMobile] = React12__namespace.useState(false);
1573
- const [hoverOpen, setHoverOpen] = React12__namespace.useState(false);
1574
- const [_open, _setOpen] = React12__namespace.useState(defaultOpen);
1575
- const open = openProp ?? _open;
1576
- const setOpen = React12__namespace.useCallback(
1577
- (value) => {
1578
- if (setOpenProp) {
1579
- return setOpenProp(typeof value === "function" ? value(open) : value);
1580
- }
1581
- _setOpen(value);
1582
- },
1583
- [setOpenProp, open]
1584
- );
1585
- const toggleSidebar = React12__namespace.useCallback(() => {
1586
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
1587
- }, [isMobile, setOpen, setOpenMobile]);
1588
- React12__namespace.useEffect(() => {
1589
- const handleKeyDown = (event) => {
1590
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
1591
- event.preventDefault();
1592
- toggleSidebar();
1593
- }
1594
- };
1595
- window.addEventListener("keydown", handleKeyDown);
1596
- return () => window.removeEventListener("keydown", handleKeyDown);
1597
- }, [toggleSidebar]);
1598
- const state = open ? "expanded" : "collapsed";
1599
- const isHoverExpanded = !open && hoverOpen;
1600
- const contextValue = React12__namespace.useMemo(
1601
- () => ({
1602
- state,
1603
- open,
1604
- setOpen,
1605
- isMobile,
1606
- openMobile,
1607
- setOpenMobile,
1608
- toggleSidebar,
1609
- hoverOpen,
1610
- setHoverOpen,
1611
- isHoverExpanded
1612
- }),
1613
- [
1614
- state,
1615
- open,
1616
- setOpen,
1617
- isMobile,
1618
- openMobile,
1619
- setOpenMobile,
1620
- toggleSidebar,
1621
- hoverOpen,
1622
- setHoverOpen,
1623
- isHoverExpanded
1624
- ]
1625
- );
1626
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
1627
- "div",
1628
- {
1629
- style: {
1630
- "--sidebar-width": SIDEBAR_WIDTH,
1631
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
1632
- ...style
1633
- },
1634
- className: cn(
1635
- "group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
1636
- className
1637
- ),
1638
- ref,
1639
- ...props,
1640
- children
1641
- }
1642
- ) }) });
1643
- }
1644
- );
1645
- SidebarProvider.displayName = "SidebarProvider";
1646
- Sidebar = React12__namespace.forwardRef(
1647
- ({
1648
- side = "left",
1649
- variant = "sidebar",
1650
- collapsible = "offcanvas",
1651
- hoverExpandEnabled = true,
1652
- className,
1653
- children,
1654
- ...props
1655
- }, ref) => {
1656
- const {
1657
- isMobile,
1658
- state,
1659
- openMobile,
1660
- setOpenMobile,
1661
- setHoverOpen,
1662
- isHoverExpanded
1663
- } = useSidebar();
1664
- const handleMouseEnter = React12__namespace.useCallback(() => {
1665
- if (hoverExpandEnabled && state === "collapsed" && collapsible === "icon") {
1666
- setHoverOpen(true);
1667
- }
1668
- }, [hoverExpandEnabled, state, collapsible, setHoverOpen]);
1669
- const handleMouseLeave = React12__namespace.useCallback(() => {
1670
- if (hoverExpandEnabled) {
1671
- setHoverOpen(false);
1672
- }
1673
- }, [hoverExpandEnabled, setHoverOpen]);
1674
- if (collapsible === "none") {
1675
- return /* @__PURE__ */ jsxRuntime.jsx(
1676
- "div",
1677
- {
1678
- className: cn(
1679
- "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
1680
- className
1681
- ),
1682
- ref,
1683
- ...props,
1684
- children
1685
- }
1686
- );
1687
- }
1688
- if (isMobile) {
1689
- return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
1690
- SheetContent,
1691
- {
1692
- "data-sidebar": "sidebar",
1693
- "data-mobile": "true",
1694
- className: "w-(--sidebar-width) bg-background p-0 text-foreground [&>button]:hidden",
1695
- style: {
1696
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
1697
- },
1698
- side,
1699
- children: [
1700
- /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { className: "sr-only", children: "Mobile Menu" }),
1701
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
1702
- ]
1703
- }
1704
- ) });
1705
- }
1706
- return /* @__PURE__ */ jsxRuntime.jsxs(
1707
- "div",
1708
- {
1709
- ref,
1710
- className: cn(
1711
- "group peer hidden md:block transition-colors duration-200",
1712
- // Blue bg + white text when collapsed, white bg + dark text when expanded/hover
1713
- state === "collapsed" && !isHoverExpanded ? "text-sidebar-foreground" : "text-foreground"
1714
- ),
1715
- "data-state": state,
1716
- "data-hover-expanded": isHoverExpanded,
1717
- "data-collapsible": state === "collapsed" ? collapsible : "",
1718
- "data-variant": variant,
1719
- "data-side": side,
1720
- onMouseEnter: handleMouseEnter,
1721
- onMouseLeave: handleMouseLeave,
1722
- children: [
1723
- /* @__PURE__ */ jsxRuntime.jsx(
1724
- "div",
1725
- {
1726
- className: cn(
1727
- "duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear",
1728
- "group-data-[collapsible=offcanvas]:w-0",
1729
- "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
1730
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
1731
- )
1732
- }
1733
- ),
1734
- /* @__PURE__ */ jsxRuntime.jsx(
1735
- "div",
1736
- {
1737
- className: cn(
1738
- "duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",
1739
- 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)]",
1740
- // Adjustments for collapsible=icon
1741
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_8px)] group-data-[collapsible=icon]:px-2.5" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[collapsible=icon]:border-r group-data-[collapsible=icon]:px-0",
1742
- // Hover expand - override icon width to full width on hover
1743
- "group-data-[hover-expanded=true]:!w-(--sidebar-width) group-data-[hover-expanded=true]:shadow-xl group-data-[hover-expanded=true]:z-[100]",
1744
- className
1745
- ),
1746
- ...props,
1747
- children: /* @__PURE__ */ jsxRuntime.jsx(
1748
- "div",
1749
- {
1750
- "data-sidebar": "sidebar",
1751
- className: cn(
1752
- "flex h-full w-full flex-col border-r transition-colors duration-200",
1753
- // Blue background when collapsed, white when expanded/hover
1754
- "group-data-[state=collapsed]:bg-sidebar group-data-[state=collapsed]:border-sidebar-border",
1755
- "group-data-[state=expanded]:bg-background group-data-[state=expanded]:border-border",
1756
- "group-data-[hover-expanded=true]:!bg-background group-data-[hover-expanded=true]:!border-border",
1757
- "group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
1758
- ),
1759
- children
1760
- }
1761
- )
1762
- }
1763
- )
1764
- ]
1765
- }
1766
- );
1767
- }
1768
- );
1769
- Sidebar.displayName = "Sidebar";
1770
- SidebarTrigger = React12__namespace.forwardRef(({ className, onClick, ...props }, ref) => {
1771
- const { toggleSidebar } = useSidebar();
1772
- return /* @__PURE__ */ jsxRuntime.jsxs(
1773
- Button,
1774
- {
1775
- ref,
1776
- "data-sidebar": "trigger",
1777
- variant: "ghost",
1778
- size: "icon",
1779
- className: cn("h-7 w-7", className),
1780
- onClick: (event) => {
1781
- onClick?.(event);
1782
- toggleSidebar();
1783
- },
1784
- ...props,
1785
- children: [
1786
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeft, {}),
1787
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
1788
- ]
1789
- }
1790
- );
1791
- });
1792
- SidebarTrigger.displayName = "SidebarTrigger";
1793
- SidebarRail = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1794
- const { toggleSidebar } = useSidebar();
1795
- return /* @__PURE__ */ jsxRuntime.jsx(
1796
- "button",
1797
- {
1798
- ref,
1799
- "data-sidebar": "rail",
1800
- "aria-label": "Toggle Sidebar",
1801
- tabIndex: -1,
1802
- onClick: toggleSidebar,
1803
- title: "Toggle Sidebar",
1804
- className: cn(
1805
- "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
1806
- "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
1807
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
1808
- "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
1809
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
1810
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
1811
- className
1812
- ),
1813
- ...props
1814
- }
1815
- );
1816
- });
1817
- SidebarRail.displayName = "SidebarRail";
1818
- SidebarInset = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1819
- return /* @__PURE__ */ jsxRuntime.jsx(
1820
- "main",
1821
- {
1822
- ref,
1823
- className: cn(
1824
- "relative flex min-h-svh flex-1 flex-col bg-muted/40 transition-[margin] duration-200 ease-linear",
1825
- "peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] 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",
1826
- className
1827
- ),
1828
- ...props
1829
- }
1830
- );
1831
- });
1832
- SidebarInset.displayName = "SidebarInset";
1833
- SidebarInput = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1834
- return /* @__PURE__ */ jsxRuntime.jsx(
1835
- "input",
1836
- {
1837
- ref,
1838
- "data-sidebar": "input",
1839
- className: cn(
1840
- "flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
1841
- className
1842
- ),
1843
- ...props
1844
- }
1845
- );
1846
- });
1847
- SidebarInput.displayName = "SidebarInput";
1848
- SidebarHeader = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1849
- return /* @__PURE__ */ jsxRuntime.jsx(
1850
- "div",
1851
- {
1852
- ref,
1853
- "data-sidebar": "header",
1854
- className: cn("flex flex-col gap-2 p-2", className),
1855
- ...props
1856
- }
1857
- );
1858
- });
1859
- SidebarHeader.displayName = "SidebarHeader";
1860
- SidebarFooter = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1861
- return /* @__PURE__ */ jsxRuntime.jsx(
1862
- "div",
1863
- {
1864
- ref,
1865
- "data-sidebar": "footer",
1866
- className: cn("flex flex-col gap-2 p-2", className),
1867
- ...props
1868
- }
1869
- );
1870
- });
1871
- SidebarFooter.displayName = "SidebarFooter";
1872
- SidebarSeparator = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1873
- return /* @__PURE__ */ jsxRuntime.jsx(
1874
- "div",
1875
- {
1876
- ref,
1877
- "data-sidebar": "separator",
1878
- className: cn("mx-2 h-[1px] w-auto bg-sidebar-border", className),
1879
- ...props
1880
- }
1881
- );
1882
- });
1883
- SidebarSeparator.displayName = "SidebarSeparator";
1884
- SidebarContent = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1885
- return /* @__PURE__ */ jsxRuntime.jsx(
1886
- "div",
1887
- {
1888
- ref,
1889
- "data-sidebar": "content",
1890
- className: cn(
1891
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto",
1892
- // Hide overflow when collapsed, but show when hover-expanded
1893
- "group-data-[collapsible=icon]:overflow-hidden group-data-[hover-expanded=true]:!overflow-auto",
1894
- className
1895
- ),
1896
- ...props
1897
- }
1898
- );
1899
- });
1900
- SidebarContent.displayName = "SidebarContent";
1901
- SidebarGroup = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1902
- return /* @__PURE__ */ jsxRuntime.jsx(
1903
- "div",
1904
- {
1905
- ref,
1906
- "data-sidebar": "group",
1907
- className: cn("relative flex w-full min-w-0 flex-col p-2", className),
1908
- ...props
1909
- }
1910
- );
1911
- });
1912
- SidebarGroup.displayName = "SidebarGroup";
1913
- SidebarGroupLabel = React12__namespace.forwardRef(({ className, asChild = false, ...props }, ref) => {
1914
- const Comp = asChild ? reactSlot.Slot : "div";
1915
- return /* @__PURE__ */ jsxRuntime.jsx(
1916
- Comp,
1917
- {
1918
- ref,
1919
- "data-sidebar": "group-label",
1920
- className: cn(
1921
- "duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-bold text-primary uppercase tracking-wider outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
1922
- // Hide when collapsed, show when hover-expanded
1923
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
1924
- "group-data-[hover-expanded=true]:!mt-0 group-data-[hover-expanded=true]:!opacity-100",
1925
- className
1926
- ),
1927
- ...props
1928
- }
1929
- );
1930
- });
1931
- SidebarGroupLabel.displayName = "SidebarGroupLabel";
1932
- SidebarGroupAction = React12__namespace.forwardRef(({ className, asChild = false, ...props }, ref) => {
1933
- const Comp = asChild ? reactSlot.Slot : "button";
1934
- return /* @__PURE__ */ jsxRuntime.jsx(
1935
- Comp,
1936
- {
1937
- ref,
1938
- "data-sidebar": "group-action",
1939
- className: cn(
1940
- "absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
1941
- // Increases the hit area of the button on mobile.
1942
- "after:absolute after:-inset-2 after:md:hidden",
1943
- "group-data-[collapsible=icon]:hidden",
1944
- className
1945
- ),
1946
- ...props
1947
- }
1948
- );
1949
- });
1950
- SidebarGroupAction.displayName = "SidebarGroupAction";
1951
- SidebarGroupContent = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1952
- return /* @__PURE__ */ jsxRuntime.jsx(
1953
- "div",
1954
- {
1955
- ref,
1956
- "data-sidebar": "group-content",
1957
- className: cn("w-full text-sm", className),
1958
- ...props
1959
- }
1960
- );
1961
- });
1962
- SidebarGroupContent.displayName = "SidebarGroupContent";
1963
- SidebarMenu = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1964
- return /* @__PURE__ */ jsxRuntime.jsx(
1965
- "ul",
1966
- {
1967
- ref,
1968
- "data-sidebar": "menu",
1969
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
1970
- ...props
1971
- }
1972
- );
1973
- });
1974
- SidebarMenu.displayName = "SidebarMenu";
1975
- SidebarMenuItem = React12__namespace.forwardRef(({ className, ...props }, ref) => {
1976
- return /* @__PURE__ */ jsxRuntime.jsx(
1977
- "li",
1978
- {
1979
- ref,
1980
- "data-sidebar": "menu-item",
1981
- className: cn("group/menu-item relative", className),
1982
- ...props
1983
- }
1984
- );
1985
- });
1986
- SidebarMenuItem.displayName = "SidebarMenuItem";
1987
- sidebarMenuButtonVariants = classVarianceAuthority.cva(
1988
- // Base styles + hover-expand overrides
1989
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[hover-expanded=true]:!size-auto group-data-[hover-expanded=true]:!w-full group-data-[hover-expanded=true]:!p-2",
1990
- {
1991
- variants: {
1992
- variant: {
1993
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1994
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
1995
- },
1996
- size: {
1997
- default: "h-8 text-sm",
1998
- sm: "h-7 text-xs",
1999
- lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
2000
- },
2001
- isActive: {
2002
- true: "bg-primary/10 text-primary font-bold"
2003
- }
2004
- },
2005
- defaultVariants: {
2006
- variant: "default",
2007
- size: "default"
2008
- }
2009
- }
2010
- );
2011
- SidebarMenuButton = React12__namespace.forwardRef(
2012
- ({
2013
- asChild = false,
2014
- isActive = false,
2015
- variant = "default",
2016
- size = "default",
2017
- tooltip,
2018
- className,
2019
- ...props
2020
- }, ref) => {
2021
- const Comp = asChild ? reactSlot.Slot : "button";
2022
- const { isMobile, state } = useSidebar();
2023
- const button = /* @__PURE__ */ jsxRuntime.jsx(
2024
- Comp,
2025
- {
2026
- ref,
2027
- "data-sidebar": "menu-button",
2028
- "data-size": size,
2029
- "data-active": isActive,
2030
- className: cn(
2031
- sidebarMenuButtonVariants({ variant, size, isActive }),
2032
- className
2033
- ),
2034
- ...props
2035
- }
2036
- );
2037
- if (!tooltip) {
2038
- return button;
2039
- }
2040
- if (typeof tooltip === "string") {
2041
- tooltip = {
2042
- children: tooltip
2043
- };
2044
- }
2045
- return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
2046
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: button }),
2047
- /* @__PURE__ */ jsxRuntime.jsx(
2048
- TooltipContent,
2049
- {
2050
- side: "right",
2051
- align: "center",
2052
- hidden: state !== "collapsed" || isMobile,
2053
- ...tooltip
2054
- }
2055
- )
2056
- ] });
2057
- }
2058
- );
2059
- SidebarMenuButton.displayName = "SidebarMenuButton";
2060
- SidebarMenuAction = React12__namespace.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
2061
- const Comp = asChild ? reactSlot.Slot : "button";
2062
- return /* @__PURE__ */ jsxRuntime.jsx(
2063
- Comp,
2064
- {
2065
- ref,
2066
- "data-sidebar": "menu-action",
2067
- className: cn(
2068
- "absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
2069
- // Increases the hit area of the button on mobile.
2070
- "after:absolute after:-inset-2 after:md:hidden",
2071
- "peer-data-[size=sm]/menu-button:top-1",
2072
- "peer-data-[size=default]/menu-button:top-1.5",
2073
- "peer-data-[size=lg]/menu-button:top-2.5",
2074
- "group-data-[collapsible=icon]:hidden",
2075
- showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
2076
- className
2077
- ),
2078
- ...props
2079
- }
2080
- );
2081
- });
2082
- SidebarMenuAction.displayName = "SidebarMenuAction";
2083
- SidebarMenuBadge = React12__namespace.forwardRef(({ className, ...props }, ref) => {
2084
- return /* @__PURE__ */ jsxRuntime.jsx(
2085
- "div",
2086
- {
2087
- ref,
2088
- "data-sidebar": "menu-badge",
2089
- className: cn(
2090
- "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 text-sidebar-foreground select-none",
2091
- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
2092
- "peer-data-[size=sm]/menu-button:top-1",
2093
- "peer-data-[size=default]/menu-button:top-1.5",
2094
- "peer-data-[size=lg]/menu-button:top-2.5",
2095
- "group-data-[collapsible=icon]:hidden",
2096
- className
2097
- ),
2098
- ...props
2099
- }
2100
- );
2101
- });
2102
- SidebarMenuBadge.displayName = "SidebarMenuBadge";
2103
- SidebarMenuSkeleton = React12__namespace.forwardRef(({ className, showIcon = false, ...props }, ref) => {
2104
- const width = React12__namespace.useMemo(() => {
2105
- return `${Math.floor(Math.random() * 40) + 50}%`;
2106
- }, []);
2107
- return /* @__PURE__ */ jsxRuntime.jsxs(
2108
- "div",
2109
- {
2110
- ref,
2111
- "data-sidebar": "menu-skeleton",
2112
- className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
2113
- ...props,
2114
- children: [
2115
- showIcon && /* @__PURE__ */ jsxRuntime.jsx(
2116
- "div",
2117
- {
2118
- className: "size-4 rounded-md animate-pulse bg-muted",
2119
- "data-sidebar": "menu-skeleton-icon"
2120
- }
2121
- ),
2122
- /* @__PURE__ */ jsxRuntime.jsx(
2123
- "div",
2124
- {
2125
- className: "h-4 flex-1 max-w-[--skeleton-width] animate-pulse bg-muted rounded-full",
2126
- "data-sidebar": "menu-skeleton-text",
2127
- style: {
2128
- "--skeleton-width": width
2129
- }
2130
- }
2131
- )
2132
- ]
2133
- }
2134
- );
2135
- });
2136
- SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
2137
- SidebarMenuSub = React12__namespace.forwardRef(({ className, ...props }, ref) => {
2138
- return /* @__PURE__ */ jsxRuntime.jsx(
2139
- "ul",
2140
- {
2141
- ref,
2142
- "data-sidebar": "menu-sub",
2143
- className: cn(
2144
- "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
2145
- // Hide when collapsed, show when hover-expanded
2146
- "group-data-[collapsible=icon]:hidden group-data-[hover-expanded=true]:!flex",
2147
- className
2148
- ),
2149
- ...props
2150
- }
2151
- );
2152
- });
2153
- SidebarMenuSub.displayName = "SidebarMenuSub";
2154
- SidebarMenuSubItem = React12__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, ...props }));
2155
- SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
2156
- SidebarMenuSubButton = React12__namespace.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
2157
- const Comp = asChild ? reactSlot.Slot : "a";
2158
- return /* @__PURE__ */ jsxRuntime.jsx(
2159
- Comp,
2160
- {
2161
- ref,
2162
- "data-sidebar": "menu-sub-button",
2163
- "data-size": size,
2164
- "data-active": isActive,
2165
- className: cn(
2166
- "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground 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 text-xs",
2167
- "data-[active=true]:bg-primary/15 data-[active=true]:!text-primary data-[active=true]:font-bold",
2168
- size === "sm" && "text-xs",
2169
- size === "md" && "text-sm",
2170
- className
2171
- ),
2172
- ...props
2173
- }
2174
- );
2175
- });
2176
- SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
2177
- }
2178
- });
2179
- function Spinner({ size = "md", className }) {
2180
- const sizeClasses = {
2181
- sm: "h-4 w-4",
2182
- md: "h-6 w-6",
2183
- lg: "h-8 w-8"
2184
- };
2185
- return /* @__PURE__ */ jsxRuntime.jsx(
2186
- "div",
2187
- {
2188
- className: cn(
2189
- "animate-spin rounded-full border-2 border-current border-t-transparent",
2190
- sizeClasses[size],
2191
- className
2192
- )
2193
- }
2194
- );
2195
- }
2196
- var Textarea, ButtonLoading;
2197
- var init_primitives = __esm({
2198
- "src/ui/primitives/index.tsx"() {
2199
- init_utils();
2200
- init_button();
2201
- init_badge();
2202
- init_button();
2203
- init_input();
2204
- init_checkbox();
2205
- init_card();
2206
- init_separator();
2207
- init_card();
2208
- init_table();
2209
- init_dropdown_menu();
2210
- init_dialog();
2211
- init_tabs();
2212
- init_breadcrumb();
2213
- init_keyboard();
2214
- init_pagination();
2215
- init_status_badge();
2216
- init_sidebar2();
2217
- init_popover();
2218
- init_scroll_area();
2219
- init_calendar();
2220
- init_resizable();
2221
- init_slider();
2222
- init_switch();
2223
- init_tooltip();
2224
- init_select();
2225
- init_menubar();
2226
- init_navigation_menu();
2227
- init_toggle();
2228
- init_toggle_group();
2229
- init_combobox();
2230
- init_label();
2231
- Textarea = React12__namespace.forwardRef(
2232
- ({ className, ...props }, ref) => {
2233
- return /* @__PURE__ */ jsxRuntime.jsx(
2234
- "textarea",
2235
- {
2236
- className: cn(
2237
- "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2238
- className
2239
- ),
2240
- ref,
2241
- ...props
2242
- }
2243
- );
2244
- }
2245
- );
2246
- Textarea.displayName = "Textarea";
2247
- ButtonLoading = React12__namespace.forwardRef(({ className, isLoading, children, disabled, ...props }, ref) => {
2248
- return /* @__PURE__ */ jsxRuntime.jsxs(
2249
- Button,
2250
- {
2251
- className: cn("gap-2", className),
2252
- disabled: isLoading || disabled,
2253
- ref,
2254
- ...props,
2255
- children: [
2256
- isLoading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm" }),
2257
- children
2258
- ]
2259
- }
2260
- );
2261
- });
2262
- ButtonLoading.displayName = "ButtonLoading";
2263
- }
2264
- });
2265
- var init_radio_group = __esm({
2266
- "src/ui/forms/radio-group.tsx"() {
2267
- "use client";
2268
- }
2269
- });
2270
- var init_rating = __esm({
2271
- "src/ui/forms/rating.tsx"() {
2272
- "use client";
2273
- classVarianceAuthority.cva(
2274
- "transition-all duration-100 ease-in-out hover:scale-110",
2275
- {
2276
- variants: {
2277
- size: {
2278
- sm: "w-4 h-4",
2279
- default: "w-6 h-6",
2280
- lg: "w-8 h-8"
2281
- },
2282
- variant: {
2283
- default: "text-yellow-400",
2284
- primary: "text-primary",
2285
- muted: "text-muted-foreground"
2286
- },
2287
- filled: {
2288
- true: "",
2289
- false: "text-gray-200"
2290
- }
2291
- },
2292
- defaultVariants: {
2293
- size: "default",
2294
- variant: "default",
2295
- filled: false
2296
- }
2297
- }
2298
- );
2299
- }
2300
- });
2301
- var init_command = __esm({
2302
- "src/ui/forms/command.tsx"() {
2303
- "use client";
2304
- }
2305
- });
2306
- var MultiSelect;
2307
- var init_multi_select = __esm({
2308
- "src/ui/forms/multi-select.tsx"() {
2309
- "use client";
2310
- init_utils();
2311
- init_primitives();
2312
- init_client();
2313
- MultiSelect = React12__namespace.forwardRef(
2314
- ({
2315
- options,
2316
- value: controlledValue,
2317
- onValueChange,
2318
- defaultValue = [],
2319
- placeholder = "Select options...",
2320
- searchPlaceholder = "Search...",
2321
- emptyText = "No option found.",
2322
- maxCount = 3,
2323
- disabled = false,
2324
- responsive = false,
2325
- className,
2326
- id
2327
- }, ref) => {
2328
- const [internalValue, setInternalValue] = React12.useState(defaultValue);
2329
- const [open, setOpen] = React12.useState(false);
2330
- const [searchValue, setSearchValue] = React12.useState("");
2331
- const isControlled = controlledValue !== void 0;
2332
- const value = isControlled ? controlledValue : internalValue;
2333
- const containerRef = React12.useRef(null);
2334
- const searchInputRef = React12.useRef(null);
2335
- const dropdownRef = React12.useRef(null);
2336
- const buttonRef = React12.useRef(null);
2337
- const [politeMessage, setPoliteMessage] = React12.useState("");
2338
- const [assertiveMessage, setAssertiveMessage] = React12.useState("");
2339
- const prevSelectedCount = React12.useRef(value.length);
2340
- const announce = React12.useCallback(
2341
- (message, priority = "polite") => {
2342
- if (priority === "assertive") {
2343
- setAssertiveMessage(message);
2344
- setTimeout(() => setAssertiveMessage(""), 100);
2345
- } else {
2346
- setPoliteMessage(message);
2347
- setTimeout(() => setPoliteMessage(""), 100);
2348
- }
2349
- },
2350
- []
2351
- );
2352
- const [screenSize, setScreenSize] = React12.useState("desktop");
2353
- React12.useEffect(() => {
2354
- if (typeof window === "undefined") return;
2355
- const handleResize = () => {
2356
- const width = window.innerWidth;
2357
- if (width < 640) {
2358
- setScreenSize("mobile");
2359
- } else if (width < 1024) {
2360
- setScreenSize("tablet");
2361
- } else {
2362
- setScreenSize("desktop");
2363
- }
2364
- };
2365
- handleResize();
2366
- window.addEventListener("resize", handleResize);
2367
- return () => window.removeEventListener("resize", handleResize);
2368
- }, []);
2369
- const getResponsiveSettings = React12.useCallback(() => {
2370
- if (!responsive) {
2371
- return {
2372
- maxCount,
2373
- compactMode: false
2374
- };
2375
- }
2376
- if (responsive === true) {
2377
- const defaultResponsive = {
2378
- mobile: { maxCount: 2, compactMode: true },
2379
- tablet: { maxCount: 4, compactMode: false },
2380
- desktop: { maxCount: 6, compactMode: false }
2381
- };
2382
- const currentSettings2 = defaultResponsive[screenSize];
2383
- return {
2384
- maxCount: currentSettings2?.maxCount ?? maxCount,
2385
- compactMode: currentSettings2?.compactMode ?? false
2386
- };
2387
- }
2388
- const currentSettings = responsive[screenSize];
2389
- return {
2390
- maxCount: currentSettings?.maxCount ?? maxCount,
2391
- compactMode: currentSettings?.compactMode ?? false
2392
- };
2393
- }, [responsive, screenSize, maxCount]);
2394
- const responsiveSettings = getResponsiveSettings();
2395
- const filteredOptions = React12.useMemo(() => {
2396
- if (!searchValue.trim()) {
2397
- return options;
2398
- }
2399
- const searchLower = searchValue.toLowerCase();
2400
- return options.filter(
2401
- (option) => option.label.toLowerCase().includes(searchLower) || String(option.value).toLowerCase().includes(searchLower)
2402
- );
2403
- }, [options, searchValue]);
2404
- React12.useEffect(() => {
2405
- if (!open) {
2406
- setSearchValue("");
2407
- }
2408
- }, [open]);
2409
- React12.useEffect(() => {
2410
- if (open && searchInputRef.current) {
2411
- setTimeout(() => {
2412
- searchInputRef.current?.focus();
2413
- }, 50);
2414
- }
2415
- }, [open]);
2416
- React12.useEffect(() => {
2417
- if (!open) return;
2418
- const handleClickOutside = (event) => {
2419
- const target = event.target;
2420
- if (containerRef.current && !containerRef.current.contains(target) && dropdownRef.current && !dropdownRef.current.contains(target)) {
2421
- if (target.closest('[data-slot="dialog-content"]')) {
2422
- return;
2423
- }
2424
- setOpen(false);
2425
- }
2426
- };
2427
- const handleEscape = (event) => {
2428
- if (event.key === "Escape" && open) {
2429
- event.stopPropagation();
2430
- setOpen(false);
2431
- }
2432
- };
2433
- document.addEventListener("mousedown", handleClickOutside, true);
2434
- document.addEventListener("keydown", handleEscape, true);
2435
- return () => {
2436
- document.removeEventListener("mousedown", handleClickOutside, true);
2437
- document.removeEventListener("keydown", handleEscape, true);
2438
- };
2439
- }, [open]);
2440
- React12.useEffect(() => {
2441
- const selectedCount = value.length;
2442
- const totalOptions = options.filter((opt) => !opt.disabled).length;
2443
- if (selectedCount !== prevSelectedCount.current) {
2444
- const diff = selectedCount - prevSelectedCount.current;
2445
- if (diff > 0) {
2446
- announce(`${selectedCount} of ${totalOptions} options selected.`);
2447
- } else if (diff < 0) {
2448
- announce(
2449
- `Option removed. ${selectedCount} of ${totalOptions} options selected.`
2450
- );
2451
- }
2452
- prevSelectedCount.current = selectedCount;
2453
- }
2454
- }, [value, announce, options]);
2455
- const updateValue = React12.useCallback(
2456
- (newValue) => {
2457
- if (!isControlled) {
2458
- setInternalValue(newValue);
2459
- }
2460
- onValueChange?.(newValue);
2461
- },
2462
- [isControlled, onValueChange]
2463
- );
2464
- const handleSelect = React12.useCallback(
2465
- (optionValue) => {
2466
- const option = options.find((opt) => opt.value === optionValue);
2467
- if (option?.disabled) {
2468
- return;
2469
- }
2470
- const newValue = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
2471
- updateValue(newValue);
2472
- },
2473
- [value, options, updateValue]
2474
- );
2475
- const handleSelectAll = React12.useCallback(() => {
2476
- updateValue(
2477
- filteredOptions.filter((opt) => !opt.disabled).map((opt) => opt.value)
2478
- );
2479
- }, [updateValue, filteredOptions]);
2480
- const handleClearAll = React12.useCallback(() => {
2481
- updateValue([]);
2482
- }, [updateValue]);
2483
- const handleRemove = React12.useCallback(
2484
- (optionValue, e) => {
2485
- e.stopPropagation();
2486
- updateValue(value.filter((v) => v !== optionValue));
2487
- },
2488
- [updateValue, value]
2489
- );
2490
- const clearExtraOptions = React12.useCallback(() => {
2491
- const newSelectedValues = value.slice(0, responsiveSettings.maxCount);
2492
- updateValue(newSelectedValues);
2493
- }, [value, responsiveSettings.maxCount, updateValue]);
2494
- React12__namespace.useImperativeHandle(
2495
- ref,
2496
- () => ({
2497
- reset: () => {
2498
- updateValue(defaultValue);
2499
- setOpen(false);
2500
- setSearchValue("");
2501
- },
2502
- getSelectedValues: () => value,
2503
- setSelectedValues: (values) => {
2504
- updateValue(values);
2505
- },
2506
- clear: () => {
2507
- updateValue([]);
2508
- },
2509
- focus: () => {
2510
- buttonRef.current?.focus();
2511
- }
2512
- }),
2513
- [value, defaultValue, updateValue]
2514
- );
2515
- const selectedOptions = options.filter(
2516
- (option) => value.includes(option.value)
2517
- );
2518
- const getBadgeColor = (index) => {
2519
- const colors = [
2520
- "bg-blue-100 text-blue-700 hover:bg-blue-200",
2521
- "bg-green-100 text-green-700 hover:bg-green-200",
2522
- "bg-purple-100 text-purple-700 hover:bg-purple-200",
2523
- "bg-orange-100 text-orange-700 hover:bg-orange-200",
2524
- "bg-pink-100 text-pink-700 hover:bg-pink-200",
2525
- "bg-cyan-100 text-cyan-700 hover:bg-cyan-200"
2526
- ];
2527
- return colors[index % colors.length];
2528
- };
2529
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "relative w-full", children: [
2530
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sr-only", children: [
2531
- /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", children: politeMessage }),
2532
- /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-live": "assertive", "aria-atomic": "true", role: "alert", children: assertiveMessage })
2533
- ] }),
2534
- /* @__PURE__ */ jsxRuntime.jsxs(
2535
- Button,
2536
- {
2537
- ref: buttonRef,
2538
- type: "button",
2539
- variant: "outline",
2540
- role: "combobox",
2541
- "aria-expanded": open,
2542
- disabled,
2543
- className: cn(
2544
- "w-full justify-between h-auto min-h-10 px-3 py-2",
2545
- responsiveSettings.compactMode && "min-h-8 text-sm",
2546
- className
2547
- ),
2548
- id,
2549
- onClick: (e) => {
2550
- e.stopPropagation();
2551
- setOpen(!open);
2552
- },
2553
- children: [
2554
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: selectedOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2555
- selectedOptions.slice(0, responsiveSettings.maxCount).map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2556
- Badge,
2557
- {
2558
- className: cn(
2559
- "mr-1 mb-1",
2560
- getBadgeColor(index),
2561
- responsiveSettings.compactMode && "text-xs px-1.5 py-0.5"
2562
- ),
2563
- onClick: (e) => handleRemove(option.value, e),
2564
- children: [
2565
- option.icon && !responsiveSettings.compactMode && /* @__PURE__ */ jsxRuntime.jsx(option.icon, { className: "mr-2 h-4 w-4" }),
2566
- option.label,
2567
- /* @__PURE__ */ jsxRuntime.jsx(
2568
- "div",
2569
- {
2570
- role: "button",
2571
- tabIndex: 0,
2572
- className: "ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",
2573
- onKeyDown: (e) => {
2574
- if (e.key === "Enter") {
2575
- handleRemove(option.value, e);
2576
- }
2577
- },
2578
- onMouseDown: (e) => {
2579
- e.preventDefault();
2580
- e.stopPropagation();
2581
- },
2582
- onClick: (e) => handleRemove(option.value, e),
2583
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3 text-muted-foreground hover:text-foreground" })
2584
- }
2585
- )
2586
- ]
2587
- },
2588
- String(option.value)
2589
- )),
2590
- value.length > responsiveSettings.maxCount && /* @__PURE__ */ jsxRuntime.jsxs(
2591
- Badge,
2592
- {
2593
- className: cn(
2594
- "mr-1 mb-1 bg-muted text-muted-foreground hover:bg-muted",
2595
- responsiveSettings.compactMode && "text-xs px-1.5 py-0.5"
2596
- ),
2597
- children: [
2598
- "+",
2599
- value.length - responsiveSettings.maxCount,
2600
- " more",
2601
- /* @__PURE__ */ jsxRuntime.jsx(
2602
- "div",
2603
- {
2604
- role: "button",
2605
- tabIndex: 0,
2606
- className: "ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",
2607
- onClick: (e) => {
2608
- e.stopPropagation();
2609
- clearExtraOptions();
2610
- },
2611
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
2612
- }
2613
- )
2614
- ]
2615
- }
2616
- )
2617
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: placeholder }) }),
2618
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
2619
- ]
2620
- }
2621
- ),
2622
- open && /* @__PURE__ */ jsxRuntime.jsx(
2623
- "div",
2624
- {
2625
- ref: dropdownRef,
2626
- className: "absolute z-[100] mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md",
2627
- style: {
2628
- top: "100%",
2629
- left: 0
2630
- },
2631
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
2632
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3 py-2", children: [
2633
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
2634
- /* @__PURE__ */ jsxRuntime.jsx(
2635
- Input,
2636
- {
2637
- ref: searchInputRef,
2638
- placeholder: searchPlaceholder,
2639
- value: searchValue,
2640
- onChange: (e) => {
2641
- e.stopPropagation();
2642
- setSearchValue(e.target.value);
2643
- },
2644
- onKeyDown: (e) => {
2645
- e.stopPropagation();
2646
- if (e.key === "Escape") {
2647
- e.preventDefault();
2648
- setOpen(false);
2649
- }
2650
- },
2651
- onClick: (e) => {
2652
- e.stopPropagation();
2653
- },
2654
- onFocus: (e) => {
2655
- e.stopPropagation();
2656
- },
2657
- className: "border-0 focus-visible:ring-0 focus-visible:ring-offset-0 h-9 bg-transparent px-0"
2658
- }
2659
- ),
2660
- searchValue && /* @__PURE__ */ jsxRuntime.jsx(
2661
- Button,
2662
- {
2663
- type: "button",
2664
- variant: "ghost",
2665
- size: "sm",
2666
- className: "h-6 w-6 p-0",
2667
- onClick: (e) => {
2668
- e.stopPropagation();
2669
- setSearchValue("");
2670
- searchInputRef.current?.focus();
2671
- },
2672
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
2673
- }
2674
- )
2675
- ] }),
2676
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b p-1", children: [
2677
- /* @__PURE__ */ jsxRuntime.jsx(
2678
- Button,
2679
- {
2680
- type: "button",
2681
- variant: "ghost",
2682
- size: "sm",
2683
- className: "h-8 px-2 text-xs",
2684
- onClick: (e) => {
2685
- e.stopPropagation();
2686
- handleSelectAll();
2687
- },
2688
- children: "Select All"
2689
- }
2690
- ),
2691
- /* @__PURE__ */ jsxRuntime.jsx(
2692
- Button,
2693
- {
2694
- type: "button",
2695
- variant: "ghost",
2696
- size: "sm",
2697
- className: "h-8 px-2 text-xs",
2698
- onClick: (e) => {
2699
- e.stopPropagation();
2700
- handleClearAll();
2701
- },
2702
- children: "Clear All"
2703
- }
2704
- )
2705
- ] }),
2706
- /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "max-h-[300px]", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyText }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1", children: filteredOptions.map((option) => {
2707
- const isSelected = value.includes(option.value);
2708
- const isDisabled = option.disabled || false;
2709
- return /* @__PURE__ */ jsxRuntime.jsxs(
2710
- "div",
2711
- {
2712
- role: "option",
2713
- "aria-selected": isSelected,
2714
- "aria-disabled": isDisabled,
2715
- className: cn(
2716
- "relative flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
2717
- isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-accent hover:text-accent-foreground",
2718
- isSelected && !isDisabled && "bg-accent text-accent-foreground"
2719
- ),
2720
- onMouseDown: (e) => {
2721
- e.preventDefault();
2722
- e.stopPropagation();
2723
- },
2724
- onClick: (e) => {
2725
- e.preventDefault();
2726
- e.stopPropagation();
2727
- if (!isDisabled) {
2728
- handleSelect(option.value);
2729
- }
2730
- },
2731
- children: [
2732
- /* @__PURE__ */ jsxRuntime.jsx(
2733
- "div",
2734
- {
2735
- className: cn(
2736
- "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
2737
- isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
2738
- ),
2739
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: cn("h-4 w-4") })
2740
- }
2741
- ),
2742
- option.icon && /* @__PURE__ */ jsxRuntime.jsx(option.icon, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
2743
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: option.label })
2744
- ]
2745
- },
2746
- String(option.value)
2747
- );
2748
- }) }) }),
2749
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
2750
- Button,
2751
- {
2752
- type: "button",
2753
- variant: "outline",
2754
- size: "sm",
2755
- className: "w-full h-8 text-xs",
2756
- onClick: (e) => {
2757
- e.stopPropagation();
2758
- setOpen(false);
2759
- },
2760
- children: "Close"
2761
- }
2762
- ) })
2763
- ] })
2764
- }
2765
- )
2766
- ] });
2767
- }
2768
- );
2769
- MultiSelect.displayName = "MultiSelect";
2770
- }
2771
- });
2772
- var init_date_picker = __esm({
2773
- "src/ui/forms/date-picker.tsx"() {
2774
- "use client";
2775
- }
2776
- });
2777
- var init_date_range_picker = __esm({
2778
- "src/ui/forms/date-range-picker.tsx"() {
2779
- "use client";
2780
- }
2781
- });
2782
- var init_input_time = __esm({
2783
- "src/ui/forms/input-time.tsx"() {
2784
- "use client";
2785
- }
2786
- });
2787
- var init_date_time_picker = __esm({
2788
- "src/ui/forms/date-time-picker.tsx"() {
2789
- "use client";
2790
- }
2791
- });
2792
- var init_emoji_picker = __esm({
2793
- "src/ui/forms/emoji-picker.tsx"() {
2794
- "use client";
2795
- dynamic__default.default(
2796
- () => {
2797
- return import('emoji-picker-react');
2798
- },
2799
- { ssr: false }
2800
- );
2801
- }
2802
- });
2803
- var init_file_thumbnail = __esm({
2804
- "src/ui/forms/file-thumbnail.tsx"() {
2805
- }
2806
- });
2807
- var init_file_dropzone = __esm({
2808
- "src/ui/forms/file-dropzone.tsx"() {
2809
- "use client";
2810
- }
2811
- });
2812
- var init_input_file = __esm({
2813
- "src/ui/forms/input-file.tsx"() {
2814
- "use client";
2815
- }
2816
- });
2817
- var init_input_group = __esm({
2818
- "src/ui/forms/input-group.tsx"() {
2819
- "use client";
2820
- }
2821
- });
2822
- var init_input_otp = __esm({
2823
- "src/ui/forms/input-otp.tsx"() {
2824
- "use client";
2825
- }
2826
- });
2827
- var init_input_phone = __esm({
2828
- "src/ui/forms/input-phone.tsx"() {
2829
- "use client";
2830
- }
2831
- });
2832
- var init_input_spin = __esm({
2833
- "src/ui/forms/input-spin.tsx"() {
2834
- "use client";
2835
- }
2836
- });
2837
- var init_input_tags = __esm({
2838
- "src/ui/forms/input-tags.tsx"() {
2839
- "use client";
2840
- }
2841
- });
2842
- var init_multiple_date_picker = __esm({
2843
- "src/ui/forms/multiple-date-picker.tsx"() {
2844
- "use client";
2845
- }
2846
- });
2847
- var init_time_picker = __esm({
2848
- "src/ui/forms/time-picker.tsx"() {
2849
- "use client";
2850
- }
2851
- });
2852
- var init_editor = __esm({
2853
- "src/ui/forms/editor/index.tsx"() {
2854
- "use client";
2855
- }
2856
- });
2857
- function FormField(props) {
2858
- return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
2859
- }
2860
- function useFormField() {
2861
- const fieldContext = React12.useContext(FormFieldContext);
2862
- const itemContext = React12.useContext(FormItemContext);
2863
- const { getFieldState, formState } = reactHookForm.useFormContext();
2864
- const fieldState = getFieldState(fieldContext.name, formState);
2865
- if (!fieldContext) {
2866
- throw new Error("useFormField should be used within <FormField>");
2867
- }
2868
- const { id } = itemContext;
2869
- return {
2870
- id,
2871
- name: fieldContext.name,
2872
- formItemId: `${id}-form-item`,
2873
- formDescriptionId: `${id}-form-item-description`,
2874
- formMessageId: `${id}-form-item-message`,
2875
- ...fieldState
2876
- };
2877
- }
2878
- function FormItem({ className, ...props }) {
2879
- const id = React12.useId();
2880
- return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
2881
- "div",
2882
- {
2883
- "data-slot": "form-item",
2884
- className: cn("grid gap-2", className),
2885
- ...props
2886
- }
2887
- ) });
2888
- }
2889
- function FormLabel({
2890
- className,
2891
- ...props
2892
- }) {
2893
- const { error, formItemId } = useFormField();
2894
- return /* @__PURE__ */ jsxRuntime.jsx(
2895
- Label3,
2896
- {
2897
- "data-slot": "form-label",
2898
- "data-error": !!error,
2899
- className: cn("data-[error=true]:text-destructive", className),
2900
- htmlFor: formItemId,
2901
- ...props
2902
- }
2903
- );
2904
- }
2905
- function FormControl({ ...props }) {
2906
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
2907
- return /* @__PURE__ */ jsxRuntime.jsx(
2908
- reactSlot.Slot,
2909
- {
2910
- "data-slot": "form-control",
2911
- id: formItemId,
2912
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
2913
- "aria-invalid": !!error,
2914
- ...props
2915
- }
2916
- );
2917
- }
2918
- function FormMessage({
2919
- className,
2920
- children,
2921
- ...props
2922
- }) {
2923
- const { error, formMessageId } = useFormField();
2924
- const body = error ? String(error?.message) : children;
2925
- if (!body) {
2926
- return null;
2927
- }
2928
- return /* @__PURE__ */ jsxRuntime.jsx(
2929
- "p",
2930
- {
2931
- "data-slot": "form-message",
2932
- id: formMessageId,
2933
- className: cn("text-[0.8rem] font-medium text-destructive", className),
2934
- ...props,
2935
- children: body
2936
- }
2937
- );
2938
- }
2939
- var Form, FormFieldContext, FormItemContext;
2940
- var init_forms = __esm({
2941
- "src/ui/forms/index.tsx"() {
2942
- "use client";
2943
- init_utils();
2944
- init_client();
2945
- init_radio_group();
2946
- init_rating();
2947
- init_command();
2948
- init_multi_select();
2949
- init_date_picker();
2950
- init_date_range_picker();
2951
- init_date_time_picker();
2952
- init_emoji_picker();
2953
- init_file_dropzone();
2954
- init_file_thumbnail();
2955
- init_input_file();
2956
- init_input_group();
2957
- init_input_otp();
2958
- init_input_phone();
2959
- init_input_spin();
2960
- init_input_tags();
2961
- init_input_time();
2962
- init_multiple_date_picker();
2963
- init_time_picker();
2964
- init_editor();
2965
- Form = reactHookForm.FormProvider;
2966
- FormFieldContext = React12.createContext(
2967
- {}
2968
- );
2969
- FormItemContext = React12.createContext(
2970
- {}
2971
- );
2972
- }
2973
- });
2974
- var init_formatted_number_input = __esm({
2975
- "src/ui/data-display/formatted-number-input.tsx"() {
2976
- "use client";
2977
- }
2978
- });
2979
- var init_data_table_pagination = __esm({
2980
- "src/ui/data-display/data-table-pagination.tsx"() {
2981
- "use client";
2982
- }
2983
- });
2984
- var init_kpi_card = __esm({
2985
- "src/ui/data-display/kpi-card.tsx"() {
2986
- "use client";
2987
- }
2988
- });
2989
- var THEME_STYLES;
2990
- var init_compact_stat_bar = __esm({
2991
- "src/ui/data-display/compact-stat-bar.tsx"() {
2992
- init_utils();
2993
- THEME_STYLES = {
2994
- dark: {
2995
- wrapper: "hover:bg-[#181d26]/5 dark:hover:bg-slate-100/5",
2996
- box: "bg-[#181d26] group-hover:bg-[#0a2e0e] dark:bg-slate-800 dark:group-hover:bg-slate-700",
2997
- icon: "text-white",
2998
- label: "text-[#181d26] dark:text-slate-300"
2999
- },
3000
- green: {
3001
- wrapper: "hover:bg-[#006400]/10",
3002
- box: "bg-[#006400] group-hover:bg-[#39bf45]",
3003
- icon: "text-white",
3004
- label: "text-[#006400] dark:text-[#39bf45]"
3005
- },
3006
- blue: {
3007
- wrapper: "hover:bg-[#254fad]/10",
3008
- box: "bg-[#254fad] group-hover:bg-[#1d3d8f]",
3009
- icon: "text-white",
3010
- label: "text-[#254fad] dark:text-[#60a5fa]"
3011
- },
3012
- purple: {
3013
- wrapper: "hover:bg-[#7C3AED]/10",
3014
- box: "bg-[#7C3AED] group-hover:bg-[#6D28D9]",
3015
- icon: "text-white",
3016
- label: "text-[#7C3AED] dark:text-[#a78bfa]"
3017
- },
3018
- orange: {
3019
- wrapper: "hover:bg-[#EA580C]/10",
3020
- box: "bg-[#EA580C] group-hover:bg-[#C2410C]",
3021
- icon: "text-white",
3022
- label: "text-[#EA580C] dark:text-[#fb923c]"
3023
- },
3024
- emerald: {
3025
- wrapper: "hover:bg-[#059669]/10",
3026
- box: "bg-[#059669] group-hover:bg-[#047857]",
3027
- icon: "text-white",
3028
- label: "text-[#059669] dark:text-[#34d399]"
3029
- },
3030
- primary: {
3031
- wrapper: "hover:bg-primary/10",
3032
- box: "bg-primary group-hover:bg-primary/90",
3033
- icon: "text-primary-foreground",
3034
- label: "text-primary"
3035
- },
3036
- destructive: {
3037
- wrapper: "hover:bg-destructive/10",
3038
- box: "bg-destructive group-hover:bg-destructive/90",
3039
- icon: "text-destructive-foreground",
3040
- label: "text-destructive"
3041
- },
3042
- muted: {
3043
- wrapper: "hover:bg-muted/50",
3044
- box: "bg-muted group-hover:bg-muted-foreground/20",
3045
- icon: "text-muted-foreground",
3046
- label: "text-muted-foreground"
3047
- },
3048
- rose: {
3049
- wrapper: "hover:bg-[#E11D48]/10",
3050
- box: "bg-[#E11D48] group-hover:bg-[#BE123C]",
3051
- icon: "text-white",
3052
- label: "text-[#E11D48] dark:text-[#fb7185]"
3053
- }
3054
- };
3055
- React12.memo(function CompactStatBar2({
3056
- items,
3057
- className
3058
- }) {
3059
- if (!items || items.length === 0) return null;
3060
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col md:flex-row md:items-stretch gap-2 pb-1", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-stretch overflow-x-auto no-scrollbar flex-1 bg-white dark:bg-[#1e293b] border border-slate-200 dark:border-slate-800 shadow-sm rounded-[10px] divide-x divide-slate-100 dark:divide-slate-800", children: items.map((item) => {
3061
- const theme = THEME_STYLES[item.colorTheme || "dark"];
3062
- const Icon2 = item.icon;
3063
- return /* @__PURE__ */ jsxRuntime.jsxs(
3064
- "div",
3065
- {
3066
- className: cn(
3067
- "flex items-center gap-3 min-w-fit px-5 py-2 flex-1 transition-colors group cursor-default",
3068
- theme.wrapper
3069
- ),
3070
- children: [
3071
- /* @__PURE__ */ jsxRuntime.jsx(
3072
- "div",
3073
- {
3074
- className: cn(
3075
- "p-1.5 rounded-md transition-colors shadow-sm shrink-0",
3076
- theme.box
3077
- ),
3078
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: cn("w-3.5 h-3.5", theme.icon), strokeWidth: 2.5 })
3079
- }
3080
- ),
3081
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
3082
- /* @__PURE__ */ jsxRuntime.jsx(
3083
- "span",
3084
- {
3085
- className: cn(
3086
- "text-[9px] font-bold uppercase tracking-wider mb-0.5",
3087
- item.isHighlighted ? "text-emerald-600 dark:text-emerald-400" : theme.label
3088
- ),
3089
- children: item.label
3090
- }
3091
- ),
3092
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
3093
- "font-black leading-none",
3094
- item.isHighlighted ? "text-[22px] text-emerald-700 dark:text-emerald-400" : "text-[17px] text-slate-900 dark:text-white"
3095
- ), children: item.value })
3096
- ] })
3097
- ]
3098
- },
3099
- item.id
3100
- );
3101
- }) }) });
3102
- });
3103
- }
3104
- });
3105
- var init_show_more_text = __esm({
3106
- "src/ui/data-display/show-more-text.tsx"() {
3107
- "use client";
3108
- }
3109
- });
3110
- var init_chart = __esm({
3111
- "src/ui/data-display/chart.tsx"() {
3112
- "use client";
3113
- React12.createContext(null);
3114
- }
3115
- });
3116
- var init_carousel = __esm({
3117
- "src/ui/data-display/carousel.tsx"() {
3118
- "use client";
3119
- React12.createContext(null);
3120
- }
3121
- });
3122
- var init_accordion = __esm({
3123
- "src/ui/data-display/accordion.tsx"() {
3124
- "use client";
3125
- }
3126
- });
3127
- var init_kanban_item = __esm({
3128
- "src/ui/data-display/kanban/kanban-item.tsx"() {
3129
- }
3130
- });
3131
- var init_kanban_column = __esm({
3132
- "src/ui/data-display/kanban/kanban-column.tsx"() {
3133
- }
3134
- });
3135
- var init_kanban_board = __esm({
3136
- "src/ui/data-display/kanban/kanban-board.tsx"() {
3137
- }
3138
- });
3139
-
3140
- // src/ui/data-display/kanban/kanban-types.ts
3141
- var init_kanban_types = __esm({
3142
- "src/ui/data-display/kanban/kanban-types.ts"() {
3143
- }
3144
- });
3145
-
3146
- // src/ui/data-display/kanban/index.ts
3147
- var init_kanban = __esm({
3148
- "src/ui/data-display/kanban/index.ts"() {
3149
- init_kanban_board();
3150
- init_kanban_column();
3151
- init_kanban_item();
3152
- init_kanban_types();
3153
- }
3154
- });
3155
- var init_aspect_ratio = __esm({
3156
- "src/ui/data-display/aspect-ratio.tsx"() {
3157
- "use client";
3158
- }
3159
- });
3160
- var init_bento_grid = __esm({
3161
- "src/ui/data-display/bento-grid.tsx"() {
3162
- }
3163
- });
3164
- var init_highlight = __esm({
3165
- "src/ui/data-display/highlight.tsx"() {
3166
- }
3167
- });
3168
- var init_code_block_highlight = __esm({
3169
- "src/ui/data-display/code-block-highlight.tsx"() {
3170
- "use client";
3171
- }
3172
- });
3173
- var init_collapsible = __esm({
3174
- "src/ui/data-display/collapsible.tsx"() {
3175
- "use client";
3176
- }
3177
- });
3178
- var init_hover_card = __esm({
3179
- "src/ui/data-display/hover-card.tsx"() {
3180
- "use client";
3181
- }
3182
- });
3183
- var init_iphone_15_pro = __esm({
3184
- "src/ui/data-display/iphone-15-pro.tsx"() {
3185
- }
3186
- });
3187
- var init_media_grid = __esm({
3188
- "src/ui/data-display/media-grid.tsx"() {
3189
- "use client";
3190
- }
3191
- });
3192
- var init_safari = __esm({
3193
- "src/ui/data-display/safari.tsx"() {
3194
- }
3195
- });
3196
- var init_timeline = __esm({
3197
- "src/ui/data-display/timeline.tsx"() {
3198
- classVarianceAuthority.cva("grid", {
3199
- variants: {
3200
- align: {
3201
- left: "[&>li]:grid-cols-[0_min-content_1fr]",
3202
- right: "[&>li]:grid-cols-[1fr_min-content]",
3203
- center: "[&>li]:grid-cols-[1fr_min-content_1fr]"
3204
- }
3205
- },
3206
- defaultVariants: {
3207
- align: "left"
3208
- }
3209
- });
3210
- classVarianceAuthority.cva("grid items-center gap-x-2", {
3211
- variants: {
3212
- status: {
3213
- done: "text-foreground",
3214
- default: "text-muted-foreground"
3215
- }
3216
- },
3217
- defaultVariants: {
3218
- status: "default"
3219
- }
3220
- });
3221
- classVarianceAuthority.cva("row-start-2 row-end-2 pb-8", {
3222
- variants: {
3223
- side: {
3224
- start: "col-start-3 col-end-4 me-auto text-start",
3225
- end: "col-start-1 col-end-2 ms-auto text-end"
3226
- }
3227
- },
3228
- defaultVariants: {
3229
- side: "start"
3230
- }
3231
- });
3232
- classVarianceAuthority.cva(
3233
- "row-start-1 row-end-1 line-clamp-1 max-w-full truncate",
3234
- {
3235
- variants: {
3236
- side: {
3237
- start: "col-start-3 col-end-4 me-auto text-start",
3238
- end: "col-start-1 col-end-2 ms-auto text-end"
3239
- },
3240
- variant: {
3241
- primary: "text-base font-medium text-foreground",
3242
- secondary: "text-sm font-light text-muted-foreground"
3243
- }
3244
- },
3245
- defaultVariants: {
3246
- side: "start",
3247
- variant: "primary"
3248
- }
3249
- }
3250
- );
3251
- }
3252
- });
3253
-
3254
- // src/ui/data-display/data-table/index.ts
3255
- var init_data_table = __esm({
3256
- "src/ui/data-display/data-table/index.ts"() {
3257
- }
3258
- });
3259
-
3260
- // src/ui/data-display/index.tsx
3261
- var init_data_display = __esm({
3262
- "src/ui/data-display/index.tsx"() {
3263
- "use client";
3264
- init_formatted_number_input();
3265
- init_data_table_pagination();
3266
- init_avatar();
3267
- init_kpi_card();
3268
- init_compact_stat_bar();
3269
- init_show_more_text();
3270
- init_chart();
3271
- init_carousel();
3272
- init_accordion();
3273
- init_kanban();
3274
- init_aspect_ratio();
3275
- init_bento_grid();
3276
- init_code_block_highlight();
3277
- init_collapsible();
3278
- init_highlight();
3279
- init_hover_card();
3280
- init_iphone_15_pro();
3281
- init_media_grid();
3282
- init_safari();
3283
- init_timeline();
3284
- init_data_table();
3285
- }
3286
- });
3287
- var init_auth_layout = __esm({
3288
- "src/ui/auth/auth-layout.tsx"() {
3289
- "use client";
3290
- }
3291
- });
3292
- var init_sign_in_form = __esm({
3293
- "src/ui/auth/sign-in-form.tsx"() {
3294
- "use client";
3295
- }
3296
- });
3297
- var init_register_form = __esm({
3298
- "src/ui/auth/register-form.tsx"() {
3299
- "use client";
3300
- }
3301
- });
3302
- var init_oauth_links = __esm({
3303
- "src/ui/auth/oauth-links.tsx"() {
3304
- "use client";
3305
- }
3306
- });
3307
- var init_forgot_password_form = __esm({
3308
- "src/ui/auth/forgot-password-form.tsx"() {
3309
- "use client";
3310
- }
3311
- });
3312
- var init_new_password_form = __esm({
3313
- "src/ui/auth/new-password-form.tsx"() {
3314
- "use client";
3315
- }
3316
- });
3317
- var init_verify_email_form = __esm({
3318
- "src/ui/auth/verify-email-form.tsx"() {
3319
- "use client";
3320
- }
3321
- });
3322
-
3323
- // src/ui/auth/index.tsx
3324
- var init_auth = __esm({
3325
- "src/ui/auth/index.tsx"() {
3326
- init_auth_layout();
3327
- init_sign_in_form();
3328
- init_register_form();
3329
- init_oauth_links();
3330
- init_forgot_password_form();
3331
- init_new_password_form();
3332
- init_verify_email_form();
3333
- }
3334
- });
3335
- var init_job_management = __esm({
3336
- "src/ui/management/job-management.tsx"() {
3337
- "use client";
3338
- }
3339
- });
3340
- var init_audit_log_page = __esm({
3341
- "src/ui/management/audit-log-page.tsx"() {
3342
- "use client";
3343
- }
3344
- });
3345
- var init_cache_management = __esm({
3346
- "src/ui/management/cache-management.tsx"() {
3347
- "use client";
3348
- }
3349
- });
3350
-
3351
- // src/ui/management/index.ts
3352
- var init_management = __esm({
3353
- "src/ui/management/index.ts"() {
3354
- init_job_management();
3355
- init_audit_log_page();
3356
- init_cache_management();
3357
- }
3358
- });
3359
- var init_not_found = __esm({
3360
- "src/ui/pages/not-found.tsx"() {
3361
- }
3362
- });
3363
-
3364
- // src/ui/index.tsx
3365
- var init_ui = __esm({
3366
- "src/ui/index.tsx"() {
3367
- init_primitives();
3368
- init_client();
3369
- init_forms();
3370
- init_data_display();
3371
- init_feedback();
3372
- init_layout();
3373
- init_auth();
3374
- init_management();
3375
- init_not_found();
3376
- }
3377
- });
3378
-
3379
- // src/user/schemas.ts
3380
- init_utils();
3381
- var MAX_AVATAR_SIZE = 5e7;
3382
- var fomratedAvatarSize = formatFileSize(MAX_AVATAR_SIZE);
3383
- var ProfileInfoSchema = zod.z.object({
3384
- firstName: zod.z.string().trim().min(2, { message: "First Name must contain at least 2 characters." }).max(50, { message: "First Name must contain at most 50 characters." }),
3385
- lastName: zod.z.string().trim().min(2, { message: "Last Name must contain at least 2 characters." }).max(50, { message: "Last Name must contain at most 50 characters." }),
3386
- username: zod.z.string().toLowerCase().trim().min(3, { message: "Username must contain at least 3 characters." }).max(50, { message: "Username must contain at most 50 characters." }),
3387
- email: zod.z.string().email({ message: "Invalid email address" }).toLowerCase().trim(),
3388
- phoneNumber: zod.z.string().min(10, { message: "Phone Number must contain at least 10 digits." }).max(15, { message: "Username must contain at most 15 digits." }),
3389
- state: zod.z.string().trim().min(2, { message: "State must contain at least 2 characters." }).max(50, { message: "State must contain at most 50 characters." }),
3390
- country: zod.z.string().trim().min(2, { message: "Country must contain at least 2 characters." }).max(56, { message: "Country must contain at most 56 characters." }),
3391
- address: zod.z.string().trim().min(2, { message: "Address must contain at least 2 characters." }).max(100, { message: "Address must contain at most 100 characters." }),
3392
- zipCode: zod.z.string().min(5, { message: "Zip Code must contain at least 5 digits." }).max(10, { message: "Zip Code must contain at most 10 characters." }),
3393
- language: zod.z.string(),
3394
- timeZone: zod.z.string(),
3395
- currency: zod.z.string(),
3396
- organization: zod.z.string().trim().optional(),
3397
- avatar: zod.z.instanceof(File).refine((avatar) => avatar.size <= MAX_AVATAR_SIZE, {
3398
- message: `Avatar must be ${fomratedAvatarSize} or less.`
3399
- }).optional()
3400
- });
3401
- var DeleteAccountSchema = zod.z.object({});
3402
-
3403
- // src/user/components/dangerous-zone.tsx
3404
- init_ui();
3405
- init_ui();
3406
- function DeleteAccountForm({ user, dictionary }) {
3407
- const t = dictionary?.profile?.dangerZone;
3408
- const form = reactHookForm.useForm({
3409
- resolver: zod$1.zodResolver(DeleteAccountSchema),
3410
- defaultValues: {
3411
- ...user
3412
- }
3413
- });
3414
- const { isSubmitting } = form.formState;
3415
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-x-2", children: [
3416
- /* @__PURE__ */ jsxRuntime.jsx(ButtonLoading, { isLoading: isSubmitting, variant: "outline", children: t?.disableAccount || "Disable Account" }),
3417
- /* @__PURE__ */ jsxRuntime.jsx(ButtonLoading, { isLoading: isSubmitting, variant: "destructive", children: t?.deleteAccount || "Delete Account" })
3418
- ] });
3419
- }
3420
- function DangerousZone({ user, dictionary }) {
3421
- const t = dictionary?.profile?.dangerZone;
3422
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
3423
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { children: [
3424
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: t?.title || "Dangerous Zone" }),
3425
- /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: t?.description || "Manage sensitive settings, such as account deletion or deactivation. Proceed with caution." })
3426
- ] }),
3427
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx(DeleteAccountForm, { user, dictionary }) })
3428
- ] });
3429
- }
3430
-
3431
- // src/user/components/profile-info.tsx
3432
- init_ui();
3433
- init_utils();
3434
- init_ui();
3435
- init_ui();
3436
- init_ui();
3437
- init_ui();
3438
- init_ui();
3439
- function ProfileInfoForm({ user, dictionary }) {
3440
- const t = dictionary?.profile;
3441
- const fields = t?.fields;
3442
- const placeholders = t?.placeholders;
3443
- const buttons = t?.buttons;
3444
- const [photoPreview, setPhotoPreview] = React12.useState(
3445
- user?.avatar
3446
- );
3447
- const form = reactHookForm.useForm({
3448
- resolver: zod$1.zodResolver(ProfileInfoSchema),
3449
- values: {
3450
- ...user,
3451
- avatar: void 0
3452
- }
3453
- });
3454
- const { isSubmitting, isDirty } = form.formState;
3455
- const isDisabled = isSubmitting || !isDirty;
3456
- async function onSubmit(_data) {
3457
- }
3458
- function handleResetForm() {
3459
- form.reset();
3460
- setPhotoPreview(user?.avatar);
3461
- }
3462
- function handleUploadPhoto(e) {
3463
- const file = e.target.files?.[0];
3464
- if (file) {
3465
- const imageUrl = URL.createObjectURL(file);
3466
- setPhotoPreview(imageUrl);
3467
- form.setValue("avatar", file);
3468
- form.trigger("avatar");
3469
- }
3470
- }
3471
- function handleRemovePhoto() {
3472
- form.resetField("avatar");
3473
- setPhotoPreview(void 0);
3474
- }
3475
- return /* @__PURE__ */ jsxRuntime.jsx(Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "grid gap-y-3", children: [
3476
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-4", children: [
3477
- /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { className: "size-22", children: [
3478
- /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: photoPreview, alt: "Profile Avatar" }),
3479
- /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: getInitials(user.name) })
3480
- ] }),
3481
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
3482
- /* @__PURE__ */ jsxRuntime.jsx(
3483
- FormField,
3484
- {
3485
- control: form.control,
3486
- name: "avatar",
3487
- render: () => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3488
- /* @__PURE__ */ jsxRuntime.jsx(
3489
- FormLabel,
3490
- {
3491
- className: cn(
3492
- buttonVariants({ variant: "default" }),
3493
- "cursor-pointer w-full"
3494
- ),
3495
- children: buttons?.uploadPhoto || "Upload Photo"
3496
- }
3497
- ),
3498
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
3499
- Input,
3500
- {
3501
- type: "file",
3502
- accept: "image/*",
3503
- className: "hidden",
3504
- onChange: handleUploadPhoto
3505
- }
3506
- ) }),
3507
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3508
- ] })
3509
- }
3510
- ),
3511
- /* @__PURE__ */ jsxRuntime.jsx(
3512
- Button,
3513
- {
3514
- type: "button",
3515
- variant: "destructive",
3516
- onClick: handleRemovePhoto,
3517
- children: buttons?.removePhoto || "Remove Photo"
3518
- }
3519
- )
3520
- ] })
3521
- ] }),
3522
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2 md:grid-cols-2", children: [
3523
- /* @__PURE__ */ jsxRuntime.jsx(
3524
- FormField,
3525
- {
3526
- control: form.control,
3527
- name: "firstName",
3528
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: "grow", children: [
3529
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.firstName || "First Name" }),
3530
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.firstName || "John", ...field }) }),
3531
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3532
- ] })
3533
- }
3534
- ),
3535
- /* @__PURE__ */ jsxRuntime.jsx(
3536
- FormField,
3537
- {
3538
- control: form.control,
3539
- name: "lastName",
3540
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: "grow", children: [
3541
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.lastName || "Last Name" }),
3542
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.lastName || "Doe", ...field }) }),
3543
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3544
- ] })
3545
- }
3546
- ),
3547
- /* @__PURE__ */ jsxRuntime.jsx(
3548
- FormField,
3549
- {
3550
- control: form.control,
3551
- name: "username",
3552
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3553
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.username || "Username" }),
3554
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.username || "john_doe", ...field }) }),
3555
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3556
- ] })
3557
- }
3558
- ),
3559
- /* @__PURE__ */ jsxRuntime.jsx(
3560
- FormField,
3561
- {
3562
- control: form.control,
3563
- name: "email",
3564
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3565
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.email || "Email" }),
3566
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
3567
- Input,
3568
- {
3569
- type: "email",
3570
- placeholder: placeholders?.email || "name@example.com",
3571
- ...field
3572
- }
3573
- ) }),
3574
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3575
- ] })
3576
- }
3577
- ),
3578
- /* @__PURE__ */ jsxRuntime.jsx(
3579
- FormField,
3580
- {
3581
- control: form.control,
3582
- name: "state",
3583
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3584
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.state || "State" }),
3585
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { onValueChange: field.onChange, value: field.value, children: [
3586
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholders?.selectState || "Select a state" }) }) }),
3587
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: [
3588
- "Alabama",
3589
- "Alaska",
3590
- "Arizona",
3591
- "Arkansas",
3592
- "California",
3593
- "Colorado",
3594
- "Connecticut",
3595
- "Delaware",
3596
- "Florida",
3597
- "Georgia",
3598
- "Hawaii",
3599
- "Idaho",
3600
- "Illinois",
3601
- "Indiana",
3602
- "Iowa",
3603
- "Kansas",
3604
- "Kentucky",
3605
- "Louisiana",
3606
- "Maine",
3607
- "Maryland",
3608
- "Massachusetts",
3609
- "Michigan",
3610
- "Minnesota",
3611
- "Mississippi",
3612
- "Missouri",
3613
- "Montana",
3614
- "Nebraska",
3615
- "Nevada",
3616
- "New Hampshire",
3617
- "New Jersey",
3618
- "New Mexico",
3619
- "New York",
3620
- "North Carolina",
3621
- "North Dakota",
3622
- "Ohio",
3623
- "Oklahoma",
3624
- "Oregon",
3625
- "Pennsylvania",
3626
- "Rhode Island",
3627
- "South Carolina",
3628
- "South Dakota",
3629
- "Tennessee",
3630
- "Texas",
3631
- "Utah",
3632
- "Vermont",
3633
- "Virginia",
3634
- "Washington",
3635
- "West Virginia",
3636
- "Wisconsin",
3637
- "Wyoming"
3638
- ].map((state) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: state, children: state }, state)) })
3639
- ] }),
3640
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3641
- ] })
3642
- }
3643
- ),
3644
- /* @__PURE__ */ jsxRuntime.jsx(
3645
- FormField,
3646
- {
3647
- control: form.control,
3648
- name: "country",
3649
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3650
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.country || "Country" }),
3651
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { onValueChange: field.onChange, value: field.value, children: [
3652
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholders?.selectCountry || "Select a country" }) }) }),
3653
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: [
3654
- "United States",
3655
- "Canada",
3656
- "United Kingdom",
3657
- "Australia",
3658
- "Germany",
3659
- "France",
3660
- "Japan",
3661
- "China",
3662
- "India",
3663
- "Brazil"
3664
- ].map((country) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: country, children: country }, country)) })
3665
- ] }),
3666
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3667
- ] })
3668
- }
3669
- ),
3670
- /* @__PURE__ */ jsxRuntime.jsx(
3671
- FormField,
3672
- {
3673
- control: form.control,
3674
- name: "address",
3675
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3676
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.address || "Address" }),
3677
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.address || "123 Main St", ...field }) }),
3678
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3679
- ] })
3680
- }
3681
- ),
3682
- /* @__PURE__ */ jsxRuntime.jsx(
3683
- FormField,
3684
- {
3685
- control: form.control,
3686
- name: "zipCode",
3687
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3688
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.zipCode || "Zip Code" }),
3689
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.zipCode || "90210", ...field }) }),
3690
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3691
- ] })
3692
- }
3693
- ),
3694
- /* @__PURE__ */ jsxRuntime.jsx(
3695
- FormField,
3696
- {
3697
- control: form.control,
3698
- name: "language",
3699
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3700
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.language || "Preferred Language" }),
3701
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { onValueChange: field.onChange, value: field.value, children: [
3702
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholders?.selectLanguage || "Select a language" }) }) }),
3703
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: [
3704
- "English",
3705
- "Spanish",
3706
- "French",
3707
- "German",
3708
- "Chinese",
3709
- "Japanese",
3710
- "Arabic",
3711
- "Portuguese",
3712
- "Russian",
3713
- "Hindi"
3714
- ].map((language) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: language, children: language }, language)) })
3715
- ] }),
3716
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3717
- ] })
3718
- }
3719
- ),
3720
- /* @__PURE__ */ jsxRuntime.jsx(
3721
- FormField,
3722
- {
3723
- control: form.control,
3724
- name: "timeZone",
3725
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3726
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.timeZone || "Time Zone" }),
3727
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { onValueChange: field.onChange, value: field.value, children: [
3728
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholders?.selectTimeZone || "Select a time zone" }) }) }),
3729
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: [
3730
- "GMT-12:00",
3731
- "GMT-11:00",
3732
- "GMT-10:00",
3733
- "GMT-09:00",
3734
- "GMT-08:00",
3735
- "GMT-07:00",
3736
- "GMT-06:00",
3737
- "GMT-05:00",
3738
- "GMT-04:00",
3739
- "GMT-03:00",
3740
- "GMT-02:00",
3741
- "GMT-01:00",
3742
- "GMT+00:00",
3743
- "GMT+01:00",
3744
- "GMT+02:00",
3745
- "GMT+03:00",
3746
- "GMT+04:00",
3747
- "GMT+05:00",
3748
- "GMT+06:00",
3749
- "GMT+07:00",
3750
- "GMT+08:00",
3751
- "GMT+09:00",
3752
- "GMT+10:00",
3753
- "GMT+11:00",
3754
- "GMT+12:00"
3755
- ].map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: timezone, children: timezone }, timezone)) })
3756
- ] }),
3757
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3758
- ] })
3759
- }
3760
- ),
3761
- /* @__PURE__ */ jsxRuntime.jsx(
3762
- FormField,
3763
- {
3764
- control: form.control,
3765
- name: "currency",
3766
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3767
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.currency || "Currency" }),
3768
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { onValueChange: field.onChange, value: field.value, children: [
3769
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholders?.selectCurrency || "Select a currency" }) }) }),
3770
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: [
3771
- "USD",
3772
- "EUR",
3773
- "GBP",
3774
- "JPY",
3775
- "CAD",
3776
- "AUD",
3777
- "CHF",
3778
- "CNY",
3779
- "INR",
3780
- "BRL"
3781
- ].map((currency) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: currency, children: currency }, currency)) })
3782
- ] }),
3783
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3784
- ] })
3785
- }
3786
- ),
3787
- /* @__PURE__ */ jsxRuntime.jsx(
3788
- FormField,
3789
- {
3790
- control: form.control,
3791
- name: "organization",
3792
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { children: [
3793
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: fields?.organization || "Organization (Optional)" }),
3794
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "text", placeholder: placeholders?.organization || "Company Name", ...field }) }),
3795
- /* @__PURE__ */ jsxRuntime.jsx(FormMessage, {})
3796
- ] })
3797
- }
3798
- )
3799
- ] }),
3800
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-x-2 mt-2", children: [
3801
- /* @__PURE__ */ jsxRuntime.jsx(
3802
- ButtonLoading,
3803
- {
3804
- isLoading: isSubmitting,
3805
- className: "w-fit",
3806
- disabled: isDisabled,
3807
- children: buttons?.save || "Save"
3808
- }
3809
- ),
3810
- /* @__PURE__ */ jsxRuntime.jsx(
3811
- Button,
3812
- {
3813
- type: "reset",
3814
- variant: "secondary",
3815
- className: "w-fit",
3816
- disabled: isDisabled,
3817
- onClick: handleResetForm,
3818
- children: buttons?.reset || "Reset"
3819
- }
3820
- )
3821
- ] })
3822
- ] }) });
3823
- }
3824
- function ProfileInfo({ user, dictionary }) {
3825
- const t = dictionary?.profile;
3826
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
3827
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { children: [
3828
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: t?.title || "Profile Information" }),
3829
- /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: t?.description || "Update your public profile details." })
3830
- ] }),
3831
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ProfileInfoForm, { user, dictionary }) })
3832
- ] });
3833
- }
3834
- function ProfilePage({ user, dictionary }) {
3835
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4", children: [
3836
- /* @__PURE__ */ jsxRuntime.jsx(ProfileInfo, { user, dictionary }),
3837
- /* @__PURE__ */ jsxRuntime.jsx(DangerousZone, { user, dictionary })
3838
- ] });
3839
- }
3840
-
3841
- // src/user/user-service.ts
3842
- async function getUsersData(db, params) {
3843
- const { page = 1, pageSize = 10, search, status } = params;
3844
- const skip = (page - 1) * pageSize;
3845
- const whereConditions = [];
3846
- if (search) {
3847
- whereConditions.push({
3848
- OR: [
3849
- { name: { contains: search, mode: "insensitive" } },
3850
- { email: { contains: search, mode: "insensitive" } }
3851
- ]
3852
- });
3853
- }
3854
- if (status !== void 0 && status !== "") {
3855
- whereConditions.push({ isActive: status === "active" });
3856
- }
3857
- if (params.roleCode) {
3858
- whereConditions.push({
3859
- userRoles: {
3860
- some: {
3861
- role: {
3862
- code: params.roleCode
3863
- }
3864
- }
3865
- }
3866
- });
3867
- }
3868
- const where = whereConditions.length > 0 ? { AND: whereConditions } : {};
3869
- const [users, total] = await Promise.all([
3870
- db.user.findMany({
3871
- where,
3872
- skip,
3873
- take: pageSize,
3874
- orderBy: { createdAt: "desc" },
3875
- select: {
3876
- id: true,
3877
- name: true,
3878
- email: true,
3879
- image: true,
3880
- isActive: true,
3881
- lastLoginAt: true,
3882
- createdAt: true,
3883
- updatedAt: true,
3884
- userType: true,
3885
- // Added userType
3886
- userRoles: {
3887
- select: {
3888
- role: {
3889
- select: {
3890
- code: true,
3891
- name: true
3892
- }
3893
- }
3894
- }
3895
- },
3896
- userBranches: {
3897
- select: {
3898
- branch: {
3899
- select: {
3900
- id: true,
3901
- name: true
3902
- }
3903
- },
3904
- isDefault: true
3905
- }
3906
- },
3907
- // Removed invalid userSuppliers selection
3908
- profiles: {
3909
- select: {
3910
- department: true,
3911
- departmentRef: {
3912
- select: {
3913
- id: true,
3914
- name: true
3915
- }
3916
- },
3917
- jobTitleId: true,
3918
- jobTitleRef: {
3919
- select: {
3920
- id: true,
3921
- name: true
3922
- }
3923
- },
3924
- address: true,
3925
- // Added address
3926
- phone: true,
3927
- // Added phone
3928
- gender: true,
3929
- dateOfBirth: true,
3930
- groupId: true,
3931
- idNumber: true,
3932
- supplierId: true,
3933
- // Select supplierId from profiles
3934
- supplier: {
3935
- // Select supplier details from profiles
3936
- select: {
3937
- name: true
3938
- }
3939
- }
3940
- }
3941
- }
3942
- }
3943
- }),
3944
- db.user.count({ where })
3945
- ]);
3946
- const data = users.map((user) => ({
3947
- id: user.id,
3948
- name: user.name,
3949
- email: user.email,
3950
- image: user.image,
3951
- status: user.isActive ? "active" : "inactive",
3952
- userType: user.userType || "employee",
3953
- supplierId: user.profiles?.supplierId || "",
3954
- supplierName: user.profiles?.supplier?.name || "",
3955
- address: user.profiles?.address || "",
3956
- // Added address
3957
- phone: user.profiles?.phone || "",
3958
- // Added phone
3959
- gender: user.profiles?.gender || "",
3960
- birthday: user.profiles?.dateOfBirth || null,
3961
- groupId: user.profiles?.groupId || "",
3962
- idNumber: user.profiles?.idNumber || "",
3963
- lastLoginAt: user.lastLoginAt,
3964
- createdAt: user.createdAt,
3965
- updatedAt: user.updatedAt,
3966
- departmentId: user.profiles?.departmentRef?.id || null,
3967
- departmentName: user.profiles?.departmentRef?.name || null,
3968
- jobTitleId: user.profiles?.jobTitleRef?.id || null,
3969
- jobTitleName: user.profiles?.jobTitleRef?.name || null,
3970
- roleNames: user.userRoles?.map((ur) => ur.role.name) || [],
3971
- roleCodes: user.userRoles?.map((ur) => ur.role.code) || [],
3972
- branches: user.userBranches?.map((ub) => ({
3973
- id: ub.branch?.id,
3974
- name: ub.branch?.name,
3975
- isDefault: ub.isDefault
3976
- })).filter((b) => b.id) || [],
3977
- branchIds: user.userBranches?.map((ub) => ub.branch?.id).filter(Boolean) || [],
3978
- branchNames: user.userBranches?.map((ub) => ub.branch?.name).filter(Boolean) || []
3979
- }));
3980
- return {
3981
- data,
3982
- total,
3983
- page,
3984
- pageSize
3985
- };
3986
- }
3987
- async function getUsersWithDetails(db, params) {
3988
- const {
3989
- page = 1,
3990
- pageSize = 10,
3991
- search,
3992
- status,
3993
- roleCode,
3994
- departmentId
3995
- } = params;
3996
- const skip = (page - 1) * pageSize;
3997
- const whereConditions = [];
3998
- if (search) {
3999
- whereConditions.push({
4000
- OR: [
4001
- { name: { contains: search, mode: "insensitive" } },
4002
- { email: { contains: search, mode: "insensitive" } }
4003
- ]
4004
- });
4005
- }
4006
- if (status !== void 0 && status !== "") {
4007
- whereConditions.push({ isActive: status === "active" });
4008
- }
4009
- if (roleCode) {
4010
- whereConditions.push({
4011
- userRoles: {
4012
- some: { roleCode }
4013
- }
4014
- });
4015
- }
4016
- if (departmentId) {
4017
- whereConditions.push({
4018
- profiles: {
4019
- is: {
4020
- departmentId
4021
- }
4022
- }
4023
- });
4024
- }
4025
- const where = whereConditions.length > 0 ? { AND: whereConditions } : {};
4026
- const [users, total, activeCount, rolesCount, customers, suppliers] = await Promise.all([
4027
- db.user.findMany({
4028
- where,
4029
- skip,
4030
- take: pageSize,
4031
- orderBy: { createdAt: "desc" },
4032
- select: {
4033
- id: true,
4034
- name: true,
4035
- email: true,
4036
- image: true,
4037
- isActive: true,
4038
- createdAt: true,
4039
- updatedAt: true,
4040
- userRoles: {
4041
- select: {
4042
- role: {
4043
- select: {
4044
- code: true,
4045
- name: true
4046
- }
4047
- }
4048
- }
4049
- },
4050
- userBranches: {
4051
- select: {
4052
- branch: {
4053
- select: {
4054
- id: true,
4055
- name: true
4056
- }
4057
- },
4058
- isDefault: true
4059
- }
4060
- },
4061
- profiles: {
4062
- select: {
4063
- departmentRef: {
4064
- select: {
4065
- id: true,
4066
- name: true,
4067
- code: true
4068
- }
4069
- },
4070
- jobTitleRef: {
4071
- select: {
4072
- id: true,
4073
- name: true,
4074
- code: true,
4075
- level: true
4076
- }
4077
- },
4078
- address: true,
4079
- // Added address
4080
- phone: true,
4081
- // Added phone
4082
- gender: true,
4083
- dateOfBirth: true,
4084
- groupId: true,
4085
- idNumber: true,
4086
- supplierId: true,
4087
- // Added supplierId
4088
- supplier: {
4089
- // Added supplier
4090
- select: {
4091
- name: true
4092
- }
4093
- }
4094
- }
4095
- }
4096
- }
4097
- }),
4098
- db.user.count({ where }),
4099
- db.user.count({ where: { ...where, isActive: true } }),
4100
- db.role.count({ where: { status: "active" } }),
4101
- db.user.count({ where: { userType: "customer" } }).catch(() => 0),
4102
- db.user.count({ where: { userType: "supplier" } }).catch(() => 0)
4103
- ]);
4104
- const totalUsersCount = await db.user.count();
4105
- const totalActiveCount = await db.user.count({ where: { isActive: true } });
4106
- const employees = Math.max(0, totalUsersCount - customers - suppliers);
4107
- const data = users.map((user) => ({
4108
- id: user.id,
4109
- name: user.name,
4110
- email: user.email,
4111
- image: user.image,
4112
- isActive: user.isActive,
4113
- userType: user.userType || "employee",
4114
- // Added userType
4115
- supplierId: user.profiles?.supplierId || "",
4116
- // Added supplierId
4117
- address: user.profiles?.address || "",
4118
- // Added address
4119
- phone: user.profiles?.phone || "",
4120
- // Added phone
4121
- gender: user.profiles?.gender || "",
4122
- birthday: user.profiles?.dateOfBirth || null,
4123
- groupId: user.profiles?.groupId || "",
4124
- idNumber: user.profiles?.idNumber || "",
4125
- createdAt: user.createdAt,
4126
- updatedAt: user.updatedAt,
4127
- roles: user.userRoles.map((ur) => ({
4128
- code: ur.role.code,
4129
- name: ur.role.name
4130
- })),
4131
- branches: user.userBranches?.map((ub) => ({
4132
- id: ub.branch?.id,
4133
- name: ub.branch?.name,
4134
- isDefault: ub.isDefault
4135
- })).filter((b) => b.id) || [],
4136
- branchIds: user.userBranches?.map((ub) => ub.branch?.id).filter(Boolean) || [],
4137
- branchNames: user.userBranches?.map((ub) => ub.branch?.name).filter(Boolean) || [],
4138
- department: user.profiles?.departmentRef || null,
4139
- jobTitle: user.profiles?.jobTitleRef || null
4140
- }));
4141
- return {
4142
- data,
4143
- total,
4144
- page,
4145
- pageSize,
4146
- stats: {
4147
- totalUsers: totalUsersCount,
4148
- activeUsers: totalActiveCount,
4149
- inactiveUsers: totalUsersCount - totalActiveCount,
4150
- totalRoles: rolesCount,
4151
- employees,
4152
- customers,
4153
- suppliers
4154
- }
4155
- };
4156
- }
4157
- async function getActiveRoles(db) {
4158
- const roles = await db.role.findMany({
4159
- where: { status: "active" },
4160
- select: {
4161
- code: true,
4162
- name: true,
4163
- status: true
4164
- },
4165
- orderBy: { name: "asc" }
4166
- });
4167
- return roles;
4168
- }
4169
- async function getActiveDepartments(db) {
4170
- const departments = await db.department.findMany({
4171
- where: { status: "active" },
4172
- select: {
4173
- id: true,
4174
- code: true,
4175
- name: true
4176
- },
4177
- orderBy: { order: "asc" }
4178
- });
4179
- return departments;
4180
- }
4181
- async function getUserStats(db) {
4182
- const [totalUsers, activeUsers, customers, suppliers, totalRoles] = await Promise.all([
4183
- db.user.count(),
4184
- db.user.count({ where: { isActive: true } }),
4185
- db.user.count({ where: { userType: "customer" } }).catch(() => 0),
4186
- db.user.count({ where: { userType: "supplier" } }).catch(() => 0),
4187
- db.role.count({ where: { status: "active" } })
4188
- ]);
4189
- const employees = Math.max(0, totalUsers - customers - suppliers);
4190
- return {
4191
- totalUsers,
4192
- activeUsers,
4193
- inactiveUsers: totalUsers - activeUsers,
4194
- totalRoles,
4195
- employees,
4196
- customers,
4197
- suppliers
4198
- };
4199
- }
4200
- async function getUserProfile(db, userId) {
4201
- const user = await db.user.findUnique({
4202
- where: { id: userId },
4203
- select: {
4204
- id: true,
4205
- name: true,
4206
- email: true,
4207
- image: true,
4208
- isActive: true,
4209
- createdAt: true,
4210
- updatedAt: true,
4211
- userType: true,
4212
- // Added userType
4213
- userRoles: {
4214
- select: {
4215
- role: {
4216
- select: {
4217
- code: true,
4218
- name: true
4219
- }
4220
- }
4221
- }
4222
- },
4223
- // Removed invalid userSuppliers selection
4224
- profiles: {
4225
- select: {
4226
- departmentRef: {
4227
- select: {
4228
- id: true,
4229
- name: true,
4230
- code: true
4231
- }
4232
- },
4233
- jobTitleRef: {
4234
- select: {
4235
- id: true,
4236
- name: true,
4237
- code: true
4238
- }
4239
- },
4240
- address: true,
4241
- // Added address
4242
- phone: true,
4243
- // Added phone
4244
- gender: true,
4245
- dateOfBirth: true,
4246
- groupId: true,
4247
- idNumber: true,
4248
- supplierId: true,
4249
- // Select supplierId from profiles
4250
- supplier: {
4251
- select: {
4252
- name: true
4253
- }
4254
- }
4255
- }
4256
- }
4257
- }
4258
- });
4259
- if (!user) return null;
4260
- const nameParts = (user.name || "").split(" ");
4261
- const lastName = nameParts.pop() || "";
4262
- const firstName = nameParts.join(" ");
4263
- return {
4264
- id: user.id,
4265
- firstName,
4266
- lastName,
4267
- name: user.name || "",
4268
- username: user.email?.split("@")[0] || "",
4269
- email: user.email || "",
4270
- avatar: user.image || "",
4271
- role: user.userRoles?.[0]?.role?.name || "User",
4272
- background: "",
4273
- status: user.isActive ? "active" : "inactive",
4274
- phoneNumber: user.profiles?.phone || "",
4275
- state: "",
4276
- country: "",
4277
- address: user.profiles?.address || "",
4278
- zipCode: "",
4279
- language: "English",
4280
- timeZone: "GMT+07:00",
4281
- currency: "USD",
4282
- organization: "",
4283
- twoFactorAuth: false,
4284
- loginAlerts: false,
4285
- connections: 0,
4286
- followers: 0
4287
- };
4288
- }
4289
-
4290
- exports.DangerousZone = DangerousZone;
4291
- exports.DeleteAccountForm = DeleteAccountForm;
4292
- exports.DeleteAccountSchema = DeleteAccountSchema;
4293
- exports.MAX_AVATAR_SIZE = MAX_AVATAR_SIZE;
4294
- exports.ProfileInfo = ProfileInfo;
4295
- exports.ProfileInfoForm = ProfileInfoForm;
4296
- exports.ProfileInfoSchema = ProfileInfoSchema;
4297
- exports.ProfilePage = ProfilePage;
4298
- exports.fomratedAvatarSize = fomratedAvatarSize;
4299
- exports.getActiveDepartments = getActiveDepartments;
4300
- exports.getActiveRoles = getActiveRoles;
4301
- exports.getUserProfile = getUserProfile;
4302
- exports.getUserStats = getUserStats;
4303
- exports.getUsersData = getUsersData;
4304
- exports.getUsersWithDetails = getUsersWithDetails;
4305
- //# sourceMappingURL=index.js.map
4306
- //# sourceMappingURL=index.js.map