@amazecontinuityprojects/amazeui 1.0.0 → 1.1.0
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.
- package/dist/index.d.mts +81 -36
- package/dist/index.d.ts +81 -36
- package/dist/index.js +402 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +385 -154
- package/dist/index.mjs.map +1 -1
- package/dist/tailwind.css +239 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -56,6 +57,13 @@ __export(index_exports, {
|
|
|
56
57
|
PopoverContent: () => PopoverContent,
|
|
57
58
|
PopoverTrigger: () => PopoverTrigger,
|
|
58
59
|
Progress: () => Progress,
|
|
60
|
+
Sidebar: () => Sidebar,
|
|
61
|
+
SidebarContent: () => SidebarContent,
|
|
62
|
+
SidebarFooter: () => SidebarFooter,
|
|
63
|
+
SidebarGroup: () => SidebarGroup,
|
|
64
|
+
SidebarGroupLabel: () => SidebarGroupLabel,
|
|
65
|
+
SidebarHeader: () => SidebarHeader,
|
|
66
|
+
SidebarItem: () => SidebarItem,
|
|
59
67
|
Skeleton: () => Skeleton,
|
|
60
68
|
Switch: () => Switch,
|
|
61
69
|
Table: () => Table,
|
|
@@ -68,16 +76,18 @@ __export(index_exports, {
|
|
|
68
76
|
TabsContent: () => TabsContent,
|
|
69
77
|
TabsList: () => TabsList,
|
|
70
78
|
TabsTrigger: () => TabsTrigger,
|
|
79
|
+
ThemeProvider: () => ThemeProvider,
|
|
71
80
|
buttonTextVariants: () => buttonTextVariants,
|
|
72
81
|
buttonVariants: () => buttonVariants,
|
|
73
|
-
cn: () => cn
|
|
82
|
+
cn: () => cn,
|
|
83
|
+
useSidebar: () => useSidebar,
|
|
84
|
+
useTheme: () => import_next_themes2.useTheme
|
|
74
85
|
});
|
|
75
86
|
module.exports = __toCommonJS(index_exports);
|
|
76
87
|
|
|
77
|
-
// src/
|
|
88
|
+
// src/lib/primitives.tsx
|
|
78
89
|
var React = __toESM(require("react"));
|
|
79
90
|
var import_react_native = require("react-native");
|
|
80
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
81
91
|
|
|
82
92
|
// src/lib/utils.ts
|
|
83
93
|
var import_clsx = require("clsx");
|
|
@@ -86,8 +96,48 @@ function cn(...inputs) {
|
|
|
86
96
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
87
97
|
}
|
|
88
98
|
|
|
89
|
-
// src/
|
|
99
|
+
// src/lib/primitives.tsx
|
|
90
100
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
101
|
+
var View = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
102
|
+
if (import_react_native.Platform.OS === "web") {
|
|
103
|
+
const C = "div";
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, className: cn("flex flex-col items-stretch justify-start min-w-0 min-h-0 relative", className), style, ...props });
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { ref, className, style, ...props });
|
|
107
|
+
});
|
|
108
|
+
View.displayName = "View";
|
|
109
|
+
var Text = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
110
|
+
if (import_react_native.Platform.OS === "web") {
|
|
111
|
+
const C = "span";
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, className: cn("inline m-0 p-0", className), style, ...props });
|
|
113
|
+
}
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { ref, className, style, ...props });
|
|
115
|
+
});
|
|
116
|
+
Text.displayName = "Text";
|
|
117
|
+
var Pressable = React.forwardRef(({ className, style, onPress, onClick, ...props }, ref) => {
|
|
118
|
+
if (import_react_native.Platform.OS === "web") {
|
|
119
|
+
const C = "button";
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, type: "button", onClick: onPress || onClick, className: cn("flex flex-col items-stretch justify-start bg-transparent border-none p-0 m-0 cursor-pointer outline-none relative", className), style, ...props });
|
|
121
|
+
}
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, { ref, onPress: onPress || onClick, className, style, ...props });
|
|
123
|
+
});
|
|
124
|
+
Pressable.displayName = "Pressable";
|
|
125
|
+
var TextInput = React.forwardRef(({ className, style, onChangeText, onChange, value, ...props }, ref) => {
|
|
126
|
+
if (import_react_native.Platform.OS === "web") {
|
|
127
|
+
const C = "input";
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, value, onChange: (e) => {
|
|
129
|
+
onChangeText == null ? void 0 : onChangeText(e.target.value);
|
|
130
|
+
onChange == null ? void 0 : onChange(e);
|
|
131
|
+
}, className, style: { ...style }, ...props });
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.TextInput, { ref, value, onChangeText, onChange, className, style, ...props });
|
|
134
|
+
});
|
|
135
|
+
TextInput.displayName = "TextInput";
|
|
136
|
+
|
|
137
|
+
// src/components/ui/button.tsx
|
|
138
|
+
var React2 = __toESM(require("react"));
|
|
139
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
140
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
91
141
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
92
142
|
"flex flex-row items-center justify-center gap-2 rounded-md font-medium transition-all",
|
|
93
143
|
{
|
|
@@ -131,15 +181,19 @@ var buttonTextVariants = (0, import_class_variance_authority.cva)(
|
|
|
131
181
|
}
|
|
132
182
|
}
|
|
133
183
|
);
|
|
134
|
-
var Button =
|
|
135
|
-
({ className, variant, size, children, textClassName, ...props }, ref) => {
|
|
136
|
-
return /* @__PURE__ */ (0,
|
|
137
|
-
|
|
184
|
+
var Button = React2.forwardRef(
|
|
185
|
+
({ className, variant, size, children, textClassName, onClick, onPress, ...props }, ref) => {
|
|
186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
187
|
+
Pressable,
|
|
138
188
|
{
|
|
189
|
+
onPress: onPress || onClick,
|
|
139
190
|
ref,
|
|
140
191
|
...{ className: cn(buttonVariants({ variant, size }), className) },
|
|
141
192
|
...props,
|
|
142
|
-
children:
|
|
193
|
+
children: React2.Children.map(
|
|
194
|
+
children,
|
|
195
|
+
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { ...{ className: cn(buttonTextVariants({ variant }), textClassName) }, children: child }) : child
|
|
196
|
+
)
|
|
143
197
|
}
|
|
144
198
|
);
|
|
145
199
|
}
|
|
@@ -147,23 +201,22 @@ var Button = React.forwardRef(
|
|
|
147
201
|
Button.displayName = "Button";
|
|
148
202
|
|
|
149
203
|
// src/components/ui/card.tsx
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
import_react_native2.View,
|
|
204
|
+
var React3 = __toESM(require("react"));
|
|
205
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
206
|
+
var Card = React3.forwardRef(
|
|
207
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
208
|
+
View,
|
|
156
209
|
{
|
|
157
210
|
ref,
|
|
158
|
-
...{ className: cn("rounded-xl border border-border bg-card shadow-sm", className) },
|
|
211
|
+
...{ className: cn("rounded-xl border border-border bg-card/60 backdrop-blur-xl shadow-sm dark:bg-card/40", className) },
|
|
159
212
|
...props
|
|
160
213
|
}
|
|
161
214
|
)
|
|
162
215
|
);
|
|
163
216
|
Card.displayName = "Card";
|
|
164
|
-
var CardHeader =
|
|
165
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
166
|
-
|
|
217
|
+
var CardHeader = React3.forwardRef(
|
|
218
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
219
|
+
View,
|
|
167
220
|
{
|
|
168
221
|
ref,
|
|
169
222
|
...{ className: cn("flex flex-col space-y-1.5 p-6", className) },
|
|
@@ -172,9 +225,9 @@ var CardHeader = React2.forwardRef(
|
|
|
172
225
|
)
|
|
173
226
|
);
|
|
174
227
|
CardHeader.displayName = "CardHeader";
|
|
175
|
-
var CardTitle =
|
|
176
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
177
|
-
|
|
228
|
+
var CardTitle = React3.forwardRef(
|
|
229
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
230
|
+
Text,
|
|
178
231
|
{
|
|
179
232
|
ref,
|
|
180
233
|
...{ className: cn("font-semibold text-lg leading-none tracking-tight text-foreground", className) },
|
|
@@ -183,9 +236,9 @@ var CardTitle = React2.forwardRef(
|
|
|
183
236
|
)
|
|
184
237
|
);
|
|
185
238
|
CardTitle.displayName = "CardTitle";
|
|
186
|
-
var CardDescription =
|
|
187
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
188
|
-
|
|
239
|
+
var CardDescription = React3.forwardRef(
|
|
240
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
241
|
+
Text,
|
|
189
242
|
{
|
|
190
243
|
ref,
|
|
191
244
|
...{ className: cn("text-sm text-muted-foreground", className) },
|
|
@@ -194,13 +247,13 @@ var CardDescription = React2.forwardRef(
|
|
|
194
247
|
)
|
|
195
248
|
);
|
|
196
249
|
CardDescription.displayName = "CardDescription";
|
|
197
|
-
var CardContent =
|
|
198
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
250
|
+
var CardContent = React3.forwardRef(
|
|
251
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(View, { ref, ...{ className: cn("p-6 pt-0", className) }, ...props })
|
|
199
252
|
);
|
|
200
253
|
CardContent.displayName = "CardContent";
|
|
201
|
-
var CardFooter =
|
|
202
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
203
|
-
|
|
254
|
+
var CardFooter = React3.forwardRef(
|
|
255
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
256
|
+
View,
|
|
204
257
|
{
|
|
205
258
|
ref,
|
|
206
259
|
...{ className: cn("flex flex-row items-center p-6 pt-0", className) },
|
|
@@ -211,13 +264,12 @@ var CardFooter = React2.forwardRef(
|
|
|
211
264
|
CardFooter.displayName = "CardFooter";
|
|
212
265
|
|
|
213
266
|
// src/components/ui/input.tsx
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var Input = React3.forwardRef(
|
|
267
|
+
var React4 = __toESM(require("react"));
|
|
268
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
269
|
+
var Input = React4.forwardRef(
|
|
218
270
|
({ className, ...props }, ref) => {
|
|
219
|
-
return /* @__PURE__ */ (0,
|
|
220
|
-
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
272
|
+
TextInput,
|
|
221
273
|
{
|
|
222
274
|
ref,
|
|
223
275
|
placeholderTextColor: "#a3a3a3",
|
|
@@ -230,10 +282,9 @@ var Input = React3.forwardRef(
|
|
|
230
282
|
Input.displayName = "Input";
|
|
231
283
|
|
|
232
284
|
// src/components/ui/label.tsx
|
|
233
|
-
var
|
|
234
|
-
var import_react_native4 = require("react-native");
|
|
285
|
+
var React5 = __toESM(require("react"));
|
|
235
286
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
236
|
-
var
|
|
287
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
237
288
|
var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
238
289
|
"text-sm font-medium leading-none text-foreground peer-disabled:opacity-70",
|
|
239
290
|
{
|
|
@@ -241,9 +292,9 @@ var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
|
241
292
|
defaultVariants: {}
|
|
242
293
|
}
|
|
243
294
|
);
|
|
244
|
-
var Label =
|
|
245
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
246
|
-
|
|
295
|
+
var Label = React5.forwardRef(
|
|
296
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
297
|
+
Text,
|
|
247
298
|
{
|
|
248
299
|
ref,
|
|
249
300
|
...{ className: cn(labelVariants(), className) },
|
|
@@ -254,11 +305,10 @@ var Label = React4.forwardRef(
|
|
|
254
305
|
Label.displayName = "Label";
|
|
255
306
|
|
|
256
307
|
// src/components/ui/skeleton.tsx
|
|
257
|
-
var
|
|
258
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
308
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
259
309
|
function Skeleton({ className, ...props }) {
|
|
260
|
-
return /* @__PURE__ */ (0,
|
|
261
|
-
|
|
310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
311
|
+
View,
|
|
262
312
|
{
|
|
263
313
|
...{ className: cn("animate-pulse rounded-md bg-primary/10", className) },
|
|
264
314
|
...props
|
|
@@ -267,14 +317,20 @@ function Skeleton({ className, ...props }) {
|
|
|
267
317
|
}
|
|
268
318
|
|
|
269
319
|
// src/components/ui/switch.tsx
|
|
270
|
-
var
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
var Switch =
|
|
274
|
-
({ className, ...props }, ref) => {
|
|
275
|
-
return /* @__PURE__ */ (0,
|
|
276
|
-
|
|
320
|
+
var React6 = __toESM(require("react"));
|
|
321
|
+
var import_react_native2 = require("react-native");
|
|
322
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
323
|
+
var Switch = React6.forwardRef(
|
|
324
|
+
({ className, onCheckedChange, onChange, onValueChange, checked, value, ...props }, ref) => {
|
|
325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
326
|
+
import_react_native2.Switch,
|
|
277
327
|
{
|
|
328
|
+
value: checked !== void 0 ? checked : value,
|
|
329
|
+
onValueChange: (val) => {
|
|
330
|
+
onValueChange == null ? void 0 : onValueChange(val);
|
|
331
|
+
onCheckedChange == null ? void 0 : onCheckedChange(val);
|
|
332
|
+
onChange == null ? void 0 : onChange(val);
|
|
333
|
+
},
|
|
278
334
|
ref,
|
|
279
335
|
...props
|
|
280
336
|
}
|
|
@@ -284,20 +340,19 @@ var Switch = React5.forwardRef(
|
|
|
284
340
|
Switch.displayName = "Switch";
|
|
285
341
|
|
|
286
342
|
// src/components/ui/progress.tsx
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
var Progress = React6.forwardRef(
|
|
343
|
+
var React7 = __toESM(require("react"));
|
|
344
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
345
|
+
var Progress = React7.forwardRef(
|
|
291
346
|
({ className, value = 0, ...props }, ref) => {
|
|
292
347
|
const boundedValue = Math.min(100, Math.max(0, value || 0));
|
|
293
|
-
return /* @__PURE__ */ (0,
|
|
294
|
-
|
|
348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
349
|
+
View,
|
|
295
350
|
{
|
|
296
351
|
ref,
|
|
297
352
|
...{ className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className) },
|
|
298
353
|
...props,
|
|
299
|
-
children: /* @__PURE__ */ (0,
|
|
300
|
-
|
|
354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
355
|
+
View,
|
|
301
356
|
{
|
|
302
357
|
...{ className: "h-full bg-primary flex-1 transition-all" },
|
|
303
358
|
style: { width: `${boundedValue}%` }
|
|
@@ -310,32 +365,31 @@ var Progress = React6.forwardRef(
|
|
|
310
365
|
Progress.displayName = "Progress";
|
|
311
366
|
|
|
312
367
|
// src/components/ui/tabs.tsx
|
|
313
|
-
var
|
|
314
|
-
var
|
|
315
|
-
var
|
|
316
|
-
var TabsContext = React7.createContext(null);
|
|
368
|
+
var React8 = __toESM(require("react"));
|
|
369
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
370
|
+
var TabsContext = React8.createContext(null);
|
|
317
371
|
function Tabs({ value: controlledValue, defaultValue, onValueChange, className, children, ...props }) {
|
|
318
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
372
|
+
const [uncontrolledValue, setUncontrolledValue] = React8.useState(defaultValue || "");
|
|
319
373
|
const value = controlledValue !== void 0 ? controlledValue : uncontrolledValue;
|
|
320
|
-
const handleValueChange =
|
|
374
|
+
const handleValueChange = React8.useCallback(
|
|
321
375
|
(newValue) => {
|
|
322
376
|
setUncontrolledValue(newValue);
|
|
323
377
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
324
378
|
},
|
|
325
379
|
[onValueChange]
|
|
326
380
|
);
|
|
327
|
-
return /* @__PURE__ */ (0,
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TabsContext.Provider, { value: { value, onValueChange: handleValueChange }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(View, { ...{ className }, ...props, children }) });
|
|
328
382
|
}
|
|
329
383
|
function useTabsContext() {
|
|
330
|
-
const context =
|
|
384
|
+
const context = React8.useContext(TabsContext);
|
|
331
385
|
if (!context) {
|
|
332
386
|
throw new Error("Tabs compound components must be rendered within the Tabs component");
|
|
333
387
|
}
|
|
334
388
|
return context;
|
|
335
389
|
}
|
|
336
|
-
var TabsList =
|
|
337
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
338
|
-
|
|
390
|
+
var TabsList = React8.forwardRef(
|
|
391
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
392
|
+
View,
|
|
339
393
|
{
|
|
340
394
|
ref,
|
|
341
395
|
...{ className: cn("flex-row items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className) },
|
|
@@ -344,12 +398,12 @@ var TabsList = React7.forwardRef(
|
|
|
344
398
|
)
|
|
345
399
|
);
|
|
346
400
|
TabsList.displayName = "TabsList";
|
|
347
|
-
var TabsTrigger =
|
|
401
|
+
var TabsTrigger = React8.forwardRef(
|
|
348
402
|
({ className, textClassName, value, children, ...props }, ref) => {
|
|
349
403
|
const context = useTabsContext();
|
|
350
404
|
const isSelected = context.value === value;
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
352
|
-
|
|
405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
406
|
+
Pressable,
|
|
353
407
|
{
|
|
354
408
|
ref,
|
|
355
409
|
onPress: () => context.onValueChange(value),
|
|
@@ -359,20 +413,20 @@ var TabsTrigger = React7.forwardRef(
|
|
|
359
413
|
className
|
|
360
414
|
) },
|
|
361
415
|
...props,
|
|
362
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
416
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { ...{ className: cn("text-sm font-medium transition-all", isSelected ? "text-foreground" : "text-muted-foreground", textClassName) }, children }) : children
|
|
363
417
|
}
|
|
364
418
|
);
|
|
365
419
|
}
|
|
366
420
|
);
|
|
367
421
|
TabsTrigger.displayName = "TabsTrigger";
|
|
368
|
-
var TabsContent =
|
|
422
|
+
var TabsContent = React8.forwardRef(
|
|
369
423
|
({ className, value, children, ...props }, ref) => {
|
|
370
424
|
const context = useTabsContext();
|
|
371
425
|
if (context.value !== value) {
|
|
372
426
|
return null;
|
|
373
427
|
}
|
|
374
|
-
return /* @__PURE__ */ (0,
|
|
375
|
-
|
|
428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
429
|
+
View,
|
|
376
430
|
{
|
|
377
431
|
ref,
|
|
378
432
|
...{ className: cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className) },
|
|
@@ -385,12 +439,11 @@ var TabsContent = React7.forwardRef(
|
|
|
385
439
|
TabsContent.displayName = "TabsContent";
|
|
386
440
|
|
|
387
441
|
// src/components/ui/table.tsx
|
|
388
|
-
var
|
|
389
|
-
var
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
import_react_native9.View,
|
|
442
|
+
var React9 = __toESM(require("react"));
|
|
443
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
444
|
+
var Table = React9.forwardRef(
|
|
445
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(View, { ...{ className: "w-full overflow-hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
446
|
+
View,
|
|
394
447
|
{
|
|
395
448
|
ref,
|
|
396
449
|
...{ className: cn("w-full text-sm", className) },
|
|
@@ -399,13 +452,13 @@ var Table = React8.forwardRef(
|
|
|
399
452
|
) })
|
|
400
453
|
);
|
|
401
454
|
Table.displayName = "Table";
|
|
402
|
-
var TableHeader =
|
|
403
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
455
|
+
var TableHeader = React9.forwardRef(
|
|
456
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(View, { ref, ...{ className: cn("flex flex-row items-center border-b border-border bg-muted/50", className) }, ...props })
|
|
404
457
|
);
|
|
405
458
|
TableHeader.displayName = "TableHeader";
|
|
406
|
-
var TableBody =
|
|
407
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
408
|
-
|
|
459
|
+
var TableBody = React9.forwardRef(
|
|
460
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
461
|
+
View,
|
|
409
462
|
{
|
|
410
463
|
ref,
|
|
411
464
|
...{ className: cn("flex flex-col [&_>_view:last-child]:border-0", className) },
|
|
@@ -414,9 +467,9 @@ var TableBody = React8.forwardRef(
|
|
|
414
467
|
)
|
|
415
468
|
);
|
|
416
469
|
TableBody.displayName = "TableBody";
|
|
417
|
-
var TableRow =
|
|
418
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
419
|
-
|
|
470
|
+
var TableRow = React9.forwardRef(
|
|
471
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
472
|
+
View,
|
|
420
473
|
{
|
|
421
474
|
ref,
|
|
422
475
|
...{ className: cn(
|
|
@@ -428,9 +481,9 @@ var TableRow = React8.forwardRef(
|
|
|
428
481
|
)
|
|
429
482
|
);
|
|
430
483
|
TableRow.displayName = "TableRow";
|
|
431
|
-
var TableHead =
|
|
432
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
433
|
-
|
|
484
|
+
var TableHead = React9.forwardRef(
|
|
485
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
486
|
+
View,
|
|
434
487
|
{
|
|
435
488
|
ref,
|
|
436
489
|
...{ className: cn(
|
|
@@ -438,66 +491,68 @@ var TableHead = React8.forwardRef(
|
|
|
438
491
|
className
|
|
439
492
|
) },
|
|
440
493
|
...props,
|
|
441
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
494
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { ...{ className: "font-semibold text-muted-foreground text-sm" }, children }) : children
|
|
442
495
|
}
|
|
443
496
|
)
|
|
444
497
|
);
|
|
445
498
|
TableHead.displayName = "TableHead";
|
|
446
|
-
var TableCell =
|
|
447
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
448
|
-
|
|
499
|
+
var TableCell = React9.forwardRef(
|
|
500
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
501
|
+
View,
|
|
449
502
|
{
|
|
450
503
|
ref,
|
|
451
504
|
...{ className: cn("p-4 align-middle", className) },
|
|
452
505
|
...props,
|
|
453
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
506
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { ...{ className: "text-foreground text-sm" }, children }) : children
|
|
454
507
|
}
|
|
455
508
|
)
|
|
456
509
|
);
|
|
457
510
|
TableCell.displayName = "TableCell";
|
|
458
511
|
|
|
459
512
|
// src/components/ui/dialog.tsx
|
|
460
|
-
var
|
|
461
|
-
var
|
|
462
|
-
var
|
|
463
|
-
var DialogContext =
|
|
513
|
+
var React10 = __toESM(require("react"));
|
|
514
|
+
var import_react_native3 = require("react-native");
|
|
515
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
516
|
+
var DialogContext = React10.createContext(null);
|
|
464
517
|
function useDialog() {
|
|
465
|
-
const context =
|
|
518
|
+
const context = React10.useContext(DialogContext);
|
|
466
519
|
if (!context) throw new Error("Dialog components must be used within a Dialog");
|
|
467
520
|
return context;
|
|
468
521
|
}
|
|
469
522
|
function Dialog({ open = false, onOpenChange, children, ...props }) {
|
|
470
|
-
const [isOpen, setIsOpen] =
|
|
523
|
+
const [isOpen, setIsOpen] = React10.useState(open);
|
|
471
524
|
const isControlled = onOpenChange !== void 0;
|
|
472
525
|
const currentOpen = isControlled ? open : isOpen;
|
|
473
|
-
const setCurrentOpen =
|
|
526
|
+
const setCurrentOpen = React10.useCallback((val) => {
|
|
474
527
|
if (!isControlled) setIsOpen(val);
|
|
475
528
|
onOpenChange == null ? void 0 : onOpenChange(val);
|
|
476
529
|
}, [isControlled, onOpenChange]);
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogContext.Provider, { value: { open: currentOpen, onOpenChange: setCurrentOpen }, children });
|
|
478
531
|
}
|
|
479
|
-
var DialogTrigger =
|
|
532
|
+
var DialogTrigger = React10.forwardRef(
|
|
480
533
|
({ onPress, children, ...props }, ref) => {
|
|
481
534
|
const { onOpenChange } = useDialog();
|
|
482
|
-
return /* @__PURE__ */ (0,
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Pressable, { ref, onPress: (e) => {
|
|
536
|
+
var _a;
|
|
483
537
|
onOpenChange(true);
|
|
484
538
|
onPress == null ? void 0 : onPress(e);
|
|
539
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
485
540
|
}, ...props, children });
|
|
486
541
|
}
|
|
487
542
|
);
|
|
488
543
|
DialogTrigger.displayName = "DialogTrigger";
|
|
489
|
-
var DialogContent =
|
|
544
|
+
var DialogContent = React10.forwardRef(
|
|
490
545
|
({ className, children, ...props }, ref) => {
|
|
491
546
|
const { open, onOpenChange } = useDialog();
|
|
492
|
-
return /* @__PURE__ */ (0,
|
|
493
|
-
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
548
|
+
import_react_native3.Modal,
|
|
494
549
|
{
|
|
495
550
|
visible: open,
|
|
496
551
|
transparent: true,
|
|
497
552
|
animationType: "fade",
|
|
498
553
|
onRequestClose: () => onOpenChange(false),
|
|
499
|
-
children: /* @__PURE__ */ (0,
|
|
500
|
-
|
|
554
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(View, { ...{ className: "flex-1 items-center justify-center bg-black/80" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
555
|
+
View,
|
|
501
556
|
{
|
|
502
557
|
ref,
|
|
503
558
|
...{ className: cn("w-full max-w-lg rounded-xl border border-border bg-background p-6 shadow-lg sm:rounded-[1rem]", className) },
|
|
@@ -510,49 +565,51 @@ var DialogContent = React9.forwardRef(
|
|
|
510
565
|
}
|
|
511
566
|
);
|
|
512
567
|
DialogContent.displayName = "DialogContent";
|
|
513
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
568
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(View, { ...{ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className) }, ...props });
|
|
514
569
|
DialogHeader.displayName = "DialogHeader";
|
|
515
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
570
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(View, { ...{ className: cn("flex flex-row flex-wrap items-center justify-end space-x-2 mt-4", className) }, ...props });
|
|
516
571
|
DialogFooter.displayName = "DialogFooter";
|
|
517
|
-
var DialogTitle =
|
|
518
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
572
|
+
var DialogTitle = React10.forwardRef(
|
|
573
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { ref, ...{ className: cn("text-lg font-semibold leading-none tracking-tight text-foreground", className) }, ...props })
|
|
519
574
|
);
|
|
520
575
|
DialogTitle.displayName = "DialogTitle";
|
|
521
|
-
var DialogDescription =
|
|
522
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
576
|
+
var DialogDescription = React10.forwardRef(
|
|
577
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { ref, ...{ className: cn("text-sm text-muted-foreground", className) }, ...props })
|
|
523
578
|
);
|
|
524
579
|
DialogDescription.displayName = "DialogDescription";
|
|
525
580
|
|
|
526
581
|
// src/components/ui/dropdown-menu.tsx
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
530
|
-
var DropdownContext =
|
|
582
|
+
var React11 = __toESM(require("react"));
|
|
583
|
+
var import_react_native4 = require("react-native");
|
|
584
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
585
|
+
var DropdownContext = React11.createContext(null);
|
|
531
586
|
function DropdownMenu({ children }) {
|
|
532
|
-
const [open, setOpen] =
|
|
533
|
-
return /* @__PURE__ */ (0,
|
|
587
|
+
const [open, setOpen] = React11.useState(false);
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View, { ...{ className: "relative" }, children }) });
|
|
534
589
|
}
|
|
535
|
-
var DropdownMenuTrigger =
|
|
590
|
+
var DropdownMenuTrigger = React11.forwardRef(
|
|
536
591
|
({ onPress, children, ...props }, ref) => {
|
|
537
|
-
const context =
|
|
538
|
-
return /* @__PURE__ */ (0,
|
|
592
|
+
const context = React11.useContext(DropdownContext);
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Pressable, { ref, onPress: (e) => {
|
|
594
|
+
var _a;
|
|
539
595
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
540
596
|
onPress == null ? void 0 : onPress(e);
|
|
597
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
541
598
|
}, ...props, children });
|
|
542
599
|
}
|
|
543
600
|
);
|
|
544
601
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
545
|
-
var DropdownMenuContent =
|
|
602
|
+
var DropdownMenuContent = React11.forwardRef(
|
|
546
603
|
({ className, children, ...props }, ref) => {
|
|
547
|
-
const context =
|
|
604
|
+
const context = React11.useContext(DropdownContext);
|
|
548
605
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
549
|
-
return /* @__PURE__ */ (0,
|
|
550
|
-
|
|
606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native4.Modal, { visible: context.open, transparent: true, animationType: "fade", onRequestClose: () => context.setOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
607
|
+
Pressable,
|
|
551
608
|
{
|
|
552
609
|
onPress: () => context.setOpen(false),
|
|
553
610
|
...{ className: "flex-1 bg-black/10 justify-end sm:justify-center items-center" },
|
|
554
|
-
children: /* @__PURE__ */ (0,
|
|
555
|
-
|
|
611
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
612
|
+
View,
|
|
556
613
|
{
|
|
557
614
|
ref,
|
|
558
615
|
...{ className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 zoom-in-95", className) },
|
|
@@ -565,64 +622,68 @@ var DropdownMenuContent = React10.forwardRef(
|
|
|
565
622
|
}
|
|
566
623
|
);
|
|
567
624
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
568
|
-
var DropdownMenuItem =
|
|
625
|
+
var DropdownMenuItem = React11.forwardRef(
|
|
569
626
|
({ className, textClassName, onPress, children, ...props }, ref) => {
|
|
570
|
-
const context =
|
|
571
|
-
return /* @__PURE__ */ (0,
|
|
572
|
-
|
|
627
|
+
const context = React11.useContext(DropdownContext);
|
|
628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
629
|
+
Pressable,
|
|
573
630
|
{
|
|
574
631
|
ref,
|
|
575
632
|
onPress: (e) => {
|
|
633
|
+
var _a;
|
|
576
634
|
context == null ? void 0 : context.setOpen(false);
|
|
577
635
|
onPress == null ? void 0 : onPress(e);
|
|
636
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
578
637
|
},
|
|
579
638
|
...{ className: cn("relative flex-row items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent", className) },
|
|
580
639
|
...props,
|
|
581
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
640
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { ...{ className: cn("text-foreground", textClassName) }, children }) : children
|
|
582
641
|
}
|
|
583
642
|
);
|
|
584
643
|
}
|
|
585
644
|
);
|
|
586
645
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
587
|
-
var DropdownMenuLabel =
|
|
588
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
646
|
+
var DropdownMenuLabel = React11.forwardRef(
|
|
647
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { ref, ...{ className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", className) }, ...props })
|
|
589
648
|
);
|
|
590
649
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
591
|
-
var DropdownMenuSeparator =
|
|
592
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
650
|
+
var DropdownMenuSeparator = React11.forwardRef(
|
|
651
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View, { ref, ...{ className: cn("-mx-1 my-1 h-px bg-muted", className) }, ...props })
|
|
593
652
|
);
|
|
594
653
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
595
654
|
|
|
596
655
|
// src/components/ui/popover.tsx
|
|
597
|
-
var
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var PopoverContext =
|
|
656
|
+
var React12 = __toESM(require("react"));
|
|
657
|
+
var import_react_native5 = require("react-native");
|
|
658
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
659
|
+
var PopoverContext = React12.createContext(null);
|
|
601
660
|
function Popover({ children }) {
|
|
602
|
-
const [open, setOpen] =
|
|
603
|
-
return /* @__PURE__ */ (0,
|
|
661
|
+
const [open, setOpen] = React12.useState(false);
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(View, { ...{ className: "relative" }, children }) });
|
|
604
663
|
}
|
|
605
|
-
var PopoverTrigger =
|
|
664
|
+
var PopoverTrigger = React12.forwardRef(
|
|
606
665
|
({ onPress, children, ...props }, ref) => {
|
|
607
|
-
const context =
|
|
608
|
-
return /* @__PURE__ */ (0,
|
|
666
|
+
const context = React12.useContext(PopoverContext);
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pressable, { ref, onPress: (e) => {
|
|
668
|
+
var _a;
|
|
609
669
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
610
670
|
onPress == null ? void 0 : onPress(e);
|
|
671
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
611
672
|
}, ...props, children });
|
|
612
673
|
}
|
|
613
674
|
);
|
|
614
675
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
615
|
-
var PopoverContent =
|
|
676
|
+
var PopoverContent = React12.forwardRef(
|
|
616
677
|
({ className, children, ...props }, ref) => {
|
|
617
|
-
const context =
|
|
678
|
+
const context = React12.useContext(PopoverContext);
|
|
618
679
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
619
|
-
return /* @__PURE__ */ (0,
|
|
620
|
-
|
|
680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native5.Modal, { visible: context.open, transparent: true, animationType: "fade", onRequestClose: () => context.setOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
681
|
+
Pressable,
|
|
621
682
|
{
|
|
622
683
|
onPress: () => context.setOpen(false),
|
|
623
684
|
...{ className: "flex-1 bg-transparent justify-center items-center" },
|
|
624
|
-
children: /* @__PURE__ */ (0,
|
|
625
|
-
|
|
685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
686
|
+
View,
|
|
626
687
|
{
|
|
627
688
|
ref,
|
|
628
689
|
...{ className: cn("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none", className) },
|
|
@@ -635,6 +696,175 @@ var PopoverContent = React11.forwardRef(
|
|
|
635
696
|
}
|
|
636
697
|
);
|
|
637
698
|
PopoverContent.displayName = "PopoverContent";
|
|
699
|
+
|
|
700
|
+
// src/components/ui/sidebar.tsx
|
|
701
|
+
var React13 = __toESM(require("react"));
|
|
702
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
703
|
+
var SidebarContext = React13.createContext(null);
|
|
704
|
+
function useSidebar() {
|
|
705
|
+
const context = React13.useContext(SidebarContext);
|
|
706
|
+
if (!context) {
|
|
707
|
+
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
708
|
+
}
|
|
709
|
+
return context;
|
|
710
|
+
}
|
|
711
|
+
var Sidebar = React13.forwardRef(
|
|
712
|
+
({ className, isOpen = true, onOpenChange, side = "left", children, ...props }, ref) => {
|
|
713
|
+
const [internalOpen, setInternalOpen] = React13.useState(isOpen);
|
|
714
|
+
const isControlled = onOpenChange !== void 0;
|
|
715
|
+
const openState = isControlled ? isOpen : internalOpen;
|
|
716
|
+
const handleToggle = React13.useCallback((open) => {
|
|
717
|
+
if (isControlled) {
|
|
718
|
+
onOpenChange(open);
|
|
719
|
+
} else {
|
|
720
|
+
setInternalOpen(open);
|
|
721
|
+
}
|
|
722
|
+
}, [isControlled, onOpenChange]);
|
|
723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SidebarContext.Provider, { value: { isOpen: openState, setIsOpen: handleToggle }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
724
|
+
"aside",
|
|
725
|
+
{
|
|
726
|
+
ref,
|
|
727
|
+
"data-state": openState ? "expanded" : "collapsed",
|
|
728
|
+
className: cn(
|
|
729
|
+
"fixed top-4 z-50 hidden h-[calc(100vh-2rem)] flex-col rounded-[24px] border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-lg dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)] transition-all duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)] md:flex",
|
|
730
|
+
openState ? "overflow-hidden w-[280px]" : "overflow-visible w-[72px]",
|
|
731
|
+
side === "left" ? "left-4" : "right-4",
|
|
732
|
+
className
|
|
733
|
+
),
|
|
734
|
+
...props,
|
|
735
|
+
children
|
|
736
|
+
}
|
|
737
|
+
) });
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
Sidebar.displayName = "Sidebar";
|
|
741
|
+
var SidebarHeader = React13.forwardRef(
|
|
742
|
+
({ className, ...props }, ref) => {
|
|
743
|
+
const { isOpen } = useSidebar();
|
|
744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
ref,
|
|
748
|
+
className: cn(
|
|
749
|
+
"flex flex-col border-b border-sidebar-border shrink-0",
|
|
750
|
+
isOpen ? "px-4 pb-4 pt-5" : "px-3.5 py-4",
|
|
751
|
+
className
|
|
752
|
+
),
|
|
753
|
+
...props
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
);
|
|
758
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
759
|
+
var SidebarContent = React13.forwardRef(
|
|
760
|
+
({ className, ...props }, ref) => {
|
|
761
|
+
const { isOpen } = useSidebar();
|
|
762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
763
|
+
"div",
|
|
764
|
+
{
|
|
765
|
+
ref,
|
|
766
|
+
style: { overflowY: "auto", overflowX: "hidden" },
|
|
767
|
+
className: cn(
|
|
768
|
+
"min-h-0 flex-1",
|
|
769
|
+
isOpen ? "px-3 py-4" : "px-2 py-4 items-center",
|
|
770
|
+
className
|
|
771
|
+
),
|
|
772
|
+
...props
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
);
|
|
777
|
+
SidebarContent.displayName = "SidebarContent";
|
|
778
|
+
var SidebarGroup = React13.forwardRef(
|
|
779
|
+
({ className, ...props }, ref) => {
|
|
780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
781
|
+
"div",
|
|
782
|
+
{
|
|
783
|
+
ref,
|
|
784
|
+
className: cn("flex flex-col gap-1 w-full", className),
|
|
785
|
+
...props
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
791
|
+
var SidebarGroupLabel = React13.forwardRef(
|
|
792
|
+
({ className, ...props }, ref) => {
|
|
793
|
+
const { isOpen } = useSidebar();
|
|
794
|
+
if (!isOpen) return null;
|
|
795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
796
|
+
"div",
|
|
797
|
+
{
|
|
798
|
+
ref,
|
|
799
|
+
className: cn("px-3 mb-1 mt-4 text-[10px] font-bold uppercase tracking-[0.1em] text-sidebar-foreground/50", className),
|
|
800
|
+
...props
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
);
|
|
805
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
806
|
+
var SidebarItem = React13.forwardRef(
|
|
807
|
+
({ className, icon, isActive, label, rightElement, ...props }, ref) => {
|
|
808
|
+
const { isOpen } = useSidebar();
|
|
809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
810
|
+
"button",
|
|
811
|
+
{
|
|
812
|
+
ref,
|
|
813
|
+
"data-active": isActive,
|
|
814
|
+
className: cn(
|
|
815
|
+
"group relative flex items-center rounded-xl transition-all duration-150 w-full hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
816
|
+
isOpen ? "gap-3 px-3 py-2 justify-start text-sm" : "justify-center p-3 h-11 w-11 mt-1",
|
|
817
|
+
isActive ? "bg-sidebar-accent border border-sidebar-border text-info font-semibold shadow-sm" : "text-sidebar-foreground/70 border border-transparent",
|
|
818
|
+
className
|
|
819
|
+
),
|
|
820
|
+
...props,
|
|
821
|
+
children: [
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("shrink-0", isActive ? "text-info" : "text-sidebar-foreground/60 group-hover:text-sidebar-foreground"), children: icon }),
|
|
823
|
+
isOpen && label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: cn("truncate flex-1 text-left", isActive ? "font-semibold" : "font-medium"), children: label }),
|
|
824
|
+
isOpen && rightElement && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "shrink-0", children: rightElement }),
|
|
825
|
+
!isOpen && label && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "absolute left-full ml-4 hidden group-hover:block z-50 px-3 py-1.5 rounded-lg bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 text-xs font-medium whitespace-nowrap shadow-xl", children: [
|
|
826
|
+
label,
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "absolute left-0 top-1/2 -translate-x-1 -translate-y-1/2 w-2 h-2 bg-gray-900 dark:bg-gray-100 rotate-45" })
|
|
828
|
+
] })
|
|
829
|
+
]
|
|
830
|
+
}
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
SidebarItem.displayName = "SidebarItem";
|
|
835
|
+
var SidebarFooter = React13.forwardRef(
|
|
836
|
+
({ className, ...props }, ref) => {
|
|
837
|
+
const { isOpen } = useSidebar();
|
|
838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
839
|
+
"div",
|
|
840
|
+
{
|
|
841
|
+
ref,
|
|
842
|
+
className: cn(
|
|
843
|
+
"shrink-0 border-t border-sidebar-border bg-sidebar-accent/30 backdrop-blur-md",
|
|
844
|
+
isOpen ? "p-4" : "p-3 flex justify-center",
|
|
845
|
+
className
|
|
846
|
+
),
|
|
847
|
+
...props
|
|
848
|
+
}
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
);
|
|
852
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
853
|
+
|
|
854
|
+
// src/components/ui/theme-provider.tsx
|
|
855
|
+
var React14 = __toESM(require("react"));
|
|
856
|
+
var import_next_themes = require("next-themes");
|
|
857
|
+
var import_next_themes2 = require("next-themes");
|
|
858
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
859
|
+
function ThemeProvider({ children, ...props }) {
|
|
860
|
+
React14.useEffect(() => {
|
|
861
|
+
const legacyDarkTheme = ["mid", "night"].join("");
|
|
862
|
+
if (window.localStorage.getItem("theme") === legacyDarkTheme) {
|
|
863
|
+
window.localStorage.setItem("theme", "dark");
|
|
864
|
+
}
|
|
865
|
+
}, []);
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_next_themes.ThemeProvider, { ...props, children });
|
|
867
|
+
}
|
|
638
868
|
// Annotate the CommonJS export names for ESM import in node:
|
|
639
869
|
0 && (module.exports = {
|
|
640
870
|
Button,
|
|
@@ -663,6 +893,13 @@ PopoverContent.displayName = "PopoverContent";
|
|
|
663
893
|
PopoverContent,
|
|
664
894
|
PopoverTrigger,
|
|
665
895
|
Progress,
|
|
896
|
+
Sidebar,
|
|
897
|
+
SidebarContent,
|
|
898
|
+
SidebarFooter,
|
|
899
|
+
SidebarGroup,
|
|
900
|
+
SidebarGroupLabel,
|
|
901
|
+
SidebarHeader,
|
|
902
|
+
SidebarItem,
|
|
666
903
|
Skeleton,
|
|
667
904
|
Switch,
|
|
668
905
|
Table,
|
|
@@ -675,8 +912,11 @@ PopoverContent.displayName = "PopoverContent";
|
|
|
675
912
|
TabsContent,
|
|
676
913
|
TabsList,
|
|
677
914
|
TabsTrigger,
|
|
915
|
+
ThemeProvider,
|
|
678
916
|
buttonTextVariants,
|
|
679
917
|
buttonVariants,
|
|
680
|
-
cn
|
|
918
|
+
cn,
|
|
919
|
+
useSidebar,
|
|
920
|
+
useTheme
|
|
681
921
|
});
|
|
682
922
|
//# sourceMappingURL=index.js.map
|