panelui-native 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/lib/module/components/alert/index.js +122 -0
- package/lib/module/components/alert/index.js.map +1 -0
- package/lib/module/components/avatar/index.js +74 -0
- package/lib/module/components/avatar/index.js.map +1 -0
- package/lib/module/components/badge/index.js +77 -0
- package/lib/module/components/badge/index.js.map +1 -0
- package/lib/module/components/bottom-sheet/index.js +137 -0
- package/lib/module/components/bottom-sheet/index.js.map +1 -0
- package/lib/module/components/button/index.js +101 -0
- package/lib/module/components/button/index.js.map +1 -0
- package/lib/module/components/card/index.js +73 -0
- package/lib/module/components/card/index.js.map +1 -0
- package/lib/module/components/checkbox/index.js +84 -0
- package/lib/module/components/checkbox/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +140 -0
- package/lib/module/components/dialog/index.js.map +1 -0
- package/lib/module/components/input/index.js +92 -0
- package/lib/module/components/input/index.js.map +1 -0
- package/lib/module/components/radio-group/index.js +92 -0
- package/lib/module/components/radio-group/index.js.map +1 -0
- package/lib/module/components/select/index.js +147 -0
- package/lib/module/components/select/index.js.map +1 -0
- package/lib/module/components/skeleton/index.js +26 -0
- package/lib/module/components/skeleton/index.js.map +1 -0
- package/lib/module/components/spinner/index.js +47 -0
- package/lib/module/components/spinner/index.js.map +1 -0
- package/lib/module/components/switch/index.js +96 -0
- package/lib/module/components/switch/index.js.map +1 -0
- package/lib/module/components/tabs/index.js +161 -0
- package/lib/module/components/tabs/index.js.map +1 -0
- package/lib/module/icons/index.js +65 -0
- package/lib/module/icons/index.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/primitives/animated-pressable.js +51 -0
- package/lib/module/primitives/animated-pressable.js.map +1 -0
- package/lib/module/primitives/portal.js +76 -0
- package/lib/module/primitives/portal.js.map +1 -0
- package/lib/module/primitives/text.js +51 -0
- package/lib/module/primitives/text.js.map +1 -0
- package/lib/module/providers/panel-ui-provider.js +29 -0
- package/lib/module/providers/panel-ui-provider.js.map +1 -0
- package/lib/module/theme/use-theme.js +19 -0
- package/lib/module/theme/use-theme.js.map +1 -0
- package/lib/module/uniwind-env.d.js +4 -0
- package/lib/module/uniwind-env.d.js.map +1 -0
- package/lib/module/utils/cn.js +8 -0
- package/lib/module/utils/cn.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/alert/index.d.ts +113 -0
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar/index.d.ts +83 -0
- package/lib/typescript/src/components/avatar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/badge/index.d.ts +114 -0
- package/lib/typescript/src/components/badge/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +30 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts +159 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/card/index.d.ts +13 -0
- package/lib/typescript/src/components/card/index.d.ts.map +1 -0
- package/lib/typescript/src/components/checkbox/index.d.ts +47 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts +50 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/components/input/index.d.ts +12 -0
- package/lib/typescript/src/components/input/index.d.ts.map +1 -0
- package/lib/typescript/src/components/radio-group/index.d.ts +20 -0
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts +23 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -0
- package/lib/typescript/src/components/skeleton/index.d.ts +6 -0
- package/lib/typescript/src/components/skeleton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/spinner/index.d.ts +27 -0
- package/lib/typescript/src/components/spinner/index.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/index.d.ts +76 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -0
- package/lib/typescript/src/components/tabs/index.d.ts +34 -0
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +9 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +23 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/animated-pressable.d.ts +14 -0
- package/lib/typescript/src/primitives/animated-pressable.d.ts.map +1 -0
- package/lib/typescript/src/primitives/portal.d.ts +11 -0
- package/lib/typescript/src/primitives/portal.d.ts.map +1 -0
- package/lib/typescript/src/primitives/text.d.ts +66 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -0
- package/lib/typescript/src/providers/panel-ui-provider.d.ts +13 -0
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -0
- package/lib/typescript/src/theme/use-theme.d.ts +12 -0
- package/lib/typescript/src/theme/use-theme.d.ts.map +1 -0
- package/lib/typescript/src/utils/cn.d.ts +3 -0
- package/lib/typescript/src/utils/cn.d.ts.map +1 -0
- package/package.json +73 -0
- package/src/components/alert/index.tsx +106 -0
- package/src/components/avatar/index.tsx +68 -0
- package/src/components/badge/index.tsx +51 -0
- package/src/components/bottom-sheet/index.tsx +186 -0
- package/src/components/button/index.tsx +93 -0
- package/src/components/card/index.tsx +64 -0
- package/src/components/checkbox/index.tsx +79 -0
- package/src/components/dialog/index.tsx +180 -0
- package/src/components/input/index.tsx +104 -0
- package/src/components/radio-group/index.tsx +118 -0
- package/src/components/select/index.tsx +165 -0
- package/src/components/skeleton/index.tsx +34 -0
- package/src/components/spinner/index.tsx +53 -0
- package/src/components/switch/index.tsx +83 -0
- package/src/components/tabs/index.tsx +208 -0
- package/src/icons/index.tsx +48 -0
- package/src/index.ts +54 -0
- package/src/primitives/animated-pressable.tsx +71 -0
- package/src/primitives/portal.tsx +90 -0
- package/src/primitives/text.tsx +47 -0
- package/src/providers/panel-ui-provider.tsx +30 -0
- package/src/theme/use-theme.ts +18 -0
- package/src/uniwind-env.d.ts +1 -0
- package/src/utils/cn.ts +6 -0
- package/theme.css +143 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, forwardRef, useContext } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { tv } from 'tailwind-variants';
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { Text } from "../../primitives/text.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const alertVariants = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: 'w-full gap-1 rounded-xl border p-4',
|
|
12
|
+
title: 'font-semibold',
|
|
13
|
+
description: 'text-sm'
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: {
|
|
18
|
+
root: 'border-border bg-card',
|
|
19
|
+
title: 'text-foreground',
|
|
20
|
+
description: 'text-muted-foreground'
|
|
21
|
+
},
|
|
22
|
+
info: {
|
|
23
|
+
root: 'border-info/32 bg-info/4',
|
|
24
|
+
title: 'text-foreground',
|
|
25
|
+
description: 'text-muted-foreground'
|
|
26
|
+
},
|
|
27
|
+
success: {
|
|
28
|
+
root: 'border-success/32 bg-success/4',
|
|
29
|
+
title: 'text-foreground',
|
|
30
|
+
description: 'text-muted-foreground'
|
|
31
|
+
},
|
|
32
|
+
warning: {
|
|
33
|
+
root: 'border-warning/32 bg-warning/4',
|
|
34
|
+
title: 'text-foreground',
|
|
35
|
+
description: 'text-muted-foreground'
|
|
36
|
+
},
|
|
37
|
+
destructive: {
|
|
38
|
+
root: 'border-destructive/32 bg-destructive/4',
|
|
39
|
+
title: 'text-foreground',
|
|
40
|
+
description: 'text-muted-foreground'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
variant: 'default'
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const AlertContext = /*#__PURE__*/createContext('default');
|
|
49
|
+
const AlertRoot = /*#__PURE__*/forwardRef(({
|
|
50
|
+
className,
|
|
51
|
+
variant = 'default',
|
|
52
|
+
icon,
|
|
53
|
+
children,
|
|
54
|
+
...props
|
|
55
|
+
}, ref) => {
|
|
56
|
+
const {
|
|
57
|
+
root
|
|
58
|
+
} = alertVariants({
|
|
59
|
+
variant
|
|
60
|
+
});
|
|
61
|
+
return /*#__PURE__*/_jsx(AlertContext.Provider, {
|
|
62
|
+
value: variant,
|
|
63
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
64
|
+
ref: ref,
|
|
65
|
+
accessibilityRole: "alert",
|
|
66
|
+
className: root({
|
|
67
|
+
className
|
|
68
|
+
}),
|
|
69
|
+
...props,
|
|
70
|
+
children: icon ? /*#__PURE__*/_jsxs(View, {
|
|
71
|
+
className: "flex-row items-start gap-3",
|
|
72
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
73
|
+
className: "mt-0.5",
|
|
74
|
+
children: icon
|
|
75
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
76
|
+
className: "flex-1 gap-1",
|
|
77
|
+
children: children
|
|
78
|
+
})]
|
|
79
|
+
}) : children
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
AlertRoot.displayName = 'Alert';
|
|
84
|
+
const AlertTitle = /*#__PURE__*/forwardRef(({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}, ref) => {
|
|
88
|
+
const variant = useContext(AlertContext);
|
|
89
|
+
const {
|
|
90
|
+
title
|
|
91
|
+
} = alertVariants({
|
|
92
|
+
variant
|
|
93
|
+
});
|
|
94
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
95
|
+
ref: ref,
|
|
96
|
+
className: cn(title(), className),
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
AlertTitle.displayName = 'Alert.Title';
|
|
101
|
+
const AlertDescription = /*#__PURE__*/forwardRef(({
|
|
102
|
+
className,
|
|
103
|
+
...props
|
|
104
|
+
}, ref) => {
|
|
105
|
+
const variant = useContext(AlertContext);
|
|
106
|
+
const {
|
|
107
|
+
description
|
|
108
|
+
} = alertVariants({
|
|
109
|
+
variant
|
|
110
|
+
});
|
|
111
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
112
|
+
ref: ref,
|
|
113
|
+
className: cn(description(), className),
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
AlertDescription.displayName = 'Alert.Description';
|
|
118
|
+
export const Alert = Object.assign(AlertRoot, {
|
|
119
|
+
Title: AlertTitle,
|
|
120
|
+
Description: AlertDescription
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","cn","Text","jsx","_jsx","jsxs","_jsxs","alertVariants","slots","root","title","description","variants","variant","default","info","success","warning","destructive","defaultVariants","AlertContext","AlertRoot","className","icon","children","props","ref","Provider","value","accessibilityRole","displayName","AlertTitle","AlertDescription","Alert","Object","assign","Title","Description"],"sourceRoot":"../../../../src","sources":["components/alert/index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,IAAI,QAAwB,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7D,MAAMC,aAAa,GAAGP,EAAE,CAAC;EACvBQ,KAAK,EAAE;IACLC,IAAI,EAAE,oCAAoC;IAC1CC,KAAK,EAAE,eAAe;IACtBC,WAAW,EAAE;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AAO,MAAMG,KAAK,GAAGC,MAAM,CAACC,MAAM,CAACd,SAAS,EAAE;EAC5Ce,KAAK,EAAEL,UAAU;EACjBM,WAAW,EAAEL;AACf,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, useState } from 'react';
|
|
4
|
+
import { Image, View } from 'react-native';
|
|
5
|
+
import { tv } from 'tailwind-variants';
|
|
6
|
+
import { Text } from "../../primitives/text.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const avatarVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: 'items-center justify-center overflow-hidden rounded-full border border-border bg-muted',
|
|
11
|
+
image: 'h-full w-full',
|
|
12
|
+
fallback: 'font-medium text-muted-foreground'
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: {
|
|
17
|
+
root: 'h-8 w-8',
|
|
18
|
+
fallback: 'text-xs'
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
root: 'h-10 w-10',
|
|
22
|
+
fallback: 'text-sm'
|
|
23
|
+
},
|
|
24
|
+
lg: {
|
|
25
|
+
root: 'h-14 w-14',
|
|
26
|
+
fallback: 'text-lg'
|
|
27
|
+
},
|
|
28
|
+
xl: {
|
|
29
|
+
root: 'h-20 w-20',
|
|
30
|
+
fallback: 'text-2xl'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: 'md'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export const Avatar = /*#__PURE__*/forwardRef(({
|
|
39
|
+
className,
|
|
40
|
+
size,
|
|
41
|
+
source,
|
|
42
|
+
fallback,
|
|
43
|
+
imageProps,
|
|
44
|
+
...props
|
|
45
|
+
}, ref) => {
|
|
46
|
+
const [errored, setErrored] = useState(false);
|
|
47
|
+
const {
|
|
48
|
+
root,
|
|
49
|
+
image,
|
|
50
|
+
fallback: fallbackSlot
|
|
51
|
+
} = avatarVariants({
|
|
52
|
+
size
|
|
53
|
+
});
|
|
54
|
+
const showImage = !!source && !errored;
|
|
55
|
+
return /*#__PURE__*/_jsx(View, {
|
|
56
|
+
ref: ref,
|
|
57
|
+
accessibilityRole: "image",
|
|
58
|
+
className: root({
|
|
59
|
+
className
|
|
60
|
+
}),
|
|
61
|
+
...props,
|
|
62
|
+
children: showImage ? /*#__PURE__*/_jsx(Image, {
|
|
63
|
+
source: source,
|
|
64
|
+
onError: () => setErrored(true),
|
|
65
|
+
className: image(),
|
|
66
|
+
...imageProps
|
|
67
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
68
|
+
className: fallbackSlot(),
|
|
69
|
+
children: fallback ?? '?'
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
Avatar.displayName = 'Avatar';
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useState","Image","View","tv","Text","jsx","_jsx","avatarVariants","slots","root","image","fallback","variants","size","sm","md","lg","xl","defaultVariants","Avatar","className","source","imageProps","props","ref","errored","setErrored","fallbackSlot","showImage","accessibilityRole","children","onError","displayName"],"sourceRoot":"../../../../src","sources":["components/avatar/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAC5C,SACEC,KAAK,EACLC,IAAI,QAIC,cAAc;AACrB,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,cAAc,GAAGJ,EAAE,CAAC;EACxBK,KAAK,EAAE;IACLC,IAAI,EAAE,wFAAwF;IAC9FC,KAAK,EAAE,eAAe;IACtBC,QAAQ,EAAE;EACZ,CAAC;EACDC,QAAQ,EAAE;IACRC,IAA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,CAAC,CAAE;MAAAG,QAAA,EAAEnB,QAAQ,IAAI;IAAG,CAAO;EACzD,CACG,CAAC;AAEX,CACF,CAAC;AAEDQ,MAAM,CAACa,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { tv } from 'tailwind-variants';
|
|
6
|
+
import { Text } from "../../primitives/text.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const badgeVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: 'flex-row items-center justify-center gap-1 self-start rounded-sm border border-transparent px-2 py-0.5',
|
|
11
|
+
label: 'text-xs font-medium'
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: {
|
|
16
|
+
root: 'bg-primary',
|
|
17
|
+
label: 'text-primary-foreground'
|
|
18
|
+
},
|
|
19
|
+
secondary: {
|
|
20
|
+
root: 'bg-secondary',
|
|
21
|
+
label: 'text-secondary-foreground'
|
|
22
|
+
},
|
|
23
|
+
outline: {
|
|
24
|
+
root: 'border-border bg-transparent',
|
|
25
|
+
label: 'text-foreground'
|
|
26
|
+
},
|
|
27
|
+
destructive: {
|
|
28
|
+
root: 'bg-destructive',
|
|
29
|
+
label: 'text-white'
|
|
30
|
+
},
|
|
31
|
+
success: {
|
|
32
|
+
root: 'bg-success/8 dark:bg-success/16',
|
|
33
|
+
label: 'text-success-foreground'
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
root: 'bg-warning/8 dark:bg-warning/16',
|
|
37
|
+
label: 'text-warning-foreground'
|
|
38
|
+
},
|
|
39
|
+
info: {
|
|
40
|
+
root: 'bg-info/8 dark:bg-info/16',
|
|
41
|
+
label: 'text-info-foreground'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: 'default'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export const Badge = /*#__PURE__*/forwardRef(({
|
|
50
|
+
children,
|
|
51
|
+
className,
|
|
52
|
+
labelClassName,
|
|
53
|
+
variant,
|
|
54
|
+
...props
|
|
55
|
+
}, ref) => {
|
|
56
|
+
const {
|
|
57
|
+
root,
|
|
58
|
+
label
|
|
59
|
+
} = badgeVariants({
|
|
60
|
+
variant
|
|
61
|
+
});
|
|
62
|
+
return /*#__PURE__*/_jsx(View, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: root({
|
|
65
|
+
className
|
|
66
|
+
}),
|
|
67
|
+
...props,
|
|
68
|
+
children: typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
69
|
+
className: label({
|
|
70
|
+
className: labelClassName
|
|
71
|
+
}),
|
|
72
|
+
children: children
|
|
73
|
+
}) : children
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
Badge.displayName = 'Badge';
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","tv","Text","jsx","_jsx","badgeVariants","slots","root","label","variants","variant","default","secondary","outline","destructive","success","warning","info","defaultVariants","Badge","children","className","labelClassName","props","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/badge/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,aAAa,GAAGJ,EAAE,CAAC;EACvBK,KAAK,EAAE;IACLC,IAAI,EAAE,wGAAwG;IAC9GC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE;QAAEJ,IAAI,EA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ignoreList":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cloneElement, createContext, isValidElement, useCallback, useContext, useMemo, useState } from 'react';
|
|
4
|
+
import { Pressable, useWindowDimensions, View } from 'react-native';
|
|
5
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
6
|
+
import Animated, { FadeIn, FadeOut, SlideInDown, SlideOutDown, runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
7
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
+
import { Portal } from "../../primitives/portal.js";
|
|
9
|
+
import { cn } from "../../utils/cn.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const SPRING = {
|
|
12
|
+
damping: 22,
|
|
13
|
+
stiffness: 280,
|
|
14
|
+
mass: 0.7
|
|
15
|
+
};
|
|
16
|
+
const DISMISS_DISTANCE = 120;
|
|
17
|
+
const DISMISS_VELOCITY = 800;
|
|
18
|
+
const BottomSheetContext = /*#__PURE__*/createContext(null);
|
|
19
|
+
function useBottomSheet(component) {
|
|
20
|
+
const context = useContext(BottomSheetContext);
|
|
21
|
+
if (!context) {
|
|
22
|
+
throw new Error(`${component} must be used within a <BottomSheet>`);
|
|
23
|
+
}
|
|
24
|
+
return context;
|
|
25
|
+
}
|
|
26
|
+
function BottomSheetRoot({
|
|
27
|
+
children,
|
|
28
|
+
open,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
defaultOpen = false
|
|
31
|
+
}) {
|
|
32
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
33
|
+
const isControlled = open !== undefined;
|
|
34
|
+
const resolvedOpen = isControlled ? open : internalOpen;
|
|
35
|
+
const setOpen = useCallback(next => {
|
|
36
|
+
if (!isControlled) setInternalOpen(next);
|
|
37
|
+
onOpenChange?.(next);
|
|
38
|
+
}, [isControlled, onOpenChange]);
|
|
39
|
+
const context = useMemo(() => ({
|
|
40
|
+
open: resolvedOpen,
|
|
41
|
+
setOpen
|
|
42
|
+
}), [resolvedOpen, setOpen]);
|
|
43
|
+
return /*#__PURE__*/_jsx(BottomSheetContext.Provider, {
|
|
44
|
+
value: context,
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function BottomSheetTrigger({
|
|
49
|
+
children
|
|
50
|
+
}) {
|
|
51
|
+
const {
|
|
52
|
+
setOpen
|
|
53
|
+
} = useBottomSheet('BottomSheet.Trigger');
|
|
54
|
+
if (! /*#__PURE__*/isValidElement(children)) return children;
|
|
55
|
+
return /*#__PURE__*/cloneElement(children, {
|
|
56
|
+
onPress: (...args) => {
|
|
57
|
+
children.props.onPress?.(...args);
|
|
58
|
+
setOpen(true);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function BottomSheetContent({
|
|
63
|
+
className,
|
|
64
|
+
dismissible = true,
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
const {
|
|
69
|
+
open,
|
|
70
|
+
setOpen
|
|
71
|
+
} = useBottomSheet('BottomSheet.Content');
|
|
72
|
+
const {
|
|
73
|
+
height: screenHeight
|
|
74
|
+
} = useWindowDimensions();
|
|
75
|
+
const insets = useSafeAreaInsets();
|
|
76
|
+
const translateY = useSharedValue(0);
|
|
77
|
+
const close = useCallback(() => setOpen(false), [setOpen]);
|
|
78
|
+
const pan = Gesture.Pan().onChange(event => {
|
|
79
|
+
// Rubber-band when dragging upward, follow the finger downward.
|
|
80
|
+
const next = translateY.value + event.changeY;
|
|
81
|
+
translateY.value = next > 0 ? next : next / 3;
|
|
82
|
+
}).onEnd(event => {
|
|
83
|
+
if (translateY.value > DISMISS_DISTANCE || event.velocityY > DISMISS_VELOCITY) {
|
|
84
|
+
translateY.value = withTiming(screenHeight, {
|
|
85
|
+
duration: 200
|
|
86
|
+
}, () => {
|
|
87
|
+
runOnJS(close)();
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
translateY.value = withSpring(0, SPRING);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const sheetStyle = useAnimatedStyle(() => ({
|
|
94
|
+
transform: [{
|
|
95
|
+
translateY: translateY.value
|
|
96
|
+
}]
|
|
97
|
+
}));
|
|
98
|
+
if (!open) return null;
|
|
99
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
100
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
101
|
+
className: "absolute inset-0 justify-end",
|
|
102
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
103
|
+
entering: FadeIn.duration(180),
|
|
104
|
+
exiting: FadeOut.duration(180),
|
|
105
|
+
className: "absolute inset-0",
|
|
106
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
107
|
+
accessibilityLabel: "Close sheet",
|
|
108
|
+
className: "flex-1 bg-black/50",
|
|
109
|
+
onPress: dismissible ? close : undefined
|
|
110
|
+
})
|
|
111
|
+
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
112
|
+
gesture: pan,
|
|
113
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
114
|
+
entering: SlideInDown.springify().damping(22).stiffness(240).mass(0.8),
|
|
115
|
+
exiting: SlideOutDown.duration(200),
|
|
116
|
+
style: [sheetStyle, {
|
|
117
|
+
paddingBottom: Math.max(insets.bottom, 16)
|
|
118
|
+
}],
|
|
119
|
+
accessibilityViewIsModal: true,
|
|
120
|
+
className: cn('rounded-t-3xl border border-b-0 border-border bg-popover px-5 pt-2 shadow-lg', className),
|
|
121
|
+
...props,
|
|
122
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
123
|
+
className: "mb-3 self-center",
|
|
124
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
125
|
+
className: "h-1 w-10 rounded-full bg-muted-foreground/30"
|
|
126
|
+
})
|
|
127
|
+
}), children]
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
export const BottomSheet = Object.assign(BottomSheetRoot, {
|
|
134
|
+
Trigger: BottomSheetTrigger,
|
|
135
|
+
Content: BottomSheetContent
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cloneElement","createContext","isValidElement","useCallback","useContext","useMemo","useState","Pressable","useWindowDimensions","View","Gesture","GestureDetector","Animated","FadeIn","FadeOut","SlideInDown","SlideOutDown","runOnJS","useAnimatedStyle","useSharedValue","withSpring","withTiming","useSafeAreaInsets","Portal","cn","jsx","_jsx","jsxs","_jsxs","SPRING","damping","stiffness","mass","DISMISS_DISTANCE","DISMISS_VELOCITY","BottomSheetContext","useBottomSheet","component","context","Error","BottomSheetRoot","children","open","onOpenChange","defaultOpen","internalOpen","setInternalOpen","isControlled","undefined","resolvedOpen","setOpen","next","Provider","value","BottomSheetTrigger","onPress","args","props","BottomSheetContent","className","dismissible","height","screenHeight","insets","translateY","close","pan","Pan","onChange","event","changeY","onEnd","velocityY","duration","sheetStyle","transform","entering","exiting","accessibilityLabel","gesture","springify","style","paddingBottom","Math","max","bottom","accessibilityViewIsModal","BottomSheet","Object","assign","Trigger","Content"],"sourceRoot":"../../../../src","sources":["components/bottom-sheet/index.tsx"],"mappings":";;AAAA,SACEA,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAGH,OAAO;AACd,SAASC,SAAS,EAAEC,mBAAmB,EAAEC,IAAI,QAAwB,cAAc;AACnF,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,YAAY,EACZC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AACh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QAAQ,CAACH,IAAI;UACZmE,QAAQ,EAAE7D,WAAW,CAACiE,SAAS,CAAC,CAAC,CAAClD,OAAO,CAAC,EAAE,CAAC,CAACC,SAAS,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;UACvE6C,OAAO,EAAE7D,YAAY,CAACyD,QAAQ,CAAC,GAAG,CAAE;UACpCQ,KAAK,EAAE,CAACP,UAAU,EAAE;YAAEQ,aAAa,EAAEC,IAAI,CAACC,GAAG,CAACrB,MAAM,CAACsB,MAAM,EAAE,EAAE;UAAE,CAAC,CAAE;UACpEC,wBAAwB;UACxB3B,SAAS,EAAEnC,EAAE,CACX,8EAA8E,EAC9EmC,SACF,CAAE;UAAA,GACEF,KAAK;UAAAhB,QAAA,gBAETf,IAAA,CAACjB,IAAI;YAACkD,SAAS,EAAC,kBAAkB;YAAAlB,QAAA,eAChCf,IAAA,CAACjB,IAAI;cAACkD,SAAS,EAAC;YAA8C,CAAE;UAAC,CAC7D,CAAC,EACNlB,QAAQ;QAAA,CACI;MAAC,CACD,CAAC;IAAA,CACd;EAAC,CACD,CAAC;AAEb;AAEA,OAAO,MAAM8C,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACjD,eAAe,EAAE;EACxDkD,OAAO,EAAEpC,kBAAkB;EAC3BqC,OAAO,EAAEjC;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, isValidElement } from 'react';
|
|
4
|
+
import { tv } from 'tailwind-variants';
|
|
5
|
+
import { AnimatedPressable } from "../../primitives/animated-pressable.js";
|
|
6
|
+
import { Text } from "../../primitives/text.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const buttonVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: 'flex-row items-center justify-center gap-2 rounded-lg border border-transparent',
|
|
11
|
+
label: 'font-medium'
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
primary: {
|
|
16
|
+
root: 'border-primary bg-primary shadow-sm',
|
|
17
|
+
label: 'text-primary-foreground'
|
|
18
|
+
},
|
|
19
|
+
secondary: {
|
|
20
|
+
root: 'bg-secondary',
|
|
21
|
+
label: 'text-secondary-foreground'
|
|
22
|
+
},
|
|
23
|
+
outline: {
|
|
24
|
+
root: 'border-input bg-popover shadow-sm',
|
|
25
|
+
label: 'text-foreground'
|
|
26
|
+
},
|
|
27
|
+
ghost: {
|
|
28
|
+
root: 'bg-transparent',
|
|
29
|
+
label: 'text-foreground'
|
|
30
|
+
},
|
|
31
|
+
destructive: {
|
|
32
|
+
root: 'border-destructive bg-destructive shadow-sm',
|
|
33
|
+
label: 'text-white'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
sm: {
|
|
38
|
+
root: 'h-9 gap-1.5 px-2.5',
|
|
39
|
+
label: 'text-sm'
|
|
40
|
+
},
|
|
41
|
+
md: {
|
|
42
|
+
root: 'h-11 px-4',
|
|
43
|
+
label: 'text-base'
|
|
44
|
+
},
|
|
45
|
+
lg: {
|
|
46
|
+
root: 'h-12 px-6',
|
|
47
|
+
label: 'text-lg'
|
|
48
|
+
},
|
|
49
|
+
icon: {
|
|
50
|
+
root: 'h-11 w-11 px-0'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
true: {
|
|
55
|
+
root: 'opacity-[0.64]'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: 'primary',
|
|
61
|
+
size: 'md'
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export const Button = /*#__PURE__*/forwardRef(({
|
|
65
|
+
children,
|
|
66
|
+
className,
|
|
67
|
+
labelClassName,
|
|
68
|
+
variant,
|
|
69
|
+
size,
|
|
70
|
+
disabled,
|
|
71
|
+
...props
|
|
72
|
+
}, ref) => {
|
|
73
|
+
const {
|
|
74
|
+
root,
|
|
75
|
+
label
|
|
76
|
+
} = buttonVariants({
|
|
77
|
+
variant,
|
|
78
|
+
size,
|
|
79
|
+
disabled: !!disabled
|
|
80
|
+
});
|
|
81
|
+
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
82
|
+
ref: ref,
|
|
83
|
+
accessibilityRole: "button",
|
|
84
|
+
accessibilityState: {
|
|
85
|
+
disabled: !!disabled
|
|
86
|
+
},
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
className: root({
|
|
89
|
+
className
|
|
90
|
+
}),
|
|
91
|
+
...props,
|
|
92
|
+
children: typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
93
|
+
className: label({
|
|
94
|
+
className: labelClassName
|
|
95
|
+
}),
|
|
96
|
+
children: children
|
|
97
|
+
}) : /*#__PURE__*/isValidElement(children) ? children : children
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
Button.displayName = 'Button';
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","isValidElement","tv","AnimatedPressable","Text","jsx","_jsx","buttonVariants","slots","root","label","variants","variant","primary","secondary","outline","ghost","destructive","size","sm","md","lg","icon","disabled","true","defaultVariants","Button","children","className","labelClassName","props","ref","accessibilityRole","accessibilityState","displayName"],"sourceRoot":"../../../../src","sources":["components/button/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,cAAc,QAAwB,OAAO;AAElE,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SACEC,iBAAiB,QAEZ,wCAAqC;AAC5C,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,cAAc,GAAGL,EAAE,CAAC;EACxBM,KAAK,EAAE;IACLC,IAAI,EAAE,iFAAiF;IACvFC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ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AiB;IAChB4B,GAAG,EAAEA,GAAI;IACTC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAE;MAAEV,QAAQ,EAAE,CAAC,CAACA;IAAS,CAAE;IAC7CA,QAAQ,EAAEA,QAAS;IACnBK,SAAS,EAAEnB,IAAI,CAAC;MAAEmB;IAAU,CAAC,CAAE;IAAA,GAC3BE,KAAK;IAAAH,QAAA,EAER,OAAOA,QAAQ,KAAK,QAAQ,gBAC3BrB,IAAA,CAACF,IAAI;MAACwB,SAAS,EAAElB,KAAK,CAAC;QAAEkB,SAAS,EAAEC;MAAe,CAAC,CAAE;MAAAF,QAAA,EAAEA;IAAQ,CAAO,CAAC,GACtE,aAAA1B,cAAc,CAAC0B,QAAQ,CAAC,GAC1BA,QAAQ,GAERA;EACD,CACgB,CAAC;AAExB,CACF,CAAC;AAEDD,MAAM,CAACQ,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { Text } from "../../primitives/text.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const CardRoot = /*#__PURE__*/forwardRef(({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
className: cn('rounded-xl border border-border bg-card shadow-sm', className),
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
CardRoot.displayName = 'Card';
|
|
17
|
+
const CardHeader = /*#__PURE__*/forwardRef(({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: cn('gap-1.5 p-4', className),
|
|
23
|
+
...props
|
|
24
|
+
}));
|
|
25
|
+
CardHeader.displayName = 'Card.Header';
|
|
26
|
+
const CardTitle = /*#__PURE__*/forwardRef(({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}, ref) => /*#__PURE__*/_jsx(Text, {
|
|
30
|
+
ref: ref,
|
|
31
|
+
size: "lg",
|
|
32
|
+
weight: "semibold",
|
|
33
|
+
className: cn('text-card-foreground', className),
|
|
34
|
+
...props
|
|
35
|
+
}));
|
|
36
|
+
CardTitle.displayName = 'Card.Title';
|
|
37
|
+
const CardDescription = /*#__PURE__*/forwardRef(({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}, ref) => /*#__PURE__*/_jsx(Text, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
size: "sm",
|
|
43
|
+
muted: true,
|
|
44
|
+
className: className,
|
|
45
|
+
...props
|
|
46
|
+
}));
|
|
47
|
+
CardDescription.displayName = 'Card.Description';
|
|
48
|
+
const CardContent = /*#__PURE__*/forwardRef(({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: cn('p-4 pt-0', className),
|
|
54
|
+
...props
|
|
55
|
+
}));
|
|
56
|
+
CardContent.displayName = 'Card.Content';
|
|
57
|
+
const CardFooter = /*#__PURE__*/forwardRef(({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
61
|
+
ref: ref,
|
|
62
|
+
className: cn('flex-row items-center gap-2 p-4 pt-0', className),
|
|
63
|
+
...props
|
|
64
|
+
}));
|
|
65
|
+
CardFooter.displayName = 'Card.Footer';
|
|
66
|
+
export const Card = Object.assign(CardRoot, {
|
|
67
|
+
Header: CardHeader,
|
|
68
|
+
Title: CardTitle,
|
|
69
|
+
Description: CardDescription,
|
|
70
|
+
Content: CardContent,
|
|
71
|
+
Footer: CardFooter
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","cn","Text","jsx","_jsx","CardRoot","className","props","ref","displayName","CardHeader","CardTitle","size","weight","CardDescription","muted","CardContent","CardFooter","Card","Object","assign","Header","Title","Description","Content","Footer"],"sourceRoot":"../../../../src","sources":["components/card/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,IAAI,QAAwB,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAM7D,MAAMC,QAAQ,gBAAGN,UAAU,CAAkB,CAAC;EAAEO,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBACxEJ,IAAA,CAACJ,IAAI;EACHQ,GAAG,EAAEA,GAAI;EACTF,SAAS,EAAEL,EAAE,CAAC,mDAAmD,EAAEK,SAAS,CAAE;EAAA,GAC1EC;AAAK,CACV,CACF,CAAC;AACFF,QAAQ,CAACI,WAAW,GAAG,MAAM;AAE7B,MAAMC,UAAU,gBAAGX,UAAU,CAAkB,CAAC;EAAEO,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBAC1EJ,IAAA,CAACJ,IAAI;EAACQ,GAAG,EAAEA,GAAI;EAACF,SAAS,EAAEL,EAAE,CAAC,aAAa,EAAEK,SAAS,CAAE;EAAA,GAAKC;AAAK,CAAG,CACtE,CAAC;AACFG,UAAU,CAACD,WAAW,GAAG,aAAa;AAEtC,MAAME,SAAS,gBAAGZ,UAAU,CAC1B,CAAC;EAAEO,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBAC3BJ,IAAA,CAACF,IAAI;EACHM,GAAG,EAAEA,GAAI;EACTI,IAAI,EAAC,IAAI;EACTC,MAAM,EAAC,UAAU;EACjBP,SAAS,EAAEL,EAAE,CAAC,sBAAsB,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