@flipova/foundation 2.3.0 → 2.4.0-beta.1
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
|
@@ -4,44 +4,30 @@ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
|
4
4
|
import { Text as RNText } from 'react-native';
|
|
5
5
|
import { textStyle } from './styles';
|
|
6
6
|
|
|
7
|
-
type ITextProps = React.ComponentProps<typeof RNText> &
|
|
8
|
-
VariantProps<typeof textStyle>;
|
|
7
|
+
type ITextProps = React.ComponentProps<typeof RNText> & VariantProps<typeof textStyle>;
|
|
9
8
|
|
|
10
|
-
const Text = React.forwardRef<React.ComponentRef<typeof RNText>, ITextProps>(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
strikeThrough: strikeThrough as boolean,
|
|
33
|
-
size,
|
|
34
|
-
sub: sub as boolean,
|
|
35
|
-
italic: italic as boolean,
|
|
36
|
-
highlight: highlight as boolean,
|
|
37
|
-
class: className,
|
|
38
|
-
})}
|
|
39
|
-
{...props}
|
|
40
|
-
ref={ref}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
);
|
|
9
|
+
const Text = React.forwardRef<React.ComponentRef<typeof RNText>, ITextProps>(function Text(
|
|
10
|
+
{ className, isTruncated, bold, underline, strikeThrough, size = 'md', sub, italic, highlight, ...props },
|
|
11
|
+
ref,
|
|
12
|
+
) {
|
|
13
|
+
return (
|
|
14
|
+
<RNText
|
|
15
|
+
className={textStyle({
|
|
16
|
+
isTruncated: isTruncated as boolean,
|
|
17
|
+
bold: bold as boolean,
|
|
18
|
+
underline: underline as boolean,
|
|
19
|
+
strikeThrough: strikeThrough as boolean,
|
|
20
|
+
size,
|
|
21
|
+
sub: sub as boolean,
|
|
22
|
+
italic: italic as boolean,
|
|
23
|
+
highlight: highlight as boolean,
|
|
24
|
+
class: className,
|
|
25
|
+
})}
|
|
26
|
+
{...props}
|
|
27
|
+
ref={ref}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
45
31
|
|
|
46
32
|
Text.displayName = 'Text';
|
|
47
33
|
|
|
@@ -4,41 +4,39 @@ import { textStyle } from './styles';
|
|
|
4
4
|
|
|
5
5
|
type ITextProps = React.ComponentProps<'span'> & VariantProps<typeof textStyle>;
|
|
6
6
|
|
|
7
|
-
const Text = React.forwardRef<React.ComponentRef<'span'>, ITextProps>(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
);
|
|
7
|
+
const Text = React.forwardRef<React.ComponentRef<'span'>, ITextProps>(function Text(
|
|
8
|
+
{
|
|
9
|
+
className,
|
|
10
|
+
isTruncated,
|
|
11
|
+
bold,
|
|
12
|
+
underline,
|
|
13
|
+
strikeThrough,
|
|
14
|
+
size = 'md',
|
|
15
|
+
sub,
|
|
16
|
+
italic,
|
|
17
|
+
highlight,
|
|
18
|
+
...props
|
|
19
|
+
}: { className?: string } & ITextProps,
|
|
20
|
+
ref,
|
|
21
|
+
) {
|
|
22
|
+
return (
|
|
23
|
+
<span
|
|
24
|
+
className={textStyle({
|
|
25
|
+
isTruncated: isTruncated as boolean,
|
|
26
|
+
bold: bold as boolean,
|
|
27
|
+
underline: underline as boolean,
|
|
28
|
+
strikeThrough: strikeThrough as boolean,
|
|
29
|
+
size,
|
|
30
|
+
sub: sub as boolean,
|
|
31
|
+
italic: italic as boolean,
|
|
32
|
+
highlight: highlight as boolean,
|
|
33
|
+
class: className,
|
|
34
|
+
})}
|
|
35
|
+
{...props}
|
|
36
|
+
ref={ref}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
42
40
|
|
|
43
41
|
Text.displayName = 'Text';
|
|
44
42
|
|
|
@@ -23,11 +23,11 @@ export const textStyle = tva({
|
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
25
|
'2xs': 'text-2xs',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
xs: 'text-xs',
|
|
27
|
+
sm: 'text-sm',
|
|
28
|
+
md: 'text-base',
|
|
29
|
+
lg: 'text-lg',
|
|
30
|
+
xl: 'text-xl',
|
|
31
31
|
'2xl': 'text-2xl',
|
|
32
32
|
'3xl': 'text-3xl',
|
|
33
33
|
'4xl': 'text-4xl',
|
|
@@ -3,10 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { createTextarea } from '@gluestack-ui/core/textarea/creator';
|
|
4
4
|
import { View, TextInput } from 'react-native';
|
|
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 type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
11
8
|
|
|
12
9
|
const SCOPE = 'TEXTAREA';
|
|
@@ -44,49 +41,38 @@ const textareaInputStyle = tva({
|
|
|
44
41
|
},
|
|
45
42
|
});
|
|
46
43
|
|
|
47
|
-
type ITextareaProps = React.ComponentProps<typeof UITextarea> &
|
|
48
|
-
VariantProps<typeof textareaStyle>;
|
|
44
|
+
type ITextareaProps = React.ComponentProps<typeof UITextarea> & VariantProps<typeof textareaStyle>;
|
|
49
45
|
|
|
50
|
-
const Textarea = React.forwardRef<
|
|
51
|
-
React.ComponentRef<typeof UITextarea>,
|
|
52
|
-
ITextareaProps
|
|
53
|
-
>(function Textarea(
|
|
46
|
+
const Textarea = React.forwardRef<React.ComponentRef<typeof UITextarea>, ITextareaProps>(function Textarea(
|
|
54
47
|
{ className, variant = 'default', size = 'md', ...props },
|
|
55
|
-
ref
|
|
48
|
+
ref,
|
|
56
49
|
) {
|
|
57
50
|
return (
|
|
58
|
-
<UITextarea
|
|
59
|
-
ref={ref}
|
|
60
|
-
{...props}
|
|
61
|
-
className={textareaStyle({ variant, class: className })}
|
|
62
|
-
context={{ size }}
|
|
63
|
-
/>
|
|
51
|
+
<UITextarea ref={ref} {...props} className={textareaStyle({ variant, class: className })} context={{ size }} />
|
|
64
52
|
);
|
|
65
53
|
});
|
|
66
54
|
|
|
67
|
-
type ITextareaInputProps = React.ComponentProps<typeof UITextarea.Input> &
|
|
68
|
-
VariantProps<typeof textareaInputStyle>;
|
|
55
|
+
type ITextareaInputProps = React.ComponentProps<typeof UITextarea.Input> & VariantProps<typeof textareaInputStyle>;
|
|
69
56
|
|
|
70
|
-
const TextareaInput = React.forwardRef<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
>(function TextareaInput({ className, ...props }, ref) {
|
|
74
|
-
const { size: parentSize } = useStyleContext(SCOPE);
|
|
57
|
+
const TextareaInput = React.forwardRef<React.ComponentRef<typeof UITextarea.Input>, ITextareaInputProps>(
|
|
58
|
+
function TextareaInput({ className, ...props }, ref) {
|
|
59
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
75
60
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
61
|
+
return (
|
|
62
|
+
<UITextarea.Input
|
|
63
|
+
ref={ref}
|
|
64
|
+
{...props}
|
|
65
|
+
textAlignVertical="top"
|
|
66
|
+
className={textareaInputStyle({
|
|
67
|
+
parentVariants: {
|
|
68
|
+
size: parentSize,
|
|
69
|
+
},
|
|
70
|
+
class: className,
|
|
71
|
+
})}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
90
76
|
|
|
91
77
|
Textarea.displayName = 'Textarea';
|
|
92
78
|
TextareaInput.displayName = 'TextareaInput';
|
|
@@ -45,11 +45,11 @@ const toastTitleStyle = tva({
|
|
|
45
45
|
},
|
|
46
46
|
size: {
|
|
47
47
|
'2xs': 'text-2xs',
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
xs: 'text-xs',
|
|
49
|
+
sm: 'text-sm',
|
|
50
|
+
md: 'text-base',
|
|
51
|
+
lg: 'text-lg',
|
|
52
|
+
xl: 'text-xl',
|
|
53
53
|
'2xl': 'text-2xl',
|
|
54
54
|
'3xl': 'text-3xl',
|
|
55
55
|
'4xl': 'text-4xl',
|
|
@@ -141,11 +141,11 @@ const toastDescriptionStyle = tva({
|
|
|
141
141
|
},
|
|
142
142
|
size: {
|
|
143
143
|
'2xs': 'text-2xs',
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
xs: 'text-xs',
|
|
145
|
+
sm: 'text-sm',
|
|
146
|
+
md: 'text-base',
|
|
147
|
+
lg: 'text-lg',
|
|
148
|
+
xl: 'text-xl',
|
|
149
149
|
'2xl': 'text-2xl',
|
|
150
150
|
'3xl': 'text-3xl',
|
|
151
151
|
'4xl': 'text-4xl',
|
|
@@ -166,33 +166,30 @@ type IToastProps = React.ComponentProps<typeof Root> & {
|
|
|
166
166
|
className?: string;
|
|
167
167
|
} & VariantProps<typeof toastStyle>;
|
|
168
168
|
|
|
169
|
-
const Toast = React.forwardRef<React.ComponentRef<typeof Root>, IToastProps>(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
);
|
|
169
|
+
const Toast = React.forwardRef<React.ComponentRef<typeof Root>, IToastProps>(function Toast(
|
|
170
|
+
{ className, variant = 'solid', action = 'muted', ...props },
|
|
171
|
+
ref,
|
|
172
|
+
) {
|
|
173
|
+
return (
|
|
174
|
+
<Root
|
|
175
|
+
ref={ref}
|
|
176
|
+
entering={SlideInUp}
|
|
177
|
+
className={toastStyle({ variant, action, class: className })}
|
|
178
|
+
context={{ variant, action }}
|
|
179
|
+
{...props}
|
|
180
|
+
/>
|
|
181
|
+
);
|
|
182
|
+
});
|
|
185
183
|
|
|
186
184
|
type IToastTitleProps = React.ComponentProps<typeof Text> & {
|
|
187
185
|
className?: string;
|
|
188
186
|
} & VariantProps<typeof toastTitleStyle>;
|
|
189
187
|
|
|
190
|
-
const ToastTitle = React.forwardRef<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const { variant: parentVariant, action: parentAction } =
|
|
195
|
-
useStyleContext(SCOPE);
|
|
188
|
+
const ToastTitle = React.forwardRef<React.ComponentRef<typeof Text>, IToastTitleProps>(function ToastTitle(
|
|
189
|
+
{ className, size = 'md', children, ...props },
|
|
190
|
+
ref,
|
|
191
|
+
) {
|
|
192
|
+
const { variant: parentVariant, action: parentAction } = useStyleContext(SCOPE);
|
|
196
193
|
React.useEffect(() => {
|
|
197
194
|
// Issue from react-native side
|
|
198
195
|
// Hack for now, will fix this later
|
|
@@ -224,29 +221,27 @@ type IToastDescriptionProps = React.ComponentProps<typeof Text> & {
|
|
|
224
221
|
className?: string;
|
|
225
222
|
} & VariantProps<typeof toastDescriptionStyle>;
|
|
226
223
|
|
|
227
|
-
const ToastDescription = React.forwardRef<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
});
|
|
224
|
+
const ToastDescription = React.forwardRef<React.ComponentRef<typeof Text>, IToastDescriptionProps>(
|
|
225
|
+
function ToastDescription({ className, size = 'md', ...props }, ref) {
|
|
226
|
+
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
227
|
+
return (
|
|
228
|
+
<Text
|
|
229
|
+
ref={ref}
|
|
230
|
+
{...props}
|
|
231
|
+
className={toastDescriptionStyle({
|
|
232
|
+
size,
|
|
233
|
+
class: className,
|
|
234
|
+
parentVariants: {
|
|
235
|
+
variant: parentVariant,
|
|
236
|
+
},
|
|
237
|
+
})}
|
|
238
|
+
/>
|
|
239
|
+
);
|
|
240
|
+
},
|
|
241
|
+
);
|
|
246
242
|
|
|
247
243
|
Toast.displayName = 'Toast';
|
|
248
244
|
ToastTitle.displayName = 'ToastTitle';
|
|
249
245
|
ToastDescription.displayName = 'ToastDescription';
|
|
250
246
|
|
|
251
247
|
export { Toast, ToastDescription, ToastTitle, useToast };
|
|
252
|
-
|
|
@@ -5,11 +5,7 @@ import { View, Text, ViewStyle } from 'react-native';
|
|
|
5
5
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
6
|
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
7
7
|
import { withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
8
|
-
import {
|
|
9
|
-
Motion,
|
|
10
|
-
AnimatePresence,
|
|
11
|
-
MotionComponentProps,
|
|
12
|
-
} from '@legendapp/motion';
|
|
8
|
+
import { Motion, AnimatePresence, MotionComponentProps } from '@legendapp/motion';
|
|
13
9
|
import { cssInterop } from 'nativewind';
|
|
14
10
|
|
|
15
11
|
type IMotionViewProps = React.ComponentProps<typeof View> &
|
|
@@ -52,11 +48,11 @@ const tooltipTextStyle = tva({
|
|
|
52
48
|
},
|
|
53
49
|
size: {
|
|
54
50
|
'2xs': 'text-2xs',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
xs: 'text-xs',
|
|
52
|
+
sm: 'text-sm',
|
|
53
|
+
md: 'text-base',
|
|
54
|
+
lg: 'text-lg',
|
|
55
|
+
xl: 'text-xl',
|
|
60
56
|
'2xl': 'text-2xl',
|
|
61
57
|
'3xl': 'text-3xl',
|
|
62
58
|
'4xl': 'text-4xl',
|
|
@@ -82,17 +78,11 @@ type ITooltipContentProps = React.ComponentProps<typeof UITooltip.Content> &
|
|
|
82
78
|
type ITooltipTextProps = React.ComponentProps<typeof UITooltip.Text> &
|
|
83
79
|
VariantProps<typeof tooltipTextStyle> & { className?: string };
|
|
84
80
|
|
|
85
|
-
const Tooltip = React.forwardRef<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<UITooltip
|
|
91
|
-
ref={ref}
|
|
92
|
-
className={tooltipStyle({ class: className })}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
81
|
+
const Tooltip = React.forwardRef<React.ComponentRef<typeof UITooltip>, ITooltipProps>(function Tooltip(
|
|
82
|
+
{ className, ...props },
|
|
83
|
+
ref,
|
|
84
|
+
) {
|
|
85
|
+
return <UITooltip ref={ref} className={tooltipStyle({ class: className })} {...props} />;
|
|
96
86
|
});
|
|
97
87
|
|
|
98
88
|
const TooltipContent = React.forwardRef<
|
|
@@ -115,13 +105,7 @@ const TooltipText = React.forwardRef<
|
|
|
115
105
|
React.ComponentRef<typeof UITooltip.Text>,
|
|
116
106
|
ITooltipTextProps & { className?: string }
|
|
117
107
|
>(function TooltipText({ size, className, ...props }, ref) {
|
|
118
|
-
return (
|
|
119
|
-
<UITooltip.Text
|
|
120
|
-
ref={ref}
|
|
121
|
-
className={tooltipTextStyle({ size, class: className })}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
108
|
+
return <UITooltip.Text ref={ref} className={tooltipTextStyle({ size, class: className })} {...props} />;
|
|
125
109
|
});
|
|
126
110
|
|
|
127
111
|
Tooltip.displayName = 'Tooltip';
|
|
@@ -4,24 +4,24 @@ import { View } from 'react-native';
|
|
|
4
4
|
|
|
5
5
|
import { vstackStyle } from './styles';
|
|
6
6
|
|
|
7
|
-
type IVStackProps = React.ComponentProps<typeof View> &
|
|
8
|
-
VariantProps<typeof vstackStyle>;
|
|
7
|
+
type IVStackProps = React.ComponentProps<typeof View> & VariantProps<typeof vstackStyle>;
|
|
9
8
|
|
|
10
|
-
const VStack = React.forwardRef<React.ComponentRef<typeof View>, IVStackProps>(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
9
|
+
const VStack = React.forwardRef<React.ComponentRef<typeof View>, IVStackProps>(function VStack(
|
|
10
|
+
{ className, space, reversed, ...props },
|
|
11
|
+
ref,
|
|
12
|
+
) {
|
|
13
|
+
return (
|
|
14
|
+
<View
|
|
15
|
+
className={vstackStyle({
|
|
16
|
+
space,
|
|
17
|
+
reversed: reversed as boolean,
|
|
18
|
+
class: className,
|
|
19
|
+
})}
|
|
20
|
+
{...props}
|
|
21
|
+
ref={ref}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
25
|
|
|
26
26
|
VStack.displayName = 'VStack';
|
|
27
27
|
|
|
@@ -3,24 +3,24 @@ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
|
3
3
|
|
|
4
4
|
import { vstackStyle } from './styles';
|
|
5
5
|
|
|
6
|
-
type IVStackProps = React.ComponentProps<'div'> &
|
|
7
|
-
VariantProps<typeof vstackStyle>;
|
|
6
|
+
type IVStackProps = React.ComponentProps<'div'> & VariantProps<typeof vstackStyle>;
|
|
8
7
|
|
|
9
|
-
const VStack = React.forwardRef<React.ComponentRef<'div'>, IVStackProps>(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
);
|
|
8
|
+
const VStack = React.forwardRef<React.ComponentRef<'div'>, IVStackProps>(function VStack(
|
|
9
|
+
{ className, space, reversed, ...props },
|
|
10
|
+
ref,
|
|
11
|
+
) {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
className={vstackStyle({
|
|
15
|
+
space,
|
|
16
|
+
reversed: reversed as boolean,
|
|
17
|
+
class: className,
|
|
18
|
+
})}
|
|
19
|
+
{...props}
|
|
20
|
+
ref={ref}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
24
|
|
|
25
25
|
VStack.displayName = 'VStack';
|
|
26
26
|
|
|
@@ -9,11 +9,11 @@ export const vstackStyle = tva({
|
|
|
9
9
|
base: `flex-col ${baseStyle}`,
|
|
10
10
|
variants: {
|
|
11
11
|
space: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
xs: 'gap-1',
|
|
13
|
+
sm: 'gap-2',
|
|
14
|
+
md: 'gap-3',
|
|
15
|
+
lg: 'gap-4',
|
|
16
|
+
xl: 'gap-5',
|
|
17
17
|
'2xl': 'gap-6',
|
|
18
18
|
'3xl': 'gap-7',
|
|
19
19
|
'4xl': 'gap-8',
|
package/design/tools/design.js
CHANGED
|
@@ -83,8 +83,7 @@ const TARGETS = {
|
|
|
83
83
|
},
|
|
84
84
|
doc: {
|
|
85
85
|
script: 'docgen.py',
|
|
86
|
-
args: ['--manifest', MANIFEST, '--documentation', DOCUMENTATION,
|
|
87
|
-
'--root', REPO_ROOT, '--out', DOCS_OUT],
|
|
86
|
+
args: ['--manifest', MANIFEST, '--documentation', DOCUMENTATION, '--root', REPO_ROOT, '--out', DOCS_OUT],
|
|
88
87
|
},
|
|
89
88
|
pipeline: {
|
|
90
89
|
script: null,
|
|
@@ -111,22 +110,23 @@ function findPython() {
|
|
|
111
110
|
if (REPO_ROOT !== DESIGN_DIR) venvDirs.push(path.join(REPO_ROOT, 'design', 'tools', '.venv'));
|
|
112
111
|
|
|
113
112
|
for (const dir of venvDirs) {
|
|
114
|
-
const candidates =
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
const candidates =
|
|
114
|
+
process.platform === 'win32'
|
|
115
|
+
? [path.join(dir, 'Scripts', 'python.exe')]
|
|
116
|
+
: [path.join(dir, 'bin', 'python3'), path.join(dir, 'bin', 'python')];
|
|
117
117
|
for (const candidate of candidates) {
|
|
118
118
|
if (fs.existsSync(candidate)) return candidate;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const pathExes = process.platform === 'win32'
|
|
123
|
-
? ['python.exe', 'python3.exe']
|
|
124
|
-
: ['python3', 'python'];
|
|
122
|
+
const pathExes = process.platform === 'win32' ? ['python.exe', 'python3.exe'] : ['python3', 'python'];
|
|
125
123
|
for (const exe of pathExes) {
|
|
126
124
|
try {
|
|
127
125
|
const probe = spawnSync(exe, ['-c', 'import lxml.etree'], { stdio: 'ignore' });
|
|
128
126
|
if (probe.status === 0) return exe;
|
|
129
|
-
} catch (_) {
|
|
127
|
+
} catch (_) {
|
|
128
|
+
/* not on PATH */
|
|
129
|
+
}
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
@@ -136,8 +136,10 @@ function main() {
|
|
|
136
136
|
const spec = TARGETS[target];
|
|
137
137
|
if (!spec) {
|
|
138
138
|
process.stderr.write(
|
|
139
|
-
'Unknown target: %s\nAvailable targets: %s\n'
|
|
140
|
-
.replace('%s',
|
|
139
|
+
'Unknown target: %s\nAvailable targets: %s\n'
|
|
140
|
+
.replace('%s', String(target))
|
|
141
|
+
.replace('%s', Object.keys(TARGETS).join(', ')),
|
|
142
|
+
);
|
|
141
143
|
process.exit(2);
|
|
142
144
|
}
|
|
143
145
|
|
|
@@ -170,7 +172,8 @@ function main() {
|
|
|
170
172
|
if (!python) {
|
|
171
173
|
process.stderr.write(
|
|
172
174
|
'No suitable Python found. Create the project venv or set FOUNDATION_PYTHON.\n' +
|
|
173
|
-
|
|
175
|
+
' C:/opt/Python38-32/python3.exe -m venv --without-pip --system-site-packages design/tools/.venv\n',
|
|
176
|
+
);
|
|
174
177
|
process.exit(2);
|
|
175
178
|
}
|
|
176
179
|
|
package/design/tools/npm.js
CHANGED
|
@@ -273,7 +273,7 @@ function adopt(force) {
|
|
|
273
273
|
process.stdout.write('\nNext steps:\n');
|
|
274
274
|
process.stdout.write(' 1. edit design/tokens.xml and design/themes.xml - that is now your design system\n');
|
|
275
275
|
process.stdout.write(' 2. npm run design:gen -> theme/config.ts + theme/tokens.js\n');
|
|
276
|
-
process.stdout.write(
|
|
276
|
+
process.stdout.write(" 3. tailwind.config.js -> require('./theme/tokens')\n");
|
|
277
277
|
process.stdout.write(' 4. wrap the app in <AppThemeProvider mode="system"> from ./theme/provider\n');
|
|
278
278
|
process.stdout.write(' 5. npm run design:verify -> the registries are in step with the artifacts\n');
|
|
279
279
|
}
|
|
@@ -335,10 +335,11 @@ function main() {
|
|
|
335
335
|
}
|
|
336
336
|
if (command === undefined) {
|
|
337
337
|
process.stderr.write(
|
|
338
|
-
'Usage: npx flipova-design <init|inject|adopt|where|gen|check|verify|canonical|lint|doc|edit|run|pipeline>\n'
|
|
338
|
+
'Usage: npx flipova-design <init|inject|adopt|where|gen|check|verify|canonical|lint|doc|edit|run|pipeline>\n',
|
|
339
|
+
);
|
|
339
340
|
process.exit(2);
|
|
340
341
|
}
|
|
341
342
|
runTool(command, args);
|
|
342
343
|
}
|
|
343
344
|
|
|
344
|
-
main();
|
|
345
|
+
main();
|