getlotui 0.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/README.md +78 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +5 -0
- package/dist/commands/add.d.ts +1 -0
- package/dist/commands/add.js +37 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -0
- package/dist/templates/expo/Accordion.d.ts +14 -0
- package/dist/templates/expo/Accordion.js +118 -0
- package/dist/templates/expo/Accordion.tsx +152 -0
- package/dist/templates/expo/AlertDialog.d.ts +12 -0
- package/dist/templates/expo/AlertDialog.js +126 -0
- package/dist/templates/expo/AlertDialog.tsx +147 -0
- package/dist/templates/expo/Avatar.d.ts +8 -0
- package/dist/templates/expo/Avatar.js +81 -0
- package/dist/templates/expo/Avatar.tsx +78 -0
- package/dist/templates/expo/Badge.d.ts +6 -0
- package/dist/templates/expo/Badge.js +60 -0
- package/dist/templates/expo/Badge.tsx +67 -0
- package/dist/templates/expo/Button.d.ts +9 -0
- package/dist/templates/expo/Button.js +37 -0
- package/dist/templates/expo/Button.tsx +53 -0
- package/dist/templates/expo/Dropdown.d.ts +12 -0
- package/dist/templates/expo/Dropdown.js +91 -0
- package/dist/templates/expo/Dropdown.tsx +100 -0
- package/dist/templates/expo/Input.d.ts +11 -0
- package/dist/templates/expo/Input.js +43 -0
- package/dist/templates/expo/Input.tsx +67 -0
- package/dist/templates/expo/Toast.d.ts +16 -0
- package/dist/templates/expo/Toast.js +142 -0
- package/dist/templates/expo/Toast.tsx +161 -0
- package/dist/templates/expo/utils.d.ts +4 -0
- package/dist/templates/expo/utils.js +10 -0
- package/dist/templates/expo/utils.ts +8 -0
- package/dist/templates/flutter/Accordion.dart +142 -0
- package/dist/templates/flutter/Alert.dart +96 -0
- package/dist/templates/flutter/AlertDialog.dart +175 -0
- package/dist/templates/flutter/Avatar.dart +82 -0
- package/dist/templates/flutter/Badge.dart +89 -0
- package/dist/templates/flutter/Button.dart +116 -0
- package/dist/templates/flutter/Card.dart +91 -0
- package/dist/templates/flutter/Input.dart +73 -0
- package/dist/templates/flutter/Text.dart +87 -0
- package/dist/templates/flutter/utils.dart +13 -0
- package/dist/templates/templates/expo/Button.tsx +50 -0
- package/dist/templates/templates/expo/Input.tsx +67 -0
- package/dist/templates/web/Accordion.d.ts +7 -0
- package/dist/templates/web/Accordion.js +59 -0
- package/dist/templates/web/Accordion.tsx +64 -0
- package/dist/templates/web/Alert.d.ts +9 -0
- package/dist/templates/web/Alert.js +64 -0
- package/dist/templates/web/Alert.tsx +71 -0
- package/dist/templates/web/AlertDialog.d.ts +14 -0
- package/dist/templates/web/AlertDialog.js +85 -0
- package/dist/templates/web/AlertDialog.tsx +164 -0
- package/dist/templates/web/Avatar.d.ts +6 -0
- package/dist/templates/web/Avatar.js +50 -0
- package/dist/templates/web/Avatar.tsx +51 -0
- package/dist/templates/web/Badge.d.ts +9 -0
- package/dist/templates/web/Badge.js +59 -0
- package/dist/templates/web/Badge.tsx +38 -0
- package/dist/templates/web/Button.d.ts +10 -0
- package/dist/templates/web/Button.js +70 -0
- package/dist/templates/web/Button.tsx +60 -0
- package/dist/templates/web/Card.d.ts +9 -0
- package/dist/templates/web/Card.js +65 -0
- package/dist/templates/web/Card.tsx +92 -0
- package/dist/templates/web/Dropdown.d.ts +27 -0
- package/dist/templates/web/Dropdown.js +95 -0
- package/dist/templates/web/Dropdown.tsx +198 -0
- package/dist/templates/web/Input.d.ts +3 -0
- package/dist/templates/web/Input.js +41 -0
- package/dist/templates/web/Input.tsx +21 -0
- package/dist/templates/web/Tabs.d.ts +7 -0
- package/dist/templates/web/Tabs.js +55 -0
- package/dist/templates/web/Tabs.tsx +66 -0
- package/dist/templates/web/Toast.d.ts +15 -0
- package/dist/templates/web/Toast.js +75 -0
- package/dist/templates/web/Toast.tsx +126 -0
- package/dist/templates/web/utils.d.ts +2 -0
- package/dist/templates/web/utils.js +8 -0
- package/dist/templates/web/utils.ts +6 -0
- package/dist/utils/detect.d.ts +19 -0
- package/dist/utils/detect.js +90 -0
- package/dist/utils/fs.d.ts +5 -0
- package/dist/utils/fs.js +35 -0
- package/getlotui.config.json +4 -0
- package/package.json +31 -0
- package/src/bin.ts +5 -0
- package/src/commands/add.ts +50 -0
- package/src/commands/init.ts +108 -0
- package/src/index.ts +23 -0
- package/src/templates/expo/Accordion.tsx +152 -0
- package/src/templates/expo/AlertDialog.tsx +147 -0
- package/src/templates/expo/Avatar.tsx +78 -0
- package/src/templates/expo/Badge.tsx +67 -0
- package/src/templates/expo/Button.tsx +53 -0
- package/src/templates/expo/Dropdown.tsx +100 -0
- package/src/templates/expo/Input.tsx +67 -0
- package/src/templates/expo/Toast.tsx +161 -0
- package/src/templates/expo/utils.ts +8 -0
- package/src/templates/flutter/Accordion.dart +142 -0
- package/src/templates/flutter/Alert.dart +96 -0
- package/src/templates/flutter/AlertDialog.dart +175 -0
- package/src/templates/flutter/Avatar.dart +82 -0
- package/src/templates/flutter/Badge.dart +89 -0
- package/src/templates/flutter/Button.dart +116 -0
- package/src/templates/flutter/Card.dart +91 -0
- package/src/templates/flutter/Input.dart +73 -0
- package/src/templates/flutter/Text.dart +87 -0
- package/src/templates/flutter/utils.dart +13 -0
- package/src/templates/web/Accordion.tsx +64 -0
- package/src/templates/web/Alert.tsx +71 -0
- package/src/templates/web/AlertDialog.tsx +164 -0
- package/src/templates/web/Avatar.tsx +51 -0
- package/src/templates/web/Badge.tsx +38 -0
- package/src/templates/web/Button.tsx +60 -0
- package/src/templates/web/Card.tsx +92 -0
- package/src/templates/web/Dropdown.tsx +198 -0
- package/src/templates/web/Input.tsx +21 -0
- package/src/templates/web/Tabs.tsx +66 -0
- package/src/templates/web/Toast.tsx +126 -0
- package/src/templates/web/utils.ts +6 -0
- package/src/utils/detect.ts +81 -0
- package/src/utils/fs.ts +32 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import '../theme/tokens.dart';
|
|
3
|
+
|
|
4
|
+
class CrossUICard extends StatelessWidget {
|
|
5
|
+
final Widget? header;
|
|
6
|
+
final Widget? title;
|
|
7
|
+
final Widget? description;
|
|
8
|
+
final Widget child;
|
|
9
|
+
final Widget? footer;
|
|
10
|
+
final VoidCallback? onTap;
|
|
11
|
+
|
|
12
|
+
const CrossUICard({
|
|
13
|
+
Key? key,
|
|
14
|
+
required this.child,
|
|
15
|
+
this.header,
|
|
16
|
+
this.title,
|
|
17
|
+
this.description,
|
|
18
|
+
this.footer,
|
|
19
|
+
this.onTap,
|
|
20
|
+
}) : super(key: key);
|
|
21
|
+
|
|
22
|
+
@override
|
|
23
|
+
Widget build(BuildContext context) {
|
|
24
|
+
return InkWell(
|
|
25
|
+
onTap: onTap,
|
|
26
|
+
borderRadius: BorderRadius.circular(CrossUITokens.radiusLarge),
|
|
27
|
+
child: Container(
|
|
28
|
+
decoration: BoxDecoration(
|
|
29
|
+
color: Colors.white,
|
|
30
|
+
borderRadius: BorderRadius.circular(CrossUITokens.radiusLarge),
|
|
31
|
+
border: Border.all(color: CrossUITokens.border),
|
|
32
|
+
boxShadow: [
|
|
33
|
+
BoxShadow(
|
|
34
|
+
color: Colors.black.withOpacity(0.05),
|
|
35
|
+
blurRadius: 10,
|
|
36
|
+
offset: const Offset(0, 4),
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
),
|
|
40
|
+
child: Column(
|
|
41
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
42
|
+
children: [
|
|
43
|
+
if (header != null || title != null || description != null)
|
|
44
|
+
Padding(
|
|
45
|
+
padding: const EdgeInsets.all(CrossUITokens.spacingL),
|
|
46
|
+
child: Column(
|
|
47
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
48
|
+
children: [
|
|
49
|
+
if (header != null) header!,
|
|
50
|
+
if (title != null) ...[
|
|
51
|
+
DefaultTextStyle(
|
|
52
|
+
style: const TextStyle(
|
|
53
|
+
fontSize: CrossUITokens.fontSize2xl,
|
|
54
|
+
fontWeight: FontWeight.bold,
|
|
55
|
+
color: CrossUITokens.dark,
|
|
56
|
+
),
|
|
57
|
+
child: title!,
|
|
58
|
+
),
|
|
59
|
+
],
|
|
60
|
+
if (description != null) ...[
|
|
61
|
+
const SizedBox(height: 4),
|
|
62
|
+
DefaultTextStyle(
|
|
63
|
+
style: const TextStyle(
|
|
64
|
+
fontSize: CrossUITokens.fontSizeSm,
|
|
65
|
+
color: Colors.grey,
|
|
66
|
+
),
|
|
67
|
+
child: description!,
|
|
68
|
+
),
|
|
69
|
+
],
|
|
70
|
+
],
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
Padding(
|
|
74
|
+
padding: const EdgeInsets.symmetric(horizontal: CrossUITokens.spacingL),
|
|
75
|
+
child: child,
|
|
76
|
+
),
|
|
77
|
+
if (footer != null) ...[
|
|
78
|
+
const SizedBox(height: CrossUITokens.spacingL),
|
|
79
|
+
const Divider(height: 1),
|
|
80
|
+
Padding(
|
|
81
|
+
padding: const EdgeInsets.all(CrossUITokens.spacingL),
|
|
82
|
+
child: footer!,
|
|
83
|
+
),
|
|
84
|
+
] else
|
|
85
|
+
const SizedBox(height: CrossUITokens.spacingL),
|
|
86
|
+
],
|
|
87
|
+
),
|
|
88
|
+
),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import '../theme/tokens.dart';
|
|
3
|
+
|
|
4
|
+
class CrossUIInput extends StatelessWidget {
|
|
5
|
+
final String? placeholder;
|
|
6
|
+
final TextEditingController? controller;
|
|
7
|
+
final bool obscureText;
|
|
8
|
+
final TextInputType? keyboardType;
|
|
9
|
+
final void Function(String)? onChanged;
|
|
10
|
+
final bool disabled;
|
|
11
|
+
final String? label;
|
|
12
|
+
|
|
13
|
+
const CrossUIInput({
|
|
14
|
+
Key? key,
|
|
15
|
+
this.placeholder,
|
|
16
|
+
this.controller,
|
|
17
|
+
this.obscureText = false,
|
|
18
|
+
this.keyboardType,
|
|
19
|
+
this.onChanged,
|
|
20
|
+
this.disabled = false,
|
|
21
|
+
this.label,
|
|
22
|
+
}) : super(key: key);
|
|
23
|
+
|
|
24
|
+
@override
|
|
25
|
+
Widget build(BuildContext context) {
|
|
26
|
+
return Column(
|
|
27
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
28
|
+
children: [
|
|
29
|
+
if (label != null) ...[
|
|
30
|
+
Text(
|
|
31
|
+
label!,
|
|
32
|
+
style: const TextStyle(
|
|
33
|
+
fontSize: CrossUITokens.fontSizeSm,
|
|
34
|
+
fontWeight: FontWeight.w600,
|
|
35
|
+
color: CrossUITokens.dark,
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
const SizedBox(height: CrossUITokens.spacingXs),
|
|
39
|
+
],
|
|
40
|
+
TextField(
|
|
41
|
+
controller: controller,
|
|
42
|
+
obscureText: obscureText,
|
|
43
|
+
keyboardType: keyboardType,
|
|
44
|
+
onChanged: onChanged,
|
|
45
|
+
enabled: !disabled,
|
|
46
|
+
style: const TextStyle(fontSize: CrossUITokens.fontSizeBase),
|
|
47
|
+
decoration: InputDecoration(
|
|
48
|
+
hintText: placeholder,
|
|
49
|
+
hintStyle: const TextStyle(color: Color(0xFF94A3B8)),
|
|
50
|
+
contentPadding: const EdgeInsets.symmetric(
|
|
51
|
+
horizontal: CrossUITokens.spacingM,
|
|
52
|
+
vertical: CrossUITokens.spacingM,
|
|
53
|
+
),
|
|
54
|
+
filled: true,
|
|
55
|
+
fillColor: disabled ? const Color(0xFFF1F5F9) : Colors.white,
|
|
56
|
+
enabledBorder: OutlineInputBorder(
|
|
57
|
+
borderRadius: BorderRadius.circular(CrossUITokens.radiusMedium),
|
|
58
|
+
borderSide: const BorderSide(color: CrossUITokens.border),
|
|
59
|
+
),
|
|
60
|
+
focusedBorder: OutlineInputBorder(
|
|
61
|
+
borderRadius: BorderRadius.circular(CrossUITokens.radiusMedium),
|
|
62
|
+
borderSide: const BorderSide(color: CrossUITokens.primary, width: 2),
|
|
63
|
+
),
|
|
64
|
+
disabledBorder: OutlineInputBorder(
|
|
65
|
+
borderRadius: BorderRadius.circular(CrossUITokens.radiusMedium),
|
|
66
|
+
borderSide: const BorderSide(color: CrossUITokens.border),
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
),
|
|
70
|
+
],
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import '../theme/tokens.dart';
|
|
3
|
+
|
|
4
|
+
enum CrossUITextVariant { h1, h2, h3, h4, h5, h6, body, subtitle, caption, muted, code }
|
|
5
|
+
|
|
6
|
+
class CrossUIText extends StatelessWidget {
|
|
7
|
+
final String text;
|
|
8
|
+
final CrossUITextVariant variant;
|
|
9
|
+
final Color? color;
|
|
10
|
+
final TextAlign? textAlign;
|
|
11
|
+
final FontWeight? fontWeight;
|
|
12
|
+
|
|
13
|
+
const CrossUIText(
|
|
14
|
+
this.text, {
|
|
15
|
+
Key? key,
|
|
16
|
+
this.variant = CrossUITextVariant.body,
|
|
17
|
+
this.color,
|
|
18
|
+
this.textAlign,
|
|
19
|
+
this.fontWeight,
|
|
20
|
+
}) : super(key: key);
|
|
21
|
+
|
|
22
|
+
@override
|
|
23
|
+
Widget build(BuildContext context) {
|
|
24
|
+
double fontSize;
|
|
25
|
+
FontWeight defaultFontWeight = FontWeight.normal;
|
|
26
|
+
Color defaultColor = color ?? CrossUITokens.dark;
|
|
27
|
+
bool isCode = false;
|
|
28
|
+
|
|
29
|
+
switch (variant) {
|
|
30
|
+
case CrossUITextVariant.h1:
|
|
31
|
+
fontSize = CrossUITokens.fontSize6xl;
|
|
32
|
+
defaultFontWeight = FontWeight.w900;
|
|
33
|
+
break;
|
|
34
|
+
case CrossUITextVariant.h2:
|
|
35
|
+
fontSize = CrossUITokens.fontSize4xl;
|
|
36
|
+
defaultFontWeight = FontWeight.bold;
|
|
37
|
+
break;
|
|
38
|
+
case CrossUITextVariant.h3:
|
|
39
|
+
fontSize = CrossUITokens.fontSize2xl;
|
|
40
|
+
defaultFontWeight = FontWeight.bold;
|
|
41
|
+
break;
|
|
42
|
+
case CrossUITextVariant.h4:
|
|
43
|
+
fontSize = CrossUITokens.fontSizeXl;
|
|
44
|
+
defaultFontWeight = FontWeight.w600;
|
|
45
|
+
break;
|
|
46
|
+
case CrossUITextVariant.h5:
|
|
47
|
+
fontSize = CrossUITokens.fontSizeLg;
|
|
48
|
+
defaultFontWeight = FontWeight.w600;
|
|
49
|
+
break;
|
|
50
|
+
case CrossUITextVariant.h6:
|
|
51
|
+
fontSize = CrossUITokens.fontSizeBase;
|
|
52
|
+
defaultFontWeight = FontWeight.w600;
|
|
53
|
+
break;
|
|
54
|
+
case CrossUITextVariant.subtitle:
|
|
55
|
+
fontSize = CrossUITokens.fontSizeLg;
|
|
56
|
+
defaultColor = color ?? Colors.grey[700]!;
|
|
57
|
+
break;
|
|
58
|
+
case CrossUITextVariant.caption:
|
|
59
|
+
fontSize = CrossUITokens.fontSizeXs;
|
|
60
|
+
defaultColor = color ?? Colors.grey[600]!;
|
|
61
|
+
break;
|
|
62
|
+
case CrossUITextVariant.muted:
|
|
63
|
+
fontSize = CrossUITokens.fontSizeSm;
|
|
64
|
+
defaultColor = color ?? Colors.grey[500]!;
|
|
65
|
+
break;
|
|
66
|
+
case CrossUITextVariant.code:
|
|
67
|
+
fontSize = CrossUITokens.fontSizeSm;
|
|
68
|
+
isCode = true;
|
|
69
|
+
break;
|
|
70
|
+
case CrossUITextVariant.body:
|
|
71
|
+
default:
|
|
72
|
+
fontSize = CrossUITokens.fontSizeBase;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Text(
|
|
77
|
+
text,
|
|
78
|
+
textAlign: textAlign,
|
|
79
|
+
style: TextStyle(
|
|
80
|
+
fontSize: fontSize,
|
|
81
|
+
fontWeight: fontWeight ?? defaultFontWeight,
|
|
82
|
+
color: defaultColor,
|
|
83
|
+
fontFamily: isCode ? 'monospace' : null,
|
|
84
|
+
),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
|
|
3
|
+
class CrossUIUtils {
|
|
4
|
+
static TextStyle cnText(List<TextStyle?> styles) {
|
|
5
|
+
TextStyle result = const TextStyle();
|
|
6
|
+
for (var style in styles) {
|
|
7
|
+
if (style != null) {
|
|
8
|
+
result = result.merge(style);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableOpacity, Text, StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
title: string;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
variant?: "default" | "primary" | "secondary";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Button: React.FC<ButtonProps> = ({
|
|
12
|
+
title,
|
|
13
|
+
onPress,
|
|
14
|
+
variant = "default",
|
|
15
|
+
disabled = false,
|
|
16
|
+
}) => {
|
|
17
|
+
const backgroundColor =
|
|
18
|
+
variant === "primary"
|
|
19
|
+
? "#2563eb" // blue-600
|
|
20
|
+
: variant === "secondary"
|
|
21
|
+
? "#6b7280" // gray-500
|
|
22
|
+
: "#e5e7eb"; // gray-200
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<TouchableOpacity
|
|
26
|
+
style={[styles.button, { backgroundColor }, disabled && styles.disabled]}
|
|
27
|
+
onPress={onPress}
|
|
28
|
+
disabled={disabled}
|
|
29
|
+
>
|
|
30
|
+
<Text style={styles.text}>{title}</Text>
|
|
31
|
+
</TouchableOpacity>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
button: {
|
|
37
|
+
paddingVertical: 12,
|
|
38
|
+
paddingHorizontal: 24,
|
|
39
|
+
borderRadius: 4,
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
},
|
|
43
|
+
text: {
|
|
44
|
+
color: "#fff",
|
|
45
|
+
fontWeight: "600",
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
opacity: 0.6,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextInput, StyleSheet, View, Text } from "react-native";
|
|
3
|
+
|
|
4
|
+
type InputProps = {
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChangeText: (text: string) => void;
|
|
9
|
+
secureTextEntry?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Input: React.FC<InputProps> = ({
|
|
14
|
+
label,
|
|
15
|
+
placeholder,
|
|
16
|
+
value,
|
|
17
|
+
onChangeText,
|
|
18
|
+
secureTextEntry = false,
|
|
19
|
+
disabled = false,
|
|
20
|
+
}) => {
|
|
21
|
+
const colors = {
|
|
22
|
+
text: "#111827", // gray-900
|
|
23
|
+
border: "#d1d5db", // gray-300
|
|
24
|
+
muted: "#9ca3af", // gray-400
|
|
25
|
+
};
|
|
26
|
+
return (
|
|
27
|
+
<View style={styles.container}>
|
|
28
|
+
{label && (
|
|
29
|
+
<Text style={[styles.label, { color: colors.text }]}>{label}</Text>
|
|
30
|
+
)}
|
|
31
|
+
<TextInput
|
|
32
|
+
style={[
|
|
33
|
+
styles.input,
|
|
34
|
+
{ borderColor: colors.border, color: colors.text },
|
|
35
|
+
disabled && styles.disabled,
|
|
36
|
+
]}
|
|
37
|
+
placeholder={placeholder}
|
|
38
|
+
placeholderTextColor={colors.muted}
|
|
39
|
+
value={value}
|
|
40
|
+
onChangeText={onChangeText}
|
|
41
|
+
secureTextEntry={secureTextEntry}
|
|
42
|
+
editable={!disabled}
|
|
43
|
+
/>
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
container: {
|
|
50
|
+
marginVertical: 8,
|
|
51
|
+
},
|
|
52
|
+
label: {
|
|
53
|
+
marginBottom: 4,
|
|
54
|
+
fontSize: 14,
|
|
55
|
+
fontWeight: "500",
|
|
56
|
+
},
|
|
57
|
+
input: {
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderRadius: 4,
|
|
60
|
+
paddingHorizontal: 12,
|
|
61
|
+
paddingVertical: 8,
|
|
62
|
+
fontSize: 16,
|
|
63
|
+
},
|
|
64
|
+
disabled: {
|
|
65
|
+
opacity: 0.6,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): React.JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Accordion = Accordion;
|
|
37
|
+
exports.AccordionItem = AccordionItem;
|
|
38
|
+
exports.AccordionTrigger = AccordionTrigger;
|
|
39
|
+
exports.AccordionContent = AccordionContent;
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
|
|
42
|
+
const lucide_react_1 = require("lucide-react");
|
|
43
|
+
const utils_1 = require("@/lib/utils");
|
|
44
|
+
function Accordion({ ...props }) {
|
|
45
|
+
return React.createElement(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
46
|
+
}
|
|
47
|
+
function AccordionItem({ className, ...props }) {
|
|
48
|
+
return (React.createElement(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: (0, utils_1.cn)("border-b", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
51
|
+
return (React.createElement(AccordionPrimitive.Header, { className: "flex" },
|
|
52
|
+
React.createElement(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: (0, utils_1.cn)("flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline [&&[data-state=open]>svg]:rotate-180", className), ...props },
|
|
53
|
+
children,
|
|
54
|
+
React.createElement(lucide_react_1.ChevronDown, { className: "size-4 shrink-0 transition-transform duration-200" }))));
|
|
55
|
+
}
|
|
56
|
+
function AccordionContent({ className, children, ...props }) {
|
|
57
|
+
return (React.createElement(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props },
|
|
58
|
+
React.createElement("div", { className: (0, utils_1.cn)("pb-4 pt-0", className) }, children)));
|
|
59
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
import { ChevronDown } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
function Accordion({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
10
|
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function AccordionItem({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
17
|
+
return (
|
|
18
|
+
<AccordionPrimitive.Item
|
|
19
|
+
data-slot="accordion-item"
|
|
20
|
+
className={cn("border-b", className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function AccordionTrigger({
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
31
|
+
return (
|
|
32
|
+
<AccordionPrimitive.Header className="flex">
|
|
33
|
+
<AccordionPrimitive.Trigger
|
|
34
|
+
data-slot="accordion-trigger"
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline [&&[data-state=open]>svg]:rotate-180",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
<ChevronDown className="size-4 shrink-0 transition-transform duration-200" />
|
|
43
|
+
</AccordionPrimitive.Trigger>
|
|
44
|
+
</AccordionPrimitive.Header>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function AccordionContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
53
|
+
return (
|
|
54
|
+
<AccordionPrimitive.Content
|
|
55
|
+
data-slot="accordion-content"
|
|
56
|
+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
60
|
+
</AccordionPrimitive.Content>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "success" | "info" | "warning" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Alert = Alert;
|
|
37
|
+
exports.AlertTitle = AlertTitle;
|
|
38
|
+
exports.AlertDescription = AlertDescription;
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
+
const utils_1 = require("@/lib/utils");
|
|
42
|
+
const alertVariants = (0, class_variance_authority_1.cva)("relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-[auto_1fr] gap-x-3 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "bg-card text-card-foreground",
|
|
46
|
+
destructive: "text-destructive border-destructive/50 bg-destructive/5 dark:bg-destructive/10 [&>svg]:text-destructive",
|
|
47
|
+
info: "text-blue-600 border-blue-500/50 bg-blue-50 dark:bg-blue-950/20 dark:text-blue-400 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",
|
|
48
|
+
success: "text-green-600 border-green-500/50 bg-green-50 dark:bg-green-950/20 dark:text-green-400 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",
|
|
49
|
+
warning: "text-yellow-600 border-yellow-500/50 bg-yellow-50 dark:bg-yellow-950/20 dark:text-yellow-400 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
variant: "default",
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
function Alert({ className, variant, ...props }) {
|
|
57
|
+
return (React.createElement("div", { "data-slot": "alert", role: "alert", className: (0, utils_1.cn)(alertVariants({ variant }), className), ...props }));
|
|
58
|
+
}
|
|
59
|
+
function AlertTitle({ className, ...props }) {
|
|
60
|
+
return (React.createElement("div", { "data-slot": "alert-title", className: (0, utils_1.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className), ...props }));
|
|
61
|
+
}
|
|
62
|
+
function AlertDescription({ className, ...props }) {
|
|
63
|
+
return (React.createElement("div", { "data-slot": "alert-description", className: (0, utils_1.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className), ...props }));
|
|
64
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-[auto_1fr] gap-x-3 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"text-destructive border-destructive/50 bg-destructive/5 dark:bg-destructive/10 [&>svg]:text-destructive",
|
|
14
|
+
info: "text-blue-600 border-blue-500/50 bg-blue-50 dark:bg-blue-950/20 dark:text-blue-400 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",
|
|
15
|
+
success:
|
|
16
|
+
"text-green-600 border-green-500/50 bg-green-50 dark:bg-green-950/20 dark:text-green-400 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",
|
|
17
|
+
warning:
|
|
18
|
+
"text-yellow-600 border-yellow-500/50 bg-yellow-50 dark:bg-yellow-950/20 dark:text-yellow-400 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default",
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
function Alert({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="alert"
|
|
35
|
+
role="alert"
|
|
36
|
+
className={cn(alertVariants({ variant }), className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
43
|
+
return (
|
|
44
|
+
<div
|
|
45
|
+
data-slot="alert-title"
|
|
46
|
+
className={cn(
|
|
47
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function AlertDescription({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<"div">) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="alert-description"
|
|
62
|
+
className={cn(
|
|
63
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
|
|
7
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
11
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
12
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): React.JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|