@flipova/foundation 2.3.0 → 2.4.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 +157 -156
- package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
- package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
- package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
- package/components/ui/accordion/AnimatedHeight.tsx +3 -15
- package/components/ui/accordion/AnimatedIcon.tsx +2 -9
- package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
- package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
- package/components/ui/accordion/index.tsx +71 -139
- package/components/ui/actionsheet/index.tsx +63 -105
- package/components/ui/alert/index.tsx +20 -50
- package/components/ui/alert-dialog/index.tsx +23 -48
- package/components/ui/avatar/index.tsx +32 -68
- package/components/ui/badge/index.tsx +18 -49
- package/components/ui/bottomsheet/index.tsx +20 -52
- package/components/ui/box/index.tsx +4 -9
- package/components/ui/box/index.web.tsx +3 -9
- package/components/ui/button/index.tsx +73 -109
- package/components/ui/calendar/creator.tsx +69 -30
- package/components/ui/calendar/index.tsx +81 -159
- package/components/ui/calendar/styles.tsx +10 -10
- package/components/ui/card/index.tsx +8 -9
- package/components/ui/card/index.web.tsx +4 -10
- package/components/ui/center/index.tsx +6 -11
- package/components/ui/center/index.web.tsx +3 -9
- package/components/ui/checkbox/index.tsx +46 -107
- package/components/ui/date-time-picker/creator.tsx +14 -1
- package/components/ui/date-time-picker/index.tsx +107 -156
- package/components/ui/date-time-picker/index.web.tsx +11 -33
- package/components/ui/date-time-picker/styles.tsx +5 -5
- package/components/ui/divider/index.tsx +5 -6
- package/components/ui/drawer/index.tsx +108 -128
- package/components/ui/fab/index.tsx +25 -68
- package/components/ui/flat-list/index.tsx +11 -8
- package/components/ui/form-control/index.tsx +49 -90
- package/components/ui/gluestack-ui-provider/index.tsx +4 -18
- package/components/ui/gluestack-ui-provider/index.web.tsx +10 -11
- package/components/ui/gluestack-ui-provider/script.ts +1 -3
- package/components/ui/gluestack-ui-provider/theme-context.ts +2 -2
- package/components/ui/gluestack-ui-provider/useGluestackColors.ts +2 -6
- package/components/ui/grid/index.tsx +128 -165
- package/components/ui/grid/index.web.tsx +17 -19
- package/components/ui/grid/styles.tsx +1 -3
- package/components/ui/heading/index.tsx +146 -169
- package/components/ui/heading/index.web.tsx +7 -28
- package/components/ui/heading/styles.tsx +5 -5
- package/components/ui/hstack/index.tsx +16 -15
- package/components/ui/hstack/index.web.tsx +17 -17
- package/components/ui/hstack/styles.tsx +5 -5
- package/components/ui/icon/index.tsx +95 -486
- package/components/ui/icon/index.web.tsx +79 -439
- package/components/ui/image/index.tsx +13 -18
- package/components/ui/image-viewer/index.tsx +149 -221
- package/components/ui/image-viewer/index.web.tsx +88 -113
- package/components/ui/input/index.tsx +20 -33
- package/components/ui/link/index.tsx +16 -22
- package/components/ui/liquid-glass/index.tsx +19 -25
- package/components/ui/menu/index.tsx +44 -66
- package/components/ui/modal/index.tsx +70 -91
- package/components/ui/popover/index.tsx +102 -121
- package/components/ui/portal/index.tsx +5 -6
- package/components/ui/pressable/index.tsx +5 -9
- package/components/ui/progress/index.tsx +4 -11
- package/components/ui/radio/index.tsx +47 -83
- package/components/ui/select/index.tsx +38 -59
- package/components/ui/select/select-actionsheet.tsx +61 -108
- package/components/ui/skeleton/index.tsx +22 -43
- package/components/ui/skeleton/index.web.tsx +63 -75
- package/components/ui/slider/index.tsx +36 -56
- package/components/ui/spinner/index.tsx +1 -10
- package/components/ui/switch/index.tsx +6 -13
- package/components/ui/table/index.tsx +39 -102
- package/components/ui/table/index.web.tsx +41 -79
- package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
- package/components/ui/tabs/creator.tsx +32 -24
- package/components/ui/tabs/index.tsx +253 -309
- package/components/ui/text/index.tsx +23 -37
- package/components/ui/text/index.web.tsx +33 -35
- package/components/ui/text/styles.tsx +5 -5
- package/components/ui/textarea/index.tsx +24 -38
- package/components/ui/toast/index.tsx +47 -52
- package/components/ui/tooltip/index.tsx +12 -28
- package/components/ui/vstack/index.tsx +17 -17
- package/components/ui/vstack/index.web.tsx +17 -17
- package/components/ui/vstack/styles.tsx +5 -5
- package/design/tools/design.js +15 -12
- package/design/tools/npm.js +4 -3
- package/dist/{chunk-B277QSR5.mjs → chunk-2R66P5X5.mjs} +1816 -3124
- package/dist/chunk-2R66P5X5.mjs.map +1 -0
- package/dist/{chunk-GD37RFBR.js → chunk-LCTFQJZM.js} +1816 -3124
- package/dist/chunk-LCTFQJZM.js.map +1 -0
- package/dist/index.js +294 -294
- package/dist/index.mjs +1 -1
- package/dist/ui/index.js +294 -294
- package/dist/ui/index.mjs +1 -1
- package/package.json +12 -7
- package/dist/chunk-B277QSR5.mjs.map +0 -1
- package/dist/chunk-GD37RFBR.js.map +0 -1
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import { createAlert } from '@gluestack-ui/core/alert/creator';
|
|
3
3
|
import { View, Text } from 'react-native';
|
|
4
4
|
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
5
|
-
import {
|
|
6
|
-
withStyleContext,
|
|
7
|
-
useStyleContext,
|
|
8
|
-
} from '@gluestack-ui/utils/nativewind-utils';
|
|
5
|
+
import { withStyleContext, useStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
9
6
|
import React from 'react';
|
|
10
7
|
import { cssInterop } from 'nativewind';
|
|
11
8
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
@@ -62,32 +59,21 @@ cssInterop(UIIcon, {
|
|
|
62
59
|
},
|
|
63
60
|
});
|
|
64
61
|
|
|
65
|
-
type IAlertProps = Omit<
|
|
66
|
-
React.ComponentPropsWithoutRef<typeof UIAlert>,
|
|
67
|
-
'context'
|
|
68
|
-
> &
|
|
69
|
-
VariantProps<typeof alertStyle>;
|
|
62
|
+
type IAlertProps = Omit<React.ComponentPropsWithoutRef<typeof UIAlert>, 'context'> & VariantProps<typeof alertStyle>;
|
|
70
63
|
|
|
71
|
-
const Alert = React.forwardRef<React.ComponentRef<typeof UIAlert>, IAlertProps>(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ref={ref}
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
64
|
+
const Alert = React.forwardRef<React.ComponentRef<typeof UIAlert>, IAlertProps>(function Alert(
|
|
65
|
+
{ className, variant = 'default', ...props },
|
|
66
|
+
ref,
|
|
67
|
+
) {
|
|
68
|
+
return <UIAlert className={alertStyle({ variant, class: className })} context={{ variant }} ref={ref} {...props} />;
|
|
69
|
+
});
|
|
83
70
|
|
|
84
|
-
type IAlertTextProps = React.ComponentPropsWithoutRef<typeof UIAlert.Text> &
|
|
85
|
-
VariantProps<typeof alertTextStyle>;
|
|
71
|
+
type IAlertTextProps = React.ComponentPropsWithoutRef<typeof UIAlert.Text> & VariantProps<typeof alertTextStyle>;
|
|
86
72
|
|
|
87
|
-
const AlertText = React.forwardRef<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
const AlertText = React.forwardRef<React.ComponentRef<typeof UIAlert.Text>, IAlertTextProps>(function AlertText(
|
|
74
|
+
{ className, ...props },
|
|
75
|
+
ref,
|
|
76
|
+
) {
|
|
91
77
|
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
92
78
|
return (
|
|
93
79
|
<UIAlert.Text
|
|
@@ -110,32 +96,16 @@ type IAlertIconProps = React.ComponentPropsWithoutRef<typeof UIAlert.Icon> &
|
|
|
110
96
|
size?: number | 'sm' | 'md' | 'lg' | 'xl';
|
|
111
97
|
};
|
|
112
98
|
|
|
113
|
-
const AlertIcon = React.forwardRef<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
99
|
+
const AlertIcon = React.forwardRef<React.ComponentRef<typeof UIAlert.Icon>, IAlertIconProps>(function AlertIcon(
|
|
100
|
+
{ className, size = 'sm', ...props },
|
|
101
|
+
ref,
|
|
102
|
+
) {
|
|
117
103
|
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
118
104
|
|
|
119
105
|
if (typeof size === 'number') {
|
|
120
|
-
return (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{...props}
|
|
124
|
-
className={alertIconStyle({ class: className })}
|
|
125
|
-
size={size}
|
|
126
|
-
/>
|
|
127
|
-
);
|
|
128
|
-
} else if (
|
|
129
|
-
(props.height !== undefined || props.width !== undefined) &&
|
|
130
|
-
size === undefined
|
|
131
|
-
) {
|
|
132
|
-
return (
|
|
133
|
-
<UIAlert.Icon
|
|
134
|
-
ref={ref}
|
|
135
|
-
{...props}
|
|
136
|
-
className={alertIconStyle({ class: className })}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
106
|
+
return <UIAlert.Icon ref={ref} {...props} className={alertIconStyle({ class: className })} size={size} />;
|
|
107
|
+
} else if ((props.height !== undefined || props.width !== undefined) && size === undefined) {
|
|
108
|
+
return <UIAlert.Icon ref={ref} {...props} className={alertIconStyle({ class: className })} />;
|
|
139
109
|
}
|
|
140
110
|
return (
|
|
141
111
|
<UIAlert.Icon
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { createAlertDialog } from '@gluestack-ui/core/alert-dialog/creator';
|
|
3
3
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
4
|
-
import {
|
|
5
|
-
tva,
|
|
6
|
-
useStyleContext,
|
|
7
|
-
withStyleContext,
|
|
8
|
-
} from '@gluestack-ui/utils/nativewind-utils';
|
|
4
|
+
import { tva, useStyleContext, withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
9
5
|
import { cssInterop } from 'nativewind';
|
|
10
6
|
import React from 'react';
|
|
11
7
|
import { Pressable, ScrollView, View } from 'react-native';
|
|
12
|
-
import Animated, {
|
|
13
|
-
Easing,
|
|
14
|
-
FadeIn,
|
|
15
|
-
FadeOut,
|
|
16
|
-
ZoomIn
|
|
17
|
-
} from 'react-native-reanimated';
|
|
8
|
+
import Animated, { Easing, FadeIn, FadeOut, ZoomIn } from 'react-native-reanimated';
|
|
18
9
|
|
|
19
10
|
const SCOPE = 'ALERT_DIALOG';
|
|
20
11
|
|
|
@@ -80,55 +71,40 @@ const alertDialogBackdropStyle = tva({
|
|
|
80
71
|
base: 'absolute left-0 top-0 right-0 bottom-0 bg-black/50 web:cursor-default',
|
|
81
72
|
});
|
|
82
73
|
|
|
83
|
-
type IAlertDialogProps = React.ComponentPropsWithoutRef<
|
|
84
|
-
typeof UIAccessibleAlertDialog
|
|
85
|
-
> &
|
|
74
|
+
type IAlertDialogProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog> &
|
|
86
75
|
VariantProps<typeof alertDialogStyle>;
|
|
87
76
|
|
|
88
|
-
type IAlertDialogContentProps = React.ComponentPropsWithoutRef<
|
|
89
|
-
typeof UIAccessibleAlertDialog.Content
|
|
90
|
-
> &
|
|
77
|
+
type IAlertDialogContentProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Content> &
|
|
91
78
|
VariantProps<typeof alertDialogContentStyle> & { className?: string };
|
|
92
79
|
|
|
93
|
-
type IAlertDialogCloseButtonProps = React.ComponentPropsWithoutRef<
|
|
94
|
-
typeof UIAccessibleAlertDialog.CloseButton
|
|
95
|
-
> &
|
|
80
|
+
type IAlertDialogCloseButtonProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.CloseButton> &
|
|
96
81
|
VariantProps<typeof alertDialogCloseButtonStyle>;
|
|
97
82
|
|
|
98
|
-
type IAlertDialogHeaderProps = React.ComponentPropsWithoutRef<
|
|
99
|
-
typeof UIAccessibleAlertDialog.Header
|
|
100
|
-
> &
|
|
83
|
+
type IAlertDialogHeaderProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Header> &
|
|
101
84
|
VariantProps<typeof alertDialogHeaderStyle>;
|
|
102
85
|
|
|
103
|
-
type IAlertDialogFooterProps = React.ComponentPropsWithoutRef<
|
|
104
|
-
typeof UIAccessibleAlertDialog.Footer
|
|
105
|
-
> &
|
|
86
|
+
type IAlertDialogFooterProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Footer> &
|
|
106
87
|
VariantProps<typeof alertDialogFooterStyle>;
|
|
107
88
|
|
|
108
|
-
type IAlertDialogBodyProps = React.ComponentPropsWithoutRef<
|
|
109
|
-
typeof UIAccessibleAlertDialog.Body
|
|
110
|
-
> &
|
|
89
|
+
type IAlertDialogBodyProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Body> &
|
|
111
90
|
VariantProps<typeof alertDialogBodyStyle>;
|
|
112
91
|
|
|
113
|
-
type IAlertDialogBackdropProps = React.ComponentPropsWithoutRef<
|
|
114
|
-
typeof UIAccessibleAlertDialog.Backdrop
|
|
115
|
-
> &
|
|
92
|
+
type IAlertDialogBackdropProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Backdrop> &
|
|
116
93
|
VariantProps<typeof alertDialogBackdropStyle> & { className?: string };
|
|
117
94
|
|
|
118
|
-
const AlertDialog = React.forwardRef<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
95
|
+
const AlertDialog = React.forwardRef<React.ComponentRef<typeof UIAccessibleAlertDialog>, IAlertDialogProps>(
|
|
96
|
+
function AlertDialog({ className, size = 'md', ...props }, ref) {
|
|
97
|
+
return (
|
|
98
|
+
<UIAccessibleAlertDialog
|
|
99
|
+
ref={ref}
|
|
100
|
+
{...props}
|
|
101
|
+
className={alertDialogStyle({ class: className })}
|
|
102
|
+
context={{ size }}
|
|
103
|
+
pointerEvents="box-none"
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
);
|
|
132
108
|
|
|
133
109
|
const AlertDialogContent = React.forwardRef<
|
|
134
110
|
React.ComponentRef<typeof UIAccessibleAlertDialog.Content>,
|
|
@@ -249,6 +225,5 @@ export {
|
|
|
249
225
|
AlertDialogCloseButton,
|
|
250
226
|
AlertDialogContent,
|
|
251
227
|
AlertDialogFooter,
|
|
252
|
-
AlertDialogHeader
|
|
228
|
+
AlertDialogHeader,
|
|
253
229
|
};
|
|
254
|
-
|
|
@@ -36,66 +36,38 @@ const avatarImageStyle = tva({
|
|
|
36
36
|
base: 'h-full w-full rounded-full absolute',
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
type IAvatarProps = Omit<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
React.ComponentRef<typeof UIAvatar>,
|
|
47
|
-
IAvatarProps
|
|
48
|
-
>(function Avatar({ className, ...props }, ref) {
|
|
49
|
-
return (
|
|
50
|
-
<UIAvatar
|
|
51
|
-
ref={ref}
|
|
52
|
-
{...props}
|
|
53
|
-
className={avatarStyle({ class: className })}
|
|
54
|
-
context={{}}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
39
|
+
type IAvatarProps = Omit<React.ComponentPropsWithoutRef<typeof UIAvatar>, 'context'> & VariantProps<typeof avatarStyle>;
|
|
40
|
+
|
|
41
|
+
const Avatar = React.forwardRef<React.ComponentRef<typeof UIAvatar>, IAvatarProps>(function Avatar(
|
|
42
|
+
{ className, ...props },
|
|
43
|
+
ref,
|
|
44
|
+
) {
|
|
45
|
+
return <UIAvatar ref={ref} {...props} className={avatarStyle({ class: className })} context={{}} />;
|
|
57
46
|
});
|
|
58
47
|
|
|
59
|
-
type IAvatarBadgeProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Badge> &
|
|
60
|
-
VariantProps<typeof avatarBadgeStyle>;
|
|
48
|
+
type IAvatarBadgeProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Badge> & VariantProps<typeof avatarBadgeStyle>;
|
|
61
49
|
|
|
62
|
-
const AvatarBadge = React.forwardRef<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<UIAvatar.Badge
|
|
68
|
-
ref={ref}
|
|
69
|
-
{...props}
|
|
70
|
-
className={avatarBadgeStyle({ class: className })}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
50
|
+
const AvatarBadge = React.forwardRef<React.ComponentRef<typeof UIAvatar.Badge>, IAvatarBadgeProps>(function AvatarBadge(
|
|
51
|
+
{ className, ...props },
|
|
52
|
+
ref,
|
|
53
|
+
) {
|
|
54
|
+
return <UIAvatar.Badge ref={ref} {...props} className={avatarBadgeStyle({ class: className })} />;
|
|
73
55
|
});
|
|
74
56
|
|
|
75
|
-
type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef<
|
|
76
|
-
typeof UIAvatar.FallbackText
|
|
77
|
-
> &
|
|
57
|
+
type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef<typeof UIAvatar.FallbackText> &
|
|
78
58
|
VariantProps<typeof avatarFallbackTextStyle>;
|
|
79
|
-
const AvatarFallbackText = React.forwardRef<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
type IAvatarImageProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Image> &
|
|
93
|
-
VariantProps<typeof avatarImageStyle>;
|
|
94
|
-
|
|
95
|
-
const AvatarImage = React.forwardRef<
|
|
96
|
-
React.ComponentRef<typeof UIAvatar.Image>,
|
|
97
|
-
IAvatarImageProps
|
|
98
|
-
>(function AvatarImage({ className, ...props }, ref) {
|
|
59
|
+
const AvatarFallbackText = React.forwardRef<React.ComponentRef<typeof UIAvatar.FallbackText>, IAvatarFallbackTextProps>(
|
|
60
|
+
function AvatarFallbackText({ className, ...props }, ref) {
|
|
61
|
+
return <UIAvatar.FallbackText ref={ref} {...props} className={avatarFallbackTextStyle({ class: className })} />;
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
type IAvatarImageProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Image> & VariantProps<typeof avatarImageStyle>;
|
|
66
|
+
|
|
67
|
+
const AvatarImage = React.forwardRef<React.ComponentRef<typeof UIAvatar.Image>, IAvatarImageProps>(function AvatarImage(
|
|
68
|
+
{ className, ...props },
|
|
69
|
+
ref,
|
|
70
|
+
) {
|
|
99
71
|
return (
|
|
100
72
|
<UIAvatar.Image
|
|
101
73
|
ref={ref}
|
|
@@ -108,13 +80,12 @@ const AvatarImage = React.forwardRef<
|
|
|
108
80
|
);
|
|
109
81
|
});
|
|
110
82
|
|
|
111
|
-
type IAvatarGroupProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Group> &
|
|
112
|
-
VariantProps<typeof avatarGroupStyle>;
|
|
83
|
+
type IAvatarGroupProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Group> & VariantProps<typeof avatarGroupStyle>;
|
|
113
84
|
|
|
114
|
-
const AvatarGroup = React.forwardRef<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
85
|
+
const AvatarGroup = React.forwardRef<React.ComponentRef<typeof UIAvatar.Group>, IAvatarGroupProps>(function AvatarGroup(
|
|
86
|
+
{ className, ...props },
|
|
87
|
+
ref,
|
|
88
|
+
) {
|
|
118
89
|
return (
|
|
119
90
|
<UIAvatar.Group
|
|
120
91
|
ref={ref}
|
|
@@ -129,11 +100,4 @@ const AvatarGroup = React.forwardRef<
|
|
|
129
100
|
// Alias for shadcn compatibility
|
|
130
101
|
const AvatarFallback = AvatarFallbackText;
|
|
131
102
|
|
|
132
|
-
export {
|
|
133
|
-
Avatar,
|
|
134
|
-
AvatarBadge,
|
|
135
|
-
AvatarFallback,
|
|
136
|
-
AvatarFallbackText,
|
|
137
|
-
AvatarGroup,
|
|
138
|
-
AvatarImage,
|
|
139
|
-
};
|
|
103
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarFallbackText, AvatarGroup, AvatarImage };
|
|
@@ -3,10 +3,7 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
4
|
import { UIIcon } from '@gluestack-ui/core/icon/creator';
|
|
5
5
|
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
-
import {
|
|
7
|
-
withStyleContext,
|
|
8
|
-
useStyleContext,
|
|
9
|
-
} from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
+
import { withStyleContext, useStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
10
7
|
import { cssInterop } from 'nativewind';
|
|
11
8
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
12
9
|
|
|
@@ -19,8 +16,7 @@ const badgeStyle = tva({
|
|
|
19
16
|
variant: {
|
|
20
17
|
default: 'bg-primary',
|
|
21
18
|
secondary: 'bg-secondary',
|
|
22
|
-
destructive:
|
|
23
|
-
'bg-destructive dark:bg-destructive/60',
|
|
19
|
+
destructive: 'bg-destructive dark:bg-destructive/60',
|
|
24
20
|
outline: 'border border-border dark:border-border/90 bg-transparent',
|
|
25
21
|
},
|
|
26
22
|
},
|
|
@@ -65,32 +61,21 @@ cssInterop(UIIcon, {
|
|
|
65
61
|
},
|
|
66
62
|
});
|
|
67
63
|
|
|
68
|
-
type IBadgeProps = React.ComponentPropsWithoutRef<typeof ContextView> &
|
|
69
|
-
|
|
70
|
-
function Badge({
|
|
71
|
-
children,
|
|
72
|
-
variant = 'default',
|
|
73
|
-
className,
|
|
74
|
-
...props
|
|
75
|
-
}: { className?: string } & IBadgeProps) {
|
|
64
|
+
type IBadgeProps = React.ComponentPropsWithoutRef<typeof ContextView> & VariantProps<typeof badgeStyle>;
|
|
65
|
+
function Badge({ children, variant = 'default', className, ...props }: { className?: string } & IBadgeProps) {
|
|
76
66
|
return (
|
|
77
|
-
<ContextView
|
|
78
|
-
className={badgeStyle({ variant, class: className })}
|
|
79
|
-
{...props}
|
|
80
|
-
context={{ variant }}
|
|
81
|
-
>
|
|
67
|
+
<ContextView className={badgeStyle({ variant, class: className })} {...props} context={{ variant }}>
|
|
82
68
|
{children}
|
|
83
69
|
</ContextView>
|
|
84
70
|
);
|
|
85
71
|
}
|
|
86
72
|
|
|
87
|
-
type IBadgeTextProps = React.ComponentPropsWithoutRef<typeof Text> &
|
|
88
|
-
VariantProps<typeof badgeTextStyle>;
|
|
73
|
+
type IBadgeTextProps = React.ComponentPropsWithoutRef<typeof Text> & VariantProps<typeof badgeTextStyle>;
|
|
89
74
|
|
|
90
|
-
const BadgeText = React.forwardRef<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
const BadgeText = React.forwardRef<React.ComponentRef<typeof Text>, IBadgeTextProps>(function BadgeText(
|
|
76
|
+
{ children, className, ...props },
|
|
77
|
+
ref,
|
|
78
|
+
) {
|
|
94
79
|
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
95
80
|
return (
|
|
96
81
|
<Text
|
|
@@ -115,32 +100,16 @@ type IBadgeIconProps = React.ComponentPropsWithoutRef<typeof UIIcon> &
|
|
|
115
100
|
width?: number;
|
|
116
101
|
};
|
|
117
102
|
|
|
118
|
-
const BadgeIcon = React.forwardRef<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
const BadgeIcon = React.forwardRef<React.ComponentRef<typeof Svg>, IBadgeIconProps>(function BadgeIcon(
|
|
104
|
+
{ className, size, ...props },
|
|
105
|
+
ref,
|
|
106
|
+
) {
|
|
122
107
|
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
123
108
|
|
|
124
109
|
if (typeof size === 'number') {
|
|
125
|
-
return (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{...props}
|
|
129
|
-
className={badgeIconStyle({ class: className })}
|
|
130
|
-
size={size}
|
|
131
|
-
/>
|
|
132
|
-
);
|
|
133
|
-
} else if (
|
|
134
|
-
(props?.height !== undefined || props?.width !== undefined) &&
|
|
135
|
-
size === undefined
|
|
136
|
-
) {
|
|
137
|
-
return (
|
|
138
|
-
<UIIcon
|
|
139
|
-
ref={ref as any}
|
|
140
|
-
{...props}
|
|
141
|
-
className={badgeIconStyle({ class: className })}
|
|
142
|
-
/>
|
|
143
|
-
);
|
|
110
|
+
return <UIIcon ref={ref as any} {...props} className={badgeIconStyle({ class: className })} size={size} />;
|
|
111
|
+
} else if ((props?.height !== undefined || props?.width !== undefined) && size === undefined) {
|
|
112
|
+
return <UIIcon ref={ref as any} {...props} className={badgeIconStyle({ class: className })} />;
|
|
144
113
|
}
|
|
145
114
|
return (
|
|
146
115
|
<UIIcon
|
|
@@ -160,4 +129,4 @@ Badge.displayName = 'Badge';
|
|
|
160
129
|
BadgeText.displayName = 'BadgeText';
|
|
161
130
|
BadgeIcon.displayName = 'BadgeIcon';
|
|
162
131
|
|
|
163
|
-
export { Badge, BadgeIcon, BadgeText };
|
|
132
|
+
export { Badge, BadgeIcon, BadgeText };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { FocusScope } from '@gluestack-ui/utils/aria';
|
|
3
3
|
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
4
4
|
import GorhomBottomSheet, {
|
|
@@ -70,10 +70,10 @@ type BottomSheetContextValue = {
|
|
|
70
70
|
const BottomSheetContext = createContext<BottomSheetContextValue>({
|
|
71
71
|
visible: false,
|
|
72
72
|
bottomSheetRef: { current: null! },
|
|
73
|
-
handleClose: () => {
|
|
74
|
-
handleNaturalClose: () => {
|
|
75
|
-
handleOpen: () => {
|
|
76
|
-
snapToIndex: () => {
|
|
73
|
+
handleClose: () => {},
|
|
74
|
+
handleNaturalClose: () => {},
|
|
75
|
+
handleOpen: () => {},
|
|
76
|
+
snapToIndex: () => {},
|
|
77
77
|
currentIndex: -1,
|
|
78
78
|
});
|
|
79
79
|
|
|
@@ -107,7 +107,7 @@ export const BottomSheet = forwardRef<BottomSheetRef, IBottomSheetRootProps>(
|
|
|
107
107
|
setCurrentIndex(targetIndex);
|
|
108
108
|
onOpen?.();
|
|
109
109
|
},
|
|
110
|
-
[defaultSnapIndex, onOpen]
|
|
110
|
+
[defaultSnapIndex, onOpen],
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
// Triggers the close animation only — state updates happen via onChange chain
|
|
@@ -146,7 +146,7 @@ export const BottomSheet = forwardRef<BottomSheetRef, IBottomSheetRootProps>(
|
|
|
146
146
|
expand,
|
|
147
147
|
collapse,
|
|
148
148
|
}),
|
|
149
|
-
[handleOpen, handleClose, snapToIndex, expand, collapse]
|
|
149
|
+
[handleOpen, handleClose, snapToIndex, expand, collapse],
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
const contextValue = useMemo(
|
|
@@ -159,23 +159,16 @@ export const BottomSheet = forwardRef<BottomSheetRef, IBottomSheetRootProps>(
|
|
|
159
159
|
snapToIndex,
|
|
160
160
|
currentIndex,
|
|
161
161
|
}),
|
|
162
|
-
[visible, handleClose, handleNaturalClose, handleOpen, snapToIndex, currentIndex]
|
|
162
|
+
[visible, handleClose, handleNaturalClose, handleOpen, snapToIndex, currentIndex],
|
|
163
163
|
);
|
|
164
164
|
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
{children}
|
|
168
|
-
</BottomSheetContext.Provider>
|
|
169
|
-
);
|
|
170
|
-
}
|
|
165
|
+
return <BottomSheetContext.Provider value={contextValue}>{children}</BottomSheetContext.Provider>;
|
|
166
|
+
},
|
|
171
167
|
);
|
|
172
168
|
|
|
173
169
|
BottomSheet.displayName = 'BottomSheet';
|
|
174
170
|
|
|
175
|
-
type IBottomSheetPortalProps = Omit<
|
|
176
|
-
React.ComponentProps<typeof GorhomBottomSheet>,
|
|
177
|
-
'ref'
|
|
178
|
-
> & {
|
|
171
|
+
type IBottomSheetPortalProps = Omit<React.ComponentProps<typeof GorhomBottomSheet>, 'ref'> & {
|
|
179
172
|
snapPoints: (string | number)[];
|
|
180
173
|
className?: string;
|
|
181
174
|
backgroundClassName?: string;
|
|
@@ -209,7 +202,7 @@ export const BottomSheetPortal = ({
|
|
|
209
202
|
handleNaturalClose();
|
|
210
203
|
}
|
|
211
204
|
},
|
|
212
|
-
[handleNaturalClose, onChange]
|
|
205
|
+
[handleNaturalClose, onChange],
|
|
213
206
|
);
|
|
214
207
|
|
|
215
208
|
return (
|
|
@@ -284,9 +277,7 @@ export const BottomSheetBackdrop = ({
|
|
|
284
277
|
);
|
|
285
278
|
};
|
|
286
279
|
|
|
287
|
-
type IBottomSheetHandleProps = React.ComponentProps<
|
|
288
|
-
typeof GorhomBottomSheetHandle
|
|
289
|
-
> & {
|
|
280
|
+
type IBottomSheetHandleProps = React.ComponentProps<typeof GorhomBottomSheetHandle> & {
|
|
290
281
|
className?: string;
|
|
291
282
|
indicatorClassName?: string;
|
|
292
283
|
};
|
|
@@ -308,18 +299,12 @@ export const BottomSheetDragIndicator = ({
|
|
|
308
299
|
);
|
|
309
300
|
};
|
|
310
301
|
|
|
311
|
-
type IBottomSheetContentProps = React.ComponentProps<
|
|
312
|
-
typeof GorhomBottomSheetView
|
|
313
|
-
> & {
|
|
302
|
+
type IBottomSheetContentProps = React.ComponentProps<typeof GorhomBottomSheetView> & {
|
|
314
303
|
className?: string;
|
|
315
304
|
focusScope?: boolean;
|
|
316
305
|
};
|
|
317
306
|
|
|
318
|
-
export const BottomSheetContent = ({
|
|
319
|
-
className,
|
|
320
|
-
focusScope = true,
|
|
321
|
-
...props
|
|
322
|
-
}: IBottomSheetContentProps) => {
|
|
307
|
+
export const BottomSheetContent = ({ className, focusScope = true, ...props }: IBottomSheetContentProps) => {
|
|
323
308
|
const { handleClose, visible } = useContext(BottomSheetContext);
|
|
324
309
|
|
|
325
310
|
const keyDownHandlers = useMemo(() => {
|
|
@@ -357,18 +342,12 @@ export const BottomSheetContent = ({
|
|
|
357
342
|
);
|
|
358
343
|
};
|
|
359
344
|
|
|
360
|
-
type IBottomSheetFooterProps = React.ComponentProps<
|
|
361
|
-
typeof GorhomBottomSheetFooter
|
|
362
|
-
> & {
|
|
345
|
+
type IBottomSheetFooterProps = React.ComponentProps<typeof GorhomBottomSheetFooter> & {
|
|
363
346
|
className?: string;
|
|
364
347
|
children?: React.ReactNode;
|
|
365
348
|
};
|
|
366
349
|
|
|
367
|
-
export const BottomSheetFooter = ({
|
|
368
|
-
className,
|
|
369
|
-
children,
|
|
370
|
-
...props
|
|
371
|
-
}: IBottomSheetFooterProps) => {
|
|
350
|
+
export const BottomSheetFooter = ({ className, children, ...props }: IBottomSheetFooterProps) => {
|
|
372
351
|
return (
|
|
373
352
|
<GorhomBottomSheetFooter {...props}>
|
|
374
353
|
<View
|
|
@@ -386,12 +365,7 @@ type IBottomSheetItemProps = PressableProps & {
|
|
|
386
365
|
closeOnSelect?: boolean;
|
|
387
366
|
};
|
|
388
367
|
|
|
389
|
-
export const BottomSheetItem = ({
|
|
390
|
-
children,
|
|
391
|
-
className,
|
|
392
|
-
closeOnSelect = true,
|
|
393
|
-
...props
|
|
394
|
-
}: IBottomSheetItemProps) => {
|
|
368
|
+
export const BottomSheetItem = ({ children, className, closeOnSelect = true, ...props }: IBottomSheetItemProps) => {
|
|
395
369
|
const { handleClose } = useContext(BottomSheetContext);
|
|
396
370
|
|
|
397
371
|
return (
|
|
@@ -416,17 +390,11 @@ type IBottomSheetItemTextProps = TextProps & {
|
|
|
416
390
|
className?: string;
|
|
417
391
|
};
|
|
418
392
|
|
|
419
|
-
export const BottomSheetItemText = ({
|
|
420
|
-
className,
|
|
421
|
-
...props
|
|
422
|
-
}: IBottomSheetItemTextProps) => {
|
|
393
|
+
export const BottomSheetItemText = ({ className, ...props }: IBottomSheetItemTextProps) => {
|
|
423
394
|
return <Text {...props} className={bottomSheetItemTextStyle({ className })} />;
|
|
424
395
|
};
|
|
425
396
|
|
|
426
|
-
export const BottomSheetTextInput = ({
|
|
427
|
-
className,
|
|
428
|
-
...props
|
|
429
|
-
}: TextInputProps) => {
|
|
397
|
+
export const BottomSheetTextInput = ({ className, ...props }: TextInputProps) => {
|
|
430
398
|
return <GorhomBottomSheetInput {...props} className={bottomSheetTextInputStyle({ className })} />;
|
|
431
399
|
};
|
|
432
400
|
// Scrollable components with className support
|
|
@@ -4,16 +4,11 @@ import { View, ViewProps } from 'react-native';
|
|
|
4
4
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
5
5
|
import { boxStyle } from './styles';
|
|
6
6
|
|
|
7
|
-
type IBoxProps = ViewProps &
|
|
8
|
-
VariantProps<typeof boxStyle> & { className?: string };
|
|
7
|
+
type IBoxProps = ViewProps & VariantProps<typeof boxStyle> & { className?: string };
|
|
9
8
|
|
|
10
|
-
const Box = React.forwardRef<React.ComponentRef<typeof View>, IBoxProps>(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<View ref={ref} {...props} className={boxStyle({ class: className })} />
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
);
|
|
9
|
+
const Box = React.forwardRef<React.ComponentRef<typeof View>, IBoxProps>(function Box({ className, ...props }, ref) {
|
|
10
|
+
return <View ref={ref} {...props} className={boxStyle({ class: className })} />;
|
|
11
|
+
});
|
|
17
12
|
|
|
18
13
|
Box.displayName = 'Box';
|
|
19
14
|
export { Box };
|
|
@@ -3,16 +3,10 @@ import { boxStyle } from './styles';
|
|
|
3
3
|
|
|
4
4
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
5
5
|
|
|
6
|
-
type IBoxProps = React.ComponentPropsWithoutRef<'div'> &
|
|
7
|
-
VariantProps<typeof boxStyle> & { className?: string };
|
|
6
|
+
type IBoxProps = React.ComponentPropsWithoutRef<'div'> & VariantProps<typeof boxStyle> & { className?: string };
|
|
8
7
|
|
|
9
|
-
const Box = React.forwardRef<HTMLDivElement, IBoxProps>(function Box(
|
|
10
|
-
{ className
|
|
11
|
-
ref
|
|
12
|
-
) {
|
|
13
|
-
return (
|
|
14
|
-
<div ref={ref} className={boxStyle({ class: className })} {...props} />
|
|
15
|
-
);
|
|
8
|
+
const Box = React.forwardRef<HTMLDivElement, IBoxProps>(function Box({ className, ...props }, ref) {
|
|
9
|
+
return <div ref={ref} className={boxStyle({ class: className })} {...props} />;
|
|
16
10
|
});
|
|
17
11
|
|
|
18
12
|
Box.displayName = 'Box';
|