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