@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.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/lib/primitives.tsx
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Platform, View as RNView, Text as RNText, Pressable as RNPressable, TextInput as RNTextInput } from "react-native";
|
|
5
4
|
|
|
6
5
|
// src/lib/utils.ts
|
|
7
6
|
import { clsx } from "clsx";
|
|
@@ -10,8 +9,48 @@ function cn(...inputs) {
|
|
|
10
9
|
return twMerge(clsx(inputs));
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
// src/
|
|
12
|
+
// src/lib/primitives.tsx
|
|
14
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var View = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
15
|
+
if (Platform.OS === "web") {
|
|
16
|
+
const C = "div";
|
|
17
|
+
return /* @__PURE__ */ jsx(C, { ref, className: cn("flex flex-col items-stretch justify-start min-w-0 min-h-0 relative", className), style, ...props });
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx(RNView, { ref, className, style, ...props });
|
|
20
|
+
});
|
|
21
|
+
View.displayName = "View";
|
|
22
|
+
var Text = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
23
|
+
if (Platform.OS === "web") {
|
|
24
|
+
const C = "span";
|
|
25
|
+
return /* @__PURE__ */ jsx(C, { ref, className: cn("inline m-0 p-0", className), style, ...props });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx(RNText, { ref, className, style, ...props });
|
|
28
|
+
});
|
|
29
|
+
Text.displayName = "Text";
|
|
30
|
+
var Pressable = React.forwardRef(({ className, style, onPress, onClick, ...props }, ref) => {
|
|
31
|
+
if (Platform.OS === "web") {
|
|
32
|
+
const C = "button";
|
|
33
|
+
return /* @__PURE__ */ 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 });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ jsx(RNPressable, { ref, onPress: onPress || onClick, className, style, ...props });
|
|
36
|
+
});
|
|
37
|
+
Pressable.displayName = "Pressable";
|
|
38
|
+
var TextInput = React.forwardRef(({ className, style, onChangeText, onChange, value, ...props }, ref) => {
|
|
39
|
+
if (Platform.OS === "web") {
|
|
40
|
+
const C = "input";
|
|
41
|
+
return /* @__PURE__ */ jsx(C, { ref, value, onChange: (e) => {
|
|
42
|
+
onChangeText == null ? void 0 : onChangeText(e.target.value);
|
|
43
|
+
onChange == null ? void 0 : onChange(e);
|
|
44
|
+
}, className, style: { ...style }, ...props });
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx(RNTextInput, { ref, value, onChangeText, onChange, className, style, ...props });
|
|
47
|
+
});
|
|
48
|
+
TextInput.displayName = "TextInput";
|
|
49
|
+
|
|
50
|
+
// src/components/ui/button.tsx
|
|
51
|
+
import * as React2 from "react";
|
|
52
|
+
import { cva } from "class-variance-authority";
|
|
53
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
15
54
|
var buttonVariants = cva(
|
|
16
55
|
"flex flex-row items-center justify-center gap-2 rounded-md font-medium transition-all",
|
|
17
56
|
{
|
|
@@ -55,15 +94,19 @@ var buttonTextVariants = cva(
|
|
|
55
94
|
}
|
|
56
95
|
}
|
|
57
96
|
);
|
|
58
|
-
var Button =
|
|
59
|
-
({ className, variant, size, children, textClassName, ...props }, ref) => {
|
|
60
|
-
return /* @__PURE__ */
|
|
97
|
+
var Button = React2.forwardRef(
|
|
98
|
+
({ className, variant, size, children, textClassName, onClick, onPress, ...props }, ref) => {
|
|
99
|
+
return /* @__PURE__ */ jsx2(
|
|
61
100
|
Pressable,
|
|
62
101
|
{
|
|
102
|
+
onPress: onPress || onClick,
|
|
63
103
|
ref,
|
|
64
104
|
...{ className: cn(buttonVariants({ variant, size }), className) },
|
|
65
105
|
...props,
|
|
66
|
-
children:
|
|
106
|
+
children: React2.Children.map(
|
|
107
|
+
children,
|
|
108
|
+
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ jsx2(Text, { ...{ className: cn(buttonTextVariants({ variant }), textClassName) }, children: child }) : child
|
|
109
|
+
)
|
|
67
110
|
}
|
|
68
111
|
);
|
|
69
112
|
}
|
|
@@ -71,22 +114,21 @@ var Button = React.forwardRef(
|
|
|
71
114
|
Button.displayName = "Button";
|
|
72
115
|
|
|
73
116
|
// src/components/ui/card.tsx
|
|
74
|
-
import * as
|
|
75
|
-
import {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
117
|
+
import * as React3 from "react";
|
|
118
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
119
|
+
var Card = React3.forwardRef(
|
|
120
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
79
121
|
View,
|
|
80
122
|
{
|
|
81
123
|
ref,
|
|
82
|
-
...{ className: cn("rounded-xl border border-border bg-card shadow-sm", className) },
|
|
124
|
+
...{ className: cn("rounded-xl border border-border bg-card/60 backdrop-blur-xl shadow-sm dark:bg-card/40", className) },
|
|
83
125
|
...props
|
|
84
126
|
}
|
|
85
127
|
)
|
|
86
128
|
);
|
|
87
129
|
Card.displayName = "Card";
|
|
88
|
-
var CardHeader =
|
|
89
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
130
|
+
var CardHeader = React3.forwardRef(
|
|
131
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
90
132
|
View,
|
|
91
133
|
{
|
|
92
134
|
ref,
|
|
@@ -96,9 +138,9 @@ var CardHeader = React2.forwardRef(
|
|
|
96
138
|
)
|
|
97
139
|
);
|
|
98
140
|
CardHeader.displayName = "CardHeader";
|
|
99
|
-
var CardTitle =
|
|
100
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
101
|
-
|
|
141
|
+
var CardTitle = React3.forwardRef(
|
|
142
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
143
|
+
Text,
|
|
102
144
|
{
|
|
103
145
|
ref,
|
|
104
146
|
...{ className: cn("font-semibold text-lg leading-none tracking-tight text-foreground", className) },
|
|
@@ -107,9 +149,9 @@ var CardTitle = React2.forwardRef(
|
|
|
107
149
|
)
|
|
108
150
|
);
|
|
109
151
|
CardTitle.displayName = "CardTitle";
|
|
110
|
-
var CardDescription =
|
|
111
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
112
|
-
|
|
152
|
+
var CardDescription = React3.forwardRef(
|
|
153
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
154
|
+
Text,
|
|
113
155
|
{
|
|
114
156
|
ref,
|
|
115
157
|
...{ className: cn("text-sm text-muted-foreground", className) },
|
|
@@ -118,12 +160,12 @@ var CardDescription = React2.forwardRef(
|
|
|
118
160
|
)
|
|
119
161
|
);
|
|
120
162
|
CardDescription.displayName = "CardDescription";
|
|
121
|
-
var CardContent =
|
|
122
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
163
|
+
var CardContent = React3.forwardRef(
|
|
164
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(View, { ref, ...{ className: cn("p-6 pt-0", className) }, ...props })
|
|
123
165
|
);
|
|
124
166
|
CardContent.displayName = "CardContent";
|
|
125
|
-
var CardFooter =
|
|
126
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
167
|
+
var CardFooter = React3.forwardRef(
|
|
168
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
127
169
|
View,
|
|
128
170
|
{
|
|
129
171
|
ref,
|
|
@@ -135,12 +177,11 @@ var CardFooter = React2.forwardRef(
|
|
|
135
177
|
CardFooter.displayName = "CardFooter";
|
|
136
178
|
|
|
137
179
|
// src/components/ui/input.tsx
|
|
138
|
-
import * as
|
|
139
|
-
import {
|
|
140
|
-
|
|
141
|
-
var Input = React3.forwardRef(
|
|
180
|
+
import * as React4 from "react";
|
|
181
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
182
|
+
var Input = React4.forwardRef(
|
|
142
183
|
({ className, ...props }, ref) => {
|
|
143
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ jsx4(
|
|
144
185
|
TextInput,
|
|
145
186
|
{
|
|
146
187
|
ref,
|
|
@@ -154,10 +195,9 @@ var Input = React3.forwardRef(
|
|
|
154
195
|
Input.displayName = "Input";
|
|
155
196
|
|
|
156
197
|
// src/components/ui/label.tsx
|
|
157
|
-
import * as
|
|
158
|
-
import { Text as Text3 } from "react-native";
|
|
198
|
+
import * as React5 from "react";
|
|
159
199
|
import { cva as cva2 } from "class-variance-authority";
|
|
160
|
-
import { jsx as
|
|
200
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
161
201
|
var labelVariants = cva2(
|
|
162
202
|
"text-sm font-medium leading-none text-foreground peer-disabled:opacity-70",
|
|
163
203
|
{
|
|
@@ -165,9 +205,9 @@ var labelVariants = cva2(
|
|
|
165
205
|
defaultVariants: {}
|
|
166
206
|
}
|
|
167
207
|
);
|
|
168
|
-
var Label =
|
|
169
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
170
|
-
|
|
208
|
+
var Label = React5.forwardRef(
|
|
209
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
210
|
+
Text,
|
|
171
211
|
{
|
|
172
212
|
ref,
|
|
173
213
|
...{ className: cn(labelVariants(), className) },
|
|
@@ -178,11 +218,10 @@ var Label = React4.forwardRef(
|
|
|
178
218
|
Label.displayName = "Label";
|
|
179
219
|
|
|
180
220
|
// src/components/ui/skeleton.tsx
|
|
181
|
-
import {
|
|
182
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
221
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
183
222
|
function Skeleton({ className, ...props }) {
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
|
|
223
|
+
return /* @__PURE__ */ jsx6(
|
|
224
|
+
View,
|
|
186
225
|
{
|
|
187
226
|
...{ className: cn("animate-pulse rounded-md bg-primary/10", className) },
|
|
188
227
|
...props
|
|
@@ -191,14 +230,20 @@ function Skeleton({ className, ...props }) {
|
|
|
191
230
|
}
|
|
192
231
|
|
|
193
232
|
// src/components/ui/switch.tsx
|
|
194
|
-
import * as
|
|
233
|
+
import * as React6 from "react";
|
|
195
234
|
import { Switch as NativeSwitch } from "react-native";
|
|
196
|
-
import { jsx as
|
|
197
|
-
var Switch =
|
|
198
|
-
({ className, ...props }, ref) => {
|
|
199
|
-
return /* @__PURE__ */
|
|
235
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
236
|
+
var Switch = React6.forwardRef(
|
|
237
|
+
({ className, onCheckedChange, onChange, onValueChange, checked, value, ...props }, ref) => {
|
|
238
|
+
return /* @__PURE__ */ jsx7(
|
|
200
239
|
NativeSwitch,
|
|
201
240
|
{
|
|
241
|
+
value: checked !== void 0 ? checked : value,
|
|
242
|
+
onValueChange: (val) => {
|
|
243
|
+
onValueChange == null ? void 0 : onValueChange(val);
|
|
244
|
+
onCheckedChange == null ? void 0 : onCheckedChange(val);
|
|
245
|
+
onChange == null ? void 0 : onChange(val);
|
|
246
|
+
},
|
|
202
247
|
ref,
|
|
203
248
|
...props
|
|
204
249
|
}
|
|
@@ -208,20 +253,19 @@ var Switch = React5.forwardRef(
|
|
|
208
253
|
Switch.displayName = "Switch";
|
|
209
254
|
|
|
210
255
|
// src/components/ui/progress.tsx
|
|
211
|
-
import * as
|
|
212
|
-
import {
|
|
213
|
-
|
|
214
|
-
var Progress = React6.forwardRef(
|
|
256
|
+
import * as React7 from "react";
|
|
257
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
258
|
+
var Progress = React7.forwardRef(
|
|
215
259
|
({ className, value = 0, ...props }, ref) => {
|
|
216
260
|
const boundedValue = Math.min(100, Math.max(0, value || 0));
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
|
|
261
|
+
return /* @__PURE__ */ jsx8(
|
|
262
|
+
View,
|
|
219
263
|
{
|
|
220
264
|
ref,
|
|
221
265
|
...{ className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className) },
|
|
222
266
|
...props,
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
|
|
267
|
+
children: /* @__PURE__ */ jsx8(
|
|
268
|
+
View,
|
|
225
269
|
{
|
|
226
270
|
...{ className: "h-full bg-primary flex-1 transition-all" },
|
|
227
271
|
style: { width: `${boundedValue}%` }
|
|
@@ -234,32 +278,31 @@ var Progress = React6.forwardRef(
|
|
|
234
278
|
Progress.displayName = "Progress";
|
|
235
279
|
|
|
236
280
|
// src/components/ui/tabs.tsx
|
|
237
|
-
import * as
|
|
238
|
-
import {
|
|
239
|
-
|
|
240
|
-
var TabsContext = React7.createContext(null);
|
|
281
|
+
import * as React8 from "react";
|
|
282
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
283
|
+
var TabsContext = React8.createContext(null);
|
|
241
284
|
function Tabs({ value: controlledValue, defaultValue, onValueChange, className, children, ...props }) {
|
|
242
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
285
|
+
const [uncontrolledValue, setUncontrolledValue] = React8.useState(defaultValue || "");
|
|
243
286
|
const value = controlledValue !== void 0 ? controlledValue : uncontrolledValue;
|
|
244
|
-
const handleValueChange =
|
|
287
|
+
const handleValueChange = React8.useCallback(
|
|
245
288
|
(newValue) => {
|
|
246
289
|
setUncontrolledValue(newValue);
|
|
247
290
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
248
291
|
},
|
|
249
292
|
[onValueChange]
|
|
250
293
|
);
|
|
251
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ jsx9(TabsContext.Provider, { value: { value, onValueChange: handleValueChange }, children: /* @__PURE__ */ jsx9(View, { ...{ className }, ...props, children }) });
|
|
252
295
|
}
|
|
253
296
|
function useTabsContext() {
|
|
254
|
-
const context =
|
|
297
|
+
const context = React8.useContext(TabsContext);
|
|
255
298
|
if (!context) {
|
|
256
299
|
throw new Error("Tabs compound components must be rendered within the Tabs component");
|
|
257
300
|
}
|
|
258
301
|
return context;
|
|
259
302
|
}
|
|
260
|
-
var TabsList =
|
|
261
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
262
|
-
|
|
303
|
+
var TabsList = React8.forwardRef(
|
|
304
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
305
|
+
View,
|
|
263
306
|
{
|
|
264
307
|
ref,
|
|
265
308
|
...{ className: cn("flex-row items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className) },
|
|
@@ -268,12 +311,12 @@ var TabsList = React7.forwardRef(
|
|
|
268
311
|
)
|
|
269
312
|
);
|
|
270
313
|
TabsList.displayName = "TabsList";
|
|
271
|
-
var TabsTrigger =
|
|
314
|
+
var TabsTrigger = React8.forwardRef(
|
|
272
315
|
({ className, textClassName, value, children, ...props }, ref) => {
|
|
273
316
|
const context = useTabsContext();
|
|
274
317
|
const isSelected = context.value === value;
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
|
|
318
|
+
return /* @__PURE__ */ jsx9(
|
|
319
|
+
Pressable,
|
|
277
320
|
{
|
|
278
321
|
ref,
|
|
279
322
|
onPress: () => context.onValueChange(value),
|
|
@@ -283,20 +326,20 @@ var TabsTrigger = React7.forwardRef(
|
|
|
283
326
|
className
|
|
284
327
|
) },
|
|
285
328
|
...props,
|
|
286
|
-
children: typeof children === "string" ? /* @__PURE__ */
|
|
329
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx9(Text, { ...{ className: cn("text-sm font-medium transition-all", isSelected ? "text-foreground" : "text-muted-foreground", textClassName) }, children }) : children
|
|
287
330
|
}
|
|
288
331
|
);
|
|
289
332
|
}
|
|
290
333
|
);
|
|
291
334
|
TabsTrigger.displayName = "TabsTrigger";
|
|
292
|
-
var TabsContent =
|
|
335
|
+
var TabsContent = React8.forwardRef(
|
|
293
336
|
({ className, value, children, ...props }, ref) => {
|
|
294
337
|
const context = useTabsContext();
|
|
295
338
|
if (context.value !== value) {
|
|
296
339
|
return null;
|
|
297
340
|
}
|
|
298
|
-
return /* @__PURE__ */
|
|
299
|
-
|
|
341
|
+
return /* @__PURE__ */ jsx9(
|
|
342
|
+
View,
|
|
300
343
|
{
|
|
301
344
|
ref,
|
|
302
345
|
...{ 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) },
|
|
@@ -309,12 +352,11 @@ var TabsContent = React7.forwardRef(
|
|
|
309
352
|
TabsContent.displayName = "TabsContent";
|
|
310
353
|
|
|
311
354
|
// src/components/ui/table.tsx
|
|
312
|
-
import * as
|
|
313
|
-
import {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
View5,
|
|
355
|
+
import * as React9 from "react";
|
|
356
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
357
|
+
var Table = React9.forwardRef(
|
|
358
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(View, { ...{ className: "w-full overflow-hidden" }, children: /* @__PURE__ */ jsx10(
|
|
359
|
+
View,
|
|
318
360
|
{
|
|
319
361
|
ref,
|
|
320
362
|
...{ className: cn("w-full text-sm", className) },
|
|
@@ -323,13 +365,13 @@ var Table = React8.forwardRef(
|
|
|
323
365
|
) })
|
|
324
366
|
);
|
|
325
367
|
Table.displayName = "Table";
|
|
326
|
-
var TableHeader =
|
|
327
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
368
|
+
var TableHeader = React9.forwardRef(
|
|
369
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(View, { ref, ...{ className: cn("flex flex-row items-center border-b border-border bg-muted/50", className) }, ...props })
|
|
328
370
|
);
|
|
329
371
|
TableHeader.displayName = "TableHeader";
|
|
330
|
-
var TableBody =
|
|
331
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
332
|
-
|
|
372
|
+
var TableBody = React9.forwardRef(
|
|
373
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
374
|
+
View,
|
|
333
375
|
{
|
|
334
376
|
ref,
|
|
335
377
|
...{ className: cn("flex flex-col [&_>_view:last-child]:border-0", className) },
|
|
@@ -338,9 +380,9 @@ var TableBody = React8.forwardRef(
|
|
|
338
380
|
)
|
|
339
381
|
);
|
|
340
382
|
TableBody.displayName = "TableBody";
|
|
341
|
-
var TableRow =
|
|
342
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
343
|
-
|
|
383
|
+
var TableRow = React9.forwardRef(
|
|
384
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
385
|
+
View,
|
|
344
386
|
{
|
|
345
387
|
ref,
|
|
346
388
|
...{ className: cn(
|
|
@@ -352,9 +394,9 @@ var TableRow = React8.forwardRef(
|
|
|
352
394
|
)
|
|
353
395
|
);
|
|
354
396
|
TableRow.displayName = "TableRow";
|
|
355
|
-
var TableHead =
|
|
356
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
357
|
-
|
|
397
|
+
var TableHead = React9.forwardRef(
|
|
398
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
399
|
+
View,
|
|
358
400
|
{
|
|
359
401
|
ref,
|
|
360
402
|
...{ className: cn(
|
|
@@ -362,66 +404,68 @@ var TableHead = React8.forwardRef(
|
|
|
362
404
|
className
|
|
363
405
|
) },
|
|
364
406
|
...props,
|
|
365
|
-
children: typeof children === "string" ? /* @__PURE__ */
|
|
407
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx10(Text, { ...{ className: "font-semibold text-muted-foreground text-sm" }, children }) : children
|
|
366
408
|
}
|
|
367
409
|
)
|
|
368
410
|
);
|
|
369
411
|
TableHead.displayName = "TableHead";
|
|
370
|
-
var TableCell =
|
|
371
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
372
|
-
|
|
412
|
+
var TableCell = React9.forwardRef(
|
|
413
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
414
|
+
View,
|
|
373
415
|
{
|
|
374
416
|
ref,
|
|
375
417
|
...{ className: cn("p-4 align-middle", className) },
|
|
376
418
|
...props,
|
|
377
|
-
children: typeof children === "string" ? /* @__PURE__ */
|
|
419
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx10(Text, { ...{ className: "text-foreground text-sm" }, children }) : children
|
|
378
420
|
}
|
|
379
421
|
)
|
|
380
422
|
);
|
|
381
423
|
TableCell.displayName = "TableCell";
|
|
382
424
|
|
|
383
425
|
// src/components/ui/dialog.tsx
|
|
384
|
-
import * as
|
|
385
|
-
import { Modal
|
|
386
|
-
import { jsx as
|
|
387
|
-
var DialogContext =
|
|
426
|
+
import * as React10 from "react";
|
|
427
|
+
import { Modal } from "react-native";
|
|
428
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
429
|
+
var DialogContext = React10.createContext(null);
|
|
388
430
|
function useDialog() {
|
|
389
|
-
const context =
|
|
431
|
+
const context = React10.useContext(DialogContext);
|
|
390
432
|
if (!context) throw new Error("Dialog components must be used within a Dialog");
|
|
391
433
|
return context;
|
|
392
434
|
}
|
|
393
435
|
function Dialog({ open = false, onOpenChange, children, ...props }) {
|
|
394
|
-
const [isOpen, setIsOpen] =
|
|
436
|
+
const [isOpen, setIsOpen] = React10.useState(open);
|
|
395
437
|
const isControlled = onOpenChange !== void 0;
|
|
396
438
|
const currentOpen = isControlled ? open : isOpen;
|
|
397
|
-
const setCurrentOpen =
|
|
439
|
+
const setCurrentOpen = React10.useCallback((val) => {
|
|
398
440
|
if (!isControlled) setIsOpen(val);
|
|
399
441
|
onOpenChange == null ? void 0 : onOpenChange(val);
|
|
400
442
|
}, [isControlled, onOpenChange]);
|
|
401
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ jsx11(DialogContext.Provider, { value: { open: currentOpen, onOpenChange: setCurrentOpen }, children });
|
|
402
444
|
}
|
|
403
|
-
var DialogTrigger =
|
|
445
|
+
var DialogTrigger = React10.forwardRef(
|
|
404
446
|
({ onPress, children, ...props }, ref) => {
|
|
405
447
|
const { onOpenChange } = useDialog();
|
|
406
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ jsx11(Pressable, { ref, onPress: (e) => {
|
|
449
|
+
var _a;
|
|
407
450
|
onOpenChange(true);
|
|
408
451
|
onPress == null ? void 0 : onPress(e);
|
|
452
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
409
453
|
}, ...props, children });
|
|
410
454
|
}
|
|
411
455
|
);
|
|
412
456
|
DialogTrigger.displayName = "DialogTrigger";
|
|
413
|
-
var DialogContent =
|
|
457
|
+
var DialogContent = React10.forwardRef(
|
|
414
458
|
({ className, children, ...props }, ref) => {
|
|
415
459
|
const { open, onOpenChange } = useDialog();
|
|
416
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ jsx11(
|
|
417
461
|
Modal,
|
|
418
462
|
{
|
|
419
463
|
visible: open,
|
|
420
464
|
transparent: true,
|
|
421
465
|
animationType: "fade",
|
|
422
466
|
onRequestClose: () => onOpenChange(false),
|
|
423
|
-
children: /* @__PURE__ */
|
|
424
|
-
|
|
467
|
+
children: /* @__PURE__ */ jsx11(View, { ...{ className: "flex-1 items-center justify-center bg-black/80" }, children: /* @__PURE__ */ jsx11(
|
|
468
|
+
View,
|
|
425
469
|
{
|
|
426
470
|
ref,
|
|
427
471
|
...{ className: cn("w-full max-w-lg rounded-xl border border-border bg-background p-6 shadow-lg sm:rounded-[1rem]", className) },
|
|
@@ -434,49 +478,51 @@ var DialogContent = React9.forwardRef(
|
|
|
434
478
|
}
|
|
435
479
|
);
|
|
436
480
|
DialogContent.displayName = "DialogContent";
|
|
437
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
481
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx11(View, { ...{ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className) }, ...props });
|
|
438
482
|
DialogHeader.displayName = "DialogHeader";
|
|
439
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
483
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx11(View, { ...{ className: cn("flex flex-row flex-wrap items-center justify-end space-x-2 mt-4", className) }, ...props });
|
|
440
484
|
DialogFooter.displayName = "DialogFooter";
|
|
441
|
-
var DialogTitle =
|
|
442
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
485
|
+
var DialogTitle = React10.forwardRef(
|
|
486
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(Text, { ref, ...{ className: cn("text-lg font-semibold leading-none tracking-tight text-foreground", className) }, ...props })
|
|
443
487
|
);
|
|
444
488
|
DialogTitle.displayName = "DialogTitle";
|
|
445
|
-
var DialogDescription =
|
|
446
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
489
|
+
var DialogDescription = React10.forwardRef(
|
|
490
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(Text, { ref, ...{ className: cn("text-sm text-muted-foreground", className) }, ...props })
|
|
447
491
|
);
|
|
448
492
|
DialogDescription.displayName = "DialogDescription";
|
|
449
493
|
|
|
450
494
|
// src/components/ui/dropdown-menu.tsx
|
|
451
|
-
import * as
|
|
452
|
-
import { Modal as Modal2
|
|
453
|
-
import { jsx as
|
|
454
|
-
var DropdownContext =
|
|
495
|
+
import * as React11 from "react";
|
|
496
|
+
import { Modal as Modal2 } from "react-native";
|
|
497
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
498
|
+
var DropdownContext = React11.createContext(null);
|
|
455
499
|
function DropdownMenu({ children }) {
|
|
456
|
-
const [open, setOpen] =
|
|
457
|
-
return /* @__PURE__ */
|
|
500
|
+
const [open, setOpen] = React11.useState(false);
|
|
501
|
+
return /* @__PURE__ */ jsx12(DropdownContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ jsx12(View, { ...{ className: "relative" }, children }) });
|
|
458
502
|
}
|
|
459
|
-
var DropdownMenuTrigger =
|
|
503
|
+
var DropdownMenuTrigger = React11.forwardRef(
|
|
460
504
|
({ onPress, children, ...props }, ref) => {
|
|
461
|
-
const context =
|
|
462
|
-
return /* @__PURE__ */
|
|
505
|
+
const context = React11.useContext(DropdownContext);
|
|
506
|
+
return /* @__PURE__ */ jsx12(Pressable, { ref, onPress: (e) => {
|
|
507
|
+
var _a;
|
|
463
508
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
464
509
|
onPress == null ? void 0 : onPress(e);
|
|
510
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
465
511
|
}, ...props, children });
|
|
466
512
|
}
|
|
467
513
|
);
|
|
468
514
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
469
|
-
var DropdownMenuContent =
|
|
515
|
+
var DropdownMenuContent = React11.forwardRef(
|
|
470
516
|
({ className, children, ...props }, ref) => {
|
|
471
|
-
const context =
|
|
517
|
+
const context = React11.useContext(DropdownContext);
|
|
472
518
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
|
|
519
|
+
return /* @__PURE__ */ jsx12(Modal2, { visible: context.open, transparent: true, animationType: "fade", onRequestClose: () => context.setOpen(false), children: /* @__PURE__ */ jsx12(
|
|
520
|
+
Pressable,
|
|
475
521
|
{
|
|
476
522
|
onPress: () => context.setOpen(false),
|
|
477
523
|
...{ className: "flex-1 bg-black/10 justify-end sm:justify-center items-center" },
|
|
478
|
-
children: /* @__PURE__ */
|
|
479
|
-
|
|
524
|
+
children: /* @__PURE__ */ jsx12(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx12(
|
|
525
|
+
View,
|
|
480
526
|
{
|
|
481
527
|
ref,
|
|
482
528
|
...{ 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) },
|
|
@@ -489,64 +535,68 @@ var DropdownMenuContent = React10.forwardRef(
|
|
|
489
535
|
}
|
|
490
536
|
);
|
|
491
537
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
492
|
-
var DropdownMenuItem =
|
|
538
|
+
var DropdownMenuItem = React11.forwardRef(
|
|
493
539
|
({ className, textClassName, onPress, children, ...props }, ref) => {
|
|
494
|
-
const context =
|
|
495
|
-
return /* @__PURE__ */
|
|
496
|
-
|
|
540
|
+
const context = React11.useContext(DropdownContext);
|
|
541
|
+
return /* @__PURE__ */ jsx12(
|
|
542
|
+
Pressable,
|
|
497
543
|
{
|
|
498
544
|
ref,
|
|
499
545
|
onPress: (e) => {
|
|
546
|
+
var _a;
|
|
500
547
|
context == null ? void 0 : context.setOpen(false);
|
|
501
548
|
onPress == null ? void 0 : onPress(e);
|
|
549
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
502
550
|
},
|
|
503
551
|
...{ 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) },
|
|
504
552
|
...props,
|
|
505
|
-
children: typeof children === "string" ? /* @__PURE__ */
|
|
553
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx12(Text, { ...{ className: cn("text-foreground", textClassName) }, children }) : children
|
|
506
554
|
}
|
|
507
555
|
);
|
|
508
556
|
}
|
|
509
557
|
);
|
|
510
558
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
511
|
-
var DropdownMenuLabel =
|
|
512
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
559
|
+
var DropdownMenuLabel = React11.forwardRef(
|
|
560
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx12(Text, { ref, ...{ className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", className) }, ...props })
|
|
513
561
|
);
|
|
514
562
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
515
|
-
var DropdownMenuSeparator =
|
|
516
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
563
|
+
var DropdownMenuSeparator = React11.forwardRef(
|
|
564
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx12(View, { ref, ...{ className: cn("-mx-1 my-1 h-px bg-muted", className) }, ...props })
|
|
517
565
|
);
|
|
518
566
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
519
567
|
|
|
520
568
|
// src/components/ui/popover.tsx
|
|
521
|
-
import * as
|
|
522
|
-
import { Modal as Modal3
|
|
523
|
-
import { jsx as
|
|
524
|
-
var PopoverContext =
|
|
569
|
+
import * as React12 from "react";
|
|
570
|
+
import { Modal as Modal3 } from "react-native";
|
|
571
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
572
|
+
var PopoverContext = React12.createContext(null);
|
|
525
573
|
function Popover({ children }) {
|
|
526
|
-
const [open, setOpen] =
|
|
527
|
-
return /* @__PURE__ */
|
|
574
|
+
const [open, setOpen] = React12.useState(false);
|
|
575
|
+
return /* @__PURE__ */ jsx13(PopoverContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ jsx13(View, { ...{ className: "relative" }, children }) });
|
|
528
576
|
}
|
|
529
|
-
var PopoverTrigger =
|
|
577
|
+
var PopoverTrigger = React12.forwardRef(
|
|
530
578
|
({ onPress, children, ...props }, ref) => {
|
|
531
|
-
const context =
|
|
532
|
-
return /* @__PURE__ */
|
|
579
|
+
const context = React12.useContext(PopoverContext);
|
|
580
|
+
return /* @__PURE__ */ jsx13(Pressable, { ref, onPress: (e) => {
|
|
581
|
+
var _a;
|
|
533
582
|
context == null ? void 0 : context.setOpen(!context.open);
|
|
534
583
|
onPress == null ? void 0 : onPress(e);
|
|
584
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
535
585
|
}, ...props, children });
|
|
536
586
|
}
|
|
537
587
|
);
|
|
538
588
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
539
|
-
var PopoverContent =
|
|
589
|
+
var PopoverContent = React12.forwardRef(
|
|
540
590
|
({ className, children, ...props }, ref) => {
|
|
541
|
-
const context =
|
|
591
|
+
const context = React12.useContext(PopoverContext);
|
|
542
592
|
if (!(context == null ? void 0 : context.open)) return null;
|
|
543
|
-
return /* @__PURE__ */
|
|
544
|
-
|
|
593
|
+
return /* @__PURE__ */ jsx13(Modal3, { visible: context.open, transparent: true, animationType: "fade", onRequestClose: () => context.setOpen(false), children: /* @__PURE__ */ jsx13(
|
|
594
|
+
Pressable,
|
|
545
595
|
{
|
|
546
596
|
onPress: () => context.setOpen(false),
|
|
547
597
|
...{ className: "flex-1 bg-transparent justify-center items-center" },
|
|
548
|
-
children: /* @__PURE__ */
|
|
549
|
-
|
|
598
|
+
children: /* @__PURE__ */ jsx13(Pressable, { onPress: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx13(
|
|
599
|
+
View,
|
|
550
600
|
{
|
|
551
601
|
ref,
|
|
552
602
|
...{ className: cn("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none", className) },
|