@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,2526 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
3
- import * as React11 from 'react';
4
- import { useContext, useState, useEffect, useCallback, createContext } 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 { ChevronRight, Check, Dot, AlertTriangle, ChevronDown, Copy, ClipboardCopy, X, PanelLeft } 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 'next/link';
14
- import 'react-use';
15
- import '@radix-ui/react-direction';
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 * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
30
- import { Drawer as Drawer$1 } from 'vaul';
31
- import * as ProgressPrimitive from '@radix-ui/react-progress';
32
- import { Toaster as Toaster$1 } from 'sonner';
33
- import 'next/navigation';
34
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
35
-
36
- var __getOwnPropNames = Object.getOwnPropertyNames;
37
- var __esm = (fn, res) => function __init() {
38
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
39
- };
40
- function cn(...inputs) {
41
- return twMerge(clsx(inputs));
42
- }
43
- var Logger;
44
- var init_utils = __esm({
45
- "src/utils/index.ts"() {
46
- Logger = class {
47
- log(level, message, context, error) {
48
- const entry = {
49
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
50
- level,
51
- message,
52
- context
53
- };
54
- if (error instanceof Error) {
55
- entry.error = {
56
- name: error.name,
57
- message: error.message,
58
- stack: error.stack
59
- };
60
- } else if (error) {
61
- entry.error = error;
62
- }
63
- const logString = JSON.stringify(entry);
64
- switch (level) {
65
- case "error":
66
- console.error(logString);
67
- break;
68
- case "warn":
69
- console.warn(logString);
70
- break;
71
- case "debug":
72
- if (process.env.NODE_ENV === "development") console.debug(logString);
73
- break;
74
- default:
75
- console.log(logString);
76
- }
77
- }
78
- info(message, context) {
79
- this.log("info", message, context);
80
- }
81
- warn(message, context) {
82
- this.log("warn", message, context);
83
- }
84
- error(message, error, context) {
85
- this.log("error", message, context, error);
86
- }
87
- debug(message, context) {
88
- this.log("debug", message, context);
89
- }
90
- };
91
- new Logger();
92
- }
93
- });
94
- var buttonVariants, Button;
95
- var init_button = __esm({
96
- "src/ui/primitives/button.tsx"() {
97
- init_utils();
98
- buttonVariants = cva(
99
- "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",
100
- {
101
- variants: {
102
- variant: {
103
- // Existing variants (backwards-compatible)
104
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
105
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
106
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
107
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
108
- ghost: "hover:bg-accent hover:text-accent-foreground",
109
- link: "text-primary underline-offset-4 hover:underline",
110
- // New Plane-inspired variants using semantic tokens
111
- 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",
112
- danger: "bg-danger text-text-on-color hover:bg-danger-hover active:bg-danger-hover disabled:bg-layer-disabled disabled:text-text-disabled",
113
- "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",
114
- 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",
115
- tertiary: "bg-layer-3 text-text-secondary hover:bg-layer-3-hover active:bg-layer-3-hover disabled:bg-transparent disabled:text-text-disabled"
116
- },
117
- size: {
118
- // Existing sizes (backwards-compatible)
119
- default: "h-10 px-4 py-2",
120
- sm: "h-9 rounded-md px-3",
121
- lg: "h-11 rounded-md px-8",
122
- icon: "h-10 w-10",
123
- // New ERP-specific compact sizes
124
- xs: "h-7 rounded-sm px-2 text-xs",
125
- compact: "h-8 rounded-md px-3 text-xs",
126
- "icon-sm": "h-8 w-8",
127
- "icon-xs": "h-7 w-7"
128
- }
129
- },
130
- defaultVariants: {
131
- variant: "default",
132
- size: "default"
133
- }
134
- }
135
- );
136
- Button = React11.forwardRef(
137
- ({ className, variant, size, asChild = false, loading = false, prependIcon, appendIcon, children, disabled, ...props }, ref) => {
138
- if (asChild) {
139
- return /* @__PURE__ */ jsx(
140
- Slot,
141
- {
142
- className: cn(buttonVariants({ variant, size }), className),
143
- ref,
144
- ...{ disabled: disabled || loading },
145
- ...props,
146
- children: React11.isValidElement(children) && (prependIcon || appendIcon) ? React11.cloneElement(children, {}, /* @__PURE__ */ jsxs(Fragment, { children: [
147
- prependIcon && React11.cloneElement(prependIcon, {
148
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
149
- }),
150
- children.props.children,
151
- appendIcon && React11.cloneElement(appendIcon, {
152
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
153
- })
154
- ] })) : children
155
- }
156
- );
157
- }
158
- return /* @__PURE__ */ jsxs(
159
- "button",
160
- {
161
- className: cn(buttonVariants({ variant, size }), className),
162
- ref,
163
- disabled: disabled || loading,
164
- ...props,
165
- children: [
166
- prependIcon && React11.cloneElement(prependIcon, {
167
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
168
- }),
169
- children,
170
- appendIcon && React11.cloneElement(appendIcon, {
171
- className: cn("shrink-0", size === "xs" || size === "compact" ? "size-3.5" : "size-4")
172
- })
173
- ]
174
- }
175
- );
176
- }
177
- );
178
- Button.displayName = "Button";
179
- }
180
- });
181
- var init_badge = __esm({
182
- "src/ui/primitives/badge.tsx"() {
183
- cva(
184
- "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",
185
- {
186
- variants: {
187
- variant: {
188
- // Existing variants (backwards-compatible)
189
- default: "border-transparent bg-primary text-primary-foreground",
190
- secondary: "border-transparent bg-secondary text-secondary-foreground",
191
- destructive: "border-transparent bg-destructive text-destructive-foreground",
192
- outline: "text-foreground",
193
- // Enhanced semantic variants (using Design Tokens)
194
- success: "border-transparent bg-success-subtle text-success-text",
195
- warning: "border-transparent bg-warning-subtle text-warning-text",
196
- danger: "border-transparent bg-danger-subtle text-danger-text",
197
- info: "border-transparent bg-info-subtle text-info-text",
198
- accent: "border-transparent bg-accent-primary-subtle text-accent-primary"
199
- },
200
- size: {
201
- default: "",
202
- sm: "px-1.5 py-0 text-[10px]",
203
- lg: "px-3 py-1 text-sm"
204
- }
205
- },
206
- defaultVariants: {
207
- variant: "default",
208
- size: "default"
209
- }
210
- }
211
- );
212
- }
213
- });
214
- var Input;
215
- var init_input = __esm({
216
- "src/ui/primitives/input.tsx"() {
217
- init_utils();
218
- Input = React11.forwardRef(
219
- ({ className, type, ...props }, ref) => {
220
- return /* @__PURE__ */ jsx(
221
- "input",
222
- {
223
- type,
224
- className: cn(
225
- "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",
226
- className
227
- ),
228
- ref,
229
- ...props
230
- }
231
- );
232
- }
233
- );
234
- Input.displayName = "Input";
235
- }
236
- });
237
- var Checkbox;
238
- var init_checkbox = __esm({
239
- "src/ui/primitives/checkbox.tsx"() {
240
- "use client";
241
- init_utils();
242
- Checkbox = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
243
- CheckboxPrimitive.Root,
244
- {
245
- ref,
246
- className: cn(
247
- "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",
248
- className
249
- ),
250
- ...props,
251
- children: /* @__PURE__ */ jsx(
252
- CheckboxPrimitive.Indicator,
253
- {
254
- className: cn("flex items-center justify-center text-current"),
255
- children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
256
- }
257
- )
258
- }
259
- ));
260
- Checkbox.displayName = CheckboxPrimitive.Root.displayName;
261
- }
262
- });
263
- var Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter;
264
- var init_card = __esm({
265
- "src/ui/primitives/card.tsx"() {
266
- init_utils();
267
- Card = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
268
- "div",
269
- {
270
- ref,
271
- className: cn(
272
- "rounded-lg border bg-card text-card-foreground shadow-sm",
273
- className
274
- ),
275
- ...props
276
- }
277
- ));
278
- Card.displayName = "Card";
279
- CardHeader = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
280
- "div",
281
- {
282
- ref,
283
- className: cn("flex flex-col space-y-1.5 p-6", className),
284
- ...props
285
- }
286
- ));
287
- CardHeader.displayName = "CardHeader";
288
- CardTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
289
- "h3",
290
- {
291
- ref,
292
- className: cn(
293
- "text-2xl font-semibold leading-none tracking-tight",
294
- className
295
- ),
296
- ...props
297
- }
298
- ));
299
- CardTitle.displayName = "CardTitle";
300
- CardDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
301
- "p",
302
- {
303
- ref,
304
- className: cn("text-sm text-muted-foreground", className),
305
- ...props
306
- }
307
- ));
308
- CardDescription.displayName = "CardDescription";
309
- CardContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
310
- CardContent.displayName = "CardContent";
311
- CardFooter = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
312
- "div",
313
- {
314
- ref,
315
- className: cn("flex items-center p-6 pt-0", className),
316
- ...props
317
- }
318
- ));
319
- CardFooter.displayName = "CardFooter";
320
- }
321
- });
322
- var Separator;
323
- var init_separator = __esm({
324
- "src/ui/primitives/separator.tsx"() {
325
- init_utils();
326
- Separator = React11.forwardRef(
327
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx(
328
- "div",
329
- {
330
- ref,
331
- className: cn(
332
- "shrink-0 bg-border",
333
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
334
- className
335
- ),
336
- ...props
337
- }
338
- )
339
- );
340
- Separator.displayName = "Separator";
341
- }
342
- });
343
- var Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption;
344
- var init_table = __esm({
345
- "src/ui/primitives/table.tsx"() {
346
- init_utils();
347
- Table = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
348
- "table",
349
- {
350
- ref,
351
- className: cn("w-max min-w-full caption-bottom text-xs", className),
352
- ...props
353
- }
354
- ) }));
355
- Table.displayName = "Table";
356
- TableHeader = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
357
- TableHeader.displayName = "TableHeader";
358
- TableBody = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
359
- "tbody",
360
- {
361
- ref,
362
- className: cn("[&_tr:last-child]:border-0", className),
363
- ...props
364
- }
365
- ));
366
- TableBody.displayName = "TableBody";
367
- TableFooter = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
368
- "tfoot",
369
- {
370
- ref,
371
- className: cn(
372
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
373
- className
374
- ),
375
- ...props
376
- }
377
- ));
378
- TableFooter.displayName = "TableFooter";
379
- TableRow = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
380
- "tr",
381
- {
382
- ref,
383
- className: cn(
384
- "border-b transition-colors even:bg-muted/30 data-[state=selected]:bg-muted",
385
- className
386
- ),
387
- ...props
388
- }
389
- ));
390
- TableRow.displayName = "TableRow";
391
- TableHead = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
392
- "th",
393
- {
394
- ref,
395
- className: cn(
396
- "h-9 px-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
397
- className
398
- ),
399
- ...props
400
- }
401
- ));
402
- TableHead.displayName = "TableHead";
403
- TableCell = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
404
- "td",
405
- {
406
- ref,
407
- className: cn("px-3 py-1.5 align-middle [&:has([role=checkbox])]:pr-0 text-xs", className),
408
- ...props
409
- }
410
- ));
411
- TableCell.displayName = "TableCell";
412
- TableCaption = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
413
- "caption",
414
- {
415
- ref,
416
- className: cn("mt-4 text-sm text-muted-foreground", className),
417
- ...props
418
- }
419
- ));
420
- TableCaption.displayName = "TableCaption";
421
- }
422
- });
423
- var init_dropdown_menu = __esm({
424
- "src/ui/primitives/dropdown-menu.tsx"() {
425
- "use client";
426
- }
427
- });
428
- var Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription;
429
- var init_dialog = __esm({
430
- "src/ui/primitives/dialog.tsx"() {
431
- "use client";
432
- init_utils();
433
- Dialog = DialogPrimitive.Root;
434
- DialogTrigger = DialogPrimitive.Trigger;
435
- DialogPortal = DialogPrimitive.Portal;
436
- DialogClose = DialogPrimitive.Close;
437
- DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
438
- DialogPrimitive.Overlay,
439
- {
440
- ref,
441
- className: cn(
442
- "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",
443
- className
444
- ),
445
- ...props
446
- }
447
- ));
448
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
449
- DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
450
- /* @__PURE__ */ jsx(DialogOverlay, {}),
451
- /* @__PURE__ */ jsxs(
452
- DialogPrimitive.Content,
453
- {
454
- ref,
455
- className: cn(
456
- "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",
457
- className
458
- ),
459
- ...props,
460
- children: [
461
- children,
462
- /* @__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: [
463
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
464
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
465
- ] })
466
- ]
467
- }
468
- )
469
- ] }));
470
- DialogContent.displayName = DialogPrimitive.Content.displayName;
471
- DialogHeader = ({
472
- className,
473
- ...props
474
- }) => /* @__PURE__ */ jsx(
475
- "div",
476
- {
477
- className: cn(
478
- "flex flex-col space-y-1.5 text-center sm:text-left",
479
- className
480
- ),
481
- ...props
482
- }
483
- );
484
- DialogHeader.displayName = "DialogHeader";
485
- DialogFooter = ({
486
- className,
487
- ...props
488
- }) => /* @__PURE__ */ jsx(
489
- "div",
490
- {
491
- className: cn(
492
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
493
- className
494
- ),
495
- ...props
496
- }
497
- );
498
- DialogFooter.displayName = "DialogFooter";
499
- DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
500
- DialogPrimitive.Title,
501
- {
502
- ref,
503
- className: cn(
504
- "text-lg font-semibold leading-none tracking-tight",
505
- className
506
- ),
507
- ...props
508
- }
509
- ));
510
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
511
- DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
512
- DialogPrimitive.Description,
513
- {
514
- ref,
515
- className: cn("text-sm text-muted-foreground", className),
516
- ...props
517
- }
518
- ));
519
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
520
- }
521
- });
522
- var TabsList, TabsTrigger, TabsContent;
523
- var init_tabs = __esm({
524
- "src/ui/primitives/tabs.tsx"() {
525
- "use client";
526
- init_utils();
527
- TabsList = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
528
- TabsPrimitive.List,
529
- {
530
- ref,
531
- className: cn(
532
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
533
- className
534
- ),
535
- ...props
536
- }
537
- ));
538
- TabsList.displayName = TabsPrimitive.List.displayName;
539
- TabsTrigger = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
540
- TabsPrimitive.Trigger,
541
- {
542
- ref,
543
- className: cn(
544
- "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",
545
- className
546
- ),
547
- ...props
548
- }
549
- ));
550
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
551
- TabsContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
552
- TabsPrimitive.Content,
553
- {
554
- ref,
555
- className: cn(
556
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
557
- className
558
- ),
559
- ...props
560
- }
561
- ));
562
- TabsContent.displayName = TabsPrimitive.Content.displayName;
563
- }
564
- });
565
- var init_breadcrumb = __esm({
566
- "src/ui/primitives/breadcrumb.tsx"() {
567
- }
568
- });
569
- var init_keyboard = __esm({
570
- "src/ui/primitives/keyboard.tsx"() {
571
- }
572
- });
573
- var init_pagination = __esm({
574
- "src/ui/primitives/pagination.tsx"() {
575
- }
576
- });
577
- var init_status_badge = __esm({
578
- "src/ui/primitives/status-badge.tsx"() {
579
- }
580
- });
581
- var init_tenant_provider = __esm({
582
- "src/providers/tenant-provider.tsx"() {
583
- createContext(void 0);
584
- }
585
- });
586
- var defaultSettings, SettingsContext;
587
- var init_providers = __esm({
588
- "src/providers/index.tsx"() {
589
- "use client";
590
- init_tenant_provider();
591
- defaultSettings = {
592
- theme: "blue",
593
- mode: "system",
594
- radius: 0.5,
595
- layout: "vertical",
596
- locale: "vi",
597
- sidebarVariant: "sidebar",
598
- sidebarCollapsible: "icon",
599
- density: "comfortable"
600
- };
601
- SettingsContext = createContext(void 0);
602
- }
603
- });
604
- var init_calendar = __esm({
605
- "src/ui/primitives/calendar.tsx"() {
606
- "use client";
607
- init_utils();
608
- init_button();
609
- }
610
- });
611
- function ScrollArea({
612
- orientation,
613
- className,
614
- children,
615
- ...props
616
- }) {
617
- return /* @__PURE__ */ jsxs(
618
- ScrollAreaPrimitive.Root,
619
- {
620
- "data-slot": "scroll-area",
621
- className: cn("relative overflow-hidden", className),
622
- ...props,
623
- children: [
624
- /* @__PURE__ */ jsx(
625
- ScrollAreaPrimitive.Viewport,
626
- {
627
- "data-slot": "scroll-area-viewport",
628
- className: "h-full w-full rounded-[inherit]",
629
- children
630
- }
631
- ),
632
- /* @__PURE__ */ jsx(ScrollBar, { orientation }),
633
- /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
634
- ]
635
- }
636
- );
637
- }
638
- function ScrollBar({
639
- className,
640
- orientation = "vertical",
641
- ...props
642
- }) {
643
- return /* @__PURE__ */ jsx(
644
- ScrollAreaPrimitive.ScrollAreaScrollbar,
645
- {
646
- "data-slot": "scroll-area-scrollbar",
647
- orientation,
648
- className: cn(
649
- "flex touch-none select-none transition-colors",
650
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
651
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
652
- className
653
- ),
654
- ...props,
655
- children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
656
- }
657
- );
658
- }
659
- var init_scroll_area = __esm({
660
- "src/ui/primitives/scroll-area.tsx"() {
661
- "use client";
662
- init_utils();
663
- }
664
- });
665
- var init_combobox = __esm({
666
- "src/ui/primitives/combobox.tsx"() {
667
- "use client";
668
- }
669
- });
670
- var init_select = __esm({
671
- "src/ui/primitives/select.tsx"() {
672
- "use client";
673
- }
674
- });
675
- var init_popover = __esm({
676
- "src/ui/primitives/popover.tsx"() {
677
- "use client";
678
- }
679
- });
680
- var init_switch = __esm({
681
- "src/ui/primitives/switch.tsx"() {
682
- "use client";
683
- }
684
- });
685
- var Label3;
686
- var init_label = __esm({
687
- "src/ui/primitives/label.tsx"() {
688
- "use client";
689
- init_utils();
690
- Label3 = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
691
- LabelPrimitive.Root,
692
- {
693
- ref,
694
- className: cn(
695
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
696
- className
697
- ),
698
- ...props
699
- }
700
- ));
701
- Label3.displayName = LabelPrimitive.Root.displayName;
702
- }
703
- });
704
- function TooltipProvider({
705
- delayDuration = 0,
706
- ...props
707
- }) {
708
- return /* @__PURE__ */ jsx(
709
- TooltipPrimitive.Provider,
710
- {
711
- "data-slot": "tooltip-provider",
712
- delayDuration,
713
- ...props
714
- }
715
- );
716
- }
717
- function Tooltip({
718
- ...props
719
- }) {
720
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
721
- }
722
- function TooltipTrigger({
723
- className,
724
- ...props
725
- }) {
726
- return /* @__PURE__ */ jsx(
727
- TooltipPrimitive.Trigger,
728
- {
729
- "data-slot": "tooltip-trigger",
730
- className: cn("cursor-pointer", className),
731
- ...props
732
- }
733
- );
734
- }
735
- function TooltipContent({
736
- className,
737
- sideOffset = 0,
738
- ...props
739
- }) {
740
- return /* @__PURE__ */ jsx(
741
- TooltipPrimitive.Content,
742
- {
743
- "data-slot": "tooltip-content",
744
- sideOffset,
745
- className: cn(
746
- "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",
747
- className
748
- ),
749
- ...props
750
- }
751
- );
752
- }
753
- var init_tooltip = __esm({
754
- "src/ui/primitives/tooltip.tsx"() {
755
- "use client";
756
- init_utils();
757
- }
758
- });
759
- var init_resizable = __esm({
760
- "src/ui/primitives/resizable.tsx"() {
761
- "use client";
762
- }
763
- });
764
- var init_slider = __esm({
765
- "src/ui/primitives/slider.tsx"() {
766
- "use client";
767
- }
768
- });
769
- var init_toggle = __esm({
770
- "src/ui/primitives/toggle.tsx"() {
771
- "use client";
772
- cva(
773
- "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",
774
- {
775
- variants: {
776
- variant: {
777
- default: "bg-transparent",
778
- outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
779
- },
780
- size: {
781
- default: "h-9 px-3",
782
- sm: "h-8 px-2",
783
- lg: "h-10 px-3"
784
- }
785
- },
786
- defaultVariants: {
787
- variant: "default",
788
- size: "default"
789
- }
790
- }
791
- );
792
- }
793
- });
794
- var init_toggle_group = __esm({
795
- "src/ui/primitives/toggle-group.tsx"() {
796
- "use client";
797
- createContext({
798
- size: "default",
799
- variant: "default"
800
- });
801
- }
802
- });
803
- var init_menubar = __esm({
804
- "src/ui/primitives/menubar.tsx"() {
805
- "use client";
806
- }
807
- });
808
- var init_navigation_menu = __esm({
809
- "src/ui/primitives/navigation-menu.tsx"() {
810
- cva(
811
- "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"
812
- );
813
- }
814
- });
815
- function Sheet({
816
- ...props
817
- }) {
818
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
819
- }
820
- function SheetTrigger({
821
- className,
822
- ...props
823
- }) {
824
- return /* @__PURE__ */ jsx(
825
- DialogPrimitive.Trigger,
826
- {
827
- "data-slot": "sheet-trigger",
828
- className: cn("cursor-pointer", className),
829
- ...props
830
- }
831
- );
832
- }
833
- function SheetClose({
834
- ...props
835
- }) {
836
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "sheet-close", ...props });
837
- }
838
- function SheetPortal({
839
- ...props
840
- }) {
841
- return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
842
- }
843
- function SheetOverlay({
844
- className,
845
- ...props
846
- }) {
847
- return /* @__PURE__ */ jsx(
848
- DialogPrimitive.Overlay,
849
- {
850
- "data-slot": "sheet-overlay",
851
- className: cn(
852
- "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",
853
- className
854
- ),
855
- ...props
856
- }
857
- );
858
- }
859
- function SheetContent({
860
- className,
861
- children,
862
- side = "right",
863
- ...props
864
- }) {
865
- return /* @__PURE__ */ jsxs(SheetPortal, { children: [
866
- /* @__PURE__ */ jsx(SheetOverlay, {}),
867
- /* @__PURE__ */ jsx(
868
- DialogPrimitive.Content,
869
- {
870
- "data-slot": "sheet-content",
871
- className: cn(sheetVariants({ side }), className),
872
- ...props,
873
- children
874
- }
875
- )
876
- ] });
877
- }
878
- function SheetHeader({ className, ...props }) {
879
- return /* @__PURE__ */ jsx(
880
- "div",
881
- {
882
- "data-slot": "sheet-header",
883
- className: cn("flex flex-col space-y-1", className),
884
- ...props
885
- }
886
- );
887
- }
888
- function SheetFooter({ className, ...props }) {
889
- return /* @__PURE__ */ jsx(
890
- "div",
891
- {
892
- "data-slot": "sheet-footer",
893
- className: cn(
894
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",
895
- className
896
- ),
897
- ...props
898
- }
899
- );
900
- }
901
- function SheetTitle({
902
- className,
903
- ...props
904
- }) {
905
- return /* @__PURE__ */ jsx(
906
- DialogPrimitive.Title,
907
- {
908
- "data-slot": "sheet-title",
909
- className: cn("text-lg font-semibold text-foreground", className),
910
- ...props
911
- }
912
- );
913
- }
914
- function SheetDescription({
915
- className,
916
- ...props
917
- }) {
918
- return /* @__PURE__ */ jsx(
919
- DialogPrimitive.Description,
920
- {
921
- "data-slot": "sheet-description",
922
- className: cn("text-sm text-muted-foreground", className),
923
- ...props
924
- }
925
- );
926
- }
927
- var sheetVariants;
928
- var init_sheet = __esm({
929
- "src/ui/feedback/sheet.tsx"() {
930
- "use client";
931
- init_utils();
932
- sheetVariants = cva(
933
- "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",
934
- {
935
- variants: {
936
- side: {
937
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
938
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
939
- 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",
940
- 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",
941
- 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",
942
- 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"
943
- }
944
- },
945
- defaultVariants: {
946
- side: "right"
947
- }
948
- }
949
- );
950
- }
951
- });
952
- function ContextMenu({
953
- ...props
954
- }) {
955
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
956
- }
957
- function ContextMenuTrigger({
958
- ...props
959
- }) {
960
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
961
- }
962
- function ContextMenuGroup({
963
- ...props
964
- }) {
965
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
966
- }
967
- function ContextMenuPortal({
968
- ...props
969
- }) {
970
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
971
- }
972
- function ContextMenuSub({
973
- ...props
974
- }) {
975
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
976
- }
977
- function ContextMenuRadioGroup({
978
- ...props
979
- }) {
980
- return /* @__PURE__ */ jsx(
981
- ContextMenuPrimitive.RadioGroup,
982
- {
983
- "data-slot": "context-menu-radio-group",
984
- ...props
985
- }
986
- );
987
- }
988
- function ContextMenuSubTrigger({
989
- className,
990
- inset,
991
- children,
992
- ...props
993
- }) {
994
- return /* @__PURE__ */ jsxs(
995
- ContextMenuPrimitive.SubTrigger,
996
- {
997
- "data-slot": "context-menu-sub-trigger",
998
- className: cn(
999
- "flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1000
- inset && "ps-8",
1001
- className
1002
- ),
1003
- ...props,
1004
- children: [
1005
- children,
1006
- /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
1007
- ]
1008
- }
1009
- );
1010
- }
1011
- function ContextMenuSubContent({
1012
- className,
1013
- ...props
1014
- }) {
1015
- return /* @__PURE__ */ jsx(
1016
- ContextMenuPrimitive.SubContent,
1017
- {
1018
- "data-slot": "context-menu-sub-content",
1019
- className: cn(
1020
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1021
- className
1022
- ),
1023
- ...props
1024
- }
1025
- );
1026
- }
1027
- function ContextMenuContent({
1028
- className,
1029
- ...props
1030
- }) {
1031
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1032
- ContextMenuPrimitive.Content,
1033
- {
1034
- "data-slot": "context-menu-content",
1035
- className: cn(
1036
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1037
- className
1038
- ),
1039
- ...props
1040
- }
1041
- ) });
1042
- }
1043
- function ContextMenuItem({
1044
- className,
1045
- inset,
1046
- variant = "default",
1047
- ...props
1048
- }) {
1049
- return /* @__PURE__ */ jsx(
1050
- ContextMenuPrimitive.Item,
1051
- {
1052
- "data-slot": "context-menu-item",
1053
- "data-inset": inset,
1054
- "data-variant": variant,
1055
- className: cn(
1056
- "relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground",
1057
- className
1058
- ),
1059
- ...props
1060
- }
1061
- );
1062
- }
1063
- function ContextMenuCheckboxItem({
1064
- className,
1065
- children,
1066
- checked,
1067
- ...props
1068
- }) {
1069
- return /* @__PURE__ */ jsxs(
1070
- ContextMenuPrimitive.CheckboxItem,
1071
- {
1072
- "data-slot": "context-menu-checkbox-item",
1073
- className: cn(
1074
- "relative flex cursor-pointer select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
1075
- className
1076
- ),
1077
- checked,
1078
- ...props,
1079
- children: [
1080
- /* @__PURE__ */ jsx("span", { className: "absolute start-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
1081
- children
1082
- ]
1083
- }
1084
- );
1085
- }
1086
- function ContextMenuRadioItem({
1087
- className,
1088
- children,
1089
- ...props
1090
- }) {
1091
- return /* @__PURE__ */ jsxs(
1092
- ContextMenuPrimitive.RadioItem,
1093
- {
1094
- "data-slot": "context-menu-radio-item",
1095
- className: cn(
1096
- "relative flex cursor-pointer select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
1097
- className
1098
- ),
1099
- ...props,
1100
- children: [
1101
- /* @__PURE__ */ jsx("span", { className: "absolute start-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Dot, { className: "h-4 w-4 fill-current" }) }) }),
1102
- children
1103
- ]
1104
- }
1105
- );
1106
- }
1107
- function ContextMenuLabel({
1108
- className,
1109
- inset,
1110
- ...props
1111
- }) {
1112
- return /* @__PURE__ */ jsx(
1113
- ContextMenuPrimitive.Label,
1114
- {
1115
- "data-slot": "context-menu-label",
1116
- className: cn(
1117
- "px-2 py-1.5 text-sm font-semibold text-foreground",
1118
- inset && "ps-8",
1119
- className
1120
- ),
1121
- ...props
1122
- }
1123
- );
1124
- }
1125
- function ContextMenuSeparator({
1126
- className,
1127
- ...props
1128
- }) {
1129
- return /* @__PURE__ */ jsx(
1130
- ContextMenuPrimitive.Separator,
1131
- {
1132
- "data-slot": "context-menu-separator",
1133
- className: cn("-mx-1 my-1 h-px bg-border", className),
1134
- ...props
1135
- }
1136
- );
1137
- }
1138
- function ContextMenuShortcut({
1139
- className,
1140
- ...props
1141
- }) {
1142
- return /* @__PURE__ */ jsx(
1143
- "span",
1144
- {
1145
- "data-slot": "context-menu-shortcut",
1146
- className: cn(
1147
- "ms-auto text-sm tracking-widest text-muted-foreground",
1148
- className
1149
- ),
1150
- ...props
1151
- }
1152
- );
1153
- }
1154
- var init_context_menu = __esm({
1155
- "src/ui/feedback/context-menu.tsx"() {
1156
- "use client";
1157
- init_utils();
1158
- }
1159
- });
1160
- function Drawer({
1161
- shouldScaleBackground = true,
1162
- ...props
1163
- }) {
1164
- return /* @__PURE__ */ jsx(
1165
- Drawer$1.Root,
1166
- {
1167
- "data-slot": "drawer",
1168
- shouldScaleBackground,
1169
- ...props
1170
- }
1171
- );
1172
- }
1173
- function DrawerTrigger({
1174
- className,
1175
- ...props
1176
- }) {
1177
- return /* @__PURE__ */ jsx(
1178
- Drawer$1.Trigger,
1179
- {
1180
- "data-slot": "drawer-trigger",
1181
- className: cn("cursor-pointer", className),
1182
- ...props
1183
- }
1184
- );
1185
- }
1186
- function DrawerPortal({
1187
- children,
1188
- ...props
1189
- }) {
1190
- const Portal9 = Drawer$1.Portal;
1191
- return /* @__PURE__ */ jsx(Portal9, { "data-slot": "drawer-portal", ...props, children });
1192
- }
1193
- function DrawerClose({
1194
- ...props
1195
- }) {
1196
- return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
1197
- }
1198
- function DrawerOverlay({
1199
- className,
1200
- ...props
1201
- }) {
1202
- return /* @__PURE__ */ jsx(
1203
- Drawer$1.Overlay,
1204
- {
1205
- "data-slot": "drawer-overlay",
1206
- className: cn("fixed inset-0 z-50 bg-black/80", className),
1207
- ...props
1208
- }
1209
- );
1210
- }
1211
- function DrawerContent({
1212
- className,
1213
- children,
1214
- ...props
1215
- }) {
1216
- return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
1217
- /* @__PURE__ */ jsx(DrawerOverlay, {}),
1218
- /* @__PURE__ */ jsxs(
1219
- Drawer$1.Content,
1220
- {
1221
- "data-slot": "drawer-content",
1222
- className: cn(
1223
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
1224
- className
1225
- ),
1226
- ...props,
1227
- children: [
1228
- /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
1229
- children
1230
- ]
1231
- }
1232
- )
1233
- ] });
1234
- }
1235
- function DrawerHeader({ className, ...props }) {
1236
- return /* @__PURE__ */ jsx(
1237
- "div",
1238
- {
1239
- "data-slot": "drawer-header",
1240
- className: cn("grid gap-1.5 p-4 text-center sm:text-start", className),
1241
- ...props
1242
- }
1243
- );
1244
- }
1245
- function DrawerFooter({ className, ...props }) {
1246
- return /* @__PURE__ */ jsx(
1247
- "div",
1248
- {
1249
- "data-slot": "drawer-footer",
1250
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
1251
- ...props
1252
- }
1253
- );
1254
- }
1255
- function DrawerTitle({
1256
- className,
1257
- ...props
1258
- }) {
1259
- return /* @__PURE__ */ jsx(
1260
- Drawer$1.Title,
1261
- {
1262
- "data-slot": "drawer-title",
1263
- className: cn(
1264
- "text-lg font-semibold leading-none tracking-tight",
1265
- className
1266
- ),
1267
- ...props
1268
- }
1269
- );
1270
- }
1271
- function DrawerDescription({
1272
- className,
1273
- ...props
1274
- }) {
1275
- return /* @__PURE__ */ jsx(
1276
- Drawer$1.Description,
1277
- {
1278
- "data-slot": "drawer-description",
1279
- className: cn("text-sm text-muted-foreground", className),
1280
- ...props
1281
- }
1282
- );
1283
- }
1284
- var init_drawer = __esm({
1285
- "src/ui/feedback/drawer.tsx"() {
1286
- "use client";
1287
- init_utils();
1288
- }
1289
- });
1290
- function Progress({
1291
- className,
1292
- value,
1293
- max,
1294
- ...props
1295
- }) {
1296
- return /* @__PURE__ */ jsx(
1297
- ProgressPrimitive.Root,
1298
- {
1299
- "data-slot": "progress",
1300
- className: cn(
1301
- "relative h-2 w-full overflow-hidden rounded-lg bg-primary/20",
1302
- className
1303
- ),
1304
- max,
1305
- ...props,
1306
- children: /* @__PURE__ */ jsx(
1307
- ProgressPrimitive.Indicator,
1308
- {
1309
- "data-slot": "progress-indicator",
1310
- className: "h-full w-full flex-1 bg-primary transition-all",
1311
- style: {
1312
- transform: `translateX(-${100 - (value || 0) / (max || 100) * 100}%)`
1313
- }
1314
- }
1315
- )
1316
- }
1317
- );
1318
- }
1319
- var init_progress = __esm({
1320
- "src/ui/feedback/progress.tsx"() {
1321
- "use client";
1322
- init_utils();
1323
- }
1324
- });
1325
- function Toaster({ ...props }) {
1326
- const { settings } = useSettings();
1327
- const mode = settings.mode;
1328
- return /* @__PURE__ */ jsx(
1329
- Toaster$1,
1330
- {
1331
- theme: mode,
1332
- className: "toaster group",
1333
- toastOptions: {
1334
- classNames: {
1335
- toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
1336
- description: "group-[.toast]:text-muted-foreground",
1337
- actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
1338
- cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
1339
- }
1340
- },
1341
- richColors: true,
1342
- closeButton: true,
1343
- ...props
1344
- }
1345
- );
1346
- }
1347
- var init_sonner = __esm({
1348
- "src/ui/feedback/sonner.tsx"() {
1349
- "use client";
1350
- init_hooks();
1351
- }
1352
- });
1353
-
1354
- // src/hooks/use-tenant.ts
1355
- var init_use_tenant = __esm({
1356
- "src/hooks/use-tenant.ts"() {
1357
- }
1358
- });
1359
- function useMediaQuery(query) {
1360
- const [matches, setMatches] = useState(false);
1361
- useEffect(() => {
1362
- if (typeof window !== "undefined") {
1363
- const media = window.matchMedia(query);
1364
- setMatches(media.matches);
1365
- const listener = (event) => setMatches(event.matches);
1366
- media.addEventListener("change", listener);
1367
- return () => media.removeEventListener("change", listener);
1368
- }
1369
- }, [query]);
1370
- return matches;
1371
- }
1372
- function useMobile() {
1373
- return useMediaQuery("(max-width: 768px)");
1374
- }
1375
- function useSettings() {
1376
- const context = useContext(SettingsContext);
1377
- if (!context) {
1378
- return defaultSettingsValue;
1379
- }
1380
- return context;
1381
- }
1382
- var defaultSettingsValue;
1383
- var init_hooks = __esm({
1384
- "src/hooks/index.tsx"() {
1385
- "use client";
1386
- init_providers();
1387
- init_use_tenant();
1388
- defaultSettingsValue = {
1389
- settings: defaultSettings,
1390
- updateSettings: () => {
1391
- },
1392
- resetSettings: () => {
1393
- }
1394
- };
1395
- createContext(null);
1396
- }
1397
- });
1398
- function useSidebar() {
1399
- const context = React11.useContext(SidebarContext);
1400
- if (!context) {
1401
- throw new Error("useSidebar must be used within a SidebarProvider.");
1402
- }
1403
- return context;
1404
- }
1405
- 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;
1406
- var init_sidebar = __esm({
1407
- "src/ui/primitives/sidebar.tsx"() {
1408
- "use client";
1409
- init_hooks();
1410
- init_utils();
1411
- init_button();
1412
- init_feedback();
1413
- init_tooltip();
1414
- SIDEBAR_WIDTH = "16rem";
1415
- SIDEBAR_WIDTH_MOBILE = "18rem";
1416
- SIDEBAR_WIDTH_ICON = "3rem";
1417
- SIDEBAR_KEYBOARD_SHORTCUT = "b";
1418
- SidebarContext = React11.createContext(null);
1419
- SidebarProvider = React11.forwardRef(
1420
- ({
1421
- defaultOpen = false,
1422
- open: openProp,
1423
- onOpenChange: setOpenProp,
1424
- className,
1425
- style,
1426
- children,
1427
- ...props
1428
- }, ref) => {
1429
- const isMobile = useMobile();
1430
- const [openMobile, setOpenMobile] = React11.useState(false);
1431
- const [hoverOpen, setHoverOpen] = React11.useState(false);
1432
- const [_open, _setOpen] = React11.useState(defaultOpen);
1433
- const open = openProp ?? _open;
1434
- const setOpen = React11.useCallback(
1435
- (value) => {
1436
- if (setOpenProp) {
1437
- return setOpenProp(typeof value === "function" ? value(open) : value);
1438
- }
1439
- _setOpen(value);
1440
- },
1441
- [setOpenProp, open]
1442
- );
1443
- const toggleSidebar = React11.useCallback(() => {
1444
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
1445
- }, [isMobile, setOpen, setOpenMobile]);
1446
- React11.useEffect(() => {
1447
- const handleKeyDown = (event) => {
1448
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
1449
- event.preventDefault();
1450
- toggleSidebar();
1451
- }
1452
- };
1453
- window.addEventListener("keydown", handleKeyDown);
1454
- return () => window.removeEventListener("keydown", handleKeyDown);
1455
- }, [toggleSidebar]);
1456
- const state = open ? "expanded" : "collapsed";
1457
- const isHoverExpanded = !open && hoverOpen;
1458
- const contextValue = React11.useMemo(
1459
- () => ({
1460
- state,
1461
- open,
1462
- setOpen,
1463
- isMobile,
1464
- openMobile,
1465
- setOpenMobile,
1466
- toggleSidebar,
1467
- hoverOpen,
1468
- setHoverOpen,
1469
- isHoverExpanded
1470
- }),
1471
- [
1472
- state,
1473
- open,
1474
- setOpen,
1475
- isMobile,
1476
- openMobile,
1477
- setOpenMobile,
1478
- toggleSidebar,
1479
- hoverOpen,
1480
- setHoverOpen,
1481
- isHoverExpanded
1482
- ]
1483
- );
1484
- return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
1485
- "div",
1486
- {
1487
- style: {
1488
- "--sidebar-width": SIDEBAR_WIDTH,
1489
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
1490
- ...style
1491
- },
1492
- className: cn(
1493
- "group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
1494
- className
1495
- ),
1496
- ref,
1497
- ...props,
1498
- children
1499
- }
1500
- ) }) });
1501
- }
1502
- );
1503
- SidebarProvider.displayName = "SidebarProvider";
1504
- Sidebar = React11.forwardRef(
1505
- ({
1506
- side = "left",
1507
- variant = "sidebar",
1508
- collapsible = "offcanvas",
1509
- hoverExpandEnabled = true,
1510
- className,
1511
- children,
1512
- ...props
1513
- }, ref) => {
1514
- const {
1515
- isMobile,
1516
- state,
1517
- openMobile,
1518
- setOpenMobile,
1519
- setHoverOpen,
1520
- isHoverExpanded
1521
- } = useSidebar();
1522
- const handleMouseEnter = React11.useCallback(() => {
1523
- if (hoverExpandEnabled && state === "collapsed" && collapsible === "icon") {
1524
- setHoverOpen(true);
1525
- }
1526
- }, [hoverExpandEnabled, state, collapsible, setHoverOpen]);
1527
- const handleMouseLeave = React11.useCallback(() => {
1528
- if (hoverExpandEnabled) {
1529
- setHoverOpen(false);
1530
- }
1531
- }, [hoverExpandEnabled, setHoverOpen]);
1532
- if (collapsible === "none") {
1533
- return /* @__PURE__ */ jsx(
1534
- "div",
1535
- {
1536
- className: cn(
1537
- "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
1538
- className
1539
- ),
1540
- ref,
1541
- ...props,
1542
- children
1543
- }
1544
- );
1545
- }
1546
- if (isMobile) {
1547
- return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
1548
- SheetContent,
1549
- {
1550
- "data-sidebar": "sidebar",
1551
- "data-mobile": "true",
1552
- className: "w-(--sidebar-width) bg-background p-0 text-foreground [&>button]:hidden",
1553
- style: {
1554
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
1555
- },
1556
- side,
1557
- children: [
1558
- /* @__PURE__ */ jsx(SheetTitle, { className: "sr-only", children: "Mobile Menu" }),
1559
- /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
1560
- ]
1561
- }
1562
- ) });
1563
- }
1564
- return /* @__PURE__ */ jsxs(
1565
- "div",
1566
- {
1567
- ref,
1568
- className: cn(
1569
- "group peer hidden md:block transition-colors duration-200",
1570
- // Blue bg + white text when collapsed, white bg + dark text when expanded/hover
1571
- state === "collapsed" && !isHoverExpanded ? "text-sidebar-foreground" : "text-foreground"
1572
- ),
1573
- "data-state": state,
1574
- "data-hover-expanded": isHoverExpanded,
1575
- "data-collapsible": state === "collapsed" ? collapsible : "",
1576
- "data-variant": variant,
1577
- "data-side": side,
1578
- onMouseEnter: handleMouseEnter,
1579
- onMouseLeave: handleMouseLeave,
1580
- children: [
1581
- /* @__PURE__ */ jsx(
1582
- "div",
1583
- {
1584
- className: cn(
1585
- "duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear",
1586
- "group-data-[collapsible=offcanvas]:w-0",
1587
- "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
1588
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
1589
- )
1590
- }
1591
- ),
1592
- /* @__PURE__ */ jsx(
1593
- "div",
1594
- {
1595
- className: cn(
1596
- "duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",
1597
- 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)]",
1598
- // Adjustments for collapsible=icon
1599
- 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",
1600
- // Hover expand - override icon width to full width on hover
1601
- "group-data-[hover-expanded=true]:!w-(--sidebar-width) group-data-[hover-expanded=true]:shadow-xl group-data-[hover-expanded=true]:z-[100]",
1602
- className
1603
- ),
1604
- ...props,
1605
- children: /* @__PURE__ */ jsx(
1606
- "div",
1607
- {
1608
- "data-sidebar": "sidebar",
1609
- className: cn(
1610
- "flex h-full w-full flex-col border-r transition-colors duration-200",
1611
- // Blue background when collapsed, white when expanded/hover
1612
- "group-data-[state=collapsed]:bg-sidebar group-data-[state=collapsed]:border-sidebar-border",
1613
- "group-data-[state=expanded]:bg-background group-data-[state=expanded]:border-border",
1614
- "group-data-[hover-expanded=true]:!bg-background group-data-[hover-expanded=true]:!border-border",
1615
- "group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
1616
- ),
1617
- children
1618
- }
1619
- )
1620
- }
1621
- )
1622
- ]
1623
- }
1624
- );
1625
- }
1626
- );
1627
- Sidebar.displayName = "Sidebar";
1628
- SidebarTrigger = React11.forwardRef(({ className, onClick, ...props }, ref) => {
1629
- const { toggleSidebar } = useSidebar();
1630
- return /* @__PURE__ */ jsxs(
1631
- Button,
1632
- {
1633
- ref,
1634
- "data-sidebar": "trigger",
1635
- variant: "ghost",
1636
- size: "icon",
1637
- className: cn("h-7 w-7", className),
1638
- onClick: (event) => {
1639
- onClick?.(event);
1640
- toggleSidebar();
1641
- },
1642
- ...props,
1643
- children: [
1644
- /* @__PURE__ */ jsx(PanelLeft, {}),
1645
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
1646
- ]
1647
- }
1648
- );
1649
- });
1650
- SidebarTrigger.displayName = "SidebarTrigger";
1651
- SidebarRail = React11.forwardRef(({ className, ...props }, ref) => {
1652
- const { toggleSidebar } = useSidebar();
1653
- return /* @__PURE__ */ jsx(
1654
- "button",
1655
- {
1656
- ref,
1657
- "data-sidebar": "rail",
1658
- "aria-label": "Toggle Sidebar",
1659
- tabIndex: -1,
1660
- onClick: toggleSidebar,
1661
- title: "Toggle Sidebar",
1662
- className: cn(
1663
- "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",
1664
- "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
1665
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
1666
- "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
1667
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
1668
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
1669
- className
1670
- ),
1671
- ...props
1672
- }
1673
- );
1674
- });
1675
- SidebarRail.displayName = "SidebarRail";
1676
- SidebarInset = React11.forwardRef(({ className, ...props }, ref) => {
1677
- return /* @__PURE__ */ jsx(
1678
- "main",
1679
- {
1680
- ref,
1681
- className: cn(
1682
- "relative flex min-h-svh flex-1 flex-col bg-muted/40 transition-[margin] duration-200 ease-linear",
1683
- "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",
1684
- className
1685
- ),
1686
- ...props
1687
- }
1688
- );
1689
- });
1690
- SidebarInset.displayName = "SidebarInset";
1691
- SidebarInput = React11.forwardRef(({ className, ...props }, ref) => {
1692
- return /* @__PURE__ */ jsx(
1693
- "input",
1694
- {
1695
- ref,
1696
- "data-sidebar": "input",
1697
- className: cn(
1698
- "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",
1699
- className
1700
- ),
1701
- ...props
1702
- }
1703
- );
1704
- });
1705
- SidebarInput.displayName = "SidebarInput";
1706
- SidebarHeader = React11.forwardRef(({ className, ...props }, ref) => {
1707
- return /* @__PURE__ */ jsx(
1708
- "div",
1709
- {
1710
- ref,
1711
- "data-sidebar": "header",
1712
- className: cn("flex flex-col gap-2 p-2", className),
1713
- ...props
1714
- }
1715
- );
1716
- });
1717
- SidebarHeader.displayName = "SidebarHeader";
1718
- SidebarFooter = React11.forwardRef(({ className, ...props }, ref) => {
1719
- return /* @__PURE__ */ jsx(
1720
- "div",
1721
- {
1722
- ref,
1723
- "data-sidebar": "footer",
1724
- className: cn("flex flex-col gap-2 p-2", className),
1725
- ...props
1726
- }
1727
- );
1728
- });
1729
- SidebarFooter.displayName = "SidebarFooter";
1730
- SidebarSeparator = React11.forwardRef(({ className, ...props }, ref) => {
1731
- return /* @__PURE__ */ jsx(
1732
- "div",
1733
- {
1734
- ref,
1735
- "data-sidebar": "separator",
1736
- className: cn("mx-2 h-[1px] w-auto bg-sidebar-border", className),
1737
- ...props
1738
- }
1739
- );
1740
- });
1741
- SidebarSeparator.displayName = "SidebarSeparator";
1742
- SidebarContent = React11.forwardRef(({ className, ...props }, ref) => {
1743
- return /* @__PURE__ */ jsx(
1744
- "div",
1745
- {
1746
- ref,
1747
- "data-sidebar": "content",
1748
- className: cn(
1749
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto",
1750
- // Hide overflow when collapsed, but show when hover-expanded
1751
- "group-data-[collapsible=icon]:overflow-hidden group-data-[hover-expanded=true]:!overflow-auto",
1752
- className
1753
- ),
1754
- ...props
1755
- }
1756
- );
1757
- });
1758
- SidebarContent.displayName = "SidebarContent";
1759
- SidebarGroup = React11.forwardRef(({ className, ...props }, ref) => {
1760
- return /* @__PURE__ */ jsx(
1761
- "div",
1762
- {
1763
- ref,
1764
- "data-sidebar": "group",
1765
- className: cn("relative flex w-full min-w-0 flex-col p-2", className),
1766
- ...props
1767
- }
1768
- );
1769
- });
1770
- SidebarGroup.displayName = "SidebarGroup";
1771
- SidebarGroupLabel = React11.forwardRef(({ className, asChild = false, ...props }, ref) => {
1772
- const Comp = asChild ? Slot : "div";
1773
- return /* @__PURE__ */ jsx(
1774
- Comp,
1775
- {
1776
- ref,
1777
- "data-sidebar": "group-label",
1778
- className: cn(
1779
- "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",
1780
- // Hide when collapsed, show when hover-expanded
1781
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
1782
- "group-data-[hover-expanded=true]:!mt-0 group-data-[hover-expanded=true]:!opacity-100",
1783
- className
1784
- ),
1785
- ...props
1786
- }
1787
- );
1788
- });
1789
- SidebarGroupLabel.displayName = "SidebarGroupLabel";
1790
- SidebarGroupAction = React11.forwardRef(({ className, asChild = false, ...props }, ref) => {
1791
- const Comp = asChild ? Slot : "button";
1792
- return /* @__PURE__ */ jsx(
1793
- Comp,
1794
- {
1795
- ref,
1796
- "data-sidebar": "group-action",
1797
- className: cn(
1798
- "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",
1799
- // Increases the hit area of the button on mobile.
1800
- "after:absolute after:-inset-2 after:md:hidden",
1801
- "group-data-[collapsible=icon]:hidden",
1802
- className
1803
- ),
1804
- ...props
1805
- }
1806
- );
1807
- });
1808
- SidebarGroupAction.displayName = "SidebarGroupAction";
1809
- SidebarGroupContent = React11.forwardRef(({ className, ...props }, ref) => {
1810
- return /* @__PURE__ */ jsx(
1811
- "div",
1812
- {
1813
- ref,
1814
- "data-sidebar": "group-content",
1815
- className: cn("w-full text-sm", className),
1816
- ...props
1817
- }
1818
- );
1819
- });
1820
- SidebarGroupContent.displayName = "SidebarGroupContent";
1821
- SidebarMenu = React11.forwardRef(({ className, ...props }, ref) => {
1822
- return /* @__PURE__ */ jsx(
1823
- "ul",
1824
- {
1825
- ref,
1826
- "data-sidebar": "menu",
1827
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
1828
- ...props
1829
- }
1830
- );
1831
- });
1832
- SidebarMenu.displayName = "SidebarMenu";
1833
- SidebarMenuItem = React11.forwardRef(({ className, ...props }, ref) => {
1834
- return /* @__PURE__ */ jsx(
1835
- "li",
1836
- {
1837
- ref,
1838
- "data-sidebar": "menu-item",
1839
- className: cn("group/menu-item relative", className),
1840
- ...props
1841
- }
1842
- );
1843
- });
1844
- SidebarMenuItem.displayName = "SidebarMenuItem";
1845
- sidebarMenuButtonVariants = cva(
1846
- // Base styles + hover-expand overrides
1847
- "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",
1848
- {
1849
- variants: {
1850
- variant: {
1851
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1852
- 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))]"
1853
- },
1854
- size: {
1855
- default: "h-8 text-sm",
1856
- sm: "h-7 text-xs",
1857
- lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
1858
- },
1859
- isActive: {
1860
- true: "bg-primary/10 text-primary font-bold"
1861
- }
1862
- },
1863
- defaultVariants: {
1864
- variant: "default",
1865
- size: "default"
1866
- }
1867
- }
1868
- );
1869
- SidebarMenuButton = React11.forwardRef(
1870
- ({
1871
- asChild = false,
1872
- isActive = false,
1873
- variant = "default",
1874
- size = "default",
1875
- tooltip,
1876
- className,
1877
- ...props
1878
- }, ref) => {
1879
- const Comp = asChild ? Slot : "button";
1880
- const { isMobile, state } = useSidebar();
1881
- const button = /* @__PURE__ */ jsx(
1882
- Comp,
1883
- {
1884
- ref,
1885
- "data-sidebar": "menu-button",
1886
- "data-size": size,
1887
- "data-active": isActive,
1888
- className: cn(
1889
- sidebarMenuButtonVariants({ variant, size, isActive }),
1890
- className
1891
- ),
1892
- ...props
1893
- }
1894
- );
1895
- if (!tooltip) {
1896
- return button;
1897
- }
1898
- if (typeof tooltip === "string") {
1899
- tooltip = {
1900
- children: tooltip
1901
- };
1902
- }
1903
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
1904
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
1905
- /* @__PURE__ */ jsx(
1906
- TooltipContent,
1907
- {
1908
- side: "right",
1909
- align: "center",
1910
- hidden: state !== "collapsed" || isMobile,
1911
- ...tooltip
1912
- }
1913
- )
1914
- ] });
1915
- }
1916
- );
1917
- SidebarMenuButton.displayName = "SidebarMenuButton";
1918
- SidebarMenuAction = React11.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
1919
- const Comp = asChild ? Slot : "button";
1920
- return /* @__PURE__ */ jsx(
1921
- Comp,
1922
- {
1923
- ref,
1924
- "data-sidebar": "menu-action",
1925
- className: cn(
1926
- "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",
1927
- // Increases the hit area of the button on mobile.
1928
- "after:absolute after:-inset-2 after:md:hidden",
1929
- "peer-data-[size=sm]/menu-button:top-1",
1930
- "peer-data-[size=default]/menu-button:top-1.5",
1931
- "peer-data-[size=lg]/menu-button:top-2.5",
1932
- "group-data-[collapsible=icon]:hidden",
1933
- showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
1934
- className
1935
- ),
1936
- ...props
1937
- }
1938
- );
1939
- });
1940
- SidebarMenuAction.displayName = "SidebarMenuAction";
1941
- SidebarMenuBadge = React11.forwardRef(({ className, ...props }, ref) => {
1942
- return /* @__PURE__ */ jsx(
1943
- "div",
1944
- {
1945
- ref,
1946
- "data-sidebar": "menu-badge",
1947
- className: cn(
1948
- "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",
1949
- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
1950
- "peer-data-[size=sm]/menu-button:top-1",
1951
- "peer-data-[size=default]/menu-button:top-1.5",
1952
- "peer-data-[size=lg]/menu-button:top-2.5",
1953
- "group-data-[collapsible=icon]:hidden",
1954
- className
1955
- ),
1956
- ...props
1957
- }
1958
- );
1959
- });
1960
- SidebarMenuBadge.displayName = "SidebarMenuBadge";
1961
- SidebarMenuSkeleton = React11.forwardRef(({ className, showIcon = false, ...props }, ref) => {
1962
- const width = React11.useMemo(() => {
1963
- return `${Math.floor(Math.random() * 40) + 50}%`;
1964
- }, []);
1965
- return /* @__PURE__ */ jsxs(
1966
- "div",
1967
- {
1968
- ref,
1969
- "data-sidebar": "menu-skeleton",
1970
- className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
1971
- ...props,
1972
- children: [
1973
- showIcon && /* @__PURE__ */ jsx(
1974
- "div",
1975
- {
1976
- className: "size-4 rounded-md animate-pulse bg-muted",
1977
- "data-sidebar": "menu-skeleton-icon"
1978
- }
1979
- ),
1980
- /* @__PURE__ */ jsx(
1981
- "div",
1982
- {
1983
- className: "h-4 flex-1 max-w-[--skeleton-width] animate-pulse bg-muted rounded-full",
1984
- "data-sidebar": "menu-skeleton-text",
1985
- style: {
1986
- "--skeleton-width": width
1987
- }
1988
- }
1989
- )
1990
- ]
1991
- }
1992
- );
1993
- });
1994
- SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
1995
- SidebarMenuSub = React11.forwardRef(({ className, ...props }, ref) => {
1996
- return /* @__PURE__ */ jsx(
1997
- "ul",
1998
- {
1999
- ref,
2000
- "data-sidebar": "menu-sub",
2001
- className: cn(
2002
- "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",
2003
- // Hide when collapsed, show when hover-expanded
2004
- "group-data-[collapsible=icon]:hidden group-data-[hover-expanded=true]:!flex",
2005
- className
2006
- ),
2007
- ...props
2008
- }
2009
- );
2010
- });
2011
- SidebarMenuSub.displayName = "SidebarMenuSub";
2012
- SidebarMenuSubItem = React11.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, ...props }));
2013
- SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
2014
- SidebarMenuSubButton = React11.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
2015
- const Comp = asChild ? Slot : "a";
2016
- return /* @__PURE__ */ jsx(
2017
- Comp,
2018
- {
2019
- ref,
2020
- "data-sidebar": "menu-sub-button",
2021
- "data-size": size,
2022
- "data-active": isActive,
2023
- className: cn(
2024
- "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",
2025
- "data-[active=true]:bg-primary/15 data-[active=true]:!text-primary data-[active=true]:font-bold",
2026
- size === "sm" && "text-xs",
2027
- size === "md" && "text-sm",
2028
- className
2029
- ),
2030
- ...props
2031
- }
2032
- );
2033
- });
2034
- SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
2035
- }
2036
- });
2037
- function Spinner({ size = "md", className }) {
2038
- const sizeClasses = {
2039
- sm: "h-4 w-4",
2040
- md: "h-6 w-6",
2041
- lg: "h-8 w-8"
2042
- };
2043
- return /* @__PURE__ */ jsx(
2044
- "div",
2045
- {
2046
- className: cn(
2047
- "animate-spin rounded-full border-2 border-current border-t-transparent",
2048
- sizeClasses[size],
2049
- className
2050
- )
2051
- }
2052
- );
2053
- }
2054
- var Textarea, ButtonLoading;
2055
- var init_primitives = __esm({
2056
- "src/ui/primitives/index.tsx"() {
2057
- init_utils();
2058
- init_button();
2059
- init_badge();
2060
- init_button();
2061
- init_input();
2062
- init_checkbox();
2063
- init_card();
2064
- init_separator();
2065
- init_card();
2066
- init_table();
2067
- init_dropdown_menu();
2068
- init_dialog();
2069
- init_tabs();
2070
- init_breadcrumb();
2071
- init_keyboard();
2072
- init_pagination();
2073
- init_status_badge();
2074
- init_sidebar();
2075
- init_popover();
2076
- init_scroll_area();
2077
- init_calendar();
2078
- init_resizable();
2079
- init_slider();
2080
- init_switch();
2081
- init_tooltip();
2082
- init_select();
2083
- init_menubar();
2084
- init_navigation_menu();
2085
- init_toggle();
2086
- init_toggle_group();
2087
- init_combobox();
2088
- init_label();
2089
- Textarea = React11.forwardRef(
2090
- ({ className, ...props }, ref) => {
2091
- return /* @__PURE__ */ jsx(
2092
- "textarea",
2093
- {
2094
- className: cn(
2095
- "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",
2096
- className
2097
- ),
2098
- ref,
2099
- ...props
2100
- }
2101
- );
2102
- }
2103
- );
2104
- Textarea.displayName = "Textarea";
2105
- ButtonLoading = React11.forwardRef(({ className, isLoading, children, disabled, ...props }, ref) => {
2106
- return /* @__PURE__ */ jsxs(
2107
- Button,
2108
- {
2109
- className: cn("gap-2", className),
2110
- disabled: isLoading || disabled,
2111
- ref,
2112
- ...props,
2113
- children: [
2114
- isLoading && /* @__PURE__ */ jsx(Spinner, { size: "sm" }),
2115
- children
2116
- ]
2117
- }
2118
- );
2119
- });
2120
- ButtonLoading.displayName = "ButtonLoading";
2121
- }
2122
- });
2123
- function Alert({
2124
- className,
2125
- variant,
2126
- ...props
2127
- }) {
2128
- return /* @__PURE__ */ jsx(
2129
- "div",
2130
- {
2131
- "data-slot": "alert",
2132
- role: "alert",
2133
- className: cn(alertVariants({ variant }), className),
2134
- ...props
2135
- }
2136
- );
2137
- }
2138
- function AlertTitle({ className, ...props }) {
2139
- return /* @__PURE__ */ jsx(
2140
- "h5",
2141
- {
2142
- "data-slot": "alert-title",
2143
- className: cn("mb-1 font-medium leading-none tracking-tight", className),
2144
- ...props
2145
- }
2146
- );
2147
- }
2148
- function AlertDescription({
2149
- className,
2150
- ...props
2151
- }) {
2152
- return /* @__PURE__ */ jsx(
2153
- "div",
2154
- {
2155
- "data-slot": "alert-description",
2156
- className: cn("text-sm [&_p]:leading-relaxed", className),
2157
- ...props
2158
- }
2159
- );
2160
- }
2161
- var alertVariants;
2162
- var init_alert = __esm({
2163
- "src/ui/feedback/alert.tsx"() {
2164
- init_utils();
2165
- alertVariants = cva(
2166
- "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",
2167
- {
2168
- variants: {
2169
- variant: {
2170
- default: "bg-background text-foreground",
2171
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
2172
- }
2173
- },
2174
- defaultVariants: {
2175
- variant: "default"
2176
- }
2177
- }
2178
- );
2179
- }
2180
- });
2181
- function useErrorDialog() {
2182
- const context = useContext(ErrorDialogContext);
2183
- if (!context) {
2184
- throw new Error("useErrorDialog must be used within ErrorDialogProvider");
2185
- }
2186
- return context;
2187
- }
2188
- function ErrorDialogProvider({ children }) {
2189
- const [open, setOpen] = useState(false);
2190
- const [data, setData] = useState({});
2191
- const [expanded, setExpanded] = useState(false);
2192
- const [copied, setCopied] = useState(false);
2193
- useEffect(() => {
2194
- const unsubscribe = globalError.subscribe((errorData) => {
2195
- setData(errorData);
2196
- setOpen(true);
2197
- setExpanded(false);
2198
- setCopied(false);
2199
- });
2200
- return unsubscribe;
2201
- }, []);
2202
- const showError = useCallback((input) => {
2203
- let errorData = {};
2204
- if (input instanceof Error) {
2205
- errorData = {
2206
- title: input.name || "Error",
2207
- description: input.message,
2208
- trace: input.stack
2209
- };
2210
- } else if (typeof input === "string") {
2211
- errorData = {
2212
- title: "Error",
2213
- description: input
2214
- };
2215
- } else {
2216
- errorData = input;
2217
- }
2218
- setData(errorData);
2219
- setOpen(true);
2220
- setExpanded(false);
2221
- setCopied(false);
2222
- }, []);
2223
- const dismiss = useCallback(() => {
2224
- setOpen(false);
2225
- }, []);
2226
- const buildFullDiagnostic = useCallback(() => {
2227
- if (data.trace && data.trace.startsWith("=== Th\xF4ng tin l\u1ED7i")) {
2228
- return data.trace;
2229
- }
2230
- const parts = [
2231
- `=== Th\xF4ng tin l\u1ED7i ===`
2232
- ];
2233
- if (data.code) parts.push(`M\xE3 l\u1ED7i: ${data.code}`);
2234
- parts.push(`Th\u1EDDi gian: ${(/* @__PURE__ */ new Date()).toLocaleString("vi-VN", {
2235
- timeZone: "Asia/Ho_Chi_Minh",
2236
- day: "2-digit",
2237
- month: "2-digit",
2238
- year: "numeric",
2239
- hour: "2-digit",
2240
- minute: "2-digit",
2241
- second: "2-digit"
2242
- })}`);
2243
- if (data.title) parts.push(`L\u1ED7i: ${data.title}`);
2244
- if (data.description && typeof data.description === "string") {
2245
- parts.push(`M\xF4 t\u1EA3: ${data.description}`);
2246
- }
2247
- if (data.trace) {
2248
- parts.push(`
2249
- Chi ti\u1EBFt:
2250
- ${data.trace}`);
2251
- }
2252
- return parts.join("\n");
2253
- }, [data]);
2254
- const copyAll = useCallback(async () => {
2255
- const text = buildFullDiagnostic();
2256
- try {
2257
- await navigator.clipboard.writeText(text);
2258
- setCopied(true);
2259
- setTimeout(() => setCopied(false), 2e3);
2260
- } catch {
2261
- const textarea = document.createElement("textarea");
2262
- textarea.value = text;
2263
- textarea.style.position = "fixed";
2264
- textarea.style.opacity = "0";
2265
- document.body.appendChild(textarea);
2266
- textarea.select();
2267
- document.execCommand("copy");
2268
- document.body.removeChild(textarea);
2269
- setCopied(true);
2270
- setTimeout(() => setCopied(false), 2e3);
2271
- }
2272
- }, [buildFullDiagnostic]);
2273
- const copyTrace = () => {
2274
- if (data.trace) {
2275
- navigator.clipboard.writeText(data.trace);
2276
- }
2277
- };
2278
- return /* @__PURE__ */ jsxs(ErrorDialogContext.Provider, { value: { showError, dismiss }, children: [
2279
- children,
2280
- /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md md:max-w-xl sm:max-w-lg border-destructive/20", children: [
2281
- /* @__PURE__ */ jsxs(DialogHeader, { children: [
2282
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-destructive", children: [
2283
- /* @__PURE__ */ jsx("div", { className: "p-2 bg-destructive/10 rounded-full", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-6 w-6" }) }),
2284
- /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: data.title || "\u0110\xE3 x\u1EA3y ra l\u1ED7i" })
2285
- ] }),
2286
- /* @__PURE__ */ jsx(DialogDescription, { className: "text-base pt-2 text-foreground font-medium", children: data.description }),
2287
- data.code && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground font-mono mt-1", children: [
2288
- "M\xE3 l\u1ED7i: ",
2289
- data.code
2290
- ] })
2291
- ] }),
2292
- data.trace && /* @__PURE__ */ jsxs("div", { className: "mt-2 border rounded-md bg-muted/30 overflow-hidden", children: [
2293
- /* @__PURE__ */ jsx(
2294
- "button",
2295
- {
2296
- onClick: () => setExpanded(!expanded),
2297
- className: "w-full flex items-center justify-between p-2 text-sm font-medium hover:bg-muted/50 transition-colors",
2298
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
2299
- expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }),
2300
- /* @__PURE__ */ jsx("span", { children: "Chi ti\u1EBFt l\u1ED7i & Trace Log" })
2301
- ] })
2302
- }
2303
- ),
2304
- expanded && /* @__PURE__ */ jsxs("div", { className: "relative border-t bg-muted/50", children: [
2305
- /* @__PURE__ */ jsx(ScrollArea, { className: "h-[200px] w-full p-4", children: /* @__PURE__ */ jsx("pre", { className: "text-xs font-mono whitespace-pre-wrap break-all text-muted-foreground", children: data.trace }) }),
2306
- /* @__PURE__ */ jsx(
2307
- Button,
2308
- {
2309
- variant: "ghost",
2310
- size: "icon",
2311
- className: "absolute top-2 right-2 h-6 w-6",
2312
- onClick: copyTrace,
2313
- title: "Copy Trace Log",
2314
- children: /* @__PURE__ */ jsx(Copy, { className: "h-3 w-3" })
2315
- }
2316
- )
2317
- ] })
2318
- ] }),
2319
- /* @__PURE__ */ jsxs(DialogFooter, { className: "flex-row gap-2 sm:justify-between", children: [
2320
- /* @__PURE__ */ jsx(
2321
- Button,
2322
- {
2323
- variant: "outline",
2324
- size: "sm",
2325
- onClick: copyAll,
2326
- className: "gap-1.5 text-xs",
2327
- children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
2328
- /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-green-600" }),
2329
- "\u0110\xE3 sao ch\xE9p"
2330
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2331
- /* @__PURE__ */ jsx(ClipboardCopy, { className: "h-3.5 w-3.5" }),
2332
- "Sao ch\xE9p th\xF4ng tin l\u1ED7i"
2333
- ] })
2334
- }
2335
- ),
2336
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: dismiss, children: "\u0110\xF3ng" })
2337
- ] })
2338
- ] }) })
2339
- ] });
2340
- }
2341
- var GlobalErrorEmitter, globalError, ErrorDialogContext;
2342
- var init_error_dialog = __esm({
2343
- "src/ui/feedback/error-dialog.tsx"() {
2344
- "use client";
2345
- init_primitives();
2346
- GlobalErrorEmitter = class {
2347
- constructor() {
2348
- this.listeners = [];
2349
- }
2350
- subscribe(listener) {
2351
- this.listeners.push(listener);
2352
- return () => {
2353
- this.listeners = this.listeners.filter((l) => l !== listener);
2354
- };
2355
- }
2356
- emit(data) {
2357
- this.listeners.forEach((listener) => listener(data));
2358
- }
2359
- };
2360
- globalError = new GlobalErrorEmitter();
2361
- ErrorDialogContext = createContext(null);
2362
- }
2363
- });
2364
- function AlertDialog({
2365
- ...props
2366
- }) {
2367
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
2368
- }
2369
- function AlertDialogTrigger({
2370
- className,
2371
- ...props
2372
- }) {
2373
- return /* @__PURE__ */ jsx(
2374
- AlertDialogPrimitive.Trigger,
2375
- {
2376
- "data-slot": "alert-dialog-trigger",
2377
- className: cn("cursor-pointer", className),
2378
- ...props
2379
- }
2380
- );
2381
- }
2382
- function AlertDialogPortal({
2383
- ...props
2384
- }) {
2385
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
2386
- }
2387
- function AlertDialogOverlay({
2388
- className,
2389
- ...props
2390
- }) {
2391
- return /* @__PURE__ */ jsx(
2392
- AlertDialogPrimitive.Overlay,
2393
- {
2394
- "data-slot": "alert-dialog-overlay",
2395
- className: cn(
2396
- "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",
2397
- className
2398
- ),
2399
- ...props
2400
- }
2401
- );
2402
- }
2403
- function AlertDialogContent({
2404
- className,
2405
- ...props
2406
- }) {
2407
- return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
2408
- /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
2409
- /* @__PURE__ */ jsx(
2410
- AlertDialogPrimitive.Content,
2411
- {
2412
- "data-slot": "alert-dialog-content",
2413
- className: cn(
2414
- "fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] grid bg-background translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border 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 sm:max-w-lg",
2415
- className
2416
- ),
2417
- ...props
2418
- }
2419
- )
2420
- ] });
2421
- }
2422
- function AlertDialogHeader({
2423
- className,
2424
- ...props
2425
- }) {
2426
- return /* @__PURE__ */ jsx(
2427
- "div",
2428
- {
2429
- "data-slot": "alert-dialog-header",
2430
- className: cn(
2431
- "flex flex-col space-y-2 text-center sm:text-left",
2432
- className
2433
- ),
2434
- ...props
2435
- }
2436
- );
2437
- }
2438
- function AlertDialogFooter({
2439
- className,
2440
- ...props
2441
- }) {
2442
- return /* @__PURE__ */ jsx(
2443
- "div",
2444
- {
2445
- "data-slot": "alert-dialog-footer",
2446
- className: cn(
2447
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",
2448
- className
2449
- ),
2450
- ...props
2451
- }
2452
- );
2453
- }
2454
- function AlertDialogTitle({
2455
- className,
2456
- ...props
2457
- }) {
2458
- return /* @__PURE__ */ jsx(
2459
- AlertDialogPrimitive.Title,
2460
- {
2461
- "data-slot": "alert-dialog-title",
2462
- className: cn("text-lg font-semibold", className),
2463
- ...props
2464
- }
2465
- );
2466
- }
2467
- function AlertDialogDescription({
2468
- className,
2469
- ...props
2470
- }) {
2471
- return /* @__PURE__ */ jsx(
2472
- AlertDialogPrimitive.Description,
2473
- {
2474
- "data-slot": "alert-dialog-description",
2475
- className: cn("text-sm text-muted-foreground", className),
2476
- ...props
2477
- }
2478
- );
2479
- }
2480
- function AlertDialogAction({
2481
- className,
2482
- ...props
2483
- }) {
2484
- return /* @__PURE__ */ jsx(
2485
- AlertDialogPrimitive.Action,
2486
- {
2487
- className: cn(buttonVariants(), className),
2488
- ...props
2489
- }
2490
- );
2491
- }
2492
- function AlertDialogCancel({
2493
- className,
2494
- ...props
2495
- }) {
2496
- return /* @__PURE__ */ jsx(
2497
- AlertDialogPrimitive.Cancel,
2498
- {
2499
- className: cn(
2500
- buttonVariants({ variant: "outline" }),
2501
- "mt-2 sm:mt-0",
2502
- className
2503
- ),
2504
- ...props
2505
- }
2506
- );
2507
- }
2508
- var init_feedback = __esm({
2509
- "src/ui/feedback/index.tsx"() {
2510
- init_primitives();
2511
- init_utils();
2512
- init_primitives();
2513
- init_progress();
2514
- init_sheet();
2515
- init_alert();
2516
- init_context_menu();
2517
- init_drawer();
2518
- init_sonner();
2519
- init_error_dialog();
2520
- }
2521
- });
2522
- init_feedback();
2523
-
2524
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, ErrorDialogProvider, Progress, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Toaster, alertVariants, globalError, sheetVariants, useErrorDialog };
2525
- //# sourceMappingURL=feedback.mjs.map
2526
- //# sourceMappingURL=feedback.mjs.map