@amazecontinuityprojects/amazeui 1.0.0 → 1.0.2
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 +51 -35
- package/dist/index.d.ts +51 -35
- package/dist/index.js +210 -160
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +203 -153
- package/dist/index.mjs.map +1 -1
- package/dist/tailwind.css +229 -0
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -74,10 +74,9 @@ __export(index_exports, {
|
|
|
74
74
|
});
|
|
75
75
|
module.exports = __toCommonJS(index_exports);
|
|
76
76
|
|
|
77
|
-
// src/
|
|
77
|
+
// src/lib/primitives.tsx
|
|
78
78
|
var React = __toESM(require("react"));
|
|
79
79
|
var import_react_native = require("react-native");
|
|
80
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
81
80
|
|
|
82
81
|
// src/lib/utils.ts
|
|
83
82
|
var import_clsx = require("clsx");
|
|
@@ -86,8 +85,48 @@ function cn(...inputs) {
|
|
|
86
85
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
// src/
|
|
88
|
+
// src/lib/primitives.tsx
|
|
90
89
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
90
|
+
var View = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
91
|
+
if (import_react_native.Platform.OS === "web") {
|
|
92
|
+
const C = "div";
|
|
93
|
+
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 });
|
|
94
|
+
}
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { ref, className, style, ...props });
|
|
96
|
+
});
|
|
97
|
+
View.displayName = "View";
|
|
98
|
+
var Text = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
99
|
+
if (import_react_native.Platform.OS === "web") {
|
|
100
|
+
const C = "span";
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, className: cn("inline m-0 p-0", className), style, ...props });
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { ref, className, style, ...props });
|
|
104
|
+
});
|
|
105
|
+
Text.displayName = "Text";
|
|
106
|
+
var Pressable = React.forwardRef(({ className, style, onPress, onClick, ...props }, ref) => {
|
|
107
|
+
if (import_react_native.Platform.OS === "web") {
|
|
108
|
+
const C = "button";
|
|
109
|
+
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 });
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, { ref, onPress: onPress || onClick, className, style, ...props });
|
|
112
|
+
});
|
|
113
|
+
Pressable.displayName = "Pressable";
|
|
114
|
+
var TextInput = React.forwardRef(({ className, style, onChangeText, onChange, value, ...props }, ref) => {
|
|
115
|
+
if (import_react_native.Platform.OS === "web") {
|
|
116
|
+
const C = "input";
|
|
117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { ref, value, onChange: (e) => {
|
|
118
|
+
onChangeText == null ? void 0 : onChangeText(e.target.value);
|
|
119
|
+
onChange == null ? void 0 : onChange(e);
|
|
120
|
+
}, className, style: { ...style }, ...props });
|
|
121
|
+
}
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.TextInput, { ref, value, onChangeText, onChange, className, style, ...props });
|
|
123
|
+
});
|
|
124
|
+
TextInput.displayName = "TextInput";
|
|
125
|
+
|
|
126
|
+
// src/components/ui/button.tsx
|
|
127
|
+
var React2 = __toESM(require("react"));
|
|
128
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
129
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
91
130
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
92
131
|
"flex flex-row items-center justify-center gap-2 rounded-md font-medium transition-all",
|
|
93
132
|
{
|
|
@@ -131,15 +170,19 @@ var buttonTextVariants = (0, import_class_variance_authority.cva)(
|
|
|
131
170
|
}
|
|
132
171
|
}
|
|
133
172
|
);
|
|
134
|
-
var Button =
|
|
135
|
-
({ className, variant, size, children, textClassName, ...props }, ref) => {
|
|
136
|
-
return /* @__PURE__ */ (0,
|
|
137
|
-
|
|
173
|
+
var Button = React2.forwardRef(
|
|
174
|
+
({ className, variant, size, children, textClassName, onClick, onPress, ...props }, ref) => {
|
|
175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
176
|
+
Pressable,
|
|
138
177
|
{
|
|
178
|
+
onPress: onPress || onClick,
|
|
139
179
|
ref,
|
|
140
180
|
...{ className: cn(buttonVariants({ variant, size }), className) },
|
|
141
181
|
...props,
|
|
142
|
-
children:
|
|
182
|
+
children: React2.Children.map(
|
|
183
|
+
children,
|
|
184
|
+
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { ...{ className: cn(buttonTextVariants({ variant }), textClassName) }, children: child }) : child
|
|
185
|
+
)
|
|
143
186
|
}
|
|
144
187
|
);
|
|
145
188
|
}
|
|
@@ -147,23 +190,22 @@ var Button = React.forwardRef(
|
|
|
147
190
|
Button.displayName = "Button";
|
|
148
191
|
|
|
149
192
|
// src/components/ui/card.tsx
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
import_react_native2.View,
|
|
193
|
+
var React3 = __toESM(require("react"));
|
|
194
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
195
|
+
var Card = React3.forwardRef(
|
|
196
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
197
|
+
View,
|
|
156
198
|
{
|
|
157
199
|
ref,
|
|
158
|
-
...{ className: cn("rounded-xl border border-border bg-card shadow-sm", className) },
|
|
200
|
+
...{ className: cn("rounded-xl border border-border bg-card/60 backdrop-blur-xl shadow-sm dark:bg-card/40", className) },
|
|
159
201
|
...props
|
|
160
202
|
}
|
|
161
203
|
)
|
|
162
204
|
);
|
|
163
205
|
Card.displayName = "Card";
|
|
164
|
-
var CardHeader =
|
|
165
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
166
|
-
|
|
206
|
+
var CardHeader = React3.forwardRef(
|
|
207
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
208
|
+
View,
|
|
167
209
|
{
|
|
168
210
|
ref,
|
|
169
211
|
...{ className: cn("flex flex-col space-y-1.5 p-6", className) },
|
|
@@ -172,9 +214,9 @@ var CardHeader = React2.forwardRef(
|
|
|
172
214
|
)
|
|
173
215
|
);
|
|
174
216
|
CardHeader.displayName = "CardHeader";
|
|
175
|
-
var CardTitle =
|
|
176
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
177
|
-
|
|
217
|
+
var CardTitle = React3.forwardRef(
|
|
218
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
219
|
+
Text,
|
|
178
220
|
{
|
|
179
221
|
ref,
|
|
180
222
|
...{ className: cn("font-semibold text-lg leading-none tracking-tight text-foreground", className) },
|
|
@@ -183,9 +225,9 @@ var CardTitle = React2.forwardRef(
|
|
|
183
225
|
)
|
|
184
226
|
);
|
|
185
227
|
CardTitle.displayName = "CardTitle";
|
|
186
|
-
var CardDescription =
|
|
187
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
188
|
-
|
|
228
|
+
var CardDescription = React3.forwardRef(
|
|
229
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
230
|
+
Text,
|
|
189
231
|
{
|
|
190
232
|
ref,
|
|
191
233
|
...{ className: cn("text-sm text-muted-foreground", className) },
|
|
@@ -194,13 +236,13 @@ var CardDescription = React2.forwardRef(
|
|
|
194
236
|
)
|
|
195
237
|
);
|
|
196
238
|
CardDescription.displayName = "CardDescription";
|
|
197
|
-
var CardContent =
|
|
198
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
239
|
+
var CardContent = React3.forwardRef(
|
|
240
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(View, { ref, ...{ className: cn("p-6 pt-0", className) }, ...props })
|
|
199
241
|
);
|
|
200
242
|
CardContent.displayName = "CardContent";
|
|
201
|
-
var CardFooter =
|
|
202
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
203
|
-
|
|
243
|
+
var CardFooter = React3.forwardRef(
|
|
244
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
245
|
+
View,
|
|
204
246
|
{
|
|
205
247
|
ref,
|
|
206
248
|
...{ className: cn("flex flex-row items-center p-6 pt-0", className) },
|
|
@@ -211,13 +253,12 @@ var CardFooter = React2.forwardRef(
|
|
|
211
253
|
CardFooter.displayName = "CardFooter";
|
|
212
254
|
|
|
213
255
|
// src/components/ui/input.tsx
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var Input = React3.forwardRef(
|
|
256
|
+
var React4 = __toESM(require("react"));
|
|
257
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
258
|
+
var Input = React4.forwardRef(
|
|
218
259
|
({ className, ...props }, ref) => {
|
|
219
|
-
return /* @__PURE__ */ (0,
|
|
220
|
-
|
|
260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
261
|
+
TextInput,
|
|
221
262
|
{
|
|
222
263
|
ref,
|
|
223
264
|
placeholderTextColor: "#a3a3a3",
|
|
@@ -230,10 +271,9 @@ var Input = React3.forwardRef(
|
|
|
230
271
|
Input.displayName = "Input";
|
|
231
272
|
|
|
232
273
|
// src/components/ui/label.tsx
|
|
233
|
-
var
|
|
234
|
-
var import_react_native4 = require("react-native");
|
|
274
|
+
var React5 = __toESM(require("react"));
|
|
235
275
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
236
|
-
var
|
|
276
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
237
277
|
var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
238
278
|
"text-sm font-medium leading-none text-foreground peer-disabled:opacity-70",
|
|
239
279
|
{
|
|
@@ -241,9 +281,9 @@ var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
|
241
281
|
defaultVariants: {}
|
|
242
282
|
}
|
|
243
283
|
);
|
|
244
|
-
var Label =
|
|
245
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
246
|
-
|
|
284
|
+
var Label = React5.forwardRef(
|
|
285
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
286
|
+
Text,
|
|
247
287
|
{
|
|
248
288
|
ref,
|
|
249
289
|
...{ className: cn(labelVariants(), className) },
|
|
@@ -254,11 +294,10 @@ var Label = React4.forwardRef(
|
|
|
254
294
|
Label.displayName = "Label";
|
|
255
295
|
|
|
256
296
|
// src/components/ui/skeleton.tsx
|
|
257
|
-
var
|
|
258
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
297
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
259
298
|
function Skeleton({ className, ...props }) {
|
|
260
|
-
return /* @__PURE__ */ (0,
|
|
261
|
-
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
300
|
+
View,
|
|
262
301
|
{
|
|
263
302
|
...{ className: cn("animate-pulse rounded-md bg-primary/10", className) },
|
|
264
303
|
...props
|
|
@@ -267,14 +306,20 @@ function Skeleton({ className, ...props }) {
|
|
|
267
306
|
}
|
|
268
307
|
|
|
269
308
|
// src/components/ui/switch.tsx
|
|
270
|
-
var
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
var Switch =
|
|
274
|
-
({ className, ...props }, ref) => {
|
|
275
|
-
return /* @__PURE__ */ (0,
|
|
276
|
-
|
|
309
|
+
var React6 = __toESM(require("react"));
|
|
310
|
+
var import_react_native2 = require("react-native");
|
|
311
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
312
|
+
var Switch = React6.forwardRef(
|
|
313
|
+
({ className, onCheckedChange, onChange, onValueChange, checked, value, ...props }, ref) => {
|
|
314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
315
|
+
import_react_native2.Switch,
|
|
277
316
|
{
|
|
317
|
+
value: checked !== void 0 ? checked : value,
|
|
318
|
+
onValueChange: (val) => {
|
|
319
|
+
onValueChange == null ? void 0 : onValueChange(val);
|
|
320
|
+
onCheckedChange == null ? void 0 : onCheckedChange(val);
|
|
321
|
+
onChange == null ? void 0 : onChange(val);
|
|
322
|
+
},
|
|
278
323
|
ref,
|
|
279
324
|
...props
|
|
280
325
|
}
|
|
@@ -284,20 +329,19 @@ var Switch = React5.forwardRef(
|
|
|
284
329
|
Switch.displayName = "Switch";
|
|
285
330
|
|
|
286
331
|
// src/components/ui/progress.tsx
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
var Progress = React6.forwardRef(
|
|
332
|
+
var React7 = __toESM(require("react"));
|
|
333
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
334
|
+
var Progress = React7.forwardRef(
|
|
291
335
|
({ className, value = 0, ...props }, ref) => {
|
|
292
336
|
const boundedValue = Math.min(100, Math.max(0, value || 0));
|
|
293
|
-
return /* @__PURE__ */ (0,
|
|
294
|
-
|
|
337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
338
|
+
View,
|
|
295
339
|
{
|
|
296
340
|
ref,
|
|
297
341
|
...{ className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className) },
|
|
298
342
|
...props,
|
|
299
|
-
children: /* @__PURE__ */ (0,
|
|
300
|
-
|
|
343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
344
|
+
View,
|
|
301
345
|
{
|
|
302
346
|
...{ className: "h-full bg-primary flex-1 transition-all" },
|
|
303
347
|
style: { width: `${boundedValue}%` }
|
|
@@ -310,32 +354,31 @@ var Progress = React6.forwardRef(
|
|
|
310
354
|
Progress.displayName = "Progress";
|
|
311
355
|
|
|
312
356
|
// src/components/ui/tabs.tsx
|
|
313
|
-
var
|
|
314
|
-
var
|
|
315
|
-
var
|
|
316
|
-
var TabsContext = React7.createContext(null);
|
|
357
|
+
var React8 = __toESM(require("react"));
|
|
358
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
359
|
+
var TabsContext = React8.createContext(null);
|
|
317
360
|
function Tabs({ value: controlledValue, defaultValue, onValueChange, className, children, ...props }) {
|
|
318
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
361
|
+
const [uncontrolledValue, setUncontrolledValue] = React8.useState(defaultValue || "");
|
|
319
362
|
const value = controlledValue !== void 0 ? controlledValue : uncontrolledValue;
|
|
320
|
-
const handleValueChange =
|
|
363
|
+
const handleValueChange = React8.useCallback(
|
|
321
364
|
(newValue) => {
|
|
322
365
|
setUncontrolledValue(newValue);
|
|
323
366
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
324
367
|
},
|
|
325
368
|
[onValueChange]
|
|
326
369
|
);
|
|
327
|
-
return /* @__PURE__ */ (0,
|
|
370
|
+
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
371
|
}
|
|
329
372
|
function useTabsContext() {
|
|
330
|
-
const context =
|
|
373
|
+
const context = React8.useContext(TabsContext);
|
|
331
374
|
if (!context) {
|
|
332
375
|
throw new Error("Tabs compound components must be rendered within the Tabs component");
|
|
333
376
|
}
|
|
334
377
|
return context;
|
|
335
378
|
}
|
|
336
|
-
var TabsList =
|
|
337
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
338
|
-
|
|
379
|
+
var TabsList = React8.forwardRef(
|
|
380
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
381
|
+
View,
|
|
339
382
|
{
|
|
340
383
|
ref,
|
|
341
384
|
...{ className: cn("flex-row items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className) },
|
|
@@ -344,12 +387,12 @@ var TabsList = React7.forwardRef(
|
|
|
344
387
|
)
|
|
345
388
|
);
|
|
346
389
|
TabsList.displayName = "TabsList";
|
|
347
|
-
var TabsTrigger =
|
|
390
|
+
var TabsTrigger = React8.forwardRef(
|
|
348
391
|
({ className, textClassName, value, children, ...props }, ref) => {
|
|
349
392
|
const context = useTabsContext();
|
|
350
393
|
const isSelected = context.value === value;
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
352
|
-
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
395
|
+
Pressable,
|
|
353
396
|
{
|
|
354
397
|
ref,
|
|
355
398
|
onPress: () => context.onValueChange(value),
|
|
@@ -359,20 +402,20 @@ var TabsTrigger = React7.forwardRef(
|
|
|
359
402
|
className
|
|
360
403
|
) },
|
|
361
404
|
...props,
|
|
362
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
405
|
+
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
406
|
}
|
|
364
407
|
);
|
|
365
408
|
}
|
|
366
409
|
);
|
|
367
410
|
TabsTrigger.displayName = "TabsTrigger";
|
|
368
|
-
var TabsContent =
|
|
411
|
+
var TabsContent = React8.forwardRef(
|
|
369
412
|
({ className, value, children, ...props }, ref) => {
|
|
370
413
|
const context = useTabsContext();
|
|
371
414
|
if (context.value !== value) {
|
|
372
415
|
return null;
|
|
373
416
|
}
|
|
374
|
-
return /* @__PURE__ */ (0,
|
|
375
|
-
|
|
417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
418
|
+
View,
|
|
376
419
|
{
|
|
377
420
|
ref,
|
|
378
421
|
...{ 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 +428,11 @@ var TabsContent = React7.forwardRef(
|
|
|
385
428
|
TabsContent.displayName = "TabsContent";
|
|
386
429
|
|
|
387
430
|
// src/components/ui/table.tsx
|
|
388
|
-
var
|
|
389
|
-
var
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
import_react_native9.View,
|
|
431
|
+
var React9 = __toESM(require("react"));
|
|
432
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
433
|
+
var Table = React9.forwardRef(
|
|
434
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(View, { ...{ className: "w-full overflow-hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
435
|
+
View,
|
|
394
436
|
{
|
|
395
437
|
ref,
|
|
396
438
|
...{ className: cn("w-full text-sm", className) },
|
|
@@ -399,13 +441,13 @@ var Table = React8.forwardRef(
|
|
|
399
441
|
) })
|
|
400
442
|
);
|
|
401
443
|
Table.displayName = "Table";
|
|
402
|
-
var TableHeader =
|
|
403
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
444
|
+
var TableHeader = React9.forwardRef(
|
|
445
|
+
({ 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
446
|
);
|
|
405
447
|
TableHeader.displayName = "TableHeader";
|
|
406
|
-
var TableBody =
|
|
407
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
408
|
-
|
|
448
|
+
var TableBody = React9.forwardRef(
|
|
449
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
450
|
+
View,
|
|
409
451
|
{
|
|
410
452
|
ref,
|
|
411
453
|
...{ className: cn("flex flex-col [&_>_view:last-child]:border-0", className) },
|
|
@@ -414,9 +456,9 @@ var TableBody = React8.forwardRef(
|
|
|
414
456
|
)
|
|
415
457
|
);
|
|
416
458
|
TableBody.displayName = "TableBody";
|
|
417
|
-
var TableRow =
|
|
418
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
419
|
-
|
|
459
|
+
var TableRow = React9.forwardRef(
|
|
460
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
461
|
+
View,
|
|
420
462
|
{
|
|
421
463
|
ref,
|
|
422
464
|
...{ className: cn(
|
|
@@ -428,9 +470,9 @@ var TableRow = React8.forwardRef(
|
|
|
428
470
|
)
|
|
429
471
|
);
|
|
430
472
|
TableRow.displayName = "TableRow";
|
|
431
|
-
var TableHead =
|
|
432
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
433
|
-
|
|
473
|
+
var TableHead = React9.forwardRef(
|
|
474
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
475
|
+
View,
|
|
434
476
|
{
|
|
435
477
|
ref,
|
|
436
478
|
...{ className: cn(
|
|
@@ -438,66 +480,68 @@ var TableHead = React8.forwardRef(
|
|
|
438
480
|
className
|
|
439
481
|
) },
|
|
440
482
|
...props,
|
|
441
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
483
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { ...{ className: "font-semibold text-muted-foreground text-sm" }, children }) : children
|
|
442
484
|
}
|
|
443
485
|
)
|
|
444
486
|
);
|
|
445
487
|
TableHead.displayName = "TableHead";
|
|
446
|
-
var TableCell =
|
|
447
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
448
|
-
|
|
488
|
+
var TableCell = React9.forwardRef(
|
|
489
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
490
|
+
View,
|
|
449
491
|
{
|
|
450
492
|
ref,
|
|
451
493
|
...{ className: cn("p-4 align-middle", className) },
|
|
452
494
|
...props,
|
|
453
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
495
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { ...{ className: "text-foreground text-sm" }, children }) : children
|
|
454
496
|
}
|
|
455
497
|
)
|
|
456
498
|
);
|
|
457
499
|
TableCell.displayName = "TableCell";
|
|
458
500
|
|
|
459
501
|
// src/components/ui/dialog.tsx
|
|
460
|
-
var
|
|
461
|
-
var
|
|
462
|
-
var
|
|
463
|
-
var DialogContext =
|
|
502
|
+
var React10 = __toESM(require("react"));
|
|
503
|
+
var import_react_native3 = require("react-native");
|
|
504
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
505
|
+
var DialogContext = React10.createContext(null);
|
|
464
506
|
function useDialog() {
|
|
465
|
-
const context =
|
|
507
|
+
const context = React10.useContext(DialogContext);
|
|
466
508
|
if (!context) throw new Error("Dialog components must be used within a Dialog");
|
|
467
509
|
return context;
|
|
468
510
|
}
|
|
469
511
|
function Dialog({ open = false, onOpenChange, children, ...props }) {
|
|
470
|
-
const [isOpen, setIsOpen] =
|
|
512
|
+
const [isOpen, setIsOpen] = React10.useState(open);
|
|
471
513
|
const isControlled = onOpenChange !== void 0;
|
|
472
514
|
const currentOpen = isControlled ? open : isOpen;
|
|
473
|
-
const setCurrentOpen =
|
|
515
|
+
const setCurrentOpen = React10.useCallback((val) => {
|
|
474
516
|
if (!isControlled) setIsOpen(val);
|
|
475
517
|
onOpenChange == null ? void 0 : onOpenChange(val);
|
|
476
518
|
}, [isControlled, onOpenChange]);
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogContext.Provider, { value: { open: currentOpen, onOpenChange: setCurrentOpen }, children });
|
|
478
520
|
}
|
|
479
|
-
var DialogTrigger =
|
|
521
|
+
var DialogTrigger = React10.forwardRef(
|
|
480
522
|
({ onPress, children, ...props }, ref) => {
|
|
481
523
|
const { onOpenChange } = useDialog();
|
|
482
|
-
return /* @__PURE__ */ (0,
|
|
524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Pressable, { ref, onPress: (e) => {
|
|
525
|
+
var _a;
|
|
483
526
|
onOpenChange(true);
|
|
484
527
|
onPress == null ? void 0 : onPress(e);
|
|
528
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
485
529
|
}, ...props, children });
|
|
486
530
|
}
|
|
487
531
|
);
|
|
488
532
|
DialogTrigger.displayName = "DialogTrigger";
|
|
489
|
-
var DialogContent =
|
|
533
|
+
var DialogContent = React10.forwardRef(
|
|
490
534
|
({ className, children, ...props }, ref) => {
|
|
491
535
|
const { open, onOpenChange } = useDialog();
|
|
492
|
-
return /* @__PURE__ */ (0,
|
|
493
|
-
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
537
|
+
import_react_native3.Modal,
|
|
494
538
|
{
|
|
495
539
|
visible: open,
|
|
496
540
|
transparent: true,
|
|
497
541
|
animationType: "fade",
|
|
498
542
|
onRequestClose: () => onOpenChange(false),
|
|
499
|
-
children: /* @__PURE__ */ (0,
|
|
500
|
-
|
|
543
|
+
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)(
|
|
544
|
+
View,
|
|
501
545
|
{
|
|
502
546
|
ref,
|
|
503
547
|
...{ className: cn("w-full max-w-lg rounded-xl border border-border bg-background p-6 shadow-lg sm:rounded-[1rem]", className) },
|
|
@@ -510,49 +554,51 @@ var DialogContent = React9.forwardRef(
|
|
|
510
554
|
}
|
|
511
555
|
);
|
|
512
556
|
DialogContent.displayName = "DialogContent";
|
|
513
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
557
|
+
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
558
|
DialogHeader.displayName = "DialogHeader";
|
|
515
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
559
|
+
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
560
|
DialogFooter.displayName = "DialogFooter";
|
|
517
|
-
var DialogTitle =
|
|
518
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
561
|
+
var DialogTitle = React10.forwardRef(
|
|
562
|
+
({ 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
563
|
);
|
|
520
564
|
DialogTitle.displayName = "DialogTitle";
|
|
521
|
-
var DialogDescription =
|
|
522
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
565
|
+
var DialogDescription = React10.forwardRef(
|
|
566
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { ref, ...{ className: cn("text-sm text-muted-foreground", className) }, ...props })
|
|
523
567
|
);
|
|
524
568
|
DialogDescription.displayName = "DialogDescription";
|
|
525
569
|
|
|
526
570
|
// src/components/ui/dropdown-menu.tsx
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
530
|
-
var DropdownContext =
|
|
571
|
+
var React11 = __toESM(require("react"));
|
|
572
|
+
var import_react_native4 = require("react-native");
|
|
573
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
574
|
+
var DropdownContext = React11.createContext(null);
|
|
531
575
|
function DropdownMenu({ children }) {
|
|
532
|
-
const [open, setOpen] =
|
|
533
|
-
return /* @__PURE__ */ (0,
|
|
576
|
+
const [open, setOpen] = React11.useState(false);
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View, { ...{ className: "relative" }, children }) });
|
|
534
578
|
}
|
|
535
|
-
var DropdownMenuTrigger =
|
|
579
|
+
var DropdownMenuTrigger = React11.forwardRef(
|
|
536
580
|
({ onPress, children, ...props }, ref) => {
|
|
537
|
-
const context =
|
|
538
|
-
return /* @__PURE__ */ (0,
|
|
581
|
+
const context = React11.useContext(DropdownContext);
|
|
582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Pressable, { ref, onPress: (e) => {
|
|
583
|
+
var _a;
|
|
539
584
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
540
585
|
onPress == null ? void 0 : onPress(e);
|
|
586
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
541
587
|
}, ...props, children });
|
|
542
588
|
}
|
|
543
589
|
);
|
|
544
590
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
545
|
-
var DropdownMenuContent =
|
|
591
|
+
var DropdownMenuContent = React11.forwardRef(
|
|
546
592
|
({ className, children, ...props }, ref) => {
|
|
547
|
-
const context =
|
|
593
|
+
const context = React11.useContext(DropdownContext);
|
|
548
594
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
549
|
-
return /* @__PURE__ */ (0,
|
|
550
|
-
|
|
595
|
+
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)(
|
|
596
|
+
Pressable,
|
|
551
597
|
{
|
|
552
598
|
onPress: () => context.setOpen(false),
|
|
553
599
|
...{ className: "flex-1 bg-black/10 justify-end sm:justify-center items-center" },
|
|
554
|
-
children: /* @__PURE__ */ (0,
|
|
555
|
-
|
|
600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
601
|
+
View,
|
|
556
602
|
{
|
|
557
603
|
ref,
|
|
558
604
|
...{ 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 +611,68 @@ var DropdownMenuContent = React10.forwardRef(
|
|
|
565
611
|
}
|
|
566
612
|
);
|
|
567
613
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
568
|
-
var DropdownMenuItem =
|
|
614
|
+
var DropdownMenuItem = React11.forwardRef(
|
|
569
615
|
({ className, textClassName, onPress, children, ...props }, ref) => {
|
|
570
|
-
const context =
|
|
571
|
-
return /* @__PURE__ */ (0,
|
|
572
|
-
|
|
616
|
+
const context = React11.useContext(DropdownContext);
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
618
|
+
Pressable,
|
|
573
619
|
{
|
|
574
620
|
ref,
|
|
575
621
|
onPress: (e) => {
|
|
622
|
+
var _a;
|
|
576
623
|
context == null ? void 0 : context.setOpen(false);
|
|
577
624
|
onPress == null ? void 0 : onPress(e);
|
|
625
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
578
626
|
},
|
|
579
627
|
...{ 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
628
|
...props,
|
|
581
|
-
children: typeof children === "string" ? /* @__PURE__ */ (0,
|
|
629
|
+
children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { ...{ className: cn("text-foreground", textClassName) }, children }) : children
|
|
582
630
|
}
|
|
583
631
|
);
|
|
584
632
|
}
|
|
585
633
|
);
|
|
586
634
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
587
|
-
var DropdownMenuLabel =
|
|
588
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
635
|
+
var DropdownMenuLabel = React11.forwardRef(
|
|
636
|
+
({ 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
637
|
);
|
|
590
638
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
591
|
-
var DropdownMenuSeparator =
|
|
592
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
639
|
+
var DropdownMenuSeparator = React11.forwardRef(
|
|
640
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View, { ref, ...{ className: cn("-mx-1 my-1 h-px bg-muted", className) }, ...props })
|
|
593
641
|
);
|
|
594
642
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
595
643
|
|
|
596
644
|
// src/components/ui/popover.tsx
|
|
597
|
-
var
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var PopoverContext =
|
|
645
|
+
var React12 = __toESM(require("react"));
|
|
646
|
+
var import_react_native5 = require("react-native");
|
|
647
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
648
|
+
var PopoverContext = React12.createContext(null);
|
|
601
649
|
function Popover({ children }) {
|
|
602
|
-
const [open, setOpen] =
|
|
603
|
-
return /* @__PURE__ */ (0,
|
|
650
|
+
const [open, setOpen] = React12.useState(false);
|
|
651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(View, { ...{ className: "relative" }, children }) });
|
|
604
652
|
}
|
|
605
|
-
var PopoverTrigger =
|
|
653
|
+
var PopoverTrigger = React12.forwardRef(
|
|
606
654
|
({ onPress, children, ...props }, ref) => {
|
|
607
|
-
const context =
|
|
608
|
-
return /* @__PURE__ */ (0,
|
|
655
|
+
const context = React12.useContext(PopoverContext);
|
|
656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pressable, { ref, onPress: (e) => {
|
|
657
|
+
var _a;
|
|
609
658
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
610
659
|
onPress == null ? void 0 : onPress(e);
|
|
660
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
611
661
|
}, ...props, children });
|
|
612
662
|
}
|
|
613
663
|
);
|
|
614
664
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
615
|
-
var PopoverContent =
|
|
665
|
+
var PopoverContent = React12.forwardRef(
|
|
616
666
|
({ className, children, ...props }, ref) => {
|
|
617
|
-
const context =
|
|
667
|
+
const context = React12.useContext(PopoverContext);
|
|
618
668
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
619
|
-
return /* @__PURE__ */ (0,
|
|
620
|
-
|
|
669
|
+
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)(
|
|
670
|
+
Pressable,
|
|
621
671
|
{
|
|
622
672
|
onPress: () => context.setOpen(false),
|
|
623
673
|
...{ className: "flex-1 bg-transparent justify-center items-center" },
|
|
624
|
-
children: /* @__PURE__ */ (0,
|
|
625
|
-
|
|
674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
675
|
+
View,
|
|
626
676
|
{
|
|
627
677
|
ref,
|
|
628
678
|
...{ className: cn("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none", className) },
|